From f1a8053b38807d3d1e1c498128e9848dca3288ce Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 13:29:51 +0000 Subject: [PATCH 01/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/react/promise | 1 - 1 file changed, 1 deletion(-) delete mode 160000 upload/system/storage/vendor/react/promise diff --git a/upload/system/storage/vendor/react/promise b/upload/system/storage/vendor/react/promise deleted file mode 160000 index f4edc258161..00000000000 --- a/upload/system/storage/vendor/react/promise +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f4edc2581617431aea50430749db55cc3fc031b3 From 9eaa603001370fc427314cff58222bb5cc956677 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 13:31:50 +0000 Subject: [PATCH 02/39] Support for PHP 8.0 and 8.1 --- composer.json | 1 - composer.lock | 1001 ++- .../storage/vendor/composer/ClassLoader.php | 157 +- .../vendor/composer/InstalledVersions.php | 350 + .../vendor/composer/autoload_classmap.php | 7 + .../vendor/composer/autoload_files.php | 11 +- .../storage/vendor/composer/autoload_psr4.php | 15 +- .../storage/vendor/composer/autoload_real.php | 15 +- .../vendor/composer/autoload_static.php | 88 +- .../storage/vendor/composer/installed.json | 2518 ++++--- .../storage/vendor/composer/installed.php | 209 + .../vendor/composer/platform_check.php | 26 + .../storage/vendor/guzzlehttp/log-subscriber | 1 - .../vendor/guzzlehttp/promises/CHANGELOG.md | 103 + .../vendor/guzzlehttp/promises/LICENSE | 24 + .../vendor/guzzlehttp/promises/Makefile | 13 + .../vendor/guzzlehttp/promises/README.md | 547 ++ .../vendor/guzzlehttp/promises/composer.json | 58 + .../promises/src/AggregateException.php | 17 + .../promises/src/CancellationException.php | 10 + .../guzzlehttp/promises/src/Coroutine.php | 169 + .../vendor/guzzlehttp/promises/src/Create.php | 84 + .../vendor/guzzlehttp/promises/src/Each.php | 90 + .../guzzlehttp/promises/src/EachPromise.php | 255 + .../promises/src/FulfilledPromise.php | 84 + .../vendor/guzzlehttp/promises/src/Is.php | 46 + .../guzzlehttp/promises/src/Promise.php | 278 + .../promises/src/PromiseInterface.php | 97 + .../promises/src/PromisorInterface.php | 16 + .../promises/src/RejectedPromise.php | 91 + .../promises/src/RejectionException.php | 48 + .../guzzlehttp/promises/src/TaskQueue.php | 67 + .../promises/src/TaskQueueInterface.php | 24 + .../vendor/guzzlehttp/promises/src/Utils.php | 276 + .../guzzlehttp/promises/src/functions.php | 363 ++ .../promises/src/functions_include.php | 6 + .../guzzlehttp/psr7/.github/FUNDING.yml | 2 + .../vendor/guzzlehttp/psr7/.github/stale.yml | 14 + .../guzzlehttp/psr7/.github/workflows/ci.yml | 34 + .../psr7/.github/workflows/integration.yml | 37 + .../psr7/.github/workflows/static.yml | 29 + .../vendor/guzzlehttp/psr7/.php_cs.dist | 56 + .../vendor/guzzlehttp/psr7/CHANGELOG.md | 300 + .../storage/vendor/guzzlehttp/psr7/LICENSE | 26 + .../storage/vendor/guzzlehttp/psr7/README.md | 824 +++ .../vendor/guzzlehttp/psr7/composer.json | 73 + .../guzzlehttp/psr7/src/AppendStream.php | 246 + .../guzzlehttp/psr7/src/BufferStream.php | 142 + .../guzzlehttp/psr7/src/CachingStream.php | 147 + .../guzzlehttp/psr7/src/DroppingStream.php | 45 + .../vendor/guzzlehttp/psr7/src/FnStream.php | 163 + .../vendor/guzzlehttp/psr7/src/Header.php | 71 + .../guzzlehttp/psr7/src/InflateStream.php | 56 + .../guzzlehttp/psr7/src/LazyOpenStream.php | 42 + .../guzzlehttp/psr7/src/LimitStream.php | 157 + .../vendor/guzzlehttp/psr7/src/Message.php | 252 + .../guzzlehttp/psr7/src/MessageTrait.php | 214 + .../vendor/guzzlehttp/psr7/src/MimeType.php | 140 + .../guzzlehttp/psr7/src/MultipartStream.php | 158 + .../guzzlehttp/psr7/src/NoSeekStream.php | 25 + .../vendor/guzzlehttp/psr7/src/PumpStream.php | 170 + .../vendor/guzzlehttp/psr7/src/Query.php | 113 + .../vendor/guzzlehttp/psr7/src/Request.php | 152 + .../vendor/guzzlehttp/psr7/src/Response.php | 155 + .../vendor/guzzlehttp/psr7/src/Rfc7230.php | 19 + .../guzzlehttp/psr7/src/ServerRequest.php | 379 ++ .../vendor/guzzlehttp/psr7/src/Stream.php | 270 + .../psr7/src/StreamDecoratorTrait.php | 152 + .../guzzlehttp/psr7/src/StreamWrapper.php | 165 + .../guzzlehttp/psr7/src/UploadedFile.php | 328 + .../vendor/guzzlehttp/psr7/src/Uri.php | 810 +++ .../guzzlehttp/psr7/src/UriNormalizer.php | 219 + .../guzzlehttp/psr7/src/UriResolver.php | 222 + .../vendor/guzzlehttp/psr7/src/Utils.php | 428 ++ .../vendor/guzzlehttp/psr7/src/functions.php | 422 ++ .../guzzlehttp/psr7/src/functions_include.php | 6 + .../system/storage/vendor/guzzlehttp/ringphp | 1 - .../system/storage/vendor/guzzlehttp/streams | 1 - upload/system/storage/vendor/klarna/kco_rest | 1 - .../vendor/psr/http-message/CHANGELOG.md | 36 + .../storage/vendor/psr/http-message/LICENSE | 19 + .../storage/vendor/psr/http-message/README.md | 13 + .../vendor/psr/http-message/composer.json | 26 + .../psr/http-message/src/MessageInterface.php | 187 + .../psr/http-message/src/RequestInterface.php | 129 + .../http-message/src/ResponseInterface.php | 68 + .../src/ServerRequestInterface.php | 261 + .../psr/http-message/src/StreamInterface.php | 158 + .../src/UploadedFileInterface.php | 123 + .../psr/http-message/src/UriInterface.php | 323 + upload/system/storage/vendor/psr/log | 1 - .../vendor/ralouphie/getallheaders/LICENSE | 21 + .../vendor/ralouphie/getallheaders/README.md | 27 + .../ralouphie/getallheaders/composer.json | 26 + .../getallheaders/src/getallheaders.php | 46 + .../vendor/symfony/polyfill-ctype/Ctype.php | 53 +- .../symfony/polyfill-ctype/bootstrap.php | 4 + .../symfony/polyfill-ctype/bootstrap80.php | 46 + .../symfony/polyfill-ctype/composer.json | 7 +- .../vendor/symfony/polyfill-intl-idn/Idn.php | 925 +++ .../vendor/symfony/polyfill-intl-idn/Info.php | 23 + .../vendor/symfony/polyfill-intl-idn/LICENSE | 19 + .../symfony/polyfill-intl-idn/README.md | 12 + .../Resources/unidata/DisallowedRanges.php | 375 ++ .../Resources/unidata/Regex.php | 24 + .../Resources/unidata/deviation.php | 8 + .../Resources/unidata/disallowed.php | 2638 ++++++++ .../unidata/disallowed_STD3_mapped.php | 308 + .../unidata/disallowed_STD3_valid.php | 71 + .../Resources/unidata/ignored.php | 273 + .../Resources/unidata/mapped.php | 5778 +++++++++++++++++ .../Resources/unidata/virama.php | 65 + .../symfony/polyfill-intl-idn/bootstrap.php | 145 + .../symfony/polyfill-intl-idn/bootstrap80.php | 125 + .../symfony/polyfill-intl-idn/composer.json | 44 + .../symfony/polyfill-intl-normalizer/LICENSE | 19 + .../polyfill-intl-normalizer/Normalizer.php | 310 + .../polyfill-intl-normalizer/README.md | 14 + .../Resources/stubs/Normalizer.php | 17 + .../unidata/canonicalComposition.php | 945 +++ .../unidata/canonicalDecomposition.php | 2065 ++++++ .../Resources/unidata/combiningClass.php | 876 +++ .../unidata/compatibilityDecomposition.php | 3695 +++++++++++ .../polyfill-intl-normalizer/bootstrap.php | 23 + .../polyfill-intl-normalizer/bootstrap80.php | 19 + .../polyfill-intl-normalizer/composer.json | 39 + .../vendor/symfony/polyfill-php72/LICENSE | 19 + .../vendor/symfony/polyfill-php72/Php72.php | 217 + .../vendor/symfony/polyfill-php72/README.md | 28 + .../symfony/polyfill-php72/bootstrap.php | 57 + .../symfony/polyfill-php72/composer.json | 35 + .../vendor/symfony/polyfill-php80/LICENSE | 19 + .../vendor/symfony/polyfill-php80/Php80.php | 115 + .../symfony/polyfill-php80/PhpToken.php | 103 + .../vendor/symfony/polyfill-php80/README.md | 24 + .../Resources/stubs/Attribute.php | 22 + .../Resources/stubs/PhpToken.php | 7 + .../Resources/stubs/Stringable.php | 11 + .../Resources/stubs/UnhandledMatchError.php | 7 + .../Resources/stubs/ValueError.php | 7 + .../symfony/polyfill-php80/bootstrap.php | 42 + .../symfony/polyfill-php80/composer.json | 40 + .../system/storage/vendor/symfony/translation | 1 - .../symfony/translation-contracts/.gitignore | 3 + .../translation-contracts/CHANGELOG.md | 5 + .../symfony/translation-contracts/LICENSE | 19 + .../LocaleAwareInterface.php | 31 + .../symfony/translation-contracts/README.md | 9 + .../Test/TranslatorTest.php | 390 ++ .../TranslatableInterface.php | 20 + .../TranslatorInterface.php | 67 + .../translation-contracts/TranslatorTrait.php | 262 + .../translation-contracts/composer.json | 37 + .../storage/vendor/twig/twig/.gitattributes | 1 + .../vendor/twig/twig/.github/workflows/ci.yml | 173 + .../twig/.github/workflows/documentation.yml | 60 + .../{.php_cs.dist => .php-cs-fixer.dist.php} | 4 +- .../storage/vendor/twig/twig/.travis.yml | 50 - .../system/storage/vendor/twig/twig/CHANGELOG | 1216 +--- .../system/storage/vendor/twig/twig/LICENSE | 2 +- .../storage/vendor/twig/twig/README.rst | 3 +- .../storage/vendor/twig/twig/composer.json | 7 +- .../storage/vendor/twig/twig/doc/advanced.rst | 918 --- .../storage/vendor/twig/twig/doc/api.rst | 588 -- .../vendor/twig/twig/doc/coding_standards.rst | 101 - .../vendor/twig/twig/doc/deprecated.rst | 115 - .../vendor/twig/twig/doc/filters/abs.rst | 18 - .../vendor/twig/twig/doc/filters/batch.rst | 44 - .../twig/twig/doc/filters/capitalize.rst | 11 - .../vendor/twig/twig/doc/filters/column.rst | 27 - .../twig/doc/filters/convert_encoding.rst | 22 - .../twig/twig/doc/filters/country_name.rst | 42 - .../twig/twig/doc/filters/currency_name.rst | 45 - .../twig/twig/doc/filters/currency_symbol.rst | 45 - .../vendor/twig/twig/doc/filters/data_uri.rst | 51 - .../vendor/twig/twig/doc/filters/date.rst | 82 - .../twig/twig/doc/filters/date_modify.rst | 20 - .../vendor/twig/twig/doc/filters/default.rst | 42 - .../vendor/twig/twig/doc/filters/escape.rst | 119 - .../vendor/twig/twig/doc/filters/filter.rst | 58 - .../vendor/twig/twig/doc/filters/first.rst | 22 - .../vendor/twig/twig/doc/filters/format.rst | 16 - .../twig/twig/doc/filters/format_currency.rst | 75 - .../twig/twig/doc/filters/format_date.rst | 32 - .../twig/twig/doc/filters/format_datetime.rst | 68 - .../twig/twig/doc/filters/format_number.rst | 115 - .../twig/twig/doc/filters/format_time.rst | 32 - .../twig/doc/filters/html_to_markdown.rst | 66 - .../vendor/twig/twig/doc/filters/index.rst | 59 - .../twig/twig/doc/filters/inky_to_html.rst | 40 - .../twig/twig/doc/filters/inline_css.rst | 64 - .../vendor/twig/twig/doc/filters/join.rst | 35 - .../twig/twig/doc/filters/json_encode.rst | 23 - .../vendor/twig/twig/doc/filters/keys.rst | 11 - .../twig/twig/doc/filters/language_name.rst | 45 - .../vendor/twig/twig/doc/filters/last.rst | 22 - .../vendor/twig/twig/doc/filters/length.rst | 23 - .../twig/twig/doc/filters/locale_name.rst | 45 - .../vendor/twig/twig/doc/filters/lower.rst | 10 - .../vendor/twig/twig/doc/filters/map.rst | 37 - .../twig/doc/filters/markdown_to_html.rst | 65 - .../vendor/twig/twig/doc/filters/merge.rst | 48 - .../vendor/twig/twig/doc/filters/nl2br.rst | 19 - .../twig/twig/doc/filters/number_format.rst | 53 - .../vendor/twig/twig/doc/filters/raw.rst | 38 - .../vendor/twig/twig/doc/filters/reduce.rst | 32 - .../vendor/twig/twig/doc/filters/replace.rst | 25 - .../vendor/twig/twig/doc/filters/reverse.rst | 44 - .../vendor/twig/twig/doc/filters/round.rst | 34 - .../vendor/twig/twig/doc/filters/slice.rst | 68 - .../vendor/twig/twig/doc/filters/sort.rst | 45 - .../twig/twig/doc/filters/spaceless.rst | 65 - .../vendor/twig/twig/doc/filters/split.rst | 50 - .../twig/twig/doc/filters/striptags.rst | 29 - .../twig/twig/doc/filters/timezone_name.rst | 44 - .../vendor/twig/twig/doc/filters/title.rst | 11 - .../vendor/twig/twig/doc/filters/trim.rst | 39 - .../vendor/twig/twig/doc/filters/u.rst | 78 - .../vendor/twig/twig/doc/filters/upper.rst | 10 - .../twig/twig/doc/filters/url_encode.rst | 23 - .../twig/twig/doc/functions/attribute.rst | 23 - .../vendor/twig/twig/doc/functions/block.rst | 35 - .../twig/twig/doc/functions/constant.rst | 23 - .../twig/doc/functions/country_timezones.rst | 30 - .../vendor/twig/twig/doc/functions/cycle.rst | 28 - .../vendor/twig/twig/doc/functions/date.rst | 46 - .../vendor/twig/twig/doc/functions/dump.rst | 66 - .../twig/twig/doc/functions/html_classes.rst | 33 - .../twig/twig/doc/functions/include.rst | 77 - .../vendor/twig/twig/doc/functions/index.rst | 22 - .../vendor/twig/twig/doc/functions/max.rst | 17 - .../vendor/twig/twig/doc/functions/min.rst | 17 - .../vendor/twig/twig/doc/functions/parent.rst | 20 - .../vendor/twig/twig/doc/functions/random.rst | 30 - .../vendor/twig/twig/doc/functions/range.rst | 58 - .../vendor/twig/twig/doc/functions/source.rst | 26 - .../doc/functions/template_from_string.rst | 40 - .../storage/vendor/twig/twig/doc/index.rst | 19 - .../vendor/twig/twig/doc/installation.rst | 10 - .../vendor/twig/twig/doc/internals.rst | 140 - .../storage/vendor/twig/twig/doc/intro.rst | 70 - .../storage/vendor/twig/twig/doc/recipes.rst | 527 -- .../vendor/twig/twig/doc/tags/apply.rst | 23 - .../vendor/twig/twig/doc/tags/autoescape.rst | 61 - .../vendor/twig/twig/doc/tags/block.rst | 11 - .../vendor/twig/twig/doc/tags/deprecated.rst | 30 - .../storage/vendor/twig/twig/doc/tags/do.rst | 9 - .../vendor/twig/twig/doc/tags/embed.rst | 175 - .../vendor/twig/twig/doc/tags/extends.rst | 263 - .../vendor/twig/twig/doc/tags/filter.rst | 26 - .../vendor/twig/twig/doc/tags/flush.rst | 14 - .../storage/vendor/twig/twig/doc/tags/for.rst | 176 - .../vendor/twig/twig/doc/tags/from.rst | 6 - .../storage/vendor/twig/twig/doc/tags/if.rst | 79 - .../vendor/twig/twig/doc/tags/import.rst | 6 - .../vendor/twig/twig/doc/tags/include.rst | 111 - .../vendor/twig/twig/doc/tags/index.rst | 27 - .../vendor/twig/twig/doc/tags/macro.rst | 180 - .../vendor/twig/twig/doc/tags/sandbox.rst | 30 - .../storage/vendor/twig/twig/doc/tags/set.rst | 78 - .../vendor/twig/twig/doc/tags/spaceless.rst | 41 - .../storage/vendor/twig/twig/doc/tags/use.rst | 117 - .../vendor/twig/twig/doc/tags/verbatim.rst | 16 - .../vendor/twig/twig/doc/tags/with.rst | 41 - .../vendor/twig/twig/doc/templates.rst | 865 --- .../vendor/twig/twig/doc/tests/constant.rst | 19 - .../vendor/twig/twig/doc/tests/defined.rst | 30 - .../twig/twig/doc/tests/divisibleby.rst | 10 - .../vendor/twig/twig/doc/tests/empty.rst | 22 - .../vendor/twig/twig/doc/tests/even.rst | 10 - .../vendor/twig/twig/doc/tests/index.rst | 15 - .../vendor/twig/twig/doc/tests/iterable.rst | 16 - .../vendor/twig/twig/doc/tests/null.rst | 12 - .../vendor/twig/twig/doc/tests/odd.rst | 10 - .../vendor/twig/twig/doc/tests/sameas.rst | 11 - .../storage/vendor/twig/twig/drupal_test.sh | 50 - .../twig/twig/lib/Twig/BaseNodeVisitor.php | 4 +- .../twig/twig/lib/Twig/Cache/Filesystem.php | 4 +- .../vendor/twig/twig/lib/Twig/Cache/Null.php | 4 +- .../twig/twig/lib/Twig/CacheInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/Compiler.php | 4 +- .../twig/lib/Twig/ContainerRuntimeLoader.php | 4 +- .../vendor/twig/twig/lib/Twig/Environment.php | 4 +- .../vendor/twig/twig/lib/Twig/Error.php | 4 +- .../twig/twig/lib/Twig/Error/Loader.php | 4 +- .../twig/twig/lib/Twig/Error/Runtime.php | 4 +- .../twig/twig/lib/Twig/Error/Syntax.php | 4 +- .../twig/lib/Twig/ExistsLoaderInterface.php | 4 +- .../twig/twig/lib/Twig/ExpressionParser.php | 4 +- .../vendor/twig/twig/lib/Twig/Extension.php | 4 +- .../twig/twig/lib/Twig/Extension/Core.php | 4 +- .../twig/twig/lib/Twig/Extension/Debug.php | 4 +- .../twig/twig/lib/Twig/Extension/Escaper.php | 4 +- .../lib/Twig/Extension/GlobalsInterface.php | 4 +- .../Twig/Extension/InitRuntimeInterface.php | 4 +- .../twig/lib/Twig/Extension/Optimizer.php | 4 +- .../twig/twig/lib/Twig/Extension/Profiler.php | 4 +- .../twig/twig/lib/Twig/Extension/Sandbox.php | 4 +- .../twig/twig/lib/Twig/Extension/Staging.php | 4 +- .../twig/lib/Twig/Extension/StringLoader.php | 4 +- .../twig/twig/lib/Twig/ExtensionInterface.php | 4 +- .../twig/twig/lib/Twig/ExtensionSet.php | 4 +- .../twig/lib/Twig/FactoryRuntimeLoader.php | 4 +- .../Twig/FileExtensionEscapingStrategy.php | 4 +- .../vendor/twig/twig/lib/Twig/Filter.php | 4 +- .../vendor/twig/twig/lib/Twig/Function.php | 4 +- .../vendor/twig/twig/lib/Twig/Lexer.php | 4 +- .../twig/twig/lib/Twig/Loader/Array.php | 4 +- .../twig/twig/lib/Twig/Loader/Chain.php | 4 +- .../twig/twig/lib/Twig/Loader/Filesystem.php | 4 +- .../twig/twig/lib/Twig/LoaderInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/Markup.php | 4 +- .../vendor/twig/twig/lib/Twig/Node.php | 4 +- .../twig/twig/lib/Twig/Node/AutoEscape.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Block.php | 4 +- .../twig/lib/Twig/Node/BlockReference.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Body.php | 4 +- .../twig/twig/lib/Twig/Node/CheckSecurity.php | 4 +- .../twig/twig/lib/Twig/Node/Deprecated.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Do.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Embed.php | 4 +- .../twig/twig/lib/Twig/Node/Expression.php | 4 +- .../twig/lib/Twig/Node/Expression/Array.php | 4 +- .../lib/Twig/Node/Expression/AssignName.php | 4 +- .../twig/lib/Twig/Node/Expression/Binary.php | 4 +- .../lib/Twig/Node/Expression/Binary/Add.php | 4 +- .../lib/Twig/Node/Expression/Binary/And.php | 4 +- .../Node/Expression/Binary/BitwiseAnd.php | 4 +- .../Twig/Node/Expression/Binary/BitwiseOr.php | 4 +- .../Node/Expression/Binary/BitwiseXor.php | 4 +- .../Twig/Node/Expression/Binary/Concat.php | 4 +- .../lib/Twig/Node/Expression/Binary/Div.php | 4 +- .../Twig/Node/Expression/Binary/EndsWith.php | 4 +- .../lib/Twig/Node/Expression/Binary/Equal.php | 4 +- .../Twig/Node/Expression/Binary/FloorDiv.php | 4 +- .../Twig/Node/Expression/Binary/Greater.php | 4 +- .../Node/Expression/Binary/GreaterEqual.php | 4 +- .../lib/Twig/Node/Expression/Binary/In.php | 4 +- .../lib/Twig/Node/Expression/Binary/Less.php | 4 +- .../Twig/Node/Expression/Binary/LessEqual.php | 4 +- .../Twig/Node/Expression/Binary/Matches.php | 4 +- .../lib/Twig/Node/Expression/Binary/Mod.php | 4 +- .../lib/Twig/Node/Expression/Binary/Mul.php | 4 +- .../Twig/Node/Expression/Binary/NotEqual.php | 4 +- .../lib/Twig/Node/Expression/Binary/NotIn.php | 4 +- .../lib/Twig/Node/Expression/Binary/Or.php | 4 +- .../lib/Twig/Node/Expression/Binary/Power.php | 4 +- .../lib/Twig/Node/Expression/Binary/Range.php | 4 +- .../Node/Expression/Binary/StartsWith.php | 4 +- .../lib/Twig/Node/Expression/Binary/Sub.php | 4 +- .../Twig/Node/Expression/BlockReference.php | 4 +- .../twig/lib/Twig/Node/Expression/Call.php | 4 +- .../lib/Twig/Node/Expression/Conditional.php | 4 +- .../lib/Twig/Node/Expression/Constant.php | 4 +- .../twig/lib/Twig/Node/Expression/Filter.php | 4 +- .../Twig/Node/Expression/Filter/Default.php | 4 +- .../lib/Twig/Node/Expression/Function.php | 4 +- .../twig/lib/Twig/Node/Expression/GetAttr.php | 4 +- .../lib/Twig/Node/Expression/MethodCall.php | 4 +- .../twig/lib/Twig/Node/Expression/Name.php | 4 +- .../lib/Twig/Node/Expression/NullCoalesce.php | 4 +- .../twig/lib/Twig/Node/Expression/Parent.php | 4 +- .../lib/Twig/Node/Expression/TempName.php | 4 +- .../twig/lib/Twig/Node/Expression/Test.php | 4 +- .../Twig/Node/Expression/Test/Constant.php | 4 +- .../lib/Twig/Node/Expression/Test/Defined.php | 4 +- .../Twig/Node/Expression/Test/Divisibleby.php | 4 +- .../lib/Twig/Node/Expression/Test/Even.php | 4 +- .../lib/Twig/Node/Expression/Test/Null.php | 4 +- .../lib/Twig/Node/Expression/Test/Odd.php | 4 +- .../lib/Twig/Node/Expression/Test/Sameas.php | 4 +- .../twig/lib/Twig/Node/Expression/Unary.php | 4 +- .../lib/Twig/Node/Expression/Unary/Neg.php | 4 +- .../lib/Twig/Node/Expression/Unary/Not.php | 4 +- .../lib/Twig/Node/Expression/Unary/Pos.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Flush.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/For.php | 4 +- .../twig/twig/lib/Twig/Node/ForLoop.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/If.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Import.php | 4 +- .../twig/twig/lib/Twig/Node/Include.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Macro.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Module.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Print.php | 4 +- .../twig/twig/lib/Twig/Node/Sandbox.php | 4 +- .../twig/lib/Twig/Node/SandboxedPrint.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Set.php | 4 +- .../twig/twig/lib/Twig/Node/Spaceless.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/Text.php | 4 +- .../vendor/twig/twig/lib/Twig/Node/With.php | 4 +- .../twig/lib/Twig/NodeCaptureInterface.php | 4 +- .../twig/lib/Twig/NodeOutputInterface.php | 4 +- .../twig/twig/lib/Twig/NodeTraverser.php | 4 +- .../twig/lib/Twig/NodeVisitor/Escaper.php | 4 +- .../twig/lib/Twig/NodeVisitor/Optimizer.php | 4 +- .../lib/Twig/NodeVisitor/SafeAnalysis.php | 4 +- .../twig/lib/Twig/NodeVisitor/Sandbox.php | 4 +- .../twig/lib/Twig/NodeVisitorInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/Parser.php | 4 +- .../twig/lib/Twig/Profiler/Dumper/Base.php | 4 +- .../lib/Twig/Profiler/Dumper/Blackfire.php | 4 +- .../twig/lib/Twig/Profiler/Dumper/Html.php | 4 +- .../twig/lib/Twig/Profiler/Dumper/Text.php | 4 +- .../lib/Twig/Profiler/Node/EnterProfile.php | 4 +- .../lib/Twig/Profiler/Node/LeaveProfile.php | 4 +- .../Twig/Profiler/NodeVisitor/Profiler.php | 4 +- .../twig/twig/lib/Twig/Profiler/Profile.php | 4 +- .../twig/lib/Twig/RuntimeLoaderInterface.php | 4 +- .../twig/lib/Twig/Sandbox/SecurityError.php | 4 +- .../Sandbox/SecurityNotAllowedFilterError.php | 4 +- .../SecurityNotAllowedFunctionError.php | 4 +- .../Sandbox/SecurityNotAllowedMethodError.php | 4 +- .../SecurityNotAllowedPropertyError.php | 4 +- .../Sandbox/SecurityNotAllowedTagError.php | 4 +- .../twig/lib/Twig/Sandbox/SecurityPolicy.php | 4 +- .../Twig/Sandbox/SecurityPolicyInterface.php | 4 +- .../twig/twig/lib/Twig/SimpleFilter.php | 2 +- .../twig/twig/lib/Twig/SimpleFunction.php | 2 +- .../vendor/twig/twig/lib/Twig/SimpleTest.php | 2 +- .../vendor/twig/twig/lib/Twig/Source.php | 4 +- .../lib/Twig/SourceContextLoaderInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/Template.php | 4 +- .../twig/twig/lib/Twig/TemplateWrapper.php | 4 +- .../vendor/twig/twig/lib/Twig/Test.php | 4 +- .../lib/Twig/Test/IntegrationTestCase.php | 4 +- .../twig/twig/lib/Twig/Test/NodeTestCase.php | 4 +- .../vendor/twig/twig/lib/Twig/Token.php | 4 +- .../vendor/twig/twig/lib/Twig/TokenParser.php | 4 +- .../twig/lib/Twig/TokenParser/AutoEscape.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Block.php | 4 +- .../twig/lib/Twig/TokenParser/Deprecated.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Do.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Embed.php | 4 +- .../twig/lib/Twig/TokenParser/Extends.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Filter.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Flush.php | 4 +- .../twig/twig/lib/Twig/TokenParser/For.php | 4 +- .../twig/twig/lib/Twig/TokenParser/From.php | 4 +- .../twig/twig/lib/Twig/TokenParser/If.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Import.php | 4 +- .../twig/lib/Twig/TokenParser/Include.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Macro.php | 4 +- .../twig/lib/Twig/TokenParser/Sandbox.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Set.php | 4 +- .../twig/lib/Twig/TokenParser/Spaceless.php | 4 +- .../twig/twig/lib/Twig/TokenParser/Use.php | 4 +- .../twig/twig/lib/Twig/TokenParser/With.php | 4 +- .../twig/lib/Twig/TokenParserInterface.php | 4 +- .../vendor/twig/twig/lib/Twig/TokenStream.php | 4 +- .../lib/Twig/Util/DeprecationCollector.php | 4 +- .../lib/Twig/Util/TemplateDirIterator.php | 4 +- .../twig/twig/src/Cache/FilesystemCache.php | 6 +- .../storage/vendor/twig/twig/src/Compiler.php | 8 +- .../vendor/twig/twig/src/Environment.php | 43 +- .../vendor/twig/twig/src/Error/Error.php | 8 +- .../vendor/twig/twig/src/ExpressionParser.php | 30 +- .../twig/twig/src/Extension/CoreExtension.php | 190 +- .../twig/src/Extension/EscaperExtension.php | 25 +- .../src/FileExtensionEscapingStrategy.php | 2 +- .../storage/vendor/twig/twig/src/Lexer.php | 43 +- .../twig/twig/src/Loader/FilesystemLoader.php | 8 +- .../storage/vendor/twig/twig/src/Markup.php | 8 + .../twig/src/Node/CheckSecurityCallNode.php | 28 + .../twig/twig/src/Node/CheckSecurityNode.php | 13 +- .../src/Node/Expression/CallExpression.php | 11 +- .../twig/src/Node/Expression/Test/OddTest.php | 2 +- .../vendor/twig/twig/src/Node/MacroNode.php | 2 +- .../vendor/twig/twig/src/Node/ModuleNode.php | 2 +- .../vendor/twig/twig/src/Node/Node.php | 10 +- .../vendor/twig/twig/src/Node/SandboxNode.php | 7 + .../vendor/twig/twig/src/NodeTraverser.php | 2 +- .../src/NodeVisitor/OptimizerNodeVisitor.php | 10 +- .../src/NodeVisitor/SandboxNodeVisitor.php | 4 +- .../storage/vendor/twig/twig/src/Parser.php | 8 +- .../NodeVisitor/ProfilerNodeVisitor.php | 22 +- .../vendor/twig/twig/src/Profiler/Profile.php | 21 +- .../Sandbox/SecurityNotAllowedFilterError.php | 6 +- .../SecurityNotAllowedFunctionError.php | 6 +- .../Sandbox/SecurityNotAllowedMethodError.php | 6 +- .../SecurityNotAllowedPropertyError.php | 6 +- .../Sandbox/SecurityNotAllowedTagError.php | 6 +- .../storage/vendor/twig/twig/src/Template.php | 8 +- .../twig/src/Test/IntegrationTestCase.php | 8 +- .../storage/vendor/twig/twig/src/Token.php | 28 +- .../twig/src/TokenParser/ApplyTokenParser.php | 2 +- .../src/TokenParser/FilterTokenParser.php | 2 +- .../twig/src/TokenParser/ForTokenParser.php | 2 +- .../src/TokenParser/SpacelessTokenParser.php | 2 +- .../vendor/twig/twig/src/TwigFilter.php | 2 +- .../vendor/twig/twig/src/TwigFunction.php | 2 +- .../storage/vendor/twig/twig/src/TwigTest.php | 8 +- .../twig/src/Util/DeprecationCollector.php | 2 +- .../twig/src/Util/TemplateDirIterator.php | 8 + 493 files changed, 36073 insertions(+), 11166 deletions(-) create mode 100644 upload/system/storage/vendor/composer/InstalledVersions.php create mode 100644 upload/system/storage/vendor/composer/installed.php create mode 100644 upload/system/storage/vendor/composer/platform_check.php delete mode 160000 upload/system/storage/vendor/guzzlehttp/log-subscriber create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/LICENSE create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/Makefile create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/README.md create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/composer.json create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/CancellationException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Coroutine.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Create.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Each.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Is.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/PromisorInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/RejectedPromise.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Utils.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/functions.php create mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/FUNDING.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/stale.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/LICENSE create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/README.md create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/composer.json create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/PumpStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php create mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php delete mode 160000 upload/system/storage/vendor/guzzlehttp/ringphp delete mode 160000 upload/system/storage/vendor/guzzlehttp/streams delete mode 160000 upload/system/storage/vendor/klarna/kco_rest create mode 100644 upload/system/storage/vendor/psr/http-message/CHANGELOG.md create mode 100644 upload/system/storage/vendor/psr/http-message/LICENSE create mode 100644 upload/system/storage/vendor/psr/http-message/README.md create mode 100644 upload/system/storage/vendor/psr/http-message/composer.json create mode 100644 upload/system/storage/vendor/psr/http-message/src/MessageInterface.php create mode 100644 upload/system/storage/vendor/psr/http-message/src/RequestInterface.php create mode 100644 upload/system/storage/vendor/psr/http-message/src/ResponseInterface.php create mode 100644 upload/system/storage/vendor/psr/http-message/src/ServerRequestInterface.php create mode 100644 upload/system/storage/vendor/psr/http-message/src/StreamInterface.php create mode 100644 upload/system/storage/vendor/psr/http-message/src/UploadedFileInterface.php create mode 100644 upload/system/storage/vendor/psr/http-message/src/UriInterface.php delete mode 160000 upload/system/storage/vendor/psr/log create mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/LICENSE create mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/README.md create mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/composer.json create mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/deviation.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json create mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/LICENSE create mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/Php72.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/README.md create mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/composer.json create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/LICENSE create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Php80.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/README.md create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/composer.json delete mode 160000 upload/system/storage/vendor/symfony/translation create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/.gitignore create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/LICENSE create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/README.md create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php create mode 100644 upload/system/storage/vendor/symfony/translation-contracts/composer.json create mode 100644 upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml create mode 100644 upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml rename upload/system/storage/vendor/twig/twig/{.php_cs.dist => .php-cs-fixer.dist.php} (88%) delete mode 100644 upload/system/storage/vendor/twig/twig/.travis.yml delete mode 100644 upload/system/storage/vendor/twig/twig/doc/advanced.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/api.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/coding_standards.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/deprecated.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/abs.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/batch.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/capitalize.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/column.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/convert_encoding.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/country_name.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/currency_name.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/currency_symbol.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/data_uri.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/date.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/date_modify.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/default.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/escape.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/filter.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/first.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/format.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/format_currency.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/format_date.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/format_datetime.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/format_number.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/format_time.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/html_to_markdown.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/index.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/inky_to_html.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/inline_css.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/join.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/json_encode.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/keys.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/language_name.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/last.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/length.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/locale_name.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/lower.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/map.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/markdown_to_html.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/merge.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/nl2br.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/number_format.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/raw.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/reduce.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/replace.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/reverse.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/round.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/slice.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/sort.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/spaceless.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/split.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/striptags.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/timezone_name.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/title.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/trim.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/u.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/upper.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/filters/url_encode.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/attribute.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/block.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/constant.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/country_timezones.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/cycle.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/date.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/dump.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/html_classes.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/include.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/index.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/max.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/min.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/parent.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/random.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/range.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/source.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/functions/template_from_string.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/index.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/installation.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/internals.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/intro.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/recipes.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/apply.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/autoescape.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/block.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/deprecated.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/do.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/embed.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/extends.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/filter.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/flush.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/for.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/from.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/if.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/import.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/include.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/index.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/macro.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/sandbox.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/set.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/spaceless.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/use.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/verbatim.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tags/with.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/templates.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/constant.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/defined.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/divisibleby.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/empty.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/even.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/index.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/iterable.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/null.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/odd.rst delete mode 100644 upload/system/storage/vendor/twig/twig/doc/tests/sameas.rst delete mode 100644 upload/system/storage/vendor/twig/twig/drupal_test.sh create mode 100644 upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityCallNode.php diff --git a/composer.json b/composer.json index 5ec6adb808c..f0c18f0f82d 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,6 @@ "braintree/braintree_php" : "3.40.0", "cardinity/cardinity-sdk-php": "^1.0", "divido/divido-php": ">=1.1.1", - "klarna/kco_rest": "^2.2", "php": ">=5.4.0", "scssphp/scssphp": "1.1.1", "twig/twig": "^2.4.8", diff --git a/composer.lock b/composer.lock index 3703ebf0197..1245f44d0e5 100644 --- a/composer.lock +++ b/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": "b1c9faf639905985b9c722501eb89dc6", + "content-hash": "250646499513c930cfed79a457f63377", "packages": [ { "name": "braintree/braintree_php", @@ -34,7 +34,10 @@ "type": "library", "autoload": { "psr-0": { - "Braintree": "lib" + "Braintree": "lib/" + }, + "psr-4": { + "Braintree\\": "lib/Braintree" } }, "notification-url": "https://packagist.org/downloads/", @@ -44,32 +47,35 @@ "authors": [ { "name": "Braintree", - "homepage": "http://www.braintreepayments.com" + "homepage": "https://www.braintreepayments.com" } ], "description": "Braintree PHP Client Library", - "time": "2015-07-15T15:07:13+00:00" + "support": { + "issues": "https://github.com/braintree/braintree_php/issues", + "source": "https://github.com/braintree/braintree_php/tree/3.40.0" + }, + "time": "2019-03-28T23:16:53+00:00" }, { "name": "cardinity/cardinity-sdk-php", - "version": "v1.0.3", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/cardinity/cardinity-sdk-php.git", - "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c" + "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/f51f6fbacee393b4eeff7b80be2b1cee77896b4c", - "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c", + "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/b790656ee918b4686a6ee82b919ee74d2998c1c3", + "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "~5.1", - "guzzlehttp/log-subscriber": "~1.0", - "guzzlehttp/oauth-subscriber": "0.2.*", - "php": ">=5.4.0", - "symfony/validator": "~2.6" + "guzzlehttp/guzzle": "^6.2.1", + "guzzlehttp/oauth-subscriber": "0.3.*", + "php": ">=5.5.9", + "symfony/validator": "~3.0 || ~4.0" }, "require-dev": { "monolog/monolog": "~1.0", @@ -87,8 +93,12 @@ "MIT" ], "description": "Client library for Cardinity credit card processing API", - "homepage": "http://cardinity.com", - "time": "2016-12-29T09:57:23+00:00" + "homepage": "https://cardinity.com", + "support": { + "issues": "https://github.com/cardinity/cardinity-sdk-php/issues", + "source": "https://github.com/cardinity/cardinity-sdk-php/tree/master" + }, + "time": "2018-04-16T08:35:53+00:00" }, { "name": "divido/divido-php", @@ -137,29 +147,43 @@ }, { "name": "guzzlehttp/guzzle", - "version": "5.3.4", + "version": "6.5.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", "shasum": "" }, "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0", - "react/promise": "^2.2" + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { "GuzzleHttp\\": "src/" } @@ -175,7 +199,7 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "description": "Guzzle is a PHP HTTP client library", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -186,79 +210,29 @@ "rest", "web service" ], - "time": "2019-10-30T09:32:00+00:00" - }, - { - "name": "guzzlehttp/log-subscriber", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/log-subscriber.git", - "reference": "99c3c0004165db721d8ef7bbef60c996210e538a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/log-subscriber/zipball/99c3c0004165db721d8ef7bbef60c996210e538a", - "reference": "99c3c0004165db721d8ef7bbef60c996210e538a", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~4.0 | ~5.0", - "php": ">=5.4.0", - "psr/log": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/6.5" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Subscriber\\Log\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Logs HTTP requests and responses as they are sent over the wire (Guzzle 4+)", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "log", - "plugin" - ], - "abandoned": true, - "time": "2014-10-13T03:31:43+00:00" + "time": "2020-06-16T21:01:06+00:00" }, { "name": "guzzlehttp/oauth-subscriber", - "version": "0.2.0", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/oauth-subscriber.git", - "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5" + "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/03f1ebe31d3112526106d0570c80eba6820e86e5", - "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5", + "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", + "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "~4.0|~5.0", - "php": ">=5.4.0" + "guzzlehttp/guzzle": "~6.0", + "php": ">=5.5.0" }, "require-dev": { "phpunit/phpunit": "~4.0" @@ -266,7 +240,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.1-dev" + "dev-master": "0.3-dev" } }, "autoload": { @@ -291,43 +265,44 @@ "Guzzle", "oauth" ], - "time": "2014-10-23T22:19:02+00:00" + "support": { + "issues": "https://github.com/guzzle/oauth-subscriber/issues", + "source": "https://github.com/guzzle/oauth-subscriber/tree/master" + }, + "time": "2015-08-15T19:44:28+00:00" }, { - "name": "guzzlehttp/ringphp", - "version": "1.1.1", + "name": "guzzlehttp/promises", + "version": "1.5.1", "source": { "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" + "php": ">=5.5" }, "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.5-dev" } }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "GuzzleHttp\\Ring\\": "src/" + "GuzzleHttp\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -335,45 +310,92 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "abandoned": true, - "time": "2018-07-31T13:22:33+00:00" + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" }, { - "name": "guzzlehttp/streams", - "version": "3.0.0", + "name": "guzzlehttp/psr7", + "version": "1.8.3", "source": { "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" + "url": "https://github.com/guzzle/psr7.git", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.7-dev" } }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "GuzzleHttp\\Stream\\": "src/" + "GuzzleHttp\\Psr7\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -381,82 +403,80 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "Guzzle", - "stream" + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" ], - "abandoned": true, - "time": "2014-10-12T19:18:40+00:00" - }, - { - "name": "klarna/kco_rest", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/klarna/kco_rest_php.git", - "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/8a2142a2ebb087bb61901d51d1bb9698790e78c5", - "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5", - "shasum": "" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.8.3" }, - "require": { - "guzzlehttp/guzzle": ">=4.2,<6.0", - "php": ">=5.4.0" - }, - "require-dev": { - "apigen/apigen": "4.0.*", - "klarna/apigen-theme": "~1.0", - "phploc/phploc": "2.0.*", - "phpmd/phpmd": "2.1.*", - "phpunit/phpunit": "4.2.*", - "satooshi/php-coveralls": "0.6.*", - "sebastian/phpcpd": "2.0.*", - "squizlabs/php_codesniffer": "1.5.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, { - "name": "Klarna AB", - "email": "integration@klarna.com" + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" } ], - "description": "Klarna Checkout PHP SDK", - "homepage": "http://developers.klarna.com", - "abandoned": true, - "time": "2015-12-07T09:51:35+00:00" + "time": "2021-10-05T13:56:00+00:00" }, { - "name": "psr/log", - "version": "1.1.3", + "name": "psr/http-message", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { @@ -465,12 +485,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -483,42 +503,46 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ - "log", + "http", + "http-message", "psr", - "psr-3" + "psr-7", + "request", + "response" ], - "time": "2020-03-23T09:12:05+00:00" + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" }, { - "name": "react/promise", - "version": "v2.8.0", + "name": "ralouphie/getallheaders", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, "files": [ - "src/functions_include.php" + "src/getallheaders.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -527,16 +551,16 @@ ], "authors": [ { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" } ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "time": "2020-05-12T15:16:56+00:00" + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" }, { "name": "scssphp/scssphp", @@ -597,24 +621,31 @@ "scss", "stylesheet" ], + "support": { + "issues": "https://github.com/scssphp/scssphp/issues", + "source": "https://github.com/scssphp/scssphp/tree/1.1.1" + }, "time": "2020-06-04T17:30:40+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.18.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { "ext-ctype": "For best performance" @@ -622,7 +653,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -630,12 +661,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -659,6 +690,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -673,32 +707,34 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.18.0", + "name": "symfony/polyfill-intl-idn", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "749045c69efb97c70d25d7463abba812e91f3a44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", + "reference": "749045c69efb97c70d25d7463abba812e91f3a44", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -706,11 +742,99 @@ } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-14T14:02:44+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { "files": [ "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -727,6 +851,90 @@ "homepage": "https://symfony.com/contributors" } ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ @@ -736,6 +944,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -750,52 +961,120 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { - "name": "symfony/translation", - "version": "v3.0.9", + "name": "symfony/polyfill-php72", + "version": "v1.25.0", "source": { "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.1" }, - "conflict": { - "symfony/config": "<2.8" + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/intl": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "shasum": "" + }, + "require": { + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Translation\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -804,66 +1083,186 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Translation Component", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", - "time": "2016-07-30T07:22:48+00:00" + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-04T08:16:47+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-17T14:20:01+00:00" }, { "name": "symfony/validator", - "version": "v2.8.52", + "version": "v4.4.38", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a" + "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a", - "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "url": "https://api.github.com/repos/symfony/validator/zipball/71f994225b20f6fdc594d494df762f0ad8c34aca", + "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=7.1.3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation": "~2.4|~3.0.0" + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^1.1|^2" + }, + "conflict": { + "doctrine/lexer": "<1.1", + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<4.4", + "symfony/intl": "<4.3", + "symfony/translation": ">=5.0", + "symfony/yaml": "<3.4" }, "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "^1.2.1", - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", - "symfony/property-access": "~2.3|~3.0.0", - "symfony/yaml": "^2.0.5|~3.0.0" + "doctrine/annotations": "^1.10.4", + "doctrine/cache": "^1.0|^2.0", + "egulias/email-validator": "^2.1.10|^3", + "symfony/cache": "^3.4|^4.0|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-client": "^4.3|^5.0", + "symfony/http-foundation": "^4.1|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/intl": "^4.3|^5.0", + "symfony/mime": "^4.4|^5.0", + "symfony/property-access": "^3.4|^4.0|^5.0", + "symfony/property-info": "^3.4|^4.0|^5.0", + "symfony/translation": "^4.2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "doctrine/cache": "For using the default cached annotation reader.", "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the mapping cache.", "symfony/config": "", - "symfony/expression-language": "For using the 2.4 Expression validator", + "symfony/expression-language": "For using the Expression validator", "symfony/http-foundation": "", "symfony/intl": "", - "symfony/property-access": "For using the 2.4 Validator API", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/property-info": "To automatically add NotNull and Type constraints", + "symfony/translation": "For translating validation errors.", "symfony/yaml": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Validator\\": "" @@ -886,37 +1285,55 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Validator Component", + "description": "Provides tools to validate values", "homepage": "https://symfony.com", - "time": "2018-11-14T14:06:48+00:00" + "support": { + "source": "https://github.com/symfony/validator/tree/v4.4.38" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-02-24T08:44:54+00:00" }, { "name": "twig/twig", - "version": "v2.13.0", + "version": "v2.14.11", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911" + "reference": "66baa66f29ee30e487e05f1679903e36eb01d727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/46a612ba1bbf6ee1c58acabacd868212ff8a2911", - "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/66baa66f29ee30e487e05f1679903e36eb01d727", + "reference": "66baa66f29ee30e487e05f1679903e36eb01d727", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.8" }, "require-dev": { "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.13-dev" + "dev-master": "2.14-dev" } }, "autoload": { @@ -953,19 +1370,11 @@ "keywords": [ "templating" ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v2.14.11" + }, "funding": [ - { - "url": "https://certification.symfony.com/", - "type": "custom" - }, - { - "url": "https://live.symfony.com/", - "type": "custom" - }, - { - "url": "https://symfony.com/cloud/", - "type": "custom" - }, { "url": "https://github.com/fabpot", "type": "github" @@ -975,7 +1384,7 @@ "type": "tidelift" } ], - "time": "2020-07-05T13:08:05+00:00" + "time": "2022-02-04T06:57:25+00:00" }, { "name": "zoujingli/wechat-php-sdk", @@ -1012,6 +1421,10 @@ "keywords": [ "wechat-php-sdk" ], + "support": { + "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", + "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" + }, "time": "2019-10-10T09:42:15+00:00" } ], @@ -1025,5 +1438,5 @@ "php": ">=5.4.0" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.2.0" } diff --git a/upload/system/storage/vendor/composer/ClassLoader.php b/upload/system/storage/vendor/composer/ClassLoader.php index fce8549f078..afef3fa2ad8 100644 --- a/upload/system/storage/vendor/composer/ClassLoader.php +++ b/upload/system/storage/vendor/composer/ClassLoader.php @@ -37,57 +37,130 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + /** @var ?string */ + private $vendorDir; + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,9 +175,11 @@ 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 array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -147,11 +222,13 @@ 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 array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @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 * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -195,8 +272,10 @@ 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 array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +290,12 @@ 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 array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +315,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +339,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +361,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,25 +383,44 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { @@ -323,6 +429,8 @@ public function loadClass($class) return true; } + + return null; } /** @@ -367,6 +475,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -438,6 +561,10 @@ private function findFileWithExtension($class, $ext) * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/upload/system/storage/vendor/composer/InstalledVersions.php b/upload/system/storage/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000000..d50e0c9fcc4 --- /dev/null +++ b/upload/system/storage/vendor/composer/InstalledVersions.php @@ -0,0 +1,350 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + */ +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 + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + 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 false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @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} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // 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 = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @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 + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + 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'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // 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'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/upload/system/storage/vendor/composer/autoload_classmap.php b/upload/system/storage/vendor/composer/autoload_classmap.php index b9461a63714..ea10880dd2f 100644 --- a/upload/system/storage/vendor/composer/autoload_classmap.php +++ b/upload/system/storage/vendor/composer/autoload_classmap.php @@ -6,4 +6,11 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( + 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_files.php b/upload/system/storage/vendor/composer/autoload_files.php index e4a930d222e..56f63ce0664 100644 --- a/upload/system/storage/vendor/composer/autoload_files.php +++ b/upload/system/storage/vendor/composer/autoload_files.php @@ -6,7 +6,14 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', + 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index fbaa4473532..3f34da9ad04 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -8,18 +8,19 @@ return array( 'Wechat\\' => array($vendorDir . '/zoujingli/wechat-php-sdk/Wechat'), 'Twig\\' => array($vendorDir . '/twig/twig/src'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), + 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), + 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'), 'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'), - 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), 'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'), - 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'GuzzleHttp\\Subscriber\\Oauth\\' => array($vendorDir . '/guzzlehttp/oauth-subscriber/src'), - 'GuzzleHttp\\Subscriber\\Log\\' => array($vendorDir . '/guzzlehttp/log-subscriber/src'), - 'GuzzleHttp\\Stream\\' => array($vendorDir . '/guzzlehttp/streams/src'), - 'GuzzleHttp\\Ring\\' => array($vendorDir . '/guzzlehttp/ringphp/src'), + 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), + 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Cardinity\\' => array($vendorDir . '/cardinity/cardinity-sdk-php/src'), - '' => array($vendorDir . '/klarna/kco_rest/src'), ); diff --git a/upload/system/storage/vendor/composer/autoload_real.php b/upload/system/storage/vendor/composer/autoload_real.php index 4bdcde48e43..3caebdf2ffa 100644 --- a/upload/system/storage/vendor/composer/autoload_real.php +++ b/upload/system/storage/vendor/composer/autoload_real.php @@ -22,13 +22,15 @@ public static function getLoader() return self::$loader; } + require __DIR__ . '/platform_check.php'; + spl_autoload_register(array('ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); spl_autoload_unregister(array('ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::getInitializer($loader)); } else { @@ -63,11 +65,16 @@ public static function getLoader() } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequirea8cb75283b86ff94542c6f1327c4ce59($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index d105a184097..e5cc2988e82 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -7,9 +7,16 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 { public static $files = array ( - 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', + 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( @@ -23,26 +30,25 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ), 'S' => array ( + 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Polyfill\\Php72\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, + 'Symfony\\Polyfill\\Intl\\Idn\\' => 26, 'Symfony\\Polyfill\\Ctype\\' => 23, + 'Symfony\\Contracts\\Translation\\' => 30, 'Symfony\\Component\\Validator\\' => 28, - 'Symfony\\Component\\Translation\\' => 30, 'ScssPhp\\ScssPhp\\' => 16, ), - 'R' => - array ( - 'React\\Promise\\' => 14, - ), 'P' => array ( - 'Psr\\Log\\' => 8, + 'Psr\\Http\\Message\\' => 17, ), 'G' => array ( 'GuzzleHttp\\Subscriber\\Oauth\\' => 28, - 'GuzzleHttp\\Subscriber\\Log\\' => 26, - 'GuzzleHttp\\Stream\\' => 18, - 'GuzzleHttp\\Ring\\' => 16, + 'GuzzleHttp\\Psr7\\' => 16, + 'GuzzleHttp\\Promise\\' => 19, 'GuzzleHttp\\' => 11, ), 'C' => @@ -60,49 +66,57 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/twig/twig/src', ), + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), + 'Symfony\\Polyfill\\Php72\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', + ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', + ), + 'Symfony\\Polyfill\\Intl\\Idn\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn', + ), 'Symfony\\Polyfill\\Ctype\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', ), - 'Symfony\\Component\\Validator\\' => + 'Symfony\\Contracts\\Translation\\' => array ( - 0 => __DIR__ . '/..' . '/symfony/validator', + 0 => __DIR__ . '/..' . '/symfony/translation-contracts', ), - 'Symfony\\Component\\Translation\\' => + 'Symfony\\Component\\Validator\\' => array ( - 0 => __DIR__ . '/..' . '/symfony/translation', + 0 => __DIR__ . '/..' . '/symfony/validator', ), 'ScssPhp\\ScssPhp\\' => array ( 0 => __DIR__ . '/..' . '/scssphp/scssphp/src', ), - 'React\\Promise\\' => - array ( - 0 => __DIR__ . '/..' . '/react/promise/src', - ), - 'Psr\\Log\\' => + 'Psr\\Http\\Message\\' => array ( - 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', + 0 => __DIR__ . '/..' . '/psr/http-message/src', ), 'GuzzleHttp\\Subscriber\\Oauth\\' => array ( 0 => __DIR__ . '/..' . '/guzzlehttp/oauth-subscriber/src', ), - 'GuzzleHttp\\Subscriber\\Log\\' => + 'GuzzleHttp\\Psr7\\' => array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/log-subscriber/src', + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', ), - 'GuzzleHttp\\Stream\\' => + 'GuzzleHttp\\Promise\\' => array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/streams/src', - ), - 'GuzzleHttp\\Ring\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/ringphp/src', + 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', ), 'GuzzleHttp\\' => array ( @@ -114,10 +128,6 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ), ); - public static $fallbackDirsPsr4 = array ( - 0 => __DIR__ . '/..' . '/klarna/kco_rest/src', - ); - public static $prefixesPsr0 = array ( 'T' => array ( @@ -142,13 +152,23 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ), ); + public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', + ); + public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixDirsPsr4; - $loader->fallbackDirsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$fallbackDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixesPsr0; + $loader->classMap = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$classMap; }, null, ClassLoader::class); } diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 16b586b5bb1..783747bf5a3 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1,1046 +1,1472 @@ -[ - { - "name": "braintree/braintree_php", - "version": "3.40.0", - "version_normalized": "3.40.0.0", - "source": { - "type": "git", - "url": "https://github.com/braintree/braintree_php.git", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-dom": "*", - "ext-hash": "*", - "ext-openssl": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*" - }, - "time": "2015-07-15T15:07:13+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Braintree": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Braintree", - "homepage": "http://www.braintreepayments.com" - } - ], - "description": "Braintree PHP Client Library" - }, - { - "name": "cardinity/cardinity-sdk-php", - "version": "v1.0.3", - "version_normalized": "1.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/cardinity/cardinity-sdk-php.git", - "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/f51f6fbacee393b4eeff7b80be2b1cee77896b4c", - "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~5.1", - "guzzlehttp/log-subscriber": "~1.0", - "guzzlehttp/oauth-subscriber": "0.2.*", - "php": ">=5.4.0", - "symfony/validator": "~2.6" - }, - "require-dev": { - "monolog/monolog": "~1.0", - "phpspec/phpspec": "~2.1", - "phpunit/phpunit": "~4.3" - }, - "time": "2016-12-29T09:57:23+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Cardinity\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Client library for Cardinity credit card processing API", - "homepage": "http://cardinity.com" - }, - { - "name": "divido/divido-php", - "version": "v1.15-stable", - "version_normalized": "1.15.0.0", - "source": { - "type": "git", - "url": "git@github.com:DividoFinancialServices/divido-api-php.git", - "reference": "8edd902ec2be8151331985021107031292b41ca1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/DividoFinancialServices/divido-api-php/zipball/8edd902ec2be8151331985021107031292b41ca1", - "reference": "8edd902ec2be8151331985021107031292b41ca1", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.2.0" - }, - "time": "2018-01-21T15:38:57+00:00", - "type": "library", - "extra": { - "branch-alias": { - "master": "2.0-dev", - "v1.1.1": "1.1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Divido": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Divido PHP library", - "homepage": "https://www.divido.com/", - "keywords": [ - "api", - "divido", - "finance", - "instalments", - "payment processing" - ] - }, - { - "name": "guzzlehttp/guzzle", - "version": "5.3.4", - "version_normalized": "5.3.4.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0", - "react/promise": "^2.2" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0" - }, - "time": "2019-10-30T09:32:00+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] - }, - { - "name": "guzzlehttp/log-subscriber", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/log-subscriber.git", - "reference": "99c3c0004165db721d8ef7bbef60c996210e538a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/log-subscriber/zipball/99c3c0004165db721d8ef7bbef60c996210e538a", - "reference": "99c3c0004165db721d8ef7bbef60c996210e538a", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~4.0 | ~5.0", - "php": ">=5.4.0", - "psr/log": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2014-10-13T03:31:43+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Subscriber\\Log\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Logs HTTP requests and responses as they are sent over the wire (Guzzle 4+)", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "log", - "plugin" - ], - "abandoned": true - }, - { - "name": "guzzlehttp/oauth-subscriber", - "version": "0.2.0", - "version_normalized": "0.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/oauth-subscriber.git", - "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/03f1ebe31d3112526106d0570c80eba6820e86e5", - "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~4.0|~5.0", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2014-10-23T22:19:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Subscriber\\Oauth\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle OAuth 1.0 subscriber", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "oauth" - ] - }, - { - "name": "guzzlehttp/ringphp", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", - "shasum": "" - }, - "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "time": "2018-07-31T13:22:33+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "abandoned": true - }, - { - "name": "guzzlehttp/streams", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2014-10-12T19:18:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "abandoned": true - }, - { - "name": "klarna/kco_rest", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/klarna/kco_rest_php.git", - "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/8a2142a2ebb087bb61901d51d1bb9698790e78c5", - "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": ">=4.2,<6.0", - "php": ">=5.4.0" - }, - "require-dev": { - "apigen/apigen": "4.0.*", - "klarna/apigen-theme": "~1.0", - "phploc/phploc": "2.0.*", - "phpmd/phpmd": "2.1.*", - "phpunit/phpunit": "4.2.*", - "satooshi/php-coveralls": "0.6.*", - "sebastian/phpcpd": "2.0.*", - "squizlabs/php_codesniffer": "1.5.*" - }, - "time": "2015-12-07T09:51:35+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Klarna AB", - "email": "integration@klarna.com" - } - ], - "description": "Klarna Checkout PHP SDK", - "homepage": "http://developers.klarna.com", - "abandoned": true - }, - { - "name": "psr/log", - "version": "1.1.3", - "version_normalized": "1.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2020-03-23T09:12:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { - "name": "react/promise", - "version": "v2.8.0", - "version_normalized": "2.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" - }, - "time": "2020-05-12T15:16:56+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ] - }, - { - "name": "scssphp/scssphp", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/scssphp/scssphp.git", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/824e4cec10b2bfa88eec5dac23991cb9106622c1", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", - "squizlabs/php_codesniffer": "~3.5", - "twbs/bootstrap": "~4.3", - "zurb/foundation": "~6.5" - }, - "time": "2020-06-04T17:30:40+00:00", - "bin": [ - "bin/pscss" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ScssPhp\\ScssPhp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "homepage": "https://github.com/robocoder" - }, - { - "name": "Cédric Morin", - "email": "cedric@yterium.com", - "homepage": "https://github.com/Cerdic" - } - ], - "description": "scssphp is a compiler for SCSS written in PHP.", - "homepage": "http://scssphp.github.io/scssphp/", - "keywords": [ - "css", - "less", - "sass", - "scss", - "stylesheet" - ] - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.18.0", - "version_normalized": "1.18.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2020-07-14T12:35:20+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.18.0", - "version_normalized": "1.18.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2020-07-14T12:35:20+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/translation", - "version": "v3.0.9", - "version_normalized": "3.0.9.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.8" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/intl": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2016-07-30T07:22:48+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/validator", - "version": "v2.8.52", - "version_normalized": "2.8.52.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a", - "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation": "~2.4|~3.0.0" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "^1.2.1", - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", - "symfony/property-access": "~2.3|~3.0.0", - "symfony/yaml": "^2.0.5|~3.0.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "egulias/email-validator": "Strict (RFC compliant) email validation", - "symfony/config": "", - "symfony/expression-language": "For using the 2.4 Expression validator", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For using the 2.4 Validator API", - "symfony/yaml": "" - }, - "time": "2018-11-14T14:06:48+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Validator Component", - "homepage": "https://symfony.com" - }, - { - "name": "twig/twig", - "version": "v2.13.0", - "version_normalized": "2.13.0.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/46a612ba1bbf6ee1c58acabacd868212ff8a2911", - "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" - }, - "time": "2020-07-05T13:08:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.13-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - }, - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "funding": [ - { - "url": "https://certification.symfony.com/", - "type": "custom" - }, - { - "url": "https://live.symfony.com/", - "type": "custom" - }, - { - "url": "https://symfony.com/cloud/", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/twig/twig", - "type": "tidelift" - } - ] - }, - { - "name": "zoujingli/wechat-php-sdk", - "version": "v1.3.18", - "version_normalized": "1.3.18.0", - "source": { - "type": "git", - "url": "https://github.com/zoujingli/wechat-php-sdk.git", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-libxml": "*", - "ext-simplexml": "*", - "php": ">=5.3.3" - }, - "time": "2019-10-10T09:42:15+00:00", - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Wechat\\": "./Wechat" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "WeChat development of SDK", - "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", - "keywords": [ - "wechat-php-sdk" - ] - } -] +{ + "packages": [ + { + "name": "braintree/braintree_php", + "version": "3.40.0", + "version_normalized": "3.40.0.0", + "source": { + "type": "git", + "url": "https://github.com/braintree/braintree_php.git", + "reference": "840fc6ebf8d96756fed475cce94565fef178187d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", + "reference": "840fc6ebf8d96756fed475cce94565fef178187d", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-dom": "*", + "ext-hash": "*", + "ext-openssl": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, + "time": "2015-07-15T15:07:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Braintree": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Braintree", + "homepage": "http://www.braintreepayments.com" + } + ], + "description": "Braintree PHP Client Library", + "install-path": "../braintree/braintree_php" + }, + { + "name": "cardinity/cardinity-sdk-php", + "version": "v1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/cardinity/cardinity-sdk-php.git", + "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/b790656ee918b4686a6ee82b919ee74d2998c1c3", + "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.2.1", + "guzzlehttp/oauth-subscriber": "0.3.*", + "php": ">=5.5.9", + "symfony/validator": "~3.0 || ~4.0" + }, + "require-dev": { + "monolog/monolog": "~1.0", + "phpspec/phpspec": "~2.1", + "phpunit/phpunit": "~4.3" + }, + "time": "2018-04-16T08:35:53+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Cardinity\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Client library for Cardinity credit card processing API", + "homepage": "https://cardinity.com", + "support": { + "issues": "https://github.com/cardinity/cardinity-sdk-php/issues", + "source": "https://github.com/cardinity/cardinity-sdk-php/tree/master" + }, + "install-path": "../cardinity/cardinity-sdk-php" + }, + { + "name": "divido/divido-php", + "version": "v1.15-stable", + "version_normalized": "1.15.0.0", + "source": { + "type": "git", + "url": "git@github.com:DividoFinancialServices/divido-api-php.git", + "reference": "8edd902ec2be8151331985021107031292b41ca1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DividoFinancialServices/divido-api-php/zipball/8edd902ec2be8151331985021107031292b41ca1", + "reference": "8edd902ec2be8151331985021107031292b41ca1", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.2.0" + }, + "time": "2018-01-21T15:38:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "master": "2.0-dev", + "v1.1.1": "1.1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Divido": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Divido PHP library", + "homepage": "https://www.divido.com/", + "keywords": [ + "api", + "divido", + "finance", + "instalments", + "payment processing" + ], + "install-path": "../divido/divido-php" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.5.5", + "version_normalized": "6.5.5.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "time": "2020-06-16T21:01:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/6.5" + }, + "install-path": "../guzzlehttp/guzzle" + }, + { + "name": "guzzlehttp/oauth-subscriber", + "version": "0.3.0", + "version_normalized": "0.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/oauth-subscriber.git", + "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", + "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6.0", + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2015-08-15T19:44:28+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Subscriber\\Oauth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle OAuth 1.0 subscriber", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "oauth" + ], + "support": { + "issues": "https://github.com/guzzle/oauth-subscriber/issues", + "source": "https://github.com/guzzle/oauth-subscriber/tree/master" + }, + "install-path": "../guzzlehttp/oauth-subscriber" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "version_normalized": "1.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "time": "2021-10-22T20:56:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/promises" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.8.3", + "version_normalized": "1.8.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2021-10-05T13:56:00+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.8.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/psr7" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-08-06T14:39:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "install-path": "../psr/http-message" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "time": "2019-03-08T08:55:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "install-path": "../ralouphie/getallheaders" + }, + { + "name": "scssphp/scssphp", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/scssphp/scssphp.git", + "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/scssphp/scssphp/zipball/824e4cec10b2bfa88eec5dac23991cb9106622c1", + "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", + "squizlabs/php_codesniffer": "~3.5", + "twbs/bootstrap": "~4.3", + "zurb/foundation": "~6.5" + }, + "time": "2020-06-04T17:30:40+00:00", + "bin": [ + "bin/pscss" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "ScssPhp\\ScssPhp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "homepage": "https://github.com/robocoder" + }, + { + "name": "Cédric Morin", + "email": "cedric@yterium.com", + "homepage": "https://github.com/Cerdic" + } + ], + "description": "scssphp is a compiler for SCSS written in PHP.", + "homepage": "http://scssphp.github.io/scssphp/", + "keywords": [ + "css", + "less", + "sass", + "scss", + "stylesheet" + ], + "install-path": "../scssphp/scssphp" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2021-10-20T20:35:02+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-ctype" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "749045c69efb97c70d25d7463abba812e91f3a44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", + "reference": "749045c69efb97c70d25d7463abba812e91f3a44", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2021-09-14T14:02:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-intl-idn" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2021-02-19T12:13:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-intl-normalizer" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2021-11-30T18:21:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-05-27T09:17:38+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php72" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2022-03-04T08:16:47+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.5.0", + "version_normalized": "2.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "time": "2021-08-17T14:20:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/translation-contracts" + }, + { + "name": "symfony/validator", + "version": "v4.4.38", + "version_normalized": "4.4.38.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/71f994225b20f6fdc594d494df762f0ad8c34aca", + "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^1.1|^2" + }, + "conflict": { + "doctrine/lexer": "<1.1", + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<4.4", + "symfony/intl": "<4.3", + "symfony/translation": ">=5.0", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "^1.10.4", + "doctrine/cache": "^1.0|^2.0", + "egulias/email-validator": "^2.1.10|^3", + "symfony/cache": "^3.4|^4.0|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-client": "^4.3|^5.0", + "symfony/http-foundation": "^4.1|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/intl": "^4.3|^5.0", + "symfony/mime": "^4.4|^5.0", + "symfony/property-access": "^3.4|^4.0|^5.0", + "symfony/property-info": "^3.4|^4.0|^5.0", + "symfony/translation": "^4.2", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the mapping cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/property-info": "To automatically add NotNull and Type constraints", + "symfony/translation": "For translating validation errors.", + "symfony/yaml": "" + }, + "time": "2022-02-24T08:44:54+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to validate values", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/validator/tree/v4.4.38" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/validator" + }, + { + "name": "twig/twig", + "version": "v2.14.11", + "version_normalized": "2.14.11.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "66baa66f29ee30e487e05f1679903e36eb01d727" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/66baa66f29ee30e487e05f1679903e36eb01d727", + "reference": "66baa66f29ee30e487e05f1679903e36eb01d727", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.8" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + }, + "time": "2022-02-04T06:57:25+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.14-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v2.14.11" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "install-path": "../twig/twig" + }, + { + "name": "zoujingli/wechat-php-sdk", + "version": "v1.3.18", + "version_normalized": "1.3.18.0", + "source": { + "type": "git", + "url": "https://github.com/zoujingli/wechat-php-sdk.git", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "time": "2019-10-10T09:42:15+00:00", + "type": "project", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WeChat development of SDK", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "keywords": [ + "wechat-php-sdk" + ], + "install-path": "../zoujingli/wechat-php-sdk" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php new file mode 100644 index 00000000000..62287f14880 --- /dev/null +++ b/upload/system/storage/vendor/composer/installed.php @@ -0,0 +1,209 @@ + array( + 'pretty_version' => 'dev-3.0.x.x_Maintenance', + 'version' => 'dev-3.0.x.x_Maintenance', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../../../../', + 'aliases' => array(), + 'reference' => '58e1d302e465df7215c4464d8e95f47edbc15682', + 'name' => 'opencart/opencart', + 'dev' => true, + ), + 'versions' => array( + 'braintree/braintree_php' => array( + 'pretty_version' => '3.40.0', + 'version' => '3.40.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../braintree/braintree_php', + 'aliases' => array(), + 'reference' => '840fc6ebf8d96756fed475cce94565fef178187d', + 'dev_requirement' => false, + ), + 'cardinity/cardinity-sdk-php' => array( + 'pretty_version' => 'v1.1.1', + 'version' => '1.1.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../cardinity/cardinity-sdk-php', + 'aliases' => array(), + 'reference' => 'b790656ee918b4686a6ee82b919ee74d2998c1c3', + 'dev_requirement' => false, + ), + 'divido/divido-php' => array( + 'pretty_version' => 'v1.15-stable', + 'version' => '1.15.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../divido/divido-php', + 'aliases' => array(), + 'reference' => '8edd902ec2be8151331985021107031292b41ca1', + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '6.5.5', + 'version' => '6.5.5.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'reference' => '9d4290de1cfd701f38099ef7e183b64b4b7b0c5e', + 'dev_requirement' => false, + ), + 'guzzlehttp/oauth-subscriber' => array( + 'pretty_version' => '0.3.0', + 'version' => '0.3.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/oauth-subscriber', + 'aliases' => array(), + 'reference' => '04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf', + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '1.8.3', + 'version' => '1.8.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'reference' => '1afdd860a2566ed3c2b0b4a3de6e23434a79ec85', + 'dev_requirement' => false, + ), + 'opencart/opencart' => array( + 'pretty_version' => 'dev-3.0.x.x_Maintenance', + 'version' => 'dev-3.0.x.x_Maintenance', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../../../../', + 'aliases' => array(), + 'reference' => '58e1d302e465df7215c4464d8e95f47edbc15682', + 'dev_requirement' => false, + ), + 'psr/http-message' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-message', + 'aliases' => array(), + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + 'dev_requirement' => false, + ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'dev_requirement' => false, + ), + 'scssphp/scssphp' => array( + 'pretty_version' => '1.1.1', + 'version' => '1.1.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../scssphp/scssphp', + 'aliases' => array(), + 'reference' => '824e4cec10b2bfa88eec5dac23991cb9106622c1', + 'dev_requirement' => false, + ), + 'symfony/polyfill-ctype' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', + 'aliases' => array(), + 'reference' => '30885182c981ab175d4d034db0f6f469898070ab', + 'dev_requirement' => false, + ), + 'symfony/polyfill-intl-idn' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', + 'aliases' => array(), + 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44', + 'dev_requirement' => false, + ), + 'symfony/polyfill-intl-normalizer' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', + 'aliases' => array(), + 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php72' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php72', + 'aliases' => array(), + 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', + 'dev_requirement' => false, + ), + 'symfony/translation-contracts' => array( + 'pretty_version' => 'v2.5.0', + 'version' => '2.5.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/translation-contracts', + 'aliases' => array(), + 'reference' => 'd28150f0f44ce854e942b671fc2620a98aae1b1e', + 'dev_requirement' => false, + ), + 'symfony/validator' => array( + 'pretty_version' => 'v4.4.38', + 'version' => '4.4.38.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/validator', + 'aliases' => array(), + 'reference' => '71f994225b20f6fdc594d494df762f0ad8c34aca', + 'dev_requirement' => false, + ), + 'twig/twig' => array( + 'pretty_version' => 'v2.14.11', + 'version' => '2.14.11.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../twig/twig', + 'aliases' => array(), + 'reference' => '66baa66f29ee30e487e05f1679903e36eb01d727', + 'dev_requirement' => false, + ), + 'zoujingli/wechat-php-sdk' => array( + 'pretty_version' => 'v1.3.18', + 'version' => '1.3.18.0', + 'type' => 'project', + 'install_path' => __DIR__ . '/../zoujingli/wechat-php-sdk', + 'aliases' => array(), + 'reference' => 'd37d0c1919ede2ee54e65100ac3792e947b1e0ef', + 'dev_requirement' => false, + ), + ), +); diff --git a/upload/system/storage/vendor/composer/platform_check.php b/upload/system/storage/vendor/composer/platform_check.php new file mode 100644 index 00000000000..a8b98d5ceb1 --- /dev/null +++ b/upload/system/storage/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70205)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber b/upload/system/storage/vendor/guzzlehttp/log-subscriber deleted file mode 160000 index 99c3c000416..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/log-subscriber +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99c3c0004165db721d8ef7bbef60c996210e538a diff --git a/upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md new file mode 100644 index 00000000000..235e13bc7d1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md @@ -0,0 +1,103 @@ +# CHANGELOG + +## 1.5.1 - 2021-10-22 + +### Fixed + +- 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 + +### Fixed + +- Fix manually settle promises generated with Utils::task + +## 1.4.1 - 2021-02-18 + +### Fixed + +- Fixed `each_limit` skipping promises and failing + +## 1.4.0 - 2020-09-30 + +### Added + +- Support for PHP 8 +- Optional `$recursive` flag to `all` +- Replaced functions by static methods + +### Fixed + +- Fix empty `each` processing +- Fix promise handling for Iterators of non-unique keys +- Fixed `method_exists` crashes on PHP 8 +- Memory leak on exceptions + + +## 1.3.1 - 2016-12-20 + +### Fixed + +- `wait()` foreign promise compatibility + + +## 1.3.0 - 2016-11-18 + +### Added + +- Adds support for custom task queues. + +### Fixed + +- Fixed coroutine promise memory leak. + + +## 1.2.0 - 2016-05-18 + +### Changed + +- Update to now catch `\Throwable` on PHP 7+ + + +## 1.1.0 - 2016-03-07 + +### Changed + +- Update EachPromise to prevent recurring on a iterator when advancing, as this + could trigger fatal generator errors. +- Update Promise to allow recursive waiting without unwrapping exceptions. + + +## 1.0.3 - 2015-10-15 + +### Changed + +- Update EachPromise to immediately resolve when the underlying promise iterator + is empty. Previously, such a promise would throw an exception when its `wait` + function was called. + + +## 1.0.2 - 2015-05-15 + +### Changed + +- Conditionally require functions.php. + + +## 1.0.1 - 2015-06-24 + +### Changed + +- Updating EachPromise to call next on the underlying promise iterator as late + as possible to ensure that generators that generate new requests based on + callbacks are not iterated until after callbacks are invoked. + + +## 1.0.0 - 2015-05-12 + +- Initial release diff --git a/upload/system/storage/vendor/guzzlehttp/promises/LICENSE b/upload/system/storage/vendor/guzzlehttp/promises/LICENSE new file mode 100644 index 00000000000..9f0f943be88 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Graham Campbell +Copyright (c) 2017 Tobias Schultze +Copyright (c) 2020 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/promises/Makefile b/upload/system/storage/vendor/guzzlehttp/promises/Makefile new file mode 100644 index 00000000000..8d5b3ef95eb --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/Makefile @@ -0,0 +1,13 @@ +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/upload/system/storage/vendor/guzzlehttp/promises/README.md b/upload/system/storage/vendor/guzzlehttp/promises/README.md new file mode 100644 index 00000000000..c175fec76b6 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/README.md @@ -0,0 +1,547 @@ +# Guzzle Promises + +[Promises/A+](https://promisesaplus.com/) implementation that handles promise +chaining and resolution iteratively, allowing for "infinite" promise chaining +while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) +for a general introduction to promises. + +- [Features](#features) +- [Quick start](#quick-start) +- [Synchronous wait](#synchronous-wait) +- [Cancellation](#cancellation) +- [API](#api) + - [Promise](#promise) + - [FulfilledPromise](#fulfilledpromise) + - [RejectedPromise](#rejectedpromise) +- [Promise interop](#promise-interop) +- [Implementation notes](#implementation-notes) + + +# Features + +- [Promises/A+](https://promisesaplus.com/) implementation. +- Promise resolution and chaining is handled iteratively, allowing for + "infinite" promise chaining. +- Promises have a synchronous `wait` method. +- Promises can be cancelled. +- Works with any object that has a `then` function. +- C# style async/await coroutine promises using + `GuzzleHttp\Promise\Coroutine::of()`. + + +# 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 are registered with the `then` method by providing an optional +`$onFulfilled` followed by an optional `$onRejected` function. + + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then( + // $onFulfilled + function ($value) { + echo 'The promise was fulfilled.'; + }, + // $onRejected + function ($reason) { + echo 'The promise was rejected.'; + } +); +``` + +*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 +only once and in the order in which they were added. + + +## 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 +all of the onFulfilled callbacks (resolving a promise with a rejected promise +will reject the promise and trigger the `$onRejected` callbacks). + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(function ($value) { + // Return a value and don't break the chain + return "Hello, " . $value; + }) + // This then is executed after the first then and receives the value + // returned from the first then. + ->then(function ($value) { + echo $value; + }); + +// Resolving the promise triggers the $onFulfilled callbacks and outputs +// "Hello, reader." +$promise->resolve('reader.'); +``` + + +## 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 +promise in the chain. Returning a promise in a `then` callback will cause the +subsequent promises in the chain to only be fulfilled when the returned promise +has been fulfilled. The next promise in the chain will be invoked with the +resolved value of the promise. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$nextPromise = new Promise(); + +$promise + ->then(function ($value) use ($nextPromise) { + echo $value; + return $nextPromise; + }) + ->then(function ($value) { + echo $value; + }); + +// Triggers the first callback and outputs "A" +$promise->resolve('A'); +// Triggers the second callback and outputs "B" +$nextPromise->resolve('B'); +``` + +## Promise rejection + +When a promise is rejected, the `$onRejected` callbacks are invoked with the +rejection reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + echo $reason; +}); + +$promise->reject('Error!'); +// Outputs "Error!" +``` + +## Rejection forwarding + +If an exception is thrown in an `$onRejected` callback, subsequent +`$onRejected` callbacks are invoked with the thrown exception as the reason. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + throw new Exception($reason); +})->then(null, function ($reason) { + assert($reason->getMessage() === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +You can also forward a rejection down the promise chain by returning a +`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or +`$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new Promise(); +$promise->then(null, function ($reason) { + return new RejectedPromise($reason); +})->then(null, function ($reason) { + assert($reason === 'Error!'); +}); + +$promise->reject('Error!'); +``` + +If an exception is not thrown in a `$onRejected` callback and the callback +does not return a rejected promise, downstream `$onFulfilled` callbacks are +invoked using the value returned from the `$onRejected` callback. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise(); +$promise + ->then(null, function ($reason) { + return "It's ok"; + }) + ->then(function ($value) { + assert($value === "It's ok"); + }); + +$promise->reject('Error!'); +``` + +# 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 +to synchronously force a promise to complete. When a wait function is invoked +it is expected to deliver a value to the promise or reject the promise. If the +wait function does not deliver a value, then an exception is thrown. The wait +function provided to a promise constructor is invoked when the `wait` function +of the promise is called. + +```php +$promise = new Promise(function () use (&$promise) { + $promise->resolve('foo'); +}); + +// Calling wait will return the value of the promise. +echo $promise->wait(); // outputs "foo" +``` + +If an exception is encountered while invoking the wait function of a promise, +the promise is rejected with the exception and the exception is thrown. + +```php +$promise = new Promise(function () use (&$promise) { + throw new Exception('foo'); +}); + +$promise->wait(); // throws the exception. +``` + +Calling `wait` on a promise that has been fulfilled will not trigger the wait +function. It will simply return the previously resolved value. + +```php +$promise = new Promise(function () { die('this is not called!'); }); +$promise->resolve('foo'); +echo $promise->wait(); // outputs "foo" +``` + +Calling `wait` on a promise that has been rejected will throw an exception. If +the rejection reason is an instance of `\Exception` the reason is thrown. +Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason +can be obtained by calling the `getReason` method of the exception. + +```php +$promise = new Promise(); +$promise->reject('foo'); +$promise->wait(); +``` + +> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' + + +## 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 +promise if it was fulfilled or throw an exception if it was rejected). This is +called "unwrapping" the promise. Waiting on a promise will by default unwrap +the promise state. + +You can force a promise to resolve and *not* unwrap the state of the promise +by passing `false` to the first argument of the `wait` function: + +```php +$promise = new Promise(); +$promise->reject('foo'); +// This will not throw an exception. It simply ensures the promise has +// been resolved. +$promise->wait(false); +``` + +When unwrapping a promise, the resolved value of the promise will be waited +upon until the unwrapped value is not a promise. This means that if you resolve +promise A with a promise B and unwrap promise A, the value returned by the +wait function will be the value delivered to promise B. + +**Note**: when you do not unwrap the promise, no value is returned. + + +# 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 +cancel function that when invoked cancels the action of computing a resolution +of the promise. + + +# API + + +## 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 +expected to resolve the promise. `$cancelFn` is a function with no arguments +that is expected to cancel the computation of a promise. It is invoked when the +`cancel()` method of a promise is called. + +```php +use GuzzleHttp\Promise\Promise; + +$promise = new Promise( + function () use (&$promise) { + $promise->resolve('waited'); + }, + function () { + // do something that will cancel the promise computation (e.g., close + // a socket, cancel a database query, etc...) + } +); + +assert('waited' === $promise->wait()); +``` + +A promise has the following methods: + +- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` + + Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. + +- `otherwise(callable $onRejected) : PromiseInterface` + + Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. + +- `wait($unwrap = true) : mixed` + + Synchronously waits on the promise to complete. + + `$unwrap` controls whether or not the value of the promise is returned for a + fulfilled promise or if an exception is thrown if the promise is rejected. + This is set to `true` by default. + +- `cancel()` + + Attempts to cancel the promise if possible. The promise being cancelled and + the parent most ancestor that has not yet been resolved will also be + cancelled. Any promises waiting on the cancelled promise to resolve will also + be cancelled. + +- `getState() : string` + + Returns the state of the promise. One of `pending`, `fulfilled`, or + `rejected`. + +- `resolve($value)` + + Fulfills the promise with the given `$value`. + +- `reject($reason)` + + Rejects the promise with the given `$reason`. + + +## FulfilledPromise + +A fulfilled promise can be created to represent a promise that has been +fulfilled. + +```php +use GuzzleHttp\Promise\FulfilledPromise; + +$promise = new FulfilledPromise('value'); + +// Fulfilled callbacks are immediately invoked. +$promise->then(function ($value) { + echo $value; +}); +``` + + +## RejectedPromise + +A rejected promise can be created to represent a promise that has been +rejected. + +```php +use GuzzleHttp\Promise\RejectedPromise; + +$promise = new RejectedPromise('Error'); + +// Rejected callbacks are immediately invoked. +$promise->then(null, function ($reason) { + echo $reason; +}); +``` + + +# Promise interop + +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) +for example. When a foreign promise is returned inside of a then method +callback, promise resolution will occur recursively. + +```php +// Create a React promise +$deferred = new React\Promise\Deferred(); +$reactPromise = $deferred->promise(); + +// Create a Guzzle promise that is fulfilled with a React promise. +$guzzlePromise = new GuzzleHttp\Promise\Promise(); +$guzzlePromise->then(function ($value) use ($reactPromise) { + // Do something something with the value... + // Return the React promise + return $reactPromise; +}); +``` + +Please note that wait and cancel chaining is no longer possible when forwarding +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 + +In order to keep the stack size constant, Guzzle promises are resolved +asynchronously using a task queue. When waiting on promises synchronously, the +task queue will be automatically run to ensure that the blocking promise and +any forwarded promises are resolved. When using promises asynchronously in an +event loop, you will need to run the task queue on each tick of the loop. If +you do not run the task queue, then promises will not be resolved. + +You can run the task queue using the `run()` method of the global task queue +instance. + +```php +// Get the global task queue +$queue = GuzzleHttp\Promise\Utils::queue(); +$queue->run(); +``` + +For example, you could use Guzzle promises with React using a periodic timer: + +```php +$loop = React\EventLoop\Factory::create(); +$loop->addPeriodicTimer(0, [$queue, 'run']); +``` + +*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? + + +# Implementation notes + + +## 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. + +```php +then(function ($v) { + // The stack size remains constant (a good thing) + echo xdebug_get_stack_depth() . ', '; + return $v + 1; + }); +} + +$parent->resolve(0); +var_dump($p->wait()); // int(1000) + +``` + +When a promise is fulfilled or rejected with a non-promise value, the promise +then takes ownership of the handlers of each child promise and delivers values +down the chain without using recursion. + +When a promise is resolved with another promise, the original promise transfers +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. + +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 +the computation. This is a nice separation of computation and delivery because +consumers of the promise cannot modify the value that will be eventually +delivered. + +One side effect of being able to implement promise resolution and chaining +iteratively is that you need to be able for one promise to reach into the state +of another promise to shuffle around ownership of handlers. In order to achieve +this without making the handlers of a promise publicly mutable, a promise is +also the deferred value, allowing promises of the same parent class to reach +into and modify the private properties of promises of the same type. While this +does allow consumers of the value to modify the resolution or rejection of the +deferred, it is a small price to pay for keeping the stack size constant. + +```php +$promise = new Promise(); +$promise->then(function ($value) { echo $value; }); +// The promise is the deferred value, so you can deliver a value to it. +$promise->resolve('foo'); +// prints "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: + +| Original Function | Replacement Method | +|----------------|----------------| +| `queue` | `Utils::queue` | +| `task` | `Utils::task` | +| `promise_for` | `Create::promiseFor` | +| `rejection_for` | `Create::rejectionFor` | +| `exception_for` | `Create::exceptionFor` | +| `iter_for` | `Create::iterFor` | +| `inspect` | `Utils::inspect` | +| `inspect_all` | `Utils::inspectAll` | +| `unwrap` | `Utils::unwrap` | +| `all` | `Utils::all` | +| `some` | `Utils::some` | +| `any` | `Utils::any` | +| `settle` | `Utils::settle` | +| `each` | `Each::of` | +| `each_limit` | `Each::ofLimit` | +| `each_limit_all` | `Each::ofLimitAll` | +| `!is_fulfilled` | `Is::pending` | +| `is_fulfilled` | `Is::fulfilled` | +| `is_rejected` | `Is::rejected` | +| `is_settled` | `Is::settled` | +| `coroutine` | `Coroutine::of` | + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/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 + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/upload/system/storage/vendor/guzzlehttp/promises/composer.json b/upload/system/storage/vendor/guzzlehttp/promises/composer.json new file mode 100644 index 00000000000..c959fb32b41 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/composer.json @@ -0,0 +1,58 @@ +{ + "name": "guzzlehttp/promises", + "description": "Guzzle promises library", + "keywords": ["promise"], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "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" + } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php b/upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php new file mode 100644 index 00000000000..d2b5712b925 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php @@ -0,0 +1,17 @@ +then(function ($v) { echo $v; }); + * + * @param callable $generatorFn Generator function to wrap into a promise. + * + * @return Promise + * + * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration + */ +final class Coroutine implements PromiseInterface +{ + /** + * @var PromiseInterface|null + */ + private $currentPromise; + + /** + * @var Generator + */ + private $generator; + + /** + * @var Promise + */ + private $result; + + public function __construct(callable $generatorFn) + { + $this->generator = $generatorFn(); + $this->result = new Promise(function () { + 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); + } + } + + /** + * Create a new coroutine. + * + * @return self + */ + public static function of(callable $generatorFn) + { + return new self($generatorFn); + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + return $this->result->then($onFulfilled, $onRejected); + } + + public function otherwise(callable $onRejected) + { + return $this->result->otherwise($onRejected); + } + + public function wait($unwrap = true) + { + return $this->result->wait($unwrap); + } + + public function getState() + { + return $this->result->getState(); + } + + public function resolve($value) + { + $this->result->resolve($value); + } + + public function reject($reason) + { + $this->result->reject($reason); + } + + public function cancel() + { + $this->currentPromise->cancel(); + $this->result->cancel(); + } + + private function nextCoroutine($yielded) + { + $this->currentPromise = Create::promiseFor($yielded) + ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); + } + + /** + * @internal + */ + public function _handleSuccess($value) + { + unset($this->currentPromise); + try { + $next = $this->generator->send($value); + if ($this->generator->valid()) { + $this->nextCoroutine($next); + } else { + $this->result->resolve($value); + } + } catch (Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * @internal + */ + public function _handleFailure($reason) + { + 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/upload/system/storage/vendor/guzzlehttp/promises/src/Create.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Create.php new file mode 100644 index 00000000000..8d038e9c1ce --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/Create.php @@ -0,0 +1,84 @@ +then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; + } + + return new FulfilledPromise($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 + */ + public static function rejectionFor($reason) + { + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); + } + + /** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + */ + public static function exceptionFor($reason) + { + if ($reason instanceof \Exception || $reason instanceof \Throwable) { + return $reason; + } + + return new RejectionException($reason); + } + + /** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + */ + public static function iterFor($value) + { + if ($value instanceof \Iterator) { + return $value; + } + + if (is_array($value)) { + return new \ArrayIterator($value); + } + + return new \ArrayIterator([$value]); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/Each.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Each.php new file mode 100644 index 00000000000..1dda3549932 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/Each.php @@ -0,0 +1,90 @@ + $onFulfilled, + 'rejected' => $onRejected + ]))->promise(); + } + + /** + * Like of, 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 + */ + public static function ofLimit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null + ) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency + ]))->promise(); + } + + /** + * Like 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 + */ + public static function ofLimitAll( + $iterable, + $concurrency, + callable $onFulfilled = null + ) { + return each_limit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate) { + $aggregate->reject($reason); + } + ); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php b/upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php new file mode 100644 index 00000000000..38ecb59b158 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php @@ -0,0 +1,255 @@ +iterable = Create::iterFor($iterable); + + if (isset($config['concurrency'])) { + $this->concurrency = $config['concurrency']; + } + + if (isset($config['fulfilled'])) { + $this->onFulfilled = $config['fulfilled']; + } + + if (isset($config['rejected'])) { + $this->onRejected = $config['rejected']; + } + } + + /** @psalm-suppress InvalidNullableReturnType */ + public function promise() + { + if ($this->aggregate) { + return $this->aggregate; + } + + try { + $this->createPromise(); + /** @psalm-assert Promise $this->aggregate */ + $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() + { + $this->mutex = false; + $this->aggregate = new Promise(function () { + if ($this->checkIfFinished()) { + return; + } + reset($this->pending); + // Consume a potentially fluctuating list of promises while + // ensuring that indexes are maintained (precluding array_shift). + while ($promise = current($this->pending)) { + next($this->pending); + $promise->wait(); + if (Is::settled($this->aggregate)) { + return; + } + } + }); + + // Clear the references when the promise is resolved. + $clearFn = function () { + $this->iterable = $this->concurrency = $this->pending = null; + $this->onFulfilled = $this->onRejected = null; + $this->nextPendingIndex = 0; + }; + + $this->aggregate->then($clearFn, $clearFn); + } + + private function refillPending() + { + if (!$this->concurrency) { + // Add all pending promises. + while ($this->addPending() && $this->advanceIterator()); + return; + } + + // Add only up to N pending promises. + $concurrency = is_callable($this->concurrency) + ? call_user_func($this->concurrency, count($this->pending)) + : $this->concurrency; + $concurrency = max($concurrency - count($this->pending), 0); + // Concurrency may be set to 0 to disallow new promises. + if (!$concurrency) { + return; + } + // Add the first pending promise. + $this->addPending(); + // Note this is special handling for concurrency=1 so that we do + // not advance the iterator after adding the first promise. This + // helps work around issues with generators that might not have the + // next value to yield until promise callbacks are called. + while (--$concurrency + && $this->advanceIterator() + && $this->addPending()); + } + + private function addPending() + { + if (!$this->iterable || !$this->iterable->valid()) { + return false; + } + + $promise = Create::promiseFor($this->iterable->current()); + $key = $this->iterable->key(); + + // Iterable keys may not be unique, so we use a counter to + // guarantee uniqueness + $idx = $this->nextPendingIndex++; + + $this->pending[$idx] = $promise->then( + function ($value) use ($idx, $key) { + if ($this->onFulfilled) { + call_user_func( + $this->onFulfilled, + $value, + $key, + $this->aggregate + ); + } + $this->step($idx); + }, + function ($reason) use ($idx, $key) { + if ($this->onRejected) { + call_user_func( + $this->onRejected, + $reason, + $key, + $this->aggregate + ); + } + $this->step($idx); + } + ); + + return true; + } + + private function advanceIterator() + { + // Place a lock on the iterator so that we ensure to not recurse, + // preventing fatal generator errors. + if ($this->mutex) { + return false; + } + + $this->mutex = true; + + 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) + { + // If the promise was already resolved, then ignore this step. + if (Is::settled($this->aggregate)) { + return; + } + + unset($this->pending[$idx]); + + // Only refill pending promises if we are not locked, preventing the + // EachPromise to recursively invoke the provided iterator, which + // cause a fatal error: "Cannot resume an already running generator" + if ($this->advanceIterator() && !$this->checkIfFinished()) { + // Add more pending promises if possible. + $this->refillPending(); + } + } + + private function checkIfFinished() + { + if (!$this->pending && !$this->iterable->valid()) { + // Resolve the promise if there's nothing left to do. + $this->aggregate->resolve(null); + return true; + } + + return false; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php new file mode 100644 index 00000000000..98f72a62a6f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -0,0 +1,84 @@ +value = $value; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // Return itself if there is no onFulfilled function. + if (!$onFulfilled) { + return $this; + } + + $queue = Utils::queue(); + $p = new Promise([$queue, 'run']); + $value = $this->value; + $queue->add(static function () use ($p, $value, $onFulfilled) { + if (Is::pending($p)) { + try { + $p->resolve($onFulfilled($value)); + } catch (\Throwable $e) { + $p->reject($e); + } catch (\Exception $e) { + $p->reject($e); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + return $unwrap ? $this->value : null; + } + + public function getState() + { + return self::FULFILLED; + } + + public function resolve($value) + { + if ($value !== $this->value) { + throw new \LogicException("Cannot resolve a fulfilled promise"); + } + } + + public function reject($reason) + { + throw new \LogicException("Cannot reject a fulfilled promise"); + } + + public function cancel() + { + // pass + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/Is.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Is.php new file mode 100644 index 00000000000..c3ed8d01433 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/Is.php @@ -0,0 +1,46 @@ +getState() === PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled or rejected. + * + * @return bool + */ + public static function settled(PromiseInterface $promise) + { + return $promise->getState() !== PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled. + * + * @return bool + */ + public static function fulfilled(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::FULFILLED; + } + + /** + * Returns true if a promise is rejected. + * + * @return bool + */ + public static function rejected(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::REJECTED; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php new file mode 100644 index 00000000000..75939057b64 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php @@ -0,0 +1,278 @@ +waitFn = $waitFn; + $this->cancelFn = $cancelFn; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + if ($this->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) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true) + { + $this->waitIfPending(); + + if ($this->result instanceof PromiseInterface) { + return $this->result->wait($unwrap); + } + if ($unwrap) { + if ($this->state === self::FULFILLED) { + return $this->result; + } + // It's rejected so "unwrap" and throw an exception. + throw Create::exceptionFor($this->result); + } + } + + public function getState() + { + return $this->state; + } + + public function cancel() + { + if ($this->state !== self::PENDING) { + return; + } + + $this->waitFn = $this->waitList = null; + + if ($this->cancelFn) { + $fn = $this->cancelFn; + $this->cancelFn = null; + try { + $fn(); + } catch (\Throwable $e) { + $this->reject($e); + } catch (\Exception $e) { + $this->reject($e); + } + } + + // Reject the promise only if it wasn't rejected in a then callback. + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject(new CancellationException('Promise has been cancelled')); + } + } + + public function resolve($value) + { + $this->settle(self::FULFILLED, $value); + } + + public function reject($reason) + { + $this->settle(self::REJECTED, $reason); + } + + private function settle($state, $value) + { + if ($this->state !== self::PENDING) { + // Ignore calls with the same resolution. + if ($state === $this->state && $value === $this->result) { + return; + } + throw $this->state === $state + ? new \LogicException("The promise is already {$state}.") + : new \LogicException("Cannot change a {$this->state} promise to {$state}"); + } + + if ($value === $this) { + throw new \LogicException('Cannot fulfill or reject a promise with itself'); + } + + // Clear out the state of the promise but stash the handlers. + $this->state = $state; + $this->result = $value; + $handlers = $this->handlers; + $this->handlers = null; + $this->waitList = $this->waitFn = null; + $this->cancelFn = null; + + if (!$handlers) { + return; + } + + // If the value was not a settled promise or a thenable, then resolve + // it in the task queue using the correct ID. + 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) { + foreach ($handlers as $handler) { + self::callHandler($id, $value, $handler); + } + }); + } elseif ($value instanceof Promise && Is::pending($value)) { + // We can just merge our handlers onto the next promise. + $value->handlers = array_merge($value->handlers, $handlers); + } else { + // Resolve the handlers when the forwarded promise is resolved. + $value->then( + static function ($value) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(1, $value, $handler); + } + }, + static function ($reason) use ($handlers) { + foreach ($handlers as $handler) { + self::callHandler(2, $reason, $handler); + } + } + ); + } + } + + /** + * Call a stack of handlers using a specific callback index and value. + * + * @param int $index 1 (resolve) or 2 (reject). + * @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) + { + /** @var PromiseInterface $promise */ + $promise = $handler[0]; + + // The promise may have been cancelled or resolved before placing + // this thunk in the queue. + if (Is::settled($promise)) { + return; + } + + try { + if (isset($handler[$index])) { + /* + * If $f throws an exception, then $handler will be in the exception + * stack trace. Since $handler contains a reference to the callable + * itself we get a circular reference. We clear the $handler + * here to avoid that memory leak. + */ + $f = $handler[$index]; + unset($handler); + $promise->resolve($f($value)); + } elseif ($index === 1) { + // Forward resolution values as-is. + $promise->resolve($value); + } else { + // Forward rejections down the chain. + $promise->reject($value); + } + } catch (\Throwable $reason) { + $promise->reject($reason); + } catch (\Exception $reason) { + $promise->reject($reason); + } + } + + private function waitIfPending() + { + if ($this->state !== self::PENDING) { + return; + } elseif ($this->waitFn) { + $this->invokeWaitFn(); + } elseif ($this->waitList) { + $this->invokeWaitList(); + } 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.'); + } + + Utils::queue()->run(); + + /** @psalm-suppress RedundantCondition */ + if ($this->state === self::PENDING) { + $this->reject('Invoking the wait callback did not resolve the promise'); + } + } + + private function invokeWaitFn() + { + try { + $wfn = $this->waitFn; + $this->waitFn = null; + $wfn(true); + } catch (\Exception $reason) { + if ($this->state === self::PENDING) { + // The promise has not been resolved yet, so reject the promise + // with the exception. + $this->reject($reason); + } else { + // The promise was already resolved, so there's a problem in + // the application. + throw $reason; + } + } + } + + private function invokeWaitList() + { + $waitList = $this->waitList; + $this->waitList = null; + + foreach ($waitList as $result) { + do { + $result->waitIfPending(); + $result = $result->result; + } while ($result instanceof Promise); + + if ($result instanceof PromiseInterface) { + $result->wait(false); + } + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php b/upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php new file mode 100644 index 00000000000..e598331435a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -0,0 +1,97 @@ +reason = $reason; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null + ) { + // If there's no onRejected callback then just return self. + if (!$onRejected) { + return $this; + } + + $queue = Utils::queue(); + $reason = $this->reason; + $p = new Promise([$queue, 'run']); + $queue->add(static function () use ($p, $reason, $onRejected) { + if (Is::pending($p)) { + try { + // Return a resolved promise if onRejected does not throw. + $p->resolve($onRejected($reason)); + } 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); + } + } + }); + + return $p; + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, $onRejected); + } + + public function wait($unwrap = true, $defaultDelivery = null) + { + if ($unwrap) { + throw Create::exceptionFor($this->reason); + } + + return null; + } + + public function getState() + { + return self::REJECTED; + } + + public function resolve($value) + { + throw new \LogicException("Cannot resolve a rejected promise"); + } + + public function reject($reason) + { + if ($reason !== $this->reason) { + throw new \LogicException("Cannot reject a rejected promise"); + } + } + + public function cancel() + { + // pass + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php b/upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php new file mode 100644 index 00000000000..e2f137707df --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php @@ -0,0 +1,48 @@ +reason = $reason; + + $message = 'The promise was rejected'; + + if ($description) { + $message .= ' with reason: ' . $description; + } elseif (is_string($reason) + || (is_object($reason) && method_exists($reason, '__toString')) + ) { + $message .= ' with reason: ' . $this->reason; + } elseif ($reason instanceof \JsonSerializable) { + $message .= ' with reason: ' + . json_encode($this->reason, JSON_PRETTY_PRINT); + } + + parent::__construct($message); + } + + /** + * Returns the rejection reason. + * + * @return mixed + */ + public function getReason() + { + return $this->reason; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php b/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php new file mode 100644 index 00000000000..f0fba2c594a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -0,0 +1,67 @@ +run(); + */ +class TaskQueue implements TaskQueueInterface +{ + private $enableShutdown = true; + private $queue = []; + + public function __construct($withShutdown = true) + { + if ($withShutdown) { + register_shutdown_function(function () { + if ($this->enableShutdown) { + // Only run the tasks if an E_ERROR didn't occur. + $err = error_get_last(); + if (!$err || ($err['type'] ^ E_ERROR)) { + $this->run(); + } + } + }); + } + } + + public function isEmpty() + { + return !$this->queue; + } + + public function add(callable $task) + { + $this->queue[] = $task; + } + + public function run() + { + while ($task = array_shift($this->queue)) { + /** @var callable $task */ + $task(); + } + } + + /** + * The task queue will be run and exhausted by default when the process + * exits IFF the exit is not the result of a PHP E_ERROR error. + * + * You can disable running the automatic shutdown of the queue by calling + * this function. If you disable the task queue shutdown process, then you + * MUST either run the task queue (as a result of running your event loop + * or manually using the run() method) or wait on each outstanding promise. + * + * Note: This shutdown will occur before any destructors are triggered. + */ + public function disableShutdown() + { + $this->enableShutdown = false; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php new file mode 100644 index 00000000000..723d4d54eb1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -0,0 +1,24 @@ + + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\Utils::queue()->run(); + * } + * + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + */ + public static function queue(TaskQueueInterface $assign = null) + { + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; + } + + /** + * 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 + */ + public static function task(callable $task) + { + $queue = self::queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise) { + try { + if (Is::pending($promise)) { + $promise->resolve($task()); + } + } catch (\Throwable $e) { + $promise->reject($e); + } catch (\Exception $e) { + $promise->reject($e); + } + }); + + return $promise; + } + + /** + * 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 + */ + public static function inspect(PromiseInterface $promise) + { + try { + return [ + 'state' => PromiseInterface::FULFILLED, + '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]; + } + } + + /** + * 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 + */ + public static function inspectAll($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = inspect($promise); + } + + return $results; + } + + /** + * 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 + */ + public static function unwrap($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; + } + + /** + * 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 + */ + public static function all($promises, $recursive = false) + { + $results = []; + $promise = Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate) { + $aggregate->reject($reason); + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + + if (true === $recursive) { + $promise = $promise->then(function ($results) use ($recursive, &$promises) { + foreach ($promises as $promise) { + if (Is::pending($promise)) { + return self::all($promises, $recursive); + } + } + return $results; + }); + } + + return $promise; + } + + /** + * 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 + */ + public static function some($count, $promises) + { + $results = []; + $rejections = []; + + return Each::of( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + if (Is::settled($p)) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections) { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + return array_values($results); + } + ); + } + + /** + * 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 + */ + public static function any($promises) + { + return self::some(1, $promises)->then(function ($values) { + return $values[0]; + }); + } + + /** + * 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 + */ + public static function settle($promises) + { + $results = []; + + return Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/functions.php b/upload/system/storage/vendor/guzzlehttp/promises/src/functions.php new file mode 100644 index 00000000000..c03d39d0210 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/functions.php @@ -0,0 +1,363 @@ + + * 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/upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php b/upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php new file mode 100644 index 00000000000..34cd1710aa2 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php @@ -0,0 +1,6 @@ + + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml new file mode 100644 index 00000000000..eda7dceb56f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + max-parallel: 10 + matrix: + php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: 'none' + extensions: mbstring + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Mimic PHP 8.0 + run: composer config platform.php 8.0.999 + if: matrix.php > 8 + + - name: Install dependencies + run: composer update --no-interaction --no-progress + + - name: Run tests + run: make test diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml new file mode 100644 index 00000000000..3c31f9ef2a8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml @@ -0,0 +1,37 @@ +name: Integration + +on: + pull_request: + +jobs: + + build: + name: Test + runs-on: ubuntu-latest + strategy: + max-parallel: 10 + matrix: + php: ['7.2', '7.3', '7.4', '8.0'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download dependencies + uses: ramsey/composer-install@v1 + with: + composer-options: --no-interaction --optimize-autoloader + + - name: Start server + run: php -S 127.0.0.1:10002 tests/Integration/server.php & + + - name: Run tests + env: + TEST_SERVER: 127.0.0.1:10002 + run: ./vendor/bin/phpunit --testsuite Integration diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml new file mode 100644 index 00000000000..ab4d68ba30b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml @@ -0,0 +1,29 @@ +name: Static analysis + +on: + pull_request: + +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + extensions: mbstring + + - name: Download dependencies + run: composer update --no-interaction --no-progress + + - name: Download PHP CS Fixer + run: composer require "friendsofphp/php-cs-fixer:2.18.4" + + - name: Execute PHP CS Fixer + run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist b/upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist new file mode 100644 index 00000000000..e4f0bd53570 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist @@ -0,0 +1,56 @@ +setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'concat_space' => ['spacing' => 'one'], + 'declare_strict_types' => false, + 'final_static_access' => true, + 'fully_qualified_strict_types' => true, + 'header_comment' => false, + 'is_null' => ['use_yoda_style' => true], + 'list_syntax' => ['syntax' => 'long'], + 'lowercase_cast' => true, + 'magic_method_casing' => true, + 'modernize_types_casting' => true, + 'multiline_comment_opening_closing' => true, + 'no_alias_functions' => true, + 'no_alternative_syntax' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_leading_import_slash' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_unset_cast' => true, + 'no_unused_imports' => true, + 'no_whitespace_in_blank_line' => true, + 'ordered_imports' => true, + 'php_unit_ordered_covers' => true, + 'php_unit_test_annotation' => ['style' => 'prefix'], + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'phpdoc_align' => ['align' => 'vertical'], + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types' => true, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'phpdoc_var_without_name' => true, + 'single_trait_insert_per_statement' => true, + 'standardize_not_equals' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ) +; + +return $config; diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md new file mode 100644 index 00000000000..f40736c4eb0 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -0,0 +1,300 @@ +# Change Log + + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## Unreleased + +## 1.8.3 - 2021-10-05 + +### Fixed + +- Return `null` in caching stream size if remote size is `null` + +## 1.8.2 - 2021-04-26 + +### Fixed + +- Handle possibly unset `url` in `stream_get_meta_data` + +## 1.8.1 - 2021-03-21 + +### Fixed + +- Issue parsing IPv6 URLs +- Issue modifying ServerRequest lost all its attributes + +## 1.8.0 - 2021-03-21 + +### Added + +- Locale independent URL parsing +- Most classes got a `@final` annotation to prepare for 2.0 + +### Fixed + +- Issue when creating stream from `php://input` and curl-ext is not installed +- Broken `Utils::tryFopen()` on PHP 8 + +## 1.7.0 - 2020-09-30 + +### Added + +- Replaced functions by static methods + +### Fixed + +- Converting a non-seekable stream to a string +- Handle multiple Set-Cookie correctly +- Ignore array keys in header values when merging +- Allow multibyte characters to be parsed in `Message:bodySummary()` + +### Changed + +- Restored partial HHVM 3 support + + +## [1.6.1] - 2019-07-02 + +### Fixed + +- Accept null and bool header values again + + +## [1.6.0] - 2019-06-30 + +### Added + +- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) +- Added MIME type for WEBP image format (#246) +- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) + +### Changed + +- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) +- Accept port number 0 to be valid (#270) + +### Fixed + +- Fixed subsequent reads from `php://input` in ServerRequest (#247) +- Fixed readable/writable detection for certain stream modes (#248) +- Fixed encoding of special characters in the `userInfo` component of an URI (#253) + + +## [1.5.2] - 2018-12-04 + +### Fixed + +- Check body size when getting the message summary + + +## [1.5.1] - 2018-12-04 + +### Fixed + +- Get the summary of a body only if it is readable + + +## [1.5.0] - 2018-12-03 + +### Added + +- Response first-line to response string exception (fixes #145) +- A test for #129 behavior +- `get_message_body_summary` function in order to get the message summary +- `3gp` and `mkv` mime types + +### Changed + +- Clarify exception message when stream is detached + +### Deprecated + +- Deprecated parsing folded header lines as per RFC 7230 + +### Fixed + +- Fix `AppendStream::detach` to not close streams +- `InflateStream` preserves `isSeekable` attribute of the underlying stream +- `ServerRequest::getUriFromGlobals` to support URLs in query parameters + + +Several other fixes and improvements. + + +## [1.4.2] - 2017-03-20 + +### Fixed + +- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing + calls to `trigger_error` when deprecated methods are invoked. + + +## [1.4.1] - 2017-02-27 + +### Added + +- Rriggering of silenced deprecation warnings. + +### Fixed + +- Reverted BC break by reintroducing behavior to automagically fix a URI with a + relative path and an authority by adding a leading slash to the path. It's only + deprecated now. + + +## [1.4.0] - 2017-02-21 + +### Added + +- Added common URI utility methods based on RFC 3986 (see documentation in the readme): + - `Uri::isDefaultPort` + - `Uri::isAbsolute` + - `Uri::isNetworkPathReference` + - `Uri::isAbsolutePathReference` + - `Uri::isRelativePathReference` + - `Uri::isSameDocumentReference` + - `Uri::composeComponents` + - `UriNormalizer::normalize` + - `UriNormalizer::isEquivalent` + - `UriResolver::relativize` + +### Changed + +- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. +- Allow `parse_response` to parse a response without delimiting space and reason. +- Ensure each URI modification results in a valid URI according to PSR-7 discussions. + Invalid modifications will throw an exception instead of returning a wrong URI or + doing some magic. + - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception + because the path of a URI with an authority must start with a slash "/" or be empty + - `(new Uri())->withScheme('http')` will return `'http://localhost'` + +### Deprecated + +- `Uri::resolve` in favor of `UriResolver::resolve` +- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` + +### Fixed + +- `Stream::read` when length parameter <= 0. +- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. +- `ServerRequest::getUriFromGlobals` when `Host` header contains port. +- Compatibility of URIs with `file` scheme and empty host. + + +## [1.3.1] - 2016-06-25 + +### Fixed + +- `Uri::__toString` for network path references, e.g. `//example.org`. +- Missing lowercase normalization for host. +- Handling of URI components in case they are `'0'` in a lot of places, + e.g. as a user info password. +- `Uri::withAddedHeader` to correctly merge headers with different case. +- Trimming of header values in `Uri::withAddedHeader`. Header values may + be surrounded by whitespace which should be ignored according to RFC 7230 + Section 3.2.4. This does not apply to header names. +- `Uri::withAddedHeader` with an array of header values. +- `Uri::resolve` when base path has no slash and handling of fragment. +- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the + key/value both in encoded as well as decoded form to those methods. This is + consistent with withPath, withQuery etc. +- `ServerRequest::withoutAttribute` when attribute value is null. + + +## [1.3.0] - 2016-04-13 + +### Added + +- Remaining interfaces needed for full PSR7 compatibility + (ServerRequestInterface, UploadedFileInterface, etc.). +- Support for stream_for from scalars. + +### Changed + +- Can now extend Uri. + +### Fixed +- A bug in validating request methods by making it more permissive. + + +## [1.2.3] - 2016-02-18 + +### Fixed + +- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote + streams, which can sometimes return fewer bytes than requested with `fread`. +- Handling of gzipped responses with FNAME headers. + + +## [1.2.2] - 2016-01-22 + +### Added + +- Support for URIs without any authority. +- Support for HTTP 451 'Unavailable For Legal Reasons.' +- Support for using '0' as a filename. +- Support for including non-standard ports in Host headers. + + +## [1.2.1] - 2015-11-02 + +### Changes + +- Now supporting negative offsets when seeking to SEEK_END. + + +## [1.2.0] - 2015-08-15 + +### Changed + +- Body as `"0"` is now properly added to a response. +- Now allowing forward seeking in CachingStream. +- Now properly parsing HTTP requests that contain proxy targets in + `parse_request`. +- functions.php is now conditionally required. +- user-info is no longer dropped when resolving URIs. + + +## [1.1.0] - 2015-06-24 + +### Changed + +- URIs can now be relative. +- `multipart/form-data` headers are now overridden case-insensitively. +- URI paths no longer encode the following characters because they are allowed + in URIs: "(", ")", "*", "!", "'" +- A port is no longer added to a URI when the scheme is missing and no port is + present. + + +## 1.0.0 - 2015-05-19 + +Initial release. + +Currently unsupported: + +- `Psr\Http\Message\ServerRequestInterface` +- `Psr\Http\Message\UploadedFileInterface` + + + +[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 +[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 +[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 +[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 +[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/LICENSE b/upload/system/storage/vendor/guzzlehttp/psr7/LICENSE new file mode 100644 index 00000000000..51c7ec81cb8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/LICENSE @@ -0,0 +1,26 @@ +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Graham Campbell +Copyright (c) 2016 Tobias Schultze +Copyright (c) 2016 George Mponos +Copyright (c) 2018 Tobias Nyholm + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/README.md b/upload/system/storage/vendor/guzzlehttp/psr7/README.md new file mode 100644 index 00000000000..464cae4f22e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/README.md @@ -0,0 +1,824 @@ +# PSR-7 Message Implementation + +This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/) +message implementation, several stream decorators, and some helpful +functionality like query string parsing. + + +[![Build Status](https://travis-ci.org/guzzle/psr7.svg?branch=master)](https://travis-ci.org/guzzle/psr7) + + +# Stream implementation + +This package comes with a number of stream implementations and stream +decorators. + + +## AppendStream + +`GuzzleHttp\Psr7\AppendStream` + +Reads from multiple streams, one after the other. + +```php +use GuzzleHttp\Psr7; + +$a = Psr7\Utils::streamFor('abc, '); +$b = Psr7\Utils::streamFor('123.'); +$composed = new Psr7\AppendStream([$a, $b]); + +$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); + +echo $composed; // abc, 123. Above all listen to me. +``` + + +## BufferStream + +`GuzzleHttp\Psr7\BufferStream` + +Provides a buffer stream that can be written to fill a buffer, and read +from to remove bytes from the buffer. + +This stream returns a "hwm" metadata value that tells upstream consumers +what the configured high water mark of the stream is, or the maximum +preferred size of the buffer. + +```php +use GuzzleHttp\Psr7; + +// When more than 1024 bytes are in the buffer, it will begin returning +// false to writes. This is an indication that writers should slow down. +$buffer = new Psr7\BufferStream(1024); +``` + + +## CachingStream + +The CachingStream is used to allow seeking over previously read bytes on +non-seekable streams. This can be useful when transferring a non-seekable +entity body fails due to needing to rewind the stream (for example, resulting +from a redirect). Data that is read from the remote stream will be buffered in +a PHP temp stream so that previously read bytes are cached first in memory, +then on disk. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); +$stream = new Psr7\CachingStream($original); + +$stream->read(1024); +echo $stream->tell(); +// 1024 + +$stream->seek(0); +echo $stream->tell(); +// 0 +``` + + +## DroppingStream + +`GuzzleHttp\Psr7\DroppingStream` + +Stream decorator that begins dropping data once the size of the underlying +stream becomes too full. + +```php +use GuzzleHttp\Psr7; + +// Create an empty stream +$stream = Psr7\Utils::streamFor(); + +// Start dropping data when the stream has more than 10 bytes +$dropping = new Psr7\DroppingStream($stream, 10); + +$dropping->write('01234567890123456789'); +echo $stream; // 0123456789 +``` + + +## FnStream + +`GuzzleHttp\Psr7\FnStream` + +Compose stream implementations based on a hash of functions. + +Allows for easy testing and extension of a provided stream without needing +to create a concrete class for a simple extension point. + +```php + +use GuzzleHttp\Psr7; + +$stream = Psr7\Utils::streamFor('hi'); +$fnStream = Psr7\FnStream::decorate($stream, [ + 'rewind' => function () use ($stream) { + echo 'About to rewind - '; + $stream->rewind(); + echo 'rewound!'; + } +]); + +$fnStream->rewind(); +// Outputs: About to rewind - rewound! +``` + + +## InflateStream + +`GuzzleHttp\Psr7\InflateStream` + +Uses PHP's zlib.inflate filter to inflate deflate or gzipped content. + +This stream decorator skips the first 10 bytes of the given stream to remove +the gzip header, converts the provided stream to a PHP stream resource, +then appends the zlib.inflate filter. The stream is then converted back +to a Guzzle stream resource to be used as a Guzzle stream. + + +## LazyOpenStream + +`GuzzleHttp\Psr7\LazyOpenStream` + +Lazily reads or writes to a file that is opened only after an IO operation +take place on the stream. + +```php +use GuzzleHttp\Psr7; + +$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); +// The file has not yet been opened... + +echo $stream->read(10); +// The file is opened and read from only when needed. +``` + + +## LimitStream + +`GuzzleHttp\Psr7\LimitStream` + +LimitStream can be used to read a subset or slice of an existing stream object. +This can be useful for breaking a large file into smaller pieces to be sent in +chunks (e.g. Amazon S3's multipart upload API). + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); +echo $original->getSize(); +// >>> 1048576 + +// Limit the size of the body to 1024 bytes and start reading from byte 2048 +$stream = new Psr7\LimitStream($original, 1024, 2048); +echo $stream->getSize(); +// >>> 1024 +echo $stream->tell(); +// >>> 0 +``` + + +## MultipartStream + +`GuzzleHttp\Psr7\MultipartStream` + +Stream that when read returns bytes for a streaming multipart or +multipart/form-data stream. + + +## NoSeekStream + +`GuzzleHttp\Psr7\NoSeekStream` + +NoSeekStream wraps a stream and does not allow seeking. + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); +$noSeek = new Psr7\NoSeekStream($original); + +echo $noSeek->read(3); +// foo +var_export($noSeek->isSeekable()); +// false +$noSeek->seek(0); +var_export($noSeek->read(3)); +// NULL +``` + + +## PumpStream + +`GuzzleHttp\Psr7\PumpStream` + +Provides a read only stream that pumps data from a PHP callable. + +When invoking the provided callable, the PumpStream will pass the amount of +data requested to read to the callable. The callable can choose to ignore +this value and return fewer or more bytes than requested. Any extra data +returned by the provided callable is buffered internally until drained using +the read() function of the PumpStream. The provided callable MUST return +false when there is no more data to read. + + +## Implementing stream decorators + +Creating a stream decorator is very easy thanks to the +`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that +implement `Psr\Http\Message\StreamInterface` by proxying to an underlying +stream. Just `use` the `StreamDecoratorTrait` and implement your custom +methods. + +For example, let's say we wanted to call a specific function each time the last +byte is read from a stream. This could be implemented by overriding the +`read()` method. + +```php +use Psr\Http\Message\StreamInterface; +use GuzzleHttp\Psr7\StreamDecoratorTrait; + +class EofCallbackStream implements StreamInterface +{ + use StreamDecoratorTrait; + + private $callback; + + public function __construct(StreamInterface $stream, callable $cb) + { + $this->stream = $stream; + $this->callback = $cb; + } + + public function read($length) + { + $result = $this->stream->read($length); + + // Invoke the callback when EOF is hit. + if ($this->eof()) { + call_user_func($this->callback); + } + + return $result; + } +} +``` + +This decorator could be added to any existing stream and used like so: + +```php +use GuzzleHttp\Psr7; + +$original = Psr7\Utils::streamFor('foo'); + +$eofStream = new EofCallbackStream($original, function () { + echo 'EOF!'; +}); + +$eofStream->read(2); +$eofStream->read(1); +// echoes "EOF!" +$eofStream->seek(0); +$eofStream->read(3); +// echoes "EOF!" +``` + + +## PHP StreamWrapper + +You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a +PSR-7 stream as a PHP stream resource. + +Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP +stream from a PSR-7 stream. + +```php +use GuzzleHttp\Psr7\StreamWrapper; + +$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); +$resource = StreamWrapper::getResource($stream); +echo fread($resource, 6); // outputs hello! +``` + + +# Static API + +There are various static methods available under the `GuzzleHttp\Psr7` namespace. + + +## `GuzzleHttp\Psr7\Message::toString` + +`public static function toString(MessageInterface $message): string` + +Returns the string representation of an HTTP message. + +```php +$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); +echo GuzzleHttp\Psr7\Message::toString($request); +``` + + +## `GuzzleHttp\Psr7\Message::bodySummary` + +`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` + +Get a short summary of the message body. + +Will return `null` if the response is not printable. + + +## `GuzzleHttp\Psr7\Message::rewindBody` + +`public static function rewindBody(MessageInterface $message): void` + +Attempts to rewind a message body and throws an exception on failure. + +The body of the message will only be rewound if a call to `tell()` +returns a value other than `0`. + + +## `GuzzleHttp\Psr7\Message::parseMessage` + +`public static function parseMessage(string $message): array` + +Parses an HTTP message into an associative array. + +The array contains the "start-line" key containing the start line of +the message, "headers" key containing an associative array of header +array values, and a "body" key containing the body of the message. + + +## `GuzzleHttp\Psr7\Message::parseRequestUri` + +`public static function parseRequestUri(string $path, array $headers): string` + +Constructs a URI for an HTTP request message. + + +## `GuzzleHttp\Psr7\Message::parseRequest` + +`public static function parseRequest(string $message): Request` + +Parses a request message string into a request object. + + +## `GuzzleHttp\Psr7\Message::parseResponse` + +`public static function parseResponse(string $message): Response` + +Parses a response message string into a response object. + + +## `GuzzleHttp\Psr7\Header::parse` + +`public static function parse(string|array $header): array` + +Parse an array of header values containing ";" separated data into an +array of associative arrays representing the header key value pair data +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` + +`public static function normalize(string|array $header): array` + +Converts an array of header values that may contain comma separated +headers into an array of headers with no comma separated values. + + +## `GuzzleHttp\Psr7\Query::parse` + +`public static function parse(string $str, int|bool $urlEncoding = true): array` + +Parse a query string into an associative array. + +If multiple values are found for the same key, the value of that key +value pair will become an array. This function does not parse nested +PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` +will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. + + +## `GuzzleHttp\Psr7\Query::build` + +`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` + +Build a query string from an array of key value pairs. + +This function can use the return value of `parse()` to build a query +string. This function does not modify the provided keys when an array is +encountered (like `http_build_query()` would). + + +## `GuzzleHttp\Psr7\Utils::caselessRemove` + +`public static function caselessRemove(iterable $keys, $keys, array $data): array` + +Remove the items given by the keys, case insensitively from the data. + + +## `GuzzleHttp\Psr7\Utils::copyToStream` + +`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` + +Copy the contents of a stream into another stream until the given number +of bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::copyToString` + +`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` + +Copy the contents of a stream into a string until the given number of +bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::hash` + +`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` + +Calculate a hash of a stream. + +This method reads the entire stream to calculate a rolling hash, based on +PHP's `hash_init` functions. + + +## `GuzzleHttp\Psr7\Utils::modifyRequest` + +`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` + +Clone and modify a request with the given changes. + +This method is useful for reducing the number of clones needed to mutate +a message. + +- method: (string) Changes the HTTP method. +- set_headers: (array) Sets the given headers. +- remove_headers: (array) Remove the given headers. +- body: (mixed) Sets the given body. +- uri: (UriInterface) Set the URI. +- query: (string) Set the query string value of the URI. +- version: (string) Set the protocol version. + + +## `GuzzleHttp\Psr7\Utils::readLine` + +`public static function readLine(StreamInterface $stream, int $maxLength = null): string` + +Read a line from the stream up to the maximum allowed buffer length. + + +## `GuzzleHttp\Psr7\Utils::streamFor` + +`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` + +Create a new stream based on the input type. + +Options is an associative array that can contain the following keys: + +- metadata: Array of custom metadata. +- size: Size of the stream. + +This method accepts the following `$resource` types: + +- `Psr\Http\Message\StreamInterface`: Returns the value as-is. +- `string`: Creates a stream object that uses the given string as the contents. +- `resource`: Creates a stream object that wraps the given PHP stream resource. +- `Iterator`: If the provided value implements `Iterator`, then a read-only + stream object will be created that wraps the given iterable. Each time the + stream is read from, data from the iterator will fill a buffer and will be + continuously called until the buffer is equal to the requested read size. + Subsequent read calls will first read from the buffer and then call `next` + on the underlying iterator until it is exhausted. +- `object` with `__toString()`: If the object has the `__toString()` method, + the object will be cast to a string and then a stream will be returned that + uses the string value. +- `NULL`: When `null` is passed, an empty stream object is returned. +- `callable` When a callable is passed, a read-only stream object will be + created that invokes the given callable. The callable is invoked with the + number of suggested bytes to read. The callable can return any number of + bytes, but MUST return `false` when there is no more data to return. The + stream object that wraps the callable will invoke the callable until the + number of requested bytes are available. Any additional bytes will be + buffered and used in subsequent reads. + +```php +$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); +$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); + +$generator = function ($bytes) { + for ($i = 0; $i < $bytes; $i++) { + yield ' '; + } +} + +$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); +``` + + +## `GuzzleHttp\Psr7\Utils::tryFopen` + +`public static function tryFopen(string $filename, string $mode): resource` + +Safely opens a PHP stream resource using a filename. + +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::uriFor` + +`public static function uriFor(string|UriInterface $uri): UriInterface` + +Returns a UriInterface for the given value. + +This function accepts a string or UriInterface and returns a +UriInterface for the given value. If the value is already a +UriInterface, it is returned as-is. + + +## `GuzzleHttp\Psr7\MimeType::fromFilename` + +`public static function fromFilename(string $filename): string|null` + +Determines the mimetype of a file by looking at its extension. + + +## `GuzzleHttp\Psr7\MimeType::fromExtension` + +`public static function fromExtension(string $extension): string|null` + +Maps a file extensions to a mimetype. + + +## Upgrading from Function API + +The static API was first introduced in 1.7.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: + +| Original Function | Replacement Method | +|----------------|----------------| +| `str` | `Message::toString` | +| `uri_for` | `Utils::uriFor` | +| `stream_for` | `Utils::streamFor` | +| `parse_header` | `Header::parse` | +| `normalize_header` | `Header::normalize` | +| `modify_request` | `Utils::modifyRequest` | +| `rewind_body` | `Message::rewindBody` | +| `try_fopen` | `Utils::tryFopen` | +| `copy_to_string` | `Utils::copyToString` | +| `copy_to_stream` | `Utils::copyToStream` | +| `hash` | `Utils::hash` | +| `readline` | `Utils::readLine` | +| `parse_request` | `Message::parseRequest` | +| `parse_response` | `Message::parseResponse` | +| `parse_query` | `Query::parse` | +| `build_query` | `Query::build` | +| `mimetype_from_filename` | `MimeType::fromFilename` | +| `mimetype_from_extension` | `MimeType::fromExtension` | +| `_parse_message` | `Message::parseMessage` | +| `_parse_request_uri` | `Message::parseRequestUri` | +| `get_message_body_summary` | `Message::bodySummary` | +| `_caseless_remove` | `Utils::caselessRemove` | + + +# Additional URI Methods + +Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, +this library also provides additional functionality when working with URIs as static methods. + +## URI Types + +An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. +An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, +the base URI. Relative references can be divided into several forms according to +[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): + +- network-path references, e.g. `//example.com/path` +- absolute-path references, e.g. `/path` +- relative-path references, e.g. `subpath` + +The following methods can be used to identify the type of the URI. + +### `GuzzleHttp\Psr7\Uri::isAbsolute` + +`public static function isAbsolute(UriInterface $uri): bool` + +Whether the URI is absolute, i.e. it has a scheme. + +### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` + +`public static function isNetworkPathReference(UriInterface $uri): bool` + +Whether the URI is a network-path reference. A relative reference that begins with two slash characters is +termed an network-path reference. + +### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` + +`public static function isAbsolutePathReference(UriInterface $uri): bool` + +Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is +termed an absolute-path reference. + +### `GuzzleHttp\Psr7\Uri::isRelativePathReference` + +`public static function isRelativePathReference(UriInterface $uri): bool` + +Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is +termed a relative-path reference. + +### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` + +`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` + +Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its +fragment component, identical to the base URI. When no base URI is given, only an empty URI reference +(apart from its fragment) is considered a same-document reference. + +## URI Components + +Additional methods to work with URI components. + +### `GuzzleHttp\Psr7\Uri::isDefaultPort` + +`public static function isDefaultPort(UriInterface $uri): bool` + +Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null +or the standard port. This method can be used independently of the implementation. + +### `GuzzleHttp\Psr7\Uri::composeComponents` + +`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` + +Composes a URI reference string from its various components according to +[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called +manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. + +### `GuzzleHttp\Psr7\Uri::fromParts` + +`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. + + +### `GuzzleHttp\Psr7\Uri::withQueryValue` + +`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` + +Creates a new URI with a specific query string value. Any existing query string values that exactly match the +provided key are removed and replaced with the given key value pair. A value of null will set the query string +key without a value, e.g. "key" instead of "key=value". + +### `GuzzleHttp\Psr7\Uri::withQueryValues` + +`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` + +Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an +associative array of key => value. + +### `GuzzleHttp\Psr7\Uri::withoutQueryValue` + +`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` + +Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the +provided key are removed. + +## Reference Resolution + +`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according +to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers +do when resolving a link in a website based on the current request URI. + +### `GuzzleHttp\Psr7\UriResolver::resolve` + +`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` + +Converts the relative URI into a new URI that is resolved against the base URI. + +### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` + +`public static function removeDotSegments(string $path): string` + +Removes dot segments from a path and returns the new path according to +[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). + +### `GuzzleHttp\Psr7\UriResolver::relativize` + +`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` + +Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): + +```php +(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) +``` + +One use-case is to use the current request URI as base URI and then generate relative links in your documents +to reduce the document size or offer self-contained downloadable document archives. + +```php +$base = new Uri('http://example.com/a/b/'); +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. +echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. +echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. +``` + +## Normalization and Comparison + +`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to +[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). + +### `GuzzleHttp\Psr7\UriNormalizer::normalize` + +`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` + +Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. +This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask +of normalizations to apply. The following normalizations are available: + +- `UriNormalizer::PRESERVING_NORMALIZATIONS` + + Default normalizations which only include the ones that preserve semantics. + +- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` + + All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. + + Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` + +- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` + + Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of + ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should + not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved + characters by URI normalizers. + + Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` + +- `UriNormalizer::CONVERT_EMPTY_PATH` + + Converts the empty path to "/" for http and https URIs. + + Example: `http://example.org` → `http://example.org/` + +- `UriNormalizer::REMOVE_DEFAULT_HOST` + + Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host + "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to + RFC 3986. + + Example: `file://localhost/myfile` → `file:///myfile` + +- `UriNormalizer::REMOVE_DEFAULT_PORT` + + Removes the default port of the given URI scheme from the URI. + + Example: `http://example.org:80/` → `http://example.org/` + +- `UriNormalizer::REMOVE_DOT_SEGMENTS` + + Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would + change the semantics of the URI reference. + + Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` + +- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` + + Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes + and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization + may change the semantics. Encoded slashes (%2F) are not removed. + + Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` + +- `UriNormalizer::SORT_QUERY_PARAMETERS` + + Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be + significant (this is not defined by the standard). So this normalization is not safe and may change the semantics + of the URI. + + Example: `?lang=en&article=fred` → `?article=fred&lang=en` + +### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` + +`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` + +Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given +`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. +This of course assumes they will be resolved against the same base URI. If this is not the case, determination of +equivalence or difference of relative references does not mean anything. + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. + +## 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 + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/composer.json b/upload/system/storage/vendor/guzzlehttp/psr7/composer.json new file mode 100644 index 00000000000..bfa7cfdc16e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/composer.json @@ -0,0 +1,73 @@ +{ + "name": "guzzlehttp/psr7", + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], + "license": "MIT", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10", + "ext-zlib": "*" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": ["src/functions_include.php"] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\Psr7\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php new file mode 100644 index 00000000000..fa9153d78f4 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -0,0 +1,246 @@ +addStream($stream); + } + } + + public function __toString() + { + try { + $this->rewind(); + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream) + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Closes each attached stream. + * + * {@inheritdoc} + */ + public function close() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + * + * {@inheritdoc} + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + + return null; + } + + public function tell() + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + * + * {@inheritdoc} + */ + public function getSize() + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof() + { + return !$this->streams || + ($this->current >= count($this->streams) - 1 && + $this->streams[$this->current]->eof()); + } + + public function rewind() + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + * + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + . $i . ' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + * + * {@inheritdoc} + */ + public function read($length) + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $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++; + } + + $result = $this->streams[$this->current]->read($remaining); + + // Using a loose comparison here to match on '', false, and null + if ($result == null) { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return false; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php new file mode 100644 index 00000000000..783859c198b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -0,0 +1,142 @@ +hwm = $hwm; + } + + public function __toString() + { + return $this->getContents(); + } + + public function getContents() + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close() + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + + return null; + } + + public function getSize() + { + return strlen($this->buffer); + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return true; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof() + { + return strlen($this->buffer) === 0; + } + + public function tell() + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length) + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string) + { + $this->buffer .= $string; + + // TODO: What should happen here? + if (strlen($this->buffer) >= $this->hwm) { + return false; + } + + return strlen($string); + } + + public function getMetadata($key = null) + { + if ($key == 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php new file mode 100644 index 00000000000..febade9f41b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -0,0 +1,147 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); + } + + public function getSize() + { + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + if ($whence == SEEK_SET) { + $byte = $offset; + } elseif ($whence == SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence == SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length) + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string) + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof() + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close() + { + $this->remoteStream->close() && $this->stream->close(); + } + + private function cacheEntireStream() + { + $target = new FnStream(['write' => 'strlen']); + Utils::copyToStream($this, $target); + + return $this->tell(); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php new file mode 100644 index 00000000000..9f7420c405e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -0,0 +1,45 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string) + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php new file mode 100644 index 00000000000..76a8cc7ba63 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php @@ -0,0 +1,163 @@ +methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_' . $name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * + * @throws \BadMethodCallException + */ + public function __get($name) + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + . '() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * + * @throws \LogicException + */ + public function __wakeup() + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { + $methods[$diff] = [$stream, $diff]; + } + + return new self($methods); + } + + public function __toString() + { + return call_user_func($this->_fn___toString); + } + + public function close() + { + return call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function getSize() + { + return call_user_func($this->_fn_getSize); + } + + public function tell() + { + return call_user_func($this->_fn_tell); + } + + public function eof() + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable() + { + return call_user_func($this->_fn_isSeekable); + } + + public function rewind() + { + call_user_func($this->_fn_rewind); + } + + public function seek($offset, $whence = SEEK_SET) + { + call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable() + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string) + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable() + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length) + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents() + { + return call_user_func($this->_fn_getContents); + } + + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php new file mode 100644 index 00000000000..865d7421429 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php @@ -0,0 +1,71 @@ +]+>|[^=]+/', $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; + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @return array Returns the normalized header field values. + */ + public static function normalize($header) + { + if (!is_array($header)) { + return array_map('trim', explode(',', $header)); + } + + $result = []; + foreach ($header as $value) { + foreach ((array) $value as $v) { + if (strpos($v, ',') === false) { + $result[] = $v; + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { + $result[] = trim($vv); + } + } + } + + return $result; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php new file mode 100644 index 00000000000..0cbd2cce27d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -0,0 +1,56 @@ +read(10); + $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); + // Skip the header, that is 10 + length of filename + 1 (nil) bytes + $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); + $resource = StreamWrapper::getResource($stream); + stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } + + /** + * @param StreamInterface $stream + * @param $header + * + * @return int + */ + private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) + { + $filename_header_length = 0; + + if (substr(bin2hex($header), 6, 2) === '08') { + // we have a filename, read until nil + $filename_header_length = 1; + while ($stream->read(1) !== chr(0)) { + $filename_header_length++; + } + } + + return $filename_header_length; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php new file mode 100644 index 00000000000..911e127d318 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -0,0 +1,42 @@ +filename = $filename; + $this->mode = $mode; + } + + /** + * Creates the underlying stream lazily when required. + * + * @return StreamInterface + */ + protected function createStream() + { + return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php new file mode 100644 index 00000000000..1173ec40d70 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -0,0 +1,157 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof() + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit == -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + * {@inheritdoc} + */ + public function getSize() + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit == -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset %s with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + * {@inheritdoc} + */ + public function tell() + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset($offset) + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit($limit) + { + $this->limit = $limit; + } + + public function read($length) + { + if ($this->limit == -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php new file mode 100644 index 00000000000..516d1cb84ac --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php @@ -0,0 +1,252 @@ +getMethod() . ' ' + . $message->getRequestTarget()) + . ' HTTP/' . $message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: " . $message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $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') { + foreach ($values as $value) { + $msg .= "\r\n{$name}: " . $value; + } + } else { + $msg .= "\r\n{$name}: " . implode(', ', $values); + } + } + + return "{$msg}\r\n\r\n" . $message->getBody(); + } + + /** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return string|null + */ + public static function bodySummary(MessageInterface $message, $truncateAt = 120) + { + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // 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)) { + return null; + } + + return $summary; + } + + /** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` + * returns a value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ + public static function rewindBody(MessageInterface $message) + { + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } + } + + /** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + */ + public static function parseMessage($message) + { + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + list($rawHeaders, $body) = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + list($startLine, $rawHeaders) = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; + } + + /** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + */ + public static function parseRequestUri($path, array $headers) + { + $hostKey = array_filter(array_keys($headers), function ($k) { + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme . '://' . $host . '/' . ltrim($path, '/'); + } + + /** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + * + * @return Request + */ + public static function parseRequest($message) + { + $data = self::parseMessage($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + } + + /** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + * + * @return Response + */ + public static function parseResponse($message) + { + $data = self::parseMessage($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // 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']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + (int) $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + isset($parts[2]) ? $parts[2] : null + ); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php new file mode 100644 index 00000000000..99203bb43a4 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -0,0 +1,214 @@ + array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface|null */ + private $stream; + + public function getProtocolVersion() + { + return $this->protocol; + } + + public function withProtocolVersion($version) + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + return $new; + } + + public function getHeaders() + { + return $this->headers; + } + + public function hasHeader($header) + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header) + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header) + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header) + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody() + { + if (!$this->stream) { + $this->stream = Utils::streamFor(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body) + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + return $new; + } + + private function setHeaders(array $headers) + { + $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; + } + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + private function normalizeHeaderValue($value) + { + if (!is_array($value)) { + return $this->trimHeaderValues([$value]); + } + + if (count($value) === 0) { + throw new \InvalidArgumentException('Header value can not be an empty array.'); + } + + return $this->trimHeaderValues($value); + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param string[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values) + { + return array_map(function ($value) { + if (!is_scalar($value) && null !== $value) { + throw new \InvalidArgumentException(sprintf( + 'Header value must be scalar or null but %s provided.', + is_object($value) ? get_class($value) : gettype($value) + )); + } + + return trim((string) $value, " \t"); + }, array_values($values)); + } + + private function assertHeader($header) + { + if (!is_string($header)) { + throw new \InvalidArgumentException(sprintf( + 'Header name must be a string but %s provided.', + is_object($header) ? get_class($header) : gettype($header) + )); + } + + if ($header === '') { + throw new \InvalidArgumentException('Header name can not be empty.'); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php new file mode 100644 index 00000000000..205c7b1fa67 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php @@ -0,0 +1,140 @@ + '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', + ]; + + $extension = strtolower($extension); + + return isset($mimetypes[$extension]) + ? $mimetypes[$extension] + : null; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php new file mode 100644 index 00000000000..5a6079a89f5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -0,0 +1,158 @@ +boundary = $boundary ?: sha1(uniqid('', true)); + $this->stream = $this->createStream($elements); + } + + /** + * Get the boundary + * + * @return string + */ + public function getBoundary() + { + return $this->boundary; + } + + public function isWritable() + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + */ + private function getHeaders(array $headers) + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements) + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element) + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = Utils::streamFor($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if (substr($uri, 0, 6) !== 'php://') { + $element['filename'] = $uri; + } + } + + list($body, $headers) = $this->createElement( + $element['name'], + $element['contents'], + isset($element['filename']) ? $element['filename'] : null, + isset($element['headers']) ? $element['headers'] : [] + ); + + $stream->addStream(Utils::streamFor($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(Utils::streamFor("\r\n")); + } + + /** + * @return array + */ + private function createElement($name, StreamInterface $stream, $filename, array $headers) + { + // Set a default content-disposition header if one was no provided + $disposition = $this->getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf( + 'form-data; name="%s"; filename="%s"', + $name, + basename($filename) + ) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = $this->getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // 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; + } + } + + return [$stream, $headers]; + } + + private function getHeader(array $headers, $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php new file mode 100644 index 00000000000..d66bdde4602 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -0,0 +1,25 @@ +source = $source; + $this->size = isset($options['size']) ? $options['size'] : null; + $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; + $this->buffer = new BufferStream(); + } + + public function __toString() + { + try { + return Utils::copyToString($this); + } catch (\Exception $e) { + return ''; + } + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = false; + $this->source = null; + + return null; + } + + public function getSize() + { + return $this->size; + } + + public function tell() + { + return $this->tellPos; + } + + public function eof() + { + return !$this->source; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable() + { + return true; + } + + public function read($length) + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents() + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + } + + private function pump($length) + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php new file mode 100644 index 00000000000..5a7cc0359ed --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php @@ -0,0 +1,113 @@ + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + */ + public static function parse($str, $urlEncoding = true) + { + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { + return $str; + }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * + * @return string + */ + public static function build(array $params, $encoding = PHP_QUERY_RFC3986) + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function ($str) { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder($k); + if (!is_array($v)) { + $qs .= $k; + if ($v !== null) { + $qs .= '=' . $encoder($v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + if ($vv !== null) { + $qs .= '=' . $encoder($vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php new file mode 100644 index 00000000000..c1cdaebff80 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php @@ -0,0 +1,152 @@ +assertMethod($method); + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + } + + public function getRequestTarget() + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target == '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?' . $this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget) + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + return $new; + } + + public function getMethod() + { + return $this->method; + } + + public function withMethod($method) + { + $this->assertMethod($method); + $new = clone $this; + $new->method = strtoupper($method); + return $new; + } + + public function getUri() + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false) + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri() + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':' . $port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + private function assertMethod($method) + { + if (!is_string($method) || $method === '') { + throw new \InvalidArgumentException('Method must be a non-empty string.'); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php new file mode 100644 index 00000000000..8c01a0f5a43 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php @@ -0,0 +1,155 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase = ''; + + /** @var int */ + private $statusCode = 200; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + $status = 200, + array $headers = [], + $body = null, + $version = '1.1', + $reason = null + ) { + $this->assertStatusCodeIsInteger($status); + $status = (int) $status; + $this->assertStatusCodeRange($status); + + $this->statusCode = $status; + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::$phrases[$this->statusCode])) { + $this->reasonPhrase = self::$phrases[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = '') + { + $this->assertStatusCodeIsInteger($code); + $code = (int) $code; + $this->assertStatusCodeRange($code); + + $new = clone $this; + $new->statusCode = $code; + if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { + $reasonPhrase = self::$phrases[$new->statusCode]; + } + $new->reasonPhrase = (string) $reasonPhrase; + return $new; + } + + private function assertStatusCodeIsInteger($statusCode) + { + if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + } + + private function assertStatusCodeRange($statusCode) + { + if ($statusCode < 100 || $statusCode >= 600) { + throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php new file mode 100644 index 00000000000..51b571f24de --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -0,0 +1,19 @@ +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php new file mode 100644 index 00000000000..e6d26f5ff9a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -0,0 +1,379 @@ +serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files A array which respect $_FILES structure + * + * @return array + * + * @throws InvalidArgumentException for unrecognized values + */ + public static function normalizeFiles(array $files) + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * + * @return array|UploadedFileInterface + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @param array $files + * + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []) + { + $normalizedFiles = []; + + 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], + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + * + * @return ServerRequestInterface + */ + public static function fromGlobals() + { + $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority($authority) + { + $uri = 'http://' . $authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = isset($parts['host']) ? $parts['host'] : null; + $port = isset($parts['port']) ? $parts['port'] : null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + * + * @return UriInterface + */ + public static function getUriFromGlobals() + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + /** + * {@inheritdoc} + */ + public function getServerParams() + { + return $this->serverParams; + } + + /** + * {@inheritdoc} + */ + public function getUploadedFiles() + { + return $this->uploadedFiles; + } + + /** + * {@inheritdoc} + */ + public function withUploadedFiles(array $uploadedFiles) + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getCookieParams() + { + return $this->cookieParams; + } + + /** + * {@inheritdoc} + */ + public function withCookieParams(array $cookies) + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getQueryParams() + { + return $this->queryParams; + } + + /** + * {@inheritdoc} + */ + public function withQueryParams(array $query) + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + /** + * {@inheritdoc} + */ + public function withParsedBody($data) + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + /** + * {@inheritdoc} + */ + public function withAttribute($attribute, $value) + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function withoutAttribute($attribute) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php new file mode 100644 index 00000000000..3865d6d6a13 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php @@ -0,0 +1,270 @@ +size = $options['size']; + } + + $this->customMetadata = isset($options['metadata']) + ? $options['metadata'] + : []; + + $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->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + public function getContents() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $contents = stream_get_contents($this->stream); + + if ($contents === false) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function close() + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize() + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + return $this->size; + } + + return null; + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function eof() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $whence = (int) $whence; + + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + . $offset . ' with whence ' . var_export($whence, true)); + } + } + + public function read($length) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + $string = fread($this->stream, $length); + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return isset($meta[$key]) ? $meta[$key] : null; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php new file mode 100644 index 00000000000..5025dd67b8a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -0,0 +1,152 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @param string $name Name of the property (allows "stream" only). + * + * @return StreamInterface + */ + public function __get($name) + { + if ($name == 'stream') { + $this->stream = $this->createStream(); + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + // Really, PHP? https://bugs.php.net/bug.php?id=53648 + trigger_error('StreamDecorator::__toString exception: ' + . (string) $e, E_USER_ERROR); + return ''; + } + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Allow decorators to implement custom methods + * + * @param string $method Missing method name + * @param array $args Method arguments + * + * @return mixed + */ + public function __call($method, array $args) + { + $result = call_user_func_array([$this->stream, $method], $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close() + { + $this->stream->close(); + } + + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize() + { + return $this->stream->getSize(); + } + + public function eof() + { + return $this->stream->eof(); + } + + public function tell() + { + return $this->stream->tell(); + } + + public function isReadable() + { + return $this->stream->isReadable(); + } + + public function isWritable() + { + return $this->stream->isWritable(); + } + + public function isSeekable() + { + return $this->stream->isSeekable(); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $this->stream->seek($offset, $whence); + } + + public function read($length) + { + return $this->stream->read($length); + } + + public function write($string) + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @return StreamInterface + * + * @throws \BadMethodCallException + */ + protected function createStream() + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php new file mode 100644 index 00000000000..fc7cb969bd2 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -0,0 +1,165 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + . 'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @param StreamInterface $stream + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream] + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register() + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open($path, $mode, $options, &$opened_path) + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read($count) + { + return $this->stream->read($count); + } + + public function stream_write($data) + { + return (int) $this->stream->write($data); + } + + public function stream_tell() + { + return $this->stream->tell(); + } + + public function stream_eof() + { + return $this->stream->eof(); + } + + public function stream_seek($offset, $whence) + { + $this->stream->seek($offset, $whence); + + return true; + } + + public function stream_cast($cast_as) + { + $stream = clone($this->stream); + + return $stream->detach(); + } + + public function stream_stat() + { + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + '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, + 'blksize' => 0, + 'blocks' => 0 + ]; + } + + public function url_stat($path, $flags) + { + return [ + '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 + ]; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php new file mode 100644 index 00000000000..bf342c4de3b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -0,0 +1,328 @@ +setError($errorStatus); + $this->setSize($size); + $this->setClientFilename($clientFilename); + $this->setClientMediaType($clientMediaType); + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param mixed $streamOrFile + * + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile) + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @param int $error + * + * @throws InvalidArgumentException + */ + private function setError($error) + { + if (false === is_int($error)) { + throw new InvalidArgumentException( + 'Upload file error status must be an integer' + ); + } + + if (false === in_array($error, UploadedFile::$errors)) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + /** + * @param int $size + * + * @throws InvalidArgumentException + */ + private function setSize($size) + { + if (false === is_int($size)) { + throw new InvalidArgumentException( + 'Upload file size must be an integer' + ); + } + + $this->size = $size; + } + + /** + * @param mixed $param + * + * @return bool + */ + private function isStringOrNull($param) + { + return in_array(gettype($param), ['string', 'NULL']); + } + + /** + * @param mixed $param + * + * @return bool + */ + private function isStringNotEmpty($param) + { + return is_string($param) && false === empty($param); + } + + /** + * @param string|null $clientFilename + * + * @throws InvalidArgumentException + */ + private function setClientFilename($clientFilename) + { + if (false === $this->isStringOrNull($clientFilename)) { + throw new InvalidArgumentException( + 'Upload file client filename must be a string or null' + ); + } + + $this->clientFilename = $clientFilename; + } + + /** + * @param string|null $clientMediaType + * + * @throws InvalidArgumentException + */ + private function setClientMediaType($clientMediaType) + { + if (false === $this->isStringOrNull($clientMediaType)) { + throw new InvalidArgumentException( + 'Upload file client media type must be a string or null' + ); + } + + $this->clientMediaType = $clientMediaType; + } + + /** + * Return true if there is no upload error + * + * @return bool + */ + private function isOk() + { + return $this->error === UPLOAD_ERR_OK; + } + + /** + * @return bool + */ + public function isMoved() + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive() + { + if (false === $this->isOk()) { + throw new RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + /** + * {@inheritdoc} + * + * @throws RuntimeException if the upload was not successful. + */ + public function getStream() + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + return new LazyOpenStream($this->file, 'r+'); + } + + /** + * {@inheritdoc} + * + * @see http://php.net/is_uploaded_file + * @see http://php.net/move_uploaded_file + * + * @param string $targetPath Path to which to move the uploaded file. + * + * @throws RuntimeException if the upload was not successful. + * @throws InvalidArgumentException if the $path specified is invalid. + * @throws RuntimeException on any error during the move operation, or on + * the second or subsequent call to the method. + */ + public function moveTo($targetPath) + { + $this->validateActive(); + + if (false === $this->isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = php_sapi_name() == 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + Utils::copyToStream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + /** + * {@inheritdoc} + * + * @return int|null The file size in bytes or null if unknown. + */ + public function getSize() + { + return $this->size; + } + + /** + * {@inheritdoc} + * + * @see http://php.net/manual/en/features.file-upload.errors.php + * + * @return int One of PHP's UPLOAD_ERR_XXX constants. + */ + public function getError() + { + return $this->error; + } + + /** + * {@inheritdoc} + * + * @return string|null The filename sent by the client or null if none + * was provided. + */ + public function getClientFilename() + { + return $this->clientFilename; + } + + /** + * {@inheritdoc} + */ + public function getClientMediaType() + { + return $this->clientMediaType; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php new file mode 100644 index 00000000000..0f9f020d3ca --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php @@ -0,0 +1,810 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; + private static $charSubDelims = '!\$&\'\(\)\*\+,;='; + private static $replaceQuery = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** + * @param string $uri URI to parse + */ + public function __construct($uri = '') + { + // weak type check to also accept null until we can add scalar type hints + if ($uri != '') { + $parts = self::parse($uri); + if ($parts === false) { + throw new \InvalidArgumentException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @param string $url + * + * @return array|false + */ + private static function parse($url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + $prefix = $matches[1]; + $url = $matches[2]; + } + + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix . $encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + + public function __toString() + { + return self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @param string $scheme + * @param string $authority + * @param string $path + * @param string $query + * @param string $fragment + * + * @return string + * + * @link https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents($scheme, $authority, $path, $query, $fragment) + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme . ':'; + } + + if ($authority != ''|| $scheme === 'file') { + $uri .= '//' . $authority; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?' . $query; + } + + if ($fragment != '') { + $uri .= '#' . $fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + * + * @param UriInterface $uri + * + * @return bool + */ + public static function isDefaultPort(UriInterface $uri) + { + return $uri->getPort() === null + || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @param UriInterface $uri + * + * @return bool + * + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @link https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri) + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri) + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Removes dot segments from a path and returns the new path. + * + * @param string $path + * + * @return string + * + * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. + * @see UriResolver::removeDotSegments + */ + public static function removeDotSegments($path) + { + return UriResolver::removeDotSegments($path); + } + + /** + * Converts the relative URI into a new URI that is resolved against the base URI. + * + * @param UriInterface $base Base URI + * @param string|UriInterface $rel Relative URI + * + * @return UriInterface + * + * @deprecated since version 1.4. Use UriResolver::resolve instead. + * @see UriResolver::resolve + */ + public static function resolve(UriInterface $base, $rel) + { + if (!($rel instanceof UriInterface)) { + $rel = new self($rel); + } + + return UriResolver::resolve($base, $rel); + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + * + * @return UriInterface + */ + public static function withoutQueryValue(UriInterface $uri, $key) + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + * + * @return UriInterface + */ + public static function withQueryValue(UriInterface $uri, $key, $value) + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param array $keyValueArray Associative array of key and values + * + * @return UriInterface + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray) + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString($key, $value); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @param array $parts + * + * @return UriInterface + * + * @link http://php.net/manual/en/function.parse-url.php + * + * @throws \InvalidArgumentException If the components do not form a valid URI. + */ + public static function fromParts(array $parts) + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme() + { + return $this->scheme; + } + + public function getAuthority() + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo . '@' . $authority; + } + + if ($this->port !== null) { + $authority .= ':' . $this->port; + } + + return $authority; + } + + public function getUserInfo() + { + return $this->userInfo; + } + + public function getHost() + { + return $this->host; + } + + public function getPort() + { + return $this->port; + } + + public function getPath() + { + return $this->path; + } + + public function getQuery() + { + return $this->query; + } + + public function getFragment() + { + return $this->fragment; + } + + public function withScheme($scheme) + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null) + { + $info = $this->filterUserInfoComponent($user); + if ($password !== null) { + $info .= ':' . $this->filterUserInfoComponent($password); + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->validateState(); + + return $new; + } + + public function withHost($host) + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->validateState(); + + return $new; + } + + public function withPort($port) + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path) + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->validateState(); + + return $new; + } + + public function withQuery($query) + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + + return $new; + } + + public function withFragment($fragment) + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + + return $new; + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts) + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) + ? $this->filterUserInfoComponent($parts['user']) + : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); + } + + $this->removeDefaultPort(); + } + + /** + * @param string $scheme + * + * @return string + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme) + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param string $component + * + * @return string + * + * @throws \InvalidArgumentException If the user info is invalid. + */ + private function filterUserInfoComponent($component) + { + if (!is_string($component)) { + throw new \InvalidArgumentException('User info must be a string'); + } + + return preg_replace_callback( + '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $component + ); + } + + /** + * @param string $host + * + * @return string + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host) + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param int|null $port + * + * @return int|null + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port) + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xffff < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 0 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param UriInterface $uri + * @param array $keys + * + * @return array + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys) + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map('rawurldecode', $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + /** + * @param string $key + * @param string|null $value + * + * @return string + */ + private static function generateQueryString($key, $value) + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::$replaceQuery); + + if ($value !== null) { + $queryString .= '=' . strtr($value, self::$replaceQuery); + } + + return $queryString; + } + + private function removeDefaultPort() + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param string $path + * + * @return string + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path) + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param string $str + * + * @return string + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str) + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match) + { + return rawurlencode($match[0]); + } + + private function validateState() + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } elseif (isset($this->path[0]) && $this->path[0] !== '/') { + @trigger_error( + 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . + 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', + E_USER_DEPRECATED + ); + $this->path = '/' . $this->path; + //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php new file mode 100644 index 00000000000..81419ead426 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -0,0 +1,219 @@ +getPath() === '' && + ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri) + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match) { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri) + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match) { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php new file mode 100644 index 00000000000..a3cb15d5703 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -0,0 +1,222 @@ +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->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 = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + * + * @param UriInterface $base Base URI + * @param UriInterface $target Target URI + * + * @return UriInterface The relative URI reference + */ + public static function relativize(UriInterface $base, UriInterface $target) + { + if ($target->getScheme() !== '' && + ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target) + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $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 + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php new file mode 100644 index 00000000000..6b6c8cced5d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php @@ -0,0 +1,428 @@ + $keys + * + * @return array + */ + public static function caselessRemove($keys, array $data) + { + $result = []; + + foreach ($keys as &$key) { + $key = strtolower($key); + } + + foreach ($data as $k => $v) { + if (!in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1) + { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } + } + + /** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @return string + * + * @throws \RuntimeException on error. + */ + public static function copyToString(StreamInterface $stream, $maxLen = -1) + { + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based + * on PHP's `hash_init` functions. + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @return string Returns the hash of the stream + * + * @throws \RuntimeException on error. + */ + public static function hash(StreamInterface $stream, $algo, $rawOutput = false) + { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Clone and modify a request with the given changes. + * + * This method is useful for reducing the number of clones needed to mutate + * a message. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + * + * @return RequestInterface + */ + public static function modifyRequest(RequestInterface $request, array $changes) + { + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':' . $port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = self::caselessRemove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + $new = (new ServerRequest( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; + } + + return new Request( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion() + ); + } + + /** + * Read a line from the stream up to the maximum allowed buffer length. + * + * @param StreamInterface $stream Stream to read from + * @param int|null $maxLength Maximum buffer length + * + * @return string + */ + public static function readLine(StreamInterface $stream, $maxLength = null) + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + // Using a loose equality here to match on '' and false. + if (null == ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data + * @param array $options Additional options + * + * @return StreamInterface + * + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function streamFor($resource = '', array $options = []) + { + if (is_scalar($resource)) { + $stream = self::tryFopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, $resource); + fseek($stream, 0); + } + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + $metaData = \stream_get_meta_data($resource); + if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + fwrite($stream, stream_get_contents($resource)); + fseek($stream, 0); + $resource = $stream; + } + return new Stream($resource, $options); + case 'object': + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return Utils::streamFor((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(self::tryFopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + } + + /** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * + * @throws \RuntimeException if the file cannot be opened + */ + public static function tryFopen($filename, $mode) + { + $ex = null; + set_error_handler(function () use ($filename, $mode, &$ex) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + func_get_args()[1] + )); + + return true; + }); + + try { + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; + } + + /** + * Returns a UriInterface for the given value. + * + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @return UriInterface + * + * @throws \InvalidArgumentException + */ + public static function uriFor($uri) + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php new file mode 100644 index 00000000000..b0901fadd30 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php @@ -0,0 +1,422 @@ + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + * + * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead. + */ +function parse_query($str, $urlEncoding = true) +{ + return Query::parse($str, $urlEncoding); +} + +/** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse_query()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * + * @return string + * + * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. + */ +function build_query(array $params, $encoding = PHP_QUERY_RFC3986) +{ + return Query::build($params, $encoding); +} + +/** + * Determines the mimetype of a file by looking at its extension. + * + * @param string $filename + * + * @return string|null + * + * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead. + */ +function mimetype_from_filename($filename) +{ + return MimeType::fromFilename($filename); +} + +/** + * Maps a file extensions to a mimetype. + * + * @param $extension string The file extension. + * + * @return string|null + * + * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead. + */ +function mimetype_from_extension($extension) +{ + return MimeType::fromExtension($extension); +} + +/** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + * + * @internal + * + * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. + */ +function _parse_message($message) +{ + return Message::parseMessage($message); +} + +/** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + * + * @internal + * + * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. + */ +function _parse_request_uri($path, array $headers) +{ + return Message::parseRequestUri($path, $headers); +} + +/** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return string|null + * + * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead. + */ +function get_message_body_summary(MessageInterface $message, $truncateAt = 120) +{ + return Message::bodySummary($message, $truncateAt); +} + +/** + * Remove the items given by the keys, case insensitively from the data. + * + * @param iterable $keys + * + * @return array + * + * @internal + * + * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. + */ +function _caseless_remove($keys, array $data) +{ + return Utils::caselessRemove($keys, $data); +} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php new file mode 100644 index 00000000000..96a4a83a01a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php @@ -0,0 +1,6 @@ +=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/upload/system/storage/vendor/psr/http-message/src/MessageInterface.php b/upload/system/storage/vendor/psr/http-message/src/MessageInterface.php new file mode 100644 index 00000000000..dd46e5ec81e --- /dev/null +++ b/upload/system/storage/vendor/psr/http-message/src/MessageInterface.php @@ -0,0 +1,187 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * // Emit headers iteratively: + * foreach ($message->getHeaders() as $name => $values) { + * foreach ($values as $value) { + * header(sprintf('%s: %s', $name, $value), false); + * } + * } + * + * While header names are not case-sensitive, getHeaders() will preserve the + * exact case in which headers were originally specified. + * + * @return string[][] Returns an associative array of the message's headers. Each + * key MUST be a header name, and each value MUST be an array of strings + * for that header. + */ + public function getHeaders(); + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $name Case-insensitive header field name. + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader($name); + + /** + * Retrieves a message header value by the given case-insensitive name. + * + * This method returns an array of all the header values of the given + * case-insensitive header name. + * + * If the header does not appear in the message, this method MUST return an + * empty array. + * + * @param string $name Case-insensitive header field name. + * @return string[] An array of string values as provided for the given + * header. If the header does not appear in the message, this method MUST + * return an empty array. + */ + public function getHeader($name); + + /** + * Retrieves a comma-separated string of the values for a single header. + * + * This method returns all of the header values of the given + * case-insensitive header name as a string concatenated together using + * a comma. + * + * NOTE: Not all header values may be appropriately represented using + * comma concatenation. For such headers, use getHeader() instead + * and supply your own delimiter when concatenating. + * + * If the header does not appear in the message, this method MUST return + * an empty string. + * + * @param string $name Case-insensitive header field name. + * @return string A string of values as provided for the given header + * 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); + + /** + * Return an instance with the provided value replacing the specified header. + * + * While header names are case-insensitive, the casing of the header will + * be preserved by this function, and returned from getHeaders(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new and/or updated header and value. + * + * @param string $name Case-insensitive header field name. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withHeader($name, $value); + + /** + * Return an instance with the specified header appended with the given value. + * + * Existing values for the specified header will be maintained. The new + * value(s) will be appended to the existing list. If the header did not + * exist previously, it will be added. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * new header and/or value. + * + * @param string $name Case-insensitive header field name to add. + * @param string|string[] $value Header value(s). + * @return static + * @throws \InvalidArgumentException for invalid header names or values. + */ + public function withAddedHeader($name, $value); + + /** + * Return an instance without the specified header. + * + * Header resolution MUST be done without case-sensitivity. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the named header. + * + * @param string $name Case-insensitive header field name to remove. + * @return static + */ + public function withoutHeader($name); + + /** + * Gets the body of the message. + * + * @return StreamInterface Returns the body as a stream. + */ + public function getBody(); + + /** + * Return an instance with the specified message body. + * + * The body MUST be a StreamInterface object. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return a new instance that has the + * new body stream. + * + * @param StreamInterface $body Body. + * @return static + * @throws \InvalidArgumentException When the body is not valid. + */ + public function withBody(StreamInterface $body); +} diff --git a/upload/system/storage/vendor/psr/http-message/src/RequestInterface.php b/upload/system/storage/vendor/psr/http-message/src/RequestInterface.php new file mode 100644 index 00000000000..a96d4fd6366 --- /dev/null +++ b/upload/system/storage/vendor/psr/http-message/src/RequestInterface.php @@ -0,0 +1,129 @@ +getQuery()` + * or from the `QUERY_STRING` server param. + * + * @return array + */ + public function getQueryParams(); + + /** + * Return an instance with the specified query string arguments. + * + * These values SHOULD remain immutable over the course of the incoming + * request. They MAY be injected during instantiation, such as from PHP's + * $_GET superglobal, or MAY be derived from some other value such as the + * URI. In cases where the arguments are parsed from the URI, the data + * MUST be compatible with what PHP's parse_str() would return for + * purposes of how duplicate query parameters are handled, and how nested + * sets are handled. + * + * Setting query string arguments MUST NOT change the URI stored by the + * request, nor the values in the server params. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated query string arguments. + * + * @param array $query Array of query string arguments, typically from + * $_GET. + * @return static + */ + public function withQueryParams(array $query); + + /** + * Retrieve normalized file upload data. + * + * This method returns upload metadata in a normalized tree, with each leaf + * an instance of Psr\Http\Message\UploadedFileInterface. + * + * These values MAY be prepared from $_FILES or the message body during + * instantiation, or MAY be injected via withUploadedFiles(). + * + * @return array An array tree of UploadedFileInterface instances; an empty + * array MUST be returned if no data is present. + */ + public function getUploadedFiles(); + + /** + * Create a new instance with the specified uploaded files. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param array $uploadedFiles An array tree of UploadedFileInterface instances. + * @return static + * @throws \InvalidArgumentException if an invalid structure is provided. + */ + public function withUploadedFiles(array $uploadedFiles); + + /** + * Retrieve any parameters provided in the request body. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, this method MUST + * return the contents of $_POST. + * + * Otherwise, this method may return any results of deserializing + * the request body content; as parsing returns structured content, the + * potential types MUST be arrays or objects only. A null value indicates + * the absence of body content. + * + * @return null|array|object The deserialized body parameters, if any. + * These will typically be an array or object. + */ + public function getParsedBody(); + + /** + * Return an instance with the specified body parameters. + * + * These MAY be injected during instantiation. + * + * If the request Content-Type is either application/x-www-form-urlencoded + * or multipart/form-data, and the request method is POST, use this method + * ONLY to inject the contents of $_POST. + * + * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of + * deserializing the request body content. Deserialization/parsing returns + * structured data, and, as such, this method ONLY accepts arrays or objects, + * or a null value if nothing was available to parse. + * + * As an example, if content negotiation determines that the request data + * is a JSON payload, this method could be used to create a request + * instance with the deserialized parameters. + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated body parameters. + * + * @param null|array|object $data The deserialized body data. This will + * typically be in an array or object. + * @return static + * @throws \InvalidArgumentException if an unsupported argument type is + * provided. + */ + public function withParsedBody($data); + + /** + * Retrieve attributes derived from the request. + * + * The request "attributes" may be used to allow injection of any + * parameters derived from the request: e.g., the results of path + * match operations; the results of decrypting cookies; the results of + * deserializing non-form-encoded message bodies; etc. Attributes + * will be application and request specific, and CAN be mutable. + * + * @return array Attributes derived from the request. + */ + public function getAttributes(); + + /** + * Retrieve a single derived request attribute. + * + * Retrieves a single derived request attribute as described in + * getAttributes(). If the attribute has not been previously set, returns + * the default value as provided. + * + * This method obviates the need for a hasAttribute() method, as it allows + * specifying a default value to return if the attribute is not found. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $default Default value to return if the attribute does not exist. + * @return mixed + */ + public function getAttribute($name, $default = null); + + /** + * Return an instance with the specified derived request attribute. + * + * This method allows setting a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that has the + * updated attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @param mixed $value The value of the attribute. + * @return static + */ + public function withAttribute($name, $value); + + /** + * Return an instance that removes the specified derived request attribute. + * + * This method allows removing a single derived request attribute as + * described in getAttributes(). + * + * This method MUST be implemented in such a way as to retain the + * immutability of the message, and MUST return an instance that removes + * the attribute. + * + * @see getAttributes() + * @param string $name The attribute name. + * @return static + */ + public function withoutAttribute($name); +} diff --git a/upload/system/storage/vendor/psr/http-message/src/StreamInterface.php b/upload/system/storage/vendor/psr/http-message/src/StreamInterface.php new file mode 100644 index 00000000000..f68f391269b --- /dev/null +++ b/upload/system/storage/vendor/psr/http-message/src/StreamInterface.php @@ -0,0 +1,158 @@ + + * [user-info@]host[:port] + * + * + * If the port component is not set or is the standard port for the current + * scheme, it SHOULD NOT be included. + * + * @see https://tools.ietf.org/html/rfc3986#section-3.2 + * @return string The URI authority, in "[user-info@]host[:port]" format. + */ + public function getAuthority(); + + /** + * Retrieve the user information component of the URI. + * + * If no user information is present, this method MUST return an empty + * string. + * + * If a user is present in the URI, this will return that value; + * additionally, if the password is also present, it will be appended to the + * user value, with a colon (":") separating the values. + * + * The trailing "@" character is not part of the user information and MUST + * NOT be added. + * + * @return string The URI user information, in "username[:password]" format. + */ + public function getUserInfo(); + + /** + * Retrieve the host component of the URI. + * + * If no host is present, this method MUST return an empty string. + * + * The value returned MUST be normalized to lowercase, per RFC 3986 + * Section 3.2.2. + * + * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 + * @return string The URI host. + */ + public function getHost(); + + /** + * Retrieve the port component of the URI. + * + * If a port is present, and it is non-standard for the current scheme, + * this method MUST return it as an integer. If the port is the standard port + * used with the current scheme, this method SHOULD return null. + * + * If no port is present, and no scheme is present, this method MUST return + * a null value. + * + * If no port is present, but a scheme is present, this method MAY return + * the standard port for that scheme, but SHOULD return null. + * + * @return null|int The URI port. + */ + public function getPort(); + + /** + * Retrieve the path component of the URI. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * Normally, the empty path "" and absolute path "/" are considered equal as + * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically + * do this normalization because in contexts with a trimmed base path, e.g. + * the front controller, this difference becomes significant. It's the task + * of the user to handle both "" and "/". + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.3. + * + * As an example, if the value should include a slash ("/") not intended as + * delimiter between path segments, that value MUST be passed in encoded + * form (e.g., "%2F") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.3 + * @return string The URI path. + */ + public function getPath(); + + /** + * Retrieve the query string of the URI. + * + * If no query string is present, this method MUST return an empty string. + * + * The leading "?" character is not part of the query and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.4. + * + * As an example, if a value in a key/value pair of the query string should + * include an ampersand ("&") not intended as a delimiter between values, + * that value MUST be passed in encoded form (e.g., "%26") to the instance. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.4 + * @return string The URI query string. + */ + public function getQuery(); + + /** + * Retrieve the fragment component of the URI. + * + * If no fragment is present, this method MUST return an empty string. + * + * The leading "#" character is not part of the fragment and MUST NOT be + * added. + * + * The value returned MUST be percent-encoded, but MUST NOT double-encode + * any characters. To determine what characters to encode, please refer to + * RFC 3986, Sections 2 and 3.5. + * + * @see https://tools.ietf.org/html/rfc3986#section-2 + * @see https://tools.ietf.org/html/rfc3986#section-3.5 + * @return string The URI fragment. + */ + public function getFragment(); + + /** + * Return an instance with the specified scheme. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified scheme. + * + * Implementations MUST support the schemes "http" and "https" case + * insensitively, and MAY accommodate other schemes if required. + * + * An empty scheme is equivalent to removing the scheme. + * + * @param string $scheme The scheme to use with the new instance. + * @return static A new instance with the specified scheme. + * @throws \InvalidArgumentException for invalid or unsupported schemes. + */ + public function withScheme($scheme); + + /** + * Return an instance with the specified user information. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified user information. + * + * Password is optional, but the user information MUST include the + * user; an empty string for the user is equivalent to removing user + * information. + * + * @param string $user The user name to use for authority. + * @param null|string $password The password associated with $user. + * @return static A new instance with the specified user information. + */ + public function withUserInfo($user, $password = null); + + /** + * Return an instance with the specified host. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified host. + * + * An empty host value is equivalent to removing the host. + * + * @param string $host The hostname to use with the new instance. + * @return static A new instance with the specified host. + * @throws \InvalidArgumentException for invalid hostnames. + */ + public function withHost($host); + + /** + * Return an instance with the specified port. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified port. + * + * Implementations MUST raise an exception for ports outside the + * established TCP and UDP port ranges. + * + * A null value provided for the port is equivalent to removing the port + * information. + * + * @param null|int $port The port to use with the new instance; a null value + * removes the port information. + * @return static A new instance with the specified port. + * @throws \InvalidArgumentException for invalid ports. + */ + public function withPort($port); + + /** + * Return an instance with the specified path. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified path. + * + * The path can either be empty or absolute (starting with a slash) or + * rootless (not starting with a slash). Implementations MUST support all + * three syntaxes. + * + * If the path is intended to be domain-relative rather than path relative then + * it must begin with a slash ("/"). Paths not starting with a slash ("/") + * are assumed to be relative to some base path known to the application or + * consumer. + * + * Users can provide both encoded and decoded path characters. + * Implementations ensure the correct encoding as outlined in getPath(). + * + * @param string $path The path to use with the new instance. + * @return static A new instance with the specified path. + * @throws \InvalidArgumentException for invalid paths. + */ + public function withPath($path); + + /** + * Return an instance with the specified query string. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified query string. + * + * Users can provide both encoded and decoded query characters. + * Implementations ensure the correct encoding as outlined in getQuery(). + * + * An empty query string value is equivalent to removing the query string. + * + * @param string $query The query string to use with the new instance. + * @return static A new instance with the specified query string. + * @throws \InvalidArgumentException for invalid query strings. + */ + public function withQuery($query); + + /** + * Return an instance with the specified URI fragment. + * + * This method MUST retain the state of the current instance, and return + * an instance that contains the specified URI fragment. + * + * Users can provide both encoded and decoded fragment characters. + * Implementations ensure the correct encoding as outlined in getFragment(). + * + * An empty fragment value is equivalent to removing the fragment. + * + * @param string $fragment The fragment to use with the new instance. + * @return static A new instance with the specified fragment. + */ + public function withFragment($fragment); + + /** + * Return the string representation as a URI reference. + * + * Depending on which components of the URI are present, the resulting + * string is either a full URI or relative reference according to RFC 3986, + * Section 4.1. The method concatenates the various components of the URI, + * using the appropriate delimiters: + * + * - If a scheme is present, it MUST be suffixed by ":". + * - If an authority is present, it MUST be prefixed by "//". + * - The path can be concatenated without delimiters. But there are two + * cases where the path has to be adjusted to make the URI reference + * valid as PHP does not allow to throw an exception in __toString(): + * - If the path is rootless and an authority is present, the path MUST + * be prefixed by "/". + * - If the path is starting with more than one "/" and no authority is + * present, the starting slashes MUST be reduced to one. + * - If a query is present, it MUST be prefixed by "?". + * - If a fragment is present, it MUST be prefixed by "#". + * + * @see http://tools.ietf.org/html/rfc3986#section-4.1 + * @return string + */ + public function __toString(); +} diff --git a/upload/system/storage/vendor/psr/log b/upload/system/storage/vendor/psr/log deleted file mode 160000 index 6c001f1daaf..00000000000 --- a/upload/system/storage/vendor/psr/log +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/LICENSE b/upload/system/storage/vendor/ralouphie/getallheaders/LICENSE new file mode 100644 index 00000000000..be5540c2af7 --- /dev/null +++ b/upload/system/storage/vendor/ralouphie/getallheaders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Ralph Khattar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/README.md b/upload/system/storage/vendor/ralouphie/getallheaders/README.md new file mode 100644 index 00000000000..9430d76bbc2 --- /dev/null +++ b/upload/system/storage/vendor/ralouphie/getallheaders/README.md @@ -0,0 +1,27 @@ +getallheaders +============= + +PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. + +[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) +[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) +[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) +[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) + + +This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). + +## Install + +For PHP version **`>= 5.6`**: + +``` +composer require ralouphie/getallheaders +``` + +For PHP version **`< 5.6`**: + +``` +composer require ralouphie/getallheaders "^2" +``` diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/composer.json b/upload/system/storage/vendor/ralouphie/getallheaders/composer.json new file mode 100644 index 00000000000..de8ce62e45d --- /dev/null +++ b/upload/system/storage/vendor/ralouphie/getallheaders/composer.json @@ -0,0 +1,26 @@ +{ + "name": "ralouphie/getallheaders", + "description": "A polyfill for getallheaders.", + "license": "MIT", + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5 || ^6.5", + "php-coveralls/php-coveralls": "^2.1" + }, + "autoload": { + "files": ["src/getallheaders.php"] + }, + "autoload-dev": { + "psr-4": { + "getallheaders\\Tests\\": "tests/" + } + } +} diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php b/upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php new file mode 100644 index 00000000000..c7285a5ba16 --- /dev/null +++ b/upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php @@ -0,0 +1,46 @@ + 'Content-Type', + 'CONTENT_LENGTH' => 'Content-Length', + 'CONTENT_MD5' => 'Content-Md5', + ); + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) === 'HTTP_') { + $key = substr($key, 5); + if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { + $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); + $headers[$key] = $value; + } + } elseif (isset($copy_server[$key])) { + $headers[$copy_server[$key]] = $value; + } + } + + if (!isset($headers['Authorization'])) { + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { + $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + } elseif (isset($_SERVER['PHP_AUTH_USER'])) { + $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; + $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); + } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { + $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; + } + } + + return $headers; + } + +} diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php b/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php index 58414dc73bd..ba75a2c95fc 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php @@ -25,13 +25,13 @@ final class Ctype * * @see https://php.net/ctype-alnum * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alnum($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); } @@ -41,13 +41,13 @@ public static function ctype_alnum($text) * * @see https://php.net/ctype-alpha * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alpha($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); } @@ -57,13 +57,13 @@ public static function ctype_alpha($text) * * @see https://php.net/ctype-cntrl * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_cntrl($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); } @@ -73,13 +73,13 @@ public static function ctype_cntrl($text) * * @see https://php.net/ctype-digit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_digit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); } @@ -89,13 +89,13 @@ public static function ctype_digit($text) * * @see https://php.net/ctype-graph * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_graph($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); } @@ -105,13 +105,13 @@ public static function ctype_graph($text) * * @see https://php.net/ctype-lower * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_lower($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); } @@ -121,13 +121,13 @@ public static function ctype_lower($text) * * @see https://php.net/ctype-print * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_print($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); } @@ -137,13 +137,13 @@ public static function ctype_print($text) * * @see https://php.net/ctype-punct * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_punct($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); } @@ -153,13 +153,13 @@ public static function ctype_punct($text) * * @see https://php.net/ctype-space * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_space($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); } @@ -169,13 +169,13 @@ public static function ctype_space($text) * * @see https://php.net/ctype-upper * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_upper($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); } @@ -185,13 +185,13 @@ public static function ctype_upper($text) * * @see https://php.net/ctype-xdigit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_xdigit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); } @@ -204,11 +204,12 @@ public static function ctype_xdigit($text) * (negative values have 256 added in order to allow characters in the Extended ASCII range). * Any other integer is interpreted as a string containing the decimal digits of the integer. * - * @param string|int $int + * @param mixed $int + * @param string $function * * @return mixed */ - private static function convert_int_to_char_for_ctype($int) + private static function convert_int_to_char_for_ctype($int, $function) { if (!\is_int($int)) { return $int; @@ -218,6 +219,10 @@ private static function convert_int_to_char_for_ctype($int) return (string) $int; } + if (\PHP_VERSION_ID >= 80100) { + @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); + } + if ($int < 0) { $int += 256; } diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php index 8d6fc4becca..d54524b31b4 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php @@ -11,6 +11,10 @@ use Symfony\Polyfill\Ctype as p; +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + if (!function_exists('ctype_alnum')) { function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } } diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php new file mode 100644 index 00000000000..ab2f8611dac --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Ctype as p; + +if (!function_exists('ctype_alnum')) { + function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } +} +if (!function_exists('ctype_alpha')) { + function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } +} +if (!function_exists('ctype_cntrl')) { + function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } +} +if (!function_exists('ctype_digit')) { + function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } +} +if (!function_exists('ctype_graph')) { + function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } +} +if (!function_exists('ctype_lower')) { + function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } +} +if (!function_exists('ctype_print')) { + function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } +} +if (!function_exists('ctype_punct')) { + function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } +} +if (!function_exists('ctype_space')) { + function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } +} +if (!function_exists('ctype_upper')) { + function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } +} +if (!function_exists('ctype_xdigit')) { + function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json b/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json index 90108c65bd1..ccb8e570358 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json @@ -16,7 +16,10 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, @@ -28,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php new file mode 100644 index 00000000000..fee3026df26 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php @@ -0,0 +1,925 @@ + and Trevor Rowbotham + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Idn; + +use Exception; +use Normalizer; +use Symfony\Polyfill\Intl\Idn\Resources\unidata\DisallowedRanges; +use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex; + +/** + * @see https://www.unicode.org/reports/tr46/ + * + * @internal + */ +final class Idn +{ + public const ERROR_EMPTY_LABEL = 1; + public const ERROR_LABEL_TOO_LONG = 2; + public const ERROR_DOMAIN_NAME_TOO_LONG = 4; + public const ERROR_LEADING_HYPHEN = 8; + public const ERROR_TRAILING_HYPHEN = 0x10; + public const ERROR_HYPHEN_3_4 = 0x20; + public const ERROR_LEADING_COMBINING_MARK = 0x40; + public const ERROR_DISALLOWED = 0x80; + public const ERROR_PUNYCODE = 0x100; + public const ERROR_LABEL_HAS_DOT = 0x200; + public const ERROR_INVALID_ACE_LABEL = 0x400; + public const ERROR_BIDI = 0x800; + public const ERROR_CONTEXTJ = 0x1000; + public const ERROR_CONTEXTO_PUNCTUATION = 0x2000; + public const ERROR_CONTEXTO_DIGITS = 0x4000; + + public const INTL_IDNA_VARIANT_2003 = 0; + public const INTL_IDNA_VARIANT_UTS46 = 1; + + public const IDNA_DEFAULT = 0; + public const IDNA_ALLOW_UNASSIGNED = 1; + public const IDNA_USE_STD3_RULES = 2; + public const IDNA_CHECK_BIDI = 4; + public const IDNA_CHECK_CONTEXTJ = 8; + public const IDNA_NONTRANSITIONAL_TO_ASCII = 16; + public const IDNA_NONTRANSITIONAL_TO_UNICODE = 32; + + public const MAX_DOMAIN_SIZE = 253; + public const MAX_LABEL_SIZE = 63; + + public const BASE = 36; + public const TMIN = 1; + public const TMAX = 26; + public const SKEW = 38; + public const DAMP = 700; + public const INITIAL_BIAS = 72; + public const INITIAL_N = 128; + public const DELIMITER = '-'; + public const MAX_INT = 2147483647; + + /** + * Contains the numeric value of a basic code point (for use in representing integers) in the + * range 0 to BASE-1, or -1 if b is does not represent a value. + * + * @var array + */ + private static $basicToDigit = [ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, + + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, + + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + ]; + + /** + * @var array + */ + private static $virama; + + /** + * @var array + */ + private static $mapped; + + /** + * @var array + */ + private static $ignored; + + /** + * @var array + */ + private static $deviation; + + /** + * @var array + */ + private static $disallowed; + + /** + * @var array + */ + private static $disallowed_STD3_mapped; + + /** + * @var array + */ + private static $disallowed_STD3_valid; + + /** + * @var bool + */ + private static $mappingTableLoaded = false; + + /** + * @see https://www.unicode.org/reports/tr46/#ToASCII + * + * @param string $domainName + * @param int $options + * @param int $variant + * @param array $idna_info + * + * @return string|false + */ + public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) + { + if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { + @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); + } + + $options = [ + 'CheckHyphens' => true, + 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), + 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), + 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), + 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_ASCII), + 'VerifyDnsLength' => true, + ]; + $info = new Info(); + $labels = self::process((string) $domainName, $options, $info); + + foreach ($labels as $i => $label) { + // Only convert labels to punycode that contain non-ASCII code points + if (1 === preg_match('/[^\x00-\x7F]/', $label)) { + try { + $label = 'xn--'.self::punycodeEncode($label); + } catch (Exception $e) { + $info->errors |= self::ERROR_PUNYCODE; + } + + $labels[$i] = $label; + } + } + + if ($options['VerifyDnsLength']) { + self::validateDomainAndLabelLength($labels, $info); + } + + $idna_info = [ + 'result' => implode('.', $labels), + 'isTransitionalDifferent' => $info->transitionalDifferent, + 'errors' => $info->errors, + ]; + + return 0 === $info->errors ? $idna_info['result'] : false; + } + + /** + * @see https://www.unicode.org/reports/tr46/#ToUnicode + * + * @param string $domainName + * @param int $options + * @param int $variant + * @param array $idna_info + * + * @return string|false + */ + public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) + { + if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { + @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); + } + + $info = new Info(); + $labels = self::process((string) $domainName, [ + 'CheckHyphens' => true, + 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), + 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), + 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), + 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_UNICODE), + ], $info); + $idna_info = [ + 'result' => implode('.', $labels), + 'isTransitionalDifferent' => $info->transitionalDifferent, + 'errors' => $info->errors, + ]; + + return 0 === $info->errors ? $idna_info['result'] : false; + } + + /** + * @param string $label + * + * @return bool + */ + private static function isValidContextJ(array $codePoints, $label) + { + if (!isset(self::$virama)) { + self::$virama = require __DIR__.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'unidata'.\DIRECTORY_SEPARATOR.'virama.php'; + } + + $offset = 0; + + foreach ($codePoints as $i => $codePoint) { + if (0x200C !== $codePoint && 0x200D !== $codePoint) { + continue; + } + + if (!isset($codePoints[$i - 1])) { + return false; + } + + // If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True; + if (isset(self::$virama[$codePoints[$i - 1]])) { + continue; + } + + // If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C(Joining_Type:T)*(Joining_Type:{R,D})) Then + // True; + // Generated RegExp = ([Joining_Type:{L,D}][Joining_Type:T]*\u200C[Joining_Type:T]*)[Joining_Type:{R,D}] + if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset)) { + $offset += \strlen($matches[1][0]); + + continue; + } + + return false; + } + + return true; + } + + /** + * @see https://www.unicode.org/reports/tr46/#ProcessingStepMap + * + * @param string $input + * @param array $options + * + * @return string + */ + private static function mapCodePoints($input, array $options, Info $info) + { + $str = ''; + $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; + $transitional = $options['Transitional_Processing']; + + foreach (self::utf8Decode($input) as $codePoint) { + $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); + + switch ($data['status']) { + case 'disallowed': + $info->errors |= self::ERROR_DISALLOWED; + + // no break. + + case 'valid': + $str .= mb_chr($codePoint, 'utf-8'); + + break; + + case 'ignored': + // Do nothing. + break; + + case 'mapped': + $str .= $data['mapping']; + + break; + + case 'deviation': + $info->transitionalDifferent = true; + $str .= ($transitional ? $data['mapping'] : mb_chr($codePoint, 'utf-8')); + + break; + } + } + + return $str; + } + + /** + * @see https://www.unicode.org/reports/tr46/#Processing + * + * @param string $domain + * @param array $options + * + * @return array + */ + private static function process($domain, array $options, Info $info) + { + // If VerifyDnsLength is not set, we are doing ToUnicode otherwise we are doing ToASCII and + // we need to respect the VerifyDnsLength option. + $checkForEmptyLabels = !isset($options['VerifyDnsLength']) || $options['VerifyDnsLength']; + + if ($checkForEmptyLabels && '' === $domain) { + $info->errors |= self::ERROR_EMPTY_LABEL; + + return [$domain]; + } + + // Step 1. Map each code point in the domain name string + $domain = self::mapCodePoints($domain, $options, $info); + + // Step 2. Normalize the domain name string to Unicode Normalization Form C. + if (!Normalizer::isNormalized($domain, Normalizer::FORM_C)) { + $domain = Normalizer::normalize($domain, Normalizer::FORM_C); + } + + // Step 3. Break the string into labels at U+002E (.) FULL STOP. + $labels = explode('.', $domain); + $lastLabelIndex = \count($labels) - 1; + + // Step 4. Convert and validate each label in the domain name string. + foreach ($labels as $i => $label) { + $validationOptions = $options; + + if ('xn--' === substr($label, 0, 4)) { + try { + $label = self::punycodeDecode(substr($label, 4)); + } catch (Exception $e) { + $info->errors |= self::ERROR_PUNYCODE; + + continue; + } + + $validationOptions['Transitional_Processing'] = false; + $labels[$i] = $label; + } + + self::validateLabel($label, $info, $validationOptions, $i > 0 && $i === $lastLabelIndex); + } + + if ($info->bidiDomain && !$info->validBidiDomain) { + $info->errors |= self::ERROR_BIDI; + } + + // Any input domain name string that does not record an error has been successfully + // processed according to this specification. Conversely, if an input domain_name string + // causes an error, then the processing of the input domain_name string fails. Determining + // what to do with error input is up to the caller, and not in the scope of this document. + return $labels; + } + + /** + * @see https://tools.ietf.org/html/rfc5893#section-2 + * + * @param string $label + */ + private static function validateBidiLabel($label, Info $info) + { + if (1 === preg_match(Regex::RTL_LABEL, $label)) { + $info->bidiDomain = true; + + // Step 1. The first character must be a character with Bidi property L, R, or AL. + // If it has the R or AL property, it is an RTL label + if (1 !== preg_match(Regex::BIDI_STEP_1_RTL, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 2. In an RTL label, only characters with the Bidi properties R, AL, AN, EN, ES, + // CS, ET, ON, BN, or NSM are allowed. + if (1 === preg_match(Regex::BIDI_STEP_2, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 3. In an RTL label, the end of the label must be a character with Bidi property + // R, AL, EN, or AN, followed by zero or more characters with Bidi property NSM. + if (1 !== preg_match(Regex::BIDI_STEP_3, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 4. In an RTL label, if an EN is present, no AN may be present, and vice versa. + if (1 === preg_match(Regex::BIDI_STEP_4_AN, $label) && 1 === preg_match(Regex::BIDI_STEP_4_EN, $label)) { + $info->validBidiDomain = false; + + return; + } + + return; + } + + // We are a LTR label + // Step 1. The first character must be a character with Bidi property L, R, or AL. + // If it has the L property, it is an LTR label. + if (1 !== preg_match(Regex::BIDI_STEP_1_LTR, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 5. In an LTR label, only characters with the Bidi properties L, EN, + // ES, CS, ET, ON, BN, or NSM are allowed. + if (1 === preg_match(Regex::BIDI_STEP_5, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 6.In an LTR label, the end of the label must be a character with Bidi property L or + // EN, followed by zero or more characters with Bidi property NSM. + if (1 !== preg_match(Regex::BIDI_STEP_6, $label)) { + $info->validBidiDomain = false; + + return; + } + } + + /** + * @param array $labels + */ + private static function validateDomainAndLabelLength(array $labels, Info $info) + { + $maxDomainSize = self::MAX_DOMAIN_SIZE; + $length = \count($labels); + + // Number of "." delimiters. + $domainLength = $length - 1; + + // If the last label is empty and it is not the first label, then it is the root label. + // Increase the max size by 1, making it 254, to account for the root label's "." + // delimiter. This also means we don't need to check the last label's length for being too + // long. + if ($length > 1 && '' === $labels[$length - 1]) { + ++$maxDomainSize; + --$length; + } + + for ($i = 0; $i < $length; ++$i) { + $bytes = \strlen($labels[$i]); + $domainLength += $bytes; + + if ($bytes > self::MAX_LABEL_SIZE) { + $info->errors |= self::ERROR_LABEL_TOO_LONG; + } + } + + if ($domainLength > $maxDomainSize) { + $info->errors |= self::ERROR_DOMAIN_NAME_TOO_LONG; + } + } + + /** + * @see https://www.unicode.org/reports/tr46/#Validity_Criteria + * + * @param string $label + * @param array $options + * @param bool $canBeEmpty + */ + private static function validateLabel($label, Info $info, array $options, $canBeEmpty) + { + if ('' === $label) { + if (!$canBeEmpty && (!isset($options['VerifyDnsLength']) || $options['VerifyDnsLength'])) { + $info->errors |= self::ERROR_EMPTY_LABEL; + } + + return; + } + + // Step 1. The label must be in Unicode Normalization Form C. + if (!Normalizer::isNormalized($label, Normalizer::FORM_C)) { + $info->errors |= self::ERROR_INVALID_ACE_LABEL; + } + + $codePoints = self::utf8Decode($label); + + if ($options['CheckHyphens']) { + // Step 2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character + // in both the thrid and fourth positions. + if (isset($codePoints[2], $codePoints[3]) && 0x002D === $codePoints[2] && 0x002D === $codePoints[3]) { + $info->errors |= self::ERROR_HYPHEN_3_4; + } + + // Step 3. If CheckHyphens, the label must neither begin nor end with a U+002D + // HYPHEN-MINUS character. + if ('-' === substr($label, 0, 1)) { + $info->errors |= self::ERROR_LEADING_HYPHEN; + } + + if ('-' === substr($label, -1, 1)) { + $info->errors |= self::ERROR_TRAILING_HYPHEN; + } + } + + // Step 4. The label must not contain a U+002E (.) FULL STOP. + if (false !== strpos($label, '.')) { + $info->errors |= self::ERROR_LABEL_HAS_DOT; + } + + // Step 5. The label must not begin with a combining mark, that is: General_Category=Mark. + if (1 === preg_match(Regex::COMBINING_MARK, $label)) { + $info->errors |= self::ERROR_LEADING_COMBINING_MARK; + } + + // Step 6. Each code point in the label must only have certain status values according to + // Section 5, IDNA Mapping Table: + $transitional = $options['Transitional_Processing']; + $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; + + foreach ($codePoints as $codePoint) { + $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); + $status = $data['status']; + + if ('valid' === $status || (!$transitional && 'deviation' === $status)) { + continue; + } + + $info->errors |= self::ERROR_DISALLOWED; + + break; + } + + // Step 7. If CheckJoiners, the label must satisify the ContextJ rules from Appendix A, in + // The Unicode Code Points and Internationalized Domain Names for Applications (IDNA) + // [IDNA2008]. + if ($options['CheckJoiners'] && !self::isValidContextJ($codePoints, $label)) { + $info->errors |= self::ERROR_CONTEXTJ; + } + + // Step 8. If CheckBidi, and if the domain name is a Bidi domain name, then the label must + // satisfy all six of the numbered conditions in [IDNA2008] RFC 5893, Section 2. + if ($options['CheckBidi'] && (!$info->bidiDomain || $info->validBidiDomain)) { + self::validateBidiLabel($label, $info); + } + } + + /** + * @see https://tools.ietf.org/html/rfc3492#section-6.2 + * + * @param string $input + * + * @return string + */ + private static function punycodeDecode($input) + { + $n = self::INITIAL_N; + $out = 0; + $i = 0; + $bias = self::INITIAL_BIAS; + $lastDelimIndex = strrpos($input, self::DELIMITER); + $b = false === $lastDelimIndex ? 0 : $lastDelimIndex; + $inputLength = \strlen($input); + $output = []; + $bytes = array_map('ord', str_split($input)); + + for ($j = 0; $j < $b; ++$j) { + if ($bytes[$j] > 0x7F) { + throw new Exception('Invalid input'); + } + + $output[$out++] = $input[$j]; + } + + if ($b > 0) { + ++$b; + } + + for ($in = $b; $in < $inputLength; ++$out) { + $oldi = $i; + $w = 1; + + for ($k = self::BASE; /* no condition */; $k += self::BASE) { + if ($in >= $inputLength) { + throw new Exception('Invalid input'); + } + + $digit = self::$basicToDigit[$bytes[$in++] & 0xFF]; + + if ($digit < 0) { + throw new Exception('Invalid input'); + } + + if ($digit > intdiv(self::MAX_INT - $i, $w)) { + throw new Exception('Integer overflow'); + } + + $i += $digit * $w; + + if ($k <= $bias) { + $t = self::TMIN; + } elseif ($k >= $bias + self::TMAX) { + $t = self::TMAX; + } else { + $t = $k - $bias; + } + + if ($digit < $t) { + break; + } + + $baseMinusT = self::BASE - $t; + + if ($w > intdiv(self::MAX_INT, $baseMinusT)) { + throw new Exception('Integer overflow'); + } + + $w *= $baseMinusT; + } + + $outPlusOne = $out + 1; + $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi); + + if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) { + throw new Exception('Integer overflow'); + } + + $n += intdiv($i, $outPlusOne); + $i %= $outPlusOne; + array_splice($output, $i++, 0, [mb_chr($n, 'utf-8')]); + } + + return implode('', $output); + } + + /** + * @see https://tools.ietf.org/html/rfc3492#section-6.3 + * + * @param string $input + * + * @return string + */ + private static function punycodeEncode($input) + { + $n = self::INITIAL_N; + $delta = 0; + $out = 0; + $bias = self::INITIAL_BIAS; + $inputLength = 0; + $output = ''; + $iter = self::utf8Decode($input); + + foreach ($iter as $codePoint) { + ++$inputLength; + + if ($codePoint < 0x80) { + $output .= \chr($codePoint); + ++$out; + } + } + + $h = $out; + $b = $out; + + if ($b > 0) { + $output .= self::DELIMITER; + ++$out; + } + + while ($h < $inputLength) { + $m = self::MAX_INT; + + foreach ($iter as $codePoint) { + if ($codePoint >= $n && $codePoint < $m) { + $m = $codePoint; + } + } + + if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) { + throw new Exception('Integer overflow'); + } + + $delta += ($m - $n) * ($h + 1); + $n = $m; + + foreach ($iter as $codePoint) { + if ($codePoint < $n && 0 === ++$delta) { + throw new Exception('Integer overflow'); + } + + if ($codePoint === $n) { + $q = $delta; + + for ($k = self::BASE; /* no condition */; $k += self::BASE) { + if ($k <= $bias) { + $t = self::TMIN; + } elseif ($k >= $bias + self::TMAX) { + $t = self::TMAX; + } else { + $t = $k - $bias; + } + + if ($q < $t) { + break; + } + + $qMinusT = $q - $t; + $baseMinusT = self::BASE - $t; + $output .= self::encodeDigit($t + ($qMinusT) % ($baseMinusT), false); + ++$out; + $q = intdiv($qMinusT, $baseMinusT); + } + + $output .= self::encodeDigit($q, false); + ++$out; + $bias = self::adaptBias($delta, $h + 1, $h === $b); + $delta = 0; + ++$h; + } + } + + ++$delta; + ++$n; + } + + return $output; + } + + /** + * @see https://tools.ietf.org/html/rfc3492#section-6.1 + * + * @param int $delta + * @param int $numPoints + * @param bool $firstTime + * + * @return int + */ + private static function adaptBias($delta, $numPoints, $firstTime) + { + // xxx >> 1 is a faster way of doing intdiv(xxx, 2) + $delta = $firstTime ? intdiv($delta, self::DAMP) : $delta >> 1; + $delta += intdiv($delta, $numPoints); + $k = 0; + + while ($delta > ((self::BASE - self::TMIN) * self::TMAX) >> 1) { + $delta = intdiv($delta, self::BASE - self::TMIN); + $k += self::BASE; + } + + return $k + intdiv((self::BASE - self::TMIN + 1) * $delta, $delta + self::SKEW); + } + + /** + * @param int $d + * @param bool $flag + * + * @return string + */ + private static function encodeDigit($d, $flag) + { + return \chr($d + 22 + 75 * ($d < 26 ? 1 : 0) - (($flag ? 1 : 0) << 5)); + } + + /** + * Takes a UTF-8 encoded string and converts it into a series of integer code points. Any + * invalid byte sequences will be replaced by a U+FFFD replacement code point. + * + * @see https://encoding.spec.whatwg.org/#utf-8-decoder + * + * @param string $input + * + * @return array + */ + private static function utf8Decode($input) + { + $bytesSeen = 0; + $bytesNeeded = 0; + $lowerBoundary = 0x80; + $upperBoundary = 0xBF; + $codePoint = 0; + $codePoints = []; + $length = \strlen($input); + + for ($i = 0; $i < $length; ++$i) { + $byte = \ord($input[$i]); + + if (0 === $bytesNeeded) { + if ($byte >= 0x00 && $byte <= 0x7F) { + $codePoints[] = $byte; + + continue; + } + + if ($byte >= 0xC2 && $byte <= 0xDF) { + $bytesNeeded = 1; + $codePoint = $byte & 0x1F; + } elseif ($byte >= 0xE0 && $byte <= 0xEF) { + if (0xE0 === $byte) { + $lowerBoundary = 0xA0; + } elseif (0xED === $byte) { + $upperBoundary = 0x9F; + } + + $bytesNeeded = 2; + $codePoint = $byte & 0xF; + } elseif ($byte >= 0xF0 && $byte <= 0xF4) { + if (0xF0 === $byte) { + $lowerBoundary = 0x90; + } elseif (0xF4 === $byte) { + $upperBoundary = 0x8F; + } + + $bytesNeeded = 3; + $codePoint = $byte & 0x7; + } else { + $codePoints[] = 0xFFFD; + } + + continue; + } + + if ($byte < $lowerBoundary || $byte > $upperBoundary) { + $codePoint = 0; + $bytesNeeded = 0; + $bytesSeen = 0; + $lowerBoundary = 0x80; + $upperBoundary = 0xBF; + --$i; + $codePoints[] = 0xFFFD; + + continue; + } + + $lowerBoundary = 0x80; + $upperBoundary = 0xBF; + $codePoint = ($codePoint << 6) | ($byte & 0x3F); + + if (++$bytesSeen !== $bytesNeeded) { + continue; + } + + $codePoints[] = $codePoint; + $codePoint = 0; + $bytesNeeded = 0; + $bytesSeen = 0; + } + + // String unexpectedly ended, so append a U+FFFD code point. + if (0 !== $bytesNeeded) { + $codePoints[] = 0xFFFD; + } + + return $codePoints; + } + + /** + * @param int $codePoint + * @param bool $useSTD3ASCIIRules + * + * @return array{status: string, mapping?: string} + */ + private static function lookupCodePointStatus($codePoint, $useSTD3ASCIIRules) + { + if (!self::$mappingTableLoaded) { + self::$mappingTableLoaded = true; + self::$mapped = require __DIR__.'/Resources/unidata/mapped.php'; + self::$ignored = require __DIR__.'/Resources/unidata/ignored.php'; + self::$deviation = require __DIR__.'/Resources/unidata/deviation.php'; + self::$disallowed = require __DIR__.'/Resources/unidata/disallowed.php'; + self::$disallowed_STD3_mapped = require __DIR__.'/Resources/unidata/disallowed_STD3_mapped.php'; + self::$disallowed_STD3_valid = require __DIR__.'/Resources/unidata/disallowed_STD3_valid.php'; + } + + if (isset(self::$mapped[$codePoint])) { + return ['status' => 'mapped', 'mapping' => self::$mapped[$codePoint]]; + } + + if (isset(self::$ignored[$codePoint])) { + return ['status' => 'ignored']; + } + + if (isset(self::$deviation[$codePoint])) { + return ['status' => 'deviation', 'mapping' => self::$deviation[$codePoint]]; + } + + if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) { + return ['status' => 'disallowed']; + } + + $isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]); + + if ($isDisallowedMapped || isset(self::$disallowed_STD3_valid[$codePoint])) { + $status = 'disallowed'; + + if (!$useSTD3ASCIIRules) { + $status = $isDisallowedMapped ? 'mapped' : 'valid'; + } + + if ($isDisallowedMapped) { + return ['status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]]; + } + + return ['status' => $status]; + } + + return ['status' => 'valid']; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php new file mode 100644 index 00000000000..25c3582b2a6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php @@ -0,0 +1,23 @@ + and Trevor Rowbotham + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Idn; + +/** + * @internal + */ +class Info +{ + public $bidiDomain = false; + public $errors = 0; + public $validBidiDomain = true; + public $transitionalDifferent = false; +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE b/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE new file mode 100644 index 00000000000..03c5e25774f --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 Fabien Potencier and Trevor Rowbotham + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md b/upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md new file mode 100644 index 00000000000..2e75f2e520a --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md @@ -0,0 +1,12 @@ +Symfony Polyfill / Intl: Idn +============================ + +This component provides [`idn_to_ascii`](https://php.net/idn-to-ascii) and [`idn_to_utf8`](https://php.net/idn-to-utf8) functions to users who run php versions without 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). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php new file mode 100644 index 00000000000..5bb70e48aca --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php @@ -0,0 +1,375 @@ += 128 && $codePoint <= 159) { + return true; + } + + if ($codePoint >= 2155 && $codePoint <= 2207) { + return true; + } + + if ($codePoint >= 3676 && $codePoint <= 3712) { + return true; + } + + if ($codePoint >= 3808 && $codePoint <= 3839) { + return true; + } + + if ($codePoint >= 4059 && $codePoint <= 4095) { + return true; + } + + if ($codePoint >= 4256 && $codePoint <= 4293) { + return true; + } + + if ($codePoint >= 6849 && $codePoint <= 6911) { + return true; + } + + if ($codePoint >= 11859 && $codePoint <= 11903) { + return true; + } + + if ($codePoint >= 42955 && $codePoint <= 42996) { + return true; + } + + if ($codePoint >= 55296 && $codePoint <= 57343) { + return true; + } + + if ($codePoint >= 57344 && $codePoint <= 63743) { + return true; + } + + if ($codePoint >= 64218 && $codePoint <= 64255) { + return true; + } + + if ($codePoint >= 64976 && $codePoint <= 65007) { + return true; + } + + if ($codePoint >= 65630 && $codePoint <= 65663) { + return true; + } + + if ($codePoint >= 65953 && $codePoint <= 65999) { + return true; + } + + if ($codePoint >= 66046 && $codePoint <= 66175) { + return true; + } + + if ($codePoint >= 66518 && $codePoint <= 66559) { + return true; + } + + if ($codePoint >= 66928 && $codePoint <= 67071) { + return true; + } + + if ($codePoint >= 67432 && $codePoint <= 67583) { + return true; + } + + if ($codePoint >= 67760 && $codePoint <= 67807) { + return true; + } + + if ($codePoint >= 67904 && $codePoint <= 67967) { + return true; + } + + if ($codePoint >= 68256 && $codePoint <= 68287) { + return true; + } + + if ($codePoint >= 68528 && $codePoint <= 68607) { + return true; + } + + if ($codePoint >= 68681 && $codePoint <= 68735) { + return true; + } + + if ($codePoint >= 68922 && $codePoint <= 69215) { + return true; + } + + if ($codePoint >= 69298 && $codePoint <= 69375) { + return true; + } + + if ($codePoint >= 69466 && $codePoint <= 69551) { + return true; + } + + if ($codePoint >= 70207 && $codePoint <= 70271) { + return true; + } + + if ($codePoint >= 70517 && $codePoint <= 70655) { + return true; + } + + if ($codePoint >= 70874 && $codePoint <= 71039) { + return true; + } + + if ($codePoint >= 71134 && $codePoint <= 71167) { + return true; + } + + if ($codePoint >= 71370 && $codePoint <= 71423) { + return true; + } + + if ($codePoint >= 71488 && $codePoint <= 71679) { + return true; + } + + if ($codePoint >= 71740 && $codePoint <= 71839) { + return true; + } + + if ($codePoint >= 72026 && $codePoint <= 72095) { + return true; + } + + if ($codePoint >= 72441 && $codePoint <= 72703) { + return true; + } + + if ($codePoint >= 72887 && $codePoint <= 72959) { + return true; + } + + if ($codePoint >= 73130 && $codePoint <= 73439) { + return true; + } + + if ($codePoint >= 73465 && $codePoint <= 73647) { + return true; + } + + if ($codePoint >= 74650 && $codePoint <= 74751) { + return true; + } + + if ($codePoint >= 75076 && $codePoint <= 77823) { + return true; + } + + if ($codePoint >= 78905 && $codePoint <= 82943) { + return true; + } + + if ($codePoint >= 83527 && $codePoint <= 92159) { + return true; + } + + if ($codePoint >= 92784 && $codePoint <= 92879) { + return true; + } + + if ($codePoint >= 93072 && $codePoint <= 93759) { + return true; + } + + if ($codePoint >= 93851 && $codePoint <= 93951) { + return true; + } + + if ($codePoint >= 94112 && $codePoint <= 94175) { + return true; + } + + if ($codePoint >= 101590 && $codePoint <= 101631) { + return true; + } + + if ($codePoint >= 101641 && $codePoint <= 110591) { + return true; + } + + if ($codePoint >= 110879 && $codePoint <= 110927) { + return true; + } + + if ($codePoint >= 111356 && $codePoint <= 113663) { + return true; + } + + if ($codePoint >= 113828 && $codePoint <= 118783) { + return true; + } + + if ($codePoint >= 119366 && $codePoint <= 119519) { + return true; + } + + if ($codePoint >= 119673 && $codePoint <= 119807) { + return true; + } + + if ($codePoint >= 121520 && $codePoint <= 122879) { + return true; + } + + if ($codePoint >= 122923 && $codePoint <= 123135) { + return true; + } + + if ($codePoint >= 123216 && $codePoint <= 123583) { + return true; + } + + if ($codePoint >= 123648 && $codePoint <= 124927) { + return true; + } + + if ($codePoint >= 125143 && $codePoint <= 125183) { + return true; + } + + if ($codePoint >= 125280 && $codePoint <= 126064) { + return true; + } + + if ($codePoint >= 126133 && $codePoint <= 126208) { + return true; + } + + if ($codePoint >= 126270 && $codePoint <= 126463) { + return true; + } + + if ($codePoint >= 126652 && $codePoint <= 126703) { + return true; + } + + if ($codePoint >= 126706 && $codePoint <= 126975) { + return true; + } + + if ($codePoint >= 127406 && $codePoint <= 127461) { + return true; + } + + if ($codePoint >= 127590 && $codePoint <= 127743) { + return true; + } + + if ($codePoint >= 129202 && $codePoint <= 129279) { + return true; + } + + if ($codePoint >= 129751 && $codePoint <= 129791) { + return true; + } + + if ($codePoint >= 129995 && $codePoint <= 130031) { + return true; + } + + if ($codePoint >= 130042 && $codePoint <= 131069) { + return true; + } + + if ($codePoint >= 173790 && $codePoint <= 173823) { + return true; + } + + if ($codePoint >= 191457 && $codePoint <= 194559) { + return true; + } + + if ($codePoint >= 195102 && $codePoint <= 196605) { + return true; + } + + if ($codePoint >= 201547 && $codePoint <= 262141) { + return true; + } + + if ($codePoint >= 262144 && $codePoint <= 327677) { + return true; + } + + if ($codePoint >= 327680 && $codePoint <= 393213) { + return true; + } + + if ($codePoint >= 393216 && $codePoint <= 458749) { + return true; + } + + if ($codePoint >= 458752 && $codePoint <= 524285) { + return true; + } + + if ($codePoint >= 524288 && $codePoint <= 589821) { + return true; + } + + if ($codePoint >= 589824 && $codePoint <= 655357) { + return true; + } + + if ($codePoint >= 655360 && $codePoint <= 720893) { + return true; + } + + if ($codePoint >= 720896 && $codePoint <= 786429) { + return true; + } + + if ($codePoint >= 786432 && $codePoint <= 851965) { + return true; + } + + if ($codePoint >= 851968 && $codePoint <= 917501) { + return true; + } + + if ($codePoint >= 917536 && $codePoint <= 917631) { + return true; + } + + if ($codePoint >= 917632 && $codePoint <= 917759) { + return true; + } + + if ($codePoint >= 918000 && $codePoint <= 983037) { + return true; + } + + if ($codePoint >= 983040 && $codePoint <= 1048573) { + return true; + } + + if ($codePoint >= 1048576 && $codePoint <= 1114109) { + return true; + } + + return false; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php new file mode 100644 index 00000000000..5c1c51ddeec --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php @@ -0,0 +1,24 @@ + 'ss', + 962 => 'σ', + 8204 => '', + 8205 => '', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php new file mode 100644 index 00000000000..25a5f564d54 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php @@ -0,0 +1,2638 @@ + true, + 889 => true, + 896 => true, + 897 => true, + 898 => true, + 899 => true, + 907 => true, + 909 => true, + 930 => true, + 1216 => true, + 1328 => true, + 1367 => true, + 1368 => true, + 1419 => true, + 1420 => true, + 1424 => true, + 1480 => true, + 1481 => true, + 1482 => true, + 1483 => true, + 1484 => true, + 1485 => true, + 1486 => true, + 1487 => true, + 1515 => true, + 1516 => true, + 1517 => true, + 1518 => true, + 1525 => true, + 1526 => true, + 1527 => true, + 1528 => true, + 1529 => true, + 1530 => true, + 1531 => true, + 1532 => true, + 1533 => true, + 1534 => true, + 1535 => true, + 1536 => true, + 1537 => true, + 1538 => true, + 1539 => true, + 1540 => true, + 1541 => true, + 1564 => true, + 1565 => true, + 1757 => true, + 1806 => true, + 1807 => true, + 1867 => true, + 1868 => true, + 1970 => true, + 1971 => true, + 1972 => true, + 1973 => true, + 1974 => true, + 1975 => true, + 1976 => true, + 1977 => true, + 1978 => true, + 1979 => true, + 1980 => true, + 1981 => true, + 1982 => true, + 1983 => true, + 2043 => true, + 2044 => true, + 2094 => true, + 2095 => true, + 2111 => true, + 2140 => true, + 2141 => true, + 2143 => true, + 2229 => true, + 2248 => true, + 2249 => true, + 2250 => true, + 2251 => true, + 2252 => true, + 2253 => true, + 2254 => true, + 2255 => true, + 2256 => true, + 2257 => true, + 2258 => true, + 2274 => true, + 2436 => true, + 2445 => true, + 2446 => true, + 2449 => true, + 2450 => true, + 2473 => true, + 2481 => true, + 2483 => true, + 2484 => true, + 2485 => true, + 2490 => true, + 2491 => true, + 2501 => true, + 2502 => true, + 2505 => true, + 2506 => true, + 2511 => true, + 2512 => true, + 2513 => true, + 2514 => true, + 2515 => true, + 2516 => true, + 2517 => true, + 2518 => true, + 2520 => true, + 2521 => true, + 2522 => true, + 2523 => true, + 2526 => true, + 2532 => true, + 2533 => true, + 2559 => true, + 2560 => true, + 2564 => true, + 2571 => true, + 2572 => true, + 2573 => true, + 2574 => true, + 2577 => true, + 2578 => true, + 2601 => true, + 2609 => true, + 2612 => true, + 2615 => true, + 2618 => true, + 2619 => true, + 2621 => true, + 2627 => true, + 2628 => true, + 2629 => true, + 2630 => true, + 2633 => true, + 2634 => true, + 2638 => true, + 2639 => true, + 2640 => true, + 2642 => true, + 2643 => true, + 2644 => true, + 2645 => true, + 2646 => true, + 2647 => true, + 2648 => true, + 2653 => true, + 2655 => true, + 2656 => true, + 2657 => true, + 2658 => true, + 2659 => true, + 2660 => true, + 2661 => true, + 2679 => true, + 2680 => true, + 2681 => true, + 2682 => true, + 2683 => true, + 2684 => true, + 2685 => true, + 2686 => true, + 2687 => true, + 2688 => true, + 2692 => true, + 2702 => true, + 2706 => true, + 2729 => true, + 2737 => true, + 2740 => true, + 2746 => true, + 2747 => true, + 2758 => true, + 2762 => true, + 2766 => true, + 2767 => true, + 2769 => true, + 2770 => true, + 2771 => true, + 2772 => true, + 2773 => true, + 2774 => true, + 2775 => true, + 2776 => true, + 2777 => true, + 2778 => true, + 2779 => true, + 2780 => true, + 2781 => true, + 2782 => true, + 2783 => true, + 2788 => true, + 2789 => true, + 2802 => true, + 2803 => true, + 2804 => true, + 2805 => true, + 2806 => true, + 2807 => true, + 2808 => true, + 2816 => true, + 2820 => true, + 2829 => true, + 2830 => true, + 2833 => true, + 2834 => true, + 2857 => true, + 2865 => true, + 2868 => true, + 2874 => true, + 2875 => true, + 2885 => true, + 2886 => true, + 2889 => true, + 2890 => true, + 2894 => true, + 2895 => true, + 2896 => true, + 2897 => true, + 2898 => true, + 2899 => true, + 2900 => true, + 2904 => true, + 2905 => true, + 2906 => true, + 2907 => true, + 2910 => true, + 2916 => true, + 2917 => true, + 2936 => true, + 2937 => true, + 2938 => true, + 2939 => true, + 2940 => true, + 2941 => true, + 2942 => true, + 2943 => true, + 2944 => true, + 2945 => true, + 2948 => true, + 2955 => true, + 2956 => true, + 2957 => true, + 2961 => true, + 2966 => true, + 2967 => true, + 2968 => true, + 2971 => true, + 2973 => true, + 2976 => true, + 2977 => true, + 2978 => true, + 2981 => true, + 2982 => true, + 2983 => true, + 2987 => true, + 2988 => true, + 2989 => true, + 3002 => true, + 3003 => true, + 3004 => true, + 3005 => true, + 3011 => true, + 3012 => true, + 3013 => true, + 3017 => true, + 3022 => true, + 3023 => true, + 3025 => true, + 3026 => true, + 3027 => true, + 3028 => true, + 3029 => true, + 3030 => true, + 3032 => true, + 3033 => true, + 3034 => true, + 3035 => true, + 3036 => true, + 3037 => true, + 3038 => true, + 3039 => true, + 3040 => true, + 3041 => true, + 3042 => true, + 3043 => true, + 3044 => true, + 3045 => true, + 3067 => true, + 3068 => true, + 3069 => true, + 3070 => true, + 3071 => true, + 3085 => true, + 3089 => true, + 3113 => true, + 3130 => true, + 3131 => true, + 3132 => true, + 3141 => true, + 3145 => true, + 3150 => true, + 3151 => true, + 3152 => true, + 3153 => true, + 3154 => true, + 3155 => true, + 3156 => true, + 3159 => true, + 3163 => true, + 3164 => true, + 3165 => true, + 3166 => true, + 3167 => true, + 3172 => true, + 3173 => true, + 3184 => true, + 3185 => true, + 3186 => true, + 3187 => true, + 3188 => true, + 3189 => true, + 3190 => true, + 3213 => true, + 3217 => true, + 3241 => true, + 3252 => true, + 3258 => true, + 3259 => true, + 3269 => true, + 3273 => true, + 3278 => true, + 3279 => true, + 3280 => true, + 3281 => true, + 3282 => true, + 3283 => true, + 3284 => true, + 3287 => true, + 3288 => true, + 3289 => true, + 3290 => true, + 3291 => true, + 3292 => true, + 3293 => true, + 3295 => true, + 3300 => true, + 3301 => true, + 3312 => true, + 3315 => true, + 3316 => true, + 3317 => true, + 3318 => true, + 3319 => true, + 3320 => true, + 3321 => true, + 3322 => true, + 3323 => true, + 3324 => true, + 3325 => true, + 3326 => true, + 3327 => true, + 3341 => true, + 3345 => true, + 3397 => true, + 3401 => true, + 3408 => true, + 3409 => true, + 3410 => true, + 3411 => true, + 3428 => true, + 3429 => true, + 3456 => true, + 3460 => true, + 3479 => true, + 3480 => true, + 3481 => true, + 3506 => true, + 3516 => true, + 3518 => true, + 3519 => true, + 3527 => true, + 3528 => true, + 3529 => true, + 3531 => true, + 3532 => true, + 3533 => true, + 3534 => true, + 3541 => true, + 3543 => true, + 3552 => true, + 3553 => true, + 3554 => true, + 3555 => true, + 3556 => true, + 3557 => true, + 3568 => true, + 3569 => true, + 3573 => true, + 3574 => true, + 3575 => true, + 3576 => true, + 3577 => true, + 3578 => true, + 3579 => true, + 3580 => true, + 3581 => true, + 3582 => true, + 3583 => true, + 3584 => true, + 3643 => true, + 3644 => true, + 3645 => true, + 3646 => true, + 3715 => true, + 3717 => true, + 3723 => true, + 3748 => true, + 3750 => true, + 3774 => true, + 3775 => true, + 3781 => true, + 3783 => true, + 3790 => true, + 3791 => true, + 3802 => true, + 3803 => true, + 3912 => true, + 3949 => true, + 3950 => true, + 3951 => true, + 3952 => true, + 3992 => true, + 4029 => true, + 4045 => true, + 4294 => true, + 4296 => true, + 4297 => true, + 4298 => true, + 4299 => true, + 4300 => true, + 4302 => true, + 4303 => true, + 4447 => true, + 4448 => true, + 4681 => true, + 4686 => true, + 4687 => true, + 4695 => true, + 4697 => true, + 4702 => true, + 4703 => true, + 4745 => true, + 4750 => true, + 4751 => true, + 4785 => true, + 4790 => true, + 4791 => true, + 4799 => true, + 4801 => true, + 4806 => true, + 4807 => true, + 4823 => true, + 4881 => true, + 4886 => true, + 4887 => true, + 4955 => true, + 4956 => true, + 4989 => true, + 4990 => true, + 4991 => true, + 5018 => true, + 5019 => true, + 5020 => true, + 5021 => true, + 5022 => true, + 5023 => true, + 5110 => true, + 5111 => true, + 5118 => true, + 5119 => true, + 5760 => true, + 5789 => true, + 5790 => true, + 5791 => true, + 5881 => true, + 5882 => true, + 5883 => true, + 5884 => true, + 5885 => true, + 5886 => true, + 5887 => true, + 5901 => true, + 5909 => true, + 5910 => true, + 5911 => true, + 5912 => true, + 5913 => true, + 5914 => true, + 5915 => true, + 5916 => true, + 5917 => true, + 5918 => true, + 5919 => true, + 5943 => true, + 5944 => true, + 5945 => true, + 5946 => true, + 5947 => true, + 5948 => true, + 5949 => true, + 5950 => true, + 5951 => true, + 5972 => true, + 5973 => true, + 5974 => true, + 5975 => true, + 5976 => true, + 5977 => true, + 5978 => true, + 5979 => true, + 5980 => true, + 5981 => true, + 5982 => true, + 5983 => true, + 5997 => true, + 6001 => true, + 6004 => true, + 6005 => true, + 6006 => true, + 6007 => true, + 6008 => true, + 6009 => true, + 6010 => true, + 6011 => true, + 6012 => true, + 6013 => true, + 6014 => true, + 6015 => true, + 6068 => true, + 6069 => true, + 6110 => true, + 6111 => true, + 6122 => true, + 6123 => true, + 6124 => true, + 6125 => true, + 6126 => true, + 6127 => true, + 6138 => true, + 6139 => true, + 6140 => true, + 6141 => true, + 6142 => true, + 6143 => true, + 6150 => true, + 6158 => true, + 6159 => true, + 6170 => true, + 6171 => true, + 6172 => true, + 6173 => true, + 6174 => true, + 6175 => true, + 6265 => true, + 6266 => true, + 6267 => true, + 6268 => true, + 6269 => true, + 6270 => true, + 6271 => true, + 6315 => true, + 6316 => true, + 6317 => true, + 6318 => true, + 6319 => true, + 6390 => true, + 6391 => true, + 6392 => true, + 6393 => true, + 6394 => true, + 6395 => true, + 6396 => true, + 6397 => true, + 6398 => true, + 6399 => true, + 6431 => true, + 6444 => true, + 6445 => true, + 6446 => true, + 6447 => true, + 6460 => true, + 6461 => true, + 6462 => true, + 6463 => true, + 6465 => true, + 6466 => true, + 6467 => true, + 6510 => true, + 6511 => true, + 6517 => true, + 6518 => true, + 6519 => true, + 6520 => true, + 6521 => true, + 6522 => true, + 6523 => true, + 6524 => true, + 6525 => true, + 6526 => true, + 6527 => true, + 6572 => true, + 6573 => true, + 6574 => true, + 6575 => true, + 6602 => true, + 6603 => true, + 6604 => true, + 6605 => true, + 6606 => true, + 6607 => true, + 6619 => true, + 6620 => true, + 6621 => true, + 6684 => true, + 6685 => true, + 6751 => true, + 6781 => true, + 6782 => true, + 6794 => true, + 6795 => true, + 6796 => true, + 6797 => true, + 6798 => true, + 6799 => true, + 6810 => true, + 6811 => true, + 6812 => true, + 6813 => true, + 6814 => true, + 6815 => true, + 6830 => true, + 6831 => true, + 6988 => true, + 6989 => true, + 6990 => true, + 6991 => true, + 7037 => true, + 7038 => true, + 7039 => true, + 7156 => true, + 7157 => true, + 7158 => true, + 7159 => true, + 7160 => true, + 7161 => true, + 7162 => true, + 7163 => true, + 7224 => true, + 7225 => true, + 7226 => true, + 7242 => true, + 7243 => true, + 7244 => true, + 7305 => true, + 7306 => true, + 7307 => true, + 7308 => true, + 7309 => true, + 7310 => true, + 7311 => true, + 7355 => true, + 7356 => true, + 7368 => true, + 7369 => true, + 7370 => true, + 7371 => true, + 7372 => true, + 7373 => true, + 7374 => true, + 7375 => true, + 7419 => true, + 7420 => true, + 7421 => true, + 7422 => true, + 7423 => true, + 7674 => true, + 7958 => true, + 7959 => true, + 7966 => true, + 7967 => true, + 8006 => true, + 8007 => true, + 8014 => true, + 8015 => true, + 8024 => true, + 8026 => true, + 8028 => true, + 8030 => true, + 8062 => true, + 8063 => true, + 8117 => true, + 8133 => true, + 8148 => true, + 8149 => true, + 8156 => true, + 8176 => true, + 8177 => true, + 8181 => true, + 8191 => true, + 8206 => true, + 8207 => true, + 8228 => true, + 8229 => true, + 8230 => true, + 8232 => true, + 8233 => true, + 8234 => true, + 8235 => true, + 8236 => true, + 8237 => true, + 8238 => true, + 8289 => true, + 8290 => true, + 8291 => true, + 8293 => true, + 8294 => true, + 8295 => true, + 8296 => true, + 8297 => true, + 8298 => true, + 8299 => true, + 8300 => true, + 8301 => true, + 8302 => true, + 8303 => true, + 8306 => true, + 8307 => true, + 8335 => true, + 8349 => true, + 8350 => true, + 8351 => true, + 8384 => true, + 8385 => true, + 8386 => true, + 8387 => true, + 8388 => true, + 8389 => true, + 8390 => true, + 8391 => true, + 8392 => true, + 8393 => true, + 8394 => true, + 8395 => true, + 8396 => true, + 8397 => true, + 8398 => true, + 8399 => true, + 8433 => true, + 8434 => true, + 8435 => true, + 8436 => true, + 8437 => true, + 8438 => true, + 8439 => true, + 8440 => true, + 8441 => true, + 8442 => true, + 8443 => true, + 8444 => true, + 8445 => true, + 8446 => true, + 8447 => true, + 8498 => true, + 8579 => true, + 8588 => true, + 8589 => true, + 8590 => true, + 8591 => true, + 9255 => true, + 9256 => true, + 9257 => true, + 9258 => true, + 9259 => true, + 9260 => true, + 9261 => true, + 9262 => true, + 9263 => true, + 9264 => true, + 9265 => true, + 9266 => true, + 9267 => true, + 9268 => true, + 9269 => true, + 9270 => true, + 9271 => true, + 9272 => true, + 9273 => true, + 9274 => true, + 9275 => true, + 9276 => true, + 9277 => true, + 9278 => true, + 9279 => true, + 9291 => true, + 9292 => true, + 9293 => true, + 9294 => true, + 9295 => true, + 9296 => true, + 9297 => true, + 9298 => true, + 9299 => true, + 9300 => true, + 9301 => true, + 9302 => true, + 9303 => true, + 9304 => true, + 9305 => true, + 9306 => true, + 9307 => true, + 9308 => true, + 9309 => true, + 9310 => true, + 9311 => true, + 9352 => true, + 9353 => true, + 9354 => true, + 9355 => true, + 9356 => true, + 9357 => true, + 9358 => true, + 9359 => true, + 9360 => true, + 9361 => true, + 9362 => true, + 9363 => true, + 9364 => true, + 9365 => true, + 9366 => true, + 9367 => true, + 9368 => true, + 9369 => true, + 9370 => true, + 9371 => true, + 11124 => true, + 11125 => true, + 11158 => true, + 11311 => true, + 11359 => true, + 11508 => true, + 11509 => true, + 11510 => true, + 11511 => true, + 11512 => true, + 11558 => true, + 11560 => true, + 11561 => true, + 11562 => true, + 11563 => true, + 11564 => true, + 11566 => true, + 11567 => true, + 11624 => true, + 11625 => true, + 11626 => true, + 11627 => true, + 11628 => true, + 11629 => true, + 11630 => true, + 11633 => true, + 11634 => true, + 11635 => true, + 11636 => true, + 11637 => true, + 11638 => true, + 11639 => true, + 11640 => true, + 11641 => true, + 11642 => true, + 11643 => true, + 11644 => true, + 11645 => true, + 11646 => true, + 11671 => true, + 11672 => true, + 11673 => true, + 11674 => true, + 11675 => true, + 11676 => true, + 11677 => true, + 11678 => true, + 11679 => true, + 11687 => true, + 11695 => true, + 11703 => true, + 11711 => true, + 11719 => true, + 11727 => true, + 11735 => true, + 11743 => true, + 11930 => true, + 12020 => true, + 12021 => true, + 12022 => true, + 12023 => true, + 12024 => true, + 12025 => true, + 12026 => true, + 12027 => true, + 12028 => true, + 12029 => true, + 12030 => true, + 12031 => true, + 12246 => true, + 12247 => true, + 12248 => true, + 12249 => true, + 12250 => true, + 12251 => true, + 12252 => true, + 12253 => true, + 12254 => true, + 12255 => true, + 12256 => true, + 12257 => true, + 12258 => true, + 12259 => true, + 12260 => true, + 12261 => true, + 12262 => true, + 12263 => true, + 12264 => true, + 12265 => true, + 12266 => true, + 12267 => true, + 12268 => true, + 12269 => true, + 12270 => true, + 12271 => true, + 12272 => true, + 12273 => true, + 12274 => true, + 12275 => true, + 12276 => true, + 12277 => true, + 12278 => true, + 12279 => true, + 12280 => true, + 12281 => true, + 12282 => true, + 12283 => true, + 12284 => true, + 12285 => true, + 12286 => true, + 12287 => true, + 12352 => true, + 12439 => true, + 12440 => true, + 12544 => true, + 12545 => true, + 12546 => true, + 12547 => true, + 12548 => true, + 12592 => true, + 12644 => true, + 12687 => true, + 12772 => true, + 12773 => true, + 12774 => true, + 12775 => true, + 12776 => true, + 12777 => true, + 12778 => true, + 12779 => true, + 12780 => true, + 12781 => true, + 12782 => true, + 12783 => true, + 12831 => true, + 13250 => true, + 13255 => true, + 13272 => true, + 40957 => true, + 40958 => true, + 40959 => true, + 42125 => true, + 42126 => true, + 42127 => true, + 42183 => true, + 42184 => true, + 42185 => true, + 42186 => true, + 42187 => true, + 42188 => true, + 42189 => true, + 42190 => true, + 42191 => true, + 42540 => true, + 42541 => true, + 42542 => true, + 42543 => true, + 42544 => true, + 42545 => true, + 42546 => true, + 42547 => true, + 42548 => true, + 42549 => true, + 42550 => true, + 42551 => true, + 42552 => true, + 42553 => true, + 42554 => true, + 42555 => true, + 42556 => true, + 42557 => true, + 42558 => true, + 42559 => true, + 42744 => true, + 42745 => true, + 42746 => true, + 42747 => true, + 42748 => true, + 42749 => true, + 42750 => true, + 42751 => true, + 42944 => true, + 42945 => true, + 43053 => true, + 43054 => true, + 43055 => true, + 43066 => true, + 43067 => true, + 43068 => true, + 43069 => true, + 43070 => true, + 43071 => true, + 43128 => true, + 43129 => true, + 43130 => true, + 43131 => true, + 43132 => true, + 43133 => true, + 43134 => true, + 43135 => true, + 43206 => true, + 43207 => true, + 43208 => true, + 43209 => true, + 43210 => true, + 43211 => true, + 43212 => true, + 43213 => true, + 43226 => true, + 43227 => true, + 43228 => true, + 43229 => true, + 43230 => true, + 43231 => true, + 43348 => true, + 43349 => true, + 43350 => true, + 43351 => true, + 43352 => true, + 43353 => true, + 43354 => true, + 43355 => true, + 43356 => true, + 43357 => true, + 43358 => true, + 43389 => true, + 43390 => true, + 43391 => true, + 43470 => true, + 43482 => true, + 43483 => true, + 43484 => true, + 43485 => true, + 43519 => true, + 43575 => true, + 43576 => true, + 43577 => true, + 43578 => true, + 43579 => true, + 43580 => true, + 43581 => true, + 43582 => true, + 43583 => true, + 43598 => true, + 43599 => true, + 43610 => true, + 43611 => true, + 43715 => true, + 43716 => true, + 43717 => true, + 43718 => true, + 43719 => true, + 43720 => true, + 43721 => true, + 43722 => true, + 43723 => true, + 43724 => true, + 43725 => true, + 43726 => true, + 43727 => true, + 43728 => true, + 43729 => true, + 43730 => true, + 43731 => true, + 43732 => true, + 43733 => true, + 43734 => true, + 43735 => true, + 43736 => true, + 43737 => true, + 43738 => true, + 43767 => true, + 43768 => true, + 43769 => true, + 43770 => true, + 43771 => true, + 43772 => true, + 43773 => true, + 43774 => true, + 43775 => true, + 43776 => true, + 43783 => true, + 43784 => true, + 43791 => true, + 43792 => true, + 43799 => true, + 43800 => true, + 43801 => true, + 43802 => true, + 43803 => true, + 43804 => true, + 43805 => true, + 43806 => true, + 43807 => true, + 43815 => true, + 43823 => true, + 43884 => true, + 43885 => true, + 43886 => true, + 43887 => true, + 44014 => true, + 44015 => true, + 44026 => true, + 44027 => true, + 44028 => true, + 44029 => true, + 44030 => true, + 44031 => true, + 55204 => true, + 55205 => true, + 55206 => true, + 55207 => true, + 55208 => true, + 55209 => true, + 55210 => true, + 55211 => true, + 55212 => true, + 55213 => true, + 55214 => true, + 55215 => true, + 55239 => true, + 55240 => true, + 55241 => true, + 55242 => true, + 55292 => true, + 55293 => true, + 55294 => true, + 55295 => true, + 64110 => true, + 64111 => true, + 64263 => true, + 64264 => true, + 64265 => true, + 64266 => true, + 64267 => true, + 64268 => true, + 64269 => true, + 64270 => true, + 64271 => true, + 64272 => true, + 64273 => true, + 64274 => true, + 64280 => true, + 64281 => true, + 64282 => true, + 64283 => true, + 64284 => true, + 64311 => true, + 64317 => true, + 64319 => true, + 64322 => true, + 64325 => true, + 64450 => true, + 64451 => true, + 64452 => true, + 64453 => true, + 64454 => true, + 64455 => true, + 64456 => true, + 64457 => true, + 64458 => true, + 64459 => true, + 64460 => true, + 64461 => true, + 64462 => true, + 64463 => true, + 64464 => true, + 64465 => true, + 64466 => true, + 64832 => true, + 64833 => true, + 64834 => true, + 64835 => true, + 64836 => true, + 64837 => true, + 64838 => true, + 64839 => true, + 64840 => true, + 64841 => true, + 64842 => true, + 64843 => true, + 64844 => true, + 64845 => true, + 64846 => true, + 64847 => true, + 64912 => true, + 64913 => true, + 64968 => true, + 64969 => true, + 64970 => true, + 64971 => true, + 64972 => true, + 64973 => true, + 64974 => true, + 64975 => true, + 65022 => true, + 65023 => true, + 65042 => true, + 65049 => true, + 65050 => true, + 65051 => true, + 65052 => true, + 65053 => true, + 65054 => true, + 65055 => true, + 65072 => true, + 65106 => true, + 65107 => true, + 65127 => true, + 65132 => true, + 65133 => true, + 65134 => true, + 65135 => true, + 65141 => true, + 65277 => true, + 65278 => true, + 65280 => true, + 65440 => true, + 65471 => true, + 65472 => true, + 65473 => true, + 65480 => true, + 65481 => true, + 65488 => true, + 65489 => true, + 65496 => true, + 65497 => true, + 65501 => true, + 65502 => true, + 65503 => true, + 65511 => true, + 65519 => true, + 65520 => true, + 65521 => true, + 65522 => true, + 65523 => true, + 65524 => true, + 65525 => true, + 65526 => true, + 65527 => true, + 65528 => true, + 65529 => true, + 65530 => true, + 65531 => true, + 65532 => true, + 65533 => true, + 65534 => true, + 65535 => true, + 65548 => true, + 65575 => true, + 65595 => true, + 65598 => true, + 65614 => true, + 65615 => true, + 65787 => true, + 65788 => true, + 65789 => true, + 65790 => true, + 65791 => true, + 65795 => true, + 65796 => true, + 65797 => true, + 65798 => true, + 65844 => true, + 65845 => true, + 65846 => true, + 65935 => true, + 65949 => true, + 65950 => true, + 65951 => true, + 66205 => true, + 66206 => true, + 66207 => true, + 66257 => true, + 66258 => true, + 66259 => true, + 66260 => true, + 66261 => true, + 66262 => true, + 66263 => true, + 66264 => true, + 66265 => true, + 66266 => true, + 66267 => true, + 66268 => true, + 66269 => true, + 66270 => true, + 66271 => true, + 66300 => true, + 66301 => true, + 66302 => true, + 66303 => true, + 66340 => true, + 66341 => true, + 66342 => true, + 66343 => true, + 66344 => true, + 66345 => true, + 66346 => true, + 66347 => true, + 66348 => true, + 66379 => true, + 66380 => true, + 66381 => true, + 66382 => true, + 66383 => true, + 66427 => true, + 66428 => true, + 66429 => true, + 66430 => true, + 66431 => true, + 66462 => true, + 66500 => true, + 66501 => true, + 66502 => true, + 66503 => true, + 66718 => true, + 66719 => true, + 66730 => true, + 66731 => true, + 66732 => true, + 66733 => true, + 66734 => true, + 66735 => true, + 66772 => true, + 66773 => true, + 66774 => true, + 66775 => true, + 66812 => true, + 66813 => true, + 66814 => true, + 66815 => true, + 66856 => true, + 66857 => true, + 66858 => true, + 66859 => true, + 66860 => true, + 66861 => true, + 66862 => true, + 66863 => true, + 66916 => true, + 66917 => true, + 66918 => true, + 66919 => true, + 66920 => true, + 66921 => true, + 66922 => true, + 66923 => true, + 66924 => true, + 66925 => true, + 66926 => true, + 67383 => true, + 67384 => true, + 67385 => true, + 67386 => true, + 67387 => true, + 67388 => true, + 67389 => true, + 67390 => true, + 67391 => true, + 67414 => true, + 67415 => true, + 67416 => true, + 67417 => true, + 67418 => true, + 67419 => true, + 67420 => true, + 67421 => true, + 67422 => true, + 67423 => true, + 67590 => true, + 67591 => true, + 67593 => true, + 67638 => true, + 67641 => true, + 67642 => true, + 67643 => true, + 67645 => true, + 67646 => true, + 67670 => true, + 67743 => true, + 67744 => true, + 67745 => true, + 67746 => true, + 67747 => true, + 67748 => true, + 67749 => true, + 67750 => true, + 67827 => true, + 67830 => true, + 67831 => true, + 67832 => true, + 67833 => true, + 67834 => true, + 67868 => true, + 67869 => true, + 67870 => true, + 67898 => true, + 67899 => true, + 67900 => true, + 67901 => true, + 67902 => true, + 68024 => true, + 68025 => true, + 68026 => true, + 68027 => true, + 68048 => true, + 68049 => true, + 68100 => true, + 68103 => true, + 68104 => true, + 68105 => true, + 68106 => true, + 68107 => true, + 68116 => true, + 68120 => true, + 68150 => true, + 68151 => true, + 68155 => true, + 68156 => true, + 68157 => true, + 68158 => true, + 68169 => true, + 68170 => true, + 68171 => true, + 68172 => true, + 68173 => true, + 68174 => true, + 68175 => true, + 68185 => true, + 68186 => true, + 68187 => true, + 68188 => true, + 68189 => true, + 68190 => true, + 68191 => true, + 68327 => true, + 68328 => true, + 68329 => true, + 68330 => true, + 68343 => true, + 68344 => true, + 68345 => true, + 68346 => true, + 68347 => true, + 68348 => true, + 68349 => true, + 68350 => true, + 68351 => true, + 68406 => true, + 68407 => true, + 68408 => true, + 68438 => true, + 68439 => true, + 68467 => true, + 68468 => true, + 68469 => true, + 68470 => true, + 68471 => true, + 68498 => true, + 68499 => true, + 68500 => true, + 68501 => true, + 68502 => true, + 68503 => true, + 68504 => true, + 68509 => true, + 68510 => true, + 68511 => true, + 68512 => true, + 68513 => true, + 68514 => true, + 68515 => true, + 68516 => true, + 68517 => true, + 68518 => true, + 68519 => true, + 68520 => true, + 68787 => true, + 68788 => true, + 68789 => true, + 68790 => true, + 68791 => true, + 68792 => true, + 68793 => true, + 68794 => true, + 68795 => true, + 68796 => true, + 68797 => true, + 68798 => true, + 68799 => true, + 68851 => true, + 68852 => true, + 68853 => true, + 68854 => true, + 68855 => true, + 68856 => true, + 68857 => true, + 68904 => true, + 68905 => true, + 68906 => true, + 68907 => true, + 68908 => true, + 68909 => true, + 68910 => true, + 68911 => true, + 69247 => true, + 69290 => true, + 69294 => true, + 69295 => true, + 69416 => true, + 69417 => true, + 69418 => true, + 69419 => true, + 69420 => true, + 69421 => true, + 69422 => true, + 69423 => true, + 69580 => true, + 69581 => true, + 69582 => true, + 69583 => true, + 69584 => true, + 69585 => true, + 69586 => true, + 69587 => true, + 69588 => true, + 69589 => true, + 69590 => true, + 69591 => true, + 69592 => true, + 69593 => true, + 69594 => true, + 69595 => true, + 69596 => true, + 69597 => true, + 69598 => true, + 69599 => true, + 69623 => true, + 69624 => true, + 69625 => true, + 69626 => true, + 69627 => true, + 69628 => true, + 69629 => true, + 69630 => true, + 69631 => true, + 69710 => true, + 69711 => true, + 69712 => true, + 69713 => true, + 69744 => true, + 69745 => true, + 69746 => true, + 69747 => true, + 69748 => true, + 69749 => true, + 69750 => true, + 69751 => true, + 69752 => true, + 69753 => true, + 69754 => true, + 69755 => true, + 69756 => true, + 69757 => true, + 69758 => true, + 69821 => true, + 69826 => true, + 69827 => true, + 69828 => true, + 69829 => true, + 69830 => true, + 69831 => true, + 69832 => true, + 69833 => true, + 69834 => true, + 69835 => true, + 69836 => true, + 69837 => true, + 69838 => true, + 69839 => true, + 69865 => true, + 69866 => true, + 69867 => true, + 69868 => true, + 69869 => true, + 69870 => true, + 69871 => true, + 69882 => true, + 69883 => true, + 69884 => true, + 69885 => true, + 69886 => true, + 69887 => true, + 69941 => true, + 69960 => true, + 69961 => true, + 69962 => true, + 69963 => true, + 69964 => true, + 69965 => true, + 69966 => true, + 69967 => true, + 70007 => true, + 70008 => true, + 70009 => true, + 70010 => true, + 70011 => true, + 70012 => true, + 70013 => true, + 70014 => true, + 70015 => true, + 70112 => true, + 70133 => true, + 70134 => true, + 70135 => true, + 70136 => true, + 70137 => true, + 70138 => true, + 70139 => true, + 70140 => true, + 70141 => true, + 70142 => true, + 70143 => true, + 70162 => true, + 70279 => true, + 70281 => true, + 70286 => true, + 70302 => true, + 70314 => true, + 70315 => true, + 70316 => true, + 70317 => true, + 70318 => true, + 70319 => true, + 70379 => true, + 70380 => true, + 70381 => true, + 70382 => true, + 70383 => true, + 70394 => true, + 70395 => true, + 70396 => true, + 70397 => true, + 70398 => true, + 70399 => true, + 70404 => true, + 70413 => true, + 70414 => true, + 70417 => true, + 70418 => true, + 70441 => true, + 70449 => true, + 70452 => true, + 70458 => true, + 70469 => true, + 70470 => true, + 70473 => true, + 70474 => true, + 70478 => true, + 70479 => true, + 70481 => true, + 70482 => true, + 70483 => true, + 70484 => true, + 70485 => true, + 70486 => true, + 70488 => true, + 70489 => true, + 70490 => true, + 70491 => true, + 70492 => true, + 70500 => true, + 70501 => true, + 70509 => true, + 70510 => true, + 70511 => true, + 70748 => true, + 70754 => true, + 70755 => true, + 70756 => true, + 70757 => true, + 70758 => true, + 70759 => true, + 70760 => true, + 70761 => true, + 70762 => true, + 70763 => true, + 70764 => true, + 70765 => true, + 70766 => true, + 70767 => true, + 70768 => true, + 70769 => true, + 70770 => true, + 70771 => true, + 70772 => true, + 70773 => true, + 70774 => true, + 70775 => true, + 70776 => true, + 70777 => true, + 70778 => true, + 70779 => true, + 70780 => true, + 70781 => true, + 70782 => true, + 70783 => true, + 70856 => true, + 70857 => true, + 70858 => true, + 70859 => true, + 70860 => true, + 70861 => true, + 70862 => true, + 70863 => true, + 71094 => true, + 71095 => true, + 71237 => true, + 71238 => true, + 71239 => true, + 71240 => true, + 71241 => true, + 71242 => true, + 71243 => true, + 71244 => true, + 71245 => true, + 71246 => true, + 71247 => true, + 71258 => true, + 71259 => true, + 71260 => true, + 71261 => true, + 71262 => true, + 71263 => true, + 71277 => true, + 71278 => true, + 71279 => true, + 71280 => true, + 71281 => true, + 71282 => true, + 71283 => true, + 71284 => true, + 71285 => true, + 71286 => true, + 71287 => true, + 71288 => true, + 71289 => true, + 71290 => true, + 71291 => true, + 71292 => true, + 71293 => true, + 71294 => true, + 71295 => true, + 71353 => true, + 71354 => true, + 71355 => true, + 71356 => true, + 71357 => true, + 71358 => true, + 71359 => true, + 71451 => true, + 71452 => true, + 71468 => true, + 71469 => true, + 71470 => true, + 71471 => true, + 71923 => true, + 71924 => true, + 71925 => true, + 71926 => true, + 71927 => true, + 71928 => true, + 71929 => true, + 71930 => true, + 71931 => true, + 71932 => true, + 71933 => true, + 71934 => true, + 71943 => true, + 71944 => true, + 71946 => true, + 71947 => true, + 71956 => true, + 71959 => true, + 71990 => true, + 71993 => true, + 71994 => true, + 72007 => true, + 72008 => true, + 72009 => true, + 72010 => true, + 72011 => true, + 72012 => true, + 72013 => true, + 72014 => true, + 72015 => true, + 72104 => true, + 72105 => true, + 72152 => true, + 72153 => true, + 72165 => true, + 72166 => true, + 72167 => true, + 72168 => true, + 72169 => true, + 72170 => true, + 72171 => true, + 72172 => true, + 72173 => true, + 72174 => true, + 72175 => true, + 72176 => true, + 72177 => true, + 72178 => true, + 72179 => true, + 72180 => true, + 72181 => true, + 72182 => true, + 72183 => true, + 72184 => true, + 72185 => true, + 72186 => true, + 72187 => true, + 72188 => true, + 72189 => true, + 72190 => true, + 72191 => true, + 72264 => true, + 72265 => true, + 72266 => true, + 72267 => true, + 72268 => true, + 72269 => true, + 72270 => true, + 72271 => true, + 72355 => true, + 72356 => true, + 72357 => true, + 72358 => true, + 72359 => true, + 72360 => true, + 72361 => true, + 72362 => true, + 72363 => true, + 72364 => true, + 72365 => true, + 72366 => true, + 72367 => true, + 72368 => true, + 72369 => true, + 72370 => true, + 72371 => true, + 72372 => true, + 72373 => true, + 72374 => true, + 72375 => true, + 72376 => true, + 72377 => true, + 72378 => true, + 72379 => true, + 72380 => true, + 72381 => true, + 72382 => true, + 72383 => true, + 72713 => true, + 72759 => true, + 72774 => true, + 72775 => true, + 72776 => true, + 72777 => true, + 72778 => true, + 72779 => true, + 72780 => true, + 72781 => true, + 72782 => true, + 72783 => true, + 72813 => true, + 72814 => true, + 72815 => true, + 72848 => true, + 72849 => true, + 72872 => true, + 72967 => true, + 72970 => true, + 73015 => true, + 73016 => true, + 73017 => true, + 73019 => true, + 73022 => true, + 73032 => true, + 73033 => true, + 73034 => true, + 73035 => true, + 73036 => true, + 73037 => true, + 73038 => true, + 73039 => true, + 73050 => true, + 73051 => true, + 73052 => true, + 73053 => true, + 73054 => true, + 73055 => true, + 73062 => true, + 73065 => true, + 73103 => true, + 73106 => true, + 73113 => true, + 73114 => true, + 73115 => true, + 73116 => true, + 73117 => true, + 73118 => true, + 73119 => true, + 73649 => true, + 73650 => true, + 73651 => true, + 73652 => true, + 73653 => true, + 73654 => true, + 73655 => true, + 73656 => true, + 73657 => true, + 73658 => true, + 73659 => true, + 73660 => true, + 73661 => true, + 73662 => true, + 73663 => true, + 73714 => true, + 73715 => true, + 73716 => true, + 73717 => true, + 73718 => true, + 73719 => true, + 73720 => true, + 73721 => true, + 73722 => true, + 73723 => true, + 73724 => true, + 73725 => true, + 73726 => true, + 74863 => true, + 74869 => true, + 74870 => true, + 74871 => true, + 74872 => true, + 74873 => true, + 74874 => true, + 74875 => true, + 74876 => true, + 74877 => true, + 74878 => true, + 74879 => true, + 78895 => true, + 78896 => true, + 78897 => true, + 78898 => true, + 78899 => true, + 78900 => true, + 78901 => true, + 78902 => true, + 78903 => true, + 78904 => true, + 92729 => true, + 92730 => true, + 92731 => true, + 92732 => true, + 92733 => true, + 92734 => true, + 92735 => true, + 92767 => true, + 92778 => true, + 92779 => true, + 92780 => true, + 92781 => true, + 92910 => true, + 92911 => true, + 92918 => true, + 92919 => true, + 92920 => true, + 92921 => true, + 92922 => true, + 92923 => true, + 92924 => true, + 92925 => true, + 92926 => true, + 92927 => true, + 92998 => true, + 92999 => true, + 93000 => true, + 93001 => true, + 93002 => true, + 93003 => true, + 93004 => true, + 93005 => true, + 93006 => true, + 93007 => true, + 93018 => true, + 93026 => true, + 93048 => true, + 93049 => true, + 93050 => true, + 93051 => true, + 93052 => true, + 94027 => true, + 94028 => true, + 94029 => true, + 94030 => true, + 94088 => true, + 94089 => true, + 94090 => true, + 94091 => true, + 94092 => true, + 94093 => true, + 94094 => true, + 94181 => true, + 94182 => true, + 94183 => true, + 94184 => true, + 94185 => true, + 94186 => true, + 94187 => true, + 94188 => true, + 94189 => true, + 94190 => true, + 94191 => true, + 94194 => true, + 94195 => true, + 94196 => true, + 94197 => true, + 94198 => true, + 94199 => true, + 94200 => true, + 94201 => true, + 94202 => true, + 94203 => true, + 94204 => true, + 94205 => true, + 94206 => true, + 94207 => true, + 100344 => true, + 100345 => true, + 100346 => true, + 100347 => true, + 100348 => true, + 100349 => true, + 100350 => true, + 100351 => true, + 110931 => true, + 110932 => true, + 110933 => true, + 110934 => true, + 110935 => true, + 110936 => true, + 110937 => true, + 110938 => true, + 110939 => true, + 110940 => true, + 110941 => true, + 110942 => true, + 110943 => true, + 110944 => true, + 110945 => true, + 110946 => true, + 110947 => true, + 110952 => true, + 110953 => true, + 110954 => true, + 110955 => true, + 110956 => true, + 110957 => true, + 110958 => true, + 110959 => true, + 113771 => true, + 113772 => true, + 113773 => true, + 113774 => true, + 113775 => true, + 113789 => true, + 113790 => true, + 113791 => true, + 113801 => true, + 113802 => true, + 113803 => true, + 113804 => true, + 113805 => true, + 113806 => true, + 113807 => true, + 113818 => true, + 113819 => true, + 119030 => true, + 119031 => true, + 119032 => true, + 119033 => true, + 119034 => true, + 119035 => true, + 119036 => true, + 119037 => true, + 119038 => true, + 119039 => true, + 119079 => true, + 119080 => true, + 119155 => true, + 119156 => true, + 119157 => true, + 119158 => true, + 119159 => true, + 119160 => true, + 119161 => true, + 119162 => true, + 119273 => true, + 119274 => true, + 119275 => true, + 119276 => true, + 119277 => true, + 119278 => true, + 119279 => true, + 119280 => true, + 119281 => true, + 119282 => true, + 119283 => true, + 119284 => true, + 119285 => true, + 119286 => true, + 119287 => true, + 119288 => true, + 119289 => true, + 119290 => true, + 119291 => true, + 119292 => true, + 119293 => true, + 119294 => true, + 119295 => true, + 119540 => true, + 119541 => true, + 119542 => true, + 119543 => true, + 119544 => true, + 119545 => true, + 119546 => true, + 119547 => true, + 119548 => true, + 119549 => true, + 119550 => true, + 119551 => true, + 119639 => true, + 119640 => true, + 119641 => true, + 119642 => true, + 119643 => true, + 119644 => true, + 119645 => true, + 119646 => true, + 119647 => true, + 119893 => true, + 119965 => true, + 119968 => true, + 119969 => true, + 119971 => true, + 119972 => true, + 119975 => true, + 119976 => true, + 119981 => true, + 119994 => true, + 119996 => true, + 120004 => true, + 120070 => true, + 120075 => true, + 120076 => true, + 120085 => true, + 120093 => true, + 120122 => true, + 120127 => true, + 120133 => true, + 120135 => true, + 120136 => true, + 120137 => true, + 120145 => true, + 120486 => true, + 120487 => true, + 120780 => true, + 120781 => true, + 121484 => true, + 121485 => true, + 121486 => true, + 121487 => true, + 121488 => true, + 121489 => true, + 121490 => true, + 121491 => true, + 121492 => true, + 121493 => true, + 121494 => true, + 121495 => true, + 121496 => true, + 121497 => true, + 121498 => true, + 121504 => true, + 122887 => true, + 122905 => true, + 122906 => true, + 122914 => true, + 122917 => true, + 123181 => true, + 123182 => true, + 123183 => true, + 123198 => true, + 123199 => true, + 123210 => true, + 123211 => true, + 123212 => true, + 123213 => true, + 123642 => true, + 123643 => true, + 123644 => true, + 123645 => true, + 123646 => true, + 125125 => true, + 125126 => true, + 125260 => true, + 125261 => true, + 125262 => true, + 125263 => true, + 125274 => true, + 125275 => true, + 125276 => true, + 125277 => true, + 126468 => true, + 126496 => true, + 126499 => true, + 126501 => true, + 126502 => true, + 126504 => true, + 126515 => true, + 126520 => true, + 126522 => true, + 126524 => true, + 126525 => true, + 126526 => true, + 126527 => true, + 126528 => true, + 126529 => true, + 126531 => true, + 126532 => true, + 126533 => true, + 126534 => true, + 126536 => true, + 126538 => true, + 126540 => true, + 126544 => true, + 126547 => true, + 126549 => true, + 126550 => true, + 126552 => true, + 126554 => true, + 126556 => true, + 126558 => true, + 126560 => true, + 126563 => true, + 126565 => true, + 126566 => true, + 126571 => true, + 126579 => true, + 126584 => true, + 126589 => true, + 126591 => true, + 126602 => true, + 126620 => true, + 126621 => true, + 126622 => true, + 126623 => true, + 126624 => true, + 126628 => true, + 126634 => true, + 127020 => true, + 127021 => true, + 127022 => true, + 127023 => true, + 127124 => true, + 127125 => true, + 127126 => true, + 127127 => true, + 127128 => true, + 127129 => true, + 127130 => true, + 127131 => true, + 127132 => true, + 127133 => true, + 127134 => true, + 127135 => true, + 127151 => true, + 127152 => true, + 127168 => true, + 127184 => true, + 127222 => true, + 127223 => true, + 127224 => true, + 127225 => true, + 127226 => true, + 127227 => true, + 127228 => true, + 127229 => true, + 127230 => true, + 127231 => true, + 127232 => true, + 127491 => true, + 127492 => true, + 127493 => true, + 127494 => true, + 127495 => true, + 127496 => true, + 127497 => true, + 127498 => true, + 127499 => true, + 127500 => true, + 127501 => true, + 127502 => true, + 127503 => true, + 127548 => true, + 127549 => true, + 127550 => true, + 127551 => true, + 127561 => true, + 127562 => true, + 127563 => true, + 127564 => true, + 127565 => true, + 127566 => true, + 127567 => true, + 127570 => true, + 127571 => true, + 127572 => true, + 127573 => true, + 127574 => true, + 127575 => true, + 127576 => true, + 127577 => true, + 127578 => true, + 127579 => true, + 127580 => true, + 127581 => true, + 127582 => true, + 127583 => true, + 128728 => true, + 128729 => true, + 128730 => true, + 128731 => true, + 128732 => true, + 128733 => true, + 128734 => true, + 128735 => true, + 128749 => true, + 128750 => true, + 128751 => true, + 128765 => true, + 128766 => true, + 128767 => true, + 128884 => true, + 128885 => true, + 128886 => true, + 128887 => true, + 128888 => true, + 128889 => true, + 128890 => true, + 128891 => true, + 128892 => true, + 128893 => true, + 128894 => true, + 128895 => true, + 128985 => true, + 128986 => true, + 128987 => true, + 128988 => true, + 128989 => true, + 128990 => true, + 128991 => true, + 129004 => true, + 129005 => true, + 129006 => true, + 129007 => true, + 129008 => true, + 129009 => true, + 129010 => true, + 129011 => true, + 129012 => true, + 129013 => true, + 129014 => true, + 129015 => true, + 129016 => true, + 129017 => true, + 129018 => true, + 129019 => true, + 129020 => true, + 129021 => true, + 129022 => true, + 129023 => true, + 129036 => true, + 129037 => true, + 129038 => true, + 129039 => true, + 129096 => true, + 129097 => true, + 129098 => true, + 129099 => true, + 129100 => true, + 129101 => true, + 129102 => true, + 129103 => true, + 129114 => true, + 129115 => true, + 129116 => true, + 129117 => true, + 129118 => true, + 129119 => true, + 129160 => true, + 129161 => true, + 129162 => true, + 129163 => true, + 129164 => true, + 129165 => true, + 129166 => true, + 129167 => true, + 129198 => true, + 129199 => true, + 129401 => true, + 129484 => true, + 129620 => true, + 129621 => true, + 129622 => true, + 129623 => true, + 129624 => true, + 129625 => true, + 129626 => true, + 129627 => true, + 129628 => true, + 129629 => true, + 129630 => true, + 129631 => true, + 129646 => true, + 129647 => true, + 129653 => true, + 129654 => true, + 129655 => true, + 129659 => true, + 129660 => true, + 129661 => true, + 129662 => true, + 129663 => true, + 129671 => true, + 129672 => true, + 129673 => true, + 129674 => true, + 129675 => true, + 129676 => true, + 129677 => true, + 129678 => true, + 129679 => true, + 129705 => true, + 129706 => true, + 129707 => true, + 129708 => true, + 129709 => true, + 129710 => true, + 129711 => true, + 129719 => true, + 129720 => true, + 129721 => true, + 129722 => true, + 129723 => true, + 129724 => true, + 129725 => true, + 129726 => true, + 129727 => true, + 129731 => true, + 129732 => true, + 129733 => true, + 129734 => true, + 129735 => true, + 129736 => true, + 129737 => true, + 129738 => true, + 129739 => true, + 129740 => true, + 129741 => true, + 129742 => true, + 129743 => true, + 129939 => true, + 131070 => true, + 131071 => true, + 177973 => true, + 177974 => true, + 177975 => true, + 177976 => true, + 177977 => true, + 177978 => true, + 177979 => true, + 177980 => true, + 177981 => true, + 177982 => true, + 177983 => true, + 178206 => true, + 178207 => true, + 183970 => true, + 183971 => true, + 183972 => true, + 183973 => true, + 183974 => true, + 183975 => true, + 183976 => true, + 183977 => true, + 183978 => true, + 183979 => true, + 183980 => true, + 183981 => true, + 183982 => true, + 183983 => true, + 194664 => true, + 194676 => true, + 194847 => true, + 194911 => true, + 195007 => true, + 196606 => true, + 196607 => true, + 262142 => true, + 262143 => true, + 327678 => true, + 327679 => true, + 393214 => true, + 393215 => true, + 458750 => true, + 458751 => true, + 524286 => true, + 524287 => true, + 589822 => true, + 589823 => true, + 655358 => true, + 655359 => true, + 720894 => true, + 720895 => true, + 786430 => true, + 786431 => true, + 851966 => true, + 851967 => true, + 917502 => true, + 917503 => true, + 917504 => true, + 917505 => true, + 917506 => true, + 917507 => true, + 917508 => true, + 917509 => true, + 917510 => true, + 917511 => true, + 917512 => true, + 917513 => true, + 917514 => true, + 917515 => true, + 917516 => true, + 917517 => true, + 917518 => true, + 917519 => true, + 917520 => true, + 917521 => true, + 917522 => true, + 917523 => true, + 917524 => true, + 917525 => true, + 917526 => true, + 917527 => true, + 917528 => true, + 917529 => true, + 917530 => true, + 917531 => true, + 917532 => true, + 917533 => true, + 917534 => true, + 917535 => true, + 983038 => true, + 983039 => true, + 1048574 => true, + 1048575 => true, + 1114110 => true, + 1114111 => true, +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php new file mode 100644 index 00000000000..54f21cc0cdd --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php @@ -0,0 +1,308 @@ + ' ', + 168 => ' ̈', + 175 => ' Ì„', + 180 => ' Ì', + 184 => ' ̧', + 728 => ' ̆', + 729 => ' ̇', + 730 => ' ÌŠ', + 731 => ' ̨', + 732 => ' ̃', + 733 => ' Ì‹', + 890 => ' ι', + 894 => ';', + 900 => ' Ì', + 901 => ' ̈Ì', + 8125 => ' Ì“', + 8127 => ' Ì“', + 8128 => ' Í‚', + 8129 => ' ̈͂', + 8141 => ' Ì“Ì€', + 8142 => ' Ì“Ì', + 8143 => ' Ì“Í‚', + 8157 => ' ̔̀', + 8158 => ' Ì”Ì', + 8159 => ' ̔͂', + 8173 => ' ̈̀', + 8174 => ' ̈Ì', + 8175 => '`', + 8189 => ' Ì', + 8190 => ' Ì”', + 8192 => ' ', + 8193 => ' ', + 8194 => ' ', + 8195 => ' ', + 8196 => ' ', + 8197 => ' ', + 8198 => ' ', + 8199 => ' ', + 8200 => ' ', + 8201 => ' ', + 8202 => ' ', + 8215 => ' ̳', + 8239 => ' ', + 8252 => '!!', + 8254 => ' Ì…', + 8263 => '??', + 8264 => '?!', + 8265 => '!?', + 8287 => ' ', + 8314 => '+', + 8316 => '=', + 8317 => '(', + 8318 => ')', + 8330 => '+', + 8332 => '=', + 8333 => '(', + 8334 => ')', + 8448 => 'a/c', + 8449 => 'a/s', + 8453 => 'c/o', + 8454 => 'c/u', + 9332 => '(1)', + 9333 => '(2)', + 9334 => '(3)', + 9335 => '(4)', + 9336 => '(5)', + 9337 => '(6)', + 9338 => '(7)', + 9339 => '(8)', + 9340 => '(9)', + 9341 => '(10)', + 9342 => '(11)', + 9343 => '(12)', + 9344 => '(13)', + 9345 => '(14)', + 9346 => '(15)', + 9347 => '(16)', + 9348 => '(17)', + 9349 => '(18)', + 9350 => '(19)', + 9351 => '(20)', + 9372 => '(a)', + 9373 => '(b)', + 9374 => '(c)', + 9375 => '(d)', + 9376 => '(e)', + 9377 => '(f)', + 9378 => '(g)', + 9379 => '(h)', + 9380 => '(i)', + 9381 => '(j)', + 9382 => '(k)', + 9383 => '(l)', + 9384 => '(m)', + 9385 => '(n)', + 9386 => '(o)', + 9387 => '(p)', + 9388 => '(q)', + 9389 => '(r)', + 9390 => '(s)', + 9391 => '(t)', + 9392 => '(u)', + 9393 => '(v)', + 9394 => '(w)', + 9395 => '(x)', + 9396 => '(y)', + 9397 => '(z)', + 10868 => '::=', + 10869 => '==', + 10870 => '===', + 12288 => ' ', + 12443 => ' ã‚™', + 12444 => ' ã‚š', + 12800 => '(á„€)', + 12801 => '(á„‚)', + 12802 => '(ᄃ)', + 12803 => '(á„…)', + 12804 => '(ᄆ)', + 12805 => '(ᄇ)', + 12806 => '(ᄉ)', + 12807 => '(á„‹)', + 12808 => '(á„Œ)', + 12809 => '(á„Ž)', + 12810 => '(á„)', + 12811 => '(á„)', + 12812 => '(á„‘)', + 12813 => '(á„’)', + 12814 => '(ê°€)', + 12815 => '(나)', + 12816 => '(다)', + 12817 => '(ë¼)', + 12818 => '(마)', + 12819 => '(ë°”)', + 12820 => '(사)', + 12821 => '(ì•„)', + 12822 => '(ìž)', + 12823 => '(ì°¨)', + 12824 => '(ì¹´)', + 12825 => '(타)', + 12826 => '(파)', + 12827 => '(하)', + 12828 => '(주)', + 12829 => '(오전)', + 12830 => '(오후)', + 12832 => '(一)', + 12833 => '(二)', + 12834 => '(三)', + 12835 => '(å››)', + 12836 => '(五)', + 12837 => '(å…­)', + 12838 => '(七)', + 12839 => '(å…«)', + 12840 => '(ä¹)', + 12841 => '(å)', + 12842 => '(月)', + 12843 => '(ç«)', + 12844 => '(æ°´)', + 12845 => '(木)', + 12846 => '(金)', + 12847 => '(土)', + 12848 => '(æ—¥)', + 12849 => '(æ ª)', + 12850 => '(有)', + 12851 => '(社)', + 12852 => '(å)', + 12853 => '(特)', + 12854 => '(財)', + 12855 => '(ç¥)', + 12856 => '(労)', + 12857 => '(代)', + 12858 => '(呼)', + 12859 => '(å­¦)', + 12860 => '(監)', + 12861 => '(ä¼)', + 12862 => '(資)', + 12863 => '(å”)', + 12864 => '(祭)', + 12865 => '(休)', + 12866 => '(自)', + 12867 => '(至)', + 64297 => '+', + 64606 => ' ٌّ', + 64607 => ' ÙÙ‘', + 64608 => ' ÙŽÙ‘', + 64609 => ' ÙÙ‘', + 64610 => ' ÙÙ‘', + 64611 => ' ّٰ', + 65018 => 'صلى الله عليه وسلم', + 65019 => 'جل جلاله', + 65040 => ',', + 65043 => ':', + 65044 => ';', + 65045 => '!', + 65046 => '?', + 65075 => '_', + 65076 => '_', + 65077 => '(', + 65078 => ')', + 65079 => '{', + 65080 => '}', + 65095 => '[', + 65096 => ']', + 65097 => ' Ì…', + 65098 => ' Ì…', + 65099 => ' Ì…', + 65100 => ' Ì…', + 65101 => '_', + 65102 => '_', + 65103 => '_', + 65104 => ',', + 65108 => ';', + 65109 => ':', + 65110 => '?', + 65111 => '!', + 65113 => '(', + 65114 => ')', + 65115 => '{', + 65116 => '}', + 65119 => '#', + 65120 => '&', + 65121 => '*', + 65122 => '+', + 65124 => '<', + 65125 => '>', + 65126 => '=', + 65128 => '\\', + 65129 => '$', + 65130 => '%', + 65131 => '@', + 65136 => ' Ù‹', + 65138 => ' ÙŒ', + 65140 => ' Ù', + 65142 => ' ÙŽ', + 65144 => ' Ù', + 65146 => ' Ù', + 65148 => ' Ù‘', + 65150 => ' Ù’', + 65281 => '!', + 65282 => '"', + 65283 => '#', + 65284 => '$', + 65285 => '%', + 65286 => '&', + 65287 => '\'', + 65288 => '(', + 65289 => ')', + 65290 => '*', + 65291 => '+', + 65292 => ',', + 65295 => '/', + 65306 => ':', + 65307 => ';', + 65308 => '<', + 65309 => '=', + 65310 => '>', + 65311 => '?', + 65312 => '@', + 65339 => '[', + 65340 => '\\', + 65341 => ']', + 65342 => '^', + 65343 => '_', + 65344 => '`', + 65371 => '{', + 65372 => '|', + 65373 => '}', + 65374 => '~', + 65507 => ' Ì„', + 127233 => '0,', + 127234 => '1,', + 127235 => '2,', + 127236 => '3,', + 127237 => '4,', + 127238 => '5,', + 127239 => '6,', + 127240 => '7,', + 127241 => '8,', + 127242 => '9,', + 127248 => '(a)', + 127249 => '(b)', + 127250 => '(c)', + 127251 => '(d)', + 127252 => '(e)', + 127253 => '(f)', + 127254 => '(g)', + 127255 => '(h)', + 127256 => '(i)', + 127257 => '(j)', + 127258 => '(k)', + 127259 => '(l)', + 127260 => '(m)', + 127261 => '(n)', + 127262 => '(o)', + 127263 => '(p)', + 127264 => '(q)', + 127265 => '(r)', + 127266 => '(s)', + 127267 => '(t)', + 127268 => '(u)', + 127269 => '(v)', + 127270 => '(w)', + 127271 => '(x)', + 127272 => '(y)', + 127273 => '(z)', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php new file mode 100644 index 00000000000..223396ec4c3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php @@ -0,0 +1,71 @@ + true, + 1 => true, + 2 => true, + 3 => true, + 4 => true, + 5 => true, + 6 => true, + 7 => true, + 8 => true, + 9 => true, + 10 => true, + 11 => true, + 12 => true, + 13 => true, + 14 => true, + 15 => true, + 16 => true, + 17 => true, + 18 => true, + 19 => true, + 20 => true, + 21 => true, + 22 => true, + 23 => true, + 24 => true, + 25 => true, + 26 => true, + 27 => true, + 28 => true, + 29 => true, + 30 => true, + 31 => true, + 32 => true, + 33 => true, + 34 => true, + 35 => true, + 36 => true, + 37 => true, + 38 => true, + 39 => true, + 40 => true, + 41 => true, + 42 => true, + 43 => true, + 44 => true, + 47 => true, + 58 => true, + 59 => true, + 60 => true, + 61 => true, + 62 => true, + 63 => true, + 64 => true, + 91 => true, + 92 => true, + 93 => true, + 94 => true, + 95 => true, + 96 => true, + 123 => true, + 124 => true, + 125 => true, + 126 => true, + 127 => true, + 8800 => true, + 8814 => true, + 8815 => true, +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php new file mode 100644 index 00000000000..b377844130e --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php @@ -0,0 +1,273 @@ + true, + 847 => true, + 6155 => true, + 6156 => true, + 6157 => true, + 8203 => true, + 8288 => true, + 8292 => true, + 65024 => true, + 65025 => true, + 65026 => true, + 65027 => true, + 65028 => true, + 65029 => true, + 65030 => true, + 65031 => true, + 65032 => true, + 65033 => true, + 65034 => true, + 65035 => true, + 65036 => true, + 65037 => true, + 65038 => true, + 65039 => true, + 65279 => true, + 113824 => true, + 113825 => true, + 113826 => true, + 113827 => true, + 917760 => true, + 917761 => true, + 917762 => true, + 917763 => true, + 917764 => true, + 917765 => true, + 917766 => true, + 917767 => true, + 917768 => true, + 917769 => true, + 917770 => true, + 917771 => true, + 917772 => true, + 917773 => true, + 917774 => true, + 917775 => true, + 917776 => true, + 917777 => true, + 917778 => true, + 917779 => true, + 917780 => true, + 917781 => true, + 917782 => true, + 917783 => true, + 917784 => true, + 917785 => true, + 917786 => true, + 917787 => true, + 917788 => true, + 917789 => true, + 917790 => true, + 917791 => true, + 917792 => true, + 917793 => true, + 917794 => true, + 917795 => true, + 917796 => true, + 917797 => true, + 917798 => true, + 917799 => true, + 917800 => true, + 917801 => true, + 917802 => true, + 917803 => true, + 917804 => true, + 917805 => true, + 917806 => true, + 917807 => true, + 917808 => true, + 917809 => true, + 917810 => true, + 917811 => true, + 917812 => true, + 917813 => true, + 917814 => true, + 917815 => true, + 917816 => true, + 917817 => true, + 917818 => true, + 917819 => true, + 917820 => true, + 917821 => true, + 917822 => true, + 917823 => true, + 917824 => true, + 917825 => true, + 917826 => true, + 917827 => true, + 917828 => true, + 917829 => true, + 917830 => true, + 917831 => true, + 917832 => true, + 917833 => true, + 917834 => true, + 917835 => true, + 917836 => true, + 917837 => true, + 917838 => true, + 917839 => true, + 917840 => true, + 917841 => true, + 917842 => true, + 917843 => true, + 917844 => true, + 917845 => true, + 917846 => true, + 917847 => true, + 917848 => true, + 917849 => true, + 917850 => true, + 917851 => true, + 917852 => true, + 917853 => true, + 917854 => true, + 917855 => true, + 917856 => true, + 917857 => true, + 917858 => true, + 917859 => true, + 917860 => true, + 917861 => true, + 917862 => true, + 917863 => true, + 917864 => true, + 917865 => true, + 917866 => true, + 917867 => true, + 917868 => true, + 917869 => true, + 917870 => true, + 917871 => true, + 917872 => true, + 917873 => true, + 917874 => true, + 917875 => true, + 917876 => true, + 917877 => true, + 917878 => true, + 917879 => true, + 917880 => true, + 917881 => true, + 917882 => true, + 917883 => true, + 917884 => true, + 917885 => true, + 917886 => true, + 917887 => true, + 917888 => true, + 917889 => true, + 917890 => true, + 917891 => true, + 917892 => true, + 917893 => true, + 917894 => true, + 917895 => true, + 917896 => true, + 917897 => true, + 917898 => true, + 917899 => true, + 917900 => true, + 917901 => true, + 917902 => true, + 917903 => true, + 917904 => true, + 917905 => true, + 917906 => true, + 917907 => true, + 917908 => true, + 917909 => true, + 917910 => true, + 917911 => true, + 917912 => true, + 917913 => true, + 917914 => true, + 917915 => true, + 917916 => true, + 917917 => true, + 917918 => true, + 917919 => true, + 917920 => true, + 917921 => true, + 917922 => true, + 917923 => true, + 917924 => true, + 917925 => true, + 917926 => true, + 917927 => true, + 917928 => true, + 917929 => true, + 917930 => true, + 917931 => true, + 917932 => true, + 917933 => true, + 917934 => true, + 917935 => true, + 917936 => true, + 917937 => true, + 917938 => true, + 917939 => true, + 917940 => true, + 917941 => true, + 917942 => true, + 917943 => true, + 917944 => true, + 917945 => true, + 917946 => true, + 917947 => true, + 917948 => true, + 917949 => true, + 917950 => true, + 917951 => true, + 917952 => true, + 917953 => true, + 917954 => true, + 917955 => true, + 917956 => true, + 917957 => true, + 917958 => true, + 917959 => true, + 917960 => true, + 917961 => true, + 917962 => true, + 917963 => true, + 917964 => true, + 917965 => true, + 917966 => true, + 917967 => true, + 917968 => true, + 917969 => true, + 917970 => true, + 917971 => true, + 917972 => true, + 917973 => true, + 917974 => true, + 917975 => true, + 917976 => true, + 917977 => true, + 917978 => true, + 917979 => true, + 917980 => true, + 917981 => true, + 917982 => true, + 917983 => true, + 917984 => true, + 917985 => true, + 917986 => true, + 917987 => true, + 917988 => true, + 917989 => true, + 917990 => true, + 917991 => true, + 917992 => true, + 917993 => true, + 917994 => true, + 917995 => true, + 917996 => true, + 917997 => true, + 917998 => true, + 917999 => true, +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php new file mode 100644 index 00000000000..9b85fe9d3f8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php @@ -0,0 +1,5778 @@ + 'a', + 66 => 'b', + 67 => 'c', + 68 => 'd', + 69 => 'e', + 70 => 'f', + 71 => 'g', + 72 => 'h', + 73 => 'i', + 74 => 'j', + 75 => 'k', + 76 => 'l', + 77 => 'm', + 78 => 'n', + 79 => 'o', + 80 => 'p', + 81 => 'q', + 82 => 'r', + 83 => 's', + 84 => 't', + 85 => 'u', + 86 => 'v', + 87 => 'w', + 88 => 'x', + 89 => 'y', + 90 => 'z', + 170 => 'a', + 178 => '2', + 179 => '3', + 181 => 'μ', + 185 => '1', + 186 => 'o', + 188 => '1â„4', + 189 => '1â„2', + 190 => '3â„4', + 192 => 'à', + 193 => 'á', + 194 => 'â', + 195 => 'ã', + 196 => 'ä', + 197 => 'Ã¥', + 198 => 'æ', + 199 => 'ç', + 200 => 'è', + 201 => 'é', + 202 => 'ê', + 203 => 'ë', + 204 => 'ì', + 205 => 'í', + 206 => 'î', + 207 => 'ï', + 208 => 'ð', + 209 => 'ñ', + 210 => 'ò', + 211 => 'ó', + 212 => 'ô', + 213 => 'õ', + 214 => 'ö', + 216 => 'ø', + 217 => 'ù', + 218 => 'ú', + 219 => 'û', + 220 => 'ü', + 221 => 'ý', + 222 => 'þ', + 256 => 'Ä', + 258 => 'ă', + 260 => 'Ä…', + 262 => 'ć', + 264 => 'ĉ', + 266 => 'Ä‹', + 268 => 'Ä', + 270 => 'Ä', + 272 => 'Ä‘', + 274 => 'Ä“', + 276 => 'Ä•', + 278 => 'Ä—', + 280 => 'Ä™', + 282 => 'Ä›', + 284 => 'Ä', + 286 => 'ÄŸ', + 288 => 'Ä¡', + 290 => 'Ä£', + 292 => 'Ä¥', + 294 => 'ħ', + 296 => 'Ä©', + 298 => 'Ä«', + 300 => 'Ä­', + 302 => 'į', + 304 => 'i̇', + 306 => 'ij', + 307 => 'ij', + 308 => 'ĵ', + 310 => 'Ä·', + 313 => 'ĺ', + 315 => 'ļ', + 317 => 'ľ', + 319 => 'l·', + 320 => 'l·', + 321 => 'Å‚', + 323 => 'Å„', + 325 => 'ņ', + 327 => 'ň', + 329 => 'ʼn', + 330 => 'Å‹', + 332 => 'Å', + 334 => 'Å', + 336 => 'Å‘', + 338 => 'Å“', + 340 => 'Å•', + 342 => 'Å—', + 344 => 'Å™', + 346 => 'Å›', + 348 => 'Å', + 350 => 'ÅŸ', + 352 => 'Å¡', + 354 => 'Å£', + 356 => 'Å¥', + 358 => 'ŧ', + 360 => 'Å©', + 362 => 'Å«', + 364 => 'Å­', + 366 => 'ů', + 368 => 'ű', + 370 => 'ų', + 372 => 'ŵ', + 374 => 'Å·', + 376 => 'ÿ', + 377 => 'ź', + 379 => 'ż', + 381 => 'ž', + 383 => 's', + 385 => 'É“', + 386 => 'ƃ', + 388 => 'Æ…', + 390 => 'É”', + 391 => 'ƈ', + 393 => 'É–', + 394 => 'É—', + 395 => 'ÆŒ', + 398 => 'Ç', + 399 => 'É™', + 400 => 'É›', + 401 => 'Æ’', + 403 => 'É ', + 404 => 'É£', + 406 => 'É©', + 407 => 'ɨ', + 408 => 'Æ™', + 412 => 'ɯ', + 413 => 'ɲ', + 415 => 'ɵ', + 416 => 'Æ¡', + 418 => 'Æ£', + 420 => 'Æ¥', + 422 => 'Ê€', + 423 => 'ƨ', + 425 => 'ʃ', + 428 => 'Æ­', + 430 => 'ʈ', + 431 => 'Æ°', + 433 => 'ÊŠ', + 434 => 'Ê‹', + 435 => 'Æ´', + 437 => 'ƶ', + 439 => 'Ê’', + 440 => 'ƹ', + 444 => 'ƽ', + 452 => 'dž', + 453 => 'dž', + 454 => 'dž', + 455 => 'lj', + 456 => 'lj', + 457 => 'lj', + 458 => 'nj', + 459 => 'nj', + 460 => 'nj', + 461 => 'ÇŽ', + 463 => 'Ç', + 465 => 'Ç’', + 467 => 'Ç”', + 469 => 'Ç–', + 471 => 'ǘ', + 473 => 'Çš', + 475 => 'Çœ', + 478 => 'ÇŸ', + 480 => 'Ç¡', + 482 => 'Ç£', + 484 => 'Ç¥', + 486 => 'ǧ', + 488 => 'Ç©', + 490 => 'Ç«', + 492 => 'Ç­', + 494 => 'ǯ', + 497 => 'dz', + 498 => 'dz', + 499 => 'dz', + 500 => 'ǵ', + 502 => 'Æ•', + 503 => 'Æ¿', + 504 => 'ǹ', + 506 => 'Ç»', + 508 => 'ǽ', + 510 => 'Ç¿', + 512 => 'È', + 514 => 'ȃ', + 516 => 'È…', + 518 => 'ȇ', + 520 => 'ȉ', + 522 => 'È‹', + 524 => 'È', + 526 => 'È', + 528 => 'È‘', + 530 => 'È“', + 532 => 'È•', + 534 => 'È—', + 536 => 'È™', + 538 => 'È›', + 540 => 'È', + 542 => 'ÈŸ', + 544 => 'Æž', + 546 => 'È£', + 548 => 'È¥', + 550 => 'ȧ', + 552 => 'È©', + 554 => 'È«', + 556 => 'È­', + 558 => 'ȯ', + 560 => 'ȱ', + 562 => 'ȳ', + 570 => 'â±¥', + 571 => 'ȼ', + 573 => 'Æš', + 574 => 'ⱦ', + 577 => 'É‚', + 579 => 'Æ€', + 580 => 'ʉ', + 581 => 'ÊŒ', + 582 => 'ɇ', + 584 => 'ɉ', + 586 => 'É‹', + 588 => 'É', + 590 => 'É', + 688 => 'h', + 689 => 'ɦ', + 690 => 'j', + 691 => 'r', + 692 => 'ɹ', + 693 => 'É»', + 694 => 'Ê', + 695 => 'w', + 696 => 'y', + 736 => 'É£', + 737 => 'l', + 738 => 's', + 739 => 'x', + 740 => 'Ê•', + 832 => 'Ì€', + 833 => 'Ì', + 835 => 'Ì“', + 836 => '̈Ì', + 837 => 'ι', + 880 => 'ͱ', + 882 => 'ͳ', + 884 => 'ʹ', + 886 => 'Í·', + 895 => 'ϳ', + 902 => 'ά', + 903 => '·', + 904 => 'έ', + 905 => 'ή', + 906 => 'ί', + 908 => 'ÏŒ', + 910 => 'Ï', + 911 => 'ÏŽ', + 913 => 'α', + 914 => 'β', + 915 => 'γ', + 916 => 'δ', + 917 => 'ε', + 918 => 'ζ', + 919 => 'η', + 920 => 'θ', + 921 => 'ι', + 922 => 'κ', + 923 => 'λ', + 924 => 'μ', + 925 => 'ν', + 926 => 'ξ', + 927 => 'ο', + 928 => 'Ï€', + 929 => 'Ï', + 931 => 'σ', + 932 => 'Ï„', + 933 => 'Ï…', + 934 => 'φ', + 935 => 'χ', + 936 => 'ψ', + 937 => 'ω', + 938 => 'ÏŠ', + 939 => 'Ï‹', + 975 => 'Ï—', + 976 => 'β', + 977 => 'θ', + 978 => 'Ï…', + 979 => 'Ï', + 980 => 'Ï‹', + 981 => 'φ', + 982 => 'Ï€', + 984 => 'Ï™', + 986 => 'Ï›', + 988 => 'Ï', + 990 => 'ÏŸ', + 992 => 'Ï¡', + 994 => 'Ï£', + 996 => 'Ï¥', + 998 => 'ϧ', + 1000 => 'Ï©', + 1002 => 'Ï«', + 1004 => 'Ï­', + 1006 => 'ϯ', + 1008 => 'κ', + 1009 => 'Ï', + 1010 => 'σ', + 1012 => 'θ', + 1013 => 'ε', + 1015 => 'ϸ', + 1017 => 'σ', + 1018 => 'Ï»', + 1021 => 'Í»', + 1022 => 'ͼ', + 1023 => 'ͽ', + 1024 => 'Ñ', + 1025 => 'Ñ‘', + 1026 => 'Ñ’', + 1027 => 'Ñ“', + 1028 => 'Ñ”', + 1029 => 'Ñ•', + 1030 => 'Ñ–', + 1031 => 'Ñ—', + 1032 => 'ј', + 1033 => 'Ñ™', + 1034 => 'Ñš', + 1035 => 'Ñ›', + 1036 => 'Ñœ', + 1037 => 'Ñ', + 1038 => 'Ñž', + 1039 => 'ÑŸ', + 1040 => 'а', + 1041 => 'б', + 1042 => 'в', + 1043 => 'г', + 1044 => 'д', + 1045 => 'е', + 1046 => 'ж', + 1047 => 'з', + 1048 => 'и', + 1049 => 'й', + 1050 => 'к', + 1051 => 'л', + 1052 => 'м', + 1053 => 'н', + 1054 => 'о', + 1055 => 'п', + 1056 => 'Ñ€', + 1057 => 'Ñ', + 1058 => 'Ñ‚', + 1059 => 'у', + 1060 => 'Ñ„', + 1061 => 'Ñ…', + 1062 => 'ц', + 1063 => 'ч', + 1064 => 'ш', + 1065 => 'щ', + 1066 => 'ÑŠ', + 1067 => 'Ñ‹', + 1068 => 'ÑŒ', + 1069 => 'Ñ', + 1070 => 'ÑŽ', + 1071 => 'Ñ', + 1120 => 'Ñ¡', + 1122 => 'Ñ£', + 1124 => 'Ñ¥', + 1126 => 'ѧ', + 1128 => 'Ñ©', + 1130 => 'Ñ«', + 1132 => 'Ñ­', + 1134 => 'ѯ', + 1136 => 'ѱ', + 1138 => 'ѳ', + 1140 => 'ѵ', + 1142 => 'Ñ·', + 1144 => 'ѹ', + 1146 => 'Ñ»', + 1148 => 'ѽ', + 1150 => 'Ñ¿', + 1152 => 'Ò', + 1162 => 'Ò‹', + 1164 => 'Ò', + 1166 => 'Ò', + 1168 => 'Ò‘', + 1170 => 'Ò“', + 1172 => 'Ò•', + 1174 => 'Ò—', + 1176 => 'Ò™', + 1178 => 'Ò›', + 1180 => 'Ò', + 1182 => 'ÒŸ', + 1184 => 'Ò¡', + 1186 => 'Ò£', + 1188 => 'Ò¥', + 1190 => 'Ò§', + 1192 => 'Ò©', + 1194 => 'Ò«', + 1196 => 'Ò­', + 1198 => 'Ò¯', + 1200 => 'Ò±', + 1202 => 'Ò³', + 1204 => 'Òµ', + 1206 => 'Ò·', + 1208 => 'Ò¹', + 1210 => 'Ò»', + 1212 => 'Ò½', + 1214 => 'Ò¿', + 1217 => 'Ó‚', + 1219 => 'Ó„', + 1221 => 'Ó†', + 1223 => 'Óˆ', + 1225 => 'ÓŠ', + 1227 => 'ÓŒ', + 1229 => 'ÓŽ', + 1232 => 'Ó‘', + 1234 => 'Ó“', + 1236 => 'Ó•', + 1238 => 'Ó—', + 1240 => 'Ó™', + 1242 => 'Ó›', + 1244 => 'Ó', + 1246 => 'ÓŸ', + 1248 => 'Ó¡', + 1250 => 'Ó£', + 1252 => 'Ó¥', + 1254 => 'Ó§', + 1256 => 'Ó©', + 1258 => 'Ó«', + 1260 => 'Ó­', + 1262 => 'Ó¯', + 1264 => 'Ó±', + 1266 => 'Ó³', + 1268 => 'Óµ', + 1270 => 'Ó·', + 1272 => 'Ó¹', + 1274 => 'Ó»', + 1276 => 'Ó½', + 1278 => 'Ó¿', + 1280 => 'Ô', + 1282 => 'Ôƒ', + 1284 => 'Ô…', + 1286 => 'Ô‡', + 1288 => 'Ô‰', + 1290 => 'Ô‹', + 1292 => 'Ô', + 1294 => 'Ô', + 1296 => 'Ô‘', + 1298 => 'Ô“', + 1300 => 'Ô•', + 1302 => 'Ô—', + 1304 => 'Ô™', + 1306 => 'Ô›', + 1308 => 'Ô', + 1310 => 'ÔŸ', + 1312 => 'Ô¡', + 1314 => 'Ô£', + 1316 => 'Ô¥', + 1318 => 'Ô§', + 1320 => 'Ô©', + 1322 => 'Ô«', + 1324 => 'Ô­', + 1326 => 'Ô¯', + 1329 => 'Õ¡', + 1330 => 'Õ¢', + 1331 => 'Õ£', + 1332 => 'Õ¤', + 1333 => 'Õ¥', + 1334 => 'Õ¦', + 1335 => 'Õ§', + 1336 => 'Õ¨', + 1337 => 'Õ©', + 1338 => 'Õª', + 1339 => 'Õ«', + 1340 => 'Õ¬', + 1341 => 'Õ­', + 1342 => 'Õ®', + 1343 => 'Õ¯', + 1344 => 'Õ°', + 1345 => 'Õ±', + 1346 => 'Õ²', + 1347 => 'Õ³', + 1348 => 'Õ´', + 1349 => 'Õµ', + 1350 => 'Õ¶', + 1351 => 'Õ·', + 1352 => 'Õ¸', + 1353 => 'Õ¹', + 1354 => 'Õº', + 1355 => 'Õ»', + 1356 => 'Õ¼', + 1357 => 'Õ½', + 1358 => 'Õ¾', + 1359 => 'Õ¿', + 1360 => 'Ö€', + 1361 => 'Ö', + 1362 => 'Ö‚', + 1363 => 'Öƒ', + 1364 => 'Ö„', + 1365 => 'Ö…', + 1366 => 'Ö†', + 1415 => 'Õ¥Ö‚', + 1653 => 'اٴ', + 1654 => 'وٴ', + 1655 => 'Û‡Ù´', + 1656 => 'يٴ', + 2392 => 'क़', + 2393 => 'ख़', + 2394 => 'ग़', + 2395 => 'ज़', + 2396 => 'ड़', + 2397 => 'ढ़', + 2398 => 'फ़', + 2399 => 'य़', + 2524 => 'ড়', + 2525 => 'ঢ়', + 2527 => 'য়', + 2611 => 'ਲ਼', + 2614 => 'ਸ਼', + 2649 => 'ਖ਼', + 2650 => 'ਗ਼', + 2651 => 'ਜ਼', + 2654 => 'ਫ਼', + 2908 => 'ଡ଼', + 2909 => 'ଢ଼', + 3635 => 'à¹à¸²', + 3763 => 'à»àº²', + 3804 => 'ຫນ', + 3805 => 'ຫມ', + 3852 => '་', + 3907 => 'གྷ', + 3917 => 'ཌྷ', + 3922 => 'དྷ', + 3927 => 'བྷ', + 3932 => 'ཛྷ', + 3945 => 'ཀྵ', + 3955 => 'ཱི', + 3957 => 'ཱུ', + 3958 => 'ྲྀ', + 3959 => 'ྲཱྀ', + 3960 => 'ླྀ', + 3961 => 'ླཱྀ', + 3969 => 'ཱྀ', + 3987 => 'ྒྷ', + 3997 => 'ྜྷ', + 4002 => 'ྡྷ', + 4007 => 'ྦྷ', + 4012 => 'ྫྷ', + 4025 => 'à¾à¾µ', + 4295 => 'â´§', + 4301 => 'â´­', + 4348 => 'ნ', + 5112 => 'á°', + 5113 => 'á±', + 5114 => 'á²', + 5115 => 'á³', + 5116 => 'á´', + 5117 => 'áµ', + 7296 => 'в', + 7297 => 'д', + 7298 => 'о', + 7299 => 'Ñ', + 7300 => 'Ñ‚', + 7301 => 'Ñ‚', + 7302 => 'ÑŠ', + 7303 => 'Ñ£', + 7304 => 'ꙋ', + 7312 => 'áƒ', + 7313 => 'ბ', + 7314 => 'გ', + 7315 => 'დ', + 7316 => 'ე', + 7317 => 'ვ', + 7318 => 'ზ', + 7319 => 'თ', + 7320 => 'ი', + 7321 => 'კ', + 7322 => 'ლ', + 7323 => 'მ', + 7324 => 'ნ', + 7325 => 'áƒ', + 7326 => 'პ', + 7327 => 'ჟ', + 7328 => 'რ', + 7329 => 'ს', + 7330 => 'ტ', + 7331 => 'უ', + 7332 => 'ფ', + 7333 => 'ქ', + 7334 => 'ღ', + 7335 => 'ყ', + 7336 => 'შ', + 7337 => 'ჩ', + 7338 => 'ც', + 7339 => 'ძ', + 7340 => 'წ', + 7341 => 'ჭ', + 7342 => 'ხ', + 7343 => 'ჯ', + 7344 => 'ჰ', + 7345 => 'ჱ', + 7346 => 'ჲ', + 7347 => 'ჳ', + 7348 => 'ჴ', + 7349 => 'ჵ', + 7350 => 'ჶ', + 7351 => 'ჷ', + 7352 => 'ჸ', + 7353 => 'ჹ', + 7354 => 'ჺ', + 7357 => 'ჽ', + 7358 => 'ჾ', + 7359 => 'ჿ', + 7468 => 'a', + 7469 => 'æ', + 7470 => 'b', + 7472 => 'd', + 7473 => 'e', + 7474 => 'Ç', + 7475 => 'g', + 7476 => 'h', + 7477 => 'i', + 7478 => 'j', + 7479 => 'k', + 7480 => 'l', + 7481 => 'm', + 7482 => 'n', + 7484 => 'o', + 7485 => 'È£', + 7486 => 'p', + 7487 => 'r', + 7488 => 't', + 7489 => 'u', + 7490 => 'w', + 7491 => 'a', + 7492 => 'É', + 7493 => 'É‘', + 7494 => 'á´‚', + 7495 => 'b', + 7496 => 'd', + 7497 => 'e', + 7498 => 'É™', + 7499 => 'É›', + 7500 => 'Éœ', + 7501 => 'g', + 7503 => 'k', + 7504 => 'm', + 7505 => 'Å‹', + 7506 => 'o', + 7507 => 'É”', + 7508 => 'á´–', + 7509 => 'á´—', + 7510 => 'p', + 7511 => 't', + 7512 => 'u', + 7513 => 'á´', + 7514 => 'ɯ', + 7515 => 'v', + 7516 => 'á´¥', + 7517 => 'β', + 7518 => 'γ', + 7519 => 'δ', + 7520 => 'φ', + 7521 => 'χ', + 7522 => 'i', + 7523 => 'r', + 7524 => 'u', + 7525 => 'v', + 7526 => 'β', + 7527 => 'γ', + 7528 => 'Ï', + 7529 => 'φ', + 7530 => 'χ', + 7544 => 'н', + 7579 => 'É’', + 7580 => 'c', + 7581 => 'É•', + 7582 => 'ð', + 7583 => 'Éœ', + 7584 => 'f', + 7585 => 'ÉŸ', + 7586 => 'É¡', + 7587 => 'É¥', + 7588 => 'ɨ', + 7589 => 'É©', + 7590 => 'ɪ', + 7591 => 'áµ»', + 7592 => 'Ê', + 7593 => 'É­', + 7594 => 'ᶅ', + 7595 => 'ÊŸ', + 7596 => 'ɱ', + 7597 => 'É°', + 7598 => 'ɲ', + 7599 => 'ɳ', + 7600 => 'É´', + 7601 => 'ɵ', + 7602 => 'ɸ', + 7603 => 'Ê‚', + 7604 => 'ʃ', + 7605 => 'Æ«', + 7606 => 'ʉ', + 7607 => 'ÊŠ', + 7608 => 'á´œ', + 7609 => 'Ê‹', + 7610 => 'ÊŒ', + 7611 => 'z', + 7612 => 'Ê', + 7613 => 'Ê‘', + 7614 => 'Ê’', + 7615 => 'θ', + 7680 => 'á¸', + 7682 => 'ḃ', + 7684 => 'ḅ', + 7686 => 'ḇ', + 7688 => 'ḉ', + 7690 => 'ḋ', + 7692 => 'á¸', + 7694 => 'á¸', + 7696 => 'ḑ', + 7698 => 'ḓ', + 7700 => 'ḕ', + 7702 => 'ḗ', + 7704 => 'ḙ', + 7706 => 'ḛ', + 7708 => 'á¸', + 7710 => 'ḟ', + 7712 => 'ḡ', + 7714 => 'ḣ', + 7716 => 'ḥ', + 7718 => 'ḧ', + 7720 => 'ḩ', + 7722 => 'ḫ', + 7724 => 'ḭ', + 7726 => 'ḯ', + 7728 => 'ḱ', + 7730 => 'ḳ', + 7732 => 'ḵ', + 7734 => 'ḷ', + 7736 => 'ḹ', + 7738 => 'ḻ', + 7740 => 'ḽ', + 7742 => 'ḿ', + 7744 => 'á¹', + 7746 => 'ṃ', + 7748 => 'á¹…', + 7750 => 'ṇ', + 7752 => 'ṉ', + 7754 => 'ṋ', + 7756 => 'á¹', + 7758 => 'á¹', + 7760 => 'ṑ', + 7762 => 'ṓ', + 7764 => 'ṕ', + 7766 => 'á¹—', + 7768 => 'á¹™', + 7770 => 'á¹›', + 7772 => 'á¹', + 7774 => 'ṟ', + 7776 => 'ṡ', + 7778 => 'á¹£', + 7780 => 'á¹¥', + 7782 => 'ṧ', + 7784 => 'ṩ', + 7786 => 'ṫ', + 7788 => 'á¹­', + 7790 => 'ṯ', + 7792 => 'á¹±', + 7794 => 'á¹³', + 7796 => 'á¹µ', + 7798 => 'á¹·', + 7800 => 'á¹¹', + 7802 => 'á¹»', + 7804 => 'á¹½', + 7806 => 'ṿ', + 7808 => 'áº', + 7810 => 'ẃ', + 7812 => 'ẅ', + 7814 => 'ẇ', + 7816 => 'ẉ', + 7818 => 'ẋ', + 7820 => 'áº', + 7822 => 'áº', + 7824 => 'ẑ', + 7826 => 'ẓ', + 7828 => 'ẕ', + 7834 => 'aʾ', + 7835 => 'ṡ', + 7838 => 'ss', + 7840 => 'ạ', + 7842 => 'ả', + 7844 => 'ấ', + 7846 => 'ầ', + 7848 => 'ẩ', + 7850 => 'ẫ', + 7852 => 'ậ', + 7854 => 'ắ', + 7856 => 'ằ', + 7858 => 'ẳ', + 7860 => 'ẵ', + 7862 => 'ặ', + 7864 => 'ẹ', + 7866 => 'ẻ', + 7868 => 'ẽ', + 7870 => 'ế', + 7872 => 'á»', + 7874 => 'ể', + 7876 => 'á»…', + 7878 => 'ệ', + 7880 => 'ỉ', + 7882 => 'ị', + 7884 => 'á»', + 7886 => 'á»', + 7888 => 'ố', + 7890 => 'ồ', + 7892 => 'ổ', + 7894 => 'á»—', + 7896 => 'á»™', + 7898 => 'á»›', + 7900 => 'á»', + 7902 => 'ở', + 7904 => 'ỡ', + 7906 => 'ợ', + 7908 => 'ụ', + 7910 => 'ủ', + 7912 => 'ứ', + 7914 => 'ừ', + 7916 => 'á»­', + 7918 => 'ữ', + 7920 => 'á»±', + 7922 => 'ỳ', + 7924 => 'ỵ', + 7926 => 'á»·', + 7928 => 'ỹ', + 7930 => 'á»»', + 7932 => 'ỽ', + 7934 => 'ỿ', + 7944 => 'á¼€', + 7945 => 'á¼', + 7946 => 'ἂ', + 7947 => 'ἃ', + 7948 => 'ἄ', + 7949 => 'á¼…', + 7950 => 'ἆ', + 7951 => 'ἇ', + 7960 => 'á¼', + 7961 => 'ἑ', + 7962 => 'á¼’', + 7963 => 'ἓ', + 7964 => 'á¼”', + 7965 => 'ἕ', + 7976 => 'á¼ ', + 7977 => 'ἡ', + 7978 => 'á¼¢', + 7979 => 'á¼£', + 7980 => 'ἤ', + 7981 => 'á¼¥', + 7982 => 'ἦ', + 7983 => 'ἧ', + 7992 => 'á¼°', + 7993 => 'á¼±', + 7994 => 'á¼²', + 7995 => 'á¼³', + 7996 => 'á¼´', + 7997 => 'á¼µ', + 7998 => 'ἶ', + 7999 => 'á¼·', + 8008 => 'á½€', + 8009 => 'á½', + 8010 => 'ὂ', + 8011 => 'ὃ', + 8012 => 'ὄ', + 8013 => 'á½…', + 8025 => 'ὑ', + 8027 => 'ὓ', + 8029 => 'ὕ', + 8031 => 'á½—', + 8040 => 'á½ ', + 8041 => 'ὡ', + 8042 => 'á½¢', + 8043 => 'á½£', + 8044 => 'ὤ', + 8045 => 'á½¥', + 8046 => 'ὦ', + 8047 => 'ὧ', + 8049 => 'ά', + 8051 => 'έ', + 8053 => 'ή', + 8055 => 'ί', + 8057 => 'ÏŒ', + 8059 => 'Ï', + 8061 => 'ÏŽ', + 8064 => 'ἀι', + 8065 => 'á¼Î¹', + 8066 => 'ἂι', + 8067 => 'ἃι', + 8068 => 'ἄι', + 8069 => 'ἅι', + 8070 => 'ἆι', + 8071 => 'ἇι', + 8072 => 'ἀι', + 8073 => 'á¼Î¹', + 8074 => 'ἂι', + 8075 => 'ἃι', + 8076 => 'ἄι', + 8077 => 'ἅι', + 8078 => 'ἆι', + 8079 => 'ἇι', + 8080 => 'ἠι', + 8081 => 'ἡι', + 8082 => 'ἢι', + 8083 => 'ἣι', + 8084 => 'ἤι', + 8085 => 'ἥι', + 8086 => 'ἦι', + 8087 => 'ἧι', + 8088 => 'ἠι', + 8089 => 'ἡι', + 8090 => 'ἢι', + 8091 => 'ἣι', + 8092 => 'ἤι', + 8093 => 'ἥι', + 8094 => 'ἦι', + 8095 => 'ἧι', + 8096 => 'ὠι', + 8097 => 'ὡι', + 8098 => 'ὢι', + 8099 => 'ὣι', + 8100 => 'ὤι', + 8101 => 'ὥι', + 8102 => 'ὦι', + 8103 => 'ὧι', + 8104 => 'ὠι', + 8105 => 'ὡι', + 8106 => 'ὢι', + 8107 => 'ὣι', + 8108 => 'ὤι', + 8109 => 'ὥι', + 8110 => 'ὦι', + 8111 => 'ὧι', + 8114 => 'ὰι', + 8115 => 'αι', + 8116 => 'άι', + 8119 => 'ᾶι', + 8120 => 'á¾°', + 8121 => 'á¾±', + 8122 => 'á½°', + 8123 => 'ά', + 8124 => 'αι', + 8126 => 'ι', + 8130 => 'ὴι', + 8131 => 'ηι', + 8132 => 'ήι', + 8135 => 'ῆι', + 8136 => 'á½²', + 8137 => 'έ', + 8138 => 'á½´', + 8139 => 'ή', + 8140 => 'ηι', + 8147 => 'Î', + 8152 => 'á¿', + 8153 => 'á¿‘', + 8154 => 'ὶ', + 8155 => 'ί', + 8163 => 'ΰ', + 8168 => 'á¿ ', + 8169 => 'á¿¡', + 8170 => 'ὺ', + 8171 => 'Ï', + 8172 => 'á¿¥', + 8178 => 'ὼι', + 8179 => 'ωι', + 8180 => 'ώι', + 8183 => 'ῶι', + 8184 => 'ὸ', + 8185 => 'ÏŒ', + 8186 => 'á½¼', + 8187 => 'ÏŽ', + 8188 => 'ωι', + 8209 => 'â€', + 8243 => '′′', + 8244 => '′′′', + 8246 => '‵‵', + 8247 => '‵‵‵', + 8279 => '′′′′', + 8304 => '0', + 8305 => 'i', + 8308 => '4', + 8309 => '5', + 8310 => '6', + 8311 => '7', + 8312 => '8', + 8313 => '9', + 8315 => '−', + 8319 => 'n', + 8320 => '0', + 8321 => '1', + 8322 => '2', + 8323 => '3', + 8324 => '4', + 8325 => '5', + 8326 => '6', + 8327 => '7', + 8328 => '8', + 8329 => '9', + 8331 => '−', + 8336 => 'a', + 8337 => 'e', + 8338 => 'o', + 8339 => 'x', + 8340 => 'É™', + 8341 => 'h', + 8342 => 'k', + 8343 => 'l', + 8344 => 'm', + 8345 => 'n', + 8346 => 'p', + 8347 => 's', + 8348 => 't', + 8360 => 'rs', + 8450 => 'c', + 8451 => '°c', + 8455 => 'É›', + 8457 => '°f', + 8458 => 'g', + 8459 => 'h', + 8460 => 'h', + 8461 => 'h', + 8462 => 'h', + 8463 => 'ħ', + 8464 => 'i', + 8465 => 'i', + 8466 => 'l', + 8467 => 'l', + 8469 => 'n', + 8470 => 'no', + 8473 => 'p', + 8474 => 'q', + 8475 => 'r', + 8476 => 'r', + 8477 => 'r', + 8480 => 'sm', + 8481 => 'tel', + 8482 => 'tm', + 8484 => 'z', + 8486 => 'ω', + 8488 => 'z', + 8490 => 'k', + 8491 => 'Ã¥', + 8492 => 'b', + 8493 => 'c', + 8495 => 'e', + 8496 => 'e', + 8497 => 'f', + 8499 => 'm', + 8500 => 'o', + 8501 => '×', + 8502 => 'ב', + 8503 => '×’', + 8504 => 'ד', + 8505 => 'i', + 8507 => 'fax', + 8508 => 'Ï€', + 8509 => 'γ', + 8510 => 'γ', + 8511 => 'Ï€', + 8512 => '∑', + 8517 => 'd', + 8518 => 'd', + 8519 => 'e', + 8520 => 'i', + 8521 => 'j', + 8528 => '1â„7', + 8529 => '1â„9', + 8530 => '1â„10', + 8531 => '1â„3', + 8532 => '2â„3', + 8533 => '1â„5', + 8534 => '2â„5', + 8535 => '3â„5', + 8536 => '4â„5', + 8537 => '1â„6', + 8538 => '5â„6', + 8539 => '1â„8', + 8540 => '3â„8', + 8541 => '5â„8', + 8542 => '7â„8', + 8543 => '1â„', + 8544 => 'i', + 8545 => 'ii', + 8546 => 'iii', + 8547 => 'iv', + 8548 => 'v', + 8549 => 'vi', + 8550 => 'vii', + 8551 => 'viii', + 8552 => 'ix', + 8553 => 'x', + 8554 => 'xi', + 8555 => 'xii', + 8556 => 'l', + 8557 => 'c', + 8558 => 'd', + 8559 => 'm', + 8560 => 'i', + 8561 => 'ii', + 8562 => 'iii', + 8563 => 'iv', + 8564 => 'v', + 8565 => 'vi', + 8566 => 'vii', + 8567 => 'viii', + 8568 => 'ix', + 8569 => 'x', + 8570 => 'xi', + 8571 => 'xii', + 8572 => 'l', + 8573 => 'c', + 8574 => 'd', + 8575 => 'm', + 8585 => '0â„3', + 8748 => '∫∫', + 8749 => '∫∫∫', + 8751 => '∮∮', + 8752 => '∮∮∮', + 9001 => '〈', + 9002 => '〉', + 9312 => '1', + 9313 => '2', + 9314 => '3', + 9315 => '4', + 9316 => '5', + 9317 => '6', + 9318 => '7', + 9319 => '8', + 9320 => '9', + 9321 => '10', + 9322 => '11', + 9323 => '12', + 9324 => '13', + 9325 => '14', + 9326 => '15', + 9327 => '16', + 9328 => '17', + 9329 => '18', + 9330 => '19', + 9331 => '20', + 9398 => 'a', + 9399 => 'b', + 9400 => 'c', + 9401 => 'd', + 9402 => 'e', + 9403 => 'f', + 9404 => 'g', + 9405 => 'h', + 9406 => 'i', + 9407 => 'j', + 9408 => 'k', + 9409 => 'l', + 9410 => 'm', + 9411 => 'n', + 9412 => 'o', + 9413 => 'p', + 9414 => 'q', + 9415 => 'r', + 9416 => 's', + 9417 => 't', + 9418 => 'u', + 9419 => 'v', + 9420 => 'w', + 9421 => 'x', + 9422 => 'y', + 9423 => 'z', + 9424 => 'a', + 9425 => 'b', + 9426 => 'c', + 9427 => 'd', + 9428 => 'e', + 9429 => 'f', + 9430 => 'g', + 9431 => 'h', + 9432 => 'i', + 9433 => 'j', + 9434 => 'k', + 9435 => 'l', + 9436 => 'm', + 9437 => 'n', + 9438 => 'o', + 9439 => 'p', + 9440 => 'q', + 9441 => 'r', + 9442 => 's', + 9443 => 't', + 9444 => 'u', + 9445 => 'v', + 9446 => 'w', + 9447 => 'x', + 9448 => 'y', + 9449 => 'z', + 9450 => '0', + 10764 => '∫∫∫∫', + 10972 => 'â«Ì¸', + 11264 => 'â°°', + 11265 => 'â°±', + 11266 => 'â°²', + 11267 => 'â°³', + 11268 => 'â°´', + 11269 => 'â°µ', + 11270 => 'â°¶', + 11271 => 'â°·', + 11272 => 'â°¸', + 11273 => 'â°¹', + 11274 => 'â°º', + 11275 => 'â°»', + 11276 => 'â°¼', + 11277 => 'â°½', + 11278 => 'â°¾', + 11279 => 'â°¿', + 11280 => 'â±€', + 11281 => 'â±', + 11282 => 'ⱂ', + 11283 => 'ⱃ', + 11284 => 'ⱄ', + 11285 => 'â±…', + 11286 => 'ⱆ', + 11287 => 'ⱇ', + 11288 => 'ⱈ', + 11289 => 'ⱉ', + 11290 => 'ⱊ', + 11291 => 'ⱋ', + 11292 => 'ⱌ', + 11293 => 'â±', + 11294 => 'ⱎ', + 11295 => 'â±', + 11296 => 'â±', + 11297 => 'ⱑ', + 11298 => 'â±’', + 11299 => 'ⱓ', + 11300 => 'â±”', + 11301 => 'ⱕ', + 11302 => 'â±–', + 11303 => 'â±—', + 11304 => 'ⱘ', + 11305 => 'â±™', + 11306 => 'ⱚ', + 11307 => 'â±›', + 11308 => 'ⱜ', + 11309 => 'â±', + 11310 => 'ⱞ', + 11360 => 'ⱡ', + 11362 => 'É«', + 11363 => 'áµ½', + 11364 => 'ɽ', + 11367 => 'ⱨ', + 11369 => 'ⱪ', + 11371 => 'ⱬ', + 11373 => 'É‘', + 11374 => 'ɱ', + 11375 => 'É', + 11376 => 'É’', + 11378 => 'â±³', + 11381 => 'ⱶ', + 11388 => 'j', + 11389 => 'v', + 11390 => 'È¿', + 11391 => 'É€', + 11392 => 'â²', + 11394 => 'ⲃ', + 11396 => 'â²…', + 11398 => 'ⲇ', + 11400 => 'ⲉ', + 11402 => 'ⲋ', + 11404 => 'â²', + 11406 => 'â²', + 11408 => 'ⲑ', + 11410 => 'ⲓ', + 11412 => 'ⲕ', + 11414 => 'â²—', + 11416 => 'â²™', + 11418 => 'â²›', + 11420 => 'â²', + 11422 => 'ⲟ', + 11424 => 'ⲡ', + 11426 => 'â²£', + 11428 => 'â²¥', + 11430 => 'ⲧ', + 11432 => 'ⲩ', + 11434 => 'ⲫ', + 11436 => 'â²­', + 11438 => 'ⲯ', + 11440 => 'â²±', + 11442 => 'â²³', + 11444 => 'â²µ', + 11446 => 'â²·', + 11448 => 'â²¹', + 11450 => 'â²»', + 11452 => 'â²½', + 11454 => 'ⲿ', + 11456 => 'â³', + 11458 => 'ⳃ', + 11460 => 'â³…', + 11462 => 'ⳇ', + 11464 => 'ⳉ', + 11466 => 'ⳋ', + 11468 => 'â³', + 11470 => 'â³', + 11472 => 'ⳑ', + 11474 => 'ⳓ', + 11476 => 'ⳕ', + 11478 => 'â³—', + 11480 => 'â³™', + 11482 => 'â³›', + 11484 => 'â³', + 11486 => 'ⳟ', + 11488 => 'ⳡ', + 11490 => 'â³£', + 11499 => 'ⳬ', + 11501 => 'â³®', + 11506 => 'â³³', + 11631 => 'ⵡ', + 11935 => 'æ¯', + 12019 => '龟', + 12032 => '一', + 12033 => '丨', + 12034 => '丶', + 12035 => '丿', + 12036 => 'ä¹™', + 12037 => '亅', + 12038 => '二', + 12039 => '亠', + 12040 => '人', + 12041 => 'å„¿', + 12042 => 'å…¥', + 12043 => 'å…«', + 12044 => '冂', + 12045 => '冖', + 12046 => '冫', + 12047 => '几', + 12048 => '凵', + 12049 => '刀', + 12050 => '力', + 12051 => '勹', + 12052 => '匕', + 12053 => '匚', + 12054 => '匸', + 12055 => 'å', + 12056 => 'åœ', + 12057 => 'å©', + 12058 => '厂', + 12059 => '厶', + 12060 => 'åˆ', + 12061 => 'å£', + 12062 => 'å›—', + 12063 => '土', + 12064 => '士', + 12065 => '夂', + 12066 => '夊', + 12067 => '夕', + 12068 => '大', + 12069 => '女', + 12070 => 'å­', + 12071 => '宀', + 12072 => '寸', + 12073 => 'å°', + 12074 => 'å°¢', + 12075 => 'å°¸', + 12076 => 'å±®', + 12077 => 'å±±', + 12078 => 'å·›', + 12079 => 'å·¥', + 12080 => 'å·±', + 12081 => 'å·¾', + 12082 => 'å¹²', + 12083 => '幺', + 12084 => '广', + 12085 => 'å»´', + 12086 => '廾', + 12087 => '弋', + 12088 => '弓', + 12089 => 'å½', + 12090 => '彡', + 12091 => 'å½³', + 12092 => '心', + 12093 => '戈', + 12094 => '戶', + 12095 => '手', + 12096 => '支', + 12097 => 'æ”´', + 12098 => 'æ–‡', + 12099 => 'æ–—', + 12100 => 'æ–¤', + 12101 => 'æ–¹', + 12102 => 'æ— ', + 12103 => 'æ—¥', + 12104 => 'æ›°', + 12105 => '月', + 12106 => '木', + 12107 => '欠', + 12108 => 'æ­¢', + 12109 => 'æ­¹', + 12110 => '殳', + 12111 => '毋', + 12112 => '比', + 12113 => '毛', + 12114 => 'æ°', + 12115 => 'æ°”', + 12116 => 'æ°´', + 12117 => 'ç«', + 12118 => '爪', + 12119 => '父', + 12120 => '爻', + 12121 => '爿', + 12122 => '片', + 12123 => '牙', + 12124 => '牛', + 12125 => '犬', + 12126 => '玄', + 12127 => '玉', + 12128 => 'ç“œ', + 12129 => '瓦', + 12130 => '甘', + 12131 => '生', + 12132 => '用', + 12133 => 'ç”°', + 12134 => 'ç–‹', + 12135 => 'ç–’', + 12136 => '癶', + 12137 => '白', + 12138 => 'çš®', + 12139 => 'çš¿', + 12140 => 'ç›®', + 12141 => '矛', + 12142 => '矢', + 12143 => '石', + 12144 => '示', + 12145 => '禸', + 12146 => '禾', + 12147 => 'ç©´', + 12148 => 'ç«‹', + 12149 => '竹', + 12150 => 'ç±³', + 12151 => '糸', + 12152 => '缶', + 12153 => '网', + 12154 => '羊', + 12155 => 'ç¾½', + 12156 => 'è€', + 12157 => '而', + 12158 => '耒', + 12159 => '耳', + 12160 => 'è¿', + 12161 => '肉', + 12162 => '臣', + 12163 => '自', + 12164 => '至', + 12165 => '臼', + 12166 => '舌', + 12167 => '舛', + 12168 => '舟', + 12169 => '艮', + 12170 => '色', + 12171 => '艸', + 12172 => 'è™', + 12173 => '虫', + 12174 => 'è¡€', + 12175 => 'è¡Œ', + 12176 => 'è¡£', + 12177 => '襾', + 12178 => '見', + 12179 => '角', + 12180 => '言', + 12181 => 'è°·', + 12182 => '豆', + 12183 => '豕', + 12184 => '豸', + 12185 => 'è²', + 12186 => '赤', + 12187 => 'èµ°', + 12188 => '足', + 12189 => '身', + 12190 => '車', + 12191 => 'è¾›', + 12192 => 'è¾°', + 12193 => 'è¾µ', + 12194 => 'é‚‘', + 12195 => 'é…‰', + 12196 => '釆', + 12197 => '里', + 12198 => '金', + 12199 => 'é•·', + 12200 => 'é–€', + 12201 => '阜', + 12202 => '隶', + 12203 => 'éš¹', + 12204 => '雨', + 12205 => 'é‘', + 12206 => 'éž', + 12207 => 'é¢', + 12208 => 'é©', + 12209 => '韋', + 12210 => '韭', + 12211 => '音', + 12212 => 'é ', + 12213 => '風', + 12214 => '飛', + 12215 => '食', + 12216 => '首', + 12217 => '香', + 12218 => '馬', + 12219 => '骨', + 12220 => '高', + 12221 => 'é«Ÿ', + 12222 => '鬥', + 12223 => '鬯', + 12224 => '鬲', + 12225 => '鬼', + 12226 => 'é­š', + 12227 => 'é³¥', + 12228 => 'é¹µ', + 12229 => '鹿', + 12230 => '麥', + 12231 => '麻', + 12232 => '黃', + 12233 => 'é»', + 12234 => '黑', + 12235 => '黹', + 12236 => '黽', + 12237 => '鼎', + 12238 => '鼓', + 12239 => 'é¼ ', + 12240 => 'é¼»', + 12241 => '齊', + 12242 => 'é½’', + 12243 => 'é¾', + 12244 => '龜', + 12245 => 'é¾ ', + 12290 => '.', + 12342 => '〒', + 12344 => 'å', + 12345 => 'å„', + 12346 => 'å…', + 12447 => 'より', + 12543 => 'コト', + 12593 => 'á„€', + 12594 => 'á„', + 12595 => 'ᆪ', + 12596 => 'á„‚', + 12597 => 'ᆬ', + 12598 => 'ᆭ', + 12599 => 'ᄃ', + 12600 => 'á„„', + 12601 => 'á„…', + 12602 => 'ᆰ', + 12603 => 'ᆱ', + 12604 => 'ᆲ', + 12605 => 'ᆳ', + 12606 => 'ᆴ', + 12607 => 'ᆵ', + 12608 => 'á„š', + 12609 => 'ᄆ', + 12610 => 'ᄇ', + 12611 => 'ᄈ', + 12612 => 'á„¡', + 12613 => 'ᄉ', + 12614 => 'á„Š', + 12615 => 'á„‹', + 12616 => 'á„Œ', + 12617 => 'á„', + 12618 => 'á„Ž', + 12619 => 'á„', + 12620 => 'á„', + 12621 => 'á„‘', + 12622 => 'á„’', + 12623 => 'á…¡', + 12624 => 'á…¢', + 12625 => 'á…£', + 12626 => 'á…¤', + 12627 => 'á…¥', + 12628 => 'á…¦', + 12629 => 'á…§', + 12630 => 'á…¨', + 12631 => 'á…©', + 12632 => 'á…ª', + 12633 => 'á…«', + 12634 => 'á…¬', + 12635 => 'á…­', + 12636 => 'á…®', + 12637 => 'á…¯', + 12638 => 'á…°', + 12639 => 'á…±', + 12640 => 'á…²', + 12641 => 'á…³', + 12642 => 'á…´', + 12643 => 'á…µ', + 12645 => 'á„”', + 12646 => 'á„•', + 12647 => 'ᇇ', + 12648 => 'ᇈ', + 12649 => 'ᇌ', + 12650 => 'ᇎ', + 12651 => 'ᇓ', + 12652 => 'ᇗ', + 12653 => 'ᇙ', + 12654 => 'á„œ', + 12655 => 'á‡', + 12656 => 'ᇟ', + 12657 => 'á„', + 12658 => 'á„ž', + 12659 => 'á„ ', + 12660 => 'á„¢', + 12661 => 'á„£', + 12662 => 'ᄧ', + 12663 => 'á„©', + 12664 => 'á„«', + 12665 => 'ᄬ', + 12666 => 'á„­', + 12667 => 'á„®', + 12668 => 'ᄯ', + 12669 => 'ᄲ', + 12670 => 'ᄶ', + 12671 => 'á…€', + 12672 => 'á…‡', + 12673 => 'á…Œ', + 12674 => 'ᇱ', + 12675 => 'ᇲ', + 12676 => 'á…—', + 12677 => 'á…˜', + 12678 => 'á…™', + 12679 => 'ᆄ', + 12680 => 'ᆅ', + 12681 => 'ᆈ', + 12682 => 'ᆑ', + 12683 => 'ᆒ', + 12684 => 'ᆔ', + 12685 => 'ᆞ', + 12686 => 'ᆡ', + 12690 => '一', + 12691 => '二', + 12692 => '三', + 12693 => 'å››', + 12694 => '上', + 12695 => '中', + 12696 => '下', + 12697 => '甲', + 12698 => 'ä¹™', + 12699 => '丙', + 12700 => 'ä¸', + 12701 => '天', + 12702 => '地', + 12703 => '人', + 12868 => 'å•', + 12869 => 'å¹¼', + 12870 => 'æ–‡', + 12871 => 'ç®', + 12880 => 'pte', + 12881 => '21', + 12882 => '22', + 12883 => '23', + 12884 => '24', + 12885 => '25', + 12886 => '26', + 12887 => '27', + 12888 => '28', + 12889 => '29', + 12890 => '30', + 12891 => '31', + 12892 => '32', + 12893 => '33', + 12894 => '34', + 12895 => '35', + 12896 => 'á„€', + 12897 => 'á„‚', + 12898 => 'ᄃ', + 12899 => 'á„…', + 12900 => 'ᄆ', + 12901 => 'ᄇ', + 12902 => 'ᄉ', + 12903 => 'á„‹', + 12904 => 'á„Œ', + 12905 => 'á„Ž', + 12906 => 'á„', + 12907 => 'á„', + 12908 => 'á„‘', + 12909 => 'á„’', + 12910 => 'ê°€', + 12911 => '나', + 12912 => '다', + 12913 => 'ë¼', + 12914 => '마', + 12915 => 'ë°”', + 12916 => '사', + 12917 => 'ì•„', + 12918 => 'ìž', + 12919 => 'ì°¨', + 12920 => 'ì¹´', + 12921 => '타', + 12922 => '파', + 12923 => '하', + 12924 => '참고', + 12925 => '주ì˜', + 12926 => 'ìš°', + 12928 => '一', + 12929 => '二', + 12930 => '三', + 12931 => 'å››', + 12932 => '五', + 12933 => 'å…­', + 12934 => '七', + 12935 => 'å…«', + 12936 => 'ä¹', + 12937 => 'å', + 12938 => '月', + 12939 => 'ç«', + 12940 => 'æ°´', + 12941 => '木', + 12942 => '金', + 12943 => '土', + 12944 => 'æ—¥', + 12945 => 'æ ª', + 12946 => '有', + 12947 => '社', + 12948 => 'å', + 12949 => '特', + 12950 => '財', + 12951 => 'ç¥', + 12952 => '労', + 12953 => '秘', + 12954 => 'ç”·', + 12955 => '女', + 12956 => 'é©', + 12957 => '優', + 12958 => 'å°', + 12959 => '注', + 12960 => 'é …', + 12961 => '休', + 12962 => '写', + 12963 => 'æ­£', + 12964 => '上', + 12965 => '中', + 12966 => '下', + 12967 => 'å·¦', + 12968 => 'å³', + 12969 => '医', + 12970 => 'å®—', + 12971 => 'å­¦', + 12972 => '監', + 12973 => 'ä¼', + 12974 => '資', + 12975 => 'å”', + 12976 => '夜', + 12977 => '36', + 12978 => '37', + 12979 => '38', + 12980 => '39', + 12981 => '40', + 12982 => '41', + 12983 => '42', + 12984 => '43', + 12985 => '44', + 12986 => '45', + 12987 => '46', + 12988 => '47', + 12989 => '48', + 12990 => '49', + 12991 => '50', + 12992 => '1月', + 12993 => '2月', + 12994 => '3月', + 12995 => '4月', + 12996 => '5月', + 12997 => '6月', + 12998 => '7月', + 12999 => '8月', + 13000 => '9月', + 13001 => '10月', + 13002 => '11月', + 13003 => '12月', + 13004 => 'hg', + 13005 => 'erg', + 13006 => 'ev', + 13007 => 'ltd', + 13008 => 'ã‚¢', + 13009 => 'イ', + 13010 => 'ウ', + 13011 => 'エ', + 13012 => 'オ', + 13013 => 'ã‚«', + 13014 => 'ã‚­', + 13015 => 'ク', + 13016 => 'ケ', + 13017 => 'コ', + 13018 => 'サ', + 13019 => 'ã‚·', + 13020 => 'ス', + 13021 => 'ã‚»', + 13022 => 'ソ', + 13023 => 'ã‚¿', + 13024 => 'ãƒ', + 13025 => 'ツ', + 13026 => 'テ', + 13027 => 'ト', + 13028 => 'ナ', + 13029 => 'ニ', + 13030 => 'ヌ', + 13031 => 'ãƒ', + 13032 => 'ノ', + 13033 => 'ãƒ', + 13034 => 'ヒ', + 13035 => 'フ', + 13036 => 'ヘ', + 13037 => 'ホ', + 13038 => 'マ', + 13039 => 'ミ', + 13040 => 'ム', + 13041 => 'メ', + 13042 => 'モ', + 13043 => 'ヤ', + 13044 => 'ユ', + 13045 => 'ヨ', + 13046 => 'ラ', + 13047 => 'リ', + 13048 => 'ル', + 13049 => 'レ', + 13050 => 'ロ', + 13051 => 'ワ', + 13052 => 'ヰ', + 13053 => 'ヱ', + 13054 => 'ヲ', + 13055 => '令和', + 13056 => 'アパート', + 13057 => 'アルファ', + 13058 => 'アンペア', + 13059 => 'アール', + 13060 => 'イニング', + 13061 => 'インãƒ', + 13062 => 'ウォン', + 13063 => 'エスクード', + 13064 => 'エーカー', + 13065 => 'オンス', + 13066 => 'オーム', + 13067 => 'カイリ', + 13068 => 'カラット', + 13069 => 'カロリー', + 13070 => 'ガロン', + 13071 => 'ガンマ', + 13072 => 'ギガ', + 13073 => 'ギニー', + 13074 => 'キュリー', + 13075 => 'ギルダー', + 13076 => 'キロ', + 13077 => 'キログラム', + 13078 => 'キロメートル', + 13079 => 'キロワット', + 13080 => 'グラム', + 13081 => 'グラムトン', + 13082 => 'クルゼイロ', + 13083 => 'クローãƒ', + 13084 => 'ケース', + 13085 => 'コルナ', + 13086 => 'コーãƒ', + 13087 => 'サイクル', + 13088 => 'サンãƒãƒ¼ãƒ ', + 13089 => 'シリング', + 13090 => 'センãƒ', + 13091 => 'セント', + 13092 => 'ダース', + 13093 => 'デシ', + 13094 => 'ドル', + 13095 => 'トン', + 13096 => 'ナノ', + 13097 => 'ノット', + 13098 => 'ãƒã‚¤ãƒ„', + 13099 => 'パーセント', + 13100 => 'パーツ', + 13101 => 'ãƒãƒ¼ãƒ¬ãƒ«', + 13102 => 'ピアストル', + 13103 => 'ピクル', + 13104 => 'ピコ', + 13105 => 'ビル', + 13106 => 'ファラッド', + 13107 => 'フィート', + 13108 => 'ブッシェル', + 13109 => 'フラン', + 13110 => 'ヘクタール', + 13111 => 'ペソ', + 13112 => 'ペニヒ', + 13113 => 'ヘルツ', + 13114 => 'ペンス', + 13115 => 'ページ', + 13116 => 'ベータ', + 13117 => 'ãƒã‚¤ãƒ³ãƒˆ', + 13118 => 'ボルト', + 13119 => 'ホン', + 13120 => 'ãƒãƒ³ãƒ‰', + 13121 => 'ホール', + 13122 => 'ホーン', + 13123 => 'マイクロ', + 13124 => 'マイル', + 13125 => 'マッãƒ', + 13126 => 'マルク', + 13127 => 'マンション', + 13128 => 'ミクロン', + 13129 => 'ミリ', + 13130 => 'ミリãƒãƒ¼ãƒ«', + 13131 => 'メガ', + 13132 => 'メガトン', + 13133 => 'メートル', + 13134 => 'ヤード', + 13135 => 'ヤール', + 13136 => 'ユアン', + 13137 => 'リットル', + 13138 => 'リラ', + 13139 => 'ルピー', + 13140 => 'ルーブル', + 13141 => 'レム', + 13142 => 'レントゲン', + 13143 => 'ワット', + 13144 => '0点', + 13145 => '1点', + 13146 => '2点', + 13147 => '3点', + 13148 => '4点', + 13149 => '5点', + 13150 => '6点', + 13151 => '7点', + 13152 => '8点', + 13153 => '9点', + 13154 => '10点', + 13155 => '11点', + 13156 => '12点', + 13157 => '13点', + 13158 => '14点', + 13159 => '15点', + 13160 => '16点', + 13161 => '17点', + 13162 => '18点', + 13163 => '19点', + 13164 => '20点', + 13165 => '21点', + 13166 => '22点', + 13167 => '23点', + 13168 => '24点', + 13169 => 'hpa', + 13170 => 'da', + 13171 => 'au', + 13172 => 'bar', + 13173 => 'ov', + 13174 => 'pc', + 13175 => 'dm', + 13176 => 'dm2', + 13177 => 'dm3', + 13178 => 'iu', + 13179 => 'å¹³æˆ', + 13180 => '昭和', + 13181 => '大正', + 13182 => '明治', + 13183 => 'æ ªå¼ä¼šç¤¾', + 13184 => 'pa', + 13185 => 'na', + 13186 => 'μa', + 13187 => 'ma', + 13188 => 'ka', + 13189 => 'kb', + 13190 => 'mb', + 13191 => 'gb', + 13192 => 'cal', + 13193 => 'kcal', + 13194 => 'pf', + 13195 => 'nf', + 13196 => 'μf', + 13197 => 'μg', + 13198 => 'mg', + 13199 => 'kg', + 13200 => 'hz', + 13201 => 'khz', + 13202 => 'mhz', + 13203 => 'ghz', + 13204 => 'thz', + 13205 => 'μl', + 13206 => 'ml', + 13207 => 'dl', + 13208 => 'kl', + 13209 => 'fm', + 13210 => 'nm', + 13211 => 'μm', + 13212 => 'mm', + 13213 => 'cm', + 13214 => 'km', + 13215 => 'mm2', + 13216 => 'cm2', + 13217 => 'm2', + 13218 => 'km2', + 13219 => 'mm3', + 13220 => 'cm3', + 13221 => 'm3', + 13222 => 'km3', + 13223 => 'm∕s', + 13224 => 'm∕s2', + 13225 => 'pa', + 13226 => 'kpa', + 13227 => 'mpa', + 13228 => 'gpa', + 13229 => 'rad', + 13230 => 'rad∕s', + 13231 => 'rad∕s2', + 13232 => 'ps', + 13233 => 'ns', + 13234 => 'μs', + 13235 => 'ms', + 13236 => 'pv', + 13237 => 'nv', + 13238 => 'μv', + 13239 => 'mv', + 13240 => 'kv', + 13241 => 'mv', + 13242 => 'pw', + 13243 => 'nw', + 13244 => 'μw', + 13245 => 'mw', + 13246 => 'kw', + 13247 => 'mw', + 13248 => 'kω', + 13249 => 'mω', + 13251 => 'bq', + 13252 => 'cc', + 13253 => 'cd', + 13254 => 'c∕kg', + 13256 => 'db', + 13257 => 'gy', + 13258 => 'ha', + 13259 => 'hp', + 13260 => 'in', + 13261 => 'kk', + 13262 => 'km', + 13263 => 'kt', + 13264 => 'lm', + 13265 => 'ln', + 13266 => 'log', + 13267 => 'lx', + 13268 => 'mb', + 13269 => 'mil', + 13270 => 'mol', + 13271 => 'ph', + 13273 => 'ppm', + 13274 => 'pr', + 13275 => 'sr', + 13276 => 'sv', + 13277 => 'wb', + 13278 => 'v∕m', + 13279 => 'a∕m', + 13280 => '1æ—¥', + 13281 => '2æ—¥', + 13282 => '3æ—¥', + 13283 => '4æ—¥', + 13284 => '5æ—¥', + 13285 => '6æ—¥', + 13286 => '7æ—¥', + 13287 => '8æ—¥', + 13288 => '9æ—¥', + 13289 => '10æ—¥', + 13290 => '11æ—¥', + 13291 => '12æ—¥', + 13292 => '13æ—¥', + 13293 => '14æ—¥', + 13294 => '15æ—¥', + 13295 => '16æ—¥', + 13296 => '17æ—¥', + 13297 => '18æ—¥', + 13298 => '19æ—¥', + 13299 => '20æ—¥', + 13300 => '21æ—¥', + 13301 => '22æ—¥', + 13302 => '23æ—¥', + 13303 => '24æ—¥', + 13304 => '25æ—¥', + 13305 => '26æ—¥', + 13306 => '27æ—¥', + 13307 => '28æ—¥', + 13308 => '29æ—¥', + 13309 => '30æ—¥', + 13310 => '31æ—¥', + 13311 => 'gal', + 42560 => 'ê™', + 42562 => 'ꙃ', + 42564 => 'ê™…', + 42566 => 'ꙇ', + 42568 => 'ꙉ', + 42570 => 'ꙋ', + 42572 => 'ê™', + 42574 => 'ê™', + 42576 => 'ꙑ', + 42578 => 'ꙓ', + 42580 => 'ꙕ', + 42582 => 'ê™—', + 42584 => 'ê™™', + 42586 => 'ê™›', + 42588 => 'ê™', + 42590 => 'ꙟ', + 42592 => 'ꙡ', + 42594 => 'ꙣ', + 42596 => 'ꙥ', + 42598 => 'ꙧ', + 42600 => 'ꙩ', + 42602 => 'ꙫ', + 42604 => 'ê™­', + 42624 => 'êš', + 42626 => 'ꚃ', + 42628 => 'êš…', + 42630 => 'ꚇ', + 42632 => 'ꚉ', + 42634 => 'êš‹', + 42636 => 'êš', + 42638 => 'êš', + 42640 => 'êš‘', + 42642 => 'êš“', + 42644 => 'êš•', + 42646 => 'êš—', + 42648 => 'êš™', + 42650 => 'êš›', + 42652 => 'ÑŠ', + 42653 => 'ÑŒ', + 42786 => 'ꜣ', + 42788 => 'ꜥ', + 42790 => 'ꜧ', + 42792 => 'ꜩ', + 42794 => 'ꜫ', + 42796 => 'ꜭ', + 42798 => 'ꜯ', + 42802 => 'ꜳ', + 42804 => 'ꜵ', + 42806 => 'ꜷ', + 42808 => 'ꜹ', + 42810 => 'ꜻ', + 42812 => 'ꜽ', + 42814 => 'ꜿ', + 42816 => 'ê', + 42818 => 'êƒ', + 42820 => 'ê…', + 42822 => 'ê‡', + 42824 => 'ê‰', + 42826 => 'ê‹', + 42828 => 'ê', + 42830 => 'ê', + 42832 => 'ê‘', + 42834 => 'ê“', + 42836 => 'ê•', + 42838 => 'ê—', + 42840 => 'ê™', + 42842 => 'ê›', + 42844 => 'ê', + 42846 => 'êŸ', + 42848 => 'ê¡', + 42850 => 'ê£', + 42852 => 'ê¥', + 42854 => 'ê§', + 42856 => 'ê©', + 42858 => 'ê«', + 42860 => 'ê­', + 42862 => 'ê¯', + 42864 => 'ê¯', + 42873 => 'êº', + 42875 => 'ê¼', + 42877 => 'áµ¹', + 42878 => 'ê¿', + 42880 => 'êž', + 42882 => 'ꞃ', + 42884 => 'êž…', + 42886 => 'ꞇ', + 42891 => 'ꞌ', + 42893 => 'É¥', + 42896 => 'êž‘', + 42898 => 'êž“', + 42902 => 'êž—', + 42904 => 'êž™', + 42906 => 'êž›', + 42908 => 'êž', + 42910 => 'ꞟ', + 42912 => 'êž¡', + 42914 => 'ꞣ', + 42916 => 'ꞥ', + 42918 => 'ꞧ', + 42920 => 'êž©', + 42922 => 'ɦ', + 42923 => 'Éœ', + 42924 => 'É¡', + 42925 => 'ɬ', + 42926 => 'ɪ', + 42928 => 'Êž', + 42929 => 'ʇ', + 42930 => 'Ê', + 42931 => 'ê­“', + 42932 => 'êžµ', + 42934 => 'êž·', + 42936 => 'êž¹', + 42938 => 'êž»', + 42940 => 'êž½', + 42942 => 'êž¿', + 42946 => 'ꟃ', + 42948 => 'êž”', + 42949 => 'Ê‚', + 42950 => 'ᶎ', + 42951 => 'ꟈ', + 42953 => 'ꟊ', + 42997 => 'ꟶ', + 43000 => 'ħ', + 43001 => 'Å“', + 43868 => 'ꜧ', + 43869 => 'ꬷ', + 43870 => 'É«', + 43871 => 'ê­’', + 43881 => 'Ê', + 43888 => 'Ꭰ', + 43889 => 'Ꭱ', + 43890 => 'Ꭲ', + 43891 => 'Ꭳ', + 43892 => 'Ꭴ', + 43893 => 'Ꭵ', + 43894 => 'Ꭶ', + 43895 => 'Ꭷ', + 43896 => 'Ꭸ', + 43897 => 'Ꭹ', + 43898 => 'Ꭺ', + 43899 => 'Ꭻ', + 43900 => 'Ꭼ', + 43901 => 'Ꭽ', + 43902 => 'Ꭾ', + 43903 => 'Ꭿ', + 43904 => 'Ꮀ', + 43905 => 'Ꮁ', + 43906 => 'Ꮂ', + 43907 => 'Ꮃ', + 43908 => 'Ꮄ', + 43909 => 'Ꮅ', + 43910 => 'Ꮆ', + 43911 => 'Ꮇ', + 43912 => 'Ꮈ', + 43913 => 'Ꮉ', + 43914 => 'Ꮊ', + 43915 => 'Ꮋ', + 43916 => 'Ꮌ', + 43917 => 'Ꮍ', + 43918 => 'Ꮎ', + 43919 => 'Ꮏ', + 43920 => 'á€', + 43921 => 'á', + 43922 => 'á‚', + 43923 => 'áƒ', + 43924 => 'á„', + 43925 => 'á…', + 43926 => 'á†', + 43927 => 'á‡', + 43928 => 'áˆ', + 43929 => 'á‰', + 43930 => 'áŠ', + 43931 => 'á‹', + 43932 => 'áŒ', + 43933 => 'á', + 43934 => 'áŽ', + 43935 => 'á', + 43936 => 'á', + 43937 => 'á‘', + 43938 => 'á’', + 43939 => 'á“', + 43940 => 'á”', + 43941 => 'á•', + 43942 => 'á–', + 43943 => 'á—', + 43944 => 'á˜', + 43945 => 'á™', + 43946 => 'áš', + 43947 => 'á›', + 43948 => 'áœ', + 43949 => 'á', + 43950 => 'áž', + 43951 => 'áŸ', + 43952 => 'á ', + 43953 => 'á¡', + 43954 => 'á¢', + 43955 => 'á£', + 43956 => 'á¤', + 43957 => 'á¥', + 43958 => 'á¦', + 43959 => 'á§', + 43960 => 'á¨', + 43961 => 'á©', + 43962 => 'áª', + 43963 => 'á«', + 43964 => 'á¬', + 43965 => 'á­', + 43966 => 'á®', + 43967 => 'á¯', + 63744 => '豈', + 63745 => 'æ›´', + 63746 => '車', + 63747 => '賈', + 63748 => '滑', + 63749 => '串', + 63750 => 'å¥', + 63751 => '龜', + 63752 => '龜', + 63753 => '契', + 63754 => '金', + 63755 => 'å–‡', + 63756 => '奈', + 63757 => '懶', + 63758 => '癩', + 63759 => 'ç¾…', + 63760 => '蘿', + 63761 => '螺', + 63762 => '裸', + 63763 => 'é‚', + 63764 => '樂', + 63765 => 'æ´›', + 63766 => '烙', + 63767 => 'çž', + 63768 => 'è½', + 63769 => 'é…ª', + 63770 => '駱', + 63771 => '亂', + 63772 => 'åµ', + 63773 => '欄', + 63774 => '爛', + 63775 => '蘭', + 63776 => '鸞', + 63777 => 'åµ', + 63778 => 'æ¿«', + 63779 => 'è—', + 63780 => '襤', + 63781 => '拉', + 63782 => '臘', + 63783 => 'è Ÿ', + 63784 => '廊', + 63785 => '朗', + 63786 => '浪', + 63787 => '狼', + 63788 => '郎', + 63789 => '來', + 63790 => '冷', + 63791 => 'å‹ž', + 63792 => 'æ“„', + 63793 => 'æ«“', + 63794 => 'çˆ', + 63795 => '盧', + 63796 => 'è€', + 63797 => '蘆', + 63798 => '虜', + 63799 => 'è·¯', + 63800 => '露', + 63801 => 'é­¯', + 63802 => 'é·º', + 63803 => '碌', + 63804 => '祿', + 63805 => '綠', + 63806 => 'è‰', + 63807 => '錄', + 63808 => '鹿', + 63809 => 'è«–', + 63810 => '壟', + 63811 => '弄', + 63812 => 'ç± ', + 63813 => 'è¾', + 63814 => '牢', + 63815 => '磊', + 63816 => '賂', + 63817 => 'é›·', + 63818 => '壘', + 63819 => 'å±¢', + 63820 => '樓', + 63821 => 'æ·š', + 63822 => 'æ¼', + 63823 => 'ç´¯', + 63824 => '縷', + 63825 => '陋', + 63826 => 'å‹’', + 63827 => 'è‚‹', + 63828 => '凜', + 63829 => '凌', + 63830 => '稜', + 63831 => '綾', + 63832 => 'è±', + 63833 => '陵', + 63834 => '讀', + 63835 => 'æ‹', + 63836 => '樂', + 63837 => '諾', + 63838 => '丹', + 63839 => '寧', + 63840 => '怒', + 63841 => '率', + 63842 => 'ç•°', + 63843 => '北', + 63844 => '磻', + 63845 => '便', + 63846 => '復', + 63847 => 'ä¸', + 63848 => '泌', + 63849 => '數', + 63850 => 'ç´¢', + 63851 => 'åƒ', + 63852 => 'å¡ž', + 63853 => 'çœ', + 63854 => '葉', + 63855 => '說', + 63856 => '殺', + 63857 => 'è¾°', + 63858 => '沈', + 63859 => '拾', + 63860 => 'è‹¥', + 63861 => '掠', + 63862 => 'ç•¥', + 63863 => '亮', + 63864 => 'å…©', + 63865 => '凉', + 63866 => 'æ¢', + 63867 => '糧', + 63868 => '良', + 63869 => 'è«’', + 63870 => 'é‡', + 63871 => '勵', + 63872 => 'å‘‚', + 63873 => '女', + 63874 => '廬', + 63875 => 'æ—…', + 63876 => '濾', + 63877 => '礪', + 63878 => 'é–­', + 63879 => '驪', + 63880 => '麗', + 63881 => '黎', + 63882 => '力', + 63883 => '曆', + 63884 => 'æ­·', + 63885 => 'è½¢', + 63886 => 'å¹´', + 63887 => 'æ†', + 63888 => '戀', + 63889 => 'æ’š', + 63890 => 'æ¼£', + 63891 => 'ç…‰', + 63892 => 'ç’‰', + 63893 => '秊', + 63894 => 'ç·´', + 63895 => 'è¯', + 63896 => '輦', + 63897 => 'è“®', + 63898 => '連', + 63899 => 'éŠ', + 63900 => '列', + 63901 => '劣', + 63902 => 'å’½', + 63903 => '烈', + 63904 => '裂', + 63905 => '說', + 63906 => '廉', + 63907 => '念', + 63908 => 'æ»', + 63909 => 'æ®®', + 63910 => 'ç°¾', + 63911 => 'çµ', + 63912 => '令', + 63913 => '囹', + 63914 => '寧', + 63915 => '嶺', + 63916 => '怜', + 63917 => '玲', + 63918 => 'ç‘©', + 63919 => '羚', + 63920 => 'è†', + 63921 => '鈴', + 63922 => '零', + 63923 => 'éˆ', + 63924 => 'é ˜', + 63925 => '例', + 63926 => '禮', + 63927 => '醴', + 63928 => '隸', + 63929 => '惡', + 63930 => '了', + 63931 => '僚', + 63932 => '寮', + 63933 => 'å°¿', + 63934 => 'æ–™', + 63935 => '樂', + 63936 => '燎', + 63937 => '療', + 63938 => '蓼', + 63939 => 'é¼', + 63940 => 'é¾', + 63941 => '暈', + 63942 => '阮', + 63943 => '劉', + 63944 => 'æ»', + 63945 => '柳', + 63946 => 'æµ', + 63947 => '溜', + 63948 => 'ç‰', + 63949 => 'ç•™', + 63950 => 'ç¡«', + 63951 => 'ç´', + 63952 => 'é¡ž', + 63953 => 'å…­', + 63954 => '戮', + 63955 => '陸', + 63956 => '倫', + 63957 => 'å´™', + 63958 => 'æ·ª', + 63959 => '輪', + 63960 => '律', + 63961 => 'æ…„', + 63962 => 'æ —', + 63963 => '率', + 63964 => '隆', + 63965 => '利', + 63966 => 'å', + 63967 => 'å±¥', + 63968 => '易', + 63969 => 'æŽ', + 63970 => '梨', + 63971 => 'æ³¥', + 63972 => 'ç†', + 63973 => 'ç—¢', + 63974 => 'ç½¹', + 63975 => 'è£', + 63976 => '裡', + 63977 => '里', + 63978 => '離', + 63979 => '匿', + 63980 => '溺', + 63981 => 'å', + 63982 => 'ç‡', + 63983 => 'ç’˜', + 63984 => 'è—º', + 63985 => '隣', + 63986 => 'é±—', + 63987 => '麟', + 63988 => 'æž—', + 63989 => 'æ·‹', + 63990 => '臨', + 63991 => 'ç«‹', + 63992 => '笠', + 63993 => 'ç²’', + 63994 => 'ç‹€', + 63995 => 'ç‚™', + 63996 => 'è­˜', + 63997 => '什', + 63998 => '茶', + 63999 => '刺', + 64000 => '切', + 64001 => '度', + 64002 => 'æ‹“', + 64003 => 'ç³–', + 64004 => 'å®…', + 64005 => 'æ´ž', + 64006 => 'æš´', + 64007 => 'è¼»', + 64008 => 'è¡Œ', + 64009 => 'é™', + 64010 => '見', + 64011 => '廓', + 64012 => 'å…€', + 64013 => 'å—€', + 64016 => 'å¡š', + 64018 => 'æ™´', + 64021 => '凞', + 64022 => '猪', + 64023 => '益', + 64024 => '礼', + 64025 => '神', + 64026 => '祥', + 64027 => 'ç¦', + 64028 => 'é–', + 64029 => 'ç²¾', + 64030 => 'ç¾½', + 64032 => '蘒', + 64034 => '諸', + 64037 => '逸', + 64038 => '都', + 64042 => '飯', + 64043 => '飼', + 64044 => '館', + 64045 => '鶴', + 64046 => '郞', + 64047 => 'éš·', + 64048 => 'ä¾®', + 64049 => '僧', + 64050 => 'å…', + 64051 => '勉', + 64052 => '勤', + 64053 => 'å‘', + 64054 => 'å–', + 64055 => '嘆', + 64056 => '器', + 64057 => 'å¡€', + 64058 => '墨', + 64059 => '層', + 64060 => 'å±®', + 64061 => 'æ‚”', + 64062 => 'æ…¨', + 64063 => '憎', + 64064 => '懲', + 64065 => 'æ•', + 64066 => 'æ—¢', + 64067 => 'æš‘', + 64068 => '梅', + 64069 => 'æµ·', + 64070 => '渚', + 64071 => 'æ¼¢', + 64072 => 'ç…®', + 64073 => '爫', + 64074 => 'ç¢', + 64075 => '碑', + 64076 => '社', + 64077 => '祉', + 64078 => '祈', + 64079 => 'ç¥', + 64080 => '祖', + 64081 => 'ç¥', + 64082 => 'ç¦', + 64083 => '禎', + 64084 => 'ç©€', + 64085 => 'çª', + 64086 => '節', + 64087 => 'ç·´', + 64088 => '縉', + 64089 => 'ç¹', + 64090 => 'ç½²', + 64091 => '者', + 64092 => '臭', + 64093 => '艹', + 64094 => '艹', + 64095 => 'è‘—', + 64096 => 'è¤', + 64097 => '視', + 64098 => 'è¬', + 64099 => '謹', + 64100 => '賓', + 64101 => 'è´ˆ', + 64102 => '辶', + 64103 => '逸', + 64104 => '難', + 64105 => '響', + 64106 => 'é »', + 64107 => 'æµ', + 64108 => '𤋮', + 64109 => '舘', + 64112 => '並', + 64113 => '况', + 64114 => 'å…¨', + 64115 => 'ä¾€', + 64116 => 'å……', + 64117 => '冀', + 64118 => '勇', + 64119 => '勺', + 64120 => 'å–', + 64121 => 'å••', + 64122 => 'å–™', + 64123 => 'å—¢', + 64124 => 'å¡š', + 64125 => '墳', + 64126 => '奄', + 64127 => '奔', + 64128 => 'å©¢', + 64129 => '嬨', + 64130 => 'å»’', + 64131 => 'å»™', + 64132 => '彩', + 64133 => 'å¾­', + 64134 => '惘', + 64135 => 'æ…Ž', + 64136 => '愈', + 64137 => '憎', + 64138 => 'æ… ', + 64139 => '懲', + 64140 => '戴', + 64141 => 'æ„', + 64142 => 'æœ', + 64143 => 'æ‘’', + 64144 => 'æ•–', + 64145 => 'æ™´', + 64146 => '朗', + 64147 => '望', + 64148 => 'æ–', + 64149 => 'æ­¹', + 64150 => '殺', + 64151 => 'æµ', + 64152 => 'æ»›', + 64153 => '滋', + 64154 => 'æ¼¢', + 64155 => '瀞', + 64156 => 'ç…®', + 64157 => '瞧', + 64158 => '爵', + 64159 => '犯', + 64160 => '猪', + 64161 => '瑱', + 64162 => '甆', + 64163 => 'ç”»', + 64164 => 'ç˜', + 64165 => '瘟', + 64166 => '益', + 64167 => 'ç››', + 64168 => 'ç›´', + 64169 => 'çŠ', + 64170 => 'ç€', + 64171 => '磌', + 64172 => '窱', + 64173 => '節', + 64174 => 'ç±»', + 64175 => 'çµ›', + 64176 => 'ç·´', + 64177 => 'ç¼¾', + 64178 => '者', + 64179 => 'è’', + 64180 => 'è¯', + 64181 => 'è¹', + 64182 => 'è¥', + 64183 => '覆', + 64184 => '視', + 64185 => '調', + 64186 => '諸', + 64187 => 'è«‹', + 64188 => 'è¬', + 64189 => '諾', + 64190 => 'è«­', + 64191 => '謹', + 64192 => '變', + 64193 => 'è´ˆ', + 64194 => '輸', + 64195 => 'é²', + 64196 => '醙', + 64197 => '鉶', + 64198 => '陼', + 64199 => '難', + 64200 => 'é–', + 64201 => '韛', + 64202 => '響', + 64203 => 'é ‹', + 64204 => 'é »', + 64205 => '鬒', + 64206 => '龜', + 64207 => '𢡊', + 64208 => '𢡄', + 64209 => 'ð£•', + 64210 => 'ã®', + 64211 => '䀘', + 64212 => '䀹', + 64213 => '𥉉', + 64214 => 'ð¥³', + 64215 => '𧻓', + 64216 => '齃', + 64217 => '龎', + 64256 => 'ff', + 64257 => 'fi', + 64258 => 'fl', + 64259 => 'ffi', + 64260 => 'ffl', + 64261 => 'st', + 64262 => 'st', + 64275 => 'Õ´Õ¶', + 64276 => 'Õ´Õ¥', + 64277 => 'Õ´Õ«', + 64278 => 'Õ¾Õ¶', + 64279 => 'Õ´Õ­', + 64285 => '×™Ö´', + 64287 => 'ײַ', + 64288 => '×¢', + 64289 => '×', + 64290 => 'ד', + 64291 => '×”', + 64292 => '×›', + 64293 => 'ל', + 64294 => '×', + 64295 => 'ר', + 64296 => 'ת', + 64298 => 'ש×', + 64299 => 'שׂ', + 64300 => 'שּ×', + 64301 => 'שּׂ', + 64302 => '×Ö·', + 64303 => '×Ö¸', + 64304 => '×Ö¼', + 64305 => 'בּ', + 64306 => '×’Ö¼', + 64307 => 'דּ', + 64308 => '×”Ö¼', + 64309 => 'וּ', + 64310 => '×–Ö¼', + 64312 => 'טּ', + 64313 => '×™Ö¼', + 64314 => 'ךּ', + 64315 => '×›Ö¼', + 64316 => 'לּ', + 64318 => 'מּ', + 64320 => '× Ö¼', + 64321 => 'סּ', + 64323 => '×£Ö¼', + 64324 => 'פּ', + 64326 => 'צּ', + 64327 => 'קּ', + 64328 => 'רּ', + 64329 => 'שּ', + 64330 => 'תּ', + 64331 => 'וֹ', + 64332 => 'בֿ', + 64333 => '×›Ö¿', + 64334 => 'פֿ', + 64335 => '×ל', + 64336 => 'Ù±', + 64337 => 'Ù±', + 64338 => 'Ù»', + 64339 => 'Ù»', + 64340 => 'Ù»', + 64341 => 'Ù»', + 64342 => 'Ù¾', + 64343 => 'Ù¾', + 64344 => 'Ù¾', + 64345 => 'Ù¾', + 64346 => 'Ú€', + 64347 => 'Ú€', + 64348 => 'Ú€', + 64349 => 'Ú€', + 64350 => 'Ùº', + 64351 => 'Ùº', + 64352 => 'Ùº', + 64353 => 'Ùº', + 64354 => 'Ù¿', + 64355 => 'Ù¿', + 64356 => 'Ù¿', + 64357 => 'Ù¿', + 64358 => 'Ù¹', + 64359 => 'Ù¹', + 64360 => 'Ù¹', + 64361 => 'Ù¹', + 64362 => 'Ú¤', + 64363 => 'Ú¤', + 64364 => 'Ú¤', + 64365 => 'Ú¤', + 64366 => 'Ú¦', + 64367 => 'Ú¦', + 64368 => 'Ú¦', + 64369 => 'Ú¦', + 64370 => 'Ú„', + 64371 => 'Ú„', + 64372 => 'Ú„', + 64373 => 'Ú„', + 64374 => 'Úƒ', + 64375 => 'Úƒ', + 64376 => 'Úƒ', + 64377 => 'Úƒ', + 64378 => 'Ú†', + 64379 => 'Ú†', + 64380 => 'Ú†', + 64381 => 'Ú†', + 64382 => 'Ú‡', + 64383 => 'Ú‡', + 64384 => 'Ú‡', + 64385 => 'Ú‡', + 64386 => 'Ú', + 64387 => 'Ú', + 64388 => 'ÚŒ', + 64389 => 'ÚŒ', + 64390 => 'ÚŽ', + 64391 => 'ÚŽ', + 64392 => 'Úˆ', + 64393 => 'Úˆ', + 64394 => 'Ú˜', + 64395 => 'Ú˜', + 64396 => 'Ú‘', + 64397 => 'Ú‘', + 64398 => 'Ú©', + 64399 => 'Ú©', + 64400 => 'Ú©', + 64401 => 'Ú©', + 64402 => 'Ú¯', + 64403 => 'Ú¯', + 64404 => 'Ú¯', + 64405 => 'Ú¯', + 64406 => 'Ú³', + 64407 => 'Ú³', + 64408 => 'Ú³', + 64409 => 'Ú³', + 64410 => 'Ú±', + 64411 => 'Ú±', + 64412 => 'Ú±', + 64413 => 'Ú±', + 64414 => 'Úº', + 64415 => 'Úº', + 64416 => 'Ú»', + 64417 => 'Ú»', + 64418 => 'Ú»', + 64419 => 'Ú»', + 64420 => 'Û€', + 64421 => 'Û€', + 64422 => 'Û', + 64423 => 'Û', + 64424 => 'Û', + 64425 => 'Û', + 64426 => 'Ú¾', + 64427 => 'Ú¾', + 64428 => 'Ú¾', + 64429 => 'Ú¾', + 64430 => 'Û’', + 64431 => 'Û’', + 64432 => 'Û“', + 64433 => 'Û“', + 64467 => 'Ú­', + 64468 => 'Ú­', + 64469 => 'Ú­', + 64470 => 'Ú­', + 64471 => 'Û‡', + 64472 => 'Û‡', + 64473 => 'Û†', + 64474 => 'Û†', + 64475 => 'Ûˆ', + 64476 => 'Ûˆ', + 64477 => 'Û‡Ù´', + 64478 => 'Û‹', + 64479 => 'Û‹', + 64480 => 'Û…', + 64481 => 'Û…', + 64482 => 'Û‰', + 64483 => 'Û‰', + 64484 => 'Û', + 64485 => 'Û', + 64486 => 'Û', + 64487 => 'Û', + 64488 => 'Ù‰', + 64489 => 'Ù‰', + 64490 => 'ئا', + 64491 => 'ئا', + 64492 => 'ئە', + 64493 => 'ئە', + 64494 => 'ئو', + 64495 => 'ئو', + 64496 => 'ئۇ', + 64497 => 'ئۇ', + 64498 => 'ئۆ', + 64499 => 'ئۆ', + 64500 => 'ئۈ', + 64501 => 'ئۈ', + 64502 => 'ئÛ', + 64503 => 'ئÛ', + 64504 => 'ئÛ', + 64505 => 'ئى', + 64506 => 'ئى', + 64507 => 'ئى', + 64508 => 'ÛŒ', + 64509 => 'ÛŒ', + 64510 => 'ÛŒ', + 64511 => 'ÛŒ', + 64512 => 'ئج', + 64513 => 'ئح', + 64514 => 'ئم', + 64515 => 'ئى', + 64516 => 'ئي', + 64517 => 'بج', + 64518 => 'بح', + 64519 => 'بخ', + 64520 => 'بم', + 64521 => 'بى', + 64522 => 'بي', + 64523 => 'تج', + 64524 => 'تح', + 64525 => 'تخ', + 64526 => 'تم', + 64527 => 'تى', + 64528 => 'تي', + 64529 => 'ثج', + 64530 => 'ثم', + 64531 => 'ثى', + 64532 => 'ثي', + 64533 => 'جح', + 64534 => 'جم', + 64535 => 'حج', + 64536 => 'حم', + 64537 => 'خج', + 64538 => 'خح', + 64539 => 'خم', + 64540 => 'سج', + 64541 => 'سح', + 64542 => 'سخ', + 64543 => 'سم', + 64544 => 'صح', + 64545 => 'صم', + 64546 => 'ضج', + 64547 => 'ضح', + 64548 => 'ضخ', + 64549 => 'ضم', + 64550 => 'طح', + 64551 => 'طم', + 64552 => 'ظم', + 64553 => 'عج', + 64554 => 'عم', + 64555 => 'غج', + 64556 => 'غم', + 64557 => 'Ùج', + 64558 => 'ÙØ­', + 64559 => 'ÙØ®', + 64560 => 'ÙÙ…', + 64561 => 'ÙÙ‰', + 64562 => 'ÙÙŠ', + 64563 => 'قح', + 64564 => 'قم', + 64565 => 'قى', + 64566 => 'قي', + 64567 => 'كا', + 64568 => 'كج', + 64569 => 'كح', + 64570 => 'كخ', + 64571 => 'كل', + 64572 => 'كم', + 64573 => 'كى', + 64574 => 'كي', + 64575 => 'لج', + 64576 => 'لح', + 64577 => 'لخ', + 64578 => 'لم', + 64579 => 'لى', + 64580 => 'لي', + 64581 => 'مج', + 64582 => 'مح', + 64583 => 'مخ', + 64584 => 'مم', + 64585 => 'مى', + 64586 => 'مي', + 64587 => 'نج', + 64588 => 'نح', + 64589 => 'نخ', + 64590 => 'نم', + 64591 => 'نى', + 64592 => 'ني', + 64593 => 'هج', + 64594 => 'هم', + 64595 => 'هى', + 64596 => 'هي', + 64597 => 'يج', + 64598 => 'يح', + 64599 => 'يخ', + 64600 => 'يم', + 64601 => 'يى', + 64602 => 'يي', + 64603 => 'ذٰ', + 64604 => 'رٰ', + 64605 => 'ىٰ', + 64612 => 'ئر', + 64613 => 'ئز', + 64614 => 'ئم', + 64615 => 'ئن', + 64616 => 'ئى', + 64617 => 'ئي', + 64618 => 'بر', + 64619 => 'بز', + 64620 => 'بم', + 64621 => 'بن', + 64622 => 'بى', + 64623 => 'بي', + 64624 => 'تر', + 64625 => 'تز', + 64626 => 'تم', + 64627 => 'تن', + 64628 => 'تى', + 64629 => 'تي', + 64630 => 'ثر', + 64631 => 'ثز', + 64632 => 'ثم', + 64633 => 'ثن', + 64634 => 'ثى', + 64635 => 'ثي', + 64636 => 'ÙÙ‰', + 64637 => 'ÙÙŠ', + 64638 => 'قى', + 64639 => 'قي', + 64640 => 'كا', + 64641 => 'كل', + 64642 => 'كم', + 64643 => 'كى', + 64644 => 'كي', + 64645 => 'لم', + 64646 => 'لى', + 64647 => 'لي', + 64648 => 'ما', + 64649 => 'مم', + 64650 => 'نر', + 64651 => 'نز', + 64652 => 'نم', + 64653 => 'نن', + 64654 => 'نى', + 64655 => 'ني', + 64656 => 'ىٰ', + 64657 => 'ير', + 64658 => 'يز', + 64659 => 'يم', + 64660 => 'ين', + 64661 => 'يى', + 64662 => 'يي', + 64663 => 'ئج', + 64664 => 'ئح', + 64665 => 'ئخ', + 64666 => 'ئم', + 64667 => 'ئه', + 64668 => 'بج', + 64669 => 'بح', + 64670 => 'بخ', + 64671 => 'بم', + 64672 => 'به', + 64673 => 'تج', + 64674 => 'تح', + 64675 => 'تخ', + 64676 => 'تم', + 64677 => 'ته', + 64678 => 'ثم', + 64679 => 'جح', + 64680 => 'جم', + 64681 => 'حج', + 64682 => 'حم', + 64683 => 'خج', + 64684 => 'خم', + 64685 => 'سج', + 64686 => 'سح', + 64687 => 'سخ', + 64688 => 'سم', + 64689 => 'صح', + 64690 => 'صخ', + 64691 => 'صم', + 64692 => 'ضج', + 64693 => 'ضح', + 64694 => 'ضخ', + 64695 => 'ضم', + 64696 => 'طح', + 64697 => 'ظم', + 64698 => 'عج', + 64699 => 'عم', + 64700 => 'غج', + 64701 => 'غم', + 64702 => 'Ùج', + 64703 => 'ÙØ­', + 64704 => 'ÙØ®', + 64705 => 'ÙÙ…', + 64706 => 'قح', + 64707 => 'قم', + 64708 => 'كج', + 64709 => 'كح', + 64710 => 'كخ', + 64711 => 'كل', + 64712 => 'كم', + 64713 => 'لج', + 64714 => 'لح', + 64715 => 'لخ', + 64716 => 'لم', + 64717 => 'له', + 64718 => 'مج', + 64719 => 'مح', + 64720 => 'مخ', + 64721 => 'مم', + 64722 => 'نج', + 64723 => 'نح', + 64724 => 'نخ', + 64725 => 'نم', + 64726 => 'نه', + 64727 => 'هج', + 64728 => 'هم', + 64729 => 'هٰ', + 64730 => 'يج', + 64731 => 'يح', + 64732 => 'يخ', + 64733 => 'يم', + 64734 => 'يه', + 64735 => 'ئم', + 64736 => 'ئه', + 64737 => 'بم', + 64738 => 'به', + 64739 => 'تم', + 64740 => 'ته', + 64741 => 'ثم', + 64742 => 'ثه', + 64743 => 'سم', + 64744 => 'سه', + 64745 => 'شم', + 64746 => 'شه', + 64747 => 'كل', + 64748 => 'كم', + 64749 => 'لم', + 64750 => 'نم', + 64751 => 'نه', + 64752 => 'يم', + 64753 => 'يه', + 64754 => 'Ù€ÙŽÙ‘', + 64755 => 'Ù€ÙÙ‘', + 64756 => 'Ù€ÙÙ‘', + 64757 => 'طى', + 64758 => 'طي', + 64759 => 'عى', + 64760 => 'عي', + 64761 => 'غى', + 64762 => 'غي', + 64763 => 'سى', + 64764 => 'سي', + 64765 => 'شى', + 64766 => 'شي', + 64767 => 'حى', + 64768 => 'حي', + 64769 => 'جى', + 64770 => 'جي', + 64771 => 'خى', + 64772 => 'خي', + 64773 => 'صى', + 64774 => 'صي', + 64775 => 'ضى', + 64776 => 'ضي', + 64777 => 'شج', + 64778 => 'شح', + 64779 => 'شخ', + 64780 => 'شم', + 64781 => 'شر', + 64782 => 'سر', + 64783 => 'صر', + 64784 => 'ضر', + 64785 => 'طى', + 64786 => 'طي', + 64787 => 'عى', + 64788 => 'عي', + 64789 => 'غى', + 64790 => 'غي', + 64791 => 'سى', + 64792 => 'سي', + 64793 => 'شى', + 64794 => 'شي', + 64795 => 'حى', + 64796 => 'حي', + 64797 => 'جى', + 64798 => 'جي', + 64799 => 'خى', + 64800 => 'خي', + 64801 => 'صى', + 64802 => 'صي', + 64803 => 'ضى', + 64804 => 'ضي', + 64805 => 'شج', + 64806 => 'شح', + 64807 => 'شخ', + 64808 => 'شم', + 64809 => 'شر', + 64810 => 'سر', + 64811 => 'صر', + 64812 => 'ضر', + 64813 => 'شج', + 64814 => 'شح', + 64815 => 'شخ', + 64816 => 'شم', + 64817 => 'سه', + 64818 => 'شه', + 64819 => 'طم', + 64820 => 'سج', + 64821 => 'سح', + 64822 => 'سخ', + 64823 => 'شج', + 64824 => 'شح', + 64825 => 'شخ', + 64826 => 'طم', + 64827 => 'ظم', + 64828 => 'اً', + 64829 => 'اً', + 64848 => 'تجم', + 64849 => 'تحج', + 64850 => 'تحج', + 64851 => 'تحم', + 64852 => 'تخم', + 64853 => 'تمج', + 64854 => 'تمح', + 64855 => 'تمخ', + 64856 => 'جمح', + 64857 => 'جمح', + 64858 => 'حمي', + 64859 => 'حمى', + 64860 => 'سحج', + 64861 => 'سجح', + 64862 => 'سجى', + 64863 => 'سمح', + 64864 => 'سمح', + 64865 => 'سمج', + 64866 => 'سمم', + 64867 => 'سمم', + 64868 => 'صحح', + 64869 => 'صحح', + 64870 => 'صمم', + 64871 => 'شحم', + 64872 => 'شحم', + 64873 => 'شجي', + 64874 => 'شمخ', + 64875 => 'شمخ', + 64876 => 'شمم', + 64877 => 'شمم', + 64878 => 'ضحى', + 64879 => 'ضخم', + 64880 => 'ضخم', + 64881 => 'طمح', + 64882 => 'طمح', + 64883 => 'طمم', + 64884 => 'طمي', + 64885 => 'عجم', + 64886 => 'عمم', + 64887 => 'عمم', + 64888 => 'عمى', + 64889 => 'غمم', + 64890 => 'غمي', + 64891 => 'غمى', + 64892 => 'Ùخم', + 64893 => 'Ùخم', + 64894 => 'قمح', + 64895 => 'قمم', + 64896 => 'لحم', + 64897 => 'لحي', + 64898 => 'لحى', + 64899 => 'لجج', + 64900 => 'لجج', + 64901 => 'لخم', + 64902 => 'لخم', + 64903 => 'لمح', + 64904 => 'لمح', + 64905 => 'محج', + 64906 => 'محم', + 64907 => 'محي', + 64908 => 'مجح', + 64909 => 'مجم', + 64910 => 'مخج', + 64911 => 'مخم', + 64914 => 'مجخ', + 64915 => 'همج', + 64916 => 'همم', + 64917 => 'نحم', + 64918 => 'نحى', + 64919 => 'نجم', + 64920 => 'نجم', + 64921 => 'نجى', + 64922 => 'نمي', + 64923 => 'نمى', + 64924 => 'يمم', + 64925 => 'يمم', + 64926 => 'بخي', + 64927 => 'تجي', + 64928 => 'تجى', + 64929 => 'تخي', + 64930 => 'تخى', + 64931 => 'تمي', + 64932 => 'تمى', + 64933 => 'جمي', + 64934 => 'جحى', + 64935 => 'جمى', + 64936 => 'سخى', + 64937 => 'صحي', + 64938 => 'شحي', + 64939 => 'ضحي', + 64940 => 'لجي', + 64941 => 'لمي', + 64942 => 'يحي', + 64943 => 'يجي', + 64944 => 'يمي', + 64945 => 'ممي', + 64946 => 'قمي', + 64947 => 'نحي', + 64948 => 'قمح', + 64949 => 'لحم', + 64950 => 'عمي', + 64951 => 'كمي', + 64952 => 'نجح', + 64953 => 'مخي', + 64954 => 'لجم', + 64955 => 'كمم', + 64956 => 'لجم', + 64957 => 'نجح', + 64958 => 'جحي', + 64959 => 'حجي', + 64960 => 'مجي', + 64961 => 'Ùمي', + 64962 => 'بحي', + 64963 => 'كمم', + 64964 => 'عجم', + 64965 => 'صمم', + 64966 => 'سخي', + 64967 => 'نجي', + 65008 => 'صلے', + 65009 => 'قلے', + 65010 => 'الله', + 65011 => 'اكبر', + 65012 => 'محمد', + 65013 => 'صلعم', + 65014 => 'رسول', + 65015 => 'عليه', + 65016 => 'وسلم', + 65017 => 'صلى', + 65020 => 'ریال', + 65041 => 'ã€', + 65047 => '〖', + 65048 => '〗', + 65073 => '—', + 65074 => '–', + 65081 => '〔', + 65082 => '〕', + 65083 => 'ã€', + 65084 => '】', + 65085 => '《', + 65086 => '》', + 65087 => '〈', + 65088 => '〉', + 65089 => '「', + 65090 => 'ã€', + 65091 => '『', + 65092 => 'ã€', + 65105 => 'ã€', + 65112 => '—', + 65117 => '〔', + 65118 => '〕', + 65123 => '-', + 65137 => 'ـً', + 65143 => 'Ù€ÙŽ', + 65145 => 'Ù€Ù', + 65147 => 'Ù€Ù', + 65149 => 'ـّ', + 65151 => 'ـْ', + 65152 => 'Ø¡', + 65153 => 'Ø¢', + 65154 => 'Ø¢', + 65155 => 'Ø£', + 65156 => 'Ø£', + 65157 => 'ؤ', + 65158 => 'ؤ', + 65159 => 'Ø¥', + 65160 => 'Ø¥', + 65161 => 'ئ', + 65162 => 'ئ', + 65163 => 'ئ', + 65164 => 'ئ', + 65165 => 'ا', + 65166 => 'ا', + 65167 => 'ب', + 65168 => 'ب', + 65169 => 'ب', + 65170 => 'ب', + 65171 => 'Ø©', + 65172 => 'Ø©', + 65173 => 'ت', + 65174 => 'ت', + 65175 => 'ت', + 65176 => 'ت', + 65177 => 'Ø«', + 65178 => 'Ø«', + 65179 => 'Ø«', + 65180 => 'Ø«', + 65181 => 'ج', + 65182 => 'ج', + 65183 => 'ج', + 65184 => 'ج', + 65185 => 'Ø­', + 65186 => 'Ø­', + 65187 => 'Ø­', + 65188 => 'Ø­', + 65189 => 'Ø®', + 65190 => 'Ø®', + 65191 => 'Ø®', + 65192 => 'Ø®', + 65193 => 'د', + 65194 => 'د', + 65195 => 'Ø°', + 65196 => 'Ø°', + 65197 => 'ر', + 65198 => 'ر', + 65199 => 'ز', + 65200 => 'ز', + 65201 => 'س', + 65202 => 'س', + 65203 => 'س', + 65204 => 'س', + 65205 => 'Ø´', + 65206 => 'Ø´', + 65207 => 'Ø´', + 65208 => 'Ø´', + 65209 => 'ص', + 65210 => 'ص', + 65211 => 'ص', + 65212 => 'ص', + 65213 => 'ض', + 65214 => 'ض', + 65215 => 'ض', + 65216 => 'ض', + 65217 => 'Ø·', + 65218 => 'Ø·', + 65219 => 'Ø·', + 65220 => 'Ø·', + 65221 => 'ظ', + 65222 => 'ظ', + 65223 => 'ظ', + 65224 => 'ظ', + 65225 => 'ع', + 65226 => 'ع', + 65227 => 'ع', + 65228 => 'ع', + 65229 => 'غ', + 65230 => 'غ', + 65231 => 'غ', + 65232 => 'غ', + 65233 => 'Ù', + 65234 => 'Ù', + 65235 => 'Ù', + 65236 => 'Ù', + 65237 => 'Ù‚', + 65238 => 'Ù‚', + 65239 => 'Ù‚', + 65240 => 'Ù‚', + 65241 => 'Ùƒ', + 65242 => 'Ùƒ', + 65243 => 'Ùƒ', + 65244 => 'Ùƒ', + 65245 => 'Ù„', + 65246 => 'Ù„', + 65247 => 'Ù„', + 65248 => 'Ù„', + 65249 => 'Ù…', + 65250 => 'Ù…', + 65251 => 'Ù…', + 65252 => 'Ù…', + 65253 => 'Ù†', + 65254 => 'Ù†', + 65255 => 'Ù†', + 65256 => 'Ù†', + 65257 => 'Ù‡', + 65258 => 'Ù‡', + 65259 => 'Ù‡', + 65260 => 'Ù‡', + 65261 => 'Ùˆ', + 65262 => 'Ùˆ', + 65263 => 'Ù‰', + 65264 => 'Ù‰', + 65265 => 'ÙŠ', + 65266 => 'ÙŠ', + 65267 => 'ÙŠ', + 65268 => 'ÙŠ', + 65269 => 'لآ', + 65270 => 'لآ', + 65271 => 'لأ', + 65272 => 'لأ', + 65273 => 'لإ', + 65274 => 'لإ', + 65275 => 'لا', + 65276 => 'لا', + 65293 => '-', + 65294 => '.', + 65296 => '0', + 65297 => '1', + 65298 => '2', + 65299 => '3', + 65300 => '4', + 65301 => '5', + 65302 => '6', + 65303 => '7', + 65304 => '8', + 65305 => '9', + 65313 => 'a', + 65314 => 'b', + 65315 => 'c', + 65316 => 'd', + 65317 => 'e', + 65318 => 'f', + 65319 => 'g', + 65320 => 'h', + 65321 => 'i', + 65322 => 'j', + 65323 => 'k', + 65324 => 'l', + 65325 => 'm', + 65326 => 'n', + 65327 => 'o', + 65328 => 'p', + 65329 => 'q', + 65330 => 'r', + 65331 => 's', + 65332 => 't', + 65333 => 'u', + 65334 => 'v', + 65335 => 'w', + 65336 => 'x', + 65337 => 'y', + 65338 => 'z', + 65345 => 'a', + 65346 => 'b', + 65347 => 'c', + 65348 => 'd', + 65349 => 'e', + 65350 => 'f', + 65351 => 'g', + 65352 => 'h', + 65353 => 'i', + 65354 => 'j', + 65355 => 'k', + 65356 => 'l', + 65357 => 'm', + 65358 => 'n', + 65359 => 'o', + 65360 => 'p', + 65361 => 'q', + 65362 => 'r', + 65363 => 's', + 65364 => 't', + 65365 => 'u', + 65366 => 'v', + 65367 => 'w', + 65368 => 'x', + 65369 => 'y', + 65370 => 'z', + 65375 => '⦅', + 65376 => '⦆', + 65377 => '.', + 65378 => '「', + 65379 => 'ã€', + 65380 => 'ã€', + 65381 => '・', + 65382 => 'ヲ', + 65383 => 'ã‚¡', + 65384 => 'ã‚£', + 65385 => 'ã‚¥', + 65386 => 'ェ', + 65387 => 'ã‚©', + 65388 => 'ャ', + 65389 => 'ュ', + 65390 => 'ョ', + 65391 => 'ッ', + 65392 => 'ー', + 65393 => 'ã‚¢', + 65394 => 'イ', + 65395 => 'ウ', + 65396 => 'エ', + 65397 => 'オ', + 65398 => 'ã‚«', + 65399 => 'ã‚­', + 65400 => 'ク', + 65401 => 'ケ', + 65402 => 'コ', + 65403 => 'サ', + 65404 => 'ã‚·', + 65405 => 'ス', + 65406 => 'ã‚»', + 65407 => 'ソ', + 65408 => 'ã‚¿', + 65409 => 'ãƒ', + 65410 => 'ツ', + 65411 => 'テ', + 65412 => 'ト', + 65413 => 'ナ', + 65414 => 'ニ', + 65415 => 'ヌ', + 65416 => 'ãƒ', + 65417 => 'ノ', + 65418 => 'ãƒ', + 65419 => 'ヒ', + 65420 => 'フ', + 65421 => 'ヘ', + 65422 => 'ホ', + 65423 => 'マ', + 65424 => 'ミ', + 65425 => 'ム', + 65426 => 'メ', + 65427 => 'モ', + 65428 => 'ヤ', + 65429 => 'ユ', + 65430 => 'ヨ', + 65431 => 'ラ', + 65432 => 'リ', + 65433 => 'ル', + 65434 => 'レ', + 65435 => 'ロ', + 65436 => 'ワ', + 65437 => 'ン', + 65438 => 'ã‚™', + 65439 => 'ã‚š', + 65441 => 'á„€', + 65442 => 'á„', + 65443 => 'ᆪ', + 65444 => 'á„‚', + 65445 => 'ᆬ', + 65446 => 'ᆭ', + 65447 => 'ᄃ', + 65448 => 'á„„', + 65449 => 'á„…', + 65450 => 'ᆰ', + 65451 => 'ᆱ', + 65452 => 'ᆲ', + 65453 => 'ᆳ', + 65454 => 'ᆴ', + 65455 => 'ᆵ', + 65456 => 'á„š', + 65457 => 'ᄆ', + 65458 => 'ᄇ', + 65459 => 'ᄈ', + 65460 => 'á„¡', + 65461 => 'ᄉ', + 65462 => 'á„Š', + 65463 => 'á„‹', + 65464 => 'á„Œ', + 65465 => 'á„', + 65466 => 'á„Ž', + 65467 => 'á„', + 65468 => 'á„', + 65469 => 'á„‘', + 65470 => 'á„’', + 65474 => 'á…¡', + 65475 => 'á…¢', + 65476 => 'á…£', + 65477 => 'á…¤', + 65478 => 'á…¥', + 65479 => 'á…¦', + 65482 => 'á…§', + 65483 => 'á…¨', + 65484 => 'á…©', + 65485 => 'á…ª', + 65486 => 'á…«', + 65487 => 'á…¬', + 65490 => 'á…­', + 65491 => 'á…®', + 65492 => 'á…¯', + 65493 => 'á…°', + 65494 => 'á…±', + 65495 => 'á…²', + 65498 => 'á…³', + 65499 => 'á…´', + 65500 => 'á…µ', + 65504 => '¢', + 65505 => '£', + 65506 => '¬', + 65508 => '¦', + 65509 => 'Â¥', + 65510 => 'â‚©', + 65512 => '│', + 65513 => 'â†', + 65514 => '↑', + 65515 => '→', + 65516 => '↓', + 65517 => 'â– ', + 65518 => 'â—‹', + 66560 => 'ð¨', + 66561 => 'ð©', + 66562 => 'ðª', + 66563 => 'ð«', + 66564 => 'ð¬', + 66565 => 'ð­', + 66566 => 'ð®', + 66567 => 'ð¯', + 66568 => 'ð°', + 66569 => 'ð±', + 66570 => 'ð²', + 66571 => 'ð³', + 66572 => 'ð´', + 66573 => 'ðµ', + 66574 => 'ð¶', + 66575 => 'ð·', + 66576 => 'ð¸', + 66577 => 'ð¹', + 66578 => 'ðº', + 66579 => 'ð»', + 66580 => 'ð¼', + 66581 => 'ð½', + 66582 => 'ð¾', + 66583 => 'ð¿', + 66584 => 'ð‘€', + 66585 => 'ð‘', + 66586 => 'ð‘‚', + 66587 => 'ð‘ƒ', + 66588 => 'ð‘„', + 66589 => 'ð‘…', + 66590 => 'ð‘†', + 66591 => 'ð‘‡', + 66592 => 'ð‘ˆ', + 66593 => 'ð‘‰', + 66594 => 'ð‘Š', + 66595 => 'ð‘‹', + 66596 => 'ð‘Œ', + 66597 => 'ð‘', + 66598 => 'ð‘Ž', + 66599 => 'ð‘', + 66736 => 'ð“˜', + 66737 => 'ð“™', + 66738 => 'ð“š', + 66739 => 'ð“›', + 66740 => 'ð“œ', + 66741 => 'ð“', + 66742 => 'ð“ž', + 66743 => 'ð“Ÿ', + 66744 => 'ð“ ', + 66745 => 'ð“¡', + 66746 => 'ð“¢', + 66747 => 'ð“£', + 66748 => 'ð“¤', + 66749 => 'ð“¥', + 66750 => 'ð“¦', + 66751 => 'ð“§', + 66752 => 'ð“¨', + 66753 => 'ð“©', + 66754 => 'ð“ª', + 66755 => 'ð“«', + 66756 => 'ð“¬', + 66757 => 'ð“­', + 66758 => 'ð“®', + 66759 => 'ð“¯', + 66760 => 'ð“°', + 66761 => 'ð“±', + 66762 => 'ð“²', + 66763 => 'ð“³', + 66764 => 'ð“´', + 66765 => 'ð“µ', + 66766 => 'ð“¶', + 66767 => 'ð“·', + 66768 => 'ð“¸', + 66769 => 'ð“¹', + 66770 => 'ð“º', + 66771 => 'ð“»', + 68736 => 'ð³€', + 68737 => 'ð³', + 68738 => 'ð³‚', + 68739 => 'ð³ƒ', + 68740 => 'ð³„', + 68741 => 'ð³…', + 68742 => 'ð³†', + 68743 => 'ð³‡', + 68744 => 'ð³ˆ', + 68745 => 'ð³‰', + 68746 => 'ð³Š', + 68747 => 'ð³‹', + 68748 => 'ð³Œ', + 68749 => 'ð³', + 68750 => 'ð³Ž', + 68751 => 'ð³', + 68752 => 'ð³', + 68753 => 'ð³‘', + 68754 => 'ð³’', + 68755 => 'ð³“', + 68756 => 'ð³”', + 68757 => 'ð³•', + 68758 => 'ð³–', + 68759 => 'ð³—', + 68760 => 'ð³˜', + 68761 => 'ð³™', + 68762 => 'ð³š', + 68763 => 'ð³›', + 68764 => 'ð³œ', + 68765 => 'ð³', + 68766 => 'ð³ž', + 68767 => 'ð³Ÿ', + 68768 => 'ð³ ', + 68769 => 'ð³¡', + 68770 => 'ð³¢', + 68771 => 'ð³£', + 68772 => 'ð³¤', + 68773 => 'ð³¥', + 68774 => 'ð³¦', + 68775 => 'ð³§', + 68776 => 'ð³¨', + 68777 => 'ð³©', + 68778 => 'ð³ª', + 68779 => 'ð³«', + 68780 => 'ð³¬', + 68781 => 'ð³­', + 68782 => 'ð³®', + 68783 => 'ð³¯', + 68784 => 'ð³°', + 68785 => 'ð³±', + 68786 => 'ð³²', + 71840 => 'ð‘£€', + 71841 => 'ð‘£', + 71842 => '𑣂', + 71843 => '𑣃', + 71844 => '𑣄', + 71845 => 'ð‘£…', + 71846 => '𑣆', + 71847 => '𑣇', + 71848 => '𑣈', + 71849 => '𑣉', + 71850 => '𑣊', + 71851 => '𑣋', + 71852 => '𑣌', + 71853 => 'ð‘£', + 71854 => '𑣎', + 71855 => 'ð‘£', + 71856 => 'ð‘£', + 71857 => '𑣑', + 71858 => 'ð‘£’', + 71859 => '𑣓', + 71860 => 'ð‘£”', + 71861 => '𑣕', + 71862 => 'ð‘£–', + 71863 => 'ð‘£—', + 71864 => '𑣘', + 71865 => 'ð‘£™', + 71866 => '𑣚', + 71867 => 'ð‘£›', + 71868 => '𑣜', + 71869 => 'ð‘£', + 71870 => '𑣞', + 71871 => '𑣟', + 93760 => 'ð–¹ ', + 93761 => '𖹡', + 93762 => 'ð–¹¢', + 93763 => 'ð–¹£', + 93764 => '𖹤', + 93765 => 'ð–¹¥', + 93766 => '𖹦', + 93767 => '𖹧', + 93768 => '𖹨', + 93769 => '𖹩', + 93770 => '𖹪', + 93771 => '𖹫', + 93772 => '𖹬', + 93773 => 'ð–¹­', + 93774 => 'ð–¹®', + 93775 => '𖹯', + 93776 => 'ð–¹°', + 93777 => 'ð–¹±', + 93778 => 'ð–¹²', + 93779 => 'ð–¹³', + 93780 => 'ð–¹´', + 93781 => 'ð–¹µ', + 93782 => '𖹶', + 93783 => 'ð–¹·', + 93784 => '𖹸', + 93785 => 'ð–¹¹', + 93786 => '𖹺', + 93787 => 'ð–¹»', + 93788 => 'ð–¹¼', + 93789 => 'ð–¹½', + 93790 => 'ð–¹¾', + 93791 => '𖹿', + 119134 => 'ð…—ð…¥', + 119135 => 'ð…˜ð…¥', + 119136 => 'ð…˜ð…¥ð…®', + 119137 => 'ð…˜ð…¥ð…¯', + 119138 => 'ð…˜ð…¥ð…°', + 119139 => 'ð…˜ð…¥ð…±', + 119140 => 'ð…˜ð…¥ð…²', + 119227 => 'ð†¹ð…¥', + 119228 => 'ð†ºð…¥', + 119229 => 'ð†¹ð…¥ð…®', + 119230 => 'ð†ºð…¥ð…®', + 119231 => 'ð†¹ð…¥ð…¯', + 119232 => 'ð†ºð…¥ð…¯', + 119808 => 'a', + 119809 => 'b', + 119810 => 'c', + 119811 => 'd', + 119812 => 'e', + 119813 => 'f', + 119814 => 'g', + 119815 => 'h', + 119816 => 'i', + 119817 => 'j', + 119818 => 'k', + 119819 => 'l', + 119820 => 'm', + 119821 => 'n', + 119822 => 'o', + 119823 => 'p', + 119824 => 'q', + 119825 => 'r', + 119826 => 's', + 119827 => 't', + 119828 => 'u', + 119829 => 'v', + 119830 => 'w', + 119831 => 'x', + 119832 => 'y', + 119833 => 'z', + 119834 => 'a', + 119835 => 'b', + 119836 => 'c', + 119837 => 'd', + 119838 => 'e', + 119839 => 'f', + 119840 => 'g', + 119841 => 'h', + 119842 => 'i', + 119843 => 'j', + 119844 => 'k', + 119845 => 'l', + 119846 => 'm', + 119847 => 'n', + 119848 => 'o', + 119849 => 'p', + 119850 => 'q', + 119851 => 'r', + 119852 => 's', + 119853 => 't', + 119854 => 'u', + 119855 => 'v', + 119856 => 'w', + 119857 => 'x', + 119858 => 'y', + 119859 => 'z', + 119860 => 'a', + 119861 => 'b', + 119862 => 'c', + 119863 => 'd', + 119864 => 'e', + 119865 => 'f', + 119866 => 'g', + 119867 => 'h', + 119868 => 'i', + 119869 => 'j', + 119870 => 'k', + 119871 => 'l', + 119872 => 'm', + 119873 => 'n', + 119874 => 'o', + 119875 => 'p', + 119876 => 'q', + 119877 => 'r', + 119878 => 's', + 119879 => 't', + 119880 => 'u', + 119881 => 'v', + 119882 => 'w', + 119883 => 'x', + 119884 => 'y', + 119885 => 'z', + 119886 => 'a', + 119887 => 'b', + 119888 => 'c', + 119889 => 'd', + 119890 => 'e', + 119891 => 'f', + 119892 => 'g', + 119894 => 'i', + 119895 => 'j', + 119896 => 'k', + 119897 => 'l', + 119898 => 'm', + 119899 => 'n', + 119900 => 'o', + 119901 => 'p', + 119902 => 'q', + 119903 => 'r', + 119904 => 's', + 119905 => 't', + 119906 => 'u', + 119907 => 'v', + 119908 => 'w', + 119909 => 'x', + 119910 => 'y', + 119911 => 'z', + 119912 => 'a', + 119913 => 'b', + 119914 => 'c', + 119915 => 'd', + 119916 => 'e', + 119917 => 'f', + 119918 => 'g', + 119919 => 'h', + 119920 => 'i', + 119921 => 'j', + 119922 => 'k', + 119923 => 'l', + 119924 => 'm', + 119925 => 'n', + 119926 => 'o', + 119927 => 'p', + 119928 => 'q', + 119929 => 'r', + 119930 => 's', + 119931 => 't', + 119932 => 'u', + 119933 => 'v', + 119934 => 'w', + 119935 => 'x', + 119936 => 'y', + 119937 => 'z', + 119938 => 'a', + 119939 => 'b', + 119940 => 'c', + 119941 => 'd', + 119942 => 'e', + 119943 => 'f', + 119944 => 'g', + 119945 => 'h', + 119946 => 'i', + 119947 => 'j', + 119948 => 'k', + 119949 => 'l', + 119950 => 'm', + 119951 => 'n', + 119952 => 'o', + 119953 => 'p', + 119954 => 'q', + 119955 => 'r', + 119956 => 's', + 119957 => 't', + 119958 => 'u', + 119959 => 'v', + 119960 => 'w', + 119961 => 'x', + 119962 => 'y', + 119963 => 'z', + 119964 => 'a', + 119966 => 'c', + 119967 => 'd', + 119970 => 'g', + 119973 => 'j', + 119974 => 'k', + 119977 => 'n', + 119978 => 'o', + 119979 => 'p', + 119980 => 'q', + 119982 => 's', + 119983 => 't', + 119984 => 'u', + 119985 => 'v', + 119986 => 'w', + 119987 => 'x', + 119988 => 'y', + 119989 => 'z', + 119990 => 'a', + 119991 => 'b', + 119992 => 'c', + 119993 => 'd', + 119995 => 'f', + 119997 => 'h', + 119998 => 'i', + 119999 => 'j', + 120000 => 'k', + 120001 => 'l', + 120002 => 'm', + 120003 => 'n', + 120005 => 'p', + 120006 => 'q', + 120007 => 'r', + 120008 => 's', + 120009 => 't', + 120010 => 'u', + 120011 => 'v', + 120012 => 'w', + 120013 => 'x', + 120014 => 'y', + 120015 => 'z', + 120016 => 'a', + 120017 => 'b', + 120018 => 'c', + 120019 => 'd', + 120020 => 'e', + 120021 => 'f', + 120022 => 'g', + 120023 => 'h', + 120024 => 'i', + 120025 => 'j', + 120026 => 'k', + 120027 => 'l', + 120028 => 'm', + 120029 => 'n', + 120030 => 'o', + 120031 => 'p', + 120032 => 'q', + 120033 => 'r', + 120034 => 's', + 120035 => 't', + 120036 => 'u', + 120037 => 'v', + 120038 => 'w', + 120039 => 'x', + 120040 => 'y', + 120041 => 'z', + 120042 => 'a', + 120043 => 'b', + 120044 => 'c', + 120045 => 'd', + 120046 => 'e', + 120047 => 'f', + 120048 => 'g', + 120049 => 'h', + 120050 => 'i', + 120051 => 'j', + 120052 => 'k', + 120053 => 'l', + 120054 => 'm', + 120055 => 'n', + 120056 => 'o', + 120057 => 'p', + 120058 => 'q', + 120059 => 'r', + 120060 => 's', + 120061 => 't', + 120062 => 'u', + 120063 => 'v', + 120064 => 'w', + 120065 => 'x', + 120066 => 'y', + 120067 => 'z', + 120068 => 'a', + 120069 => 'b', + 120071 => 'd', + 120072 => 'e', + 120073 => 'f', + 120074 => 'g', + 120077 => 'j', + 120078 => 'k', + 120079 => 'l', + 120080 => 'm', + 120081 => 'n', + 120082 => 'o', + 120083 => 'p', + 120084 => 'q', + 120086 => 's', + 120087 => 't', + 120088 => 'u', + 120089 => 'v', + 120090 => 'w', + 120091 => 'x', + 120092 => 'y', + 120094 => 'a', + 120095 => 'b', + 120096 => 'c', + 120097 => 'd', + 120098 => 'e', + 120099 => 'f', + 120100 => 'g', + 120101 => 'h', + 120102 => 'i', + 120103 => 'j', + 120104 => 'k', + 120105 => 'l', + 120106 => 'm', + 120107 => 'n', + 120108 => 'o', + 120109 => 'p', + 120110 => 'q', + 120111 => 'r', + 120112 => 's', + 120113 => 't', + 120114 => 'u', + 120115 => 'v', + 120116 => 'w', + 120117 => 'x', + 120118 => 'y', + 120119 => 'z', + 120120 => 'a', + 120121 => 'b', + 120123 => 'd', + 120124 => 'e', + 120125 => 'f', + 120126 => 'g', + 120128 => 'i', + 120129 => 'j', + 120130 => 'k', + 120131 => 'l', + 120132 => 'm', + 120134 => 'o', + 120138 => 's', + 120139 => 't', + 120140 => 'u', + 120141 => 'v', + 120142 => 'w', + 120143 => 'x', + 120144 => 'y', + 120146 => 'a', + 120147 => 'b', + 120148 => 'c', + 120149 => 'd', + 120150 => 'e', + 120151 => 'f', + 120152 => 'g', + 120153 => 'h', + 120154 => 'i', + 120155 => 'j', + 120156 => 'k', + 120157 => 'l', + 120158 => 'm', + 120159 => 'n', + 120160 => 'o', + 120161 => 'p', + 120162 => 'q', + 120163 => 'r', + 120164 => 's', + 120165 => 't', + 120166 => 'u', + 120167 => 'v', + 120168 => 'w', + 120169 => 'x', + 120170 => 'y', + 120171 => 'z', + 120172 => 'a', + 120173 => 'b', + 120174 => 'c', + 120175 => 'd', + 120176 => 'e', + 120177 => 'f', + 120178 => 'g', + 120179 => 'h', + 120180 => 'i', + 120181 => 'j', + 120182 => 'k', + 120183 => 'l', + 120184 => 'm', + 120185 => 'n', + 120186 => 'o', + 120187 => 'p', + 120188 => 'q', + 120189 => 'r', + 120190 => 's', + 120191 => 't', + 120192 => 'u', + 120193 => 'v', + 120194 => 'w', + 120195 => 'x', + 120196 => 'y', + 120197 => 'z', + 120198 => 'a', + 120199 => 'b', + 120200 => 'c', + 120201 => 'd', + 120202 => 'e', + 120203 => 'f', + 120204 => 'g', + 120205 => 'h', + 120206 => 'i', + 120207 => 'j', + 120208 => 'k', + 120209 => 'l', + 120210 => 'm', + 120211 => 'n', + 120212 => 'o', + 120213 => 'p', + 120214 => 'q', + 120215 => 'r', + 120216 => 's', + 120217 => 't', + 120218 => 'u', + 120219 => 'v', + 120220 => 'w', + 120221 => 'x', + 120222 => 'y', + 120223 => 'z', + 120224 => 'a', + 120225 => 'b', + 120226 => 'c', + 120227 => 'd', + 120228 => 'e', + 120229 => 'f', + 120230 => 'g', + 120231 => 'h', + 120232 => 'i', + 120233 => 'j', + 120234 => 'k', + 120235 => 'l', + 120236 => 'm', + 120237 => 'n', + 120238 => 'o', + 120239 => 'p', + 120240 => 'q', + 120241 => 'r', + 120242 => 's', + 120243 => 't', + 120244 => 'u', + 120245 => 'v', + 120246 => 'w', + 120247 => 'x', + 120248 => 'y', + 120249 => 'z', + 120250 => 'a', + 120251 => 'b', + 120252 => 'c', + 120253 => 'd', + 120254 => 'e', + 120255 => 'f', + 120256 => 'g', + 120257 => 'h', + 120258 => 'i', + 120259 => 'j', + 120260 => 'k', + 120261 => 'l', + 120262 => 'm', + 120263 => 'n', + 120264 => 'o', + 120265 => 'p', + 120266 => 'q', + 120267 => 'r', + 120268 => 's', + 120269 => 't', + 120270 => 'u', + 120271 => 'v', + 120272 => 'w', + 120273 => 'x', + 120274 => 'y', + 120275 => 'z', + 120276 => 'a', + 120277 => 'b', + 120278 => 'c', + 120279 => 'd', + 120280 => 'e', + 120281 => 'f', + 120282 => 'g', + 120283 => 'h', + 120284 => 'i', + 120285 => 'j', + 120286 => 'k', + 120287 => 'l', + 120288 => 'm', + 120289 => 'n', + 120290 => 'o', + 120291 => 'p', + 120292 => 'q', + 120293 => 'r', + 120294 => 's', + 120295 => 't', + 120296 => 'u', + 120297 => 'v', + 120298 => 'w', + 120299 => 'x', + 120300 => 'y', + 120301 => 'z', + 120302 => 'a', + 120303 => 'b', + 120304 => 'c', + 120305 => 'd', + 120306 => 'e', + 120307 => 'f', + 120308 => 'g', + 120309 => 'h', + 120310 => 'i', + 120311 => 'j', + 120312 => 'k', + 120313 => 'l', + 120314 => 'm', + 120315 => 'n', + 120316 => 'o', + 120317 => 'p', + 120318 => 'q', + 120319 => 'r', + 120320 => 's', + 120321 => 't', + 120322 => 'u', + 120323 => 'v', + 120324 => 'w', + 120325 => 'x', + 120326 => 'y', + 120327 => 'z', + 120328 => 'a', + 120329 => 'b', + 120330 => 'c', + 120331 => 'd', + 120332 => 'e', + 120333 => 'f', + 120334 => 'g', + 120335 => 'h', + 120336 => 'i', + 120337 => 'j', + 120338 => 'k', + 120339 => 'l', + 120340 => 'm', + 120341 => 'n', + 120342 => 'o', + 120343 => 'p', + 120344 => 'q', + 120345 => 'r', + 120346 => 's', + 120347 => 't', + 120348 => 'u', + 120349 => 'v', + 120350 => 'w', + 120351 => 'x', + 120352 => 'y', + 120353 => 'z', + 120354 => 'a', + 120355 => 'b', + 120356 => 'c', + 120357 => 'd', + 120358 => 'e', + 120359 => 'f', + 120360 => 'g', + 120361 => 'h', + 120362 => 'i', + 120363 => 'j', + 120364 => 'k', + 120365 => 'l', + 120366 => 'm', + 120367 => 'n', + 120368 => 'o', + 120369 => 'p', + 120370 => 'q', + 120371 => 'r', + 120372 => 's', + 120373 => 't', + 120374 => 'u', + 120375 => 'v', + 120376 => 'w', + 120377 => 'x', + 120378 => 'y', + 120379 => 'z', + 120380 => 'a', + 120381 => 'b', + 120382 => 'c', + 120383 => 'd', + 120384 => 'e', + 120385 => 'f', + 120386 => 'g', + 120387 => 'h', + 120388 => 'i', + 120389 => 'j', + 120390 => 'k', + 120391 => 'l', + 120392 => 'm', + 120393 => 'n', + 120394 => 'o', + 120395 => 'p', + 120396 => 'q', + 120397 => 'r', + 120398 => 's', + 120399 => 't', + 120400 => 'u', + 120401 => 'v', + 120402 => 'w', + 120403 => 'x', + 120404 => 'y', + 120405 => 'z', + 120406 => 'a', + 120407 => 'b', + 120408 => 'c', + 120409 => 'd', + 120410 => 'e', + 120411 => 'f', + 120412 => 'g', + 120413 => 'h', + 120414 => 'i', + 120415 => 'j', + 120416 => 'k', + 120417 => 'l', + 120418 => 'm', + 120419 => 'n', + 120420 => 'o', + 120421 => 'p', + 120422 => 'q', + 120423 => 'r', + 120424 => 's', + 120425 => 't', + 120426 => 'u', + 120427 => 'v', + 120428 => 'w', + 120429 => 'x', + 120430 => 'y', + 120431 => 'z', + 120432 => 'a', + 120433 => 'b', + 120434 => 'c', + 120435 => 'd', + 120436 => 'e', + 120437 => 'f', + 120438 => 'g', + 120439 => 'h', + 120440 => 'i', + 120441 => 'j', + 120442 => 'k', + 120443 => 'l', + 120444 => 'm', + 120445 => 'n', + 120446 => 'o', + 120447 => 'p', + 120448 => 'q', + 120449 => 'r', + 120450 => 's', + 120451 => 't', + 120452 => 'u', + 120453 => 'v', + 120454 => 'w', + 120455 => 'x', + 120456 => 'y', + 120457 => 'z', + 120458 => 'a', + 120459 => 'b', + 120460 => 'c', + 120461 => 'd', + 120462 => 'e', + 120463 => 'f', + 120464 => 'g', + 120465 => 'h', + 120466 => 'i', + 120467 => 'j', + 120468 => 'k', + 120469 => 'l', + 120470 => 'm', + 120471 => 'n', + 120472 => 'o', + 120473 => 'p', + 120474 => 'q', + 120475 => 'r', + 120476 => 's', + 120477 => 't', + 120478 => 'u', + 120479 => 'v', + 120480 => 'w', + 120481 => 'x', + 120482 => 'y', + 120483 => 'z', + 120484 => 'ı', + 120485 => 'È·', + 120488 => 'α', + 120489 => 'β', + 120490 => 'γ', + 120491 => 'δ', + 120492 => 'ε', + 120493 => 'ζ', + 120494 => 'η', + 120495 => 'θ', + 120496 => 'ι', + 120497 => 'κ', + 120498 => 'λ', + 120499 => 'μ', + 120500 => 'ν', + 120501 => 'ξ', + 120502 => 'ο', + 120503 => 'Ï€', + 120504 => 'Ï', + 120505 => 'θ', + 120506 => 'σ', + 120507 => 'Ï„', + 120508 => 'Ï…', + 120509 => 'φ', + 120510 => 'χ', + 120511 => 'ψ', + 120512 => 'ω', + 120513 => '∇', + 120514 => 'α', + 120515 => 'β', + 120516 => 'γ', + 120517 => 'δ', + 120518 => 'ε', + 120519 => 'ζ', + 120520 => 'η', + 120521 => 'θ', + 120522 => 'ι', + 120523 => 'κ', + 120524 => 'λ', + 120525 => 'μ', + 120526 => 'ν', + 120527 => 'ξ', + 120528 => 'ο', + 120529 => 'Ï€', + 120530 => 'Ï', + 120531 => 'σ', + 120532 => 'σ', + 120533 => 'Ï„', + 120534 => 'Ï…', + 120535 => 'φ', + 120536 => 'χ', + 120537 => 'ψ', + 120538 => 'ω', + 120539 => '∂', + 120540 => 'ε', + 120541 => 'θ', + 120542 => 'κ', + 120543 => 'φ', + 120544 => 'Ï', + 120545 => 'Ï€', + 120546 => 'α', + 120547 => 'β', + 120548 => 'γ', + 120549 => 'δ', + 120550 => 'ε', + 120551 => 'ζ', + 120552 => 'η', + 120553 => 'θ', + 120554 => 'ι', + 120555 => 'κ', + 120556 => 'λ', + 120557 => 'μ', + 120558 => 'ν', + 120559 => 'ξ', + 120560 => 'ο', + 120561 => 'Ï€', + 120562 => 'Ï', + 120563 => 'θ', + 120564 => 'σ', + 120565 => 'Ï„', + 120566 => 'Ï…', + 120567 => 'φ', + 120568 => 'χ', + 120569 => 'ψ', + 120570 => 'ω', + 120571 => '∇', + 120572 => 'α', + 120573 => 'β', + 120574 => 'γ', + 120575 => 'δ', + 120576 => 'ε', + 120577 => 'ζ', + 120578 => 'η', + 120579 => 'θ', + 120580 => 'ι', + 120581 => 'κ', + 120582 => 'λ', + 120583 => 'μ', + 120584 => 'ν', + 120585 => 'ξ', + 120586 => 'ο', + 120587 => 'Ï€', + 120588 => 'Ï', + 120589 => 'σ', + 120590 => 'σ', + 120591 => 'Ï„', + 120592 => 'Ï…', + 120593 => 'φ', + 120594 => 'χ', + 120595 => 'ψ', + 120596 => 'ω', + 120597 => '∂', + 120598 => 'ε', + 120599 => 'θ', + 120600 => 'κ', + 120601 => 'φ', + 120602 => 'Ï', + 120603 => 'Ï€', + 120604 => 'α', + 120605 => 'β', + 120606 => 'γ', + 120607 => 'δ', + 120608 => 'ε', + 120609 => 'ζ', + 120610 => 'η', + 120611 => 'θ', + 120612 => 'ι', + 120613 => 'κ', + 120614 => 'λ', + 120615 => 'μ', + 120616 => 'ν', + 120617 => 'ξ', + 120618 => 'ο', + 120619 => 'Ï€', + 120620 => 'Ï', + 120621 => 'θ', + 120622 => 'σ', + 120623 => 'Ï„', + 120624 => 'Ï…', + 120625 => 'φ', + 120626 => 'χ', + 120627 => 'ψ', + 120628 => 'ω', + 120629 => '∇', + 120630 => 'α', + 120631 => 'β', + 120632 => 'γ', + 120633 => 'δ', + 120634 => 'ε', + 120635 => 'ζ', + 120636 => 'η', + 120637 => 'θ', + 120638 => 'ι', + 120639 => 'κ', + 120640 => 'λ', + 120641 => 'μ', + 120642 => 'ν', + 120643 => 'ξ', + 120644 => 'ο', + 120645 => 'Ï€', + 120646 => 'Ï', + 120647 => 'σ', + 120648 => 'σ', + 120649 => 'Ï„', + 120650 => 'Ï…', + 120651 => 'φ', + 120652 => 'χ', + 120653 => 'ψ', + 120654 => 'ω', + 120655 => '∂', + 120656 => 'ε', + 120657 => 'θ', + 120658 => 'κ', + 120659 => 'φ', + 120660 => 'Ï', + 120661 => 'Ï€', + 120662 => 'α', + 120663 => 'β', + 120664 => 'γ', + 120665 => 'δ', + 120666 => 'ε', + 120667 => 'ζ', + 120668 => 'η', + 120669 => 'θ', + 120670 => 'ι', + 120671 => 'κ', + 120672 => 'λ', + 120673 => 'μ', + 120674 => 'ν', + 120675 => 'ξ', + 120676 => 'ο', + 120677 => 'Ï€', + 120678 => 'Ï', + 120679 => 'θ', + 120680 => 'σ', + 120681 => 'Ï„', + 120682 => 'Ï…', + 120683 => 'φ', + 120684 => 'χ', + 120685 => 'ψ', + 120686 => 'ω', + 120687 => '∇', + 120688 => 'α', + 120689 => 'β', + 120690 => 'γ', + 120691 => 'δ', + 120692 => 'ε', + 120693 => 'ζ', + 120694 => 'η', + 120695 => 'θ', + 120696 => 'ι', + 120697 => 'κ', + 120698 => 'λ', + 120699 => 'μ', + 120700 => 'ν', + 120701 => 'ξ', + 120702 => 'ο', + 120703 => 'Ï€', + 120704 => 'Ï', + 120705 => 'σ', + 120706 => 'σ', + 120707 => 'Ï„', + 120708 => 'Ï…', + 120709 => 'φ', + 120710 => 'χ', + 120711 => 'ψ', + 120712 => 'ω', + 120713 => '∂', + 120714 => 'ε', + 120715 => 'θ', + 120716 => 'κ', + 120717 => 'φ', + 120718 => 'Ï', + 120719 => 'Ï€', + 120720 => 'α', + 120721 => 'β', + 120722 => 'γ', + 120723 => 'δ', + 120724 => 'ε', + 120725 => 'ζ', + 120726 => 'η', + 120727 => 'θ', + 120728 => 'ι', + 120729 => 'κ', + 120730 => 'λ', + 120731 => 'μ', + 120732 => 'ν', + 120733 => 'ξ', + 120734 => 'ο', + 120735 => 'Ï€', + 120736 => 'Ï', + 120737 => 'θ', + 120738 => 'σ', + 120739 => 'Ï„', + 120740 => 'Ï…', + 120741 => 'φ', + 120742 => 'χ', + 120743 => 'ψ', + 120744 => 'ω', + 120745 => '∇', + 120746 => 'α', + 120747 => 'β', + 120748 => 'γ', + 120749 => 'δ', + 120750 => 'ε', + 120751 => 'ζ', + 120752 => 'η', + 120753 => 'θ', + 120754 => 'ι', + 120755 => 'κ', + 120756 => 'λ', + 120757 => 'μ', + 120758 => 'ν', + 120759 => 'ξ', + 120760 => 'ο', + 120761 => 'Ï€', + 120762 => 'Ï', + 120763 => 'σ', + 120764 => 'σ', + 120765 => 'Ï„', + 120766 => 'Ï…', + 120767 => 'φ', + 120768 => 'χ', + 120769 => 'ψ', + 120770 => 'ω', + 120771 => '∂', + 120772 => 'ε', + 120773 => 'θ', + 120774 => 'κ', + 120775 => 'φ', + 120776 => 'Ï', + 120777 => 'Ï€', + 120778 => 'Ï', + 120779 => 'Ï', + 120782 => '0', + 120783 => '1', + 120784 => '2', + 120785 => '3', + 120786 => '4', + 120787 => '5', + 120788 => '6', + 120789 => '7', + 120790 => '8', + 120791 => '9', + 120792 => '0', + 120793 => '1', + 120794 => '2', + 120795 => '3', + 120796 => '4', + 120797 => '5', + 120798 => '6', + 120799 => '7', + 120800 => '8', + 120801 => '9', + 120802 => '0', + 120803 => '1', + 120804 => '2', + 120805 => '3', + 120806 => '4', + 120807 => '5', + 120808 => '6', + 120809 => '7', + 120810 => '8', + 120811 => '9', + 120812 => '0', + 120813 => '1', + 120814 => '2', + 120815 => '3', + 120816 => '4', + 120817 => '5', + 120818 => '6', + 120819 => '7', + 120820 => '8', + 120821 => '9', + 120822 => '0', + 120823 => '1', + 120824 => '2', + 120825 => '3', + 120826 => '4', + 120827 => '5', + 120828 => '6', + 120829 => '7', + 120830 => '8', + 120831 => '9', + 125184 => '𞤢', + 125185 => '𞤣', + 125186 => '𞤤', + 125187 => '𞤥', + 125188 => '𞤦', + 125189 => '𞤧', + 125190 => '𞤨', + 125191 => '𞤩', + 125192 => '𞤪', + 125193 => '𞤫', + 125194 => '𞤬', + 125195 => '𞤭', + 125196 => '𞤮', + 125197 => '𞤯', + 125198 => '𞤰', + 125199 => '𞤱', + 125200 => '𞤲', + 125201 => '𞤳', + 125202 => '𞤴', + 125203 => '𞤵', + 125204 => '𞤶', + 125205 => '𞤷', + 125206 => '𞤸', + 125207 => '𞤹', + 125208 => '𞤺', + 125209 => '𞤻', + 125210 => '𞤼', + 125211 => '𞤽', + 125212 => '𞤾', + 125213 => '𞤿', + 125214 => '𞥀', + 125215 => 'ðž¥', + 125216 => '𞥂', + 125217 => '𞥃', + 126464 => 'ا', + 126465 => 'ب', + 126466 => 'ج', + 126467 => 'د', + 126469 => 'Ùˆ', + 126470 => 'ز', + 126471 => 'Ø­', + 126472 => 'Ø·', + 126473 => 'ÙŠ', + 126474 => 'Ùƒ', + 126475 => 'Ù„', + 126476 => 'Ù…', + 126477 => 'Ù†', + 126478 => 'س', + 126479 => 'ع', + 126480 => 'Ù', + 126481 => 'ص', + 126482 => 'Ù‚', + 126483 => 'ر', + 126484 => 'Ø´', + 126485 => 'ت', + 126486 => 'Ø«', + 126487 => 'Ø®', + 126488 => 'Ø°', + 126489 => 'ض', + 126490 => 'ظ', + 126491 => 'غ', + 126492 => 'Ù®', + 126493 => 'Úº', + 126494 => 'Ú¡', + 126495 => 'Ù¯', + 126497 => 'ب', + 126498 => 'ج', + 126500 => 'Ù‡', + 126503 => 'Ø­', + 126505 => 'ÙŠ', + 126506 => 'Ùƒ', + 126507 => 'Ù„', + 126508 => 'Ù…', + 126509 => 'Ù†', + 126510 => 'س', + 126511 => 'ع', + 126512 => 'Ù', + 126513 => 'ص', + 126514 => 'Ù‚', + 126516 => 'Ø´', + 126517 => 'ت', + 126518 => 'Ø«', + 126519 => 'Ø®', + 126521 => 'ض', + 126523 => 'غ', + 126530 => 'ج', + 126535 => 'Ø­', + 126537 => 'ÙŠ', + 126539 => 'Ù„', + 126541 => 'Ù†', + 126542 => 'س', + 126543 => 'ع', + 126545 => 'ص', + 126546 => 'Ù‚', + 126548 => 'Ø´', + 126551 => 'Ø®', + 126553 => 'ض', + 126555 => 'غ', + 126557 => 'Úº', + 126559 => 'Ù¯', + 126561 => 'ب', + 126562 => 'ج', + 126564 => 'Ù‡', + 126567 => 'Ø­', + 126568 => 'Ø·', + 126569 => 'ÙŠ', + 126570 => 'Ùƒ', + 126572 => 'Ù…', + 126573 => 'Ù†', + 126574 => 'س', + 126575 => 'ع', + 126576 => 'Ù', + 126577 => 'ص', + 126578 => 'Ù‚', + 126580 => 'Ø´', + 126581 => 'ت', + 126582 => 'Ø«', + 126583 => 'Ø®', + 126585 => 'ض', + 126586 => 'ظ', + 126587 => 'غ', + 126588 => 'Ù®', + 126590 => 'Ú¡', + 126592 => 'ا', + 126593 => 'ب', + 126594 => 'ج', + 126595 => 'د', + 126596 => 'Ù‡', + 126597 => 'Ùˆ', + 126598 => 'ز', + 126599 => 'Ø­', + 126600 => 'Ø·', + 126601 => 'ÙŠ', + 126603 => 'Ù„', + 126604 => 'Ù…', + 126605 => 'Ù†', + 126606 => 'س', + 126607 => 'ع', + 126608 => 'Ù', + 126609 => 'ص', + 126610 => 'Ù‚', + 126611 => 'ر', + 126612 => 'Ø´', + 126613 => 'ت', + 126614 => 'Ø«', + 126615 => 'Ø®', + 126616 => 'Ø°', + 126617 => 'ض', + 126618 => 'ظ', + 126619 => 'غ', + 126625 => 'ب', + 126626 => 'ج', + 126627 => 'د', + 126629 => 'Ùˆ', + 126630 => 'ز', + 126631 => 'Ø­', + 126632 => 'Ø·', + 126633 => 'ÙŠ', + 126635 => 'Ù„', + 126636 => 'Ù…', + 126637 => 'Ù†', + 126638 => 'س', + 126639 => 'ع', + 126640 => 'Ù', + 126641 => 'ص', + 126642 => 'Ù‚', + 126643 => 'ر', + 126644 => 'Ø´', + 126645 => 'ت', + 126646 => 'Ø«', + 126647 => 'Ø®', + 126648 => 'Ø°', + 126649 => 'ض', + 126650 => 'ظ', + 126651 => 'غ', + 127274 => '〔s〕', + 127275 => 'c', + 127276 => 'r', + 127277 => 'cd', + 127278 => 'wz', + 127280 => 'a', + 127281 => 'b', + 127282 => 'c', + 127283 => 'd', + 127284 => 'e', + 127285 => 'f', + 127286 => 'g', + 127287 => 'h', + 127288 => 'i', + 127289 => 'j', + 127290 => 'k', + 127291 => 'l', + 127292 => 'm', + 127293 => 'n', + 127294 => 'o', + 127295 => 'p', + 127296 => 'q', + 127297 => 'r', + 127298 => 's', + 127299 => 't', + 127300 => 'u', + 127301 => 'v', + 127302 => 'w', + 127303 => 'x', + 127304 => 'y', + 127305 => 'z', + 127306 => 'hv', + 127307 => 'mv', + 127308 => 'sd', + 127309 => 'ss', + 127310 => 'ppv', + 127311 => 'wc', + 127338 => 'mc', + 127339 => 'md', + 127340 => 'mr', + 127376 => 'dj', + 127488 => 'ã»ã‹', + 127489 => 'ココ', + 127490 => 'サ', + 127504 => '手', + 127505 => 'å­—', + 127506 => 'åŒ', + 127507 => 'デ', + 127508 => '二', + 127509 => '多', + 127510 => '解', + 127511 => '天', + 127512 => '交', + 127513 => '映', + 127514 => 'ç„¡', + 127515 => 'æ–™', + 127516 => 'å‰', + 127517 => '後', + 127518 => 'å†', + 127519 => 'æ–°', + 127520 => 'åˆ', + 127521 => '終', + 127522 => '生', + 127523 => '販', + 127524 => '声', + 127525 => 'å¹', + 127526 => 'æ¼”', + 127527 => '投', + 127528 => 'æ•', + 127529 => '一', + 127530 => '三', + 127531 => 'éŠ', + 127532 => 'å·¦', + 127533 => '中', + 127534 => 'å³', + 127535 => '指', + 127536 => 'èµ°', + 127537 => '打', + 127538 => 'ç¦', + 127539 => '空', + 127540 => 'åˆ', + 127541 => '満', + 127542 => '有', + 127543 => '月', + 127544 => '申', + 127545 => '割', + 127546 => 'å–¶', + 127547 => 'é…', + 127552 => '〔本〕', + 127553 => '〔三〕', + 127554 => '〔二〕', + 127555 => '〔安〕', + 127556 => '〔点〕', + 127557 => '〔打〕', + 127558 => '〔盗〕', + 127559 => '〔å‹ã€•', + 127560 => '〔敗〕', + 127568 => 'å¾—', + 127569 => 'å¯', + 130032 => '0', + 130033 => '1', + 130034 => '2', + 130035 => '3', + 130036 => '4', + 130037 => '5', + 130038 => '6', + 130039 => '7', + 130040 => '8', + 130041 => '9', + 194560 => '丽', + 194561 => '丸', + 194562 => 'ä¹', + 194563 => 'ð „¢', + 194564 => 'ä½ ', + 194565 => 'ä¾®', + 194566 => 'ä¾»', + 194567 => '倂', + 194568 => 'åº', + 194569 => 'å‚™', + 194570 => '僧', + 194571 => 'åƒ', + 194572 => 'ã’ž', + 194573 => '𠘺', + 194574 => 'å…', + 194575 => 'å…”', + 194576 => 'å…¤', + 194577 => 'å…·', + 194578 => '𠔜', + 194579 => 'ã’¹', + 194580 => 'å…§', + 194581 => 'å†', + 194582 => 'ð •‹', + 194583 => '冗', + 194584 => '冤', + 194585 => '仌', + 194586 => '冬', + 194587 => '况', + 194588 => '𩇟', + 194589 => '凵', + 194590 => '刃', + 194591 => 'ã“Ÿ', + 194592 => '刻', + 194593 => '剆', + 194594 => '割', + 194595 => '剷', + 194596 => '㔕', + 194597 => '勇', + 194598 => '勉', + 194599 => '勤', + 194600 => '勺', + 194601 => '包', + 194602 => '匆', + 194603 => '北', + 194604 => 'å‰', + 194605 => 'å‘', + 194606 => 'åš', + 194607 => 'å³', + 194608 => 'å½', + 194609 => 'å¿', + 194610 => 'å¿', + 194611 => 'å¿', + 194612 => '𠨬', + 194613 => 'ç°', + 194614 => 'åŠ', + 194615 => 'åŸ', + 194616 => 'ð ­£', + 194617 => 'å«', + 194618 => 'å±', + 194619 => 'å†', + 194620 => 'å’ž', + 194621 => 'å¸', + 194622 => '呈', + 194623 => '周', + 194624 => 'å’¢', + 194625 => '哶', + 194626 => 'å”', + 194627 => 'å•“', + 194628 => 'å•£', + 194629 => 'å–„', + 194630 => 'å–„', + 194631 => 'å–™', + 194632 => 'å–«', + 194633 => 'å–³', + 194634 => 'å—‚', + 194635 => '圖', + 194636 => '嘆', + 194637 => '圗', + 194638 => '噑', + 194639 => 'å™´', + 194640 => '切', + 194641 => '壮', + 194642 => '城', + 194643 => '埴', + 194644 => 'å ', + 194645 => 'åž‹', + 194646 => 'å ²', + 194647 => 'å ±', + 194648 => '墬', + 194649 => '𡓤', + 194650 => '売', + 194651 => '壷', + 194652 => '夆', + 194653 => '多', + 194654 => '夢', + 194655 => '奢', + 194656 => '𡚨', + 194657 => '𡛪', + 194658 => '姬', + 194659 => '娛', + 194660 => '娧', + 194661 => '姘', + 194662 => '婦', + 194663 => 'ã›®', + 194665 => '嬈', + 194666 => '嬾', + 194667 => '嬾', + 194668 => '𡧈', + 194669 => '寃', + 194670 => '寘', + 194671 => '寧', + 194672 => '寳', + 194673 => '𡬘', + 194674 => '寿', + 194675 => 'å°†', + 194677 => 'å°¢', + 194678 => 'ãž', + 194679 => 'å± ', + 194680 => 'å±®', + 194681 => 'å³€', + 194682 => 'å²', + 194683 => 'ð¡·¤', + 194684 => '嵃', + 194685 => 'ð¡·¦', + 194686 => 'åµ®', + 194687 => '嵫', + 194688 => 'åµ¼', + 194689 => 'å·¡', + 194690 => 'å·¢', + 194691 => 'ã ¯', + 194692 => 'å·½', + 194693 => '帨', + 194694 => '帽', + 194695 => '幩', + 194696 => 'ã¡¢', + 194697 => '𢆃', + 194698 => '㡼', + 194699 => '庰', + 194700 => '庳', + 194701 => '庶', + 194702 => '廊', + 194703 => '𪎒', + 194704 => '廾', + 194705 => '𢌱', + 194706 => '𢌱', + 194707 => 'èˆ', + 194708 => 'å¼¢', + 194709 => 'å¼¢', + 194710 => '㣇', + 194711 => '𣊸', + 194712 => '𦇚', + 194713 => 'å½¢', + 194714 => '彫', + 194715 => '㣣', + 194716 => '徚', + 194717 => 'å¿', + 194718 => 'å¿—', + 194719 => '忹', + 194720 => 'æ‚', + 194721 => '㤺', + 194722 => '㤜', + 194723 => 'æ‚”', + 194724 => '𢛔', + 194725 => '惇', + 194726 => 'æ…ˆ', + 194727 => 'æ…Œ', + 194728 => 'æ…Ž', + 194729 => 'æ…Œ', + 194730 => 'æ…º', + 194731 => '憎', + 194732 => '憲', + 194733 => '憤', + 194734 => '憯', + 194735 => '懞', + 194736 => '懲', + 194737 => '懶', + 194738 => 'æˆ', + 194739 => '戛', + 194740 => 'æ‰', + 194741 => '抱', + 194742 => 'æ‹”', + 194743 => 'æ', + 194744 => '𢬌', + 194745 => '挽', + 194746 => '拼', + 194747 => 'æ¨', + 194748 => '掃', + 194749 => 'æ¤', + 194750 => '𢯱', + 194751 => 'æ¢', + 194752 => 'æ…', + 194753 => '掩', + 194754 => '㨮', + 194755 => 'æ‘©', + 194756 => '摾', + 194757 => 'æ’', + 194758 => 'æ‘·', + 194759 => '㩬', + 194760 => 'æ•', + 194761 => '敬', + 194762 => '𣀊', + 194763 => 'æ—£', + 194764 => '書', + 194765 => '晉', + 194766 => '㬙', + 194767 => 'æš‘', + 194768 => '㬈', + 194769 => '㫤', + 194770 => '冒', + 194771 => '冕', + 194772 => '最', + 194773 => 'æšœ', + 194774 => 'è‚­', + 194775 => 'ä™', + 194776 => '朗', + 194777 => '望', + 194778 => '朡', + 194779 => 'æž', + 194780 => 'æ“', + 194781 => 'ð£ƒ', + 194782 => 'ã­‰', + 194783 => '柺', + 194784 => 'æž…', + 194785 => 'æ¡’', + 194786 => '梅', + 194787 => '𣑭', + 194788 => '梎', + 194789 => 'æ Ÿ', + 194790 => '椔', + 194791 => 'ã®', + 194792 => '楂', + 194793 => '榣', + 194794 => '槪', + 194795 => '檨', + 194796 => '𣚣', + 194797 => 'æ«›', + 194798 => 'ã°˜', + 194799 => '次', + 194800 => '𣢧', + 194801 => 'æ­”', + 194802 => '㱎', + 194803 => 'æ­²', + 194804 => '殟', + 194805 => '殺', + 194806 => 'æ®»', + 194807 => 'ð£ª', + 194808 => 'ð¡´‹', + 194809 => '𣫺', + 194810 => '汎', + 194811 => '𣲼', + 194812 => '沿', + 194813 => 'æ³', + 194814 => '汧', + 194815 => 'æ´–', + 194816 => 'æ´¾', + 194817 => 'æµ·', + 194818 => 'æµ', + 194819 => '浩', + 194820 => '浸', + 194821 => '涅', + 194822 => '𣴞', + 194823 => 'æ´´', + 194824 => '港', + 194825 => 'æ¹®', + 194826 => 'ã´³', + 194827 => '滋', + 194828 => '滇', + 194829 => '𣻑', + 194830 => 'æ·¹', + 194831 => 'æ½®', + 194832 => '𣽞', + 194833 => '𣾎', + 194834 => '濆', + 194835 => '瀹', + 194836 => '瀞', + 194837 => '瀛', + 194838 => '㶖', + 194839 => 'çŠ', + 194840 => 'ç½', + 194841 => 'ç·', + 194842 => 'ç‚­', + 194843 => '𠔥', + 194844 => 'ç……', + 194845 => '𤉣', + 194846 => '熜', + 194848 => '爨', + 194849 => '爵', + 194850 => 'ç‰', + 194851 => '𤘈', + 194852 => '犀', + 194853 => '犕', + 194854 => '𤜵', + 194855 => '𤠔', + 194856 => 'çº', + 194857 => '王', + 194858 => '㺬', + 194859 => '玥', + 194860 => '㺸', + 194861 => '㺸', + 194862 => '瑇', + 194863 => 'ç‘œ', + 194864 => '瑱', + 194865 => 'ç’…', + 194866 => 'ç“Š', + 194867 => 'ã¼›', + 194868 => '甤', + 194869 => '𤰶', + 194870 => '甾', + 194871 => '𤲒', + 194872 => 'ç•°', + 194873 => '𢆟', + 194874 => 'ç˜', + 194875 => '𤾡', + 194876 => '𤾸', + 194877 => 'ð¥„', + 194878 => '㿼', + 194879 => '䀈', + 194880 => 'ç›´', + 194881 => '𥃳', + 194882 => '𥃲', + 194883 => '𥄙', + 194884 => '𥄳', + 194885 => '眞', + 194886 => '真', + 194887 => '真', + 194888 => 'çŠ', + 194889 => '䀹', + 194890 => 'çž‹', + 194891 => 'ä†', + 194892 => 'ä‚–', + 194893 => 'ð¥', + 194894 => 'ç¡Ž', + 194895 => '碌', + 194896 => '磌', + 194897 => '䃣', + 194898 => '𥘦', + 194899 => '祖', + 194900 => '𥚚', + 194901 => '𥛅', + 194902 => 'ç¦', + 194903 => '秫', + 194904 => '䄯', + 194905 => 'ç©€', + 194906 => 'ç©Š', + 194907 => 'ç©', + 194908 => '𥥼', + 194909 => '𥪧', + 194910 => '𥪧', + 194912 => '䈂', + 194913 => '𥮫', + 194914 => '篆', + 194915 => '築', + 194916 => '䈧', + 194917 => '𥲀', + 194918 => 'ç³’', + 194919 => '䊠', + 194920 => '糨', + 194921 => 'ç³£', + 194922 => 'ç´€', + 194923 => '𥾆', + 194924 => 'çµ£', + 194925 => 'äŒ', + 194926 => 'ç·‡', + 194927 => '縂', + 194928 => 'ç¹…', + 194929 => '䌴', + 194930 => '𦈨', + 194931 => '𦉇', + 194932 => 'ä™', + 194933 => '𦋙', + 194934 => '罺', + 194935 => '𦌾', + 194936 => '羕', + 194937 => '翺', + 194938 => '者', + 194939 => '𦓚', + 194940 => '𦔣', + 194941 => 'è ', + 194942 => '𦖨', + 194943 => 'è°', + 194944 => 'ð£Ÿ', + 194945 => 'ä•', + 194946 => '育', + 194947 => '脃', + 194948 => 'ä‹', + 194949 => '脾', + 194950 => '媵', + 194951 => '𦞧', + 194952 => '𦞵', + 194953 => '𣎓', + 194954 => '𣎜', + 194955 => 'èˆ', + 194956 => '舄', + 194957 => '辞', + 194958 => 'ä‘«', + 194959 => '芑', + 194960 => '芋', + 194961 => 'èŠ', + 194962 => '劳', + 194963 => '花', + 194964 => '芳', + 194965 => '芽', + 194966 => '苦', + 194967 => '𦬼', + 194968 => 'è‹¥', + 194969 => 'èŒ', + 194970 => 'è£', + 194971 => '莭', + 194972 => '茣', + 194973 => '莽', + 194974 => 'è§', + 194975 => 'è‘—', + 194976 => 'è“', + 194977 => 'èŠ', + 194978 => 'èŒ', + 194979 => 'èœ', + 194980 => '𦰶', + 194981 => '𦵫', + 194982 => '𦳕', + 194983 => '䔫', + 194984 => '蓱', + 194985 => '蓳', + 194986 => 'è”–', + 194987 => 'ð§Š', + 194988 => '蕤', + 194989 => '𦼬', + 194990 => 'ä•', + 194991 => 'ä•¡', + 194992 => '𦾱', + 194993 => '𧃒', + 194994 => 'ä•«', + 194995 => 'è™', + 194996 => '虜', + 194997 => '虧', + 194998 => '虩', + 194999 => 'èš©', + 195000 => '蚈', + 195001 => '蜎', + 195002 => '蛢', + 195003 => 'è¹', + 195004 => '蜨', + 195005 => 'è«', + 195006 => '螆', + 195008 => '蟡', + 195009 => 'è ', + 195010 => 'ä—¹', + 195011 => 'è¡ ', + 195012 => 'è¡£', + 195013 => '𧙧', + 195014 => '裗', + 195015 => '裞', + 195016 => '䘵', + 195017 => '裺', + 195018 => 'ã’»', + 195019 => '𧢮', + 195020 => '𧥦', + 195021 => 'äš¾', + 195022 => '䛇', + 195023 => '誠', + 195024 => 'è«­', + 195025 => '變', + 195026 => '豕', + 195027 => '𧲨', + 195028 => '貫', + 195029 => 'è³', + 195030 => 'è´›', + 195031 => 'èµ·', + 195032 => '𧼯', + 195033 => 'ð  „', + 195034 => 'è·‹', + 195035 => '趼', + 195036 => 'è·°', + 195037 => '𠣞', + 195038 => 'è»”', + 195039 => '輸', + 195040 => '𨗒', + 195041 => '𨗭', + 195042 => 'é‚”', + 195043 => '郱', + 195044 => 'é„‘', + 195045 => '𨜮', + 195046 => 'é„›', + 195047 => '鈸', + 195048 => 'é‹—', + 195049 => '鋘', + 195050 => '鉼', + 195051 => 'é¹', + 195052 => 'é•', + 195053 => '𨯺', + 195054 => 'é–‹', + 195055 => '䦕', + 195056 => 'é–·', + 195057 => '𨵷', + 195058 => '䧦', + 195059 => '雃', + 195060 => '嶲', + 195061 => '霣', + 195062 => 'ð©……', + 195063 => '𩈚', + 195064 => 'ä©®', + 195065 => '䩶', + 195066 => '韠', + 195067 => 'ð©Š', + 195068 => '䪲', + 195069 => 'ð©’–', + 195070 => 'é ‹', + 195071 => 'é ‹', + 195072 => 'é ©', + 195073 => 'ð©–¶', + 195074 => '飢', + 195075 => '䬳', + 195076 => '餩', + 195077 => '馧', + 195078 => '駂', + 195079 => '駾', + 195080 => '䯎', + 195081 => '𩬰', + 195082 => '鬒', + 195083 => 'é±€', + 195084 => 'é³½', + 195085 => '䳎', + 195086 => 'ä³­', + 195087 => '鵧', + 195088 => '𪃎', + 195089 => '䳸', + 195090 => '𪄅', + 195091 => '𪈎', + 195092 => '𪊑', + 195093 => '麻', + 195094 => 'äµ–', + 195095 => '黹', + 195096 => '黾', + 195097 => 'é¼…', + 195098 => 'é¼', + 195099 => 'é¼–', + 195100 => 'é¼»', + 195101 => '𪘀', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php new file mode 100644 index 00000000000..1958e37ed25 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php @@ -0,0 +1,65 @@ + 9, + 2509 => 9, + 2637 => 9, + 2765 => 9, + 2893 => 9, + 3021 => 9, + 3149 => 9, + 3277 => 9, + 3387 => 9, + 3388 => 9, + 3405 => 9, + 3530 => 9, + 3642 => 9, + 3770 => 9, + 3972 => 9, + 4153 => 9, + 4154 => 9, + 5908 => 9, + 5940 => 9, + 6098 => 9, + 6752 => 9, + 6980 => 9, + 7082 => 9, + 7083 => 9, + 7154 => 9, + 7155 => 9, + 11647 => 9, + 43014 => 9, + 43052 => 9, + 43204 => 9, + 43347 => 9, + 43456 => 9, + 43766 => 9, + 44013 => 9, + 68159 => 9, + 69702 => 9, + 69759 => 9, + 69817 => 9, + 69939 => 9, + 69940 => 9, + 70080 => 9, + 70197 => 9, + 70378 => 9, + 70477 => 9, + 70722 => 9, + 70850 => 9, + 71103 => 9, + 71231 => 9, + 71350 => 9, + 71467 => 9, + 71737 => 9, + 71997 => 9, + 71998 => 9, + 72160 => 9, + 72244 => 9, + 72263 => 9, + 72345 => 9, + 72767 => 9, + 73028 => 9, + 73029 => 9, + 73111 => 9, +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php new file mode 100644 index 00000000000..57c78356c99 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php @@ -0,0 +1,145 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Idn as p; + +if (extension_loaded('intl')) { + return; +} + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!defined('U_IDNA_PROHIBITED_ERROR')) { + define('U_IDNA_PROHIBITED_ERROR', 66560); +} +if (!defined('U_IDNA_ERROR_START')) { + define('U_IDNA_ERROR_START', 66560); +} +if (!defined('U_IDNA_UNASSIGNED_ERROR')) { + define('U_IDNA_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { + define('U_IDNA_CHECK_BIDI_ERROR', 66562); +} +if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { + define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); +} +if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { + define('U_IDNA_ACE_PREFIX_ERROR', 66564); +} +if (!defined('U_IDNA_VERIFICATION_ERROR')) { + define('U_IDNA_VERIFICATION_ERROR', 66565); +} +if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { + define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); +} +if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { + define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); +} +if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { + define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); +} +if (!defined('U_IDNA_ERROR_LIMIT')) { + define('U_IDNA_ERROR_LIMIT', 66569); +} +if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { + define('U_STRINGPREP_PROHIBITED_ERROR', 66560); +} +if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { + define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { + define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); +} +if (!defined('IDNA_DEFAULT')) { + define('IDNA_DEFAULT', 0); +} +if (!defined('IDNA_ALLOW_UNASSIGNED')) { + define('IDNA_ALLOW_UNASSIGNED', 1); +} +if (!defined('IDNA_USE_STD3_RULES')) { + define('IDNA_USE_STD3_RULES', 2); +} +if (!defined('IDNA_CHECK_BIDI')) { + define('IDNA_CHECK_BIDI', 4); +} +if (!defined('IDNA_CHECK_CONTEXTJ')) { + define('IDNA_CHECK_CONTEXTJ', 8); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { + define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { + define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); +} +if (!defined('INTL_IDNA_VARIANT_2003')) { + define('INTL_IDNA_VARIANT_2003', 0); +} +if (!defined('INTL_IDNA_VARIANT_UTS46')) { + define('INTL_IDNA_VARIANT_UTS46', 1); +} +if (!defined('IDNA_ERROR_EMPTY_LABEL')) { + define('IDNA_ERROR_EMPTY_LABEL', 1); +} +if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { + define('IDNA_ERROR_LABEL_TOO_LONG', 2); +} +if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { + define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); +} +if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { + define('IDNA_ERROR_LEADING_HYPHEN', 8); +} +if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { + define('IDNA_ERROR_TRAILING_HYPHEN', 16); +} +if (!defined('IDNA_ERROR_HYPHEN_3_4')) { + define('IDNA_ERROR_HYPHEN_3_4', 32); +} +if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { + define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); +} +if (!defined('IDNA_ERROR_DISALLOWED')) { + define('IDNA_ERROR_DISALLOWED', 128); +} +if (!defined('IDNA_ERROR_PUNYCODE')) { + define('IDNA_ERROR_PUNYCODE', 256); +} +if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { + define('IDNA_ERROR_LABEL_HAS_DOT', 512); +} +if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { + define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); +} +if (!defined('IDNA_ERROR_BIDI')) { + define('IDNA_ERROR_BIDI', 2048); +} +if (!defined('IDNA_ERROR_CONTEXTJ')) { + define('IDNA_ERROR_CONTEXTJ', 4096); +} + +if (\PHP_VERSION_ID < 70400) { + if (!function_exists('idn_to_ascii')) { + function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } + } + if (!function_exists('idn_to_utf8')) { + function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } + } +} else { + if (!function_exists('idn_to_ascii')) { + function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } + } + if (!function_exists('idn_to_utf8')) { + function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php new file mode 100644 index 00000000000..a62c2d69bf7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php @@ -0,0 +1,125 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Idn as p; + +if (!defined('U_IDNA_PROHIBITED_ERROR')) { + define('U_IDNA_PROHIBITED_ERROR', 66560); +} +if (!defined('U_IDNA_ERROR_START')) { + define('U_IDNA_ERROR_START', 66560); +} +if (!defined('U_IDNA_UNASSIGNED_ERROR')) { + define('U_IDNA_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { + define('U_IDNA_CHECK_BIDI_ERROR', 66562); +} +if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { + define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); +} +if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { + define('U_IDNA_ACE_PREFIX_ERROR', 66564); +} +if (!defined('U_IDNA_VERIFICATION_ERROR')) { + define('U_IDNA_VERIFICATION_ERROR', 66565); +} +if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { + define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); +} +if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { + define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); +} +if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { + define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); +} +if (!defined('U_IDNA_ERROR_LIMIT')) { + define('U_IDNA_ERROR_LIMIT', 66569); +} +if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { + define('U_STRINGPREP_PROHIBITED_ERROR', 66560); +} +if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { + define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { + define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); +} +if (!defined('IDNA_DEFAULT')) { + define('IDNA_DEFAULT', 0); +} +if (!defined('IDNA_ALLOW_UNASSIGNED')) { + define('IDNA_ALLOW_UNASSIGNED', 1); +} +if (!defined('IDNA_USE_STD3_RULES')) { + define('IDNA_USE_STD3_RULES', 2); +} +if (!defined('IDNA_CHECK_BIDI')) { + define('IDNA_CHECK_BIDI', 4); +} +if (!defined('IDNA_CHECK_CONTEXTJ')) { + define('IDNA_CHECK_CONTEXTJ', 8); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { + define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { + define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); +} +if (!defined('INTL_IDNA_VARIANT_UTS46')) { + define('INTL_IDNA_VARIANT_UTS46', 1); +} +if (!defined('IDNA_ERROR_EMPTY_LABEL')) { + define('IDNA_ERROR_EMPTY_LABEL', 1); +} +if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { + define('IDNA_ERROR_LABEL_TOO_LONG', 2); +} +if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { + define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); +} +if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { + define('IDNA_ERROR_LEADING_HYPHEN', 8); +} +if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { + define('IDNA_ERROR_TRAILING_HYPHEN', 16); +} +if (!defined('IDNA_ERROR_HYPHEN_3_4')) { + define('IDNA_ERROR_HYPHEN_3_4', 32); +} +if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { + define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); +} +if (!defined('IDNA_ERROR_DISALLOWED')) { + define('IDNA_ERROR_DISALLOWED', 128); +} +if (!defined('IDNA_ERROR_PUNYCODE')) { + define('IDNA_ERROR_PUNYCODE', 256); +} +if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { + define('IDNA_ERROR_LABEL_HAS_DOT', 512); +} +if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { + define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); +} +if (!defined('IDNA_ERROR_BIDI')) { + define('IDNA_ERROR_BIDI', 2048); +} +if (!defined('IDNA_ERROR_CONTEXTJ')) { + define('IDNA_ERROR_CONTEXTJ', 4096); +} + +if (!function_exists('idn_to_ascii')) { + function idn_to_ascii(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); } +} +if (!function_exists('idn_to_utf8')) { + function idn_to_utf8(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json b/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json new file mode 100644 index 00000000000..c5a2a462a7a --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json @@ -0,0 +1,44 @@ +{ + "name": "symfony/polyfill-intl-idn", + "type": "library", + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "idn"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" }, + "files": [ "bootstrap.php" ] + }, + "suggest": { + "ext-intl": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE new file mode 100644 index 00000000000..4cd8bdd3007 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2019 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php new file mode 100644 index 00000000000..4443c2322af --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php @@ -0,0 +1,310 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Normalizer; + +/** + * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. + * + * It has been validated with Unicode 6.3 Normalization Conformance Test. + * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. + * + * @author Nicolas Grekas + * + * @internal + */ +class Normalizer +{ + public const FORM_D = \Normalizer::FORM_D; + public const FORM_KD = \Normalizer::FORM_KD; + public const FORM_C = \Normalizer::FORM_C; + public const FORM_KC = \Normalizer::FORM_KC; + public const NFD = \Normalizer::NFD; + public const NFKD = \Normalizer::NFKD; + public const NFC = \Normalizer::NFC; + public const NFKC = \Normalizer::NFKC; + + private static $C; + private static $D; + private static $KD; + private static $cC; + private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + private static $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"; + + public static function isNormalized(string $s, int $form = self::FORM_C) + { + if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { + return false; + } + if (!isset($s[strspn($s, self::$ASCII)])) { + return true; + } + if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { + return true; + } + + return self::normalize($s, $form) === $s; + } + + public static function normalize(string $s, int $form = self::FORM_C) + { + if (!preg_match('//u', $s)) { + return false; + } + + switch ($form) { + case self::NFC: $C = true; $K = false; break; + case self::NFD: $C = false; $K = false; break; + case self::NFKC: $C = true; $K = true; break; + case self::NFKD: $C = false; $K = true; break; + default: + if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { + return $s; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); + } + + if ('' === $s) { + return ''; + } + + if ($K && null === self::$KD) { + self::$KD = self::getData('compatibilityDecomposition'); + } + + if (null === self::$D) { + self::$D = self::getData('canonicalDecomposition'); + self::$cC = self::getData('combiningClass'); + } + + if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { + mb_internal_encoding('8bit'); + } + + $r = self::decompose($s, $K); + + if ($C) { + if (null === self::$C) { + self::$C = self::getData('canonicalComposition'); + } + + $r = self::recompose($r); + } + if (null !== $mbEncoding) { + mb_internal_encoding($mbEncoding); + } + + return $r; + } + + private static function recompose($s) + { + $ASCII = self::$ASCII; + $compMap = self::$C; + $combClass = self::$cC; + $ulenMask = self::$ulenMask; + + $result = $tail = ''; + + $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; + $len = \strlen($s); + + $lastUchr = substr($s, 0, $i); + $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; + + while ($i < $len) { + if ($s[$i] < "\x80") { + // ASCII chars + + if ($tail) { + $lastUchr .= $tail; + $tail = ''; + } + + if ($j = strspn($s, $ASCII, $i + 1)) { + $lastUchr .= substr($s, $i, $j); + $i += $j; + } + + $result .= $lastUchr; + $lastUchr = $s[$i]; + $lastUcls = 0; + ++$i; + continue; + } + + $ulen = $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + + if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr + || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr + || $lastUcls) { + // Table lookup and combining chars composition + + $ucls = $combClass[$uchr] ?? 0; + + if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { + $lastUchr = $compMap[$lastUchr.$uchr]; + } elseif ($lastUcls = $ucls) { + $tail .= $uchr; + } else { + if ($tail) { + $lastUchr .= $tail; + $tail = ''; + } + + $result .= $lastUchr; + $lastUchr = $uchr; + } + } else { + // Hangul chars + + $L = \ord($lastUchr[2]) - 0x80; + $V = \ord($uchr[2]) - 0xA1; + $T = 0; + + $uchr = substr($s, $i + $ulen, 3); + + if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { + $T = \ord($uchr[2]) - 0xA7; + 0 > $T && $T += 0x40; + $ulen += 3; + } + + $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; + $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); + } + + $i += $ulen; + } + + return $result.$lastUchr.$tail; + } + + private static function decompose($s, $c) + { + $result = ''; + + $ASCII = self::$ASCII; + $decompMap = self::$D; + $combClass = self::$cC; + $ulenMask = self::$ulenMask; + if ($c) { + $compatMap = self::$KD; + } + + $c = []; + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + if ($s[$i] < "\x80") { + // ASCII chars + + if ($c) { + ksort($c); + $result .= implode('', $c); + $c = []; + } + + $j = 1 + strspn($s, $ASCII, $i + 1); + $result .= substr($s, $i, $j); + $i += $j; + continue; + } + + $ulen = $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { + // Table lookup + + if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { + $uchr = $j; + + $j = \strlen($uchr); + $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; + + if ($ulen != $j) { + // Put trailing chars in $s + + $j -= $ulen; + $i -= $j; + + if (0 > $i) { + $s = str_repeat(' ', -$i).$s; + $len -= $i; + $i = 0; + } + + while ($j--) { + $s[$i + $j] = $uchr[$ulen + $j]; + } + + $uchr = substr($uchr, 0, $ulen); + } + } + if (isset($combClass[$uchr])) { + // Combining chars, for sorting + + if (!isset($c[$combClass[$uchr]])) { + $c[$combClass[$uchr]] = ''; + } + $c[$combClass[$uchr]] .= $uchr; + continue; + } + } else { + // Hangul chars + + $uchr = unpack('C*', $uchr); + $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; + + $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) + ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); + + if ($j %= 28) { + $uchr .= $j < 25 + ? ("\xE1\x86".\chr(0xA7 + $j)) + : ("\xE1\x87".\chr(0x67 + $j)); + } + } + if ($c) { + ksort($c); + $result .= implode('', $c); + $c = []; + } + + $result .= $uchr; + } + + if ($c) { + ksort($c); + $result .= implode('', $c); + } + + return $result; + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md new file mode 100644 index 00000000000..15060c5f1fa --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md @@ -0,0 +1,14 @@ +Symfony Polyfill / Intl: Normalizer +=================================== + +This component provides a fallback implementation for the +[`Normalizer`](https://php.net/Normalizer) class provided +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). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php new file mode 100644 index 00000000000..0fdfc890a2a --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php @@ -0,0 +1,17 @@ + 'À', + 'AÌ' => 'Ã', + 'AÌ‚' => 'Â', + 'Ã' => 'Ã', + 'Ä' => 'Ä', + 'AÌŠ' => 'Ã…', + 'Ç' => 'Ç', + 'EÌ€' => 'È', + 'EÌ' => 'É', + 'EÌ‚' => 'Ê', + 'Ë' => 'Ë', + 'IÌ€' => 'ÃŒ', + 'IÌ' => 'Ã', + 'IÌ‚' => 'ÃŽ', + 'Ï' => 'Ã', + 'Ñ' => 'Ñ', + 'OÌ€' => 'Ã’', + 'OÌ' => 'Ó', + 'OÌ‚' => 'Ô', + 'Õ' => 'Õ', + 'Ö' => 'Ö', + 'UÌ€' => 'Ù', + 'UÌ' => 'Ú', + 'UÌ‚' => 'Û', + 'Ü' => 'Ãœ', + 'YÌ' => 'Ã', + 'aÌ€' => 'à', + 'aÌ' => 'á', + 'aÌ‚' => 'â', + 'ã' => 'ã', + 'ä' => 'ä', + 'aÌŠ' => 'Ã¥', + 'ç' => 'ç', + 'eÌ€' => 'è', + 'eÌ' => 'é', + 'eÌ‚' => 'ê', + 'ë' => 'ë', + 'iÌ€' => 'ì', + 'iÌ' => 'í', + 'iÌ‚' => 'î', + 'ï' => 'ï', + 'ñ' => 'ñ', + 'oÌ€' => 'ò', + 'oÌ' => 'ó', + 'oÌ‚' => 'ô', + 'õ' => 'õ', + 'ö' => 'ö', + 'uÌ€' => 'ù', + 'uÌ' => 'ú', + 'uÌ‚' => 'û', + 'ü' => 'ü', + 'yÌ' => 'ý', + 'ÿ' => 'ÿ', + 'AÌ„' => 'Ä€', + 'aÌ„' => 'Ä', + 'Ă' => 'Ä‚', + 'ă' => 'ă', + 'Ą' => 'Ä„', + 'ą' => 'Ä…', + 'CÌ' => 'Ć', + 'cÌ' => 'ć', + 'CÌ‚' => 'Ĉ', + 'cÌ‚' => 'ĉ', + 'Ċ' => 'ÄŠ', + 'ċ' => 'Ä‹', + 'CÌŒ' => 'ÄŒ', + 'cÌŒ' => 'Ä', + 'DÌŒ' => 'ÄŽ', + 'dÌŒ' => 'Ä', + 'EÌ„' => 'Ä’', + 'eÌ„' => 'Ä“', + 'Ĕ' => 'Ä”', + 'ĕ' => 'Ä•', + 'Ė' => 'Ä–', + 'ė' => 'Ä—', + 'Ę' => 'Ę', + 'ę' => 'Ä™', + 'EÌŒ' => 'Äš', + 'eÌŒ' => 'Ä›', + 'GÌ‚' => 'Äœ', + 'gÌ‚' => 'Ä', + 'Ğ' => 'Äž', + 'ğ' => 'ÄŸ', + 'Ġ' => 'Ä ', + 'ġ' => 'Ä¡', + 'Ģ' => 'Ä¢', + 'ģ' => 'Ä£', + 'HÌ‚' => 'Ĥ', + 'hÌ‚' => 'Ä¥', + 'Ĩ' => 'Ĩ', + 'ĩ' => 'Ä©', + 'IÌ„' => 'Ī', + 'iÌ„' => 'Ä«', + 'Ĭ' => 'Ĭ', + 'ĭ' => 'Ä­', + 'Į' => 'Ä®', + 'į' => 'į', + 'İ' => 'Ä°', + 'JÌ‚' => 'Ä´', + 'jÌ‚' => 'ĵ', + 'Ķ' => 'Ķ', + 'ķ' => 'Ä·', + 'LÌ' => 'Ĺ', + 'lÌ' => 'ĺ', + 'Ļ' => 'Ä»', + 'ļ' => 'ļ', + 'LÌŒ' => 'Ľ', + 'lÌŒ' => 'ľ', + 'NÌ' => 'Ń', + 'nÌ' => 'Å„', + 'Ņ' => 'Å…', + 'ņ' => 'ņ', + 'NÌŒ' => 'Ň', + 'nÌŒ' => 'ň', + 'OÌ„' => 'ÅŒ', + 'oÌ„' => 'Å', + 'Ŏ' => 'ÅŽ', + 'ŏ' => 'Å', + 'OÌ‹' => 'Å', + 'oÌ‹' => 'Å‘', + 'RÌ' => 'Å”', + 'rÌ' => 'Å•', + 'Ŗ' => 'Å–', + 'ŗ' => 'Å—', + 'RÌŒ' => 'Ř', + 'rÌŒ' => 'Å™', + 'SÌ' => 'Åš', + 'sÌ' => 'Å›', + 'SÌ‚' => 'Åœ', + 'sÌ‚' => 'Å', + 'Ş' => 'Åž', + 'ş' => 'ÅŸ', + 'SÌŒ' => 'Å ', + 'sÌŒ' => 'Å¡', + 'Ţ' => 'Å¢', + 'ţ' => 'Å£', + 'TÌŒ' => 'Ť', + 'tÌŒ' => 'Å¥', + 'Ũ' => 'Ũ', + 'ũ' => 'Å©', + 'UÌ„' => 'Ū', + 'uÌ„' => 'Å«', + 'Ŭ' => 'Ŭ', + 'ŭ' => 'Å­', + 'UÌŠ' => 'Å®', + 'uÌŠ' => 'ů', + 'UÌ‹' => 'Å°', + 'uÌ‹' => 'ű', + 'Ų' => 'Ų', + 'ų' => 'ų', + 'WÌ‚' => 'Å´', + 'wÌ‚' => 'ŵ', + 'YÌ‚' => 'Ŷ', + 'yÌ‚' => 'Å·', + 'Ÿ' => 'Ÿ', + 'ZÌ' => 'Ź', + 'zÌ' => 'ź', + 'Ż' => 'Å»', + 'ż' => 'ż', + 'ZÌŒ' => 'Ž', + 'zÌŒ' => 'ž', + 'OÌ›' => 'Æ ', + 'oÌ›' => 'Æ¡', + 'UÌ›' => 'Ư', + 'uÌ›' => 'Æ°', + 'AÌŒ' => 'Ç', + 'aÌŒ' => 'ÇŽ', + 'IÌŒ' => 'Ç', + 'iÌŒ' => 'Ç', + 'OÌŒ' => 'Ç‘', + 'oÌŒ' => 'Ç’', + 'UÌŒ' => 'Ç“', + 'uÌŒ' => 'Ç”', + 'Ǖ' => 'Ç•', + 'ǖ' => 'Ç–', + 'ÃœÌ' => 'Ç—', + 'üÌ' => 'ǘ', + 'Ǚ' => 'Ç™', + 'ǚ' => 'Çš', + 'Ǜ' => 'Ç›', + 'ǜ' => 'Çœ', + 'Ǟ' => 'Çž', + 'ǟ' => 'ÇŸ', + 'Ǡ' => 'Ç ', + 'ǡ' => 'Ç¡', + 'Ǣ' => 'Ç¢', + 'ǣ' => 'Ç£', + 'GÌŒ' => 'Ǧ', + 'gÌŒ' => 'ǧ', + 'KÌŒ' => 'Ǩ', + 'kÌŒ' => 'Ç©', + 'Ǫ' => 'Ǫ', + 'ǫ' => 'Ç«', + 'Ǭ' => 'Ǭ', + 'Ç«Ì„' => 'Ç­', + 'Æ·ÌŒ' => 'Ç®', + 'Ê’ÌŒ' => 'ǯ', + 'jÌŒ' => 'Ç°', + 'GÌ' => 'Ç´', + 'gÌ' => 'ǵ', + 'NÌ€' => 'Ǹ', + 'nÌ€' => 'ǹ', + 'Ã…Ì' => 'Ǻ', + 'Ã¥Ì' => 'Ç»', + 'ÆÌ' => 'Ǽ', + 'æÌ' => 'ǽ', + 'ØÌ' => 'Ǿ', + 'øÌ' => 'Ç¿', + 'AÌ' => 'È€', + 'aÌ' => 'È', + 'AÌ‘' => 'È‚', + 'aÌ‘' => 'ȃ', + 'EÌ' => 'È„', + 'eÌ' => 'È…', + 'EÌ‘' => 'Ȇ', + 'eÌ‘' => 'ȇ', + 'IÌ' => 'Ȉ', + 'iÌ' => 'ȉ', + 'IÌ‘' => 'ÈŠ', + 'iÌ‘' => 'È‹', + 'OÌ' => 'ÈŒ', + 'oÌ' => 'È', + 'OÌ‘' => 'ÈŽ', + 'oÌ‘' => 'È', + 'RÌ' => 'È', + 'rÌ' => 'È‘', + 'RÌ‘' => 'È’', + 'rÌ‘' => 'È“', + 'UÌ' => 'È”', + 'uÌ' => 'È•', + 'UÌ‘' => 'È–', + 'uÌ‘' => 'È—', + 'Ș' => 'Ș', + 'ș' => 'È™', + 'Ț' => 'Èš', + 'ț' => 'È›', + 'HÌŒ' => 'Èž', + 'hÌŒ' => 'ÈŸ', + 'Ȧ' => 'Ȧ', + 'ȧ' => 'ȧ', + 'Ȩ' => 'Ȩ', + 'ȩ' => 'È©', + 'Ȫ' => 'Ȫ', + 'ȫ' => 'È«', + 'Ȭ' => 'Ȭ', + 'ȭ' => 'È­', + 'Ȯ' => 'È®', + 'ȯ' => 'ȯ', + 'Ȱ' => 'È°', + 'ȱ' => 'ȱ', + 'YÌ„' => 'Ȳ', + 'yÌ„' => 'ȳ', + '¨Ì' => 'Î…', + 'ΑÌ' => 'Ά', + 'ΕÌ' => 'Έ', + 'ΗÌ' => 'Ή', + 'ΙÌ' => 'Ί', + 'ΟÌ' => 'ÎŒ', + 'Î¥Ì' => 'ÎŽ', + 'ΩÌ' => 'Î', + 'ÏŠÌ' => 'Î', + 'Ϊ' => 'Ϊ', + 'Ϋ' => 'Ϋ', + 'αÌ' => 'ά', + 'εÌ' => 'έ', + 'ηÌ' => 'ή', + 'ιÌ' => 'ί', + 'Ï‹Ì' => 'ΰ', + 'ϊ' => 'ÏŠ', + 'ϋ' => 'Ï‹', + 'οÌ' => 'ÏŒ', + 'Ï…Ì' => 'Ï', + 'ωÌ' => 'ÏŽ', + 'Ï’Ì' => 'Ï“', + 'ϔ' => 'Ï”', + 'Ѐ' => 'Ѐ', + 'Ё' => 'Ð', + 'ГÌ' => 'Ѓ', + 'Ї' => 'Ї', + 'КÌ' => 'ÐŒ', + 'Ѝ' => 'Ð', + 'Ў' => 'ÐŽ', + 'Й' => 'Й', + 'й' => 'й', + 'ѐ' => 'Ñ', + 'ё' => 'Ñ‘', + 'гÌ' => 'Ñ“', + 'ї' => 'Ñ—', + 'кÌ' => 'Ñœ', + 'ѝ' => 'Ñ', + 'ў' => 'Ñž', + 'Ñ´Ì' => 'Ѷ', + 'ѵÌ' => 'Ñ·', + 'Ӂ' => 'Ó', + 'ӂ' => 'Ó‚', + 'Ð̆' => 'Ó', + 'ӑ' => 'Ó‘', + 'Ð̈' => 'Ó’', + 'ӓ' => 'Ó“', + 'Ӗ' => 'Ó–', + 'ӗ' => 'Ó—', + 'Ӛ' => 'Óš', + 'ӛ' => 'Ó›', + 'Ӝ' => 'Óœ', + 'ӝ' => 'Ó', + 'Ӟ' => 'Óž', + 'ӟ' => 'ÓŸ', + 'Ӣ' => 'Ó¢', + 'ӣ' => 'Ó£', + 'Ӥ' => 'Ó¤', + 'ӥ' => 'Ó¥', + 'Ӧ' => 'Ó¦', + 'ӧ' => 'Ó§', + 'Ӫ' => 'Óª', + 'ӫ' => 'Ó«', + 'Ӭ' => 'Ó¬', + 'Ñ̈' => 'Ó­', + 'Ӯ' => 'Ó®', + 'ӯ' => 'Ó¯', + 'Ӱ' => 'Ó°', + 'ӱ' => 'Ó±', + 'Ӳ' => 'Ó²', + 'ӳ' => 'Ó³', + 'Ӵ' => 'Ó´', + 'ӵ' => 'Óµ', + 'Ӹ' => 'Ó¸', + 'ӹ' => 'Ó¹', + 'آ' => 'Ø¢', + 'أ' => 'Ø£', + 'ÙˆÙ”' => 'ؤ', + 'إ' => 'Ø¥', + 'ÙŠÙ”' => 'ئ', + 'Û•Ù”' => 'Û€', + 'ÛÙ”' => 'Û‚', + 'Û’Ù”' => 'Û“', + 'ऩ' => 'ऩ', + 'ऱ' => 'ऱ', + 'ऴ' => 'ऴ', + 'ো' => 'ো', + 'ৌ' => 'ৌ', + 'ୈ' => 'à­ˆ', + 'ୋ' => 'à­‹', + 'ୌ' => 'à­Œ', + 'ஔ' => 'à®”', + 'ொ' => 'ொ', + 'ோ' => 'ோ', + 'ௌ' => 'ௌ', + 'ై' => 'ై', + 'ೀ' => 'à³€', + 'ೇ' => 'ೇ', + 'ೈ' => 'ೈ', + 'ೊ' => 'ೊ', + 'ೋ' => 'ೋ', + 'ൊ' => 'ൊ', + 'ോ' => 'ോ', + 'ൌ' => 'ൌ', + 'ේ' => 'à·š', + 'à·™à·' => 'à·œ', + 'ෝ' => 'à·', + 'ෞ' => 'à·ž', + 'ဦ' => 'ဦ', + 'ᬆ' => 'ᬆ', + 'ᬈ' => 'ᬈ', + 'ᬊ' => 'ᬊ', + 'ᬌ' => 'ᬌ', + 'á¬á¬µ' => 'ᬎ', + 'ᬒ' => 'ᬒ', + 'ᬻ' => 'ᬻ', + 'ᬽ' => 'ᬽ', + 'ᭀ' => 'á­€', + 'ᭁ' => 'á­', + 'ᭃ' => 'á­ƒ', + 'AÌ¥' => 'Ḁ', + 'aÌ¥' => 'á¸', + 'Ḃ' => 'Ḃ', + 'ḃ' => 'ḃ', + 'BÌ£' => 'Ḅ', + 'bÌ£' => 'ḅ', + 'Ḇ' => 'Ḇ', + 'ḇ' => 'ḇ', + 'ÇÌ' => 'Ḉ', + 'çÌ' => 'ḉ', + 'Ḋ' => 'Ḋ', + 'ḋ' => 'ḋ', + 'DÌ£' => 'Ḍ', + 'dÌ£' => 'á¸', + 'Ḏ' => 'Ḏ', + 'ḏ' => 'á¸', + 'Ḑ' => 'á¸', + 'ḑ' => 'ḑ', + 'DÌ­' => 'Ḓ', + 'dÌ­' => 'ḓ', + 'Ä’Ì€' => 'Ḕ', + 'Ä“Ì€' => 'ḕ', + 'Ä’Ì' => 'Ḗ', + 'Ä“Ì' => 'ḗ', + 'EÌ­' => 'Ḙ', + 'eÌ­' => 'ḙ', + 'EÌ°' => 'Ḛ', + 'eÌ°' => 'ḛ', + 'Ḝ' => 'Ḝ', + 'ḝ' => 'á¸', + 'Ḟ' => 'Ḟ', + 'ḟ' => 'ḟ', + 'GÌ„' => 'Ḡ', + 'gÌ„' => 'ḡ', + 'Ḣ' => 'Ḣ', + 'ḣ' => 'ḣ', + 'HÌ£' => 'Ḥ', + 'hÌ£' => 'ḥ', + 'Ḧ' => 'Ḧ', + 'ḧ' => 'ḧ', + 'Ḩ' => 'Ḩ', + 'ḩ' => 'ḩ', + 'HÌ®' => 'Ḫ', + 'hÌ®' => 'ḫ', + 'IÌ°' => 'Ḭ', + 'iÌ°' => 'ḭ', + 'ÃÌ' => 'Ḯ', + 'ïÌ' => 'ḯ', + 'KÌ' => 'Ḱ', + 'kÌ' => 'ḱ', + 'KÌ£' => 'Ḳ', + 'kÌ£' => 'ḳ', + 'Ḵ' => 'Ḵ', + 'ḵ' => 'ḵ', + 'LÌ£' => 'Ḷ', + 'lÌ£' => 'ḷ', + 'Ḹ' => 'Ḹ', + 'ḹ' => 'ḹ', + 'Ḻ' => 'Ḻ', + 'ḻ' => 'ḻ', + 'LÌ­' => 'Ḽ', + 'lÌ­' => 'ḽ', + 'MÌ' => 'Ḿ', + 'mÌ' => 'ḿ', + 'Ṁ' => 'á¹€', + 'ṁ' => 'á¹', + 'MÌ£' => 'Ṃ', + 'mÌ£' => 'ṃ', + 'Ṅ' => 'Ṅ', + 'ṅ' => 'á¹…', + 'NÌ£' => 'Ṇ', + 'nÌ£' => 'ṇ', + 'Ṉ' => 'Ṉ', + 'ṉ' => 'ṉ', + 'NÌ­' => 'Ṋ', + 'nÌ­' => 'ṋ', + 'ÕÌ' => 'Ṍ', + 'õÌ' => 'á¹', + 'Ṏ' => 'Ṏ', + 'ṏ' => 'á¹', + 'Ṑ' => 'á¹', + 'ÅÌ€' => 'ṑ', + 'ÅŒÌ' => 'á¹’', + 'ÅÌ' => 'ṓ', + 'PÌ' => 'á¹”', + 'pÌ' => 'ṕ', + 'Ṗ' => 'á¹–', + 'ṗ' => 'á¹—', + 'Ṙ' => 'Ṙ', + 'ṙ' => 'á¹™', + 'RÌ£' => 'Ṛ', + 'rÌ£' => 'á¹›', + 'Ṝ' => 'Ṝ', + 'ṝ' => 'á¹', + 'Ṟ' => 'Ṟ', + 'ṟ' => 'ṟ', + 'Ṡ' => 'á¹ ', + 'ṡ' => 'ṡ', + 'SÌ£' => 'á¹¢', + 'sÌ£' => 'á¹£', + 'Ṥ' => 'Ṥ', + 'ṥ' => 'á¹¥', + 'Ṧ' => 'Ṧ', + 'ṧ' => 'ṧ', + 'Ṩ' => 'Ṩ', + 'ṩ' => 'ṩ', + 'Ṫ' => 'Ṫ', + 'ṫ' => 'ṫ', + 'TÌ£' => 'Ṭ', + 'tÌ£' => 'á¹­', + 'Ṯ' => 'á¹®', + 'ṯ' => 'ṯ', + 'TÌ­' => 'á¹°', + 'tÌ­' => 'á¹±', + 'Ṳ' => 'á¹²', + 'ṳ' => 'á¹³', + 'UÌ°' => 'á¹´', + 'uÌ°' => 'á¹µ', + 'UÌ­' => 'Ṷ', + 'uÌ­' => 'á¹·', + 'ŨÌ' => 'Ṹ', + 'Å©Ì' => 'á¹¹', + 'Ṻ' => 'Ṻ', + 'ṻ' => 'á¹»', + 'Ṽ' => 'á¹¼', + 'ṽ' => 'á¹½', + 'VÌ£' => 'á¹¾', + 'vÌ£' => 'ṿ', + 'WÌ€' => 'Ẁ', + 'wÌ€' => 'áº', + 'WÌ' => 'Ẃ', + 'wÌ' => 'ẃ', + 'Ẅ' => 'Ẅ', + 'ẅ' => 'ẅ', + 'Ẇ' => 'Ẇ', + 'ẇ' => 'ẇ', + 'WÌ£' => 'Ẉ', + 'wÌ£' => 'ẉ', + 'Ẋ' => 'Ẋ', + 'ẋ' => 'ẋ', + 'Ẍ' => 'Ẍ', + 'ẍ' => 'áº', + 'Ẏ' => 'Ẏ', + 'ẏ' => 'áº', + 'ZÌ‚' => 'áº', + 'zÌ‚' => 'ẑ', + 'ZÌ£' => 'Ẓ', + 'zÌ£' => 'ẓ', + 'Ẕ' => 'Ẕ', + 'ẕ' => 'ẕ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'wÌŠ' => 'ẘ', + 'yÌŠ' => 'ẙ', + 'ẛ' => 'ẛ', + 'AÌ£' => 'Ạ', + 'aÌ£' => 'ạ', + 'Ả' => 'Ả', + 'ả' => 'ả', + 'ÂÌ' => 'Ấ', + 'âÌ' => 'ấ', + 'Ầ' => 'Ầ', + 'ầ' => 'ầ', + 'Ẩ' => 'Ẩ', + 'ẩ' => 'ẩ', + 'Ẫ' => 'Ẫ', + 'ẫ' => 'ẫ', + 'Ậ' => 'Ậ', + 'ậ' => 'ậ', + 'Ä‚Ì' => 'Ắ', + 'ăÌ' => 'ắ', + 'Ä‚Ì€' => 'Ằ', + 'ằ' => 'ằ', + 'Ẳ' => 'Ẳ', + 'ẳ' => 'ẳ', + 'Ẵ' => 'Ẵ', + 'ẵ' => 'ẵ', + 'Ặ' => 'Ặ', + 'ặ' => 'ặ', + 'EÌ£' => 'Ẹ', + 'eÌ£' => 'ẹ', + 'Ẻ' => 'Ẻ', + 'ẻ' => 'ẻ', + 'Ẽ' => 'Ẽ', + 'ẽ' => 'ẽ', + 'ÊÌ' => 'Ế', + 'êÌ' => 'ế', + 'Ề' => 'Ề', + 'ề' => 'á»', + 'Ể' => 'Ể', + 'ể' => 'ể', + 'Ễ' => 'Ễ', + 'ễ' => 'á»…', + 'Ệ' => 'Ệ', + 'ệ' => 'ệ', + 'Ỉ' => 'Ỉ', + 'ỉ' => 'ỉ', + 'IÌ£' => 'Ị', + 'iÌ£' => 'ị', + 'OÌ£' => 'Ọ', + 'oÌ£' => 'á»', + 'Ỏ' => 'Ỏ', + 'ỏ' => 'á»', + 'ÔÌ' => 'á»', + 'ôÌ' => 'ố', + 'Ồ' => 'á»’', + 'ồ' => 'ồ', + 'Ổ' => 'á»”', + 'ổ' => 'ổ', + 'Ỗ' => 'á»–', + 'ỗ' => 'á»—', + 'Ộ' => 'Ộ', + 'á»Ì‚' => 'á»™', + 'Æ Ì' => 'Ớ', + 'Æ¡Ì' => 'á»›', + 'Ờ' => 'Ờ', + 'Æ¡Ì€' => 'á»', + 'Ở' => 'Ở', + 'ở' => 'ở', + 'Ỡ' => 'á» ', + 'ỡ' => 'ỡ', + 'Ợ' => 'Ợ', + 'Æ¡Ì£' => 'ợ', + 'UÌ£' => 'Ụ', + 'uÌ£' => 'ụ', + 'Ủ' => 'Ủ', + 'ủ' => 'ủ', + 'ƯÌ' => 'Ứ', + 'Æ°Ì' => 'ứ', + 'Ừ' => 'Ừ', + 'Æ°Ì€' => 'ừ', + 'Ử' => 'Ử', + 'ử' => 'á»­', + 'Ữ' => 'á»®', + 'ữ' => 'ữ', + 'Ự' => 'á»°', + 'Æ°Ì£' => 'á»±', + 'YÌ€' => 'Ỳ', + 'yÌ€' => 'ỳ', + 'YÌ£' => 'á»´', + 'yÌ£' => 'ỵ', + 'Ỷ' => 'Ỷ', + 'ỷ' => 'á»·', + 'Ỹ' => 'Ỹ', + 'ỹ' => 'ỹ', + 'ἀ' => 'á¼€', + 'ἁ' => 'á¼', + 'ἂ' => 'ἂ', + 'á¼Ì€' => 'ἃ', + 'á¼€Ì' => 'ἄ', + 'á¼Ì' => 'á¼…', + 'ἆ' => 'ἆ', + 'á¼Í‚' => 'ἇ', + 'Ἀ' => 'Ἀ', + 'Ἁ' => 'Ἁ', + 'Ἂ' => 'Ἂ', + 'Ἃ' => 'Ἃ', + 'ἈÌ' => 'Ἄ', + 'ἉÌ' => 'á¼', + 'Ἆ' => 'Ἆ', + 'Ἇ' => 'á¼', + 'ἐ' => 'á¼', + 'ἑ' => 'ἑ', + 'á¼Ì€' => 'á¼’', + 'ἓ' => 'ἓ', + 'á¼Ì' => 'á¼”', + 'ἑÌ' => 'ἕ', + 'Ἐ' => 'Ἐ', + 'Ἑ' => 'á¼™', + 'Ἒ' => 'Ἒ', + 'Ἓ' => 'á¼›', + 'ἘÌ' => 'Ἔ', + 'á¼™Ì' => 'á¼', + 'ἠ' => 'á¼ ', + 'ἡ' => 'ἡ', + 'ἢ' => 'á¼¢', + 'ἣ' => 'á¼£', + 'á¼ Ì' => 'ἤ', + 'ἡÌ' => 'á¼¥', + 'á¼ Í‚' => 'ἦ', + 'ἧ' => 'ἧ', + 'Ἠ' => 'Ἠ', + 'Ἡ' => 'Ἡ', + 'Ἢ' => 'Ἢ', + 'Ἣ' => 'Ἣ', + 'ἨÌ' => 'Ἤ', + 'ἩÌ' => 'á¼­', + 'Ἦ' => 'á¼®', + 'Ἧ' => 'Ἧ', + 'ἰ' => 'á¼°', + 'ἱ' => 'á¼±', + 'á¼°Ì€' => 'á¼²', + 'ἳ' => 'á¼³', + 'á¼°Ì' => 'á¼´', + 'á¼±Ì' => 'á¼µ', + 'á¼°Í‚' => 'ἶ', + 'ἷ' => 'á¼·', + 'Ἰ' => 'Ἰ', + 'Ἱ' => 'á¼¹', + 'Ἲ' => 'Ἲ', + 'Ἳ' => 'á¼»', + 'ἸÌ' => 'á¼¼', + 'á¼¹Ì' => 'á¼½', + 'Ἶ' => 'á¼¾', + 'Ἷ' => 'Ἷ', + 'ὀ' => 'á½€', + 'ὁ' => 'á½', + 'ὂ' => 'ὂ', + 'á½Ì€' => 'ὃ', + 'á½€Ì' => 'ὄ', + 'á½Ì' => 'á½…', + 'Ὀ' => 'Ὀ', + 'Ὁ' => 'Ὁ', + 'Ὂ' => 'Ὂ', + 'Ὃ' => 'Ὃ', + 'ὈÌ' => 'Ὄ', + 'ὉÌ' => 'á½', + 'Ï…Ì“' => 'á½', + 'Ï…Ì”' => 'ὑ', + 'á½Ì€' => 'á½’', + 'ὓ' => 'ὓ', + 'á½Ì' => 'á½”', + 'ὑÌ' => 'ὕ', + 'á½Í‚' => 'á½–', + 'ὗ' => 'á½—', + 'Ὑ' => 'á½™', + 'Ὓ' => 'á½›', + 'á½™Ì' => 'á½', + 'Ὗ' => 'Ὗ', + 'ὠ' => 'á½ ', + 'ὡ' => 'ὡ', + 'ὢ' => 'á½¢', + 'ὣ' => 'á½£', + 'á½ Ì' => 'ὤ', + 'ὡÌ' => 'á½¥', + 'á½ Í‚' => 'ὦ', + 'ὧ' => 'ὧ', + 'Ὠ' => 'Ὠ', + 'Ὡ' => 'Ὡ', + 'Ὢ' => 'Ὢ', + 'Ὣ' => 'Ὣ', + 'ὨÌ' => 'Ὤ', + 'ὩÌ' => 'á½­', + 'Ὦ' => 'á½®', + 'Ὧ' => 'Ὧ', + 'ὰ' => 'á½°', + 'ὲ' => 'á½²', + 'ὴ' => 'á½´', + 'ὶ' => 'ὶ', + 'ὸ' => 'ὸ', + 'Ï…Ì€' => 'ὺ', + 'ὼ' => 'á½¼', + 'ᾀ' => 'á¾€', + 'á¼Í…' => 'á¾', + 'ᾂ' => 'ᾂ', + 'ᾃ' => 'ᾃ', + 'ᾄ' => 'ᾄ', + 'á¼…Í…' => 'á¾…', + 'ᾆ' => 'ᾆ', + 'ᾇ' => 'ᾇ', + 'ᾈ' => 'ᾈ', + 'ᾉ' => 'ᾉ', + 'ᾊ' => 'ᾊ', + 'ᾋ' => 'ᾋ', + 'ᾌ' => 'ᾌ', + 'á¼Í…' => 'á¾', + 'ᾎ' => 'ᾎ', + 'á¼Í…' => 'á¾', + 'á¼ Í…' => 'á¾', + 'ᾑ' => 'ᾑ', + 'ᾒ' => 'á¾’', + 'ᾓ' => 'ᾓ', + 'ᾔ' => 'á¾”', + 'ᾕ' => 'ᾕ', + 'ᾖ' => 'á¾–', + 'ᾗ' => 'á¾—', + 'ᾘ' => 'ᾘ', + 'ᾙ' => 'á¾™', + 'ᾚ' => 'ᾚ', + 'ᾛ' => 'á¾›', + 'ᾜ' => 'ᾜ', + 'á¼­Í…' => 'á¾', + 'ᾞ' => 'ᾞ', + 'ᾟ' => 'ᾟ', + 'á½ Í…' => 'á¾ ', + 'ᾡ' => 'ᾡ', + 'ᾢ' => 'á¾¢', + 'ᾣ' => 'á¾£', + 'ᾤ' => 'ᾤ', + 'ᾥ' => 'á¾¥', + 'ᾦ' => 'ᾦ', + 'ᾧ' => 'ᾧ', + 'ᾨ' => 'ᾨ', + 'ᾩ' => 'ᾩ', + 'ᾪ' => 'ᾪ', + 'ᾫ' => 'ᾫ', + 'ᾬ' => 'ᾬ', + 'á½­Í…' => 'á¾­', + 'ᾮ' => 'á¾®', + 'ᾯ' => 'ᾯ', + 'ᾰ' => 'á¾°', + 'ᾱ' => 'á¾±', + 'á½°Í…' => 'á¾²', + 'ᾳ' => 'á¾³', + 'ᾴ' => 'á¾´', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'á¾·', + 'Ᾰ' => 'Ᾰ', + 'Ᾱ' => 'á¾¹', + 'Ὰ' => 'Ὰ', + 'ᾼ' => 'á¾¼', + '῁' => 'á¿', + 'á½´Í…' => 'á¿‚', + 'ῃ' => 'ῃ', + 'ῄ' => 'á¿„', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῇ', + 'Ὲ' => 'Ὲ', + 'Ὴ' => 'á¿Š', + 'ῌ' => 'á¿Œ', + '῍' => 'á¿', + '᾿Ì' => 'á¿Ž', + '῏' => 'á¿', + 'ῐ' => 'á¿', + 'ῑ' => 'á¿‘', + 'ÏŠÌ€' => 'á¿’', + 'ῖ' => 'á¿–', + 'ÏŠÍ‚' => 'á¿—', + 'Ῐ' => 'Ῐ', + 'Ῑ' => 'á¿™', + 'Ὶ' => 'á¿š', + '῝' => 'á¿', + '῾Ì' => 'á¿ž', + '῟' => 'á¿Ÿ', + 'ῠ' => 'á¿ ', + 'Ï…Ì„' => 'á¿¡', + 'Ï‹Ì€' => 'á¿¢', + 'ÏÌ“' => 'ῤ', + 'ÏÌ”' => 'á¿¥', + 'Ï…Í‚' => 'ῦ', + 'Ï‹Í‚' => 'ῧ', + 'Ῠ' => 'Ῠ', + 'Ῡ' => 'á¿©', + 'Ὺ' => 'Ὺ', + 'Ῥ' => 'Ῥ', + '῭' => 'á¿­', + 'ῲ' => 'ῲ', + 'ῳ' => 'ῳ', + 'ÏŽÍ…' => 'á¿´', + 'ῶ' => 'ῶ', + 'ῷ' => 'á¿·', + 'Ὸ' => 'Ὸ', + 'Ὼ' => 'Ὼ', + 'ῼ' => 'ῼ', + 'â†Ì¸' => '↚', + '↛' => '↛', + '↮' => '↮', + 'â‡Ì¸' => 'â‡', + '⇎' => '⇎', + '⇏' => 'â‡', + '∄' => '∄', + '∉' => '∉', + '∌' => '∌', + '∤' => '∤', + '∦' => '∦', + '≁' => 'â‰', + '≄' => '≄', + '≇' => '≇', + '≉' => '≉', + '≠' => '≠', + '≢' => '≢', + 'â‰Ì¸' => '≭', + '≮' => '≮', + '≯' => '≯', + '≰' => '≰', + '≱' => '≱', + '≴' => '≴', + '≵' => '≵', + '≸' => '≸', + '≹' => '≹', + '⊀' => '⊀', + '⊁' => 'âŠ', + '⊄' => '⊄', + '⊅' => '⊅', + '⊈' => '⊈', + '⊉' => '⊉', + '⊬' => '⊬', + '⊭' => '⊭', + '⊮' => '⊮', + '⊯' => '⊯', + '⋠' => 'â‹ ', + '⋡' => 'â‹¡', + '⋢' => 'â‹¢', + '⋣' => 'â‹£', + '⋪' => '⋪', + '⋫' => 'â‹«', + '⋬' => '⋬', + '⋭' => 'â‹­', + 'ã‹ã‚™' => 'ãŒ', + 'ãã‚™' => 'ãŽ', + 'ãã‚™' => 'ã', + 'ã‘ã‚™' => 'ã’', + 'ã“ã‚™' => 'ã”', + 'ã•ã‚™' => 'ã–', + 'ã—ã‚™' => 'ã˜', + 'ã™ã‚™' => 'ãš', + 'ã›ã‚™' => 'ãœ', + 'ãã‚™' => 'ãž', + 'ãŸã‚™' => 'ã ', + 'ã¡ã‚™' => 'ã¢', + 'ã¤ã‚™' => 'ã¥', + 'ã¦ã‚™' => 'ã§', + 'ã¨ã‚™' => 'ã©', + 'ã¯ã‚™' => 'ã°', + 'ã¯ã‚š' => 'ã±', + 'ã²ã‚™' => 'ã³', + 'ã²ã‚š' => 'ã´', + 'ãµã‚™' => 'ã¶', + 'ãµã‚š' => 'ã·', + 'ã¸ã‚™' => 'ã¹', + 'ã¸ã‚š' => 'ãº', + 'ã»ã‚™' => 'ã¼', + 'ã»ã‚š' => 'ã½', + 'ã†ã‚™' => 'ã‚”', + 'ã‚ã‚™' => 'ã‚ž', + 'ã‚«ã‚™' => 'ガ', + 'ã‚­ã‚™' => 'ã‚®', + 'グ' => 'ã‚°', + 'ゲ' => 'ゲ', + 'ゴ' => 'ã‚´', + 'ザ' => 'ザ', + 'ã‚·ã‚™' => 'ジ', + 'ズ' => 'ズ', + 'ゼ' => 'ゼ', + 'ゾ' => 'ゾ', + 'ã‚¿ã‚™' => 'ダ', + 'ãƒã‚™' => 'ヂ', + 'ヅ' => 'ヅ', + 'デ' => 'デ', + 'ド' => 'ド', + 'ãƒã‚™' => 'ãƒ', + 'ãƒã‚š' => 'パ', + 'ビ' => 'ビ', + 'ピ' => 'ピ', + 'ブ' => 'ブ', + 'プ' => 'プ', + 'ベ' => 'ベ', + 'ペ' => 'ペ', + 'ボ' => 'ボ', + 'ポ' => 'ãƒ', + 'ヴ' => 'ヴ', + 'ヷ' => 'ヷ', + 'ヸ' => 'ヸ', + 'ヹ' => 'ヹ', + 'ヺ' => 'ヺ', + 'ヾ' => 'ヾ', + '𑂚' => 'ð‘‚š', + '𑂜' => 'ð‘‚œ', + '𑂫' => 'ð‘‚«', + '𑄮' => 'ð‘„®', + '𑄯' => '𑄯', + 'ð‘‡ð‘Œ¾' => 'ð‘‹', + 'ð‘‡ð‘—' => 'ð‘Œ', + '𑒻' => 'ð‘’»', + '𑒼' => 'ð‘’¼', + '𑒾' => 'ð‘’¾', + '𑖺' => 'ð‘–º', + '𑖻' => 'ð‘–»', + '𑤸' => '𑤸', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php new file mode 100644 index 00000000000..5a3e8e0969d --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php @@ -0,0 +1,2065 @@ + 'AÌ€', + 'Ã' => 'AÌ', + 'Â' => 'AÌ‚', + 'Ã' => 'Ã', + 'Ä' => 'Ä', + 'Ã…' => 'AÌŠ', + 'Ç' => 'Ç', + 'È' => 'EÌ€', + 'É' => 'EÌ', + 'Ê' => 'EÌ‚', + 'Ë' => 'Ë', + 'ÃŒ' => 'IÌ€', + 'Ã' => 'IÌ', + 'ÃŽ' => 'IÌ‚', + 'Ã' => 'Ï', + 'Ñ' => 'Ñ', + 'Ã’' => 'OÌ€', + 'Ó' => 'OÌ', + 'Ô' => 'OÌ‚', + 'Õ' => 'Õ', + 'Ö' => 'Ö', + 'Ù' => 'UÌ€', + 'Ú' => 'UÌ', + 'Û' => 'UÌ‚', + 'Ãœ' => 'Ü', + 'Ã' => 'YÌ', + 'à' => 'aÌ€', + 'á' => 'aÌ', + 'â' => 'aÌ‚', + 'ã' => 'ã', + 'ä' => 'ä', + 'Ã¥' => 'aÌŠ', + 'ç' => 'ç', + 'è' => 'eÌ€', + 'é' => 'eÌ', + 'ê' => 'eÌ‚', + 'ë' => 'ë', + 'ì' => 'iÌ€', + 'í' => 'iÌ', + 'î' => 'iÌ‚', + 'ï' => 'ï', + 'ñ' => 'ñ', + 'ò' => 'oÌ€', + 'ó' => 'oÌ', + 'ô' => 'oÌ‚', + 'õ' => 'õ', + 'ö' => 'ö', + 'ù' => 'uÌ€', + 'ú' => 'uÌ', + 'û' => 'uÌ‚', + 'ü' => 'ü', + 'ý' => 'yÌ', + 'ÿ' => 'ÿ', + 'Ä€' => 'AÌ„', + 'Ä' => 'aÌ„', + 'Ä‚' => 'Ă', + 'ă' => 'ă', + 'Ä„' => 'Ą', + 'Ä…' => 'ą', + 'Ć' => 'CÌ', + 'ć' => 'cÌ', + 'Ĉ' => 'CÌ‚', + 'ĉ' => 'cÌ‚', + 'ÄŠ' => 'Ċ', + 'Ä‹' => 'ċ', + 'ÄŒ' => 'CÌŒ', + 'Ä' => 'cÌŒ', + 'ÄŽ' => 'DÌŒ', + 'Ä' => 'dÌŒ', + 'Ä’' => 'EÌ„', + 'Ä“' => 'eÌ„', + 'Ä”' => 'Ĕ', + 'Ä•' => 'ĕ', + 'Ä–' => 'Ė', + 'Ä—' => 'ė', + 'Ę' => 'Ę', + 'Ä™' => 'ę', + 'Äš' => 'EÌŒ', + 'Ä›' => 'eÌŒ', + 'Äœ' => 'GÌ‚', + 'Ä' => 'gÌ‚', + 'Äž' => 'Ğ', + 'ÄŸ' => 'ğ', + 'Ä ' => 'Ġ', + 'Ä¡' => 'ġ', + 'Ä¢' => 'Ģ', + 'Ä£' => 'ģ', + 'Ĥ' => 'HÌ‚', + 'Ä¥' => 'hÌ‚', + 'Ĩ' => 'Ĩ', + 'Ä©' => 'ĩ', + 'Ī' => 'IÌ„', + 'Ä«' => 'iÌ„', + 'Ĭ' => 'Ĭ', + 'Ä­' => 'ĭ', + 'Ä®' => 'Į', + 'į' => 'į', + 'Ä°' => 'İ', + 'Ä´' => 'JÌ‚', + 'ĵ' => 'jÌ‚', + 'Ķ' => 'Ķ', + 'Ä·' => 'ķ', + 'Ĺ' => 'LÌ', + 'ĺ' => 'lÌ', + 'Ä»' => 'Ļ', + 'ļ' => 'ļ', + 'Ľ' => 'LÌŒ', + 'ľ' => 'lÌŒ', + 'Ń' => 'NÌ', + 'Å„' => 'nÌ', + 'Å…' => 'Ņ', + 'ņ' => 'ņ', + 'Ň' => 'NÌŒ', + 'ň' => 'nÌŒ', + 'ÅŒ' => 'OÌ„', + 'Å' => 'oÌ„', + 'ÅŽ' => 'Ŏ', + 'Å' => 'ŏ', + 'Å' => 'OÌ‹', + 'Å‘' => 'oÌ‹', + 'Å”' => 'RÌ', + 'Å•' => 'rÌ', + 'Å–' => 'Ŗ', + 'Å—' => 'ŗ', + 'Ř' => 'RÌŒ', + 'Å™' => 'rÌŒ', + 'Åš' => 'SÌ', + 'Å›' => 'sÌ', + 'Åœ' => 'SÌ‚', + 'Å' => 'sÌ‚', + 'Åž' => 'Ş', + 'ÅŸ' => 'ş', + 'Å ' => 'SÌŒ', + 'Å¡' => 'sÌŒ', + 'Å¢' => 'Ţ', + 'Å£' => 'ţ', + 'Ť' => 'TÌŒ', + 'Å¥' => 'tÌŒ', + 'Ũ' => 'Ũ', + 'Å©' => 'ũ', + 'Ū' => 'UÌ„', + 'Å«' => 'uÌ„', + 'Ŭ' => 'Ŭ', + 'Å­' => 'ŭ', + 'Å®' => 'UÌŠ', + 'ů' => 'uÌŠ', + 'Å°' => 'UÌ‹', + 'ű' => 'uÌ‹', + 'Ų' => 'Ų', + 'ų' => 'ų', + 'Å´' => 'WÌ‚', + 'ŵ' => 'wÌ‚', + 'Ŷ' => 'YÌ‚', + 'Å·' => 'yÌ‚', + 'Ÿ' => 'Ÿ', + 'Ź' => 'ZÌ', + 'ź' => 'zÌ', + 'Å»' => 'Ż', + 'ż' => 'ż', + 'Ž' => 'ZÌŒ', + 'ž' => 'zÌŒ', + 'Æ ' => 'OÌ›', + 'Æ¡' => 'oÌ›', + 'Ư' => 'UÌ›', + 'Æ°' => 'uÌ›', + 'Ç' => 'AÌŒ', + 'ÇŽ' => 'aÌŒ', + 'Ç' => 'IÌŒ', + 'Ç' => 'iÌŒ', + 'Ç‘' => 'OÌŒ', + 'Ç’' => 'oÌŒ', + 'Ç“' => 'UÌŒ', + 'Ç”' => 'uÌŒ', + 'Ç•' => 'Ǖ', + 'Ç–' => 'ǖ', + 'Ç—' => 'ÜÌ', + 'ǘ' => 'üÌ', + 'Ç™' => 'Ǚ', + 'Çš' => 'ǚ', + 'Ç›' => 'Ǜ', + 'Çœ' => 'ǜ', + 'Çž' => 'Ǟ', + 'ÇŸ' => 'ǟ', + 'Ç ' => 'Ǡ', + 'Ç¡' => 'ǡ', + 'Ç¢' => 'Ǣ', + 'Ç£' => 'ǣ', + 'Ǧ' => 'GÌŒ', + 'ǧ' => 'gÌŒ', + 'Ǩ' => 'KÌŒ', + 'Ç©' => 'kÌŒ', + 'Ǫ' => 'Ǫ', + 'Ç«' => 'ǫ', + 'Ǭ' => 'Ǭ', + 'Ç­' => 'ǭ', + 'Ç®' => 'Æ·ÌŒ', + 'ǯ' => 'Ê’ÌŒ', + 'Ç°' => 'jÌŒ', + 'Ç´' => 'GÌ', + 'ǵ' => 'gÌ', + 'Ǹ' => 'NÌ€', + 'ǹ' => 'nÌ€', + 'Ǻ' => 'AÌŠÌ', + 'Ç»' => 'aÌŠÌ', + 'Ǽ' => 'ÆÌ', + 'ǽ' => 'æÌ', + 'Ǿ' => 'ØÌ', + 'Ç¿' => 'øÌ', + 'È€' => 'AÌ', + 'È' => 'aÌ', + 'È‚' => 'AÌ‘', + 'ȃ' => 'aÌ‘', + 'È„' => 'EÌ', + 'È…' => 'eÌ', + 'Ȇ' => 'EÌ‘', + 'ȇ' => 'eÌ‘', + 'Ȉ' => 'IÌ', + 'ȉ' => 'iÌ', + 'ÈŠ' => 'IÌ‘', + 'È‹' => 'iÌ‘', + 'ÈŒ' => 'OÌ', + 'È' => 'oÌ', + 'ÈŽ' => 'OÌ‘', + 'È' => 'oÌ‘', + 'È' => 'RÌ', + 'È‘' => 'rÌ', + 'È’' => 'RÌ‘', + 'È“' => 'rÌ‘', + 'È”' => 'UÌ', + 'È•' => 'uÌ', + 'È–' => 'UÌ‘', + 'È—' => 'uÌ‘', + 'Ș' => 'Ș', + 'È™' => 'ș', + 'Èš' => 'Ț', + 'È›' => 'ț', + 'Èž' => 'HÌŒ', + 'ÈŸ' => 'hÌŒ', + 'Ȧ' => 'Ȧ', + 'ȧ' => 'ȧ', + 'Ȩ' => 'Ȩ', + 'È©' => 'ȩ', + 'Ȫ' => 'Ȫ', + 'È«' => 'ȫ', + 'Ȭ' => 'Ȭ', + 'È­' => 'ȭ', + 'È®' => 'Ȯ', + 'ȯ' => 'ȯ', + 'È°' => 'Ȱ', + 'ȱ' => 'ȱ', + 'Ȳ' => 'YÌ„', + 'ȳ' => 'yÌ„', + 'Í€' => 'Ì€', + 'Í' => 'Ì', + '̓' => 'Ì“', + 'Í„' => '̈Ì', + 'Í´' => 'ʹ', + ';' => ';', + 'Î…' => '¨Ì', + 'Ά' => 'ΑÌ', + '·' => '·', + 'Έ' => 'ΕÌ', + 'Ή' => 'ΗÌ', + 'Ί' => 'ΙÌ', + 'ÎŒ' => 'ΟÌ', + 'ÎŽ' => 'Î¥Ì', + 'Î' => 'ΩÌ', + 'Î' => 'ϊÌ', + 'Ϊ' => 'Ϊ', + 'Ϋ' => 'Ϋ', + 'ά' => 'αÌ', + 'έ' => 'εÌ', + 'ή' => 'ηÌ', + 'ί' => 'ιÌ', + 'ΰ' => 'ϋÌ', + 'ÏŠ' => 'ϊ', + 'Ï‹' => 'ϋ', + 'ÏŒ' => 'οÌ', + 'Ï' => 'Ï…Ì', + 'ÏŽ' => 'ωÌ', + 'Ï“' => 'Ï’Ì', + 'Ï”' => 'ϔ', + 'Ѐ' => 'Ѐ', + 'Ð' => 'Ё', + 'Ѓ' => 'ГÌ', + 'Ї' => 'Ї', + 'ÐŒ' => 'КÌ', + 'Ð' => 'Ѝ', + 'ÐŽ' => 'Ў', + 'Й' => 'Й', + 'й' => 'й', + 'Ñ' => 'ѐ', + 'Ñ‘' => 'ё', + 'Ñ“' => 'гÌ', + 'Ñ—' => 'ї', + 'Ñœ' => 'кÌ', + 'Ñ' => 'ѝ', + 'Ñž' => 'ў', + 'Ѷ' => 'Ñ´Ì', + 'Ñ·' => 'ѵÌ', + 'Ó' => 'Ӂ', + 'Ó‚' => 'ӂ', + 'Ó' => 'Ð̆', + 'Ó‘' => 'ӑ', + 'Ó’' => 'Ð̈', + 'Ó“' => 'ӓ', + 'Ó–' => 'Ӗ', + 'Ó—' => 'ӗ', + 'Óš' => 'Ӛ', + 'Ó›' => 'ӛ', + 'Óœ' => 'Ӝ', + 'Ó' => 'ӝ', + 'Óž' => 'Ӟ', + 'ÓŸ' => 'ӟ', + 'Ó¢' => 'Ӣ', + 'Ó£' => 'ӣ', + 'Ó¤' => 'Ӥ', + 'Ó¥' => 'ӥ', + 'Ó¦' => 'Ӧ', + 'Ó§' => 'ӧ', + 'Óª' => 'Ӫ', + 'Ó«' => 'ӫ', + 'Ó¬' => 'Ӭ', + 'Ó­' => 'Ñ̈', + 'Ó®' => 'Ӯ', + 'Ó¯' => 'ӯ', + 'Ó°' => 'Ӱ', + 'Ó±' => 'ӱ', + 'Ó²' => 'Ӳ', + 'Ó³' => 'ӳ', + 'Ó´' => 'Ӵ', + 'Óµ' => 'ӵ', + 'Ó¸' => 'Ӹ', + 'Ó¹' => 'ӹ', + 'Ø¢' => 'آ', + 'Ø£' => 'أ', + 'ؤ' => 'ÙˆÙ”', + 'Ø¥' => 'إ', + 'ئ' => 'ÙŠÙ”', + 'Û€' => 'Û•Ù”', + 'Û‚' => 'ÛÙ”', + 'Û“' => 'Û’Ù”', + 'ऩ' => 'ऩ', + 'ऱ' => 'ऱ', + 'ऴ' => 'ऴ', + 'क़' => 'क़', + 'ख़' => 'ख़', + 'ग़' => 'ग़', + 'ज़' => 'ज़', + 'ड़' => 'ड़', + 'à¥' => 'ढ़', + 'फ़' => 'फ़', + 'य़' => 'य़', + 'ো' => 'ো', + 'ৌ' => 'ৌ', + 'ড়' => 'ড়', + 'à§' => 'ঢ়', + 'য়' => 'য়', + 'ਲ਼' => 'ਲ਼', + 'ਸ਼' => 'ਸ਼', + 'à©™' => 'ਖ਼', + 'à©š' => 'ਗ਼', + 'à©›' => 'ਜ਼', + 'à©ž' => 'ਫ਼', + 'à­ˆ' => 'ୈ', + 'à­‹' => 'ୋ', + 'à­Œ' => 'ୌ', + 'à­œ' => 'ଡ଼', + 'à­' => 'ଢ଼', + 'à®”' => 'ஔ', + 'ொ' => 'ொ', + 'ோ' => 'ோ', + 'ௌ' => 'ௌ', + 'ై' => 'ై', + 'à³€' => 'ೀ', + 'ೇ' => 'ೇ', + 'ೈ' => 'ೈ', + 'ೊ' => 'ೊ', + 'ೋ' => 'ೋ', + 'ൊ' => 'ൊ', + 'ോ' => 'ോ', + 'ൌ' => 'ൌ', + 'à·š' => 'ේ', + 'à·œ' => 'à·™à·', + 'à·' => 'à·™à·à·Š', + 'à·ž' => 'ෞ', + 'གྷ' => 'གྷ', + 'à½' => 'ཌྷ', + 'དྷ' => 'དྷ', + 'བྷ' => 'བྷ', + 'ཛྷ' => 'ཛྷ', + 'ཀྵ' => 'ཀྵ', + 'ཱི' => 'ཱི', + 'ཱུ' => 'ཱུ', + 'ྲྀ' => 'ྲྀ', + 'ླྀ' => 'ླྀ', + 'à¾' => 'ཱྀ', + 'ྒྷ' => 'ྒྷ', + 'à¾' => 'ྜྷ', + 'ྡྷ' => 'ྡྷ', + 'ྦྷ' => 'ྦྷ', + 'ྫྷ' => 'ྫྷ', + 'ྐྵ' => 'à¾à¾µ', + 'ဦ' => 'ဦ', + 'ᬆ' => 'ᬆ', + 'ᬈ' => 'ᬈ', + 'ᬊ' => 'ᬊ', + 'ᬌ' => 'ᬌ', + 'ᬎ' => 'á¬á¬µ', + 'ᬒ' => 'ᬒ', + 'ᬻ' => 'ᬻ', + 'ᬽ' => 'ᬽ', + 'á­€' => 'ᭀ', + 'á­' => 'ᭁ', + 'á­ƒ' => 'ᭃ', + 'Ḁ' => 'AÌ¥', + 'á¸' => 'aÌ¥', + 'Ḃ' => 'Ḃ', + 'ḃ' => 'ḃ', + 'Ḅ' => 'BÌ£', + 'ḅ' => 'bÌ£', + 'Ḇ' => 'Ḇ', + 'ḇ' => 'ḇ', + 'Ḉ' => 'ÇÌ', + 'ḉ' => 'çÌ', + 'Ḋ' => 'Ḋ', + 'ḋ' => 'ḋ', + 'Ḍ' => 'DÌ£', + 'á¸' => 'dÌ£', + 'Ḏ' => 'Ḏ', + 'á¸' => 'ḏ', + 'á¸' => 'Ḑ', + 'ḑ' => 'ḑ', + 'Ḓ' => 'DÌ­', + 'ḓ' => 'dÌ­', + 'Ḕ' => 'EÌ„Ì€', + 'ḕ' => 'eÌ„Ì€', + 'Ḗ' => 'EÌ„Ì', + 'ḗ' => 'eÌ„Ì', + 'Ḙ' => 'EÌ­', + 'ḙ' => 'eÌ­', + 'Ḛ' => 'EÌ°', + 'ḛ' => 'eÌ°', + 'Ḝ' => 'Ḝ', + 'á¸' => 'ḝ', + 'Ḟ' => 'Ḟ', + 'ḟ' => 'ḟ', + 'Ḡ' => 'GÌ„', + 'ḡ' => 'gÌ„', + 'Ḣ' => 'Ḣ', + 'ḣ' => 'ḣ', + 'Ḥ' => 'HÌ£', + 'ḥ' => 'hÌ£', + 'Ḧ' => 'Ḧ', + 'ḧ' => 'ḧ', + 'Ḩ' => 'Ḩ', + 'ḩ' => 'ḩ', + 'Ḫ' => 'HÌ®', + 'ḫ' => 'hÌ®', + 'Ḭ' => 'IÌ°', + 'ḭ' => 'iÌ°', + 'Ḯ' => 'ÏÌ', + 'ḯ' => 'ïÌ', + 'Ḱ' => 'KÌ', + 'ḱ' => 'kÌ', + 'Ḳ' => 'KÌ£', + 'ḳ' => 'kÌ£', + 'Ḵ' => 'Ḵ', + 'ḵ' => 'ḵ', + 'Ḷ' => 'LÌ£', + 'ḷ' => 'lÌ£', + 'Ḹ' => 'Ḹ', + 'ḹ' => 'ḹ', + 'Ḻ' => 'Ḻ', + 'ḻ' => 'ḻ', + 'Ḽ' => 'LÌ­', + 'ḽ' => 'lÌ­', + 'Ḿ' => 'MÌ', + 'ḿ' => 'mÌ', + 'á¹€' => 'Ṁ', + 'á¹' => 'ṁ', + 'Ṃ' => 'MÌ£', + 'ṃ' => 'mÌ£', + 'Ṅ' => 'Ṅ', + 'á¹…' => 'ṅ', + 'Ṇ' => 'NÌ£', + 'ṇ' => 'nÌ£', + 'Ṉ' => 'Ṉ', + 'ṉ' => 'ṉ', + 'Ṋ' => 'NÌ­', + 'ṋ' => 'nÌ­', + 'Ṍ' => 'ÕÌ', + 'á¹' => 'õÌ', + 'Ṏ' => 'Ṏ', + 'á¹' => 'ṏ', + 'á¹' => 'OÌ„Ì€', + 'ṑ' => 'oÌ„Ì€', + 'á¹’' => 'OÌ„Ì', + 'ṓ' => 'oÌ„Ì', + 'á¹”' => 'PÌ', + 'ṕ' => 'pÌ', + 'á¹–' => 'Ṗ', + 'á¹—' => 'ṗ', + 'Ṙ' => 'Ṙ', + 'á¹™' => 'ṙ', + 'Ṛ' => 'RÌ£', + 'á¹›' => 'rÌ£', + 'Ṝ' => 'Ṝ', + 'á¹' => 'ṝ', + 'Ṟ' => 'Ṟ', + 'ṟ' => 'ṟ', + 'á¹ ' => 'Ṡ', + 'ṡ' => 'ṡ', + 'á¹¢' => 'SÌ£', + 'á¹£' => 'sÌ£', + 'Ṥ' => 'SÌ̇', + 'á¹¥' => 'sÌ̇', + 'Ṧ' => 'Ṧ', + 'ṧ' => 'ṧ', + 'Ṩ' => 'Ṩ', + 'ṩ' => 'ṩ', + 'Ṫ' => 'Ṫ', + 'ṫ' => 'ṫ', + 'Ṭ' => 'TÌ£', + 'á¹­' => 'tÌ£', + 'á¹®' => 'Ṯ', + 'ṯ' => 'ṯ', + 'á¹°' => 'TÌ­', + 'á¹±' => 'tÌ­', + 'á¹²' => 'Ṳ', + 'á¹³' => 'ṳ', + 'á¹´' => 'UÌ°', + 'á¹µ' => 'uÌ°', + 'Ṷ' => 'UÌ­', + 'á¹·' => 'uÌ­', + 'Ṹ' => 'ŨÌ', + 'á¹¹' => 'ũÌ', + 'Ṻ' => 'Ṻ', + 'á¹»' => 'ṻ', + 'á¹¼' => 'Ṽ', + 'á¹½' => 'ṽ', + 'á¹¾' => 'VÌ£', + 'ṿ' => 'vÌ£', + 'Ẁ' => 'WÌ€', + 'áº' => 'wÌ€', + 'Ẃ' => 'WÌ', + 'ẃ' => 'wÌ', + 'Ẅ' => 'Ẅ', + 'ẅ' => 'ẅ', + 'Ẇ' => 'Ẇ', + 'ẇ' => 'ẇ', + 'Ẉ' => 'WÌ£', + 'ẉ' => 'wÌ£', + 'Ẋ' => 'Ẋ', + 'ẋ' => 'ẋ', + 'Ẍ' => 'Ẍ', + 'áº' => 'ẍ', + 'Ẏ' => 'Ẏ', + 'áº' => 'ẏ', + 'áº' => 'ZÌ‚', + 'ẑ' => 'zÌ‚', + 'Ẓ' => 'ZÌ£', + 'ẓ' => 'zÌ£', + 'Ẕ' => 'Ẕ', + 'ẕ' => 'ẕ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'wÌŠ', + 'ẙ' => 'yÌŠ', + 'ẛ' => 'ẛ', + 'Ạ' => 'AÌ£', + 'ạ' => 'aÌ£', + 'Ả' => 'Ả', + 'ả' => 'ả', + 'Ấ' => 'AÌ‚Ì', + 'ấ' => 'aÌ‚Ì', + 'Ầ' => 'AÌ‚Ì€', + 'ầ' => 'aÌ‚Ì€', + 'Ẩ' => 'Ẩ', + 'ẩ' => 'ẩ', + 'Ẫ' => 'Ẫ', + 'ẫ' => 'ẫ', + 'Ậ' => 'Ậ', + 'ậ' => 'ậ', + 'Ắ' => 'ĂÌ', + 'ắ' => 'ăÌ', + 'Ằ' => 'Ằ', + 'ằ' => 'ằ', + 'Ẳ' => 'Ẳ', + 'ẳ' => 'ẳ', + 'Ẵ' => 'Ẵ', + 'ẵ' => 'ẵ', + 'Ặ' => 'Ặ', + 'ặ' => 'ặ', + 'Ẹ' => 'EÌ£', + 'ẹ' => 'eÌ£', + 'Ẻ' => 'Ẻ', + 'ẻ' => 'ẻ', + 'Ẽ' => 'Ẽ', + 'ẽ' => 'ẽ', + 'Ế' => 'EÌ‚Ì', + 'ế' => 'eÌ‚Ì', + 'Ề' => 'EÌ‚Ì€', + 'á»' => 'eÌ‚Ì€', + 'Ể' => 'Ể', + 'ể' => 'ể', + 'Ễ' => 'Ễ', + 'á»…' => 'ễ', + 'Ệ' => 'Ệ', + 'ệ' => 'ệ', + 'Ỉ' => 'Ỉ', + 'ỉ' => 'ỉ', + 'Ị' => 'IÌ£', + 'ị' => 'iÌ£', + 'Ọ' => 'OÌ£', + 'á»' => 'oÌ£', + 'Ỏ' => 'Ỏ', + 'á»' => 'ỏ', + 'á»' => 'OÌ‚Ì', + 'ố' => 'oÌ‚Ì', + 'á»’' => 'OÌ‚Ì€', + 'ồ' => 'oÌ‚Ì€', + 'á»”' => 'Ổ', + 'ổ' => 'ổ', + 'á»–' => 'Ỗ', + 'á»—' => 'ỗ', + 'Ộ' => 'Ộ', + 'á»™' => 'ộ', + 'Ớ' => 'OÌ›Ì', + 'á»›' => 'oÌ›Ì', + 'Ờ' => 'Ờ', + 'á»' => 'ờ', + 'Ở' => 'Ở', + 'ở' => 'ở', + 'á» ' => 'Ỡ', + 'ỡ' => 'ỡ', + 'Ợ' => 'Ợ', + 'ợ' => 'ợ', + 'Ụ' => 'UÌ£', + 'ụ' => 'uÌ£', + 'Ủ' => 'Ủ', + 'ủ' => 'ủ', + 'Ứ' => 'UÌ›Ì', + 'ứ' => 'uÌ›Ì', + 'Ừ' => 'Ừ', + 'ừ' => 'ừ', + 'Ử' => 'Ử', + 'á»­' => 'ử', + 'á»®' => 'Ữ', + 'ữ' => 'ữ', + 'á»°' => 'Ự', + 'á»±' => 'ự', + 'Ỳ' => 'YÌ€', + 'ỳ' => 'yÌ€', + 'á»´' => 'YÌ£', + 'ỵ' => 'yÌ£', + 'Ỷ' => 'Ỷ', + 'á»·' => 'ỷ', + 'Ỹ' => 'Ỹ', + 'ỹ' => 'ỹ', + 'á¼€' => 'ἀ', + 'á¼' => 'ἁ', + 'ἂ' => 'ἂ', + 'ἃ' => 'ἃ', + 'ἄ' => 'ἀÌ', + 'á¼…' => 'ἁÌ', + 'ἆ' => 'ἆ', + 'ἇ' => 'ἇ', + 'Ἀ' => 'Ἀ', + 'Ἁ' => 'Ἁ', + 'Ἂ' => 'Ἂ', + 'Ἃ' => 'Ἃ', + 'Ἄ' => 'ἈÌ', + 'á¼' => 'ἉÌ', + 'Ἆ' => 'Ἆ', + 'á¼' => 'Ἇ', + 'á¼' => 'ἐ', + 'ἑ' => 'ἑ', + 'á¼’' => 'ἒ', + 'ἓ' => 'ἓ', + 'á¼”' => 'ἐÌ', + 'ἕ' => 'ἑÌ', + 'Ἐ' => 'Ἐ', + 'á¼™' => 'Ἑ', + 'Ἒ' => 'Ἒ', + 'á¼›' => 'Ἓ', + 'Ἔ' => 'ἘÌ', + 'á¼' => 'ἙÌ', + 'á¼ ' => 'ἠ', + 'ἡ' => 'ἡ', + 'á¼¢' => 'ἢ', + 'á¼£' => 'ἣ', + 'ἤ' => 'ἠÌ', + 'á¼¥' => 'ἡÌ', + 'ἦ' => 'ἦ', + 'ἧ' => 'ἧ', + 'Ἠ' => 'Ἠ', + 'Ἡ' => 'Ἡ', + 'Ἢ' => 'Ἢ', + 'Ἣ' => 'Ἣ', + 'Ἤ' => 'ἨÌ', + 'á¼­' => 'ἩÌ', + 'á¼®' => 'Ἦ', + 'Ἧ' => 'Ἧ', + 'á¼°' => 'ἰ', + 'á¼±' => 'ἱ', + 'á¼²' => 'ἲ', + 'á¼³' => 'ἳ', + 'á¼´' => 'ἰÌ', + 'á¼µ' => 'ἱÌ', + 'ἶ' => 'ἶ', + 'á¼·' => 'ἷ', + 'Ἰ' => 'Ἰ', + 'á¼¹' => 'Ἱ', + 'Ἲ' => 'Ἲ', + 'á¼»' => 'Ἳ', + 'á¼¼' => 'ἸÌ', + 'á¼½' => 'ἹÌ', + 'á¼¾' => 'Ἶ', + 'Ἷ' => 'Ἷ', + 'á½€' => 'ὀ', + 'á½' => 'ὁ', + 'ὂ' => 'ὂ', + 'ὃ' => 'ὃ', + 'ὄ' => 'ὀÌ', + 'á½…' => 'ὁÌ', + 'Ὀ' => 'Ὀ', + 'Ὁ' => 'Ὁ', + 'Ὂ' => 'Ὂ', + 'Ὃ' => 'Ὃ', + 'Ὄ' => 'ὈÌ', + 'á½' => 'ὉÌ', + 'á½' => 'Ï…Ì“', + 'ὑ' => 'Ï…Ì”', + 'á½’' => 'Ï…Ì“Ì€', + 'ὓ' => 'ὓ', + 'á½”' => 'Ï…Ì“Ì', + 'ὕ' => 'Ï…Ì”Ì', + 'á½–' => 'Ï…Ì“Í‚', + 'á½—' => 'ὗ', + 'á½™' => 'Ὑ', + 'á½›' => 'Ὓ', + 'á½' => 'ὙÌ', + 'Ὗ' => 'Ὗ', + 'á½ ' => 'ὠ', + 'ὡ' => 'ὡ', + 'á½¢' => 'ὢ', + 'á½£' => 'ὣ', + 'ὤ' => 'ὠÌ', + 'á½¥' => 'ὡÌ', + 'ὦ' => 'ὦ', + 'ὧ' => 'ὧ', + 'Ὠ' => 'Ὠ', + 'Ὡ' => 'Ὡ', + 'Ὢ' => 'Ὢ', + 'Ὣ' => 'Ὣ', + 'Ὤ' => 'ὨÌ', + 'á½­' => 'ὩÌ', + 'á½®' => 'Ὦ', + 'Ὧ' => 'Ὧ', + 'á½°' => 'ὰ', + 'á½±' => 'αÌ', + 'á½²' => 'ὲ', + 'á½³' => 'εÌ', + 'á½´' => 'ὴ', + 'á½µ' => 'ηÌ', + 'ὶ' => 'ὶ', + 'á½·' => 'ιÌ', + 'ὸ' => 'ὸ', + 'á½¹' => 'οÌ', + 'ὺ' => 'Ï…Ì€', + 'á½»' => 'Ï…Ì', + 'á½¼' => 'ὼ', + 'á½½' => 'ωÌ', + 'á¾€' => 'ᾀ', + 'á¾' => 'ᾁ', + 'ᾂ' => 'ᾂ', + 'ᾃ' => 'ᾃ', + 'ᾄ' => 'ἀÌÍ…', + 'á¾…' => 'ἁÌÍ…', + 'ᾆ' => 'ᾆ', + 'ᾇ' => 'ᾇ', + 'ᾈ' => 'ᾈ', + 'ᾉ' => 'ᾉ', + 'ᾊ' => 'ᾊ', + 'ᾋ' => 'ᾋ', + 'ᾌ' => 'ἈÌÍ…', + 'á¾' => 'ἉÌÍ…', + 'ᾎ' => 'ᾎ', + 'á¾' => 'ᾏ', + 'á¾' => 'ᾐ', + 'ᾑ' => 'ᾑ', + 'á¾’' => 'ᾒ', + 'ᾓ' => 'ᾓ', + 'á¾”' => 'ἠÌÍ…', + 'ᾕ' => 'ἡÌÍ…', + 'á¾–' => 'ᾖ', + 'á¾—' => 'ᾗ', + 'ᾘ' => 'ᾘ', + 'á¾™' => 'ᾙ', + 'ᾚ' => 'ᾚ', + 'á¾›' => 'ᾛ', + 'ᾜ' => 'ἨÌÍ…', + 'á¾' => 'ἩÌÍ…', + 'ᾞ' => 'ᾞ', + 'ᾟ' => 'ᾟ', + 'á¾ ' => 'ᾠ', + 'ᾡ' => 'ᾡ', + 'á¾¢' => 'ᾢ', + 'á¾£' => 'ᾣ', + 'ᾤ' => 'ὠÌÍ…', + 'á¾¥' => 'ὡÌÍ…', + 'ᾦ' => 'ᾦ', + 'ᾧ' => 'ᾧ', + 'ᾨ' => 'ᾨ', + 'ᾩ' => 'ᾩ', + 'ᾪ' => 'ᾪ', + 'ᾫ' => 'ᾫ', + 'ᾬ' => 'ὨÌÍ…', + 'á¾­' => 'ὩÌÍ…', + 'á¾®' => 'ᾮ', + 'ᾯ' => 'ᾯ', + 'á¾°' => 'ᾰ', + 'á¾±' => 'ᾱ', + 'á¾²' => 'ᾲ', + 'á¾³' => 'ᾳ', + 'á¾´' => 'αÌÍ…', + 'ᾶ' => 'ᾶ', + 'á¾·' => 'ᾷ', + 'Ᾰ' => 'Ᾰ', + 'á¾¹' => 'Ᾱ', + 'Ὰ' => 'Ὰ', + 'á¾»' => 'ΑÌ', + 'á¾¼' => 'ᾼ', + 'á¾¾' => 'ι', + 'á¿' => '῁', + 'á¿‚' => 'ῂ', + 'ῃ' => 'ῃ', + 'á¿„' => 'ηÌÍ…', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῇ', + 'Ὲ' => 'Ὲ', + 'Έ' => 'ΕÌ', + 'á¿Š' => 'Ὴ', + 'á¿‹' => 'ΗÌ', + 'á¿Œ' => 'ῌ', + 'á¿' => '῍', + 'á¿Ž' => '᾿Ì', + 'á¿' => '῏', + 'á¿' => 'ῐ', + 'á¿‘' => 'ῑ', + 'á¿’' => 'ῒ', + 'á¿“' => 'ϊÌ', + 'á¿–' => 'ῖ', + 'á¿—' => 'ῗ', + 'Ῐ' => 'Ῐ', + 'á¿™' => 'Ῑ', + 'á¿š' => 'Ὶ', + 'á¿›' => 'ΙÌ', + 'á¿' => '῝', + 'á¿ž' => '῾Ì', + 'á¿Ÿ' => '῟', + 'á¿ ' => 'ῠ', + 'á¿¡' => 'Ï…Ì„', + 'á¿¢' => 'ῢ', + 'á¿£' => 'ϋÌ', + 'ῤ' => 'ÏÌ“', + 'á¿¥' => 'ÏÌ”', + 'ῦ' => 'Ï…Í‚', + 'ῧ' => 'ῧ', + 'Ῠ' => 'Ῠ', + 'á¿©' => 'Ῡ', + 'Ὺ' => 'Ὺ', + 'á¿«' => 'Î¥Ì', + 'Ῥ' => 'Ῥ', + 'á¿­' => '῭', + 'á¿®' => '¨Ì', + '`' => '`', + 'ῲ' => 'ῲ', + 'ῳ' => 'ῳ', + 'á¿´' => 'ωÌÍ…', + 'ῶ' => 'ῶ', + 'á¿·' => 'ῷ', + 'Ὸ' => 'Ὸ', + 'Ό' => 'ΟÌ', + 'Ὼ' => 'Ὼ', + 'á¿»' => 'ΩÌ', + 'ῼ' => 'ῼ', + '´' => '´', + ' ' => ' ', + 'â€' => ' ', + 'Ω' => 'Ω', + 'K' => 'K', + 'â„«' => 'AÌŠ', + '↚' => 'â†Ì¸', + '↛' => '↛', + '↮' => '↮', + 'â‡' => 'â‡Ì¸', + '⇎' => '⇎', + 'â‡' => '⇏', + '∄' => '∄', + '∉' => '∉', + '∌' => '∌', + '∤' => '∤', + '∦' => '∦', + 'â‰' => '≁', + '≄' => '≄', + '≇' => '≇', + '≉' => '≉', + '≠' => '≠', + '≢' => '≢', + '≭' => 'â‰Ì¸', + '≮' => '≮', + '≯' => '≯', + '≰' => '≰', + '≱' => '≱', + '≴' => '≴', + '≵' => '≵', + '≸' => '≸', + '≹' => '≹', + '⊀' => '⊀', + 'âŠ' => '⊁', + '⊄' => '⊄', + '⊅' => '⊅', + '⊈' => '⊈', + '⊉' => '⊉', + '⊬' => '⊬', + '⊭' => '⊭', + '⊮' => '⊮', + '⊯' => '⊯', + 'â‹ ' => '⋠', + 'â‹¡' => '⋡', + 'â‹¢' => '⋢', + 'â‹£' => '⋣', + '⋪' => '⋪', + 'â‹«' => '⋫', + '⋬' => '⋬', + 'â‹­' => '⋭', + '〈' => '〈', + '〉' => '〉', + 'â«œ' => 'â«Ì¸', + 'ãŒ' => 'ã‹ã‚™', + 'ãŽ' => 'ãã‚™', + 'ã' => 'ãã‚™', + 'ã’' => 'ã‘ã‚™', + 'ã”' => 'ã“ã‚™', + 'ã–' => 'ã•ã‚™', + 'ã˜' => 'ã—ã‚™', + 'ãš' => 'ã™ã‚™', + 'ãœ' => 'ã›ã‚™', + 'ãž' => 'ãã‚™', + 'ã ' => 'ãŸã‚™', + 'ã¢' => 'ã¡ã‚™', + 'ã¥' => 'ã¤ã‚™', + 'ã§' => 'ã¦ã‚™', + 'ã©' => 'ã¨ã‚™', + 'ã°' => 'ã¯ã‚™', + 'ã±' => 'ã¯ã‚š', + 'ã³' => 'ã²ã‚™', + 'ã´' => 'ã²ã‚š', + 'ã¶' => 'ãµã‚™', + 'ã·' => 'ãµã‚š', + 'ã¹' => 'ã¸ã‚™', + 'ãº' => 'ã¸ã‚š', + 'ã¼' => 'ã»ã‚™', + 'ã½' => 'ã»ã‚š', + 'ã‚”' => 'ã†ã‚™', + 'ã‚ž' => 'ã‚ã‚™', + 'ガ' => 'ã‚«ã‚™', + 'ã‚®' => 'ã‚­ã‚™', + 'ã‚°' => 'グ', + 'ゲ' => 'ゲ', + 'ã‚´' => 'ゴ', + 'ザ' => 'ザ', + 'ジ' => 'ã‚·ã‚™', + 'ズ' => 'ズ', + 'ゼ' => 'ゼ', + 'ゾ' => 'ゾ', + 'ダ' => 'ã‚¿ã‚™', + 'ヂ' => 'ãƒã‚™', + 'ヅ' => 'ヅ', + 'デ' => 'デ', + 'ド' => 'ド', + 'ãƒ' => 'ãƒã‚™', + 'パ' => 'ãƒã‚š', + 'ビ' => 'ビ', + 'ピ' => 'ピ', + 'ブ' => 'ブ', + 'プ' => 'プ', + 'ベ' => 'ベ', + 'ペ' => 'ペ', + 'ボ' => 'ボ', + 'ãƒ' => 'ポ', + 'ヴ' => 'ヴ', + 'ヷ' => 'ヷ', + 'ヸ' => 'ヸ', + 'ヹ' => 'ヹ', + 'ヺ' => 'ヺ', + 'ヾ' => 'ヾ', + '豈' => '豈', + 'ï¤' => 'æ›´', + '車' => '車', + '賈' => '賈', + '滑' => '滑', + '串' => '串', + '句' => 'å¥', + '龜' => '龜', + '龜' => '龜', + '契' => '契', + '金' => '金', + '喇' => 'å–‡', + '奈' => '奈', + 'ï¤' => '懶', + '癩' => '癩', + 'ï¤' => 'ç¾…', + 'ï¤' => '蘿', + '螺' => '螺', + '裸' => '裸', + '邏' => 'é‚', + '樂' => '樂', + '洛' => 'æ´›', + '烙' => '烙', + '珞' => 'çž', + '落' => 'è½', + '酪' => 'é…ª', + '駱' => '駱', + '亂' => '亂', + '卵' => 'åµ', + 'ï¤' => '欄', + '爛' => '爛', + '蘭' => '蘭', + '鸞' => '鸞', + '嵐' => 'åµ', + '濫' => 'æ¿«', + '藍' => 'è—', + '襤' => '襤', + '拉' => '拉', + '臘' => '臘', + '蠟' => 'è Ÿ', + '廊' => '廊', + '朗' => '朗', + '浪' => '浪', + '狼' => '狼', + '郎' => '郎', + '來' => '來', + '冷' => '冷', + '勞' => 'å‹ž', + '擄' => 'æ“„', + '櫓' => 'æ«“', + '爐' => 'çˆ', + '盧' => '盧', + '老' => 'è€', + '蘆' => '蘆', + '虜' => '虜', + '路' => 'è·¯', + '露' => '露', + '魯' => 'é­¯', + '鷺' => 'é·º', + '碌' => '碌', + '祿' => '祿', + '綠' => '綠', + '菉' => 'è‰', + '錄' => '錄', + '鹿' => '鹿', + 'ï¥' => 'è«–', + '壟' => '壟', + '弄' => '弄', + '籠' => 'ç± ', + '聾' => 'è¾', + '牢' => '牢', + '磊' => '磊', + '賂' => '賂', + '雷' => 'é›·', + '壘' => '壘', + '屢' => 'å±¢', + '樓' => '樓', + 'ï¥' => 'æ·š', + '漏' => 'æ¼', + 'ï¥' => 'ç´¯', + 'ï¥' => '縷', + '陋' => '陋', + '勒' => 'å‹’', + '肋' => 'è‚‹', + '凜' => '凜', + '凌' => '凌', + '稜' => '稜', + '綾' => '綾', + '菱' => 'è±', + '陵' => '陵', + '讀' => '讀', + '拏' => 'æ‹', + '樂' => '樂', + 'ï¥' => '諾', + '丹' => '丹', + '寧' => '寧', + '怒' => '怒', + '率' => '率', + '異' => 'ç•°', + '北' => '北', + '磻' => '磻', + '便' => '便', + '復' => '復', + '不' => 'ä¸', + '泌' => '泌', + '數' => '數', + '索' => 'ç´¢', + '參' => 'åƒ', + '塞' => 'å¡ž', + '省' => 'çœ', + '葉' => '葉', + '說' => '說', + '殺' => '殺', + '辰' => 'è¾°', + '沈' => '沈', + '拾' => '拾', + '若' => 'è‹¥', + '掠' => '掠', + '略' => 'ç•¥', + '亮' => '亮', + '兩' => 'å…©', + '凉' => '凉', + '梁' => 'æ¢', + '糧' => '糧', + '良' => '良', + '諒' => 'è«’', + '量' => 'é‡', + '勵' => '勵', + '呂' => 'å‘‚', + 'ï¦' => '女', + '廬' => '廬', + '旅' => 'æ—…', + '濾' => '濾', + '礪' => '礪', + '閭' => 'é–­', + '驪' => '驪', + '麗' => '麗', + '黎' => '黎', + '力' => '力', + '曆' => '曆', + '歷' => 'æ­·', + 'ï¦' => 'è½¢', + '年' => 'å¹´', + 'ï¦' => 'æ†', + 'ï¦' => '戀', + '撚' => 'æ’š', + '漣' => 'æ¼£', + '煉' => 'ç…‰', + '璉' => 'ç’‰', + '秊' => '秊', + '練' => 'ç·´', + '聯' => 'è¯', + '輦' => '輦', + '蓮' => 'è“®', + '連' => '連', + '鍊' => 'éŠ', + '列' => '列', + 'ï¦' => '劣', + '咽' => 'å’½', + '烈' => '烈', + '裂' => '裂', + '說' => '說', + '廉' => '廉', + '念' => '念', + '捻' => 'æ»', + '殮' => 'æ®®', + '簾' => 'ç°¾', + '獵' => 'çµ', + '令' => '令', + '囹' => '囹', + '寧' => '寧', + '嶺' => '嶺', + '怜' => '怜', + '玲' => '玲', + '瑩' => 'ç‘©', + '羚' => '羚', + '聆' => 'è†', + '鈴' => '鈴', + '零' => '零', + '靈' => 'éˆ', + '領' => 'é ˜', + '例' => '例', + '禮' => '禮', + '醴' => '醴', + '隸' => '隸', + '惡' => '惡', + '了' => '了', + '僚' => '僚', + '寮' => '寮', + '尿' => 'å°¿', + '料' => 'æ–™', + '樂' => '樂', + '燎' => '燎', + 'ï§' => '療', + '蓼' => '蓼', + '遼' => 'é¼', + '龍' => 'é¾', + '暈' => '暈', + '阮' => '阮', + '劉' => '劉', + '杻' => 'æ»', + '柳' => '柳', + '流' => 'æµ', + '溜' => '溜', + '琉' => 'ç‰', + 'ï§' => 'ç•™', + '硫' => 'ç¡«', + 'ï§' => 'ç´', + 'ï§' => 'é¡ž', + '六' => 'å…­', + '戮' => '戮', + '陸' => '陸', + '倫' => '倫', + '崙' => 'å´™', + '淪' => 'æ·ª', + '輪' => '輪', + '律' => '律', + '慄' => 'æ…„', + '栗' => 'æ —', + '率' => '率', + '隆' => '隆', + 'ï§' => '利', + '吏' => 'å', + '履' => 'å±¥', + '易' => '易', + '李' => 'æŽ', + '梨' => '梨', + '泥' => 'æ³¥', + '理' => 'ç†', + '痢' => 'ç—¢', + '罹' => 'ç½¹', + '裏' => 'è£', + '裡' => '裡', + '里' => '里', + '離' => '離', + '匿' => '匿', + '溺' => '溺', + '吝' => 'å', + '燐' => 'ç‡', + '璘' => 'ç’˜', + '藺' => 'è—º', + '隣' => '隣', + '鱗' => 'é±—', + '麟' => '麟', + '林' => 'æž—', + '淋' => 'æ·‹', + '臨' => '臨', + '立' => 'ç«‹', + '笠' => '笠', + '粒' => 'ç²’', + '狀' => 'ç‹€', + '炙' => 'ç‚™', + '識' => 'è­˜', + '什' => '什', + '茶' => '茶', + '刺' => '刺', + '切' => '切', + 'ï¨' => '度', + '拓' => 'æ‹“', + '糖' => 'ç³–', + '宅' => 'å®…', + '洞' => 'æ´ž', + '暴' => 'æš´', + '輻' => 'è¼»', + '行' => 'è¡Œ', + '降' => 'é™', + '見' => '見', + '廓' => '廓', + '兀' => 'å…€', + 'ï¨' => 'å—€', + 'ï¨' => 'å¡š', + '晴' => 'æ™´', + '凞' => '凞', + '猪' => '猪', + '益' => '益', + '礼' => '礼', + '神' => '神', + '祥' => '祥', + '福' => 'ç¦', + '靖' => 'é–', + 'ï¨' => 'ç²¾', + '羽' => 'ç¾½', + '蘒' => '蘒', + '諸' => '諸', + '逸' => '逸', + '都' => '都', + '飯' => '飯', + '飼' => '飼', + '館' => '館', + '鶴' => '鶴', + '郞' => '郞', + '隷' => 'éš·', + '侮' => 'ä¾®', + '僧' => '僧', + '免' => 'å…', + '勉' => '勉', + '勤' => '勤', + '卑' => 'å‘', + '喝' => 'å–', + '嘆' => '嘆', + '器' => '器', + '塀' => 'å¡€', + '墨' => '墨', + '層' => '層', + '屮' => 'å±®', + '悔' => 'æ‚”', + '慨' => 'æ…¨', + '憎' => '憎', + 'ï©€' => '懲', + 'ï©' => 'æ•', + 'ï©‚' => 'æ—¢', + '暑' => 'æš‘', + 'ï©„' => '梅', + 'ï©…' => 'æµ·', + '渚' => '渚', + '漢' => 'æ¼¢', + '煮' => 'ç…®', + '爫' => '爫', + 'ï©Š' => 'ç¢', + 'ï©‹' => '碑', + 'ï©Œ' => '社', + 'ï©' => '祉', + 'ï©Ž' => '祈', + 'ï©' => 'ç¥', + 'ï©' => '祖', + 'ï©‘' => 'ç¥', + 'ï©’' => 'ç¦', + 'ï©“' => '禎', + 'ï©”' => 'ç©€', + 'ï©•' => 'çª', + 'ï©–' => '節', + 'ï©—' => 'ç·´', + '縉' => '縉', + 'ï©™' => 'ç¹', + 'ï©š' => 'ç½²', + 'ï©›' => '者', + 'ï©œ' => '臭', + 'ï©' => '艹', + 'ï©ž' => '艹', + 'ï©Ÿ' => 'è‘—', + 'ï© ' => 'è¤', + 'ï©¡' => '視', + 'ï©¢' => 'è¬', + 'ï©£' => '謹', + '賓' => '賓', + 'ï©¥' => 'è´ˆ', + '辶' => '辶', + '逸' => '逸', + '難' => '難', + 'ï©©' => '響', + '頻' => 'é »', + 'ï©«' => 'æµ', + '𤋮' => '𤋮', + 'ï©­' => '舘', + 'ï©°' => '並', + '况' => '况', + '全' => 'å…¨', + '侀' => 'ä¾€', + 'ï©´' => 'å……', + '冀' => '冀', + '勇' => '勇', + 'ï©·' => '勺', + '喝' => 'å–', + '啕' => 'å••', + '喙' => 'å–™', + 'ï©»' => 'å—¢', + '塚' => 'å¡š', + '墳' => '墳', + '奄' => '奄', + 'ï©¿' => '奔', + '婢' => 'å©¢', + 'ïª' => '嬨', + '廒' => 'å»’', + '廙' => 'å»™', + '彩' => '彩', + '徭' => 'å¾­', + '惘' => '惘', + '慎' => 'æ…Ž', + '愈' => '愈', + '憎' => '憎', + '慠' => 'æ… ', + '懲' => '懲', + '戴' => '戴', + 'ïª' => 'æ„', + '搜' => 'æœ', + 'ïª' => 'æ‘’', + 'ïª' => 'æ•–', + '晴' => 'æ™´', + '朗' => '朗', + '望' => '望', + '杖' => 'æ–', + '歹' => 'æ­¹', + '殺' => '殺', + '流' => 'æµ', + '滛' => 'æ»›', + '滋' => '滋', + '漢' => 'æ¼¢', + '瀞' => '瀞', + '煮' => 'ç…®', + 'ïª' => '瞧', + '爵' => '爵', + '犯' => '犯', + '猪' => '猪', + '瑱' => '瑱', + '甆' => '甆', + '画' => 'ç”»', + '瘝' => 'ç˜', + '瘟' => '瘟', + '益' => '益', + '盛' => 'ç››', + '直' => 'ç›´', + '睊' => 'çŠ', + '着' => 'ç€', + '磌' => '磌', + '窱' => '窱', + '節' => '節', + '类' => 'ç±»', + '絛' => 'çµ›', + '練' => 'ç·´', + '缾' => 'ç¼¾', + '者' => '者', + '荒' => 'è’', + '華' => 'è¯', + '蝹' => 'è¹', + '襁' => 'è¥', + '覆' => '覆', + '視' => '視', + '調' => '調', + '諸' => '諸', + '請' => 'è«‹', + '謁' => 'è¬', + '諾' => '諾', + '諭' => 'è«­', + '謹' => '謹', + 'ï«€' => '變', + 'ï«' => 'è´ˆ', + 'ï«‚' => '輸', + '遲' => 'é²', + 'ï«„' => '醙', + 'ï«…' => '鉶', + '陼' => '陼', + '難' => '難', + '靖' => 'é–', + '韛' => '韛', + 'ï«Š' => '響', + 'ï«‹' => 'é ‹', + 'ï«Œ' => 'é »', + 'ï«' => '鬒', + 'ï«Ž' => '龜', + 'ï«' => '𢡊', + 'ï«' => '𢡄', + 'ï«‘' => 'ð£•', + 'ï«’' => 'ã®', + 'ï«“' => '䀘', + 'ï«”' => '䀹', + 'ï«•' => '𥉉', + 'ï«–' => 'ð¥³', + 'ï«—' => '𧻓', + '齃' => '齃', + 'ï«™' => '龎', + 'ï¬' => '×™Ö´', + 'ײַ' => 'ײַ', + 'שׁ' => 'ש×', + 'שׂ' => 'שׂ', + 'שּׁ' => 'שּ×', + 'שּׂ' => 'שּׂ', + 'אַ' => '×Ö·', + 'אָ' => '×Ö¸', + 'אּ' => '×Ö¼', + 'בּ' => 'בּ', + 'גּ' => '×’Ö¼', + 'דּ' => 'דּ', + 'הּ' => '×”Ö¼', + 'וּ' => 'וּ', + 'זּ' => '×–Ö¼', + 'טּ' => 'טּ', + 'יּ' => '×™Ö¼', + 'ךּ' => 'ךּ', + 'כּ' => '×›Ö¼', + 'לּ' => 'לּ', + 'מּ' => 'מּ', + 'ï­€' => '× Ö¼', + 'ï­' => 'סּ', + 'ï­ƒ' => '×£Ö¼', + 'ï­„' => 'פּ', + 'ï­†' => 'צּ', + 'ï­‡' => 'קּ', + 'ï­ˆ' => 'רּ', + 'ï­‰' => 'שּ', + 'ï­Š' => 'תּ', + 'ï­‹' => 'וֹ', + 'ï­Œ' => 'בֿ', + 'ï­' => '×›Ö¿', + 'ï­Ž' => 'פֿ', + 'ð‘‚š' => '𑂚', + 'ð‘‚œ' => '𑂜', + 'ð‘‚«' => '𑂫', + 'ð‘„®' => '𑄮', + '𑄯' => '𑄯', + 'ð‘‹' => 'ð‘‡ð‘Œ¾', + 'ð‘Œ' => 'ð‘‡ð‘—', + 'ð‘’»' => '𑒻', + 'ð‘’¼' => '𑒼', + 'ð‘’¾' => '𑒾', + 'ð‘–º' => '𑖺', + 'ð‘–»' => '𑖻', + '𑤸' => '𑤸', + 'ð…ž' => 'ð…—ð…¥', + 'ð…Ÿ' => 'ð…˜ð…¥', + 'ð… ' => 'ð…˜ð…¥ð…®', + 'ð…¡' => 'ð…˜ð…¥ð…¯', + 'ð…¢' => 'ð…˜ð…¥ð…°', + 'ð…£' => 'ð…˜ð…¥ð…±', + 'ð…¤' => 'ð…˜ð…¥ð…²', + 'ð†»' => 'ð†¹ð…¥', + 'ð†¼' => 'ð†ºð…¥', + 'ð†½' => 'ð†¹ð…¥ð…®', + 'ð†¾' => 'ð†ºð…¥ð…®', + 'ð†¿' => 'ð†¹ð…¥ð…¯', + 'ð‡€' => 'ð†ºð…¥ð…¯', + '丽' => '丽', + 'ð¯ ' => '丸', + '乁' => 'ä¹', + '𠄢' => 'ð „¢', + '你' => 'ä½ ', + '侮' => 'ä¾®', + '侻' => 'ä¾»', + '倂' => '倂', + '偺' => 'åº', + '備' => 'å‚™', + '僧' => '僧', + '像' => 'åƒ', + '㒞' => 'ã’ž', + 'ð¯ ' => '𠘺', + '免' => 'å…', + 'ð¯ ' => 'å…”', + 'ð¯ ' => 'å…¤', + '具' => 'å…·', + '𠔜' => '𠔜', + '㒹' => 'ã’¹', + '內' => 'å…§', + '再' => 'å†', + '𠕋' => 'ð •‹', + '冗' => '冗', + '冤' => '冤', + '仌' => '仌', + '冬' => '冬', + '况' => '况', + '𩇟' => '𩇟', + 'ð¯ ' => '凵', + '刃' => '刃', + '㓟' => 'ã“Ÿ', + '刻' => '刻', + '剆' => '剆', + '割' => '割', + '剷' => '剷', + '㔕' => '㔕', + '勇' => '勇', + '勉' => '勉', + '勤' => '勤', + '勺' => '勺', + '包' => '包', + '匆' => '匆', + '北' => '北', + '卉' => 'å‰', + '卑' => 'å‘', + '博' => 'åš', + '即' => 'å³', + '卽' => 'å½', + '卿' => 'å¿', + '卿' => 'å¿', + '卿' => 'å¿', + '𠨬' => '𠨬', + '灰' => 'ç°', + '及' => 'åŠ', + '叟' => 'åŸ', + '𠭣' => 'ð ­£', + '叫' => 'å«', + '叱' => 'å±', + '吆' => 'å†', + '咞' => 'å’ž', + '吸' => 'å¸', + '呈' => '呈', + '周' => '周', + '咢' => 'å’¢', + 'ð¯¡' => '哶', + '唐' => 'å”', + '啓' => 'å•“', + '啣' => 'å•£', + '善' => 'å–„', + '善' => 'å–„', + '喙' => 'å–™', + '喫' => 'å–«', + '喳' => 'å–³', + '嗂' => 'å—‚', + '圖' => '圖', + '嘆' => '嘆', + 'ð¯¡' => '圗', + '噑' => '噑', + 'ð¯¡' => 'å™´', + 'ð¯¡' => '切', + '壮' => '壮', + '城' => '城', + '埴' => '埴', + '堍' => 'å ', + '型' => 'åž‹', + '堲' => 'å ²', + '報' => 'å ±', + '墬' => '墬', + '𡓤' => '𡓤', + '売' => '売', + '壷' => '壷', + '夆' => '夆', + 'ð¯¡' => '多', + '夢' => '夢', + '奢' => '奢', + '𡚨' => '𡚨', + '𡛪' => '𡛪', + '姬' => '姬', + '娛' => '娛', + '娧' => '娧', + '姘' => '姘', + '婦' => '婦', + '㛮' => 'ã›®', + '㛼' => '㛼', + '嬈' => '嬈', + '嬾' => '嬾', + '嬾' => '嬾', + '𡧈' => '𡧈', + '寃' => '寃', + '寘' => '寘', + '寧' => '寧', + '寳' => '寳', + '𡬘' => '𡬘', + '寿' => '寿', + '将' => 'å°†', + '当' => '当', + '尢' => 'å°¢', + '㞁' => 'ãž', + '屠' => 'å± ', + '屮' => 'å±®', + '峀' => 'å³€', + '岍' => 'å²', + '𡷤' => 'ð¡·¤', + '嵃' => '嵃', + '𡷦' => 'ð¡·¦', + '嵮' => 'åµ®', + '嵫' => '嵫', + '嵼' => 'åµ¼', + 'ð¯¢' => 'å·¡', + '巢' => 'å·¢', + '㠯' => 'ã ¯', + '巽' => 'å·½', + '帨' => '帨', + '帽' => '帽', + '幩' => '幩', + '㡢' => 'ã¡¢', + '𢆃' => '𢆃', + '㡼' => '㡼', + '庰' => '庰', + '庳' => '庳', + 'ð¯¢' => '庶', + '廊' => '廊', + 'ð¯¢' => '𪎒', + 'ð¯¢' => '廾', + '𢌱' => '𢌱', + '𢌱' => '𢌱', + '舁' => 'èˆ', + '弢' => 'å¼¢', + '弢' => 'å¼¢', + '㣇' => '㣇', + '𣊸' => '𣊸', + '𦇚' => '𦇚', + '形' => 'å½¢', + '彫' => '彫', + '㣣' => '㣣', + '徚' => '徚', + 'ð¯¢' => 'å¿', + '志' => 'å¿—', + '忹' => '忹', + '悁' => 'æ‚', + '㤺' => '㤺', + '㤜' => '㤜', + '悔' => 'æ‚”', + '𢛔' => '𢛔', + '惇' => '惇', + '慈' => 'æ…ˆ', + '慌' => 'æ…Œ', + '慎' => 'æ…Ž', + '慌' => 'æ…Œ', + '慺' => 'æ…º', + '憎' => '憎', + '憲' => '憲', + '憤' => '憤', + '憯' => '憯', + '懞' => '懞', + '懲' => '懲', + '懶' => '懶', + '成' => 'æˆ', + '戛' => '戛', + '扝' => 'æ‰', + '抱' => '抱', + '拔' => 'æ‹”', + '捐' => 'æ', + '𢬌' => '𢬌', + '挽' => '挽', + '拼' => '拼', + '捨' => 'æ¨', + '掃' => '掃', + '揤' => 'æ¤', + '𢯱' => '𢯱', + '搢' => 'æ¢', + '揅' => 'æ…', + 'ð¯£' => '掩', + '㨮' => '㨮', + '摩' => 'æ‘©', + '摾' => '摾', + '撝' => 'æ’', + '摷' => 'æ‘·', + '㩬' => '㩬', + '敏' => 'æ•', + '敬' => '敬', + '𣀊' => '𣀊', + '旣' => 'æ—£', + '書' => '書', + 'ð¯£' => '晉', + '㬙' => '㬙', + 'ð¯£' => 'æš‘', + 'ð¯£' => '㬈', + '㫤' => '㫤', + '冒' => '冒', + '冕' => '冕', + '最' => '最', + '暜' => 'æšœ', + '肭' => 'è‚­', + '䏙' => 'ä™', + '朗' => '朗', + '望' => '望', + '朡' => '朡', + '杞' => 'æž', + '杓' => 'æ“', + 'ð¯£' => 'ð£ƒ', + '㭉' => 'ã­‰', + '柺' => '柺', + '枅' => 'æž…', + '桒' => 'æ¡’', + '梅' => '梅', + '𣑭' => '𣑭', + '梎' => '梎', + '栟' => 'æ Ÿ', + '椔' => '椔', + '㮝' => 'ã®', + '楂' => '楂', + '榣' => '榣', + '槪' => '槪', + '檨' => '檨', + '𣚣' => '𣚣', + '櫛' => 'æ«›', + '㰘' => 'ã°˜', + '次' => '次', + '𣢧' => '𣢧', + '歔' => 'æ­”', + '㱎' => '㱎', + '歲' => 'æ­²', + '殟' => '殟', + '殺' => '殺', + '殻' => 'æ®»', + '𣪍' => 'ð£ª', + '𡴋' => 'ð¡´‹', + '𣫺' => '𣫺', + '汎' => '汎', + '𣲼' => '𣲼', + '沿' => '沿', + '泍' => 'æ³', + '汧' => '汧', + '洖' => 'æ´–', + '派' => 'æ´¾', + 'ð¯¤' => 'æµ·', + '流' => 'æµ', + '浩' => '浩', + '浸' => '浸', + '涅' => '涅', + '𣴞' => '𣴞', + '洴' => 'æ´´', + '港' => '港', + '湮' => 'æ¹®', + '㴳' => 'ã´³', + '滋' => '滋', + '滇' => '滇', + 'ð¯¤' => '𣻑', + '淹' => 'æ·¹', + 'ð¯¤' => 'æ½®', + 'ð¯¤' => '𣽞', + '𣾎' => '𣾎', + '濆' => '濆', + '瀹' => '瀹', + '瀞' => '瀞', + '瀛' => '瀛', + '㶖' => '㶖', + '灊' => 'çŠ', + '災' => 'ç½', + '灷' => 'ç·', + '炭' => 'ç‚­', + '𠔥' => '𠔥', + '煅' => 'ç……', + 'ð¯¤' => '𤉣', + '熜' => '熜', + '𤎫' => '𤎫', + '爨' => '爨', + '爵' => '爵', + '牐' => 'ç‰', + '𤘈' => '𤘈', + '犀' => '犀', + '犕' => '犕', + '𤜵' => '𤜵', + '𤠔' => '𤠔', + '獺' => 'çº', + '王' => '王', + '㺬' => '㺬', + '玥' => '玥', + '㺸' => '㺸', + '㺸' => '㺸', + '瑇' => '瑇', + '瑜' => 'ç‘œ', + '瑱' => '瑱', + '璅' => 'ç’…', + '瓊' => 'ç“Š', + '㼛' => 'ã¼›', + '甤' => '甤', + '𤰶' => '𤰶', + '甾' => '甾', + '𤲒' => '𤲒', + '異' => 'ç•°', + '𢆟' => '𢆟', + '瘐' => 'ç˜', + '𤾡' => '𤾡', + '𤾸' => '𤾸', + '𥁄' => 'ð¥„', + '㿼' => '㿼', + '䀈' => '䀈', + '直' => 'ç›´', + 'ð¯¥' => '𥃳', + '𥃲' => '𥃲', + '𥄙' => '𥄙', + '𥄳' => '𥄳', + '眞' => '眞', + '真' => '真', + '真' => '真', + '睊' => 'çŠ', + '䀹' => '䀹', + '瞋' => 'çž‹', + '䁆' => 'ä†', + '䂖' => 'ä‚–', + 'ð¯¥' => 'ð¥', + '硎' => 'ç¡Ž', + 'ð¯¥' => '碌', + 'ð¯¥' => '磌', + '䃣' => '䃣', + '𥘦' => '𥘦', + '祖' => '祖', + '𥚚' => '𥚚', + '𥛅' => '𥛅', + '福' => 'ç¦', + '秫' => '秫', + '䄯' => '䄯', + '穀' => 'ç©€', + '穊' => 'ç©Š', + '穏' => 'ç©', + '𥥼' => '𥥼', + 'ð¯¥' => '𥪧', + '𥪧' => '𥪧', + '竮' => 'ç«®', + '䈂' => '䈂', + '𥮫' => '𥮫', + '篆' => '篆', + '築' => '築', + '䈧' => '䈧', + '𥲀' => '𥲀', + '糒' => 'ç³’', + '䊠' => '䊠', + '糨' => '糨', + '糣' => 'ç³£', + '紀' => 'ç´€', + '𥾆' => '𥾆', + '絣' => 'çµ£', + '䌁' => 'äŒ', + '緇' => 'ç·‡', + '縂' => '縂', + '繅' => 'ç¹…', + '䌴' => '䌴', + '𦈨' => '𦈨', + '𦉇' => '𦉇', + '䍙' => 'ä™', + '𦋙' => '𦋙', + '罺' => '罺', + '𦌾' => '𦌾', + '羕' => '羕', + '翺' => '翺', + '者' => '者', + '𦓚' => '𦓚', + '𦔣' => '𦔣', + '聠' => 'è ', + '𦖨' => '𦖨', + '聰' => 'è°', + '𣍟' => 'ð£Ÿ', + 'ð¯¦' => 'ä•', + '育' => '育', + '脃' => '脃', + '䐋' => 'ä‹', + '脾' => '脾', + '媵' => '媵', + '𦞧' => '𦞧', + '𦞵' => '𦞵', + '𣎓' => '𣎓', + '𣎜' => '𣎜', + '舁' => 'èˆ', + '舄' => '舄', + 'ð¯¦' => '辞', + '䑫' => 'ä‘«', + 'ð¯¦' => '芑', + 'ð¯¦' => '芋', + '芝' => 'èŠ', + '劳' => '劳', + '花' => '花', + '芳' => '芳', + '芽' => '芽', + '苦' => '苦', + '𦬼' => '𦬼', + '若' => 'è‹¥', + '茝' => 'èŒ', + '荣' => 'è£', + '莭' => '莭', + '茣' => '茣', + 'ð¯¦' => '莽', + '菧' => 'è§', + '著' => 'è‘—', + '荓' => 'è“', + '菊' => 'èŠ', + '菌' => 'èŒ', + '菜' => 'èœ', + '𦰶' => '𦰶', + '𦵫' => '𦵫', + '𦳕' => '𦳕', + '䔫' => '䔫', + '蓱' => '蓱', + '蓳' => '蓳', + '蔖' => 'è”–', + '𧏊' => 'ð§Š', + '蕤' => '蕤', + '𦼬' => '𦼬', + '䕝' => 'ä•', + '䕡' => 'ä•¡', + '𦾱' => '𦾱', + '𧃒' => '𧃒', + '䕫' => 'ä•«', + '虐' => 'è™', + '虜' => '虜', + '虧' => '虧', + '虩' => '虩', + '蚩' => 'èš©', + '蚈' => '蚈', + '蜎' => '蜎', + '蛢' => '蛢', + '蝹' => 'è¹', + '蜨' => '蜨', + '蝫' => 'è«', + '螆' => '螆', + '䗗' => 'ä——', + '蟡' => '蟡', + 'ð¯§' => 'è ', + '䗹' => 'ä—¹', + '衠' => 'è¡ ', + '衣' => 'è¡£', + '𧙧' => '𧙧', + '裗' => '裗', + '裞' => '裞', + '䘵' => '䘵', + '裺' => '裺', + '㒻' => 'ã’»', + '𧢮' => '𧢮', + '𧥦' => '𧥦', + 'ð¯§' => 'äš¾', + '䛇' => '䛇', + 'ð¯§' => '誠', + 'ð¯§' => 'è«­', + '變' => '變', + '豕' => '豕', + '𧲨' => '𧲨', + '貫' => '貫', + '賁' => 'è³', + '贛' => 'è´›', + '起' => 'èµ·', + '𧼯' => '𧼯', + '𠠄' => 'ð  „', + '跋' => 'è·‹', + '趼' => '趼', + '跰' => 'è·°', + 'ð¯§' => '𠣞', + '軔' => 'è»”', + '輸' => '輸', + '𨗒' => '𨗒', + '𨗭' => '𨗭', + '邔' => 'é‚”', + '郱' => '郱', + '鄑' => 'é„‘', + '𨜮' => '𨜮', + '鄛' => 'é„›', + '鈸' => '鈸', + '鋗' => 'é‹—', + '鋘' => '鋘', + '鉼' => '鉼', + '鏹' => 'é¹', + '鐕' => 'é•', + '𨯺' => '𨯺', + '開' => 'é–‹', + '䦕' => '䦕', + '閷' => 'é–·', + '𨵷' => '𨵷', + '䧦' => '䧦', + '雃' => '雃', + '嶲' => '嶲', + '霣' => '霣', + '𩅅' => 'ð©……', + '𩈚' => '𩈚', + '䩮' => 'ä©®', + '䩶' => '䩶', + '韠' => '韠', + '𩐊' => 'ð©Š', + '䪲' => '䪲', + '𩒖' => 'ð©’–', + '頋' => 'é ‹', + '頋' => 'é ‹', + '頩' => 'é ©', + 'ð¯¨' => 'ð©–¶', + '飢' => '飢', + '䬳' => '䬳', + '餩' => '餩', + '馧' => '馧', + '駂' => '駂', + '駾' => '駾', + '䯎' => '䯎', + '𩬰' => '𩬰', + '鬒' => '鬒', + '鱀' => 'é±€', + '鳽' => 'é³½', + 'ð¯¨' => '䳎', + '䳭' => 'ä³­', + 'ð¯¨' => '鵧', + 'ð¯¨' => '𪃎', + '䳸' => '䳸', + '𪄅' => '𪄅', + '𪈎' => '𪈎', + '𪊑' => '𪊑', + '麻' => '麻', + '䵖' => 'äµ–', + '黹' => '黹', + '黾' => '黾', + '鼅' => 'é¼…', + '鼏' => 'é¼', + '鼖' => 'é¼–', + '鼻' => 'é¼»', + 'ð¯¨' => '𪘀', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php new file mode 100644 index 00000000000..ec90f36eb65 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php @@ -0,0 +1,876 @@ + 230, + 'Ì' => 230, + 'Ì‚' => 230, + '̃' => 230, + 'Ì„' => 230, + 'Ì…' => 230, + '̆' => 230, + '̇' => 230, + '̈' => 230, + '̉' => 230, + 'ÌŠ' => 230, + 'Ì‹' => 230, + 'ÌŒ' => 230, + 'Ì' => 230, + 'ÌŽ' => 230, + 'Ì' => 230, + 'Ì' => 230, + 'Ì‘' => 230, + 'Ì’' => 230, + 'Ì“' => 230, + 'Ì”' => 230, + 'Ì•' => 232, + 'Ì–' => 220, + 'Ì—' => 220, + '̘' => 220, + 'Ì™' => 220, + 'Ìš' => 232, + 'Ì›' => 216, + 'Ìœ' => 220, + 'Ì' => 220, + 'Ìž' => 220, + 'ÌŸ' => 220, + 'Ì ' => 220, + 'Ì¡' => 202, + 'Ì¢' => 202, + 'Ì£' => 220, + '̤' => 220, + 'Ì¥' => 220, + '̦' => 220, + '̧' => 202, + '̨' => 202, + 'Ì©' => 220, + '̪' => 220, + 'Ì«' => 220, + '̬' => 220, + 'Ì­' => 220, + 'Ì®' => 220, + '̯' => 220, + 'Ì°' => 220, + '̱' => 220, + '̲' => 220, + '̳' => 220, + 'Ì´' => 1, + '̵' => 1, + '̶' => 1, + 'Ì·' => 1, + '̸' => 1, + '̹' => 220, + '̺' => 220, + 'Ì»' => 220, + '̼' => 220, + '̽' => 230, + '̾' => 230, + 'Ì¿' => 230, + 'Í€' => 230, + 'Í' => 230, + 'Í‚' => 230, + '̓' => 230, + 'Í„' => 230, + 'Í…' => 240, + '͆' => 230, + '͇' => 220, + '͈' => 220, + '͉' => 220, + 'ÍŠ' => 230, + 'Í‹' => 230, + 'ÍŒ' => 230, + 'Í' => 220, + 'ÍŽ' => 220, + 'Í' => 230, + 'Í‘' => 230, + 'Í’' => 230, + 'Í“' => 220, + 'Í”' => 220, + 'Í•' => 220, + 'Í–' => 220, + 'Í—' => 230, + '͘' => 232, + 'Í™' => 220, + 'Íš' => 220, + 'Í›' => 230, + 'Íœ' => 233, + 'Í' => 234, + 'Íž' => 234, + 'ÍŸ' => 233, + 'Í ' => 234, + 'Í¡' => 234, + 'Í¢' => 233, + 'Í£' => 230, + 'ͤ' => 230, + 'Í¥' => 230, + 'ͦ' => 230, + 'ͧ' => 230, + 'ͨ' => 230, + 'Í©' => 230, + 'ͪ' => 230, + 'Í«' => 230, + 'ͬ' => 230, + 'Í­' => 230, + 'Í®' => 230, + 'ͯ' => 230, + 'Òƒ' => 230, + 'Ò„' => 230, + 'Ò…' => 230, + 'Ò†' => 230, + 'Ò‡' => 230, + 'Ö‘' => 220, + 'Ö’' => 230, + 'Ö“' => 230, + 'Ö”' => 230, + 'Ö•' => 230, + 'Ö–' => 220, + 'Ö—' => 230, + 'Ö˜' => 230, + 'Ö™' => 230, + 'Öš' => 222, + 'Ö›' => 220, + 'Öœ' => 230, + 'Ö' => 230, + 'Öž' => 230, + 'ÖŸ' => 230, + 'Ö ' => 230, + 'Ö¡' => 230, + 'Ö¢' => 220, + 'Ö£' => 220, + 'Ö¤' => 220, + 'Ö¥' => 220, + 'Ö¦' => 220, + 'Ö§' => 220, + 'Ö¨' => 230, + 'Ö©' => 230, + 'Öª' => 220, + 'Ö«' => 230, + 'Ö¬' => 230, + 'Ö­' => 222, + 'Ö®' => 228, + 'Ö¯' => 230, + 'Ö°' => 10, + 'Ö±' => 11, + 'Ö²' => 12, + 'Ö³' => 13, + 'Ö´' => 14, + 'Öµ' => 15, + 'Ö¶' => 16, + 'Ö·' => 17, + 'Ö¸' => 18, + 'Ö¹' => 19, + 'Öº' => 19, + 'Ö»' => 20, + 'Ö¼' => 21, + 'Ö½' => 22, + 'Ö¿' => 23, + '×' => 24, + 'ׂ' => 25, + 'ׄ' => 230, + '×…' => 220, + 'ׇ' => 18, + 'Ø' => 230, + 'Ø‘' => 230, + 'Ø’' => 230, + 'Ø“' => 230, + 'Ø”' => 230, + 'Ø•' => 230, + 'Ø–' => 230, + 'Ø—' => 230, + 'ؘ' => 30, + 'Ø™' => 31, + 'Øš' => 32, + 'Ù‹' => 27, + 'ÙŒ' => 28, + 'Ù' => 29, + 'ÙŽ' => 30, + 'Ù' => 31, + 'Ù' => 32, + 'Ù‘' => 33, + 'Ù’' => 34, + 'Ù“' => 230, + 'Ù”' => 230, + 'Ù•' => 220, + 'Ù–' => 220, + 'Ù—' => 230, + 'Ù˜' => 230, + 'Ù™' => 230, + 'Ùš' => 230, + 'Ù›' => 230, + 'Ùœ' => 220, + 'Ù' => 230, + 'Ùž' => 230, + 'ÙŸ' => 220, + 'Ù°' => 35, + 'Û–' => 230, + 'Û—' => 230, + 'Û˜' => 230, + 'Û™' => 230, + 'Ûš' => 230, + 'Û›' => 230, + 'Ûœ' => 230, + 'ÛŸ' => 230, + 'Û ' => 230, + 'Û¡' => 230, + 'Û¢' => 230, + 'Û£' => 220, + 'Û¤' => 230, + 'Û§' => 230, + 'Û¨' => 230, + 'Ûª' => 220, + 'Û«' => 230, + 'Û¬' => 230, + 'Û­' => 220, + 'Ü‘' => 36, + 'Ü°' => 230, + 'ܱ' => 220, + 'ܲ' => 230, + 'ܳ' => 230, + 'Ü´' => 220, + 'ܵ' => 230, + 'ܶ' => 230, + 'Ü·' => 220, + 'ܸ' => 220, + 'ܹ' => 220, + 'ܺ' => 230, + 'Ü»' => 220, + 'ܼ' => 220, + 'ܽ' => 230, + 'ܾ' => 220, + 'Ü¿' => 230, + 'Ý€' => 230, + 'Ý' => 230, + 'Ý‚' => 220, + '݃' => 230, + 'Ý„' => 220, + 'Ý…' => 230, + '݆' => 220, + '݇' => 230, + '݈' => 220, + '݉' => 230, + 'ÝŠ' => 230, + 'ß«' => 230, + '߬' => 230, + 'ß­' => 230, + 'ß®' => 230, + '߯' => 230, + 'ß°' => 230, + 'ß±' => 230, + 'ß²' => 220, + 'ß³' => 230, + 'ß½' => 220, + 'à –' => 230, + 'à —' => 230, + 'à ˜' => 230, + 'à ™' => 230, + 'à ›' => 230, + 'à œ' => 230, + 'à ' => 230, + 'à ž' => 230, + 'à Ÿ' => 230, + 'à  ' => 230, + 'à ¡' => 230, + 'à ¢' => 230, + 'à £' => 230, + 'à ¥' => 230, + 'à ¦' => 230, + 'à §' => 230, + 'à ©' => 230, + 'à ª' => 230, + 'à «' => 230, + 'à ¬' => 230, + 'à ­' => 230, + 'à¡™' => 220, + 'à¡š' => 220, + 'à¡›' => 220, + '࣓' => 220, + 'ࣔ' => 230, + 'ࣕ' => 230, + 'ࣖ' => 230, + 'ࣗ' => 230, + 'ࣘ' => 230, + 'ࣙ' => 230, + 'ࣚ' => 230, + 'ࣛ' => 230, + 'ࣜ' => 230, + 'à£' => 230, + 'ࣞ' => 230, + 'ࣟ' => 230, + '࣠' => 230, + '࣡' => 230, + 'ࣣ' => 220, + 'ࣤ' => 230, + 'ࣥ' => 230, + 'ࣦ' => 220, + 'ࣧ' => 230, + 'ࣨ' => 230, + 'ࣩ' => 220, + '࣪' => 230, + '࣫' => 230, + '࣬' => 230, + '࣭' => 220, + '࣮' => 220, + '࣯' => 220, + 'ࣰ' => 27, + 'ࣱ' => 28, + 'ࣲ' => 29, + 'ࣳ' => 230, + 'ࣴ' => 230, + 'ࣵ' => 230, + 'ࣶ' => 220, + 'ࣷ' => 230, + 'ࣸ' => 230, + 'ࣹ' => 220, + 'ࣺ' => 220, + 'ࣻ' => 230, + 'ࣼ' => 230, + 'ࣽ' => 230, + 'ࣾ' => 230, + 'ࣿ' => 230, + '़' => 7, + 'à¥' => 9, + '॑' => 230, + '॒' => 220, + '॓' => 230, + '॔' => 230, + '়' => 7, + 'à§' => 9, + '৾' => 230, + '਼' => 7, + 'à©' => 9, + '઼' => 7, + 'à«' => 9, + '଼' => 7, + 'à­' => 9, + 'à¯' => 9, + 'à±' => 9, + 'ౕ' => 84, + 'à±–' => 91, + '಼' => 7, + 'à³' => 9, + 'à´»' => 9, + 'à´¼' => 9, + 'àµ' => 9, + 'à·Š' => 9, + 'ุ' => 103, + 'ู' => 103, + 'ฺ' => 9, + '่' => 107, + '้' => 107, + '๊' => 107, + '๋' => 107, + 'ຸ' => 118, + 'ູ' => 118, + '຺' => 9, + '່' => 122, + '້' => 122, + '໊' => 122, + '໋' => 122, + '༘' => 220, + '༙' => 220, + '༵' => 220, + '༷' => 220, + '༹' => 216, + 'ཱ' => 129, + 'ི' => 130, + 'ུ' => 132, + 'ེ' => 130, + 'ཻ' => 130, + 'ོ' => 130, + 'ཽ' => 130, + 'ྀ' => 130, + 'ྂ' => 230, + 'ྃ' => 230, + '྄' => 9, + '྆' => 230, + '྇' => 230, + '࿆' => 220, + '့' => 7, + '္' => 9, + '်' => 9, + 'á‚' => 220, + 'á' => 230, + 'áž' => 230, + 'áŸ' => 230, + '᜔' => 9, + '᜴' => 9, + '្' => 9, + 'áŸ' => 230, + 'ᢩ' => 228, + '᤹' => 222, + '᤺' => 230, + '᤻' => 220, + 'ᨗ' => 230, + 'ᨘ' => 220, + 'á© ' => 9, + '᩵' => 230, + '᩶' => 230, + 'á©·' => 230, + '᩸' => 230, + '᩹' => 230, + '᩺' => 230, + 'á©»' => 230, + '᩼' => 230, + 'á©¿' => 220, + '᪰' => 230, + '᪱' => 230, + '᪲' => 230, + '᪳' => 230, + '᪴' => 230, + '᪵' => 220, + '᪶' => 220, + '᪷' => 220, + '᪸' => 220, + '᪹' => 220, + '᪺' => 220, + '᪻' => 230, + '᪼' => 230, + '᪽' => 220, + 'ᪿ' => 220, + 'á«€' => 220, + '᬴' => 7, + 'á­„' => 9, + 'á­«' => 230, + 'á­¬' => 220, + 'á­­' => 230, + 'á­®' => 230, + 'á­¯' => 230, + 'á­°' => 230, + 'á­±' => 230, + 'á­²' => 230, + 'á­³' => 230, + '᮪' => 9, + '᮫' => 9, + '᯦' => 7, + '᯲' => 9, + '᯳' => 9, + 'á°·' => 7, + 'á³' => 230, + '᳑' => 230, + 'á³’' => 230, + 'á³”' => 1, + '᳕' => 220, + 'á³–' => 220, + 'á³—' => 220, + '᳘' => 220, + 'á³™' => 220, + '᳚' => 230, + 'á³›' => 230, + '᳜' => 220, + 'á³' => 220, + '᳞' => 220, + '᳟' => 220, + 'á³ ' => 230, + 'á³¢' => 1, + 'á³£' => 1, + '᳤' => 1, + 'á³¥' => 1, + '᳦' => 1, + '᳧' => 1, + '᳨' => 1, + 'á³­' => 220, + 'á³´' => 230, + '᳸' => 230, + 'á³¹' => 230, + 'á·€' => 230, + 'á·' => 230, + 'á·‚' => 220, + 'á·ƒ' => 230, + 'á·„' => 230, + 'á·…' => 230, + 'á·†' => 230, + 'á·‡' => 230, + 'á·ˆ' => 230, + 'á·‰' => 230, + 'á·Š' => 220, + 'á·‹' => 230, + 'á·Œ' => 230, + 'á·' => 234, + 'á·Ž' => 214, + 'á·' => 220, + 'á·' => 202, + 'á·‘' => 230, + 'á·’' => 230, + 'á·“' => 230, + 'á·”' => 230, + 'á·•' => 230, + 'á·–' => 230, + 'á·—' => 230, + 'á·˜' => 230, + 'á·™' => 230, + 'á·š' => 230, + 'á·›' => 230, + 'á·œ' => 230, + 'á·' => 230, + 'á·ž' => 230, + 'á·Ÿ' => 230, + 'á· ' => 230, + 'á·¡' => 230, + 'á·¢' => 230, + 'á·£' => 230, + 'á·¤' => 230, + 'á·¥' => 230, + 'á·¦' => 230, + 'á·§' => 230, + 'á·¨' => 230, + 'á·©' => 230, + 'á·ª' => 230, + 'á·«' => 230, + 'á·¬' => 230, + 'á·­' => 230, + 'á·®' => 230, + 'á·¯' => 230, + 'á·°' => 230, + 'á·±' => 230, + 'á·²' => 230, + 'á·³' => 230, + 'á·´' => 230, + 'á·µ' => 230, + 'á·¶' => 232, + 'á··' => 228, + 'á·¸' => 228, + 'á·¹' => 220, + 'á·»' => 230, + 'á·¼' => 233, + 'á·½' => 220, + 'á·¾' => 230, + 'á·¿' => 220, + 'âƒ' => 230, + '⃑' => 230, + '⃒' => 1, + '⃓' => 1, + '⃔' => 230, + '⃕' => 230, + '⃖' => 230, + '⃗' => 230, + '⃘' => 1, + '⃙' => 1, + '⃚' => 1, + '⃛' => 230, + '⃜' => 230, + '⃡' => 230, + '⃥' => 1, + '⃦' => 1, + '⃧' => 230, + '⃨' => 220, + '⃩' => 230, + '⃪' => 1, + '⃫' => 1, + '⃬' => 220, + '⃭' => 220, + '⃮' => 220, + '⃯' => 220, + '⃰' => 230, + '⳯' => 230, + 'â³°' => 230, + 'â³±' => 230, + '⵿' => 9, + 'â· ' => 230, + 'â·¡' => 230, + 'â·¢' => 230, + 'â·£' => 230, + 'â·¤' => 230, + 'â·¥' => 230, + 'â·¦' => 230, + 'â·§' => 230, + 'â·¨' => 230, + 'â·©' => 230, + 'â·ª' => 230, + 'â·«' => 230, + 'â·¬' => 230, + 'â·­' => 230, + 'â·®' => 230, + 'â·¯' => 230, + 'â·°' => 230, + 'â·±' => 230, + 'â·²' => 230, + 'â·³' => 230, + 'â·´' => 230, + 'â·µ' => 230, + 'â·¶' => 230, + 'â··' => 230, + 'â·¸' => 230, + 'â·¹' => 230, + 'â·º' => 230, + 'â·»' => 230, + 'â·¼' => 230, + 'â·½' => 230, + 'â·¾' => 230, + 'â·¿' => 230, + '〪' => 218, + '〫' => 228, + '〬' => 232, + '〭' => 222, + '〮' => 224, + '〯' => 224, + 'ã‚™' => 8, + 'ã‚š' => 8, + '꙯' => 230, + 'ê™´' => 230, + 'ꙵ' => 230, + 'ꙶ' => 230, + 'ê™·' => 230, + 'ꙸ' => 230, + 'ꙹ' => 230, + 'ꙺ' => 230, + 'ê™»' => 230, + '꙼' => 230, + '꙽' => 230, + 'êšž' => 230, + 'ꚟ' => 230, + 'ê›°' => 230, + 'ê›±' => 230, + 'ê †' => 9, + 'ê ¬' => 9, + '꣄' => 9, + '꣠' => 230, + '꣡' => 230, + '꣢' => 230, + '꣣' => 230, + '꣤' => 230, + '꣥' => 230, + '꣦' => 230, + '꣧' => 230, + '꣨' => 230, + '꣩' => 230, + '꣪' => 230, + '꣫' => 230, + '꣬' => 230, + '꣭' => 230, + '꣮' => 230, + '꣯' => 230, + '꣰' => 230, + '꣱' => 230, + '꤫' => 220, + '꤬' => 220, + '꤭' => 220, + '꥓' => 9, + '꦳' => 7, + '꧀' => 9, + 'ꪰ' => 230, + 'ꪲ' => 230, + 'ꪳ' => 230, + 'ꪴ' => 220, + 'ꪷ' => 230, + 'ꪸ' => 230, + 'ꪾ' => 230, + '꪿' => 230, + 'ê«' => 230, + '꫶' => 9, + '꯭' => 9, + 'ﬞ' => 26, + '︠' => 230, + '︡' => 230, + '︢' => 230, + '︣' => 230, + '︤' => 230, + '︥' => 230, + '︦' => 230, + '︧' => 220, + '︨' => 220, + '︩' => 220, + '︪' => 220, + '︫' => 220, + '︬' => 220, + '︭' => 220, + '︮' => 230, + '︯' => 230, + 'ð‡½' => 220, + 'ð‹ ' => 220, + 'ð¶' => 230, + 'ð·' => 230, + 'ð¸' => 230, + 'ð¹' => 230, + 'ðº' => 230, + 'ð¨' => 220, + 'ð¨' => 230, + 'ð¨¸' => 230, + 'ð¨¹' => 1, + 'ð¨º' => 220, + 'ð¨¿' => 9, + 'ð«¥' => 230, + 'ð«¦' => 220, + 'ð´¤' => 230, + 'ð´¥' => 230, + 'ð´¦' => 230, + 'ð´§' => 230, + 'ðº«' => 230, + 'ðº¬' => 230, + 'ð½†' => 220, + 'ð½‡' => 220, + 'ð½ˆ' => 230, + 'ð½‰' => 230, + 'ð½Š' => 230, + 'ð½‹' => 220, + 'ð½Œ' => 230, + 'ð½' => 220, + 'ð½Ž' => 220, + 'ð½' => 220, + 'ð½' => 220, + 'ð‘†' => 9, + 'ð‘¿' => 9, + 'ð‘‚¹' => 9, + '𑂺' => 7, + 'ð‘„€' => 230, + 'ð‘„' => 230, + 'ð‘„‚' => 230, + 'ð‘„³' => 9, + 'ð‘„´' => 9, + 'ð‘…³' => 7, + '𑇀' => 9, + '𑇊' => 7, + '𑈵' => 9, + '𑈶' => 7, + 'ð‘‹©' => 7, + '𑋪' => 9, + '𑌻' => 7, + '𑌼' => 7, + 'ð‘' => 9, + 'ð‘¦' => 230, + 'ð‘§' => 230, + 'ð‘¨' => 230, + 'ð‘©' => 230, + 'ð‘ª' => 230, + 'ð‘«' => 230, + 'ð‘¬' => 230, + 'ð‘°' => 230, + 'ð‘±' => 230, + 'ð‘²' => 230, + 'ð‘³' => 230, + 'ð‘´' => 230, + 'ð‘‘‚' => 9, + '𑑆' => 7, + 'ð‘‘ž' => 230, + 'ð‘“‚' => 9, + '𑓃' => 7, + 'ð‘–¿' => 9, + 'ð‘—€' => 7, + '𑘿' => 9, + '𑚶' => 9, + 'ð‘š·' => 7, + '𑜫' => 9, + 'ð‘ ¹' => 9, + 'ð‘ º' => 7, + '𑤽' => 9, + '𑤾' => 9, + '𑥃' => 7, + '𑧠' => 9, + '𑨴' => 9, + '𑩇' => 9, + '𑪙' => 9, + 'ð‘°¿' => 9, + '𑵂' => 7, + '𑵄' => 9, + '𑵅' => 9, + '𑶗' => 9, + 'ð–«°' => 1, + 'ð–«±' => 1, + 'ð–«²' => 1, + 'ð–«³' => 1, + 'ð–«´' => 1, + 'ð–¬°' => 230, + '𖬱' => 230, + '𖬲' => 230, + '𖬳' => 230, + 'ð–¬´' => 230, + '𖬵' => 230, + '𖬶' => 230, + 'ð–¿°' => 6, + 'ð–¿±' => 6, + '𛲞' => 1, + 'ð…¥' => 216, + 'ð…¦' => 216, + 'ð…§' => 1, + 'ð…¨' => 1, + 'ð…©' => 1, + 'ð…­' => 226, + 'ð…®' => 216, + 'ð…¯' => 216, + 'ð…°' => 216, + 'ð…±' => 216, + 'ð…²' => 216, + 'ð…»' => 220, + 'ð…¼' => 220, + 'ð…½' => 220, + 'ð…¾' => 220, + 'ð…¿' => 220, + 'ð†€' => 220, + 'ð†' => 220, + 'ð†‚' => 220, + 'ð†…' => 230, + 'ð††' => 230, + 'ð†‡' => 230, + 'ð†ˆ' => 230, + 'ð†‰' => 230, + 'ð†Š' => 220, + 'ð†‹' => 220, + 'ð†ª' => 230, + 'ð†«' => 230, + 'ð†¬' => 230, + 'ð†­' => 230, + 'ð‰‚' => 230, + 'ð‰ƒ' => 230, + 'ð‰„' => 230, + '𞀀' => 230, + 'ðž€' => 230, + '𞀂' => 230, + '𞀃' => 230, + '𞀄' => 230, + '𞀅' => 230, + '𞀆' => 230, + '𞀈' => 230, + '𞀉' => 230, + '𞀊' => 230, + '𞀋' => 230, + '𞀌' => 230, + 'ðž€' => 230, + '𞀎' => 230, + 'ðž€' => 230, + 'ðž€' => 230, + '𞀑' => 230, + '𞀒' => 230, + '𞀓' => 230, + '𞀔' => 230, + '𞀕' => 230, + '𞀖' => 230, + '𞀗' => 230, + '𞀘' => 230, + '𞀛' => 230, + '𞀜' => 230, + 'ðž€' => 230, + '𞀞' => 230, + '𞀟' => 230, + '𞀠' => 230, + '𞀡' => 230, + '𞀣' => 230, + '𞀤' => 230, + '𞀦' => 230, + '𞀧' => 230, + '𞀨' => 230, + '𞀩' => 230, + '𞀪' => 230, + 'ðž„°' => 230, + '𞄱' => 230, + '𞄲' => 230, + '𞄳' => 230, + 'ðž„´' => 230, + '𞄵' => 230, + '𞄶' => 230, + '𞋬' => 230, + 'ðž‹­' => 230, + 'ðž‹®' => 230, + '𞋯' => 230, + 'ðž£' => 220, + '𞣑' => 220, + '𞣒' => 220, + '𞣓' => 220, + '𞣔' => 220, + '𞣕' => 220, + '𞣖' => 220, + '𞥄' => 230, + '𞥅' => 230, + '𞥆' => 230, + '𞥇' => 230, + '𞥈' => 230, + '𞥉' => 230, + '𞥊' => 7, +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php new file mode 100644 index 00000000000..1574902893c --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php @@ -0,0 +1,3695 @@ + ' ', + '¨' => ' ̈', + 'ª' => 'a', + '¯' => ' Ì„', + '²' => '2', + '³' => '3', + '´' => ' Ì', + 'µ' => 'μ', + '¸' => ' ̧', + '¹' => '1', + 'º' => 'o', + '¼' => '1â„4', + '½' => '1â„2', + '¾' => '3â„4', + 'IJ' => 'IJ', + 'ij' => 'ij', + 'Ä¿' => 'L·', + 'Å€' => 'l·', + 'ʼn' => 'ʼn', + 'Å¿' => 's', + 'Ç„' => 'DZÌŒ', + 'Ç…' => 'DzÌŒ', + 'dž' => 'dzÌŒ', + 'LJ' => 'LJ', + 'Lj' => 'Lj', + 'lj' => 'lj', + 'ÇŠ' => 'NJ', + 'Ç‹' => 'Nj', + 'ÇŒ' => 'nj', + 'DZ' => 'DZ', + 'Dz' => 'Dz', + 'dz' => 'dz', + 'Ê°' => 'h', + 'ʱ' => 'ɦ', + 'ʲ' => 'j', + 'ʳ' => 'r', + 'Ê´' => 'ɹ', + 'ʵ' => 'É»', + 'ʶ' => 'Ê', + 'Ê·' => 'w', + 'ʸ' => 'y', + '˘' => ' ̆', + 'Ë™' => ' ̇', + 'Ëš' => ' ÌŠ', + 'Ë›' => ' ̨', + 'Ëœ' => ' ̃', + 'Ë' => ' Ì‹', + 'Ë ' => 'É£', + 'Ë¡' => 'l', + 'Ë¢' => 's', + 'Ë£' => 'x', + 'ˤ' => 'Ê•', + 'ͺ' => ' Í…', + '΄' => ' Ì', + 'Î…' => ' ̈Ì', + 'Ï' => 'β', + 'Ï‘' => 'θ', + 'Ï’' => 'Î¥', + 'Ï“' => 'Î¥Ì', + 'Ï”' => 'Ϋ', + 'Ï•' => 'φ', + 'Ï–' => 'Ï€', + 'Ï°' => 'κ', + 'ϱ' => 'Ï', + 'ϲ' => 'Ï‚', + 'Ï´' => 'Θ', + 'ϵ' => 'ε', + 'Ϲ' => 'Σ', + 'Ö‡' => 'Õ¥Ö‚', + 'Ùµ' => 'اٴ', + 'Ù¶' => 'وٴ', + 'Ù·' => 'Û‡Ù´', + 'Ù¸' => 'يٴ', + 'ำ' => 'à¹à¸²', + 'ຳ' => 'à»àº²', + 'ໜ' => 'ຫນ', + 'à»' => 'ຫມ', + '༌' => '་', + 'ཷ' => 'ྲཱྀ', + 'ཹ' => 'ླཱྀ', + 'ჼ' => 'ნ', + 'á´¬' => 'A', + 'á´­' => 'Æ', + 'á´®' => 'B', + 'á´°' => 'D', + 'á´±' => 'E', + 'á´²' => 'ÆŽ', + 'á´³' => 'G', + 'á´´' => 'H', + 'á´µ' => 'I', + 'á´¶' => 'J', + 'á´·' => 'K', + 'á´¸' => 'L', + 'á´¹' => 'M', + 'á´º' => 'N', + 'á´¼' => 'O', + 'á´½' => 'È¢', + 'á´¾' => 'P', + 'á´¿' => 'R', + 'áµ€' => 'T', + 'áµ' => 'U', + 'ᵂ' => 'W', + 'ᵃ' => 'a', + 'ᵄ' => 'É', + 'áµ…' => 'É‘', + 'ᵆ' => 'á´‚', + 'ᵇ' => 'b', + 'ᵈ' => 'd', + 'ᵉ' => 'e', + 'ᵊ' => 'É™', + 'ᵋ' => 'É›', + 'ᵌ' => 'Éœ', + 'áµ' => 'g', + 'áµ' => 'k', + 'áµ' => 'm', + 'ᵑ' => 'Å‹', + 'áµ’' => 'o', + 'ᵓ' => 'É”', + 'áµ”' => 'á´–', + 'ᵕ' => 'á´—', + 'áµ–' => 'p', + 'áµ—' => 't', + 'ᵘ' => 'u', + 'áµ™' => 'á´', + 'ᵚ' => 'ɯ', + 'áµ›' => 'v', + 'ᵜ' => 'á´¥', + 'áµ' => 'β', + 'ᵞ' => 'γ', + 'ᵟ' => 'δ', + 'áµ ' => 'φ', + 'ᵡ' => 'χ', + 'áµ¢' => 'i', + 'áµ£' => 'r', + 'ᵤ' => 'u', + 'áµ¥' => 'v', + 'ᵦ' => 'β', + 'ᵧ' => 'γ', + 'ᵨ' => 'Ï', + 'ᵩ' => 'φ', + 'ᵪ' => 'χ', + 'ᵸ' => 'н', + 'ᶛ' => 'É’', + 'ᶜ' => 'c', + 'á¶' => 'É•', + 'ᶞ' => 'ð', + 'ᶟ' => 'Éœ', + 'ᶠ' => 'f', + 'ᶡ' => 'ÉŸ', + 'ᶢ' => 'É¡', + 'ᶣ' => 'É¥', + 'ᶤ' => 'ɨ', + 'ᶥ' => 'É©', + 'ᶦ' => 'ɪ', + 'ᶧ' => 'áµ»', + 'ᶨ' => 'Ê', + 'ᶩ' => 'É­', + 'ᶪ' => 'ᶅ', + 'ᶫ' => 'ÊŸ', + 'ᶬ' => 'ɱ', + 'ᶭ' => 'É°', + 'ᶮ' => 'ɲ', + 'ᶯ' => 'ɳ', + 'ᶰ' => 'É´', + 'ᶱ' => 'ɵ', + 'ᶲ' => 'ɸ', + 'ᶳ' => 'Ê‚', + 'ᶴ' => 'ʃ', + 'ᶵ' => 'Æ«', + 'ᶶ' => 'ʉ', + 'ᶷ' => 'ÊŠ', + 'ᶸ' => 'á´œ', + 'ᶹ' => 'Ê‹', + 'ᶺ' => 'ÊŒ', + 'ᶻ' => 'z', + 'ᶼ' => 'Ê', + 'ᶽ' => 'Ê‘', + 'ᶾ' => 'Ê’', + 'ᶿ' => 'θ', + 'ẚ' => 'aʾ', + 'ẛ' => 'ṡ', + 'á¾½' => ' Ì“', + '᾿' => ' Ì“', + 'á¿€' => ' Í‚', + 'á¿' => ' ̈͂', + 'á¿' => ' Ì“Ì€', + 'á¿Ž' => ' Ì“Ì', + 'á¿' => ' Ì“Í‚', + 'á¿' => ' ̔̀', + 'á¿ž' => ' Ì”Ì', + 'á¿Ÿ' => ' ̔͂', + 'á¿­' => ' ̈̀', + 'á¿®' => ' ̈Ì', + '´' => ' Ì', + '῾' => ' Ì”', + ' ' => ' ', + 'â€' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + '‑' => 'â€', + '‗' => ' ̳', + '․' => '.', + '‥' => '..', + '…' => '...', + ' ' => ' ', + '″' => '′′', + '‴' => '′′′', + '‶' => '‵‵', + '‷' => '‵‵‵', + '‼' => '!!', + '‾' => ' Ì…', + 'â‡' => '??', + 'âˆ' => '?!', + 'â‰' => '!?', + 'â—' => '′′′′', + 'âŸ' => ' ', + 'â°' => '0', + 'â±' => 'i', + 'â´' => '4', + 'âµ' => '5', + 'â¶' => '6', + 'â·' => '7', + 'â¸' => '8', + 'â¹' => '9', + 'âº' => '+', + 'â»' => '−', + 'â¼' => '=', + 'â½' => '(', + 'â¾' => ')', + 'â¿' => 'n', + 'â‚€' => '0', + 'â‚' => '1', + 'â‚‚' => '2', + '₃' => '3', + 'â‚„' => '4', + 'â‚…' => '5', + '₆' => '6', + '₇' => '7', + '₈' => '8', + '₉' => '9', + 'â‚Š' => '+', + 'â‚‹' => '−', + 'â‚Œ' => '=', + 'â‚' => '(', + 'â‚Ž' => ')', + 'â‚' => 'a', + 'â‚‘' => 'e', + 'â‚’' => 'o', + 'â‚“' => 'x', + 'â‚”' => 'É™', + 'â‚•' => 'h', + 'â‚–' => 'k', + 'â‚—' => 'l', + 'ₘ' => 'm', + 'â‚™' => 'n', + 'â‚š' => 'p', + 'â‚›' => 's', + 'â‚œ' => 't', + '₨' => 'Rs', + 'â„€' => 'a/c', + 'â„' => 'a/s', + 'â„‚' => 'C', + '℃' => '°C', + 'â„…' => 'c/o', + '℆' => 'c/u', + 'ℇ' => 'Æ', + '℉' => '°F', + 'â„Š' => 'g', + 'â„‹' => 'H', + 'â„Œ' => 'H', + 'â„' => 'H', + 'â„Ž' => 'h', + 'â„' => 'ħ', + 'â„' => 'I', + 'â„‘' => 'I', + 'â„’' => 'L', + 'â„“' => 'l', + 'â„•' => 'N', + 'â„–' => 'No', + 'â„™' => 'P', + 'â„š' => 'Q', + 'â„›' => 'R', + 'â„œ' => 'R', + 'â„' => 'R', + 'â„ ' => 'SM', + 'â„¡' => 'TEL', + 'â„¢' => 'TM', + 'ℤ' => 'Z', + 'ℨ' => 'Z', + 'ℬ' => 'B', + 'â„­' => 'C', + 'ℯ' => 'e', + 'â„°' => 'E', + 'ℱ' => 'F', + 'ℳ' => 'M', + 'â„´' => 'o', + 'ℵ' => '×', + 'ℶ' => 'ב', + 'â„·' => '×’', + 'ℸ' => 'ד', + 'ℹ' => 'i', + 'â„»' => 'FAX', + 'ℼ' => 'Ï€', + 'ℽ' => 'γ', + 'ℾ' => 'Γ', + 'â„¿' => 'Π', + 'â…€' => '∑', + 'â……' => 'D', + 'â…†' => 'd', + 'â…‡' => 'e', + 'â…ˆ' => 'i', + 'â…‰' => 'j', + 'â…' => '1â„7', + 'â…‘' => '1â„9', + 'â…’' => '1â„10', + 'â…“' => '1â„3', + 'â…”' => '2â„3', + 'â…•' => '1â„5', + 'â…–' => '2â„5', + 'â…—' => '3â„5', + 'â…˜' => '4â„5', + 'â…™' => '1â„6', + 'â…š' => '5â„6', + 'â…›' => '1â„8', + 'â…œ' => '3â„8', + 'â…' => '5â„8', + 'â…ž' => '7â„8', + 'â…Ÿ' => '1â„', + 'â… ' => 'I', + 'â…¡' => 'II', + 'â…¢' => 'III', + 'â…£' => 'IV', + 'â…¤' => 'V', + 'â…¥' => 'VI', + 'â…¦' => 'VII', + 'â…§' => 'VIII', + 'â…¨' => 'IX', + 'â…©' => 'X', + 'â…ª' => 'XI', + 'â…«' => 'XII', + 'â…¬' => 'L', + 'â…­' => 'C', + 'â…®' => 'D', + 'â…¯' => 'M', + 'â…°' => 'i', + 'â…±' => 'ii', + 'â…²' => 'iii', + 'â…³' => 'iv', + 'â…´' => 'v', + 'â…µ' => 'vi', + 'â…¶' => 'vii', + 'â…·' => 'viii', + 'â…¸' => 'ix', + 'â…¹' => 'x', + 'â…º' => 'xi', + 'â…»' => 'xii', + 'â…¼' => 'l', + 'â…½' => 'c', + 'â…¾' => 'd', + 'â…¿' => 'm', + '↉' => '0â„3', + '∬' => '∫∫', + '∭' => '∫∫∫', + '∯' => '∮∮', + '∰' => '∮∮∮', + 'â‘ ' => '1', + 'â‘¡' => '2', + 'â‘¢' => '3', + 'â‘£' => '4', + '⑤' => '5', + 'â‘¥' => '6', + '⑦' => '7', + '⑧' => '8', + '⑨' => '9', + 'â‘©' => '10', + '⑪' => '11', + 'â‘«' => '12', + '⑬' => '13', + 'â‘­' => '14', + 'â‘®' => '15', + '⑯' => '16', + 'â‘°' => '17', + '⑱' => '18', + '⑲' => '19', + '⑳' => '20', + 'â‘´' => '(1)', + '⑵' => '(2)', + '⑶' => '(3)', + 'â‘·' => '(4)', + '⑸' => '(5)', + '⑹' => '(6)', + '⑺' => '(7)', + 'â‘»' => '(8)', + '⑼' => '(9)', + '⑽' => '(10)', + '⑾' => '(11)', + 'â‘¿' => '(12)', + 'â’€' => '(13)', + 'â’' => '(14)', + 'â’‚' => '(15)', + 'â’ƒ' => '(16)', + 'â’„' => '(17)', + 'â’…' => '(18)', + 'â’†' => '(19)', + 'â’‡' => '(20)', + 'â’ˆ' => '1.', + 'â’‰' => '2.', + 'â’Š' => '3.', + 'â’‹' => '4.', + 'â’Œ' => '5.', + 'â’' => '6.', + 'â’Ž' => '7.', + 'â’' => '8.', + 'â’' => '9.', + 'â’‘' => '10.', + 'â’’' => '11.', + 'â’“' => '12.', + 'â’”' => '13.', + 'â’•' => '14.', + 'â’–' => '15.', + 'â’—' => '16.', + 'â’˜' => '17.', + 'â’™' => '18.', + 'â’š' => '19.', + 'â’›' => '20.', + 'â’œ' => '(a)', + 'â’' => '(b)', + 'â’ž' => '(c)', + 'â’Ÿ' => '(d)', + 'â’ ' => '(e)', + 'â’¡' => '(f)', + 'â’¢' => '(g)', + 'â’£' => '(h)', + 'â’¤' => '(i)', + 'â’¥' => '(j)', + 'â’¦' => '(k)', + 'â’§' => '(l)', + 'â’¨' => '(m)', + 'â’©' => '(n)', + 'â’ª' => '(o)', + 'â’«' => '(p)', + 'â’¬' => '(q)', + 'â’­' => '(r)', + 'â’®' => '(s)', + 'â’¯' => '(t)', + 'â’°' => '(u)', + 'â’±' => '(v)', + 'â’²' => '(w)', + 'â’³' => '(x)', + 'â’´' => '(y)', + 'â’µ' => '(z)', + 'â’¶' => 'A', + 'â’·' => 'B', + 'â’¸' => 'C', + 'â’¹' => 'D', + 'â’º' => 'E', + 'â’»' => 'F', + 'â’¼' => 'G', + 'â’½' => 'H', + 'â’¾' => 'I', + 'â’¿' => 'J', + 'â“€' => 'K', + 'â“' => 'L', + 'â“‚' => 'M', + 'Ⓝ' => 'N', + 'â“„' => 'O', + 'â“…' => 'P', + 'Ⓠ' => 'Q', + 'Ⓡ' => 'R', + 'Ⓢ' => 'S', + 'Ⓣ' => 'T', + 'â“Š' => 'U', + 'â“‹' => 'V', + 'â“Œ' => 'W', + 'â“' => 'X', + 'â“Ž' => 'Y', + 'â“' => 'Z', + 'â“' => 'a', + 'â“‘' => 'b', + 'â“’' => 'c', + 'â““' => 'd', + 'â“”' => 'e', + 'â“•' => 'f', + 'â“–' => 'g', + 'â“—' => 'h', + 'ⓘ' => 'i', + 'â“™' => 'j', + 'â“š' => 'k', + 'â“›' => 'l', + 'â“œ' => 'm', + 'â“' => 'n', + 'â“ž' => 'o', + 'â“Ÿ' => 'p', + 'â“ ' => 'q', + 'â“¡' => 'r', + 'â“¢' => 's', + 'â“£' => 't', + 'ⓤ' => 'u', + 'â“¥' => 'v', + 'ⓦ' => 'w', + 'ⓧ' => 'x', + 'ⓨ' => 'y', + 'â“©' => 'z', + '⓪' => '0', + '⨌' => '∫∫∫∫', + 'â©´' => '::=', + '⩵' => '==', + '⩶' => '===', + 'â±¼' => 'j', + 'â±½' => 'V', + 'ⵯ' => 'ⵡ', + '⺟' => 'æ¯', + '⻳' => '龟', + 'â¼€' => '一', + 'â¼' => '丨', + '⼂' => '丶', + '⼃' => '丿', + '⼄' => 'ä¹™', + 'â¼…' => '亅', + '⼆' => '二', + '⼇' => '亠', + '⼈' => '人', + '⼉' => 'å„¿', + '⼊' => 'å…¥', + '⼋' => 'å…«', + '⼌' => '冂', + 'â¼' => '冖', + '⼎' => '冫', + 'â¼' => '几', + 'â¼' => '凵', + '⼑' => '刀', + 'â¼’' => '力', + '⼓' => '勹', + 'â¼”' => '匕', + '⼕' => '匚', + 'â¼–' => '匸', + 'â¼—' => 'å', + '⼘' => 'åœ', + 'â¼™' => 'å©', + '⼚' => '厂', + 'â¼›' => '厶', + '⼜' => 'åˆ', + 'â¼' => 'å£', + '⼞' => 'å›—', + '⼟' => '土', + 'â¼ ' => '士', + '⼡' => '夂', + 'â¼¢' => '夊', + 'â¼£' => '夕', + '⼤' => '大', + 'â¼¥' => '女', + '⼦' => 'å­', + '⼧' => '宀', + '⼨' => '寸', + '⼩' => 'å°', + '⼪' => 'å°¢', + '⼫' => 'å°¸', + '⼬' => 'å±®', + 'â¼­' => 'å±±', + 'â¼®' => 'å·›', + '⼯' => 'å·¥', + 'â¼°' => 'å·±', + 'â¼±' => 'å·¾', + 'â¼²' => 'å¹²', + 'â¼³' => '幺', + 'â¼´' => '广', + 'â¼µ' => 'å»´', + '⼶' => '廾', + 'â¼·' => '弋', + '⼸' => '弓', + 'â¼¹' => 'å½', + '⼺' => '彡', + 'â¼»' => 'å½³', + 'â¼¼' => '心', + 'â¼½' => '戈', + 'â¼¾' => '戶', + '⼿' => '手', + 'â½€' => '支', + 'â½' => 'æ”´', + '⽂' => 'æ–‡', + '⽃' => 'æ–—', + '⽄' => 'æ–¤', + 'â½…' => 'æ–¹', + '⽆' => 'æ— ', + '⽇' => 'æ—¥', + '⽈' => 'æ›°', + '⽉' => '月', + '⽊' => '木', + '⽋' => '欠', + '⽌' => 'æ­¢', + 'â½' => 'æ­¹', + '⽎' => '殳', + 'â½' => '毋', + 'â½' => '比', + '⽑' => '毛', + 'â½’' => 'æ°', + '⽓' => 'æ°”', + 'â½”' => 'æ°´', + '⽕' => 'ç«', + 'â½–' => '爪', + 'â½—' => '父', + '⽘' => '爻', + 'â½™' => '爿', + '⽚' => '片', + 'â½›' => '牙', + '⽜' => '牛', + 'â½' => '犬', + '⽞' => '玄', + '⽟' => '玉', + 'â½ ' => 'ç“œ', + '⽡' => '瓦', + 'â½¢' => '甘', + 'â½£' => '生', + '⽤' => '用', + 'â½¥' => 'ç”°', + '⽦' => 'ç–‹', + '⽧' => 'ç–’', + '⽨' => '癶', + '⽩' => '白', + '⽪' => 'çš®', + '⽫' => 'çš¿', + '⽬' => 'ç›®', + 'â½­' => '矛', + 'â½®' => '矢', + '⽯' => '石', + 'â½°' => '示', + 'â½±' => '禸', + 'â½²' => '禾', + 'â½³' => 'ç©´', + 'â½´' => 'ç«‹', + 'â½µ' => '竹', + '⽶' => 'ç±³', + 'â½·' => '糸', + '⽸' => '缶', + 'â½¹' => '网', + '⽺' => '羊', + 'â½»' => 'ç¾½', + 'â½¼' => 'è€', + 'â½½' => '而', + 'â½¾' => '耒', + '⽿' => '耳', + 'â¾€' => 'è¿', + 'â¾' => '肉', + '⾂' => '臣', + '⾃' => '自', + '⾄' => '至', + 'â¾…' => '臼', + '⾆' => '舌', + '⾇' => '舛', + '⾈' => '舟', + '⾉' => '艮', + '⾊' => '色', + '⾋' => '艸', + '⾌' => 'è™', + 'â¾' => '虫', + '⾎' => 'è¡€', + 'â¾' => 'è¡Œ', + 'â¾' => 'è¡£', + '⾑' => '襾', + 'â¾’' => '見', + '⾓' => '角', + 'â¾”' => '言', + '⾕' => 'è°·', + 'â¾–' => '豆', + 'â¾—' => '豕', + '⾘' => '豸', + 'â¾™' => 'è²', + '⾚' => '赤', + 'â¾›' => 'èµ°', + '⾜' => '足', + 'â¾' => '身', + '⾞' => '車', + '⾟' => 'è¾›', + 'â¾ ' => 'è¾°', + '⾡' => 'è¾µ', + 'â¾¢' => 'é‚‘', + 'â¾£' => 'é…‰', + '⾤' => '釆', + 'â¾¥' => '里', + '⾦' => '金', + '⾧' => 'é•·', + '⾨' => 'é–€', + '⾩' => '阜', + '⾪' => '隶', + '⾫' => 'éš¹', + '⾬' => '雨', + 'â¾­' => 'é‘', + 'â¾®' => 'éž', + '⾯' => 'é¢', + 'â¾°' => 'é©', + 'â¾±' => '韋', + 'â¾²' => '韭', + 'â¾³' => '音', + 'â¾´' => 'é ', + 'â¾µ' => '風', + '⾶' => '飛', + 'â¾·' => '食', + '⾸' => '首', + 'â¾¹' => '香', + '⾺' => '馬', + 'â¾»' => '骨', + 'â¾¼' => '高', + 'â¾½' => 'é«Ÿ', + 'â¾¾' => '鬥', + '⾿' => '鬯', + 'â¿€' => '鬲', + 'â¿' => '鬼', + 'â¿‚' => 'é­š', + '⿃' => 'é³¥', + 'â¿„' => 'é¹µ', + 'â¿…' => '鹿', + '⿆' => '麥', + '⿇' => '麻', + '⿈' => '黃', + '⿉' => 'é»', + 'â¿Š' => '黑', + 'â¿‹' => '黹', + 'â¿Œ' => '黽', + 'â¿' => '鼎', + 'â¿Ž' => '鼓', + 'â¿' => 'é¼ ', + 'â¿' => 'é¼»', + 'â¿‘' => '齊', + 'â¿’' => 'é½’', + 'â¿“' => 'é¾', + 'â¿”' => '龜', + 'â¿•' => 'é¾ ', + ' ' => ' ', + '〶' => '〒', + '〸' => 'å', + '〹' => 'å„', + '〺' => 'å…', + 'ã‚›' => ' ã‚™', + 'ã‚œ' => ' ã‚š', + 'ã‚Ÿ' => 'より', + 'ヿ' => 'コト', + 'ㄱ' => 'á„€', + 'ㄲ' => 'á„', + 'ㄳ' => 'ᆪ', + 'ã„´' => 'á„‚', + 'ㄵ' => 'ᆬ', + 'ㄶ' => 'ᆭ', + 'ã„·' => 'ᄃ', + 'ㄸ' => 'á„„', + 'ㄹ' => 'á„…', + 'ㄺ' => 'ᆰ', + 'ã„»' => 'ᆱ', + 'ㄼ' => 'ᆲ', + 'ㄽ' => 'ᆳ', + 'ㄾ' => 'ᆴ', + 'ã„¿' => 'ᆵ', + 'ã…€' => 'á„š', + 'ã…' => 'ᄆ', + 'ã…‚' => 'ᄇ', + 'ã…ƒ' => 'ᄈ', + 'ã…„' => 'á„¡', + 'ã……' => 'ᄉ', + 'ã…†' => 'á„Š', + 'ã…‡' => 'á„‹', + 'ã…ˆ' => 'á„Œ', + 'ã…‰' => 'á„', + 'ã…Š' => 'á„Ž', + 'ã…‹' => 'á„', + 'ã…Œ' => 'á„', + 'ã…' => 'á„‘', + 'ã…Ž' => 'á„’', + 'ã…' => 'á…¡', + 'ã…' => 'á…¢', + 'ã…‘' => 'á…£', + 'ã…’' => 'á…¤', + 'ã…“' => 'á…¥', + 'ã…”' => 'á…¦', + 'ã…•' => 'á…§', + 'ã…–' => 'á…¨', + 'ã…—' => 'á…©', + 'ã…˜' => 'á…ª', + 'ã…™' => 'á…«', + 'ã…š' => 'á…¬', + 'ã…›' => 'á…­', + 'ã…œ' => 'á…®', + 'ã…' => 'á…¯', + 'ã…ž' => 'á…°', + 'ã…Ÿ' => 'á…±', + 'ã… ' => 'á…²', + 'ã…¡' => 'á…³', + 'ã…¢' => 'á…´', + 'ã…£' => 'á…µ', + 'ã…¤' => 'á… ', + 'ã…¥' => 'á„”', + 'ã…¦' => 'á„•', + 'ã…§' => 'ᇇ', + 'ã…¨' => 'ᇈ', + 'ã…©' => 'ᇌ', + 'ã…ª' => 'ᇎ', + 'ã…«' => 'ᇓ', + 'ã…¬' => 'ᇗ', + 'ã…­' => 'ᇙ', + 'ã…®' => 'á„œ', + 'ã…¯' => 'á‡', + 'ã…°' => 'ᇟ', + 'ã…±' => 'á„', + 'ã…²' => 'á„ž', + 'ã…³' => 'á„ ', + 'ã…´' => 'á„¢', + 'ã…µ' => 'á„£', + 'ã…¶' => 'ᄧ', + 'ã…·' => 'á„©', + 'ã…¸' => 'á„«', + 'ã…¹' => 'ᄬ', + 'ã…º' => 'á„­', + 'ã…»' => 'á„®', + 'ã…¼' => 'ᄯ', + 'ã…½' => 'ᄲ', + 'ã…¾' => 'ᄶ', + 'ã…¿' => 'á…€', + 'ㆀ' => 'á…‡', + 'ã†' => 'á…Œ', + 'ㆂ' => 'ᇱ', + 'ㆃ' => 'ᇲ', + 'ㆄ' => 'á…—', + 'ㆅ' => 'á…˜', + 'ㆆ' => 'á…™', + 'ㆇ' => 'ᆄ', + 'ㆈ' => 'ᆅ', + 'ㆉ' => 'ᆈ', + 'ㆊ' => 'ᆑ', + 'ㆋ' => 'ᆒ', + 'ㆌ' => 'ᆔ', + 'ã†' => 'ᆞ', + 'ㆎ' => 'ᆡ', + '㆒' => '一', + '㆓' => '二', + '㆔' => '三', + '㆕' => 'å››', + '㆖' => '上', + '㆗' => '中', + '㆘' => '下', + '㆙' => '甲', + '㆚' => 'ä¹™', + '㆛' => '丙', + '㆜' => 'ä¸', + 'ã†' => '天', + '㆞' => '地', + '㆟' => '人', + '㈀' => '(á„€)', + 'ãˆ' => '(á„‚)', + '㈂' => '(ᄃ)', + '㈃' => '(á„…)', + '㈄' => '(ᄆ)', + '㈅' => '(ᄇ)', + '㈆' => '(ᄉ)', + '㈇' => '(á„‹)', + '㈈' => '(á„Œ)', + '㈉' => '(á„Ž)', + '㈊' => '(á„)', + '㈋' => '(á„)', + '㈌' => '(á„‘)', + 'ãˆ' => '(á„’)', + '㈎' => '(가)', + 'ãˆ' => '(á„‚á…¡)', + 'ãˆ' => '(다)', + '㈑' => '(á„…á…¡)', + '㈒' => '(마)', + '㈓' => '(바)', + '㈔' => '(사)', + '㈕' => '(á„‹á…¡)', + '㈖' => '(자)', + '㈗' => '(á„Žá…¡)', + '㈘' => '(á„á…¡)', + '㈙' => '(á„á…¡)', + '㈚' => '(á„‘á…¡)', + '㈛' => '(á„’á…¡)', + '㈜' => '(주)', + 'ãˆ' => '(오전)', + '㈞' => '(á„‹á…©á„’á…®)', + '㈠' => '(一)', + '㈡' => '(二)', + '㈢' => '(三)', + '㈣' => '(å››)', + '㈤' => '(五)', + '㈥' => '(å…­)', + '㈦' => '(七)', + '㈧' => '(å…«)', + '㈨' => '(ä¹)', + '㈩' => '(å)', + '㈪' => '(月)', + '㈫' => '(ç«)', + '㈬' => '(æ°´)', + '㈭' => '(木)', + '㈮' => '(金)', + '㈯' => '(土)', + '㈰' => '(æ—¥)', + '㈱' => '(æ ª)', + '㈲' => '(有)', + '㈳' => '(社)', + '㈴' => '(å)', + '㈵' => '(特)', + '㈶' => '(財)', + '㈷' => '(ç¥)', + '㈸' => '(労)', + '㈹' => '(代)', + '㈺' => '(呼)', + '㈻' => '(å­¦)', + '㈼' => '(監)', + '㈽' => '(ä¼)', + '㈾' => '(資)', + '㈿' => '(å”)', + '㉀' => '(祭)', + 'ã‰' => '(休)', + '㉂' => '(自)', + '㉃' => '(至)', + '㉄' => 'å•', + '㉅' => 'å¹¼', + '㉆' => 'æ–‡', + '㉇' => 'ç®', + 'ã‰' => 'PTE', + '㉑' => '21', + '㉒' => '22', + '㉓' => '23', + '㉔' => '24', + '㉕' => '25', + '㉖' => '26', + '㉗' => '27', + '㉘' => '28', + '㉙' => '29', + '㉚' => '30', + '㉛' => '31', + '㉜' => '32', + 'ã‰' => '33', + '㉞' => '34', + '㉟' => '35', + '㉠' => 'á„€', + '㉡' => 'á„‚', + '㉢' => 'ᄃ', + '㉣' => 'á„…', + '㉤' => 'ᄆ', + '㉥' => 'ᄇ', + '㉦' => 'ᄉ', + '㉧' => 'á„‹', + '㉨' => 'á„Œ', + '㉩' => 'á„Ž', + '㉪' => 'á„', + '㉫' => 'á„', + '㉬' => 'á„‘', + '㉭' => 'á„’', + '㉮' => '가', + '㉯' => 'á„‚á…¡', + '㉰' => '다', + '㉱' => 'á„…á…¡', + '㉲' => '마', + '㉳' => '바', + '㉴' => '사', + '㉵' => 'á„‹á…¡', + '㉶' => '자', + '㉷' => 'á„Žá…¡', + '㉸' => 'á„á…¡', + '㉹' => 'á„á…¡', + '㉺' => 'á„‘á…¡', + '㉻' => 'á„’á…¡', + '㉼' => '참고', + '㉽' => '주의', + '㉾' => 'á„‹á…®', + '㊀' => '一', + 'ãŠ' => '二', + '㊂' => '三', + '㊃' => 'å››', + '㊄' => '五', + '㊅' => 'å…­', + '㊆' => '七', + '㊇' => 'å…«', + '㊈' => 'ä¹', + '㊉' => 'å', + '㊊' => '月', + '㊋' => 'ç«', + '㊌' => 'æ°´', + 'ãŠ' => '木', + '㊎' => '金', + 'ãŠ' => '土', + 'ãŠ' => 'æ—¥', + '㊑' => 'æ ª', + '㊒' => '有', + '㊓' => '社', + '㊔' => 'å', + '㊕' => '特', + '㊖' => '財', + '㊗' => 'ç¥', + '㊘' => '労', + '㊙' => '秘', + '㊚' => 'ç”·', + '㊛' => '女', + '㊜' => 'é©', + 'ãŠ' => '優', + '㊞' => 'å°', + '㊟' => '注', + '㊠' => 'é …', + '㊡' => '休', + '㊢' => '写', + '㊣' => 'æ­£', + '㊤' => '上', + '㊥' => '中', + '㊦' => '下', + '㊧' => 'å·¦', + '㊨' => 'å³', + '㊩' => '医', + '㊪' => 'å®—', + '㊫' => 'å­¦', + '㊬' => '監', + '㊭' => 'ä¼', + '㊮' => '資', + '㊯' => 'å”', + '㊰' => '夜', + '㊱' => '36', + '㊲' => '37', + '㊳' => '38', + '㊴' => '39', + '㊵' => '40', + '㊶' => '41', + '㊷' => '42', + '㊸' => '43', + '㊹' => '44', + '㊺' => '45', + '㊻' => '46', + '㊼' => '47', + '㊽' => '48', + '㊾' => '49', + '㊿' => '50', + 'ã‹€' => '1月', + 'ã‹' => '2月', + 'ã‹‚' => '3月', + '㋃' => '4月', + 'ã‹„' => '5月', + 'ã‹…' => '6月', + '㋆' => '7月', + '㋇' => '8月', + '㋈' => '9月', + '㋉' => '10月', + 'ã‹Š' => '11月', + 'ã‹‹' => '12月', + 'ã‹Œ' => 'Hg', + 'ã‹' => 'erg', + 'ã‹Ž' => 'eV', + 'ã‹' => 'LTD', + 'ã‹' => 'ã‚¢', + 'ã‹‘' => 'イ', + 'ã‹’' => 'ウ', + 'ã‹“' => 'エ', + 'ã‹”' => 'オ', + 'ã‹•' => 'ã‚«', + 'ã‹–' => 'ã‚­', + 'ã‹—' => 'ク', + '㋘' => 'ケ', + 'ã‹™' => 'コ', + 'ã‹š' => 'サ', + 'ã‹›' => 'ã‚·', + 'ã‹œ' => 'ス', + 'ã‹' => 'ã‚»', + 'ã‹ž' => 'ソ', + 'ã‹Ÿ' => 'ã‚¿', + 'ã‹ ' => 'ãƒ', + 'ã‹¡' => 'ツ', + 'ã‹¢' => 'テ', + 'ã‹£' => 'ト', + '㋤' => 'ナ', + 'ã‹¥' => 'ニ', + '㋦' => 'ヌ', + '㋧' => 'ãƒ', + '㋨' => 'ノ', + 'ã‹©' => 'ãƒ', + '㋪' => 'ヒ', + 'ã‹«' => 'フ', + '㋬' => 'ヘ', + 'ã‹­' => 'ホ', + 'ã‹®' => 'マ', + '㋯' => 'ミ', + 'ã‹°' => 'ム', + '㋱' => 'メ', + '㋲' => 'モ', + '㋳' => 'ヤ', + 'ã‹´' => 'ユ', + '㋵' => 'ヨ', + '㋶' => 'ラ', + 'ã‹·' => 'リ', + '㋸' => 'ル', + '㋹' => 'レ', + '㋺' => 'ロ', + 'ã‹»' => 'ワ', + '㋼' => 'ヰ', + '㋽' => 'ヱ', + '㋾' => 'ヲ', + 'ã‹¿' => '令和', + '㌀' => 'ã‚¢ãƒã‚šãƒ¼ãƒˆ', + 'ãŒ' => 'アルファ', + '㌂' => 'アンペア', + '㌃' => 'アール', + '㌄' => 'イニング', + '㌅' => 'インãƒ', + '㌆' => 'ウォン', + '㌇' => 'エスクード', + '㌈' => 'エーカー', + '㌉' => 'オンス', + '㌊' => 'オーム', + '㌋' => 'カイリ', + '㌌' => 'カラット', + 'ãŒ' => 'カロリー', + '㌎' => 'ガロン', + 'ãŒ' => 'ガンマ', + 'ãŒ' => 'ギガ', + '㌑' => 'ギニー', + '㌒' => 'キュリー', + '㌓' => 'ギルダー', + '㌔' => 'キロ', + '㌕' => 'キログラム', + '㌖' => 'キロメートル', + '㌗' => 'キロワット', + '㌘' => 'グラム', + '㌙' => 'グラムトン', + '㌚' => 'クルゼイロ', + '㌛' => 'クローãƒ', + '㌜' => 'ケース', + 'ãŒ' => 'コルナ', + '㌞' => 'コーポ', + '㌟' => 'サイクル', + '㌠' => 'サンãƒãƒ¼ãƒ ', + '㌡' => 'シリング', + '㌢' => 'センãƒ', + '㌣' => 'セント', + '㌤' => 'ダース', + '㌥' => 'デシ', + '㌦' => 'ドル', + '㌧' => 'トン', + '㌨' => 'ナノ', + '㌩' => 'ノット', + '㌪' => 'ãƒã‚¤ãƒ„', + '㌫' => 'ãƒã‚šãƒ¼ã‚»ãƒ³ãƒˆ', + '㌬' => 'ãƒã‚šãƒ¼ãƒ„', + '㌭' => 'ãƒã‚™ãƒ¼ãƒ¬ãƒ«', + '㌮' => 'ピアストル', + '㌯' => 'ピクル', + '㌰' => 'ピコ', + '㌱' => 'ビル', + '㌲' => 'ファラッド', + '㌳' => 'フィート', + '㌴' => 'ブッシェル', + '㌵' => 'フラン', + '㌶' => 'ヘクタール', + '㌷' => 'ペソ', + '㌸' => 'ペニヒ', + '㌹' => 'ヘルツ', + '㌺' => 'ペンス', + '㌻' => 'ページ', + '㌼' => 'ベータ', + '㌽' => 'ポイント', + '㌾' => 'ボルト', + '㌿' => 'ホン', + 'ã€' => 'ポンド', + 'ã' => 'ホール', + 'ã‚' => 'ホーン', + 'ãƒ' => 'マイクロ', + 'ã„' => 'マイル', + 'ã…' => 'マッãƒ', + 'ã†' => 'マルク', + 'ã‡' => 'マンション', + 'ãˆ' => 'ミクロン', + 'ã‰' => 'ミリ', + 'ãŠ' => 'ミリãƒã‚™ãƒ¼ãƒ«', + 'ã‹' => 'メガ', + 'ãŒ' => 'メガトン', + 'ã' => 'メートル', + 'ãŽ' => 'ヤード', + 'ã' => 'ヤール', + 'ã' => 'ユアン', + 'ã‘' => 'リットル', + 'ã’' => 'リラ', + 'ã“' => 'ルピー', + 'ã”' => 'ルーブル', + 'ã•' => 'レム', + 'ã–' => 'レントゲン', + 'ã—' => 'ワット', + 'ã˜' => '0点', + 'ã™' => '1点', + 'ãš' => '2点', + 'ã›' => '3点', + 'ãœ' => '4点', + 'ã' => '5点', + 'ãž' => '6点', + 'ãŸ' => '7点', + 'ã ' => '8点', + 'ã¡' => '9点', + 'ã¢' => '10点', + 'ã£' => '11点', + 'ã¤' => '12点', + 'ã¥' => '13点', + 'ã¦' => '14点', + 'ã§' => '15点', + 'ã¨' => '16点', + 'ã©' => '17点', + 'ãª' => '18点', + 'ã«' => '19点', + 'ã¬' => '20点', + 'ã­' => '21点', + 'ã®' => '22点', + 'ã¯' => '23点', + 'ã°' => '24点', + 'ã±' => 'hPa', + 'ã²' => 'da', + 'ã³' => 'AU', + 'ã´' => 'bar', + 'ãµ' => 'oV', + 'ã¶' => 'pc', + 'ã·' => 'dm', + 'ã¸' => 'dm2', + 'ã¹' => 'dm3', + 'ãº' => 'IU', + 'ã»' => 'å¹³æˆ', + 'ã¼' => '昭和', + 'ã½' => '大正', + 'ã¾' => '明治', + 'ã¿' => 'æ ªå¼ä¼šç¤¾', + '㎀' => 'pA', + 'ãŽ' => 'nA', + '㎂' => 'μA', + '㎃' => 'mA', + '㎄' => 'kA', + '㎅' => 'KB', + '㎆' => 'MB', + '㎇' => 'GB', + '㎈' => 'cal', + '㎉' => 'kcal', + '㎊' => 'pF', + '㎋' => 'nF', + '㎌' => 'μF', + 'ãŽ' => 'μg', + '㎎' => 'mg', + 'ãŽ' => 'kg', + 'ãŽ' => 'Hz', + '㎑' => 'kHz', + '㎒' => 'MHz', + '㎓' => 'GHz', + '㎔' => 'THz', + '㎕' => 'μl', + '㎖' => 'ml', + '㎗' => 'dl', + '㎘' => 'kl', + '㎙' => 'fm', + '㎚' => 'nm', + '㎛' => 'μm', + '㎜' => 'mm', + 'ãŽ' => 'cm', + '㎞' => 'km', + '㎟' => 'mm2', + '㎠' => 'cm2', + '㎡' => 'm2', + '㎢' => 'km2', + '㎣' => 'mm3', + '㎤' => 'cm3', + '㎥' => 'm3', + '㎦' => 'km3', + '㎧' => 'm∕s', + '㎨' => 'm∕s2', + '㎩' => 'Pa', + '㎪' => 'kPa', + '㎫' => 'MPa', + '㎬' => 'GPa', + '㎭' => 'rad', + '㎮' => 'rad∕s', + '㎯' => 'rad∕s2', + '㎰' => 'ps', + '㎱' => 'ns', + '㎲' => 'μs', + '㎳' => 'ms', + '㎴' => 'pV', + '㎵' => 'nV', + '㎶' => 'μV', + '㎷' => 'mV', + '㎸' => 'kV', + '㎹' => 'MV', + '㎺' => 'pW', + '㎻' => 'nW', + '㎼' => 'μW', + '㎽' => 'mW', + '㎾' => 'kW', + '㎿' => 'MW', + 'ã€' => 'kΩ', + 'ã' => 'MΩ', + 'ã‚' => 'a.m.', + 'ãƒ' => 'Bq', + 'ã„' => 'cc', + 'ã…' => 'cd', + 'ã†' => 'C∕kg', + 'ã‡' => 'Co.', + 'ãˆ' => 'dB', + 'ã‰' => 'Gy', + 'ãŠ' => 'ha', + 'ã‹' => 'HP', + 'ãŒ' => 'in', + 'ã' => 'KK', + 'ãŽ' => 'KM', + 'ã' => 'kt', + 'ã' => 'lm', + 'ã‘' => 'ln', + 'ã’' => 'log', + 'ã“' => 'lx', + 'ã”' => 'mb', + 'ã•' => 'mil', + 'ã–' => 'mol', + 'ã—' => 'PH', + 'ã˜' => 'p.m.', + 'ã™' => 'PPM', + 'ãš' => 'PR', + 'ã›' => 'sr', + 'ãœ' => 'Sv', + 'ã' => 'Wb', + 'ãž' => 'V∕m', + 'ãŸ' => 'A∕m', + 'ã ' => '1æ—¥', + 'ã¡' => '2æ—¥', + 'ã¢' => '3æ—¥', + 'ã£' => '4æ—¥', + 'ã¤' => '5æ—¥', + 'ã¥' => '6æ—¥', + 'ã¦' => '7æ—¥', + 'ã§' => '8æ—¥', + 'ã¨' => '9æ—¥', + 'ã©' => '10æ—¥', + 'ãª' => '11æ—¥', + 'ã«' => '12æ—¥', + 'ã¬' => '13æ—¥', + 'ã­' => '14æ—¥', + 'ã®' => '15æ—¥', + 'ã¯' => '16æ—¥', + 'ã°' => '17æ—¥', + 'ã±' => '18æ—¥', + 'ã²' => '19æ—¥', + 'ã³' => '20æ—¥', + 'ã´' => '21æ—¥', + 'ãµ' => '22æ—¥', + 'ã¶' => '23æ—¥', + 'ã·' => '24æ—¥', + 'ã¸' => '25æ—¥', + 'ã¹' => '26æ—¥', + 'ãº' => '27æ—¥', + 'ã»' => '28æ—¥', + 'ã¼' => '29æ—¥', + 'ã½' => '30æ—¥', + 'ã¾' => '31æ—¥', + 'ã¿' => 'gal', + 'êšœ' => 'ÑŠ', + 'êš' => 'ÑŒ', + 'ê°' => 'ê¯', + 'ꟸ' => 'Ħ', + 'ꟹ' => 'Å“', + 'ê­œ' => 'ꜧ', + 'ê­' => 'ꬷ', + 'ê­ž' => 'É«', + 'ê­Ÿ' => 'ê­’', + 'ê­©' => 'Ê', + 'ff' => 'ff', + 'ï¬' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'Õ´Õ¶', + 'ﬔ' => 'Õ´Õ¥', + 'ﬕ' => 'Õ´Õ«', + 'ﬖ' => 'Õ¾Õ¶', + 'ﬗ' => 'Õ´Õ­', + 'ﬠ' => '×¢', + 'ﬡ' => '×', + 'ﬢ' => 'ד', + 'ﬣ' => '×”', + 'ﬤ' => '×›', + 'ﬥ' => 'ל', + 'ﬦ' => '×', + 'ﬧ' => 'ר', + 'ﬨ' => 'ת', + '﬩' => '+', + 'ï­' => '×ל', + 'ï­' => 'Ù±', + 'ï­‘' => 'Ù±', + 'ï­’' => 'Ù»', + 'ï­“' => 'Ù»', + 'ï­”' => 'Ù»', + 'ï­•' => 'Ù»', + 'ï­–' => 'Ù¾', + 'ï­—' => 'Ù¾', + 'ï­˜' => 'Ù¾', + 'ï­™' => 'Ù¾', + 'ï­š' => 'Ú€', + 'ï­›' => 'Ú€', + 'ï­œ' => 'Ú€', + 'ï­' => 'Ú€', + 'ï­ž' => 'Ùº', + 'ï­Ÿ' => 'Ùº', + 'ï­ ' => 'Ùº', + 'ï­¡' => 'Ùº', + 'ï­¢' => 'Ù¿', + 'ï­£' => 'Ù¿', + 'ï­¤' => 'Ù¿', + 'ï­¥' => 'Ù¿', + 'ï­¦' => 'Ù¹', + 'ï­§' => 'Ù¹', + 'ï­¨' => 'Ù¹', + 'ï­©' => 'Ù¹', + 'ï­ª' => 'Ú¤', + 'ï­«' => 'Ú¤', + 'ï­¬' => 'Ú¤', + 'ï­­' => 'Ú¤', + 'ï­®' => 'Ú¦', + 'ï­¯' => 'Ú¦', + 'ï­°' => 'Ú¦', + 'ï­±' => 'Ú¦', + 'ï­²' => 'Ú„', + 'ï­³' => 'Ú„', + 'ï­´' => 'Ú„', + 'ï­µ' => 'Ú„', + 'ï­¶' => 'Úƒ', + 'ï­·' => 'Úƒ', + 'ï­¸' => 'Úƒ', + 'ï­¹' => 'Úƒ', + 'ï­º' => 'Ú†', + 'ï­»' => 'Ú†', + 'ï­¼' => 'Ú†', + 'ï­½' => 'Ú†', + 'ï­¾' => 'Ú‡', + 'ï­¿' => 'Ú‡', + 'ﮀ' => 'Ú‡', + 'ï®' => 'Ú‡', + 'ﮂ' => 'Ú', + 'ﮃ' => 'Ú', + 'ﮄ' => 'ÚŒ', + 'ï®…' => 'ÚŒ', + 'ﮆ' => 'ÚŽ', + 'ﮇ' => 'ÚŽ', + 'ﮈ' => 'Úˆ', + 'ﮉ' => 'Úˆ', + 'ﮊ' => 'Ú˜', + 'ﮋ' => 'Ú˜', + 'ﮌ' => 'Ú‘', + 'ï®' => 'Ú‘', + 'ﮎ' => 'Ú©', + 'ï®' => 'Ú©', + 'ï®' => 'Ú©', + 'ﮑ' => 'Ú©', + 'ï®’' => 'Ú¯', + 'ﮓ' => 'Ú¯', + 'ï®”' => 'Ú¯', + 'ﮕ' => 'Ú¯', + 'ï®–' => 'Ú³', + 'ï®—' => 'Ú³', + 'ﮘ' => 'Ú³', + 'ï®™' => 'Ú³', + 'ﮚ' => 'Ú±', + 'ï®›' => 'Ú±', + 'ﮜ' => 'Ú±', + 'ï®' => 'Ú±', + 'ﮞ' => 'Úº', + 'ﮟ' => 'Úº', + 'ï® ' => 'Ú»', + 'ﮡ' => 'Ú»', + 'ﮢ' => 'Ú»', + 'ﮣ' => 'Ú»', + 'ﮤ' => 'Û•Ù”', + 'ﮥ' => 'Û•Ù”', + 'ﮦ' => 'Û', + 'ﮧ' => 'Û', + 'ﮨ' => 'Û', + 'ﮩ' => 'Û', + 'ﮪ' => 'Ú¾', + 'ﮫ' => 'Ú¾', + 'ﮬ' => 'Ú¾', + 'ï®­' => 'Ú¾', + 'ï®®' => 'Û’', + 'ﮯ' => 'Û’', + 'ï®°' => 'Û’Ù”', + 'ï®±' => 'Û’Ù”', + 'ﯓ' => 'Ú­', + 'ﯔ' => 'Ú­', + 'ﯕ' => 'Ú­', + 'ﯖ' => 'Ú­', + 'ﯗ' => 'Û‡', + 'ﯘ' => 'Û‡', + 'ﯙ' => 'Û†', + 'ﯚ' => 'Û†', + 'ﯛ' => 'Ûˆ', + 'ﯜ' => 'Ûˆ', + 'ï¯' => 'Û‡Ù´', + 'ﯞ' => 'Û‹', + 'ﯟ' => 'Û‹', + 'ﯠ' => 'Û…', + 'ﯡ' => 'Û…', + 'ﯢ' => 'Û‰', + 'ﯣ' => 'Û‰', + 'ﯤ' => 'Û', + 'ﯥ' => 'Û', + 'ﯦ' => 'Û', + 'ﯧ' => 'Û', + 'ﯨ' => 'Ù‰', + 'ﯩ' => 'Ù‰', + 'ﯪ' => 'ئا', + 'ﯫ' => 'ئا', + 'ﯬ' => 'ÙŠÙ”Û•', + 'ﯭ' => 'ÙŠÙ”Û•', + 'ﯮ' => 'ÙŠÙ”Ùˆ', + 'ﯯ' => 'ÙŠÙ”Ùˆ', + 'ﯰ' => 'ÙŠÙ”Û‡', + 'ﯱ' => 'ÙŠÙ”Û‡', + 'ﯲ' => 'ÙŠÙ”Û†', + 'ﯳ' => 'ÙŠÙ”Û†', + 'ﯴ' => 'ÙŠÙ”Ûˆ', + 'ﯵ' => 'ÙŠÙ”Ûˆ', + 'ﯶ' => 'ÙŠÙ”Û', + 'ﯷ' => 'ÙŠÙ”Û', + 'ﯸ' => 'ÙŠÙ”Û', + 'ﯹ' => 'ÙŠÙ”Ù‰', + 'ﯺ' => 'ÙŠÙ”Ù‰', + 'ﯻ' => 'ÙŠÙ”Ù‰', + 'ﯼ' => 'ÛŒ', + 'ﯽ' => 'ÛŒ', + 'ﯾ' => 'ÛŒ', + 'ﯿ' => 'ÛŒ', + 'ï°€' => 'ئج', + 'ï°' => 'ئح', + 'ï°‚' => 'ÙŠÙ”Ù…', + 'ï°ƒ' => 'ÙŠÙ”Ù‰', + 'ï°„' => 'ÙŠÙ”ÙŠ', + 'ï°…' => 'بج', + 'ï°†' => 'بح', + 'ï°‡' => 'بخ', + 'ï°ˆ' => 'بم', + 'ï°‰' => 'بى', + 'ï°Š' => 'بي', + 'ï°‹' => 'تج', + 'ï°Œ' => 'تح', + 'ï°' => 'تخ', + 'ï°Ž' => 'تم', + 'ï°' => 'تى', + 'ï°' => 'تي', + 'ï°‘' => 'ثج', + 'ï°’' => 'ثم', + 'ï°“' => 'ثى', + 'ï°”' => 'ثي', + 'ï°•' => 'جح', + 'ï°–' => 'جم', + 'ï°—' => 'حج', + 'ï°˜' => 'حم', + 'ï°™' => 'خج', + 'ï°š' => 'خح', + 'ï°›' => 'خم', + 'ï°œ' => 'سج', + 'ï°' => 'سح', + 'ï°ž' => 'سخ', + 'ï°Ÿ' => 'سم', + 'ï° ' => 'صح', + 'ï°¡' => 'صم', + 'ï°¢' => 'ضج', + 'ï°£' => 'ضح', + 'ï°¤' => 'ضخ', + 'ï°¥' => 'ضم', + 'ï°¦' => 'طح', + 'ï°§' => 'طم', + 'ï°¨' => 'ظم', + 'ï°©' => 'عج', + 'ï°ª' => 'عم', + 'ï°«' => 'غج', + 'ï°¬' => 'غم', + 'ï°­' => 'Ùج', + 'ï°®' => 'ÙØ­', + 'ï°¯' => 'ÙØ®', + 'ï°°' => 'ÙÙ…', + 'ï°±' => 'ÙÙ‰', + 'ï°²' => 'ÙÙŠ', + 'ï°³' => 'قح', + 'ï°´' => 'قم', + 'ï°µ' => 'قى', + 'ï°¶' => 'قي', + 'ï°·' => 'كا', + 'ï°¸' => 'كج', + 'ï°¹' => 'كح', + 'ï°º' => 'كخ', + 'ï°»' => 'كل', + 'ï°¼' => 'كم', + 'ï°½' => 'كى', + 'ï°¾' => 'كي', + 'ï°¿' => 'لج', + 'ï±€' => 'لح', + 'ï±' => 'لخ', + 'ﱂ' => 'لم', + 'ﱃ' => 'لى', + 'ﱄ' => 'لي', + 'ï±…' => 'مج', + 'ﱆ' => 'مح', + 'ﱇ' => 'مخ', + 'ﱈ' => 'مم', + 'ﱉ' => 'مى', + 'ﱊ' => 'مي', + 'ﱋ' => 'نج', + 'ﱌ' => 'نح', + 'ï±' => 'نخ', + 'ﱎ' => 'نم', + 'ï±' => 'نى', + 'ï±' => 'ني', + 'ﱑ' => 'هج', + 'ï±’' => 'هم', + 'ﱓ' => 'هى', + 'ï±”' => 'هي', + 'ﱕ' => 'يج', + 'ï±–' => 'يح', + 'ï±—' => 'يخ', + 'ﱘ' => 'يم', + 'ï±™' => 'يى', + 'ﱚ' => 'يي', + 'ï±›' => 'ذٰ', + 'ﱜ' => 'رٰ', + 'ï±' => 'ىٰ', + 'ﱞ' => ' ٌّ', + 'ﱟ' => ' ÙÙ‘', + 'ï± ' => ' ÙŽÙ‘', + 'ﱡ' => ' ÙÙ‘', + 'ï±¢' => ' ÙÙ‘', + 'ï±£' => ' ّٰ', + 'ﱤ' => 'ئر', + 'ï±¥' => 'ئز', + 'ﱦ' => 'ÙŠÙ”Ù…', + 'ﱧ' => 'ÙŠÙ”Ù†', + 'ﱨ' => 'ÙŠÙ”Ù‰', + 'ﱩ' => 'ÙŠÙ”ÙŠ', + 'ﱪ' => 'بر', + 'ﱫ' => 'بز', + 'ﱬ' => 'بم', + 'ï±­' => 'بن', + 'ï±®' => 'بى', + 'ﱯ' => 'بي', + 'ï±°' => 'تر', + 'ï±±' => 'تز', + 'ï±²' => 'تم', + 'ï±³' => 'تن', + 'ï±´' => 'تى', + 'ï±µ' => 'تي', + 'ﱶ' => 'ثر', + 'ï±·' => 'ثز', + 'ﱸ' => 'ثم', + 'ï±¹' => 'ثن', + 'ﱺ' => 'ثى', + 'ï±»' => 'ثي', + 'ï±¼' => 'ÙÙ‰', + 'ï±½' => 'ÙÙŠ', + 'ï±¾' => 'قى', + 'ﱿ' => 'قي', + 'ï²€' => 'كا', + 'ï²' => 'كل', + 'ﲂ' => 'كم', + 'ﲃ' => 'كى', + 'ﲄ' => 'كي', + 'ï²…' => 'لم', + 'ﲆ' => 'لى', + 'ﲇ' => 'لي', + 'ﲈ' => 'ما', + 'ﲉ' => 'مم', + 'ﲊ' => 'نر', + 'ﲋ' => 'نز', + 'ﲌ' => 'نم', + 'ï²' => 'نن', + 'ﲎ' => 'نى', + 'ï²' => 'ني', + 'ï²' => 'ىٰ', + 'ﲑ' => 'ير', + 'ï²’' => 'يز', + 'ﲓ' => 'يم', + 'ï²”' => 'ين', + 'ﲕ' => 'يى', + 'ï²–' => 'يي', + 'ï²—' => 'ئج', + 'ﲘ' => 'ئح', + 'ï²™' => 'ئخ', + 'ﲚ' => 'ÙŠÙ”Ù…', + 'ï²›' => 'ÙŠÙ”Ù‡', + 'ﲜ' => 'بج', + 'ï²' => 'بح', + 'ﲞ' => 'بخ', + 'ﲟ' => 'بم', + 'ï² ' => 'به', + 'ﲡ' => 'تج', + 'ï²¢' => 'تح', + 'ï²£' => 'تخ', + 'ﲤ' => 'تم', + 'ï²¥' => 'ته', + 'ﲦ' => 'ثم', + 'ﲧ' => 'جح', + 'ﲨ' => 'جم', + 'ﲩ' => 'حج', + 'ﲪ' => 'حم', + 'ﲫ' => 'خج', + 'ﲬ' => 'خم', + 'ï²­' => 'سج', + 'ï²®' => 'سح', + 'ﲯ' => 'سخ', + 'ï²°' => 'سم', + 'ï²±' => 'صح', + 'ï²²' => 'صخ', + 'ï²³' => 'صم', + 'ï²´' => 'ضج', + 'ï²µ' => 'ضح', + 'ﲶ' => 'ضخ', + 'ï²·' => 'ضم', + 'ﲸ' => 'طح', + 'ï²¹' => 'ظم', + 'ﲺ' => 'عج', + 'ï²»' => 'عم', + 'ï²¼' => 'غج', + 'ï²½' => 'غم', + 'ï²¾' => 'Ùج', + 'ﲿ' => 'ÙØ­', + 'ï³€' => 'ÙØ®', + 'ï³' => 'ÙÙ…', + 'ﳂ' => 'قح', + 'ﳃ' => 'قم', + 'ﳄ' => 'كج', + 'ï³…' => 'كح', + 'ﳆ' => 'كخ', + 'ﳇ' => 'كل', + 'ﳈ' => 'كم', + 'ﳉ' => 'لج', + 'ﳊ' => 'لح', + 'ﳋ' => 'لخ', + 'ﳌ' => 'لم', + 'ï³' => 'له', + 'ﳎ' => 'مج', + 'ï³' => 'مح', + 'ï³' => 'مخ', + 'ﳑ' => 'مم', + 'ï³’' => 'نج', + 'ﳓ' => 'نح', + 'ï³”' => 'نخ', + 'ﳕ' => 'نم', + 'ï³–' => 'نه', + 'ï³—' => 'هج', + 'ﳘ' => 'هم', + 'ï³™' => 'هٰ', + 'ﳚ' => 'يج', + 'ï³›' => 'يح', + 'ﳜ' => 'يخ', + 'ï³' => 'يم', + 'ﳞ' => 'يه', + 'ﳟ' => 'ÙŠÙ”Ù…', + 'ï³ ' => 'ÙŠÙ”Ù‡', + 'ﳡ' => 'بم', + 'ï³¢' => 'به', + 'ï³£' => 'تم', + 'ﳤ' => 'ته', + 'ï³¥' => 'ثم', + 'ﳦ' => 'ثه', + 'ﳧ' => 'سم', + 'ﳨ' => 'سه', + 'ﳩ' => 'شم', + 'ﳪ' => 'شه', + 'ﳫ' => 'كل', + 'ﳬ' => 'كم', + 'ï³­' => 'لم', + 'ï³®' => 'نم', + 'ﳯ' => 'نه', + 'ï³°' => 'يم', + 'ï³±' => 'يه', + 'ï³²' => 'Ù€ÙŽÙ‘', + 'ï³³' => 'Ù€ÙÙ‘', + 'ï³´' => 'Ù€ÙÙ‘', + 'ï³µ' => 'طى', + 'ﳶ' => 'طي', + 'ï³·' => 'عى', + 'ﳸ' => 'عي', + 'ï³¹' => 'غى', + 'ﳺ' => 'غي', + 'ï³»' => 'سى', + 'ï³¼' => 'سي', + 'ï³½' => 'شى', + 'ï³¾' => 'شي', + 'ﳿ' => 'حى', + 'ï´€' => 'حي', + 'ï´' => 'جى', + 'ï´‚' => 'جي', + 'ï´ƒ' => 'خى', + 'ï´„' => 'خي', + 'ï´…' => 'صى', + 'ï´†' => 'صي', + 'ï´‡' => 'ضى', + 'ï´ˆ' => 'ضي', + 'ï´‰' => 'شج', + 'ï´Š' => 'شح', + 'ï´‹' => 'شخ', + 'ï´Œ' => 'شم', + 'ï´' => 'شر', + 'ï´Ž' => 'سر', + 'ï´' => 'صر', + 'ï´' => 'ضر', + 'ï´‘' => 'طى', + 'ï´’' => 'طي', + 'ï´“' => 'عى', + 'ï´”' => 'عي', + 'ï´•' => 'غى', + 'ï´–' => 'غي', + 'ï´—' => 'سى', + 'ï´˜' => 'سي', + 'ï´™' => 'شى', + 'ï´š' => 'شي', + 'ï´›' => 'حى', + 'ï´œ' => 'حي', + 'ï´' => 'جى', + 'ï´ž' => 'جي', + 'ï´Ÿ' => 'خى', + 'ï´ ' => 'خي', + 'ï´¡' => 'صى', + 'ï´¢' => 'صي', + 'ï´£' => 'ضى', + 'ï´¤' => 'ضي', + 'ï´¥' => 'شج', + 'ï´¦' => 'شح', + 'ï´§' => 'شخ', + 'ï´¨' => 'شم', + 'ï´©' => 'شر', + 'ï´ª' => 'سر', + 'ï´«' => 'صر', + 'ï´¬' => 'ضر', + 'ï´­' => 'شج', + 'ï´®' => 'شح', + 'ï´¯' => 'شخ', + 'ï´°' => 'شم', + 'ï´±' => 'سه', + 'ï´²' => 'شه', + 'ï´³' => 'طم', + 'ï´´' => 'سج', + 'ï´µ' => 'سح', + 'ï´¶' => 'سخ', + 'ï´·' => 'شج', + 'ï´¸' => 'شح', + 'ï´¹' => 'شخ', + 'ï´º' => 'طم', + 'ï´»' => 'ظم', + 'ï´¼' => 'اً', + 'ï´½' => 'اً', + 'ïµ' => 'تجم', + 'ﵑ' => 'تحج', + 'ïµ’' => 'تحج', + 'ﵓ' => 'تحم', + 'ïµ”' => 'تخم', + 'ﵕ' => 'تمج', + 'ïµ–' => 'تمح', + 'ïµ—' => 'تمخ', + 'ﵘ' => 'جمح', + 'ïµ™' => 'جمح', + 'ﵚ' => 'حمي', + 'ïµ›' => 'حمى', + 'ﵜ' => 'سحج', + 'ïµ' => 'سجح', + 'ﵞ' => 'سجى', + 'ﵟ' => 'سمح', + 'ïµ ' => 'سمح', + 'ﵡ' => 'سمج', + 'ïµ¢' => 'سمم', + 'ïµ£' => 'سمم', + 'ﵤ' => 'صحح', + 'ïµ¥' => 'صحح', + 'ﵦ' => 'صمم', + 'ﵧ' => 'شحم', + 'ﵨ' => 'شحم', + 'ﵩ' => 'شجي', + 'ﵪ' => 'شمخ', + 'ﵫ' => 'شمخ', + 'ﵬ' => 'شمم', + 'ïµ­' => 'شمم', + 'ïµ®' => 'ضحى', + 'ﵯ' => 'ضخم', + 'ïµ°' => 'ضخم', + 'ïµ±' => 'طمح', + 'ïµ²' => 'طمح', + 'ïµ³' => 'طمم', + 'ïµ´' => 'طمي', + 'ïµµ' => 'عجم', + 'ﵶ' => 'عمم', + 'ïµ·' => 'عمم', + 'ﵸ' => 'عمى', + 'ïµ¹' => 'غمم', + 'ﵺ' => 'غمي', + 'ïµ»' => 'غمى', + 'ïµ¼' => 'Ùخم', + 'ïµ½' => 'Ùخم', + 'ïµ¾' => 'قمح', + 'ﵿ' => 'قمم', + 'ﶀ' => 'لحم', + 'ï¶' => 'لحي', + 'ﶂ' => 'لحى', + 'ﶃ' => 'لجج', + 'ﶄ' => 'لجج', + 'ﶅ' => 'لخم', + 'ﶆ' => 'لخم', + 'ﶇ' => 'لمح', + 'ﶈ' => 'لمح', + 'ﶉ' => 'محج', + 'ﶊ' => 'محم', + 'ﶋ' => 'محي', + 'ﶌ' => 'مجح', + 'ï¶' => 'مجم', + 'ﶎ' => 'مخج', + 'ï¶' => 'مخم', + 'ﶒ' => 'مجخ', + 'ﶓ' => 'همج', + 'ﶔ' => 'همم', + 'ﶕ' => 'نحم', + 'ﶖ' => 'نحى', + 'ﶗ' => 'نجم', + 'ﶘ' => 'نجم', + 'ﶙ' => 'نجى', + 'ﶚ' => 'نمي', + 'ﶛ' => 'نمى', + 'ﶜ' => 'يمم', + 'ï¶' => 'يمم', + 'ﶞ' => 'بخي', + 'ﶟ' => 'تجي', + 'ﶠ' => 'تجى', + 'ﶡ' => 'تخي', + 'ﶢ' => 'تخى', + 'ﶣ' => 'تمي', + 'ﶤ' => 'تمى', + 'ﶥ' => 'جمي', + 'ﶦ' => 'جحى', + 'ﶧ' => 'جمى', + 'ﶨ' => 'سخى', + 'ﶩ' => 'صحي', + 'ﶪ' => 'شحي', + 'ﶫ' => 'ضحي', + 'ﶬ' => 'لجي', + 'ﶭ' => 'لمي', + 'ﶮ' => 'يحي', + 'ﶯ' => 'يجي', + 'ﶰ' => 'يمي', + 'ﶱ' => 'ممي', + 'ﶲ' => 'قمي', + 'ﶳ' => 'نحي', + 'ﶴ' => 'قمح', + 'ﶵ' => 'لحم', + 'ﶶ' => 'عمي', + 'ﶷ' => 'كمي', + 'ﶸ' => 'نجح', + 'ﶹ' => 'مخي', + 'ﶺ' => 'لجم', + 'ﶻ' => 'كمم', + 'ﶼ' => 'لجم', + 'ﶽ' => 'نجح', + 'ﶾ' => 'جحي', + 'ﶿ' => 'حجي', + 'ï·€' => 'مجي', + 'ï·' => 'Ùمي', + 'ï·‚' => 'بحي', + 'ï·ƒ' => 'كمم', + 'ï·„' => 'عجم', + 'ï·…' => 'صمم', + 'ï·†' => 'سخي', + 'ï·‡' => 'نجي', + 'ï·°' => 'صلے', + 'ï·±' => 'قلے', + 'ï·²' => 'الله', + 'ï·³' => 'اكبر', + 'ï·´' => 'محمد', + 'ï·µ' => 'صلعم', + 'ï·¶' => 'رسول', + 'ï··' => 'عليه', + 'ï·¸' => 'وسلم', + 'ï·¹' => 'صلى', + 'ï·º' => 'صلى الله عليه وسلم', + 'ï·»' => 'جل جلاله', + 'ï·¼' => 'ریال', + 'ï¸' => ',', + '︑' => 'ã€', + '︒' => '。', + '︓' => ':', + '︔' => ';', + '︕' => '!', + '︖' => '?', + '︗' => '〖', + '︘' => '〗', + '︙' => '...', + '︰' => '..', + '︱' => '—', + '︲' => '–', + '︳' => '_', + '︴' => '_', + '︵' => '(', + '︶' => ')', + '︷' => '{', + '︸' => '}', + '︹' => '〔', + '︺' => '〕', + '︻' => 'ã€', + '︼' => '】', + '︽' => '《', + '︾' => '》', + '︿' => '〈', + 'ï¹€' => '〉', + 'ï¹' => '「', + '﹂' => 'ã€', + '﹃' => '『', + '﹄' => 'ã€', + '﹇' => '[', + '﹈' => ']', + '﹉' => ' Ì…', + '﹊' => ' Ì…', + '﹋' => ' Ì…', + '﹌' => ' Ì…', + 'ï¹' => '_', + '﹎' => '_', + 'ï¹' => '_', + 'ï¹' => ',', + '﹑' => 'ã€', + 'ï¹’' => '.', + 'ï¹”' => ';', + '﹕' => ':', + 'ï¹–' => '?', + 'ï¹—' => '!', + '﹘' => '—', + 'ï¹™' => '(', + '﹚' => ')', + 'ï¹›' => '{', + '﹜' => '}', + 'ï¹' => '〔', + '﹞' => '〕', + '﹟' => '#', + 'ï¹ ' => '&', + '﹡' => '*', + 'ï¹¢' => '+', + 'ï¹£' => '-', + '﹤' => '<', + 'ï¹¥' => '>', + '﹦' => '=', + '﹨' => '\\', + '﹩' => '$', + '﹪' => '%', + '﹫' => '@', + 'ï¹°' => ' Ù‹', + 'ï¹±' => 'ـً', + 'ï¹²' => ' ÙŒ', + 'ï¹´' => ' Ù', + 'ﹶ' => ' ÙŽ', + 'ï¹·' => 'Ù€ÙŽ', + 'ﹸ' => ' Ù', + 'ï¹¹' => 'Ù€Ù', + 'ﹺ' => ' Ù', + 'ï¹»' => 'Ù€Ù', + 'ï¹¼' => ' Ù‘', + 'ï¹½' => 'ـّ', + 'ï¹¾' => ' Ù’', + 'ﹿ' => 'ـْ', + 'ﺀ' => 'Ø¡', + 'ïº' => 'آ', + 'ﺂ' => 'آ', + 'ﺃ' => 'أ', + 'ﺄ' => 'أ', + 'ﺅ' => 'ÙˆÙ”', + 'ﺆ' => 'ÙˆÙ”', + 'ﺇ' => 'إ', + 'ﺈ' => 'إ', + 'ﺉ' => 'ÙŠÙ”', + 'ﺊ' => 'ÙŠÙ”', + 'ﺋ' => 'ÙŠÙ”', + 'ﺌ' => 'ÙŠÙ”', + 'ïº' => 'ا', + 'ﺎ' => 'ا', + 'ïº' => 'ب', + 'ïº' => 'ب', + 'ﺑ' => 'ب', + 'ﺒ' => 'ب', + 'ﺓ' => 'Ø©', + 'ﺔ' => 'Ø©', + 'ﺕ' => 'ت', + 'ﺖ' => 'ت', + 'ﺗ' => 'ت', + 'ﺘ' => 'ت', + 'ﺙ' => 'Ø«', + 'ﺚ' => 'Ø«', + 'ﺛ' => 'Ø«', + 'ﺜ' => 'Ø«', + 'ïº' => 'ج', + 'ﺞ' => 'ج', + 'ﺟ' => 'ج', + 'ﺠ' => 'ج', + 'ﺡ' => 'Ø­', + 'ﺢ' => 'Ø­', + 'ﺣ' => 'Ø­', + 'ﺤ' => 'Ø­', + 'ﺥ' => 'Ø®', + 'ﺦ' => 'Ø®', + 'ﺧ' => 'Ø®', + 'ﺨ' => 'Ø®', + 'ﺩ' => 'د', + 'ﺪ' => 'د', + 'ﺫ' => 'Ø°', + 'ﺬ' => 'Ø°', + 'ﺭ' => 'ر', + 'ﺮ' => 'ر', + 'ﺯ' => 'ز', + 'ﺰ' => 'ز', + 'ﺱ' => 'س', + 'ﺲ' => 'س', + 'ﺳ' => 'س', + 'ﺴ' => 'س', + 'ﺵ' => 'Ø´', + 'ﺶ' => 'Ø´', + 'ﺷ' => 'Ø´', + 'ﺸ' => 'Ø´', + 'ﺹ' => 'ص', + 'ﺺ' => 'ص', + 'ﺻ' => 'ص', + 'ﺼ' => 'ص', + 'ﺽ' => 'ض', + 'ﺾ' => 'ض', + 'ﺿ' => 'ض', + 'ﻀ' => 'ض', + 'ï»' => 'Ø·', + 'ﻂ' => 'Ø·', + 'ﻃ' => 'Ø·', + 'ﻄ' => 'Ø·', + 'ï»…' => 'ظ', + 'ﻆ' => 'ظ', + 'ﻇ' => 'ظ', + 'ﻈ' => 'ظ', + 'ﻉ' => 'ع', + 'ﻊ' => 'ع', + 'ﻋ' => 'ع', + 'ﻌ' => 'ع', + 'ï»' => 'غ', + 'ﻎ' => 'غ', + 'ï»' => 'غ', + 'ï»' => 'غ', + 'ﻑ' => 'Ù', + 'ï»’' => 'Ù', + 'ﻓ' => 'Ù', + 'ï»”' => 'Ù', + 'ﻕ' => 'Ù‚', + 'ï»–' => 'Ù‚', + 'ï»—' => 'Ù‚', + 'ﻘ' => 'Ù‚', + 'ï»™' => 'Ùƒ', + 'ﻚ' => 'Ùƒ', + 'ï»›' => 'Ùƒ', + 'ﻜ' => 'Ùƒ', + 'ï»' => 'Ù„', + 'ﻞ' => 'Ù„', + 'ﻟ' => 'Ù„', + 'ï» ' => 'Ù„', + 'ﻡ' => 'Ù…', + 'ﻢ' => 'Ù…', + 'ﻣ' => 'Ù…', + 'ﻤ' => 'Ù…', + 'ﻥ' => 'Ù†', + 'ﻦ' => 'Ù†', + 'ﻧ' => 'Ù†', + 'ﻨ' => 'Ù†', + 'ﻩ' => 'Ù‡', + 'ﻪ' => 'Ù‡', + 'ﻫ' => 'Ù‡', + 'ﻬ' => 'Ù‡', + 'ï»­' => 'Ùˆ', + 'ï»®' => 'Ùˆ', + 'ﻯ' => 'Ù‰', + 'ï»°' => 'Ù‰', + 'ï»±' => 'ÙŠ', + 'ﻲ' => 'ÙŠ', + 'ﻳ' => 'ÙŠ', + 'ï»´' => 'ÙŠ', + 'ﻵ' => 'لآ', + 'ﻶ' => 'لآ', + 'ï»·' => 'لأ', + 'ﻸ' => 'لأ', + 'ﻹ' => 'لإ', + 'ﻺ' => 'لإ', + 'ï»»' => 'لا', + 'ﻼ' => 'لا', + 'ï¼' => '!', + '"' => '"', + '#' => '#', + '$' => '$', + 'ï¼…' => '%', + '&' => '&', + ''' => '\'', + '(' => '(', + ')' => ')', + '*' => '*', + '+' => '+', + ',' => ',', + 'ï¼' => '-', + '.' => '.', + 'ï¼' => '/', + 'ï¼' => '0', + '1' => '1', + 'ï¼’' => '2', + '3' => '3', + 'ï¼”' => '4', + '5' => '5', + 'ï¼–' => '6', + 'ï¼—' => '7', + '8' => '8', + 'ï¼™' => '9', + ':' => ':', + 'ï¼›' => ';', + '<' => '<', + 'ï¼' => '=', + '>' => '>', + '?' => '?', + 'ï¼ ' => '@', + 'A' => 'A', + 'ï¼¢' => 'B', + 'ï¼£' => 'C', + 'D' => 'D', + 'ï¼¥' => 'E', + 'F' => 'F', + 'G' => 'G', + 'H' => 'H', + 'I' => 'I', + 'J' => 'J', + 'K' => 'K', + 'L' => 'L', + 'ï¼­' => 'M', + 'ï¼®' => 'N', + 'O' => 'O', + 'ï¼°' => 'P', + 'ï¼±' => 'Q', + 'ï¼²' => 'R', + 'ï¼³' => 'S', + 'ï¼´' => 'T', + 'ï¼µ' => 'U', + 'V' => 'V', + 'ï¼·' => 'W', + 'X' => 'X', + 'ï¼¹' => 'Y', + 'Z' => 'Z', + 'ï¼»' => '[', + 'ï¼¼' => '\\', + 'ï¼½' => ']', + 'ï¼¾' => '^', + '_' => '_', + 'ï½€' => '`', + 'ï½' => 'a', + 'b' => 'b', + 'c' => 'c', + 'd' => 'd', + 'ï½…' => 'e', + 'f' => 'f', + 'g' => 'g', + 'h' => 'h', + 'i' => 'i', + 'j' => 'j', + 'k' => 'k', + 'l' => 'l', + 'ï½' => 'm', + 'n' => 'n', + 'ï½' => 'o', + 'ï½' => 'p', + 'q' => 'q', + 'ï½’' => 'r', + 's' => 's', + 'ï½”' => 't', + 'u' => 'u', + 'ï½–' => 'v', + 'ï½—' => 'w', + 'x' => 'x', + 'ï½™' => 'y', + 'z' => 'z', + 'ï½›' => '{', + '|' => '|', + 'ï½' => '}', + '~' => '~', + '⦅' => '⦅', + 'ï½ ' => '⦆', + '。' => '。', + 'ï½¢' => '「', + 'ï½£' => 'ã€', + '、' => 'ã€', + 'ï½¥' => '・', + 'ヲ' => 'ヲ', + 'ァ' => 'ã‚¡', + 'ィ' => 'ã‚£', + 'ゥ' => 'ã‚¥', + 'ェ' => 'ェ', + 'ォ' => 'ã‚©', + 'ャ' => 'ャ', + 'ï½­' => 'ュ', + 'ï½®' => 'ョ', + 'ッ' => 'ッ', + 'ï½°' => 'ー', + 'ï½±' => 'ã‚¢', + 'ï½²' => 'イ', + 'ï½³' => 'ウ', + 'ï½´' => 'エ', + 'ï½µ' => 'オ', + 'カ' => 'ã‚«', + 'ï½·' => 'ã‚­', + 'ク' => 'ク', + 'ï½¹' => 'ケ', + 'コ' => 'コ', + 'ï½»' => 'サ', + 'ï½¼' => 'ã‚·', + 'ï½½' => 'ス', + 'ï½¾' => 'ã‚»', + 'ソ' => 'ソ', + 'ï¾€' => 'ã‚¿', + 'ï¾' => 'ãƒ', + 'ツ' => 'ツ', + 'テ' => 'テ', + 'ト' => 'ト', + 'ï¾…' => 'ナ', + 'ニ' => 'ニ', + 'ヌ' => 'ヌ', + 'ネ' => 'ãƒ', + 'ノ' => 'ノ', + 'ハ' => 'ãƒ', + 'ヒ' => 'ヒ', + 'フ' => 'フ', + 'ï¾' => 'ヘ', + 'ホ' => 'ホ', + 'ï¾' => 'マ', + 'ï¾' => 'ミ', + 'ム' => 'ム', + 'ï¾’' => 'メ', + 'モ' => 'モ', + 'ï¾”' => 'ヤ', + 'ユ' => 'ユ', + 'ï¾–' => 'ヨ', + 'ï¾—' => 'ラ', + 'リ' => 'リ', + 'ï¾™' => 'ル', + 'レ' => 'レ', + 'ï¾›' => 'ロ', + 'ワ' => 'ワ', + 'ï¾' => 'ン', + '゙' => 'ã‚™', + '゚' => 'ã‚š', + 'ï¾ ' => 'á… ', + 'ᄀ' => 'á„€', + 'ï¾¢' => 'á„', + 'ï¾£' => 'ᆪ', + 'ᄂ' => 'á„‚', + 'ï¾¥' => 'ᆬ', + 'ᆭ' => 'ᆭ', + 'ᄃ' => 'ᄃ', + 'ᄄ' => 'á„„', + 'ᄅ' => 'á„…', + 'ᆰ' => 'ᆰ', + 'ᆱ' => 'ᆱ', + 'ᆲ' => 'ᆲ', + 'ï¾­' => 'ᆳ', + 'ï¾®' => 'ᆴ', + 'ᆵ' => 'ᆵ', + 'ï¾°' => 'á„š', + 'ï¾±' => 'ᄆ', + 'ï¾²' => 'ᄇ', + 'ï¾³' => 'ᄈ', + 'ï¾´' => 'á„¡', + 'ï¾µ' => 'ᄉ', + 'ᄊ' => 'á„Š', + 'ï¾·' => 'á„‹', + 'ᄌ' => 'á„Œ', + 'ï¾¹' => 'á„', + 'ᄎ' => 'á„Ž', + 'ï¾»' => 'á„', + 'ï¾¼' => 'á„', + 'ï¾½' => 'á„‘', + 'ï¾¾' => 'á„’', + 'ï¿‚' => 'á…¡', + 'ᅢ' => 'á…¢', + 'ï¿„' => 'á…£', + 'ï¿…' => 'á…¤', + 'ᅥ' => 'á…¥', + 'ᅦ' => 'á…¦', + 'ï¿Š' => 'á…§', + 'ï¿‹' => 'á…¨', + 'ï¿Œ' => 'á…©', + 'ï¿' => 'á…ª', + 'ï¿Ž' => 'á…«', + 'ï¿' => 'á…¬', + 'ï¿’' => 'á…­', + 'ï¿“' => 'á…®', + 'ï¿”' => 'á…¯', + 'ï¿•' => 'á…°', + 'ï¿–' => 'á…±', + 'ï¿—' => 'á…²', + 'ï¿š' => 'á…³', + 'ï¿›' => 'á…´', + 'ï¿œ' => 'á…µ', + 'ï¿ ' => '¢', + 'ï¿¡' => '£', + 'ï¿¢' => '¬', + 'ï¿£' => ' Ì„', + '¦' => '¦', + 'ï¿¥' => 'Â¥', + '₩' => 'â‚©', + '│' => '│', + 'ï¿©' => 'â†', + '↑' => '↑', + 'ï¿«' => '→', + '↓' => '↓', + 'ï¿­' => 'â– ', + 'ï¿®' => 'â—‹', + 'ð€' => 'A', + 'ð' => 'B', + 'ð‚' => 'C', + 'ðƒ' => 'D', + 'ð„' => 'E', + 'ð…' => 'F', + 'ð†' => 'G', + 'ð‡' => 'H', + 'ðˆ' => 'I', + 'ð‰' => 'J', + 'ðŠ' => 'K', + 'ð‹' => 'L', + 'ðŒ' => 'M', + 'ð' => 'N', + 'ðŽ' => 'O', + 'ð' => 'P', + 'ð' => 'Q', + 'ð‘' => 'R', + 'ð’' => 'S', + 'ð“' => 'T', + 'ð”' => 'U', + 'ð•' => 'V', + 'ð–' => 'W', + 'ð—' => 'X', + 'ð˜' => 'Y', + 'ð™' => 'Z', + 'ðš' => 'a', + 'ð›' => 'b', + 'ðœ' => 'c', + 'ð' => 'd', + 'ðž' => 'e', + 'ðŸ' => 'f', + 'ð ' => 'g', + 'ð¡' => 'h', + 'ð¢' => 'i', + 'ð£' => 'j', + 'ð¤' => 'k', + 'ð¥' => 'l', + 'ð¦' => 'm', + 'ð§' => 'n', + 'ð¨' => 'o', + 'ð©' => 'p', + 'ðª' => 'q', + 'ð«' => 'r', + 'ð¬' => 's', + 'ð­' => 't', + 'ð®' => 'u', + 'ð¯' => 'v', + 'ð°' => 'w', + 'ð±' => 'x', + 'ð²' => 'y', + 'ð³' => 'z', + 'ð´' => 'A', + 'ðµ' => 'B', + 'ð¶' => 'C', + 'ð·' => 'D', + 'ð¸' => 'E', + 'ð¹' => 'F', + 'ðº' => 'G', + 'ð»' => 'H', + 'ð¼' => 'I', + 'ð½' => 'J', + 'ð¾' => 'K', + 'ð¿' => 'L', + 'ð‘€' => 'M', + 'ð‘' => 'N', + 'ð‘‚' => 'O', + 'ð‘ƒ' => 'P', + 'ð‘„' => 'Q', + 'ð‘…' => 'R', + 'ð‘†' => 'S', + 'ð‘‡' => 'T', + 'ð‘ˆ' => 'U', + 'ð‘‰' => 'V', + 'ð‘Š' => 'W', + 'ð‘‹' => 'X', + 'ð‘Œ' => 'Y', + 'ð‘' => 'Z', + 'ð‘Ž' => 'a', + 'ð‘' => 'b', + 'ð‘' => 'c', + 'ð‘‘' => 'd', + 'ð‘’' => 'e', + 'ð‘“' => 'f', + 'ð‘”' => 'g', + 'ð‘–' => 'i', + 'ð‘—' => 'j', + 'ð‘˜' => 'k', + 'ð‘™' => 'l', + 'ð‘š' => 'm', + 'ð‘›' => 'n', + 'ð‘œ' => 'o', + 'ð‘' => 'p', + 'ð‘ž' => 'q', + 'ð‘Ÿ' => 'r', + 'ð‘ ' => 's', + 'ð‘¡' => 't', + 'ð‘¢' => 'u', + 'ð‘£' => 'v', + 'ð‘¤' => 'w', + 'ð‘¥' => 'x', + 'ð‘¦' => 'y', + 'ð‘§' => 'z', + 'ð‘¨' => 'A', + 'ð‘©' => 'B', + 'ð‘ª' => 'C', + 'ð‘«' => 'D', + 'ð‘¬' => 'E', + 'ð‘­' => 'F', + 'ð‘®' => 'G', + 'ð‘¯' => 'H', + 'ð‘°' => 'I', + 'ð‘±' => 'J', + 'ð‘²' => 'K', + 'ð‘³' => 'L', + 'ð‘´' => 'M', + 'ð‘µ' => 'N', + 'ð‘¶' => 'O', + 'ð‘·' => 'P', + 'ð‘¸' => 'Q', + 'ð‘¹' => 'R', + 'ð‘º' => 'S', + 'ð‘»' => 'T', + 'ð‘¼' => 'U', + 'ð‘½' => 'V', + 'ð‘¾' => 'W', + 'ð‘¿' => 'X', + 'ð’€' => 'Y', + 'ð’' => 'Z', + 'ð’‚' => 'a', + 'ð’ƒ' => 'b', + 'ð’„' => 'c', + 'ð’…' => 'd', + 'ð’†' => 'e', + 'ð’‡' => 'f', + 'ð’ˆ' => 'g', + 'ð’‰' => 'h', + 'ð’Š' => 'i', + 'ð’‹' => 'j', + 'ð’Œ' => 'k', + 'ð’' => 'l', + 'ð’Ž' => 'm', + 'ð’' => 'n', + 'ð’' => 'o', + 'ð’‘' => 'p', + 'ð’’' => 'q', + 'ð’“' => 'r', + 'ð’”' => 's', + 'ð’•' => 't', + 'ð’–' => 'u', + 'ð’—' => 'v', + 'ð’˜' => 'w', + 'ð’™' => 'x', + 'ð’š' => 'y', + 'ð’›' => 'z', + 'ð’œ' => 'A', + 'ð’ž' => 'C', + 'ð’Ÿ' => 'D', + 'ð’¢' => 'G', + 'ð’¥' => 'J', + 'ð’¦' => 'K', + 'ð’©' => 'N', + 'ð’ª' => 'O', + 'ð’«' => 'P', + 'ð’¬' => 'Q', + 'ð’®' => 'S', + 'ð’¯' => 'T', + 'ð’°' => 'U', + 'ð’±' => 'V', + 'ð’²' => 'W', + 'ð’³' => 'X', + 'ð’´' => 'Y', + 'ð’µ' => 'Z', + 'ð’¶' => 'a', + 'ð’·' => 'b', + 'ð’¸' => 'c', + 'ð’¹' => 'd', + 'ð’»' => 'f', + 'ð’½' => 'h', + 'ð’¾' => 'i', + 'ð’¿' => 'j', + 'ð“€' => 'k', + 'ð“' => 'l', + 'ð“‚' => 'm', + 'ð“ƒ' => 'n', + 'ð“…' => 'p', + 'ð“†' => 'q', + 'ð“‡' => 'r', + 'ð“ˆ' => 's', + 'ð“‰' => 't', + 'ð“Š' => 'u', + 'ð“‹' => 'v', + 'ð“Œ' => 'w', + 'ð“' => 'x', + 'ð“Ž' => 'y', + 'ð“' => 'z', + 'ð“' => 'A', + 'ð“‘' => 'B', + 'ð“’' => 'C', + 'ð““' => 'D', + 'ð“”' => 'E', + 'ð“•' => 'F', + 'ð“–' => 'G', + 'ð“—' => 'H', + 'ð“˜' => 'I', + 'ð“™' => 'J', + 'ð“š' => 'K', + 'ð“›' => 'L', + 'ð“œ' => 'M', + 'ð“' => 'N', + 'ð“ž' => 'O', + 'ð“Ÿ' => 'P', + 'ð“ ' => 'Q', + 'ð“¡' => 'R', + 'ð“¢' => 'S', + 'ð“£' => 'T', + 'ð“¤' => 'U', + 'ð“¥' => 'V', + 'ð“¦' => 'W', + 'ð“§' => 'X', + 'ð“¨' => 'Y', + 'ð“©' => 'Z', + 'ð“ª' => 'a', + 'ð“«' => 'b', + 'ð“¬' => 'c', + 'ð“­' => 'd', + 'ð“®' => 'e', + 'ð“¯' => 'f', + 'ð“°' => 'g', + 'ð“±' => 'h', + 'ð“²' => 'i', + 'ð“³' => 'j', + 'ð“´' => 'k', + 'ð“µ' => 'l', + 'ð“¶' => 'm', + 'ð“·' => 'n', + 'ð“¸' => 'o', + 'ð“¹' => 'p', + 'ð“º' => 'q', + 'ð“»' => 'r', + 'ð“¼' => 's', + 'ð“½' => 't', + 'ð“¾' => 'u', + 'ð“¿' => 'v', + 'ð”€' => 'w', + 'ð”' => 'x', + 'ð”‚' => 'y', + 'ð”ƒ' => 'z', + 'ð”„' => 'A', + 'ð”…' => 'B', + 'ð”‡' => 'D', + 'ð”ˆ' => 'E', + 'ð”‰' => 'F', + 'ð”Š' => 'G', + 'ð”' => 'J', + 'ð”Ž' => 'K', + 'ð”' => 'L', + 'ð”' => 'M', + 'ð”‘' => 'N', + 'ð”’' => 'O', + 'ð”“' => 'P', + 'ð””' => 'Q', + 'ð”–' => 'S', + 'ð”—' => 'T', + 'ð”˜' => 'U', + 'ð”™' => 'V', + 'ð”š' => 'W', + 'ð”›' => 'X', + 'ð”œ' => 'Y', + 'ð”ž' => 'a', + 'ð”Ÿ' => 'b', + 'ð” ' => 'c', + 'ð”¡' => 'd', + 'ð”¢' => 'e', + 'ð”£' => 'f', + 'ð”¤' => 'g', + 'ð”¥' => 'h', + 'ð”¦' => 'i', + 'ð”§' => 'j', + 'ð”¨' => 'k', + 'ð”©' => 'l', + 'ð”ª' => 'm', + 'ð”«' => 'n', + 'ð”¬' => 'o', + 'ð”­' => 'p', + 'ð”®' => 'q', + 'ð”¯' => 'r', + 'ð”°' => 's', + 'ð”±' => 't', + 'ð”²' => 'u', + 'ð”³' => 'v', + 'ð”´' => 'w', + 'ð”µ' => 'x', + 'ð”¶' => 'y', + 'ð”·' => 'z', + 'ð”¸' => 'A', + 'ð”¹' => 'B', + 'ð”»' => 'D', + 'ð”¼' => 'E', + 'ð”½' => 'F', + 'ð”¾' => 'G', + 'ð•€' => 'I', + 'ð•' => 'J', + 'ð•‚' => 'K', + 'ð•ƒ' => 'L', + 'ð•„' => 'M', + 'ð•†' => 'O', + 'ð•Š' => 'S', + 'ð•‹' => 'T', + 'ð•Œ' => 'U', + 'ð•' => 'V', + 'ð•Ž' => 'W', + 'ð•' => 'X', + 'ð•' => 'Y', + 'ð•’' => 'a', + 'ð•“' => 'b', + 'ð•”' => 'c', + 'ð••' => 'd', + 'ð•–' => 'e', + 'ð•—' => 'f', + 'ð•˜' => 'g', + 'ð•™' => 'h', + 'ð•š' => 'i', + 'ð•›' => 'j', + 'ð•œ' => 'k', + 'ð•' => 'l', + 'ð•ž' => 'm', + 'ð•Ÿ' => 'n', + 'ð• ' => 'o', + 'ð•¡' => 'p', + 'ð•¢' => 'q', + 'ð•£' => 'r', + 'ð•¤' => 's', + 'ð•¥' => 't', + 'ð•¦' => 'u', + 'ð•§' => 'v', + 'ð•¨' => 'w', + 'ð•©' => 'x', + 'ð•ª' => 'y', + 'ð•«' => 'z', + 'ð•¬' => 'A', + 'ð•­' => 'B', + 'ð•®' => 'C', + 'ð•¯' => 'D', + 'ð•°' => 'E', + 'ð•±' => 'F', + 'ð•²' => 'G', + 'ð•³' => 'H', + 'ð•´' => 'I', + 'ð•µ' => 'J', + 'ð•¶' => 'K', + 'ð•·' => 'L', + 'ð•¸' => 'M', + 'ð•¹' => 'N', + 'ð•º' => 'O', + 'ð•»' => 'P', + 'ð•¼' => 'Q', + 'ð•½' => 'R', + 'ð•¾' => 'S', + 'ð•¿' => 'T', + 'ð–€' => 'U', + 'ð–' => 'V', + 'ð–‚' => 'W', + 'ð–ƒ' => 'X', + 'ð–„' => 'Y', + 'ð–…' => 'Z', + 'ð–†' => 'a', + 'ð–‡' => 'b', + 'ð–ˆ' => 'c', + 'ð–‰' => 'd', + 'ð–Š' => 'e', + 'ð–‹' => 'f', + 'ð–Œ' => 'g', + 'ð–' => 'h', + 'ð–Ž' => 'i', + 'ð–' => 'j', + 'ð–' => 'k', + 'ð–‘' => 'l', + 'ð–’' => 'm', + 'ð–“' => 'n', + 'ð–”' => 'o', + 'ð–•' => 'p', + 'ð––' => 'q', + 'ð–—' => 'r', + 'ð–˜' => 's', + 'ð–™' => 't', + 'ð–š' => 'u', + 'ð–›' => 'v', + 'ð–œ' => 'w', + 'ð–' => 'x', + 'ð–ž' => 'y', + 'ð–Ÿ' => 'z', + 'ð– ' => 'A', + 'ð–¡' => 'B', + 'ð–¢' => 'C', + 'ð–£' => 'D', + 'ð–¤' => 'E', + 'ð–¥' => 'F', + 'ð–¦' => 'G', + 'ð–§' => 'H', + 'ð–¨' => 'I', + 'ð–©' => 'J', + 'ð–ª' => 'K', + 'ð–«' => 'L', + 'ð–¬' => 'M', + 'ð–­' => 'N', + 'ð–®' => 'O', + 'ð–¯' => 'P', + 'ð–°' => 'Q', + 'ð–±' => 'R', + 'ð–²' => 'S', + 'ð–³' => 'T', + 'ð–´' => 'U', + 'ð–µ' => 'V', + 'ð–¶' => 'W', + 'ð–·' => 'X', + 'ð–¸' => 'Y', + 'ð–¹' => 'Z', + 'ð–º' => 'a', + 'ð–»' => 'b', + 'ð–¼' => 'c', + 'ð–½' => 'd', + 'ð–¾' => 'e', + 'ð–¿' => 'f', + 'ð—€' => 'g', + 'ð—' => 'h', + 'ð—‚' => 'i', + 'ð—ƒ' => 'j', + 'ð—„' => 'k', + 'ð—…' => 'l', + 'ð—†' => 'm', + 'ð—‡' => 'n', + 'ð—ˆ' => 'o', + 'ð—‰' => 'p', + 'ð—Š' => 'q', + 'ð—‹' => 'r', + 'ð—Œ' => 's', + 'ð—' => 't', + 'ð—Ž' => 'u', + 'ð—' => 'v', + 'ð—' => 'w', + 'ð—‘' => 'x', + 'ð—’' => 'y', + 'ð—“' => 'z', + 'ð—”' => 'A', + 'ð—•' => 'B', + 'ð—–' => 'C', + 'ð——' => 'D', + 'ð—˜' => 'E', + 'ð—™' => 'F', + 'ð—š' => 'G', + 'ð—›' => 'H', + 'ð—œ' => 'I', + 'ð—' => 'J', + 'ð—ž' => 'K', + 'ð—Ÿ' => 'L', + 'ð— ' => 'M', + 'ð—¡' => 'N', + 'ð—¢' => 'O', + 'ð—£' => 'P', + 'ð—¤' => 'Q', + 'ð—¥' => 'R', + 'ð—¦' => 'S', + 'ð—§' => 'T', + 'ð—¨' => 'U', + 'ð—©' => 'V', + 'ð—ª' => 'W', + 'ð—«' => 'X', + 'ð—¬' => 'Y', + 'ð—­' => 'Z', + 'ð—®' => 'a', + 'ð—¯' => 'b', + 'ð—°' => 'c', + 'ð—±' => 'd', + 'ð—²' => 'e', + 'ð—³' => 'f', + 'ð—´' => 'g', + 'ð—µ' => 'h', + 'ð—¶' => 'i', + 'ð—·' => 'j', + 'ð—¸' => 'k', + 'ð—¹' => 'l', + 'ð—º' => 'm', + 'ð—»' => 'n', + 'ð—¼' => 'o', + 'ð—½' => 'p', + 'ð—¾' => 'q', + 'ð—¿' => 'r', + 'ð˜€' => 's', + 'ð˜' => 't', + 'ð˜‚' => 'u', + 'ð˜ƒ' => 'v', + 'ð˜„' => 'w', + 'ð˜…' => 'x', + 'ð˜†' => 'y', + 'ð˜‡' => 'z', + 'ð˜ˆ' => 'A', + 'ð˜‰' => 'B', + 'ð˜Š' => 'C', + 'ð˜‹' => 'D', + 'ð˜Œ' => 'E', + 'ð˜' => 'F', + 'ð˜Ž' => 'G', + 'ð˜' => 'H', + 'ð˜' => 'I', + 'ð˜‘' => 'J', + 'ð˜’' => 'K', + 'ð˜“' => 'L', + 'ð˜”' => 'M', + 'ð˜•' => 'N', + 'ð˜–' => 'O', + 'ð˜—' => 'P', + 'ð˜˜' => 'Q', + 'ð˜™' => 'R', + 'ð˜š' => 'S', + 'ð˜›' => 'T', + 'ð˜œ' => 'U', + 'ð˜' => 'V', + 'ð˜ž' => 'W', + 'ð˜Ÿ' => 'X', + 'ð˜ ' => 'Y', + 'ð˜¡' => 'Z', + 'ð˜¢' => 'a', + 'ð˜£' => 'b', + 'ð˜¤' => 'c', + 'ð˜¥' => 'd', + 'ð˜¦' => 'e', + 'ð˜§' => 'f', + 'ð˜¨' => 'g', + 'ð˜©' => 'h', + 'ð˜ª' => 'i', + 'ð˜«' => 'j', + 'ð˜¬' => 'k', + 'ð˜­' => 'l', + 'ð˜®' => 'm', + 'ð˜¯' => 'n', + 'ð˜°' => 'o', + 'ð˜±' => 'p', + 'ð˜²' => 'q', + 'ð˜³' => 'r', + 'ð˜´' => 's', + 'ð˜µ' => 't', + 'ð˜¶' => 'u', + 'ð˜·' => 'v', + 'ð˜¸' => 'w', + 'ð˜¹' => 'x', + 'ð˜º' => 'y', + 'ð˜»' => 'z', + 'ð˜¼' => 'A', + 'ð˜½' => 'B', + 'ð˜¾' => 'C', + 'ð˜¿' => 'D', + 'ð™€' => 'E', + 'ð™' => 'F', + 'ð™‚' => 'G', + 'ð™ƒ' => 'H', + 'ð™„' => 'I', + 'ð™…' => 'J', + 'ð™†' => 'K', + 'ð™‡' => 'L', + 'ð™ˆ' => 'M', + 'ð™‰' => 'N', + 'ð™Š' => 'O', + 'ð™‹' => 'P', + 'ð™Œ' => 'Q', + 'ð™' => 'R', + 'ð™Ž' => 'S', + 'ð™' => 'T', + 'ð™' => 'U', + 'ð™‘' => 'V', + 'ð™’' => 'W', + 'ð™“' => 'X', + 'ð™”' => 'Y', + 'ð™•' => 'Z', + 'ð™–' => 'a', + 'ð™—' => 'b', + 'ð™˜' => 'c', + 'ð™™' => 'd', + 'ð™š' => 'e', + 'ð™›' => 'f', + 'ð™œ' => 'g', + 'ð™' => 'h', + 'ð™ž' => 'i', + 'ð™Ÿ' => 'j', + 'ð™ ' => 'k', + 'ð™¡' => 'l', + 'ð™¢' => 'm', + 'ð™£' => 'n', + 'ð™¤' => 'o', + 'ð™¥' => 'p', + 'ð™¦' => 'q', + 'ð™§' => 'r', + 'ð™¨' => 's', + 'ð™©' => 't', + 'ð™ª' => 'u', + 'ð™«' => 'v', + 'ð™¬' => 'w', + 'ð™­' => 'x', + 'ð™®' => 'y', + 'ð™¯' => 'z', + 'ð™°' => 'A', + 'ð™±' => 'B', + 'ð™²' => 'C', + 'ð™³' => 'D', + 'ð™´' => 'E', + 'ð™µ' => 'F', + 'ð™¶' => 'G', + 'ð™·' => 'H', + 'ð™¸' => 'I', + 'ð™¹' => 'J', + 'ð™º' => 'K', + 'ð™»' => 'L', + 'ð™¼' => 'M', + 'ð™½' => 'N', + 'ð™¾' => 'O', + 'ð™¿' => 'P', + 'ðš€' => 'Q', + 'ðš' => 'R', + 'ðš‚' => 'S', + 'ðšƒ' => 'T', + 'ðš„' => 'U', + 'ðš…' => 'V', + 'ðš†' => 'W', + 'ðš‡' => 'X', + 'ðšˆ' => 'Y', + 'ðš‰' => 'Z', + 'ðšŠ' => 'a', + 'ðš‹' => 'b', + 'ðšŒ' => 'c', + 'ðš' => 'd', + 'ðšŽ' => 'e', + 'ðš' => 'f', + 'ðš' => 'g', + 'ðš‘' => 'h', + 'ðš’' => 'i', + 'ðš“' => 'j', + 'ðš”' => 'k', + 'ðš•' => 'l', + 'ðš–' => 'm', + 'ðš—' => 'n', + 'ðš˜' => 'o', + 'ðš™' => 'p', + 'ðšš' => 'q', + 'ðš›' => 'r', + 'ðšœ' => 's', + 'ðš' => 't', + 'ðšž' => 'u', + 'ðšŸ' => 'v', + 'ðš ' => 'w', + 'ðš¡' => 'x', + 'ðš¢' => 'y', + 'ðš£' => 'z', + 'ðš¤' => 'ı', + 'ðš¥' => 'È·', + 'ðš¨' => 'Α', + 'ðš©' => 'Î’', + 'ðšª' => 'Γ', + 'ðš«' => 'Δ', + 'ðš¬' => 'Ε', + 'ðš­' => 'Ζ', + 'ðš®' => 'Η', + 'ðš¯' => 'Θ', + 'ðš°' => 'Ι', + 'ðš±' => 'Κ', + 'ðš²' => 'Λ', + 'ðš³' => 'Îœ', + 'ðš´' => 'Î', + 'ðšµ' => 'Ξ', + 'ðš¶' => 'Ο', + 'ðš·' => 'Π', + 'ðš¸' => 'Ρ', + 'ðš¹' => 'Θ', + 'ðšº' => 'Σ', + 'ðš»' => 'Τ', + 'ðš¼' => 'Î¥', + 'ðš½' => 'Φ', + 'ðš¾' => 'Χ', + 'ðš¿' => 'Ψ', + 'ð›€' => 'Ω', + 'ð›' => '∇', + 'ð›‚' => 'α', + 'ð›ƒ' => 'β', + 'ð›„' => 'γ', + 'ð›…' => 'δ', + 'ð›†' => 'ε', + 'ð›‡' => 'ζ', + 'ð›ˆ' => 'η', + 'ð›‰' => 'θ', + 'ð›Š' => 'ι', + 'ð›‹' => 'κ', + 'ð›Œ' => 'λ', + 'ð›' => 'μ', + 'ð›Ž' => 'ν', + 'ð›' => 'ξ', + 'ð›' => 'ο', + 'ð›‘' => 'Ï€', + 'ð›’' => 'Ï', + 'ð›“' => 'Ï‚', + 'ð›”' => 'σ', + 'ð›•' => 'Ï„', + 'ð›–' => 'Ï…', + 'ð›—' => 'φ', + 'ð›˜' => 'χ', + 'ð›™' => 'ψ', + 'ð›š' => 'ω', + 'ð››' => '∂', + 'ð›œ' => 'ε', + 'ð›' => 'θ', + 'ð›ž' => 'κ', + 'ð›Ÿ' => 'φ', + 'ð› ' => 'Ï', + 'ð›¡' => 'Ï€', + 'ð›¢' => 'Α', + 'ð›£' => 'Î’', + 'ð›¤' => 'Γ', + 'ð›¥' => 'Δ', + 'ð›¦' => 'Ε', + 'ð›§' => 'Ζ', + 'ð›¨' => 'Η', + 'ð›©' => 'Θ', + 'ð›ª' => 'Ι', + 'ð›«' => 'Κ', + 'ð›¬' => 'Λ', + 'ð›­' => 'Îœ', + 'ð›®' => 'Î', + 'ð›¯' => 'Ξ', + 'ð›°' => 'Ο', + 'ð›±' => 'Π', + 'ð›²' => 'Ρ', + 'ð›³' => 'Θ', + 'ð›´' => 'Σ', + 'ð›µ' => 'Τ', + 'ð›¶' => 'Î¥', + 'ð›·' => 'Φ', + 'ð›¸' => 'Χ', + 'ð›¹' => 'Ψ', + 'ð›º' => 'Ω', + 'ð›»' => '∇', + 'ð›¼' => 'α', + 'ð›½' => 'β', + 'ð›¾' => 'γ', + 'ð›¿' => 'δ', + 'ðœ€' => 'ε', + 'ðœ' => 'ζ', + 'ðœ‚' => 'η', + 'ðœƒ' => 'θ', + 'ðœ„' => 'ι', + 'ðœ…' => 'κ', + 'ðœ†' => 'λ', + 'ðœ‡' => 'μ', + 'ðœˆ' => 'ν', + 'ðœ‰' => 'ξ', + 'ðœŠ' => 'ο', + 'ðœ‹' => 'Ï€', + 'ðœŒ' => 'Ï', + 'ðœ' => 'Ï‚', + 'ðœŽ' => 'σ', + 'ðœ' => 'Ï„', + 'ðœ' => 'Ï…', + 'ðœ‘' => 'φ', + 'ðœ’' => 'χ', + 'ðœ“' => 'ψ', + 'ðœ”' => 'ω', + 'ðœ•' => '∂', + 'ðœ–' => 'ε', + 'ðœ—' => 'θ', + 'ðœ˜' => 'κ', + 'ðœ™' => 'φ', + 'ðœš' => 'Ï', + 'ðœ›' => 'Ï€', + 'ðœœ' => 'Α', + 'ðœ' => 'Î’', + 'ðœž' => 'Γ', + 'ðœŸ' => 'Δ', + 'ðœ ' => 'Ε', + 'ðœ¡' => 'Ζ', + 'ðœ¢' => 'Η', + 'ðœ£' => 'Θ', + 'ðœ¤' => 'Ι', + 'ðœ¥' => 'Κ', + 'ðœ¦' => 'Λ', + 'ðœ§' => 'Îœ', + 'ðœ¨' => 'Î', + 'ðœ©' => 'Ξ', + 'ðœª' => 'Ο', + 'ðœ«' => 'Π', + 'ðœ¬' => 'Ρ', + 'ðœ­' => 'Θ', + 'ðœ®' => 'Σ', + 'ðœ¯' => 'Τ', + 'ðœ°' => 'Î¥', + 'ðœ±' => 'Φ', + 'ðœ²' => 'Χ', + 'ðœ³' => 'Ψ', + 'ðœ´' => 'Ω', + 'ðœµ' => '∇', + 'ðœ¶' => 'α', + 'ðœ·' => 'β', + 'ðœ¸' => 'γ', + 'ðœ¹' => 'δ', + 'ðœº' => 'ε', + 'ðœ»' => 'ζ', + 'ðœ¼' => 'η', + 'ðœ½' => 'θ', + 'ðœ¾' => 'ι', + 'ðœ¿' => 'κ', + 'ð€' => 'λ', + 'ð' => 'μ', + 'ð‚' => 'ν', + 'ðƒ' => 'ξ', + 'ð„' => 'ο', + 'ð…' => 'Ï€', + 'ð†' => 'Ï', + 'ð‡' => 'Ï‚', + 'ðˆ' => 'σ', + 'ð‰' => 'Ï„', + 'ðŠ' => 'Ï…', + 'ð‹' => 'φ', + 'ðŒ' => 'χ', + 'ð' => 'ψ', + 'ðŽ' => 'ω', + 'ð' => '∂', + 'ð' => 'ε', + 'ð‘' => 'θ', + 'ð’' => 'κ', + 'ð“' => 'φ', + 'ð”' => 'Ï', + 'ð•' => 'Ï€', + 'ð–' => 'Α', + 'ð—' => 'Î’', + 'ð˜' => 'Γ', + 'ð™' => 'Δ', + 'ðš' => 'Ε', + 'ð›' => 'Ζ', + 'ðœ' => 'Η', + 'ð' => 'Θ', + 'ðž' => 'Ι', + 'ðŸ' => 'Κ', + 'ð ' => 'Λ', + 'ð¡' => 'Îœ', + 'ð¢' => 'Î', + 'ð£' => 'Ξ', + 'ð¤' => 'Ο', + 'ð¥' => 'Π', + 'ð¦' => 'Ρ', + 'ð§' => 'Θ', + 'ð¨' => 'Σ', + 'ð©' => 'Τ', + 'ðª' => 'Î¥', + 'ð«' => 'Φ', + 'ð¬' => 'Χ', + 'ð­' => 'Ψ', + 'ð®' => 'Ω', + 'ð¯' => '∇', + 'ð°' => 'α', + 'ð±' => 'β', + 'ð²' => 'γ', + 'ð³' => 'δ', + 'ð´' => 'ε', + 'ðµ' => 'ζ', + 'ð¶' => 'η', + 'ð·' => 'θ', + 'ð¸' => 'ι', + 'ð¹' => 'κ', + 'ðº' => 'λ', + 'ð»' => 'μ', + 'ð¼' => 'ν', + 'ð½' => 'ξ', + 'ð¾' => 'ο', + 'ð¿' => 'Ï€', + 'ðž€' => 'Ï', + 'ðž' => 'Ï‚', + 'ðž‚' => 'σ', + 'ðžƒ' => 'Ï„', + 'ðž„' => 'Ï…', + 'ðž…' => 'φ', + 'ðž†' => 'χ', + 'ðž‡' => 'ψ', + 'ðžˆ' => 'ω', + 'ðž‰' => '∂', + 'ðžŠ' => 'ε', + 'ðž‹' => 'θ', + 'ðžŒ' => 'κ', + 'ðž' => 'φ', + 'ðžŽ' => 'Ï', + 'ðž' => 'Ï€', + 'ðž' => 'Α', + 'ðž‘' => 'Î’', + 'ðž’' => 'Γ', + 'ðž“' => 'Δ', + 'ðž”' => 'Ε', + 'ðž•' => 'Ζ', + 'ðž–' => 'Η', + 'ðž—' => 'Θ', + 'ðž˜' => 'Ι', + 'ðž™' => 'Κ', + 'ðžš' => 'Λ', + 'ðž›' => 'Îœ', + 'ðžœ' => 'Î', + 'ðž' => 'Ξ', + 'ðžž' => 'Ο', + 'ðžŸ' => 'Π', + 'ðž ' => 'Ρ', + 'ðž¡' => 'Θ', + 'ðž¢' => 'Σ', + 'ðž£' => 'Τ', + 'ðž¤' => 'Î¥', + 'ðž¥' => 'Φ', + 'ðž¦' => 'Χ', + 'ðž§' => 'Ψ', + 'ðž¨' => 'Ω', + 'ðž©' => '∇', + 'ðžª' => 'α', + 'ðž«' => 'β', + 'ðž¬' => 'γ', + 'ðž­' => 'δ', + 'ðž®' => 'ε', + 'ðž¯' => 'ζ', + 'ðž°' => 'η', + 'ðž±' => 'θ', + 'ðž²' => 'ι', + 'ðž³' => 'κ', + 'ðž´' => 'λ', + 'ðžµ' => 'μ', + 'ðž¶' => 'ν', + 'ðž·' => 'ξ', + 'ðž¸' => 'ο', + 'ðž¹' => 'Ï€', + 'ðžº' => 'Ï', + 'ðž»' => 'Ï‚', + 'ðž¼' => 'σ', + 'ðž½' => 'Ï„', + 'ðž¾' => 'Ï…', + 'ðž¿' => 'φ', + 'ðŸ€' => 'χ', + 'ðŸ' => 'ψ', + 'ðŸ‚' => 'ω', + 'ðŸƒ' => '∂', + 'ðŸ„' => 'ε', + 'ðŸ…' => 'θ', + 'ðŸ†' => 'κ', + 'ðŸ‡' => 'φ', + 'ðŸˆ' => 'Ï', + 'ðŸ‰' => 'Ï€', + 'ðŸŠ' => 'Ïœ', + 'ðŸ‹' => 'Ï', + 'ðŸŽ' => '0', + 'ðŸ' => '1', + 'ðŸ' => '2', + 'ðŸ‘' => '3', + 'ðŸ’' => '4', + 'ðŸ“' => '5', + 'ðŸ”' => '6', + 'ðŸ•' => '7', + 'ðŸ–' => '8', + 'ðŸ—' => '9', + 'ðŸ˜' => '0', + 'ðŸ™' => '1', + 'ðŸš' => '2', + 'ðŸ›' => '3', + 'ðŸœ' => '4', + 'ðŸ' => '5', + 'ðŸž' => '6', + 'ðŸŸ' => '7', + 'ðŸ ' => '8', + 'ðŸ¡' => '9', + 'ðŸ¢' => '0', + 'ðŸ£' => '1', + 'ðŸ¤' => '2', + 'ðŸ¥' => '3', + 'ðŸ¦' => '4', + 'ðŸ§' => '5', + 'ðŸ¨' => '6', + 'ðŸ©' => '7', + 'ðŸª' => '8', + 'ðŸ«' => '9', + 'ðŸ¬' => '0', + 'ðŸ­' => '1', + 'ðŸ®' => '2', + 'ðŸ¯' => '3', + 'ðŸ°' => '4', + 'ðŸ±' => '5', + 'ðŸ²' => '6', + 'ðŸ³' => '7', + 'ðŸ´' => '8', + 'ðŸµ' => '9', + 'ðŸ¶' => '0', + 'ðŸ·' => '1', + 'ðŸ¸' => '2', + 'ðŸ¹' => '3', + 'ðŸº' => '4', + 'ðŸ»' => '5', + 'ðŸ¼' => '6', + 'ðŸ½' => '7', + 'ðŸ¾' => '8', + 'ðŸ¿' => '9', + '𞸀' => 'ا', + 'ðž¸' => 'ب', + '𞸂' => 'ج', + '𞸃' => 'د', + '𞸅' => 'Ùˆ', + '𞸆' => 'ز', + '𞸇' => 'Ø­', + '𞸈' => 'Ø·', + '𞸉' => 'ÙŠ', + '𞸊' => 'Ùƒ', + '𞸋' => 'Ù„', + '𞸌' => 'Ù…', + 'ðž¸' => 'Ù†', + '𞸎' => 'س', + 'ðž¸' => 'ع', + 'ðž¸' => 'Ù', + '𞸑' => 'ص', + '𞸒' => 'Ù‚', + '𞸓' => 'ر', + '𞸔' => 'Ø´', + '𞸕' => 'ت', + '𞸖' => 'Ø«', + '𞸗' => 'Ø®', + '𞸘' => 'Ø°', + '𞸙' => 'ض', + '𞸚' => 'ظ', + '𞸛' => 'غ', + '𞸜' => 'Ù®', + 'ðž¸' => 'Úº', + '𞸞' => 'Ú¡', + '𞸟' => 'Ù¯', + '𞸡' => 'ب', + '𞸢' => 'ج', + '𞸤' => 'Ù‡', + '𞸧' => 'Ø­', + '𞸩' => 'ÙŠ', + '𞸪' => 'Ùƒ', + '𞸫' => 'Ù„', + '𞸬' => 'Ù…', + '𞸭' => 'Ù†', + '𞸮' => 'س', + '𞸯' => 'ع', + '𞸰' => 'Ù', + '𞸱' => 'ص', + '𞸲' => 'Ù‚', + '𞸴' => 'Ø´', + '𞸵' => 'ت', + '𞸶' => 'Ø«', + '𞸷' => 'Ø®', + '𞸹' => 'ض', + '𞸻' => 'غ', + '𞹂' => 'ج', + '𞹇' => 'Ø­', + '𞹉' => 'ÙŠ', + '𞹋' => 'Ù„', + 'ðž¹' => 'Ù†', + '𞹎' => 'س', + 'ðž¹' => 'ع', + '𞹑' => 'ص', + 'ðž¹’' => 'Ù‚', + 'ðž¹”' => 'Ø´', + 'ðž¹—' => 'Ø®', + 'ðž¹™' => 'ض', + 'ðž¹›' => 'غ', + 'ðž¹' => 'Úº', + '𞹟' => 'Ù¯', + '𞹡' => 'ب', + 'ðž¹¢' => 'ج', + '𞹤' => 'Ù‡', + '𞹧' => 'Ø­', + '𞹨' => 'Ø·', + '𞹩' => 'ÙŠ', + '𞹪' => 'Ùƒ', + '𞹬' => 'Ù…', + 'ðž¹­' => 'Ù†', + 'ðž¹®' => 'س', + '𞹯' => 'ع', + 'ðž¹°' => 'Ù', + 'ðž¹±' => 'ص', + 'ðž¹²' => 'Ù‚', + 'ðž¹´' => 'Ø´', + 'ðž¹µ' => 'ت', + '𞹶' => 'Ø«', + 'ðž¹·' => 'Ø®', + 'ðž¹¹' => 'ض', + '𞹺' => 'ظ', + 'ðž¹»' => 'غ', + 'ðž¹¼' => 'Ù®', + 'ðž¹¾' => 'Ú¡', + '𞺀' => 'ا', + 'ðžº' => 'ب', + '𞺂' => 'ج', + '𞺃' => 'د', + '𞺄' => 'Ù‡', + '𞺅' => 'Ùˆ', + '𞺆' => 'ز', + '𞺇' => 'Ø­', + '𞺈' => 'Ø·', + '𞺉' => 'ÙŠ', + '𞺋' => 'Ù„', + '𞺌' => 'Ù…', + 'ðžº' => 'Ù†', + '𞺎' => 'س', + 'ðžº' => 'ع', + 'ðžº' => 'Ù', + '𞺑' => 'ص', + '𞺒' => 'Ù‚', + '𞺓' => 'ر', + '𞺔' => 'Ø´', + '𞺕' => 'ت', + '𞺖' => 'Ø«', + '𞺗' => 'Ø®', + '𞺘' => 'Ø°', + '𞺙' => 'ض', + '𞺚' => 'ظ', + '𞺛' => 'غ', + '𞺡' => 'ب', + '𞺢' => 'ج', + '𞺣' => 'د', + '𞺥' => 'Ùˆ', + '𞺦' => 'ز', + '𞺧' => 'Ø­', + '𞺨' => 'Ø·', + '𞺩' => 'ÙŠ', + '𞺫' => 'Ù„', + '𞺬' => 'Ù…', + '𞺭' => 'Ù†', + '𞺮' => 'س', + '𞺯' => 'ع', + '𞺰' => 'Ù', + '𞺱' => 'ص', + '𞺲' => 'Ù‚', + '𞺳' => 'ر', + '𞺴' => 'Ø´', + '𞺵' => 'ت', + '𞺶' => 'Ø«', + '𞺷' => 'Ø®', + '𞺸' => 'Ø°', + '𞺹' => 'ض', + '𞺺' => 'ظ', + '𞺻' => 'غ', + '🄀' => '0.', + 'ðŸ„' => '0,', + '🄂' => '1,', + '🄃' => '2,', + '🄄' => '3,', + '🄅' => '4,', + '🄆' => '5,', + '🄇' => '6,', + '🄈' => '7,', + '🄉' => '8,', + '🄊' => '9,', + 'ðŸ„' => '(A)', + '🄑' => '(B)', + '🄒' => '(C)', + '🄓' => '(D)', + '🄔' => '(E)', + '🄕' => '(F)', + '🄖' => '(G)', + '🄗' => '(H)', + '🄘' => '(I)', + '🄙' => '(J)', + '🄚' => '(K)', + '🄛' => '(L)', + '🄜' => '(M)', + 'ðŸ„' => '(N)', + '🄞' => '(O)', + '🄟' => '(P)', + '🄠' => '(Q)', + '🄡' => '(R)', + '🄢' => '(S)', + '🄣' => '(T)', + '🄤' => '(U)', + '🄥' => '(V)', + '🄦' => '(W)', + '🄧' => '(X)', + '🄨' => '(Y)', + '🄩' => '(Z)', + '🄪' => '〔S〕', + '🄫' => 'C', + '🄬' => 'R', + '🄭' => 'CD', + '🄮' => 'WZ', + '🄰' => 'A', + '🄱' => 'B', + '🄲' => 'C', + '🄳' => 'D', + '🄴' => 'E', + '🄵' => 'F', + '🄶' => 'G', + '🄷' => 'H', + '🄸' => 'I', + '🄹' => 'J', + '🄺' => 'K', + '🄻' => 'L', + '🄼' => 'M', + '🄽' => 'N', + '🄾' => 'O', + '🄿' => 'P', + '🅀' => 'Q', + 'ðŸ…' => 'R', + '🅂' => 'S', + '🅃' => 'T', + '🅄' => 'U', + '🅅' => 'V', + '🅆' => 'W', + '🅇' => 'X', + '🅈' => 'Y', + '🅉' => 'Z', + '🅊' => 'HV', + '🅋' => 'MV', + '🅌' => 'SD', + 'ðŸ…' => 'SS', + '🅎' => 'PPV', + 'ðŸ…' => 'WC', + '🅪' => 'MC', + '🅫' => 'MD', + '🅬' => 'MR', + 'ðŸ†' => 'DJ', + '🈀' => 'ã»ã‹', + 'ðŸˆ' => 'ココ', + '🈂' => 'サ', + 'ðŸˆ' => '手', + '🈑' => 'å­—', + '🈒' => 'åŒ', + '🈓' => 'デ', + '🈔' => '二', + '🈕' => '多', + '🈖' => '解', + '🈗' => '天', + '🈘' => '交', + '🈙' => '映', + '🈚' => 'ç„¡', + '🈛' => 'æ–™', + '🈜' => 'å‰', + 'ðŸˆ' => '後', + '🈞' => 'å†', + '🈟' => 'æ–°', + '🈠' => 'åˆ', + '🈡' => '終', + '🈢' => '生', + '🈣' => '販', + '🈤' => '声', + '🈥' => 'å¹', + '🈦' => 'æ¼”', + '🈧' => '投', + '🈨' => 'æ•', + '🈩' => '一', + '🈪' => '三', + '🈫' => 'éŠ', + '🈬' => 'å·¦', + '🈭' => '中', + '🈮' => 'å³', + '🈯' => '指', + '🈰' => 'èµ°', + '🈱' => '打', + '🈲' => 'ç¦', + '🈳' => '空', + '🈴' => 'åˆ', + '🈵' => '満', + '🈶' => '有', + '🈷' => '月', + '🈸' => '申', + '🈹' => '割', + '🈺' => 'å–¶', + '🈻' => 'é…', + '🉀' => '〔本〕', + 'ðŸ‰' => '〔三〕', + '🉂' => '〔二〕', + '🉃' => '〔安〕', + '🉄' => '〔点〕', + '🉅' => '〔打〕', + '🉆' => '〔盗〕', + '🉇' => '〔å‹ã€•', + '🉈' => '〔敗〕', + 'ðŸ‰' => 'å¾—', + '🉑' => 'å¯', + '🯰' => '0', + '🯱' => '1', + '🯲' => '2', + '🯳' => '3', + '🯴' => '4', + '🯵' => '5', + '🯶' => '6', + '🯷' => '7', + '🯸' => '8', + '🯹' => '9', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php new file mode 100644 index 00000000000..3608e5c05d6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Normalizer as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('normalizer_is_normalized')) { + function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } +} +if (!function_exists('normalizer_normalize')) { + function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php new file mode 100644 index 00000000000..e36d1a94770 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Normalizer as p; + +if (!function_exists('normalizer_is_normalized')) { + function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } +} +if (!function_exists('normalizer_normalize')) { + function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json new file mode 100644 index 00000000000..393edf701a6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json @@ -0,0 +1,39 @@ +{ + "name": "symfony/polyfill-intl-normalizer", + "type": "library", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "suggest": { + "ext-intl": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE new file mode 100644 index 00000000000..4cd8bdd3007 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2019 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/Php72.php b/upload/system/storage/vendor/symfony/polyfill-php72/Php72.php new file mode 100644 index 00000000000..5e20d5bf8f1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php72/Php72.php @@ -0,0 +1,217 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php72; + +/** + * @author Nicolas Grekas + * @author Dariusz RumiÅ„ski + * + * @internal + */ +final class Php72 +{ + private static $hashMask; + + public static function utf8_encode($s) + { + $s .= $s; + $len = \strlen($s); + + for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) { + switch (true) { + case $s[$i] < "\x80": $s[$j] = $s[$i]; break; + case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; + default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break; + } + } + + return substr($s, 0, $j); + } + + public static function utf8_decode($s) + { + $s = (string) $s; + $len = \strlen($s); + + for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) { + switch ($s[$i] & "\xF0") { + case "\xC0": + case "\xD0": + $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F"); + $s[$j] = $c < 256 ? \chr($c) : '?'; + break; + + case "\xF0": + ++$i; + // no break + + case "\xE0": + $s[$j] = '?'; + $i += 2; + break; + + default: + $s[$j] = $s[$i]; + } + } + + return substr($s, 0, $j); + } + + public static function php_os_family() + { + if ('\\' === \DIRECTORY_SEPARATOR) { + return 'Windows'; + } + + $map = [ + 'Darwin' => 'Darwin', + 'DragonFly' => 'BSD', + 'FreeBSD' => 'BSD', + 'NetBSD' => 'BSD', + 'OpenBSD' => 'BSD', + 'Linux' => 'Linux', + 'SunOS' => 'Solaris', + ]; + + return isset($map[\PHP_OS]) ? $map[\PHP_OS] : 'Unknown'; + } + + public static function spl_object_id($object) + { + if (null === self::$hashMask) { + self::initHashMask(); + } + if (null === $hash = spl_object_hash($object)) { + return; + } + + // On 32-bit systems, PHP_INT_SIZE is 4, + return self::$hashMask ^ hexdec(substr($hash, 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); + } + + public static function sapi_windows_vt100_support($stream, $enable = null) + { + if (!\is_resource($stream)) { + trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); + + return false; + } + + $meta = stream_get_meta_data($stream); + + if ('STDIO' !== $meta['stream_type']) { + trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', \E_USER_WARNING); + + return false; + } + + // We cannot actually disable vt100 support if it is set + if (false === $enable || !self::stream_isatty($stream)) { + return false; + } + + // The native function does not apply to stdin + $meta = array_map('strtolower', $meta); + $stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri']; + + return !$stdin + && (false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + || 'xterm' === getenv('TERM') + || 'Hyper' === getenv('TERM_PROGRAM')); + } + + public static function stream_isatty($stream) + { + if (!\is_resource($stream)) { + trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); + + return false; + } + + if ('\\' === \DIRECTORY_SEPARATOR) { + $stat = @fstat($stream); + // Check if formatted mode is S_IFCHR + return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; + } + + return \function_exists('posix_isatty') && @posix_isatty($stream); + } + + private static function initHashMask() + { + $obj = (object) []; + self::$hashMask = -1; + + // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below + $obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush']; + foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? \DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { + if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) { + $frame['line'] = 0; + break; + } + } + if (!empty($frame['line'])) { + ob_start(); + debug_zval_dump($obj); + self::$hashMask = (int) substr(ob_get_clean(), 17); + } + + self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = $encoding ?? mb_internal_encoding()) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if (null === $encoding) { + $s = mb_convert_encoding($s, 'UTF-8'); + } elseif ('UTF-8' !== $encoding) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/README.md b/upload/system/storage/vendor/symfony/polyfill-php72/README.md new file mode 100644 index 00000000000..59dec8a237f --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php72/README.md @@ -0,0 +1,28 @@ +Symfony Polyfill / Php72 +======================== + +This component provides functions added to PHP 7.2 core: + +- [`spl_object_id`](https://php.net/spl_object_id) +- [`stream_isatty`](https://php.net/stream_isatty) + +On Windows only: + +- [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support) + +Moved to core since 7.2 (was in the optional XML extension earlier): + +- [`utf8_encode`](https://php.net/utf8_encode) +- [`utf8_decode`](https://php.net/utf8_decode) + +Also, it provides constants added to PHP 7.2: +- [`PHP_FLOAT_*`](https://php.net/reserved.constants#constant.php-float-dig) +- [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php new file mode 100644 index 00000000000..b5c92d4c7c7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php72 as p; + +if (\PHP_VERSION_ID >= 70200) { + return; +} + +if (!defined('PHP_FLOAT_DIG')) { + define('PHP_FLOAT_DIG', 15); +} +if (!defined('PHP_FLOAT_EPSILON')) { + define('PHP_FLOAT_EPSILON', 2.2204460492503E-16); +} +if (!defined('PHP_FLOAT_MIN')) { + define('PHP_FLOAT_MIN', 2.2250738585072E-308); +} +if (!defined('PHP_FLOAT_MAX')) { + define('PHP_FLOAT_MAX', 1.7976931348623157E+308); +} +if (!defined('PHP_OS_FAMILY')) { + define('PHP_OS_FAMILY', p\Php72::php_os_family()); +} + +if ('\\' === \DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) { + function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); } +} +if (!function_exists('stream_isatty')) { + function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } +} +if (!function_exists('utf8_encode')) { + function utf8_encode($string) { return p\Php72::utf8_encode($string); } +} +if (!function_exists('utf8_decode')) { + function utf8_decode($string) { return p\Php72::utf8_decode($string); } +} +if (!function_exists('spl_object_id')) { + function spl_object_id($object) { return p\Php72::spl_object_id($object); } +} +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/composer.json b/upload/system/storage/vendor/symfony/polyfill-php72/composer.json new file mode 100644 index 00000000000..c96c8447782 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php72/composer.json @@ -0,0 +1,35 @@ +{ + "name": "symfony/polyfill-php72", + "type": "library", + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, + "files": [ "bootstrap.php" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE new file mode 100644 index 00000000000..5593b1d84f7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/Php80.php b/upload/system/storage/vendor/symfony/polyfill-php80/Php80.php new file mode 100644 index 00000000000..362dd1a9596 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php80/Php80.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan + * @author Nico Oelgart + * @author Nicolas Grekas + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php b/upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 00000000000..fe6e6910562 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/README.md b/upload/system/storage/vendor/symfony/polyfill-php80/README.md new file mode 100644 index 00000000000..10b8ee49a87 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php80/README.md @@ -0,0 +1,24 @@ +Symfony Polyfill / Php80 +======================== + +This component provides features added to PHP 8.0 core: + +- `Stringable` interface +- [`fdiv`](https://php.net/fdiv) +- `ValueError` class +- `UnhandledMatchError` class +- `FILTER_VALIDATE_BOOL` constant +- [`get_debug_type`](https://php.net/get_debug_type) +- [`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) +- [`str_ends_with`](https://php.net/str_ends_with) +- [`get_resource_id`](https://php.net/get_resource_id) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000000..7ea6d2772dc --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,22 @@ +flags = $flags; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 00000000000..72f10812b36 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,7 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/composer.json b/upload/system/storage/vendor/symfony/polyfill-php80/composer.json new file mode 100644 index 00000000000..5fe679db392 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php80/composer.json @@ -0,0 +1,40 @@ +{ + "name": "symfony/polyfill-php80", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation b/upload/system/storage/vendor/symfony/translation deleted file mode 160000 index eee6c664853..00000000000 --- a/upload/system/storage/vendor/symfony/translation +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eee6c664853fd0576f21ae25725cfffeafe83f26 diff --git a/upload/system/storage/vendor/symfony/translation-contracts/.gitignore b/upload/system/storage/vendor/symfony/translation-contracts/.gitignore new file mode 100644 index 00000000000..c49a5d8df5c --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md b/upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md new file mode 100644 index 00000000000..7932e26132d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/upload/system/storage/vendor/symfony/translation-contracts/LICENSE b/upload/system/storage/vendor/symfony/translation-contracts/LICENSE new file mode 100644 index 00000000000..2358414536d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2021 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php new file mode 100644 index 00000000000..693f92ba9b7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +interface LocaleAwareInterface +{ + /** + * Sets the current locale. + * + * @param string $locale The locale + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function setLocale(string $locale); + + /** + * Returns the current locale. + * + * @return string + */ + public function getLocale(); +} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/README.md b/upload/system/storage/vendor/symfony/translation-contracts/README.md new file mode 100644 index 00000000000..42e5c51754e --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/README.md @@ -0,0 +1,9 @@ +Symfony Translation Contracts +============================= + +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components proved useful - and +that already have battle tested implementations. + +See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php new file mode 100644 index 00000000000..89036765784 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -0,0 +1,390 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation\Test; + +use PHPUnit\Framework\TestCase; +use Symfony\Contracts\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorTrait; + +/** + * Test should cover all languages mentioned on http://translate.sourceforge.net/wiki/l10n/pluralforms + * and Plural forms mentioned on http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms. + * + * See also https://developer.mozilla.org/en/Localization_and_Plurals which mentions 15 rules having a maximum of 6 forms. + * The mozilla code is also interesting to check for. + * + * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199 + * + * The goal to cover all languages is to far fetched so this test case is smaller. + * + * @author Clemens Tolboom clemens@build2be.nl + */ +class TranslatorTest extends TestCase +{ + private $defaultLocale; + + protected function setUp(): void + { + $this->defaultLocale = \Locale::getDefault(); + \Locale::setDefault('en'); + } + + protected function tearDown(): void + { + \Locale::setDefault($this->defaultLocale); + } + + /** + * @return TranslatorInterface + */ + public function getTranslator() + { + return new class() implements TranslatorInterface { + use TranslatorTrait; + }; + } + + /** + * @dataProvider getTransTests + */ + public function testTrans($expected, $id, $parameters) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, $parameters)); + } + + /** + * @dataProvider getTransChoiceTests + */ + public function testTransChoiceWithExplicitLocale($expected, $id, $number) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + + /** + * @requires extension intl + * + * @dataProvider getTransChoiceTests + */ + public function testTransChoiceWithDefaultLocale($expected, $id, $number) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + + /** + * @dataProvider getTransChoiceTests + */ + public function testTransChoiceWithEnUsPosix($expected, $id, $number) + { + $translator = $this->getTranslator(); + $translator->setLocale('en_US_POSIX'); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + + public function testGetSetLocale() + { + $translator = $this->getTranslator(); + + $this->assertEquals('en', $translator->getLocale()); + } + + /** + * @requires extension intl + */ + public function testGetLocaleReturnsDefaultLocaleIfNotSet() + { + $translator = $this->getTranslator(); + + \Locale::setDefault('pt_BR'); + $this->assertEquals('pt_BR', $translator->getLocale()); + + \Locale::setDefault('en'); + $this->assertEquals('en', $translator->getLocale()); + } + + public function getTransTests() + { + return [ + ['Symfony is great!', 'Symfony is great!', []], + ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']], + ]; + } + + public function getTransChoiceTests() + { + return [ + ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], + ['There are 0 apples', 'There is 1 apple|There are %count% apples', 0], + ['There is 1 apple', 'There is 1 apple|There are %count% apples', 1], + ['There are 10 apples', 'There is 1 apple|There are %count% apples', 10], + // custom validation messages may be coded with a fixed value + ['There are 2 apples', 'There are 2 apples', 2], + ]; + } + + /** + * @dataProvider getInternal + */ + public function testInterval($expected, $number, $interval) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number])); + } + + public function getInternal() + { + return [ + ['foo', 3, '{1,2, 3 ,4}'], + ['bar', 10, '{1,2, 3 ,4}'], + ['bar', 3, '[1,2]'], + ['foo', 1, '[1,2]'], + ['foo', 2, '[1,2]'], + ['bar', 1, ']1,2['], + ['bar', 2, ']1,2['], + ['foo', log(0), '[-Inf,2['], + ['foo', -log(0), '[-2,+Inf]'], + ]; + } + + /** + * @dataProvider getChooseTests + */ + public function testChoose($expected, $id, $number, $locale = null) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number], null, $locale)); + } + + public function testReturnMessageIfExactlyOneStandardRuleIsGiven() + { + $translator = $this->getTranslator(); + + $this->assertEquals('There are two apples', $translator->trans('There are two apples', ['%count%' => 2])); + } + + /** + * @dataProvider getNonMatchingMessages + */ + public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) + { + $this->expectException(\InvalidArgumentException::class); + $translator = $this->getTranslator(); + + $translator->trans($id, ['%count%' => $number]); + } + + public function getNonMatchingMessages() + { + return [ + ['{0} There are no apples|{1} There is one apple', 2], + ['{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['{1} There is one apple|]2,Inf] There are %count% apples', 2], + ['{0} There are no apples|There is one apple', 2], + ]; + } + + public function getChooseTests() + { + return [ + ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['There are no apples', '{0}There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + + ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], + + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf]There are %count% apples', 10], + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], + + ['There are 0 apples', 'There is one apple|There are %count% apples', 0], + ['There is one apple', 'There is one apple|There are %count% apples', 1], + ['There are 10 apples', 'There is one apple|There are %count% apples', 10], + + ['There are 0 apples', 'one: There is one apple|more: There are %count% apples', 0], + ['There is one apple', 'one: There is one apple|more: There are %count% apples', 1], + ['There are 10 apples', 'one: There is one apple|more: There are %count% apples', 10], + + ['There are no apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 0], + ['There is one apple', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 1], + ['There are 10 apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 10], + + ['', '{0}|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['', '{0} There are no apples|{1}|]1,Inf] There are %count% apples', 1], + + // Indexed only tests which are Gettext PoFile* compatible strings. + ['There are 0 apples', 'There is one apple|There are %count% apples', 0], + ['There is one apple', 'There is one apple|There are %count% apples', 1], + ['There are 2 apples', 'There is one apple|There are %count% apples', 2], + + // Tests for float numbers + ['There is almost one apple', '{0} There are no apples|]0,1[ There is almost one apple|{1} There is one apple|[1,Inf] There is more than one apple', 0.7], + ['There is one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1], + ['There is more than one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1.7], + ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], + ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0.0], + ['There are no apples', '{0.0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], + + // Test texts with new-lines + // with double-quotes and \n in id & double-quotes and actual newlines in text + ["This is a text with a\n new-line in it. Selector = 0.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 0], + // with double-quotes and \n in id and single-quotes and actual newlines in text + ["This is a text with a\n new-line in it. Selector = 1.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 1], + ["This is a text with a\n new-line in it. Selector > 1.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 5], + // with double-quotes and id split accros lines + ['This is a text with a + new-line in it. Selector = 1.', '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 1], + // with single-quotes and id split accros lines + ['This is a text with a + new-line in it. Selector > 1.', '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 5], + // with single-quotes and \n in text + ['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0], + // with double-quotes and id split accros lines + ["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1], + // esacape pipe + ['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0], + // Empty plural set (2 plural forms) from a .PO file + ['', '|', 1], + // Empty plural set (3 plural forms) from a .PO file + ['', '||', 1], + + // Floating values + ['1.5 liters', '%count% liter|%count% liters', 1.5], + ['1.5 litre', '%count% litre|%count% litres', 1.5, 'fr'], + + // Negative values + ['-1 degree', '%count% degree|%count% degrees', -1], + ['-1 degré', '%count% degré|%count% degrés', -1], + ['-1.5 degrees', '%count% degree|%count% degrees', -1.5], + ['-1.5 degré', '%count% degré|%count% degrés', -1.5, 'fr'], + ['-2 degrees', '%count% degree|%count% degrees', -2], + ['-2 degrés', '%count% degré|%count% degrés', -2], + ]; + } + + /** + * @dataProvider failingLangcodes + */ + public function testFailedLangcodes($nplural, $langCodes) + { + $matrix = $this->generateTestData($langCodes); + $this->validateMatrix($nplural, $matrix, false); + } + + /** + * @dataProvider successLangcodes + */ + public function testLangcodes($nplural, $langCodes) + { + $matrix = $this->generateTestData($langCodes); + $this->validateMatrix($nplural, $matrix); + } + + /** + * This array should contain all currently known langcodes. + * + * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. + * + * @return array + */ + public function successLangcodes() + { + return [ + ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], + ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']], + ['3', ['be', 'bs', 'cs', 'hr']], + ['4', ['cy', 'mt', 'sl']], + ['6', ['ar']], + ]; + } + + /** + * This array should be at least empty within the near future. + * + * This both depends on a complete list trying to add above as understanding + * the plural rules of the current failing languages. + * + * @return array with nplural together with langcodes + */ + public function failingLangcodes() + { + return [ + ['1', ['fa']], + ['2', ['jbo']], + ['3', ['cbs']], + ['4', ['gd', 'kw']], + ['5', ['ga']], + ]; + } + + /** + * We validate only on the plural coverage. Thus the real rules is not tested. + * + * @param string $nplural Plural expected + * @param array $matrix Containing langcodes and their plural index values + * @param bool $expectSuccess + */ + 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."); + } else { + $this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); + } + } + } + + protected function generateTestData($langCodes) + { + $translator = new class() { + use TranslatorTrait { + getPluralizationRule as public; + } + }; + + $matrix = []; + foreach ($langCodes as $langCode) { + for ($count = 0; $count < 200; ++$count) { + $plural = $translator->getPluralizationRule($count, $langCode); + $matrix[$langCode][$count] = $plural; + } + } + + return $matrix; + } +} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php new file mode 100644 index 00000000000..47fd6fa029f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +/** + * @author Nicolas Grekas + */ +interface TranslatableInterface +{ + public function trans(TranslatorInterface $translator, string $locale = null): string; +} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php new file mode 100644 index 00000000000..77b7a9c5860 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +/** + * @author Fabien Potencier + * + * @method string getLocale() Returns the default locale + */ +interface TranslatorInterface +{ + /** + * Translates the given message. + * + * When a number is provided as a parameter named "%count%", the message is parsed for plural + * forms and a translation is chosen according to this number using the following rules: + * + * Given a message with different plural translations separated by a + * pipe (|), this method returns the correct portion of the message based + * on the given number, locale and the pluralization rules in the message + * itself. + * + * The message supports two different types of pluralization rules: + * + * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples + * indexed: There is one apple|There are %count% apples + * + * The indexed solution can also contain labels (e.g. one: There is one apple). + * This is purely for making the translations more clear - it does not + * affect the functionality. + * + * The two methods can also be mixed: + * {0} There are no apples|one: There is one apple|more: There are %count% apples + * + * An interval can represent a finite set of numbers: + * {1,2,3,4} + * + * An interval can represent numbers between two numbers: + * [1, +Inf] + * ]-1,2[ + * + * The left delimiter can be [ (inclusive) or ] (exclusive). + * The right delimiter can be [ (exclusive) or ] (inclusive). + * Beside numbers, you can use -Inf and +Inf for the infinite. + * + * @see https://en.wikipedia.org/wiki/ISO_31-11 + * + * @param string $id The message id (may also be an object that can be cast to string) + * @param array $parameters An array of parameters for the message + * @param string|null $domain The domain for the message or null to use the default + * @param string|null $locale The locale or null to use the default + * + * @return string + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null); +} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php new file mode 100644 index 00000000000..405ce8d70d3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php @@ -0,0 +1,262 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; + +/** + * A trait to help implement TranslatorInterface and LocaleAwareInterface. + * + * @author Fabien Potencier + */ +trait TranslatorTrait +{ + private $locale; + + /** + * {@inheritdoc} + */ + public function setLocale(string $locale) + { + $this->locale = $locale; + } + + /** + * {@inheritdoc} + * + * @return string + */ + public function getLocale() + { + return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); + } + + /** + * {@inheritdoc} + */ + public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + { + if (null === $id || '' === $id) { + return ''; + } + + if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) { + return strtr($id, $parameters); + } + + $number = (float) $parameters['%count%']; + $locale = $locale ?: $this->getLocale(); + + $parts = []; + if (preg_match('/^\|++$/', $id)) { + $parts = explode('|', $id); + } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) { + $parts = $matches[0]; + } + + $intervalRegexp = <<<'EOF' +/^(?P + ({\s* + (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) + \s*}) + + | + + (?P[\[\]]) + \s* + (?P-Inf|\-?\d+(\.\d+)?) + \s*,\s* + (?P\+?Inf|\-?\d+(\.\d+)?) + \s* + (?P[\[\]]) +)\s*(?P.*?)$/xs +EOF; + + $standardRules = []; + foreach ($parts as $part) { + $part = trim(str_replace('||', '|', $part)); + + // try to match an explicit rule, then fallback to the standard ones + if (preg_match($intervalRegexp, $part, $matches)) { + if ($matches[2]) { + foreach (explode(',', $matches[3]) as $n) { + if ($number == $n) { + return strtr($matches['message'], $parameters); + } + } + } else { + $leftNumber = '-Inf' === $matches['left'] ? -\INF : (float) $matches['left']; + $rightNumber = is_numeric($matches['right']) ? (float) $matches['right'] : \INF; + + if (('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber) + && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber) + ) { + return strtr($matches['message'], $parameters); + } + } + } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) { + $standardRules[] = $matches[1]; + } else { + $standardRules[] = $part; + } + } + + $position = $this->getPluralizationRule($number, $locale); + + if (!isset($standardRules[$position])) { + // when there's exactly one rule given, and that rule is a standard + // rule, use this rule + if (1 === \count($parts) && isset($standardRules[0])) { + return strtr($standardRules[0], $parameters); + } + + $message = sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number); + + if (class_exists(InvalidArgumentException::class)) { + throw new InvalidArgumentException($message); + } + + throw new \InvalidArgumentException($message); + } + + return strtr($standardRules[$position], $parameters); + } + + /** + * Returns the plural position to use for the given locale and number. + * + * The plural rules are derived from code of the Zend Framework (2010-09-25), + * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). + * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + */ + private function getPluralizationRule(float $number, string $locale): int + { + $number = abs($number); + + switch ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { + case 'af': + case 'bn': + case 'bg': + case 'ca': + case 'da': + case 'de': + case 'el': + case 'en': + case 'en_US_POSIX': + case 'eo': + case 'es': + case 'et': + case 'eu': + case 'fa': + case 'fi': + case 'fo': + case 'fur': + case 'fy': + case 'gl': + case 'gu': + case 'ha': + case 'he': + case 'hu': + case 'is': + case 'it': + case 'ku': + case 'lb': + case 'ml': + case 'mn': + case 'mr': + case 'nah': + case 'nb': + case 'ne': + case 'nl': + case 'nn': + case 'no': + case 'oc': + case 'om': + case 'or': + case 'pa': + case 'pap': + case 'ps': + case 'pt': + case 'so': + case 'sq': + case 'sv': + case 'sw': + case 'ta': + case 'te': + case 'tk': + case 'ur': + case 'zu': + return (1 == $number) ? 0 : 1; + + case 'am': + case 'bh': + case 'fil': + case 'fr': + case 'gun': + case 'hi': + case 'hy': + case 'ln': + case 'mg': + case 'nso': + case 'pt_BR': + case 'ti': + case 'wa': + return ($number < 2) ? 0 : 1; + + case 'be': + case 'bs': + case 'hr': + case 'ru': + case 'sh': + case 'sr': + case 'uk': + return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); + + case 'cs': + case 'sk': + return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); + + case 'ga': + return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2); + + case 'lt': + return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); + + case 'sl': + return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3)); + + case 'mk': + return (1 == $number % 10) ? 0 : 1; + + case 'mt': + return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); + + case 'lv': + return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2); + + case 'pl': + return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); + + case 'cy': + return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3)); + + case 'ro': + return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); + + case 'ar': + return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))); + + default: + return 0; + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/composer.json b/upload/system/storage/vendor/symfony/translation-contracts/composer.json new file mode 100644 index 00000000000..65fe243a4ff --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation-contracts/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/translation-contracts", + "type": "library", + "description": "Generic abstractions related to translation", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Translation\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/upload/system/storage/vendor/twig/twig/.gitattributes b/upload/system/storage/vendor/twig/twig/.gitattributes index 75e18f85824..1ce832b520d 100644 --- a/upload/system/storage/vendor/twig/twig/.gitattributes +++ b/upload/system/storage/vendor/twig/twig/.gitattributes @@ -1,3 +1,4 @@ +/doc/** export-ignore /extra/** export-ignore /tests export-ignore /phpunit.xml.dist export-ignore diff --git a/upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml b/upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml new file mode 100644 index 00000000000..df60b6a3d60 --- /dev/null +++ b/upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml @@ -0,0 +1,173 @@ +name: "CI" + +on: + pull_request: + push: + branches: + - '2.x' + +env: + SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1 + +jobs: + tests: + name: "PHP ${{ matrix.php-version }}" + + runs-on: 'ubuntu-latest' + + continue-on-error: ${{ matrix.experimental }} + + strategy: + matrix: + php-version: + - '7.1.3' + - '7.2.5' + - '7.3' + - '7.4' + - '8.0' + - '8.1' + composer-options: [''] + experimental: [false] + + steps: + - name: "Checkout code" + uses: actions/checkout@v2.3.3 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@2.7.0 + with: + coverage: "none" + php-version: ${{ matrix.php-version }} + ini-values: memory_limit=-1 + tools: composer:v2 + + - name: "Add PHPUnit matcher" + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: "Set composer cache directory" + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: "Cache composer" + uses: actions/cache@v2.1.2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer- + + - run: composer install ${{ matrix.composer-options }} + + - name: "Install PHPUnit" + run: vendor/bin/simple-phpunit install + + - name: "PHPUnit version" + run: vendor/bin/simple-phpunit --version + + - name: "Run tests" + run: vendor/bin/simple-phpunit + + extension-tests: + needs: + - 'tests' + + name: "${{ matrix.extension }} with PHP ${{ matrix.php-version }}" + + runs-on: 'ubuntu-latest' + + continue-on-error: true + + strategy: + matrix: + php-version: + - '7.2.5' + - '7.3' + - '7.4' + - '8.0' + - '8.1' + extension: + - 'extra/cssinliner-extra' + - 'extra/html-extra' + - 'extra/inky-extra' + - 'extra/intl-extra' + - 'extra/markdown-extra' + - 'extra/string-extra' + - 'extra/twig-extra-bundle' + composer-options: [''] + experimental: [false] + + steps: + - name: "Checkout code" + uses: actions/checkout@v2.3.3 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@2.7.0 + with: + coverage: "none" + php-version: ${{ matrix.php-version }} + ini-values: memory_limit=-1 + tools: composer:v2 + + - name: "Add PHPUnit matcher" + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: "Set composer cache directory" + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: "Cache composer" + uses: actions/cache@v2.1.2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.extension }}-${{ hashFiles('composer.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.extension }}- + + - run: composer install + + - name: "Install PHPUnit" + run: vendor/bin/simple-phpunit install + + - name: "PHPUnit version" + run: vendor/bin/simple-phpunit --version + + - if: matrix.extension == 'extra/markdown-extra' && matrix.php-version == '8.0' + working-directory: ${{ matrix.extension}} + run: composer config platform.php 7.4.99 + + - name: "Composer install" + working-directory: ${{ matrix.extension}} + run: composer install + + - name: "Run tests" + working-directory: ${{ matrix.extension}} + run: ../../vendor/bin/simple-phpunit + + integration-tests: + needs: + - 'tests' + + name: "Integration tests with PHP ${{ matrix.php-version }}" + + runs-on: 'ubuntu-20.04' + + continue-on-error: true + + strategy: + matrix: + php-version: + - '7.3' + + steps: + - name: "Checkout code" + uses: actions/checkout@v2.3.3 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@2.7.0 + with: + coverage: "none" + extensions: "gd, pdo_sqlite" + php-version: ${{ matrix.php-version }} + ini-values: memory_limit=-1 + tools: composer:v2 + + - run: bash ./tests/drupal_test.sh + shell: "bash" diff --git a/upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml b/upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml new file mode 100644 index 00000000000..8bf2409679f --- /dev/null +++ b/upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml @@ -0,0 +1,60 @@ +name: "Documentation" + +on: + pull_request: + push: + branches: + - '1.x' + +jobs: + build: + name: "Build" + + runs-on: ubuntu-latest + + steps: + - name: "Checkout code" + uses: actions/checkout@v2 + + - name: "Set up Python 3.7" + uses: actions/setup-python@v1 + with: + python-version: '3.7' # Semantic version range syntax or exact version of a Python version + + - name: "Display Python version" + run: python -c "import sys; print(sys.version)" + + - name: "Install Sphinx dependencies" + run: sudo apt-get install python-dev build-essential + + - name: "Cache pip" + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('_build/.requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: "Install Sphinx + requirements via pip" + working-directory: "doc" + run: pip install -r _build/.requirements.txt + + - name: "Build documentation" + working-directory: "doc" + run: make -C _build SPHINXOPTS="-nqW -j auto" html + + doctor-rst: + name: "DOCtor-RST" + + runs-on: ubuntu-latest + + steps: + - name: "Checkout code" + uses: actions/checkout@v2 + + - name: "Run DOCtor-RST" + uses: docker://oskarstark/doctor-rst + with: + args: --short + env: + DOCS_DIR: 'doc/' diff --git a/upload/system/storage/vendor/twig/twig/.php_cs.dist b/upload/system/storage/vendor/twig/twig/.php-cs-fixer.dist.php similarity index 88% rename from upload/system/storage/vendor/twig/twig/.php_cs.dist rename to upload/system/storage/vendor/twig/twig/.php-cs-fixer.dist.php index b81882fbf2c..b07ac7fcabd 100644 --- a/upload/system/storage/vendor/twig/twig/.php_cs.dist +++ b/upload/system/storage/vendor/twig/twig/.php-cs-fixer.dist.php @@ -1,6 +1,6 @@ setRules([ '@Symfony' => true, '@Symfony:risky' => true, @@ -16,5 +16,5 @@ 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'], ]) ->setRiskyAllowed(true) - ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) + ->setFinder((new PhpCsFixer\Finder())->in(__DIR__)) ; diff --git a/upload/system/storage/vendor/twig/twig/.travis.yml b/upload/system/storage/vendor/twig/twig/.travis.yml deleted file mode 100644 index 4d8da6f5f9a..00000000000 --- a/upload/system/storage/vendor/twig/twig/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -language: php - -dist: xenial - -cache: - directories: - - vendor - - extra/*/vendor - - $HOME/.composer/cache/files - -env: - global: - - SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1 - -before_install: - - phpenv config-rm xdebug.ini || return 0 - - echo memory_limit = -1 >> ~/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/travis.ini - -install: - - travis_retry composer install - - export PHPUNIT=$(readlink -f ./vendor/bin/simple-phpunit) - - $PHPUNIT install - - (cd extra/cssinliner-extra && travis_retry composer install) - - (cd extra/html-extra && travis_retry composer install) - - (cd extra/inky-extra && travis_retry composer install) - - (cd extra/intl-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION = nightly ]] && (cd extra/markdown-extra && composer config platform.php 7.4.99) || true) - - (cd extra/markdown-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION = 7.1 ]] || (cd extra/string-extra && travis_retry composer install)) - -script: - - $PHPUNIT - - (cd extra/cssinliner-extra && $PHPUNIT) - - (cd extra/html-extra && $PHPUNIT) - - (cd extra/inky-extra && $PHPUNIT) - - (cd extra/intl-extra && $PHPUNIT) - - (cd extra/markdown-extra && $PHPUNIT) - - ([[ $TRAVIS_PHP_VERSION = 7.1 ]] || (cd extra/string-extra && $PHPUNIT)) - -jobs: - fast_finish: true - include: - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - - php: nightly - - stage: integration tests - php: 7.3 - script: ./drupal_test.sh diff --git a/upload/system/storage/vendor/twig/twig/CHANGELOG b/upload/system/storage/vendor/twig/twig/CHANGELOG index 04cf45396d8..3aaa9aac0b3 100644 --- a/upload/system/storage/vendor/twig/twig/CHANGELOG +++ b/upload/system/storage/vendor/twig/twig/CHANGELOG @@ -1,3 +1,68 @@ +# 2.14.11 (2022-02-04) + + * Fix a security issue when in a sandbox: the `sort` filter must require a Closure for the `arrow` parameter + +# 2.14.10 (2022-01-03) + + * Allow more null arguments when Twig expects a string (for better 8.1 support) + +# 2.14.9 (2022-01-03) + +* Allow null when Twig expects a string (for better 8.1 support) +* Add support for PHP 7.1 back +* Make some performance optimizations +* Allow Symfony translation contract v3+ + +# 2.14.8 (2021-11-25) + + * Bump minimum supported Symfony component versions + * Fix a deprecated message + +# 2.14.7 (2021-09-17) + + * Allow Symfony 6 + * Improve compatibility with PHP 8.1 + * Explicitly specify the encoding for mb_ord in JS escaper + +# 2.14.6 (2021-05-16) + + * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" + +# 2.14.5 (2021-05-12) + + * Fix PHP 8.1 compatibility + * Throw a proper exception when a template name is an absolute path (as it has never been supported) + +# 2.14.4 (2021-03-10) + + * Add the slug filter + +# 2.14.3 (2021-01-05) + + * Fix extra bundle compat with older versions of Symfony + +# 2.14.2 (2021-01-05) + + * Fix "odd" not working for negative numbers + +# 2.14.1 (2020-10-27) + +* Fix "include(template_from_string())" + +# 2.14.0 (2020-10-21) + + * Fix sandbox support when using "include(template_from_string())" + * Make round brackets optional for one argument tests like "same as" or "divisible by" + * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a } + * Drop PHP 7.1 support + +# 2.13.1 (2020-08-05) + + * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag + * Fix a regression when not using a space before an operator + * Restrict callables to closures in filters + * Allow trailing commas in argument lists (in calls as well as definitions) + # 2.13.0 (2020-07-05) * Fix options not taken into account when using "Michelf\MarkdownExtra" @@ -309,1154 +374,3 @@ * removed the ability to register a global variable after the runtime or the extensions have been initialized * improved the performance of the filesystem loader * removed features that were deprecated in 1.x - -# 1.43.1 (2020-XX-XX) - - * n/a - -# 1.43.0 (2020-07-05) - - * Throw exception in case non-Traversable data is passed to "filter" - * Fix context optimization on PHP 7.4 - * Fix PHP 8 compatibility - * Drop PHP 5.5 5.6, and 7.0 support - * Fix ambiguous syntax parsing - -# 1.42.5 (2020-02-11) - - * Fix implementation of case-insensitivity for method names - -# 1.42.4 (2019-11-11) - - * optimized "block('foo') ?? 'bar" - * added supported for exponential numbers - -# 1.42.3 (2019-08-24) - - * fixed the "split" filter when the delimiter is "0" - * fixed the "empty" test on Traversable instances - * fixed cache when opcache is installed but disabled - * fixed PHP 7.4 compatibility - * bumped the minimal PHP version to 5.5 - -# 1.42.2 (2019-06-18) - - * Display partial output (PHP buffer) when an error occurs in debug mode - -# 1.42.1 (2019-06-04) - - * added support for "Twig\Markup" instances in the "in" test (again) - * allowed string operators as variables names in assignments - -# 1.42.0 (2019-05-31) - - * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance) - * fixed a PHP fatal error when calling a macro imported in a block in a nested block - * fixed a PHP fatal error when calling a macro imported in the template in another macro - * fixed wrong error message on "import" and "from" - -# 1.41.0 (2019-05-14) - - * fixed support for PHP 7.4 - * added "filter", "map", and "reduce" filters (and support for arrow functions) - * fixed partial output leak when a PHP fatal error occurs - * optimized context access on PHP 7.4 - -# 1.40.1 (2019-04-29) - -# fixed regression in NodeTraverser - -# 1.40.0 (2019-04-28) - - * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) - * added the "apply" tag as a replacement for the "filter" tag - * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning) - * added support for "Twig\Markup" instances in the "in" test - * fixed Lexer when using custom options containing the # char - * fixed "import" when macros are stored in a template string - -# 1.39.1 (2019-04-16) - - * fixed EscaperNodeVisitor - -# 1.39.0 (2019-04-16) - - * added Traversable support for the length filter - * fixed some wrong location in error messages - * made exception creation faster - * made escaping on ternary expressions (?: and ??) more fine-grained - * added the possibility to give a nice name to string templates (template_from_string function) - * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags) - * fixed "include" with "ignore missing" when an error loading occurs in the included template - * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) - -# 1.38.4 (2019-03-23) - - * fixed CheckToStringNode implementation (broken when a function/filter is variadic) - -# 1.38.3 (2019-03-21) - - * fixed the spaceless filter so that it behaves like the spaceless tag - * fixed BC break on Environment::resolveTemplate() - * fixed the bundled Autoloader to also load namespaced classes - * allowed Traversable objects to be used in the "with" tag - * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags - -# 1.38.2 (2019-03-12) - - * added TemplateWrapper::getTemplateName() - -# 1.38.1 (2019-03-12) - - * fixed class aliases - -# 1.38.0 (2019-03-12) - - * fixed sandbox security issue (under some circumstances, calling the - __toString() method on an object was possible even if not allowed by the - security policy) - * fixed batch filter clobbers array keys when fill parameter is used - * added preserveKeys support for the batch filter - * fixed "embed" support when used from "template_from_string" - * added the possibility to pass a TemplateWrapper to Twig\Environment::load() - * improved the performance of the sandbox - * added a spaceless filter - * added max value to the "random" function - * made namespace classes the default classes (PSR-0 ones are aliases now) - * removed duplicated directory separator in FilesystemLoader - * added Twig\Loader\ChainLoader::getLoaders() - * changed internal code to use the namespaced classes as much as possible - -# 1.37.1 (2019-01-14) - - * fixed regression (key exists check for non ArrayObject objects) - * fixed logic in TemplateWrapper - -# 1.37.0 (2019-01-14) - - * fixed ArrayObject access with a null value - * fixed embedded templates starting with a BOM - * fixed using a Twig_TemplateWrapper instance as an argument to extends - * switched generated code to use the PHP short array notation - * dropped PHP 5.3 support - * fixed float representation in compiled templates - * added a second argument to the join filter (last separator configuration) - -# 1.36.0 (2018-12-16) - - * made sure twig_include returns a string - * fixed multi-byte UFT-8 in escape('html_attr') - * added the "deprecated" tag - * added support for dynamically named tests - * fixed GlobalsInterface extended class - * fixed filesystem loader throwing an exception instead of returning false - -# 1.35.4 (2018-07-13) - - * ensured that syntax errors are triggered with the right line - * added the Symfony ctype polyfill as a dependency - * "js" filter now produces valid JSON - -# 1.35.3 (2018-03-20) - - * fixed block names unicity - * fixed counting children of SimpleXMLElement objects - * added missing else clause to avoid infinite loops - * fixed .. (range operator) in sandbox policy - -# 1.35.2 (2018-03-03) - - * fixed a regression in the way the profiler is registered in templates - -# 1.35.1 (2018-03-02) - - * added an exception when using "===" instead of "same as" - * fixed possible array to string conversion concealing actual error - * made variable names deterministic in compiled templates - * fixed length filter when passing an instance of IteratorAggregate - * fixed Environment::resolveTemplate to accept instances of TemplateWrapper - -# 1.35.0 (2017-09-27) - - * added Twig_Profiler_Profile::reset() - * fixed use TokenParser to return an empty Node - * added RuntimeExtensionInterface - * added circular reference detection when loading templates - -# 1.34.4 (2017-07-04) - - * added support for runtime loaders in IntegrationTestCase - * fixed deprecation when using Twig_Profiler_Dumper_Html - -# 1.34.3 (2017-06-07) - - * fixed namespaces introduction - -# 1.34.2 (2017-06-05) - - * fixed namespaces introduction - -# 1.34.1 (2017-06-05) - - * fixed namespaces introduction - -# 1.34.0 (2017-06-05) - - * added support for PHPUnit 6 when testing extensions - * fixed PHP 7.2 compatibility - * fixed template name generation in Twig_Environment::createTemplate() - * removed final tag on Twig_TokenParser_Include - * added namespaced aliases for all (non-deprecated) classes and interfaces - * dropped HHVM support - * dropped PHP 5.2 support - -# 1.33.2 (2017-04-20) - - * fixed edge case in the method cache for Twig attributes - -# 1.33.1 (2017-04-18) - - * fixed the empty() test - -# 1.33.0 (2017-03-22) - - * fixed a race condition handling when writing cache files - * "length" filter now returns string length when applied to an object that does - not implement \Countable but provides __toString() - * "empty" test will now consider the return value of the __toString() method for - objects implement __toString() but not \Countable - * fixed JS escaping for unicode characters with higher code points - -# 1.32.0 (2017-02-26) - - * fixed deprecation notice in Twig_Util_DeprecationCollector - * added a PSR-11 compatible runtime loader - * added `side` argument to `trim` to allow left or right trimming only. - -# 1.31.0 (2017-01-11) - - * added Twig_NodeCaptureInterface for nodes that capture all output - * fixed marking the environment as initialized too early - * fixed C89 compat for the C extension - * turned fatal error into exception when a previously generated cache is corrupted - * fixed offline cache warm-ups for embedded templates - -# 1.30.0 (2016-12-23) - - * added Twig_FactoryRuntimeLoader - * deprecated function/test/filter/tag overriding - * deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr - -# 1.29.0 (2016-12-13) - - * fixed sandbox being left enabled if an exception is thrown while rendering - * marked some classes as being final (via @final) - * made Twig_Error report real source path when possible - * added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 (replaces {{ _self.templateName }}) - * deprecated silent display of undefined blocks - * deprecated support for mbstring.func_overload != 0 - -# 1.28.2 (2016-11-23) - - * fixed precedence between getFoo() and isFoo() in Twig_Template::getAttribute() - * improved a deprecation message - -# 1.28.1 (2016-11-18) - - * fixed block() function when used with a template argument - -# 1.28.0 (2016-11-17) - - * added support for the PHP 7 null coalescing operator for the ?? Twig implementation - * exposed a way to access template data and methods in a portable way - * changed context access to use the PHP 7 null coalescing operator when available - * added the "with" tag - * added support for a custom template on the block() function - * added "is defined" support for block() and constant() - * optimized the way attributes are fetched - -# 1.27.0 (2016-10-25) - - * deprecated Twig_Parser::getEnvironment() - * deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor() - * deprecated Twig_Compiler::addIndentation() - * fixed regression when registering two extensions having the same class name - * deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead) - * fixed the filesystem loader with relative paths - * deprecated Twig_Node::getLine() in favor of Twig_Node::getTemplateLine() - * deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext() - * deprecated Twig_Node::getFilename() in favor of Twig_Node::getTemplateName() - * deprecated the "filename" escaping strategy (use "name" instead) - * added Twig_Source to hold information about the original template - * deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() in favor of Twig_Error::getTemplateName() and Twig_Error::setTemplateName() - * deprecated Parser::getFilename() - * fixed template paths when a template name contains a protocol like vfs:// - * improved debugging with Twig_Sandbox_SecurityError exceptions for disallowed methods and properties - -# 1.26.1 (2016-10-05) - - * removed template source code from generated template classes when debug is disabled - * fixed default implementation of Twig_Template::getDebugInfo() for better BC - * fixed regression on static calls for functions/filters/tests - -# 1.26.0 (2016-10-02) - - * added template cache invalidation based on more environment options - * added a missing deprecation notice - * fixed template paths when a template is stored in a PHAR file - * allowed filters/functions/tests implementation to use a different class than the extension they belong to - * deprecated Twig_ExtensionInterface::getName() - -# 1.25.0 (2016-09-21) - - * changed the way we store template source in template classes - * removed usage of realpath in cache keys - * fixed Twig cache sharing when used with different versions of PHP - * removed embed parent workaround for simple use cases - * deprecated the ability to store non Node instances in Node::$nodes - * deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler() - * deprecated Twig_Compiler::getFilename() - -# 1.24.2 (2016-09-01) - - * fixed static callables - * fixed a potential PHP warning when loading the cache - * fixed a case where the autoescaping does not work as expected - -# 1.24.1 (2016-05-30) - - * fixed reserved keywords (forbids true, false, null and none keywords for variables names) - * fixed support for PHP7 (Throwable support) - * marked the following methods as being internals on Twig_Environment: - getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(), - getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(), - getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension() - -# 1.24.0 (2016-01-25) - - * adding support for the ?? operator - * fixed the defined test when used on a constant, a map, or a sequence - * undeprecated _self (should only be used to get the template name, not the template instance) - * fixed parsing on PHP7 - -# 1.23.3 (2016-01-11) - - * fixed typo - -# 1.23.2 (2015-01-11) - - * added versions in deprecated messages - * made file cache tolerant for trailing (back)slashes on directory configuration - * deprecated unused Twig_Node_Expression_ExtensionReference class - -# 1.23.1 (2015-11-05) - - * fixed some exception messages which triggered PHP warnings - * fixed BC on Twig_Test_NodeTestCase - -# 1.23.0 (2015-10-29) - - * deprecated the possibility to override an extension by registering another one with the same name - * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC) - * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC) - * deprecated Twig_Environment::computeAlternatives() - -# 1.22.3 (2015-10-13) - - * fixed regression when using null as a cache strategy - * improved performance when checking template freshness - * fixed warnings when loaded templates do not exist - * fixed template class name generation to prevent possible collisions - * fixed logic for custom escapers to call them even on integers and null values - * changed template cache names to take into account the Twig C extension - -# 1.22.2 (2015-09-22) - - * fixed a race condition in template loading - -# 1.22.1 (2015-09-15) - - * fixed regression in template_from_string - -# 1.22.0 (2015-09-13) - - * made Twig_Test_IntegrationTestCase more flexible - * added an option to force PHP bytecode invalidation when writing a compiled template into the cache - * fixed the profiler duration for the root node - * changed template cache names to take into account enabled extensions - * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(), - Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix() - * added a way to override the filesystem template cache system - * added a way to get the original template source from Twig_Template - -# 1.21.2 (2015-09-09) - - * fixed variable names for the deprecation triggering code - * fixed escaping strategy detection based on filename - * added Traversable support for replace, merge, and sort - * deprecated support for character by character replacement for the "replace" filter - -# 1.21.1 (2015-08-26) - - * fixed regression when using the deprecated Twig_Test_* classes - -# 1.21.0 (2015-08-24) - - * added deprecation notices for deprecated features - * added a deprecation "framework" for filters/functions/tests and test fixtures - -# 1.20.0 (2015-08-12) - - * forbid access to the Twig environment from templates and internal parts of Twig_Template - * fixed limited RCEs when in sandbox mode - * deprecated Twig_Template::getEnvironment() - * deprecated the _self variable for usage outside of the from and import tags - * added Twig_BaseNodeVisitor to ease the compatibility of node visitors - between 1.x and 2.x - -# 1.19.0 (2015-07-31) - - * fixed wrong error message when including an undefined template in a child template - * added support for variadic filters, functions, and tests - * added support for extra positional arguments in macros - * added ignore_missing flag to the source function - * fixed batch filter with zero items - * deprecated Twig_Environment::clearTemplateCache() - * fixed sandbox disabling when using the include function - -# 1.18.2 (2015-06-06) - - * fixed template/line guessing in exceptions for nested templates - * optimized the number of inodes and the size of realpath cache when using the cache - -# 1.18.1 (2015-04-19) - - * fixed memory leaks in the C extension - * deprecated Twig_Loader_String - * fixed the slice filter when used with a SimpleXMLElement object - * fixed filesystem loader when trying to load non-files (like directories) - -# 1.18.0 (2015-01-25) - - * fixed some error messages where the line was wrong (unknown variables or argument names) - * added a new way to customize the main Module node (via empty nodes) - * added Twig_Environment::createTemplate() to create a template from a string - * added a profiler - * fixed filesystem loader cache when different file paths are used for the same template - -# 1.17.0 (2015-01-14) - - * added a 'filename' autoescaping strategy, which dynamically chooses the - autoescaping strategy for a template based on template file extension. - -# 1.16.3 (2014-12-25) - - * fixed regression for dynamic parent templates - * fixed cache management with statcache - * fixed a regression in the slice filter - -# 1.16.2 (2014-10-17) - - * fixed timezone on dates as strings - * fixed 2-words test names when a custom node class is not used - * fixed macros when using an argument named like a PHP super global (like GET or POST) - * fixed date_modify when working with DateTimeImmutable - * optimized for loops - * fixed multi-byte characters handling in the split filter - * fixed a regression in the in operator - * fixed a regression in the slice filter - -# 1.16.1 (2014-10-10) - - * improved error reporting in a sandboxed template - * fixed missing error file/line information under certain circumstances - * fixed wrong error line number in some error messages - * fixed the in operator to use strict comparisons - * sped up the slice filter - * fixed for mb function overload mb_substr acting different - * fixed the attribute() function when passing a variable for the arguments - -# 1.16.0 (2014-07-05) - - * changed url_encode to always encode according to RFC 3986 - * fixed inheritance in a 'use'-hierarchy - * removed the __toString policy check when the sandbox is disabled - * fixed recursively calling blocks in templates with inheritance - -# 1.15.1 (2014-02-13) - - * fixed the conversion of the special '0000-00-00 00:00' date - * added an error message when trying to import an undefined block from a trait - * fixed a C extension crash when accessing defined but uninitialized property. - -# 1.15.0 (2013-12-06) - - * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException - * added min and max functions - * added the round filter - * fixed a bug that prevented the optimizers to be enabled/disabled selectively - * fixed first and last filters for UTF-8 strings - * added a source function to include the content of a template without rendering it - * fixed the C extension sandbox behavior when get or set is prepend to method name - -# 1.14.2 (2013-10-30) - - * fixed error filename/line when an error occurs in an included file - * allowed operators that contain whitespaces to have more than one whitespace - * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by") - -# 1.14.1 (2013-10-15) - - * made it possible to use named operators as variables - * fixed the possibility to have a variable named 'matches' - * added support for PHP 5.5 DateTimeInterface - -# 1.14.0 (2013-10-03) - - * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy - * added new operators: ends with, starts with, and matches - * fixed some compatibility issues with HHVM - * added a way to add custom escaping strategies - * fixed the C extension compilation on Windows - * fixed the batch filter when using a fill argument with an exact match of elements to batch - * fixed the filesystem loader cache when a template name exists in several namespaces - * fixed template_from_string when the template includes or extends other ones - * fixed a crash of the C extension on an edge case - -# 1.13.2 (2013-08-03) - - * fixed the error line number for an error occurs in and embedded template - * fixed crashes of the C extension on some edge cases - -# 1.13.1 (2013-06-06) - - * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem - * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface - * adjusted backtrace call to reduce memory usage when an error occurs - * added support for object instances as the second argument of the constant test - * fixed the include function when used in an assignment - -# 1.13.0 (2013-05-10) - - * fixed getting a numeric-like item on a variable ('09' for instance) - * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access: - `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`) - * made the escape filter 20% faster for happy path (escaping string for html with UTF-8) - * changed ☃ to § in tests - * enforced usage of named arguments after positional ones - -# 1.12.3 (2013-04-08) - - * fixed a security issue in the filesystem loader where it was possible to include a template one - level above the configured path - * fixed fatal error that should be an exception when adding a filter/function/test too late - * added a batch filter - * added support for encoding an array as query string in the url_encode filter - -# 1.12.2 (2013-02-09) - - * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00) - * fixed globals when getGlobals is called early on - * added the first and last filter - -# 1.12.1 (2013-01-15) - - * added support for object instances as the second argument of the constant function - * relaxed globals management to avoid a BC break - * added support for {{ some_string[:2] }} - -# 1.12.0 (2013-01-08) - - * added verbatim as an alias for the raw tag to avoid confusion with the raw filter - * fixed registration of tests and functions as anonymous functions - * fixed globals management - -# 1.12.0-RC1 (2012-12-29) - - * added an include function (does the same as the include tag but in a more flexible way) - * added the ability to use any PHP callable to define filters, functions, and tests - * added a syntax error when using a loop variable that is not defined - * added the ability to set default values for macro arguments - * added support for named arguments for filters, tests, and functions - * moved filters/functions/tests syntax errors to the parser - * added support for extended ternary operator syntaxes - -# 1.11.1 (2012-11-11) - - * fixed debug info line numbering (was off by 2) - * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1) - * optimized variable access on PHP 5.4 - * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX) - -# 1.11.0 (2012-11-07) - - * fixed macro compilation when a variable name is a PHP reserved keyword - * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone - * fixed bitwise operator precedences - * added the template_from_string function - * fixed default timezone usage for the date function - * optimized the way Twig exceptions are managed (to make them faster) - * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster) - -# 1.10.3 (2012-10-19) - - * fixed wrong template location in some error messages - * reverted a BC break introduced in 1.10.2 - * added a split filter - -# 1.10.2 (2012-10-15) - - * fixed macro calls on PHP 5.4 - -# 1.10.1 (2012-10-15) - - * made a speed optimization to macro calls when imported via the "import" tag - * fixed C extension compilation on Windows - * fixed a segfault in the C extension when using DateTime objects - -# 1.10.0 (2012-09-28) - - * extracted functional tests framework to make it reusable for third-party extensions - * added namespaced templates support in Twig_Loader_Filesystem - * added Twig_Loader_Filesystem::prependPath() - * fixed an error when a token parser pass a closure as a test to the subparse() method - -# 1.9.2 (2012-08-25) - - * fixed the in operator for objects that contain circular references - * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface - -# 1.9.1 (2012-07-22) - - * optimized macro calls when auto-escaping is on - * fixed wrong parent class for Twig_Function_Node - * made Twig_Loader_Chain more explicit about problems - -# 1.9.0 (2012-07-13) - - * made the parsing independent of the template loaders - * fixed exception trace when an error occurs when rendering a child template - * added escaping strategies for CSS, URL, and HTML attributes - * fixed nested embed tag calls - * added the date_modify filter - -# 1.8.3 (2012-06-17) - - * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash - * fixed escaping when a project defines a function named html or js - * fixed chmod mode to apply the umask correctly - -# 1.8.2 (2012-05-30) - - * added the abs filter - * fixed a regression when using a number in template attributes - * fixed compiler when mbstring.func_overload is set to 2 - * fixed DateTimeZone support in date filter - -# 1.8.1 (2012-05-17) - - * fixed a regression when dealing with SimpleXMLElement instances in templates - * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini - * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ) - -# 1.8.0 (2012-05-08) - - * enforced interface when adding tests, filters, functions, and node visitors from extensions - * fixed a side-effect of the date filter where the timezone might be changed - * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer) - * added a way to dynamically change the auto-escaping strategy according to the template "filename" - * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html) - * added an embed tag - -# 1.7.0 (2012-04-24) - - * fixed a PHP warning when using CIFS - * fixed template line number in some exceptions - * added an iterable test - * added an error when defining two blocks with the same name in a template - * added the preserves_safety option for filters - * fixed a PHP notice when trying to access a key on a non-object/array variable - * enhanced error reporting when the template file is an instance of SplFileInfo - * added Twig_Environment::mergeGlobals() - * added compilation checks to avoid misuses of the sandbox tag - * fixed filesystem loader freshness logic for high traffic websites - * fixed random function when charset is null - -# 1.6.5 (2012-04-11) - - * fixed a regression when a template only extends another one without defining any blocks - -# 1.6.4 (2012-04-02) - - * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3 - * fixed performance when compiling large files - * optimized parent template creation when the template does not use dynamic inheritance - -# 1.6.3 (2012-03-22) - - * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension - * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot - * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate - -# 1.6.2 (2012-03-18) - - * fixed sandbox mode when used with inheritance - * added preserveKeys support for the slice filter - * fixed the date filter when a DateTime instance is passed with a specific timezone - * added a trim filter - -# 1.6.1 (2012-02-29) - - * fixed Twig C extension - * removed the creation of Twig_Markup instances when not needed - * added a way to set the default global timezone for dates - * fixed the slice filter on strings when the length is not specified - * fixed the creation of the cache directory in case of a race condition - -# 1.6.0 (2012-02-04) - - * fixed raw blocks when used with the whitespace trim option - * made a speed optimization to macro calls when imported via the "from" tag - * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added - * fixed the attribute function when passing arguments - * added slice notation support for the [] operator (syntactic sugar for the slice operator) - * added a slice filter - * added string support for the reverse filter - * fixed the empty test and the length filter for Twig_Markup instances - * added a date function to ease date comparison - * fixed unary operators precedence - * added recursive parsing support in the parser - * added string and integer handling for the random function - -# 1.5.1 (2012-01-05) - - * fixed a regression when parsing strings - -# 1.5.0 (2012-01-04) - - * added Traversable objects support for the join filter - -# 1.5.0-RC2 (2011-12-30) - - * added a way to set the default global date interval format - * fixed the date filter for DateInterval instances (setTimezone() does not exist for them) - * refactored Twig_Template::display() to ease its extension - * added a number_format filter - -# 1.5.0-RC1 (2011-12-26) - - * removed the need to quote hash keys - * allowed hash keys to be any expression - * added a do tag - * added a flush tag - * added support for dynamically named filters and functions - * added a dump function to help debugging templates - * added a nl2br filter - * added a random function - * added a way to change the default format for the date filter - * fixed the lexer when an operator ending with a letter ends a line - * added string interpolation support - * enhanced exceptions for unknown filters, functions, tests, and tags - -# 1.4.0 (2011-12-07) - - * fixed lexer when using big numbers (> PHP_INT_MAX) - * added missing preserveKeys argument to the reverse filter - * fixed macros containing filter tag calls - -# 1.4.0-RC2 (2011-11-27) - - * removed usage of Reflection in Twig_Template::getAttribute() - * added a C extension that can optionally replace Twig_Template::getAttribute() - * added negative timestamp support to the date filter - -# 1.4.0-RC1 (2011-11-20) - - * optimized variable access when using PHP 5.4 - * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby - * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders - * added Twig_Function_Node to allow more complex functions to have their own Node class - * added Twig_Filter_Node to allow more complex filters to have their own Node class - * added Twig_Test_Node to allow more complex tests to have their own Node class - * added a better error message when a template is empty but contain a BOM - * fixed "in" operator for empty strings - * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option) - * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order) - * added Twig_Environment::display() - * made the escape filter smarter when the encoding is not supported by PHP - * added a convert_encoding filter - * moved all node manipulations outside the compile() Node method - * made several speed optimizations - -# 1.3.0 (2011-10-08) - -no changes - -# 1.3.0-RC1 (2011-10-04) - - * added an optimization for the parent() function - * added cache reloading when auto_reload is true and an extension has been modified - * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup) - * allowed empty templates to be used as traits - * added traits support for the "parent" function - -# 1.2.0 (2011-09-13) - -no changes - -# 1.2.0-RC1 (2011-09-10) - - * enhanced the exception when a tag remains unclosed - * added support for empty Countable objects for the "empty" test - * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions) - * added better support for encoding problems when escaping a string (available as of PHP 5.4) - * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %}) - * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %}) - * added support for bitwise operators in expressions - * added the "attribute" function to allow getting dynamic attributes on variables - * added Twig_Loader_Chain - * added Twig_Loader_Array::setTemplate() - * added an optimization for the set tag when used to capture a large chunk of static text - * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros) - * removed the possibility to use the "extends" tag from a block - * added "if" modifier support to "for" loops - -# 1.1.2 (2011-07-30) - - * fixed json_encode filter on PHP 5.2 - * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }}) - * fixed inheritance when using conditional parents - * fixed compilation of templates when the body of a child template is not empty - * fixed output when a macro throws an exception - * fixed a parsing problem when a large chunk of text is enclosed in a comment tag - * added PHPDoc for all Token parsers and Core extension functions - -# 1.1.1 (2011-07-17) - - * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls) - * made some performance improvement for some edge cases - -# 1.1.0 (2011-06-28) - - * fixed json_encode filter - -# 1.1.0-RC3 (2011-06-24) - - * fixed method case-sensitivity when using the sandbox mode - * added timezone support for the date filter - * fixed possible security problems with NUL bytes - -# 1.1.0-RC2 (2011-06-16) - - * added an exception when the template passed to "use" is not a string - * made 'a.b is defined' not throw an exception if a is not defined (in strict mode) - * added {% line \d+ %} directive - -# 1.1.0-RC1 (2011-05-28) - -Flush your cache after upgrading. - - * fixed date filter when using a timestamp - * fixed the defined test for some cases - * fixed a parsing problem when a large chunk of text is enclosed in a raw tag - * added support for horizontal reuse of template blocks (see docs for more information) - * added whitespace control modifier to all tags (see docs for more information) - * added null as an alias for none (the null test is also an alias for the none test now) - * made TRUE, FALSE, NONE equivalent to their lowercase counterparts - * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line - * moved display() method to Twig_Template (generated templates should now use doDisplay() instead) - -# 1.0.0 (2011-03-27) - - * fixed output when using mbstring - * fixed duplicate call of methods when using the sandbox - * made the charset configurable for the escape filter - -# 1.0.0-RC2 (2011-02-21) - - * changed the way {% set %} works when capturing (the content is now marked as safe) - * added support for macro name in the endmacro tag - * make Twig_Error compatible with PHP 5.3.0 > - * fixed an infinite loop on some Windows configurations - * fixed the "length" filter for numbers - * fixed Template::getAttribute() as properties in PHP are case sensitive - * removed coupling between Twig_Node and Twig_Template - * fixed the ternary operator precedence rule - -# 1.0.0-RC1 (2011-01-09) - -Backward incompatibilities: - - * the "items" filter, which has been deprecated for quite a long time now, has been removed - * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10) - * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }} - * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }} - * the "for" tag does not support "joined by" anymore - * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off") - * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %}) - * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %}) - * removed the grammar and simple token parser (moved to the Twig Extensions repository) - -Changes: - - * added "needs_context" option for filters and functions (the context is then passed as a first argument) - * added global variables support - * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode) - * added the "from" tag to import macros as functions - * added support for functions (a function is just syntactic sugar for a getAttribute() call) - * made macros callable when sandbox mode is enabled - * added an exception when a macro uses a reserved name - * the "default" filter now uses the "empty" test instead of just checking for null - * added the "empty" test - -# 0.9.10 (2010-12-16) - -Backward incompatibilities: - - * The Escaper extension is enabled by default, which means that all displayed - variables are now automatically escaped. You can revert to the previous - behavior by removing the extension via $env->removeExtension('escaper') - or just set the 'autoescape' option to 'false'. - * removed the "without loop" attribute for the "for" tag (not needed anymore - as the Optimizer take care of that for most cases) - * arrays and hashes have now a different syntax - * arrays keep the same syntax with square brackets: [1, 2] - * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"}) - * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1}) - * the i18n extension is now part of the Twig Extensions repository - -Changes: - - * added the merge filter - * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead - * fixed usage of operators as method names (like is, in, and not) - * changed the order of execution for node visitors - * fixed default() filter behavior when used with strict_variables set to on - * fixed filesystem loader compatibility with PHAR files - * enhanced error messages when an unexpected token is parsed in an expression - * fixed filename not being added to syntax error messages - * added the autoescape option to enable/disable autoescaping - * removed the newline after a comment (mimics PHP behavior) - * added a syntax error exception when parent block is used on a template that does not extend another one - * made the Escaper extension enabled by default - * fixed sandbox extension when used with auto output escaping - * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved) - * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters) - * added priority to node visitors - -# 0.9.9 (2010-11-28) - -Backward incompatibilities: - * the self special variable has been renamed to _self - * the odd and even filters are now tests: - {{ foo|odd }} must now be written {{ foo is odd }} - * the "safe" filter has been renamed to "raw" - * in Node classes, - sub-nodes are now accessed via getNode() (instead of property access) - attributes via getAttribute() (instead of array access) - * the urlencode filter had been renamed to url_encode - * the include tag now merges the passed variables with the current context by default - (the old behavior is still possible by adding the "only" keyword) - * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime) - * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead) - * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }}) - -Changes: - * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template - * changed trans tag to accept any variable for the plural count - * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements) - * added the ** (power) operator - * changed the algorithm used for parsing expressions - * added the spaceless tag - * removed trim_blocks option - * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar()) - * changed all exceptions to extend Twig_Error - * fixed unary expressions ({{ not(1 or 0) }}) - * fixed child templates (with an extend tag) that uses one or more imports - * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }}) - * escaping has been rewritten - * the implementation of template inheritance has been rewritten - (blocks can now be called individually and still work with inheritance) - * fixed error handling for if tag when a syntax error occurs within a subparse process - * added a way to implement custom logic for resolving token parsers given a tag name - * fixed js escaper to be stricter (now uses a whilelist-based js escaper) - * added the following filers: "constant", "trans", "replace", "json_encode" - * added a "constant" test - * fixed objects with __toString() not being autoescaped - * fixed subscript expressions when calling __call() (methods now keep the case) - * added "test" feature (accessible via the "is" operator) - * removed the debug tag (should be done in an extension) - * fixed trans tag when no vars are used in plural form - * fixed race condition when writing template cache - * added the special _charset variable to reference the current charset - * added the special _context variable to reference the current context - * renamed self to _self (to avoid conflict) - * fixed Twig_Template::getAttribute() for protected properties - -# 0.9.8 (2010-06-28) - -Backward incompatibilities: - * the trans tag plural count is now attached to the plural tag: - old: `{% trans count %}...{% plural %}...{% endtrans %}` - new: `{% trans %}...{% plural count %}...{% endtrans %}` - - * added a way to translate strings coming from a variable ({% trans var %}) - * fixed trans tag when used with the Escaper extension - * fixed default cache umask - * removed Twig_Template instances from the debug tag output - * fixed objects with __isset() defined - * fixed set tag when used with a capture - * fixed type hinting for Twig_Environment::addFilter() method - -# 0.9.7 (2010-06-12) - -Backward incompatibilities: - * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %}) - * removed the sandboxed attribute of the include tag (use the new sandbox tag instead) - * refactored the Node system (if you have custom nodes, you will have to update them to use the new API) - - * added self as a special variable that refers to the current template (useful for importing macros from the current template) - * added Twig_Template instance support to the include tag - * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %}) - * added a grammar sub-framework to ease the creation of custom tags - * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface) - * removed the Twig_Resource::resolveMissingFilter() method - * fixed the filter tag which did not apply filtering to included files - * added a bunch of unit tests - * added a bunch of phpdoc - * added a sandbox tag in the sandbox extension - * changed the date filter to support any date format supported by DateTime - * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default) - * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor - * changed the cache option to only accepts an explicit path to a cache directory or false - * added a way to add token parsers, filters, and visitors without creating an extension - * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface - * changed the generated code to match the new coding standards - * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }}) - * added an exception when a child template has a non-empty body (as it is always ignored when rendering) - -# 0.9.6 (2010-05-12) - - * fixed variables defined outside a loop and for which the value changes in a for loop - * fixed the test suite for PHP 5.2 and older versions of PHPUnit - * added support for __call() in expression resolution - * fixed node visiting for macros (macros are now visited by visitors as any other node) - * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now) - * added the cycle filter - * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII - * added a long-syntax for the set tag ({% set foo %}...{% endset %}) - * unit tests are now powered by PHPUnit - * added support for gettext via the `i18n` extension - * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values - * added a more useful exception if an if tag is not closed properly - * added support for escaping strategy in the autoescape tag - * fixed lexer when a template has a big chunk of text between/in a block - -# 0.9.5 (2010-01-20) - -As for any new release, don't forget to remove all cached templates after -upgrading. - -If you have defined custom filters, you MUST upgrade them for this release. To -upgrade, replace "array" with "new Twig_Filter_Function", and replace the -environment constant by the "needs_environment" option: - - // before - 'even' => array('twig_is_even_filter', false), - 'escape' => array('twig_escape_filter', true), - - // after - 'even' => new Twig_Filter_Function('twig_is_even_filter'), - 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)), - -If you have created NodeTransformer classes, you will need to upgrade them to -the new interface (please note that the interface is not yet considered -stable). - - * fixed list nodes that did not extend the Twig_NodeListInterface - * added the "without loop" option to the for tag (it disables the generation of the loop variable) - * refactored node transformers to node visitors - * fixed automatic-escaping for blocks - * added a way to specify variables to pass to an included template - * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules) - * improved the filter system to allow object methods to be used as filters - * changed the Array and String loaders to actually make use of the cache mechanism - * included the default filter function definitions in the extension class files directly (Core, Escaper) - * added the // operator (like the floor() PHP function) - * added the .. operator (as a syntactic sugar for the range filter when the step is 1) - * added the in operator (as a syntactic sugar for the in filter) - * added the following filters in the Core extension: in, range - * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes) - * enhanced some error messages to provide better feedback in case of parsing errors - -# 0.9.4 (2009-12-02) - -If you have custom loaders, you MUST upgrade them for this release: The -Twig_Loader base class has been removed, and the Twig_LoaderInterface has also -been changed (see the source code for more information or the documentation). - - * added support for DateTime instances for the date filter - * fixed loop.last when the array only has one item - * made it possible to insert newlines in tag and variable blocks - * fixed a bug when a literal '\n' were present in a template text - * fixed bug when the filename of a template contains */ - * refactored loaders - -# 0.9.3 (2009-11-11) - -This release is NOT backward compatible with the previous releases. - - The loaders do not take the cache and autoReload arguments anymore. Instead, - the Twig_Environment class has two new options: cache and auto_reload. - Upgrading your code means changing this kind of code: - - $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true); - $twig = new Twig_Environment($loader); - - to something like this: - - $loader = new Twig_Loader_Filesystem('/path/to/templates'); - $twig = new Twig_Environment($loader, array( - 'cache' => '/path/to/compilation_cache', - 'auto_reload' => true, - )); - - * deprecated the "items" filter as it is not needed anymore - * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader - * optimized template loading speed - * removed output when an error occurs in a template and render() is used - * made major speed improvements for loops (up to 300% on even the smallest loops) - * added properties as part of the sandbox mode - * added public properties support (obj.item can now be the item property on the obj object) - * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} ) - * fixed bug when \ was used in HTML - -# 0.9.2 (2009-10-29) - - * made some speed optimizations - * changed the cache extension to .php - * added a js escaping strategy - * added support for short block tag - * changed the filter tag to allow chained filters - * made lexer more flexible as you can now change the default delimiters - * added set tag - * changed default directory permission when cache dir does not exist (more secure) - * added macro support - * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance - * made Twig_Autoloader::autoload() a static method - * avoid writing template file if an error occurs - * added $ escaping when outputting raw strings - * enhanced some error messages to ease debugging - * fixed empty cache files when the template contains an error - -# 0.9.1 (2009-10-14) - - * fixed a bug in PHP 5.2.6 - * fixed numbers with one than one decimal - * added support for method calls with arguments ({{ foo.bar('a', 43) }}) - * made small speed optimizations - * made minor tweaks to allow better extensibility and flexibility - -# 0.9.0 (2009-10-12) - - * Initial release diff --git a/upload/system/storage/vendor/twig/twig/LICENSE b/upload/system/storage/vendor/twig/twig/LICENSE index 94255bb2d4b..8711927f6d9 100644 --- a/upload/system/storage/vendor/twig/twig/LICENSE +++ b/upload/system/storage/vendor/twig/twig/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2020 by the Twig Team. +Copyright (c) 2009-2022 by the Twig Team. All rights reserved. diff --git a/upload/system/storage/vendor/twig/twig/README.rst b/upload/system/storage/vendor/twig/twig/README.rst index d896ff500a4..fbe7e9a9f83 100644 --- a/upload/system/storage/vendor/twig/twig/README.rst +++ b/upload/system/storage/vendor/twig/twig/README.rst @@ -1,8 +1,7 @@ Twig, the flexible, fast, and secure template language for PHP ============================================================== -Twig is a template language for PHP, released under the new BSD license (code -and documentation). +Twig is a template language for PHP. Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. diff --git a/upload/system/storage/vendor/twig/twig/composer.json b/upload/system/storage/vendor/twig/twig/composer.json index fb474d8bfa1..377d9ea414d 100644 --- a/upload/system/storage/vendor/twig/twig/composer.json +++ b/upload/system/storage/vendor/twig/twig/composer.json @@ -26,10 +26,11 @@ "require": { "php": ">=7.1.3", "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-ctype": "^1.8" + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php72": "^1.8" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4.9|^5.0.9", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", "psr/container": "^1.0" }, "autoload": { @@ -47,7 +48,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.13-dev" + "dev-master": "2.14-dev" } } } diff --git a/upload/system/storage/vendor/twig/twig/doc/advanced.rst b/upload/system/storage/vendor/twig/twig/doc/advanced.rst deleted file mode 100644 index 0bc7d22b195..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/advanced.rst +++ /dev/null @@ -1,918 +0,0 @@ -Extending Twig -============== - -Twig can be extended in many ways; you can add extra tags, filters, tests, -operators, global variables, and functions. You can even extend the parser -itself with node visitors. - -.. note:: - - The first section of this chapter describes how to extend Twig. If you want - to reuse your changes in different projects or if you want to share them - with others, you should then create an extension as described in the - following section. - -.. caution:: - - When extending Twig without creating an extension, Twig won't be able to - recompile your templates when the PHP code is updated. To see your changes - in real-time, either disable template caching or package your code into an - extension (see the next section of this chapter). - -Before extending Twig, you must understand the differences between all the -different possible extension points and when to use them. - -First, remember that Twig has two main language constructs: - -* ``{{ }}``: used to print the result of an expression evaluation; - -* ``{% %}``: used to execute statements. - -To understand why Twig exposes so many extension points, let's see how to -implement a *Lorem ipsum* generator (it needs to know the number of words to -generate). - -You can use a ``lipsum`` *tag*: - -.. code-block:: twig - - {% lipsum 40 %} - -That works, but using a tag for ``lipsum`` is not a good idea for at least -three main reasons: - -* ``lipsum`` is not a language construct; -* The tag outputs something; -* The tag is not flexible as you cannot use it in an expression: - - .. code-block:: twig - - {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }} - -In fact, you rarely need to create tags; and that's good news because tags are -the most complex extension point. - -Now, let's use a ``lipsum`` *filter*: - -.. code-block:: twig - - {{ 40|lipsum }} - -Again, it works. But a filter should transform the passed value to something -else. Here, we use the value to indicate the number of words to generate (so, -``40`` is an argument of the filter, not the value we want to transform). - -Next, let's use a ``lipsum`` *function*: - -.. code-block:: twig - - {{ lipsum(40) }} - -Here we go. For this specific example, the creation of a function is the -extension point to use. And you can use it anywhere an expression is accepted: - -.. code-block:: twig - - {{ 'some text' ~ lipsum(40) ~ 'some more text' }} - - {% set lipsum = lipsum(40) %} - -Lastly, you can also use a *global* object with a method able to generate lorem -ipsum text: - -.. code-block:: twig - - {{ text.lipsum(40) }} - -As a rule of thumb, use functions for frequently used features and global -objects for everything else. - -Keep in mind the following when you want to extend Twig: - -========== ========================== ========== ========================= -What? Implementation difficulty? How often? When? -========== ========================== ========== ========================= -*macro* simple frequent Content generation -*global* simple frequent Helper object -*function* simple frequent Content generation -*filter* simple frequent Value transformation -*tag* complex rare DSL language construct -*test* simple rare Boolean decision -*operator* simple rare Values transformation -========== ========================== ========== ========================= - -Globals -------- - -A global variable is like any other template variable, except that it's -available in all templates and macros:: - - $twig = new \Twig\Environment($loader); - $twig->addGlobal('text', new Text()); - -You can then use the ``text`` variable anywhere in a template: - -.. code-block:: twig - - {{ text.lipsum(40) }} - -Filters -------- - -Creating a filter consists of associating a name with a PHP callable:: - - // an anonymous function - $filter = new \Twig\TwigFilter('rot13', function ($string) { - return str_rot13($string); - }); - - // or a simple PHP function - $filter = new \Twig\TwigFilter('rot13', 'str_rot13'); - - // or a class static method - $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']); - $filter = new \Twig\TwigFilter('rot13', 'SomeClass::rot13Filter'); - - // or a class method - $filter = new \Twig\TwigFilter('rot13', [$this, 'rot13Filter']); - // the one below needs a runtime implementation (see below for more information) - $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']); - -The first argument passed to the ``\Twig\TwigFilter`` constructor is the name of the -filter you will use in templates and the second one is the PHP callable to -associate with it. - -Then, add the filter to the Twig environment:: - - $twig = new \Twig\Environment($loader); - $twig->addFilter($filter); - -And here is how to use it in a template: - -.. code-block:: twig - - {{ 'Twig'|rot13 }} - - {# will output Gjvt #} - -When called by Twig, the PHP callable receives the left side of the filter -(before the pipe ``|``) as the first argument and the extra arguments passed -to the filter (within parentheses ``()``) as extra arguments. - -For instance, the following code: - -.. code-block:: twig - - {{ 'TWIG'|lower }} - {{ now|date('d/m/Y') }} - -is compiled to something like the following:: - - - - -The ``\Twig\TwigFilter`` class takes an array of options as its last argument:: - - $filter = new \Twig\TwigFilter('rot13', 'str_rot13', $options); - -Environment-aware Filters -~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you want to access the current environment instance in your filter, set the -``needs_environment`` option to ``true``; Twig will pass the current -environment as the first argument to the filter call:: - - $filter = new \Twig\TwigFilter('rot13', function (\Twig\Environment $env, $string) { - // get the current charset for instance - $charset = $env->getCharset(); - - return str_rot13($string); - }, ['needs_environment' => true]); - -Context-aware Filters -~~~~~~~~~~~~~~~~~~~~~ - -If you want to access the current context in your filter, set the -``needs_context`` option to ``true``; Twig will pass the current context as -the first argument to the filter call (or the second one if -``needs_environment`` is also set to ``true``):: - - $filter = new \Twig\TwigFilter('rot13', function ($context, $string) { - // ... - }, ['needs_context' => true]); - - $filter = new \Twig\TwigFilter('rot13', function (\Twig\Environment $env, $context, $string) { - // ... - }, ['needs_context' => true, 'needs_environment' => true]); - -Automatic Escaping -~~~~~~~~~~~~~~~~~~ - -If automatic escaping is enabled, the output of the filter may be escaped -before printing. If your filter acts as an escaper (or explicitly outputs HTML -or JavaScript code), you will want the raw output to be printed. In such a -case, set the ``is_safe`` option:: - - $filter = new \Twig\TwigFilter('nl2br', 'nl2br', ['is_safe' => ['html']]); - -Some filters may need to work on input that is already escaped or safe, for -example when adding (safe) HTML tags to originally unsafe output. In such a -case, set the ``pre_escape`` option to escape the input data before it is run -through your filter:: - - $filter = new \Twig\TwigFilter('somefilter', 'somefilter', ['pre_escape' => 'html', 'is_safe' => ['html']]); - -Variadic Filters -~~~~~~~~~~~~~~~~ - -When a filter should accept an arbitrary number of arguments, set the -``is_variadic`` option to ``true``; Twig will pass the extra arguments as the -last argument to the filter call as an array:: - - $filter = new \Twig\TwigFilter('thumbnail', function ($file, array $options = []) { - // ... - }, ['is_variadic' => true]); - -Be warned that :ref:`named arguments ` passed to a variadic -filter cannot be checked for validity as they will automatically end up in the -option array. - -Dynamic Filters -~~~~~~~~~~~~~~~ - -A filter name containing the special ``*`` character is a dynamic filter and -the ``*`` part will match any string:: - - $filter = new \Twig\TwigFilter('*_path', function ($name, $arguments) { - // ... - }); - -The following filters are matched by the above defined dynamic filter: - -* ``product_path`` -* ``category_path`` - -A dynamic filter can define more than one dynamic parts:: - - $filter = new \Twig\TwigFilter('*_path_*', function ($name, $suffix, $arguments) { - // ... - }); - -The filter receives all dynamic part values before the normal filter arguments, -but after the environment and the context. For instance, a call to -``'foo'|a_path_b()`` will result in the following arguments to be passed to the -filter: ``('a', 'b', 'foo')``. - -Deprecated Filters -~~~~~~~~~~~~~~~~~~ - -You can mark a filter as being deprecated by setting the ``deprecated`` option -to ``true``. You can also give an alternative filter that replaces the -deprecated one when that makes sense:: - - $filter = new \Twig\TwigFilter('obsolete', function () { - // ... - }, ['deprecated' => true, 'alternative' => 'new_one']); - -When a filter is deprecated, Twig emits a deprecation notice when compiling a -template using it. See :ref:`deprecation-notices` for more information. - -Functions ---------- - -Functions are defined in the exact same way as filters, but you need to create -an instance of ``\Twig\TwigFunction``:: - - $twig = new \Twig\Environment($loader); - $function = new \Twig\TwigFunction('function_name', function () { - // ... - }); - $twig->addFunction($function); - -Functions support the same features as filters, except for the ``pre_escape`` -and ``preserves_safety`` options. - -Tests ------ - -Tests are defined in the exact same way as filters and functions, but you need -to create an instance of ``\Twig\TwigTest``:: - - $twig = new \Twig\Environment($loader); - $test = new \Twig\TwigTest('test_name', function () { - // ... - }); - $twig->addTest($test); - -Tests allow you to create custom application specific logic for evaluating -boolean conditions. As a simple example, let's create a Twig test that checks if -objects are 'red':: - - $twig = new \Twig\Environment($loader); - $test = new \Twig\TwigTest('red', function ($value) { - if (isset($value->color) && $value->color == 'red') { - return true; - } - if (isset($value->paint) && $value->paint == 'red') { - return true; - } - return false; - }); - $twig->addTest($test); - -Test functions must always return ``true``/``false``. - -When creating tests you can use the ``node_class`` option to provide custom test -compilation. This is useful if your test can be compiled into PHP primitives. -This is used by many of the tests built into Twig:: - - namespace App; - - use Twig\Environment; - use Twig\Node\Expression\TestExpression; - use Twig\TwigTest; - - $twig = new Environment($loader); - $test = new TwigTest( - 'odd', - null, - ['node_class' => OddTestExpression::class]); - $twig->addTest($test); - - class OddTestExpression extends TestExpression - { - public function compile(\Twig\Compiler $compiler) - { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' % 2 == 1') - ->raw(')') - ; - } - } - -The above example shows how you can create tests that use a node class. The node -class has access to one sub-node called ``node``. This sub-node contains the -value that is being tested. When the ``odd`` filter is used in code such as: - -.. code-block:: twig - - {% if my_value is odd %} - -The ``node`` sub-node will contain an expression of ``my_value``. Node-based -tests also have access to the ``arguments`` node. This node will contain the -various other arguments that have been provided to your test. - -.. versionadded:: 2.6 - Dynamic tests support was added in Twig 2.6. - -If you want to pass a variable number of positional or named arguments to the -test, set the ``is_variadic`` option to ``true``. Tests support dynamic -names (see dynamic filters for the syntax). - -Tags ----- - -One of the most exciting features of a template engine like Twig is the -possibility to define new **language constructs**. This is also the most complex -feature as you need to understand how Twig's internals work. - -Most of the time though, a tag is not needed: - -* If your tag generates some output, use a **function** instead. - -* If your tag modifies some content and returns it, use a **filter** instead. - - For instance, if you want to create a tag that converts a Markdown formatted - text to HTML, create a ``markdown`` filter instead: - - .. code-block:: twig - - {{ '**markdown** text'|markdown }} - - If you want use this filter on large amounts of text, wrap it with the - :doc:`apply ` tag: - - .. code-block:: twig - - {% apply markdown %} - Title - ===== - - Much better than creating a tag as you can **compose** filters. - {% endapply %} - - .. note:: - - The ``apply`` tag was introduced in Twig 2.9; use the ``filter`` tag with - previous versions. - -* If your tag does not output anything, but only exists because of a side - effect, create a **function** that returns nothing and call it via the - :doc:`filter ` tag. - - For instance, if you want to create a tag that logs text, create a ``log`` - function instead and call it via the :doc:`do ` tag: - - .. code-block:: twig - - {% do log('Log some things') %} - -If you still want to create a tag for a new language construct, great! - -Let's create a ``set`` tag that allows the definition of simple variables from -within a template. The tag can be used like follows: - -.. code-block:: twig - - {% set name = "value" %} - - {{ name }} - - {# should output value #} - -.. note:: - - The ``set`` tag is part of the Core extension and as such is always - available. The built-in version is slightly more powerful and supports - multiple assignments by default. - -Three steps are needed to define a new tag: - -* Defining a Token Parser class (responsible for parsing the template code); - -* Defining a Node class (responsible for converting the parsed code to PHP); - -* Registering the tag. - -Registering a new tag -~~~~~~~~~~~~~~~~~~~~~ - -Add a tag by calling the ``addTokenParser`` method on the ``\Twig\Environment`` -instance:: - - $twig = new \Twig\Environment($loader); - $twig->addTokenParser(new Project_Set_TokenParser()); - -Defining a Token Parser -~~~~~~~~~~~~~~~~~~~~~~~ - -Now, let's see the actual code of this class:: - - class Project_Set_TokenParser extends \Twig\TokenParser\AbstractTokenParser - { - public function parse(\Twig\Token $token) - { - $parser = $this->parser; - $stream = $parser->getStream(); - - $name = $stream->expect(\Twig\Token::NAME_TYPE)->getValue(); - $stream->expect(\Twig\Token::OPERATOR_TYPE, '='); - $value = $parser->getExpressionParser()->parseExpression(); - $stream->expect(\Twig\Token::BLOCK_END_TYPE); - - return new Project_Set_Node($name, $value, $token->getLine(), $this->getTag()); - } - - public function getTag() - { - return 'set'; - } - } - -The ``getTag()`` method must return the tag we want to parse, here ``set``. - -The ``parse()`` method is invoked whenever the parser encounters a ``set`` -tag. It should return a ``\Twig\Node\Node`` instance that represents the node (the -``Project_Set_Node`` calls creating is explained in the next section). - -The parsing process is simplified thanks to a bunch of methods you can call -from the token stream (``$this->parser->getStream()``): - -* ``getCurrent()``: Gets the current token in the stream. - -* ``next()``: Moves to the next token in the stream, *but returns the old one*. - -* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether - the current token is of a particular type or value (or both). The value may be an - array of several possible values. - -* ``expect($type[, $value[, $message]])``: If the current token isn't of the given - type/value a syntax error is thrown. Otherwise, if the type and value are correct, - the token is returned and the stream moves to the next token. - -* ``look()``: Looks at the next token without consuming it. - -Parsing expressions is done by calling the ``parseExpression()`` like we did for -the ``set`` tag. - -.. tip:: - - Reading the existing ``TokenParser`` classes is the best way to learn all - the nitty-gritty details of the parsing process. - -Defining a Node -~~~~~~~~~~~~~~~ - -The ``Project_Set_Node`` class itself is quite short:: - - class Project_Set_Node extends \Twig\Node\Node - { - public function __construct($name, \Twig\Node\Expression\AbstractExpression $value, $line, $tag = null) - { - parent::__construct(['value' => $value], ['name' => $name], $line, $tag); - } - - public function compile(\Twig\Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('$context[\''.$this->getAttribute('name').'\'] = ') - ->subcompile($this->getNode('value')) - ->raw(";\n") - ; - } - } - -The compiler implements a fluid interface and provides methods that helps the -developer generate beautiful and readable PHP code: - -* ``subcompile()``: Compiles a node. - -* ``raw()``: Writes the given string as is. - -* ``write()``: Writes the given string by adding indentation at the beginning - of each line. - -* ``string()``: Writes a quoted string. - -* ``repr()``: Writes a PHP representation of a given value (see - ``\Twig\Node\ForNode`` for a usage example). - -* ``addDebugInfo()``: Adds the line of the original template file related to - the current node as a comment. - -* ``indent()``: Indents the generated code (see ``\Twig\Node\BlockNode`` for a - usage example). - -* ``outdent()``: Outdents the generated code (see ``\Twig\Node\BlockNode`` for a - usage example). - -.. _creating_extensions: - -Creating an Extension ---------------------- - -The main motivation for writing an extension is to move often used code into a -reusable class like adding support for internationalization. An extension can -define tags, filters, tests, operators, functions, and node visitors. - -Most of the time, it is useful to create a single extension for your project, -to host all the specific tags and filters you want to add to Twig. - -.. tip:: - - When packaging your code into an extension, Twig is smart enough to - recompile your templates whenever you make a change to it (when - ``auto_reload`` is enabled). - -An extension is a class that implements the following interface:: - - interface \Twig\Extension\ExtensionInterface - { - /** - * Returns the token parser instances to add to the existing list. - * - * @return \Twig\TokenParser\TokenParserInterface[] - */ - public function getTokenParsers(); - - /** - * Returns the node visitor instances to add to the existing list. - * - * @return \Twig\NodeVisitor\NodeVisitorInterface[] - */ - public function getNodeVisitors(); - - /** - * Returns a list of filters to add to the existing list. - * - * @return \Twig\TwigFilter[] - */ - public function getFilters(); - - /** - * Returns a list of tests to add to the existing list. - * - * @return \Twig\TwigTest[] - */ - public function getTests(); - - /** - * Returns a list of functions to add to the existing list. - * - * @return \Twig\TwigFunction[] - */ - public function getFunctions(); - - /** - * Returns a list of operators to add to the existing list. - * - * @return array First array of unary operators, second array of binary operators - */ - public function getOperators(); - } - -To keep your extension class clean and lean, inherit from the built-in -``\Twig\Extension\AbstractExtension`` class instead of implementing the interface as it provides -empty implementations for all methods:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - } - -This extension does nothing for now. We will customize it in the next sections. - -You can save your extension anywhere on the filesystem, as all extensions must -be registered explicitly to be available in your templates. - -You can register an extension by using the ``addExtension()`` method on your -main ``Environment`` object:: - - $twig = new \Twig\Environment($loader); - $twig->addExtension(new Project_Twig_Extension()); - -.. tip:: - - The Twig core extensions are great examples of how extensions work. - -Globals -~~~~~~~ - -Global variables can be registered in an extension via the ``getGlobals()`` -method:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension implements \Twig\Extension\GlobalsInterface - { - public function getGlobals() - { - return [ - 'text' => new Text(), - ]; - } - - // ... - } - -Functions -~~~~~~~~~ - -Functions can be registered in an extension via the ``getFunctions()`` -method:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFunctions() - { - return [ - new \Twig\TwigFunction('lipsum', 'generate_lipsum'), - ]; - } - - // ... - } - -Filters -~~~~~~~ - -To add a filter to an extension, you need to override the ``getFilters()`` -method. This method must return an array of filters to add to the Twig -environment:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFilters() - { - return [ - new \Twig\TwigFilter('rot13', 'str_rot13'), - ]; - } - - // ... - } - -Tags -~~~~ - -Adding a tag in an extension can be done by overriding the -``getTokenParsers()`` method. This method must return an array of tags to add -to the Twig environment:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getTokenParsers() - { - return [new Project_Set_TokenParser()]; - } - - // ... - } - -In the above code, we have added a single new tag, defined by the -``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is -responsible for parsing the tag and compiling it to PHP. - -Operators -~~~~~~~~~ - -The ``getOperators()`` methods lets you add new operators. Here is how to add -the ``!``, ``||``, and ``&&`` operators:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getOperators() - { - return [ - [ - '!' => ['precedence' => 50, 'class' => \Twig\Node\Expression\Unary\NotUnary::class], - ], - [ - '||' => ['precedence' => 10, 'class' => \Twig\Node\Expression\Binary\OrBinary::class, 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT], - '&&' => ['precedence' => 15, 'class' => \Twig\Node\Expression\Binary\AndBinary::class, 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT], - ], - ]; - } - - // ... - } - -Tests -~~~~~ - -The ``getTests()`` method lets you add new test functions:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getTests() - { - return [ - new \Twig\TwigTest('even', 'twig_test_even'), - ]; - } - - // ... - } - -Definition vs Runtime -~~~~~~~~~~~~~~~~~~~~~ - -Twig filters, functions, and tests runtime implementations can be defined as -any valid PHP callable: - -* **functions/static methods**: Simple to implement and fast (used by all Twig - core extensions); but it is hard for the runtime to depend on external - objects; - -* **closures**: Simple to implement; - -* **object methods**: More flexible and required if your runtime code depends - on external objects. - -The simplest way to use methods is to define them on the extension itself:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - private $rot13Provider; - - public function __construct($rot13Provider) - { - $this->rot13Provider = $rot13Provider; - } - - public function getFunctions() - { - return [ - new \Twig\TwigFunction('rot13', [$this, 'rot13']), - ]; - } - - public function rot13($value) - { - return $this->rot13Provider->rot13($value); - } - } - -This is very convenient but not recommended as it makes template compilation -depend on runtime dependencies even if they are not needed (think for instance -as a dependency that connects to a database engine). - -You can decouple the extension definitions from their runtime implementations by -registering a ``\Twig\RuntimeLoader\RuntimeLoaderInterface`` instance on the -environment that knows how to instantiate such runtime classes (runtime classes -must be autoload-able):: - - class RuntimeLoader implements \Twig\RuntimeLoader\RuntimeLoaderInterface - { - public function load($class) - { - // implement the logic to create an instance of $class - // and inject its dependencies - // most of the time, it means using your dependency injection container - if ('Project_Twig_RuntimeExtension' === $class) { - return new $class(new Rot13Provider()); - } else { - // ... - } - } - } - - $twig->addRuntimeLoader(new RuntimeLoader()); - -.. note:: - - Twig comes with a PSR-11 compatible runtime loader - (``\Twig\RuntimeLoader\ContainerRuntimeLoader``). - -It is now possible to move the runtime logic to a new -``Project_Twig_RuntimeExtension`` class and use it directly in the extension:: - - class Project_Twig_RuntimeExtension - { - private $rot13Provider; - - public function __construct($rot13Provider) - { - $this->rot13Provider = $rot13Provider; - } - - public function rot13($value) - { - return $this->rot13Provider->rot13($value); - } - } - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFunctions() - { - return [ - new \Twig\TwigFunction('rot13', ['Project_Twig_RuntimeExtension', 'rot13']), - // or - new \Twig\TwigFunction('rot13', 'Project_Twig_RuntimeExtension::rot13'), - ]; - } - } - -Testing an Extension --------------------- - -Functional Tests -~~~~~~~~~~~~~~~~ - -You can create functional tests for extensions by creating the following file -structure in your test directory:: - - Fixtures/ - filters/ - foo.test - bar.test - functions/ - foo.test - bar.test - tags/ - foo.test - bar.test - IntegrationTest.php - -The ``IntegrationTest.php`` file should look like this:: - - class Project_Tests_IntegrationTest extends \Twig\Test\IntegrationTestCase - { - public function getExtensions() - { - return [ - new Project_Twig_Extension1(), - new Project_Twig_Extension2(), - ]; - } - - public function getFixturesDir() - { - return __DIR__.'/Fixtures/'; - } - } - -Fixtures examples can be found within the Twig repository -`tests/Twig/Fixtures`_ directory. - -Node Tests -~~~~~~~~~~ - -Testing the node visitors can be complex, so extend your test cases from -``\Twig\Test\NodeTestCase``. Examples can be found in the Twig repository -`tests/Twig/Node`_ directory. - -.. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php -.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/2.x/tests/Fixtures -.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/2.x/tests/Node diff --git a/upload/system/storage/vendor/twig/twig/doc/api.rst b/upload/system/storage/vendor/twig/twig/doc/api.rst deleted file mode 100644 index 56fcadd2669..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/api.rst +++ /dev/null @@ -1,588 +0,0 @@ -Twig for Developers -=================== - -This chapter describes the API to Twig and not the template language. It will -be most useful as reference to those implementing the template interface to -the application and not those who are creating Twig templates. - -Basics ------- - -Twig uses a central object called the **environment** (of class -``\Twig\Environment``). Instances of this class are used to store the -configuration and extensions, and are used to load templates. - -Most applications create one ``\Twig\Environment`` object on application -initialization and use that to load templates. In some cases, it might be useful -to have multiple environments side by side, with different configurations. - -The typical way to configure Twig to load templates for an application looks -roughly like this:: - - require_once '/path/to/vendor/autoload.php'; - - $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates'); - $twig = new \Twig\Environment($loader, [ - 'cache' => '/path/to/compilation_cache', - ]); - -This creates a template environment with a default configuration and a loader -that looks up templates in the ``/path/to/templates/`` directory. Different -loaders are available and you can also write your own if you want to load -templates from a database or other resources. - -.. note:: - - Notice that the second argument of the environment is an array of options. - The ``cache`` option is a compilation cache directory, where Twig caches - the compiled templates to avoid the parsing phase for sub-sequent - requests. It is very different from the cache you might want to add for - the evaluated templates. For such a need, you can use any available PHP - cache library. - -Rendering Templates -------------------- - -To load a template from a Twig environment, call the ``load()`` method which -returns a ``\Twig\TemplateWrapper`` instance:: - - $template = $twig->load('index.html'); - -To render the template with some variables, call the ``render()`` method:: - - echo $template->render(['the' => 'variables', 'go' => 'here']); - -.. note:: - - The ``display()`` method is a shortcut to output the rendered template. - -You can also load and render the template in one fell swoop:: - - echo $twig->render('index.html', ['the' => 'variables', 'go' => 'here']); - -If a template defines blocks, they can be rendered individually via the -``renderBlock()`` call:: - - echo $template->renderBlock('block_name', ['the' => 'variables', 'go' => 'here']); - -.. _environment_options: - -Environment Options -------------------- - -When creating a new ``\Twig\Environment`` instance, you can pass an array of -options as the constructor second argument:: - - $twig = new \Twig\Environment($loader, ['debug' => true]); - -The following options are available: - -* ``debug`` *boolean* - - When set to ``true``, the generated templates have a - ``__toString()`` method that you can use to display the generated nodes - (default to ``false``). - -* ``charset`` *string* (defaults to ``utf-8``) - - The charset used by the templates. - -* ``base_template_class`` *string* (defaults to ``\Twig\Template``) - - The base template class to use for generated - templates. - -* ``cache`` *string* or ``false`` - - An absolute path where to store the compiled templates, or - ``false`` to disable caching (which is the default). - -* ``auto_reload`` *boolean* - - When developing with Twig, it's useful to recompile the - template whenever the source code changes. If you don't provide a value for - the ``auto_reload`` option, it will be determined automatically based on the - ``debug`` value. - -* ``strict_variables`` *boolean* - - If set to ``false``, Twig will silently ignore invalid - variables (variables and or attributes/methods that do not exist) and - replace them with a ``null`` value. When set to ``true``, Twig throws an - exception instead (default to ``false``). - -* ``autoescape`` *string* - - Sets the default auto-escaping strategy (``name``, ``html``, ``js``, ``css``, - ``url``, ``html_attr``, or a PHP callback that takes the template "filename" - and returns the escaping strategy to use -- the callback cannot be a function - name to avoid collision with built-in escaping strategies); set it to - ``false`` to disable auto-escaping. The ``name`` escaping strategy determines - the escaping strategy to use for a template based on the template filename - extension (this strategy does not incur any overhead at runtime as - auto-escaping is done at compilation time.) - -* ``optimizations`` *integer* - - A flag that indicates which optimizations to apply - (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to - disable). - -Loaders -------- - -Loaders are responsible for loading templates from a resource such as the file -system. - -Compilation Cache -~~~~~~~~~~~~~~~~~ - -All template loaders can cache the compiled templates on the filesystem for -future reuse. It speeds up Twig a lot as templates are only compiled once. - -Built-in Loaders -~~~~~~~~~~~~~~~~ - -Here is a list of the built-in loaders: - -``\Twig\Loader\FilesystemLoader`` -................................. - -``\Twig\Loader\FilesystemLoader`` loads templates from the file system. This loader -can find templates in folders on the file system and is the preferred way to -load them:: - - $loader = new \Twig\Loader\FilesystemLoader($templateDir); - -It can also look for templates in an array of directories:: - - $loader = new \Twig\Loader\FilesystemLoader([$templateDir1, $templateDir2]); - -With such a configuration, Twig will first look for templates in -``$templateDir1`` and if they do not exist, it will fallback to look for them -in the ``$templateDir2``. - -You can add or prepend paths via the ``addPath()`` and ``prependPath()`` -methods:: - - $loader->addPath($templateDir3); - $loader->prependPath($templateDir4); - -The filesystem loader also supports namespaced templates. This allows to group -your templates under different namespaces which have their own template paths. - -When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods, -specify the namespace as the second argument (when not specified, these -methods act on the "main" namespace):: - - $loader->addPath($templateDir, 'admin'); - -Namespaced templates can be accessed via the special -``@namespace_name/template_path`` notation:: - - $twig->render('@admin/index.html', []); - -``\Twig\Loader\FilesystemLoader`` support absolute and relative paths. Using relative -paths is preferred as it makes the cache keys independent of the project root -directory (for instance, it allows warming the cache from a build server where -the directory might be different from the one used on production servers):: - - $loader = new \Twig\Loader\FilesystemLoader('templates', getcwd().'/..'); - -.. note:: - - When not passing the root path as a second argument, Twig uses ``getcwd()`` - for relative paths. - -``\Twig\Loader\ArrayLoader`` -............................ - -``\Twig\Loader\ArrayLoader`` loads a template from a PHP array. It is passed an -array of strings bound to template names:: - - $loader = new \Twig\Loader\ArrayLoader([ - 'index.html' => 'Hello {{ name }}!', - ]); - $twig = new \Twig\Environment($loader); - - echo $twig->render('index.html', ['name' => 'Fabien']); - -This loader is very useful for unit testing. It can also be used for small -projects where storing all templates in a single PHP file might make sense. - -.. tip:: - - When using the ``Array`` loader with a cache mechanism, you should know that - a new cache key is generated each time a template content "changes" (the - cache key being the source code of the template). If you don't want to see - your cache grows out of control, you need to take care of clearing the old - cache file by yourself. - -``\Twig\Loader\ChainLoader`` -............................ - -``\Twig\Loader\ChainLoader`` delegates the loading of templates to other loaders:: - - $loader1 = new \Twig\Loader\ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - ]); - $loader2 = new \Twig\Loader\ArrayLoader([ - 'index.html' => '{% extends "base.html" %}{% block content %}Hello {{ name }}{% endblock %}', - 'base.html' => 'Will never be loaded', - ]); - - $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]); - - $twig = new \Twig\Environment($loader); - -When looking for a template, Twig tries each loader in turn and returns as soon -as the template is found. When rendering the ``index.html`` template from the -above example, Twig will load it with ``$loader2`` but the ``base.html`` -template will be loaded from ``$loader1``. - -.. note:: - - You can also add loaders via the ``addLoader()`` method. - -Create your own Loader -~~~~~~~~~~~~~~~~~~~~~~ - -All loaders implement the ``\Twig\Loader\LoaderInterface``:: - - interface \Twig\Loader\LoaderInterface - { - /** - * Returns the source context for a given template logical name. - * - * @param string $name The template logical name - * - * @return \Twig\Source - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function getSourceContext($name); - - /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function getCacheKey($name); - - /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template - * - * @return bool true if the template is fresh, false otherwise - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function isFresh($name, $time); - - /** - * Check if we have the source code of a template, given its name. - * - * @param string $name The name of the template to check if we can load - * - * @return bool If the template source code is handled by this loader or not - */ - public function exists($name); - } - -The ``isFresh()`` method must return ``true`` if the current cached template -is still fresh, given the last modification time, or ``false`` otherwise. - -The ``getSourceContext()`` method must return an instance of ``\Twig\Source``. - -Using Extensions ----------------- - -Twig extensions are packages that add new features to Twig. Register an -extension via the ``addExtension()`` method:: - - $twig->addExtension(new \Twig\Extension\SandboxExtension()); - -Twig comes bundled with the following extensions: - -* *Twig\Extension\CoreExtension*: Defines all the core features of Twig. - -* *Twig\Extension\DebugExtension*: Defines the ``dump`` function to help debug - template variables. - -* *Twig\Extension\EscaperExtension*: Adds automatic output-escaping and the - possibility to escape/unescape blocks of code. - -* *Twig\Extension\SandboxExtension*: Adds a sandbox mode to the default Twig - environment, making it safe to evaluate untrusted code. - -* *Twig\Extension\ProfilerExtension*: Enabled the built-in Twig profiler. - -* *Twig\Extension\OptimizerExtension*: Optimizes the node tree before - compilation. - -* *Twig\Extension\StringLoaderExtension*: Defined the ``template_from_string`` - function to allow loading templates from string in a template. - -The Core, Escaper, and Optimizer extensions are registered by default. - -Built-in Extensions -------------------- - -This section describes the features added by the built-in extensions. - -.. tip:: - - Read the chapter about :doc:`extending Twig ` to learn how to - create your own extensions. - -Core Extension -~~~~~~~~~~~~~~ - -The ``core`` extension defines all the core features of Twig: - -* :doc:`Tags `; -* :doc:`Filters `; -* :doc:`Functions `; -* :doc:`Tests `. - -Escaper Extension -~~~~~~~~~~~~~~~~~ - -The ``escaper`` extension adds automatic output escaping to Twig. It defines a -tag, ``autoescape``, and a filter, ``raw``. - -When creating the escaper extension, you can switch on or off the global -output escaping strategy:: - - $escaper = new \Twig\Extension\EscaperExtension('html'); - $twig->addExtension($escaper); - -If set to ``html``, all variables in templates are escaped (using the ``html`` -escaping strategy), except those using the ``raw`` filter: - -.. code-block:: twig - - {{ article.to_html|raw }} - -You can also change the escaping mode locally by using the ``autoescape`` tag: - -.. code-block:: twig - - {% autoescape 'html' %} - {{ var }} - {{ var|raw }} {# var won't be escaped #} - {{ var|escape }} {# var won't be double-escaped #} - {% endautoescape %} - -.. warning:: - - The ``autoescape`` tag has no effect on included files. - -The escaping rules are implemented as follows: - -* Literals (integers, booleans, arrays, ...) used in the template directly as - variables or filter arguments are never automatically escaped: - - .. code-block:: twig - - {{ "Twig
" }} {# won't be escaped #} - - {% set text = "Twig
" %} - {{ text }} {# will be escaped #} - -* Expressions which the result is a literal or a variable marked safe - are never automatically escaped: - - .. code-block:: twig - - {{ foo ? "Twig
" : "
Twig" }} {# won't be escaped #} - - {% set text = "Twig
" %} - {{ true ? text : "
Twig" }} {# will be escaped #} - {{ false ? text : "
Twig" }} {# won't be escaped #} - - {% set text = "Twig
" %} - {{ foo ? text|raw : "
Twig" }} {# won't be escaped #} - -* Objects with a ``__toString`` method are converted to strings and - escaped. You can mark some classes and/or interfaces as being safe for some - strategies via ``EscaperExtension::addSafeClass()``: - - .. code-block:: twig - - // mark object of class Foo as safe for the HTML strategy - $escaper->addSafeClass('Foo', ['html']); - - // mark object of interface Foo as safe for the HTML strategy - $escaper->addSafeClass('FooInterface', ['html']); - - // mark object of class Foo as safe for the HTML and JS strategies - $escaper->addSafeClass('Foo', ['html', 'js']); - - // mark object of class Foo as safe for all strategies - $escaper->addSafeClass('Foo', ['all']); - -* Escaping is applied before printing, after any other filter is applied: - - .. code-block:: twig - - {{ var|upper }} {# is equivalent to {{ var|upper|escape }} #} - -* The `raw` filter should only be used at the end of the filter chain: - - .. code-block:: twig - - {{ var|raw|upper }} {# will be escaped #} - - {{ var|upper|raw }} {# won't be escaped #} - -* Automatic escaping is not applied if the last filter in the chain is marked - safe for the current context (e.g. ``html`` or ``js``). ``escape`` and - ``escape('html')`` are marked safe for HTML, ``escape('js')`` is marked - safe for JavaScript, ``raw`` is marked safe for everything. - - .. code-block:: twig - - {% autoescape 'js' %} - {{ var|escape('html') }} {# will be escaped for HTML and JavaScript #} - {{ var }} {# will be escaped for JavaScript #} - {{ var|escape('js') }} {# won't be double-escaped #} - {% endautoescape %} - -.. note:: - - Note that autoescaping has some limitations as escaping is applied on - expressions after evaluation. For instance, when working with - concatenation, ``{{ foo|raw ~ bar }}`` won't give the expected result as - escaping is applied on the result of the concatenation, not on the - individual variables (so, the ``raw`` filter won't have any effect here). - -Sandbox Extension -~~~~~~~~~~~~~~~~~ - -The ``sandbox`` extension can be used to evaluate untrusted code. Access to -unsafe attributes and methods is prohibited. The sandbox security is managed -by a policy instance. By default, Twig comes with one policy class: -``\Twig\Sandbox\SecurityPolicy``. This class allows you to white-list some -tags, filters, properties, and methods:: - - $tags = ['if']; - $filters = ['upper']; - $methods = [ - 'Article' => ['getTitle', 'getBody'], - ]; - $properties = [ - 'Article' => ['title', 'body'], - ]; - $functions = ['range']; - $policy = new \Twig\Sandbox\SecurityPolicy($tags, $filters, $methods, $properties, $functions); - -With the previous configuration, the security policy will only allow usage of -the ``if`` tag, and the ``upper`` filter. Moreover, the templates will only be -able to call the ``getTitle()`` and ``getBody()`` methods on ``Article`` -objects, and the ``title`` and ``body`` public properties. Everything else -won't be allowed and will generate a ``\Twig\Sandbox\SecurityError`` exception. - -The policy object is the first argument of the sandbox constructor:: - - $sandbox = new \Twig\Extension\SandboxExtension($policy); - $twig->addExtension($sandbox); - -By default, the sandbox mode is disabled and should be enabled when including -untrusted template code by using the ``sandbox`` tag: - -.. code-block:: twig - - {% sandbox %} - {% include 'user.html' %} - {% endsandbox %} - -You can sandbox all templates by passing ``true`` as the second argument of -the extension constructor:: - - $sandbox = new \Twig\Extension\SandboxExtension($policy, true); - -Profiler Extension -~~~~~~~~~~~~~~~~~~ - -The ``profiler`` extension enables a profiler for Twig templates; it should -only be used on your development machines as it adds some overhead:: - - $profile = new \Twig\Profiler\Profile(); - $twig->addExtension(new \Twig\Extension\ProfilerExtension($profile)); - - $dumper = new \Twig\Profiler\Dumper\TextDumper(); - echo $dumper->dump($profile); - -A profile contains information about time and memory consumption for template, -block, and macro executions. - -You can also dump the data in a `Blackfire.io `_ -compatible format:: - - $dumper = new \Twig\Profiler\Dumper\BlackfireDumper(); - file_put_contents('/path/to/profile.prof', $dumper->dump($profile)); - -Upload the profile to visualize it (create a `free account -`_ -first): - -.. code-block:: sh - - blackfire --slot=7 upload /path/to/profile.prof - -Optimizer Extension -~~~~~~~~~~~~~~~~~~~ - -The ``optimizer`` extension optimizes the node tree before compilation:: - - $twig->addExtension(new \Twig\Extension\OptimizerExtension()); - -By default, all optimizations are turned on. You can select the ones you want -to enable by passing them to the constructor:: - - $optimizer = new \Twig\Extension\OptimizerExtension(\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR); - - $twig->addExtension($optimizer); - -Twig supports the following optimizations: - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_ALL``, enables all optimizations - (this is the default value). - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_NONE``, disables all optimizations. - This reduces the compilation time, but it can increase the execution time - and the consumed memory. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR``, optimizes the ``for`` tag by - removing the ``loop`` variable creation whenever possible. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_RAW_FILTER``, removes the ``raw`` - filter whenever possible. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_VAR_ACCESS``, simplifies the creation - and access of variables in the compiled templates whenever possible. - -Exceptions ----------- - -Twig can throw exceptions: - -* ``\Twig\Error\Error``: The base exception for all errors. - -* ``\Twig\Error\SyntaxError``: Thrown to tell the user that there is a problem with - the template syntax. - -* ``\Twig\Error\RuntimeError``: Thrown when an error occurs at runtime (when a filter - does not exist for instance). - -* ``\Twig\Error\LoaderError``: Thrown when an error occurs during template loading. - -* ``\Twig\Sandbox\SecurityError``: Thrown when an unallowed tag, filter, or - method is called in a sandboxed template. diff --git a/upload/system/storage/vendor/twig/twig/doc/coding_standards.rst b/upload/system/storage/vendor/twig/twig/doc/coding_standards.rst deleted file mode 100644 index 721b0f13aaf..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/coding_standards.rst +++ /dev/null @@ -1,101 +0,0 @@ -Coding Standards -================ - -When writing Twig templates, we recommend you to follow these official coding -standards: - -* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``, - and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``): - - .. code-block:: twig - - {{ foo }} - {# comment #} - {% if foo %}{% endif %} - - When using the whitespace control character, do not put any spaces between - it and the delimiter: - - .. code-block:: twig - - {{- foo -}} - {#- comment -#} - {%- if foo -%}{%- endif -%} - -* Put one (and only one) space before and after the following operators: - comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math - operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic - operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary - operator (``?:``): - - .. code-block:: twig - - {{ 1 + 2 }} - {{ foo ~ bar }} - {{ true ? true : false }} - -* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in - arrays and hashes: - - .. code-block:: twig - - {{ [1, 2, 3] }} - {{ {'foo': 'bar'} }} - -* Do not put any spaces after an opening parenthesis and before a closing - parenthesis in expressions: - - .. code-block:: twig - - {{ 1 + (2 * 3) }} - -* Do not put any spaces before and after string delimiters: - - .. code-block:: twig - - {{ 'foo' }} - {{ "foo" }} - -* Do not put any spaces before and after the following operators: ``|``, - ``.``, ``..``, ``[]``: - - .. code-block:: twig - - {{ foo|upper|lower }} - {{ user.name }} - {{ user[name] }} - {% for i in 1..12 %}{% endfor %} - -* Do not put any spaces before and after the parenthesis used for filter and - function calls: - - .. code-block:: twig - - {{ foo|default('foo') }} - {{ range(1..10) }} - -* Do not put any spaces before and after the opening and the closing of arrays - and hashes: - - .. code-block:: twig - - {{ [1, 2, 3] }} - {{ {'foo': 'bar'} }} - -* Use lower cased and underscored variable names: - - .. code-block:: twig - - {% set foo = 'foo' %} - {% set foo_bar = 'foo' %} - -* Indent your code inside tags (use the same indentation as the one used for - the target language of the rendered template): - - .. code-block:: twig - - {% block foo %} - {% if true %} - true - {% endif %} - {% endblock %} diff --git a/upload/system/storage/vendor/twig/twig/doc/deprecated.rst b/upload/system/storage/vendor/twig/twig/doc/deprecated.rst deleted file mode 100644 index 4512703711f..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/deprecated.rst +++ /dev/null @@ -1,115 +0,0 @@ -Deprecated Features -=================== - -This document lists deprecated features in Twig 2.x. Deprecated features are -kept for backward compatibility and removed in the next major release (a -feature that was deprecated in Twig 2.x is removed in Twig 3.0). - -PSR-0 ------ - -* PSR-0 classes are deprecated in favor of namespaced ones since Twig 2.7. - -Inheritance ------------ - -* Defining a "block" definition in a non-capturing block in a child template is - deprecated since Twig 2.5.0. In Twig 3.0, it will throw a - ``Twig\Error\SyntaxError`` exception. It does not work anyway, so most - projects won't need to do anything to upgrade. - -Errors ------- - -* Passing a string as the ``$source`` argument on ``\Twig\Error\Error`` / - ``Twig\Error\Error`` constructor is deprecated since Twig 2.6.1. Pass an - instance of ``Twig\Source`` instead. - -Tags ----- - -* The ``spaceless`` tag is deprecated in Twig 2.7. Use the ``spaceless`` filter - instead or ``{% apply spaceless %}`` (the ``Twig\Node\SpacelessNode`` and - ``Twig\TokenParser\SpacelessTokenParser`` classes are also deprecated). - -* Using the ``spaceless`` tag at the root level of a child template is - deprecated in Twig 2.5.0. This does not work as one would expect it to work - anyway. In Twig 3.0, it will throw a ``Twig\Error\SyntaxError`` exception. - -* The ``filter`` tag is deprecated in Twig 2.9. Use the ``apply`` tag instead - (the ``Twig\TokenParser\FilterTokenParser`` classes is also deprecated). - -* Adding an ``if`` condition on a ``for`` tag is deprecated in Twig 2.10. Use a - ``filter`` filter or an "if" condition inside the "for" body instead (if your condition - depends on a variable updated inside the loop). - -Final Classes -------------- - -The following classes are marked as ``@final`` in Twig 2 and will be final in -3.0: - -* ``Twig\Node\ModuleNode`` -* ``Twig\TwigFilter`` -* ``Twig\TwigFunction`` -* ``Twig\TwigTest`` -* ``Twig\Profiler\Profile`` - -Parser ------- - -* As of Twig 2.7, the ``\Twig\Parser::isReservedMacroName()`` / ``Twig\Parser`` - function is deprecated and will be removed in Twig 3.0. It always returns - ``false`` anyway as Twig 2 does not have any reserved macro names. - -Environment ------------ - -* As of Twig 2.7, the ``base_template_class`` option on ``Twig\Environment`` is - deprecated and will be removed in Twig 3.0. - -* As of Twig 2.7, the ``Twig\Environment::getBaseTemplateClass()`` and - ``Twig\Environment::setBaseTemplateClass()`` methods are deprecated and will - be removed in Twig 3.0. - -* As of Twig 2.7, the ``Twig\Environment::getTemplateClass()`` is marked as - being internal and should not be used. - -* As of Twig 2.7, passing a ``Twig\Template`` instance to the - ``Twig\Environment::load()`` and ``Twig\Environment::resolveTemplate()`` is - deprecated. - -* Depending on the input, ``Twig\Environment::resolveTemplate()`` can return - a ``Twig\Template`` or a ``Twig\TemplateWrapper`` instance. In Twig 3.0, this - method will **always** return a ``Twig\TemplateWrapper`` instance. You should - only rely on the methods of this class if you want to be forward-compatible. - -Interfaces ----------- - -* As of Twig 2.7, the empty ``Twig\Loader\ExistsLoaderInterface`` interface is - deprecated and will be removed in Twig 3.0. - -* As of Twig 2.7, the ``Twig\Extension\InitRuntimeInterface`` interface is - deprecated and will be removed in Twig 3.0. - -Extensions ----------- - -* As of Twig 2.11, the ``Twig\Extension\CoreExtension::setEscaper()`` and - ``Twig\Extension\CoreExtension::getEscapers()`` are deprecated. Use the same - methods on ``Twig\Extension\EscaperExtension`` instead. - -Miscellaneous -------------- - -* As of Twig 2.7, the ``Twig_SimpleFilter``, ``Twig_SimpleFunction``, and - ``Twig_SimpleTest`` empty classes are deprecated and will be removed in Twig - 3.0. Use ``Twig\TwigFilter``, ``Twig\TwigFunction``, and ``Twig\TwigTest`` - respectively. - -* As of Twig 2.8.2, all usage of - ``Twig\Loader\FilesystemLoader::findTemplate()`` check for a ``null`` return - value (same meaning as returning ``false``). If you are overidding - ``Twig\Loader\FilesystemLoader::findTemplate()``, you must return ``null`` instead of ``false`` - to be compatible with Twig 3.0. diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/abs.rst b/upload/system/storage/vendor/twig/twig/doc/filters/abs.rst deleted file mode 100644 index 77d5cf05495..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/abs.rst +++ /dev/null @@ -1,18 +0,0 @@ -``abs`` -======= - -The ``abs`` filter returns the absolute value. - -.. code-block:: twig - - {# number = -5 #} - - {{ number|abs }} - - {# outputs 5 #} - -.. note:: - - Internally, Twig uses the PHP `abs`_ function. - -.. _`abs`: https://secure.php.net/abs diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/batch.rst b/upload/system/storage/vendor/twig/twig/doc/filters/batch.rst deleted file mode 100644 index ec5cd836ca4..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/batch.rst +++ /dev/null @@ -1,44 +0,0 @@ -``batch`` -========= - -The ``batch`` filter "batches" items by returning a list of lists with the -given number of items. A second parameter can be provided and used to fill in -missing items: - -.. code-block:: twig - - {% set items = ['a', 'b', 'c', 'd'] %} - - - {% for row in items|batch(3, 'No item') %} - - {% for column in row %} - - {% endfor %} - - {% endfor %} -
{{ column }}
- -The above example will be rendered as: - -.. code-block:: twig - - - - - - - - - - - - -
abc
dNo itemNo item
- -Arguments ---------- - -* ``size``: The size of the batch; fractional numbers will be rounded up -* ``fill``: Used to fill in missing items -* ``preserve_keys``: Whether to preserve keys or not diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/capitalize.rst b/upload/system/storage/vendor/twig/twig/doc/filters/capitalize.rst deleted file mode 100644 index 2353658bf15..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/capitalize.rst +++ /dev/null @@ -1,11 +0,0 @@ -``capitalize`` -============== - -The ``capitalize`` filter capitalizes a value. The first character will be -uppercase, all others lowercase: - -.. code-block:: twig - - {{ 'my first car'|capitalize }} - - {# outputs 'My first car' #} diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/column.rst b/upload/system/storage/vendor/twig/twig/doc/filters/column.rst deleted file mode 100644 index 97a3037dce2..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/column.rst +++ /dev/null @@ -1,27 +0,0 @@ -``column`` -========== - -.. versionadded:: 2.8 - The ``column`` filter was added in Twig 2.8. - -The ``column`` filter returns the values from a single column in the input -array. - -.. code-block:: twig - - {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %} - - {% set fruits = items|column('fruit') %} - - {# fruits now contains ['apple', 'orange'] #} - -.. note:: - - Internally, Twig uses the PHP `array_column`_ function. - -Arguments ---------- - -* ``name``: The column name to extract - -.. _`array_column`: https://secure.php.net/array_column diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/convert_encoding.rst b/upload/system/storage/vendor/twig/twig/doc/filters/convert_encoding.rst deleted file mode 100644 index d977c752c8e..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/convert_encoding.rst +++ /dev/null @@ -1,22 +0,0 @@ -``convert_encoding`` -==================== - -The ``convert_encoding`` filter converts a string from one encoding to -another. The first argument is the expected output charset and the second one -is the input charset: - -.. code-block:: twig - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - -.. note:: - - This filter relies on the `iconv`_ extension. - -Arguments ---------- - -* ``to``: The output charset -* ``from``: The input charset - -.. _`iconv`: https://secure.php.net/iconv diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/country_name.rst b/upload/system/storage/vendor/twig/twig/doc/filters/country_name.rst deleted file mode 100644 index 4dd72624e71..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/country_name.rst +++ /dev/null @@ -1,42 +0,0 @@ -``country_name`` -================ - -.. versionadded:: 2.12 - The ``country_name`` filter was added in Twig 2.12. - -The ``country_name`` filter returns the country name given its ISO-3166 -two-letter code: - -.. code-block:: twig - - {# France #} - {{ 'FR'|country_name }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# États-Unis #} - {{ 'US'|country_name('fr') }} - -.. note:: - - The ``country_name`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/currency_name.rst b/upload/system/storage/vendor/twig/twig/doc/filters/currency_name.rst deleted file mode 100644 index a5ee4691445..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/currency_name.rst +++ /dev/null @@ -1,45 +0,0 @@ -``currency_name`` -================= - -.. versionadded:: 2.12 - The ``currency_name`` filter was added in Twig 2.12. - -The ``currency_name`` filter returns the currency name given its three-letter -code: - -.. code-block:: twig - - {# Euro #} - {{ 'EUR'|currency_name }} - - {# Japanese Yen #} - {{ 'JPY'|currency_name }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# yen japonais #} - {{ 'JPY'|currency_name('fr_FR') }} - -.. note:: - - The ``currency_name`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/currency_symbol.rst b/upload/system/storage/vendor/twig/twig/doc/filters/currency_symbol.rst deleted file mode 100644 index a0f13263877..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/currency_symbol.rst +++ /dev/null @@ -1,45 +0,0 @@ -``currency_symbol`` -=================== - -.. versionadded:: 2.12 - The ``currency_symbol`` filter was added in Twig 2.12. - -The ``currency_symbol`` filter returns the currency symbol given its three-letter -code: - -.. code-block:: twig - - {# € #} - {{ 'EUR'|currency_symbol }} - - {# ¥ #} - {{ 'JPY'|currency_symbol }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# ¥ #} - {{ 'JPY'|currency_symbol('fr') }} - -.. note:: - - The ``currency_symbol`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/data_uri.rst b/upload/system/storage/vendor/twig/twig/doc/filters/data_uri.rst deleted file mode 100644 index 8ab4d589e2e..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/data_uri.rst +++ /dev/null @@ -1,51 +0,0 @@ -``data_uri`` -============ - -.. versionadded:: 2.12 - The ``data_uri`` filter was added in Twig 2.12. - -The ``data_uri`` filter generates a URL using the data scheme as defined in RFC -2397: - -.. code-block:: twig - - {{ image_data|data_uri }} - - {{ source('path_to_image')|data_uri }} - - {# force the mime type, disable the guessing of the mime type #} - {{ image_data|data_uri(mime="image/svg") }} - - {# also works with plain text #} - {{ 'foobar'|data_uri(mime="text/html") }} - - {# add some extra parameters #} - {{ 'foobar'|data_uri(mime="text/html", parameters={charset: "ascii"}) }} - -.. note:: - - The ``data_uri`` filter is part of the ``HtmlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/html-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Html\HtmlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new HtmlExtension()); - -.. note:: - - The filter does not perform any length validation on purpose (limits depends - on the usage context), validation should be done before calling this filter. - -Arguments ---------- - -* ``mime``: The mime type -* ``parameters``: An array of parameters diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/date.rst b/upload/system/storage/vendor/twig/twig/doc/filters/date.rst deleted file mode 100644 index 95a1cbff209..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/date.rst +++ /dev/null @@ -1,82 +0,0 @@ -``date`` -======== - -The ``date`` filter formats a date to a given format: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y") }} - -The format specifier is the same as supported by `date`_, -except when the filtered data is of type `DateInterval`_, when the format must conform to -`DateInterval::format`_ instead. - -The ``date`` filter accepts strings (it must be in a format supported by the -`strtotime`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For -instance, to display the current date, filter the word "now": - -.. code-block:: twig - - {{ "now"|date("m/d/Y") }} - -To escape words and characters in the date format use ``\\`` in front of each -character: - -.. code-block:: twig - - {{ post.published_at|date("F jS \\a\\t g:ia") }} - -If the value passed to the ``date`` filter is ``null``, it will return the -current date by default. If an empty string is desired instead of the current -date, use a ternary operator: - -.. code-block:: twig - - {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }} - -If no format is provided, Twig will use the default one: ``F j, Y H:i``. This -default can be changed by calling the ``setDateFormat()`` method on the -``core`` extension instance. The first argument is the default format for -dates and the second one is the default format for date intervals: - -.. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setDateFormat('d/m/Y', '%d days'); - -Timezone --------- - -By default, the date is displayed by applying the default timezone (the one -specified in php.ini or declared in Twig -- see below), but you can override -it by explicitly specifying a timezone: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y", "Europe/Paris") }} - -If the date is already a DateTime object, and if you want to keep its current -timezone, pass ``false`` as the timezone value: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y", false) }} - -The default timezone can also be set globally by calling ``setTimezone()``: - -.. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris'); - -Arguments ---------- - -* ``format``: The date format -* ``timezone``: The date timezone - -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime -.. _`DateInterval`: https://secure.php.net/DateInterval -.. _`date`: https://secure.php.net/date -.. _`DateInterval::format`: https://secure.php.net/DateInterval.format diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/date_modify.rst b/upload/system/storage/vendor/twig/twig/doc/filters/date_modify.rst deleted file mode 100644 index cc5d6df160d..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/date_modify.rst +++ /dev/null @@ -1,20 +0,0 @@ -``date_modify`` -=============== - -The ``date_modify`` filter modifies a date with a given modifier string: - -.. code-block:: twig - - {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }} - -The ``date_modify`` filter accepts strings (it must be in a format supported -by the `strtotime`_ function) or `DateTime`_ instances. You can combine -it with the :doc:`date` filter for formatting. - -Arguments ---------- - -* ``modifier``: The modifier - -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/default.rst b/upload/system/storage/vendor/twig/twig/doc/filters/default.rst deleted file mode 100644 index e616e590caa..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/default.rst +++ /dev/null @@ -1,42 +0,0 @@ -``default`` -=========== - -The ``default`` filter returns the passed default value if the value is -undefined or empty, otherwise the value of the variable: - -.. code-block:: twig - - {{ var|default('var is not defined') }} - - {{ var.foo|default('foo item on var is not defined') }} - - {{ var['foo']|default('foo item on var is not defined') }} - - {{ ''|default('passed var is empty') }} - -When using the ``default`` filter on an expression that uses variables in some -method calls, be sure to use the ``default`` filter whenever a variable can be -undefined: - -.. code-block:: twig - - {{ var.method(foo|default('foo'))|default('foo') }} - -Using the ``default`` filter on a boolean variable might trigger unexpected behaviour, as -``false`` is treated as an empty value. Consider using ``??`` instead: - -.. code-block:: twig - - {% set foo = false %} - {{ foo|default(true) }} {# true #} - {{ foo ?? true }} {# false #} - -.. note:: - - Read the documentation for the :doc:`defined<../tests/defined>` and - :doc:`empty<../tests/empty>` tests to learn more about their semantics. - -Arguments ---------- - -* ``default``: The default value diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/escape.rst b/upload/system/storage/vendor/twig/twig/doc/filters/escape.rst deleted file mode 100644 index c7c72676124..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/escape.rst +++ /dev/null @@ -1,119 +0,0 @@ -``escape`` -========== - -The ``escape`` filter escapes a string using strategies that depend on the -context. - -By default, it uses the HTML escaping strategy: - -.. code-block:: html+twig - -

- {{ user.username|escape }} -

- -For convenience, the ``e`` filter is defined as an alias: - -.. code-block:: html+twig - -

- {{ user.username|e }} -

- -The ``escape`` filter can also be used in other contexts than HTML thanks to -an optional argument which defines the escaping strategy to use: - -.. code-block:: twig - - {{ user.username|e }} - {# is equivalent to #} - {{ user.username|e('html') }} - -And here is how to escape variables included in JavaScript code: - -.. code-block:: twig - - {{ user.username|escape('js') }} - {{ user.username|e('js') }} - -The ``escape`` filter supports the following escaping strategies for HTML -documents: - -* ``html``: escapes a string for the **HTML body** context. - -* ``js``: escapes a string for the **JavaScript** context. - -* ``css``: escapes a string for the **CSS** context. CSS escaping can be - applied to any string being inserted into CSS and escapes everything except - alphanumerics. - -* ``url``: escapes a string for the **URI or parameter** contexts. This should - not be used to escape an entire URI; only a subcomponent being inserted. - -* ``html_attr``: escapes a string for the **HTML attribute** context. - -Note that doing contextual escaping in HTML documents is hard and choosing the -right escaping strategy depends on a lot of factors. Please, read related -documentation like `the OWASP prevention cheat sheet -`_ -to learn more about this topic. - -.. note:: - - Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function - for the HTML escaping strategy. - -.. caution:: - - When using automatic escaping, Twig tries to not double-escape a variable - when the automatic escaping strategy is the same as the one applied by the - escape filter; but that does not work when using a variable as the - escaping strategy: - - .. code-block:: twig - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape('html') }} {# won't be double-escaped #} - {{ var|escape(strategy) }} {# will be double-escaped #} - {% endautoescape %} - - When using a variable as the escaping strategy, you should disable - automatic escaping: - - .. code-block:: twig - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape(strategy)|raw }} {# won't be double-escaped #} - {% endautoescape %} - -Custom Escapers ---------------- - -You can define custom escapers by calling the ``setEscaper()`` method on the -escaper extension instance. The first argument is the escaper name (to be -used in the ``escape`` call) and the second one must be a valid PHP callable: - -.. code-block:: php - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\EscaperExtension::class)->setEscaper('csv', 'csv_escaper'); - -When called by Twig, the callable receives the Twig environment instance, the -string to escape, and the charset. - -.. note:: - - Built-in escapers cannot be overridden mainly because they should be - considered as the final implementation and also for better performance. - -Arguments ---------- - -* ``strategy``: The escaping strategy -* ``charset``: The string charset - -.. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/filter.rst b/upload/system/storage/vendor/twig/twig/doc/filters/filter.rst deleted file mode 100644 index e9f968290f0..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/filter.rst +++ /dev/null @@ -1,58 +0,0 @@ -``filter`` -========== - -.. versionadded:: 1.41 - The ``filter`` filter was added in Twig 1.41 and 2.10. - -The ``filter`` filter filters elements of a sequence or a mapping using an arrow -function. The arrow function receives the value of the sequence or mapping: - -.. code-block:: twig - - {% set sizes = [34, 36, 38, 40, 42] %} - - {{ sizes|filter(v => v > 38)|join(', ') }} - {# output 40, 42 #} - -Combined with the ``for`` tag, it allows to filter the items to iterate over: - -.. code-block:: twig - - {% for v in sizes|filter(v => v > 38) -%} - {{ v }} - {% endfor %} - {# output 40 42 #} - -It also works with mappings: - -.. code-block:: twig - - {% set sizes = { - xs: 34, - s: 36, - m: 38, - l: 40, - xl: 42, - } %} - - {% for k, v in sizes|filter(v => v > 38) -%} - {{ k }} = {{ v }} - {% endfor %} - {# output l = 40 xl = 42 #} - -The arrow function also receives the key as a second argument: - -.. code-block:: twig - - {% for k, v in sizes|filter((v, k) => v > 38 and k != "xl") -%} - {{ k }} = {{ v }} - {% endfor %} - {# output l = 40 #} - -Note that the arrow function has access to the current context. - -Arguments ---------- - -* ``array``: The sequence or mapping -* ``arrow``: The arrow function diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/first.rst b/upload/system/storage/vendor/twig/twig/doc/filters/first.rst deleted file mode 100644 index 8d7081a53f1..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/first.rst +++ /dev/null @@ -1,22 +0,0 @@ -``first`` -========= - -The ``first`` filter returns the first "element" of a sequence, a mapping, or -a string: - -.. code-block:: twig - - {{ [1, 2, 3, 4]|first }} - {# outputs 1 #} - - {{ { a: 1, b: 2, c: 3, d: 4 }|first }} - {# outputs 1 #} - - {{ '1234'|first }} - {# outputs 1 #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/format.rst b/upload/system/storage/vendor/twig/twig/doc/filters/format.rst deleted file mode 100644 index c0c96ee3f54..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/format.rst +++ /dev/null @@ -1,16 +0,0 @@ -``format`` -========== - -The ``format`` filter formats a given string by replacing the placeholders -(placeholders follows the `sprintf`_ notation): - -.. code-block:: twig - - {{ "I like %s and %s."|format(foo, "bar") }} - - {# outputs I like foo and bar - if the foo parameter equals to the foo string. #} - -.. _`sprintf`: https://secure.php.net/sprintf - -.. seealso:: :doc:`replace` diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/format_currency.rst b/upload/system/storage/vendor/twig/twig/doc/filters/format_currency.rst deleted file mode 100644 index a76d9d9d688..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/format_currency.rst +++ /dev/null @@ -1,75 +0,0 @@ -``format_currency`` -=================== - -.. versionadded:: 2.12 - The ``format_currency`` filter was added in Twig 2.12. - -The ``format_currency`` filter formats a number as a currency: - -.. code-block:: twig - - {# €1,000,000.00 #} - {{ '1000000'|format_currency('EUR') }} - -You can pass attributes to tweak the output: - -.. code-block:: twig - - {# €12.34 #} - {{ '12.345'|format_currency('EUR', {rounding_mode: 'floor'}) }} - - {# €1,000,000.0000 #} - {{ '1000000'|format_currency('EUR', {fraction_digit: 4}) }} - -The list of supported options: - -* ``grouping_used``; -* ``decimal_always_shown``; -* ``max_integer_digit``; -* ``min_integer_digit``; -* ``integer_digit``; -* ``max_fraction_digit``; -* ``min_fraction_digit``; -* ``fraction_digit``; -* ``multiplier``; -* ``grouping_size``; -* ``rounding_mode``; -* ``rounding_increment``; -* ``format_width``; -* ``padding_position``; -* ``secondary_grouping_size``; -* ``significant_digits_used``; -* ``min_significant_digits_used``; -* ``max_significant_digits_used``; -* ``lenient_parse``. - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# 1.000.000,00 € #} - {{ '1000000'|format_currency('EUR', locale='de') }} - -.. note:: - - The ``format_currency`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``currency``: The currency -* ``attrs``: A map of attributes -* ``locale``: The locale diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/format_date.rst b/upload/system/storage/vendor/twig/twig/doc/filters/format_date.rst deleted file mode 100644 index 786a5a5b026..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/format_date.rst +++ /dev/null @@ -1,32 +0,0 @@ -``format_date`` -=============== - -.. versionadded:: 2.12 - The ``format_date`` filter was added in Twig 2.12. - -The ``format_date`` filter formats a date. It behaves in the exact same way as -the ``format_datetime`` filter, but without the time. - -.. note:: - - The ``format_date`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``dateFormat``: The date format -* ``pattern``: A date time pattern diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/format_datetime.rst b/upload/system/storage/vendor/twig/twig/doc/filters/format_datetime.rst deleted file mode 100644 index e0b62c7647a..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/format_datetime.rst +++ /dev/null @@ -1,68 +0,0 @@ -``format_datetime`` -=================== - -.. versionadded:: 2.12 - The ``format_datetime`` filter was added in Twig 2.12. - -The ``format_datetime`` filter formats a date time: - - public function formatDateTime(Environment $env, $date, ?string $dateFormat = 'medium', ?string $timeFormat = 'medium', string $pattern = '', $timezone = null, string $calendar = 'gregorian', string $locale = null): string - -.. code-block:: twig - - {# Aug 7, 2019, 11:39:12 PM #} - {{ '2019-08-07 23:39:12'|format_datetime() }} - -You can tweak the output for the date part and the time part: - -.. code-block:: twig - - {# 23:39 #} - {{ '2019-08-07 23:39:12'|format_datetime('none', 'short', locale='fr') }} - - {# 07/08/2019 #} - {{ '2019-08-07 23:39:12'|format_datetime('short', 'none', locale='fr') }} - - {# mercredi 7 août 2019 23:39:12 UTC #} - {{ '2019-08-07 23:39:12'|format_datetime('full', 'full', locale='fr') }} - -Supported values are: ``none``, ``short``, ``medium``, ``long``, and ``full``. - -For greater flexiblity, you can even define your own pattern: - -.. code-block:: twig - - {# 11 oclock PM, GMT #} - {{ '2019-08-07 23:39:12'|format_datetime(pattern="hh 'oclock' a, zzzz") }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# 7 août 2019 23:39:12 #} - {{ '2019-08-07 23:39:12'|format_datetime(locale='fr') }} - -.. note:: - - The ``format_datetime`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``dateFormat``: The date format -* ``timeFormat``: The time format -* ``pattern``: A date time pattern diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/format_number.rst b/upload/system/storage/vendor/twig/twig/doc/filters/format_number.rst deleted file mode 100644 index 06e7d7791e3..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/format_number.rst +++ /dev/null @@ -1,115 +0,0 @@ -``format_number`` -================= - -.. versionadded:: 2.12 - The ``format_number`` filter was added in Twig 2.12. - -The ``format_number`` filter formats a number: - -.. code-block:: twig - - {{ '12.345'|format_number }} - -You can pass attributes to tweak the output: - -.. code-block:: twig - - {# 12.34 #} - {{ '12.345'|format_number({rounding_mode: 'floor'}) }} - - {# 1000000.0000 #} - {{ '1000000'|format_number({fraction_digit: 4}) }} - -The list of supported options: - -* ``grouping_used``; -* ``decimal_always_shown``; -* ``max_integer_digit``; -* ``min_integer_digit``; -* ``integer_digit``; -* ``max_fraction_digit``; -* ``min_fraction_digit``; -* ``fraction_digit``; -* ``multiplier``; -* ``grouping_size``; -* ``rounding_mode``; -* ``rounding_increment``; -* ``format_width``; -* ``padding_position``; -* ``secondary_grouping_size``; -* ``significant_digits_used``; -* ``min_significant_digits_used``; -* ``max_significant_digits_used``; -* ``lenient_parse``. - -Besides plain numbers, the filter can also format numbers in various styles: - -.. code-block:: twig - - {# 1,234% #} - {{ '12.345'|format_number(style='percent') }} - - {# twelve point three four five #} - {{ '12.345'|format_number(style='spellout') }} - - {# 12 sec. #} - {{ '12'|format_duration_number }} - -The list of supported styles: - -* ``decimal``; -* ``currency``; -* ``percent``; -* ``scientific``; -* ``spellout``; -* ``ordinal``; -* ``duration``. - -As a shortcut, you can use the ``format_*_number`` filters by replacing `*` with -a style: - -.. code-block:: twig - - {# 1,234% #} - {{ '12.345'|format_percent_number }} - - {# twelve point three four five #} - {{ '12.345'|format_spellout_number }} - -You can pass attributes to tweak the output: - -.. code-block:: twig - - {# 12.3% #} - {{ '0.12345'|format_percent_number({rounding_mode: 'floor', fraction_digit: 1}) }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# 12,345 #} - {{ '12.345'|format_number(locale='fr') }} - -.. note:: - - The ``format_number`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``attrs``: A map of attributes -* ``style``: The style of the number output diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/format_time.rst b/upload/system/storage/vendor/twig/twig/doc/filters/format_time.rst deleted file mode 100644 index d207b570632..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/format_time.rst +++ /dev/null @@ -1,32 +0,0 @@ -``format_time`` -=============== - -.. versionadded:: 2.12 - The ``format_time`` filter was added in Twig 2.12. - -The ``format_time`` filter formats a time. It behaves in the exact same way as -the ``format_datetime`` filter, but without the date. - -.. note:: - - The ``format_time`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/intl-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``timeFormat``: The time format -* ``pattern``: A date time pattern diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/html_to_markdown.rst b/upload/system/storage/vendor/twig/twig/doc/filters/html_to_markdown.rst deleted file mode 100644 index 4cb55459e21..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/html_to_markdown.rst +++ /dev/null @@ -1,66 +0,0 @@ -``html_to_markdown`` -==================== - -.. versionadded:: 2.12 - The ``html_to_markdown`` filter was added in Twig 2.12. - -The ``html_to_markdown`` filter converts a block of HTML to Markdown: - -.. code-block:: twig - - {% apply html_to_markdown %} - -

Hello!

- - {% endapply %} - -You can also add some options by passing them as an argument to the filter: - -.. code-block:: twig - - {% apply html_to_markdown({hard_break: false}) %} - -

Hello!

- - {% endapply %} - -.. note:: - - The options are the ones provided by the ``league/html-to-markdown`` package. - -You can also use the filter on an included file: - -.. code-block:: twig - - {{ include('some_template.html.twig')|html_to_markdown }} - -.. note:: - - The ``html_to_markdown`` filter is part of the ``MarkdownExtension`` which - is not installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/markdown-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Markdown\MarkdownExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new MarkdownExtension()); - - If you are not using Symfony, you must also register the extension runtime:: - - use Twig\Extra\Markdown\DefaultMarkdown; - use Twig\Extra\Markdown\MarkdownRuntime; - use Twig\RuntimeLoader\RuntimeLoaderInterface; - - $twig->addRuntimeLoader(new class implements RuntimeLoaderInterface { - public function load($class) { - if (MarkdownRuntime::class === $class) { - return new MarkdownRuntime(new DefaultMarkdown()); - } - } - }); diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/index.rst b/upload/system/storage/vendor/twig/twig/doc/filters/index.rst deleted file mode 100644 index a35c3d76d50..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/index.rst +++ /dev/null @@ -1,59 +0,0 @@ -Filters -======= - -.. toctree:: - :maxdepth: 1 - - abs - batch - capitalize - column - convert_encoding - country_name - currency_name - currency_symbol - data_uri - date - date_modify - default - escape - filter - first - format - format_currency - format_date - format_datetime - format_number - format_time - html_to_markdown - inline_css - inky_to_html - join - json_encode - keys - language_name - last - length - locale_name - lower - map - markdown_to_html - merge - nl2br - number_format - raw - reduce - replace - reverse - round - slice - sort - spaceless - split - striptags - timezone_name - title - trim - u - upper - url_encode diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/inky_to_html.rst b/upload/system/storage/vendor/twig/twig/doc/filters/inky_to_html.rst deleted file mode 100644 index fe215228f55..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/inky_to_html.rst +++ /dev/null @@ -1,40 +0,0 @@ -``inky_to_html`` -================ - -.. versionadded:: 2.12 - The ``inky_to_html`` filter was added in Twig 2.12. - -The ``inky_to_html`` filter processes an `inky email template -`_: - -.. code-block:: twig - - {% apply inky_to_html %} - - - - - {% endapply %} - -You can also use the filter on an included file: - -.. code-block:: twig - - {{ include('some_template.inky.twig')|inky_to_html }} - -.. note:: - - The ``inky_to_html`` filter is part of the ``InkyExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer req twig/inky-extra - - Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension - explicitly on the Twig environment:: - - use Twig\Extra\Inky\InkyExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new InkyExtension()); diff --git a/upload/system/storage/vendor/twig/twig/doc/filters/inline_css.rst b/upload/system/storage/vendor/twig/twig/doc/filters/inline_css.rst deleted file mode 100644 index daff5ac2bd6..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/filters/inline_css.rst +++ /dev/null @@ -1,64 +0,0 @@ -``inline_css`` -============== - -.. versionadded:: 2.12 - The ``inline_css`` filter was added in Twig 2.12. - -The ``inline_css`` filter inline CSS styles in HTML documents: - -.. code-block:: twig - - {% apply inline_css %} - - - - - -

Hello CSS!

- - - {% endapply %} - -You can also add some stylesheets by passing them as arguments to the filter: - -.. code-block:: twig - - {% apply inline_css(source("some_styles.css"), source("another.css")) %} - - -

Hello CSS!

- - - {% endapply %} - -Styles loaded via the filter override the styles defined in the `` - {% endblock %} - {% block content %} -

Index

-

- Welcome on my awesome homepage. -

- {% endblock %} - -The ``extends`` tag is the key here. It tells the template engine that this -template "extends" another template. When the template system evaluates this -template, first it locates the parent. The extends tag should be the first tag -in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -You can't define multiple ``block`` tags with the same name in the same -template. This limitation exists because a block tag works in "both" -directions. That is, a block tag doesn't just provide a hole to fill - it also -defines the content that fills the hole in the *parent*. If there were two -similarly-named ``block`` tags in a template, that template's parent wouldn't -know which one of the blocks' content to use. - -If you want to print a block multiple times you can however use the -``block`` function: - -.. code-block:: twig - - {% block title %}{% endblock %} -

{{ block('title') }}

- {% block body %}{% endblock %} - -Parent Blocks -------------- - -It's possible to render the contents of the parent block by using the -:doc:`parent<../functions/parent>` function. This gives back the results of -the parent block: - -.. code-block:: twig - - {% block sidebar %} -

Table Of Contents

- ... - {{ parent() }} - {% endblock %} - -Named Block End-Tags --------------------- - -Twig allows you to put the name of the block after the end tag for better -readability (the name after the ``endblock`` word must match the block name): - -.. code-block:: twig - - {% block sidebar %} - {% block inner_sidebar %} - ... - {% endblock inner_sidebar %} - {% endblock sidebar %} - -Block Nesting and Scope ------------------------ - -Blocks can be nested for more complex layouts. Per default, blocks have access -to variables from outer scopes: - -.. code-block:: twig - - {% for item in seq %} -
  • {% block loop_item %}{{ item }}{% endblock %}
  • - {% endfor %} - -Block Shortcuts ---------------- - -For blocks with little content, it's possible to use a shortcut syntax. The -following constructs do the same thing: - -.. code-block:: twig - - {% block title %} - {{ page_title|title }} - {% endblock %} - -.. code-block:: twig - - {% block title page_title|title %} - -Dynamic Inheritance -------------------- - -Twig supports dynamic inheritance by using a variable as the base template: - -.. code-block:: twig - - {% extends some_var %} - -If the variable evaluates to a ``\Twig\Template`` or a ``\Twig\TemplateWrapper`` -instance, Twig will use it as the parent template:: - - // {% extends layout %} - - $layout = $twig->load('some_layout_template.twig'); - - $twig->display('template.twig', ['layout' => $layout]); - -You can also provide a list of templates that are checked for existence. The -first template that exists will be used as a parent: - -.. code-block:: twig - - {% extends ['layout.html', 'base_layout.html'] %} - -Conditional Inheritance ------------------------ - -As the template name for the parent can be any valid Twig expression, it's -possible to make the inheritance mechanism conditional: - -.. code-block:: twig - - {% extends standalone ? "minimum.html" : "base.html" %} - -In this example, the template will extend the "minimum.html" layout template -if the ``standalone`` variable evaluates to ``true``, and "base.html" -otherwise. - -How do blocks work? -------------------- - -A block provides a way to change how a certain part of a template is rendered -but it does not interfere in any way with the logic around it. - -Let's take the following example to illustrate how a block works and more -importantly, how it does not work: - -.. code-block:: twig - - {# base.twig #} - - {% for post in posts %} - {% block post %} -

    {{ post.title }}

    -

    {{ post.body }}

    - {% endblock %} - {% endfor %} - -If you render this template, the result would be exactly the same with or -without the ``block`` tag. The ``block`` inside the ``for`` loop is just a way -to make it overridable by a child template: - -.. code-block:: twig - - {# child.twig #} - - {% extends "base.twig" %} - - {% block post %} -
    -
    {{ post.title }}
    -
    {{ post.text }}
    -
    - {% endblock %} - -Now, when rendering the child template, the loop is going to use the block -defined in the child template instead of the one defined in the base one; the -executed template is then equivalent to the following one: - -.. code-block:: twig - - {% for post in posts %} -
    -
    {{ post.title }}
    -
    {{ post.text }}
    -
    - {% endfor %} - -Let's take another example: a block included within an ``if`` statement: - -.. code-block:: twig - - {% if posts is empty %} - {% block head %} - {{ parent() }} - - - {% endblock head %} - {% endif %} - -Contrary to what you might think, this template does not define a block -conditionally; it just makes overridable by a child template the output of -what will be rendered when the condition is ``true``. - -If you want the output to be displayed conditionally, use the following -instead: - -.. code-block:: twig - - {% block head %} - {{ parent() }} - - {% if posts is empty %} - - {% endif %} - {% endblock head %} - -.. seealso:: :doc:`block<../functions/block>`, :doc:`block<../tags/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>` diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/filter.rst b/upload/system/storage/vendor/twig/twig/doc/tags/filter.rst deleted file mode 100644 index f225fb25139..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/filter.rst +++ /dev/null @@ -1,26 +0,0 @@ -``filter`` -========== - -.. note:: - - As of Twig 2.9, you should use the ``apply`` tag instead which does the - same thing except that the wrapped template data is not scoped. - -Filter sections allow you to apply regular Twig filters on a block of template -data. Just wrap the code in the special ``filter`` section: - -.. code-block:: twig - - {% filter upper %} - This text becomes uppercase - {% endfilter %} - -You can also chain filters and pass arguments to them: - -.. code-block:: twig - - {% filter lower|escape('html') %} - SOME TEXT - {% endfilter %} - - {# outputs "<strong>some text</strong>" #} diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/flush.rst b/upload/system/storage/vendor/twig/twig/doc/tags/flush.rst deleted file mode 100644 index 332e9825145..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/flush.rst +++ /dev/null @@ -1,14 +0,0 @@ -``flush`` -========= - -The ``flush`` tag tells Twig to flush the output buffer: - -.. code-block:: twig - - {% flush %} - -.. note:: - - Internally, Twig uses the PHP `flush`_ function. - -.. _`flush`: https://secure.php.net/flush diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/for.rst b/upload/system/storage/vendor/twig/twig/doc/tags/for.rst deleted file mode 100644 index 8e9b4e58246..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/for.rst +++ /dev/null @@ -1,176 +0,0 @@ -``for`` -======= - -Loop over each item in a sequence. For example, to display a list of users -provided in a variable called ``users``: - -.. code-block:: twig - -

    Members

    -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -.. note:: - - A sequence can be either an array or an object implementing the - ``Traversable`` interface. - -If you do need to iterate over a sequence of numbers, you can use the ``..`` -operator: - -.. code-block:: twig - - {% for i in 0..10 %} - * {{ i }} - {% endfor %} - -The above snippet of code would print all numbers from 0 to 10. - -It can be also useful with letters: - -.. code-block:: twig - - {% for letter in 'a'..'z' %} - * {{ letter }} - {% endfor %} - -The ``..`` operator can take any expression at both sides: - -.. code-block:: twig - - {% for letter in 'a'|upper..'z'|upper %} - * {{ letter }} - {% endfor %} - -.. tip: - - If you need a step different from 1, you can use the ``range`` function - instead. - -The `loop` variable -------------------- - -Inside of a ``for`` loop block you can access some special variables: - -===================== ============================================================= -Variable Description -===================== ============================================================= -``loop.index`` The current iteration of the loop. (1 indexed) -``loop.index0`` The current iteration of the loop. (0 indexed) -``loop.revindex`` The number of iterations from the end of the loop (1 indexed) -``loop.revindex0`` The number of iterations from the end of the loop (0 indexed) -``loop.first`` True if first iteration -``loop.last`` True if last iteration -``loop.length`` The number of items in the sequence -``loop.parent`` The parent context -===================== ============================================================= - -.. code-block:: twig - - {% for user in users %} - {{ loop.index }} - {{ user.username }} - {% endfor %} - -.. note:: - - The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and - ``loop.last`` variables are only available for PHP arrays, or objects that - implement the ``Countable`` interface. They are also not available when - looping with a condition. - -Adding a condition ------------------- - -.. tip:: - - As of Twig 2.10, use the :doc:`filter <../filters/filter>` filter instead, - or an ``if`` condition inside the ``for`` body (if your condition depends on - a variable updated inside the loop and you are not using the ``loop`` - variable). - -Unlike in PHP, it's not possible to ``break`` or ``continue`` in a loop. You -can however filter the sequence during iteration which allows you to skip -items. The following example skips all the users which are not active: - -.. code-block:: twig - -
      - {% for user in users if user.active %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -The advantage is that the special loop variable will count correctly thus not -counting the users not iterated over. Keep in mind that properties like -``loop.last`` will not be defined when using loop conditions. - -.. note:: - - Using the ``loop`` variable within the condition is not recommended as it - will probably not be doing what you expect it to. For instance, adding a - condition like ``loop.index > 4`` won't work as the index is only - incremented when the condition is true (so the condition will never - match). - -The `else` Clause ------------------ - -If no iteration took place because the sequence was empty, you can render a -replacement block by using ``else``: - -.. code-block:: twig - -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% else %} -
    • no user found
    • - {% endfor %} -
    - -Iterating over Keys -------------------- - -By default, a loop iterates over the values of the sequence. You can iterate -on keys by using the ``keys`` filter: - -.. code-block:: twig - -

    Members

    -
      - {% for key in users|keys %} -
    • {{ key }}
    • - {% endfor %} -
    - -Iterating over Keys and Values ------------------------------- - -You can also access both keys and values: - -.. code-block:: twig - -

    Members

    -
      - {% for key, user in users %} -
    • {{ key }}: {{ user.username|e }}
    • - {% endfor %} -
    - -Iterating over a Subset ------------------------ - -You might want to iterate over a subset of values. This can be achieved using -the :doc:`slice <../filters/slice>` filter: - -.. code-block:: twig - -

    Top Ten Members

    -
      - {% for user in users|slice(0, 10) %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/from.rst b/upload/system/storage/vendor/twig/twig/doc/tags/from.rst deleted file mode 100644 index 96c439aa74b..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/from.rst +++ /dev/null @@ -1,6 +0,0 @@ -``from`` -======== - -The ``from`` tag imports :doc:`macro<../tags/macro>` names into the current -namespace. The tag is documented in detail in the documentation for the -:doc:`macro<../tags/macro>` tag. diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/if.rst b/upload/system/storage/vendor/twig/twig/doc/tags/if.rst deleted file mode 100644 index 2a1610c822a..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/if.rst +++ /dev/null @@ -1,79 +0,0 @@ -``if`` -====== - -The ``if`` statement in Twig is comparable with the if statements of PHP. - -In the simplest form you can use it to test if an expression evaluates to -``true``: - -.. code-block:: twig - - {% if online == false %} -

    Our website is in maintenance mode. Please, come back later.

    - {% endif %} - -You can also test if an array is not empty: - -.. code-block:: twig - - {% if users %} -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - {% endif %} - -.. note:: - - If you want to test if the variable is defined, use ``if users is - defined`` instead. - -You can also use ``not`` to check for values that evaluate to ``false``: - -.. code-block:: twig - - {% if not user.subscribed %} -

    You are not subscribed to our mailing list.

    - {% endif %} - -For multiple conditions, ``and`` and ``or`` can be used: - -.. code-block:: twig - - {% if temperature > 18 and temperature < 27 %} -

    It's a nice day for a walk in the park.

    - {% endif %} - -For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can -use more complex ``expressions`` there too: - -.. code-block:: twig - - {% if product.stock > 10 %} - Available - {% elseif product.stock > 0 %} - Only {{ product.stock }} left! - {% else %} - Sold-out! - {% endif %} - -.. note:: - - The rules to determine if an expression is ``true`` or ``false`` are the - same as in PHP; here are the edge cases rules: - - ====================== ==================== - Value Boolean evaluation - ====================== ==================== - empty string false - numeric zero false - NAN (Not A Number) true - INF (Infinity) true - whitespace-only string true - string "0" or '0' false - empty array false - null false - non-empty array true - object true - ====================== ==================== diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/import.rst b/upload/system/storage/vendor/twig/twig/doc/tags/import.rst deleted file mode 100644 index f217479fb38..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/import.rst +++ /dev/null @@ -1,6 +0,0 @@ -``import`` -========== - -The ``import`` tag imports :doc:`macro<../tags/macro>` names in a local -variable. The tag is documented in detail in the documentation for the -:doc:`macro<../tags/macro>` tag. diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/include.rst b/upload/system/storage/vendor/twig/twig/doc/tags/include.rst deleted file mode 100644 index 93ec894da5d..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/include.rst +++ /dev/null @@ -1,111 +0,0 @@ -``include`` -=========== - -The ``include`` statement includes a template and returns the rendered content -of that file: - -.. code-block:: twig - - {% include 'header.html' %} - Body - {% include 'footer.html' %} - -.. note:: - - As of Twig 1.12, it is recommended to use the - :doc:`include<../functions/include>` function instead as it provides the - same features with a bit more flexibility: - - * The ``include`` function is semantically more "correct" (including a - template outputs its rendered contents in the current scope; a tag should - not display anything); - - * The ``include`` function is more "composable": - - .. code-block:: twig - - {# Store a rendered template in a variable #} - {% set content %} - {% include 'template.html' %} - {% endset %} - {# vs #} - {% set content = include('template.html') %} - - {# Filter a rendered template #} - {% filter upper %} - {% include 'template.html' %} - {% endfilter %} - {# vs #} - {{ include('template.html')|upper }} - - * The ``include`` function does not impose any specific order for - arguments thanks to :ref:`named arguments `. - -Included templates have access to the variables of the active context. - -If you are using the filesystem loader, the templates are looked for in the -paths defined by it. - -You can add additional variables by passing them after the ``with`` keyword: - -.. code-block:: twig - - {# template.html will have access to the variables from the current context and the additional ones provided #} - {% include 'template.html' with {'foo': 'bar'} %} - - {% set vars = {'foo': 'bar'} %} - {% include 'template.html' with vars %} - -You can disable access to the context by appending the ``only`` keyword: - -.. code-block:: twig - - {# only the foo variable will be accessible #} - {% include 'template.html' with {'foo': 'bar'} only %} - -.. code-block:: twig - - {# no variables will be accessible #} - {% include 'template.html' only %} - -.. tip:: - - When including a template created by an end user, you should consider - sandboxing it. More information in the :doc:`Twig for Developers<../api>` - chapter and in the :doc:`sandbox<../tags/sandbox>` tag documentation. - -The template name can be any valid Twig expression: - -.. code-block:: twig - - {% include some_var %} - {% include ajax ? 'ajax.html' : 'not_ajax.html' %} - -And if the expression evaluates to a ``\Twig\Template`` or a -``\Twig\TemplateWrapper`` instance, Twig will use it directly:: - - // {% include template %} - - $template = $twig->load('some_template.twig'); - - $twig->display('template.twig', ['template' => $template]); - -You can mark an include with ``ignore missing`` in which case Twig will ignore -the statement if the template to be included does not exist. It has to be -placed just after the template name. Here some valid examples: - -.. code-block:: twig - - {% include 'sidebar.html' ignore missing %} - {% include 'sidebar.html' ignore missing with {'foo': 'bar'} %} - {% include 'sidebar.html' ignore missing only %} - -You can also provide a list of templates that are checked for existence before -inclusion. The first template that exists will be included: - -.. code-block:: twig - - {% include ['page_detailed.html', 'page.html'] %} - -If ``ignore missing`` is given, it will fall back to rendering nothing if none -of the templates exist, otherwise it will throw an exception. diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/index.rst b/upload/system/storage/vendor/twig/twig/doc/tags/index.rst deleted file mode 100644 index 530f95f1005..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/index.rst +++ /dev/null @@ -1,27 +0,0 @@ -Tags -==== - -.. toctree:: - :maxdepth: 1 - - apply - autoescape - block - deprecated - do - embed - extends - filter - flush - for - from - if - import - include - macro - sandbox - set - spaceless - use - verbatim - with diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/macro.rst b/upload/system/storage/vendor/twig/twig/doc/tags/macro.rst deleted file mode 100644 index 691a3c5aaca..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/macro.rst +++ /dev/null @@ -1,180 +0,0 @@ -``macro`` -========= - -Macros are comparable with functions in regular programming languages. They -are useful to reuse template fragments to not repeat yourself. - -Macros are defined in regular templates. - -Imagine having a generic helper template that define how to render HTML forms -via macros (called ``forms.html``): - -.. code-block:: twig - - {% macro input(name, value, type = "text", size = 20) %} - - {% endmacro %} - - {% macro textarea(name, value, rows = 10, cols = 40) %} - - {% endmacro %} - -Each macro argument can have a default value (here ``text`` is the default value -for ``type`` if not provided in the call). - -Macros differ from native PHP functions in a few ways: - -* Arguments of a macro are always optional. - -* If extra positional arguments are passed to a macro, they end up in the - special ``varargs`` variable as a list of values. - -But as with PHP functions, macros don't have access to the current template -variables. - -.. tip:: - - You can pass the whole context as an argument by using the special - ``_context`` variable. - -Importing Macros ----------------- - -There are two ways to import macros. You can import the complete template -containing the macros into a local variable (via the ``import`` tag) or only -import specific macros from the template (via the ``from`` tag). - -To import all macros from a template into a local variable, use the ``import`` -tag: - -.. code-block:: twig - - {% import "forms.html" as forms %} - -The above ``import`` call imports the ``forms.html`` file (which can contain -only macros, or a template and some macros), and import the macros as items of -the ``forms`` local variable. - -The macros can then be called at will in the *current* template: - -.. code-block:: twig - -

    {{ forms.input('username') }}

    -

    {{ forms.input('password', null, 'password') }}

    - -Alternatively you can import names from the template into the current namespace -via the ``from`` tag: - -.. code-block:: twig - - {% from 'forms.html' import input as input_field, textarea %} - -

    {{ input_field('password', '', 'password') }}

    -

    {{ textarea('comment') }}

    - -.. tip:: - - When macro usages and definitions are in the same template, you don't need to - import the macros as they are automatically available under the special - ``_self`` variable: - - .. code-block:: twig - -

    {{ _self.input('password', '', 'password') }}

    - - {% macro input(name, value, type = "text", size = 20) %} - - {% endmacro %} - - Auto-import is only available as of Twig 2.11. For older versions, import - macros using the special ``_self`` variable for the template name: - - .. code-block:: twig - - {% import _self as forms %} - -

    {{ forms.input('username') }}

    - -.. note:: - - Before Twig 2.11, when you want to use a macro in another macro from the - same file, you need to import it locally: - - .. code-block:: twig - - {% macro input(name, value, type, size) %} - - {% endmacro %} - - {% macro wrapped_input(name, value, type, size) %} - {% import _self as forms %} - -
    - {{ forms.input(name, value, type, size) }} -
    - {% endmacro %} - -Macros Scoping --------------- - -.. versionadded:: 2.11 - - The scoping rules described in this paragraph are implemented as of Twig - 2.11. - -The scoping rules are the same whether you imported macros via ``import`` or -``from``. - -Imported macros are always **local** to the current template. It means that -macros are available in all blocks and other macros defined in the current -template, but they are not available in included templates or child templates; -you need to explicitly re-import macros in each template. - -When calling ``import`` or ``from`` from a ``block`` tag, the imported macros -are only defined in the current block and they override macros defined at the -template level with the same names. - -When calling ``import`` or ``from`` from a ``macro`` tag, the imported macros -are only defined in the current macro and they override macros defined at the -template level with the same names. - -.. note:: - - Before Twig 2.11, it was possible to use macros imported in a block in a - "sub-block". When upgrading to 2.11, you need to either move the import in - the global scope or reimport the macros explicitly in the "sub-blocks". - -Checking if a Macro is defined ------------------------------- - -.. versionadded:: 2.11 - - Support for the ``defined`` test on macros was added in Twig 2.11. - -You can check if a macro is defined via the ``defined`` test: - -.. code-block:: twig - - {% import "macros.twig" as macros %} - - {% from "macros.twig" import hello %} - - {% if macros.hello is defined -%} - OK - {% endif %} - - {% if hello is defined -%} - OK - {% endif %} - -Named Macro End-Tags --------------------- - -Twig allows you to put the name of the macro after the end tag for better -readability (the name after the ``endmacro`` word must match the macro name): - -.. code-block:: twig - - {% macro input() %} - ... - {% endmacro input %} diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/sandbox.rst b/upload/system/storage/vendor/twig/twig/doc/tags/sandbox.rst deleted file mode 100644 index b331fdb8e69..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/sandbox.rst +++ /dev/null @@ -1,30 +0,0 @@ -``sandbox`` -=========== - -The ``sandbox`` tag can be used to enable the sandboxing mode for an included -template, when sandboxing is not enabled globally for the Twig environment: - -.. code-block:: twig - - {% sandbox %} - {% include 'user.html' %} - {% endsandbox %} - -.. warning:: - - The ``sandbox`` tag is only available when the sandbox extension is - enabled (see the :doc:`Twig for Developers<../api>` chapter). - -.. note:: - - The ``sandbox`` tag can only be used to sandbox an include tag and it - cannot be used to sandbox a section of a template. The following example - won't work: - - .. code-block:: twig - - {% sandbox %} - {% for i in 1..2 %} - {{ i }} - {% endfor %} - {% endsandbox %} diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/set.rst b/upload/system/storage/vendor/twig/twig/doc/tags/set.rst deleted file mode 100644 index f752fddb67b..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/set.rst +++ /dev/null @@ -1,78 +0,0 @@ -``set`` -======= - -Inside code blocks you can also assign values to variables. Assignments use -the ``set`` tag and can have multiple targets. - -Here is how you can assign the ``bar`` value to the ``foo`` variable: - -.. code-block:: twig - - {% set foo = 'bar' %} - -After the ``set`` call, the ``foo`` variable is available in the template like -any other ones: - -.. code-block:: twig - - {# displays bar #} - {{ foo }} - -The assigned value can be any valid :ref:`Twig expression -`: - -.. code-block:: twig - - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - {% set foo = 'foo' ~ 'bar' %} - -Several variables can be assigned in one block: - -.. code-block:: twig - - {% set foo, bar = 'foo', 'bar' %} - - {# is equivalent to #} - - {% set foo = 'foo' %} - {% set bar = 'bar' %} - -The ``set`` tag can also be used to 'capture' chunks of text: - -.. code-block:: twig - - {% set foo %} - - {% endset %} - -.. caution:: - - If you enable automatic output escaping, Twig will only consider the - content to be safe when capturing chunks of text. - -.. note:: - - Note that loops are scoped in Twig; therefore a variable declared inside a - ``for`` loop is not accessible outside the loop itself: - - .. code-block:: twig - - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is NOT available #} - - If you want to access the variable, just declare it before the loop: - - .. code-block:: twig - - {% set foo = "" %} - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is available #} diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/spaceless.rst b/upload/system/storage/vendor/twig/twig/doc/tags/spaceless.rst deleted file mode 100644 index 2608538aae6..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/spaceless.rst +++ /dev/null @@ -1,41 +0,0 @@ -``spaceless`` -============= - -.. tip:: - - As of Twig 1.38, use the :doc:`spaceless <../filters/spaceless>` filter instead. - -Use the ``spaceless`` tag to remove whitespace *between HTML tags*, not -whitespace within HTML tags or whitespace in plain text: - -.. code-block:: twig - - {% spaceless %} -
    - foo -
    - {% endspaceless %} - - {# output will be
    foo
    #} - -This tag is not meant to "optimize" the size of the generated HTML content but -merely to avoid extra whitespace between HTML tags to avoid browser rendering -quirks under some circumstances. - -.. tip:: - - If you want to optimize the size of the generated HTML content, gzip - compress the output instead. - -.. tip:: - - If you want to create a tag that actually removes all extra whitespace in - an HTML string, be warned that this is not as easy as it seems to be - (think of ``textarea`` or ``pre`` tags for instance). Using a third-party - library like Tidy is probably a better idea. - -.. tip:: - - For more information on whitespace control, read the - :ref:`dedicated section ` of the documentation and learn how - you can also use the whitespace control modifier on your tags. diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/use.rst b/upload/system/storage/vendor/twig/twig/doc/tags/use.rst deleted file mode 100644 index 2aca6a01fb4..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/use.rst +++ /dev/null @@ -1,117 +0,0 @@ -``use`` -======= - -.. note:: - - Horizontal reuse is an advanced Twig feature that is hardly ever needed in - regular templates. It is mainly used by projects that need to make - template blocks reusable without using inheritance. - -Template inheritance is one of the most powerful features of Twig but it is -limited to single inheritance; a template can only extend one other template. -This limitation makes template inheritance simple to understand and easy to -debug: - -.. code-block:: twig - - {% extends "base.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -Horizontal reuse is a way to achieve the same goal as multiple inheritance, -but without the associated complexity: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -The ``use`` statement tells Twig to import the blocks defined in -``blocks.html`` into the current template (it's like macros, but for blocks): - -.. code-block:: twig - - {# blocks.html #} - - {% block sidebar %}{% endblock %} - -In this example, the ``use`` statement imports the ``sidebar`` block into the -main template. The code is mostly equivalent to the following one (the -imported blocks are not outputted automatically): - -.. code-block:: twig - - {% extends "base.html" %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -.. note:: - - The ``use`` tag only imports a template if it does not extend another - template, if it does not define macros, and if the body is empty. But it - can *use* other templates. - -.. note:: - - Because ``use`` statements are resolved independently of the context - passed to the template, the template reference cannot be an expression. - -The main template can also override any imported block. If the template -already defines the ``sidebar`` block, then the one defined in ``blocks.html`` -is ignored. To avoid name conflicts, you can rename imported blocks: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as base_sidebar, title as base_title %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -The ``parent()`` function automatically determines the correct inheritance -tree, so it can be used when overriding a block defined in an imported -template: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block sidebar %} - {{ parent() }} - {% endblock %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -In this example, ``parent()`` will correctly call the ``sidebar`` block from -the ``blocks.html`` template. - -.. tip:: - - Renaming allows you to simulate inheritance by calling the "parent" block: - - .. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as parent_sidebar %} - - {% block sidebar %} - {{ block('parent_sidebar') }} - {% endblock %} - -.. note:: - - You can use as many ``use`` statements as you want in any given template. - If two imported templates define the same block, the latest one wins. diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/verbatim.rst b/upload/system/storage/vendor/twig/twig/doc/tags/verbatim.rst deleted file mode 100644 index 88c615285e4..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/verbatim.rst +++ /dev/null @@ -1,16 +0,0 @@ -``verbatim`` -============ - -The ``verbatim`` tag marks sections as being raw text that should not be -parsed. For example to put Twig syntax as example into a template you can use -this snippet: - -.. code-block:: twig - - {% verbatim %} -
      - {% for item in seq %} -
    • {{ item }}
    • - {% endfor %} -
    - {% endverbatim %} diff --git a/upload/system/storage/vendor/twig/twig/doc/tags/with.rst b/upload/system/storage/vendor/twig/twig/doc/tags/with.rst deleted file mode 100644 index 107432f6fc8..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tags/with.rst +++ /dev/null @@ -1,41 +0,0 @@ -``with`` -======== - -Use the ``with`` tag to create a new inner scope. Variables set within this -scope are not visible outside of the scope: - -.. code-block:: twig - - {% with %} - {% set foo = 42 %} - {{ foo }} {# foo is 42 here #} - {% endwith %} - foo is not visible here any longer - -Instead of defining variables at the beginning of the scope, you can pass a -hash of variables you want to define in the ``with`` tag; the previous example -is equivalent to the following one: - -.. code-block:: twig - - {% with { foo: 42 } %} - {{ foo }} {# foo is 42 here #} - {% endwith %} - foo is not visible here any longer - - {# it works with any expression that resolves to a hash #} - {% set vars = { foo: 42 } %} - {% with vars %} - ... - {% endwith %} - -By default, the inner scope has access to the outer scope context; you can -disable this behavior by appending the ``only`` keyword: - -.. code-block:: twig - - {% set bar = 'bar' %} - {% with { foo: 42 } only %} - {# only foo is defined #} - {# bar is not defined #} - {% endwith %} diff --git a/upload/system/storage/vendor/twig/twig/doc/templates.rst b/upload/system/storage/vendor/twig/twig/doc/templates.rst deleted file mode 100644 index b83e96a0461..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/templates.rst +++ /dev/null @@ -1,865 +0,0 @@ -Twig for Template Designers -=========================== - -This document describes the syntax and semantics of the template engine and -will be most useful as reference to those creating Twig templates. - -Synopsis --------- - -A template is a regular text file. It can generate any text-based format (HTML, -XML, CSV, LaTeX, etc.). It doesn't have a specific extension, ``.html`` or -``.xml`` are just fine. - -A template contains **variables** or **expressions**, which get replaced with -values when the template is evaluated, and **tags**, which control the -template's logic. - -Below is a minimal template that illustrates a few basics. We will cover further -details later on: - -.. code-block:: html+twig - - - - - My Webpage - - - - -

    My Webpage

    - {{ a_variable }} - - - -There are two kinds of delimiters: ``{% ... %}`` and ``{{ ... }}``. The first -one is used to execute statements such as for-loops, the latter outputs the -result of an expression. - -IDEs Integration ----------------- - -Many IDEs support syntax highlighting and auto-completion for Twig: - -* *Textmate* via the `Twig bundle`_ -* *Vim* via the `Jinja syntax plugin`_ or the `vim-twig plugin`_ -* *Netbeans* via the `Twig syntax plugin`_ (until 7.1, native as of 7.2) -* *PhpStorm* (native as of 2.1) -* *Eclipse* via the `Twig plugin`_ -* *Sublime Text* via the `Twig bundle`_ -* *GtkSourceView* via the `Twig language definition`_ (used by gedit and other projects) -* *Coda* and *SubEthaEdit* via the `Twig syntax mode`_ -* *Coda 2* via the `other Twig syntax mode`_ -* *Komodo* and *Komodo Edit* via the Twig highlight/syntax check mode -* *Notepad++* via the `Notepad++ Twig Highlighter`_ -* *Emacs* via `web-mode.el`_ -* *Atom* via the `PHP-twig for atom`_ -* *Visual Studio Code* via the `Twig pack`_ - -Also, `TwigFiddle`_ is an online service that allows you to execute Twig templates -from a browser; it supports all versions of Twig. - -Variables ---------- - -The application passes variables to the templates for manipulation in the -template. Variables may have attributes or elements you can access, too. The -visual representation of a variable depends heavily on the application providing -it. - -Use a dot (``.``) to access attributes of a variable (methods or properties of a -PHP object, or items of a PHP array): - -.. code-block:: twig - - {{ foo.bar }} - -.. note:: - - It's important to know that the curly braces are *not* part of the - variable but the print statement. When accessing variables inside tags, - don't put the braces around them. - -.. sidebar:: Implementation - - For convenience's sake ``foo.bar`` does the following things on the PHP - layer: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid property; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid method - (even if ``bar`` is the constructor - use ``__construct()`` instead); - * if not, and if ``foo`` is an object, check that ``getBar`` is a valid method; - * if not, and if ``foo`` is an object, check that ``isBar`` is a valid method; - * if not, and if ``foo`` is an object, check that ``hasBar`` is a valid method; - * if not, return a ``null`` value. - - Twig also supports a specific syntax for accessing items on PHP arrays, - ``foo['bar']``: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, return a ``null`` value. - -If a variable or attribute does not exist, you will receive a ``null`` value -when the ``strict_variables`` option is set to ``false``; alternatively, if ``strict_variables`` -is set, Twig will throw an error (see :ref:`environment options`). - -.. note:: - - If you want to access a dynamic attribute of a variable, use the - :doc:`attribute` function instead. - - The ``attribute`` function is also useful when the attribute contains - special characters (like ``-`` that would be interpreted as the minus - operator): - - .. code-block:: twig - - {# equivalent to the non-working foo.data-foo #} - {{ attribute(foo, 'data-foo') }} - -Global Variables -~~~~~~~~~~~~~~~~ - -The following variables are always available in templates: - -* ``_self``: references the current template name; -* ``_context``: references the current context; -* ``_charset``: references the current charset. - -Setting Variables -~~~~~~~~~~~~~~~~~ - -You can assign values to variables inside code blocks. Assignments use the -:doc:`set` tag: - -.. code-block:: twig - - {% set foo = 'foo' %} - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - -Filters -------- - -Variables can be modified by **filters**. Filters are separated from the -variable by a pipe symbol (``|``). Multiple filters can be chained. The output -of one filter is applied to the next. - -The following example removes all HTML tags from the ``name`` and title-cases -it: - -.. code-block:: twig - - {{ name|striptags|title }} - -Filters that accept arguments have parentheses around the arguments. This -example joins the elements of a list by commas: - -.. code-block:: twig - - {{ list|join(', ') }} - -To apply a filter on a section of code, wrap it with the -:doc:`apply` tag: - -.. code-block:: twig - - {% apply upper %} - This text becomes uppercase - {% endapply %} - -Go to the :doc:`filters` page to learn more about built-in -filters. - -.. note:: - - The ``apply`` tag was introduced in Twig 2.9; use the ``filter`` tag with - previous versions. - -Functions ---------- - -Functions can be called to generate content. Functions are called by their -name followed by parentheses (``()``) and may have arguments. - -For instance, the ``range`` function returns a list containing an arithmetic -progression of integers: - -.. code-block:: twig - - {% for i in range(0, 3) %} - {{ i }}, - {% endfor %} - -Go to the :doc:`functions` page to learn more about the -built-in functions. - -.. _named-arguments: - -Named Arguments ---------------- - -.. code-block:: twig - - {% for i in range(low=1, high=10, step=2) %} - {{ i }}, - {% endfor %} - -Using named arguments makes your templates more explicit about the meaning of -the values you pass as arguments: - -.. code-block:: twig - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - - {# versus #} - - {{ data|convert_encoding(from='iso-2022-jp', to='UTF-8') }} - -Named arguments also allow you to skip some arguments for which you don't want -to change the default value: - -.. code-block:: twig - - {# the first argument is the date format, which defaults to the global date format if null is passed #} - {{ "now"|date(null, "Europe/Paris") }} - - {# or skip the format value by using a named argument for the time zone #} - {{ "now"|date(timezone="Europe/Paris") }} - -You can also use both positional and named arguments in one call, in which -case positional arguments must always come before named arguments: - -.. code-block:: twig - - {{ "now"|date('d/m/Y H:i', timezone="Europe/Paris") }} - -.. tip:: - - Each function and filter documentation page has a section where the names - of all arguments are listed when supported. - -Control Structure ------------------ - -A control structure refers to all those things that control the flow of a -program - conditionals (i.e. ``if``/``elseif``/``else``), ``for``-loops, as -well as things like blocks. Control structures appear inside ``{% ... %}`` -blocks. - -For example, to display a list of users provided in a variable called -``users``, use the :doc:`for` tag: - -.. code-block:: twig - -

    Members

    -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - -The :doc:`if` tag can be used to test an expression: - -.. code-block:: twig - - {% if users|length > 0 %} -
      - {% for user in users %} -
    • {{ user.username|e }}
    • - {% endfor %} -
    - {% endif %} - -Go to the :doc:`tags` page to learn more about the built-in tags. - -Comments --------- - -To comment-out part of a line in a template, use the comment syntax ``{# ... -#}``. This is useful for debugging or to add information for other template -designers or yourself: - -.. code-block:: twig - - {# note: disabled template because we no longer use this - {% for user in users %} - ... - {% endfor %} - #} - -Including other Templates -------------------------- - -The :doc:`include` function is useful to include a template -and return the rendered content of that template into the current one: - -.. code-block:: twig - - {{ include('sidebar.html') }} - -By default, included templates have access to the same context as the template -which includes them. This means that any variable defined in the main template -will be available in the included template too: - -.. code-block:: twig - - {% for box in boxes %} - {{ include('render_box.html') }} - {% endfor %} - -The included template ``render_box.html`` is able to access the ``box`` variable. - -The name of the template depends on the template loader. For instance, the -``\Twig\Loader\FilesystemLoader`` allows you to access other templates by giving the -filename. You can access templates in subdirectories with a slash: - -.. code-block:: twig - - {{ include('sections/articles/sidebar.html') }} - -This behavior depends on the application embedding Twig. - -Template Inheritance --------------------- - -The most powerful part of Twig is template inheritance. Template inheritance -allows you to build a base "skeleton" template that contains all the common -elements of your site and defines **blocks** that child templates can -override. - -It's easier to understand the concept by starting with an example. - -Let's define a base template, ``base.html``, which defines an HTML skeleton -document that might be used for a two-column page: - -.. code-block:: html+twig - - - - - {% block head %} - - {% block title %}{% endblock %} - My Webpage - {% endblock %} - - -
    {% block content %}{% endblock %}
    - - - - -In this example, the :doc:`block` tags define four blocks that -child templates can fill in. All the ``block`` tag does is to tell the -template engine that a child template may override those portions of the -template. - -A child template might look like this: - -.. code-block:: twig - - {% extends "base.html" %} - - {% block title %}Index{% endblock %} - {% block head %} - {{ parent() }} - - {% endblock %} - {% block content %} -

    Index

    -

    - Welcome to my awesome homepage. -

    - {% endblock %} - -The :doc:`extends` tag is the key here. It tells the template -engine that this template "extends" another template. When the template system -evaluates this template, first it locates the parent. The extends tag should -be the first tag in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -It's possible to render the contents of the parent block by using the -:doc:`parent` function. This gives back the results of the -parent block: - -.. code-block:: twig - - {% block sidebar %} -

    Table Of Contents

    - ... - {{ parent() }} - {% endblock %} - -.. tip:: - - The documentation page for the :doc:`extends` tag describes - more advanced features like block nesting, scope, dynamic inheritance, and - conditional inheritance. - -.. note:: - - Twig also supports multiple inheritance via "horizontal reuse" with the help - of the :doc:`use` tag. - -HTML Escaping -------------- - -When generating HTML from templates, there's always a risk that a variable -will include characters that affect the resulting HTML. There are two -approaches: manually escaping each variable or automatically escaping -everything by default. - -Twig supports both, automatic escaping is enabled by default. - -The automatic escaping strategy can be configured via the -:ref:`autoescape` option and defaults to ``html``. - -Working with Manual Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If manual escaping is enabled, it is **your** responsibility to escape variables -if needed. What to escape? Any variable that comes from an untrusted source. - -Escaping works by using the :doc:`escape` or ``e`` filter: - -.. code-block:: twig - - {{ user.username|e }} - -By default, the ``escape`` filter uses the ``html`` strategy, but depending on -the escaping context, you might want to explicitly use an other strategy: - -.. code-block:: twig - - {{ user.username|e('js') }} - {{ user.username|e('css') }} - {{ user.username|e('url') }} - {{ user.username|e('html_attr') }} - -Working with Automatic Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Whether automatic escaping is enabled or not, you can mark a section of a -template to be escaped or not by using the :doc:`autoescape` -tag: - -.. code-block:: twig - - {% autoescape %} - Everything will be automatically escaped in this block (using the HTML strategy) - {% endautoescape %} - -By default, auto-escaping uses the ``html`` escaping strategy. If you output -variables in other contexts, you need to explicitly escape them with the -appropriate escaping strategy: - -.. code-block:: twig - - {% autoescape 'js' %} - Everything will be automatically escaped in this block (using the JS strategy) - {% endautoescape %} - -Escaping --------- - -It is sometimes desirable or even necessary to have Twig ignore parts it would -otherwise handle as variables or blocks. For example if the default syntax is -used and you want to use ``{{`` as raw string in the template and not start a -variable you have to use a trick. - -The easiest way is to output the variable delimiter (``{{``) by using a variable -expression: - -.. code-block:: twig - - {{ '{{' }} - -For bigger sections it makes sense to mark a block -:doc:`verbatim`. - -Macros ------- - -Macros are comparable with functions in regular programming languages. They are -useful to reuse HTML fragments to not repeat yourself. They are described in the -:doc:`macro` tag documentation. - -.. _twig-expressions: - -Expressions ------------ - -Twig allows expressions everywhere. - -.. note:: - - The operator precedence is as follows, with the lowest-precedence operators - listed first: ``?:`` (ternary operator), ``b-and``, ``b-xor``, ``b-or``, - ``or``, ``and``, ``==``, ``!=``, ``<=>``, ``<``, ``>``, ``>=``, ``<=``, - ``in``, ``matches``, ``starts with``, ``ends with``, ``..``, ``+``, ``-``, - ``~``, ``*``, ``/``, ``//``, ``%``, ``is`` (tests), ``**``, ``??``, ``|`` - (filters), ``[]``, and ``.``: - - .. code-block:: twig - - {% set greeting = 'Hello ' %} - {% set name = 'Fabien' %} - - {{ greeting ~ name|lower }} {# Hello fabien #} - - {# use parenthesis to change precedence #} - {{ (greeting ~ name)|lower }} {# hello fabien #} - -Literals -~~~~~~~~ - -The simplest form of expressions are literals. Literals are representations -for PHP types such as strings, numbers, and arrays. The following literals -exist: - -* ``"Hello World"``: Everything between two double or single quotes is a - string. They are useful whenever you need a string in the template (for - example as arguments to function calls, filters or just to extend or include - a template). A string can contain a delimiter if it is preceded by a - backslash (``\``) -- like in ``'It\'s good'``. If the string contains a - backslash (e.g. ``'c:\Program Files'``) escape it by doubling it - (e.g. ``'c:\\Program Files'``). - -* ``42`` / ``42.23``: Integers and floating point numbers are created by - writing the number down. If a dot is present the number is a float, - otherwise an integer. - -* ``["foo", "bar"]``: Arrays are defined by a sequence of expressions - separated by a comma (``,``) and wrapped with squared brackets (``[]``). - -* ``{"foo": "bar"}``: Hashes are defined by a list of keys and values - separated by a comma (``,``) and wrapped with curly braces (``{}``): - - .. code-block:: twig - - {# keys as string #} - { 'foo': 'foo', 'bar': 'bar' } - - {# keys as names (equivalent to the previous hash) #} - { foo: 'foo', bar: 'bar' } - - {# keys as integer #} - { 2: 'foo', 4: 'bar' } - - {# keys as expressions (the expression must be enclosed into parentheses) #} - {% set foo = 'foo' %} - { (foo): 'foo', (1 + 1): 'bar', (foo ~ 'b'): 'baz' } - -* ``true`` / ``false``: ``true`` represents the true value, ``false`` - represents the false value. - -* ``null``: ``null`` represents no specific value. This is the value returned - when a variable does not exist. ``none`` is an alias for ``null``. - -Arrays and hashes can be nested: - -.. code-block:: twig - - {% set foo = [1, {"foo": "bar"}] %} - -.. tip:: - - Using double-quoted or single-quoted strings has no impact on performance - but :ref:`string interpolation ` is only - supported in double-quoted strings. - -Math -~~~~ - -Twig allows you to do math in templates; the following operators are supported: - -* ``+``: Adds two numbers together (the operands are casted to numbers). ``{{ - 1 + 1 }}`` is ``2``. - -* ``-``: Subtracts the second number from the first one. ``{{ 3 - 2 }}`` is - ``1``. - -* ``/``: Divides two numbers. The returned value will be a floating point - number. ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``. - -* ``%``: Calculates the remainder of an integer division. ``{{ 11 % 7 }}`` is - ``4``. - -* ``//``: Divides two numbers and returns the floored integer result. ``{{ 20 - // 7 }}`` is ``2``, ``{{ -20 // 7 }}`` is ``-3`` (this is just syntactic - sugar for the :doc:`round` filter). - -* ``*``: Multiplies the left operand with the right one. ``{{ 2 * 2 }}`` would - return ``4``. - -* ``**``: Raises the left operand to the power of the right operand. ``{{ 2 ** - 3 }}`` would return ``8``. - -.. _template_logic: - -Logic -~~~~~ - -You can combine multiple expressions with the following operators: - -* ``and``: Returns true if the left and the right operands are both true. - -* ``or``: Returns true if the left or the right operand is true. - -* ``not``: Negates a statement. - -* ``(expr)``: Groups an expression. - -.. note:: - - Twig also supports bitwise operators (``b-and``, ``b-xor``, and ``b-or``). - -.. note:: - - Operators are case sensitive. - -Comparisons -~~~~~~~~~~~ - -The following comparison operators are supported in any expression: ``==``, -``!=``, ``<``, ``>``, ``>=``, and ``<=``. - -You can also check if a string ``starts with`` or ``ends with`` another -string: - -.. code-block:: twig - - {% if 'Fabien' starts with 'F' %} - {% endif %} - - {% if 'Fabien' ends with 'n' %} - {% endif %} - -.. note:: - - For complex string comparisons, the ``matches`` operator allows you to use - `regular expressions`_: - - .. code-block:: twig - - {% if phone matches '/^[\\d\\.]+$/' %} - {% endif %} - -Containment Operator -~~~~~~~~~~~~~~~~~~~~ - -The ``in`` operator performs containment test. It returns ``true`` if the left -operand is contained in the right: - -.. code-block:: twig - - {# returns true #} - - {{ 1 in [1, 2, 3] }} - - {{ 'cd' in 'abcde' }} - -.. tip:: - - You can use this filter to perform a containment test on strings, arrays, - or objects implementing the ``Traversable`` interface. - -To perform a negative test, use the ``not in`` operator: - -.. code-block:: twig - - {% if 1 not in [1, 2, 3] %} - - {# is equivalent to #} - {% if not (1 in [1, 2, 3]) %} - -Test Operator -~~~~~~~~~~~~~ - -The ``is`` operator performs tests. Tests can be used to test a variable against -a common expression. The right operand is name of the test: - -.. code-block:: twig - - {# find out if a variable is odd #} - - {{ name is odd }} - -Tests can accept arguments too: - -.. code-block:: twig - - {% if post.status is constant('Post::PUBLISHED') %} - -Tests can be negated by using the ``is not`` operator: - -.. code-block:: twig - - {% if post.status is not constant('Post::PUBLISHED') %} - - {# is equivalent to #} - {% if not (post.status is constant('Post::PUBLISHED')) %} - -Go to the :doc:`tests` page to learn more about the built-in -tests. - -Other Operators -~~~~~~~~~~~~~~~ - -The following operators don't fit into any of the other categories: - -* ``|``: Applies a filter. - -* ``..``: Creates a sequence based on the operand before and after the operator - (this is syntactic sugar for the :doc:`range` function): - - .. code-block:: twig - - {{ 1..5 }} - - {# equivalent to #} - {{ range(1, 5) }} - - Note that you must use parentheses when combining it with the filter operator - due to the :ref:`operator precedence rules `: - - .. code-block:: twig - - (1..5)|join(', ') - -* ``~``: Converts all operands into strings and concatenates them. ``{{ "Hello - " ~ name ~ "!" }}`` would return (assuming ``name`` is ``'John'``) ``Hello - John!``. - -* ``.``, ``[]``: Gets an attribute of a variable. - -* ``?:``: The ternary operator: - - .. code-block:: twig - - {{ foo ? 'yes' : 'no' }} - {{ foo ?: 'no' }} is the same as {{ foo ? foo : 'no' }} - {{ foo ? 'yes' }} is the same as {{ foo ? 'yes' : '' }} - -* ``??``: The null-coalescing operator: - - .. code-block:: twig - - {# returns the value of foo if it is defined and not null, 'no' otherwise #} - {{ foo ?? 'no' }} - -.. _templates-string-interpolation: - -String Interpolation -~~~~~~~~~~~~~~~~~~~~ - -String interpolation (``#{expression}``) allows any valid expression to appear -within a *double-quoted string*. The result of evaluating that expression is -inserted into the string: - -.. code-block:: twig - - {{ "foo #{bar} baz" }} - {{ "foo #{1 + 2} baz" }} - -.. _templates-whitespace-control: - -Whitespace Control ------------------- - -.. versionadded:: 2.8 - Tag level Line whitespace control was added in Twig 2.8. - -The first newline after a template tag is removed automatically (like in PHP). -Whitespace is not further modified by the template engine, so each whitespace -(spaces, tabs, newlines etc.) is returned unchanged. - -You can also control whitespace on a per tag level. By using the whitespace -control modifiers on your tags, you can trim leading and or trailing whitespace. - -Twig supports two modifiers: - -* *Whitespace trimming* via the ``-`` modifier: Removes all whitespace - (including newlines); - -* *Line whitespace trimming* via the ``~`` modifier: Removes all whitespace - (excluding newlines). Using this modifier on the right disables the default - removal of the first newline inherited from PHP. - -The modifiers can be used on either side of the tags like in ``{%-`` or ``-%}`` -and they consume all whitespace for that side of the tag. It is possible to use -the modifiers on one side of a tag or on both sides: - -.. code-block:: twig - - {% set value = 'no spaces' %} - {#- No leading/trailing whitespace -#} - {%- if true -%} - {{- value -}} - {%- endif -%} - {# output 'no spaces' #} - -
  • - {{ value }}
  • - {# outputs '
  • \n no spaces
  • ' #} - -
  • - {{- value }}
  • - {# outputs '
  • no spaces
  • ' #} - -
  • - {{~ value }}
  • - {# outputs '
  • \nno spaces
  • ' #} - -.. tip:: - - In addition to the whitespace modifiers, Twig also has a ``spaceless`` filter - that removes whitespace **between HTML tags**: - - .. code-block:: twig - - {% apply spaceless %} -
    - foo bar -
    - {% endapply %} - - {# output will be
    foo bar
    #} - - The ``apply`` tag was introduced in Twig 2.9; use the ``filter`` tag with - previous versions. - -Extensions ----------- - -Twig can be extended. If you want to create your own extensions, read the -:ref:`Creating an Extension ` chapter. - -.. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle -.. _`Jinja syntax plugin`: http://jinja.pocoo.org/docs/integration/#vim -.. _`vim-twig plugin`: https://github.com/lumiliet/vim-twig -.. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig -.. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin -.. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language -.. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode -.. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode -.. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig -.. _`web-mode.el`: http://web-mode.org/ -.. _`regular expressions`: https://secure.php.net/manual/en/pcre.pattern.php -.. _`PHP-twig for atom`: https://github.com/reesef/php-twig -.. _`TwigFiddle`: https://twigfiddle.com/ -.. _`Twig pack`: https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/constant.rst b/upload/system/storage/vendor/twig/twig/doc/tests/constant.rst deleted file mode 100644 index 448c238bcaa..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/constant.rst +++ /dev/null @@ -1,19 +0,0 @@ -``constant`` -============ - -``constant`` checks if a variable has the exact same value as a constant. You -can use either global constants or class constants: - -.. code-block:: twig - - {% if post.status is constant('Post::PUBLISHED') %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} - -You can test constants from object instances as well: - -.. code-block:: twig - - {% if post.status is constant('PUBLISHED', post) %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/defined.rst b/upload/system/storage/vendor/twig/twig/doc/tests/defined.rst deleted file mode 100644 index 234a28988a0..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/defined.rst +++ /dev/null @@ -1,30 +0,0 @@ -``defined`` -=========== - -``defined`` checks if a variable is defined in the current context. This is very -useful if you use the ``strict_variables`` option: - -.. code-block:: twig - - {# defined works with variable names #} - {% if foo is defined %} - ... - {% endif %} - - {# and attributes on variables names #} - {% if foo.bar is defined %} - ... - {% endif %} - - {% if foo['bar'] is defined %} - ... - {% endif %} - -When using the ``defined`` test on an expression that uses variables in some -method calls, be sure that they are all defined first: - -.. code-block:: twig - - {% if var is defined and foo.method(var) is defined %} - ... - {% endif %} diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/divisibleby.rst b/upload/system/storage/vendor/twig/twig/doc/tests/divisibleby.rst deleted file mode 100644 index 8032d349aba..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/divisibleby.rst +++ /dev/null @@ -1,10 +0,0 @@ -``divisible by`` -================ - -``divisible by`` checks if a variable is divisible by a number: - -.. code-block:: twig - - {% if loop.index is divisible by(3) %} - ... - {% endif %} diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/empty.rst b/upload/system/storage/vendor/twig/twig/doc/tests/empty.rst deleted file mode 100644 index 2cd28069bb7..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/empty.rst +++ /dev/null @@ -1,22 +0,0 @@ -``empty`` -========= - -.. versionadded:: 2.3 - - Support for the ``__toString()`` magic method has been added in Twig 2.3. - -``empty`` checks if a variable is an empty string, an empty array, an empty -hash, exactly ``false``, or exactly ``null``. - -For objects that implement the ``Countable`` interface, ``empty`` will check the -return value of the ``count()`` method. - -For objects that implement the ``__toString()`` magic method (and not ``Countable``), -it will check if an empty string is returned. - -.. code-block:: twig - - {% if foo is empty %} - ... - {% endif %} - diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/even.rst b/upload/system/storage/vendor/twig/twig/doc/tests/even.rst deleted file mode 100644 index 5d9c87694a1..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/even.rst +++ /dev/null @@ -1,10 +0,0 @@ -``even`` -======== - -``even`` returns ``true`` if the given number is even: - -.. code-block:: twig - - {{ var is even }} - -.. seealso:: :doc:`odd<../tests/odd>` diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/index.rst b/upload/system/storage/vendor/twig/twig/doc/tests/index.rst deleted file mode 100644 index c63208ee74d..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -Tests -===== - -.. toctree:: - :maxdepth: 1 - - constant - defined - divisibleby - empty - even - iterable - null - odd - sameas diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/iterable.rst b/upload/system/storage/vendor/twig/twig/doc/tests/iterable.rst deleted file mode 100644 index 4ebfe9d8a50..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/iterable.rst +++ /dev/null @@ -1,16 +0,0 @@ -``iterable`` -============ - -``iterable`` checks if a variable is an array or a traversable object: - -.. code-block:: twig - - {# evaluates to true if the foo variable is iterable #} - {% if users is iterable %} - {% for user in users %} - Hello {{ user }}! - {% endfor %} - {% else %} - {# users is probably a string #} - Hello {{ users }}! - {% endif %} diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/null.rst b/upload/system/storage/vendor/twig/twig/doc/tests/null.rst deleted file mode 100644 index 9ed93f6bb29..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/null.rst +++ /dev/null @@ -1,12 +0,0 @@ -``null`` -======== - -``null`` returns ``true`` if the variable is ``null``: - -.. code-block:: twig - - {{ var is null }} - -.. note:: - - ``none`` is an alias for ``null``. diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/odd.rst b/upload/system/storage/vendor/twig/twig/doc/tests/odd.rst deleted file mode 100644 index 0546f83c5a6..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/odd.rst +++ /dev/null @@ -1,10 +0,0 @@ -``odd`` -======= - -``odd`` returns ``true`` if the given number is odd: - -.. code-block:: twig - - {{ var is odd }} - -.. seealso:: :doc:`even<../tests/even>` diff --git a/upload/system/storage/vendor/twig/twig/doc/tests/sameas.rst b/upload/system/storage/vendor/twig/twig/doc/tests/sameas.rst deleted file mode 100644 index c09297114bb..00000000000 --- a/upload/system/storage/vendor/twig/twig/doc/tests/sameas.rst +++ /dev/null @@ -1,11 +0,0 @@ -``same as`` -=========== - -``same as`` checks if a variable is the same as another variable. -This is equivalent to ``===`` in PHP: - -.. code-block:: twig - - {% if foo.attribute is same as(false) %} - the foo attribute really is the 'false' PHP value - {% endif %} diff --git a/upload/system/storage/vendor/twig/twig/drupal_test.sh b/upload/system/storage/vendor/twig/twig/drupal_test.sh deleted file mode 100644 index a25d886f8fd..00000000000 --- a/upload/system/storage/vendor/twig/twig/drupal_test.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -set -x -set -e - -REPO=`pwd` -cd /tmp -rm -rf drupal-twig-test -composer create-project --no-interaction drupal/recommended-project:9.1.x-dev drupal-twig-test -cd drupal-twig-test -(cd vendor/twig && rm -rf twig && ln -sf $REPO twig) -php ./web/core/scripts/drupal install --no-interaction demo_umami > output -perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output -source output -#echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php - -wget https://get.symfony.com/cli/installer -O - | bash -export PATH="$HOME/.symfony/bin:$PATH" -symfony server:start -d --no-tls - -curl -OLsS https://get.blackfire.io/blackfire-player.phar -chmod +x blackfire-player.phar -cat > drupal-tests.bkf <directory.$hash[0].$hash[1].'/'.$hash.'.php'; } @@ -67,7 +67,7 @@ public function write($key, $content) if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { // Compile cached file into bytecode cache - 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($key, true); } elseif (\function_exists('apc_compile_file')) { apc_compile_file($key); diff --git a/upload/system/storage/vendor/twig/twig/src/Compiler.php b/upload/system/storage/vendor/twig/twig/src/Compiler.php index 56933e20380..8727991d1b7 100644 --- a/upload/system/storage/vendor/twig/twig/src/Compiler.php +++ b/upload/system/storage/vendor/twig/twig/src/Compiler.php @@ -141,14 +141,14 @@ public function string($value) public function repr($value) { if (\is_int($value) || \is_float($value)) { - if (false !== $locale = setlocale(LC_NUMERIC, '0')) { - setlocale(LC_NUMERIC, 'C'); + if (false !== $locale = setlocale(\LC_NUMERIC, '0')) { + setlocale(\LC_NUMERIC, 'C'); } $this->raw(var_export($value, true)); if (false !== $locale) { - setlocale(LC_NUMERIC, $locale); + setlocale(\LC_NUMERIC, $locale); } } elseif (null === $value) { $this->raw('null'); @@ -238,7 +238,7 @@ public function outdent($step = 1) public function getVarName() { - return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++)); + return sprintf('__internal_compile_%d', $this->varNameSalt++); } } diff --git a/upload/system/storage/vendor/twig/twig/src/Environment.php b/upload/system/storage/vendor/twig/twig/src/Environment.php index fab6c789802..8e62525774a 100644 --- a/upload/system/storage/vendor/twig/twig/src/Environment.php +++ b/upload/system/storage/vendor/twig/twig/src/Environment.php @@ -38,12 +38,12 @@ */ class Environment { - const VERSION = '2.13.0'; - const VERSION_ID = 21300; - const MAJOR_VERSION = 2; - const MINOR_VERSION = 13; - const RELEASE_VERSION = 0; - const EXTRA_VERSION = ''; + public const VERSION = '2.14.11'; + public const VERSION_ID = 21411; + public const MAJOR_VERSION = 2; + public const MINOR_VERSION = 14; + public const RELEASE_VERSION = 11; + public const EXTRA_VERSION = ''; private $charset; private $loader; @@ -118,7 +118,7 @@ public function __construct(LoaderInterface $loader, $options = []) $this->setCharset($options['charset']); $this->baseTemplateClass = '\\'.ltrim($options['base_template_class'], '\\'); if ('\\'.Template::class !== $this->baseTemplateClass && '\Twig_Template' !== $this->baseTemplateClass) { - @trigger_error('The "base_template_class" option on '.__CLASS__.' is deprecated since Twig 2.7.0.', E_USER_DEPRECATED); + @trigger_error('The "base_template_class" option on '.__CLASS__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); } $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; $this->strictVariables = (bool) $options['strict_variables']; @@ -138,7 +138,7 @@ public function __construct(LoaderInterface $loader, $options = []) public function getBaseTemplateClass() { if (1 > \func_num_args() || \func_get_arg(0)) { - @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', E_USER_DEPRECATED); + @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); } return $this->baseTemplateClass; @@ -151,7 +151,7 @@ public function getBaseTemplateClass() */ public function setBaseTemplateClass($class) { - @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', E_USER_DEPRECATED); + @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); $this->baseTemplateClass = $class; $this->updateOptionsHash(); @@ -271,7 +271,7 @@ public function setCache($cache) } elseif ($cache instanceof CacheInterface) { $this->originalCache = $this->cache = $cache; } else { - throw new \LogicException(sprintf('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.')); + throw new \LogicException('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.'); } } @@ -298,7 +298,7 @@ public function getTemplateClass($name, $index = null) { $key = $this->getLoader()->getCacheKey($name).$this->optionsHash; - return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '___'.$index); + return $this->templateClassPrefix.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $key).(null === $index ? '' : '___'.$index); } /** @@ -351,7 +351,7 @@ public function load($name) } if ($name instanceof Template) { - @trigger_error('Passing a \Twig\Template instance to '.__METHOD__.' is deprecated since Twig 2.7.0, use \Twig\TemplateWrapper instead.', E_USER_DEPRECATED); + @trigger_error('Passing a \Twig\Template instance to '.__METHOD__.' is deprecated since Twig 2.7.0, use \Twig\TemplateWrapper instead.', \E_USER_DEPRECATED); return new TemplateWrapper($this, $name); } @@ -445,7 +445,7 @@ public function loadClass($cls, $name, $index = null) */ public function createTemplate($template, string $name = null) { - $hash = hash('sha256', $template, false); + $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $template, false); if (null !== $name) { $name = sprintf('%s (string template %s)', $name, $hash); } else { @@ -501,6 +501,7 @@ public function resolveTemplate($names) $names = [$names]; } + $count = \count($names); foreach ($names as $name) { if ($name instanceof Template) { return $name; @@ -509,13 +510,11 @@ public function resolveTemplate($names) return $name; } - try { - return $this->loadTemplate($name); - } catch (LoaderError $e) { - if (1 === \count($names)) { - throw $e; - } + if (1 !== $count && !$this->getLoader()->exists($name)) { + continue; } + + return $this->loadTemplate($name); } throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); @@ -623,7 +622,7 @@ public function getLoader() */ public function setCharset($charset) { - if ('UTF8' === $charset = strtoupper($charset)) { + if ('UTF8' === $charset = null === $charset ? null : strtoupper($charset)) { // iconv on Windows requires "UTF-8" instead of "UTF8" $charset = 'UTF-8'; } @@ -982,8 +981,8 @@ private function updateOptionsHash() { $this->optionsHash = implode(':', [ $this->extensionSet->getSignature(), - PHP_MAJOR_VERSION, - PHP_MINOR_VERSION, + \PHP_MAJOR_VERSION, + \PHP_MINOR_VERSION, self::VERSION, (int) $this->debug, $this->baseTemplateClass, diff --git a/upload/system/storage/vendor/twig/twig/src/Error/Error.php b/upload/system/storage/vendor/twig/twig/src/Error/Error.php index a64cbcbc065..13f6f745ce5 100644 --- a/upload/system/storage/vendor/twig/twig/src/Error/Error.php +++ b/upload/system/storage/vendor/twig/twig/src/Error/Error.php @@ -62,7 +62,7 @@ public function __construct(string $message, int $lineno = -1, $source = null, \ if (null === $source) { $name = null; } elseif (!$source instanceof Source && !$source instanceof \Twig_Source) { - @trigger_error(sprintf('Passing a string as a source to %s is deprecated since Twig 2.6.1; pass a Twig\Source instance instead.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing a string as a source to %s is deprecated since Twig 2.6.1; pass a Twig\Source instance instead.', __CLASS__), \E_USER_DEPRECATED); $name = $source; } else { $name = $source->getName(); @@ -196,11 +196,11 @@ private function guessTemplateInfo() $template = null; $templateClass = null; - $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); + $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT); foreach ($backtrace as $trace) { - if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig_Template' !== \get_class($trace['object'])) { + if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig\Template' !== \get_class($trace['object'])) { $currentClass = \get_class($trace['object']); - $isEmbedContainer = 0 === strpos($templateClass, $currentClass); + $isEmbedContainer = null === $templateClass ? false : 0 === strpos($templateClass, $currentClass); if (null === $this->name || ($this->name == $trace['object']->getTemplateName() && !$isEmbedContainer)) { $template = $trace['object']; $templateClass = \get_class($trace['object']); diff --git a/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php b/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php index e6a2073c526..1d9c8768738 100644 --- a/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php +++ b/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php @@ -45,8 +45,8 @@ */ class ExpressionParser { - const OPERATOR_LEFT = 1; - const OPERATOR_RIGHT = 2; + public const OPERATOR_LEFT = 1; + public const OPERATOR_RIGHT = 2; private $parser; private $env; @@ -366,7 +366,16 @@ public function parseHashExpression() // * a string -- 'a' // * a name, which is equivalent to a string -- a // * an expression, which must be enclosed in parentheses -- (1 + 2) - if (($token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) || ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) || $token = $stream->nextIf(/* Token::NUMBER_TYPE */ 6)) { + if ($token = $stream->nextIf(/* Token::NAME_TYPE */ 5)) { + $key = new ConstantExpression($token->getValue(), $token->getLine()); + + // {a} is a shortcut for {a:a} + if ($stream->test(Token::PUNCTUATION_TYPE, [',', '}'])) { + $value = new NameExpression($key->getAttribute('value'), $key->getTemplateLine()); + $node->addElement($value, $key); + continue; + } + } elseif (($token = $stream->nextIf(/* Token::STRING_TYPE */ 7)) || $token = $stream->nextIf(/* Token::NUMBER_TYPE */ 6)) { $key = new ConstantExpression($token->getValue(), $token->getLine()); } elseif ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { $key = $this->parseExpression(); @@ -584,6 +593,11 @@ public function parseArguments($namedArguments = false, $definition = false, $al while (!$stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) { if (!empty($args)) { $stream->expect(/* Token::PUNCTUATION_TYPE */ 9, ',', 'Arguments must be separated by a comma'); + + // if the comma above was a trailing comma, early exit the argument parse loop + if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, ')')) { + break; + } } if ($definition) { @@ -604,7 +618,7 @@ public function parseArguments($namedArguments = false, $definition = false, $al $value = $this->parsePrimaryExpression(); if (!$this->checkConstantExpression($value)) { - throw new SyntaxError(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $stream->getSourceContext()); + throw new SyntaxError('A default value for an argument must be a constant (a boolean, a string, a number, or an array).', $token->getLine(), $stream->getSourceContext()); } } else { $value = $this->parseExpression(0, $allowArrow); @@ -683,6 +697,8 @@ private function parseTestExpression(Node $node): TestExpression $arguments = null; if ($stream->test(/* Token::PUNCTUATION_TYPE */ 9, '(')) { $arguments = $this->parseArguments(true); + } elseif ($test->hasOneMandatoryArgument()) { + $arguments = new Node([0 => $this->parsePrimaryExpression()]); } if ('defined' === $name && $node instanceof NameExpression && null !== $alias = $this->parser->getImportedSymbol('function', $node->getAttribute('name'))) { @@ -734,7 +750,7 @@ private function getTestNodeClass(TwigTest $test): string $src = $stream->getSourceContext(); $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $stream->getCurrent()->getLine()); - @trigger_error($message, E_USER_DEPRECATED); + @trigger_error($message, \E_USER_DEPRECATED); } return $test->getNodeClass(); @@ -760,7 +776,7 @@ private function getFunctionNodeClass(string $name, int $line): string $src = $this->parser->getStream()->getSourceContext(); $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line); - @trigger_error($message, E_USER_DEPRECATED); + @trigger_error($message, \E_USER_DEPRECATED); } return $function->getNodeClass(); @@ -786,7 +802,7 @@ private function getFilterNodeClass(string $name, int $line): string $src = $this->parser->getStream()->getSourceContext(); $message .= sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line); - @trigger_error($message, E_USER_DEPRECATED); + @trigger_error($message, \E_USER_DEPRECATED); } return $filter->getNodeClass(); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php index d3e49029301..6ac36108137 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php @@ -89,7 +89,7 @@ final class CoreExtension extends AbstractExtension */ public function setEscaper($strategy, callable $callable) { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::setEscaper" instead.', __METHOD__, EscaperExtension::class), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::setEscaper" instead.', __METHOD__, EscaperExtension::class), \E_USER_DEPRECATED); $this->escapers[$strategy] = $callable; } @@ -103,8 +103,8 @@ public function setEscaper($strategy, callable $callable) */ public function getEscapers(/* $triggerDeprecation = true */) { - if (0 === \func_num_args() || func_get_arg(0)) { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::getEscapers" instead.', __METHOD__, EscaperExtension::class), E_USER_DEPRECATED); + if (0 === \func_num_args() || \func_get_arg(0)) { + @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::getEscapers" instead.', __METHOD__, EscaperExtension::class), \E_USER_DEPRECATED); } return $this->escapers; @@ -213,7 +213,7 @@ public function getFilters() // formatting filters new TwigFilter('date', 'twig_date_format_filter', ['needs_environment' => true]), new TwigFilter('date_modify', 'twig_date_modify_filter', ['needs_environment' => true]), - new TwigFilter('format', 'sprintf'), + new TwigFilter('format', 'twig_sprintf'), new TwigFilter('replace', 'twig_replace_filter'), new TwigFilter('number_format', 'twig_number_format_filter', ['needs_environment' => true]), new TwigFilter('abs', 'abs'), @@ -229,21 +229,21 @@ public function getFilters() new TwigFilter('capitalize', 'twig_capitalize_string_filter', ['needs_environment' => true]), new TwigFilter('upper', 'twig_upper_filter', ['needs_environment' => true]), new TwigFilter('lower', 'twig_lower_filter', ['needs_environment' => true]), - new TwigFilter('striptags', 'strip_tags'), + new TwigFilter('striptags', 'twig_striptags'), new TwigFilter('trim', 'twig_trim_filter'), - new TwigFilter('nl2br', 'nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), + new TwigFilter('nl2br', 'twig_nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), new TwigFilter('spaceless', 'twig_spaceless', ['is_safe' => ['html']]), // array helpers new TwigFilter('join', 'twig_join_filter'), new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]), - new TwigFilter('sort', 'twig_sort_filter'), + new TwigFilter('sort', 'twig_sort_filter', ['needs_environment' => true]), new TwigFilter('merge', 'twig_array_merge'), new TwigFilter('batch', 'twig_array_batch'), new TwigFilter('column', 'twig_array_column'), - new TwigFilter('filter', 'twig_array_filter'), - new TwigFilter('map', 'twig_array_map'), - new TwigFilter('reduce', 'twig_array_reduce'), + new TwigFilter('filter', 'twig_array_filter', ['needs_environment' => true]), + new TwigFilter('map', 'twig_array_map', ['needs_environment' => true]), + new TwigFilter('reduce', 'twig_array_reduce', ['needs_environment' => true]), // string/array filters new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]), @@ -279,10 +279,10 @@ public function getTests() new TwigTest('even', null, ['node_class' => EvenTest::class]), new TwigTest('odd', null, ['node_class' => OddTest::class]), new TwigTest('defined', null, ['node_class' => DefinedTest::class]), - new TwigTest('same as', null, ['node_class' => SameasTest::class]), + new TwigTest('same as', null, ['node_class' => SameasTest::class, 'one_mandatory_argument' => true]), new TwigTest('none', null, ['node_class' => NullTest::class]), new TwigTest('null', null, ['node_class' => NullTest::class]), - new TwigTest('divisible by', null, ['node_class' => DivisiblebyTest::class]), + new TwigTest('divisible by', null, ['node_class' => DivisiblebyTest::class, 'one_mandatory_argument' => true]), new TwigTest('constant', null, ['node_class' => ConstantTest::class]), new TwigTest('empty', 'twig_test_empty'), new TwigTest('iterable', 'twig_test_iterable'), @@ -349,8 +349,9 @@ class_alias('Twig\Extension\CoreExtension', 'Twig_Extension_Core'); use Twig\Markup; use Twig\Source; use Twig\Template; + use Twig\TemplateWrapper; - /** +/** * Cycles over a value. * * @param \ArrayAccess|array $values @@ -383,7 +384,7 @@ function twig_cycle($values, $position) function twig_random(Environment $env, $values = null, $max = null) { if (null === $values) { - return null === $max ? mt_rand() : mt_rand(0, $max); + return null === $max ? mt_rand() : mt_rand(0, (int) $max); } if (\is_int($values) || \is_float($values)) { @@ -400,7 +401,7 @@ function twig_random(Environment $env, $values = null, $max = null) $max = $max; } - return mt_rand($min, $max); + return mt_rand((int) $min, (int) $max); } if (\is_string($values)) { @@ -480,6 +481,19 @@ function twig_date_modify_filter(Environment $env, $date, $modifier) return $date->modify($modifier); } +/** + * Returns a formatted string. + * + * @param string|null $format + * @param ...$values + * + * @return string + */ +function twig_sprintf($format, ...$values) +{ + return sprintf($format ?? '', ...$values); +} + /** * Converts an input to a \DateTime instance. * @@ -518,6 +532,10 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null) } if (null === $date || 'now' === $date) { + if (null === $date) { + $date = 'now'; + } + return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension(CoreExtension::class)->getTimezone()); } @@ -538,7 +556,7 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null) /** * Replaces strings within a string. * - * @param string $str String to replace in + * @param string|null $str String to replace in * @param array|\Traversable $from Replace values * * @return string @@ -549,20 +567,22 @@ function twig_replace_filter($str, $from) throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from))); } - return strtr($str, twig_to_array($from)); + return strtr($str ?? '', twig_to_array($from)); } /** * Rounds a number. * - * @param int|float $value The value to round - * @param int|float $precision The rounding precision - * @param string $method The method to use for rounding + * @param int|float|string|null $value The value to round + * @param int|float $precision The rounding precision + * @param string $method The method to use for rounding * * @return int|float The rounded number */ function twig_round($value, $precision = 0, $method = 'common') { + $value = (float) $value; + if ('common' === $method) { return round($value, $precision); } @@ -571,14 +591,14 @@ function twig_round($value, $precision = 0, $method = 'common') throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.'); } - return $method($value * pow(10, $precision)) / pow(10, $precision); + return $method($value * 10 ** $precision) / 10 ** $precision; } /** * Number format filter. * * All of the formatting options can be left null, in that case the defaults will - * be used. Supplying any of the parameters will override the defaults set in the + * be used. Supplying any of the parameters will override the defaults set in the * environment object. * * @param mixed $number A float/int/string of the number to format @@ -609,17 +629,17 @@ function twig_number_format_filter(Environment $env, $number, $decimal = null, $ /** * URL encodes (RFC 3986) a string as a path segment or an array as a query string. * - * @param string|array $url A URL or an array of query parameters + * @param string|array|null $url A URL or an array of query parameters * * @return string The URL encoded value */ function twig_urlencode_filter($url) { if (\is_array($url)) { - return http_build_query($url, '', '&', PHP_QUERY_RFC3986); + return http_build_query($url, '', '&', \PHP_QUERY_RFC3986); } - return rawurlencode($url); + return rawurlencode($url ?? ''); } /** @@ -681,9 +701,7 @@ function twig_slice(Environment $env, $item, $start, $length = null, $preserveKe return \array_slice($item, $start, $length, $preserveKeys); } - $item = (string) $item; - - return (string) mb_substr($item, $start, $length, $env->getCharset()); + return (string) mb_substr((string) $item, $start, $length, $env->getCharset()); } /** @@ -772,14 +790,16 @@ function twig_join_filter($value, $glue = '', $and = null) * {{ "aabbcc"|split('', 2) }} * {# returns [aa, bb, cc] #} * - * @param string $value A string - * @param string $delimiter The delimiter - * @param int $limit The limit + * @param string|null $value A string + * @param string $delimiter The delimiter + * @param int $limit The limit * * @return array The split string as an array */ function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) { + $value = $value ?? ''; + if (\strlen($delimiter) > 0) { return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); } @@ -865,8 +885,8 @@ function twig_get_array_keys_filter($array) /** * Reverses a variable. * - * @param array|\Traversable|string $item An array, a \Traversable instance, or a string - * @param bool $preserveKeys Whether to preserve key or not + * @param array|\Traversable|string|null $item An array, a \Traversable instance, or a string + * @param bool $preserveKeys Whether to preserve key or not * * @return mixed The reversed input */ @@ -885,10 +905,10 @@ function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) $charset = $env->getCharset(); if ('UTF-8' !== $charset) { - $item = twig_convert_encoding($string, 'UTF-8', $charset); + $string = twig_convert_encoding($string, 'UTF-8', $charset); } - preg_match_all('/./us', $item, $matches); + preg_match_all('/./us', $string, $matches); $string = implode('', array_reverse($matches[0])); @@ -906,7 +926,7 @@ function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) * * @return array */ -function twig_sort_filter($array, $arrow = null) +function twig_sort_filter(Environment $env, $array, $arrow = null) { if ($array instanceof \Traversable) { $array = iterator_to_array($array); @@ -915,6 +935,8 @@ function twig_sort_filter($array, $arrow = null) } if (null !== $arrow) { + twig_check_arrow_in_sandbox($env, $arrow, 'sort', 'filter'); + uasort($array, $arrow); } else { asort($array); @@ -963,6 +985,10 @@ function twig_in_filter($value, $compare) /** * Returns a trimmed string. * + * @param string|null $string + * @param string|null $characterMask + * @param string $side + * * @return string * * @throws RuntimeError When an invalid trimming side is used (not a string or not 'left', 'right', or 'both') @@ -975,33 +1001,54 @@ function twig_trim_filter($string, $characterMask = null, $side = 'both') switch ($side) { case 'both': - return trim($string, $characterMask); + return trim($string ?? '', $characterMask); case 'left': - return ltrim($string, $characterMask); + return ltrim($string ?? '', $characterMask); case 'right': - return rtrim($string, $characterMask); + return rtrim($string ?? '', $characterMask); default: throw new RuntimeError('Trimming side must be "left", "right" or "both".'); } } +/** + * Inserts HTML line breaks before all newlines in a string. + * + * @param string|null $string + * + * @return string + */ +function twig_nl2br($string) +{ + return nl2br($string ?? ''); +} + /** * Removes whitespaces between HTML tags. * + * @param string|null $string + * * @return string */ function twig_spaceless($content) { - return trim(preg_replace('/>\s+<', $content)); + return trim(preg_replace('/>\s+<', $content ?? '')); } +/** + * @param string|null $string + * @param string $to + * @param string $from + * + * @return string + */ function twig_convert_encoding($string, $to, $from) { if (!\function_exists('iconv')) { throw new RuntimeError('Unable to convert encoding: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.'); } - return iconv($from, $to, $string); + return iconv($from, $to, $string ?? ''); } /** @@ -1039,47 +1086,60 @@ function twig_length_filter(Environment $env, $thing) /** * Converts a string to uppercase. * - * @param string $string A string + * @param string|null $string A string * * @return string The uppercased string */ function twig_upper_filter(Environment $env, $string) { - return mb_strtoupper($string, $env->getCharset()); + return mb_strtoupper($string ?? '', $env->getCharset()); } /** * Converts a string to lowercase. * - * @param string $string A string + * @param string|null $string A string * * @return string The lowercased string */ function twig_lower_filter(Environment $env, $string) { - return mb_strtolower($string, $env->getCharset()); + return mb_strtolower($string ?? '', $env->getCharset()); +} + +/** + * Strips HTML and PHP tags from a string. + * + * @param string|null $string + * @param string[]|string|null $string + * + * @return string + */ +function twig_striptags($string, $allowable_tags = null) +{ + return strip_tags($string ?? '', $allowable_tags); } /** * Returns a titlecased string. * - * @param string $string A string + * @param string|null $string A string * * @return string The titlecased string */ function twig_title_string_filter(Environment $env, $string) { if (null !== $charset = $env->getCharset()) { - return mb_convert_case($string, MB_CASE_TITLE, $charset); + return mb_convert_case($string ?? '', \MB_CASE_TITLE, $charset); } - return ucwords(strtolower($string)); + return ucwords(strtolower($string ?? '')); } /** * Returns a capitalized string. * - * @param string $string A string + * @param string|null $string A string * * @return string The capitalized string */ @@ -1087,7 +1147,7 @@ function twig_capitalize_string_filter(Environment $env, $string) { $charset = $env->getCharset(); - return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).mb_strtolower(mb_substr($string, 1, null, $charset), $charset); + return mb_strtoupper(mb_substr($string ?? '', 0, 1, $charset), $charset).mb_strtolower(mb_substr($string ?? '', 1, null, $charset), $charset); } /** @@ -1208,6 +1268,13 @@ function twig_include(Environment $env, $context, $template, $variables = [], $w if (!$alreadySandboxed = $sandbox->isSandboxed()) { $sandbox->enableSandbox(); } + + foreach ((\is_array($template) ? $template : [$template]) as $name) { + // if a Template instance is passed, it might have been instantiated outside of a sandbox, check security + if ($name instanceof TemplateWrapper || $name instanceof Template) { + $name->unwrap()->checkSecurity(); + } + } } try { @@ -1535,12 +1602,14 @@ function twig_array_column($array, $name, $index = null): array return array_column($array, $name, $index); } -function twig_array_filter($array, $arrow) +function twig_array_filter(Environment $env, $array, $arrow) { if (!twig_test_iterable($array)) { throw new RuntimeError(sprintf('The "filter" filter expects an array or "Traversable", got "%s".', \is_object($array) ? \get_class($array) : \gettype($array))); } + twig_check_arrow_in_sandbox($env, $arrow, 'filter', 'filter'); + if (\is_array($array)) { return array_filter($array, $arrow, \ARRAY_FILTER_USE_BOTH); } @@ -1549,8 +1618,10 @@ function twig_array_filter($array, $arrow) return new \CallbackFilterIterator(new \IteratorIterator($array), $arrow); } -function twig_array_map($array, $arrow) +function twig_array_map(Environment $env, $array, $arrow) { + twig_check_arrow_in_sandbox($env, $arrow, 'map', 'filter'); + $r = []; foreach ($array as $k => $v) { $r[$k] = $arrow($v, $k); @@ -1559,12 +1630,25 @@ function twig_array_map($array, $arrow) return $r; } -function twig_array_reduce($array, $arrow, $initial = null) +function twig_array_reduce(Environment $env, $array, $arrow, $initial = null) { + twig_check_arrow_in_sandbox($env, $arrow, 'reduce', 'filter'); + if (!\is_array($array)) { + if (!$array instanceof \Traversable) { + throw new RuntimeError(sprintf('The "reduce" filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($array))); + } + $array = iterator_to_array($array); } return array_reduce($array, $arrow, $initial); } + +function twig_check_arrow_in_sandbox(Environment $env, $arrow, $thing, $type) +{ + if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) { + throw new RuntimeError(sprintf('The callable passed to the "%s" %s must be a Closure in sandbox mode.', $thing, $type)); + } +} } diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php index b49c08b9259..eebdc3a4e93 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php @@ -211,7 +211,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char switch ($strategy) { case 'html': - // see https://secure.php.net/htmlspecialchars + // see https://www.php.net/htmlspecialchars // Using a static variable to avoid initializing the array // each time the function is called. Moving the declaration on the @@ -234,18 +234,18 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char ]; if (isset($htmlspecialcharsCharsets[$charset])) { - return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset); } if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { // cache the lowercase variant for future iterations $htmlspecialcharsCharsets[$charset] = true; - return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, $charset); } $string = twig_convert_encoding($string, 'UTF-8', $charset); - $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + $string = htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8'); return iconv('UTF-8', $charset, $string); @@ -282,15 +282,18 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char return $shortMap[$char]; } - // \uHHHH - $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); - $char = strtoupper(bin2hex($char)); - - if (4 >= \strlen($char)) { - return sprintf('\u%04s', $char); + $codepoint = mb_ord($char, 'UTF-8'); + if (0x10000 > $codepoint) { + return sprintf('\u%04X', $codepoint); } - return sprintf('\u%04s\u%04s', substr($char, 0, -4), substr($char, -4)); + // Split characters outside the BMP into surrogate pairs + // https://tools.ietf.org/html/rfc2781.html#section-2.1 + $u = $codepoint - 0x10000; + $high = 0xD800 | ($u >> 10); + $low = 0xDC00 | ($u & 0x3FF); + + return sprintf('\u%04X\u%04X', $high, $low); }, $string); if ('UTF-8' !== $charset) { diff --git a/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php b/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php index bc95f33435c..d79106c3148 100644 --- a/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php +++ b/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php @@ -41,7 +41,7 @@ public static function guess($name) $name = substr($name, 0, -5); } - $extension = pathinfo($name, PATHINFO_EXTENSION); + $extension = pathinfo($name, \PATHINFO_EXTENSION); switch ($extension) { case 'js': diff --git a/upload/system/storage/vendor/twig/twig/src/Lexer.php b/upload/system/storage/vendor/twig/twig/src/Lexer.php index 16068b1b351..edde9a7a0cb 100644 --- a/upload/system/storage/vendor/twig/twig/src/Lexer.php +++ b/upload/system/storage/vendor/twig/twig/src/Lexer.php @@ -37,18 +37,18 @@ class Lexer private $positions; private $currentVarBlockLine; - const STATE_DATA = 0; - const STATE_BLOCK = 1; - const STATE_VAR = 2; - const STATE_STRING = 3; - const STATE_INTERPOLATION = 4; - - const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; - const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A'; - const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; - const REGEX_DQ_STRING_DELIM = '/"/A'; - const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; - const PUNCTUATION = '()[]{}?:.,|'; + public const STATE_DATA = 0; + public const STATE_BLOCK = 1; + public const STATE_VAR = 2; + public const STATE_STRING = 3; + public const STATE_INTERPOLATION = 4; + + public const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; + public const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A'; + public const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; + public const REGEX_DQ_STRING_DELIM = '/"/A'; + public const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; + public const PUNCTUATION = '()[]{}?:.,|'; public function __construct(Environment $env, array $options = []) { @@ -112,7 +112,7 @@ public function __construct(Environment $env, array $options = []) // #} 'lex_comment' => '{ (?:'. - preg_quote($this->options['whitespace_trim']).preg_quote($this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n? + preg_quote($this->options['whitespace_trim'].$this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n? '|'. preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]* '|'. @@ -167,7 +167,7 @@ public function tokenize(Source $source) $this->position = -1; // find all token starts in one go - preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE); + preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, \PREG_OFFSET_CAPTURE); $this->positions = $matches; while ($this->cursor < $this->end) { @@ -322,7 +322,7 @@ private function lexExpression() // numbers elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) { $number = (float) $match[0]; // floats - if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) { + if (ctype_digit($match[0]) && $number <= \PHP_INT_MAX) { $number = (int) $match[0]; // integers lower than the maximum } $this->pushToken(/* Token::NUMBER_TYPE */ 6, $number); @@ -368,7 +368,7 @@ private function lexExpression() private function lexRawData() { - if (!preg_match($this->regexes['lex_raw_data'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + if (!preg_match($this->regexes['lex_raw_data'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { throw new SyntaxError('Unexpected end of file: Unclosed "verbatim" block.', $this->lineno, $this->source); } @@ -392,7 +392,7 @@ private function lexRawData() private function lexComment() { - if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + if (!preg_match($this->regexes['lex_comment'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source); } @@ -466,16 +466,15 @@ private function getOperatorRegex() $regex = []; foreach ($operators as $operator => $length) { // an operator that ends with a character must be followed by - // a whitespace or a parenthesis + // a whitespace, a parenthesis, an opening map [ or sequence { $r = preg_quote($operator, '/'); if (ctype_alpha($operator[$length - 1])) { - $r .= '(?=[\s()])'; + $r .= '(?=[\s()\[{])'; } - // an operator that begins with a character must have a space before - // or a parenthesis + // an operator that begins with a character must not have a dot or pipe before if (ctype_alpha($operator[0])) { - $r = '(?<=[\s(])'.$r; + $r = '(?rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR; - if (false !== $realPath = realpath($rootPath)) { + if (null !== $rootPath && false !== ($realPath = realpath($rootPath))) { $this->rootPath = $realPath.\DIRECTORY_SEPARATOR; } @@ -252,7 +252,7 @@ protected function findTemplate($name, $throw = true) private function normalizeName($name) { - return preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name)); + return preg_replace('#/{2,}#', '/', str_replace('\\', '/', (string) $name)); } private function parseName($name, $default = self::MAIN_NAMESPACE) @@ -300,7 +300,7 @@ private function isAbsolutePath($file) && ':' === $file[1] && strspn($file, '/\\', 2, 1) ) - || null !== parse_url($file, PHP_URL_SCHEME) + || null !== parse_url($file, \PHP_URL_SCHEME) ; } } diff --git a/upload/system/storage/vendor/twig/twig/src/Markup.php b/upload/system/storage/vendor/twig/twig/src/Markup.php index 43c890b4651..0cc45bef134 100644 --- a/upload/system/storage/vendor/twig/twig/src/Markup.php +++ b/upload/system/storage/vendor/twig/twig/src/Markup.php @@ -32,11 +32,19 @@ public function __toString() return $this->content; } + /** + * @return int + */ + #[\ReturnTypeWillChange] public function count() { return mb_strlen($this->content, $this->charset); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->content; diff --git a/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityCallNode.php b/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityCallNode.php new file mode 100644 index 00000000000..a78a38d80bb --- /dev/null +++ b/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityCallNode.php @@ -0,0 +1,28 @@ + + */ +class CheckSecurityCallNode extends Node +{ + public function compile(Compiler $compiler) + { + $compiler + ->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n") + ->write("\$this->checkSecurity();\n") + ; + } +} diff --git a/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php b/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php index 59857ca5a47..489a3652ddf 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php @@ -45,10 +45,13 @@ public function compile(Compiler $compiler) } $compiler - ->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n") - ->write('$tags = ')->repr(array_filter($tags))->raw(";\n") - ->write('$filters = ')->repr(array_filter($filters))->raw(";\n") - ->write('$functions = ')->repr(array_filter($functions))->raw(";\n\n") + ->write("\n") + ->write("public function checkSecurity()\n") + ->write("{\n") + ->indent() + ->write('static $tags = ')->repr(array_filter($tags))->raw(";\n") + ->write('static $filters = ')->repr(array_filter($filters))->raw(";\n") + ->write('static $functions = ')->repr(array_filter($functions))->raw(";\n\n") ->write("try {\n") ->indent() ->write("\$this->sandbox->checkSecurity(\n") @@ -78,6 +81,8 @@ public function compile(Compiler $compiler) ->write("throw \$e;\n") ->outdent() ->write("}\n\n") + ->outdent() + ->write("}\n") ; } } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php index 0b53f27f59a..7de754a9dfc 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php @@ -153,7 +153,16 @@ protected function getArguments($callable, $arguments) $optionalArguments = []; $pos = 0; foreach ($callableParameters as $callableParameter) { - $names[] = $name = $this->normalizeName($callableParameter->name); + $name = $this->normalizeName($callableParameter->name); + if (\PHP_VERSION_ID >= 80000 && 'range' === $callable) { + if ('start' === $name) { + $name = 'low'; + } elseif ('end' === $name) { + $name = 'high'; + } + } + + $names[] = $name; if (\array_key_exists($name, $parameters)) { if (\array_key_exists($pos, $parameters)) { diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php index 2dc693a9ae6..189e51e761e 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php @@ -28,7 +28,7 @@ public function compile(Compiler $compiler) $compiler ->raw('(') ->subcompile($this->getNode('node')) - ->raw(' % 2 == 1') + ->raw(' % 2 != 0') ->raw(')') ; } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php b/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php index a133720b461..ca4686ce95f 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php @@ -21,7 +21,7 @@ */ class MacroNode extends Node { - const VARARGS_NAME = 'varargs'; + public const VARARGS_NAME = 'varargs'; public function __construct(string $name, Node $body, Node $arguments, int $lineno, string $tag = null) { diff --git a/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php b/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php index 723a4fa8e22..29af67706d9 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php @@ -33,7 +33,7 @@ class ModuleNode extends Node public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) { if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $nodes = [ diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Node.php b/upload/system/storage/vendor/twig/twig/src/Node/Node.php index 62b08d4d458..97447525f71 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Node.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Node.php @@ -158,11 +158,19 @@ public function removeNode($name) unset($this->nodes[$name]); } + /** + * @return int + */ + #[\ReturnTypeWillChange] public function count() { return \count($this->nodes); } + /** + * @return \Traversable + */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->nodes); @@ -175,7 +183,7 @@ public function setTemplateName($name/*, $triggerDeprecation = true */) { $triggerDeprecation = 2 > \func_num_args() || \func_get_arg(1); if ($triggerDeprecation) { - @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use setSourceContext() instead.', E_USER_DEPRECATED); + @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use setSourceContext() instead.', \E_USER_DEPRECATED); } $this->name = $name; diff --git a/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php b/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php index fe59313bf64..9f8ba46cd43 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php @@ -34,12 +34,19 @@ public function compile(Compiler $compiler) ->write("\$this->sandbox->enableSandbox();\n") ->outdent() ->write("}\n") + ->write("try {\n") + ->indent() ->subcompile($this->getNode('body')) + ->outdent() + ->write("} finally {\n") + ->indent() ->write("if (!\$alreadySandboxed) {\n") ->indent() ->write("\$this->sandbox->disableSandbox();\n") ->outdent() ->write("}\n") + ->outdent() + ->write("}\n") ; } } diff --git a/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php b/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php index 625b049af94..12c5a16d602 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php @@ -71,7 +71,7 @@ private function traverseForVisitor(NodeVisitorInterface $visitor, Node $node) } } else { if (false === $m) { - @trigger_error('Returning "false" to remove a Node from NodeVisitorInterface::leaveNode() is deprecated since Twig version 2.9; return "null" instead.', E_USER_DEPRECATED); + @trigger_error('Returning "false" to remove a Node from NodeVisitorInterface::leaveNode() is deprecated since Twig version 2.9; return "null" instead.', \E_USER_DEPRECATED); } $node->removeNode($k); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php index 9f7cae4da61..62f7aafbaee 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php @@ -37,12 +37,12 @@ */ final class OptimizerNodeVisitor extends AbstractNodeVisitor { - const OPTIMIZE_ALL = -1; - const OPTIMIZE_NONE = 0; - const OPTIMIZE_FOR = 2; - const OPTIMIZE_RAW_FILTER = 4; + public const OPTIMIZE_ALL = -1; + public const OPTIMIZE_NONE = 0; + public const OPTIMIZE_FOR = 2; + public const OPTIMIZE_RAW_FILTER = 4; // obsolete, does not do anything - const OPTIMIZE_VAR_ACCESS = 8; + public const OPTIMIZE_VAR_ACCESS = 8; private $loops = []; private $loopsTargets = []; diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php index 3e8d0bca490..a51fa10d69e 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php @@ -12,6 +12,7 @@ namespace Twig\NodeVisitor; use Twig\Environment; +use Twig\Node\CheckSecurityCallNode; use Twig\Node\CheckSecurityNode; use Twig\Node\CheckToStringNode; use Twig\Node\Expression\Binary\ConcatBinary; @@ -100,7 +101,8 @@ protected function doLeaveNode(Node $node, Environment $env) if ($node instanceof ModuleNode) { $this->inAModule = false; - $node->getNode('constructor_end')->setNode('_security_check', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('display_start')])); + $node->setNode('constructor_end', new Node([new CheckSecurityCallNode(), $node->getNode('constructor_end')])); + $node->setNode('class_end', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('class_end')])); } elseif ($this->inAModule) { if ($node instanceof PrintNode || $node instanceof SetNode) { $this->needsToStringWrap = false; diff --git a/upload/system/storage/vendor/twig/twig/src/Parser.php b/upload/system/storage/vendor/twig/twig/src/Parser.php index 8a937e329d1..eb2ee15c4c8 100644 --- a/upload/system/storage/vendor/twig/twig/src/Parser.php +++ b/upload/system/storage/vendor/twig/twig/src/Parser.php @@ -56,7 +56,7 @@ public function __construct(Environment $env) public function getVarName() { - return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->stream->getSourceContext()->getCode().$this->varNameSalt++)); + return sprintf('__internal_parse_%d', $this->varNameSalt++); } public function parse(TokenStream $stream, $test = null, $dropNeedle = false) @@ -250,7 +250,7 @@ public function setMacro($name, MacroNode $node) */ public function isReservedMacroName($name) { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.7 and will be removed in 3.0.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.7 and will be removed in 3.0.', __METHOD__), \E_USER_DEPRECATED); return false; } @@ -360,7 +360,7 @@ private function filterBodyNodes(Node $node, bool $nested = false) // to be removed completely in Twig 3.0 if (!$nested && $node instanceof SpacelessNode) { - @trigger_error(sprintf('Using the spaceless tag at the root level of a child template in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), E_USER_DEPRECATED); + @trigger_error(sprintf('Using the spaceless tag at the root level of a child template in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), \E_USER_DEPRECATED); } // "block" tags that are not captured (see above) are only used for defining @@ -368,7 +368,7 @@ private function filterBodyNodes(Node $node, bool $nested = false) // expected as the definition is not part of the default template code flow. if ($nested && ($node instanceof BlockReferenceNode || $node instanceof \Twig_Node_BlockReference)) { //throw new SyntaxError('A block definition cannot be nested under non-capturing nodes.', $node->getTemplateLine(), $this->stream->getSourceContext()); - @trigger_error(sprintf('Nesting a block definition under a non-capturing node in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), E_USER_DEPRECATED); + @trigger_error(sprintf('Nesting a block definition under a non-capturing node in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), \E_USER_DEPRECATED); return; } diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php index f19f6b78fba..8b7c18adb67 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php @@ -28,10 +28,12 @@ final class ProfilerNodeVisitor extends AbstractNodeVisitor { private $extensionName; + private $varName; public function __construct(string $extensionName) { $this->extensionName = $extensionName; + $this->varName = sprintf('__internal_%s', hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $extensionName)); } protected function doEnterNode(Node $node, Environment $env) @@ -42,33 +44,25 @@ protected function doEnterNode(Node $node, Environment $env) protected function doLeaveNode(Node $node, Environment $env) { if ($node instanceof ModuleNode) { - $varName = $this->getVarName(); - $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $varName), $node->getNode('display_start')])); - $node->setNode('display_end', new Node([new LeaveProfileNode($varName), $node->getNode('display_end')])); + $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $this->varName), $node->getNode('display_start')])); + $node->setNode('display_end', new Node([new LeaveProfileNode($this->varName), $node->getNode('display_end')])); } elseif ($node instanceof BlockNode) { - $varName = $this->getVarName(); $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $varName), + new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $this->varName), $node->getNode('body'), - new LeaveProfileNode($varName), + new LeaveProfileNode($this->varName), ])); } elseif ($node instanceof MacroNode) { - $varName = $this->getVarName(); $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $varName), + new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $this->varName), $node->getNode('body'), - new LeaveProfileNode($varName), + new LeaveProfileNode($this->varName), ])); } return $node; } - private function getVarName(): string - { - return sprintf('__internal_%s', hash('sha256', $this->extensionName)); - } - public function getPriority() { return 0; diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php index a29dafd048f..3a5ff8b50fb 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php @@ -18,10 +18,10 @@ */ class Profile implements \IteratorAggregate, \Serializable { - const ROOT = 'ROOT'; - const BLOCK = 'block'; - const TEMPLATE = 'template'; - const MACRO = 'macro'; + public const ROOT = 'ROOT'; + public const BLOCK = 'block'; + public const TEMPLATE = 'template'; + public const MACRO = 'macro'; private $template; private $name; @@ -33,7 +33,7 @@ class Profile implements \IteratorAggregate, \Serializable public function __construct(string $template = 'main', string $type = self::ROOT, string $name = 'main') { if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->template = $template; @@ -157,17 +157,18 @@ public function reset() $this->enter(); } - public function getIterator() + #[\ReturnTypeWillChange] + public function getIterator(): \Traversable { return new \ArrayIterator($this->profiles); } - public function serialize() + public function serialize(): string { return serialize($this->__serialize()); } - public function unserialize($data) + public function unserialize($data): void { $this->__unserialize(unserialize($data)); } @@ -175,7 +176,7 @@ public function unserialize($data) /** * @internal */ - public function __serialize() + public function __serialize(): array { return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]; } @@ -183,7 +184,7 @@ public function __serialize() /** * @internal */ - public function __unserialize(array $data) + public function __unserialize(array $data): void { list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; } diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php index 767ec5b3dd8..33c84f2231f 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php @@ -25,13 +25,13 @@ class SecurityNotAllowedFilterError extends SecurityError public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->filterName = $functionName; diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php index 5a3013998cc..5151762b567 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php @@ -25,13 +25,13 @@ class SecurityNotAllowedFunctionError extends SecurityError public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->functionName = $functionName; diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php index c8103ea0f16..62c3fddd5f1 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php @@ -26,13 +26,13 @@ class SecurityNotAllowedMethodError extends SecurityError public function __construct(string $message, string $className, string $methodName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->className = $className; diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php index d148f08d2e2..a9e4aff2725 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php @@ -26,13 +26,13 @@ class SecurityNotAllowedPropertyError extends SecurityError public function __construct(string $message, string $className, string $propertyName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->className = $className; diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php index 25f6361131e..0abc49ef312 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php @@ -25,13 +25,13 @@ class SecurityNotAllowedTagError extends SecurityError public function __construct(string $message, string $tagName, int $lineno = -1, string $filename = null, \Exception $previous = null) { if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), E_USER_DEPRECATED); + @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); } parent::__construct($message, $lineno, $filename, $previous); $this->tagName = $tagName; diff --git a/upload/system/storage/vendor/twig/twig/src/Template.php b/upload/system/storage/vendor/twig/twig/src/Template.php index d6190acaee3..76d55cbcb3a 100644 --- a/upload/system/storage/vendor/twig/twig/src/Template.php +++ b/upload/system/storage/vendor/twig/twig/src/Template.php @@ -29,9 +29,9 @@ */ abstract class Template { - const ANY_CALL = 'any'; - const ARRAY_CALL = 'array'; - const METHOD_CALL = 'method'; + public const ANY_CALL = 'any'; + public const ARRAY_CALL = 'array'; + public const METHOD_CALL = 'method'; protected $parent; protected $parents = []; @@ -355,7 +355,7 @@ protected function loadTemplate($template, $templateName = null, $line = null, $ * * @return Template */ - protected function unwrap() + public function unwrap() { return $this; } diff --git a/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php b/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php index ce32a222cd7..df880a84128 100644 --- a/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php +++ b/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php @@ -120,7 +120,7 @@ public function getTests($name, $legacyTests = false) $deprecation = $match[3]; $templates = self::parseTemplates($match[4]); $exception = false; - preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); + preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, \PREG_SET_ORDER); } else { throw new \InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); } @@ -186,12 +186,12 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e // avoid using the same PHP class name for different cases $p = new \ReflectionProperty($twig, 'templateClassPrefix'); $p->setAccessible(true); - $p->setValue($twig, '__TwigTemplate_'.hash('sha256', uniqid(mt_rand(), true), false).'_'); + $p->setValue($twig, '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', uniqid(mt_rand(), true), false).'_'); $deprecations = []; try { $prevHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$prevHandler) { - if (E_USER_DEPRECATED === $type) { + if (\E_USER_DEPRECATED === $type) { $deprecations[] = $msg; return true; @@ -255,7 +255,7 @@ protected function doIntegrationTest($file, $message, $condition, $templates, $e protected static function parseTemplates($test) { $templates = []; - preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); + preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, \PREG_SET_ORDER); foreach ($matches as $match) { $templates[($match[1] ?: 'index.twig')] = $match[2]; } diff --git a/upload/system/storage/vendor/twig/twig/src/Token.php b/upload/system/storage/vendor/twig/twig/src/Token.php index 262fa48db74..0b2ef9be43c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Token.php +++ b/upload/system/storage/vendor/twig/twig/src/Token.php @@ -23,20 +23,20 @@ final class Token private $type; private $lineno; - const EOF_TYPE = -1; - const TEXT_TYPE = 0; - const BLOCK_START_TYPE = 1; - const VAR_START_TYPE = 2; - const BLOCK_END_TYPE = 3; - const VAR_END_TYPE = 4; - const NAME_TYPE = 5; - const NUMBER_TYPE = 6; - const STRING_TYPE = 7; - const OPERATOR_TYPE = 8; - const PUNCTUATION_TYPE = 9; - const INTERPOLATION_START_TYPE = 10; - const INTERPOLATION_END_TYPE = 11; - const ARROW_TYPE = 12; + public const EOF_TYPE = -1; + public const TEXT_TYPE = 0; + public const BLOCK_START_TYPE = 1; + public const VAR_START_TYPE = 2; + public const BLOCK_END_TYPE = 3; + public const VAR_END_TYPE = 4; + public const NAME_TYPE = 5; + public const NUMBER_TYPE = 6; + public const STRING_TYPE = 7; + public const OPERATOR_TYPE = 8; + public const PUNCTUATION_TYPE = 9; + public const INTERPOLATION_START_TYPE = 10; + public const INTERPOLATION_END_TYPE = 11; + public const ARROW_TYPE = 12; /** * @param int $type The type of the token diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php index 879879a2b01..c75e5ef8aa9 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php @@ -22,7 +22,7 @@ * * {% apply upper %} * This text becomes uppercase - * {% endapplys %} + * {% endapply %} */ final class ApplyTokenParser extends AbstractTokenParser { diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php index e57fc90aa78..5f66c58296c 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php @@ -33,7 +33,7 @@ public function parse(Token $token) $stream = $this->parser->getStream(); $lineno = $token->getLine(); - @trigger_error(sprintf('The "filter" tag in "%s" at line %d is deprecated since Twig 2.9, use the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED); + @trigger_error(sprintf('The "filter" tag in "%s" at line %d is deprecated since Twig 2.9, use the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); $name = $this->parser->getVarName(); $ref = new BlockReferenceExpression(new ConstantExpression($name, $lineno), null, $lineno, $this->getTag()); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php index 34430f00b00..a7987d95d9b 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php @@ -43,7 +43,7 @@ public function parse(Token $token) $ifexpr = null; if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'if')) { - @trigger_error(sprintf('Using an "if" condition on "for" tag in "%s" at line %d is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop).', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED); + @trigger_error(sprintf('Using an "if" condition on "for" tag in "%s" at line %d is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop).', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); $ifexpr = $this->parser->getExpressionParser()->parseExpression(); } diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php index b58624d5ec0..a609c2f7e2f 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php @@ -33,7 +33,7 @@ public function parse(Token $token) $stream = $this->parser->getStream(); $lineno = $token->getLine(); - @trigger_error(sprintf('The spaceless tag in "%s" at line %d is deprecated since Twig 2.7, use the "spaceless" filter with the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), E_USER_DEPRECATED); + @trigger_error(sprintf('The spaceless tag in "%s" at line %d is deprecated since Twig 2.7, use the "spaceless" filter with the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); $stream->expect(/* Token::BLOCK_END_TYPE */ 3); $body = $this->parser->subparse([$this, 'decideSpacelessEnd'], true); diff --git a/upload/system/storage/vendor/twig/twig/src/TwigFilter.php b/upload/system/storage/vendor/twig/twig/src/TwigFilter.php index 24fd8731e46..4351cf1397e 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigFilter.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigFilter.php @@ -40,7 +40,7 @@ class TwigFilter public function __construct(string $name, $callable = null, array $options = []) { if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->name = $name; diff --git a/upload/system/storage/vendor/twig/twig/src/TwigFunction.php b/upload/system/storage/vendor/twig/twig/src/TwigFunction.php index e4f8c78ac61..e0d961f868d 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigFunction.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigFunction.php @@ -40,7 +40,7 @@ class TwigFunction public function __construct(string $name, $callable = null, array $options = []) { if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->name = $name; diff --git a/upload/system/storage/vendor/twig/twig/src/TwigTest.php b/upload/system/storage/vendor/twig/twig/src/TwigTest.php index 845272587a5..6a58a56e3fd 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigTest.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigTest.php @@ -39,7 +39,7 @@ class TwigTest public function __construct(string $name, $callable = null, array $options = []) { if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', E_USER_DEPRECATED); + @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); } $this->name = $name; @@ -49,6 +49,7 @@ public function __construct(string $name, $callable = null, array $options = []) 'node_class' => TestExpression::class, 'deprecated' => false, 'alternative' => null, + 'one_mandatory_argument' => false, ], $options); } @@ -101,6 +102,11 @@ public function getAlternative() { return $this->options['alternative']; } + + public function hasOneMandatoryArgument(): bool + { + return (bool) $this->options['one_mandatory_argument']; + } } // For Twig 1.x compatibility diff --git a/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php b/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php index d37369841fd..17c169f74c8 100644 --- a/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php +++ b/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php @@ -57,7 +57,7 @@ public function collect(\Traversable $iterator) { $deprecations = []; set_error_handler(function ($type, $msg) use (&$deprecations) { - if (E_USER_DEPRECATED === $type) { + if (\E_USER_DEPRECATED === $type) { $deprecations[] = $msg; } }); diff --git a/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php b/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php index 1ab0dac59d5..b0356d4c2f5 100644 --- a/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php +++ b/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php @@ -16,11 +16,19 @@ */ class TemplateDirIterator extends \IteratorIterator { + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function current() { return file_get_contents(parent::current()); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function key() { return (string) parent::key(); From e2f6a88815b0dc0372df8d8d4a8f503a8846a611 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 13:35:41 +0000 Subject: [PATCH 03/39] Support for PHP 8.0 and 8.1 --- .../storage/vendor/react/promise/CHANGELOG.md | 186 ++++ .../storage/vendor/react/promise/LICENSE | 24 + .../storage/vendor/react/promise/README.md | 874 ++++++++++++++++++ .../vendor/react/promise/composer.json | 48 + .../src/CancellablePromiseInterface.php | 17 + .../react/promise/src/CancellationQueue.php | 55 ++ .../vendor/react/promise/src/Deferred.php | 65 ++ .../promise/src/Exception/LengthException.php | 7 + .../promise/src/ExtendedPromiseInterface.php | 98 ++ .../react/promise/src/FulfilledPromise.php | 71 ++ .../vendor/react/promise/src/LazyPromise.php | 66 ++ .../vendor/react/promise/src/Promise.php | 256 +++++ .../react/promise/src/PromiseInterface.php | 41 + .../react/promise/src/PromisorInterface.php | 13 + .../react/promise/src/RejectedPromise.php | 79 ++ .../src/UnhandledRejectionException.php | 31 + .../vendor/react/promise/src/functions.php | 407 ++++++++ .../react/promise/src/functions_include.php | 5 + 18 files changed, 2343 insertions(+) create mode 100644 upload/system/storage/vendor/react/promise/CHANGELOG.md create mode 100644 upload/system/storage/vendor/react/promise/LICENSE create mode 100644 upload/system/storage/vendor/react/promise/README.md create mode 100644 upload/system/storage/vendor/react/promise/composer.json create mode 100644 upload/system/storage/vendor/react/promise/src/CancellablePromiseInterface.php create mode 100644 upload/system/storage/vendor/react/promise/src/CancellationQueue.php create mode 100644 upload/system/storage/vendor/react/promise/src/Deferred.php create mode 100644 upload/system/storage/vendor/react/promise/src/Exception/LengthException.php create mode 100644 upload/system/storage/vendor/react/promise/src/ExtendedPromiseInterface.php create mode 100644 upload/system/storage/vendor/react/promise/src/FulfilledPromise.php create mode 100644 upload/system/storage/vendor/react/promise/src/LazyPromise.php create mode 100644 upload/system/storage/vendor/react/promise/src/Promise.php create mode 100644 upload/system/storage/vendor/react/promise/src/PromiseInterface.php create mode 100644 upload/system/storage/vendor/react/promise/src/PromisorInterface.php create mode 100644 upload/system/storage/vendor/react/promise/src/RejectedPromise.php create mode 100644 upload/system/storage/vendor/react/promise/src/UnhandledRejectionException.php create mode 100644 upload/system/storage/vendor/react/promise/src/functions.php create mode 100644 upload/system/storage/vendor/react/promise/src/functions_include.php diff --git a/upload/system/storage/vendor/react/promise/CHANGELOG.md b/upload/system/storage/vendor/react/promise/CHANGELOG.md new file mode 100644 index 00000000000..7f785eb5cd1 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/CHANGELOG.md @@ -0,0 +1,186 @@ +CHANGELOG for 2.x +================= + +* 2.9.0 (2022-02-11) + + * Feature: Support union types and address deprecation of `ReflectionType::getClass()` (PHP 8+). + (#198 by @cdosoftei and @SimonFrings) + + ```php + $promise->otherwise(function (OverflowException|UnderflowException $e) { + echo 'Error: ' . $e->getMessage() . PHP_EOL; + }); + ``` + + * Feature: Support intersection types (PHP 8.1+). + (#195 by @bzikarsky) + + ```php + $promise->otherwise(function (OverflowException&CacheException $e) { + echo 'Error: ' . $e->getMessage() . PHP_EOL; + }); + ``` + + * Improve test suite, use GitHub actions for continuous integration (CI), + update to PHPUnit 9, and add full core team to the license. + (#174, #183, #186, and #201 by @SimonFrings and #211 by @clue) + +* 2.8.0 (2020-05-12) + + * Mark `FulfilledPromise`, `RejectedPromise` and `LazyPromise` as deprecated for Promise v2 (and remove for Promise v3). + (#143 and #165 by @clue) + + ```php + // deprecated + $fulfilled = new React\Promise\FulfilledPromise($value); + $rejected = new React\Promise\RejectedPromise($reason); + + // recommended alternatives + $fulfilled = React\Promise\resolve($value); + $rejected = React\Promise\reject($reason); + ``` + + * Fix: Fix checking whether cancellable promise is an object and avoid possible warning. + (#168 by @smscr and @jsor) + + * Improve documentation and add docblocks to functions and interfaces. + (#135 by @CharlotteDunois) + + * Add `.gitattributes` to exclude dev files from exports. + (#154 by @reedy) + + * Improve test suite, run tests on PHP 7.4 and update PHPUnit test setup. + (#163 by @clue) + +* 2.7.1 (2018-01-07) + + * Fix: file_exists warning when resolving with long strings. + (#130 by @sbesselsen) + * Improve performance by prefixing all global functions calls with \ to skip the look up and resolve process and go straight to the global function. + (#133 by @WyriHaximus) + +* 2.7.0 (2018-06-13) + + * Feature: Improve memory consumption for pending promises by using static internal callbacks without binding to self. + (#124 by @clue) + +* 2.6.0 (2018-06-11) + + * Feature: Significantly improve memory consumption and performance by only passing resolver args + to resolver and canceller if callback requires them. Also use static callbacks without + binding to promise, clean up canceller function reference when they are no longer + needed and hide resolver and canceller references from call stack on PHP 7+. + (#113, #115, #116, #117, #118, #119 and #123 by @clue) + + These changes combined mean that rejecting promises with an `Exception` should + no longer cause any internal circular references which could cause some unexpected + memory growth in previous versions. By explicitly avoiding and explicitly + cleaning up said references, we can avoid relying on PHP's circular garbage collector + to kick in which significantly improves performance when rejecting many promises. + + * Mark legacy progress support / notification API as deprecated + (#112 by @clue) + + * Recommend rejecting promises by throwing an exception + (#114 by @jsor) + + * Improve documentation to properly instantiate LazyPromise + (#121 by @holtkamp) + + * Follower cancellation propagation was originally planned for this release + but has been reverted for now and is planned for a future release. + (#99 by @jsor and #122 by @clue) + +* 2.5.1 (2017-03-25) + + * Fix circular references when resolving with a promise which follows + itself (#94). + +* 2.5.0 (2016-12-22) + + * Revert automatic cancellation of pending collection promises once the + output promise resolves. This was introduced in 42d86b7 (PR #36, released + in [v2.3.0](https://github.com/reactphp/promise/releases/tag/v2.3.0)) and + was both unintended and backward incompatible. + + If you need automatic cancellation, you can use something like: + + ```php + function allAndCancel(array $promises) + { + return \React\Promise\all($promises) + ->always(function() use ($promises) { + foreach ($promises as $promise) { + if ($promise instanceof \React\Promise\CancellablePromiseInterface) { + $promise->cancel(); + } + } + }); + } + ``` + * `all()` and `map()` functions now preserve the order of the array (#77). + * Fix circular references when resolving a promise with itself (#71). + +* 2.4.1 (2016-05-03) + + * Fix `some()` not cancelling pending promises when too much input promises + reject (16ff799). + +* 2.4.0 (2016-03-31) + + * Support foreign thenables in `resolve()`. + Any object that provides a `then()` method is now assimilated to a trusted + promise that follows the state of this thenable (#52). + * Fix `some()` and `any()` for input arrays containing not enough items + (#34). + +* 2.3.0 (2016-03-24) + + * Allow cancellation of promises returned by functions working on promise + collections (#36). + * Handle `\Throwable` in the same way as `\Exception` (#51 by @joshdifabio). + +* 2.2.2 (2016-02-26) + + * Fix cancellation handlers called multiple times (#47 by @clue). + +* 2.2.1 (2015-07-03) + + * Fix stack error when resolving a promise in its own fulfillment or + rejection handlers. + +* 2.2.0 (2014-12-30) + + * Introduce new `ExtendedPromiseInterface` implemented by all promises. + * Add new `done()` method (part of the `ExtendedPromiseInterface`). + * Add new `otherwise()` method (part of the `ExtendedPromiseInterface`). + * Add new `always()` method (part of the `ExtendedPromiseInterface`). + * Add new `progress()` method (part of the `ExtendedPromiseInterface`). + * Rename `Deferred::progress` to `Deferred::notify` to avoid confusion with + `ExtendedPromiseInterface::progress` (a `Deferred::progress` alias is + still available for backward compatibility) + * `resolve()` now always returns a `ExtendedPromiseInterface`. + +* 2.1.0 (2014-10-15) + + * Introduce new `CancellablePromiseInterface` implemented by all promises. + * Add new `cancel()` method (part of the `CancellablePromiseInterface`). + +* 2.0.0 (2013-12-10) + + New major release. The goal is to streamline the API and to make it more + compliant with other promise libraries and especially with the new upcoming + [ES6 promises specification](https://github.com/domenic/promises-unwrapping/). + + * Add standalone Promise class. + * Add new `race()` function. + * BC break: Bump minimum PHP version to PHP 5.4. + * BC break: Remove `ResolverInterface` and `PromiseInterface` from + `Deferred`. + * BC break: Change signature of `PromiseInterface`. + * BC break: Remove `When` and `Util` classes and move static methods to + functions. + * BC break: `FulfilledPromise` and `RejectedPromise` now throw an exception + when initialized with a promise instead of a value/reason. + * BC break: `Deferred::resolve()` and `Deferred::reject()` no longer return + a promise. diff --git a/upload/system/storage/vendor/react/promise/LICENSE b/upload/system/storage/vendor/react/promise/LICENSE new file mode 100644 index 00000000000..21c1357b7a1 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2012 Jan Sorgalla, Christian Lück, Cees-Jan Kiewiet, Chris Boden + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/upload/system/storage/vendor/react/promise/README.md b/upload/system/storage/vendor/react/promise/README.md new file mode 100644 index 00000000000..d904a1d8f25 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/README.md @@ -0,0 +1,874 @@ +Promise +======= + +A lightweight implementation of +[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. + +[![CI status](https://github.com/reactphp/promise/workflows/CI/badge.svg?branch=2.x)](https://github.com/reactphp/promise/actions) + +Table of Contents +----------------- + +1. [Introduction](#introduction) +2. [Concepts](#concepts) + * [Deferred](#deferred) + * [Promise](#promise-1) +3. [API](#api) + * [Deferred](#deferred-1) + * [Deferred::promise()](#deferredpromise) + * [Deferred::resolve()](#deferredresolve) + * [Deferred::reject()](#deferredreject) + * [Deferred::notify()](#deferrednotify) + * [PromiseInterface](#promiseinterface) + * [PromiseInterface::then()](#promiseinterfacethen) + * [ExtendedPromiseInterface](#extendedpromiseinterface) + * [ExtendedPromiseInterface::done()](#extendedpromiseinterfacedone) + * [ExtendedPromiseInterface::otherwise()](#extendedpromiseinterfaceotherwise) + * [ExtendedPromiseInterface::always()](#extendedpromiseinterfacealways) + * [ExtendedPromiseInterface::progress()](#extendedpromiseinterfaceprogress) + * [CancellablePromiseInterface](#cancellablepromiseinterface) + * [CancellablePromiseInterface::cancel()](#cancellablepromiseinterfacecancel) + * [Promise](#promise-2) + * [FulfilledPromise](#fulfilledpromise) + * [RejectedPromise](#rejectedpromise) + * [LazyPromise](#lazypromise) + * [Functions](#functions) + * [resolve()](#resolve) + * [reject()](#reject) + * [all()](#all) + * [race()](#race) + * [any()](#any) + * [some()](#some) + * [map()](#map) + * [reduce()](#reduce) + * [PromisorInterface](#promisorinterface) +4. [Examples](#examples) + * [How to use Deferred](#how-to-use-deferred) + * [How promise forwarding works](#how-promise-forwarding-works) + * [Resolution forwarding](#resolution-forwarding) + * [Rejection forwarding](#rejection-forwarding) + * [Mixed resolution and rejection forwarding](#mixed-resolution-and-rejection-forwarding) + * [Progress event forwarding](#progress-event-forwarding) + * [done() vs. then()](#done-vs-then) +5. [Install](#install) +6. [Credits](#credits) +7. [License](#license) + +Introduction +------------ + +Promise is a library implementing +[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. + +It also provides several other useful promise-related concepts, such as joining +multiple promises and mapping and reducing collections of promises. + +If you've never heard about promises before, +[read this first](https://gist.github.com/3889970). + +Concepts +-------- + +### Deferred + +A **Deferred** represents a computation or unit of work that may not have +completed yet. Typically (but not always), that computation will be something +that executes asynchronously and completes at some point in the future. + +### Promise + +While a deferred represents the computation itself, a **Promise** represents +the result of that computation. Thus, each deferred has a promise that acts as +a placeholder for its actual result. + +API +--- + +### Deferred + +A deferred represents an operation whose resolution is pending. It has separate +promise and resolver parts. + +```php +$deferred = new React\Promise\Deferred(); + +$promise = $deferred->promise(); + +$deferred->resolve(mixed $value = null); +$deferred->reject(mixed $reason = null); +$deferred->notify(mixed $update = null); +``` + +The `promise` method returns the promise of the deferred. + +The `resolve` and `reject` methods control the state of the deferred. + +The deprecated `notify` method is for progress notification. + +The constructor of the `Deferred` accepts an optional `$canceller` argument. +See [Promise](#promise-2) for more information. + +#### Deferred::promise() + +```php +$promise = $deferred->promise(); +``` + +Returns the promise of the deferred, which you can hand out to others while +keeping the authority to modify its state to yourself. + +#### Deferred::resolve() + +```php +$deferred->resolve(mixed $value = null); +``` + +Resolves the promise returned by `promise()`. All consumers are notified by +having `$onFulfilled` (which they registered via `$promise->then()`) called with +`$value`. + +If `$value` itself is a promise, the promise will transition to the state of +this promise once it is resolved. + +#### Deferred::reject() + +```php +$deferred->reject(mixed $reason = null); +``` + +Rejects the promise returned by `promise()`, signalling that the deferred's +computation failed. +All consumers are notified by having `$onRejected` (which they registered via +`$promise->then()`) called with `$reason`. + +If `$reason` itself is a promise, the promise will be rejected with the outcome +of this promise regardless whether it fulfills or rejects. + +#### Deferred::notify() + +> Deprecated in v2.6.0: Progress support is deprecated and should not be used anymore. + +```php +$deferred->notify(mixed $update = null); +``` + +Triggers progress notifications, to indicate to consumers that the computation +is making progress toward its result. + +All consumers are notified by having `$onProgress` (which they registered via +`$promise->then()`) called with `$update`. + +### PromiseInterface + +The promise interface provides the common interface for all promise +implementations. + +A promise represents an eventual outcome, which is either fulfillment (success) +and an associated value, or rejection (failure) and an associated reason. + +Once in the fulfilled or rejected state, a promise becomes immutable. +Neither its state nor its result (or error) can be modified. + +#### Implementations + +* [Promise](#promise-2) +* [FulfilledPromise](#fulfilledpromise) (deprecated) +* [RejectedPromise](#rejectedpromise) (deprecated) +* [LazyPromise](#lazypromise) (deprecated) + +#### PromiseInterface::then() + +```php +$transformedPromise = $promise->then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null); +``` + +Transforms a promise's value by applying a function to the promise's fulfillment +or rejection value. Returns a new promise for the transformed result. + +The `then()` method registers new fulfilled, rejection and progress handlers +with a promise (all parameters are optional): + + * `$onFulfilled` will be invoked once the promise is fulfilled and passed + the result as the first argument. + * `$onRejected` will be invoked once the promise is rejected and passed the + reason as the first argument. + * `$onProgress` (deprecated) will be invoked whenever the producer of the promise + triggers progress notifications and passed a single argument (whatever it + wants) to indicate progress. + +It returns a new promise that will fulfill with the return value of either +`$onFulfilled` or `$onRejected`, whichever is called, or will reject with +the thrown exception if either throws. + +A promise makes the following guarantees about handlers registered in +the same call to `then()`: + + 1. Only one of `$onFulfilled` or `$onRejected` will be called, + never both. + 2. `$onFulfilled` and `$onRejected` will never be called more + than once. + 3. `$onProgress` (deprecated) may be called multiple times. + +#### See also + +* [resolve()](#resolve) - Creating a resolved promise +* [reject()](#reject) - Creating a rejected promise +* [ExtendedPromiseInterface::done()](#extendedpromiseinterfacedone) +* [done() vs. then()](#done-vs-then) + +### ExtendedPromiseInterface + +The ExtendedPromiseInterface extends the PromiseInterface with useful shortcut +and utility methods which are not part of the Promises/A specification. + +#### Implementations + +* [Promise](#promise-1) +* [FulfilledPromise](#fulfilledpromise) (deprecated) +* [RejectedPromise](#rejectedpromise) (deprecated) +* [LazyPromise](#lazypromise) (deprecated) + +#### ExtendedPromiseInterface::done() + +```php +$promise->done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null); +``` + +Consumes the promise's ultimate value if the promise fulfills, or handles the +ultimate error. + +It will cause a fatal error if either `$onFulfilled` or `$onRejected` throw or +return a rejected promise. + +Since the purpose of `done()` is consumption rather than transformation, +`done()` always returns `null`. + +#### See also + +* [PromiseInterface::then()](#promiseinterfacethen) +* [done() vs. then()](#done-vs-then) + +#### ExtendedPromiseInterface::otherwise() + +```php +$promise->otherwise(callable $onRejected); +``` + +Registers a rejection handler for promise. It is a shortcut for: + +```php +$promise->then(null, $onRejected); +``` + +Additionally, you can type hint the `$reason` argument of `$onRejected` to catch +only specific errors. + +```php +$promise + ->otherwise(function (\RuntimeException $reason) { + // Only catch \RuntimeException instances + // All other types of errors will propagate automatically + }) + ->otherwise(function ($reason) { + // Catch other errors + )}; +``` + +#### ExtendedPromiseInterface::always() + +```php +$newPromise = $promise->always(callable $onFulfilledOrRejected); +``` + +Allows you to execute "cleanup" type tasks in a promise chain. + +It arranges for `$onFulfilledOrRejected` to be called, with no arguments, +when the promise is either fulfilled or rejected. + +* If `$promise` fulfills, and `$onFulfilledOrRejected` returns successfully, + `$newPromise` will fulfill with the same value as `$promise`. +* If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a + rejected promise, `$newPromise` will reject with the thrown exception or + rejected promise's reason. +* If `$promise` rejects, and `$onFulfilledOrRejected` returns successfully, + `$newPromise` will reject with the same reason as `$promise`. +* If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a + rejected promise, `$newPromise` will reject with the thrown exception or + rejected promise's reason. + +`always()` behaves similarly to the synchronous finally statement. When combined +with `otherwise()`, `always()` allows you to write code that is similar to the familiar +synchronous catch/finally pair. + +Consider the following synchronous code: + +```php +try { + return doSomething(); +} catch(\Exception $e) { + return handleError($e); +} finally { + cleanup(); +} +``` + +Similar asynchronous code (with `doSomething()` that returns a promise) can be +written: + +```php +return doSomething() + ->otherwise('handleError') + ->always('cleanup'); +``` + +#### ExtendedPromiseInterface::progress() + +> Deprecated in v2.6.0: Progress support is deprecated and should not be used anymore. + +```php +$promise->progress(callable $onProgress); +``` + +Registers a handler for progress updates from promise. It is a shortcut for: + +```php +$promise->then(null, null, $onProgress); +``` + +### CancellablePromiseInterface + +A cancellable promise provides a mechanism for consumers to notify the creator +of the promise that they are not longer interested in the result of an +operation. + +#### CancellablePromiseInterface::cancel() + +``` php +$promise->cancel(); +``` + +The `cancel()` method notifies the creator of the promise that there is no +further interest in the results of the operation. + +Once a promise is settled (either fulfilled or rejected), calling `cancel()` on +a promise has no effect. + +#### Implementations + +* [Promise](#promise-1) +* [FulfilledPromise](#fulfilledpromise) (deprecated) +* [RejectedPromise](#rejectedpromise) (deprecated) +* [LazyPromise](#lazypromise) (deprecated) + +### Promise + +Creates a promise whose state is controlled by the functions passed to +`$resolver`. + +```php +$resolver = function (callable $resolve, callable $reject, callable $notify) { + // Do some work, possibly asynchronously, and then + // resolve or reject. You can notify of progress events (deprecated) + // along the way if you want/need. + + $resolve($awesomeResult); + // or throw new Exception('Promise rejected'); + // or $resolve($anotherPromise); + // or $reject($nastyError); + // or $notify($progressNotification); +}; + +$canceller = function () { + // Cancel/abort any running operations like network connections, streams etc. + + // Reject promise by throwing an exception + throw new Exception('Promise cancelled'); +}; + +$promise = new React\Promise\Promise($resolver, $canceller); +``` + +The promise constructor receives a resolver function and an optional canceller +function which both will be called with 3 arguments: + + * `$resolve($value)` - Primary function that seals the fate of the + returned promise. Accepts either a non-promise value, or another promise. + When called with a non-promise value, fulfills promise with that value. + When called with another promise, e.g. `$resolve($otherPromise)`, promise's + fate will be equivalent to that of `$otherPromise`. + * `$reject($reason)` - Function that rejects the promise. It is recommended to + just throw an exception instead of using `$reject()`. + * `$notify($update)` - Deprecated function that issues progress events for the promise. + +If the resolver or canceller throw an exception, the promise will be rejected +with that thrown exception as the rejection reason. + +The resolver function will be called immediately, the canceller function only +once all consumers called the `cancel()` method of the promise. + +### FulfilledPromise + +> Deprecated in v2.8.0: External usage of `FulfilledPromise` is deprecated, use `resolve()` instead. + +Creates a already fulfilled promise. + +```php +$promise = React\Promise\FulfilledPromise($value); +``` + +Note, that `$value` **cannot** be a promise. It's recommended to use +[resolve()](#resolve) for creating resolved promises. + +### RejectedPromise + +> Deprecated in v2.8.0: External usage of `RejectedPromise` is deprecated, use `reject()` instead. + +Creates a already rejected promise. + +```php +$promise = React\Promise\RejectedPromise($reason); +``` + +Note, that `$reason` **cannot** be a promise. It's recommended to use +[reject()](#reject) for creating rejected promises. + +### LazyPromise + +> Deprecated in v2.8.0: LazyPromise is deprecated and should not be used anymore. + +Creates a promise which will be lazily initialized by `$factory` once a consumer +calls the `then()` method. + +```php +$factory = function () { + $deferred = new React\Promise\Deferred(); + + // Do some heavy stuff here and resolve the deferred once completed + + return $deferred->promise(); +}; + +$promise = new React\Promise\LazyPromise($factory); + +// $factory will only be executed once we call then() +$promise->then(function ($value) { +}); +``` + +### Functions + +Useful functions for creating, joining, mapping and reducing collections of +promises. + +All functions working on promise collections (like `all()`, `race()`, `some()` +etc.) support cancellation. This means, if you call `cancel()` on the returned +promise, all promises in the collection are cancelled. If the collection itself +is a promise which resolves to an array, this promise is also cancelled. + +#### resolve() + +```php +$promise = React\Promise\resolve(mixed $promiseOrValue); +``` + +Creates a promise for the supplied `$promiseOrValue`. + +If `$promiseOrValue` is a value, it will be the resolution value of the +returned promise. + +If `$promiseOrValue` is a thenable (any object that provides a `then()` method), +a trusted promise that follows the state of the thenable is returned. + +If `$promiseOrValue` is a promise, it will be returned as is. + +Note: The promise returned is always a promise implementing +[ExtendedPromiseInterface](#extendedpromiseinterface). If you pass in a custom +promise which only implements [PromiseInterface](#promiseinterface), this +promise will be assimilated to a extended promise following `$promiseOrValue`. + +#### reject() + +```php +$promise = React\Promise\reject(mixed $promiseOrValue); +``` + +Creates a rejected promise for the supplied `$promiseOrValue`. + +If `$promiseOrValue` is a value, it will be the rejection value of the +returned promise. + +If `$promiseOrValue` is a promise, its completion value will be the rejected +value of the returned promise. + +This can be useful in situations where you need to reject a promise without +throwing an exception. For example, it allows you to propagate a rejection with +the value of another promise. + +#### all() + +```php +$promise = React\Promise\all(array|React\Promise\PromiseInterface $promisesOrValues); +``` + +Returns a promise that will resolve only once all the items in +`$promisesOrValues` have resolved. The resolution value of the returned promise +will be an array containing the resolution values of each of the items in +`$promisesOrValues`. + +#### race() + +```php +$promise = React\Promise\race(array|React\Promise\PromiseInterface $promisesOrValues); +``` + +Initiates a competitive race that allows one winner. Returns a promise which is +resolved in the same way the first settled promise resolves. + +#### any() + +```php +$promise = React\Promise\any(array|React\Promise\PromiseInterface $promisesOrValues); +``` + +Returns a promise that will resolve when any one of the items in +`$promisesOrValues` resolves. The resolution value of the returned promise +will be the resolution value of the triggering item. + +The returned promise will only reject if *all* items in `$promisesOrValues` are +rejected. The rejection value will be an array of all rejection reasons. + +The returned promise will also reject with a `React\Promise\Exception\LengthException` +if `$promisesOrValues` contains 0 items. + +#### some() + +```php +$promise = React\Promise\some(array|React\Promise\PromiseInterface $promisesOrValues, integer $howMany); +``` + +Returns a promise that will resolve when `$howMany` of the supplied items in +`$promisesOrValues` resolve. The resolution value of the returned promise +will be an array of length `$howMany` containing the resolution values of the +triggering items. + +The returned promise will reject if it becomes impossible for `$howMany` items +to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items +reject). The rejection value will be an array of +`(count($promisesOrValues) - $howMany) + 1` rejection reasons. + +The returned promise will also reject with a `React\Promise\Exception\LengthException` +if `$promisesOrValues` contains less items than `$howMany`. + +#### map() + +```php +$promise = React\Promise\map(array|React\Promise\PromiseInterface $promisesOrValues, callable $mapFunc); +``` + +Traditional map function, similar to `array_map()`, but allows input to contain +promises and/or values, and `$mapFunc` may return either a value or a promise. + +The map function receives each item as argument, where item is a fully resolved +value of a promise or value in `$promisesOrValues`. + +#### reduce() + +```php +$promise = React\Promise\reduce(array|React\Promise\PromiseInterface $promisesOrValues, callable $reduceFunc , $initialValue = null); +``` + +Traditional reduce function, similar to `array_reduce()`, but input may contain +promises and/or values, and `$reduceFunc` may return either a value or a +promise, *and* `$initialValue` may be a promise or a value for the starting +value. + +### PromisorInterface + +The `React\Promise\PromisorInterface` provides a common interface for objects +that provide a promise. `React\Promise\Deferred` implements it, but since it +is part of the public API anyone can implement it. + +Examples +-------- + +### How to use Deferred + +```php +function getAwesomeResultPromise() +{ + $deferred = new React\Promise\Deferred(); + + // Execute a Node.js-style function using the callback pattern + computeAwesomeResultAsynchronously(function ($error, $result) use ($deferred) { + if ($error) { + $deferred->reject($error); + } else { + $deferred->resolve($result); + } + }); + + // Return the promise + return $deferred->promise(); +} + +getAwesomeResultPromise() + ->then( + function ($value) { + // Deferred resolved, do something with $value + }, + function ($reason) { + // Deferred rejected, do something with $reason + }, + function ($update) { + // Progress notification triggered, do something with $update + } + ); +``` + +### How promise forwarding works + +A few simple examples to show how the mechanics of Promises/A forwarding works. +These examples are contrived, of course, and in real usage, promise chains will +typically be spread across several function calls, or even several levels of +your application architecture. + +#### Resolution forwarding + +Resolved promises forward resolution values to the next promise. +The first promise, `$deferred->promise()`, will resolve with the value passed +to `$deferred->resolve()` below. + +Each call to `then()` returns a new promise that will resolve with the return +value of the previous handler. This creates a promise "pipeline". + +```php +$deferred = new React\Promise\Deferred(); + +$deferred->promise() + ->then(function ($x) { + // $x will be the value passed to $deferred->resolve() below + // and returns a *new promise* for $x + 1 + return $x + 1; + }) + ->then(function ($x) { + // $x === 2 + // This handler receives the return value of the + // previous handler. + return $x + 1; + }) + ->then(function ($x) { + // $x === 3 + // This handler receives the return value of the + // previous handler. + return $x + 1; + }) + ->then(function ($x) { + // $x === 4 + // This handler receives the return value of the + // previous handler. + echo 'Resolve ' . $x; + }); + +$deferred->resolve(1); // Prints "Resolve 4" +``` + +#### Rejection forwarding + +Rejected promises behave similarly, and also work similarly to try/catch: +When you catch an exception, you must rethrow for it to propagate. + +Similarly, when you handle a rejected promise, to propagate the rejection, +"rethrow" it by either returning a rejected promise, or actually throwing +(since promise translates thrown exceptions into rejections) + +```php +$deferred = new React\Promise\Deferred(); + +$deferred->promise() + ->then(function ($x) { + throw new \Exception($x + 1); + }) + ->otherwise(function (\Exception $x) { + // Propagate the rejection + throw $x; + }) + ->otherwise(function (\Exception $x) { + // Can also propagate by returning another rejection + return React\Promise\reject( + new \Exception($x->getMessage() + 1) + ); + }) + ->otherwise(function ($x) { + echo 'Reject ' . $x->getMessage(); // 3 + }); + +$deferred->resolve(1); // Prints "Reject 3" +``` + +#### Mixed resolution and rejection forwarding + +Just like try/catch, you can choose to propagate or not. Mixing resolutions and +rejections will still forward handler results in a predictable way. + +```php +$deferred = new React\Promise\Deferred(); + +$deferred->promise() + ->then(function ($x) { + return $x + 1; + }) + ->then(function ($x) { + throw new \Exception($x + 1); + }) + ->otherwise(function (\Exception $x) { + // Handle the rejection, and don't propagate. + // This is like catch without a rethrow + return $x->getMessage() + 1; + }) + ->then(function ($x) { + echo 'Mixed ' . $x; // 4 + }); + +$deferred->resolve(1); // Prints "Mixed 4" +``` + +#### Progress event forwarding + +> Deprecated in v2.6.0: Progress support is deprecated and should not be used anymore. + +In the same way as resolution and rejection handlers, your progress handler +**MUST** return a progress event to be propagated to the next link in the chain. +If you return nothing, `null` will be propagated. + +Also in the same way as resolutions and rejections, if you don't register a +progress handler, the update will be propagated through. + +If your progress handler throws an exception, the exception will be propagated +to the next link in the chain. The best thing to do is to ensure your progress +handlers do not throw exceptions. + +This gives you the opportunity to transform progress events at each step in the +chain so that they are meaningful to the next step. It also allows you to choose +not to transform them, and simply let them propagate untransformed, by not +registering a progress handler. + +```php +$deferred = new React\Promise\Deferred(); + +$deferred->promise() + ->progress(function ($update) { + return $update + 1; + }) + ->progress(function ($update) { + echo 'Progress ' . $update; // 2 + }); + +$deferred->notify(1); // Prints "Progress 2" +``` + +### done() vs. then() + +The golden rule is: + + Either return your promise, or call done() on it. + +At a first glance, `then()` and `done()` seem very similar. However, there are +important distinctions. + +The intent of `then()` is to transform a promise's value and to pass or return +a new promise for the transformed value along to other parts of your code. + +The intent of `done()` is to consume a promise's value, transferring +responsibility for the value to your code. + +In addition to transforming a value, `then()` allows you to recover from, or +propagate intermediate errors. Any errors that are not handled will be caught +by the promise machinery and used to reject the promise returned by `then()`. + +Calling `done()` transfers all responsibility for errors to your code. If an +error (either a thrown exception or returned rejection) escapes the +`$onFulfilled` or `$onRejected` callbacks you provide to done, it will be +rethrown in an uncatchable way causing a fatal error. + +```php +function getJsonResult() +{ + return queryApi() + ->then( + // Transform API results to an object + function ($jsonResultString) { + return json_decode($jsonResultString); + }, + // Transform API errors to an exception + function ($jsonErrorString) { + $object = json_decode($jsonErrorString); + throw new ApiErrorException($object->errorMessage); + } + ); +} + +// Here we provide no rejection handler. If the promise returned has been +// rejected, the ApiErrorException will be thrown +getJsonResult() + ->done( + // Consume transformed object + function ($jsonResultObject) { + // Do something with $jsonResultObject + } + ); + +// Here we provide a rejection handler which will either throw while debugging +// or log the exception +getJsonResult() + ->done( + function ($jsonResultObject) { + // Do something with $jsonResultObject + }, + function (ApiErrorException $exception) { + if (isDebug()) { + throw $exception; + } else { + logException($exception); + } + } + ); +``` + +Note that if a rejection value is not an instance of `\Exception`, it will be +wrapped in an exception of the type `React\Promise\UnhandledRejectionException`. + +You can get the original rejection reason by calling `$exception->getReason()`. + +Install +------- + +The recommended way to install this library is [through Composer](https://getcomposer.org). +[New to Composer?](https://getcomposer.org/doc/00-intro.md) + +This project follows [SemVer](https://semver.org/). +This will install the latest supported version: + +```bash +$ composer require react/promise:^2.9 +``` + +See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. + +This project aims to run on any platform and thus does not require any PHP +extensions and supports running on legacy PHP 5.4 through current PHP 8+ and HHVM. +It's *highly recommended to use the latest supported PHP version* for this project. + +Credits +------- + +Promise is a port of [when.js](https://github.com/cujojs/when) +by [Brian Cavalier](https://github.com/briancavalier). + +Also, large parts of the documentation have been ported from the when.js +[Wiki](https://github.com/cujojs/when/wiki) and the +[API docs](https://github.com/cujojs/when/blob/master/docs/api.md). + +License +------- + +Released under the [MIT](LICENSE) license. diff --git a/upload/system/storage/vendor/react/promise/composer.json b/upload/system/storage/vendor/react/promise/composer.json new file mode 100644 index 00000000000..f933f153767 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/composer.json @@ -0,0 +1,48 @@ +{ + "name": "react/promise", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "license": "MIT", + "authors": [ + { + "name": "Jan Sorgalla", + "homepage": "https://sorgalla.com/", + "email": "jsorgalla@gmail.com" + }, + { + "name": "Christian Lück", + "homepage": "https://clue.engineering/", + "email": "christian@clue.engineering" + }, + { + "name": "Cees-Jan Kiewiet", + "homepage": "https://wyrihaximus.net/", + "email": "reactphp@ceesjankiewiet.nl" + }, + { + "name": "Chris Boden", + "homepage": "https://cboden.dev/", + "email": "cboden@gmail.com" + } + ], + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": ["src/functions_include.php"] + }, + "autoload-dev": { + "psr-4": { + "React\\Promise\\": ["tests", "tests/fixtures"] + } + }, + "keywords": [ + "promise", + "promises" + ] +} diff --git a/upload/system/storage/vendor/react/promise/src/CancellablePromiseInterface.php b/upload/system/storage/vendor/react/promise/src/CancellablePromiseInterface.php new file mode 100644 index 00000000000..6b3a8c65d6b --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/CancellablePromiseInterface.php @@ -0,0 +1,17 @@ +started) { + return; + } + + $this->started = true; + $this->drain(); + } + + public function enqueue($cancellable) + { + if (!\is_object($cancellable) || !\method_exists($cancellable, 'then') || !\method_exists($cancellable, 'cancel')) { + return; + } + + $length = \array_push($this->queue, $cancellable); + + if ($this->started && 1 === $length) { + $this->drain(); + } + } + + private function drain() + { + for ($i = key($this->queue); isset($this->queue[$i]); $i++) { + $cancellable = $this->queue[$i]; + + $exception = null; + + try { + $cancellable->cancel(); + } catch (\Throwable $exception) { + } catch (\Exception $exception) { + } + + unset($this->queue[$i]); + + if ($exception) { + throw $exception; + } + } + + $this->queue = []; + } +} diff --git a/upload/system/storage/vendor/react/promise/src/Deferred.php b/upload/system/storage/vendor/react/promise/src/Deferred.php new file mode 100644 index 00000000000..3ca034b859c --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/Deferred.php @@ -0,0 +1,65 @@ +canceller = $canceller; + } + + public function promise() + { + if (null === $this->promise) { + $this->promise = new Promise(function ($resolve, $reject, $notify) { + $this->resolveCallback = $resolve; + $this->rejectCallback = $reject; + $this->notifyCallback = $notify; + }, $this->canceller); + $this->canceller = null; + } + + return $this->promise; + } + + public function resolve($value = null) + { + $this->promise(); + + \call_user_func($this->resolveCallback, $value); + } + + public function reject($reason = null) + { + $this->promise(); + + \call_user_func($this->rejectCallback, $reason); + } + + /** + * @deprecated 2.6.0 Progress support is deprecated and should not be used anymore. + * @param mixed $update + */ + public function notify($update = null) + { + $this->promise(); + + \call_user_func($this->notifyCallback, $update); + } + + /** + * @deprecated 2.2.0 + * @see Deferred::notify() + */ + public function progress($update = null) + { + $this->notify($update); + } +} diff --git a/upload/system/storage/vendor/react/promise/src/Exception/LengthException.php b/upload/system/storage/vendor/react/promise/src/Exception/LengthException.php new file mode 100644 index 00000000000..775c48db6a9 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/Exception/LengthException.php @@ -0,0 +1,7 @@ +then(null, $onRejected); + * ``` + * + * Additionally, you can type hint the `$reason` argument of `$onRejected` to catch + * only specific errors. + * + * @param callable $onRejected + * @return ExtendedPromiseInterface + */ + public function otherwise(callable $onRejected); + + /** + * Allows you to execute "cleanup" type tasks in a promise chain. + * + * It arranges for `$onFulfilledOrRejected` to be called, with no arguments, + * when the promise is either fulfilled or rejected. + * + * * If `$promise` fulfills, and `$onFulfilledOrRejected` returns successfully, + * `$newPromise` will fulfill with the same value as `$promise`. + * * If `$promise` fulfills, and `$onFulfilledOrRejected` throws or returns a + * rejected promise, `$newPromise` will reject with the thrown exception or + * rejected promise's reason. + * * If `$promise` rejects, and `$onFulfilledOrRejected` returns successfully, + * `$newPromise` will reject with the same reason as `$promise`. + * * If `$promise` rejects, and `$onFulfilledOrRejected` throws or returns a + * rejected promise, `$newPromise` will reject with the thrown exception or + * rejected promise's reason. + * + * `always()` behaves similarly to the synchronous finally statement. When combined + * with `otherwise()`, `always()` allows you to write code that is similar to the familiar + * synchronous catch/finally pair. + * + * Consider the following synchronous code: + * + * ```php + * try { + * return doSomething(); + * } catch(\Exception $e) { + * return handleError($e); + * } finally { + * cleanup(); + * } + * ``` + * + * Similar asynchronous code (with `doSomething()` that returns a promise) can be + * written: + * + * ```php + * return doSomething() + * ->otherwise('handleError') + * ->always('cleanup'); + * ``` + * + * @param callable $onFulfilledOrRejected + * @return ExtendedPromiseInterface + */ + public function always(callable $onFulfilledOrRejected); + + /** + * Registers a handler for progress updates from promise. It is a shortcut for: + * + * ```php + * $promise->then(null, null, $onProgress); + * ``` + * + * @param callable $onProgress + * @return ExtendedPromiseInterface + * @deprecated 2.6.0 Progress support is deprecated and should not be used anymore. + */ + public function progress(callable $onProgress); +} diff --git a/upload/system/storage/vendor/react/promise/src/FulfilledPromise.php b/upload/system/storage/vendor/react/promise/src/FulfilledPromise.php new file mode 100644 index 00000000000..14727527788 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/FulfilledPromise.php @@ -0,0 +1,71 @@ +value = $value; + } + + public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + if (null === $onFulfilled) { + return $this; + } + + try { + return resolve($onFulfilled($this->value)); + } catch (\Throwable $exception) { + return new RejectedPromise($exception); + } catch (\Exception $exception) { + return new RejectedPromise($exception); + } + } + + public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + if (null === $onFulfilled) { + return; + } + + $result = $onFulfilled($this->value); + + if ($result instanceof ExtendedPromiseInterface) { + $result->done(); + } + } + + public function otherwise(callable $onRejected) + { + return $this; + } + + public function always(callable $onFulfilledOrRejected) + { + return $this->then(function ($value) use ($onFulfilledOrRejected) { + return resolve($onFulfilledOrRejected())->then(function () use ($value) { + return $value; + }); + }); + } + + public function progress(callable $onProgress) + { + return $this; + } + + public function cancel() + { + } +} diff --git a/upload/system/storage/vendor/react/promise/src/LazyPromise.php b/upload/system/storage/vendor/react/promise/src/LazyPromise.php new file mode 100644 index 00000000000..bbe9293e1c5 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/LazyPromise.php @@ -0,0 +1,66 @@ +factory = $factory; + } + + public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + return $this->promise()->then($onFulfilled, $onRejected, $onProgress); + } + + public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + return $this->promise()->done($onFulfilled, $onRejected, $onProgress); + } + + public function otherwise(callable $onRejected) + { + return $this->promise()->otherwise($onRejected); + } + + public function always(callable $onFulfilledOrRejected) + { + return $this->promise()->always($onFulfilledOrRejected); + } + + public function progress(callable $onProgress) + { + return $this->promise()->progress($onProgress); + } + + public function cancel() + { + return $this->promise()->cancel(); + } + + /** + * @internal + * @see Promise::settle() + */ + public function promise() + { + if (null === $this->promise) { + try { + $this->promise = resolve(\call_user_func($this->factory)); + } catch (\Throwable $exception) { + $this->promise = new RejectedPromise($exception); + } catch (\Exception $exception) { + $this->promise = new RejectedPromise($exception); + } + } + + return $this->promise; + } +} diff --git a/upload/system/storage/vendor/react/promise/src/Promise.php b/upload/system/storage/vendor/react/promise/src/Promise.php new file mode 100644 index 00000000000..33759e6fe6e --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/Promise.php @@ -0,0 +1,256 @@ +canceller = $canceller; + + // Explicitly overwrite arguments with null values before invoking + // resolver function. This ensure that these arguments do not show up + // in the stack trace in PHP 7+ only. + $cb = $resolver; + $resolver = $canceller = null; + $this->call($cb); + } + + public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + if (null !== $this->result) { + return $this->result->then($onFulfilled, $onRejected, $onProgress); + } + + if (null === $this->canceller) { + return new static($this->resolver($onFulfilled, $onRejected, $onProgress)); + } + + // This promise has a canceller, so we create a new child promise which + // has a canceller that invokes the parent canceller if all other + // followers are also cancelled. We keep a reference to this promise + // instance for the static canceller function and clear this to avoid + // keeping a cyclic reference between parent and follower. + $parent = $this; + ++$parent->requiredCancelRequests; + + return new static( + $this->resolver($onFulfilled, $onRejected, $onProgress), + static function () use (&$parent) { + if (++$parent->cancelRequests >= $parent->requiredCancelRequests) { + $parent->cancel(); + } + + $parent = null; + } + ); + } + + public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + if (null !== $this->result) { + return $this->result->done($onFulfilled, $onRejected, $onProgress); + } + + $this->handlers[] = static function (ExtendedPromiseInterface $promise) use ($onFulfilled, $onRejected) { + $promise + ->done($onFulfilled, $onRejected); + }; + + if ($onProgress) { + $this->progressHandlers[] = $onProgress; + } + } + + public function otherwise(callable $onRejected) + { + return $this->then(null, static function ($reason) use ($onRejected) { + if (!_checkTypehint($onRejected, $reason)) { + return new RejectedPromise($reason); + } + + return $onRejected($reason); + }); + } + + public function always(callable $onFulfilledOrRejected) + { + return $this->then(static function ($value) use ($onFulfilledOrRejected) { + return resolve($onFulfilledOrRejected())->then(function () use ($value) { + return $value; + }); + }, static function ($reason) use ($onFulfilledOrRejected) { + return resolve($onFulfilledOrRejected())->then(function () use ($reason) { + return new RejectedPromise($reason); + }); + }); + } + + public function progress(callable $onProgress) + { + return $this->then(null, null, $onProgress); + } + + public function cancel() + { + if (null === $this->canceller || null !== $this->result) { + return; + } + + $canceller = $this->canceller; + $this->canceller = null; + + $this->call($canceller); + } + + private function resolver(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + return function ($resolve, $reject, $notify) use ($onFulfilled, $onRejected, $onProgress) { + if ($onProgress) { + $progressHandler = static function ($update) use ($notify, $onProgress) { + try { + $notify($onProgress($update)); + } catch (\Throwable $e) { + $notify($e); + } catch (\Exception $e) { + $notify($e); + } + }; + } else { + $progressHandler = $notify; + } + + $this->handlers[] = static function (ExtendedPromiseInterface $promise) use ($onFulfilled, $onRejected, $resolve, $reject, $progressHandler) { + $promise + ->then($onFulfilled, $onRejected) + ->done($resolve, $reject, $progressHandler); + }; + + $this->progressHandlers[] = $progressHandler; + }; + } + + private function reject($reason = null) + { + if (null !== $this->result) { + return; + } + + $this->settle(reject($reason)); + } + + private function settle(ExtendedPromiseInterface $promise) + { + $promise = $this->unwrap($promise); + + if ($promise === $this) { + $promise = new RejectedPromise( + new \LogicException('Cannot resolve a promise with itself.') + ); + } + + $handlers = $this->handlers; + + $this->progressHandlers = $this->handlers = []; + $this->result = $promise; + $this->canceller = null; + + foreach ($handlers as $handler) { + $handler($promise); + } + } + + private function unwrap($promise) + { + $promise = $this->extract($promise); + + while ($promise instanceof self && null !== $promise->result) { + $promise = $this->extract($promise->result); + } + + return $promise; + } + + private function extract($promise) + { + if ($promise instanceof LazyPromise) { + $promise = $promise->promise(); + } + + return $promise; + } + + private function call(callable $cb) + { + // Explicitly overwrite argument with null value. This ensure that this + // argument does not show up in the stack trace in PHP 7+ only. + $callback = $cb; + $cb = null; + + // Use reflection to inspect number of arguments expected by this callback. + // We did some careful benchmarking here: Using reflection to avoid unneeded + // function arguments is actually faster than blindly passing them. + // Also, this helps avoiding unnecessary function arguments in the call stack + // if the callback creates an Exception (creating garbage cycles). + if (\is_array($callback)) { + $ref = new \ReflectionMethod($callback[0], $callback[1]); + } elseif (\is_object($callback) && !$callback instanceof \Closure) { + $ref = new \ReflectionMethod($callback, '__invoke'); + } else { + $ref = new \ReflectionFunction($callback); + } + $args = $ref->getNumberOfParameters(); + + try { + if ($args === 0) { + $callback(); + } else { + // Keep references to this promise instance for the static resolve/reject functions. + // By using static callbacks that are not bound to this instance + // and passing the target promise instance by reference, we can + // still execute its resolving logic and still clear this + // reference when settling the promise. This helps avoiding + // garbage cycles if any callback creates an Exception. + // These assumptions are covered by the test suite, so if you ever feel like + // refactoring this, go ahead, any alternative suggestions are welcome! + $target =& $this; + $progressHandlers =& $this->progressHandlers; + + $callback( + static function ($value = null) use (&$target) { + if ($target !== null) { + $target->settle(resolve($value)); + $target = null; + } + }, + static function ($reason = null) use (&$target) { + if ($target !== null) { + $target->reject($reason); + $target = null; + } + }, + static function ($update = null) use (&$progressHandlers) { + foreach ($progressHandlers as $handler) { + $handler($update); + } + } + ); + } + } catch (\Throwable $e) { + $target = null; + $this->reject($e); + } catch (\Exception $e) { + $target = null; + $this->reject($e); + } + } +} diff --git a/upload/system/storage/vendor/react/promise/src/PromiseInterface.php b/upload/system/storage/vendor/react/promise/src/PromiseInterface.php new file mode 100644 index 00000000000..edcb00770c7 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/PromiseInterface.php @@ -0,0 +1,41 @@ +reason = $reason; + } + + public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + if (null === $onRejected) { + return $this; + } + + try { + return resolve($onRejected($this->reason)); + } catch (\Throwable $exception) { + return new RejectedPromise($exception); + } catch (\Exception $exception) { + return new RejectedPromise($exception); + } + } + + public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) + { + if (null === $onRejected) { + throw UnhandledRejectionException::resolve($this->reason); + } + + $result = $onRejected($this->reason); + + if ($result instanceof self) { + throw UnhandledRejectionException::resolve($result->reason); + } + + if ($result instanceof ExtendedPromiseInterface) { + $result->done(); + } + } + + public function otherwise(callable $onRejected) + { + if (!_checkTypehint($onRejected, $this->reason)) { + return $this; + } + + return $this->then(null, $onRejected); + } + + public function always(callable $onFulfilledOrRejected) + { + return $this->then(null, function ($reason) use ($onFulfilledOrRejected) { + return resolve($onFulfilledOrRejected())->then(function () use ($reason) { + return new RejectedPromise($reason); + }); + }); + } + + public function progress(callable $onProgress) + { + return $this; + } + + public function cancel() + { + } +} diff --git a/upload/system/storage/vendor/react/promise/src/UnhandledRejectionException.php b/upload/system/storage/vendor/react/promise/src/UnhandledRejectionException.php new file mode 100644 index 00000000000..e7fe2f7a8cb --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/UnhandledRejectionException.php @@ -0,0 +1,31 @@ +reason = $reason; + + $message = \sprintf('Unhandled Rejection: %s', \json_encode($reason)); + + parent::__construct($message, 0); + } + + public function getReason() + { + return $this->reason; + } +} diff --git a/upload/system/storage/vendor/react/promise/src/functions.php b/upload/system/storage/vendor/react/promise/src/functions.php new file mode 100644 index 00000000000..429f0e7338f --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/functions.php @@ -0,0 +1,407 @@ +then($resolve, $reject, $notify); + }, $canceller); + } + + return new FulfilledPromise($promiseOrValue); +} + +/** + * Creates a rejected promise for the supplied `$promiseOrValue`. + * + * If `$promiseOrValue` is a value, it will be the rejection value of the + * returned promise. + * + * If `$promiseOrValue` is a promise, its completion value will be the rejected + * value of the returned promise. + * + * This can be useful in situations where you need to reject a promise without + * throwing an exception. For example, it allows you to propagate a rejection with + * the value of another promise. + * + * @param mixed $promiseOrValue + * @return PromiseInterface + */ +function reject($promiseOrValue = null) +{ + if ($promiseOrValue instanceof PromiseInterface) { + return resolve($promiseOrValue)->then(function ($value) { + return new RejectedPromise($value); + }); + } + + return new RejectedPromise($promiseOrValue); +} + +/** + * Returns a promise that will resolve only once all the items in + * `$promisesOrValues` have resolved. The resolution value of the returned promise + * will be an array containing the resolution values of each of the items in + * `$promisesOrValues`. + * + * @param array $promisesOrValues + * @return PromiseInterface + */ +function all($promisesOrValues) +{ + return map($promisesOrValues, function ($val) { + return $val; + }); +} + +/** + * Initiates a competitive race that allows one winner. Returns a promise which is + * resolved in the same way the first settled promise resolves. + * + * The returned promise will become **infinitely pending** if `$promisesOrValues` + * contains 0 items. + * + * @param array $promisesOrValues + * @return PromiseInterface + */ +function race($promisesOrValues) +{ + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($cancellationQueue, $resolve, $reject, $notify) { + if (!is_array($array) || !$array) { + $resolve(); + return; + } + + foreach ($array as $promiseOrValue) { + $cancellationQueue->enqueue($promiseOrValue); + + resolve($promiseOrValue) + ->done($resolve, $reject, $notify); + } + }, $reject, $notify); + }, $cancellationQueue); +} + +/** + * Returns a promise that will resolve when any one of the items in + * `$promisesOrValues` resolves. The resolution value of the returned promise + * will be the resolution value of the triggering item. + * + * The returned promise will only reject if *all* items in `$promisesOrValues` are + * rejected. The rejection value will be an array of all rejection reasons. + * + * The returned promise will also reject with a `React\Promise\Exception\LengthException` + * if `$promisesOrValues` contains 0 items. + * + * @param array $promisesOrValues + * @return PromiseInterface + */ +function any($promisesOrValues) +{ + return some($promisesOrValues, 1) + ->then(function ($val) { + return \array_shift($val); + }); +} + +/** + * Returns a promise that will resolve when `$howMany` of the supplied items in + * `$promisesOrValues` resolve. The resolution value of the returned promise + * will be an array of length `$howMany` containing the resolution values of the + * triggering items. + * + * The returned promise will reject if it becomes impossible for `$howMany` items + * to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items + * reject). The rejection value will be an array of + * `(count($promisesOrValues) - $howMany) + 1` rejection reasons. + * + * The returned promise will also reject with a `React\Promise\Exception\LengthException` + * if `$promisesOrValues` contains less items than `$howMany`. + * + * @param array $promisesOrValues + * @param int $howMany + * @return PromiseInterface + */ +function some($promisesOrValues, $howMany) +{ + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $howMany, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($howMany, $cancellationQueue, $resolve, $reject, $notify) { + if (!\is_array($array) || $howMany < 1) { + $resolve([]); + return; + } + + $len = \count($array); + + if ($len < $howMany) { + throw new Exception\LengthException( + \sprintf( + 'Input array must contain at least %d item%s but contains only %s item%s.', + $howMany, + 1 === $howMany ? '' : 's', + $len, + 1 === $len ? '' : 's' + ) + ); + } + + $toResolve = $howMany; + $toReject = ($len - $toResolve) + 1; + $values = []; + $reasons = []; + + foreach ($array as $i => $promiseOrValue) { + $fulfiller = function ($val) use ($i, &$values, &$toResolve, $toReject, $resolve) { + if ($toResolve < 1 || $toReject < 1) { + return; + } + + $values[$i] = $val; + + if (0 === --$toResolve) { + $resolve($values); + } + }; + + $rejecter = function ($reason) use ($i, &$reasons, &$toReject, $toResolve, $reject) { + if ($toResolve < 1 || $toReject < 1) { + return; + } + + $reasons[$i] = $reason; + + if (0 === --$toReject) { + $reject($reasons); + } + }; + + $cancellationQueue->enqueue($promiseOrValue); + + resolve($promiseOrValue) + ->done($fulfiller, $rejecter, $notify); + } + }, $reject, $notify); + }, $cancellationQueue); +} + +/** + * Traditional map function, similar to `array_map()`, but allows input to contain + * promises and/or values, and `$mapFunc` may return either a value or a promise. + * + * The map function receives each item as argument, where item is a fully resolved + * value of a promise or value in `$promisesOrValues`. + * + * @param array $promisesOrValues + * @param callable $mapFunc + * @return PromiseInterface + */ +function map($promisesOrValues, callable $mapFunc) +{ + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $mapFunc, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($mapFunc, $cancellationQueue, $resolve, $reject, $notify) { + if (!\is_array($array) || !$array) { + $resolve([]); + return; + } + + $toResolve = \count($array); + $values = []; + + foreach ($array as $i => $promiseOrValue) { + $cancellationQueue->enqueue($promiseOrValue); + $values[$i] = null; + + resolve($promiseOrValue) + ->then($mapFunc) + ->done( + function ($mapped) use ($i, &$values, &$toResolve, $resolve) { + $values[$i] = $mapped; + + if (0 === --$toResolve) { + $resolve($values); + } + }, + $reject, + $notify + ); + } + }, $reject, $notify); + }, $cancellationQueue); +} + +/** + * Traditional reduce function, similar to `array_reduce()`, but input may contain + * promises and/or values, and `$reduceFunc` may return either a value or a + * promise, *and* `$initialValue` may be a promise or a value for the starting + * value. + * + * @param array $promisesOrValues + * @param callable $reduceFunc + * @param mixed $initialValue + * @return PromiseInterface + */ +function reduce($promisesOrValues, callable $reduceFunc, $initialValue = null) +{ + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $reduceFunc, $initialValue, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($reduceFunc, $initialValue, $cancellationQueue, $resolve, $reject, $notify) { + if (!\is_array($array)) { + $array = []; + } + + $total = \count($array); + $i = 0; + + // Wrap the supplied $reduceFunc with one that handles promises and then + // delegates to the supplied. + $wrappedReduceFunc = function ($current, $val) use ($reduceFunc, $cancellationQueue, $total, &$i) { + $cancellationQueue->enqueue($val); + + return $current + ->then(function ($c) use ($reduceFunc, $total, &$i, $val) { + return resolve($val) + ->then(function ($value) use ($reduceFunc, $total, &$i, $c) { + return $reduceFunc($c, $value, $i++, $total); + }); + }); + }; + + $cancellationQueue->enqueue($initialValue); + + \array_reduce($array, $wrappedReduceFunc, resolve($initialValue)) + ->done($resolve, $reject, $notify); + }, $reject, $notify); + }, $cancellationQueue); +} + +/** + * @internal + */ +function _checkTypehint(callable $callback, $object) +{ + if (!\is_object($object)) { + return true; + } + + if (\is_array($callback)) { + $callbackReflection = new \ReflectionMethod($callback[0], $callback[1]); + } elseif (\is_object($callback) && !$callback instanceof \Closure) { + $callbackReflection = new \ReflectionMethod($callback, '__invoke'); + } else { + $callbackReflection = new \ReflectionFunction($callback); + } + + $parameters = $callbackReflection->getParameters(); + + if (!isset($parameters[0])) { + return true; + } + + $expectedException = $parameters[0]; + + // PHP before v8 used an easy API: + if (\PHP_VERSION_ID < 70100 || \defined('HHVM_VERSION')) { + if (!$expectedException->getClass()) { + return true; + } + + return $expectedException->getClass()->isInstance($object); + } + + // Extract the type of the argument and handle different possibilities + $type = $expectedException->getType(); + + $isTypeUnion = true; + $types = []; + + switch (true) { + case $type === null: + break; + case $type instanceof \ReflectionNamedType: + $types = [$type]; + break; + case $type instanceof \ReflectionIntersectionType: + $isTypeUnion = false; + case $type instanceof \ReflectionUnionType; + $types = $type->getTypes(); + break; + default: + throw new \LogicException('Unexpected return value of ReflectionParameter::getType'); + } + + // If there is no type restriction, it matches + if (empty($types)) { + return true; + } + + foreach ($types as $type) { + if (!$type instanceof \ReflectionNamedType) { + throw new \LogicException('This implementation does not support groups of intersection or union types'); + } + + // A named-type can be either a class-name or a built-in type like string, int, array, etc. + $matches = ($type->isBuiltin() && \gettype($object) === $type->getName()) + || (new \ReflectionClass($type->getName()))->isInstance($object); + + + // If we look for a single match (union), we can return early on match + // If we look for a full match (intersection), we can return early on mismatch + if ($matches) { + if ($isTypeUnion) { + return true; + } + } else { + if (!$isTypeUnion) { + return false; + } + } + } + + // If we look for a single match (union) and did not return early, we matched no type and are false + // If we look for a full match (intersection) and did not return early, we matched all types and are true + return $isTypeUnion ? false : true; +} diff --git a/upload/system/storage/vendor/react/promise/src/functions_include.php b/upload/system/storage/vendor/react/promise/src/functions_include.php new file mode 100644 index 00000000000..bd0c54fd5c4 --- /dev/null +++ b/upload/system/storage/vendor/react/promise/src/functions_include.php @@ -0,0 +1,5 @@ + Date: Fri, 4 Mar 2022 13:45:31 +0000 Subject: [PATCH 04/39] Support for PHP 8.0 and 8.1 --- composer.json | 5 +- composer.lock | 100 ++++- .../vendor/composer/autoload_files.php | 9 +- .../vendor/composer/autoload_namespaces.php | 1 - .../storage/vendor/composer/autoload_psr4.php | 1 + .../vendor/composer/autoload_static.php | 24 +- .../storage/vendor/composer/installed.json | 103 ++++- .../storage/vendor/composer/installed.php | 19 +- .../vendor/twig/twig/.github/workflows/ci.yml | 68 ++-- .../twig/.github/workflows/documentation.yml | 2 +- .../system/storage/vendor/twig/twig/CHANGELOG | 362 +++--------------- .../storage/vendor/twig/twig/composer.json | 10 +- .../twig/twig/lib/Twig/BaseNodeVisitor.php | 14 - .../twig/twig/lib/Twig/Cache/Filesystem.php | 14 - .../vendor/twig/twig/lib/Twig/Cache/Null.php | 14 - .../twig/twig/lib/Twig/CacheInterface.php | 14 - .../vendor/twig/twig/lib/Twig/Compiler.php | 14 - .../twig/lib/Twig/ContainerRuntimeLoader.php | 14 - .../vendor/twig/twig/lib/Twig/Environment.php | 14 - .../vendor/twig/twig/lib/Twig/Error.php | 14 - .../twig/twig/lib/Twig/Error/Loader.php | 14 - .../twig/twig/lib/Twig/Error/Runtime.php | 14 - .../twig/twig/lib/Twig/Error/Syntax.php | 14 - .../twig/lib/Twig/ExistsLoaderInterface.php | 14 - .../twig/twig/lib/Twig/ExpressionParser.php | 14 - .../vendor/twig/twig/lib/Twig/Extension.php | 14 - .../twig/twig/lib/Twig/Extension/Core.php | 14 - .../twig/twig/lib/Twig/Extension/Debug.php | 14 - .../twig/twig/lib/Twig/Extension/Escaper.php | 14 - .../lib/Twig/Extension/GlobalsInterface.php | 14 - .../Twig/Extension/InitRuntimeInterface.php | 14 - .../twig/lib/Twig/Extension/Optimizer.php | 14 - .../twig/twig/lib/Twig/Extension/Profiler.php | 14 - .../twig/twig/lib/Twig/Extension/Sandbox.php | 14 - .../twig/twig/lib/Twig/Extension/Staging.php | 14 - .../twig/lib/Twig/Extension/StringLoader.php | 14 - .../twig/twig/lib/Twig/ExtensionInterface.php | 14 - .../twig/twig/lib/Twig/ExtensionSet.php | 14 - .../twig/lib/Twig/FactoryRuntimeLoader.php | 14 - .../Twig/FileExtensionEscapingStrategy.php | 14 - .../vendor/twig/twig/lib/Twig/Filter.php | 14 - .../vendor/twig/twig/lib/Twig/Function.php | 14 - .../vendor/twig/twig/lib/Twig/Lexer.php | 14 - .../twig/twig/lib/Twig/Loader/Array.php | 14 - .../twig/twig/lib/Twig/Loader/Chain.php | 14 - .../twig/twig/lib/Twig/Loader/Filesystem.php | 14 - .../twig/twig/lib/Twig/LoaderInterface.php | 14 - .../vendor/twig/twig/lib/Twig/Markup.php | 14 - .../vendor/twig/twig/lib/Twig/Node.php | 14 - .../twig/twig/lib/Twig/Node/AutoEscape.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Block.php | 14 - .../twig/lib/Twig/Node/BlockReference.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Body.php | 14 - .../twig/twig/lib/Twig/Node/CheckSecurity.php | 14 - .../twig/twig/lib/Twig/Node/Deprecated.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Do.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Embed.php | 14 - .../twig/twig/lib/Twig/Node/Expression.php | 14 - .../twig/lib/Twig/Node/Expression/Array.php | 14 - .../lib/Twig/Node/Expression/AssignName.php | 14 - .../twig/lib/Twig/Node/Expression/Binary.php | 14 - .../lib/Twig/Node/Expression/Binary/Add.php | 14 - .../lib/Twig/Node/Expression/Binary/And.php | 14 - .../Node/Expression/Binary/BitwiseAnd.php | 14 - .../Twig/Node/Expression/Binary/BitwiseOr.php | 14 - .../Node/Expression/Binary/BitwiseXor.php | 14 - .../Twig/Node/Expression/Binary/Concat.php | 14 - .../lib/Twig/Node/Expression/Binary/Div.php | 14 - .../Twig/Node/Expression/Binary/EndsWith.php | 14 - .../lib/Twig/Node/Expression/Binary/Equal.php | 14 - .../Twig/Node/Expression/Binary/FloorDiv.php | 14 - .../Twig/Node/Expression/Binary/Greater.php | 14 - .../Node/Expression/Binary/GreaterEqual.php | 14 - .../lib/Twig/Node/Expression/Binary/In.php | 14 - .../lib/Twig/Node/Expression/Binary/Less.php | 14 - .../Twig/Node/Expression/Binary/LessEqual.php | 14 - .../Twig/Node/Expression/Binary/Matches.php | 14 - .../lib/Twig/Node/Expression/Binary/Mod.php | 14 - .../lib/Twig/Node/Expression/Binary/Mul.php | 14 - .../Twig/Node/Expression/Binary/NotEqual.php | 14 - .../lib/Twig/Node/Expression/Binary/NotIn.php | 14 - .../lib/Twig/Node/Expression/Binary/Or.php | 14 - .../lib/Twig/Node/Expression/Binary/Power.php | 14 - .../lib/Twig/Node/Expression/Binary/Range.php | 14 - .../Node/Expression/Binary/StartsWith.php | 14 - .../lib/Twig/Node/Expression/Binary/Sub.php | 14 - .../Twig/Node/Expression/BlockReference.php | 14 - .../twig/lib/Twig/Node/Expression/Call.php | 14 - .../lib/Twig/Node/Expression/Conditional.php | 14 - .../lib/Twig/Node/Expression/Constant.php | 14 - .../twig/lib/Twig/Node/Expression/Filter.php | 14 - .../Twig/Node/Expression/Filter/Default.php | 14 - .../lib/Twig/Node/Expression/Function.php | 14 - .../twig/lib/Twig/Node/Expression/GetAttr.php | 14 - .../lib/Twig/Node/Expression/MethodCall.php | 14 - .../twig/lib/Twig/Node/Expression/Name.php | 14 - .../lib/Twig/Node/Expression/NullCoalesce.php | 14 - .../twig/lib/Twig/Node/Expression/Parent.php | 14 - .../lib/Twig/Node/Expression/TempName.php | 14 - .../twig/lib/Twig/Node/Expression/Test.php | 14 - .../Twig/Node/Expression/Test/Constant.php | 14 - .../lib/Twig/Node/Expression/Test/Defined.php | 14 - .../Twig/Node/Expression/Test/Divisibleby.php | 14 - .../lib/Twig/Node/Expression/Test/Even.php | 14 - .../lib/Twig/Node/Expression/Test/Null.php | 14 - .../lib/Twig/Node/Expression/Test/Odd.php | 14 - .../lib/Twig/Node/Expression/Test/Sameas.php | 14 - .../twig/lib/Twig/Node/Expression/Unary.php | 14 - .../lib/Twig/Node/Expression/Unary/Neg.php | 14 - .../lib/Twig/Node/Expression/Unary/Not.php | 14 - .../lib/Twig/Node/Expression/Unary/Pos.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Flush.php | 14 - .../vendor/twig/twig/lib/Twig/Node/For.php | 14 - .../twig/twig/lib/Twig/Node/ForLoop.php | 14 - .../vendor/twig/twig/lib/Twig/Node/If.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Import.php | 14 - .../twig/twig/lib/Twig/Node/Include.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Macro.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Module.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Print.php | 14 - .../twig/twig/lib/Twig/Node/Sandbox.php | 14 - .../twig/lib/Twig/Node/SandboxedPrint.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Set.php | 14 - .../twig/twig/lib/Twig/Node/Spaceless.php | 14 - .../vendor/twig/twig/lib/Twig/Node/Text.php | 14 - .../vendor/twig/twig/lib/Twig/Node/With.php | 14 - .../twig/lib/Twig/NodeCaptureInterface.php | 14 - .../twig/lib/Twig/NodeOutputInterface.php | 14 - .../twig/twig/lib/Twig/NodeTraverser.php | 14 - .../twig/lib/Twig/NodeVisitor/Escaper.php | 14 - .../twig/lib/Twig/NodeVisitor/Optimizer.php | 14 - .../lib/Twig/NodeVisitor/SafeAnalysis.php | 14 - .../twig/lib/Twig/NodeVisitor/Sandbox.php | 14 - .../twig/lib/Twig/NodeVisitorInterface.php | 14 - .../vendor/twig/twig/lib/Twig/Parser.php | 14 - .../twig/lib/Twig/Profiler/Dumper/Base.php | 14 - .../lib/Twig/Profiler/Dumper/Blackfire.php | 14 - .../twig/lib/Twig/Profiler/Dumper/Html.php | 14 - .../twig/lib/Twig/Profiler/Dumper/Text.php | 14 - .../lib/Twig/Profiler/Node/EnterProfile.php | 14 - .../lib/Twig/Profiler/Node/LeaveProfile.php | 14 - .../Twig/Profiler/NodeVisitor/Profiler.php | 14 - .../twig/twig/lib/Twig/Profiler/Profile.php | 14 - .../twig/lib/Twig/RuntimeLoaderInterface.php | 14 - .../twig/lib/Twig/Sandbox/SecurityError.php | 14 - .../Sandbox/SecurityNotAllowedFilterError.php | 14 - .../SecurityNotAllowedFunctionError.php | 14 - .../Sandbox/SecurityNotAllowedMethodError.php | 14 - .../SecurityNotAllowedPropertyError.php | 14 - .../Sandbox/SecurityNotAllowedTagError.php | 14 - .../twig/lib/Twig/Sandbox/SecurityPolicy.php | 14 - .../Twig/Sandbox/SecurityPolicyInterface.php | 14 - .../twig/twig/lib/Twig/SimpleFilter.php | 26 -- .../twig/twig/lib/Twig/SimpleFunction.php | 26 -- .../vendor/twig/twig/lib/Twig/SimpleTest.php | 26 -- .../vendor/twig/twig/lib/Twig/Source.php | 14 - .../lib/Twig/SourceContextLoaderInterface.php | 14 - .../vendor/twig/twig/lib/Twig/Template.php | 14 - .../twig/twig/lib/Twig/TemplateWrapper.php | 14 - .../vendor/twig/twig/lib/Twig/Test.php | 14 - .../lib/Twig/Test/IntegrationTestCase.php | 14 - .../twig/twig/lib/Twig/Test/NodeTestCase.php | 14 - .../vendor/twig/twig/lib/Twig/Token.php | 14 - .../vendor/twig/twig/lib/Twig/TokenParser.php | 14 - .../twig/lib/Twig/TokenParser/AutoEscape.php | 14 - .../twig/twig/lib/Twig/TokenParser/Block.php | 14 - .../twig/lib/Twig/TokenParser/Deprecated.php | 14 - .../twig/twig/lib/Twig/TokenParser/Do.php | 14 - .../twig/twig/lib/Twig/TokenParser/Embed.php | 14 - .../twig/lib/Twig/TokenParser/Extends.php | 14 - .../twig/twig/lib/Twig/TokenParser/Filter.php | 14 - .../twig/twig/lib/Twig/TokenParser/Flush.php | 14 - .../twig/twig/lib/Twig/TokenParser/For.php | 14 - .../twig/twig/lib/Twig/TokenParser/From.php | 14 - .../twig/twig/lib/Twig/TokenParser/If.php | 14 - .../twig/twig/lib/Twig/TokenParser/Import.php | 14 - .../twig/lib/Twig/TokenParser/Include.php | 14 - .../twig/twig/lib/Twig/TokenParser/Macro.php | 14 - .../twig/lib/Twig/TokenParser/Sandbox.php | 14 - .../twig/twig/lib/Twig/TokenParser/Set.php | 14 - .../twig/lib/Twig/TokenParser/Spaceless.php | 14 - .../twig/twig/lib/Twig/TokenParser/Use.php | 14 - .../twig/twig/lib/Twig/TokenParser/With.php | 14 - .../twig/lib/Twig/TokenParserInterface.php | 14 - .../vendor/twig/twig/lib/Twig/TokenStream.php | 14 - .../lib/Twig/Util/DeprecationCollector.php | 14 - .../lib/Twig/Util/TemplateDirIterator.php | 14 - .../twig/twig/src/Cache/CacheInterface.php | 22 +- .../twig/twig/src/Cache/FilesystemCache.php | 20 +- .../vendor/twig/twig/src/Cache/NullCache.php | 10 +- .../storage/vendor/twig/twig/src/Compiler.php | 57 +-- .../vendor/twig/twig/src/Environment.php | 292 ++++---------- .../vendor/twig/twig/src/Error/Error.php | 60 +-- .../twig/twig/src/Error/LoaderError.php | 2 - .../twig/twig/src/Error/RuntimeError.php | 2 - .../twig/twig/src/Error/SyntaxError.php | 4 +- .../vendor/twig/twig/src/ExpressionParser.php | 23 +- .../twig/src/Extension/AbstractExtension.php | 2 - .../twig/twig/src/Extension/CoreExtension.php | 151 +++++--- .../twig/src/Extension/DebugExtension.php | 4 +- .../twig/src/Extension/EscaperExtension.php | 21 +- .../twig/src/Extension/ExtensionInterface.php | 5 - .../twig/src/Extension/GlobalsInterface.php | 9 +- .../src/Extension/InitRuntimeInterface.php | 36 -- .../twig/src/Extension/OptimizerExtension.php | 6 +- .../twig/src/Extension/ProfilerExtension.php | 10 +- .../twig/src/Extension/SandboxExtension.php | 22 +- .../twig/src/Extension/StagingExtension.php | 22 +- .../src/Extension/StringLoaderExtension.php | 8 +- .../vendor/twig/twig/src/ExtensionSet.php | 106 +++-- .../src/FileExtensionEscapingStrategy.php | 4 +- .../storage/vendor/twig/twig/src/Lexer.php | 32 +- .../twig/twig/src/Loader/ArrayLoader.php | 21 +- .../twig/twig/src/Loader/ChainLoader.php | 17 +- .../twig/src/Loader/ExistsLoaderInterface.php | 23 -- .../twig/twig/src/Loader/FilesystemLoader.php | 85 ++-- .../twig/twig/src/Loader/LoaderInterface.php | 32 +- .../Loader/SourceContextLoaderInterface.php | 21 - .../storage/vendor/twig/twig/src/Markup.php | 2 - .../twig/twig/src/Node/AutoEscapeNode.php | 4 +- .../vendor/twig/twig/src/Node/BlockNode.php | 4 +- .../twig/twig/src/Node/BlockReferenceNode.php | 4 +- .../vendor/twig/twig/src/Node/BodyNode.php | 2 - .../twig/twig/src/Node/CheckSecurityNode.php | 4 +- .../twig/twig/src/Node/CheckToStringNode.php | 2 +- .../twig/twig/src/Node/DeprecatedNode.php | 4 +- .../vendor/twig/twig/src/Node/DoNode.php | 4 +- .../vendor/twig/twig/src/Node/EmbedNode.php | 4 +- .../Node/Expression/AbstractExpression.php | 2 - .../src/Node/Expression/ArrayExpression.php | 11 +- .../Expression/ArrowFunctionExpression.php | 2 +- .../Node/Expression/AssignNameExpression.php | 4 +- .../Node/Expression/Binary/AbstractBinary.php | 6 +- .../src/Node/Expression/Binary/AddBinary.php | 4 +- .../src/Node/Expression/Binary/AndBinary.php | 4 +- .../Expression/Binary/BitwiseAndBinary.php | 4 +- .../Expression/Binary/BitwiseOrBinary.php | 4 +- .../Expression/Binary/BitwiseXorBinary.php | 4 +- .../Node/Expression/Binary/ConcatBinary.php | 4 +- .../src/Node/Expression/Binary/DivBinary.php | 4 +- .../Node/Expression/Binary/EndsWithBinary.php | 6 +- .../Node/Expression/Binary/EqualBinary.php | 21 +- .../Node/Expression/Binary/FloorDivBinary.php | 6 +- .../Node/Expression/Binary/GreaterBinary.php | 21 +- .../Expression/Binary/GreaterEqualBinary.php | 21 +- .../src/Node/Expression/Binary/InBinary.php | 6 +- .../src/Node/Expression/Binary/LessBinary.php | 21 +- .../Expression/Binary/LessEqualBinary.php | 21 +- .../Node/Expression/Binary/MatchesBinary.php | 6 +- .../src/Node/Expression/Binary/ModBinary.php | 4 +- .../src/Node/Expression/Binary/MulBinary.php | 4 +- .../Node/Expression/Binary/NotEqualBinary.php | 21 +- .../Node/Expression/Binary/NotInBinary.php | 6 +- .../src/Node/Expression/Binary/OrBinary.php | 4 +- .../Node/Expression/Binary/PowerBinary.php | 4 +- .../Node/Expression/Binary/RangeBinary.php | 6 +- .../Expression/Binary/SpaceshipBinary.php | 2 +- .../Expression/Binary/StartsWithBinary.php | 6 +- .../src/Node/Expression/Binary/SubBinary.php | 4 +- .../Expression/BlockReferenceExpression.php | 4 +- .../src/Node/Expression/CallExpression.php | 9 +- .../Node/Expression/ConditionalExpression.php | 4 +- .../Node/Expression/ConstantExpression.php | 4 +- .../Node/Expression/Filter/DefaultFilter.php | 4 +- .../src/Node/Expression/FilterExpression.php | 4 +- .../Node/Expression/FunctionExpression.php | 2 - .../src/Node/Expression/GetAttrExpression.php | 4 +- .../twig/src/Node/Expression/InlinePrint.php | 4 +- .../Node/Expression/MethodCallExpression.php | 4 +- .../src/Node/Expression/NameExpression.php | 4 +- .../Expression/NullCoalesceExpression.php | 4 +- .../src/Node/Expression/ParentExpression.php | 4 +- .../Node/Expression/TempNameExpression.php | 4 +- .../src/Node/Expression/Test/ConstantTest.php | 4 +- .../src/Node/Expression/Test/DefinedTest.php | 4 +- .../Node/Expression/Test/DivisiblebyTest.php | 4 +- .../src/Node/Expression/Test/EvenTest.php | 4 +- .../src/Node/Expression/Test/NullTest.php | 4 +- .../twig/src/Node/Expression/Test/OddTest.php | 4 +- .../src/Node/Expression/Test/SameasTest.php | 4 +- .../src/Node/Expression/TestExpression.php | 4 +- .../Node/Expression/Unary/AbstractUnary.php | 6 +- .../src/Node/Expression/Unary/NegUnary.php | 6 +- .../src/Node/Expression/Unary/NotUnary.php | 6 +- .../src/Node/Expression/Unary/PosUnary.php | 6 +- .../Node/Expression/VariadicExpression.php | 2 +- .../vendor/twig/twig/src/Node/FlushNode.php | 4 +- .../vendor/twig/twig/src/Node/ForLoopNode.php | 23 +- .../vendor/twig/twig/src/Node/ForNode.php | 36 +- .../vendor/twig/twig/src/Node/IfNode.php | 4 +- .../vendor/twig/twig/src/Node/ImportNode.php | 4 +- .../vendor/twig/twig/src/Node/IncludeNode.php | 6 +- .../vendor/twig/twig/src/Node/MacroNode.php | 4 +- .../vendor/twig/twig/src/Node/ModuleNode.php | 14 +- .../vendor/twig/twig/src/Node/Node.php | 74 +--- .../twig/src/Node/NodeCaptureInterface.php | 2 - .../twig/src/Node/NodeOutputInterface.php | 2 - .../vendor/twig/twig/src/Node/PrintNode.php | 4 +- .../vendor/twig/twig/src/Node/SandboxNode.php | 4 +- .../twig/twig/src/Node/SandboxedPrintNode.php | 54 --- .../vendor/twig/twig/src/Node/SetNode.php | 4 +- .../twig/twig/src/Node/SpacelessNode.php | 49 --- .../vendor/twig/twig/src/Node/TextNode.php | 4 +- .../vendor/twig/twig/src/Node/WithNode.php | 16 +- .../vendor/twig/twig/src/NodeTraverser.php | 15 +- .../src/NodeVisitor/AbstractNodeVisitor.php | 6 +- .../src/NodeVisitor/EscaperNodeVisitor.php | 26 +- .../MacroAutoImportNodeVisitor.php | 8 +- .../src/NodeVisitor/NodeVisitorInterface.php | 9 +- .../src/NodeVisitor/OptimizerNodeVisitor.php | 24 +- .../NodeVisitor/SafeAnalysisNodeVisitor.php | 22 +- .../src/NodeVisitor/SandboxNodeVisitor.php | 17 +- .../storage/vendor/twig/twig/src/Parser.php | 117 ++---- .../twig/src/Profiler/Dumper/BaseDumper.php | 10 +- .../src/Profiler/Dumper/BlackfireDumper.php | 8 +- .../twig/src/Profiler/Dumper/HtmlDumper.php | 10 +- .../twig/src/Profiler/Dumper/TextDumper.php | 8 +- .../src/Profiler/Node/EnterProfileNode.php | 4 +- .../src/Profiler/Node/LeaveProfileNode.php | 4 +- .../NodeVisitor/ProfilerNodeVisitor.php | 12 +- .../vendor/twig/twig/src/Profiler/Profile.php | 50 +-- .../RuntimeLoader/ContainerRuntimeLoader.php | 8 +- .../RuntimeLoader/FactoryRuntimeLoader.php | 14 +- .../RuntimeLoader/RuntimeLoaderInterface.php | 6 +- .../twig/twig/src/Sandbox/SecurityError.php | 2 - .../Sandbox/SecurityNotAllowedFilterError.php | 21 +- .../SecurityNotAllowedFunctionError.php | 21 +- .../Sandbox/SecurityNotAllowedMethodError.php | 21 +- .../SecurityNotAllowedPropertyError.php | 21 +- .../Sandbox/SecurityNotAllowedTagError.php | 21 +- .../twig/twig/src/Sandbox/SecurityPolicy.php | 18 +- .../src/Sandbox/SecurityPolicyInterface.php | 8 +- .../storage/vendor/twig/twig/src/Source.php | 4 +- .../storage/vendor/twig/twig/src/Template.php | 21 +- .../vendor/twig/twig/src/TemplateWrapper.php | 36 -- .../twig/src/Test/IntegrationTestCase.php | 2 - .../twig/twig/src/Test/NodeTestCase.php | 4 +- .../storage/vendor/twig/twig/src/Token.php | 47 +-- .../src/TokenParser/AbstractTokenParser.php | 4 +- .../twig/src/TokenParser/ApplyTokenParser.php | 8 +- .../src/TokenParser/AutoEscapeTokenParser.php | 11 +- .../twig/src/TokenParser/BlockTokenParser.php | 10 +- .../src/TokenParser/DeprecatedTokenParser.php | 11 +- .../twig/src/TokenParser/DoTokenParser.php | 9 +- .../twig/src/TokenParser/EmbedTokenParser.php | 11 +- .../src/TokenParser/ExtendsTokenParser.php | 10 +- .../src/TokenParser/FilterTokenParser.php | 64 ---- .../twig/src/TokenParser/FlushTokenParser.php | 9 +- .../twig/src/TokenParser/ForTokenParser.php | 75 +--- .../twig/src/TokenParser/FromTokenParser.php | 9 +- .../twig/src/TokenParser/IfTokenParser.php | 12 +- .../src/TokenParser/ImportTokenParser.php | 9 +- .../src/TokenParser/IncludeTokenParser.php | 9 +- .../twig/src/TokenParser/MacroTokenParser.php | 10 +- .../src/TokenParser/SandboxTokenParser.php | 11 +- .../twig/src/TokenParser/SetTokenParser.php | 11 +- .../src/TokenParser/SpacelessTokenParser.php | 56 --- .../src/TokenParser/TokenParserInterface.php | 10 +- .../twig/src/TokenParser/UseTokenParser.php | 8 +- .../twig/src/TokenParser/WithTokenParser.php | 11 +- .../vendor/twig/twig/src/TokenStream.php | 2 - .../vendor/twig/twig/src/TwigFilter.php | 50 +-- .../vendor/twig/twig/src/TwigFunction.php | 46 +-- .../storage/vendor/twig/twig/src/TwigTest.php | 37 +- .../twig/src/Util/DeprecationCollector.php | 6 +- .../twig/src/Util/TemplateDirIterator.php | 2 - 366 files changed, 1233 insertions(+), 4934 deletions(-) delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Cache/Filesystem.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Cache/Null.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/CacheInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Compiler.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Environment.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Error.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Error/Loader.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Error/Runtime.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Error/Syntax.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/ExpressionParser.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/Core.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/Debug.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/Escaper.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/Optimizer.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/Profiler.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/Sandbox.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/Staging.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Extension/StringLoader.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/ExtensionInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/ExtensionSet.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Filter.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Function.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Lexer.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Loader/Array.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Loader/Chain.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Loader/Filesystem.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/LoaderInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Markup.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/AutoEscape.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Block.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/BlockReference.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Body.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Deprecated.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Do.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Embed.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Array.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Call.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Function.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Name.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Flush.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/For.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/ForLoop.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/If.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Import.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Include.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Macro.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Module.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Print.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Sandbox.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Set.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Spaceless.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/Text.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Node/With.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeCaptureInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeOutputInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeTraverser.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Parser.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Profiler/Profile.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/SimpleFilter.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/SimpleFunction.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/SimpleTest.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Source.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Template.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TemplateWrapper.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Test.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Token.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Block.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Deprecated.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Do.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Embed.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Extends.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Filter.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Flush.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/For.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/From.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/If.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Import.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Include.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Macro.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Set.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/Use.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParser/With.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenParserInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/TokenStream.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php delete mode 100644 upload/system/storage/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php delete mode 100644 upload/system/storage/vendor/twig/twig/src/Extension/InitRuntimeInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php delete mode 100644 upload/system/storage/vendor/twig/twig/src/Node/SandboxedPrintNode.php delete mode 100644 upload/system/storage/vendor/twig/twig/src/Node/SpacelessNode.php delete mode 100644 upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php delete mode 100644 upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php diff --git a/composer.json b/composer.json index f0c18f0f82d..6fb4e0c1cb8 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "divido/divido-php": ">=1.1.1", "php": ">=5.4.0", "scssphp/scssphp": "1.1.1", - "twig/twig": "^2.4.8", - "zoujingli/wechat-php-sdk": ">=1.3.10" + "zoujingli/wechat-php-sdk": ">=1.3.10", + "react/promise": "^2.9", + "twig/twig": "^3.3" } } diff --git a/composer.lock b/composer.lock index 1245f44d0e5..323eccd2121 100644 --- a/composer.lock +++ b/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": "250646499513c930cfed79a457f63377", + "content-hash": "adb758cb3c253a2696bebce3d0f782a8", "packages": [ { "name": "braintree/braintree_php", @@ -562,6 +562,82 @@ }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "react/promise", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-02-11T10:27:51+00:00" + }, { "name": "scssphp/scssphp", "version": "1.1.1", @@ -1308,23 +1384,22 @@ }, { "name": "twig/twig", - "version": "v2.14.11", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "66baa66f29ee30e487e05f1679903e36eb01d727" + "reference": "972d8604a92b7054828b539f2febb0211dd5945c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/66baa66f29ee30e487e05f1679903e36eb01d727", - "reference": "66baa66f29ee30e487e05f1679903e36eb01d727", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/972d8604a92b7054828b539f2febb0211dd5945c", + "reference": "972d8604a92b7054828b539f2febb0211dd5945c", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.8" + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "psr/container": "^1.0", @@ -1333,13 +1408,10 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.14-dev" + "dev-master": "3.3-dev" } }, "autoload": { - "psr-0": { - "Twig_": "lib/" - }, "psr-4": { "Twig\\": "src/" } @@ -1372,7 +1444,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v2.14.11" + "source": "https://github.com/twigphp/Twig/tree/v3.3.8" }, "funding": [ { @@ -1384,7 +1456,7 @@ "type": "tidelift" } ], - "time": "2022-02-04T06:57:25+00:00" + "time": "2022-02-04T06:59:48+00:00" }, { "name": "zoujingli/wechat-php-sdk", diff --git a/upload/system/storage/vendor/composer/autoload_files.php b/upload/system/storage/vendor/composer/autoload_files.php index 56f63ce0664..42105d2beac 100644 --- a/upload/system/storage/vendor/composer/autoload_files.php +++ b/upload/system/storage/vendor/composer/autoload_files.php @@ -6,14 +6,15 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', + 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_namespaces.php b/upload/system/storage/vendor/composer/autoload_namespaces.php index 89454da8809..1587c87c778 100644 --- a/upload/system/storage/vendor/composer/autoload_namespaces.php +++ b/upload/system/storage/vendor/composer/autoload_namespaces.php @@ -6,7 +6,6 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - 'Twig_' => array($vendorDir . '/twig/twig/lib'), 'Divido' => array($vendorDir . '/divido/divido-php/lib'), 'Braintree' => array($vendorDir . '/braintree/braintree_php/lib'), ); diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index 3f34da9ad04..6a138b1cb64 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -17,6 +17,7 @@ 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'), 'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'), 'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'), + 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'GuzzleHttp\\Subscriber\\Oauth\\' => array($vendorDir . '/guzzlehttp/oauth-subscriber/src'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index e5cc2988e82..f3ca7275c89 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -7,16 +7,17 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 { public static $files = array ( - '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', + 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', ); public static $prefixLengthsPsr4 = array ( @@ -40,6 +41,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 'Symfony\\Component\\Validator\\' => 28, 'ScssPhp\\ScssPhp\\' => 16, ), + 'R' => + array ( + 'React\\Promise\\' => 14, + ), 'P' => array ( 'Psr\\Http\\Message\\' => 17, @@ -102,6 +107,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/scssphp/scssphp/src', ), + 'React\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/react/promise/src', + ), 'Psr\\Http\\Message\\' => array ( 0 => __DIR__ . '/..' . '/psr/http-message/src', @@ -129,13 +138,6 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ); public static $prefixesPsr0 = array ( - 'T' => - array ( - 'Twig_' => - array ( - 0 => __DIR__ . '/..' . '/twig/twig/lib', - ), - ), 'D' => array ( 'Divido' => diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 783747bf5a3..a1abcc60bc7 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -576,6 +576,85 @@ }, "install-path": "../ralouphie/getallheaders" }, + { + "name": "react/promise", + "version": "v2.9.0", + "version_normalized": "2.9.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, + "time": "2022-02-11T10:27:51+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "install-path": "../react/promise" + }, { "name": "scssphp/scssphp", "version": "1.1.1", @@ -1345,41 +1424,37 @@ }, { "name": "twig/twig", - "version": "v2.14.11", - "version_normalized": "2.14.11.0", + "version": "v3.3.8", + "version_normalized": "3.3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "66baa66f29ee30e487e05f1679903e36eb01d727" + "reference": "972d8604a92b7054828b539f2febb0211dd5945c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/66baa66f29ee30e487e05f1679903e36eb01d727", - "reference": "66baa66f29ee30e487e05f1679903e36eb01d727", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/972d8604a92b7054828b539f2febb0211dd5945c", + "reference": "972d8604a92b7054828b539f2febb0211dd5945c", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.8" + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "psr/container": "^1.0", "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, - "time": "2022-02-04T06:57:25+00:00", + "time": "2022-02-04T06:59:48+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.14-dev" + "dev-master": "3.3-dev" } }, "installation-source": "dist", "autoload": { - "psr-0": { - "Twig_": "lib/" - }, "psr-4": { "Twig\\": "src/" } @@ -1412,7 +1487,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v2.14.11" + "source": "https://github.com/twigphp/Twig/tree/v3.3.8" }, "funding": [ { diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 62287f14880..ee720c99be0 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '58e1d302e465df7215c4464d8e95f47edbc15682', + 'reference' => 'e2f6a88815b0dc0372df8d8d4a8f503a8846a611', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '58e1d302e465df7215c4464d8e95f47edbc15682', + 'reference' => 'e2f6a88815b0dc0372df8d8d4a8f503a8846a611', 'dev_requirement' => false, ), 'psr/http-message' => array( @@ -106,6 +106,15 @@ 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'dev_requirement' => false, ), + 'react/promise' => array( + 'pretty_version' => 'v2.9.0', + 'version' => '2.9.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/promise', + 'aliases' => array(), + 'reference' => '234f8fd1023c9158e2314fa9d7d0e6a83db42910', + 'dev_requirement' => false, + ), 'scssphp/scssphp' => array( 'pretty_version' => '1.1.1', 'version' => '1.1.1.0', @@ -188,12 +197,12 @@ 'dev_requirement' => false, ), 'twig/twig' => array( - 'pretty_version' => 'v2.14.11', - 'version' => '2.14.11.0', + 'pretty_version' => 'v3.3.8', + 'version' => '3.3.8.0', 'type' => 'library', 'install_path' => __DIR__ . '/../twig/twig', 'aliases' => array(), - 'reference' => '66baa66f29ee30e487e05f1679903e36eb01d727', + 'reference' => '972d8604a92b7054828b539f2febb0211dd5945c', 'dev_requirement' => false, ), 'zoujingli/wechat-php-sdk' => array( diff --git a/upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml b/upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml index df60b6a3d60..140483cc751 100644 --- a/upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml +++ b/upload/system/storage/vendor/twig/twig/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - '2.x' + - '3.x' env: SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1 @@ -20,7 +20,6 @@ jobs: strategy: matrix: php-version: - - '7.1.3' - '7.2.5' - '7.3' - '7.4' @@ -85,6 +84,7 @@ jobs: - '8.0' - '8.1' extension: + - 'extra/cache-extra' - 'extra/cssinliner-extra' - 'extra/html-extra' - 'extra/inky-extra' @@ -140,34 +140,36 @@ jobs: - name: "Run tests" working-directory: ${{ matrix.extension}} run: ../../vendor/bin/simple-phpunit - - integration-tests: - needs: - - 'tests' - - name: "Integration tests with PHP ${{ matrix.php-version }}" - - runs-on: 'ubuntu-20.04' - - continue-on-error: true - - strategy: - matrix: - php-version: - - '7.3' - - steps: - - name: "Checkout code" - uses: actions/checkout@v2.3.3 - - - name: "Install PHP with extensions" - uses: shivammathur/setup-php@2.7.0 - with: - coverage: "none" - extensions: "gd, pdo_sqlite" - php-version: ${{ matrix.php-version }} - ini-values: memory_limit=-1 - tools: composer:v2 - - - run: bash ./tests/drupal_test.sh - shell: "bash" +# +# Drupal does not support Twig 3 now! +# +# integration-tests: +# needs: +# - 'tests' +# +# name: "Integration tests with PHP ${{ matrix.php-version }}" +# +# runs-on: 'ubuntu-20.04' +# +# continue-on-error: true +# +# strategy: +# matrix: +# php-version: +# - '7.3' +# +# steps: +# - name: "Checkout code" +# uses: actions/checkout@v2.3.3 +# +# - name: "Install PHP with extensions" +# uses: shivammathur/setup-php@2.7.0 +# with: +# coverage: "none" +# extensions: "gd, pdo_sqlite" +# php-version: ${{ matrix.php-version }} +# ini-values: memory_limit=-1 +# tools: composer:v2 +# +# - run: bash ./tests/drupal_test.sh +# shell: "bash" diff --git a/upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml b/upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml index 8bf2409679f..0b3ca71594d 100644 --- a/upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml +++ b/upload/system/storage/vendor/twig/twig/.github/workflows/documentation.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - '1.x' + - '3.x' jobs: build: diff --git a/upload/system/storage/vendor/twig/twig/CHANGELOG b/upload/system/storage/vendor/twig/twig/CHANGELOG index 3aaa9aac0b3..459c05af516 100644 --- a/upload/system/storage/vendor/twig/twig/CHANGELOG +++ b/upload/system/storage/vendor/twig/twig/CHANGELOG @@ -1,376 +1,120 @@ -# 2.14.11 (2022-02-04) +# 3.3.8 (2022-02-04) * Fix a security issue when in a sandbox: the `sort` filter must require a Closure for the `arrow` parameter -# 2.14.10 (2022-01-03) +# 3.3.7 (2022-01-03) - * Allow more null arguments when Twig expects a string (for better 8.1 support) +* Allow more null support when Twig expects a string (for better 8.1 support) +* Only use Commonmark extensions if markdown enabled -# 2.14.9 (2022-01-03) +# 3.3.6 (2022-01-03) +* Only use Commonmark extensions if markdown enabled + +# 3.3.5 (2022-01-03) + +* Allow CommonMark extensions to easily be added * Allow null when Twig expects a string (for better 8.1 support) -* Add support for PHP 7.1 back * Make some performance optimizations * Allow Symfony translation contract v3+ -# 2.14.8 (2021-11-25) +# 3.3.4 (2021-11-25) * Bump minimum supported Symfony component versions * Fix a deprecated message -# 2.14.7 (2021-09-17) +# 3.3.3 (2021-09-17) * Allow Symfony 6 * Improve compatibility with PHP 8.1 * Explicitly specify the encoding for mb_ord in JS escaper - -# 2.14.6 (2021-05-16) + +# 3.3.2 (2021-05-16) * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" -# 2.14.5 (2021-05-12) +# 3.3.1 (2021-05-12) * Fix PHP 8.1 compatibility * Throw a proper exception when a template name is an absolute path (as it has never been supported) -# 2.14.4 (2021-03-10) +# 3.3.0 (2021-02-08) + * Fix macro calls in a "cache" tag * Add the slug filter + * Allow extra bundle to be compatible with Twig 2 -# 2.14.3 (2021-01-05) +# 3.2.1 (2021-01-05) * Fix extra bundle compat with older versions of Symfony -# 2.14.2 (2021-01-05) +# 3.2.0 (2021-01-05) + * Add the Cache extension in the "extra" repositories: "cache" tag + * Add "registerUndefinedTokenParserCallback" + * Mark built-in node visitors as @internal * Fix "odd" not working for negative numbers -# 2.14.1 (2020-10-27) +# 3.1.1 (2020-10-27) -* Fix "include(template_from_string())" + * Fix "include(template_from_string())" -# 2.14.0 (2020-10-21) +# 3.1.0 (2020-10-21) * Fix sandbox support when using "include(template_from_string())" * Make round brackets optional for one argument tests like "same as" or "divisible by" * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a } - * Drop PHP 7.1 support -# 2.13.1 (2020-08-05) +# 3.0.5 (2020-08-05) + * Fix twig_compare w.r.t. whitespace trimming * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag * Fix a regression when not using a space before an operator * Restrict callables to closures in filters * Allow trailing commas in argument lists (in calls as well as definitions) -# 2.13.0 (2020-07-05) +# 3.0.4 (2020-07-05) + * Fix comparison operators * Fix options not taken into account when using "Michelf\MarkdownExtra" * Fix "Twig\Extra\Intl\IntlExtension::getCountryName()" to accept "null" as a first argument - * Drop support for PHP 7.0 * Throw exception in case non-Traversable data is passed to "filter" * Fix context optimization on PHP 7.4 * Fix PHP 8 compatibility * Fix ambiguous syntax parsing -# 2.12.5 (2020-02-11) +# 3.0.3 (2020-02-11) * Add a check to ensure that iconv() is defined -# 2.12.4 (2020-02-11) +# 3.0.2 (2020-02-11) * Avoid exceptions when an intl resource is not found * Fix implementation of case-insensitivity for method names -# 2.12.3 (2019-12-28) +# 3.0.1 (2019-12-28) * fixed Symfony 5.0 support for the HTML extra extension - * fixed number formatter in Intl extra extension when using a formatter prototype - -# 2.12.2 (2019-11-11) - - * added supported for exponential numbers - -# 2.12.1 (2019-10-17) - - * added the String extension in the "extra" repositories: "u" filter - -# 2.12.0 (2019-10-05) - - * added the spaceship operator ("<=>"), useful when using an arrow function in the "sort" filter - * added support for an "arrow" function on the "sort" filter - * added the CssInliner extension in the "extra" repositories: "inline_css" - filter - * added the Inky extension in the "extra" repositories: "inky_to_html" filter - * added Intl extension in the "extra" repositories: "country_name", - "currency_name", "currency_symbol", "language_name", "locale_name", - "timezone_name", "format_currency", "format_number", - "format_*_number", "format_datetime", "format_date", and "format_time" - filters, and the "country_timezones" function - * added the Markdown extension in the "extra" repositories: "markdown_to_html", - and "html_to_markdown" filters - * added the HtmlExtension extension in the "extra" repositories: "date_uri" - filter, and "html_classes" function - * optimized "block('foo') ?? 'bar'" - * fixed the empty test on Traversable instances - * fixed array_key_exists() on objects - * fixed cache when opcache is installed but disabled - * fixed using macros in arrow functions - * fixed split filter on edge case - -# 2.11.3 (2019-06-18) - - * display partial output (PHP buffer) when an error occurs in debug mode - * fixed the filter filter (allow the result to be used several times) - * fixed macro auto-import when a template contains only macros - -# 2.11.2 (2019-06-05) - - * fixed macro auto-import - -# 2.11.1 (2019-06-04) - - * added support for "Twig\Markup" instances in the "in" test (again) - * allowed string operators as variables names in assignments - * fixed support for macros defined in parent templates - -# 2.11.0 (2019-05-31) - - * added the possibility to register classes/interfaces as being safe for the escaper ("EscaperExtension::addSafeClass()") - * deprecated CoreExtension::setEscaper() and CoreExtension::getEscapers() in favor of the same methods on EscaperExtension - * macros are now auto-imported in the template they are defined (under the ``_self`` variable) - * added support for macros on "is defined" tests - * fixed macros "import" when using the same name in the parent and child templates - * fixed recursive macros - * macros imported "globally" in a template are now available in macros without re-importing them - * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance) - * fixed a PHP fatal error when calling a macro imported in a block in a nested block - * fixed a PHP fatal error when calling a macro imported in the template in another macro - * fixed wrong error message on "import" and "from" - -# 2.10.0 (2019-05-14) - - * deprecated "if" conditions on "for" tags - * added "filter", "map", and "reduce" filters (and support for arrow functions) - * fixed partial output leak when a PHP fatal error occurs - * optimized context access on PHP 7.4 - -# 2.9.0 (2019-04-28) - - * deprecated returning "false" to remove a Node from NodeVisitorInterface::leaveNode() - * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) - * deprecated the "filter" tag (use the "apply" tag instead) - * added the "apply" tag as a replacement for the "filter" tag - * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning) - * added support for "Twig\Markup" instances in the "in" test - * fixed "import" when macros are stored in a template string - * fixed Lexer when using custom options containing the # char - * added template line number to twig_get_attribute() - -# 2.8.1 (2019-04-16) - - * fixed EscaperNodeVisitor - * deprecated passing a 3rd, 4th, and 5th arguments to the Sandbox exception classes - * deprecated Node::setTemplateName() in favor of Node::setSourceContext() - -# 2.8.0 (2019-04-16) - - * added Traversable support for the length filter - * fixed some wrong location in error messages - * made exception creation faster - * made escaping on ternary expressions (?: and ??) more fine-grained - * added the possibility to give a nice name to string templates (template_from_string function) - * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags) - * fixed "include" with "ignore missing" when an error loading occurs in the included template - * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) - * added the "column" filter - -# 2.7.4 (2019-03-23) - - * fixed variadic support - * fixed CheckToStringNode implementation (broken when a function/filter is variadic) - -# 2.7.3 (2019-03-21) - - * fixed the spaceless filter so that it behaves like the spaceless tag - * fixed BC break on Environment::resolveTemplate() - * allowed Traversable objects to be used in the "with" tag - * allowed Traversable objects to be used in the "with" tag - * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags - -# 2.7.2 (2019-03-12) - - * added TemplateWrapper::getTemplateName() - -# 2.7.1 (2019-03-12) - - * fixed class aliases - -# 2.7.0 (2019-03-12) - - * fixed sandbox security issue (under some circumstances, calling the - __toString() method on an object was possible even if not allowed by the - security policy) - * fixed batch filter clobbers array keys when fill parameter is used - * added preserveKeys support for the batch filter - * fixed "embed" support when used from "template_from_string" - * deprecated passing a Twig\Template to Twig\Environment::load()/Twig\Environment::resolveTemplate() - * added the possibility to pass a TemplateWrapper to Twig\Environment::load() - * marked Twig\Environment::getTemplateClass() as internal (implementation detail) - * improved the performance of the sandbox - * deprecated the spaceless tag - * added a spaceless filter - * added max value to the "random" function - * deprecated Twig\Extension\InitRuntimeInterface - * deprecated Twig\Loader\ExistsLoaderInterface - * deprecated PSR-0 classes in favor of namespaced ones - * made namespace classes the default classes (PSR-0 ones are aliases now) - * added Twig\Loader\ChainLoader::getLoaders() - * removed duplicated directory separator in FilesystemLoader - * deprecated the "base_template_class" option on Twig\Environment - * deprecated the Twig\Environment::getBaseTemplateClass() and - Twig\Environment::setBaseTemplateClass() methods - * changed internal code to use the namespaced classes as much as possible - * deprecated Twig_Parser::isReservedMacroName() - -# 2.6.2 (2019-01-14) - - * fixed regression (key exists check for non ArrayObject objects) - -# 2.6.1 (2019-01-14) - - * fixed ArrayObject access with a null value - * fixed embedded templates starting with a BOM - * fixed using a Twig_TemplateWrapper instance as an argument to extends - * fixed error location when calling an undefined block - * deprecated passing a string as a source on Twig_Error - * switched generated code to use the PHP short array notation - * fixed float representation in compiled templates - * added a second argument to the join filter (last separator configuration) - -# 2.6.0 (2018-12-16) - - * made sure twig_include returns a string - * fixed multi-byte UFT-8 in escape('html_attr') - * added the "deprecated" tag - * added support for dynamically named tests - * fixed GlobalsInterface extended class - * fixed filesystem loader throwing an exception instead of returning false - -# 2.5.0 (2018-07-13) - - * deprecated using the spaceless tag at the root level of a child template (noop anyway) - * deprecated the possibility to define a block in a non-capturing block in a child template - * added the Symfony ctype polyfill as a dependency - * fixed reporting the proper location for errors compiled in templates - * fixed the error handling for the optimized extension-based function calls - * ensured that syntax errors are triggered with the right line - * "js" filter now produces valid JSON - -# 2.4.8 (2018-04-02) - - * fixed a regression when using the "default" filter or the "defined" test on non-existing arrays - -# 2.4.7 (2018-03-20) - * optimized runtime performance - * optimized parser performance by inlining the constant values - * fixed block names unicity - * fixed counting children of SimpleXMLElement objects - * added missing else clause to avoid infinite loops - * fixed .. (range operator) in sandbox policy +# 3.0.0 (2019-11-15) -# 2.4.6 (2018-03-03) - - * fixed a regression in the way the profiler is registered in templates - -# 2.4.5 (2018-03-02) - - * optimized the performance of calling an extension method at runtime - * optimized the performance of the dot operator for array and method calls - * added an exception when using "===" instead of "same as" - * fixed possible array to string conversion concealing actual error - * made variable names deterministic in compiled templates - * fixed length filter when passing an instance of IteratorAggregate - * fixed Environment::resolveTemplate to accept instances of TemplateWrapper - -# 2.4.4 (2017-09-27) - - * added Twig_Profiler_Profile::reset() - * fixed use TokenParser to return an empty Node - * added RuntimeExtensionInterface - * added circular reference detection when loading templates - * added support for runtime loaders in IntegrationTestCase - * fixed deprecation when using Twig_Profiler_Dumper_Html - * removed @final from Twig_Profiler_Dumper_Text - -# 2.4.3 (2017-06-07) - - * fixed namespaces introduction - -# 2.4.2 (2017-06-05) - - * fixed namespaces introduction - -# 2.4.1 (2017-06-05) - - * fixed namespaces introduction - -# 2.4.0 (2017-06-05) - - * added support for PHPUnit 6 when testing extensions - * fixed PHP 7.2 compatibility - * fixed template name generation in Twig_Environment::createTemplate() - * removed final tag on Twig_TokenParser_Include - * dropped HHVM support - * added namespaced aliases for all (non-deprecated) classes and interfaces - * marked Twig_Filter, Twig_Function, Twig_Test, Twig_Node_Module and Twig_Profiler_Profile as final via the @final annotation - -# 2.3.2 (2017-04-20) - - * fixed edge case in the method cache for Twig attributes - -# 2.3.1 (2017-04-18) - - * fixed the empty() test - -# 2.3.0 (2017-03-22) - - * fixed a race condition handling when writing cache files - * "length" filter now returns string length when applied to an object that does - not implement \Countable but provides __toString() - * "empty" test will now consider the return value of the __toString() method for - objects implement __toString() but not \Countable - * fixed JS escaping for unicode characters with higher code points - * added error message when calling `parent()` in a block that doesn't exist in the parent template - -# 2.2.0 (2017-02-26) - - * added a PSR-11 compatible runtime loader - * added `side` argument to `trim` to allow left or right trimming only. - -# 2.1.0 (2017-01-11) - - * fixed twig_get_attribute() - * added Twig_NodeCaptureInterface for nodes that capture all output - -# 2.0.0 (2017-01-05) + * fixed number formatter in Intl extra extension when using a formatter prototype - * removed the C extension - * moved Twig_Environment::getAttribute() to twig_get_attribute() - * removed Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler() - * removed Twig_Compiler::getFilename() - * added hasser support in Twig_Template::getAttribute() - * sped up the json_encode filter - * removed reserved macro names; all names can be used as macro - * removed Twig_Template::getEnvironment() - * changed _self variable to return the current template name - * made the loader a required argument of Twig_Environment constructor - * removed Twig_Environment::clearTemplateCache() - * removed Twig_Autoloader (use Composer instead) - * removed `true` as an equivalent to `html` for the auto-escaping strategy - * removed pre-1.8 autoescape tag syntax - * dropped support for PHP 5.x - * removed the ability to register a global variable after the runtime or the extensions have been initialized - * improved the performance of the filesystem loader - * removed features that were deprecated in 1.x +# 3.0.0-BETA1 (2019-11-11) + + * removed the "if" condition support on the "for" tag + * made the in, <, >, <=, >=, ==, and != operators more strict when comparing strings and integers/floats + * removed the "filter" tag + * added type hints everywhere + * changed Environment::resolveTemplate() to always return a TemplateWrapper instance + * removed Template::__toString() + * removed Parser::isReservedMacroName() + * removed SanboxedPrintNode + * removed Node::setTemplateName() + * made classes maked as "@final" final + * removed InitRuntimeInterface, ExistsLoaderInterface, and SourceContextLoaderInterface + * removed the "spaceless" tag + * removed Twig\Environment::getBaseTemplateClass() and Twig\Environment::setBaseTemplateClass() + * removed the "base_template_class" option on Twig\Environment + * bumped minimum PHP version to 7.2 + * removed PSR-0 classes diff --git a/upload/system/storage/vendor/twig/twig/composer.json b/upload/system/storage/vendor/twig/twig/composer.json index 377d9ea414d..91ff912fcd4 100644 --- a/upload/system/storage/vendor/twig/twig/composer.json +++ b/upload/system/storage/vendor/twig/twig/composer.json @@ -24,19 +24,15 @@ } ], "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php72": "^1.8" + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", "psr/container": "^1.0" }, "autoload": { - "psr-0" : { - "Twig_" : "lib/" - }, "psr-4" : { "Twig\\" : "src/" } @@ -48,7 +44,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.14-dev" + "dev-master": "3.3-dev" } } } diff --git a/upload/system/storage/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php b/upload/system/storage/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php deleted file mode 100644 index f44b02c5131..00000000000 --- a/upload/system/storage/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php +++ /dev/null @@ -1,14 +0,0 @@ -directory = rtrim($directory, '\/').'/'; $this->options = $options; } - public function generateKey($name, $className) + public function generateKey(string $name, string $className): string { $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $className); return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php'; } - public function load($key) + public function load(string $key): void { - if (file_exists($key)) { + if (is_file($key)) { @include_once $key; } } - public function write($key, $content) + public function write(string $key, string $content): void { $dir = \dirname($key); if (!is_dir($dir)) { @@ -80,14 +76,12 @@ public function write($key, $content) throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $key)); } - public function getTimestamp($key) + public function getTimestamp(string $key): int { - if (!file_exists($key)) { + if (!is_file($key)) { return 0; } return (int) @filemtime($key); } } - -class_alias('Twig\Cache\FilesystemCache', 'Twig_Cache_Filesystem'); diff --git a/upload/system/storage/vendor/twig/twig/src/Cache/NullCache.php b/upload/system/storage/vendor/twig/twig/src/Cache/NullCache.php index 02c868cdb86..8d20d59d8b3 100644 --- a/upload/system/storage/vendor/twig/twig/src/Cache/NullCache.php +++ b/upload/system/storage/vendor/twig/twig/src/Cache/NullCache.php @@ -18,23 +18,21 @@ */ final class NullCache implements CacheInterface { - public function generateKey($name, $className) + public function generateKey(string $name, string $className): string { return ''; } - public function write($key, $content) + public function write(string $key, string $content): void { } - public function load($key) + public function load(string $key): void { } - public function getTimestamp($key) + public function getTimestamp(string $key): int { return 0; } } - -class_alias('Twig\Cache\NullCache', 'Twig_Cache_Null'); diff --git a/upload/system/storage/vendor/twig/twig/src/Compiler.php b/upload/system/storage/vendor/twig/twig/src/Compiler.php index 8727991d1b7..95e1f183b25 100644 --- a/upload/system/storage/vendor/twig/twig/src/Compiler.php +++ b/upload/system/storage/vendor/twig/twig/src/Compiler.php @@ -15,8 +15,6 @@ use Twig\Node\Node; /** - * Compiles a node to PHP code. - * * @author Fabien Potencier */ class Compiler @@ -35,34 +33,20 @@ public function __construct(Environment $env) $this->env = $env; } - /** - * Returns the environment instance related to this compiler. - * - * @return Environment - */ - public function getEnvironment() + public function getEnvironment(): Environment { return $this->env; } - /** - * Gets the current PHP code after compilation. - * - * @return string The PHP code - */ - public function getSource() + public function getSource(): string { return $this->source; } /** - * Compiles a node. - * - * @param int $indentation The current indentation - * * @return $this */ - public function compile(Node $node, $indentation = 0) + public function compile(Node $node, int $indentation = 0) { $this->lastLine = null; $this->source = ''; @@ -78,7 +62,10 @@ public function compile(Node $node, $indentation = 0) return $this; } - public function subcompile(Node $node, $raw = true) + /** + * @return $this + */ + public function subcompile(Node $node, bool $raw = true) { if (false === $raw) { $this->source .= str_repeat(' ', $this->indentation * 4); @@ -92,11 +79,9 @@ public function subcompile(Node $node, $raw = true) /** * Adds a raw string to the compiled code. * - * @param string $string The string - * * @return $this */ - public function raw($string) + public function raw(string $string) { $this->source .= $string; @@ -120,11 +105,9 @@ public function write(...$strings) /** * Adds a quoted string to the compiled code. * - * @param string $value The string - * * @return $this */ - public function string($value) + public function string(string $value) { $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\")); @@ -134,8 +117,6 @@ public function string($value) /** * Returns a PHP representation of a given value. * - * @param mixed $value The value to convert - * * @return $this */ public function repr($value) @@ -175,8 +156,6 @@ public function repr($value) } /** - * Adds debugging information. - * * @return $this */ public function addDebugInfo(Node $node) @@ -194,7 +173,7 @@ public function addDebugInfo(Node $node) return $this; } - public function getDebugInfo() + public function getDebugInfo(): array { ksort($this->debugInfo); @@ -202,13 +181,9 @@ public function getDebugInfo() } /** - * Indents the generated code. - * - * @param int $step The number of indentation to add - * * @return $this */ - public function indent($step = 1) + public function indent(int $step = 1) { $this->indentation += $step; @@ -216,15 +191,11 @@ public function indent($step = 1) } /** - * Outdents the generated code. - * - * @param int $step The number of indentation to remove - * * @return $this * * @throws \LogicException When trying to outdent too much so the indentation would become negative */ - public function outdent($step = 1) + public function outdent(int $step = 1) { // can't outdent by more steps than the current indentation level if ($this->indentation < $step) { @@ -236,10 +207,8 @@ public function outdent($step = 1) return $this; } - public function getVarName() + public function getVarName(): string { return sprintf('__internal_compile_%d', $this->varNameSalt++); } } - -class_alias('Twig\Compiler', 'Twig_Compiler'); diff --git a/upload/system/storage/vendor/twig/twig/src/Environment.php b/upload/system/storage/vendor/twig/twig/src/Environment.php index 8e62525774a..ab5e5d02b8c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Environment.php +++ b/upload/system/storage/vendor/twig/twig/src/Environment.php @@ -38,11 +38,11 @@ */ class Environment { - public const VERSION = '2.14.11'; - public const VERSION_ID = 21411; - public const MAJOR_VERSION = 2; - public const MINOR_VERSION = 14; - public const RELEASE_VERSION = 11; + public const VERSION = '3.3.8'; + public const VERSION_ID = 30308; + public const MAJOR_VERSION = 3; + public const MINOR_VERSION = 3; + public const RELEASE_VERSION = 8; public const EXTRA_VERSION = ''; private $charset; @@ -53,7 +53,6 @@ class Environment private $lexer; private $parser; private $compiler; - private $baseTemplateClass; private $globals = []; private $resolvedGlobals; private $loadedTemplates; @@ -75,9 +74,6 @@ class Environment * * * charset: The charset used by the templates (default to UTF-8). * - * * base_template_class: The base template class to use for generated - * templates (default to \Twig\Template). - * * * cache: An absolute path where to store the compiled templates, * a \Twig\Cache\CacheInterface implementation, * or false to disable compilation cache (default). @@ -106,7 +102,6 @@ public function __construct(LoaderInterface $loader, $options = []) $options = array_merge([ 'debug' => false, 'charset' => 'UTF-8', - 'base_template_class' => Template::class, 'strict_variables' => false, 'autoescape' => 'html', 'cache' => false, @@ -115,11 +110,7 @@ public function __construct(LoaderInterface $loader, $options = []) ], $options); $this->debug = (bool) $options['debug']; - $this->setCharset($options['charset']); - $this->baseTemplateClass = '\\'.ltrim($options['base_template_class'], '\\'); - if ('\\'.Template::class !== $this->baseTemplateClass && '\Twig_Template' !== $this->baseTemplateClass) { - @trigger_error('The "base_template_class" option on '.__CLASS__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); - } + $this->setCharset($options['charset'] ?? 'UTF-8'); $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; $this->strictVariables = (bool) $options['strict_variables']; $this->setCache($options['cache']); @@ -130,33 +121,6 @@ public function __construct(LoaderInterface $loader, $options = []) $this->addExtension(new OptimizerExtension($options['optimizations'])); } - /** - * Gets the base template class for compiled templates. - * - * @return string The base template class name - */ - public function getBaseTemplateClass() - { - if (1 > \func_num_args() || \func_get_arg(0)) { - @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); - } - - return $this->baseTemplateClass; - } - - /** - * Sets the base template class for compiled templates. - * - * @param string $class The base template class name - */ - public function setBaseTemplateClass($class) - { - @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED); - - $this->baseTemplateClass = $class; - $this->updateOptionsHash(); - } - /** * Enables debugging mode. */ @@ -290,11 +254,9 @@ public function setCache($cache) * @param string $name The name for which to calculate the template class name * @param int|null $index The index if it is an embedded template * - * @return string The template class name - * * @internal */ - public function getTemplateClass($name, $index = null) + public function getTemplateClass(string $name, int $index = null): string { $key = $this->getLoader()->getCacheKey($name).$this->optionsHash; @@ -304,16 +266,13 @@ public function getTemplateClass($name, $index = null) /** * Renders a template. * - * @param string|TemplateWrapper $name The template name - * @param array $context An array of parameters to pass to the template - * - * @return string The rendered template + * @param string|TemplateWrapper $name The template name * * @throws LoaderError When the template cannot be found * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ - public function render($name, array $context = []) + public function render($name, array $context = []): string { return $this->load($name)->render($context); } @@ -321,14 +280,13 @@ public function render($name, array $context = []) /** * Displays a template. * - * @param string|TemplateWrapper $name The template name - * @param array $context An array of parameters to pass to the template + * @param string|TemplateWrapper $name The template name * * @throws LoaderError When the template cannot be found * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ - public function display($name, array $context = []) + public function display($name, array $context = []): void { $this->load($name)->display($context); } @@ -341,22 +299,14 @@ public function display($name, array $context = []) * @throws LoaderError When the template cannot be found * @throws RuntimeError When a previously generated cache is corrupted * @throws SyntaxError When an error occurred during compilation - * - * @return TemplateWrapper */ - public function load($name) + public function load($name): TemplateWrapper { if ($name instanceof TemplateWrapper) { return $name; } - if ($name instanceof Template) { - @trigger_error('Passing a \Twig\Template instance to '.__METHOD__.' is deprecated since Twig 2.7.0, use \Twig\TemplateWrapper instead.', \E_USER_DEPRECATED); - - return new TemplateWrapper($this, $name); - } - - return new TemplateWrapper($this, $this->loadTemplate($name)); + return new TemplateWrapper($this, $this->loadTemplate($this->getTemplateClass($name), $name)); } /** @@ -368,23 +318,13 @@ public function load($name) * @param string $name The template name * @param int $index The index if it is an embedded template * - * @return Template A template instance representing the given template name - * * @throws LoaderError When the template cannot be found * @throws RuntimeError When a previously generated cache is corrupted * @throws SyntaxError When an error occurred during compilation * * @internal */ - public function loadTemplate($name, $index = null) - { - return $this->loadClass($this->getTemplateClass($name), $name, $index); - } - - /** - * @internal - */ - public function loadClass($cls, $name, $index = null) + public function loadTemplate(string $cls, string $name, int $index = null): Template { $mainCls = $cls; if (null !== $index) { @@ -424,8 +364,7 @@ public function loadClass($cls, $name, $index = null) } } - // to be removed in 3.0 - $this->extensionSet->initRuntime($this); + $this->extensionSet->initRuntime(); return $this->loadedTemplates[$cls] = new $cls($this); } @@ -438,12 +377,10 @@ public function loadClass($cls, $name, $index = null) * @param string $template The template source * @param string $name An optional name of the template to be used in error messages * - * @return TemplateWrapper A template instance representing the given template name - * * @throws LoaderError When the template cannot be found * @throws SyntaxError When an error occurred during compilation */ - public function createTemplate($template, string $name = null) + public function createTemplate(string $template, string $name = null): TemplateWrapper { $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $template, false); if (null !== $name) { @@ -459,7 +396,7 @@ public function createTemplate($template, string $name = null) $this->setLoader($loader); try { - return new TemplateWrapper($this, $this->loadTemplate($name)); + return new TemplateWrapper($this, $this->loadTemplate($this->getTemplateClass($name), $name)); } finally { $this->setLoader($current); } @@ -472,12 +409,9 @@ public function createTemplate($template, string $name = null) * this method also checks if the enabled extensions have * not changed. * - * @param string $name The template name - * @param int $time The last modification time of the cached template - * - * @return bool true if the template is fresh, false otherwise + * @param int $time The last modification time of the cached template */ - public function isTemplateFresh($name, $time) + public function isTemplateFresh(string $name, int $time): bool { return $this->extensionSet->getLastModified() <= $time && $this->getLoader()->isFresh($name, $time); } @@ -490,15 +424,13 @@ public function isTemplateFresh($name, $time) * * @param string|TemplateWrapper|array $names A template or an array of templates to try consecutively * - * @return TemplateWrapper|Template - * * @throws LoaderError When none of the templates can be found * @throws SyntaxError When an error occurred during compilation */ - public function resolveTemplate($names) + public function resolveTemplate($names): TemplateWrapper { if (!\is_array($names)) { - $names = [$names]; + return $this->load($names); } $count = \count($names); @@ -514,7 +446,7 @@ public function resolveTemplate($names) continue; } - return $this->loadTemplate($name); + return $this->load($name); } throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); @@ -526,13 +458,9 @@ public function setLexer(Lexer $lexer) } /** - * Tokenizes a source code. - * - * @return TokenStream - * * @throws SyntaxError When the code is syntactically wrong */ - public function tokenize(Source $source) + public function tokenize(Source $source): TokenStream { if (null === $this->lexer) { $this->lexer = new Lexer($this); @@ -549,11 +477,9 @@ public function setParser(Parser $parser) /** * Converts a token stream to a node tree. * - * @return ModuleNode - * * @throws SyntaxError When the token stream is syntactically or semantically wrong */ - public function parse(TokenStream $stream) + public function parse(TokenStream $stream): ModuleNode { if (null === $this->parser) { $this->parser = new Parser($this); @@ -569,10 +495,8 @@ public function setCompiler(Compiler $compiler) /** * Compiles a node and returns the PHP code. - * - * @return string The compiled PHP source code */ - public function compile(Node $node) + public function compile(Node $node): string { if (null === $this->compiler) { $this->compiler = new Compiler($this); @@ -584,11 +508,9 @@ public function compile(Node $node) /** * Compiles a template source code. * - * @return string The compiled PHP source code - * * @throws SyntaxError When there was an error during tokenizing, parsing or compiling */ - public function compileSource(Source $source) + public function compileSource(Source $source): string { try { return $this->compile($this->parse($this->tokenize($source))); @@ -605,22 +527,12 @@ public function setLoader(LoaderInterface $loader) $this->loader = $loader; } - /** - * Gets the Loader instance. - * - * @return LoaderInterface - */ - public function getLoader() + public function getLoader(): LoaderInterface { return $this->loader; } - /** - * Sets the default template charset. - * - * @param string $charset The default charset - */ - public function setCharset($charset) + public function setCharset(string $charset) { if ('UTF8' === $charset = null === $charset ? null : strtoupper($charset)) { // iconv on Windows requires "UTF-8" instead of "UTF8" @@ -630,58 +542,45 @@ public function setCharset($charset) $this->charset = $charset; } - /** - * Gets the default template charset. - * - * @return string The default charset - */ - public function getCharset() + public function getCharset(): string { return $this->charset; } - /** - * Returns true if the given extension is registered. - * - * @param string $class The extension class name - * - * @return bool Whether the extension is registered or not - */ - public function hasExtension($class) + public function hasExtension(string $class): bool { return $this->extensionSet->hasExtension($class); } - /** - * Adds a runtime loader. - */ public function addRuntimeLoader(RuntimeLoaderInterface $loader) { $this->runtimeLoaders[] = $loader; } /** - * Gets an extension by class name. + * @template TExtension of ExtensionInterface * - * @param string $class The extension class name + * @param class-string $class * - * @return ExtensionInterface + * @return TExtension */ - public function getExtension($class) + public function getExtension(string $class): ExtensionInterface { return $this->extensionSet->getExtension($class); } /** - * Returns the runtime implementation of a Twig element (filter/function/test). + * Returns the runtime implementation of a Twig element (filter/function/tag/test). + * + * @template TRuntime of object * - * @param string $class A runtime class name + * @param class-string $class A runtime class name * - * @return object The runtime implementation + * @return TRuntime The runtime implementation * * @throws RuntimeError When the template cannot be found */ - public function getRuntime($class) + public function getRuntime(string $class) { if (isset($this->runtimes[$class])) { return $this->runtimes[$class]; @@ -703,9 +602,7 @@ public function addExtension(ExtensionInterface $extension) } /** - * Registers an array of extensions. - * - * @param array $extensions An array of extensions + * @param ExtensionInterface[] $extensions An array of extensions */ public function setExtensions(array $extensions) { @@ -714,11 +611,9 @@ public function setExtensions(array $extensions) } /** - * Returns all registered extensions. - * * @return ExtensionInterface[] An array of extensions (keys are for internal usage only and should not be relied on) */ - public function getExtensions() + public function getExtensions(): array { return $this->extensionSet->getExtensions(); } @@ -729,32 +624,26 @@ public function addTokenParser(TokenParserInterface $parser) } /** - * Gets the registered Token Parsers. - * * @return TokenParserInterface[] * * @internal */ - public function getTokenParsers() + public function getTokenParsers(): array { return $this->extensionSet->getTokenParsers(); } /** - * Gets registered tags. - * - * @return TokenParserInterface[] - * * @internal */ - public function getTags() + public function getTokenParser(string $name): ?TokenParserInterface { - $tags = []; - foreach ($this->getTokenParsers() as $parser) { - $tags[$parser->getTag()] = $parser; - } + return $this->extensionSet->getTokenParser($name); + } - return $tags; + public function registerUndefinedTokenParserCallback(callable $callable): void + { + $this->extensionSet->registerUndefinedTokenParserCallback($callable); } public function addNodeVisitor(NodeVisitorInterface $visitor) @@ -763,13 +652,11 @@ public function addNodeVisitor(NodeVisitorInterface $visitor) } /** - * Gets the registered Node Visitors. - * * @return NodeVisitorInterface[] * * @internal */ - public function getNodeVisitors() + public function getNodeVisitors(): array { return $this->extensionSet->getNodeVisitors(); } @@ -780,23 +667,14 @@ public function addFilter(TwigFilter $filter) } /** - * Get a filter by name. - * - * Subclasses may override this method and load filters differently; - * so no list of filters is available. - * - * @param string $name The filter name - * - * @return TwigFilter|false - * * @internal */ - public function getFilter($name) + public function getFilter(string $name): ?TwigFilter { return $this->extensionSet->getFilter($name); } - public function registerUndefinedFilterCallback(callable $callable) + public function registerUndefinedFilterCallback(callable $callable): void { $this->extensionSet->registerUndefinedFilterCallback($callable); } @@ -812,7 +690,7 @@ public function registerUndefinedFilterCallback(callable $callable) * * @internal */ - public function getFilters() + public function getFilters(): array { return $this->extensionSet->getFilters(); } @@ -823,27 +701,19 @@ public function addTest(TwigTest $test) } /** - * Gets the registered Tests. - * * @return TwigTest[] * * @internal */ - public function getTests() + public function getTests(): array { return $this->extensionSet->getTests(); } /** - * Gets a test by name. - * - * @param string $name The test name - * - * @return TwigTest|false - * * @internal */ - public function getTest($name) + public function getTest(string $name): ?TwigTest { return $this->extensionSet->getTest($name); } @@ -854,23 +724,14 @@ public function addFunction(TwigFunction $function) } /** - * Get a function by name. - * - * Subclasses may override this method and load functions differently; - * so no list of functions is available. - * - * @param string $name function name - * - * @return TwigFunction|false - * * @internal */ - public function getFunction($name) + public function getFunction(string $name): ?TwigFunction { return $this->extensionSet->getFunction($name); } - public function registerUndefinedFunctionCallback(callable $callable) + public function registerUndefinedFunctionCallback(callable $callable): void { $this->extensionSet->registerUndefinedFunctionCallback($callable); } @@ -886,7 +747,7 @@ public function registerUndefinedFunctionCallback(callable $callable) * * @internal */ - public function getFunctions() + public function getFunctions(): array { return $this->extensionSet->getFunctions(); } @@ -897,10 +758,9 @@ public function getFunctions() * New globals can be added before compiling or rendering a template; * but after, you can only update existing globals. * - * @param string $name The global name - * @param mixed $value The global value + * @param mixed $value The global value */ - public function addGlobal($name, $value) + public function addGlobal(string $name, $value) { if ($this->extensionSet->isInitialized() && !\array_key_exists($name, $this->getGlobals())) { throw new \LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name)); @@ -914,13 +774,9 @@ public function addGlobal($name, $value) } /** - * Gets the registered Globals. - * - * @return array An array of globals - * * @internal */ - public function getGlobals() + public function getGlobals(): array { if ($this->extensionSet->isInitialized()) { if (null === $this->resolvedGlobals) { @@ -933,14 +789,7 @@ public function getGlobals() return array_merge($this->extensionSet->getGlobals(), $this->globals); } - /** - * Merges a context with the defined globals. - * - * @param array $context An array representing the context - * - * @return array The context merged with the globals - */ - public function mergeGlobals(array $context) + public function mergeGlobals(array $context): array { // we don't use array_merge as the context being generally // bigger than globals, this code is faster. @@ -954,30 +803,22 @@ public function mergeGlobals(array $context) } /** - * Gets the registered unary Operators. - * - * @return array An array of unary operators - * * @internal */ - public function getUnaryOperators() + public function getUnaryOperators(): array { return $this->extensionSet->getUnaryOperators(); } /** - * Gets the registered binary Operators. - * - * @return array An array of binary operators - * * @internal */ - public function getBinaryOperators() + public function getBinaryOperators(): array { return $this->extensionSet->getBinaryOperators(); } - private function updateOptionsHash() + private function updateOptionsHash(): void { $this->optionsHash = implode(':', [ $this->extensionSet->getSignature(), @@ -985,10 +826,7 @@ private function updateOptionsHash() \PHP_MINOR_VERSION, self::VERSION, (int) $this->debug, - $this->baseTemplateClass, (int) $this->strictVariables, ]); } } - -class_alias('Twig\Environment', 'Twig_Environment'); diff --git a/upload/system/storage/vendor/twig/twig/src/Error/Error.php b/upload/system/storage/vendor/twig/twig/src/Error/Error.php index 13f6f745ce5..a68be65f203 100644 --- a/upload/system/storage/vendor/twig/twig/src/Error/Error.php +++ b/upload/system/storage/vendor/twig/twig/src/Error/Error.php @@ -47,23 +47,18 @@ class Error extends \Exception /** * Constructor. * - * Set the line number to -1 to enable its automatic guessing. - * Set the name to null to enable its automatic guessing. + * By default, automatic guessing is enabled. * - * @param string $message The error message - * @param int $lineno The template line where the error occurred - * @param Source|string|null $source The source context where the error occurred - * @param \Exception $previous The previous exception + * @param string $message The error message + * @param int $lineno The template line where the error occurred + * @param Source|null $source The source context where the error occurred */ - public function __construct(string $message, int $lineno = -1, $source = null, \Exception $previous = null) + public function __construct(string $message, int $lineno = -1, Source $source = null, \Exception $previous = null) { parent::__construct('', 0, $previous); if (null === $source) { $name = null; - } elseif (!$source instanceof Source && !$source instanceof \Twig_Source) { - @trigger_error(sprintf('Passing a string as a source to %s is deprecated since Twig 2.6.1; pass a Twig\Source instance instead.', __CLASS__), \E_USER_DEPRECATED); - $name = $source; } else { $name = $source->getName(); $this->sourceCode = $source->getCode(); @@ -76,52 +71,29 @@ public function __construct(string $message, int $lineno = -1, $source = null, \ $this->updateRepr(); } - /** - * Gets the raw message. - * - * @return string The raw message - */ - public function getRawMessage() + public function getRawMessage(): string { return $this->rawMessage; } - /** - * Gets the template line where the error occurred. - * - * @return int The template line - */ - public function getTemplateLine() + public function getTemplateLine(): int { return $this->lineno; } - /** - * Sets the template line where the error occurred. - * - * @param int $lineno The template line - */ - public function setTemplateLine($lineno) + public function setTemplateLine(int $lineno): void { $this->lineno = $lineno; $this->updateRepr(); } - /** - * Gets the source context of the Twig template where the error occurred. - * - * @return Source|null - */ - public function getSourceContext() + public function getSourceContext(): ?Source { return $this->name ? new Source($this->sourceCode, $this->name, $this->sourcePath) : null; } - /** - * Sets the source context of the Twig template where the error occurred. - */ - public function setSourceContext(Source $source = null) + public function setSourceContext(Source $source = null): void { if (null === $source) { $this->sourceCode = $this->name = $this->sourcePath = null; @@ -134,19 +106,19 @@ public function setSourceContext(Source $source = null) $this->updateRepr(); } - public function guess() + public function guess(): void { $this->guessTemplateInfo(); $this->updateRepr(); } - public function appendMessage($rawMessage) + public function appendMessage($rawMessage): void { $this->rawMessage .= $rawMessage; $this->updateRepr(); } - private function updateRepr() + private function updateRepr(): void { $this->message = $this->rawMessage; @@ -191,14 +163,14 @@ private function updateRepr() } } - private function guessTemplateInfo() + private function guessTemplateInfo(): void { $template = null; $templateClass = null; $backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT); foreach ($backtrace as $trace) { - if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig\Template' !== \get_class($trace['object'])) { + if (isset($trace['object']) && $trace['object'] instanceof Template) { $currentClass = \get_class($trace['object']); $isEmbedContainer = null === $templateClass ? false : 0 === strpos($templateClass, $currentClass); if (null === $this->name || ($this->name == $trace['object']->getTemplateName() && !$isEmbedContainer)) { @@ -253,5 +225,3 @@ private function guessTemplateInfo() } } } - -class_alias('Twig\Error\Error', 'Twig_Error'); diff --git a/upload/system/storage/vendor/twig/twig/src/Error/LoaderError.php b/upload/system/storage/vendor/twig/twig/src/Error/LoaderError.php index dc5a9f1af73..7c8c23c1944 100644 --- a/upload/system/storage/vendor/twig/twig/src/Error/LoaderError.php +++ b/upload/system/storage/vendor/twig/twig/src/Error/LoaderError.php @@ -19,5 +19,3 @@ class LoaderError extends Error { } - -class_alias('Twig\Error\LoaderError', 'Twig_Error_Loader'); diff --git a/upload/system/storage/vendor/twig/twig/src/Error/RuntimeError.php b/upload/system/storage/vendor/twig/twig/src/Error/RuntimeError.php index 9b3f36e050e..f6b84766c8b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Error/RuntimeError.php +++ b/upload/system/storage/vendor/twig/twig/src/Error/RuntimeError.php @@ -20,5 +20,3 @@ class RuntimeError extends Error { } - -class_alias('Twig\Error\RuntimeError', 'Twig_Error_Runtime'); diff --git a/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php b/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php index efece9256c3..726b3309e5b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php +++ b/upload/system/storage/vendor/twig/twig/src/Error/SyntaxError.php @@ -25,7 +25,7 @@ class SyntaxError extends Error * @param string $name The original name of the item that does not exist * @param array $items An array of possible items */ - public function addSuggestions($name, array $items) + public function addSuggestions(string $name, array $items): void { $alternatives = []; foreach ($items as $item) { @@ -44,5 +44,3 @@ public function addSuggestions($name, array $items) $this->appendMessage(sprintf(' Did you mean "%s"?', implode('", "', array_keys($alternatives)))); } } - -class_alias('Twig\Error\SyntaxError', 'Twig_Error_Syntax'); diff --git a/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php b/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php index 1d9c8768738..66acddf6165 100644 --- a/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php +++ b/upload/system/storage/vendor/twig/twig/src/ExpressionParser.php @@ -255,14 +255,11 @@ public function parsePrimaryExpression() $this->parser->getStream()->next(); $node = new NameExpression($token->getValue(), $token->getLine()); break; - } elseif (isset($this->unaryOperators[$token->getValue()])) { - $class = $this->unaryOperators[$token->getValue()]['class']; + } - $ref = new \ReflectionClass($class); - if (!(\in_array($ref->getName(), [NegUnary::class, PosUnary::class, 'Twig_Node_Expression_Unary_Neg', 'Twig_Node_Expression_Unary_Pos']) - || $ref->isSubclassOf(NegUnary::class) || $ref->isSubclassOf(PosUnary::class) - || $ref->isSubclassOf('Twig_Node_Expression_Unary_Neg') || $ref->isSubclassOf('Twig_Node_Expression_Unary_Pos')) - ) { + if (isset($this->unaryOperators[$token->getValue()])) { + $class = $this->unaryOperators[$token->getValue()]['class']; + if (!\in_array($class, [NegUnary::class, PosUnary::class])) { throw new SyntaxError(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); } @@ -741,7 +738,7 @@ private function getTestNodeClass(TwigTest $test): string $stream = $this->parser->getStream(); $message = sprintf('Twig Test "%s" is deprecated', $test->getName()); - if (!\is_bool($test->getDeprecatedVersion())) { + if ($test->getDeprecatedVersion()) { $message .= sprintf(' since version %s', $test->getDeprecatedVersion()); } if ($test->getAlternative()) { @@ -758,7 +755,7 @@ private function getTestNodeClass(TwigTest $test): string private function getFunctionNodeClass(string $name, int $line): string { - if (false === $function = $this->env->getFunction($name)) { + if (!$function = $this->env->getFunction($name)) { $e = new SyntaxError(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext()); $e->addSuggestions($name, array_keys($this->env->getFunctions())); @@ -767,7 +764,7 @@ private function getFunctionNodeClass(string $name, int $line): string if ($function->isDeprecated()) { $message = sprintf('Twig Function "%s" is deprecated', $function->getName()); - if (!\is_bool($function->getDeprecatedVersion())) { + if ($function->getDeprecatedVersion()) { $message .= sprintf(' since version %s', $function->getDeprecatedVersion()); } if ($function->getAlternative()) { @@ -784,7 +781,7 @@ private function getFunctionNodeClass(string $name, int $line): string private function getFilterNodeClass(string $name, int $line): string { - if (false === $filter = $this->env->getFilter($name)) { + if (!$filter = $this->env->getFilter($name)) { $e = new SyntaxError(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext()); $e->addSuggestions($name, array_keys($this->env->getFilters())); @@ -793,7 +790,7 @@ private function getFilterNodeClass(string $name, int $line): string if ($filter->isDeprecated()) { $message = sprintf('Twig Filter "%s" is deprecated', $filter->getName()); - if (!\is_bool($filter->getDeprecatedVersion())) { + if ($filter->getDeprecatedVersion()) { $message .= sprintf(' since version %s', $filter->getDeprecatedVersion()); } if ($filter->getAlternative()) { @@ -826,5 +823,3 @@ private function checkConstantExpression(Node $node): bool return true; } } - -class_alias('Twig\ExpressionParser', 'Twig_ExpressionParser'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/AbstractExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/AbstractExtension.php index 0c012b3e962..422925f31b9 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/AbstractExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/AbstractExtension.php @@ -43,5 +43,3 @@ public function getOperators() return []; } } - -class_alias('Twig\Extension\AbstractExtension', 'Twig_Extension'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php index 6ac36108137..88cd7545842 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/CoreExtension.php @@ -56,7 +56,6 @@ use Twig\TokenParser\DoTokenParser; use Twig\TokenParser\EmbedTokenParser; use Twig\TokenParser\ExtendsTokenParser; -use Twig\TokenParser\FilterTokenParser; use Twig\TokenParser\FlushTokenParser; use Twig\TokenParser\ForTokenParser; use Twig\TokenParser\FromTokenParser; @@ -65,7 +64,6 @@ use Twig\TokenParser\IncludeTokenParser; use Twig\TokenParser\MacroTokenParser; use Twig\TokenParser\SetTokenParser; -use Twig\TokenParser\SpacelessTokenParser; use Twig\TokenParser\UseTokenParser; use Twig\TokenParser\WithTokenParser; use Twig\TwigFilter; @@ -77,38 +75,6 @@ final class CoreExtension extends AbstractExtension private $dateFormats = ['F j, Y H:i', '%d days']; private $numberFormat = [0, '.', ',']; private $timezone = null; - private $escapers = []; - - /** - * Defines a new escaper to be used via the escape filter. - * - * @param string $strategy The strategy name that should be used as a strategy in the escape call - * @param callable $callable A valid PHP callable - * - * @deprecated since Twig 2.11, to be removed in 3.0; use the same method on EscaperExtension instead - */ - public function setEscaper($strategy, callable $callable) - { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::setEscaper" instead.', __METHOD__, EscaperExtension::class), \E_USER_DEPRECATED); - - $this->escapers[$strategy] = $callable; - } - - /** - * Gets all defined escapers. - * - * @return callable[] An array of escapers - * - * @deprecated since Twig 2.11, to be removed in 3.0; use the same method on EscaperExtension instead - */ - public function getEscapers(/* $triggerDeprecation = true */) - { - if (0 === \func_num_args() || \func_get_arg(0)) { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.11; use "%s::getEscapers" instead.', __METHOD__, EscaperExtension::class), \E_USER_DEPRECATED); - } - - return $this->escapers; - } /** * Sets the default format to be used by the date filter. @@ -183,7 +149,7 @@ public function getNumberFormat() return $this->numberFormat; } - public function getTokenParsers() + public function getTokenParsers(): array { return [ new ApplyTokenParser(), @@ -193,12 +159,10 @@ public function getTokenParsers() new IncludeTokenParser(), new BlockTokenParser(), new UseTokenParser(), - new FilterTokenParser(), new MacroTokenParser(), new ImportTokenParser(), new FromTokenParser(), new SetTokenParser(), - new SpacelessTokenParser(), new FlushTokenParser(), new DoTokenParser(), new EmbedTokenParser(), @@ -207,7 +171,7 @@ public function getTokenParsers() ]; } - public function getFilters() + public function getFilters(): array { return [ // formatting filters @@ -258,7 +222,7 @@ public function getFilters() ]; } - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('max', 'max'), @@ -273,7 +237,7 @@ public function getFunctions() ]; } - public function getTests() + public function getTests(): array { return [ new TwigTest('even', null, ['node_class' => EvenTest::class]), @@ -289,12 +253,12 @@ public function getTests() ]; } - public function getNodeVisitors() + public function getNodeVisitors(): array { return [new MacroAutoImportNodeVisitor()]; } - public function getOperators() + public function getOperators(): array { return [ [ @@ -336,8 +300,6 @@ public function getOperators() ]; } } - -class_alias('Twig\Extension\CoreExtension', 'Twig_Extension_Core'); } namespace { @@ -856,8 +818,8 @@ function twig_get_array_keys_filter($array) $array = $array->getIterator(); } + $keys = []; if ($array instanceof \Iterator) { - $keys = []; $array->rewind(); while ($array->valid()) { $keys[] = $array->key(); @@ -867,7 +829,6 @@ function twig_get_array_keys_filter($array) return $keys; } - $keys = []; foreach ($array as $key => $item) { $keys[] = $key; } @@ -957,31 +918,103 @@ function twig_in_filter($value, $compare) $compare = (string) $compare; } - if (\is_array($compare)) { - return \in_array($value, $compare, \is_object($value) || \is_resource($value)); - } elseif (\is_string($compare) && (\is_string($value) || \is_int($value) || \is_float($value))) { - return '' === $value || false !== strpos($compare, (string) $value); - } elseif ($compare instanceof \Traversable) { - if (\is_object($value) || \is_resource($value)) { + if (\is_string($compare)) { + if (\is_string($value) || \is_int($value) || \is_float($value)) { + return '' === $value || false !== strpos($compare, (string) $value); + } + + return false; + } + + if (!is_iterable($compare)) { + return false; + } + + if (\is_object($value) || \is_resource($value)) { + if (!\is_array($compare)) { foreach ($compare as $item) { if ($item === $value) { return true; } } - } else { - foreach ($compare as $item) { - if ($item == $value) { - return true; - } - } + + return false; } - return false; + return \in_array($value, $compare, true); + } + + foreach ($compare as $item) { + if (0 === twig_compare($value, $item)) { + return true; + } } return false; } +/** + * Compares two values using a more strict version of the PHP non-strict comparison operator. + * + * @see https://wiki.php.net/rfc/string_to_number_comparison + * @see https://wiki.php.net/rfc/trailing_whitespace_numerics + * + * @internal + */ +function twig_compare($a, $b) +{ + // int <=> string + if (\is_int($a) && \is_string($b)) { + $bTrim = trim($b, " \t\n\r\v\f"); + if (!is_numeric($bTrim)) { + return (string) $a <=> $b; + } + if ((int) $bTrim == $bTrim) { + return $a <=> (int) $bTrim; + } else { + return (float) $a <=> (float) $bTrim; + } + } + if (\is_string($a) && \is_int($b)) { + $aTrim = trim($a, " \t\n\r\v\f"); + if (!is_numeric($aTrim)) { + return $a <=> (string) $b; + } + if ((int) $aTrim == $aTrim) { + return (int) $aTrim <=> $b; + } else { + return (float) $aTrim <=> (float) $b; + } + } + + // float <=> string + if (\is_float($a) && \is_string($b)) { + if (is_nan($a)) { + return 1; + } + $bTrim = trim($b, " \t\n\r\v\f"); + if (!is_numeric($bTrim)) { + return (string) $a <=> $b; + } + + return $a <=> (float) $bTrim; + } + if (\is_string($a) && \is_float($b)) { + if (is_nan($b)) { + return 1; + } + $aTrim = trim($a, " \t\n\r\v\f"); + if (!is_numeric($aTrim)) { + return $a <=> (string) $b; + } + + return (float) $aTrim <=> $b; + } + + // fallback to <=> + return $a <=> $b; +} + /** * Returns a trimmed string. * diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php index 2e8510dfb1d..bfb23d7bd4f 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/DebugExtension.php @@ -14,7 +14,7 @@ final class DebugExtension extends AbstractExtension { - public function getFunctions() + public function getFunctions(): array { // dump is safe if var_dump is overridden by xdebug $isDumpOutputHtmlSafe = \extension_loaded('xdebug') @@ -31,8 +31,6 @@ public function getFunctions() ]; } } - -class_alias('Twig\Extension\DebugExtension', 'Twig_Extension_Debug'); } namespace { diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php index eebdc3a4e93..72795da3b2b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/EscaperExtension.php @@ -36,17 +36,17 @@ public function __construct($defaultStrategy = 'html') $this->setDefaultStrategy($defaultStrategy); } - public function getTokenParsers() + public function getTokenParsers(): array { return [new AutoEscapeTokenParser()]; } - public function getNodeVisitors() + public function getNodeVisitors(): array { return [new EscaperNodeVisitor()]; } - public function getFilters() + public function getFilters(): array { return [ new TwigFilter('escape', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']), @@ -63,7 +63,7 @@ public function getFilters() * * @param string|false|callable $defaultStrategy An escaping strategy */ - public function setDefaultStrategy($defaultStrategy) + public function setDefaultStrategy($defaultStrategy): void { if ('name' === $defaultStrategy) { $defaultStrategy = [FileExtensionEscapingStrategy::class, 'guess']; @@ -79,7 +79,7 @@ public function setDefaultStrategy($defaultStrategy) * * @return string|false The default strategy to use for the template */ - public function getDefaultStrategy($name) + public function getDefaultStrategy(string $name) { // disable string callables to avoid calling a function named html or js, // or any other upcoming escaping strategy @@ -133,14 +133,11 @@ public function addSafeClass(string $class, array $strategies) } } } - -class_alias('Twig\Extension\EscaperExtension', 'Twig_Extension_Escaper'); } namespace { use Twig\Environment; use Twig\Error\RuntimeError; -use Twig\Extension\CoreExtension; use Twig\Extension\EscaperExtension; use Twig\Markup; use Twig\Node\Expression\ConstantExpression; @@ -150,8 +147,6 @@ class_alias('Twig\Extension\EscaperExtension', 'Twig_Extension_Escaper'); * Marks a variable as being safe. * * @param string $string A PHP variable - * - * @return string */ function twig_raw_filter($string) { @@ -395,11 +390,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char static $escapers; if (null === $escapers) { - // merge the ones set on CoreExtension for BC (to be removed in 3.0) - $escapers = array_merge( - $env->getExtension(CoreExtension::class)->getEscapers(false), - $env->getExtension(EscaperExtension::class)->getEscapers() - ); + $escapers = $env->getExtension(EscaperExtension::class)->getEscapers(); } if (isset($escapers[$strategy])) { diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/ExtensionInterface.php b/upload/system/storage/vendor/twig/twig/src/Extension/ExtensionInterface.php index a0832112587..75fa237e1de 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/ExtensionInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/ExtensionInterface.php @@ -66,8 +66,3 @@ public function getFunctions(); */ public function getOperators(); } - -class_alias('Twig\Extension\ExtensionInterface', 'Twig_ExtensionInterface'); - -// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. -class_exists('Twig\Environment'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/GlobalsInterface.php b/upload/system/storage/vendor/twig/twig/src/Extension/GlobalsInterface.php index 4421271b102..ec0c68292a1 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/GlobalsInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/GlobalsInterface.php @@ -21,12 +21,5 @@ */ interface GlobalsInterface { - /** - * Returns a list of global variables to add to the existing list. - * - * @return array An array of global variables - */ - public function getGlobals(); + public function getGlobals(): array; } - -class_alias('Twig\Extension\GlobalsInterface', 'Twig_Extension_GlobalsInterface'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/InitRuntimeInterface.php b/upload/system/storage/vendor/twig/twig/src/Extension/InitRuntimeInterface.php deleted file mode 100644 index d64d3cd1b82..00000000000 --- a/upload/system/storage/vendor/twig/twig/src/Extension/InitRuntimeInterface.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * @deprecated since Twig 2.7, to be removed in 3.0 - */ -interface InitRuntimeInterface -{ - /** - * Initializes the runtime environment. - * - * This is where you can load some file that contains filter functions for instance. - */ - public function initRuntime(Environment $environment); -} - -class_alias('Twig\Extension\InitRuntimeInterface', 'Twig_Extension_InitRuntimeInterface'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/OptimizerExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/OptimizerExtension.php index 9552b358982..965bfdb041d 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/OptimizerExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/OptimizerExtension.php @@ -17,15 +17,13 @@ final class OptimizerExtension extends AbstractExtension { private $optimizers; - public function __construct($optimizers = -1) + public function __construct(int $optimizers = -1) { $this->optimizers = $optimizers; } - public function getNodeVisitors() + public function getNodeVisitors(): array { return [new OptimizerNodeVisitor($this->optimizers)]; } } - -class_alias('Twig\Extension\OptimizerExtension', 'Twig_Extension_Optimizer'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/ProfilerExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/ProfilerExtension.php index 9e87c05a037..43e4a449e47 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/ProfilerExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/ProfilerExtension.php @@ -23,12 +23,18 @@ public function __construct(Profile $profile) $this->actives[] = $profile; } + /** + * @return void + */ public function enter(Profile $profile) { $this->actives[0]->addProfile($profile); array_unshift($this->actives, $profile); } + /** + * @return void + */ public function leave(Profile $profile) { $profile->leave(); @@ -39,10 +45,8 @@ public function leave(Profile $profile) } } - public function getNodeVisitors() + public function getNodeVisitors(): array { return [new ProfilerNodeVisitor(static::class)]; } } - -class_alias('Twig\Extension\ProfilerExtension', 'Twig_Extension_Profiler'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/SandboxExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/SandboxExtension.php index d16e4edd012..0a28cabf10e 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/SandboxExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/SandboxExtension.php @@ -30,32 +30,32 @@ public function __construct(SecurityPolicyInterface $policy, $sandboxed = false) $this->sandboxedGlobally = $sandboxed; } - public function getTokenParsers() + public function getTokenParsers(): array { return [new SandboxTokenParser()]; } - public function getNodeVisitors() + public function getNodeVisitors(): array { return [new SandboxNodeVisitor()]; } - public function enableSandbox() + public function enableSandbox(): void { $this->sandboxed = true; } - public function disableSandbox() + public function disableSandbox(): void { $this->sandboxed = false; } - public function isSandboxed() + public function isSandboxed(): bool { return $this->sandboxedGlobally || $this->sandboxed; } - public function isSandboxedGlobally() + public function isSandboxedGlobally(): bool { return $this->sandboxedGlobally; } @@ -65,19 +65,19 @@ public function setSecurityPolicy(SecurityPolicyInterface $policy) $this->policy = $policy; } - public function getSecurityPolicy() + public function getSecurityPolicy(): SecurityPolicyInterface { return $this->policy; } - public function checkSecurity($tags, $filters, $functions) + public function checkSecurity($tags, $filters, $functions): void { if ($this->isSandboxed()) { $this->policy->checkSecurity($tags, $filters, $functions); } } - public function checkMethodAllowed($obj, $method, int $lineno = -1, Source $source = null) + public function checkMethodAllowed($obj, $method, int $lineno = -1, Source $source = null): void { if ($this->isSandboxed()) { try { @@ -91,7 +91,7 @@ public function checkMethodAllowed($obj, $method, int $lineno = -1, Source $sour } } - public function checkPropertyAllowed($obj, $method, int $lineno = -1, Source $source = null) + public function checkPropertyAllowed($obj, $method, int $lineno = -1, Source $source = null): void { if ($this->isSandboxed()) { try { @@ -121,5 +121,3 @@ public function ensureToStringAllowed($obj, int $lineno = -1, Source $source = n return $obj; } } - -class_alias('Twig\Extension\SandboxExtension', 'Twig_Extension_Sandbox'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/StagingExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/StagingExtension.php index 7c0c26c8623..0ea47f90c5c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/StagingExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/StagingExtension.php @@ -32,7 +32,7 @@ final class StagingExtension extends AbstractExtension private $tokenParsers = []; private $tests = []; - public function addFunction(TwigFunction $function) + public function addFunction(TwigFunction $function): void { if (isset($this->functions[$function->getName()])) { throw new \LogicException(sprintf('Function "%s" is already registered.', $function->getName())); @@ -41,12 +41,12 @@ public function addFunction(TwigFunction $function) $this->functions[$function->getName()] = $function; } - public function getFunctions() + public function getFunctions(): array { return $this->functions; } - public function addFilter(TwigFilter $filter) + public function addFilter(TwigFilter $filter): void { if (isset($this->filters[$filter->getName()])) { throw new \LogicException(sprintf('Filter "%s" is already registered.', $filter->getName())); @@ -55,22 +55,22 @@ public function addFilter(TwigFilter $filter) $this->filters[$filter->getName()] = $filter; } - public function getFilters() + public function getFilters(): array { return $this->filters; } - public function addNodeVisitor(NodeVisitorInterface $visitor) + public function addNodeVisitor(NodeVisitorInterface $visitor): void { $this->visitors[] = $visitor; } - public function getNodeVisitors() + public function getNodeVisitors(): array { return $this->visitors; } - public function addTokenParser(TokenParserInterface $parser) + public function addTokenParser(TokenParserInterface $parser): void { if (isset($this->tokenParsers[$parser->getTag()])) { throw new \LogicException(sprintf('Tag "%s" is already registered.', $parser->getTag())); @@ -79,12 +79,12 @@ public function addTokenParser(TokenParserInterface $parser) $this->tokenParsers[$parser->getTag()] = $parser; } - public function getTokenParsers() + public function getTokenParsers(): array { return $this->tokenParsers; } - public function addTest(TwigTest $test) + public function addTest(TwigTest $test): void { if (isset($this->tests[$test->getName()])) { throw new \LogicException(sprintf('Test "%s" is already registered.', $test->getName())); @@ -93,10 +93,8 @@ public function addTest(TwigTest $test) $this->tests[$test->getName()] = $test; } - public function getTests() + public function getTests(): array { return $this->tests; } } - -class_alias('Twig\Extension\StagingExtension', 'Twig_Extension_Staging'); diff --git a/upload/system/storage/vendor/twig/twig/src/Extension/StringLoaderExtension.php b/upload/system/storage/vendor/twig/twig/src/Extension/StringLoaderExtension.php index d6718620e75..7b451471007 100644 --- a/upload/system/storage/vendor/twig/twig/src/Extension/StringLoaderExtension.php +++ b/upload/system/storage/vendor/twig/twig/src/Extension/StringLoaderExtension.php @@ -14,15 +14,13 @@ final class StringLoaderExtension extends AbstractExtension { - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('template_from_string', 'twig_template_from_string', ['needs_environment' => true]), ]; } } - -class_alias('Twig\Extension\StringLoaderExtension', 'Twig_Extension_StringLoader'); } namespace { @@ -36,10 +34,8 @@ class_alias('Twig\Extension\StringLoaderExtension', 'Twig_Extension_StringLoader * * @param string $template A template as a string or object implementing __toString() * @param string $name An optional name of the template to be used in error messages - * - * @return TemplateWrapper */ -function twig_template_from_string(Environment $env, $template, string $name = null) +function twig_template_from_string(Environment $env, $template, string $name = null): TemplateWrapper { return $env->createTemplate((string) $template, $name); } diff --git a/upload/system/storage/vendor/twig/twig/src/ExtensionSet.php b/upload/system/storage/vendor/twig/twig/src/ExtensionSet.php index dc25b133b7a..36e5bbc59da 100644 --- a/upload/system/storage/vendor/twig/twig/src/ExtensionSet.php +++ b/upload/system/storage/vendor/twig/twig/src/ExtensionSet.php @@ -14,7 +14,6 @@ use Twig\Error\RuntimeError; use Twig\Extension\ExtensionInterface; use Twig\Extension\GlobalsInterface; -use Twig\Extension\InitRuntimeInterface; use Twig\Extension\StagingExtension; use Twig\NodeVisitor\NodeVisitorInterface; use Twig\TokenParser\TokenParserInterface; @@ -40,6 +39,7 @@ final class ExtensionSet private $globals; private $functionCallbacks = []; private $filterCallbacks = []; + private $parserCallbacks = []; private $lastModified = 0; public function __construct() @@ -47,44 +47,19 @@ public function __construct() $this->staging = new StagingExtension(); } - /** - * Initializes the runtime environment. - * - * @deprecated since Twig 2.7 - */ - public function initRuntime(Environment $env) + public function initRuntime() { - if ($this->runtimeInitialized) { - return; - } - $this->runtimeInitialized = true; - - foreach ($this->extensions as $extension) { - if ($extension instanceof InitRuntimeInterface) { - $extension->initRuntime($env); - } - } } public function hasExtension(string $class): bool { - $class = ltrim($class, '\\'); - if (!isset($this->extensions[$class]) && class_exists($class, false)) { - // For BC/FC with namespaced aliases - $class = (new \ReflectionClass($class))->name; - } - - return isset($this->extensions[$class]); + return isset($this->extensions[ltrim($class, '\\')]); } public function getExtension(string $class): ExtensionInterface { $class = ltrim($class, '\\'); - if (!isset($this->extensions[$class]) && class_exists($class, false)) { - // For BC/FC with namespaced aliases - $class = (new \ReflectionClass($class))->name; - } if (!isset($this->extensions[$class])) { throw new RuntimeError(sprintf('The "%s" extension is not enabled.', $class)); @@ -96,7 +71,7 @@ public function getExtension(string $class): ExtensionInterface /** * @param ExtensionInterface[] $extensions */ - public function setExtensions(array $extensions) + public function setExtensions(array $extensions): void { foreach ($extensions as $extension) { $this->addExtension($extension); @@ -129,7 +104,7 @@ public function getLastModified(): int foreach ($this->extensions as $extension) { $r = new \ReflectionObject($extension); - if (file_exists($r->getFileName()) && ($extensionTime = filemtime($r->getFileName())) > $this->lastModified) { + if (is_file($r->getFileName()) && ($extensionTime = filemtime($r->getFileName())) > $this->lastModified) { $this->lastModified = $extensionTime; } } @@ -137,7 +112,7 @@ public function getLastModified(): int return $this->lastModified; } - public function addExtension(ExtensionInterface $extension) + public function addExtension(ExtensionInterface $extension): void { $class = \get_class($extension); @@ -149,12 +124,10 @@ public function addExtension(ExtensionInterface $extension) throw new \LogicException(sprintf('Unable to register extension "%s" as it is already registered.', $class)); } - // For BC/FC with namespaced aliases - $class = (new \ReflectionClass($class))->name; $this->extensions[$class] = $extension; } - public function addFunction(TwigFunction $function) + public function addFunction(TwigFunction $function): void { if ($this->initialized) { throw new \LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $function->getName())); @@ -175,10 +148,7 @@ public function getFunctions(): array return $this->functions; } - /** - * @return TwigFunction|false - */ - public function getFunction(string $name) + public function getFunction(string $name): ?TwigFunction { if (!$this->initialized) { $this->initExtensions(); @@ -205,15 +175,15 @@ public function getFunction(string $name) } } - return false; + return null; } - public function registerUndefinedFunctionCallback(callable $callable) + public function registerUndefinedFunctionCallback(callable $callable): void { $this->functionCallbacks[] = $callable; } - public function addFilter(TwigFilter $filter) + public function addFilter(TwigFilter $filter): void { if ($this->initialized) { throw new \LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $filter->getName())); @@ -234,10 +204,7 @@ public function getFilters(): array return $this->filters; } - /** - * @return TwigFilter|false - */ - public function getFilter(string $name) + public function getFilter(string $name): ?TwigFilter { if (!$this->initialized) { $this->initExtensions(); @@ -264,15 +231,15 @@ public function getFilter(string $name) } } - return false; + return null; } - public function registerUndefinedFilterCallback(callable $callable) + public function registerUndefinedFilterCallback(callable $callable): void { $this->filterCallbacks[] = $callable; } - public function addNodeVisitor(NodeVisitorInterface $visitor) + public function addNodeVisitor(NodeVisitorInterface $visitor): void { if ($this->initialized) { throw new \LogicException('Unable to add a node visitor as extensions have already been initialized.'); @@ -293,7 +260,7 @@ public function getNodeVisitors(): array return $this->visitors; } - public function addTokenParser(TokenParserInterface $parser) + public function addTokenParser(TokenParserInterface $parser): void { if ($this->initialized) { throw new \LogicException('Unable to add a token parser as extensions have already been initialized.'); @@ -314,6 +281,30 @@ public function getTokenParsers(): array return $this->parsers; } + public function getTokenParser(string $name): ?TokenParserInterface + { + if (!$this->initialized) { + $this->initExtensions(); + } + + if (isset($this->parsers[$name])) { + return $this->parsers[$name]; + } + + foreach ($this->parserCallbacks as $callback) { + if (false !== $parser = $callback($name)) { + return $parser; + } + } + + return null; + } + + public function registerUndefinedTokenParserCallback(callable $callable): void + { + $this->parserCallbacks[] = $callable; + } + public function getGlobals(): array { if (null !== $this->globals) { @@ -341,7 +332,7 @@ public function getGlobals(): array return $globals; } - public function addTest(TwigTest $test) + public function addTest(TwigTest $test): void { if ($this->initialized) { throw new \LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $test->getName())); @@ -362,10 +353,7 @@ public function getTests(): array return $this->tests; } - /** - * @return TwigTest|false - */ - public function getTest(string $name) + public function getTest(string $name): ?TwigTest { if (!$this->initialized) { $this->initExtensions(); @@ -388,7 +376,7 @@ public function getTest(string $name) } } - return false; + return null; } public function getUnaryOperators(): array @@ -409,7 +397,7 @@ public function getBinaryOperators(): array return $this->binaryOperators; } - private function initExtensions() + private function initExtensions(): void { $this->parsers = []; $this->filters = []; @@ -427,7 +415,7 @@ private function initExtensions() $this->initialized = true; } - private function initExtension(ExtensionInterface $extension) + private function initExtension(ExtensionInterface $extension): void { // filters foreach ($extension->getFilters() as $filter) { @@ -450,7 +438,7 @@ private function initExtension(ExtensionInterface $extension) throw new \LogicException('getTokenParsers() must return an array of \Twig\TokenParser\TokenParserInterface.'); } - $this->parsers[] = $parser; + $this->parsers[$parser->getTag()] = $parser; } // node visitors @@ -473,5 +461,3 @@ private function initExtension(ExtensionInterface $extension) } } } - -class_alias('Twig\ExtensionSet', 'Twig_ExtensionSet'); diff --git a/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php b/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php index d79106c3148..65198bbb649 100644 --- a/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php +++ b/upload/system/storage/vendor/twig/twig/src/FileExtensionEscapingStrategy.php @@ -31,7 +31,7 @@ class FileExtensionEscapingStrategy * * @return string|false The escaping strategy name to use or false to disable */ - public static function guess($name) + public static function guess(string $name) { if (\in_array(substr($name, -1), ['/', '\\'])) { return 'html'; // return html for directories @@ -58,5 +58,3 @@ public static function guess($name) } } } - -class_alias('Twig\FileExtensionEscapingStrategy', 'Twig_FileExtensionEscapingStrategy'); diff --git a/upload/system/storage/vendor/twig/twig/src/Lexer.php b/upload/system/storage/vendor/twig/twig/src/Lexer.php index edde9a7a0cb..9ff028c87d9 100644 --- a/upload/system/storage/vendor/twig/twig/src/Lexer.php +++ b/upload/system/storage/vendor/twig/twig/src/Lexer.php @@ -15,8 +15,6 @@ use Twig\Error\SyntaxError; /** - * Lexes a template string. - * * @author Fabien Potencier */ class Lexer @@ -153,7 +151,7 @@ public function __construct(Environment $env, array $options = []) ]; } - public function tokenize(Source $source) + public function tokenize(Source $source): TokenStream { $this->source = $source; $this->code = str_replace(["\r\n", "\r"], "\n", $source->getCode()); @@ -206,7 +204,7 @@ public function tokenize(Source $source) return new TokenStream($this->tokens, $this->source); } - private function lexData() + private function lexData(): void { // if no matches are left we return the rest of the template as simple text token if ($this->position == \count($this->positions[0]) - 1) { @@ -271,7 +269,7 @@ private function lexData() } } - private function lexBlock() + private function lexBlock(): void { if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, 0, $this->cursor)) { $this->pushToken(/* Token::BLOCK_END_TYPE */ 3); @@ -282,7 +280,7 @@ private function lexBlock() } } - private function lexVar() + private function lexVar(): void { if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, 0, $this->cursor)) { $this->pushToken(/* Token::VAR_END_TYPE */ 4); @@ -293,7 +291,7 @@ private function lexVar() } } - private function lexExpression() + private function lexExpression(): void { // whitespace if (preg_match('/\s+/A', $this->code, $match, 0, $this->cursor)) { @@ -366,7 +364,7 @@ private function lexExpression() } } - private function lexRawData() + private function lexRawData(): void { if (!preg_match($this->regexes['lex_raw_data'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { throw new SyntaxError('Unexpected end of file: Unclosed "verbatim" block.', $this->lineno, $this->source); @@ -390,7 +388,7 @@ private function lexRawData() $this->pushToken(/* Token::TEXT_TYPE */ 0, $text); } - private function lexComment() + private function lexComment(): void { if (!preg_match($this->regexes['lex_comment'], $this->code, $match, \PREG_OFFSET_CAPTURE, $this->cursor)) { throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source); @@ -399,7 +397,7 @@ private function lexComment() $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); } - private function lexString() + private function lexString(): void { if (preg_match($this->regexes['interpolation_start'], $this->code, $match, 0, $this->cursor)) { $this->brackets[] = [$this->options['interpolation'][0], $this->lineno]; @@ -423,7 +421,7 @@ private function lexString() } } - private function lexInterpolation() + private function lexInterpolation(): void { $bracket = end($this->brackets); if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, 0, $this->cursor)) { @@ -436,7 +434,7 @@ private function lexInterpolation() } } - private function pushToken($type, $value = '') + private function pushToken($type, $value = ''): void { // do not push empty text tokens if (/* Token::TEXT_TYPE */ 0 === $type && '' === $value) { @@ -446,13 +444,13 @@ private function pushToken($type, $value = '') $this->tokens[] = new Token($type, $value, $this->lineno); } - private function moveCursor($text) + private function moveCursor($text): void { $this->cursor += \strlen($text); $this->lineno += substr_count($text, "\n"); } - private function getOperatorRegex() + private function getOperatorRegex(): string { $operators = array_merge( ['='], @@ -486,13 +484,13 @@ private function getOperatorRegex() return '/'.implode('|', $regex).'/A'; } - private function pushState($state) + private function pushState($state): void { $this->states[] = $this->state; $this->state = $state; } - private function popState() + private function popState(): void { if (0 === \count($this->states)) { throw new \LogicException('Cannot pop state without a previous state.'); @@ -501,5 +499,3 @@ private function popState() $this->state = array_pop($this->states); } } - -class_alias('Twig\Lexer', 'Twig_Lexer'); diff --git a/upload/system/storage/vendor/twig/twig/src/Loader/ArrayLoader.php b/upload/system/storage/vendor/twig/twig/src/Loader/ArrayLoader.php index b03170b2323..5d726c35ac7 100644 --- a/upload/system/storage/vendor/twig/twig/src/Loader/ArrayLoader.php +++ b/upload/system/storage/vendor/twig/twig/src/Loader/ArrayLoader.php @@ -26,7 +26,7 @@ * * @author Fabien Potencier */ -final class ArrayLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +final class ArrayLoader implements LoaderInterface { private $templates = []; @@ -38,20 +38,13 @@ public function __construct(array $templates = []) $this->templates = $templates; } - /** - * Adds or overrides a template. - * - * @param string $name The template name - * @param string $template The template source - */ - public function setTemplate($name, $template) + public function setTemplate(string $name, string $template): void { $this->templates[$name] = $template; } - public function getSourceContext($name) + public function getSourceContext(string $name): Source { - $name = (string) $name; if (!isset($this->templates[$name])) { throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); } @@ -59,12 +52,12 @@ public function getSourceContext($name) return new Source($this->templates[$name], $name); } - public function exists($name) + public function exists(string $name): bool { return isset($this->templates[$name]); } - public function getCacheKey($name) + public function getCacheKey(string $name): string { if (!isset($this->templates[$name])) { throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); @@ -73,7 +66,7 @@ public function getCacheKey($name) return $name.':'.$this->templates[$name]; } - public function isFresh($name, $time) + public function isFresh(string $name, int $time): bool { if (!isset($this->templates[$name])) { throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); @@ -82,5 +75,3 @@ public function isFresh($name, $time) return true; } } - -class_alias('Twig\Loader\ArrayLoader', 'Twig_Loader_Array'); diff --git a/upload/system/storage/vendor/twig/twig/src/Loader/ChainLoader.php b/upload/system/storage/vendor/twig/twig/src/Loader/ChainLoader.php index edb9df8ca16..fbf4f3a0654 100644 --- a/upload/system/storage/vendor/twig/twig/src/Loader/ChainLoader.php +++ b/upload/system/storage/vendor/twig/twig/src/Loader/ChainLoader.php @@ -12,13 +12,14 @@ namespace Twig\Loader; use Twig\Error\LoaderError; +use Twig\Source; /** * Loads templates from other loaders. * * @author Fabien Potencier */ -final class ChainLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +final class ChainLoader implements LoaderInterface { private $hasSourceCache = []; private $loaders = []; @@ -33,7 +34,7 @@ public function __construct(array $loaders = []) } } - public function addLoader(LoaderInterface $loader) + public function addLoader(LoaderInterface $loader): void { $this->loaders[] = $loader; $this->hasSourceCache = []; @@ -42,12 +43,12 @@ public function addLoader(LoaderInterface $loader) /** * @return LoaderInterface[] */ - public function getLoaders() + public function getLoaders(): array { return $this->loaders; } - public function getSourceContext($name) + public function getSourceContext(string $name): Source { $exceptions = []; foreach ($this->loaders as $loader) { @@ -65,7 +66,7 @@ public function getSourceContext($name) throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); } - public function exists($name) + public function exists(string $name): bool { if (isset($this->hasSourceCache[$name])) { return $this->hasSourceCache[$name]; @@ -80,7 +81,7 @@ public function exists($name) return $this->hasSourceCache[$name] = false; } - public function getCacheKey($name) + public function getCacheKey(string $name): string { $exceptions = []; foreach ($this->loaders as $loader) { @@ -98,7 +99,7 @@ public function getCacheKey($name) throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); } - public function isFresh($name, $time) + public function isFresh(string $name, int $time): bool { $exceptions = []; foreach ($this->loaders as $loader) { @@ -116,5 +117,3 @@ public function isFresh($name, $time) throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); } } - -class_alias('Twig\Loader\ChainLoader', 'Twig_Loader_Chain'); diff --git a/upload/system/storage/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php b/upload/system/storage/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php deleted file mode 100644 index aab8bd8619b..00000000000 --- a/upload/system/storage/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - */ -class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +class FilesystemLoader implements LoaderInterface { /** Identifier of the main namespace. */ public const MAIN_NAMESPACE = '__main__'; @@ -48,35 +48,26 @@ public function __construct($paths = [], string $rootPath = null) /** * Returns the paths to the templates. - * - * @param string $namespace A path namespace - * - * @return array The array of paths where to look for templates */ - public function getPaths($namespace = self::MAIN_NAMESPACE) + public function getPaths(string $namespace = self::MAIN_NAMESPACE): array { - return isset($this->paths[$namespace]) ? $this->paths[$namespace] : []; + return $this->paths[$namespace] ?? []; } /** * Returns the path namespaces. * * The main namespace is always defined. - * - * @return array The array of defined namespaces */ - public function getNamespaces() + public function getNamespaces(): array { return array_keys($this->paths); } /** - * Sets the paths where templates are stored. - * - * @param string|array $paths A path or an array of paths where to look for templates - * @param string $namespace A path namespace + * @param string|array $paths A path or an array of paths where to look for templates */ - public function setPaths($paths, $namespace = self::MAIN_NAMESPACE) + public function setPaths($paths, string $namespace = self::MAIN_NAMESPACE): void { if (!\is_array($paths)) { $paths = [$paths]; @@ -89,14 +80,9 @@ public function setPaths($paths, $namespace = self::MAIN_NAMESPACE) } /** - * Adds a path where templates are stored. - * - * @param string $path A path where to look for templates - * @param string $namespace A path namespace - * * @throws LoaderError */ - public function addPath($path, $namespace = self::MAIN_NAMESPACE) + public function addPath(string $path, string $namespace = self::MAIN_NAMESPACE): void { // invalidate the cache $this->cache = $this->errorCache = []; @@ -110,14 +96,9 @@ public function addPath($path, $namespace = self::MAIN_NAMESPACE) } /** - * Prepends a path where templates are stored. - * - * @param string $path A path where to look for templates - * @param string $namespace A path namespace - * * @throws LoaderError */ - public function prependPath($path, $namespace = self::MAIN_NAMESPACE) + public function prependPath(string $path, string $namespace = self::MAIN_NAMESPACE): void { // invalidate the cache $this->cache = $this->errorCache = []; @@ -136,18 +117,18 @@ public function prependPath($path, $namespace = self::MAIN_NAMESPACE) } } - public function getSourceContext($name) + public function getSourceContext(string $name): Source { - if (null === ($path = $this->findTemplate($name)) || false === $path) { + if (null === $path = $this->findTemplate($name)) { return new Source('', $name, ''); } return new Source(file_get_contents($path), $name, $path); } - public function getCacheKey($name) + public function getCacheKey(string $name): string { - if (null === ($path = $this->findTemplate($name)) || false === $path) { + if (null === $path = $this->findTemplate($name)) { return ''; } $len = \strlen($this->rootPath); @@ -158,7 +139,10 @@ public function getCacheKey($name) return $path; } - public function exists($name) + /** + * @return bool + */ + public function exists(string $name) { $name = $this->normalizeName($name); @@ -166,13 +150,13 @@ public function exists($name) return true; } - return null !== ($path = $this->findTemplate($name, false)) && false !== $path; + return null !== $this->findTemplate($name, false); } - public function isFresh($name, $time) + public function isFresh(string $name, int $time): bool { // false support to be removed in 3.0 - if (null === ($path = $this->findTemplate($name)) || false === $path) { + if (null === $path = $this->findTemplate($name)) { return false; } @@ -180,16 +164,9 @@ public function isFresh($name, $time) } /** - * Checks if the template can be found. - * - * In Twig 3.0, findTemplate must return a string or null (returning false won't work anymore). - * - * @param string $name The template name - * @param bool $throw Whether to throw an exception when an error occurs - * - * @return string|false|null The template name or false/null + * @return string|null */ - protected function findTemplate($name, $throw = true) + protected function findTemplate(string $name, bool $throw = true) { $name = $this->normalizeName($name); @@ -199,7 +176,7 @@ protected function findTemplate($name, $throw = true) if (isset($this->errorCache[$name])) { if (!$throw) { - return false; + return null; } throw new LoaderError($this->errorCache[$name]); @@ -211,7 +188,7 @@ protected function findTemplate($name, $throw = true) list($namespace, $shortname) = $this->parseName($name); } catch (LoaderError $e) { if (!$throw) { - return false; + return null; } throw $e; @@ -221,7 +198,7 @@ protected function findTemplate($name, $throw = true) $this->errorCache[$name] = sprintf('There are no registered paths for namespace "%s".', $namespace); if (!$throw) { - return false; + return null; } throw new LoaderError($this->errorCache[$name]); @@ -244,18 +221,18 @@ protected function findTemplate($name, $throw = true) $this->errorCache[$name] = sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace])); if (!$throw) { - return false; + return null; } throw new LoaderError($this->errorCache[$name]); } - private function normalizeName($name) + private function normalizeName(string $name): string { - return preg_replace('#/{2,}#', '/', str_replace('\\', '/', (string) $name)); + return preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name)); } - private function parseName($name, $default = self::MAIN_NAMESPACE) + private function parseName(string $name, string $default = self::MAIN_NAMESPACE): array { if (isset($name[0]) && '@' == $name[0]) { if (false === $pos = strpos($name, '/')) { @@ -271,7 +248,7 @@ private function parseName($name, $default = self::MAIN_NAMESPACE) return [$default, $name]; } - private function validateName($name) + private function validateName(string $name): void { if (false !== strpos($name, "\0")) { throw new LoaderError('A template name cannot contain NUL bytes.'); @@ -293,7 +270,7 @@ private function validateName($name) } } - private function isAbsolutePath($file) + private function isAbsolutePath(string $file): bool { return strspn($file, '/\\', 0, 1) || (\strlen($file) > 3 && ctype_alpha($file[0]) @@ -304,5 +281,3 @@ private function isAbsolutePath($file) ; } } - -class_alias('Twig\Loader\FilesystemLoader', 'Twig_Loader_Filesystem'); diff --git a/upload/system/storage/vendor/twig/twig/src/Loader/LoaderInterface.php b/upload/system/storage/vendor/twig/twig/src/Loader/LoaderInterface.php index 5ccd2c785bf..fec7e85ff7c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Loader/LoaderInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/Loader/LoaderInterface.php @@ -24,46 +24,26 @@ interface LoaderInterface /** * Returns the source context for a given template logical name. * - * @param string $name The template logical name - * - * @return Source - * * @throws LoaderError When $name is not found */ - public function getSourceContext($name); + public function getSourceContext(string $name): Source; /** * Gets the cache key to use for the cache for a given template name. * - * @param string $name The name of the template to load - * - * @return string The cache key - * * @throws LoaderError When $name is not found */ - public function getCacheKey($name); + public function getCacheKey(string $name): string; /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param int $time Timestamp of the last modification time of the - * cached template - * - * @return bool true if the template is fresh, false otherwise + * @param int $time Timestamp of the last modification time of the cached template * * @throws LoaderError When $name is not found */ - public function isFresh($name, $time); + public function isFresh(string $name, int $time): bool; /** - * Check if we have the source code of a template, given its name. - * - * @param string $name The name of the template to check if we can load - * - * @return bool If the template source code is handled by this loader or not + * @return bool */ - public function exists($name); + public function exists(string $name); } - -class_alias('Twig\Loader\LoaderInterface', 'Twig_LoaderInterface'); diff --git a/upload/system/storage/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php b/upload/system/storage/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php deleted file mode 100644 index 4fdb17ea5c5..00000000000 --- a/upload/system/storage/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -content; } } - -class_alias('Twig\Markup', 'Twig_Markup'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/AutoEscapeNode.php b/upload/system/storage/vendor/twig/twig/src/Node/AutoEscapeNode.php index 0bd5ae1fdf6..cd970411b8d 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/AutoEscapeNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/AutoEscapeNode.php @@ -31,10 +31,8 @@ public function __construct($value, Node $body, int $lineno, string $tag = 'auto parent::__construct(['body' => $body], ['value' => $value], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->subcompile($this->getNode('body')); } } - -class_alias('Twig\Node\AutoEscapeNode', 'Twig_Node_AutoEscape'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/BlockNode.php b/upload/system/storage/vendor/twig/twig/src/Node/BlockNode.php index 4da6e6ff77b..0632ba74754 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/BlockNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/BlockNode.php @@ -26,7 +26,7 @@ public function __construct(string $name, Node $body, int $lineno, string $tag = parent::__construct(['body' => $body], ['name' => $name], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -42,5 +42,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\BlockNode', 'Twig_Node_Block'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/BlockReferenceNode.php b/upload/system/storage/vendor/twig/twig/src/Node/BlockReferenceNode.php index c46d8b3e322..cc8af5b5253 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/BlockReferenceNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/BlockReferenceNode.php @@ -26,7 +26,7 @@ public function __construct(string $name, int $lineno, string $tag = null) parent::__construct([], ['name' => $name], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -34,5 +34,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\BlockReferenceNode', 'Twig_Node_BlockReference'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/BodyNode.php b/upload/system/storage/vendor/twig/twig/src/Node/BodyNode.php index 5290be56db6..041cbf685b1 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/BodyNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/BodyNode.php @@ -19,5 +19,3 @@ class BodyNode extends Node { } - -class_alias('Twig\Node\BodyNode', 'Twig_Node_Body'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php b/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php index 489a3652ddf..472732796ed 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/CheckSecurityNode.php @@ -31,7 +31,7 @@ public function __construct(array $usedFilters, array $usedTags, array $usedFunc parent::__construct(); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $tags = $filters = $functions = []; foreach (['tags', 'filters', 'functions'] as $type) { @@ -86,5 +86,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\CheckSecurityNode', 'Twig_Node_CheckSecurity'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/CheckToStringNode.php b/upload/system/storage/vendor/twig/twig/src/Node/CheckToStringNode.php index 02b42fcdbc9..c7a9d6984e7 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/CheckToStringNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/CheckToStringNode.php @@ -31,7 +31,7 @@ public function __construct(AbstractExpression $expr) parent::__construct(['expr' => $expr], [], $expr->getTemplateLine(), $expr->getNodeTag()); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $expr = $this->getNode('expr'); $compiler diff --git a/upload/system/storage/vendor/twig/twig/src/Node/DeprecatedNode.php b/upload/system/storage/vendor/twig/twig/src/Node/DeprecatedNode.php index accd7680475..5ff44307fc5 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/DeprecatedNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/DeprecatedNode.php @@ -27,7 +27,7 @@ public function __construct(AbstractExpression $expr, int $lineno, string $tag = parent::__construct(['expr' => $expr], [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->addDebugInfo($this); @@ -51,5 +51,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\DeprecatedNode', 'Twig_Node_Deprecated'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/DoNode.php b/upload/system/storage/vendor/twig/twig/src/Node/DoNode.php index d74804c5d06..f7783d19f40 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/DoNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/DoNode.php @@ -26,7 +26,7 @@ public function __construct(AbstractExpression $expr, int $lineno, string $tag = parent::__construct(['expr' => $expr], [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -36,5 +36,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\DoNode', 'Twig_Node_Do'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/EmbedNode.php b/upload/system/storage/vendor/twig/twig/src/Node/EmbedNode.php index 016c17f8780..903c3f6c7ac 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/EmbedNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/EmbedNode.php @@ -31,7 +31,7 @@ public function __construct(string $name, int $index, ?AbstractExpression $varia $this->setAttribute('index', $index); } - protected function addGetTemplate(Compiler $compiler) + protected function addGetTemplate(Compiler $compiler): void { $compiler ->write('$this->loadTemplate(') @@ -46,5 +46,3 @@ protected function addGetTemplate(Compiler $compiler) ; } } - -class_alias('Twig\Node\EmbedNode', 'Twig_Node_Embed'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/AbstractExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/AbstractExpression.php index a3528924ca0..42da0559d12 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/AbstractExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/AbstractExpression.php @@ -22,5 +22,3 @@ abstract class AbstractExpression extends Node { } - -class_alias('Twig\Node\Expression\AbstractExpression', 'Twig_Node_Expression'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php index 917675d91e1..0e25fe46ad8 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrayExpression.php @@ -29,10 +29,9 @@ public function __construct(array $elements, int $lineno) } } - public function getKeyValuePairs() + public function getKeyValuePairs(): array { $pairs = []; - foreach (array_chunk($this->nodes, 2) as $pair) { $pairs[] = [ 'key' => $pair[0], @@ -43,7 +42,7 @@ public function getKeyValuePairs() return $pairs; } - public function hasElement(AbstractExpression $key) + public function hasElement(AbstractExpression $key): bool { foreach ($this->getKeyValuePairs() as $pair) { // we compare the string representation of the keys @@ -56,7 +55,7 @@ public function hasElement(AbstractExpression $key) return false; } - public function addElement(AbstractExpression $value, AbstractExpression $key = null) + public function addElement(AbstractExpression $value, AbstractExpression $key = null): void { if (null === $key) { $key = new ConstantExpression(++$this->index, $value->getTemplateLine()); @@ -65,7 +64,7 @@ public function addElement(AbstractExpression $value, AbstractExpression $key = array_push($this->nodes, $key, $value); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->raw('['); $first = true; @@ -84,5 +83,3 @@ public function compile(Compiler $compiler) $compiler->raw(']'); } } - -class_alias('Twig\Node\Expression\ArrayExpression', 'Twig_Node_Expression_Array'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php index b5b720eddf6..eaad03c9c05 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php @@ -26,7 +26,7 @@ public function __construct(AbstractExpression $expr, Node $names, $lineno, $tag parent::__construct(['expr' => $expr, 'names' => $names], [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php index 62c4ac0b48f..7dd1bc4a372 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php @@ -16,7 +16,7 @@ class AssignNameExpression extends NameExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('$context[') @@ -25,5 +25,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\AssignNameExpression', 'Twig_Node_Expression_AssignName'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php index 67c388aea19..c424e5cc5f0 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php @@ -23,7 +23,7 @@ public function __construct(Node $left, Node $right, int $lineno) parent::__construct(['left' => $left, 'right' => $right], [], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('(') @@ -38,7 +38,5 @@ public function compile(Compiler $compiler) ; } - abstract public function operator(Compiler $compiler); + abstract public function operator(Compiler $compiler): Compiler; } - -class_alias('Twig\Node\Expression\Binary\AbstractBinary', 'Twig_Node_Expression_Binary'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php index f7719a19ea2..ee4307e33e2 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php @@ -16,10 +16,8 @@ class AddBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('+'); } } - -class_alias('Twig\Node\Expression\Binary\AddBinary', 'Twig_Node_Expression_Binary_Add'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php index 484597da77d..5f2380da545 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php @@ -16,10 +16,8 @@ class AndBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('&&'); } } - -class_alias('Twig\Node\Expression\Binary\AndBinary', 'Twig_Node_Expression_Binary_And'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php index cf286912b28..db7d6d612dd 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php @@ -16,10 +16,8 @@ class BitwiseAndBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('&'); } } - -class_alias('Twig\Node\Expression\Binary\BitwiseAndBinary', 'Twig_Node_Expression_Binary_BitwiseAnd'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php index 7d5d2600799..ce803dd9027 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php @@ -16,10 +16,8 @@ class BitwiseOrBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('|'); } } - -class_alias('Twig\Node\Expression\Binary\BitwiseOrBinary', 'Twig_Node_Expression_Binary_BitwiseOr'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php index 72919871952..5c29785014d 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php @@ -16,10 +16,8 @@ class BitwiseXorBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('^'); } } - -class_alias('Twig\Node\Expression\Binary\BitwiseXorBinary', 'Twig_Node_Expression_Binary_BitwiseXor'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php index f6e5938fdd1..f825ab874d6 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php @@ -16,10 +16,8 @@ class ConcatBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('.'); } } - -class_alias('Twig\Node\Expression\Binary\ConcatBinary', 'Twig_Node_Expression_Binary_Concat'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php index ebfcc758b65..e3817d1cd7f 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php @@ -16,10 +16,8 @@ class DivBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('/'); } } - -class_alias('Twig\Node\Expression\Binary\DivBinary', 'Twig_Node_Expression_Binary_Div'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php index 41a0065bbc6..c3516b853fc 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php @@ -15,7 +15,7 @@ class EndsWithBinary extends AbstractBinary { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $left = $compiler->getVarName(); $right = $compiler->getVarName(); @@ -28,10 +28,8 @@ public function compile(Compiler $compiler) ; } - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw(''); } } - -class_alias('Twig\Node\Expression\Binary\EndsWithBinary', 'Twig_Node_Expression_Binary_EndsWith'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php index 84904c364ae..6b48549ef26 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php @@ -15,10 +15,25 @@ class EqualBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function compile(Compiler $compiler): void + { + if (\PHP_VERSION_ID >= 80000) { + parent::compile($compiler); + + return; + } + + $compiler + ->raw('(0 === twig_compare(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw('))') + ; + } + + public function operator(Compiler $compiler): Compiler { return $compiler->raw('=='); } } - -class_alias('Twig\Node\Expression\Binary\EqualBinary', 'Twig_Node_Expression_Binary_Equal'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php index 4dd5e3d32b7..d7e7980efde 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php @@ -15,17 +15,15 @@ class FloorDivBinary extends AbstractBinary { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->raw('(int) floor('); parent::compile($compiler); $compiler->raw(')'); } - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('/'); } } - -class_alias('Twig\Node\Expression\Binary\FloorDivBinary', 'Twig_Node_Expression_Binary_FloorDiv'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php index be73001e5b9..e1dd06780b7 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php @@ -15,10 +15,25 @@ class GreaterBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function compile(Compiler $compiler): void + { + if (\PHP_VERSION_ID >= 80000) { + parent::compile($compiler); + + return; + } + + $compiler + ->raw('(1 === twig_compare(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw('))') + ; + } + + public function operator(Compiler $compiler): Compiler { return $compiler->raw('>'); } } - -class_alias('Twig\Node\Expression\Binary\GreaterBinary', 'Twig_Node_Expression_Binary_Greater'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php index 5c2ae72ee23..df9bfcfbf9d 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php @@ -15,10 +15,25 @@ class GreaterEqualBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function compile(Compiler $compiler): void + { + if (\PHP_VERSION_ID >= 80000) { + parent::compile($compiler); + + return; + } + + $compiler + ->raw('(0 <= twig_compare(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw('))') + ; + } + + public function operator(Compiler $compiler): Compiler { return $compiler->raw('>='); } } - -class_alias('Twig\Node\Expression\Binary\GreaterEqualBinary', 'Twig_Node_Expression_Binary_GreaterEqual'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php index f00b23060f8..6dbfa97f05c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php @@ -15,7 +15,7 @@ class InBinary extends AbstractBinary { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('twig_in_filter(') @@ -26,10 +26,8 @@ public function compile(Compiler $compiler) ; } - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('in'); } } - -class_alias('Twig\Node\Expression\Binary\InBinary', 'Twig_Node_Expression_Binary_In'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php index 2b202daa728..598e629134b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php @@ -15,10 +15,25 @@ class LessBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function compile(Compiler $compiler): void + { + if (\PHP_VERSION_ID >= 80000) { + parent::compile($compiler); + + return; + } + + $compiler + ->raw('(-1 === twig_compare(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw('))') + ; + } + + public function operator(Compiler $compiler): Compiler { return $compiler->raw('<'); } } - -class_alias('Twig\Node\Expression\Binary\LessBinary', 'Twig_Node_Expression_Binary_Less'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php index 4fffafea6dc..e3c4af58d4c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php @@ -15,10 +15,25 @@ class LessEqualBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function compile(Compiler $compiler): void + { + if (\PHP_VERSION_ID >= 80000) { + parent::compile($compiler); + + return; + } + + $compiler + ->raw('(0 >= twig_compare(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw('))') + ; + } + + public function operator(Compiler $compiler): Compiler { return $compiler->raw('<='); } } - -class_alias('Twig\Node\Expression\Binary\LessEqualBinary', 'Twig_Node_Expression_Binary_LessEqual'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php index ae810b2664a..bc97292cda5 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php @@ -15,7 +15,7 @@ class MatchesBinary extends AbstractBinary { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('preg_match(') @@ -26,10 +26,8 @@ public function compile(Compiler $compiler) ; } - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw(''); } } - -class_alias('Twig\Node\Expression\Binary\MatchesBinary', 'Twig_Node_Expression_Binary_Matches'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php index e6a2b360346..271b45cac88 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php @@ -16,10 +16,8 @@ class ModBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('%'); } } - -class_alias('Twig\Node\Expression\Binary\ModBinary', 'Twig_Node_Expression_Binary_Mod'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php index cd65f5dff2d..6d4c1e0b6b8 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php @@ -16,10 +16,8 @@ class MulBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('*'); } } - -class_alias('Twig\Node\Expression\Binary\MulBinary', 'Twig_Node_Expression_Binary_Mul'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php index df5c6a23884..db47a289050 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php @@ -15,10 +15,25 @@ class NotEqualBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function compile(Compiler $compiler): void + { + if (\PHP_VERSION_ID >= 80000) { + parent::compile($compiler); + + return; + } + + $compiler + ->raw('(0 !== twig_compare(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw('))') + ; + } + + public function operator(Compiler $compiler): Compiler { return $compiler->raw('!='); } } - -class_alias('Twig\Node\Expression\Binary\NotEqualBinary', 'Twig_Node_Expression_Binary_NotEqual'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php index ed2034e35ad..fcba6cca1cb 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php @@ -15,7 +15,7 @@ class NotInBinary extends AbstractBinary { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('!twig_in_filter(') @@ -26,10 +26,8 @@ public function compile(Compiler $compiler) ; } - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('not in'); } } - -class_alias('Twig\Node\Expression\Binary\NotInBinary', 'Twig_Node_Expression_Binary_NotIn'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php index 8f9da43105c..21f87c91b4f 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php @@ -16,10 +16,8 @@ class OrBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('||'); } } - -class_alias('Twig\Node\Expression\Binary\OrBinary', 'Twig_Node_Expression_Binary_Or'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php index 32d0214fd7c..c9f4c6697df 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php @@ -15,10 +15,8 @@ class PowerBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('**'); } } - -class_alias('Twig\Node\Expression\Binary\PowerBinary', 'Twig_Node_Expression_Binary_Power'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php index e9c0cdf5e41..55982c819d7 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php @@ -15,7 +15,7 @@ class RangeBinary extends AbstractBinary { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('range(') @@ -26,10 +26,8 @@ public function compile(Compiler $compiler) ; } - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('..'); } } - -class_alias('Twig\Node\Expression\Binary\RangeBinary', 'Twig_Node_Expression_Binary_Range'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php index 5245e4051ca..ae5a4a49373 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php @@ -15,7 +15,7 @@ class SpaceshipBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('<=>'); } diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php index 1fe59fb4173..d0df1c4b639 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php @@ -15,7 +15,7 @@ class StartsWithBinary extends AbstractBinary { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $left = $compiler->getVarName(); $right = $compiler->getVarName(); @@ -28,10 +28,8 @@ public function compile(Compiler $compiler) ; } - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw(''); } } - -class_alias('Twig\Node\Expression\Binary\StartsWithBinary', 'Twig_Node_Expression_Binary_StartsWith'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php index 25469750aa0..eeb87faca96 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php @@ -16,10 +16,8 @@ class SubBinary extends AbstractBinary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { return $compiler->raw('-'); } } - -class_alias('Twig\Node\Expression\Binary\SubBinary', 'Twig_Node_Expression_Binary_Sub'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php index 8a6db4d002e..b1e2a8f7bb6 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php @@ -32,7 +32,7 @@ public function __construct(Node $name, ?Node $template, int $lineno, string $ta parent::__construct($nodes, ['is_defined_test' => false, 'output' => false], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { if ($this->getAttribute('is_defined_test')) { $this->compileTemplateCall($compiler, 'hasBlock'); @@ -84,5 +84,3 @@ private function compileBlockArguments(Compiler $compiler): Compiler return $compiler->raw(')'); } } - -class_alias('Twig\Node\Expression\BlockReferenceExpression', 'Twig_Node_Expression_BlockReference'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php index 7de754a9dfc..fdf92a8e76b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/CallExpression.php @@ -37,8 +37,7 @@ protected function compileCallable(Compiler $compiler) $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1])); } } elseif ($r instanceof \ReflectionMethod && $callable[0] instanceof ExtensionInterface) { - // For BC/FC with namespaced aliases - $class = (new \ReflectionClass(\get_class($callable[0])))->name; + $class = \get_class($callable[0]); if (!$compiler->getEnvironment()->hasExtension($class)) { // Compile a non-optimized call to trigger a \Twig\Error\RuntimeError, which cannot be a compile-time error $compiler->raw(sprintf('$this->env->getExtension(\'%s\')', $class)); @@ -61,7 +60,7 @@ protected function compileCallable(Compiler $compiler) } } - protected function compileArguments(Compiler $compiler, $isArray = false) + protected function compileArguments(Compiler $compiler, $isArray = false): void { $compiler->raw($isArray ? '[' : '('); @@ -238,7 +237,7 @@ protected function getArguments($callable, $arguments) return $arguments; } - protected function normalizeName($name) + protected function normalizeName(string $name): string { return strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], ['\\1_\\2', '\\1_\\2'], $name)); } @@ -319,5 +318,3 @@ private function reflectCallable($callable) return $this->reflector = [$r, $callable]; } } - -class_alias('Twig\Node\Expression\CallExpression', 'Twig_Node_Expression_Call'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php index 8c367d3579c..2c7bd0a276c 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php @@ -21,7 +21,7 @@ public function __construct(AbstractExpression $expr1, AbstractExpression $expr2 parent::__construct(['expr1' => $expr1, 'expr2' => $expr2, 'expr3' => $expr3], [], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('((') @@ -34,5 +34,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\ConditionalExpression', 'Twig_Node_Expression_Conditional'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConstantExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConstantExpression.php index 46e0ac39c63..7ddbcc6fa99 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConstantExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ConstantExpression.php @@ -21,10 +21,8 @@ public function __construct($value, int $lineno) parent::__construct([], ['value' => $value], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->repr($this->getAttribute('value')); } } - -class_alias('Twig\Node\Expression\ConstantExpression', 'Twig_Node_Expression_Constant'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php index 0dacae839fc..6a572d48848 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php @@ -45,10 +45,8 @@ public function __construct(Node $node, ConstantExpression $filterName, Node $ar parent::__construct($node, $filterName, $arguments, $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->subcompile($this->getNode('node')); } } - -class_alias('Twig\Node\Expression\Filter\DefaultFilter', 'Twig_Node_Expression_Filter_Default'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/FilterExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/FilterExpression.php index 41b07341c58..0fc1588696b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/FilterExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/FilterExpression.php @@ -22,7 +22,7 @@ public function __construct(Node $node, ConstantExpression $filterName, Node $ar parent::__construct(['node' => $node, 'filter' => $filterName, 'arguments' => $arguments], [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $name = $this->getNode('filter')->getAttribute('value'); $filter = $compiler->getEnvironment()->getFilter($name); @@ -38,5 +38,3 @@ public function compile(Compiler $compiler) $this->compileCallable($compiler); } } - -class_alias('Twig\Node\Expression\FilterExpression', 'Twig_Node_Expression_Filter'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/FunctionExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/FunctionExpression.php index 429dbb92459..71269775c3d 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/FunctionExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/FunctionExpression.php @@ -41,5 +41,3 @@ public function compile(Compiler $compiler) $this->compileCallable($compiler); } } - -class_alias('Twig\Node\Expression\FunctionExpression', 'Twig_Node_Expression_Function'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php index de76845a746..e6a75ce9404 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php @@ -28,7 +28,7 @@ public function __construct(AbstractExpression $node, AbstractExpression $attrib parent::__construct($nodes, ['type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'optimizable' => true], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $env = $compiler->getEnvironment(); @@ -85,5 +85,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\GetAttrExpression', 'Twig_Node_Expression_GetAttr'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/InlinePrint.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/InlinePrint.php index 469e73675a4..1ad4751e462 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/InlinePrint.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/InlinePrint.php @@ -19,12 +19,12 @@ */ final class InlinePrint extends AbstractExpression { - public function __construct(Node $node, $lineno) + public function __construct(Node $node, int $lineno) { parent::__construct(['node' => $node], [], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('print (') diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php index d5287f85f3a..d5ec0b6efcb 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php @@ -24,7 +24,7 @@ public function __construct(AbstractExpression $node, string $method, ArrayExpre } } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { if ($this->getAttribute('is_defined_test')) { $compiler @@ -60,5 +60,3 @@ public function compile(Compiler $compiler) ->raw(', $context, $this->getSourceContext())'); } } - -class_alias('Twig\Node\Expression\MethodCallExpression', 'Twig_Node_Expression_MethodCall'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/NameExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/NameExpression.php index f8426bcc1f2..c3563f01238 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/NameExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/NameExpression.php @@ -27,7 +27,7 @@ public function __construct(string $name, int $lineno) parent::__construct([], ['name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $name = $this->getAttribute('name'); @@ -95,5 +95,3 @@ public function isSimple() return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); } } - -class_alias('Twig\Node\Expression\NameExpression', 'Twig_Node_Expression_Name'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php index de03ff22025..a72bc4fc654 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php @@ -35,7 +35,7 @@ public function __construct(Node $left, Node $right, int $lineno) parent::__construct($test, $left, $right, $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { /* * This optimizes only one case. PHP 7 also supports more complex expressions @@ -58,5 +58,3 @@ public function compile(Compiler $compiler) } } } - -class_alias('Twig\Node\Expression\NullCoalesceExpression', 'Twig_Node_Expression_NullCoalesce'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ParentExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ParentExpression.php index 294ab398ecd..25491971841 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/ParentExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/ParentExpression.php @@ -26,7 +26,7 @@ public function __construct(string $name, int $lineno, string $tag = null) parent::__construct([], ['output' => false, 'name' => $name], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { if ($this->getAttribute('output')) { $compiler @@ -44,5 +44,3 @@ public function compile(Compiler $compiler) } } } - -class_alias('Twig\Node\Expression\ParentExpression', 'Twig_Node_Expression_Parent'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/TempNameExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/TempNameExpression.php index e7a1a890d26..004c704a588 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/TempNameExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/TempNameExpression.php @@ -20,7 +20,7 @@ public function __construct(string $name, int $lineno) parent::__construct([], ['name' => $name], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('$_') @@ -29,5 +29,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\TempNameExpression', 'Twig_Node_Expression_TempName'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php index 78353a8b256..57e9319d574 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php @@ -25,7 +25,7 @@ */ class ConstantTest extends TestExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('(') @@ -47,5 +47,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\Test\ConstantTest', 'Twig_Node_Expression_Test_Constant'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php index d748e86f0dc..3953bbbe2cc 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php @@ -67,10 +67,8 @@ private function changeIgnoreStrictCheck(GetAttrExpression $node) } } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->subcompile($this->getNode('node')); } } - -class_alias('Twig\Node\Expression\Test\DefinedTest', 'Twig_Node_Expression_Test_Defined'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php index 05c8ad8f7c3..4cb3ee09692 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php @@ -23,7 +23,7 @@ */ class DivisiblebyTest extends TestExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('(0 == ') @@ -34,5 +34,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\Test\DivisiblebyTest', 'Twig_Node_Expression_Test_Divisibleby'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php index 3b955d26a2f..a0e3ed62c1a 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php @@ -23,7 +23,7 @@ */ class EvenTest extends TestExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('(') @@ -33,5 +33,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\Test\EvenTest', 'Twig_Node_Expression_Test_Even'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/NullTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/NullTest.php index 24d399781ec..45b54ae3709 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/NullTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/NullTest.php @@ -23,7 +23,7 @@ */ class NullTest extends TestExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('(null === ') @@ -32,5 +32,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\Test\NullTest', 'Twig_Node_Expression_Test_Null'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php index 189e51e761e..d56c711169b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/OddTest.php @@ -23,7 +23,7 @@ */ class OddTest extends TestExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('(') @@ -33,5 +33,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\Test\OddTest', 'Twig_Node_Expression_Test_Odd'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php index 75f2b82a5bb..c96d2bc01a3 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php @@ -21,7 +21,7 @@ */ class SameasTest extends TestExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->raw('(') @@ -32,5 +32,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\Expression\Test\SameasTest', 'Twig_Node_Expression_Test_Sameas'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/TestExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/TestExpression.php index 24aa3903c3b..e518bd8f10b 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/TestExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/TestExpression.php @@ -26,7 +26,7 @@ public function __construct(Node $node, string $name, ?Node $arguments, int $lin parent::__construct($nodes, ['name' => $name], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $name = $this->getAttribute('name'); $test = $compiler->getEnvironment()->getTest($name); @@ -40,5 +40,3 @@ public function compile(Compiler $compiler) $this->compileCallable($compiler); } } - -class_alias('Twig\Node\Expression\TestExpression', 'Twig_Node_Expression_Test'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php index 4896280f102..e31e3f84b07 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php @@ -23,14 +23,12 @@ public function __construct(Node $node, int $lineno) parent::__construct(['node' => $node], [], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->raw(' '); $this->operator($compiler); $compiler->subcompile($this->getNode('node')); } - abstract public function operator(Compiler $compiler); + abstract public function operator(Compiler $compiler): Compiler; } - -class_alias('Twig\Node\Expression\Unary\AbstractUnary', 'Twig_Node_Expression_Unary'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php index dfb6f542954..dc2f2350a35 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php @@ -16,10 +16,8 @@ class NegUnary extends AbstractUnary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { - $compiler->raw('-'); + return $compiler->raw('-'); } } - -class_alias('Twig\Node\Expression\Unary\NegUnary', 'Twig_Node_Expression_Unary_Neg'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php index 7bdde96fffc..55c11bacf18 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php @@ -16,10 +16,8 @@ class NotUnary extends AbstractUnary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { - $compiler->raw('!'); + return $compiler->raw('!'); } } - -class_alias('Twig\Node\Expression\Unary\NotUnary', 'Twig_Node_Expression_Unary_Not'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php index 52d5d0c89a7..4b0a062087f 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php @@ -16,10 +16,8 @@ class PosUnary extends AbstractUnary { - public function operator(Compiler $compiler) + public function operator(Compiler $compiler): Compiler { - $compiler->raw('+'); + return $compiler->raw('+'); } } - -class_alias('Twig\Node\Expression\Unary\PosUnary', 'Twig_Node_Expression_Unary_Pos'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Expression/VariadicExpression.php b/upload/system/storage/vendor/twig/twig/src/Node/Expression/VariadicExpression.php index 3351e1a676b..a1bdb48c239 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Expression/VariadicExpression.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Expression/VariadicExpression.php @@ -15,7 +15,7 @@ class VariadicExpression extends ArrayExpression { - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->raw('...'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/FlushNode.php b/upload/system/storage/vendor/twig/twig/src/Node/FlushNode.php index b88f3409b98..fa50a88ee56 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/FlushNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/FlushNode.php @@ -25,7 +25,7 @@ public function __construct(int $lineno, string $tag) parent::__construct([], [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -33,5 +33,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\FlushNode', 'Twig_Node_Flush'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/ForLoopNode.php b/upload/system/storage/vendor/twig/twig/src/Node/ForLoopNode.php index 42aedd7ba62..d5ce845a791 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/ForLoopNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/ForLoopNode.php @@ -25,7 +25,7 @@ public function __construct(int $lineno, string $tag = null) parent::__construct([], ['with_loop' => false, 'ifexpr' => false, 'else' => false], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { if ($this->getAttribute('else')) { $compiler->write("\$context['_iterated'] = true;\n"); @@ -36,21 +36,14 @@ public function compile(Compiler $compiler) ->write("++\$context['loop']['index0'];\n") ->write("++\$context['loop']['index'];\n") ->write("\$context['loop']['first'] = false;\n") + ->write("if (isset(\$context['loop']['length'])) {\n") + ->indent() + ->write("--\$context['loop']['revindex0'];\n") + ->write("--\$context['loop']['revindex'];\n") + ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") + ->outdent() + ->write("}\n") ; - - if (!$this->getAttribute('ifexpr')) { - $compiler - ->write("if (isset(\$context['loop']['length'])) {\n") - ->indent() - ->write("--\$context['loop']['revindex0'];\n") - ->write("--\$context['loop']['revindex'];\n") - ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") - ->outdent() - ->write("}\n") - ; - } } } } - -class_alias('Twig\Node\ForLoopNode', 'Twig_Node_ForLoop'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/ForNode.php b/upload/system/storage/vendor/twig/twig/src/Node/ForNode.php index d5c34e617c3..04addfbfe58 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/ForNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/ForNode.php @@ -25,23 +25,19 @@ class ForNode extends Node { private $loop; - public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, ?AbstractExpression $ifexpr, Node $body, ?Node $else, int $lineno, string $tag = null) + public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, ?Node $ifexpr, Node $body, ?Node $else, int $lineno, string $tag = null) { $body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]); - if (null !== $ifexpr) { - $body = new IfNode(new Node([$ifexpr, $body]), null, $lineno, $tag); - } - $nodes = ['key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body]; if (null !== $else) { $nodes['else'] = $else; } - parent::__construct($nodes, ['with_loop' => true, 'ifexpr' => null !== $ifexpr], $lineno, $tag); + parent::__construct($nodes, ['with_loop' => true], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -63,26 +59,20 @@ public function compile(Compiler $compiler) ->write(" 'index' => 1,\n") ->write(" 'first' => true,\n") ->write("];\n") + ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) {\n") + ->indent() + ->write("\$length = count(\$context['_seq']);\n") + ->write("\$context['loop']['revindex0'] = \$length - 1;\n") + ->write("\$context['loop']['revindex'] = \$length;\n") + ->write("\$context['loop']['length'] = \$length;\n") + ->write("\$context['loop']['last'] = 1 === \$length;\n") + ->outdent() + ->write("}\n") ; - - if (!$this->getAttribute('ifexpr')) { - $compiler - ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) {\n") - ->indent() - ->write("\$length = count(\$context['_seq']);\n") - ->write("\$context['loop']['revindex0'] = \$length - 1;\n") - ->write("\$context['loop']['revindex'] = \$length;\n") - ->write("\$context['loop']['length'] = \$length;\n") - ->write("\$context['loop']['last'] = 1 === \$length;\n") - ->outdent() - ->write("}\n") - ; - } } $this->loop->setAttribute('else', $this->hasNode('else')); $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop')); - $this->loop->setAttribute('ifexpr', $this->getAttribute('ifexpr')); $compiler ->write("foreach (\$context['_seq'] as ") @@ -115,5 +105,3 @@ public function compile(Compiler $compiler) $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); } } - -class_alias('Twig\Node\ForNode', 'Twig_Node_For'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/IfNode.php b/upload/system/storage/vendor/twig/twig/src/Node/IfNode.php index 8ba23ddb60a..5fa20082a74 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/IfNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/IfNode.php @@ -31,7 +31,7 @@ public function __construct(Node $tests, ?Node $else, int $lineno, string $tag = parent::__construct($nodes, [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->addDebugInfo($this); for ($i = 0, $count = \count($this->getNode('tests')); $i < $count; $i += 2) { @@ -68,5 +68,3 @@ public function compile(Compiler $compiler) ->write("}\n"); } } - -class_alias('Twig\Node\IfNode', 'Twig_Node_If'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/ImportNode.php b/upload/system/storage/vendor/twig/twig/src/Node/ImportNode.php index b661f4313a7..5378d799e28 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/ImportNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/ImportNode.php @@ -27,7 +27,7 @@ public function __construct(AbstractExpression $expr, AbstractExpression $var, i parent::__construct(['expr' => $expr, 'var' => $var], ['global' => $global], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -61,5 +61,3 @@ public function compile(Compiler $compiler) $compiler->raw(";\n"); } } - -class_alias('Twig\Node\ImportNode', 'Twig_Node_Import'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/IncludeNode.php b/upload/system/storage/vendor/twig/twig/src/Node/IncludeNode.php index 3bc91295b08..d540d6b23bf 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/IncludeNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/IncludeNode.php @@ -29,10 +29,10 @@ public function __construct(AbstractExpression $expr, ?AbstractExpression $varia $nodes['variables'] = $variables; } - parent::__construct($nodes, ['only' => (bool) $only, 'ignore_missing' => (bool) $ignoreMissing], $lineno, $tag); + parent::__construct($nodes, ['only' => $only, 'ignore_missing' => $ignoreMissing], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->addDebugInfo($this); @@ -104,5 +104,3 @@ protected function addTemplateArguments(Compiler $compiler) } } } - -class_alias('Twig\Node\IncludeNode', 'Twig_Node_Include'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php b/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php index ca4686ce95f..7f1b24d5372 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/MacroNode.php @@ -34,7 +34,7 @@ public function __construct(string $name, Node $body, Node $arguments, int $line parent::__construct(['body' => $body, 'arguments' => $arguments], ['name' => $name], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -111,5 +111,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\MacroNode', 'Twig_Node_Macro'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php b/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php index 29af67706d9..e972b6ba582 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/ModuleNode.php @@ -25,17 +25,11 @@ * display_end, constructor_start, constructor_end, and class_end. * * @author Fabien Potencier - * - * @final since Twig 2.4.0 */ -class ModuleNode extends Node +final class ModuleNode extends Node { public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) { - if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); - } - $nodes = [ 'body' => $body, 'blocks' => $blocks, @@ -66,7 +60,7 @@ public function setIndex($index) $this->setAttribute('index', $index); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $this->compileTemplate($compiler); @@ -163,7 +157,7 @@ protected function compileClassHeader(Compiler $compiler) // if the template name contains */, add a blank to avoid a PHP parse error ->write('/* '.str_replace('*/', '* /', $this->getSourceContext()->getName())." */\n") ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getSourceContext()->getName(), $this->getAttribute('index'))) - ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass(false))) + ->raw(" extends Template\n") ->write("{\n") ->indent() ->write("private \$source;\n") @@ -468,5 +462,3 @@ protected function compileLoadTemplate(Compiler $compiler, $node, $var) } } } - -class_alias('Twig\Node\ModuleNode', 'Twig_Node_Module'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/Node.php b/upload/system/storage/vendor/twig/twig/src/Node/Node.php index 97447525f71..c0558b9afdc 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/Node.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/Node.php @@ -77,6 +77,9 @@ public function __toString() return implode("\n", $repr); } + /** + * @return void + */ public function compile(Compiler $compiler) { foreach ($this->nodes as $node) { @@ -84,28 +87,22 @@ public function compile(Compiler $compiler) } } - public function getTemplateLine() + public function getTemplateLine(): int { return $this->lineno; } - public function getNodeTag() + public function getNodeTag(): ?string { return $this->tag; } - /** - * @return bool - */ - public function hasAttribute($name) + public function hasAttribute(string $name): bool { return \array_key_exists($name, $this->attributes); } - /** - * @return mixed - */ - public function getAttribute($name) + public function getAttribute(string $name) { if (!\array_key_exists($name, $this->attributes)) { throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, static::class)); @@ -114,32 +111,22 @@ public function getAttribute($name) return $this->attributes[$name]; } - /** - * @param string $name - * @param mixed $value - */ - public function setAttribute($name, $value) + public function setAttribute(string $name, $value): void { $this->attributes[$name] = $value; } - public function removeAttribute($name) + public function removeAttribute(string $name): void { unset($this->attributes[$name]); } - /** - * @return bool - */ - public function hasNode($name) + public function hasNode(string $name): bool { return isset($this->nodes[$name]); } - /** - * @return Node - */ - public function getNode($name) + public function getNode(string $name): self { if (!isset($this->nodes[$name])) { throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, static::class)); @@ -148,12 +135,12 @@ public function getNode($name) return $this->nodes[$name]; } - public function setNode($name, self $node) + public function setNode(string $name, self $node): void { $this->nodes[$name] = $node; } - public function removeNode($name) + public function removeNode(string $name): void { unset($this->nodes[$name]); } @@ -167,53 +154,26 @@ public function count() return \count($this->nodes); } - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): \Traversable { return new \ArrayIterator($this->nodes); } - /** - * @deprecated since 2.8 (to be removed in 3.0) - */ - public function setTemplateName($name/*, $triggerDeprecation = true */) - { - $triggerDeprecation = 2 > \func_num_args() || \func_get_arg(1); - if ($triggerDeprecation) { - @trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use setSourceContext() instead.', \E_USER_DEPRECATED); - } - - $this->name = $name; - foreach ($this->nodes as $node) { - $node->setTemplateName($name, $triggerDeprecation); - } - } - - public function getTemplateName() + public function getTemplateName(): ?string { return $this->sourceContext ? $this->sourceContext->getName() : null; } - public function setSourceContext(Source $source) + public function setSourceContext(Source $source): void { $this->sourceContext = $source; foreach ($this->nodes as $node) { $node->setSourceContext($source); } - - $this->setTemplateName($source->getName(), false); } - public function getSourceContext() + public function getSourceContext(): ?Source { return $this->sourceContext; } } - -class_alias('Twig\Node\Node', 'Twig_Node'); - -// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. -class_exists('Twig\Compiler'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/NodeCaptureInterface.php b/upload/system/storage/vendor/twig/twig/src/Node/NodeCaptureInterface.php index 474003f34bd..9fb6a0ca14d 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/NodeCaptureInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/NodeCaptureInterface.php @@ -19,5 +19,3 @@ interface NodeCaptureInterface { } - -class_alias('Twig\Node\NodeCaptureInterface', 'Twig_NodeCaptureInterface'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/NodeOutputInterface.php b/upload/system/storage/vendor/twig/twig/src/Node/NodeOutputInterface.php index 8b046ee7661..5e35b406be1 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/NodeOutputInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/NodeOutputInterface.php @@ -19,5 +19,3 @@ interface NodeOutputInterface { } - -class_alias('Twig\Node\NodeOutputInterface', 'Twig_NodeOutputInterface'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/PrintNode.php b/upload/system/storage/vendor/twig/twig/src/Node/PrintNode.php index fcc086acd9e..60386d29969 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/PrintNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/PrintNode.php @@ -27,7 +27,7 @@ public function __construct(AbstractExpression $expr, int $lineno, string $tag = parent::__construct(['expr' => $expr], [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -37,5 +37,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\PrintNode', 'Twig_Node_Print'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php b/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php index 9f8ba46cd43..4d5666bff13 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/SandboxNode.php @@ -25,7 +25,7 @@ public function __construct(Node $body, int $lineno, string $tag = null) parent::__construct(['body' => $body], [], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -50,5 +50,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\SandboxNode', 'Twig_Node_Sandbox'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/SandboxedPrintNode.php b/upload/system/storage/vendor/twig/twig/src/Node/SandboxedPrintNode.php deleted file mode 100644 index 54e92e66f5f..00000000000 --- a/upload/system/storage/vendor/twig/twig/src/Node/SandboxedPrintNode.php +++ /dev/null @@ -1,54 +0,0 @@ - - */ -class SandboxedPrintNode extends PrintNode -{ - public function compile(Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('echo ') - ; - $expr = $this->getNode('expr'); - if ($expr instanceof ConstantExpression) { - $compiler - ->subcompile($expr) - ->raw(";\n") - ; - } else { - $compiler - ->write('$this->extensions[SandboxExtension::class]->ensureToStringAllowed(') - ->subcompile($expr) - ->raw(', ') - ->repr($expr->getTemplateLine()) - ->raw(", \$this->source);\n") - ; - } - } -} - -class_alias('Twig\Node\SandboxedPrintNode', 'Twig_Node_SandboxedPrint'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/SetNode.php b/upload/system/storage/vendor/twig/twig/src/Node/SetNode.php index 3cf4615f2b4..96b6bd8bf58 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/SetNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/SetNode.php @@ -41,7 +41,7 @@ public function __construct(bool $capture, Node $names, Node $values, int $linen } } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->addDebugInfo($this); @@ -103,5 +103,3 @@ public function compile(Compiler $compiler) $compiler->raw(";\n"); } } - -class_alias('Twig\Node\SetNode', 'Twig_Node_Set'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/SpacelessNode.php b/upload/system/storage/vendor/twig/twig/src/Node/SpacelessNode.php deleted file mode 100644 index 8fc4a2df3cf..00000000000 --- a/upload/system/storage/vendor/twig/twig/src/Node/SpacelessNode.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class SpacelessNode extends Node implements NodeOutputInterface -{ - public function __construct(Node $body, int $lineno, string $tag = 'spaceless') - { - parent::__construct(['body' => $body], [], $lineno, $tag); - } - - public function compile(Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ; - if ($compiler->getEnvironment()->isDebug()) { - $compiler->write("ob_start();\n"); - } else { - $compiler->write("ob_start(function () { return ''; });\n"); - } - $compiler - ->subcompile($this->getNode('body')) - ->write("echo trim(preg_replace('/>\s+<', ob_get_clean()));\n") - ; - } -} - -class_alias('Twig\Node\SpacelessNode', 'Twig_Node_Spaceless'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/TextNode.php b/upload/system/storage/vendor/twig/twig/src/Node/TextNode.php index 85640a56edb..d74ebe630cc 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/TextNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/TextNode.php @@ -26,7 +26,7 @@ public function __construct(string $data, int $lineno) parent::__construct([], ['data' => $data], $lineno); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) @@ -36,5 +36,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Node\TextNode', 'Twig_Node_Text'); diff --git a/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php b/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php index 07a1c4e30d3..56a334496e9 100644 --- a/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Node/WithNode.php @@ -30,10 +30,14 @@ public function __construct(Node $body, ?Node $variables, bool $only, int $linen parent::__construct($nodes, ['only' => $only], $lineno, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler->addDebugInfo($this); + $parentContextName = $compiler->getVarName(); + + $compiler->write(sprintf("\$%s = \$context;\n", $parentContextName)); + if ($this->hasNode('variables')) { $node = $this->getNode('variables'); $varsName = $compiler->getVarName(); @@ -52,21 +56,15 @@ public function compile(Compiler $compiler) ; if ($this->getAttribute('only')) { - $compiler->write("\$context = ['_parent' => \$context];\n"); - } else { - $compiler->write("\$context['_parent'] = \$context;\n"); + $compiler->write("\$context = [];\n"); } $compiler->write(sprintf("\$context = \$this->env->mergeGlobals(array_merge(\$context, \$%s));\n", $varsName)); - } else { - $compiler->write("\$context['_parent'] = \$context;\n"); } $compiler ->subcompile($this->getNode('body')) - ->write("\$context = \$context['_parent'];\n") + ->write(sprintf("\$context = \$%s;\n", $parentContextName)) ; } } - -class_alias('Twig\Node\WithNode', 'Twig_Node_With'); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php b/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php index 12c5a16d602..47a2d5ca3ed 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeTraverser.php @@ -37,7 +37,7 @@ public function __construct(Environment $env, array $visitors = []) } } - public function addVisitor(NodeVisitorInterface $visitor) + public function addVisitor(NodeVisitorInterface $visitor): void { $this->visitors[$visitor->getPriority()][] = $visitor; } @@ -57,23 +57,16 @@ public function traverse(Node $node): Node return $node; } - /** - * @return Node|null - */ - private function traverseForVisitor(NodeVisitorInterface $visitor, Node $node) + private function traverseForVisitor(NodeVisitorInterface $visitor, Node $node): ?Node { $node = $visitor->enterNode($node, $this->env); foreach ($node as $k => $n) { - if (false !== ($m = $this->traverseForVisitor($visitor, $n)) && null !== $m) { + if (null !== $m = $this->traverseForVisitor($visitor, $n)) { if ($m !== $n) { $node->setNode($k, $m); } } else { - if (false === $m) { - @trigger_error('Returning "false" to remove a Node from NodeVisitorInterface::leaveNode() is deprecated since Twig version 2.9; return "null" instead.', \E_USER_DEPRECATED); - } - $node->removeNode($k); } } @@ -81,5 +74,3 @@ private function traverseForVisitor(NodeVisitorInterface $visitor, Node $node) return $visitor->leaveNode($node, $this->env); } } - -class_alias('Twig\NodeTraverser', 'Twig_NodeTraverser'); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php index 9c6cb124dbb..d7036ae5511 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php @@ -23,12 +23,12 @@ */ abstract class AbstractNodeVisitor implements NodeVisitorInterface { - final public function enterNode(Node $node, Environment $env) + final public function enterNode(Node $node, Environment $env): Node { return $this->doEnterNode($node, $env); } - final public function leaveNode(Node $node, Environment $env) + final public function leaveNode(Node $node, Environment $env): ?Node { return $this->doLeaveNode($node, $env); } @@ -47,5 +47,3 @@ abstract protected function doEnterNode(Node $node, Environment $env); */ abstract protected function doLeaveNode(Node $node, Environment $env); } - -class_alias('Twig\NodeVisitor\AbstractNodeVisitor', 'Twig_BaseNodeVisitor'); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php index bfbfdc9e17e..fe56ea30741 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php @@ -29,8 +29,10 @@ /** * @author Fabien Potencier + * + * @internal */ -final class EscaperNodeVisitor extends AbstractNodeVisitor +final class EscaperNodeVisitor implements NodeVisitorInterface { private $statusStack = []; private $blocks = []; @@ -44,7 +46,7 @@ public function __construct() $this->safeAnalysis = new SafeAnalysisNodeVisitor(); } - protected function doEnterNode(Node $node, Environment $env) + public function enterNode(Node $node, Environment $env): Node { if ($node instanceof ModuleNode) { if ($env->hasExtension(EscaperExtension::class) && $defaultStrategy = $env->getExtension(EscaperExtension::class)->getDefaultStrategy($node->getTemplateName())) { @@ -63,7 +65,7 @@ protected function doEnterNode(Node $node, Environment $env) return $node; } - protected function doLeaveNode(Node $node, Environment $env) + public function leaveNode(Node $node, Environment $env): ?Node { if ($node instanceof ModuleNode) { $this->defaultStrategy = false; @@ -89,7 +91,7 @@ protected function doLeaveNode(Node $node, Environment $env) return $node; } - private function shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, $type) + private function shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, string $type): bool { $expr2Safe = $this->isSafeFor($type, $expression->getNode('expr2'), $env); $expr3Safe = $this->isSafeFor($type, $expression->getNode('expr3'), $env); @@ -97,7 +99,7 @@ private function shouldUnwrapConditional(ConditionalExpression $expression, Envi return $expr2Safe !== $expr3Safe; } - private function unwrapConditional(ConditionalExpression $expression, Environment $env, $type) + private function unwrapConditional(ConditionalExpression $expression, Environment $env, string $type): ConditionalExpression { // convert "echo a ? b : c" to "a ? echo b : echo c" recursively $expr2 = $expression->getNode('expr2'); @@ -116,7 +118,7 @@ private function unwrapConditional(ConditionalExpression $expression, Environmen return new ConditionalExpression($expression->getNode('expr1'), $expr2, $expr3, $expression->getTemplateLine()); } - private function escapeInlinePrintNode(InlinePrint $node, Environment $env, $type) + private function escapeInlinePrintNode(InlinePrint $node, Environment $env, string $type): Node { $expression = $node->getNode('node'); @@ -127,7 +129,7 @@ private function escapeInlinePrintNode(InlinePrint $node, Environment $env, $typ return new InlinePrint($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); } - private function escapePrintNode(PrintNode $node, Environment $env, $type) + private function escapePrintNode(PrintNode $node, Environment $env, string $type): Node { if (false === $type) { return $node; @@ -144,7 +146,7 @@ private function escapePrintNode(PrintNode $node, Environment $env, $type) return new $class($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); } - private function preEscapeFilterNode(FilterExpression $filter, Environment $env) + private function preEscapeFilterNode(FilterExpression $filter, Environment $env): FilterExpression { $name = $filter->getNode('filter')->getAttribute('value'); @@ -163,7 +165,7 @@ private function preEscapeFilterNode(FilterExpression $filter, Environment $env) return $filter; } - private function isSafeFor($type, Node $expression, $env) + private function isSafeFor(string $type, Node $expression, Environment $env): bool { $safe = $this->safeAnalysis->getSafe($expression); @@ -194,15 +196,13 @@ private function getEscaperFilter(string $type, Node $node): FilterExpression { $line = $node->getTemplateLine(); $name = new ConstantExpression('escape', $line); - $args = new Node([new ConstantExpression((string) $type, $line), new ConstantExpression(null, $line), new ConstantExpression(true, $line)]); + $args = new Node([new ConstantExpression($type, $line), new ConstantExpression(null, $line), new ConstantExpression(true, $line)]); return new FilterExpression($node, $name, $args, $line); } - public function getPriority() + public function getPriority(): int { return 0; } } - -class_alias('Twig\NodeVisitor\EscaperNodeVisitor', 'Twig_NodeVisitor_Escaper'); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php index f41d4637e14..af477e65356 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/MacroAutoImportNodeVisitor.php @@ -23,13 +23,15 @@ /** * @author Fabien Potencier + * + * @internal */ final class MacroAutoImportNodeVisitor implements NodeVisitorInterface { private $inAModule = false; private $hasMacroCalls = false; - public function enterNode(Node $node, Environment $env) + public function enterNode(Node $node, Environment $env): Node { if ($node instanceof ModuleNode) { $this->inAModule = true; @@ -39,7 +41,7 @@ public function enterNode(Node $node, Environment $env) return $node; } - public function leaveNode(Node $node, Environment $env) + public function leaveNode(Node $node, Environment $env): Node { if ($node instanceof ModuleNode) { $this->inAModule = false; @@ -64,7 +66,7 @@ public function leaveNode(Node $node, Environment $env) return $node; } - public function getPriority() + public function getPriority(): int { // we must be ran before auto-escaping return -10; diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php index e0ffae2c0ef..59e836dbdcc 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php @@ -26,14 +26,14 @@ interface NodeVisitorInterface * * @return Node The modified node */ - public function enterNode(Node $node, Environment $env); + public function enterNode(Node $node, Environment $env): Node; /** * Called after child nodes are visited. * * @return Node|null The modified node or null if the node must be removed */ - public function leaveNode(Node $node, Environment $env); + public function leaveNode(Node $node, Environment $env): ?Node; /** * Returns the priority for this visitor. @@ -44,8 +44,3 @@ public function leaveNode(Node $node, Environment $env); */ public function getPriority(); } - -class_alias('Twig\NodeVisitor\NodeVisitorInterface', 'Twig_NodeVisitorInterface'); - -// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. -class_exists('Twig\Environment'); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php index 62f7aafbaee..7ac75e41ad3 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php @@ -34,15 +34,15 @@ * optimizer mode. * * @author Fabien Potencier + * + * @internal */ -final class OptimizerNodeVisitor extends AbstractNodeVisitor +final class OptimizerNodeVisitor implements NodeVisitorInterface { public const OPTIMIZE_ALL = -1; public const OPTIMIZE_NONE = 0; public const OPTIMIZE_FOR = 2; public const OPTIMIZE_RAW_FILTER = 4; - // obsolete, does not do anything - public const OPTIMIZE_VAR_ACCESS = 8; private $loops = []; private $loopsTargets = []; @@ -53,14 +53,14 @@ final class OptimizerNodeVisitor extends AbstractNodeVisitor */ public function __construct(int $optimizers = -1) { - if (!\is_int($optimizers) || $optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER | self::OPTIMIZE_VAR_ACCESS)) { + if ($optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER)) { throw new \InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers)); } $this->optimizers = $optimizers; } - protected function doEnterNode(Node $node, Environment $env) + public function enterNode(Node $node, Environment $env): Node { if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { $this->enterOptimizeFor($node, $env); @@ -69,7 +69,7 @@ protected function doEnterNode(Node $node, Environment $env) return $node; } - protected function doLeaveNode(Node $node, Environment $env) + public function leaveNode(Node $node, Environment $env): ?Node { if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { $this->leaveOptimizeFor($node, $env); @@ -125,7 +125,7 @@ private function optimizeRawFilter(Node $node, Environment $env): Node /** * Optimizes "for" tag by removing the "loop" variable creation whenever possible. */ - private function enterOptimizeFor(Node $node, Environment $env) + private function enterOptimizeFor(Node $node, Environment $env): void { if ($node instanceof ForNode) { // disable the loop variable by default @@ -189,7 +189,7 @@ private function enterOptimizeFor(Node $node, Environment $env) /** * Optimizes "for" tag by removing the "loop" variable creation whenever possible. */ - private function leaveOptimizeFor(Node $node, Environment $env) + private function leaveOptimizeFor(Node $node, Environment $env): void { if ($node instanceof ForNode) { array_shift($this->loops); @@ -198,22 +198,20 @@ private function leaveOptimizeFor(Node $node, Environment $env) } } - private function addLoopToCurrent() + private function addLoopToCurrent(): void { $this->loops[0]->setAttribute('with_loop', true); } - private function addLoopToAll() + private function addLoopToAll(): void { foreach ($this->loops as $loop) { $loop->setAttribute('with_loop', true); } } - public function getPriority() + public function getPriority(): int { return 255; } } - -class_alias('Twig\NodeVisitor\OptimizerNodeVisitor', 'Twig_NodeVisitor_Optimizer'); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php index 02a2af436b1..90d6f2e0fd0 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php @@ -23,12 +23,15 @@ use Twig\Node\Expression\ParentExpression; use Twig\Node\Node; -final class SafeAnalysisNodeVisitor extends AbstractNodeVisitor +/** + * @internal + */ +final class SafeAnalysisNodeVisitor implements NodeVisitorInterface { private $data = []; private $safeVars = []; - public function setSafeVars($safeVars) + public function setSafeVars(array $safeVars): void { $this->safeVars = $safeVars; } @@ -53,7 +56,7 @@ public function getSafe(Node $node) } } - private function setSafe(Node $node, array $safe) + private function setSafe(Node $node, array $safe): void { $hash = spl_object_hash($node); if (isset($this->data[$hash])) { @@ -71,12 +74,12 @@ private function setSafe(Node $node, array $safe) ]; } - protected function doEnterNode(Node $node, Environment $env) + public function enterNode(Node $node, Environment $env): Node { return $node; } - protected function doLeaveNode(Node $node, Environment $env) + public function leaveNode(Node $node, Environment $env): ?Node { if ($node instanceof ConstantExpression) { // constants are marked safe for all @@ -95,7 +98,7 @@ protected function doLeaveNode(Node $node, Environment $env) // filter expression is safe when the filter is safe $name = $node->getNode('filter')->getAttribute('value'); $args = $node->getNode('arguments'); - if (false !== $filter = $env->getFilter($name)) { + if ($filter = $env->getFilter($name)) { $safe = $filter->getSafe($args); if (null === $safe) { $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety()); @@ -108,8 +111,7 @@ protected function doLeaveNode(Node $node, Environment $env) // function expression is safe when the function is safe $name = $node->getAttribute('name'); $args = $node->getNode('arguments'); - $function = $env->getFunction($name); - if (false !== $function) { + if ($function = $env->getFunction($name)) { $this->setSafe($node, $function->getSafe($args)); } else { $this->setSafe($node, []); @@ -151,10 +153,8 @@ private function intersectSafe(array $a = null, array $b = null): array return array_intersect($a, $b); } - public function getPriority() + public function getPriority(): int { return 0; } } - -class_alias('Twig\NodeVisitor\SafeAnalysisNodeVisitor', 'Twig_NodeVisitor_SafeAnalysis'); diff --git a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php index a51fa10d69e..1446cee6b98 100644 --- a/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php @@ -28,17 +28,18 @@ /** * @author Fabien Potencier + * + * @internal */ -final class SandboxNodeVisitor extends AbstractNodeVisitor +final class SandboxNodeVisitor implements NodeVisitorInterface { private $inAModule = false; private $tags; private $filters; private $functions; - private $needsToStringWrap = false; - protected function doEnterNode(Node $node, Environment $env) + public function enterNode(Node $node, Environment $env): Node { if ($node instanceof ModuleNode) { $this->inAModule = true; @@ -96,7 +97,7 @@ protected function doEnterNode(Node $node, Environment $env) return $node; } - protected function doLeaveNode(Node $node, Environment $env) + public function leaveNode(Node $node, Environment $env): ?Node { if ($node instanceof ModuleNode) { $this->inAModule = false; @@ -112,7 +113,7 @@ protected function doLeaveNode(Node $node, Environment $env) return $node; } - private function wrapNode(Node $node, string $name) + private function wrapNode(Node $node, string $name): void { $expr = $node->getNode($name); if ($expr instanceof NameExpression || $expr instanceof GetAttrExpression) { @@ -120,7 +121,7 @@ private function wrapNode(Node $node, string $name) } } - private function wrapArrayNode(Node $node, string $name) + private function wrapArrayNode(Node $node, string $name): void { $args = $node->getNode($name); foreach ($args as $name => $_) { @@ -128,10 +129,8 @@ private function wrapArrayNode(Node $node, string $name) } } - public function getPriority() + public function getPriority(): int { return 0; } } - -class_alias('Twig\NodeVisitor\SandboxNodeVisitor', 'Twig_NodeVisitor_Sandbox'); diff --git a/upload/system/storage/vendor/twig/twig/src/Parser.php b/upload/system/storage/vendor/twig/twig/src/Parser.php index eb2ee15c4c8..d0e77b35796 100644 --- a/upload/system/storage/vendor/twig/twig/src/Parser.php +++ b/upload/system/storage/vendor/twig/twig/src/Parser.php @@ -23,13 +23,10 @@ use Twig\Node\NodeCaptureInterface; use Twig\Node\NodeOutputInterface; use Twig\Node\PrintNode; -use Twig\Node\SpacelessNode; use Twig\Node\TextNode; use Twig\TokenParser\TokenParserInterface; /** - * Default parser implementation. - * * @author Fabien Potencier */ class Parser @@ -37,7 +34,6 @@ class Parser private $stack = []; private $stream; private $parent; - private $handlers; private $visitors; private $expressionParser; private $blocks; @@ -54,27 +50,17 @@ public function __construct(Environment $env) $this->env = $env; } - public function getVarName() + public function getVarName(): string { return sprintf('__internal_parse_%d', $this->varNameSalt++); } - public function parse(TokenStream $stream, $test = null, $dropNeedle = false) + public function parse(TokenStream $stream, $test = null, bool $dropNeedle = false): ModuleNode { $vars = get_object_vars($this); unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames']); $this->stack[] = $vars; - // tag handlers - if (null === $this->handlers) { - $this->handlers = []; - foreach ($this->env->getTokenParsers() as $handler) { - $handler->setParser($this); - - $this->handlers[$handler->getTag()] = $handler; - } - } - // node visitors if (null === $this->visitors) { $this->visitors = $this->env->getNodeVisitors(); @@ -126,7 +112,7 @@ public function parse(TokenStream $stream, $test = null, $dropNeedle = false) return $node; } - public function subparse($test, $dropNeedle = false) + public function subparse($test, bool $dropNeedle = false): Node { $lineno = $this->getCurrentToken()->getLine(); $rv = []; @@ -164,7 +150,7 @@ public function subparse($test, $dropNeedle = false) return new Node($rv, [], $lineno); } - if (!isset($this->handlers[$token->getValue()])) { + if (!$subparser = $this->env->getTokenParser($token->getValue())) { if (null !== $test) { $e = new SyntaxError(sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); @@ -173,7 +159,7 @@ public function subparse($test, $dropNeedle = false) } } else { $e = new SyntaxError(sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); - $e->addSuggestions($token->getValue(), array_keys($this->env->getTags())); + $e->addSuggestions($token->getValue(), array_keys($this->env->getTokenParsers())); } throw $e; @@ -181,7 +167,7 @@ public function subparse($test, $dropNeedle = false) $this->stream->next(); - $subparser = $this->handlers[$token->getValue()]; + $subparser->setParser($this); $node = $subparser->parse($token); if (null !== $node) { $rv[] = $node; @@ -200,67 +186,57 @@ public function subparse($test, $dropNeedle = false) return new Node($rv, [], $lineno); } - public function getBlockStack() + public function getBlockStack(): array { return $this->blockStack; } public function peekBlockStack() { - return isset($this->blockStack[\count($this->blockStack) - 1]) ? $this->blockStack[\count($this->blockStack) - 1] : null; + return $this->blockStack[\count($this->blockStack) - 1] ?? null; } - public function popBlockStack() + public function popBlockStack(): void { array_pop($this->blockStack); } - public function pushBlockStack($name) + public function pushBlockStack($name): void { $this->blockStack[] = $name; } - public function hasBlock($name) + public function hasBlock(string $name): bool { return isset($this->blocks[$name]); } - public function getBlock($name) + public function getBlock(string $name): Node { return $this->blocks[$name]; } - public function setBlock($name, BlockNode $value) + public function setBlock(string $name, BlockNode $value): void { $this->blocks[$name] = new BodyNode([$value], [], $value->getTemplateLine()); } - public function hasMacro($name) + public function hasMacro(string $name): bool { return isset($this->macros[$name]); } - public function setMacro($name, MacroNode $node) + public function setMacro(string $name, MacroNode $node): void { $this->macros[$name] = $node; } - /** - * @deprecated since Twig 2.7 as there are no reserved macro names anymore, will be removed in 3.0. - */ - public function isReservedMacroName($name) - { - @trigger_error(sprintf('The "%s" method is deprecated since Twig 2.7 and will be removed in 3.0.', __METHOD__), \E_USER_DEPRECATED); - - return false; - } - - public function addTrait($trait) + public function addTrait($trait): void { $this->traits[] = $trait; } - public function hasTraits() + public function hasTraits(): bool { return \count($this->traits) > 0; } @@ -272,80 +248,70 @@ public function embedTemplate(ModuleNode $template) $this->embeddedTemplates[] = $template; } - public function addImportedSymbol($type, $alias, $name = null, AbstractExpression $node = null) + public function addImportedSymbol(string $type, string $alias, string $name = null, AbstractExpression $node = null): void { $this->importedSymbols[0][$type][$alias] = ['name' => $name, 'node' => $node]; } - public function getImportedSymbol($type, $alias) + public function getImportedSymbol(string $type, string $alias) { // if the symbol does not exist in the current scope (0), try in the main/global scope (last index) return $this->importedSymbols[0][$type][$alias] ?? ($this->importedSymbols[\count($this->importedSymbols) - 1][$type][$alias] ?? null); } - public function isMainScope() + public function isMainScope(): bool { return 1 === \count($this->importedSymbols); } - public function pushLocalScope() + public function pushLocalScope(): void { array_unshift($this->importedSymbols, []); } - public function popLocalScope() + public function popLocalScope(): void { array_shift($this->importedSymbols); } - /** - * @return ExpressionParser - */ - public function getExpressionParser() + public function getExpressionParser(): ExpressionParser { return $this->expressionParser; } - public function getParent() + public function getParent(): ?Node { return $this->parent; } - public function setParent($parent) + public function setParent(?Node $parent): void { $this->parent = $parent; } - /** - * @return TokenStream - */ - public function getStream() + public function getStream(): TokenStream { return $this->stream; } - /** - * @return Token - */ - public function getCurrentToken() + public function getCurrentToken(): Token { return $this->stream->getCurrent(); } - private function filterBodyNodes(Node $node, bool $nested = false) + private function filterBodyNodes(Node $node, bool $nested = false): ?Node { // check that the body does not contain non-empty output nodes if ( ($node instanceof TextNode && !ctype_space($node->getAttribute('data'))) || - // the "&& !$node instanceof SpacelessNode" part of the condition must be removed in 3.0 - (!$node instanceof TextNode && !$node instanceof BlockReferenceNode && ($node instanceof NodeOutputInterface && !$node instanceof SpacelessNode)) + (!$node instanceof TextNode && !$node instanceof BlockReferenceNode && $node instanceof NodeOutputInterface) ) { if (false !== strpos((string) $node, \chr(0xEF).\chr(0xBB).\chr(0xBF))) { $t = substr($node->getAttribute('data'), 3); if ('' === $t || ctype_space($t)) { // bypass empty nodes starting with a BOM - return; + return null; } } @@ -358,29 +324,20 @@ private function filterBodyNodes(Node $node, bool $nested = false) return $node; } - // to be removed completely in Twig 3.0 - if (!$nested && $node instanceof SpacelessNode) { - @trigger_error(sprintf('Using the spaceless tag at the root level of a child template in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), \E_USER_DEPRECATED); - } - // "block" tags that are not captured (see above) are only used for defining // the content of the block. In such a case, nesting it does not work as // expected as the definition is not part of the default template code flow. - if ($nested && ($node instanceof BlockReferenceNode || $node instanceof \Twig_Node_BlockReference)) { - //throw new SyntaxError('A block definition cannot be nested under non-capturing nodes.', $node->getTemplateLine(), $this->stream->getSourceContext()); - @trigger_error(sprintf('Nesting a block definition under a non-capturing node in "%s" at line %d is deprecated since Twig 2.5.0 and will become a syntax error in 3.0.', $this->stream->getSourceContext()->getName(), $node->getTemplateLine()), \E_USER_DEPRECATED); - - return; + if ($nested && $node instanceof BlockReferenceNode) { + throw new SyntaxError('A block definition cannot be nested under non-capturing nodes.', $node->getTemplateLine(), $this->stream->getSourceContext()); } - // the "&& !$node instanceof SpacelessNode" part of the condition must be removed in 3.0 - if ($node instanceof NodeOutputInterface && !$node instanceof SpacelessNode) { - return; + if ($node instanceof NodeOutputInterface) { + return null; } // here, $nested means "being at the root level of a child template" - // we need to discard the wrapping "Twig_Node" for the "body" node - $nested = $nested || ('Twig_Node' !== \get_class($node) && Node::class !== \get_class($node)); + // we need to discard the wrapping "Node" for the "body" node + $nested = $nested || Node::class !== \get_class($node); foreach ($node as $k => $n) { if (null !== $n && null === $this->filterBodyNodes($n, $nested)) { $node->removeNode($k); @@ -390,5 +347,3 @@ private function filterBodyNodes(Node $node, bool $nested = false) return $node; } } - -class_alias('Twig\Parser', 'Twig_Parser'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php index 1631987bba0..4da43e475fb 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php @@ -20,16 +20,16 @@ abstract class BaseDumper { private $root; - public function dump(Profile $profile) + public function dump(Profile $profile): string { return $this->dumpProfile($profile); } - abstract protected function formatTemplate(Profile $profile, $prefix); + abstract protected function formatTemplate(Profile $profile, $prefix): string; - abstract protected function formatNonTemplate(Profile $profile, $prefix); + abstract protected function formatNonTemplate(Profile $profile, $prefix): string; - abstract protected function formatTime(Profile $profile, $percent); + abstract protected function formatTime(Profile $profile, $percent): string; private function dumpProfile(Profile $profile, $prefix = '', $sibling = false): string { @@ -61,5 +61,3 @@ private function dumpProfile(Profile $profile, $prefix = '', $sibling = false): return $str; } } - -class_alias('Twig\Profiler\Dumper\BaseDumper', 'Twig_Profiler_Dumper_Base'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php index f33342905be..03abe0fa071 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php @@ -18,7 +18,7 @@ */ final class BlackfireDumper { - public function dump(Profile $profile) + public function dump(Profile $profile): string { $data = []; $this->dumpProfile('main()', $profile, $data); @@ -28,13 +28,13 @@ public function dump(Profile $profile) $str = << $values) { - $str .= "{$name}//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n"; + $str .= "$name//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n"; } return $str; @@ -70,5 +70,3 @@ private function dumpProfile(string $edge, Profile $profile, &$data) } } } - -class_alias('Twig\Profiler\Dumper\BlackfireDumper', 'Twig_Profiler_Dumper_Blackfire'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php index 5be5abeb63f..1f2433b4d36 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php @@ -25,25 +25,23 @@ final class HtmlDumper extends BaseDumper 'big' => '#d44', ]; - public function dump(Profile $profile) + public function dump(Profile $profile): string { return '
    '.parent::dump($profile).'
    '; } - protected function formatTemplate(Profile $profile, $prefix) + protected function formatTemplate(Profile $profile, $prefix): string { return sprintf('%s└ %s', $prefix, self::$colors['template'], $profile->getTemplate()); } - protected function formatNonTemplate(Profile $profile, $prefix) + protected function formatNonTemplate(Profile $profile, $prefix): string { return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), isset(self::$colors[$profile->getType()]) ? self::$colors[$profile->getType()] : 'auto', $profile->getName()); } - protected function formatTime(Profile $profile, $percent) + protected function formatTime(Profile $profile, $percent): string { return sprintf('%.2fms/%.0f%%', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent); } } - -class_alias('Twig\Profiler\Dumper\HtmlDumper', 'Twig_Profiler_Dumper_Html'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php index 395ef9d3836..31561c466bb 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php @@ -18,20 +18,18 @@ */ final class TextDumper extends BaseDumper { - protected function formatTemplate(Profile $profile, $prefix) + protected function formatTemplate(Profile $profile, $prefix): string { return sprintf('%s└ %s', $prefix, $profile->getTemplate()); } - protected function formatNonTemplate(Profile $profile, $prefix) + protected function formatNonTemplate(Profile $profile, $prefix): string { return sprintf('%s└ %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName()); } - protected function formatTime(Profile $profile, $percent) + protected function formatTime(Profile $profile, $percent): string { return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent); } } - -class_alias('Twig\Profiler\Dumper\TextDumper', 'Twig_Profiler_Dumper_Text'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php index 91de5ffc811..1494baf44a3 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php @@ -26,7 +26,7 @@ public function __construct(string $extensionName, string $type, string $name, s parent::__construct([], ['extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName]); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->write(sprintf('$%s = $this->extensions[', $this->getAttribute('var_name'))) @@ -40,5 +40,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Profiler\Node\EnterProfileNode', 'Twig_Profiler_Node_EnterProfile'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php index 7fbf4354b0d..94cebbaa832 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php @@ -26,7 +26,7 @@ public function __construct(string $varName) parent::__construct([], ['var_name' => $varName]); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->write("\n") @@ -34,5 +34,3 @@ public function compile(Compiler $compiler) ; } } - -class_alias('Twig\Profiler\Node\LeaveProfileNode', 'Twig_Profiler_Node_LeaveProfile'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php b/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php index 8b7c18adb67..91abee807df 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php @@ -17,7 +17,7 @@ use Twig\Node\MacroNode; use Twig\Node\ModuleNode; use Twig\Node\Node; -use Twig\NodeVisitor\AbstractNodeVisitor; +use Twig\NodeVisitor\NodeVisitorInterface; use Twig\Profiler\Node\EnterProfileNode; use Twig\Profiler\Node\LeaveProfileNode; use Twig\Profiler\Profile; @@ -25,7 +25,7 @@ /** * @author Fabien Potencier */ -final class ProfilerNodeVisitor extends AbstractNodeVisitor +final class ProfilerNodeVisitor implements NodeVisitorInterface { private $extensionName; private $varName; @@ -36,12 +36,12 @@ public function __construct(string $extensionName) $this->varName = sprintf('__internal_%s', hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $extensionName)); } - protected function doEnterNode(Node $node, Environment $env) + public function enterNode(Node $node, Environment $env): Node { return $node; } - protected function doLeaveNode(Node $node, Environment $env) + public function leaveNode(Node $node, Environment $env): ?Node { if ($node instanceof ModuleNode) { $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $this->varName), $node->getNode('display_start')])); @@ -63,10 +63,8 @@ protected function doLeaveNode(Node $node, Environment $env) return $node; } - public function getPriority() + public function getPriority(): int { return 0; } } - -class_alias('Twig\Profiler\NodeVisitor\ProfilerNodeVisitor', 'Twig_Profiler_NodeVisitor_Profiler'); diff --git a/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php b/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php index 3a5ff8b50fb..252ca9b0cf4 100644 --- a/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php +++ b/upload/system/storage/vendor/twig/twig/src/Profiler/Profile.php @@ -13,10 +13,8 @@ /** * @author Fabien Potencier - * - * @final since Twig 2.4.0 */ -class Profile implements \IteratorAggregate, \Serializable +final class Profile implements \IteratorAggregate, \Serializable { public const ROOT = 'ROOT'; public const BLOCK = 'block'; @@ -32,67 +30,64 @@ class Profile implements \IteratorAggregate, \Serializable public function __construct(string $template = 'main', string $type = self::ROOT, string $name = 'main') { - if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); - } - $this->template = $template; $this->type = $type; $this->name = 0 === strpos($name, '__internal_') ? 'INTERNAL' : $name; $this->enter(); } - public function getTemplate() + public function getTemplate(): string { return $this->template; } - public function getType() + public function getType(): string { return $this->type; } - public function getName() + public function getName(): string { return $this->name; } - public function isRoot() + public function isRoot(): bool { return self::ROOT === $this->type; } - public function isTemplate() + public function isTemplate(): bool { return self::TEMPLATE === $this->type; } - public function isBlock() + public function isBlock(): bool { return self::BLOCK === $this->type; } - public function isMacro() + public function isMacro(): bool { return self::MACRO === $this->type; } - public function getProfiles() + /** + * @return Profile[] + */ + public function getProfiles(): array { return $this->profiles; } - public function addProfile(self $profile) + public function addProfile(self $profile): void { $this->profiles[] = $profile; } /** * Returns the duration in microseconds. - * - * @return float */ - public function getDuration() + public function getDuration(): float { if ($this->isRoot() && $this->profiles) { // for the root node with children, duration is the sum of all child durations @@ -109,20 +104,16 @@ public function getDuration() /** * Returns the memory usage in bytes. - * - * @return int */ - public function getMemoryUsage() + public function getMemoryUsage(): int { return isset($this->ends['mu']) && isset($this->starts['mu']) ? $this->ends['mu'] - $this->starts['mu'] : 0; } /** * Returns the peak memory usage in bytes. - * - * @return int */ - public function getPeakMemoryUsage() + public function getPeakMemoryUsage(): int { return isset($this->ends['pmu']) && isset($this->starts['pmu']) ? $this->ends['pmu'] - $this->starts['pmu'] : 0; } @@ -130,7 +121,7 @@ public function getPeakMemoryUsage() /** * Starts the profiling. */ - public function enter() + public function enter(): void { $this->starts = [ 'wt' => microtime(true), @@ -142,7 +133,7 @@ public function enter() /** * Stops the profiling. */ - public function leave() + public function leave(): void { $this->ends = [ 'wt' => microtime(true), @@ -151,13 +142,12 @@ public function leave() ]; } - public function reset() + public function reset(): void { $this->starts = $this->ends = $this->profiles = []; $this->enter(); } - #[\ReturnTypeWillChange] public function getIterator(): \Traversable { return new \ArrayIterator($this->profiles); @@ -189,5 +179,3 @@ public function __unserialize(array $data): void list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; } } - -class_alias('Twig\Profiler\Profile', 'Twig_Profiler_Profile'); diff --git a/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php b/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php index 04a6602f229..b360d7beaf1 100644 --- a/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php +++ b/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php @@ -30,12 +30,8 @@ public function __construct(ContainerInterface $container) $this->container = $container; } - public function load($class) + public function load(string $class) { - if ($this->container->has($class)) { - return $this->container->get($class); - } + return $this->container->has($class) ? $this->container->get($class) : null; } } - -class_alias('Twig\RuntimeLoader\ContainerRuntimeLoader', 'Twig_ContainerRuntimeLoader'); diff --git a/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php b/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php index e4676f7cfb5..13064839267 100644 --- a/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php +++ b/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php @@ -28,14 +28,14 @@ public function __construct(array $map = []) $this->map = $map; } - public function load($class) + public function load(string $class) { - if (isset($this->map[$class])) { - $runtimeFactory = $this->map[$class]; - - return $runtimeFactory(); + if (!isset($this->map[$class])) { + return null; } + + $runtimeFactory = $this->map[$class]; + + return $runtimeFactory(); } } - -class_alias('Twig\RuntimeLoader\FactoryRuntimeLoader', 'Twig_FactoryRuntimeLoader'); diff --git a/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php b/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php index 4eb5ad85999..9e5b2048e72 100644 --- a/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php @@ -21,11 +21,7 @@ interface RuntimeLoaderInterface /** * Creates the runtime implementation of a Twig element (filter/function/test). * - * @param string $class A runtime class - * * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class */ - public function load($class); + public function load(string $class); } - -class_alias('Twig\RuntimeLoader\RuntimeLoaderInterface', 'Twig_RuntimeLoaderInterface'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityError.php index 5f96d46bd84..30a404f2823 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityError.php @@ -21,5 +21,3 @@ class SecurityError extends Error { } - -class_alias('Twig\Sandbox\SecurityError', 'Twig_Sandbox_SecurityError'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php index 33c84f2231f..02d306360ba 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php @@ -15,32 +15,19 @@ * Exception thrown when a not allowed filter is used in a template. * * @author Martin Hasoň - * - * @final */ -class SecurityNotAllowedFilterError extends SecurityError +final class SecurityNotAllowedFilterError extends SecurityError { private $filterName; - public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null) + public function __construct(string $message, string $functionName) { - if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - parent::__construct($message, $lineno, $filename, $previous); + parent::__construct($message); $this->filterName = $functionName; } - public function getFilterName() + public function getFilterName(): string { return $this->filterName; } } - -class_alias('Twig\Sandbox\SecurityNotAllowedFilterError', 'Twig_Sandbox_SecurityNotAllowedFilterError'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php index 5151762b567..4f76dc6ece4 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php @@ -15,32 +15,19 @@ * Exception thrown when a not allowed function is used in a template. * * @author Martin Hasoň - * - * @final */ -class SecurityNotAllowedFunctionError extends SecurityError +final class SecurityNotAllowedFunctionError extends SecurityError { private $functionName; - public function __construct(string $message, string $functionName, int $lineno = -1, string $filename = null, \Exception $previous = null) + public function __construct(string $message, string $functionName) { - if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - parent::__construct($message, $lineno, $filename, $previous); + parent::__construct($message); $this->functionName = $functionName; } - public function getFunctionName() + public function getFunctionName(): string { return $this->functionName; } } - -class_alias('Twig\Sandbox\SecurityNotAllowedFunctionError', 'Twig_Sandbox_SecurityNotAllowedFunctionError'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php index 62c3fddd5f1..8df9d0baa96 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php @@ -15,31 +15,20 @@ * Exception thrown when a not allowed class method is used in a template. * * @author Kit Burton-Senior - * - * @final */ -class SecurityNotAllowedMethodError extends SecurityError +final class SecurityNotAllowedMethodError extends SecurityError { private $className; private $methodName; - public function __construct(string $message, string $className, string $methodName, int $lineno = -1, string $filename = null, \Exception $previous = null) + public function __construct(string $message, string $className, string $methodName) { - if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - parent::__construct($message, $lineno, $filename, $previous); + parent::__construct($message); $this->className = $className; $this->methodName = $methodName; } - public function getClassName() + public function getClassName(): string { return $this->className; } @@ -49,5 +38,3 @@ public function getMethodName() return $this->methodName; } } - -class_alias('Twig\Sandbox\SecurityNotAllowedMethodError', 'Twig_Sandbox_SecurityNotAllowedMethodError'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php index a9e4aff2725..42ec4f38694 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php @@ -15,31 +15,20 @@ * Exception thrown when a not allowed class property is used in a template. * * @author Kit Burton-Senior - * - * @final */ -class SecurityNotAllowedPropertyError extends SecurityError +final class SecurityNotAllowedPropertyError extends SecurityError { private $className; private $propertyName; - public function __construct(string $message, string $className, string $propertyName, int $lineno = -1, string $filename = null, \Exception $previous = null) + public function __construct(string $message, string $className, string $propertyName) { - if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - parent::__construct($message, $lineno, $filename, $previous); + parent::__construct($message); $this->className = $className; $this->propertyName = $propertyName; } - public function getClassName() + public function getClassName(): string { return $this->className; } @@ -49,5 +38,3 @@ public function getPropertyName() return $this->propertyName; } } - -class_alias('Twig\Sandbox\SecurityNotAllowedPropertyError', 'Twig_Sandbox_SecurityNotAllowedPropertyError'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php index 0abc49ef312..4522150e1b7 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php @@ -15,32 +15,19 @@ * Exception thrown when a not allowed tag is used in a template. * * @author Martin Hasoň - * - * @final */ -class SecurityNotAllowedTagError extends SecurityError +final class SecurityNotAllowedTagError extends SecurityError { private $tagName; - public function __construct(string $message, string $tagName, int $lineno = -1, string $filename = null, \Exception $previous = null) + public function __construct(string $message, string $tagName) { - if (-1 !== $lineno) { - @trigger_error(sprintf('Passing $lineno as a 3th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $filename) { - @trigger_error(sprintf('Passing $filename as a 4th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - if (null !== $previous) { - @trigger_error(sprintf('Passing $previous as a 5th argument of the %s constructor is deprecated since Twig 2.8.1.', __CLASS__), \E_USER_DEPRECATED); - } - parent::__construct($message, $lineno, $filename, $previous); + parent::__construct($message); $this->tagName = $tagName; } - public function getTagName() + public function getTagName(): string { return $this->tagName; } } - -class_alias('Twig\Sandbox\SecurityNotAllowedTagError', 'Twig_Sandbox_SecurityNotAllowedTagError'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php index 1406e8061a9..2fc0d01318a 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicy.php @@ -36,17 +36,17 @@ public function __construct(array $allowedTags = [], array $allowedFilters = [], $this->allowedFunctions = $allowedFunctions; } - public function setAllowedTags(array $tags) + public function setAllowedTags(array $tags): void { $this->allowedTags = $tags; } - public function setAllowedFilters(array $filters) + public function setAllowedFilters(array $filters): void { $this->allowedFilters = $filters; } - public function setAllowedMethods(array $methods) + public function setAllowedMethods(array $methods): void { $this->allowedMethods = []; foreach ($methods as $class => $m) { @@ -54,17 +54,17 @@ public function setAllowedMethods(array $methods) } } - public function setAllowedProperties(array $properties) + public function setAllowedProperties(array $properties): void { $this->allowedProperties = $properties; } - public function setAllowedFunctions(array $functions) + public function setAllowedFunctions(array $functions): void { $this->allowedFunctions = $functions; } - public function checkSecurity($tags, $filters, $functions) + public function checkSecurity($tags, $filters, $functions): void { foreach ($tags as $tag) { if (!\in_array($tag, $this->allowedTags)) { @@ -85,7 +85,7 @@ public function checkSecurity($tags, $filters, $functions) } } - public function checkMethodAllowed($obj, $method) + public function checkMethodAllowed($obj, $method): void { if ($obj instanceof Template || $obj instanceof Markup) { return; @@ -107,7 +107,7 @@ public function checkMethodAllowed($obj, $method) } } - public function checkPropertyAllowed($obj, $property) + public function checkPropertyAllowed($obj, $property): void { $allowed = false; foreach ($this->allowedProperties as $class => $properties) { @@ -124,5 +124,3 @@ public function checkPropertyAllowed($obj, $property) } } } - -class_alias('Twig\Sandbox\SecurityPolicy', 'Twig_Sandbox_SecurityPolicy'); diff --git a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php index 8b2ab4a9ce9..4cb479d5061 100644 --- a/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php @@ -21,17 +21,15 @@ interface SecurityPolicyInterface /** * @throws SecurityError */ - public function checkSecurity($tags, $filters, $functions); + public function checkSecurity($tags, $filters, $functions): void; /** * @throws SecurityNotAllowedMethodError */ - public function checkMethodAllowed($obj, $method); + public function checkMethodAllowed($obj, $method): void; /** * @throws SecurityNotAllowedPropertyError */ - public function checkPropertyAllowed($obj, $method); + public function checkPropertyAllowed($obj, $method): void; } - -class_alias('Twig\Sandbox\SecurityPolicyInterface', 'Twig_Sandbox_SecurityPolicyInterface'); diff --git a/upload/system/storage/vendor/twig/twig/src/Source.php b/upload/system/storage/vendor/twig/twig/src/Source.php index a72877880cb..3cb02403c1a 100644 --- a/upload/system/storage/vendor/twig/twig/src/Source.php +++ b/upload/system/storage/vendor/twig/twig/src/Source.php @@ -39,7 +39,7 @@ public function getCode(): string return $this->code; } - public function getName() + public function getName(): string { return $this->name; } @@ -49,5 +49,3 @@ public function getPath(): string return $this->path; } } - -class_alias('Twig\Source', 'Twig_Source'); diff --git a/upload/system/storage/vendor/twig/twig/src/Template.php b/upload/system/storage/vendor/twig/twig/src/Template.php index 76d55cbcb3a..e04bd04a63e 100644 --- a/upload/system/storage/vendor/twig/twig/src/Template.php +++ b/upload/system/storage/vendor/twig/twig/src/Template.php @@ -47,14 +47,6 @@ public function __construct(Environment $env) $this->extensions = $env->getExtensions(); } - /** - * @internal this method will be removed in 3.0 and is only used internally to provide an upgrade path from 1.x to 2.0 - */ - public function __toString() - { - return $this->getTemplateName(); - } - /** * Returns the template name. * @@ -74,10 +66,7 @@ abstract public function getDebugInfo(); * * @return Source */ - public function getSourceContext() - { - return new Source('', $this->getTemplateName()); - } + abstract public function getSourceContext(); /** * Returns the parent template. @@ -326,11 +315,11 @@ protected function loadTemplate($template, $templateName = null, $line = null, $ if (false !== $pos = strrpos($class, '___', -1)) { $class = substr($class, 0, $pos); } - - return $this->env->loadClass($class, $template, $index); + } else { + $class = $this->env->getTemplateClass($template); } - return $this->env->loadTemplate($template, $index); + return $this->env->loadTemplate($class, $template, $index); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($templateName ? new Source('', $templateName) : $this->getSourceContext()); @@ -431,5 +420,3 @@ protected function displayWithErrorHandling(array $context, array $blocks = []) */ abstract protected function doDisplay(array $context, array $blocks = []); } - -class_alias('Twig\Template', 'Twig_Template'); diff --git a/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php b/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php index 8b44815313c..c9c6b07c669 100644 --- a/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php +++ b/upload/system/storage/vendor/twig/twig/src/TemplateWrapper.php @@ -33,11 +33,6 @@ public function __construct(Environment $env, Template $template) $this->template = $template; } - /** - * Renders the template. - * - * @param array $context An array of parameters to pass to the template - */ public function render(array $context = []): string { // using func_get_args() allows to not expose the blocks argument @@ -45,11 +40,6 @@ public function render(array $context = []): string return $this->template->render($context, \func_get_args()[1] ?? []); } - /** - * Displays the template. - * - * @param array $context An array of parameters to pass to the template - */ public function display(array $context = []) { // using func_get_args() allows to not expose the blocks argument @@ -57,22 +47,12 @@ public function display(array $context = []) $this->template->display($context, \func_get_args()[1] ?? []); } - /** - * Checks if a block is defined. - * - * @param string $name The block name - * @param array $context An array of parameters to pass to the template - */ public function hasBlock(string $name, array $context = []): bool { return $this->template->hasBlock($name, $context); } /** - * Returns defined block names in the template. - * - * @param array $context An array of parameters to pass to the template - * * @return string[] An array of defined template block names */ public function getBlockNames(array $context = []): array @@ -80,14 +60,6 @@ public function getBlockNames(array $context = []): array return $this->template->getBlockNames($context); } - /** - * Renders a template block. - * - * @param string $name The block name to render - * @param array $context An array of parameters to pass to the template - * - * @return string The rendered block - */ public function renderBlock(string $name, array $context = []): string { $context = $this->env->mergeGlobals($context); @@ -110,12 +82,6 @@ public function renderBlock(string $name, array $context = []): string return ob_get_clean(); } - /** - * Displays a template block. - * - * @param string $name The block name to render - * @param array $context An array of parameters to pass to the template - */ public function displayBlock(string $name, array $context = []) { $this->template->displayBlock($name, $this->env->mergeGlobals($context)); @@ -141,5 +107,3 @@ public function unwrap() return $this->template; } } - -class_alias('Twig\TemplateWrapper', 'Twig_TemplateWrapper'); diff --git a/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php b/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php index df880a84128..307302bb624 100644 --- a/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php +++ b/upload/system/storage/vendor/twig/twig/src/Test/IntegrationTestCase.php @@ -263,5 +263,3 @@ protected static function parseTemplates($test) return $templates; } } - -class_alias('Twig\Test\IntegrationTestCase', 'Twig_Test_IntegrationTestCase'); diff --git a/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php b/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php index 368ceb10400..3b8b2c86c67 100644 --- a/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php +++ b/upload/system/storage/vendor/twig/twig/src/Test/NodeTestCase.php @@ -53,7 +53,7 @@ protected function getEnvironment() protected function getVariableGetter($name, $line = false) { - $line = $line > 0 ? "// line {$line}\n" : ''; + $line = $line > 0 ? "// line $line\n" : ''; return sprintf('%s($context["%s"] ?? null)', $line, $name); } @@ -63,5 +63,3 @@ protected function getAttributeGetter() return 'twig_get_attribute($this->env, $this->source, '; } } - -class_alias('Twig\Test\NodeTestCase', 'Twig_Test_NodeTestCase'); diff --git a/upload/system/storage/vendor/twig/twig/src/Token.php b/upload/system/storage/vendor/twig/twig/src/Token.php index 0b2ef9be43c..53a6cafc350 100644 --- a/upload/system/storage/vendor/twig/twig/src/Token.php +++ b/upload/system/storage/vendor/twig/twig/src/Token.php @@ -13,8 +13,6 @@ namespace Twig; /** - * Represents a Token. - * * @author Fabien Potencier */ final class Token @@ -38,12 +36,7 @@ final class Token public const INTERPOLATION_END_TYPE = 11; public const ARROW_TYPE = 12; - /** - * @param int $type The type of the token - * @param string $value The token value - * @param int $lineno The line position in the source - */ - public function __construct($type, $value, $lineno) + public function __construct(int $type, $value, int $lineno) { $this->type = $type; $this->value = $value; @@ -65,10 +58,8 @@ public function __toString() * * @param array|string|int $type The type to test * @param array|string|null $values The token value - * - * @return bool */ - public function test($type, $values = null) + public function test($type, $values = null): bool { if (null === $values && !\is_int($type)) { $values = $type; @@ -82,39 +73,22 @@ public function test($type, $values = null) ); } - /** - * @return int - */ - public function getLine() + public function getLine(): int { return $this->lineno; } - /** - * @return int - */ - public function getType() + public function getType(): int { return $this->type; } - /** - * @return string - */ public function getValue() { return $this->value; } - /** - * Returns the constant representation (internal) of a given type. - * - * @param int $type The type as an integer - * @param bool $short Whether to return a short representation or not - * - * @return string The string representation - */ - public static function typeToString($type, $short = false) + public static function typeToString(int $type, bool $short = false): string { switch ($type) { case self::EOF_TYPE: @@ -166,14 +140,7 @@ public static function typeToString($type, $short = false) return $short ? $name : 'Twig\Token::'.$name; } - /** - * Returns the English representation of a given type. - * - * @param int $type The type as an integer - * - * @return string The string representation - */ - public static function typeToEnglish($type) + public static function typeToEnglish(int $type): string { switch ($type) { case self::EOF_TYPE: @@ -209,5 +176,3 @@ public static function typeToEnglish($type) } } } - -class_alias('Twig\Token', 'Twig_Token'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php index 2c2f90b7f11..720ea676283 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php @@ -25,10 +25,8 @@ abstract class AbstractTokenParser implements TokenParserInterface */ protected $parser; - public function setParser(Parser $parser) + public function setParser(Parser $parser): void { $this->parser = $parser; } } - -class_alias('Twig\TokenParser\AbstractTokenParser', 'Twig_TokenParser'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php index c75e5ef8aa9..4dbf30406b0 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php @@ -23,10 +23,12 @@ * {% apply upper %} * This text becomes uppercase * {% endapply %} + * + * @internal */ final class ApplyTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineno = $token->getLine(); $name = $this->parser->getVarName(); @@ -46,12 +48,12 @@ public function parse(Token $token) ]); } - public function decideApplyEnd(Token $token) + public function decideApplyEnd(Token $token): bool { return $token->test('endapply'); } - public function getTag() + public function getTag(): string { return 'apply'; } diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php index 10fdb8180d4..b674bea4ab0 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php @@ -14,14 +14,17 @@ use Twig\Error\SyntaxError; use Twig\Node\AutoEscapeNode; use Twig\Node\Expression\ConstantExpression; +use Twig\Node\Node; use Twig\Token; /** * Marks a section of a template to be escaped or not. + * + * @internal */ final class AutoEscapeTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineno = $token->getLine(); $stream = $this->parser->getStream(); @@ -43,15 +46,13 @@ public function parse(Token $token) return new AutoEscapeNode($value, $body, $lineno, $this->getTag()); } - public function decideBlockEnd(Token $token) + public function decideBlockEnd(Token $token): bool { return $token->test('endautoescape'); } - public function getTag() + public function getTag(): string { return 'autoescape'; } } - -class_alias('Twig\TokenParser\AutoEscapeTokenParser', 'Twig_TokenParser_AutoEscape'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/BlockTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/BlockTokenParser.php index 449a2c05e22..5878131bec3 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/BlockTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/BlockTokenParser.php @@ -26,10 +26,12 @@ * * {% block title %}{% endblock %} - My Webpage * {% endblock %} + * + * @internal */ final class BlockTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineno = $token->getLine(); $stream = $this->parser->getStream(); @@ -64,15 +66,13 @@ public function parse(Token $token) return new BlockReferenceNode($name, $lineno, $this->getTag()); } - public function decideBlockEnd(Token $token) + public function decideBlockEnd(Token $token): bool { return $token->test('endblock'); } - public function getTag() + public function getTag(): string { return 'block'; } } - -class_alias('Twig\TokenParser\BlockTokenParser', 'Twig_TokenParser_Block'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php index 6575cff167d..31416c79c15 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php @@ -12,6 +12,7 @@ namespace Twig\TokenParser; use Twig\Node\DeprecatedNode; +use Twig\Node\Node; use Twig\Token; /** @@ -22,11 +23,11 @@ * * @author Yonel Ceruto * - * @final + * @internal */ -class DeprecatedTokenParser extends AbstractTokenParser +final class DeprecatedTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -35,10 +36,8 @@ public function parse(Token $token) return new DeprecatedNode($expr, $token->getLine(), $this->getTag()); } - public function getTag() + public function getTag(): string { return 'deprecated'; } } - -class_alias('Twig\TokenParser\DeprecatedTokenParser', 'Twig_TokenParser_Deprecated'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/DoTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/DoTokenParser.php index e5a07d69b89..32c8f12ff86 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/DoTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/DoTokenParser.php @@ -12,14 +12,17 @@ namespace Twig\TokenParser; use Twig\Node\DoNode; +use Twig\Node\Node; use Twig\Token; /** * Evaluates an expression, discarding the returned value. + * + * @internal */ final class DoTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -28,10 +31,8 @@ public function parse(Token $token) return new DoNode($expr, $token->getLine(), $this->getTag()); } - public function getTag() + public function getTag(): string { return 'do'; } } - -class_alias('Twig\TokenParser\DoTokenParser', 'Twig_TokenParser_Do'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php index 83a545e7bab..64b4f296f27 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php @@ -14,14 +14,17 @@ use Twig\Node\EmbedNode; use Twig\Node\Expression\ConstantExpression; use Twig\Node\Expression\NameExpression; +use Twig\Node\Node; use Twig\Token; /** * Embeds a template. + * + * @internal */ final class EmbedTokenParser extends IncludeTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $stream = $this->parser->getStream(); @@ -58,15 +61,13 @@ public function parse(Token $token) return new EmbedNode($module->getTemplateName(), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); } - public function decideBlockEnd(Token $token) + public function decideBlockEnd(Token $token): bool { return $token->test('endembed'); } - public function getTag() + public function getTag(): string { return 'embed'; } } - -class_alias('Twig\TokenParser\EmbedTokenParser', 'Twig_TokenParser_Embed'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php index a44980fbc75..0ca46dd29f7 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php @@ -20,10 +20,12 @@ * Extends a template by another one. * * {% extends "base.html" %} + * + * @internal */ final class ExtendsTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $stream = $this->parser->getStream(); @@ -38,15 +40,13 @@ public function parse(Token $token) } $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); - $stream->expect(Token::BLOCK_END_TYPE); + $stream->expect(/* Token::BLOCK_END_TYPE */ 3); return new Node(); } - public function getTag() + public function getTag(): string { return 'extends'; } } - -class_alias('Twig\TokenParser\ExtendsTokenParser', 'Twig_TokenParser_Extends'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php deleted file mode 100644 index 5f66c58296c..00000000000 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/FilterTokenParser.php +++ /dev/null @@ -1,64 +0,0 @@ -parser->getStream(); - $lineno = $token->getLine(); - - @trigger_error(sprintf('The "filter" tag in "%s" at line %d is deprecated since Twig 2.9, use the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); - - $name = $this->parser->getVarName(); - $ref = new BlockReferenceExpression(new ConstantExpression($name, $lineno), null, $lineno, $this->getTag()); - - $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - $block = new BlockNode($name, $body, $lineno); - $this->parser->setBlock($name, $block); - - return new PrintNode($filter, $lineno, $this->getTag()); - } - - public function decideBlockEnd(Token $token) - { - return $token->test('endfilter'); - } - - public function getTag() - { - return 'filter'; - } -} - -class_alias('Twig\TokenParser\FilterTokenParser', 'Twig_TokenParser_Filter'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/FlushTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/FlushTokenParser.php index 70f433939b1..02c74aa134b 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/FlushTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/FlushTokenParser.php @@ -12,26 +12,27 @@ namespace Twig\TokenParser; use Twig\Node\FlushNode; +use Twig\Node\Node; use Twig\Token; /** * Flushes the output to the client. * * @see flush() + * + * @internal */ final class FlushTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $this->parser->getStream()->expect(/* Token::BLOCK_END_TYPE */ 3); return new FlushNode($token->getLine(), $this->getTag()); } - public function getTag() + public function getTag(): string { return 'flush'; } } - -class_alias('Twig\TokenParser\FlushTokenParser', 'Twig_TokenParser_Flush'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php index a7987d95d9b..bac8ba2dae8 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/ForTokenParser.php @@ -12,15 +12,10 @@ namespace Twig\TokenParser; -use Twig\Error\SyntaxError; use Twig\Node\Expression\AssignNameExpression; -use Twig\Node\Expression\ConstantExpression; -use Twig\Node\Expression\GetAttrExpression; -use Twig\Node\Expression\NameExpression; use Twig\Node\ForNode; use Twig\Node\Node; use Twig\Token; -use Twig\TokenStream; /** * Loops over each item of a sequence. @@ -30,10 +25,12 @@ *
  • {{ user.username|e }}
  • * {% endfor %} * + * + * @internal */ final class ForTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineno = $token->getLine(); $stream = $this->parser->getStream(); @@ -41,13 +38,6 @@ public function parse(Token $token) $stream->expect(/* Token::OPERATOR_TYPE */ 8, 'in'); $seq = $this->parser->getExpressionParser()->parseExpression(); - $ifexpr = null; - if ($stream->nextIf(/* Token::NAME_TYPE */ 5, 'if')) { - @trigger_error(sprintf('Using an "if" condition on "for" tag in "%s" at line %d is deprecated since Twig 2.10.0, use a "filter" filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop).', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); - - $ifexpr = $this->parser->getExpressionParser()->parseExpression(); - } - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); $body = $this->parser->subparse([$this, 'decideForFork']); if ('else' == $stream->next()->getValue()) { @@ -62,76 +52,27 @@ public function parse(Token $token) $keyTarget = $targets->getNode(0); $keyTarget = new AssignNameExpression($keyTarget->getAttribute('name'), $keyTarget->getTemplateLine()); $valueTarget = $targets->getNode(1); - $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); } else { $keyTarget = new AssignNameExpression('_key', $lineno); $valueTarget = $targets->getNode(0); - $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); - } - - if ($ifexpr) { - $this->checkLoopUsageCondition($stream, $ifexpr); - $this->checkLoopUsageBody($stream, $body); } + $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); - return new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag()); + return new ForNode($keyTarget, $valueTarget, $seq, null, $body, $else, $lineno, $this->getTag()); } - public function decideForFork(Token $token) + public function decideForFork(Token $token): bool { return $token->test(['else', 'endfor']); } - public function decideForEnd(Token $token) + public function decideForEnd(Token $token): bool { return $token->test('endfor'); } - // the loop variable cannot be used in the condition - private function checkLoopUsageCondition(TokenStream $stream, Node $node) - { - if ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression && 'loop' == $node->getNode('node')->getAttribute('name')) { - throw new SyntaxError('The "loop" variable cannot be used in a looping condition.', $node->getTemplateLine(), $stream->getSourceContext()); - } - - foreach ($node as $n) { - if (!$n) { - continue; - } - - $this->checkLoopUsageCondition($stream, $n); - } - } - - // check usage of non-defined loop-items - // it does not catch all problems (for instance when a for is included into another or when the variable is used in an include) - private function checkLoopUsageBody(TokenStream $stream, Node $node) - { - if ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression && 'loop' == $node->getNode('node')->getAttribute('name')) { - $attribute = $node->getNode('attribute'); - if ($attribute instanceof ConstantExpression && \in_array($attribute->getAttribute('value'), ['length', 'revindex0', 'revindex', 'last'])) { - throw new SyntaxError(sprintf('The "loop.%s" variable is not defined when looping with a condition.', $attribute->getAttribute('value')), $node->getTemplateLine(), $stream->getSourceContext()); - } - } - - // should check for parent.loop.XXX usage - if ($node instanceof ForNode) { - return; - } - - foreach ($node as $n) { - if (!$n) { - continue; - } - - $this->checkLoopUsageBody($stream, $n); - } - } - - public function getTag() + public function getTag(): string { return 'for'; } } - -class_alias('Twig\TokenParser\ForTokenParser', 'Twig_TokenParser_For'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php index dd49f2fd33f..35098c267b1 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/FromTokenParser.php @@ -13,16 +13,19 @@ use Twig\Node\Expression\AssignNameExpression; use Twig\Node\ImportNode; +use Twig\Node\Node; use Twig\Token; /** * Imports macros. * * {% from 'forms.html' import forms %} + * + * @internal */ final class FromTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $macro = $this->parser->getExpressionParser()->parseExpression(); $stream = $this->parser->getStream(); @@ -56,10 +59,8 @@ public function parse(Token $token) return $node; } - public function getTag() + public function getTag(): string { return 'from'; } } - -class_alias('Twig\TokenParser\FromTokenParser', 'Twig_TokenParser_From'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/IfTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/IfTokenParser.php index 8ad99f07451..c0fe6df0d10 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/IfTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/IfTokenParser.php @@ -27,10 +27,12 @@ * {% endfor %} * * {% endif %} + * + * @internal */ final class IfTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineno = $token->getLine(); $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -70,20 +72,18 @@ public function parse(Token $token) return new IfNode(new Node($tests), $else, $lineno, $this->getTag()); } - public function decideIfFork(Token $token) + public function decideIfFork(Token $token): bool { return $token->test(['elseif', 'else', 'endif']); } - public function decideIfEnd(Token $token) + public function decideIfEnd(Token $token): bool { return $token->test(['endif']); } - public function getTag() + public function getTag(): string { return 'if'; } } - -class_alias('Twig\TokenParser\IfTokenParser', 'Twig_TokenParser_If'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/ImportTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/ImportTokenParser.php index b5674c1998e..44cb4dad79d 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/ImportTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/ImportTokenParser.php @@ -13,16 +13,19 @@ use Twig\Node\Expression\AssignNameExpression; use Twig\Node\ImportNode; +use Twig\Node\Node; use Twig\Token; /** * Imports macros. * * {% import 'forms.html' as forms %} + * + * @internal */ final class ImportTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $macro = $this->parser->getExpressionParser()->parseExpression(); $this->parser->getStream()->expect(/* Token::NAME_TYPE */ 5, 'as'); @@ -34,10 +37,8 @@ public function parse(Token $token) return new ImportNode($macro, $var, $token->getLine(), $this->getTag(), $this->parser->isMainScope()); } - public function getTag() + public function getTag(): string { return 'import'; } } - -class_alias('Twig\TokenParser\ImportTokenParser', 'Twig_TokenParser_Import'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php index e1e95da3d39..28beb8ae477 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php @@ -13,6 +13,7 @@ namespace Twig\TokenParser; use Twig\Node\IncludeNode; +use Twig\Node\Node; use Twig\Token; /** @@ -21,10 +22,12 @@ * {% include 'header.html' %} * Body * {% include 'footer.html' %} + * + * @internal */ class IncludeTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $expr = $this->parser->getExpressionParser()->parseExpression(); @@ -59,10 +62,8 @@ protected function parseArguments() return [$variables, $only, $ignoreMissing]; } - public function getTag() + public function getTag(): string { return 'include'; } } - -class_alias('Twig\TokenParser\IncludeTokenParser', 'Twig_TokenParser_Include'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/MacroTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/MacroTokenParser.php index d2673876722..f584927e908 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/MacroTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/MacroTokenParser.php @@ -23,10 +23,12 @@ * {% macro input(name, value, type, size) %} * * {% endmacro %} + * + * @internal */ final class MacroTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineno = $token->getLine(); $stream = $this->parser->getStream(); @@ -52,15 +54,13 @@ public function parse(Token $token) return new Node(); } - public function decideBlockEnd(Token $token) + public function decideBlockEnd(Token $token): bool { return $token->test('endmacro'); } - public function getTag() + public function getTag(): string { return 'macro'; } } - -class_alias('Twig\TokenParser\MacroTokenParser', 'Twig_TokenParser_Macro'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php index 1f579879472..c919556eccb 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php @@ -13,6 +13,7 @@ use Twig\Error\SyntaxError; use Twig\Node\IncludeNode; +use Twig\Node\Node; use Twig\Node\SandboxNode; use Twig\Node\TextNode; use Twig\Token; @@ -25,10 +26,12 @@ * {% endsandbox %} * * @see https://twig.symfony.com/doc/api.html#sandbox-extension for details + * + * @internal */ final class SandboxTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $stream = $this->parser->getStream(); $stream->expect(/* Token::BLOCK_END_TYPE */ 3); @@ -51,15 +54,13 @@ public function parse(Token $token) return new SandboxNode($body, $token->getLine(), $this->getTag()); } - public function decideBlockEnd(Token $token) + public function decideBlockEnd(Token $token): bool { return $token->test('endsandbox'); } - public function getTag() + public function getTag(): string { return 'sandbox'; } } - -class_alias('Twig\TokenParser\SandboxTokenParser', 'Twig_TokenParser_Sandbox'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/SetTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/SetTokenParser.php index 82fee26aedf..2fbdfe0901f 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/SetTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/SetTokenParser.php @@ -12,6 +12,7 @@ namespace Twig\TokenParser; use Twig\Error\SyntaxError; +use Twig\Node\Node; use Twig\Node\SetNode; use Twig\Token; @@ -24,10 +25,12 @@ * {% set foo = 'foo' ~ 'bar' %} * {% set foo, bar = 'foo', 'bar' %} * {% set foo %}Some content{% endset %} + * + * @internal */ final class SetTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineno = $token->getLine(); $stream = $this->parser->getStream(); @@ -58,15 +61,13 @@ public function parse(Token $token) return new SetNode($capture, $names, $values, $lineno, $this->getTag()); } - public function decideBlockEnd(Token $token) + public function decideBlockEnd(Token $token): bool { return $token->test('endset'); } - public function getTag() + public function getTag(): string { return 'set'; } } - -class_alias('Twig\TokenParser\SetTokenParser', 'Twig_TokenParser_Set'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php deleted file mode 100644 index a609c2f7e2f..00000000000 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php +++ /dev/null @@ -1,56 +0,0 @@ - - * foo - * - * {% endspaceless %} - * {# output will be
    foo
    #} - * - * @deprecated since Twig 2.7, to be removed in 3.0 (use the "spaceless" filter with the "apply" tag instead) - */ -final class SpacelessTokenParser extends AbstractTokenParser -{ - public function parse(Token $token) - { - $stream = $this->parser->getStream(); - $lineno = $token->getLine(); - - @trigger_error(sprintf('The spaceless tag in "%s" at line %d is deprecated since Twig 2.7, use the "spaceless" filter with the "apply" tag instead.', $stream->getSourceContext()->getName(), $lineno), \E_USER_DEPRECATED); - - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - $body = $this->parser->subparse([$this, 'decideSpacelessEnd'], true); - $stream->expect(/* Token::BLOCK_END_TYPE */ 3); - - return new SpacelessNode($body, $lineno, $this->getTag()); - } - - public function decideSpacelessEnd(Token $token) - { - return $token->test('endspaceless'); - } - - public function getTag() - { - return 'spaceless'; - } -} - -class_alias('Twig\TokenParser\SpacelessTokenParser', 'Twig_TokenParser_Spaceless'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/TokenParserInterface.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/TokenParserInterface.php index 6f34106f24a..bb8db3e5cc2 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/TokenParserInterface.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/TokenParserInterface.php @@ -26,7 +26,7 @@ interface TokenParserInterface /** * Sets the parser associated with this token parser. */ - public function setParser(Parser $parser); + public function setParser(Parser $parser): void; /** * Parses a token and returns a node. @@ -40,13 +40,7 @@ public function parse(Token $token); /** * Gets the tag name associated with this token parser. * - * @return string The tag name + * @return string */ public function getTag(); } - -class_alias('Twig\TokenParser\TokenParserInterface', 'Twig_TokenParserInterface'); - -// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. -class_exists('Twig\Token'); -class_exists('Twig\Parser'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php index 266efe5d989..d0a2de41a2e 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/UseTokenParser.php @@ -27,10 +27,12 @@ * {% block content %}{% endblock %} * * @see https://twig.symfony.com/doc/templates.html#horizontal-reuse for details. + * + * @internal */ final class UseTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $template = $this->parser->getExpressionParser()->parseExpression(); $stream = $this->parser->getStream(); @@ -64,10 +66,8 @@ public function parse(Token $token) return new Node(); } - public function getTag() + public function getTag(): string { return 'use'; } } - -class_alias('Twig\TokenParser\UseTokenParser', 'Twig_TokenParser_Use'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenParser/WithTokenParser.php b/upload/system/storage/vendor/twig/twig/src/TokenParser/WithTokenParser.php index c184fd75eb0..7d8cbe26165 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenParser/WithTokenParser.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenParser/WithTokenParser.php @@ -11,6 +11,7 @@ namespace Twig\TokenParser; +use Twig\Node\Node; use Twig\Node\WithNode; use Twig\Token; @@ -18,10 +19,12 @@ * Creates a nested scope. * * @author Fabien Potencier + * + * @internal */ final class WithTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $stream = $this->parser->getStream(); @@ -41,15 +44,13 @@ public function parse(Token $token) return new WithNode($body, $variables, $only, $token->getLine(), $this->getTag()); } - public function decideWithEnd(Token $token) + public function decideWithEnd(Token $token): bool { return $token->test('endwith'); } - public function getTag() + public function getTag(): string { return 'with'; } } - -class_alias('Twig\TokenParser\WithTokenParser', 'Twig_TokenParser_With'); diff --git a/upload/system/storage/vendor/twig/twig/src/TokenStream.php b/upload/system/storage/vendor/twig/twig/src/TokenStream.php index 3fb9e86e3df..1eac11a02d6 100644 --- a/upload/system/storage/vendor/twig/twig/src/TokenStream.php +++ b/upload/system/storage/vendor/twig/twig/src/TokenStream.php @@ -130,5 +130,3 @@ public function getSourceContext(): Source return $this->source; } } - -class_alias('Twig\TokenStream', 'Twig_TokenStream'); diff --git a/upload/system/storage/vendor/twig/twig/src/TwigFilter.php b/upload/system/storage/vendor/twig/twig/src/TwigFilter.php index 4351cf1397e..94e5f9b012b 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigFilter.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigFilter.php @@ -17,13 +17,11 @@ /** * Represents a template filter. * - * @final since Twig 2.4.0 - * * @author Fabien Potencier * * @see https://twig.symfony.com/doc/templates.html#filters */ -class TwigFilter +final class TwigFilter { private $name; private $callable; @@ -31,18 +29,10 @@ class TwigFilter private $arguments = []; /** - * Creates a template filter. - * - * @param string $name Name of this filter * @param callable|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation. - * @param array $options Options array */ public function __construct(string $name, $callable = null, array $options = []) { - if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); - } - $this->name = $name; $this->callable = $callable; $this->options = array_merge([ @@ -59,7 +49,7 @@ public function __construct(string $name, $callable = null, array $options = []) ], $options); } - public function getName() + public function getName(): string { return $this->name; } @@ -74,32 +64,32 @@ public function getCallable() return $this->callable; } - public function getNodeClass() + public function getNodeClass(): string { return $this->options['node_class']; } - public function setArguments($arguments) + public function setArguments(array $arguments): void { $this->arguments = $arguments; } - public function getArguments() + public function getArguments(): array { return $this->arguments; } - public function needsEnvironment() + public function needsEnvironment(): bool { return $this->options['needs_environment']; } - public function needsContext() + public function needsContext(): bool { return $this->options['needs_context']; } - public function getSafe(Node $filterArgs) + public function getSafe(Node $filterArgs): ?array { if (null !== $this->options['is_safe']) { return $this->options['is_safe']; @@ -108,43 +98,37 @@ public function getSafe(Node $filterArgs) if (null !== $this->options['is_safe_callback']) { return $this->options['is_safe_callback']($filterArgs); } + + return null; } - public function getPreservesSafety() + public function getPreservesSafety(): ?array { return $this->options['preserves_safety']; } - public function getPreEscape() + public function getPreEscape(): ?string { return $this->options['pre_escape']; } - public function isVariadic() + public function isVariadic(): bool { return $this->options['is_variadic']; } - public function isDeprecated() + public function isDeprecated(): bool { return (bool) $this->options['deprecated']; } - public function getDeprecatedVersion() + public function getDeprecatedVersion(): string { - return $this->options['deprecated']; + return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated']; } - public function getAlternative() + public function getAlternative(): ?string { return $this->options['alternative']; } } - -// For Twig 1.x compatibility -class_alias('Twig\TwigFilter', 'Twig_SimpleFilter', false); - -class_alias('Twig\TwigFilter', 'Twig_Filter'); - -// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. -class_exists('Twig\Node\Node'); diff --git a/upload/system/storage/vendor/twig/twig/src/TwigFunction.php b/upload/system/storage/vendor/twig/twig/src/TwigFunction.php index e0d961f868d..494d45b08c5 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigFunction.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigFunction.php @@ -17,13 +17,11 @@ /** * Represents a template function. * - * @final - * * @author Fabien Potencier * * @see https://twig.symfony.com/doc/templates.html#functions */ -class TwigFunction +final class TwigFunction { private $name; private $callable; @@ -31,18 +29,10 @@ class TwigFunction private $arguments = []; /** - * Creates a template function. - * - * @param string $name Name of this function * @param callable|null $callable A callable implementing the function. If null, you need to overwrite the "node_class" option to customize compilation. - * @param array $options Options array */ public function __construct(string $name, $callable = null, array $options = []) { - if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); - } - $this->name = $name; $this->callable = $callable; $this->options = array_merge([ @@ -57,7 +47,7 @@ public function __construct(string $name, $callable = null, array $options = []) ], $options); } - public function getName() + public function getName(): string { return $this->name; } @@ -72,32 +62,32 @@ public function getCallable() return $this->callable; } - public function getNodeClass() + public function getNodeClass(): string { return $this->options['node_class']; } - public function setArguments($arguments) + public function setArguments(array $arguments): void { $this->arguments = $arguments; } - public function getArguments() + public function getArguments(): array { return $this->arguments; } - public function needsEnvironment() + public function needsEnvironment(): bool { return $this->options['needs_environment']; } - public function needsContext() + public function needsContext(): bool { return $this->options['needs_context']; } - public function getSafe(Node $functionArgs) + public function getSafe(Node $functionArgs): ?array { if (null !== $this->options['is_safe']) { return $this->options['is_safe']; @@ -110,31 +100,23 @@ public function getSafe(Node $functionArgs) return []; } - public function isVariadic() + public function isVariadic(): bool { - return $this->options['is_variadic']; + return (bool) $this->options['is_variadic']; } - public function isDeprecated() + public function isDeprecated(): bool { return (bool) $this->options['deprecated']; } - public function getDeprecatedVersion() + public function getDeprecatedVersion(): string { - return $this->options['deprecated']; + return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated']; } - public function getAlternative() + public function getAlternative(): ?string { return $this->options['alternative']; } } - -// For Twig 1.x compatibility -class_alias('Twig\TwigFunction', 'Twig_SimpleFunction', false); - -class_alias('Twig\TwigFunction', 'Twig_Function'); - -// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. -class_exists('Twig\Node\Node'); diff --git a/upload/system/storage/vendor/twig/twig/src/TwigTest.php b/upload/system/storage/vendor/twig/twig/src/TwigTest.php index 6a58a56e3fd..4c18632f559 100644 --- a/upload/system/storage/vendor/twig/twig/src/TwigTest.php +++ b/upload/system/storage/vendor/twig/twig/src/TwigTest.php @@ -16,13 +16,11 @@ /** * Represents a template test. * - * @final since Twig 2.4.0 - * * @author Fabien Potencier * * @see https://twig.symfony.com/doc/templates.html#test-operator */ -class TwigTest +final class TwigTest { private $name; private $callable; @@ -30,18 +28,10 @@ class TwigTest private $arguments = []; /** - * Creates a template test. - * - * @param string $name Name of this test * @param callable|null $callable A callable implementing the test. If null, you need to overwrite the "node_class" option to customize compilation. - * @param array $options Options array */ public function __construct(string $name, $callable = null, array $options = []) { - if (__CLASS__ !== static::class) { - @trigger_error('Overriding '.__CLASS__.' is deprecated since Twig 2.4.0 and the class will be final in 3.0.', \E_USER_DEPRECATED); - } - $this->name = $name; $this->callable = $callable; $this->options = array_merge([ @@ -53,7 +43,7 @@ public function __construct(string $name, $callable = null, array $options = []) ], $options); } - public function getName() + public function getName(): string { return $this->name; } @@ -68,37 +58,37 @@ public function getCallable() return $this->callable; } - public function getNodeClass() + public function getNodeClass(): string { return $this->options['node_class']; } - public function setArguments($arguments) + public function setArguments(array $arguments): void { $this->arguments = $arguments; } - public function getArguments() + public function getArguments(): array { return $this->arguments; } - public function isVariadic() + public function isVariadic(): bool { - return $this->options['is_variadic']; + return (bool) $this->options['is_variadic']; } - public function isDeprecated() + public function isDeprecated(): bool { return (bool) $this->options['deprecated']; } - public function getDeprecatedVersion() + public function getDeprecatedVersion(): string { - return $this->options['deprecated']; + return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated']; } - public function getAlternative() + public function getAlternative(): ?string { return $this->options['alternative']; } @@ -108,8 +98,3 @@ public function hasOneMandatoryArgument(): bool return (bool) $this->options['one_mandatory_argument']; } } - -// For Twig 1.x compatibility -class_alias('Twig\TwigTest', 'Twig_SimpleTest', false); - -class_alias('Twig\TwigTest', 'Twig_Test'); diff --git a/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php b/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php index 17c169f74c8..378b666bdb8 100644 --- a/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php +++ b/upload/system/storage/vendor/twig/twig/src/Util/DeprecationCollector.php @@ -35,7 +35,7 @@ public function __construct(Environment $twig) * * @return array An array of deprecations */ - public function collectDir($dir, $ext = '.twig') + public function collectDir(string $dir, string $ext = '.twig'): array { $iterator = new \RegexIterator( new \RecursiveIteratorIterator( @@ -53,7 +53,7 @@ public function collectDir($dir, $ext = '.twig') * * @return array An array of deprecations */ - public function collect(\Traversable $iterator) + public function collect(\Traversable $iterator): array { $deprecations = []; set_error_handler(function ($type, $msg) use (&$deprecations) { @@ -75,5 +75,3 @@ public function collect(\Traversable $iterator) return $deprecations; } } - -class_alias('Twig\Util\DeprecationCollector', 'Twig_Util_DeprecationCollector'); diff --git a/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php b/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php index b0356d4c2f5..3bef14beec3 100644 --- a/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php +++ b/upload/system/storage/vendor/twig/twig/src/Util/TemplateDirIterator.php @@ -34,5 +34,3 @@ public function key() return (string) parent::key(); } } - -class_alias('Twig\Util\TemplateDirIterator', 'Twig_Util_TemplateDirIterator'); From 21deb0e73f15454ff5bd1b3f891aed01e458accd Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 13:50:26 +0000 Subject: [PATCH 05/39] Support for PHP 8.0 and 8.1 --- composer.json | 4 +-- composer.lock | 22 +++++++-------- .../vendor/composer/autoload_namespaces.php | 1 - .../storage/vendor/composer/autoload_psr4.php | 1 + .../vendor/composer/autoload_static.php | 15 ++++++----- .../storage/vendor/composer/installed.json | 27 +++++++++++-------- .../storage/vendor/composer/installed.php | 10 +++---- .../vendor/composer/platform_check.php | 4 +-- 8 files changed, 44 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index 6fb4e0c1cb8..9800bc909c3 100644 --- a/composer.json +++ b/composer.json @@ -9,13 +9,13 @@ "vendor-dir": "./upload/system/storage/vendor/" }, "require": { - "braintree/braintree_php" : "3.40.0", "cardinity/cardinity-sdk-php": "^1.0", "divido/divido-php": ">=1.1.1", "php": ">=5.4.0", "scssphp/scssphp": "1.1.1", "zoujingli/wechat-php-sdk": ">=1.3.10", "react/promise": "^2.9", - "twig/twig": "^3.3" + "twig/twig": "^3.3", + "braintree/braintree_php": "^6.7" } } diff --git a/composer.lock b/composer.lock index 323eccd2121..a0d41005b4a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "adb758cb3c253a2696bebce3d0f782a8", + "content-hash": "27a4e0507df2c53ca49096ffec9475f8", "packages": [ { "name": "braintree/braintree_php", - "version": "3.40.0", + "version": "6.7.0", "source": { "type": "git", "url": "https://github.com/braintree/braintree_php.git", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d" + "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d", + "url": "https://api.github.com/repos/braintree/braintree_php/zipball/3406aa331c3eb5ac38aecb135389897dd50f35a1", + "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1", "shasum": "" }, "require": { @@ -26,16 +26,14 @@ "ext-hash": "*", "ext-openssl": "*", "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.3.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "^3.0" }, "type": "library", "autoload": { - "psr-0": { - "Braintree": "lib/" - }, "psr-4": { "Braintree\\": "lib/Braintree" } @@ -53,9 +51,9 @@ "description": "Braintree PHP Client Library", "support": { "issues": "https://github.com/braintree/braintree_php/issues", - "source": "https://github.com/braintree/braintree_php/tree/3.40.0" + "source": "https://github.com/braintree/braintree_php/tree/6.7.0" }, - "time": "2019-03-28T23:16:53+00:00" + "time": "2022-02-23T22:28:07+00:00" }, { "name": "cardinity/cardinity-sdk-php", diff --git a/upload/system/storage/vendor/composer/autoload_namespaces.php b/upload/system/storage/vendor/composer/autoload_namespaces.php index 1587c87c778..13f1295d4c0 100644 --- a/upload/system/storage/vendor/composer/autoload_namespaces.php +++ b/upload/system/storage/vendor/composer/autoload_namespaces.php @@ -7,5 +7,4 @@ return array( 'Divido' => array($vendorDir . '/divido/divido-php/lib'), - 'Braintree' => array($vendorDir . '/braintree/braintree_php/lib'), ); diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index 6a138b1cb64..84f3d59965c 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -24,4 +24,5 @@ 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Cardinity\\' => array($vendorDir . '/cardinity/cardinity-sdk-php/src'), + 'Braintree\\' => array($vendorDir . '/braintree/braintree_php/lib/Braintree'), ); diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index f3ca7275c89..a6bf30b0f4d 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -60,6 +60,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 'Cardinity\\' => 10, ), + 'B' => + array ( + 'Braintree\\' => 10, + ), ); public static $prefixDirsPsr4 = array ( @@ -135,6 +139,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/cardinity/cardinity-sdk-php/src', ), + 'Braintree\\' => + array ( + 0 => __DIR__ . '/..' . '/braintree/braintree_php/lib/Braintree', + ), ); public static $prefixesPsr0 = array ( @@ -145,13 +153,6 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 0 => __DIR__ . '/..' . '/divido/divido-php/lib', ), ), - 'B' => - array ( - 'Braintree' => - array ( - 0 => __DIR__ . '/..' . '/braintree/braintree_php/lib', - ), - ), ); public static $classMap = array ( diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index a1abcc60bc7..ee002d296a9 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "braintree/braintree_php", - "version": "3.40.0", - "version_normalized": "3.40.0.0", + "version": "6.7.0", + "version_normalized": "6.7.0.0", "source": { "type": "git", "url": "https://github.com/braintree/braintree_php.git", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d" + "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d", + "url": "https://api.github.com/repos/braintree/braintree_php/zipball/3406aa331c3eb5ac38aecb135389897dd50f35a1", + "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1", "shasum": "" }, "require": { @@ -21,17 +21,18 @@ "ext-hash": "*", "ext-openssl": "*", "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.3.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "^3.0" }, - "time": "2015-07-15T15:07:13+00:00", + "time": "2022-02-23T22:28:07+00:00", "type": "library", "installation-source": "dist", "autoload": { - "psr-0": { - "Braintree": "lib" + "psr-4": { + "Braintree\\": "lib/Braintree" } }, "notification-url": "https://packagist.org/downloads/", @@ -41,10 +42,14 @@ "authors": [ { "name": "Braintree", - "homepage": "http://www.braintreepayments.com" + "homepage": "https://www.braintreepayments.com" } ], "description": "Braintree PHP Client Library", + "support": { + "issues": "https://github.com/braintree/braintree_php/issues", + "source": "https://github.com/braintree/braintree_php/tree/6.7.0" + }, "install-path": "../braintree/braintree_php" }, { diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index ee720c99be0..30a81e799c2 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,18 +5,18 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => 'e2f6a88815b0dc0372df8d8d4a8f503a8846a611', + 'reference' => '4053809bc83cf5a1fe507c10ecc741724c4a4362', 'name' => 'opencart/opencart', 'dev' => true, ), 'versions' => array( 'braintree/braintree_php' => array( - 'pretty_version' => '3.40.0', - 'version' => '3.40.0.0', + 'pretty_version' => '6.7.0', + 'version' => '6.7.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../braintree/braintree_php', 'aliases' => array(), - 'reference' => '840fc6ebf8d96756fed475cce94565fef178187d', + 'reference' => '3406aa331c3eb5ac38aecb135389897dd50f35a1', 'dev_requirement' => false, ), 'cardinity/cardinity-sdk-php' => array( @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => 'e2f6a88815b0dc0372df8d8d4a8f503a8846a611', + 'reference' => '4053809bc83cf5a1fe507c10ecc741724c4a4362', 'dev_requirement' => false, ), 'psr/http-message' => array( diff --git a/upload/system/storage/vendor/composer/platform_check.php b/upload/system/storage/vendor/composer/platform_check.php index a8b98d5ceb1..92370c5a0c9 100644 --- a/upload/system/storage/vendor/composer/platform_check.php +++ b/upload/system/storage/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70205)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70300)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { From 5e40703454e9b2d74bcbdd0ee898e350599da86f Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 13:52:23 +0000 Subject: [PATCH 06/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/braintree/braintree_php | 1 - 1 file changed, 1 deletion(-) delete mode 160000 upload/system/storage/vendor/braintree/braintree_php diff --git a/upload/system/storage/vendor/braintree/braintree_php b/upload/system/storage/vendor/braintree/braintree_php deleted file mode 160000 index c7e0e2d1ae2..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c7e0e2d1ae21d659cddb5507fb0bf181813b5733 From 323e5648b261f689e2ef53c3bf099c2e2facfb35 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 13:52:44 +0000 Subject: [PATCH 07/39] Support for PHP 8.0 and 8.1 --- .../braintree/braintree_php/CHANGELOG.md | 801 +++++++++++++++++ .../vendor/braintree/braintree_php/LICENSE | 22 + .../vendor/braintree/braintree_php/README.md | 150 ++++ .../braintree/braintree_php/composer.json | 34 + .../braintree/braintree_php/lib/Braintree.php | 33 + .../Braintree/AccountUpdaterDailyReport.php | 47 + .../lib/Braintree/AchMandate.php | 46 + .../braintree_php/lib/Braintree/AddOn.php | 40 + .../lib/Braintree/AddOnGateway.php | 42 + .../braintree_php/lib/Braintree/Address.php | 155 ++++ .../lib/Braintree/AddressGateway.php | 279 ++++++ .../lib/Braintree/ApplePayCard.php | 82 ++ .../lib/Braintree/ApplePayGateway.php | 76 ++ .../lib/Braintree/ApplePayOptions.php | 32 + .../lib/Braintree/AuthorizationAdjustment.php | 38 + .../braintree_php/lib/Braintree/Base.php | 103 +++ .../braintree_php/lib/Braintree/BinData.php | 38 + .../lib/Braintree/ClientToken.php | 64 ++ .../lib/Braintree/ClientTokenGateway.php | 123 +++ .../lib/Braintree/Collection.php | 193 +++++ .../lib/Braintree/Configuration.php | 815 ++++++++++++++++++ .../ConnectedMerchantPayPalStatusChanged.php | 34 + .../ConnectedMerchantStatusTransitioned.php | 34 + .../lib/Braintree/CredentialsParser.php | 179 ++++ .../lib/Braintree/CreditCard.php | 428 +++++++++ .../lib/Braintree/CreditCardGateway.php | 469 ++++++++++ .../lib/Braintree/CreditCardVerification.php | 84 ++ .../CreditCardVerificationGateway.php | 102 +++ .../CreditCardVerificationSearch.php | 131 +++ .../braintree_php/lib/Braintree/Customer.php | 379 ++++++++ .../lib/Braintree/CustomerGateway.php | 573 ++++++++++++ .../lib/Braintree/CustomerSearch.php | 253 ++++++ .../lib/Braintree/Descriptor.php | 10 + .../braintree_php/lib/Braintree/Digest.php | 63 ++ .../lib/Braintree/Disbursement.php | 93 ++ .../lib/Braintree/DisbursementDetails.php | 23 + .../braintree_php/lib/Braintree/Discount.php | 39 + .../lib/Braintree/DiscountGateway.php | 42 + .../braintree_php/lib/Braintree/Dispute.php | 226 +++++ .../lib/Braintree/Dispute/EvidenceDetails.php | 22 + .../Dispute/PayPalMessageDetails.php | 14 + .../Dispute/StatusHistoryDetails.php | 14 + .../Braintree/Dispute/TransactionDetails.php | 14 + .../lib/Braintree/DisputeGateway.php | 280 ++++++ .../lib/Braintree/DisputeSearch.php | 189 ++++ .../lib/Braintree/DocumentUpload.php | 57 ++ .../lib/Braintree/DocumentUploadGateway.php | 74 ++ .../lib/Braintree/EndsWithNode.php | 40 + .../lib/Braintree/EnrichedCustomerData.php | 46 + .../lib/Braintree/EqualityNode.php | 23 + .../lib/Braintree/Error/Codes.php | 717 +++++++++++++++ .../lib/Braintree/Error/ErrorCollection.php | 135 +++ .../lib/Braintree/Error/Validation.php | 43 + .../Error/ValidationErrorCollection.php | 147 ++++ .../braintree_php/lib/Braintree/Exception.php | 10 + .../Braintree/Exception/Authentication.php | 13 + .../lib/Braintree/Exception/Authorization.php | 15 + .../lib/Braintree/Exception/Configuration.php | 14 + .../lib/Braintree/Exception/Connection.php | 14 + .../Braintree/Exception/GatewayTimeout.php | 12 + .../Braintree/Exception/InvalidChallenge.php | 14 + .../Braintree/Exception/InvalidSignature.php | 14 + .../lib/Braintree/Exception/NotFound.php | 12 + .../Braintree/Exception/RequestTimeout.php | 12 + .../Braintree/Exception/SSLCaFileNotFound.php | 12 + .../Braintree/Exception/SSLCertificate.php | 12 + .../lib/Braintree/Exception/ServerError.php | 12 + .../Exception/ServiceUnavailable.php | 12 + .../TestOperationPerformedInProduction.php | 12 + .../lib/Braintree/Exception/Timeout.php | 12 + .../Braintree/Exception/TooManyRequests.php | 12 + .../lib/Braintree/Exception/Unexpected.php | 13 + .../Braintree/Exception/UpgradeRequired.php | 12 + .../Braintree/Exception/ValidationsFailed.php | 12 + .../lib/Braintree/FacilitatedDetails.php | 39 + .../lib/Braintree/FacilitatorDetails.php | 40 + .../braintree_php/lib/Braintree/Gateway.php | 265 ++++++ .../lib/Braintree/GooglePayCard.php | 68 ++ .../GrantedPaymentInstrumentUpdate.php | 56 ++ .../braintree_php/lib/Braintree/GraphQL.php | 58 ++ .../lib/Braintree/GraphQLClient.php | 29 + .../braintree_php/lib/Braintree/Http.php | 148 ++++ .../lib/Braintree/HttpHelpers/Curl.php | 190 ++++ .../lib/Braintree/HttpHelpers/CurlRequest.php | 51 ++ .../lib/Braintree/HttpHelpers/HttpRequest.php | 20 + .../braintree_php/lib/Braintree/Instance.php | 99 +++ .../braintree_php/lib/Braintree/IsNode.php | 41 + .../lib/Braintree/KeyValueNode.php | 41 + .../lib/Braintree/LocalPaymentCompleted.php | 60 ++ .../lib/Braintree/LocalPaymentExpired.php | 36 + .../lib/Braintree/LocalPaymentFunded.php | 46 + .../lib/Braintree/LocalPaymentReversed.php | 51 ++ .../braintree_php/lib/Braintree/Merchant.php | 43 + .../lib/Braintree/MerchantAccount.php | 74 ++ .../MerchantAccount/AddressDetails.php | 13 + .../MerchantAccount/BusinessDetails.php | 35 + .../MerchantAccount/FundingDetails.php | 15 + .../MerchantAccount/IndividualDetails.php | 35 + .../lib/Braintree/MerchantAccountGateway.php | 151 ++++ .../lib/Braintree/MerchantGateway.php | 43 + .../lib/Braintree/Modification.php | 37 + .../lib/Braintree/MultipleValueNode.php | 67 ++ .../lib/Braintree/MultipleValueOrTextNode.php | 92 ++ .../lib/Braintree/OAuthAccessRevocation.php | 34 + .../lib/Braintree/OAuthCredentials.php | 35 + .../lib/Braintree/OAuthGateway.php | 142 +++ .../lib/Braintree/OAuthResult.php | 35 + .../lib/Braintree/PaginatedCollection.php | 128 +++ .../lib/Braintree/PaginatedResult.php | 51 ++ .../lib/Braintree/PartialMatchNode.php | 37 + .../lib/Braintree/PartnerMerchant.php | 40 + .../lib/Braintree/PayPalAccount.php | 130 +++ .../lib/Braintree/PayPalAccountGateway.php | 173 ++++ .../lib/Braintree/PaymentInstrumentType.php | 22 + .../lib/Braintree/PaymentMethod.php | 77 ++ ...ymentMethodCustomerDataUpdatedMetadata.php | 49 ++ .../lib/Braintree/PaymentMethodGateway.php | 349 ++++++++ .../lib/Braintree/PaymentMethodNonce.php | 77 ++ .../Braintree/PaymentMethodNonceGateway.php | 75 ++ .../lib/Braintree/PaymentMethodParser.php | 43 + .../braintree_php/lib/Braintree/Plan.php | 104 +++ .../lib/Braintree/PlanGateway.php | 194 +++++ .../lib/Braintree/ProcessorResponseTypes.php | 13 + .../braintree_php/lib/Braintree/RangeNode.php | 79 ++ .../lib/Braintree/ResourceCollection.php | 161 ++++ .../Result/CreditCardVerification.php | 96 +++ .../lib/Braintree/Result/Error.php | 116 +++ .../lib/Braintree/Result/Successful.php | 84 ++ .../Result/UsBankAccountVerification.php | 106 +++ .../RevokedPaymentMethodMetadata.php | 38 + .../braintree_php/lib/Braintree/RiskData.php | 47 + .../lib/Braintree/SamsungPayCard.php | 104 +++ .../lib/Braintree/SettlementBatchSummary.php | 57 ++ .../SettlementBatchSummaryGateway.php | 80 ++ .../lib/Braintree/ShippingMethod.php | 18 + .../lib/Braintree/SignatureService.php | 24 + .../lib/Braintree/Subscription.php | 201 +++++ .../Braintree/Subscription/StatusDetails.php | 15 + .../lib/Braintree/SubscriptionGateway.php | 269 ++++++ .../lib/Braintree/SubscriptionSearch.php | 135 +++ .../lib/Braintree/Test/AuthenticationIds.php | 34 + .../lib/Braintree/Test/CreditCardNumbers.php | 91 ++ .../lib/Braintree/Test/MerchantAccount.php | 16 + .../lib/Braintree/Test/Nonces.php | 87 ++ .../lib/Braintree/Test/Transaction.php | 66 ++ .../lib/Braintree/Test/TransactionAmounts.php | 16 + .../lib/Braintree/Test/VenmoSdk.php | 31 + .../lib/Braintree/TestingGateway.php | 53 ++ .../braintree_php/lib/Braintree/TextNode.php | 23 + .../lib/Braintree/ThreeDSecureInfo.php | 38 + .../lib/Braintree/Transaction.php | 785 +++++++++++++++++ .../Braintree/Transaction/AddressDetails.php | 15 + .../Transaction/ApplePayCardDetails.php | 25 + .../Transaction/CreditCardDetails.php | 24 + .../Braintree/Transaction/CustomerDetails.php | 15 + .../Transaction/GooglePayCardDetails.php | 27 + .../Transaction/LocalPaymentDetails.php | 25 + .../Braintree/Transaction/PayPalDetails.php | 25 + .../Transaction/PayPalHereDetails.php | 25 + .../Transaction/SamsungPayCardDetails.php | 24 + .../Braintree/Transaction/StatusDetails.php | 15 + .../Transaction/SubscriptionDetails.php | 15 + .../Transaction/UsBankAccountDetails.php | 28 + .../Transaction/VenmoAccountDetails.php | 21 + .../Transaction/VisaCheckoutCardDetails.php | 24 + .../lib/Braintree/TransactionGateway.php | 757 ++++++++++++++++ .../lib/Braintree/TransactionLineItem.php | 39 + .../Braintree/TransactionLineItemGateway.php | 69 ++ .../lib/Braintree/TransactionReview.php | 34 + .../lib/Braintree/TransactionSearch.php | 691 +++++++++++++++ .../lib/Braintree/UnknownPaymentMethod.php | 54 ++ .../lib/Braintree/UsBankAccount.php | 103 +++ .../lib/Braintree/UsBankAccountGateway.php | 99 +++ .../Braintree/UsBankAccountVerification.php | 94 ++ .../UsBankAccountVerificationGateway.php | 133 +++ .../UsBankAccountVerificationSearch.php | 136 +++ .../braintree_php/lib/Braintree/Util.php | 511 +++++++++++ .../lib/Braintree/VenmoAccount.php | 59 ++ .../lib/Braintree/VenmoProfileData.php | 36 + .../braintree_php/lib/Braintree/Version.php | 28 + .../lib/Braintree/VisaCheckoutCard.php | 116 +++ .../lib/Braintree/WebhookNotification.php | 188 ++++ .../Braintree/WebhookNotificationGateway.php | 98 +++ .../lib/Braintree/WebhookTesting.php | 11 + .../lib/Braintree/WebhookTestingGateway.php | 813 +++++++++++++++++ .../braintree_php/lib/Braintree/Xml.php | 39 + .../lib/Braintree/Xml/Generator.php | 155 ++++ .../lib/Braintree/Xml/Parser.php | 144 ++++ .../braintree/braintree_php/lib/autoload.php | 22 + .../lib/ssl/api_braintreegateway_com.ca.crt | 241 ++++++ .../vendor/braintree/braintree_php/phpcs.xml | 70 ++ 191 files changed, 20110 insertions(+) create mode 100644 upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md create mode 100644 upload/system/storage/vendor/braintree/braintree_php/LICENSE create mode 100644 upload/system/storage/vendor/braintree/braintree_php/README.md create mode 100644 upload/system/storage/vendor/braintree/braintree_php/composer.json create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Customer.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Descriptor.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Digest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Disbursement.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/PayPalMessageDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/StatusHistoryDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/TransactionDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUpload.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ErrorCollection.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/Authentication.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/Authorization.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/Configuration.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/Connection.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/GatewayTimeout.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/InvalidChallenge.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/InvalidSignature.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/NotFound.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/RequestTimeout.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/SSLCaFileNotFound.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/SSLCertificate.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/ServerError.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/ServiceUnavailable.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/TestOperationPerformedInProduction.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/Timeout.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/TooManyRequests.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/Unexpected.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/UpgradeRequired.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/ValidationsFailed.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatedDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Instance.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/BusinessDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/FundingDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/IndividualDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccountGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethod.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Plan.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RangeNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SignatureService.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/AuthenticationIds.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/CreditCardNumbers.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/Nonces.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/Transaction.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/VenmoSdk.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TestingGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TextNode.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/ApplePayCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CreditCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/GooglePayCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/PayPalDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/PayPalHereDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/SamsungPayCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/SubscriptionDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/UsBankAccountDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VisaCheckoutCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UnknownPaymentMethod.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Util.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VisaCheckoutCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Generator.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/ssl/api_braintreegateway_com.ca.crt create mode 100644 upload/system/storage/vendor/braintree/braintree_php/phpcs.xml diff --git a/upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md b/upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md new file mode 100644 index 00000000000..9afa12ef52c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md @@ -0,0 +1,801 @@ +# Changelog + +## 6.7.0 +* Fix lint errors on unit test + +## 6.6.0 +* Add `PaymentMethodCustomerDataUpdated` webhook notification support + +## 6.5.1 +* Address PHP 8.1 Deprecation warnings + +## 6.5.0 +* Add plan create/update/find API endpoint +* Add `TransactionReview` webhook notification + +## 6.4.1 +* Add `exchangeRateQuoteId` to `Transaction.sale` +* Add error code `EXCHANGE_RATE_QUOTE_ID_IS_TOO_LONG` +* Added the following fields to GooglePayCard and ApplePayCard: + * `commercial` + * `debit` + * `durbinRegulated` + * `healthcare` + * `payroll` + * `prepaid` + * `productId` + * `countryOfIssuance` + * `issuingBank` +* Add `LocalPaymentExpired` and `LocalPaymentFunded` webhook notification support + +## 6.3.0 +* Add `paymentReaderCardDetails` parameter to `Transaction.sale` +* Add error code `TRANSACTION_TAX_AMOUNT_IS_REQUIRED_FOR_AIB_SWEDISH` for attribute `taxAmount` in `transaction` key for AIB:Domestic transactions in Sweden. + +## 6.2.0 +* Add `chargebackProtectionLevel ` to `Dispute` and `DisputeSearch` +* Add `skipAdvancedFraudChecking` to: + * `CreditCard.create` and `CreditCard.update` + * `PaymentMethod.create` and `PaymentMethod.update` + +## 6.1.0 +* Add `paypalMessages` to `Dispute` +* Fix bug where `__isset` methods in `Instance` and `Base` classes treated `null` value as set (Thanks @sklodzio) +* Add `tax_identifiers` parameter to `Customer.create` and `Customer.update` +* Add webhook sample for `GrantedPaymentMethodRevoked` +* Add sample webhook notifications for `SUBSCRIPTION_EXPIRED`, `SUBSCRIPTION_CANCELED` and `SUBSCRIPTION_WENT_PAST_DUE` (thanks @antonvolokha) + +## 6.0.0 +* Add `LocalPaymentReversed` webhook +* Add `adjustAuthorization` method to Transaction, for supporting multiple authorizations on a single transaction +* Add `storeId` and `storeIds` to Transaction search +* Add `merchantAccountId` parameter to Transaction refund +* Parameters that supported DateTime objects can also support DateTimeImmutable objects (closes #278) +* Add `toArray` function to Base and Instance classes (resolves #289) +* Add `jsonSerialize` to Instance class +* Breaking Changes: + * Require PHP 7.3 or higher + * Rename `AndroidPayCard` to `GooglePayCard` + * Rename `AndroidPayCardDetails` to `GooglePayCardDetails` + * Remove Configuration#isAuthenticatedInstanceProxy method in favor of Configuration#isAuthenticatedProxy + * Remove Configuration#isUsingInstanceProxy method in favor of Configuration#isUsingProxy + * Remove `TRANSACTION_EXTERNAL_VAULT_CARD_TYPE_IS_INVALID ` and `RISK_DATA_CUSTOMER_BROWSER_IS_TOO_LONG` error codes + * Remove `customer_ip` and `customer_browser` snake case parameters in favor of camel case `customerIp` and `customerBrowser` accepted in `Customer#create` and `Transaction#sale` + * Remove `AmexExpressCheckoutCard` and `AmexExpressCheckoutCardDetails` + * Remove `MasterpassCard` and `MasterpassCardDetails` + * Remove deprecated parameters: + * `deviceSessionId` from CreditCardGateway#update, CreditCardGateway#create, CustomerGateway#create, CustomerGateway#update, PaymentMethodGateay#update, and TransactionGateway#create + * `fraudMerchantId` from CreditCardGateway#update, CreditCardGateway#create, CustomerGateway#create, CustomerGateway#update, PaymentMethodGateay#update, and TransactionGateway#create + +## 5.5.0 +* Add `scaExemption` to Transaction sale +* Deprecate `deviceSessionId` and `fraudMerchantId` in `CreditCardGateway`, `CustomerGateway`, `PaymentMethodGateway`, and `TransactionGateway` classes +* Add `installments` to Transaction sale +* Add `count` to `installments` + +## 5.4.0 +* Add `AcquirerReferenceNumber` to `Transaction` +* Add `billingAgreementId` to `PayPalDetails` +* Deprecate `recurring` in Transaction sale +* Deprecate `tag` in Dispute add text evidence + +## 5.3.1 +* Deprecate `masterpassCard` and `amexExpressCheckoutCard` payment methods +* Deprecate `amexExpressCheckoutCardDetails` + +## 5.3.0 +* Add `RISK_THRESHOLD` to `GatewayRejectionReason` constants +* Add `networkTransactionId` to `CreditCardVerification` +* Add `processedWithNetworkToken` to `Transaction` +* Add `isNetworkTokenized` to `CreditCard` +* Add `productSku` to `Transaction` +* Add `phoneNumber` and `shippingMethod` to `Address` +* Add `customerDeviceId`, `customerLocationZip`, and `customerTenure` to `RiskData` +* Add error codes + * `TRANSACTION_PRODUCT_SKU_IS_INVALID` + * `TRANSACTION_SHIPPING_METHOD_IS_INVALID` + * `TRANSACTION_SHIPPING_PHONE_NUMBER_IS_INVALID` + * `TRANSACTION_BILLING_PHONE_NUMBER_IS_INVALID` + * `RISK_DATA_CUSTOMER_BROWSER_IS_TOO_LONG` + * `RISK_DATA_CUSTOMER_DEVICE_ID_IS_TOO_LONG` + * `RISK_DATA_CUSTOMER_LOCATION_ZIP_INVALID_CHARACTERS` + * `RISK_DATA_CUSTOMER_LOCATION_ZIP_IS_INVALID` + * `RISK_DATA_CUSTOMER_LOCATION_ZIP_IS_TOO_LONG` + * `RISK_DATA_CUSTOMER_TENURE_IS_TOO_LONG` + * `RISK_DATA_CUSTOMER_TENURE_IS_INVALID` + +## 5.2.0 +* Add `retrieval_reference_number` to `Transaction` +* Fix class alias issue where Exceptions could not be thrown for missing libraries or older PHP versions. +* Fix issue where `proxyHost`, `proxyPort`, `proxyType`, `proxyUser`, `proxyPassword`, and `sslVersion` were not being set on Gateway or Configuration objects. + +## 5.1.0 +* Add `threeDSecurePassThru` parameters to `Customer.create`, `PaymentMethod.create`, `CreditCard.create`, `Customer.update`, `PaymentMethod.update` and `CreditCard.update` +* Add `recurringCustomerConsent` and `recurringMaxAmount` to `authenticationInsightOptions` for `PaymentMethodNonce.create` +* Add `DOCUMENT_UPLOAD_FILE_IS_EMPTY` error code +* phpDocs fixes (thanks @pupitooo) + +## 5.0.0 +* Add `DISPUTE_ACCEPTED`, `DISPUTE_DISPUTED`, and `DISPUTE_EXPIRED` webhook constants +* Breaking Changes: + * Upgrade API version to retrieve declined refund transactions + * Throw `RequestTimeout` instead of `Timeout` for transaction search + * Drop PSR-0 Support and remove class aliases + * Remove EuropeBankAccount and IbanBankAccount modules + * Remove deprecated SEPA error codes + * Remove `paypalVaultWithoutUpgrade` + * Invalid transaction IDs are validated by the gateway and not the SDK + +## 4.8.0 +* Add `Authentication Insight` to payment method nonce create +* Add `threeDSecureAuthenticationId` support to transaction sale +* Add ThreeDSecure test payment method nonces +* Add test `AuthenticationId`s + +## 4.7.0 +* Add `RefundAuthHardDeclined` and `RefundAuthSoftDeclined` to validation errors +* Add level 2 processing options `purchaseOrderNumber`, `taxAmount`, and `taxExempt` to Transaction submit for settlement +* Add level 3 processing options `discountAmount`, `shippingAmount`, `shipsFromPostalCode`, and `lineItems` to Transaction submit for settlement + +## 4.6.0 +* Add `isNetworkTokenized` to `AndroidPayCard` and `AndroidPayCardDetails` +* Add GraphQL ID to `CreditCardVerification`, `Customer`, `Dispute`, and `Transaction` +* Add support for PHP 7.4 (#262 thanks @slt) +* Add `threeDSecurePassThru` params to PaymentMethod update + +## 4.5.0 +* Add `PROCESSOR_DOES_NOT_SUPPORT_MOTO_FOR_CARD_TYPE` to validation errors +* Make errors JSON serializable (#256 thanks @sebdesign) + +## 4.4.0 +* Add `AMOUNT_NOT_SUPPORTED_BY_PROCESSOR` to validation errors +* Forward `forwardedComments` to `processorComments` + +## 4.3.0 +* Add `PayPalHereDetails` to transactions +* Add `network_response_code` and `network_response_text` to `Transaction` and `CreditCardVerification` +* Add `xid`, `cavv`, `eciFlag`, `dsTransactionId`, and `threeDSecureVersion` to `ThreeDSecureInfo` +* Add `threeDSecureInfo` to `CreditCardVerification` +* Add `GraphQLClient` to `BraintreeGateway` class + +## 4.2.0 +* Add `captureId` to `LocalPaymentDetails` +* Add `debugId` to `LocalPaymentDetails` +* Add `refundId` to `LocalPaymentDetails` +* Add `transactionFeeAmount` to `LocalPaymentDetails` +* Add `transactionFeeCurrencyIsoCode` to `LocalPaymentDetails` +* Add `refundFromTransactionFeeAmount` to `LocalPaymentDetails` +* Add `refundFromTransactionFeeCurrencyIsoCode` to `LocalPaymentDetails` +* Add `threeDSecureVersion`, `authenticationResponse`, `directoryResponse`, `cavvAlgorithm` and `dsTransactionId` to 3DS pass thru fields +* Add `payerInfo` to `PaymentMethodNonce` details +* Add `roomTax` field to Transaction sale +* Add `noShow` field to Transaction sale +* Add `advancedDeposit` field to Transaction sale +* Add `fireSafe` field to Transaction sale +* Add `propertyPhone` field to Transaction sale +* Add `additionalCharges` field to Transaction sale +* Add `PostalCodeIsRequiredForCardBrandAndProcessor` to validation errors + +## 4.1.0 +* Add `revokedAt` field to `PayPalAccount` +* Add support for `PAYMENT_METHOD_REVOKED_BY_CUSTOMER` webhook +* Add `payment_method_nonce` field to `LocalPaymentCompleted` webhook +* Add `transaction` field to `LocalPaymentCompleted` webhook +* Add `localPaymentDetail` to transactions +* Add `TOKEN_ISSUANCE` gatewayRejectionReason enum to `Transaction` + +## 4.0.0 +* Add support for PHP 7 (Thanks to @briandotdev) +* Require PHP 7.2 or higher +* Remove support for HHVM and PHP 5 +* Update to PHPUnit 7 +* Remove deprecated `GRANTED_PAYMENT_INSTRUMENT_UPDATE` +* Remove deprecated Coinbase payment method +* Remove deprecated iDEAL payment method +* Remove deprecated `MerchantAccountGateway` creation with `applicantDetails`. Please use `individual`, `business`, and `funding`. +* When a `Customer` is created, the `customFields` property is always an array rather than potentially `null`. +* Remove Transparent Redirect +* Remove `riskData`, `applePay`, `applePayCard`, `threeDSecure`, and `venmo.profileId` snakecase attributes +* HTTPS requests throw an `SSLCertificate` exception when related to SSL, otherwise a `Connection` exception is thrown. +* Rename `DownForMaintence` Exception to `ServiceUnavailable`. Throw `Timeout` exception for transaction search errors instead of `DownForMaintenance`. +* Add `RequestTimeout` and `GatewayTimeout` exceptions. +* Add `revokedAt` field to `PayPalAccount` +* Add support for `PAYMENT_METHOD_REVOKED_BY_CUSTOMER` webhook + +## 3.40.0 +* Deprecate `GRANTED_PAYMENT_INSTRUMENT_UPDATE` and add `GRANTOR_UPDATED_GRANTED_PAYMENT_METHOD` and `RECIPIENT_UPDATED_GRANTED_PAYMENT_METHOD` +* Add `accountType` field to `TransactionGateway`, `CreditCardGateway`, `PaymentMethodGateway`, and `CreditCardVerification`. +* Add Hiper and Hipercard test numbers. +* Add `refundFromTransactionFeeAmount` field to `PayPalDetails` +* Add `refundFromTransactionFeeCurrencyIsoCode` field to `PayPalDetails` + +## 3.39.0 +* Add `bin` field to `paymentMethodNonceDetails` +* Add Error indicating pdf uploads too long for dispute evidence. +* Add `GrantedPaymentMethodRevoked` webhook response objects + +## 3.38.0 +* Add `fraudServiceProvider` field in `riskData` +* Fix issue where merchant reporting calls would throw an exception in PHP 7 (#236) + +## 3.37.0 +* Add `processorResponseType` to `Transaction`, `AuthorizationAdjustment`, and `CreditCardVerification`. +* Add `authorizationExpiresAt` to `Transaction` +* Add support for additional PayPal options when vaulting a PayPal Order during customer update +* Allow PayPal payment ID and payer ID to be passed during transaction create +* Add `travel_flight` support to industry-specific data + +## 3.36.0 +* Fix dispute results in transactions not showing the correct status sometimes +* Add `externalVault` option to transaction sale +* Add `LocalPaymentCompleted` webhook + +## 3.35.0 +* Add subscription charged unsuccessfully sample webhook to webhook testing gateway +* Add `processor_response_code` and `processor_response_text` to authorization adjustments subfield in transaction response. +* Fix issue where result objects could not be printed with `echo` (thanks @cmeon) +* Add Samsung Pay support + +## 3.34.0 +* Allow payee ID to be passed in options params for transaction create +* Add `merchant_id` to `ConnectedMerchantStatusTransitioned` and `ConnectedMerchantPayPalStatusChanged` Auth webhooks +* Fix webhook testing sample xml for dispute webhooks to include `amount-won` and `amount-disputed` (closes #225) + +## 3.33.0 +* Fix WebhookTestingGateway to use local configuration +* Add Disbursement type field and methods + +## 3.32.0 +* Add support for US Bank Account verifications API + +## 3.31.0 +* Fix issue where webhook verification would fail due to missing global public key configuration value +* Fix issue where webhook testing did not work on instantiated gateway +* Add support for VCR compelling evidence dispute representment + +## 3.30.0 +* Add `oauthAccessRevocation` to `WebhookNotification`s +* Add support for `profileId` in Transaction#create options for VenmoAccounts +* Add support for dispute search by `customerId`, `disbursementDate`, and `effectiveDate` +* Make `CustomerGateway::find` backward compatible +* Remove `sepaMandateType` and `sepaMandateAcceptanceLocation` params from `ClientTokenGateway` + +## 3.29.0 +* Add support for `association_filter_id` in `Customer#find` +* Add support for setting `timeout` and `acceptGzipEncoding` values on construction of `Configuration` instances + +## 3.28.0 +* Add support for Level 3 summary parameters: `shippingAmount`, `discountAmount`, and `shipsFromPostalCode` +* Add support for `tax_amount` field on transaction `line_items` +* Add `sourceMerchantId` property to `WebhookNotification`s if present +* Deprecate `TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_MUST_BE_GREATER_THAN_ZERO` error in favor of `TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_CANNOT_BE_NEGATIVE`. +* Deprecate `TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_MUST_BE_GREATER_THAN_ZERO` error in favor of `TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_CANNOT_BE_NEGATIVE`. +* Deprecate `Braintree\Transaction\LineItem` in favor of `Braintree\TransactionLineItem`. +* Add `findAll` static method to `TransactionLineItem` class +* Add support for `profile_id` in Transaction#create options for VenmoAccounts + +## 3.27.0 +* Add support for Level 3 summary parameters: `shippingAmount`, `discountAmount`, and `shipsFromPostalCode` +* Add support for transaction line items +* Add support for tagged evidence in `DisputeGateway::addTextEvidence` (Beta release) +* Update https certificate bundle + +## 3.26.1 +* Deprecate `OAuthGateway::computeSignature` +* Fix spec to expect PayPal transactions to move to settling rather than settled +* Fix AchMandate acceptedAt attribute parsing + +## 3.26.0 +* Add support for upgrading a PayPal future payment refresh token to a billing agreement +* Address deprecation warnings for create_function with PHP 7 (#193, thanks @chrisdeeming) +* Add `cardHolderName` to `CreditCardDetails` (#201, thanks @Samistine) +* Add GrantedPaymentInstrumentUpdate webhook support +* Allow paypal => options params to be passed in camel case +* Add ability to create a transaction from a shared nonce +* Implement JsonSerializable on Braintree Objects for easier logging (#200, thanks @hfmikep) +* Fix spec to expect PayPal transaction to settle immediately after successful capture +* Add `options` -> `paypal` -> `shipping` for creating & updating customers as well as creating payment methods +* Add `options` -> `paypal` -> `description` for creating and updating subscriptions +* Add `binData` to `PaymentMethodNonce` +* Add `bin` to `ApplePayCard` +* Add `deviceDataCaptured` field in `riskData` + +## 3.25.0 +* Add `submitForSettlement` option to `Subscription::retryCharge` +* Support `eci_indicator` for Transaction sale with raw Apple Pay parameters +* Add `accept` method for the Dispute API +* Add `addTextEvidence` method for the Dispute API +* Add `addFileEvidence` method for the Dispute API +* Add `finalize` method for the Dispute API +* Add `find` method for the Dispute API +* Add `removeEvidence` method for the Dispute API +* Add `search` method for the Dispute API +* Add DocumentUpload + +## 3.24.0 +* Add AuthorizationAdjustment class and `authorizationAdjustments` to Transaction +* Add iDEAL webhook support +* Add `IDEAL_PAYMENT` to `PaymentInstrumentType` +* Create Braintree class to be PSR compliant +* Coinbase is no longer a supported payment method. `PAYMENT_METHOD_NO_LONGER_SUPPORTED` will be returned for Coinbase operations. +* Add `ApplePay` for web domain registration. +* Add facilitated details to Transaction if present +* Update link to transaction api documentation (thanks @qoheleth-tech!). +* Fix TransactionGateway return types (thanks @jjok!). +* Update return type for client token (thanks @jlaswell!). + +## 3.23.1 +* Fix token generator return type - thanks @jjok! +* Improve error reporting for connection issues - thanks @montymxb! +* Add support for additional PayPal options when vaulting a PayPal Order + +## 3.23.0 +* Add Visa Checkout support +* Add ConnectedMerchantStatusTransitioned and ConnectedMerchantPayPalStatusChanged Auth webhooks +* Add new properties to `CreditCardVerification` and `Customer` +* Add SDK support for skip AVS and skip CVV + +## 3.22.0 +* Add option to disable Accept-Encoding: gzip header for Google App Engine +* Fix a bug where `merchantAccount->all` would attempt to fetch too many pages of merchant accounts + +## 3.21.1 +* Add back in `options->three_d_secure` to transaction params that was accidentally removed in v3.14.0 + +## 3.21.0 +* Allow optional configuration of SSL version +* Replace `var_dump` with `print_r`. Thanks, @mnlg +* Add functionality to list all merchant accounts for a merchant with `merchantAccount->all` +* Stop sending account_description field from us bank accounts + +## 3.20.0 +* Add option `skip_advanced_fraud_check` for transaction flows + +## 3.19.0 +* Add multi-currency updates to merchants onboarded through Braintree Auth +* Raise an exception if fetching pages of results times out during a transaction search + +## 3.18.0 +* Fix `UsBankAccount` support for `Customer`s +* Update `Grant` api to support options hash + +## 3.17.0 +* Add 'UsBankAccount' payment method + +## 3.16.0 +* Add authenticated proxy functionality +* Add constant for Venmo Account payment instrument type +* Add validation error for verifications with submerchants + +## 3.15.0 +* Add 'default_payment_method' option for Customer + +## 3.14.0 +**Note: This version introduced an unintentional breaking change where the `options->three_d_secure` transaction parameter was changed to `options->threeDSecure`. Starting in v3.21.1, both case conventions are supported for backwards compatibility.** + +* Add OrderId to refund +* Add 3DS Pass thru support +* Expose IDs in resource collections +* Add leading slash to the namespace. Thanks, @bocharsky-bw +* Stop modifying DateTime parameters during XML generation. Thanks, @jodarove + +## 3.13.0 +* Add method of revoking OAuth access tokens. + +## 3.12.0 +* Add Transaction `update_details` +* Support for Too Many Requests response codes +* Add ability to count errors in ErrorCollection object. Thanks, @bocharsky-bw +* Improve Type Hinting + +## 3.11.0 +* Remove final from classes. Thanks, @ibrahimlawal! +* Add currency to Transaction search + +## 3.10.0 +* Add timeout attribute +* Add start-date and end-date to SUBSCRIPTION_CHARGED_SUCCESSFULLY test webhook response + +## 3.9.0 +* Add AccountUpdaterDailyReport webhook parsing + +## 3.8.0 +* Add payment method revoke +* Add support for options in `submit_for_settlement` transaction flows +* Add verification create API +* Update https certificate bundle + +## 3.7.0 +* Add VenmoAccount +* Allow order_id and descriptor to be passed in for Transaction submit_for_settlement +* Add facilitator details onto transactions +* Add check webhook constant + +## 3.6.1 +* Fix PSR-0 style namespacing when using Symfony + +## 3.6.0 +* Add support for proxy servers +* Add PSR-4 namespacing support +* Add support for AMEX Express Checkout +* Add support for new fields in dispute webhooks (`dateWon`, `dateOpened`, `kind`) +* Add transaction data to sucessful subscription webhook + +## 3.5.0 +* Add support for raw ApplePay params on Transaction create + +## 3.4.0 +* Add sourceDescription method to Android Pay and Apple Pay payment methods +* Add new Android Pay test nonces +* Add billing agreement ID to PayPal Account +* Support amex rewards transactions + +## 3.3.0 +* Add new test payment method nonces +* Allow passing description on PayPal transactions +* Add methods to change transaction settlement status in sandbox +* Fix issue where customer with an id of 0 could not be found +* Add Europe Bank Account functionality + +## 3.2.0 +* Add additional search criteria + +## 3.1.0 +* Add support for HHVM +* Validate that configuration is valid before verifying webhooks +* Make OAuth methods conform more to existing API +* Expose customer paymentMethods as an attribute + +## 3.0.1 +* Add support for Android Pay + +## 3.0.0 +* Deprecate PHP 5.2 and 5.3 +* Validate webhook challenge payload +* Bugfix for calling `__toString()` on objects that contain a `\DateTime` + +## 2.40.0 +* Add missing criteria to credit card verification search +* Bugfix for autoloading files with Composer + +## 2.39.0 +* Add oauth functionality +* Add 3DS info to the server side + +## 2.38.0 +* Update payment instrument types and test nonces +* Add missing valid params to PaymentMethodGateway + +## 2.37.0 +* Add 3D Secure transaction fields +* Add ability to create nonce from vaulted payment methods + +## 2.36.0 +* Surface Apple Pay payment instrument name in responses +* Support Coinbase payment instruments + +## 2.35.2 +* Fix E_STRICT errors +* Expose subscription status details + +## 2.35.1 +* Bugfix for auto loading files + +## 2.35.0 +* Allow PayPal fields in transaction.options.paypal +* Add error code constants +* Internal refactoring + +## 2.34.0 +* Add risk_data to Transaction and Verification with Kount decision and id +* Add verification_amount an option when creating a credit card +* Add TravelCruise industry type to Transaction +* Add room_rate to Lodging industry type +* Add CreditCard#verification as the latest verification on that credit card +* Add ApplePay support to all endpoints that may return ApplePayCard objects +* Add prefix to sample Webhook to simulate webhook query params + +## 2.33.0 +* Allow descriptor to be passed in Funding Details options params for Merchant Account create and update. + +## 2.32.0 +* Add additionalProcessorResponse to Transaction + +## 2.31.1 +* Allow payee_email to be passed in options params for Transaction create + +## 2.31.0 +* Added paypal specific fields to transaction calls +* Added SettlementPending, SettlementDeclined transaction statuses + +## 2.30.0 +* Add descriptor url support + +## 2.29.0 +* Allow credit card verification options to be passed outside of the nonce for PaymentMethod.create +* Allow billing_address parameters and billing_address_id to be passed outside of the nonce for PaymentMethod.create +* Add Subscriptions to paypal accounts +* Add PaymentMethod.update +* Add fail_on_duplicate_payment_method option to PaymentMethod.create + +## 2.28.0 +* Adds support for v.zero SDKs. + +## 2.27.2 + +* Make webhook parsing more robust with newlines +* Add messages to InvalidSignature exceptions + +## 2.27.1 + +* Updated secureCompare to correctly compare strings in consistent time +* Add better error messages around webhook verification + +## 2.27.0 + +* Include Dispute information on Transaction +* Search for Transactions disputed on a certain date + +## 2.26.0 + +* Disbursement Webhooks + +## 2.25.1 + +* Fix factories on AddOn and Discount (thanks [stewe](https://github.com/stewe)) +* Allow billingAddressId on transaction create + +## 2.25.0 + +* Merchant account find API + +## 2.24.0 + +* Merchant account update API +* Merchant account create API v2 + +## 2.23.1 + +* Update configuration URLs + +## 2.23.0 + +* Official Partnership support + +## 2.22.2 + +* Add Partner Merchant Declined webhook +* use preg_callback_replace instead of preg_replace (thanks [jonthornton](https://github.com/jonthornton)!) + +## 2.22.1 + +* Adds missing test contstant to library namespace + +## 2.22.0 + +* Adds holdInEscrow method +* Add error codes for verification not supported error +* Add companyName and taxId to merchant account create +* Adds cancelRelease method +* Adds releaseFromEscrow functionality +* Adds phone to merchant account signature. +* Adds merchant account phone error code. +* Fix casing issues with Braintree\_Http and Braintree\_Util references (thanks [steven-hadfield](https://github.com/steven-hadfield)!) +* Fixed transaction initialization arguments to be optional (thanks [karolsojko](https://github.com/karolsojko)!) + +## 2.21.0 + +* Enable device data. + +## 2.20.0 + +* Fixed getting custom fields with valueForHtmlField. [Thanks to Miguel Manso for the fix.](https://github.com/mumia) +* Adds disbursement details to transactions. +* Adds image url to transactions. + +## 2.19.0 + +* Adds channel field to transactions. + +## 2.18.0 + +* Adds country of issuance and issuing bank bin database fields + +## 2.17.0 + +* Adds verification search + +## 2.16.0 + +* Additional card information, such as prepaid, debit, commercial, Durbin regulated, healthcare, and payroll, are returned on credit card responses +* Allows transactions to be specified as recurring + +## 2.15.0 + +* Adds prepaid field to credit cards (possible values include Yes, No, Unknown) + +## 2.14.1 + +* Adds composer support (thanks [till](https://github.com/till)) +* Fixes erroneous version number +* Braintree_Plan::all() returns empty array if no plans exist + +## 2.14.0 + +* Adds webhook gateways for parsing, verifying, and testing notifications + +## 2.13.0 + +* Adds search for duplicate credit cards given a payment method token +* Adds flag to fail saving credit card to vault if card is duplicate + +## 2.12.5 + +* Exposes plan_id on transactions + +## 2.12.4 + +* Added error code for invalid purchase order number + +## 2.12.3 + +* Fixed problematic case in ResourceCollection when no results are returned from a search. + +## 2.12.2 + +* Fixed customer search, which returned customers when no customers matched search criteria + +## 2.12.1 + +* Added new error message for merchant accounts that do not support refunds + +## 2.12.0 + +* Added ability to retrieve all Plans, AddOns, and Discounts +* Added Transaction cloning + +## 2.11.0 + +* Added Braintree_SettlementBatchSummary + +## 2.10.1 + +* Wrap dependency requirement in a function, to prevent pollution of the global namespace + +## 2.10.0 + +* Added subscriptionDetails to Transaction +* Added flag to store in vault only when a transaction is successful +* Added new error code + +## 2.9.0 + +* Added a new transaction state, AUTHORIZATION_EXPIRED. +* Enabled searching by authorizationExpiredAt. + +## 2.8.0 + +* Added next_billing_date and transaction_id to subscription search +* Added address_country_name to customer search +* Added new error codes + +## 2.7.0 + +* Added Customer search +* Added dynamic descriptors to Subscriptions and Transactions +* Added level 2 fields to Transactions: + * tax_amount + * tax_exempt + * purchase_order_number + +## 2.6.1 + +* Added billingAddressId to allowed parameters for credit cards create and update +* Allow searching on subscriptions that are currently in a trial period using inTrialPeriod + +## 2.6.0 + +* Added ability to perform multiple partial refunds on Braintree_Transactions +* Allow passing expirationMonth and expirationYear separately when creating Braintree_Transactions +* Added revertSubscriptionOnProrationFailure flag to Braintree_Subscription update that specifies how a Subscription should react to a failed proration charge +* Deprecated Braintree_Subscription nextBillAmount in favor of nextBillingPeriodAmount +* Deprecated Braintree_Transaction refundId in favor of refundIds +* Added new fields to Braintree_Subscription: + * balance + * paidThroughDate + * nextBillingPeriodAmount + +## 2.5.0 + +* Added Braintree_AddOns/Braintree_Discounts +* Enhanced Braintree_Subscription search +* Enhanced Braintree_Transaction search +* Added constants for Braintree_Result_CreditCardVerification statuses +* Added EXPIRED and PENDING statuses to Braintree_Subscription +* Allowed prorateCharges to be specified on Braintree_Subscription update +* Added Braintree_AddOn/Braintree_Discount details to Braintree_Transactions that were created from a Braintree_Subscription +* Removed 13 digit Visa Sandbox Credit Card number and replaced it with a 16 digit Visa +* Added new fields to Braintree_Subscription: + * billingDayOfMonth + * daysPastDue + * firstBillingDate + * neverExpires + * numberOfBillingCycles + +## 2.4.0 + +* Added ability to specify country using countryName, countryCodeAlpha2, countryCodeAlpha3, or countryCodeNumeric (see [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1)) +* Added gatewayRejectionReason to Braintree_Transaction and Braintree_Verification +* Added unified message to result objects + +## 2.3.0 + +* Added unified Braintree_TransparentRedirect url and confirm methods and deprecated old methods +* Added functions to Braintree_CreditCard to allow searching on expiring and expired credit cards +* Allow card verification against a specified merchant account +* Added ability to update a customer, credit card, and billing address in one request +* Allow updating the paymentMethodToken on a subscription + +## 2.2.0 + +* Prevent race condition when pulling back collection results -- search results represent the state of the data at the time the query was run +* Rename ResourceCollection's approximate_size to maximum_size because items that no longer match the query will not be returned in the result set +* Correctly handle HTTP error 426 (Upgrade Required) -- the error code is returned when your client library version is no long compatible with the gateway +* Add the ability to specify merchant_account_id when verifying credit cards +* Add subscription_id to transactions created from subscriptions + +## 2.1.0 + +* Added transaction advanced search +* Added ability to partially refund transactions +* Added ability to manually retry past-due subscriptions +* Added new transaction error codes +* Allow merchant account to be specified when creating transactions +* Allow creating a transaction with a vault customer and new payment method +* Allow existing billing address to be updated when updating credit card +* Correctly handle xml with nil=true + +## 2.0.0 + +* Updated success? on transaction responses to return false on declined transactions +* Search results now include Enumerable and will automatically paginate data +* Added credit_card[cardholder_name] to allowed transaction params and CreditCardDetails (thanks [chrismcc](https://github.com/chrismcc)) +* Fixed a bug with Customer::all +* Added constants for error codes + +## 1.2.1 + +* Added methods to get both shallow and deep errors from a Braintree_ValidationErrorCollection +* Added the ability to make a credit card the default card for a customer +* Added constants for transaction statuses +* Updated Quick Start in README.md to show a workflow with error checking + +## 1.2.0 + +* Added subscription search +* Provide access to associated subscriptions from CreditCard +* Switched from using Zend framework for HTTP requests to using curl extension +* Fixed a bug in Transparent Redirect when arg_separator.output is configured as & instead of & +* Increased http request timeout +* Fixed a bug where ForgedQueryString exception was being raised instead of DownForMaintenance +* Updated SSL CA files + +## 1.1.1 + +* Added Braintree_Transaction::refund +* Added Braintree_Transaction::submitForSettlementNoValidate +* Fixed a bug in errors->onHtmlField when checking for errors on custom fields when there are none +* Added support for passing merchantAccountId for Transaction and Subscription + +## 1.1.0 + +* Added recurring billing support + +## 1.0.1 + +* Fixed bug with Braintree_Error_ErrorCollection.deepSize +* Added methods for accessing validation errors and params by html field name + +## 1.0.0 + +* Initial release diff --git a/upload/system/storage/vendor/braintree/braintree_php/LICENSE b/upload/system/storage/vendor/braintree/braintree_php/LICENSE new file mode 100644 index 00000000000..305dd595a0f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2021 Braintree, a division of PayPal, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/upload/system/storage/vendor/braintree/braintree_php/README.md b/upload/system/storage/vendor/braintree/braintree_php/README.md new file mode 100644 index 00000000000..9a6dc533921 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/README.md @@ -0,0 +1,150 @@ +# Braintree PHP library + +The Braintree PHP library provides integration access to the Braintree Gateway. + +## TLS 1.2 required +> **The Payment Card Industry (PCI) Council has [mandated](https://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls) that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, Braintree has updated its services to require TLS 1.2 for all HTTPS connections. Braintrees require HTTP/1.1 for all connections. Please see our [technical documentation](https://github.com/paypal/tls-update) for more information.** + +## Dependencies + +The following PHP extensions are required: + +* curl +* dom +* hash +* openssl +* xmlwriter + +PHP version >= 7.3 is required. The Braintree PHP SDK is tested against PHP versions 7.3 and 7.4, and 8.0. + +_The PHP core development community has released [End-of-Life branches](https://www.php.net/eol.php) for PHP versions 5.4 - 7.2, and are no longer receiving security updates. As a result, Braintree does not support these versions of PHP._ + +## Versions + +Braintree employs a deprecation policy for our SDKs. For more information on the statuses of an SDK check our [developer docs](https://developer.paypal.com/braintree/docs/reference/general/server-sdk-deprecation-policy). + +| Major version number | Status | Released | Deprecated | Unsupported | +| -------------------- | ------ | -------- | ---------- | ----------- | +| 6.x.x | Active | March 2021 | TBA | TBA | +| 5.x.x | Inactive | March 2020 | March 2023 | March 2024 | +| 4.x.x | Inactive | May 2019 | March 2022 | March 2023 | +| 3.x.x | Inactive | May 2015 | March 2022 | March 2023 | + +## Documentation + + * [Official documentation](https://developer.paypal.com/braintree/docs/start/hello-server/php) + +Updating from an Inactive, Deprecated, or Unsupported version of this SDK? Check our [Migration Guide](https://developer.paypal.com/braintree/docs/reference/general/server-sdk-migration-guide/php) for tips. + +## Quick Start Example + +```php + 'sandbox', + 'merchantId' => 'your_merchant_id', + 'publicKey' => 'your_public_key', + 'privateKey' => 'your_private_key' +]); + +// or like this: +$config = new Braintree\Configuration([ + 'environment' => 'sandbox', + 'merchantId' => 'your_merchant_id', + 'publicKey' => 'your_public_key', + 'privateKey' => 'your_private_key' +]); +$gateway = new Braintree\Gateway($config) + +// Then, create a transaction: +$result = $gateway->transaction()->sale([ + 'amount' => '10.00', + 'paymentMethodNonce' => $nonceFromTheClient, + 'deviceData' => $deviceDataFromTheClient, + 'options' => [ 'submitForSettlement' => True ] +]); + +if ($result->success) { + print_r("success!: " . $result->transaction->id); +} else if ($result->transaction) { + print_r("Error processing transaction:"); + print_r("\n code: " . $result->transaction->processorResponseCode); + print_r("\n text: " . $result->transaction->processorResponseText); +} else { + foreach($result->errors->deepAll() AS $error) { + print_r($error->code . ": " . $error->message . "\n"); + } +} +``` + +## Namespacing + +As of major version 5.x.x, only PSR-4 namespacing is supported. This means you'll have to reference classes using PSR-4 namespacing: + +```php +$gateway = new Braintree\Gateway([ + 'environment' => 'sandbox', + 'merchantId' => 'your_merchant_id', + 'publicKey' => 'your_public_key', + 'privateKey' => 'your_private_key' +]); + +// or + +$config = new Braintree\Configuration([ + 'environment' => 'sandbox', + 'merchantId' => 'your_merchant_id', + 'publicKey' => 'your_public_key', + 'privateKey' => 'your_private_key' +]); +$gateway = new Braintree\Gateway($config) +``` + +## Google App Engine Support + +When using Google App Engine include the curl extention in your `php.ini` file (see [#190](https://github.com/braintree/braintree_php/issues/190) for more information): + +```ini +extension = "curl.so" +``` + +and turn off accepting gzip responses: + +```php +$gateway = new Braintree\Gateway([ + 'environment' => 'sandbox', + // ... + 'acceptGzipEncoding' => false, +]); +``` + +## Developing (Docker) + +The `Makefile` and `Dockerfile` will build an image containing the dependencies and drop you to a terminal where you can run tests. + +``` +make +``` + +## Linting + +The Rakefile includes commands to run [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) and [PHP Code Beautifier & Fixer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically). To run the linter commands use rake: + +```sh +rake lint:fix # runs the auto-fixer first, then sniffs for any remaining code smells +rake lint:sniff[y] # gives a detailed report of code smells +``` + +## Testing + +The unit specs can be run by anyone on any system, but the integration specs are meant to be run against a local development server of our gateway code. These integration specs are not meant for public consumption and will likely fail if run on your system. To run unit tests use rake: `rake test:unit`. + +To lint and run all tests, use rake: `rake test`. + +## License + +See the LICENSE file. diff --git a/upload/system/storage/vendor/braintree/braintree_php/composer.json b/upload/system/storage/vendor/braintree/braintree_php/composer.json new file mode 100644 index 00000000000..d229c49dd82 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/composer.json @@ -0,0 +1,34 @@ +{ + "name": "braintree/braintree_php", + "type": "library", + "description": "Braintree PHP Client Library", + "license": "MIT", + "authors": [ + { + "name": "Braintree", + "homepage": "https://www.braintreepayments.com" + } + ], + "require": { + "php": ">=7.3.0", + "ext-curl": "*", + "ext-dom": "*", + "ext-hash": "*", + "ext-openssl": "*", + "ext-xmlwriter": "*" + }, + "require-dev": { + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "^3.0" + }, + "autoload": { + "psr-4": { + "Braintree\\": "lib/Braintree" + } + }, + "autoload-dev": { + "psr-4": { + "Test\\": "tests" + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php new file mode 100644 index 00000000000..15213b1acb1 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php @@ -0,0 +1,33 @@ += 7.3.0 required'); +} + +/** + * Braintree PHP Library + * Creates class_aliases for old class names replaced by PSR-4 Namespaces + */ +class Braintree +{ + /** + * Checks for required dependencies + * + * @throws Braintree/Exception With the missing extension + * + * @return void + */ + public static function requireDependencies() + { + $requiredExtensions = ['xmlwriter', 'openssl', 'dom', 'hash', 'curl']; + foreach ($requiredExtensions as $ext) { + if (!extension_loaded($ext)) { + throw new Braintree\Exception('The Braintree library requires the ' . $ext . ' extension.'); + } + } + } +} + +Braintree::requireDependencies(); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php new file mode 100644 index 00000000000..a779f933ccf --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php @@ -0,0 +1,47 @@ +_attributes = $disputeAttribs; + } + + /** + * Creates an instance of an AccountUpdaterDailyReport from given attributes + * + * @param array $attributes to generate new AccountUpdaterDailyReport + * + * @return AccountUpdaterDailyReport + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + $display = [ + 'reportDate', 'reportUrl' + ]; + + $displayAttributes = []; + foreach ($display as $attrib) { + $displayAttributes[$attrib] = $this->$attrib; + } + return __CLASS__ . '[' . + Util::attributesToString($displayAttributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php new file mode 100644 index 00000000000..d04ff532a03 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php @@ -0,0 +1,46 @@ +_attributes) . ']'; + } + + /** + * sets instance properties from an array of values + * + * @param array $achAttribs array of achMandate data + * + * @return void + */ + protected function _initialize($achAttribs) + { + // set the attributes + $this->_attributes = $achAttribs; + } + + /** + * factory method: returns an instance of AchMandate + * to the requesting method, with populated properties + * + * @param array $attributes response object attributes + * + * @return AchMandate + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php new file mode 100644 index 00000000000..e30e4202360 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php @@ -0,0 +1,40 @@ +_initialize($attributes); + return $instance; + } + + + /** + * static methods redirecting to gateway class + * + * @see AddOnGateway::all() + * + * @return AddOn[] + */ + public static function all() + { + return Configuration::gateway()->addOn()->all(); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php new file mode 100644 index 00000000000..e13dabc98dc --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php @@ -0,0 +1,42 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Retrieve all add ons + * + * @return AddOn[] + */ + public function all() + { + $path = $this->_config->merchantPath() . '/add_ons'; + $response = $this->_http->get($path); + + $addOns = ["addOn" => $response['addOns']]; + + return Util::extractAttributeAsArray( + $addOns, + 'addOn' + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php new file mode 100644 index 00000000000..49f90633db2 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php @@ -0,0 +1,155 @@ +id === $other->id && $this->customerId === $other->customerId); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + protected function _initialize($addressAttribs) + { + // set the attributes + $this->_attributes = $addressAttribs; + } + + /** + * Creates an instance of an Address from given attributes + * + * @param array $attributes response object attributes + * + * @return Address + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + /** + * static method redirecting to gateway class + * + * @param array $attribs containing request parameters + * + * @see AddressGateway::create() + * + * @return Result\Successful|Result\Error + */ + public static function create($attribs) + { + return Configuration::gateway()->address()->create($attribs); + } + + /** + * static method redirecting to gateway class + * + * @param array $attribs containing request parameters + * + * @see AddressGateway::createNoValidate() + * + * @throws Exception\ValidationError + * + * @return Address + */ + public static function createNoValidate($attribs) + { + return Configuration::gateway()->address()->createNoValidate($attribs); + } + + /** + * static method redirecting to gateway class + * + * @param mixed $customerOrId either a customer object or string ID of customer + * @param string $addressId optional unique identifier + * + * @see AddressGateway::delete() + * + * @return Result\Successful|Result\Error + */ + public static function delete($customerOrId = null, $addressId = null) + { + return Configuration::gateway()->address()->delete($customerOrId, $addressId); + } + + /** + * static method redirecting to gateway class + * + * @param mixed $customerOrId either a customer object or string ID of customer + * @param string $addressId optional unique identifier + * + * @see AddressGateway::find() + * + * @throws Exception\NotFound + * + * @return Address + */ + public static function find($customerOrId, $addressId) + { + return Configuration::gateway()->address()->find($customerOrId, $addressId); + } + + /** + * static method redirecting to gateway class + * + * @param mixed $customerOrId (only used in call) + * @param string $addressId (only used in call) + * @param array $attributes containing request parameters + * + * @see AddressGateway::update() + * + * @return Result\Successful|Result\Error + */ + public static function update($customerOrId, $addressId, $attributes) + { + return Configuration::gateway()->address()->update($customerOrId, $addressId, $attributes); + } + + /** + * static method redirecting to gateway class + * + * @param mixed $customerOrId (only used in call) + * @param string $addressId (only used in call) + * @param array $attributes containing request parameters + * + * @see AddressGateway::updateNoValidate() + * + * @throws Exception\ValidationsFailed + * + * @return Address + */ + public static function updateNoValidate($customerOrId, $addressId, $attributes) + { + return Configuration::gateway()->address()->updateNoValidate($customerOrId, $addressId, $attributes); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php new file mode 100644 index 00000000000..37d9e902fc4 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php @@ -0,0 +1,279 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + + /** + * Create an Address + * + * @param array $attribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function create($attribs) + { + Util::verifyKeys(self::createSignature(), $attribs); + $customerId = isset($attribs['customerId']) ? + $attribs['customerId'] : + null; + + $this->_validateCustomerId($customerId); + unset($attribs['customerId']); + try { + return $this->_doCreate( + '/customers/' . $customerId . '/addresses', + ['address' => $attribs] + ); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'Customer ' . $customerId . ' not found.' + ); + } + } + + /** + * attempts the create operation assuming all data will validate + * returns a Address object instead of a Result + * + * @param array $attribs containing request parameters + * + * @throws Exception\ValidationError + * + * @return Address + */ + public function createNoValidate($attribs) + { + $result = $this->create($attribs); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * delete an address by id + * + * @param mixed $customerOrId either a customer object or string ID of customer + * @param string $addressId optional unique identifier + * + * @return Result\Successful|Result\Error + */ + public function delete($customerOrId = null, $addressId = null) + { + $this->_validateId($addressId); + $customerId = $this->_determineCustomerId($customerOrId); + $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId; + $this->_http->delete($path); + return new Result\Successful(); + } + + /** + * find an address by id + * + * Finds the address with the given addressId that is associated + * to the given customerOrId. + * If the address cannot be found, a NotFound exception will be thrown. + * + * @param mixed $customerOrId either a customer object or string ID of customer + * @param string $addressId optional unique identifier + * + * @throws Exception\NotFound + * + * @return Address + */ + public function find($customerOrId, $addressId) + { + + $customerId = $this->_determineCustomerId($customerOrId); + $this->_validateId($addressId); + + try { + $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId; + $response = $this->_http->get($path); + return Address::factory($response['address']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'address for customer ' . $customerId . + ' with id ' . $addressId . ' not found.' + ); + } + } + + /** + * updates the address record + * + * if calling this method in context, + * customerOrId is the 2nd attribute, addressId 3rd. + * customerOrId & addressId are not sent in object context. + * + * @param mixed $customerOrId (only used in call) + * @param string $addressId (only used in call) + * @param array $attributes containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function update($customerOrId, $addressId, $attributes) + { + $this->_validateId($addressId); + $customerId = $this->_determineCustomerId($customerOrId); + Util::verifyKeys(self::updateSignature(), $attributes); + + $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId; + $response = $this->_http->put($path, ['address' => $attributes]); + + return $this->_verifyGatewayResponse($response); + } + + /** + * update an address record, assuming validations will pass + * + * if calling this method in context, + * customerOrId is the 2nd attribute, addressId 3rd. + * customerOrId & addressId are not sent in object context. + * + * @param mixed $customerOrId (only used in call) + * @param string $addressId (only used in call) + * @param array $attributes containing request parameters + * + * @throws Exception\ValidationsFailed + * + * @see Address::update() + * + * @return Address + */ + public function updateNoValidate($customerOrId, $addressId, $attributes) + { + $result = $this->update($customerOrId, $addressId, $attributes); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * creates a full array signature of a valid create request + * + * @return array gateway create request format + */ + public static function createSignature() + { + return [ + 'company', 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', + 'countryName', 'customerId', 'extendedAddress', 'firstName', + 'lastName', 'locality', 'postalCode', 'region', 'streetAddress' + ]; + } + + /** + * creates a full array signature of a valid update request + * + * @return array gateway update request format + */ + public static function updateSignature() + { + return self::createSignature(); + } + + /** + * verifies that a valid address id is being used + * + * @param string $id address id + * + * @throws InvalidArgumentException + * + * @return self + */ + private function _validateId($id = null) + { + if (empty($id) || trim($id) == "") { + throw new InvalidArgumentException( + 'expected address id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { + throw new InvalidArgumentException( + $id . ' is an invalid address id.' + ); + } + } + + /** + * verifies that a valid customer id is being used + * + * @param string $id customer id + * + * @throws InvalidArgumentException + * + * @return self + */ + private function _validateCustomerId($id = null) + { + if (empty($id) || trim($id) == "") { + throw new InvalidArgumentException( + 'expected customer id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { + throw new InvalidArgumentException( + $id . ' is an invalid customer id.' + ); + } + } + + /** + * determines if a string id or Customer object was passed + * + * @param mixed $customerOrId either a customer object or string unique identifier + * + * @return string customerId + */ + private function _determineCustomerId($customerOrId) + { + $customerId = ($customerOrId instanceof Customer) ? $customerOrId->id : $customerOrId; + $this->_validateCustomerId($customerId); + return $customerId; + } + + private function _doCreate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + private function _verifyGatewayResponse($response) + { + if (isset($response['address'])) { + // return a populated instance of Address + return new Result\Successful( + Address::factory($response['address']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected address or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php new file mode 100644 index 00000000000..3137dc4df48 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php @@ -0,0 +1,82 @@ + + */ +class ApplePayCard extends Base +{ + // Card Type + const AMEX = 'Apple Pay - American Express'; + const MASTER_CARD = 'Apple Pay - MasterCard'; + const VISA = 'Apple Pay - Visa'; + + /* instance methods */ + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * checks whether the card is expired based on the current date + * + * @return boolean + */ + public function isExpired() + { + return $this->expired; + } + + /** + * factory method: returns an instance of ApplePayCard + * to the requesting method, with populated properties + * + * @param mixed $attributes of the ApplePayCard object + * + * @return ApplePayCard + */ + public static function factory($attributes) + { + $defaultAttributes = [ + 'expirationMonth' => '', + 'expirationYear' => '', + 'last4' => '', + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } + + /** + * sets instance properties from an array of values + * + * @param array $applePayCardAttribs array of Apple Pay card properties + * + * @return void + */ + protected function _initialize($applePayCardAttribs) + { + // set the attributes + $this->_attributes = $applePayCardAttribs; + + $subscriptionArray = []; + if (isset($applePayCardAttribs['subscriptions'])) { + foreach ($applePayCardAttribs['subscriptions'] as $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php new file mode 100644 index 00000000000..e5548fc7040 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php @@ -0,0 +1,76 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /* + * Register a domain for apple pay + * + * @see https://developer.paypal.com/braintree/docs/guides/apple-pay/configuration#domain-registration + * + * @param string $domain to be registered + * + * @return Result\Successful|Result\Error + */ + public function registerDomain($domain) + { + $path = $this->_config->merchantPath() . '/processing/apple_pay/validate_domains'; + $response = $this->_http->post($path, ['url' => $domain]); + if (array_key_exists('response', $response) && $response['response']['success']) { + return new Result\Successful(); + } elseif (array_key_exists('apiErrorResponse', $response)) { + return new Result\Error($response['apiErrorResponse']); + } + } + + /* + * Unregister a domain for apple pay + * + * @param string $domain to be unregistered + * + * @return Result\Successful + */ + public function unregisterDomain($domain) + { + $path = $this->_config->merchantPath() . '/processing/apple_pay/unregister_domain'; + $this->_http->delete($path, ['url' => $domain]); + return new Result\Successful(); + } + + /* + * Retrieve a list of all registered domains for apple pay + * + * @return Result\Successful|Result\Error + */ + public function registeredDomains() + { + $path = $this->_config->merchantPath() . '/processing/apple_pay/registered_domains'; + $response = $this->_http->get($path); + if (array_key_exists('response', $response) && array_key_exists('domains', $response['response'])) { + $options = ApplePayOptions::factory($response['response']); + return new Result\Successful($options, 'applePayOptions'); + } elseif (array_key_exists('apiErrorResponse', $response)) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected('expected response or apiErrorResponse'); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php new file mode 100644 index 00000000000..ea548bcb532 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php @@ -0,0 +1,32 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php new file mode 100644 index 00000000000..65847fcb765 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php @@ -0,0 +1,38 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($authorizationAdjustmentAttribs) + { + $this->_attributes = $authorizationAdjustmentAttribs; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php new file mode 100644 index 00000000000..f3fec514c72 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php @@ -0,0 +1,103 @@ +_attributes['globalId'])) { + $this->_attributes['graphQLId'] = $this->_attributes['globalId']; + } + if (array_key_exists($name, $this->_attributes)) { + return $this->_attributes[$name]; + } else { + trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE); + return null; + } + } + + /** + * Checks for the existence of a property stored in the private $_attributes property + * + * @param string $name of the key + * + * @return boolean + */ + public function __isset($name) + { + return isset($this->_attributes[$name]); + } + + /** + * Mutator for instance properties stored in the private $_attributes property + * + * @param string $key to be set + * @param mixed $value to be set + * + * @return mixed + */ + public function _set($key, $value) + { + $this->_attributes[$key] = $value; + } + + /** + * Implementation of JsonSerializable + * + * @return array + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->_attributes; + } + + /** + * Implementation of to an Array + * + * @return array + */ + public function toArray() + { + return array_map(function ($value) { + if (!is_array($value)) { + return method_exists($value, 'toArray') ? $value->toArray() : $value; + } else { + return $value; + } + }, $this->_attributes); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php new file mode 100644 index 00000000000..ffdc39cb5f9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php @@ -0,0 +1,38 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php new file mode 100644 index 00000000000..6853d3b8f20 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php @@ -0,0 +1,64 @@ +clientToken()->generate($params); + } + + /* + * static method redirecting to gateway class + * + * @param array $params to be verified + * + * @see ClientTokenGateway::conditionallyVerifyKeys() + * + * @return array + */ + public static function conditionallyVerifyKeys($params) + { + return Configuration::gateway()->clientToken()->conditionallyVerifyKeys($params); + } + + /* + * static method redirecting to gateway class + * + * @see ClientTokenGateway::generateWithCustomerIdSignature() + * + * @return array + * + */ + public static function generateWithCustomerIdSignature() + { + return Configuration::gateway()->clientToken()->generateWithCustomerIdSignature(); + } + + /* + * static method redirecting to gateway class + * + * @see ClientTokenGateway::generateWithoutCustomerIdSignature() + * + * @return array + */ + public static function generateWithoutCustomerIdSignature() + { + return Configuration::gateway()->clientToken()->generateWithoutCustomerIdSignature(); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php new file mode 100644 index 00000000000..dd41b5fc169 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php @@ -0,0 +1,123 @@ + + */ +class ClientTokenGateway +{ + private $_gateway; + private $_config; + private $_http; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($gateway) + { + $this->_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Generate a client token for client-side authorization + * + * @param Optional $params containing request parameters + * + * @return string client token + */ + public function generate($params = []) + { + if (!array_key_exists("version", $params)) { + $params["version"] = ClientToken::DEFAULT_VERSION; + } + + $this->conditionallyVerifyKeys($params); + $generateParams = ["client_token" => $params]; + + return $this->_doGenerate('/client_token', $generateParams); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doGenerate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + /* + * Checks if customer id is provided prior to verifying keys provided in params + * + * @param array $params to be verified + * + * @return array + */ + public function conditionallyVerifyKeys($params) + { + if (array_key_exists("customerId", $params)) { + Util::verifyKeys($this->generateWithCustomerIdSignature(), $params); + } else { + Util::verifyKeys($this->generateWithoutCustomerIdSignature(), $params); + } + } + + /* + * returns an array of keys including customer id + * + * @return array + * + */ + public function generateWithCustomerIdSignature() + { + return [ + "version", "customerId", "proxyMerchantId", + ["options" => ["makeDefault", "verifyCard", "failOnDuplicatePaymentMethod"]], + "merchantAccountId"]; + } + + /* + * returns an array of keys without customer id + * + * @return array + */ + public function generateWithoutCustomerIdSignature() + { + return ["version", "proxyMerchantId", "merchantAccountId"]; + } + + /** + * generic method for validating incoming gateway responses + * + * If the request is successful, returns a client token string. + * Otherwise, throws an InvalidArgumentException with the error + * response from the Gateway or an HTTP status code exception. + * + * @param array $response gateway response values + * + * @throws InvalidArgumentException | HTTP status code exception + * + * @return string client token + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['clientToken'])) { + return $response['clientToken']['value']; + } elseif (isset($response['apiErrorResponse'])) { + throw new InvalidArgumentException( + $response['apiErrorResponse']['message'] + ); + } else { + throw new Exception\Unexpected( + "Expected clientToken or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php new file mode 100644 index 00000000000..c26c2189997 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php @@ -0,0 +1,193 @@ +_collection[] = $value; + } + + /** + * Set index's value + * + * @param integer $index thats being set + * @param mixed $value to set at the index + * + * @throws OutOfRangeException + * + * @return mixed + */ + public function set($index, $value) + { + if ($index >= $this->count()) { + throw new OutOfRangeException('Index out of range'); + } + + $this->_collection[$index] = $value; + } + + /** + * Remove a value from the collection + * + * @param integer $index index to remove + * + * @throws OutOfRangeException if index is out of range + * + * @return mixed + */ + public function remove($index) + { + if ($index >= $this->count()) { + throw new OutOfRangeException('Index out of range'); + } + + array_splice($this->_collection, $index, 1); + } + + /** + * Return value at index + * + * @param integer $index of value to be retrieved + * + * @throws OutOfRangeException + * + * @return mixed + */ + public function get($index) + { + if ($index >= $this->count()) { + throw new OutOfRangeException('Index out of range'); + } + + return $this->_collection[$index]; + } + + /** + * Determine if index exists + * + * @param integer $index to check for existence + * + * @return boolean + */ + public function exists($index) + { + if ($index >= $this->count()) { + return false; + } + + return true; + } + /** + * Return count of items in collection + * Implements countable + * + * @return integer + */ + #[\ReturnTypeWillChange] + public function count() + { + return count($this->_collection); + } + + + /** + * Return an iterator + * Implements IteratorAggregate + * + * @return ArrayIterator + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new ArrayIterator($this->_collection); + } + + /** + * Set offset to value + * Implements ArrayAccess + * + * @param integer $offset + * @param mixed $value + * + * @see set + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + $this->set($offset, $value); + } + + /** + * Unset offset + * Implements ArrayAccess + * + * @param integer $offset + * + * @see remove + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $this->remove($offset); + } + + /** + * get an offset's value + * Implements ArrayAccess + * + * @param integer $offset + * + * @see get + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->get($offset); + } + + /** + * Determine if offset exists + * Implements ArrayAccess + * + * @param integer $offset + * + * @see exists + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return $this->exists($offset); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php new file mode 100644 index 00000000000..349f4745aae --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php @@ -0,0 +1,815 @@ + $value) { + if ($kind == 'environment') { + CredentialsParser::assertValidEnvironment($value); + $this->_environment = $value; + } + if ($kind == 'merchantId') { + $this->_merchantId = $value; + } + if ($kind == 'publicKey') { + $this->_publicKey = $value; + } + if ($kind == 'privateKey') { + $this->_privateKey = $value; + } + if ($kind == 'proxyHost') { + $this->_proxyHost = $value; + } + if ($kind == 'proxyPort') { + $this->_proxyPort = $value; + } + if ($kind == 'proxyType') { + $this->_proxyType = $value; + } + if ($kind == 'proxyUser') { + $this->_proxyUser = $value; + } + if ($kind == 'proxyPassword') { + $this->_proxyPassword = $value; + } + if ($kind == 'timeout') { + $this->_timeout = $value; + } + if ($kind == 'sslVersion') { + $this->_sslVersion = $value; + } + if ($kind == 'acceptGzipEncoding') { + $this->_acceptGzipEncoding = $value; + } + } + + if (isset($attribs['clientId']) || isset($attribs['accessToken'])) { + // phpcs:ignore Generic.Files.LineLength + if (isset($attribs['environment']) || isset($attribs['merchantId']) || isset($attribs['publicKey']) || isset($attribs['privateKey'])) { + // phpcs:ignore Generic.Files.LineLength + throw new Exception\Configuration('Cannot mix OAuth credentials (clientId, clientSecret, accessToken) with key credentials (publicKey, privateKey, environment, merchantId).'); + } + $parsedCredentials = new CredentialsParser($attribs); + + $this->_environment = $parsedCredentials->getEnvironment(); + $this->_merchantId = $parsedCredentials->getMerchantId(); + $this->_clientId = $parsedCredentials->getClientId(); + $this->_clientSecret = $parsedCredentials->getClientSecret(); + $this->_accessToken = $parsedCredentials->getAccessToken(); + } + } + + /** + * resets configuration to default + * + * @return Configuration + */ + public static function reset() + { + self::$global = new Configuration(); + } + + /** + * Create new gateway + * + * @return Gateway + */ + public static function gateway() + { + return new Gateway(self::$global); + } + + /** + * Getter/Setter for configuration environment + * + * @param string $value If provided, sets the environment + * + * @return self + */ + public static function environment($value = null) + { + if (empty($value)) { + return self::$global->getEnvironment(); + } + CredentialsParser::assertValidEnvironment($value); + self::$global->setEnvironment($value); + } + + /** + * Getter/Setter for configuration merchant ID + * + * @param string $value If provided, sets the merchantId + * + * @return self + */ + public static function merchantId($value = null) + { + if (empty($value)) { + return self::$global->getMerchantId(); + } + self::$global->setMerchantId($value); + } + + /** + * Getter/Setter for configuration public key + * + * @param string $value If provided, sets the public key + * + * @return self + */ + public static function publicKey($value = null) + { + if (empty($value)) { + return self::$global->getPublicKey(); + } + self::$global->setPublicKey($value); + } + + /** + * Getter/Setter for configuration private key + * + * @param string $value If provided, sets the private key + * + * @return self + */ + public static function privateKey($value = null) + { + if (empty($value)) { + return self::$global->getPrivateKey(); + } + self::$global->setPrivateKey($value); + } + + /** + * Sets or gets the read timeout to use for making requests. + * + * @param integer $value If provided, sets the read timeout + * + * @return integer The read timeout used for connecting to Braintree + */ + public static function timeout($value = null) + { + if (empty($value)) { + return self::$global->getTimeout(); + } + self::$global->setTimeout($value); + } + + /** + * Sets or gets the SSL version to use for making requests. See + * https://php.net/manual/en/function.curl-setopt.php for possible + * CURLOPT_SSLVERSION values. + * + * @param integer $value If provided, sets the SSL version + * + * @return integer The SSL version used for connecting to Braintree + */ + public static function sslVersion($value = null) + { + if (empty($value)) { + return self::$global->getSslVersion(); + } + self::$global->setSslVersion($value); + } + + /** + * Sets or gets the proxy host to use for connecting to Braintree + * + * @param string $value If provided, sets the proxy host + * + * @return string The proxy host used for connecting to Braintree + */ + public static function proxyHost($value = null) + { + if (empty($value)) { + return self::$global->getProxyHost(); + } + self::$global->setProxyHost($value); + } + + /** + * Sets or gets the port of the proxy to use for connecting to Braintree + * + * @param string $value If provided, sets the port of the proxy + * + * @return string The port of the proxy used for connecting to Braintree + */ + public static function proxyPort($value = null) + { + if (empty($value)) { + return self::$global->getProxyPort(); + } + self::$global->setProxyPort($value); + } + + /** + * Sets or gets the proxy type to use for connecting to Braintree. This value + * can be any of the CURLOPT_PROXYTYPE options in PHP cURL. + * + * @param string $value If provided, sets the proxy type + * + * @return string The proxy type used for connecting to Braintree + */ + public static function proxyType($value = null) + { + if (empty($value)) { + return self::$global->getProxyType(); + } + self::$global->setProxyType($value); + } + + /** + * Sets or gets the proxy user to use for connecting to Braintree. + * + * @param string $value If provided, sets the proxy username + * + * @return string The proxy type used for connecting to Braintree + */ + public static function proxyUser($value = null) + { + if (empty($value)) { + return self::$global->getProxyUser(); + } + self::$global->setProxyUser($value); + } + + /** + * Sets or gets the proxy password to use for connecting to Braintree. This value + * can be any of the CURLOPT_PROXYUSERPWD options in PHP cURL. + * + * @param string $value If provided, sets the proxy password + * + * @return string The proxy type used for connecting to Braintree + */ + public static function proxyPassword($value = null) + { + if (empty($value)) { + return self::$global->getProxyPassword(); + } + self::$global->setProxyPassword($value); + } + + /** + * Specify if the HTTP client is able to decode gzipped responses. + * + * // phpcs:ignore Generic.Files.LineLength + * + * @param boolean $value If true, will send an Accept-Encoding header with a gzip value. If false, will not send an Accept-Encoding header with a gzip value. + * + * @return boolean true if an Accept-Encoding header with a gzip value will be sent, false if not + */ + public static function acceptGzipEncoding($value = null) + { + if (is_null($value)) { + return self::$global->getAcceptGzipEncoding(); + } + self::$global->setAcceptGzipEncoding($value); + } + + //phpcs:ignore + public static function assertGlobalHasAccessTokenOrKeys() + { + self::$global->assertHasAccessTokenOrKeys(); + } + + /* + * Check if configuration has an access token, or api keys + * + * @throws Exception\Configuration + * + * @return self + */ + public function assertHasAccessTokenOrKeys() + { + if (empty($this->_accessToken)) { + if (empty($this->_merchantId)) { + // phpcs:ignore Generic.Files.LineLength + throw new Exception\Configuration('Braintree\\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\\Gateway).'); + } elseif (empty($this->_environment)) { + throw new Exception\Configuration('Braintree\\Configuration::environment needs to be set.'); + } elseif (empty($this->_publicKey)) { + throw new Exception\Configuration('Braintree\\Configuration::publicKey needs to be set.'); + } elseif (empty($this->_privateKey)) { + throw new Exception\Configuration('Braintree\\Configuration::privateKey needs to be set.'); + } + } + } + + /* + * Check if configuration has a client id and secret + * + * @throws Exception\Configuration + * + * @return self + */ + public function assertHasClientCredentials() + { + $this->assertHasClientId(); + $this->assertHasClientSecret(); + } + + /* + * Check if configuration has a client id + * + * @throws Exception\Configuration + * + * @return self + */ + public function assertHasClientId() + { + if (empty($this->_clientId)) { + throw new Exception\Configuration('clientId needs to be passed to Braintree\\Gateway.'); + } + } + + /* + * Check if configuration has a client secret + * + * @throws Exception\Configuration + * + * @return self + */ + public function assertHasClientSecret() + { + if (empty($this->_clientSecret)) { + throw new Exception\Configuration('clientSecret needs to be passed to Braintree\\Gateway.'); + } + } + + /* + * Getter function + * + * @return string environment + */ + public function getEnvironment() + { + return $this->_environment; + } + + /* + * Getter function + * + * @return string merchant id + */ + public function getMerchantId() + { + return $this->_merchantId; + } + + /* + * Getter function + * + * @return string public key + */ + public function getPublicKey() + { + return $this->_publicKey; + } + + /* + * Getter function + * + * @return string client id + */ + public function getClientId() + { + return $this->_clientId; + } + + /* + * Getter function + * + * @return string private key + */ + public function getPrivateKey() + { + return $this->_privateKey; + } + + /* + * Getter function + * + * @return string client secret + */ + public function getClientSecret() + { + return $this->_clientSecret; + } + + /* + * Getter function + * + * @return string proxy host + */ + public function getProxyHost() + { + return $this->_proxyHost; + } + /* + * Getter function + * + * @return string proxy port + */ + public function getProxyPort() + { + return $this->_proxyPort; + } + + + /* + * Getter function + * + * @return string proxy type + */ + public function getProxyType() + { + return $this->_proxyType; + } + + /* + * Getter function + * + * @return string proxy username + */ + public function getProxyUser() + { + return $this->_proxyUser; + } + + /* + * Getter function + * + * @return string proxy password + */ + public function getProxyPassword() + { + return $this->_proxyPassword; + } + + /* + * Getter function + * + * @return int timeout + */ + public function getTimeout() + { + return $this->_timeout; + } + + /* + * Getter function + * + * @return string ssl version + */ + public function getSslVersion() + { + return $this->_sslVersion; + } + + /* + * Getter function + * + * @return bool + */ + public function getAcceptGzipEncoding() + { + return $this->_acceptGzipEncoding; + } + + //phpcs:disable PEAR.Commenting + /** + * Do not use this method directly. Pass in the environment to the constructor. + */ + public function setEnvironment($value) + { + $this->_environment = $value; + } + + /** + * Do not use this method directly. Pass in the merchantId to the constructor. + */ + public function setMerchantId($value) + { + $this->_merchantId = $value; + } + + /** + * Do not use this method directly. Pass in the publicKey to the constructor. + */ + public function setPublicKey($value) + { + $this->_publicKey = $value; + } + + /** + * Do not use this method directly. Pass in the privateKey to the constructor. + */ + public function setPrivateKey($value) + { + $this->_privateKey = $value; + } + + private function setProxyHost($value) + { + $this->_proxyHost = $value; + } + + private function setProxyPort($value) + { + $this->_proxyPort = $value; + } + + private function setProxyType($value) + { + $this->_proxyType = $value; + } + + private function setProxyUser($value) + { + $this->_proxyUser = $value; + } + + private function setProxyPassword($value) + { + $this->_proxyPassword = $value; + } + + private function setTimeout($value) + { + $this->_timeout = $value; + } + + private function setSslVersion($value) + { + $this->_sslVersion = $value; + } + + private function setAcceptGzipEncoding($value) + { + $this->_acceptGzipEncoding = $value; + } + //phpcs:enable PEAR.Commenting + + /* + * Getter function + * + * @return string access token + */ + public function getAccessToken() + { + return $this->_accessToken; + } + + /* + * Checks for presence of access token + * + * @return bool + */ + public function isAccessToken() + { + return !empty($this->_accessToken); + } + + /* + * Checks for presence of client credentials + * + * @return bool + */ + public function isClientCredentials() + { + return !empty($this->_clientId); + } + + /** + * returns the base braintree gateway URL based on config values + * + * @return string braintree gateway URL + */ + public function baseUrl() + { + return sprintf('%s://%s:%d', $this->protocol(), $this->serverName(), $this->portNumber()); + } + + /** + * returns the base URL for Braintree's GraphQL endpoint based on config values + * + * @return string Braintree GraphQL URL + */ + public function graphQLBaseUrl() + { + return sprintf('%s://%s:%d/graphql', $this->protocol(), $this->graphQLServerName(), $this->graphQLPortNumber()); + } + + /** + * sets the merchant path based on merchant ID + * + * @return string merchant path uri + */ + public function merchantPath() + { + return '/merchants/' . $this->_merchantId; + } + + /** + * sets the physical path for the location of the CA certs + * + * @param string $sslPath optional + * + * @return string filepath + */ + public function caFile($sslPath = null) + { + $sslPath = $sslPath ? $sslPath : DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . + 'ssl' . DIRECTORY_SEPARATOR; + $caPath = __DIR__ . $sslPath . 'api_braintreegateway_com.ca.crt'; + + if (!file_exists($caPath)) { + throw new Exception\SSLCaFileNotFound(); + } + + return $caPath; + } + + /** + * returns the port number depending on environment + * + * @return int portnumber + */ + public function portNumber() + { + if ($this->sslOn()) { + return 443; + } + return getenv("GATEWAY_PORT") ? getenv("GATEWAY_PORT") : 3000; + } + + /** + * returns the port number depending on environment + * + * @return integer graphql portnumber + */ + public function graphQLPortNumber() + { + if ($this->sslOn()) { + return 443; + } + return getenv("GRAPHQL_PORT") ?: 8080; + } + + /** + * Specifies whether or not a proxy is properly configured + * + * @return boolean true if a proxy is configured properly, false if not + */ + public function isUsingProxy() + { + $proxyHost = $this->getProxyHost(); + $proxyPort = $this->getProxyPort(); + return !empty($proxyHost) && !empty($proxyPort); + } + + /** + * Specified whether or not a username and password have been provided for + * use with an authenticated proxy + * + * @return boolean true if both proxyUser and proxyPassword are present + */ + public function isAuthenticatedProxy() + { + $proxyUser = $this->getProxyUser(); + $proxyPwd = $this->getProxyPassword(); + return !empty($proxyUser) && !empty($proxyPwd); + } + + /** + * returns http protocol depending on environment + * + * @return string http || https + */ + public function protocol() + { + return $this->sslOn() ? 'https' : 'http'; + } + + /** + * returns gateway server name depending on environment + * + * @return string server domain name + */ + public function serverName() + { + switch ($this->_environment) { + case 'production': + $serverName = 'api.braintreegateway.com'; + break; + case 'qa': + $serverName = 'gateway.qa.braintreepayments.com'; + break; + case 'sandbox': + $serverName = 'api.sandbox.braintreegateway.com'; + break; + case 'development': + case 'integration': + default: + $serverName = 'localhost'; + break; + } + + return $serverName; + } + + /** + * returns Braintree GraphQL server name depending on environment + * + * @return string graphql domain name + */ + public function graphQLServerName() + { + switch ($this->_environment) { + case 'production': + $graphQLServerName = 'payments.braintree-api.com'; + break; + case 'qa': + $graphQLServerName = 'payments-qa.dev.braintree-api.com'; + break; + case 'sandbox': + $graphQLServerName = 'payments.sandbox.braintree-api.com'; + break; + case 'development': + case 'integration': + default: + $graphQLServerName = 'graphql.bt.local'; + break; + } + + return $graphQLServerName; + } + + /** + * returns boolean indicating SSL is on or off for this session, + * depending on environment + * + * @return boolean + */ + public function sslOn() + { + switch ($this->_environment) { + case 'integration': + case 'development': + $ssl = false; + break; + case 'production': + case 'qa': + case 'sandbox': + default: + $ssl = true; + break; + } + + return $ssl; + } + + /** + * log message to default logger + * + * @param string $message to log + * + * @return string + */ + public function logMessage($message) + { + error_log('[Braintree] ' . $message); + } +} +Configuration::reset(); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php new file mode 100644 index 00000000000..2837e8b19ec --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php @@ -0,0 +1,34 @@ +_initialize($attributes); + $instance->_attributes['merchantId'] = $instance->_attributes['merchantPublicId']; + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php new file mode 100644 index 00000000000..645c4b3b9f8 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php @@ -0,0 +1,34 @@ +_initialize($attributes); + $instance->_attributes['merchantId'] = $instance->_attributes['merchantPublicId']; + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php new file mode 100644 index 00000000000..e3e9781c65d --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php @@ -0,0 +1,179 @@ + $value) { + if ($kind == 'clientId') { + $this->_clientId = $value; + } + if ($kind == 'clientSecret') { + $this->_clientSecret = $value; + } + if ($kind == 'accessToken') { + $this->_accessToken = $value; + } + } + $this->parse(); + } + + private static $_validEnvironments = [ + 'development', + 'integration', + 'sandbox', + 'production', + 'qa', + ]; + + /* + * Parses environment credentials and sets the _environment variable + * + * @return object|Exception\Configuration + */ + public function parse() + { + $environments = []; + if (!empty($this->_clientId)) { + $environments[] = ['clientId', $this->_parseClientCredential('clientId', $this->_clientId, 'client_id')]; + } + if (!empty($this->_clientSecret)) { + // phpcs:ignore Generic.Files.LineLength + $environments[] = ['clientSecret', $this->_parseClientCredential('clientSecret', $this->_clientSecret, 'client_secret')]; + } + if (!empty($this->_accessToken)) { + $environments[] = ['accessToken', $this->_parseAccessToken()]; + } + + $checkEnv = $environments[0]; + foreach ($environments as $env) { + if ($env[1] !== $checkEnv[1]) { + throw new Exception\Configuration( + 'Mismatched credential environments: ' . $checkEnv[0] . ' environment is ' . $checkEnv[1] . + ' and ' . $env[0] . ' environment is ' . $env[1] + ); + } + } + + self::assertValidEnvironment($checkEnv[1]); + $this->_environment = $checkEnv[1]; + } + + /* + * Checks that the environment passed is valid + * + * @param string $environment + * + * @return self|Exception\Configuration + */ + public static function assertValidEnvironment($environment) + { + if (!in_array($environment, self::$_validEnvironments)) { + throw new Exception\Configuration('"' . + $environment . '" is not a valid environment.'); + } + } + + private function _parseClientCredential($credentialType, $value, $expectedValuePrefix) + { + $explodedCredential = explode('$', $value); + if (sizeof($explodedCredential) != 3) { + $message = 'Incorrect ' . $credentialType . ' format. Expected: type$environment$token'; + throw new Exception\Configuration($message); + } + + $gotValuePrefix = $explodedCredential[0]; + $environment = $explodedCredential[1]; + $token = $explodedCredential[2]; + + if ($gotValuePrefix != $expectedValuePrefix) { + throw new Exception\Configuration('Value passed for ' . $credentialType . ' is not a ' . $credentialType); + } + + return $environment; + } + + private function _parseAccessToken() + { + $accessTokenExploded = explode('$', $this->_accessToken); + if (sizeof($accessTokenExploded) != 4) { + $message = 'Incorrect accessToken syntax. Expected: type$environment$merchant_id$token'; + throw new Exception\Configuration($message); + } + + $gotValuePrefix = $accessTokenExploded[0]; + $environment = $accessTokenExploded[1]; + $merchantId = $accessTokenExploded[2]; + $token = $accessTokenExploded[3]; + + if ($gotValuePrefix != 'access_token') { + throw new Exception\Configuration('Value passed for accessToken is not an accessToken'); + } + + $this->_merchantId = $merchantId; + return $environment; + } + + /* + * Getter methid to retrieve the ClientId + * + * @return string + */ + public function getClientId() + { + return $this->_clientId; + } + + /* + * Getter methid to retrieve the ClientSecret + * + * @return string + */ + public function getClientSecret() + { + return $this->_clientSecret; + } + + /* + * Getter methid to retrieve the AccessToken + * + * @return string + */ + public function getAccessToken() + { + return $this->_accessToken; + } + + /* + * Getter methid to retrieve the Environment + * + * @return string + */ + public function getEnvironment() + { + return $this->_environment; + } + + /* + * Getter methid to retrieve the Merchant Id + * + * @return string + */ + public function getMerchantId() + { + return $this->_merchantId; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php new file mode 100644 index 00000000000..d88229af2f2 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php @@ -0,0 +1,428 @@ + + * For more detailed information on CreditCard verifications, see {@link https://developer.paypal.com/braintree/docs/reference/response/credit-card-verification our developer docs} + */ +class CreditCard extends Base +{ + // Card Type + const AMEX = 'American Express'; + const CARTE_BLANCHE = 'Carte Blanche'; + const CHINA_UNION_PAY = 'China UnionPay'; + const DINERS_CLUB_INTERNATIONAL = 'Diners Club'; + const DISCOVER = 'Discover'; + const ELO = 'Elo'; + const JCB = 'JCB'; + const LASER = 'Laser'; + const MAESTRO = 'Maestro'; + const UK_MAESTRO = 'UK Maestro'; + const MASTER_CARD = 'MasterCard'; + const SOLO = 'Solo'; + const SWITCH_TYPE = 'Switch'; + const VISA = 'Visa'; + const UNKNOWN = 'Unknown'; + + // Credit card origination location + const INTERNATIONAL = "international"; + const US = "us"; + + const PREPAID_YES = 'Yes'; + const PREPAID_NO = 'No'; + const PREPAID_UNKNOWN = 'Unknown'; + + const PAYROLL_YES = 'Yes'; + const PAYROLL_NO = 'No'; + const PAYROLL_UNKNOWN = 'Unknown'; + + const HEALTHCARE_YES = 'Yes'; + const HEALTHCARE_NO = 'No'; + const HEALTHCARE_UNKNOWN = 'Unknown'; + + const DURBIN_REGULATED_YES = 'Yes'; + const DURBIN_REGULATED_NO = 'No'; + const DURBIN_REGULATED_UNKNOWN = 'Unknown'; + + const DEBIT_YES = 'Yes'; + const DEBIT_NO = 'No'; + const DEBIT_UNKNOWN = 'Unknown'; + + const COMMERCIAL_YES = 'Yes'; + const COMMERCIAL_NO = 'No'; + const COMMERCIAL_UNKNOWN = 'Unknown'; + + const COUNTRY_OF_ISSUANCE_UNKNOWN = "Unknown"; + const ISSUING_BANK_UNKNOWN = "Unknown"; + const PRODUCT_ID_UNKNOWN = "Unknown"; + + /* instance methods */ + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * checks whether the card is expired based on the current date + * + * @return boolean + */ + public function isExpired() + { + return $this->expired; + } + + /** + * checks whether the card is associated with venmo sdk + * + * @return boolean + */ + public function isVenmoSdk() + { + return $this->venmoSdk; + } + + /** + * sets instance properties from an array of values + * + * @param array $creditCardAttribs array of creditcard data + * + * @return void + */ + protected function _initialize($creditCardAttribs) + { + // set the attributes + $this->_attributes = $creditCardAttribs; + + // map each address into its own object + $billingAddress = isset($creditCardAttribs['billingAddress']) ? + Address::factory($creditCardAttribs['billingAddress']) : + null; + + $subscriptionArray = []; + if (isset($creditCardAttribs['subscriptions'])) { + foreach ($creditCardAttribs['subscriptions'] as $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + $this->_set('billingAddress', $billingAddress); + $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); + $this->_set('maskedNumber', $this->bin . '******' . $this->last4); + + if (isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) { + $verifications = $creditCardAttribs['verifications']; + usort($verifications, [$this, '_compareCreatedAtOnVerifications']); + + $this->_set('verification', CreditCardVerification::factory($verifications[0])); + } + } + + private function _compareCreatedAtOnVerifications($verificationAttrib1, $verificationAttrib2) + { + return ($verificationAttrib2['createdAt'] < $verificationAttrib1['createdAt']) ? -1 : 1; + } + + /** + * returns false if comparing object is not a CreditCard, + * or is a CreditCard with a different id + * + * @param object $otherCreditCard customer to compare against + * + * @return boolean + */ + public function isEqual($otherCreditCard) + { + return !($otherCreditCard instanceof self) ? false : $this->token === $otherCreditCard->token; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * Creates an instance of an CreditCard from given attributes + * + * @param array $attributes response object attributes + * + * @return CreditCard + */ + public static function factory($attributes) + { + $defaultAttributes = [ + 'bin' => '', + 'expirationMonth' => '', + 'expirationYear' => '', + 'last4' => '', + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } + + /** + * static method redirecting to gateway class + * + * @param array $attribs containing request parameters + * + * @see CreditCardGateway::create() + * + * @throws Exception\ValidationError + * + * @return Result\Successful|Result\Error + */ + public static function create($attribs) + { + return Configuration::gateway()->creditCard()->create($attribs); + } + + /** + * Attempts the create operation assuming all data will validate + * returns a CreditCard object instead of a Result + * + * @param array $attribs containing request parameters + * + * @throws Exception\ValidationError + * + * @return CreditCard + */ + public static function createNoValidate($attribs) + { + return Configuration::gateway()->creditCard()->createNoValidate($attribs); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function createCreditCardUrl() + { + return Configuration::gateway()->creditCard()->createCreditCardUrl(); + } + + /** + * Returns a ResourceCollection of expired credit cards + * + * @return ResourceCollection + */ + public static function expired() + { + return Configuration::gateway()->creditCard()->expired(); + } + + /** + * Returns a ResourceCollection of expired credit cards + * + * @param string $ids containing credit card IDs + * + * @return ResourceCollection + */ + public static function fetchExpired($ids) + { + return Configuration::gateway()->creditCard()->fetchExpired($ids); + } + + /** + * Returns a ResourceCollection of credit cards expiring between start/end + * + * @param string $startDate the start date of search + * @param string $endDate the end date of search + * + * @return ResourceCollection + */ + public static function expiringBetween($startDate, $endDate) + { + return Configuration::gateway()->creditCard()->expiringBetween($startDate, $endDate); + } + + /** + * Returns a ResourceCollection of credit cards expiring between start/end given a set of IDs + * + * @param string $startDate the start date of search + * @param string $endDate the end date of search + * @param string $ids containing ids to search + * + * @return ResourceCollection + */ + public static function fetchExpiring($startDate, $endDate, $ids) + { + return Configuration::gateway()->creditCard()->fetchExpiring($startDate, $endDate, $ids); + } + + /** + * Find a creditcard by token + * + * @param string $token credit card unique id + * + * @throws Exception\NotFound + * + * @return CreditCard + */ + public static function find($token) + { + return Configuration::gateway()->creditCard()->find($token); + } + + /** + * Convert a payment method nonce to a credit card + * + * @param string $nonce payment method nonce + * + * @throws Exception\NotFound + * + * @return CreditCard + */ + public static function fromNonce($nonce) + { + return Configuration::gateway()->creditCard()->fromNonce($nonce); + } + + /** + * Create a credit on the card for the passed transaction + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public static function credit($token, $transactionAttribs) + { + return Configuration::gateway()->creditCard()->credit($token, $transactionAttribs); + } + + /** + * Create a credit on this card, assuming validations will pass + * + * Returns a Transaction object on success + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @throws Exception\ValidationError + * + * @return Transaction + */ + public static function creditNoValidate($token, $transactionAttribs) + { + return Configuration::gateway()->creditCard()->creditNoValidate($token, $transactionAttribs); + } + + /** + * Create a new sale for the current card + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public static function sale($token, $transactionAttribs) + { + return Configuration::gateway()->creditCard()->sale($token, $transactionAttribs); + } + + /** + * Create a new sale using this card, assuming validations will pass + * + * Returns a Transaction object on success + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @throws Exception\ValidationsFailed + * + * @return Transaction + */ + public static function saleNoValidate($token, $transactionAttribs) + { + return Configuration::gateway()->creditCard()->saleNoValidate($token, $transactionAttribs); + } + + /** + * Updates the creditcard record + * + * If calling this method in context, $token + * is the 2nd attribute. $token is not sent in object context. + * + * @param string $token (optional) + * @param array $attributes containing request parameters + * + * @return Result\Successful|Result\Error + */ + public static function update($token, $attributes) + { + return Configuration::gateway()->creditCard()->update($token, $attributes); + } + + /** + * Update a creditcard record, assuming validations will pass + * + * If calling this method in context, $token + * is the 2nd attribute. $token is not sent in object context. + * returns a CreditCard object on success + * + * @param string $token (optional) + * @param array $attributes containing request parameters + * + * @return CreditCard + * + * @throws Exception\ValidationsFailed + */ + public static function updateNoValidate($token, $attributes) + { + return Configuration::gateway()->creditCard()->updateNoValidate($token, $attributes); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function updateCreditCardUrl() + { + return Configuration::gateway()->creditCard()->updateCreditCardUrl(); + } + + /** + * Delete a credit card record + * + * @param string $token credit card identifier + * + * @return Result + */ + public static function delete($token) + { + return Configuration::gateway()->creditCard()->delete($token); + } + + /** + * All credit card types in an array + * + * @return array + */ + public static function allCardTypes() + { + return [ + CreditCard::AMEX, + CreditCard::CARTE_BLANCHE, + CreditCard::CHINA_UNION_PAY, + CreditCard::DINERS_CLUB_INTERNATIONAL, + CreditCard::DISCOVER, + CreditCard::ELO, + CreditCard::JCB, + CreditCard::LASER, + CreditCard::MAESTRO, + CreditCard::MASTER_CARD, + CreditCard::SOLO, + CreditCard::SWITCH_TYPE, + CreditCard::VISA, + CreditCard::UNKNOWN + ]; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php new file mode 100644 index 00000000000..f9273cebdfb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php @@ -0,0 +1,469 @@ + + * For more detailed information on CreditCard verifications, see {@link https://developer.paypal.com/braintree/docs/reference/response/credit-card-verification/php our reference documentation} + */ +class CreditCardGateway +{ + private $_gateway; + private $_config; + private $_http; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($gateway) + { + $this->_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Attempts the create operation + * returns a Result on success or an Error on failure + * + * @param array $attribs containing request parameterss + * + * @throws Exception\ValidationError + * + * @return Result\Successful|Result\Error + */ + public function create($attribs) + { + Util::verifyKeys(self::createSignature(), $attribs); + return $this->_doCreate('/payment_methods', ['credit_card' => $attribs]); + } + + /** + * Attempts the create operation assuming all data will validate + * returns a CreditCard object instead of a Result + * + * @param array $attribs containing request parameters + * + * @throws Exception\ValidationError + * + * @return CreditCard + */ + public function createNoValidate($attribs) + { + $result = $this->create($attribs); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * Returns a ResourceCollection of expired credit cards + * + * @return ResourceCollection + */ + public function expired() + { + $path = $this->_config->merchantPath() . '/payment_methods/all/expired_ids'; + $response = $this->_http->post($path); + $pager = [ + 'object' => $this, + 'method' => 'fetchExpired', + 'methodArgs' => [] + ]; + + return new ResourceCollection($response, $pager); + } + + /** + * Returns a ResourceCollection of expired credit cards + * + * @param string $ids containing credit card IDs + * + * @return ResourceCollection + */ + public function fetchExpired($ids) + { + $path = $this->_config->merchantPath() . "/payment_methods/all/expired"; + $response = $this->_http->post($path, ['search' => ['ids' => $ids]]); + + return Util::extractattributeasarray( + $response['paymentMethods'], + 'creditCard' + ); + } + + /** + * Returns a ResourceCollection of credit cards expiring between start/end + * + * @param string $startDate the start date of search + * @param string $endDate the end date of search + * + * @return ResourceCollection + */ + public function expiringBetween($startDate, $endDate) + { + $start = date('mY', $startDate); + $end = date('mY', $endDate); + $query = '/payment_methods/all/expiring_ids?start=' . $start . '&end=' . $end; + $queryPath = $this->_config->merchantPath() . $query; + $response = $this->_http->post($queryPath); + $pager = [ + 'object' => $this, + 'method' => 'fetchExpiring', + 'methodArgs' => [$startDate, $endDate] + ]; + + return new ResourceCollection($response, $pager); + } + + /** + * Returns a ResourceCollection of credit cards expiring between start/end given a set of IDs + * + * @param string $startDate the start date of search + * @param string $endDate the end date of search + * @param string $ids containing ids to search + * + * @return ResourceCollection + */ + public function fetchExpiring($startDate, $endDate, $ids) + { + $start = date('mY', $startDate); + $end = date('mY', $endDate); + $query = '/payment_methods/all/expiring?start=' . $start . '&end=' . $end; + $queryPath = $this->_config->merchantPath() . $query; + $response = $this->_http->post($queryPath, ['search' => ['ids' => $ids]]); + + return Util::extractAttributeAsArray( + $response['paymentMethods'], + 'creditCard' + ); + } + + /** + * Find a creditcard by token + * + * @param string $token credit card unique id + * + * @throws Exception\NotFound + * + * @return CreditCard + */ + public function find($token) + { + $this->_validateId($token); + try { + $path = $this->_config->merchantPath() . '/payment_methods/credit_card/' . $token; + $response = $this->_http->get($path); + return CreditCard::factory($response['creditCard']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'credit card with token ' . $token . ' not found' + ); + } + } + + /** + * Convert a payment method nonce to a credit card + * + * @param string $nonce payment method nonce + * + * @throws Exception\NotFound + * + * @return CreditCard + */ + public function fromNonce($nonce) + { + $this->_validateId($nonce, "nonce"); + try { + $path = $this->_config->merchantPath() . '/payment_methods/from_nonce/' . $nonce; + $response = $this->_http->get($path); + return CreditCard::factory($response['creditCard']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'credit card with nonce ' . $nonce . ' locked, consumed or not found' + ); + } + } + + /** + * Create a credit on the card for the passed transaction + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function credit($token, $transactionAttribs) + { + $this->_validateId($token); + return Transaction::credit( + array_merge( + $transactionAttribs, + ['paymentMethodToken' => $token] + ) + ); + } + + /** + * Create a credit on this card, assuming validations will pass + * + * Returns a Transaction object on success + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @throws Exception\ValidationError + * + * @return Transaction + */ + public function creditNoValidate($token, $transactionAttribs) + { + $result = $this->credit($token, $transactionAttribs); + return Util::returnObjectOrThrowException('Braintree\Transaction', $result); + } + + /** + * Create a new sale for the current card + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function sale($token, $transactionAttribs) + { + $this->_validateId($token); + return Transaction::sale( + array_merge( + $transactionAttribs, + ['paymentMethodToken' => $token] + ) + ); + } + + /** + * Create a new sale using this card, assuming validations will pass + * + * Returns a Transaction object on success + * + * @param string $token belonging to the credit card + * @param array $transactionAttribs containing request parameters + * + * @throws Exception\ValidationsFailed + * + * @return Transaction + */ + public function saleNoValidate($token, $transactionAttribs) + { + $result = $this->sale($token, $transactionAttribs); + return Util::returnObjectOrThrowException('Braintree\Transaction', $result); + } + + /** + * Updates the creditcard record + * + * If calling this method in context, $token + * is the 2nd attribute. $token is not sent in object context. + * + * @param string $token (optional) + * @param array $attributes containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function update($token, $attributes) + { + Util::verifyKeys(self::updateSignature(), $attributes); + $this->_validateId($token); + return $this->_doUpdate('put', '/payment_methods/credit_card/' . $token, ['creditCard' => $attributes]); + } + + /** + * Update a creditcard record, assuming validations will pass + * + * If calling this method in context, $token + * is the 2nd attribute. $token is not sent in object context. + * returns a CreditCard object on success + * + * @param string $token (optional) + * @param array $attributes containing request parameters + * + * @return CreditCard + * + * @throws Exception\ValidationsFailed + */ + public function updateNoValidate($token, $attributes) + { + $result = $this->update($token, $attributes); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * Delete a credit card record + * + * @param string $token credit card identifier + * + * @return Result + */ + public function delete($token) + { + $this->_validateId($token); + $path = $this->_config->merchantPath() . '/payment_methods/credit_card/' . $token; + $this->_http->delete($path); + return new Result\Successful(); + } + + private static function baseOptions() + { + return [ + 'makeDefault', + 'skipAdvancedFraudChecking', + 'venmoSdkSession', + 'verificationAccountType', + 'verificationAmount', + 'verificationMerchantAccountId', + 'verifyCard', + ]; + } + + private static function baseSignature($options) + { + return [ + 'billingAddressId', 'cardholderName', 'cvv', 'number', + 'expirationDate', 'expirationMonth', 'expirationYear', 'token', 'venmoSdkPaymentMethodCode', + 'deviceData', 'paymentMethodNonce', + ['options' => $options], + [ + 'billingAddress' => self::billingAddressSignature() + ], + ]; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function billingAddressSignature() + { + return [ + 'firstName', + 'lastName', + 'company', + 'countryCodeAlpha2', + 'countryCodeAlpha3', + 'countryCodeNumeric', + 'countryName', + 'extendedAddress', + 'locality', + 'region', + 'postalCode', + 'streetAddress' + ]; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function createSignature() + { + $options = self::baseOptions(); + $options[] = "failOnDuplicatePaymentMethod"; + $signature = self::baseSignature($options); + $signature[] = 'customerId'; + $signature[] = self::threeDSecurePassThruSignature(); + return $signature; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function threeDSecurePassThruSignature() + { + return [ + 'threeDSecurePassThru' => [ + 'eciFlag', + 'cavv', + 'xid', + 'threeDSecureVersion', + 'authenticationResponse', + 'directoryResponse', + 'cavvAlgorithm', + 'dsTransactionId', + ] + ]; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function updateSignature() + { + $options = self::baseOptions(); + $options[] = "failOnDuplicatePaymentMethod"; + $signature = self::baseSignature($options); + $signature[] = self::threeDSecurePassThruSignature(); + + $updateExistingBillingSignature = [ + [ + 'options' => [ + 'updateExisting' + ] + ] + ]; + + foreach ($signature as $key => $value) { + if (is_array($value) and array_key_exists('billingAddress', $value)) { + // phpcs:ignore + $signature[$key]['billingAddress'] = array_merge_recursive($value['billingAddress'], $updateExistingBillingSignature); + } + } + + return $signature; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doCreate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + private function _validateId($identifier = null, $identifierType = "token") + { + if (empty($identifier)) { + throw new InvalidArgumentException( + 'expected credit card id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) { + throw new InvalidArgumentException( + $identifier . ' is an invalid credit card ' . $identifierType . '.' + ); + } + } + + private function _doUpdate($httpVerb, $subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->$httpVerb($fullPath, $params); + return $this->_verifyGatewayResponse($response); + } + + /** + * Generic method for validating incoming gateway responses + * + * Creates a new CreditCard object and encapsulates + * it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['creditCard'])) { + // return a populated instance of Address + return new Result\Successful( + CreditCard::factory($response['creditCard']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected address or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php new file mode 100644 index 00000000000..3db151e3241 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php @@ -0,0 +1,84 @@ +creditCardVerification()->create($attributes); + } + + /** + * Static method redirecting to gateway class + * + * @param array $query search parameters + * @param array $ids of verifications to search + * + * @see CreditCardVerificationGateway::fetch() + * + * @return Array of CreditCardVerification objects + */ + public static function fetch($query, $ids) + { + return Configuration::gateway()->creditCardVerification()->fetch($query, $ids); + } + + /** + * Static method redirecting to gateway class + * + * @param mixed $query search query + * + * @see CreditCardVerificationGateway::search() + * + * @return ResourceCollection + */ + public static function search($query) + { + return Configuration::gateway()->creditCardVerification()->search($query); + } + + /* + * Returns keys that are acceptable for create requests + */ + public static function createSignature() + { + return [ + ['options' => ['amount', 'merchantAccountId', 'accountType']], + ['creditCard' => + [ + 'cardholderName', 'cvv', 'number', + 'expirationDate', 'expirationMonth', 'expirationYear', + ['billingAddress' => CreditCardGateway::billingAddressSignature()] + ] + ]]; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php new file mode 100644 index 00000000000..14ad2c58ab7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php @@ -0,0 +1,102 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Creates a credit card verification using the given +attributes+. + * + * @param array $attributes containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function create($attributes) + { + $queryPath = $this->_config->merchantPath() . "/verifications"; + $response = $this->_http->post($queryPath, ['verification' => $attributes]); + return $this->_verifyGatewayResponse($response); + } + + private function _verifyGatewayResponse($response) + { + + if (isset($response['verification'])) { + return new Result\Successful( + CreditCardVerification::factory($response['verification']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected transaction or apiErrorResponse" + ); + } + } + + /** + * Retrieve a credit card verification + * + * @param array $query search parameters + * @param array $ids of verifications to search + * + * @return Array of CreditCardVerification objects + */ + public function fetch($query, $ids) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + $criteria["ids"] = CreditCardVerificationSearch::ids()->in($ids)->toparam(); + $path = $this->_config->merchantPath() . '/verifications/advanced_search'; + $response = $this->_http->post($path, ['search' => $criteria]); + + return Util::extractattributeasarray( + $response['creditCardVerifications'], + 'verification' + ); + } + + /** + * Returns a ResourceCollection of customers matching the search query. + * + * @param mixed $query search query + * + * @return ResourceCollection + */ + public function search($query) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + + $path = $this->_config->merchantPath() . '/verifications/advanced_search_ids'; + $response = $this->_http->post($path, ['search' => $criteria]); + $pager = [ + 'object' => $this, + 'method' => 'fetch', + 'methodArgs' => [$query] + ]; + + return new ResourceCollection($response, $pager); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php new file mode 100644 index 00000000000..b278ad78417 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php @@ -0,0 +1,131 @@ +== More information == + * + * See our {@link https://developer.paypal.com/braintree/docs/reference/response/customer developer docs} for information on attributes + */ +class Customer extends Base +{ + /* + * Static method redirecting to gateway class + * + * @see CustomerGateway::all() + * + * @return ResourceCollection + */ + public static function all() + { + return Configuration::gateway()->customer()->all(); + } + + /** + * Static method redirecting to gateway class + * + * @param array $query containing request params + * @param int[] $ids containing customer IDs + * + * @see CustomerGateway::fetch() + * + * @return Customer|Customer[] + */ + public static function fetch($query, $ids) + { + return Configuration::gateway()->customer()->fetch($query, $ids); + } + + /** + * Static method redirecting to gateway class + * + * @param array $attribs containing request parameters + * + * @see CustomerGateway::create() + * + * @return Result\Successful|Result\Error + */ + public static function create($attribs = []) + { + return Configuration::gateway()->customer()->create($attribs); + } + + /** + * Static method redirecting to gateway class + * + * @param array $attribs of request parameters + * + * @see CustomerGateway::createNoValidate() + * + * @throws Exception\ValidationError + * + * @return Customer + */ + public static function createNoValidate($attribs = []) + { + return Configuration::gateway()->customer()->createNoValidate($attribs); + } + + /** + * Static method redirecting to gateway class + * + * @param string $id customer Id + * @param string $associationFilterId association filter Id + * + * @see CustomerGateway::find() + * + * @throws Exception\NotFound + * + * @return Customer|boolean The customer object or false if the request fails. + */ + public static function find($id, $associationFilterId = null) + { + return Configuration::gateway()->customer()->find($id, $associationFilterId); + } + + /** + * Static method redirecting to gateway class + * + * @param integer $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @see CustomerGateway::credit() + * + * @return Result\Successful|Result\Error + */ + public static function credit($customerId, $transactionAttribs) + { + return Configuration::gateway()->customer()->credit($customerId, $transactionAttribs); + } + + /** + * Static method redirecting to gateway class + * + * @param integer $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @see CustomerGateway::creditNoValidate() + * + * @throws Exception\ValidationError + * + * @return Transaction + */ + public static function creditNoValidate($customerId, $transactionAttribs) + { + return Configuration::gateway()->customer()->creditNoValidate($customerId, $transactionAttribs); + } + + /** + * Static method redirecting to gateway class + * + * @param string $customerId unique identifier + * + * @see CustomerGateway::delete() + * + * @return Result\Successful + */ + public static function delete($customerId) + { + return Configuration::gateway()->customer()->delete($customerId); + } + + /** + * Static method redirecting to gateway class + * + * @param string $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @see CustomerGateway::sale() + * + * @return Result\Successful|Result\Error + */ + public static function sale($customerId, $transactionAttribs) + { + return Configuration::gateway()->customer()->sale($customerId, $transactionAttribs); + } + + /** + * Static method redirecting to gateway class + * + * @param string $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @see CustomerGateway::saleNoValidate() + * + * @throws Exception\ValidationsFailed + * + * @return Transaction + */ + public static function saleNoValidate($customerId, $transactionAttribs) + { + return Configuration::gateway()->customer()->saleNoValidate($customerId, $transactionAttribs); + } + + /** + * Static method redirecting to gateway class + * + * @param mixed $query search query + * + * @see CustomerGateway::search() + * + * @throws InvalidArgumentException + * + * @return ResourceCollection + */ + public static function search($query) + { + return Configuration::gateway()->customer()->search($query); + } + + /** + * Static method redirecting to gateway class + * + * @param string $customerId to be updated + * @param array $attributes containing request params + * + * @see CustomerGateway::update() + * + * @return Result\Successful|Result\Error + */ + public static function update($customerId, $attributes) + { + return Configuration::gateway()->customer()->update($customerId, $attributes); + } + + /** + * update a customer record, assuming validations will pass + * + * if calling this method in static context, customerId + * is the 2nd attribute. customerId is not sent in object context. + * returns a Customer object on success + * + * @param string $customerId unique identifier + * @param array $attributes request parameters + * + * @see CustomerGateway::updateNoValidate() + * + * @throws Exception\ValidationsFailed + * + * @return Customer + */ + public static function updateNoValidate($customerId, $attributes) + { + return Configuration::gateway()->customer()->updateNoValidate($customerId, $attributes); + } + + protected function _initialize($customerAttribs) + { + $this->_attributes = $customerAttribs; + + $addressArray = []; + if (isset($customerAttribs['addresses'])) { + foreach ($customerAttribs['addresses'] as $address) { + $addressArray[] = Address::factory($address); + } + } + $this->_set('addresses', $addressArray); + + $creditCardArray = []; + if (isset($customerAttribs['creditCards'])) { + foreach ($customerAttribs['creditCards'] as $creditCard) { + $creditCardArray[] = CreditCard::factory($creditCard); + } + } + $this->_set('creditCards', $creditCardArray); + + $paypalAccountArray = []; + if (isset($customerAttribs['paypalAccounts'])) { + foreach ($customerAttribs['paypalAccounts'] as $paypalAccount) { + $paypalAccountArray[] = PayPalAccount::factory($paypalAccount); + } + } + $this->_set('paypalAccounts', $paypalAccountArray); + + $applePayCardArray = []; + if (isset($customerAttribs['applePayCards'])) { + foreach ($customerAttribs['applePayCards'] as $applePayCard) { + $applePayCardArray[] = ApplePayCard::factory($applePayCard); + } + } + $this->_set('applePayCards', $applePayCardArray); + + $googlePayCardArray = []; + if (isset($customerAttribs['androidPayCards'])) { + foreach ($customerAttribs['androidPayCards'] as $googlePayCard) { + $googlePayCardArray[] = GooglePayCard::factory($googlePayCard); + } + } + $this->_set('googlePayCards', $googlePayCardArray); + + $venmoAccountArray = array(); + if (isset($customerAttribs['venmoAccounts'])) { + foreach ($customerAttribs['venmoAccounts'] as $venmoAccount) { + $venmoAccountArray[] = VenmoAccount::factory($venmoAccount); + } + } + $this->_set('venmoAccounts', $venmoAccountArray); + + $visaCheckoutCardArray = []; + if (isset($customerAttribs['visaCheckoutCards'])) { + foreach ($customerAttribs['visaCheckoutCards'] as $visaCheckoutCard) { + $visaCheckoutCardArray[] = VisaCheckoutCard::factory($visaCheckoutCard); + } + } + $this->_set('visaCheckoutCards', $visaCheckoutCardArray); + + $samsungPayCardArray = []; + if (isset($customerAttribs['samsungPayCards'])) { + foreach ($customerAttribs['samsungPayCards'] as $samsungPayCard) { + $samsungPayCardArray[] = SamsungPayCard::factory($samsungPayCard); + } + } + $this->_set('samsungPayCards', $samsungPayCardArray); + + $usBankAccountArray = array(); + if (isset($customerAttribs['usBankAccounts'])) { + foreach ($customerAttribs['usBankAccounts'] as $usBankAccount) { + $usBankAccountArray[] = UsBankAccount::factory($usBankAccount); + } + } + $this->_set('usBankAccounts', $usBankAccountArray); + + $this->_set('paymentMethods', array_merge( + $this->creditCards, + $this->paypalAccounts, + $this->applePayCards, + $this->googlePayCards, + $this->venmoAccounts, + $this->visaCheckoutCards, + $this->samsungPayCards, + $this->usBankAccounts + )); + + $customFields = []; + if (isset($customerAttribs['customFields'])) { + $customFields = $customerAttribs['customFields']; + } + $this->_set('customFields', $customFields); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * returns false if comparing object is not a Customer, + * or is a Customer with a different id + * + * @param object $otherCust customer to compare against + * + * @return boolean + */ + public function isEqual($otherCust) + { + return !($otherCust instanceof Customer) ? false : $this->id === $otherCust->id; + } + + /** + * returns the customer's default payment method + * + * @return CreditCard|PayPalAccount + */ + public function defaultPaymentMethod() + { + $defaultPaymentMethods = array_filter($this->paymentMethods, 'Braintree\Customer::_defaultPaymentMethodFilter'); + return current($defaultPaymentMethods); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function _defaultPaymentMethodFilter($paymentMethod) + { + return $paymentMethod->isDefault(); + } + + protected $_attributes = [ + 'addresses' => '', + 'company' => '', + 'creditCards' => '', + 'email' => '', + 'fax' => '', + 'firstName' => '', + 'id' => '', + 'lastName' => '', + 'phone' => '', + 'taxIdentifiers' => '', + 'createdAt' => '', + 'updatedAt' => '', + 'website' => '', + ]; + + /** + * Creates an instance of a Customer from given attributes + * + * @param array $attributes response object attributes + * + * @return Customer + */ + public static function factory($attributes) + { + $instance = new Customer(); + $instance->_initialize($attributes); + return $instance; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php new file mode 100644 index 00000000000..fb579acd9f7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php @@ -0,0 +1,573 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /* + * Return all customers + * + * @return ResourceCollection + */ + public function all() + { + $path = $this->_config->merchantPath() . '/customers/advanced_search_ids'; + $response = $this->_http->post($path); + $pager = [ + 'object' => $this, + 'method' => 'fetch', + 'methodArgs' => [[]] + ]; + + return new ResourceCollection($response, $pager); + } + + /** + * Retrieve a customer + * + * @param array $query containing request params + * @param int[] $ids containing customer IDs + * + * @return Customer|Customer[] + */ + public function fetch($query, $ids) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + $criteria["ids"] = CustomerSearch::ids()->in($ids)->toparam(); + $path = $this->_config->merchantPath() . '/customers/advanced_search'; + $response = $this->_http->post($path, ['search' => $criteria]); + + return Util::extractattributeasarray( + $response['customers'], + 'customer' + ); + } + + /** + * Creates a customer using the given +attributes+. If :id is not passed, + * the gateway will generate it. + * + * + * $result = Customer::create(array( + * 'first_name' => 'John', + * 'last_name' => 'Smith', + * 'company' => 'Smith Co.', + * 'email' => 'john@smith.com', + * 'website' => 'www.smithco.com', + * 'fax' => '419-555-1234', + * 'phone' => '614-555-1234' + * )); + * if($result->success) { + * echo 'Created customer ' . $result->customer->id; + * } else { + * echo 'Could not create customer, see result->errors'; + * } + * + * + * @param array $attribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function create($attribs = []) + { + Util::verifyKeys(self::createSignature(), $attribs); + return $this->_doCreate('/customers', ['customer' => $attribs]); + } + + /** + * attempts the create operation assuming all data will validate + * returns a Customer object instead of a Result + * + * @param array $attribs of request parameters + * + * @throws Exception\ValidationError + * + * @return Customer + */ + public function createNoValidate($attribs = []) + { + $result = $this->create($attribs); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * creates a full array signature of a valid create request + * + * @return array gateway create request format + */ + public static function createSignature() + { + $creditCardSignature = CreditCardGateway::createSignature(); + unset($creditCardSignature[array_search('customerId', $creditCardSignature)]); + $signature = [ + 'id', 'company', 'email', 'fax', 'firstName', + 'lastName', 'phone', 'website', 'deviceData', 'paymentMethodNonce', + ['riskData' => + ['customerBrowser', 'customerIp'] + ], + ['creditCard' => $creditCardSignature], + ['customFields' => ['_anyKey_']], + ['taxIdentifiers' => + ['countryCode', 'identifier'] + ], + ['options' => [ + ['paypal' => [ + 'payee_email', + 'payeeEmail', + 'order_id', + 'orderId', + 'custom_field', + 'customField', + 'description', + 'amount', + ['shipping' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', + 'extendedAddress', 'locality', 'postalCode', 'region', + 'streetAddress'], + ], + ]] + ]], + ]; + return $signature; + } + + /** + * creates a full array signature of a valid update request + * + * @return array update request format + */ + public static function updateSignature() + { + $creditCardSignature = CreditCardGateway::updateSignature(); + + foreach ($creditCardSignature as $key => $value) { + if (is_array($value) and array_key_exists('options', $value)) { + array_push($creditCardSignature[$key]['options'], 'updateExistingToken'); + } + } + + $signature = [ + 'id', 'company', 'email', 'fax', 'firstName', + 'lastName', 'phone', 'website', 'deviceData', + 'paymentMethodNonce', 'defaultPaymentMethodToken', + ['creditCard' => $creditCardSignature], + ['customFields' => ['_anyKey_']], + ['taxIdentifiers' => + ['countryCode', 'identifier'] + ], + ['options' => [ + ['paypal' => [ + 'payee_email', + 'payeeEmail', + 'order_id', + 'orderId', + 'custom_field', + 'customField', + 'description', + 'amount', + ['shipping' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', + 'extendedAddress', 'locality', 'postalCode', 'region', + 'streetAddress'], + ], + ]], + ]], + ]; + return $signature; + } + + + /** + * find a customer by id + * + * @param string $id customer Id + * @param string $associationFilterId association filter Id + * + * @throws Exception\NotFound + * + * @return Customer|boolean The customer object or false if the request fails. + */ + public function find($id, $associationFilterId = null) + { + $this->_validateId($id); + try { + $queryParams = ''; + if ($associationFilterId) { + $queryParams = '?association_filter_id=' . $associationFilterId; + } + $path = $this->_config->merchantPath() . '/customers/' . $id . $queryParams; + $response = $this->_http->get($path); + return Customer::factory($response['customer']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'customer with id ' . $id . ' not found' + ); + } + } + + /** + * credit a customer for the passed transaction + * + * @param integer $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function credit($customerId, $transactionAttribs) + { + $this->_validateId($customerId); + return Transaction::credit( + array_merge( + $transactionAttribs, + ['customerId' => $customerId] + ) + ); + } + + /** + * credit a customer, assuming validations will pass + * + * returns a Transaction object on success + * + * @param integer $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @throws Exception\ValidationError + * + * @return Transaction + */ + public function creditNoValidate($customerId, $transactionAttribs) + { + $result = $this->credit($customerId, $transactionAttribs); + return Util::returnObjectOrThrowException('Braintree\Transaction', $result); + } + + /** + * delete a customer by id + * + * @param string $customerId unique identifier + * + * @return Result\Successful + */ + public function delete($customerId) + { + $this->_validateId($customerId); + $path = $this->_config->merchantPath() . '/customers/' . $customerId; + $this->_http->delete($path); + return new Result\Successful(); + } + + /** + * create a new sale for a customer + * + * @param string $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function sale($customerId, $transactionAttribs) + { + $this->_validateId($customerId); + return Transaction::sale( + array_merge( + $transactionAttribs, + ['customerId' => $customerId] + ) + ); + } + + /** + * create a new sale for a customer, assuming validations will pass + * + * returns a Transaction object on success + * + * @param string $customerId unique identifier + * @param array $transactionAttribs containing request parameters + * + * @throws Exception\ValidationsFailed + * + * @return Transaction + */ + public function saleNoValidate($customerId, $transactionAttribs) + { + $result = $this->sale($customerId, $transactionAttribs); + return Util::returnObjectOrThrowException('Braintree\Transaction', $result); + } + + /** + * Returns a ResourceCollection of customers matching the search query. + * + * If query is a string, the search will be a basic search. + * If query is a hash, the search will be an advanced search. + // phpcs:ignore Generic.Files.LineLength + * For more detailed information and examples, see {@link https://developer.paypal.com/braintree/docs/reference/request/customer/search/php our developer docs} + * + * @param mixed $query search query + * + * @throws InvalidArgumentException + * + * @return ResourceCollection + */ + public function search($query) + { + $criteria = []; + foreach ($query as $term) { + $result = $term->toparam(); + if (is_null($result) || empty($result)) { + throw new InvalidArgumentException('Operator must be provided'); + } + + $criteria[$term->name] = $term->toparam(); + } + + $path = $this->_config->merchantPath() . '/customers/advanced_search_ids'; + $response = $this->_http->post($path, ['search' => $criteria]); + $pager = [ + 'object' => $this, + 'method' => 'fetch', + 'methodArgs' => [$query] + ]; + + return new ResourceCollection($response, $pager); + } + + /** + * updates the customer record + * + * if calling this method in static context, customerId + * is the 2nd attribute. customerId is not sent in object context. + * + * @param string $customerId to be updated + * @param array $attributes containing request params + * + * @return Result\Successful|Result\Error + */ + public function update($customerId, $attributes) + { + Util::verifyKeys(self::updateSignature(), $attributes); + $this->_validateId($customerId); + return $this->_doUpdate( + 'put', + '/customers/' . $customerId, + ['customer' => $attributes] + ); + } + + /** + * update a customer record, assuming validations will pass + * + * if calling this method in static context, customerId + * is the 2nd attribute. customerId is not sent in object context. + * returns a Customer object on success + * + * @param string $customerId unique identifier + * @param array $attributes request parameters + * + * @throws Exception\ValidationsFailed + * + * @return Customer + */ + public function updateNoValidate($customerId, $attributes) + { + $result = $this->update($customerId, $attributes); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + protected function _initialize($customerAttribs) + { + // set the attributes + $this->_attributes = $customerAttribs; + + // map each address into its own object + $addressArray = []; + if (isset($customerAttribs['addresses'])) { + foreach ($customerAttribs['addresses'] as $address) { + $addressArray[] = Address::factory($address); + } + } + $this->_set('addresses', $addressArray); + + // map each creditCard into its own object + $creditCardArray = []; + if (isset($customerAttribs['creditCards'])) { + foreach ($customerAttribs['creditCards'] as $creditCard) { + $creditCardArray[] = CreditCard::factory($creditCard); + } + } + $this->_set('creditCards', $creditCardArray); + + // map each paypalAccount into its own object + $paypalAccountArray = []; + if (isset($customerAttribs['paypalAccounts'])) { + foreach ($customerAttribs['paypalAccounts'] as $paypalAccount) { + $paypalAccountArray[] = PayPalAccount::factory($paypalAccount); + } + } + $this->_set('paypalAccounts', $paypalAccountArray); + + // map each applePayCard into its own object + $applePayCardArray = []; + if (isset($customerAttribs['applePayCards'])) { + foreach ($customerAttribs['applePayCards'] as $applePayCard) { + $applePayCardArray[] = ApplePayCard::factory($applePayCard); + } + } + $this->_set('applePayCards', $applePayCardArray); + + // map each androidPayCard from gateway response to googlePayCard objects + $googlePayCardArray = []; + if (isset($customerAttribs['androidPayCards'])) { + foreach ($customerAttribs['androidPayCards'] as $googlePayCard) { + $googlePayCardArray[] = GooglePayCard::factory($googlePayCard); + } + } + $this->_set('googlePayCards', $googlePayCardArray); + + $paymentMethodsArray = array_merge( + $this->creditCards, + $this->paypalAccounts, + $this->applePayCards, + $this->googlePayCards + ); + $this->_set('paymentMethods', $paymentMethodsArray); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * returns false if comparing object is not a Customer, + * or is a Customer with a different id + * + * @param object $otherCust customer to compare against + * + * @return boolean + */ + public function isEqual($otherCust) + { + return !($otherCust instanceof Customer) ? false : $this->id === $otherCust->id; + } + + /** + * returns an array containt all of the customer's payment methods + * + * @return array + */ + public function paymentMethods() + { + return $this->paymentMethods; + } + + /** + * returns the customer's default payment method + * + * @return CreditCard|PayPalAccount|ApplePayCard|GooglePayCard + */ + public function defaultPaymentMethod() + { + // phpcs:ignore Generic.Files.LineLength + $defaultPaymentMethods = array_filter($this->paymentMethods, 'Braintree\\Customer::_defaultPaymentMethodFilter'); + return current($defaultPaymentMethods); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function _defaultPaymentMethodFilter($paymentMethod) + { + return $paymentMethod->isDefault(); + } + + protected $_attributes = [ + 'addresses' => '', + 'company' => '', + 'creditCards' => '', + 'email' => '', + 'fax' => '', + 'firstName' => '', + 'id' => '', + 'lastName' => '', + 'phone' => '', + 'createdAt' => '', + 'updatedAt' => '', + 'website' => '', + ]; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doCreate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + private function _validateId($id = null) + { + if (is_null($id)) { + throw new InvalidArgumentException( + 'expected customer id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { + throw new InvalidArgumentException( + $id . ' is an invalid customer id.' + ); + } + } + + private function _doUpdate($httpVerb, $subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->$httpVerb($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + private function _verifyGatewayResponse($response) + { + if (isset($response['customer'])) { + // return a populated instance of Customer + return new Result\Successful( + Customer::factory($response['customer']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected customer or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php new file mode 100644 index 00000000000..1b8eb922ec3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php @@ -0,0 +1,253 @@ +_attributes = $disbursementAttribs; + $this->merchantAccountDetails = $disbursementAttribs['merchantAccount']; + + if (isset($disbursementAttribs['merchantAccount'])) { + $this->_set( + 'merchantAccount', + MerchantAccount::factory($disbursementAttribs['merchantAccount']) + ); + } + } + + /* + * Retrieve the transactions associated with a disbursement + * + * @return ResourceCollection + */ + public function transactions() + { + $collection = Transaction::search([ + TransactionSearch::ids()->in($this->transactionIds), + ]); + + return $collection; + } + + /** + * Creates an instance of a Disbursement from given attributes + * + * @param array $attributes response object attributes + * + * @return Disbursement + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + $display = [ + 'id', 'merchantAccountDetails', 'exceptionMessage', 'amount', + 'disbursementDate', 'followUpAction', 'retry', 'success', + 'transactionIds', 'disbursementType' + ]; + + $displayAttributes = []; + foreach ($display as $attrib) { + $displayAttributes[$attrib] = $this->$attrib; + } + return __CLASS__ . '[' . + Util::attributesToString($displayAttributes) . ']'; + } + + /* + * Determines if a Disbursement is a debit + * + * @return bool + */ + public function isDebit() + { + return $this->disbursementType == Disbursement::TYPE_DEBIT; + } + + /* + * Determines if a Disbursement is a credit + * + * @return bool + */ + public function isCredit() + { + return $this->disbursementType == Disbursement::TYPE_CREDIT; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php new file mode 100644 index 00000000000..9720939eb4e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php @@ -0,0 +1,23 @@ +disbursementDate); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php new file mode 100644 index 00000000000..a5f29517187 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php @@ -0,0 +1,39 @@ +_initialize($attributes); + return $instance; + } + + /** + * static methods redirecting to gateway class + * + * @see DiscountGateway::all() + * + * @return Discount[] + */ + public static function all() + { + return Configuration::gateway()->discount()->all(); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php new file mode 100644 index 00000000000..cbe7bfefcdd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php @@ -0,0 +1,42 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /* + * Get all discounts + * + * @return array of discount objects + */ + public function all() + { + $path = $this->_config->merchantPath() . '/discounts'; + $response = $this->_http->get($path); + + $discounts = ["discount" => $response['discounts']]; + + return Util::extractAttributeAsArray( + $discounts, + 'discount' + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php new file mode 100644 index 00000000000..3b8a345e559 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php @@ -0,0 +1,226 @@ +_attributes = $disputeAttribs; + + if (isset($disputeAttribs['transaction'])) { + $transactionDetails = new Dispute\TransactionDetails($disputeAttribs['transaction']); + $this->_set('transactionDetails', $transactionDetails); + $this->_set('transaction', $transactionDetails); + } + + if (isset($disputeAttribs['evidence'])) { + $evidenceArray = array_map(function ($evidence) { + return new Dispute\EvidenceDetails($evidence); + }, $disputeAttribs['evidence']); + $this->_set('evidence', $evidenceArray); + } + + if (isset($disputeAttribs['paypalMessages'])) { + $paypalMessagesArray = array_map(function ($paypalMessages) { + return new Dispute\PayPalMessageDetails($paypalMessages); + }, $disputeAttribs['paypalMessages']); + $this->_set('paypalMessages', $paypalMessagesArray); + } + + if (isset($disputeAttribs['statusHistory'])) { + $statusHistoryArray = array_map(function ($statusHistory) { + return new Dispute\StatusHistoryDetails($statusHistory); + }, $disputeAttribs['statusHistory']); + $this->_set('statusHistory', $statusHistoryArray); + } + } + + /** + * Creates an instance of a Dispute from given attributes + * + * @param array $attributes response object attributes + * + * @return Dispute + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + $display = [ + 'amount', 'reason', 'status', + 'replyByDate', 'receivedDate', 'currencyIsoCode' + ]; + + $displayAttributes = []; + foreach ($display as $attrib) { + $displayAttributes[$attrib] = $this->$attrib; + } + return __CLASS__ . '[' . + Util::attributesToString($displayAttributes) . ']'; + } + + /** + * Static methods redirecting to gateway class + * + * @param string $id unique identifier + * + * @see DisputeGateway::accept() + * + * @return Result\Successful|Result\Error + */ + public static function accept($id) + { + return Configuration::gateway()->dispute()->accept($id); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $disputeId unique identifier + * @param string|object $documentIdOrRequest either a unique identifier string or request object + * + * @see DisputeGateway::addFileEvidence() + * + * @return Result\Successful|Result\Error + */ + public static function addFileEvidence($disputeId, $documentIdOrRequest) + { + return Configuration::gateway()->dispute()->addFileEvidence($disputeId, $documentIdOrRequest); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $id unique identifier + * @param string|mixed $contentOrRequest If a string, $contentOrRequest is the text-based content + * for the dispute evidence. + * Alternatively, the second argument can also be an array containing: + * - string $content The text-based content for the dispute evidence, and + * - string $category The category for this piece of evidence + * Note: (optional) string $tag parameter is deprecated, use $category instead. + * + * @see DisputeGateway::addTextEvidence() + * + * @return Result\Successful|Result\Error + */ + public static function addTextEvidence($id, $contentOrRequest) + { + return Configuration::gateway()->dispute()->addTextEvidence($id, $contentOrRequest); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $id unique identifier + * + * @see DisputeGateway::finalize() + * + * @return Result\Successful|Result\Error + */ + public static function finalize($id) + { + return Configuration::gateway()->dispute()->finalize($id); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $id unique identifier + * + * @see DisputeGateway::find() + * + * @return Result\Successful|Result\Error + */ + public static function find($id) + { + return Configuration::gateway()->dispute()->find($id); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $disputeId unique identifier + * @param string $evidenceId unique identifier + * + * @see DisputeGateway::removeEvidence() + * + * @return Result\Successful|Result\Error + */ + public static function removeEvidence($disputeId, $evidenceId) + { + return Configuration::gateway()->dispute()->removeEvidence($disputeId, $evidenceId); + } + + /* + * Static methods redirecting to gateway class + * + * @param DisputeSearch $query + * + * @see DisputeGateway::search() + * + * @return ResourceCollection|Result\Error + */ + public static function search($query) + { + return Configuration::gateway()->dispute()->search($query); + } + + /* + * Retrive all types of chargeback protection level types + * + * @return array + */ + public static function allChargebackProtectionLevelTypes() + { + return [ + Dispute::EFFORTLESS, + Dispute::STANDARD, + Dispute::NOT_PROTECTED + ]; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php new file mode 100644 index 00000000000..347b915e3d2 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php @@ -0,0 +1,22 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Accepts a dispute, given a dispute ID + * + * @param string $id of the dispute to be accepted + * + * @return Dispute|Exception\NotFound|Result\Error + */ + public function accept($id) + { + try { + if (is_null($id) || trim($id) == "") { + throw new Exception\NotFound(); + } + + $path = $this->_config->merchantPath() . '/disputes/' . $id . '/accept'; + $response = $this->_http->put($path); + + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } + + return new Result\Successful(); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('dispute with id "' . $id . '" not found'); + } + } + + /** + * Adds file evidence to a dispute, given a dispute ID and a document ID + * + * @param string $disputeId to have evidence added + * @param string $documentIdOrRequest either a string of the unique identifier for a DocumentUpload object or a set of request params including the DocumentUpload ID + * + * @return EvidenceDetails|Exception\NotFound + */ + public function addFileEvidence($disputeId, $documentIdOrRequest) + { + $request = is_array($documentIdOrRequest) ? $documentIdOrRequest : ['documentId' => $documentIdOrRequest]; + + if (is_null($disputeId) || trim($disputeId) == "") { + throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found'); + } + + if (is_null($request['documentId']) || trim($request['documentId']) == "") { + throw new Exception\NotFound('document with id "' . $request['documentId'] . '" not found'); + } + + try { + if (array_key_exists('category', $request)) { + if (trim($request['category']) == "") { + throw new InvalidArgumentException('category cannot be blank'); + } + } + + $request['document_upload_id'] = $request['documentId']; + unset($request['documentId']); + + $path = $this->_config->merchantPath() . '/disputes/' . $disputeId . '/evidence'; + $response = $this->_http->post($path, ['evidence' => $request]); + + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } + + if (isset($response['evidence'])) { + $evidence = new Dispute\EvidenceDetails($response['evidence']); + return new Result\Successful($evidence); + } + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found'); + } + } + + /** + * Adds text evidence to a dispute, given a dispute ID and content + * + * @param string $id of the dispute + * @param mixed $contentOrRequest text-based content for the dispute evidence + * + * @return EvidenceDetails|Exception\NotFound + */ + public function addTextEvidence($id, $contentOrRequest) + { + $request = is_array($contentOrRequest) ? $contentOrRequest : ['content' => $contentOrRequest]; + if (is_null($request['content']) || trim($request['content']) == "") { + throw new InvalidArgumentException('content cannot be blank'); + } + + try { + $evidence = [ + 'comments' => $request['content'], + ]; + + if (is_null($id) || trim($id) == "") { + throw new Exception\NotFound(); + } + + if (array_key_exists('tag', $request)) { + trigger_error('$tag is deprecated, use $category instead', E_USER_DEPRECATED); + $evidence['category'] = $request['tag']; + } + + if (array_key_exists('category', $request)) { + if (trim($request['category']) == "") { + throw new InvalidArgumentException('category cannot be blank'); + } + $evidence['category'] = $request['category']; + } + + if (array_key_exists('sequenceNumber', $request)) { + if (trim($request['sequenceNumber']) == "") { + throw new InvalidArgumentException('sequenceNumber cannot be blank'); + } elseif ((string)(int)($request['sequenceNumber']) != $request['sequenceNumber']) { + throw new InvalidArgumentException('sequenceNumber must be an integer'); + } + $evidence['sequenceNumber'] = (int)$request['sequenceNumber']; + } + + $path = $this->_config->merchantPath() . '/disputes/' . $id . '/evidence'; + $response = $this->_http->post($path, [ + 'evidence' => $evidence + ]); + + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } + + if (isset($response['evidence'])) { + $evidence = new Dispute\EvidenceDetails($response['evidence']); + return new Result\Successful($evidence); + } + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('dispute with id "' . $id . '" not found'); + } + } + + /** + * Finalize a dispute, given a dispute ID + * + * @param string $id of the dispute + * + * @return Dispute|Result\Error + */ + public function finalize($id) + { + try { + if (is_null($id) || trim($id) == "") { + throw new Exception\NotFound(); + } + + $path = $this->_config->merchantPath() . '/disputes/' . $id . '/finalize'; + $response = $this->_http->put($path); + + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } + + return new Result\Successful(); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('dispute with id "' . $id . '" not found'); + } + } + + /** + * Find a dispute, given a dispute ID + * + * @param string $id of the dispute + * + * @return Dispute|Exception\NotFound + */ + public function find($id) + { + if (is_null($id) || trim($id) == "") { + throw new Exception\NotFound('dispute with id "' . $id . '" not found'); + } + + try { + $path = $this->_config->merchantPath() . '/disputes/' . $id; + $response = $this->_http->get($path); + return Dispute::factory($response['dispute']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('dispute with id "' . $id . '" not found'); + } + } + + /** + * Remove evidence from a dispute, given a dispute ID and evidence ID + * + * @param string $disputeId unique dispute identifier + * @param string $evidenceId uniqye evidence identifier + * + * @return true|Result\Error|Exception\NotFound + */ + public function removeEvidence($disputeId, $evidenceId) + { + try { + if (is_null($disputeId) || trim($disputeId) == "" || is_null($evidenceId) || trim($evidenceId) == "") { + throw new Exception\NotFound(); + } + + $path = $this->_config->merchantPath() . '/disputes/' . $disputeId . '/evidence/' . $evidenceId; + $response = $this->_http->delete($path); + + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } + + return new Result\Successful(); + } catch (Exception\NotFound $e) { + $message = 'evidence with id "' . $evidenceId . '" for dispute with id "' . $disputeId . '" not found'; + throw new Exception\NotFound($message); + } + } + + /** + * Search for Disputes, given a DisputeSearch query + * + * @param array $query containing search fields + * + * @return ResourceCollection of Dispute objects + */ + public function search($query) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + $pager = [ + 'object' => $this, + 'method' => 'fetchDisputes', + 'query' => $criteria + ]; + return new PaginatedCollection($pager); + } + + /** + * Similar to search, with a paging object + * + * @param array $query containing search fields + * @param object $page to iterate over results + * + * @return PaginatedResults + */ + public function fetchDisputes($query, $page) + { + $response = $this->_http->post($this->_config->merchantPath() . '/disputes/advanced_search?page=' . $page, [ + 'search' => $query + ]); + $body = $response['disputes']; + $disputes = Util::extractattributeasarray($body, 'dispute'); + $totalItems = $body['totalItems'][0]; + $pageSize = $body['pageSize'][0]; + return new PaginatedResult($totalItems, $pageSize, $disputes); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php new file mode 100644 index 00000000000..249a6762441 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php @@ -0,0 +1,189 @@ + Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + * "file" => $pngFile + * ]); + * + * See our {@link https://developer.paypal.com/braintree/docs/reference/response/document-upload developer docs} for information on attributes + */ +class DocumentUpload extends Base +{ + /* DocumentUpload Kind */ + const EVIDENCE_DOCUMENT = "evidence_document"; + + protected function _initialize($documentUploadAttribs) + { + $this->_attributes = $documentUploadAttribs; + } + + /** + * Creates a DocumentUpload object + * + * @param mixed $params containing: + * kind - The kind of document + * file - The open file to upload + * + * @throws InvalidArgumentException if the params are not expected + * + * @return Result\Successful|Result\Error + */ + public static function create($params) + { + return Configuration::gateway()->documentUpload()->create($params); + } + + /** + * Creates an instance of a DocumentUpload from given attributes + * + * @param array $attributes response object attributes + * + * @return DocumentUpload + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php new file mode 100644 index 00000000000..fd995ffa7a3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php @@ -0,0 +1,74 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Accepts a dispute, given a dispute ID + * + * @param mixed $params containing: + * kind - The kind of document + * file - The open file to upload + * + * @throws InvalidArgumentException if the params are not expected + * + * @return Result\Successful|Result\Error + */ + public function create($params) + { + Util::verifyKeys(self::createSignature(), $params); + + $file = $params['file']; + + if (!is_resource($file)) { + throw new InvalidArgumentException('file must be a stream resource'); + } + + $payload = [ + 'document_upload[kind]' => $params['kind'] + ]; + $path = $this->_config->merchantPath() . '/document_uploads/'; + $response = $this->_http->postMultipart($path, $payload, $file); + + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } + + if (isset($response['documentUpload'])) { + $documentUpload = DocumentUpload::factory($response['documentUpload']); + return new Result\Successful($documentUpload); + } + } + + /* + * Returns keys that are acceptable for create requests + * + * @see create + */ + public static function createSignature() + { + return [ + 'file', 'kind' + ]; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php new file mode 100644 index 00000000000..683329bc0b7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php @@ -0,0 +1,40 @@ +name = $name; + $this->searchTerms = []; + } + + /* + * sets search terms to include the value for key "ends_with" + * + * @param string $value to be sent + * + * @return self + */ + public function endsWith($value) + { + $this->searchTerms["ends_with"] = strval($value); + return $this; + } + + /* + * Returns params + * + * @return object + */ + public function toParam() + { + return $this->searchTerms; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php new file mode 100644 index 00000000000..1d003f1141c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php @@ -0,0 +1,46 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($enrichedCustomerDataAttribs) + { + // set the attributes + $this->_attributes = $enrichedCustomerDataAttribs; + + if (isset($enrichedCustomerDataAttribs['profileData'])) { + $this->_set( + 'profileData', + VenmoProfileData::factory( + $enrichedCustomerDataAttribs['profileData'] + ) + ); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php new file mode 100644 index 00000000000..31b7256db7e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php @@ -0,0 +1,23 @@ +searchTerms['is_not'] = strval($value); + return $this; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php new file mode 100644 index 00000000000..669b98b52dc --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php @@ -0,0 +1,717 @@ +_errors = + new ValidationErrorCollection($errorData); + } + + /** + * Return count of items in collection + * Implements countable + * + * @return integer + */ + #[\ReturnTypeWillChange] + public function count() + { + return $this->deepSize(); + } + + /** + * Returns all of the validation errors at all levels of nesting in a single, flat array. + * + * @return array + */ + public function deepAll() + { + return $this->_errors->deepAll(); + } + + /** + * Returns the total number of validation errors at all levels of nesting. For example, + *if creating a customer with a credit card and a billing address, and each of the customer, + * credit card, and billing address has 1 error, this method will return 3. + * + * @return integer size + */ + public function deepSize() + { + $size = $this->_errors->deepSize(); + return $size; + } + + /** + * return errors for the passed key name + * + * @param string $key name + * + * @return mixed + */ + public function forKey($key) + { + return $this->_errors->forKey($key); + } + + /** + * return errors for the passed html field. + * For example, $result->errors->onHtmlField("transaction[customer][last_name]") + * + * @param string $field html element + * + * @return array + */ + public function onHtmlField($field) + { + $pieces = preg_split("/[\[\]]+/", $field, 0, PREG_SPLIT_NO_EMPTY); + $errors = $this; + foreach (array_slice($pieces, 0, -1) as $key) { + $errors = $errors->forKey(Util::delimiterToCamelCase($key)); + if (!isset($errors)) { + return []; + } + } + $finalKey = Util::delimiterToCamelCase(end($pieces)); + return $errors->onAttribute($finalKey); + } + + /** + * Returns the errors at the given nesting level (see forKey) in a single, flat array: + * + * + * $result = Customer::create(...); + * $customerErrors = $result->errors->forKey('customer')->shallowAll(); + * + * + * @return array + */ + public function shallowAll() + { + return $this->_errors->shallowAll(); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __get($name) + { + $varName = "_$name"; + return isset($this->$varName) ? $this->$varName : null; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return sprintf('%s', $this->_errors); + } + + /** + * Implementation of JsonSerializable + * + * @return array + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->_errors->deepAll(); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php new file mode 100644 index 00000000000..fc91ccc4391 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php @@ -0,0 +1,43 @@ +== More information == + * + * // phpcs:ignore Generic.Files.LineLength + * See our {@link https://developer.paypal.com/braintree/docs/reference/general/result-objects#error-results developer docs} for more information + */ +class Validation +{ + private $_attribute; + private $_code; + private $_message; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($attributes) + { + $this->_initializeFromArray($attributes); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + private function _initializeFromArray($attributes) + { + foreach ($attributes as $name => $value) { + $varName = "_$name"; + $this->$varName = Util::delimiterToCamelCase($value, '_'); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __get($name) + { + $varName = "_$name"; + return isset($this->$varName) ? $this->$varName : null; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php new file mode 100644 index 00000000000..90f18bc9b86 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php @@ -0,0 +1,147 @@ +== More information == + * + * // phpcs:ignore Generic.Files.LineLength + * See our {@link https://developer.paypal.com/braintree/docs/reference/general/result-objects#error-results developer docs} for information on attributes + */ +class ValidationErrorCollection extends Collection +{ + private $_errors = []; + private $_nested = []; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($data) + { + foreach ($data as $key => $errorData) { + // map errors to new collections recursively + if ($key == 'errors') { + foreach ($errorData as $error) { + $this->_errors[] = new Validation($error); + } + } else { + $this->_nested[$key] = new ValidationErrorCollection($errorData); + } + } + } + + /* + * Deeply retrieve all validation errors + * + * @return array + */ + public function deepAll() + { + $validationErrors = array_merge([], $this->_errors); + foreach ($this->_nested as $nestedErrors) { + $validationErrors = array_merge($validationErrors, $nestedErrors->deepAll()); + } + return $validationErrors; + } + + /* + * Deeply retrieve a count of errors + * + * @return int + */ + public function deepSize() + { + $total = sizeof($this->_errors); + foreach ($this->_nested as $_nestedErrors) { + $total = $total + $_nestedErrors->deepSize(); + } + return $total; + } + + /* + * Checks if index if a set variable + * + * @return bool + */ + public function forIndex($index) + { + return $this->forKey("index" . $index); + } + + /* + * Checks if the value for a given key is a set variable + * + * @return bool + */ + public function forKey($key) + { + return isset($this->_nested[$key]) ? $this->_nested[$key] : null; + } + + /* + * Returns any errors that match on a given attribute + * + * @param string $attribute to be checked for matching errors + * + * @return array + */ + public function onAttribute($attribute) + { + $matches = []; + foreach ($this->_errors as $key => $error) { + if ($error->attribute == $attribute) { + $matches[] = $error; + } + } + return $matches; + } + + /* + * Get all errors + * + * @return object + */ + public function shallowAll() + { + return $this->_errors; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __get($name) + { + $varName = "_$name"; + return isset($this->$varName) ? $this->$varName : null; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + $output = []; + + if (!empty($this->_errors)) { + $output[] = $this->_inspect($this->_errors); + } + if (!empty($this->_nested)) { + foreach ($this->_nested as $key => $values) { + $output[] = $this->_inspect($this->_nested); + } + } + return join(', ', $output); + } + + private function _inspect($errors, $scope = null) + { + $eOutput = '[' . __CLASS__ . '/errors:['; + $outputErrs = []; + foreach ($errors as $error => $errorObj) { + if (is_array($errorObj->error)) { + $outputErrs[] = "({$errorObj->error['code']} {$errorObj->error['message']})"; + } + } + $eOutput .= join(', ', $outputErrs) . ']]'; + + return $eOutput; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php new file mode 100644 index 00000000000..e0c5ca950f2 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php @@ -0,0 +1,10 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php new file mode 100644 index 00000000000..16db2f38d3b --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php @@ -0,0 +1,40 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php new file mode 100644 index 00000000000..8108584e64c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php @@ -0,0 +1,265 @@ +config = $config; + $this->graphQLClient = new GraphQLClient($config); + } + + /** + * + * @return AddOnGateway + */ + public function addOn() + { + return new AddOnGateway($this); + } + + /** + * + * @return AddressGateway + */ + public function address() + { + return new AddressGateway($this); + } + + /** + * + * @return ApplePayGateway + */ + public function applePay() + { + return new ApplePayGateway($this); + } + + /** + * + * @return ClientTokenGateway + */ + public function clientToken() + { + return new ClientTokenGateway($this); + } + + /** + * + * @return CreditCardGateway + */ + public function creditCard() + { + return new CreditCardGateway($this); + } + + /** + * + * @return CreditCardVerificationGateway + */ + public function creditCardVerification() + { + return new CreditCardVerificationGateway($this); + } + + /** + * + * @return CustomerGateway + */ + public function customer() + { + return new CustomerGateway($this); + } + + /** + * + * @return DiscountGateway + */ + public function discount() + { + return new DiscountGateway($this); + } + + /** + * + * @return DisputeGateway + */ + public function dispute() + { + return new DisputeGateway($this); + } + + /** + * + * @return DocumentUploadGateway + */ + public function documentUpload() + { + return new DocumentUploadGateway($this); + } + + /** + * + * @return MerchantGateway + */ + public function merchant() + { + return new MerchantGateway($this); + } + + /** + * + * @return MerchantAccountGateway + */ + public function merchantAccount() + { + return new MerchantAccountGateway($this); + } + + /** + * + * @return OAuthGateway + */ + public function oauth() + { + return new OAuthGateway($this); + } + + /** + * + * @return PaymentMethodGateway + */ + public function paymentMethod() + { + return new PaymentMethodGateway($this); + } + + /** + * + * @return PaymentMethodNonceGateway + */ + public function paymentMethodNonce() + { + return new PaymentMethodNonceGateway($this); + } + + /** + * + * @return PayPalAccountGateway + */ + public function payPalAccount() + { + return new PayPalAccountGateway($this); + } + + /** + * + * @return PlanGateway + */ + public function plan() + { + return new PlanGateway($this); + } + + /** + * + * @return SettlementBatchSummaryGateway + */ + public function settlementBatchSummary() + { + return new SettlementBatchSummaryGateway($this); + } + + /** + * + * @return SubscriptionGateway + */ + public function subscription() + { + return new SubscriptionGateway($this); + } + + /** + * + * @return TestingGateway + */ + public function testing() + { + return new TestingGateway($this); + } + + /** + * + * @return TransactionGateway + */ + public function transaction() + { + return new TransactionGateway($this); + } + + /** + * + * @return TransactionLineItemGateway + */ + public function transactionLineItem() + { + return new TransactionLineItemGateway($this); + } + + /** + * + * @return UsBankAccountGateway + */ + public function usBankAccount() + { + return new UsBankAccountGateway($this); + } + + /** + * + * @return UsBankAccountVerificationGateway + */ + public function usBankAccountVerification() + { + return new UsBankAccountVerificationGateway($this); + } + + /** + * + * @return WebhookNotificationGateway + */ + public function webhookNotification() + { + return new WebhookNotificationGateway($this); + } + + /** + * + * @return WebhookTestingGateway + */ + public function webhookTesting() + { + return new WebhookTestingGateway($this); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php new file mode 100644 index 00000000000..057f6e109d9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php @@ -0,0 +1,68 @@ +== More information == + * + * See our {@link https://developer.paypal.com/braintree/docs/reference/response/google-pay-card developer docs} for information on attributes + */ +class GooglePayCard extends Base +{ + /* instance methods */ + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * Creates an instance of a GooglePayCard from given attributes + * + * @param array $attributes response object attributes + * + * @return GooglePayCard + */ + public static function factory($attributes) + { + $defaultAttributes = [ + 'expirationMonth' => '', + 'expirationYear' => '', + 'last4' => $attributes['virtualCardLast4'], + 'cardType' => $attributes['virtualCardType'], + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } + + /** + * sets instance properties from an array of values + * + * @param array $googlePayCardAttribs array of Google Pay card properties + * + * @return void + */ + protected function _initialize($googlePayCardAttribs) + { + // set the attributes + $this->_attributes = $googlePayCardAttribs; + + $subscriptionArray = []; + if (isset($googlePayCardAttribs['subscriptions'])) { + foreach ($googlePayCardAttribs['subscriptions'] as $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php new file mode 100644 index 00000000000..d9e0871a27f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php @@ -0,0 +1,56 @@ +_initialize($attributes); + return $instance; + } + + /* instance methods */ + + /** + * sets instance properties from an array of values + * + * @param array $GrantedPaymentInstrumentAttribs array of grantedPaymentInstrumentUpdate data + * + * @return void + */ + protected function _initialize($grantedPaymentInstrumentUpdateAttribs) + { + // set the attributes + $this->_attributes = $grantedPaymentInstrumentUpdateAttribs; + + $paymentMethodNonce = isset($grantedPaymentInstrumentUpdateAttribs['paymentMethodNonce']) ? + GrantedPaymentInstrumentUpdate::factory($grantedPaymentInstrumentUpdateAttribs['paymentMethodNonce']) : + null; + $this->_set('paymentMethodNonce', $paymentMethodNonce); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php new file mode 100644 index 00000000000..7b1d31f6b99 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php @@ -0,0 +1,58 @@ + $definition]; + if ($variables) { + $graphQLRequest["variables"] = $variables; + } + + // phpcs:ignore Generic.Files.LineLength + $response = $this->_doUrlRequest('POST', $this->_config->graphQLBaseUrl(), json_encode($graphQLRequest), null, $this->graphQLHeaders()); + + $result = json_decode($response["body"], true); + Util::throwGraphQLResponseException($result); + + return $result; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php new file mode 100644 index 00000000000..1ba2c965610 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php @@ -0,0 +1,29 @@ +_service = new GraphQL($config); + } + + /* + * Make a GraphQL API request + * + * @param object $definition of the query + * @param object $variables optional + * + * @return object result + */ + public function query($definition, $variables = null) + { + return $this->_service->request($definition, $variables); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php new file mode 100644 index 00000000000..6ba23fd2f35 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php @@ -0,0 +1,148 @@ +_config = $config; + } + + /* + * DELETE request + * + * @param string $path URL path + * @param object $params optional any addition request parameters + * + * @return array|Exception + */ + public function delete($path, $params = null) + { + $response = $this->_doRequest('DELETE', $path, $this->_buildXml($params)); + $responseCode = $response['status']; + if ($responseCode === 200 || $responseCode === 204) { + return true; + } elseif ($responseCode === 422) { + return Xml::buildArrayFromXml($response['body']); + } else { + Util::throwStatusCodeException($response['status']); + } + } + + /* + * GET request + * + * @param string $path URL path + * + * @return array|Exception + */ + public function get($path) + { + $response = $this->_doRequest('GET', $path); + if ($response['status'] === 200) { + return Xml::buildArrayFromXml($response['body']); + } else { + Util::throwStatusCodeException($response['status']); + } + } + + /* + * POST request + * + * @param string $path URL path + * @param object $params optional any addition request parameters + * + * @return array|Exception + */ + public function post($path, $params = null) + { + $response = $this->_doRequest('POST', $path, $this->_buildXml($params)); + $responseCode = $response['status']; + if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) { + return Xml::buildArrayFromXml($response['body']); + } else { + Util::throwStatusCodeException($responseCode); + } + } + + /* + * POST request for multi parts to be sent + * + * @param string $path URL path + * @param object $params additional request parameters + * @param object $file to be uploaded + * + * @return array|Exception + */ + public function postMultipart($path, $params, $file) + { + $headers = [ + 'User-Agent: Braintree PHP Library ' . Version::get(), + 'X-ApiVersion: ' . Configuration::API_VERSION + ]; + $response = $this->_doRequest('POST', $path, $params, $file, $headers); + $responseCode = $response['status']; + if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) { + return Xml::buildArrayFromXml($response['body']); + } else { + Util::throwStatusCodeException($responseCode); + } + } + + /* + * PUT request + * + * @param string $path URL path + * @param object $params optional any addition request parameters + * + * @return array|Exception + */ + public function put($path, $params = null) + { + $response = $this->_doRequest('PUT', $path, $this->_buildXml($params)); + $responseCode = $response['status']; + if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) { + return Xml::buildArrayFromXml($response['body']); + } else { + Util::throwStatusCodeException($responseCode); + } + } + + private function _buildXml($params) + { + return empty($params) ? null : Xml::buildXmlFromArray($params); + } + + /* + * Sets internal variable to true + */ + public function useClientCredentials() + { + $this->_useClientCredentials = true; + } + + private function _doRequest($httpVerb, $path, $requestBody = null, $file = null, $headers = null) + { + return $this->_doUrlRequest($httpVerb, $this->_config->baseUrl() . $path, $requestBody, $file, $headers); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doUrlRequest($httpVerb, $url, $requestBody = null, $file = null, $customHeaders = null) + { + $curlRequest = new CurlRequest($url); + // phpcs:ignore Generic.Files.LineLength + return Curl::makeRequest($httpVerb, $url, $this->_config, $curlRequest, $requestBody, $file, $customHeaders, $this->_useClientCredentials); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php new file mode 100644 index 00000000000..5685aa56d70 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php @@ -0,0 +1,190 @@ +setOption(CURLOPT_TIMEOUT, $config->getTimeout()); + $httpRequest->setOption(CURLOPT_CUSTOMREQUEST, $httpVerb); + $httpRequest->setOption(CURLOPT_URL, $url); + + if ($config->getAcceptGzipEncoding()) { + $httpRequest->setOption(CURLOPT_ENCODING, 'gzip'); + } + + if ($config->getSslVersion()) { + $httpRequest->setOption(CURLOPT_SSLVERSION, $config->getSslVersion()); + } + + $headers = []; + if ($customHeaders) { + $headers = $customHeaders; + } else { + $headers[] = 'Accept: application/xml'; + $headers[] = 'Content-Type: application/xml'; + $headers[] = 'User-Agent: Braintree PHP Library ' . Version::get(); + $headers[] = 'X-ApiVersion: ' . Configuration::API_VERSION; + } + + $authorization = self::_getAuthorization($config, $useClientCredentials); + if (isset($authorization['user'])) { + $httpRequest->setOption(CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + $httpRequest->setOption(CURLOPT_USERPWD, $authorization['user'] . ':' . $authorization['password']); + } elseif (isset($authorization['token'])) { + $headers[] = 'Authorization: Bearer ' . $authorization['token']; + } + + if ($config->sslOn()) { + $httpRequest->setOption(CURLOPT_SSL_VERIFYPEER, true); + $httpRequest->setOption(CURLOPT_SSL_VERIFYHOST, 2); + $httpRequest->setOption(CURLOPT_CAINFO, self::_getCaFile($config)); + } + + if (!empty($file)) { + $boundary = "---------------------" . md5(mt_rand() . microtime()); + $headers[] = "Content-Type: multipart/form-data; boundary={$boundary}"; + self::_prepareMultipart($httpRequest, $requestBody, $file, $boundary); + } elseif (!empty($requestBody)) { + $httpRequest->setOption(CURLOPT_POSTFIELDS, $requestBody); + } + + if ($config->isUsingProxy()) { + $proxyHost = $config->getProxyHost(); + $proxyPort = $config->getProxyPort(); + $proxyType = $config->getProxyType(); + $proxyUser = $config->getProxyUser(); + $proxyPwd = $config->getProxyPassword(); + $httpRequest->setOption(CURLOPT_PROXY, $proxyHost . ':' . $proxyPort); + if (!empty($proxyType)) { + $httpRequest->setOption(CURLOPT_PROXYTYPE, $proxyType); + } + if ($config->isAuthenticatedProxy()) { + $httpRequest->setOption(CURLOPT_PROXYUSERPWD, $proxyUser . ':' . $proxyPwd); + } + } + + $httpRequest->setOption(CURLOPT_HTTPHEADER, $headers); + $httpRequest->setOption(CURLOPT_RETURNTRANSFER, true); + $response = $httpRequest->execute(); + $httpStatus = $httpRequest->getInfo(CURLINFO_HTTP_CODE); + $errorCode = $httpRequest->getErrorCode(); + $error = $httpRequest->getError(); + + if ($errorCode == 28 && $httpStatus == 0) { + throw new Exception\Timeout(); + } + + $httpRequest->close(); + if (is_null($error)) { + $error = ""; + } + if ($config->sslOn() && $errorCode == 35) { + throw new Exception\SSLCertificate($error, $errorCode); + } + + if ($errorCode) { + throw new Exception\Connection($error, $errorCode); + } + + return ['status' => $httpStatus, 'body' => $response]; + } + + private static function _getAuthorization($config, $useClientCredentials) + { + if ($useClientCredentials) { + return [ + 'user' => $config->getClientId(), + 'password' => $config->getClientSecret(), + ]; + } elseif ($config->isAccessToken()) { + return [ + 'token' => $config->getAccessToken(), + ]; + } else { + return [ + 'user' => $config->getPublicKey(), + 'password' => $config->getPrivateKey(), + ]; + } + } + + private static function _getCaFile($config) + { + static $memo; + + if ($memo === null) { + $caFile = $config->caFile(); + + if (substr($caFile, 0, 7) !== 'phar://') { + return $caFile; + } + + $extractedCaFile = sys_get_temp_dir() . '/api_braintreegateway_com.ca.crt'; + + if (!file_exists($extractedCaFile) || sha1_file($extractedCaFile) != sha1_file($caFile)) { + if (!copy($caFile, $extractedCaFile)) { + throw new Exception\SSLCaFileNotFound(); + } + } + $memo = $extractedCaFile; + } + + return $memo; + } + + private static function _prepareMultipart($httpRequest, $requestBody, $file, $boundary) + { + $disallow = ["\0", "\"", "\r", "\n"]; + $fileInfo = new finfo(FILEINFO_MIME_TYPE); + $filePath = stream_get_meta_data($file)['uri']; + $data = file_get_contents($filePath); + $mimeType = $fileInfo->buffer($data); + + // build normal parameters + foreach ($requestBody as $k => $v) { + $k = str_replace($disallow, "_", $k); + $body[] = implode("\r\n", [ + "Content-Disposition: form-data; name=\"{$k}\"", + "", + filter_var($v), + ]); + } + + // build file parameter + $splitFilePath = explode(DIRECTORY_SEPARATOR, $filePath); + $filePath = end($splitFilePath); + $filePath = str_replace($disallow, "_", $filePath); + $body[] = implode("\r\n", [ + "Content-Disposition: form-data; name=\"file\"; filename=\"{$filePath}\"", + "Content-Type: {$mimeType}", + "", + $data, + ]); + + // add boundary for each parameters + array_walk($body, function (&$part) use ($boundary) { + $part = "--{$boundary}\r\n{$part}"; + }); + + // add final boundary + $body[] = "--{$boundary}--"; + $body[] = ""; + + // set options + $httpRequest->setOption(CURLOPT_POST, true); + $httpRequest->setOption(CURLOPT_POSTFIELDS, implode("\r\n", $body)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php new file mode 100644 index 00000000000..5b1b6124a2c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php @@ -0,0 +1,51 @@ +_handle = curl_init($url); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function setOption($name, $value) + { + curl_setopt($this->_handle, $name, $value); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function execute() + { + return curl_exec($this->_handle); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function getInfo($name) + { + return curl_getinfo($this->_handle, $name); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function getErrorCode() + { + return curl_errno($this->_handle); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function getError() + { + return curl_error($this->_handle); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function close() + { + curl_close($this->_handle); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php new file mode 100644 index 00000000000..c13787c36f8 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php @@ -0,0 +1,20 @@ +_initializeFromArray($attributes); + } + } + + /** + * returns private/nonexistent instance properties + * + * @param string $name property name + * + * @return mixed contents of instance properties + */ + public function __get($name) + { + if (array_key_exists($name, $this->_attributes)) { + return $this->_attributes[$name]; + } else { + trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE); + return null; + } + } + + /** + * used by isset() and empty() + * + * @param string $name property name + * + * @return boolean + */ + public function __isset($name) + { + return isset($this->_attributes[$name]); + } + + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * + * @return string + */ + public function __toString() + { + $objOutput = Util::implodeAssociativeArray($this->_attributes); + return get_class($this) . '[' . $objOutput . ']'; + } + /** + * initializes instance properties from the keys/values of an array + * + * @param $aAttribs array of properties to set - single level + * + * @return void + */ + private function _initializeFromArray($attributes) + { + $this->_attributes = $attributes; + } + + /** + * Implementation of JsonSerializable + * + * @return array + */ + public function jsonSerialize() + { + return $this->_attributes; + } + + /** + * Implementation of to an Array + * + * @return array + */ + public function toArray() + { + return array_map(function ($value) { + if (!is_array($value)) { + return method_exists($value, 'toArray') ? $value->toArray() : $value; + } else { + return $value; + } + }, $this->_attributes); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php new file mode 100644 index 00000000000..e50eb6f4d78 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php @@ -0,0 +1,41 @@ +name = $name; + $this->searchTerms = []; + } + + /** + * Sets the value of the object's "is" key to a string of $value + * + * @param object $value to have its string value set in $this + * + * @return object + */ + public function is($value) + { + $this->searchTerms['is'] = strval($value); + + return $this; + } + + /** + * The searchTerms + * + * @return array + */ + public function toParam() + { + return $this->searchTerms; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php new file mode 100644 index 00000000000..c9a2735bcbb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php @@ -0,0 +1,41 @@ +name = $name; + $this->searchTerm = true; + } + + /* + * Sets search term to a value + * + * @param string $value to be assigned + * + * @return object $this + */ + public function is($value) + { + $this->searchTerm = $value; + return $this; + } + + /* + * turns a search term into a param + * + * @return object searchTerm + */ + public function toParam() + { + return $this->searchTerm; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php new file mode 100644 index 00000000000..f2cca43f54c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php @@ -0,0 +1,60 @@ +_initialize($attributes); + return $instance; + } + + /* instance methods */ + + /** + * sets instance properties from an array of values + * + * @param array $LocalPaymentCompletedAttribs array of localPaymentCompleted data + * + * @return void + */ + protected function _initialize($localPaymentCompletedAttribs) + { + // set the attributes + $this->_attributes = $localPaymentCompletedAttribs; + + if (isset($transactionAttribs['transaction'])) { + $this->_set( + 'transaction', + new Transaction( + $transactionAttribs['transaction'] + ) + ); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php new file mode 100644 index 00000000000..8618d125d2c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php @@ -0,0 +1,36 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($localPaymentExpiredAttribs) + { + $this->_attributes = $localPaymentExpiredAttribs; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php new file mode 100644 index 00000000000..9f809210bdb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php @@ -0,0 +1,46 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($localPaymentFundedAttribs) + { + // set the attributes + $this->_attributes = $localPaymentFundedAttribs; + + if (isset($transactionAttribs['transaction'])) { + $this->_set( + 'transaction', + new Transaction( + $transactionAttribs['transaction'] + ) + ); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php new file mode 100644 index 00000000000..f371e50303e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php @@ -0,0 +1,51 @@ +_initialize($attributes); + return $instance; + } + + /* instance methods */ + + /** + * sets instance properties from an array of values + * + * @param array $LocalPaymentReversedAttribs array of localPaymentReversed data + * + * @return void + */ + protected function _initialize($localPaymentReversedAttribs) + { + // set the attributes + $this->_attributes = $localPaymentReversedAttribs; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php new file mode 100644 index 00000000000..f44abd8f14c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php @@ -0,0 +1,43 @@ +_attributes = $attribs; + + $merchantAccountArray = []; + if (isset($attribs['merchantAccounts'])) { + foreach ($attribs['merchantAccounts'] as $merchantAccount) { + $merchantAccountArray[] = MerchantAccount::factory($merchantAccount); + } + } + $this->_set('merchantAccounts', $merchantAccountArray); + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return Merchant + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php new file mode 100644 index 00000000000..68b54d6aeec --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php @@ -0,0 +1,74 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($merchantAccountAttribs) + { + $this->_attributes = $merchantAccountAttribs; + + if (isset($merchantAccountAttribs['individual'])) { + $individual = $merchantAccountAttribs['individual']; + $this->_set('individualDetails', MerchantAccount\IndividualDetails::Factory($individual)); + } + + if (isset($merchantAccountAttribs['business'])) { + $business = $merchantAccountAttribs['business']; + $this->_set('businessDetails', MerchantAccount\BusinessDetails::Factory($business)); + } + + if (isset($merchantAccountAttribs['funding'])) { + $funding = $merchantAccountAttribs['funding']; + $this->_set('fundingDetails', new MerchantAccount\FundingDetails($funding)); + } + + if (isset($merchantAccountAttribs['masterMerchantAccount'])) { + $masterMerchantAccount = $merchantAccountAttribs['masterMerchantAccount']; + $this->_set('masterMerchantAccount', self::Factory($masterMerchantAccount)); + } + } + + + // static methods redirecting to gateway + + public static function create($attribs) + { + return Configuration::gateway()->merchantAccount()->create($attribs); + } + + public static function find($merchant_account_id) + { + return Configuration::gateway()->merchantAccount()->find($merchant_account_id); + } + + public static function update($merchant_account_id, $attributes) + { + return Configuration::gateway()->merchantAccount()->update($merchant_account_id, $attributes); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php new file mode 100644 index 00000000000..b98c29d0bd7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php @@ -0,0 +1,13 @@ +_attributes = $businessAttribs; + if (isset($businessAttribs['address'])) { + $this->_set('addressDetails', new AddressDetails($businessAttribs['address'])); + } + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return BusinessDetails + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/FundingDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/FundingDetails.php new file mode 100644 index 00000000000..d774bdf79f0 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/FundingDetails.php @@ -0,0 +1,15 @@ +_attributes = $individualAttribs; + if (isset($individualAttribs['address'])) { + $this->_set('addressDetails', new AddressDetails($individualAttribs['address'])); + } + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return IndividualDetails + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccountGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccountGateway.php new file mode 100644 index 00000000000..8a00ca6d736 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccountGateway.php @@ -0,0 +1,151 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + public function create($attribs) + { + Util::verifyKeys(self::createSignature(), $attribs); + return $this->_doCreate('/merchant_accounts/create_via_api', ['merchant_account' => $attribs]); + } + + public function find($merchant_account_id) + { + try { + $path = $this->_config->merchantPath() . '/merchant_accounts/' . $merchant_account_id; + $response = $this->_http->get($path); + return MerchantAccount::factory($response['merchantAccount']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('merchant account with id ' . $merchant_account_id . ' not found'); + } + } + + public function update($merchant_account_id, $attributes) + { + Util::verifyKeys(self::updateSignature(), $attributes); + $queryPath = '/merchant_accounts/' . $merchant_account_id . '/update_via_api'; + return $this->_doUpdate($queryPath, ['merchant_account' => $attributes]); + } + + public static function updateSignature() + { + $signature = self::createSignature(); + unset($signature['tosAccepted']); + return $signature; + } + + public function createForCurrency($attribs) + { + $queryPath = $this->_config->merchantPath() . '/merchant_accounts/create_for_currency'; + $response = $this->_http->post($queryPath, ['merchant_account' => $attribs]); + return $this->_verifyGatewayResponse($response); + } + + public function all() + { + $pager = [ + 'object' => $this, + 'method' => 'fetchMerchantAccounts', + ]; + return new PaginatedCollection($pager); + } + + public function fetchMerchantAccounts($page) + { + $response = $this->_http->get($this->_config->merchantPath() . '/merchant_accounts?page=' . $page); + $body = $response['merchantAccounts']; + $merchantAccounts = Util::extractattributeasarray($body, 'merchantAccount'); + $totalItems = $body['totalItems'][0]; + $pageSize = $body['pageSize'][0]; + return new PaginatedResult($totalItems, $pageSize, $merchantAccounts); + } + + public static function createSignature() + { + $addressSignature = ['streetAddress', 'postalCode', 'locality', 'region']; + $individualSignature = [ + 'firstName', + 'lastName', + 'email', + 'phone', + 'dateOfBirth', + 'ssn', + ['address' => $addressSignature] + ]; + + $businessSignature = [ + 'dbaName', + 'legalName', + 'taxId', + ['address' => $addressSignature] + ]; + + $fundingSignature = [ + 'routingNumber', + 'accountNumber', + 'destination', + 'email', + 'mobilePhone', + 'descriptor', + ]; + + return [ + 'id', + 'tosAccepted', + 'masterMerchantAccountId', + ['individual' => $individualSignature], + ['funding' => $fundingSignature], + ['business' => $businessSignature] + ]; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doCreate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + private function _doUpdate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->put($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + private function _verifyGatewayResponse($response) + { + if (isset($response['response'])) { + $response = $response['response']; + } + if (isset($response['merchantAccount'])) { + // return a populated instance of merchantAccount + return new Result\Successful( + MerchantAccount::factory($response['merchantAccount']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected merchant account or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php new file mode 100644 index 00000000000..efc3f23b7d0 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php @@ -0,0 +1,43 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasClientCredentials(); + $this->_http = new Http($gateway->config); + $this->_http->useClientCredentials(); + } + + public function create($attribs) + { + $response = $this->_http->post('/merchants/create_via_api', ['merchant' => $attribs]); + return $this->_verifyGatewayResponse($response); + } + + private function _verifyGatewayResponse($response) + { + if (isset($response['response']['merchant'])) { + // return a populated instance of merchant + return new Result\Successful([ + Merchant::factory($response['response']['merchant']), + OAuthCredentials::factory($response['response']['credentials']), + ]); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected merchant or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php new file mode 100644 index 00000000000..810f85e4110 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php @@ -0,0 +1,37 @@ +_attributes = $attributes; + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return Modification + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return get_called_class() . '[' . Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php new file mode 100644 index 00000000000..14decb36c82 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php @@ -0,0 +1,67 @@ +name = $name; + $this->items = []; + $this->allowedValues = $allowedValues; + } + + /** + * Sets the value of the object's items key to $values + * + * @param array $values to be set + * + * @throws InvalidArgumentException + * + * @return object + */ + public function in($values) + { + $bad_values = array_diff($values, $this->allowedValues); + if (count($this->allowedValues) > 0 && count($bad_values) > 0) { + $message = 'Invalid argument(s) for ' . $this->name . ':'; + foreach ($bad_values as $bad_value) { + $message .= ' ' . $bad_value; + } + + throw new InvalidArgumentException($message); + } + + $this->items = $values; + return $this; + } + + /** + * Sets the value of the object's items key to [$value] + * + * @param object $value to be set + * + * @return object + */ + public function is($value) + { + return $this->in([$value]); + } + + /** + * Retrieves items(params) from the object + * + * @return object + */ + public function toParam() + { + return $this->items; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php new file mode 100644 index 00000000000..663be905cdd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php @@ -0,0 +1,92 @@ +textNode = new TextNode($name); + } + + /** + * Sets the value of the object's "contains" key to a string of $value + * + * @param object $value to have its string value set in $this + * + * @return object + */ + public function contains($value) + { + $this->textNode->contains($value); + return $this; + } + + /** + * Sets the value of the object's "ends_width" key to a string of $value + * + * @param object $value to have its string value set in $this + * + * @return object + */ + public function endsWith($value) + { + $this->textNode->endsWith($value); + return $this; + } + + /** + * Sets the value of the object's "is" key to a string of $value + * + * @param object $value to have its string value set in $this + * + * @return object + */ + public function is($value) + { + $this->textNode->is($value); + return $this; + } + + /** + * Sets the value of the object's "is_not" key to a string of $value + * + * @param object $value to have its string value set in $this + * + * @return object + */ + public function isNot($value) + { + $this->textNode->isNot($value); + return $this; + } + + /** + * Sets the value of the object's "starts_with" key to a string of $value + * + * @param object $value to have its string value set in $this + * + * @return object + */ + public function startsWith($value) + { + $this->textNode->startsWith($value); + return $this; + } + + /** + * Merges searchTerms into the parent element's params + * + * @return array + */ + public function toParam() + { + return array_merge(parent::toParam(), $this->textNode->toParam()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php new file mode 100644 index 00000000000..9934198fd38 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php @@ -0,0 +1,34 @@ +_initialize($attributes); + + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php new file mode 100644 index 00000000000..dbd3414d884 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php @@ -0,0 +1,35 @@ +_attributes = $attribs; + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return OauthCredentials + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php new file mode 100644 index 00000000000..e23f040d885 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php @@ -0,0 +1,142 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_http = new Http($gateway->config); + $this->_http->useClientCredentials(); + + $this->_config->assertHasClientCredentials(); + } + + /* Create an oAuth token from an authorization code + * + * @param mixed $params of request details + * + * @return Result\Successful|Result\Error + */ + public function createTokenFromCode($params) + { + $params['grantType'] = "authorization_code"; + return $this->_createToken($params); + } + + /* Create an oAuth token from a refresh token + * + * @param mixed $params of request details + * + * @return Result\Successful|Result\Error + */ + public function createTokenFromRefreshToken($params) + { + $params['grantType'] = "refresh_token"; + return $this->_createToken($params); + } + + /* Revoke an oAuth Access token + * + * @param mixed $params of request details + * + * @return Result\Successful|Result\Error + */ + public function revokeAccessToken($accessToken) + { + $params = ['token' => $accessToken]; + $response = $this->_http->post('/oauth/revoke_access_token', $params); + return $this->_verifyGatewayResponse($response); + } + + private function _createToken($params) + { + $params = ['credentials' => $params]; + $response = $this->_http->post('/oauth/access_tokens', $params); + return $this->_verifyGatewayResponse($response); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + private function _verifyGatewayResponse($response) + { + if (isset($response['credentials'])) { + $result = new Result\Successful( + OAuthCredentials::factory($response['credentials']) + ); + return $this->_mapSuccess($result); + } elseif (isset($response['result'])) { + $result = new Result\Successful( + OAuthResult::factory($response['result']) + ); + return $this->_mapAccessTokenRevokeSuccess($result); + } elseif (isset($response['apiErrorResponse'])) { + $result = new Result\Error($response['apiErrorResponse']); + return $this->_mapError($result); + } else { + throw new Exception\Unexpected( + "Expected credentials or apiErrorResponse" + ); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _mapError($result) + { + $error = $result->errors->deepAll()[0]; + + if ($error->code == Error\Codes::OAUTH_INVALID_GRANT) { + $result->error = 'invalid_grant'; + } elseif ($error->code == Error\Codes::OAUTH_INVALID_CREDENTIALS) { + $result->error = 'invalid_credentials'; + } elseif ($error->code == Error\Codes::OAUTH_INVALID_SCOPE) { + $result->error = 'invalid_scope'; + } + $result->errorDescription = explode(': ', $error->message)[1]; + return $result; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _mapAccessTokenRevokeSuccess($result) + { + $result->revocationResult = $result->success; + return $result; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _mapSuccess($result) + { + $credentials = $result->credentials; + $result->accessToken = $credentials->accessToken; + $result->refreshToken = $credentials->refreshToken; + $result->tokenType = $credentials->tokenType; + $result->expiresAt = $credentials->expiresAt; + return $result; + } + + /* + * Create URL for oAuth connection + * + * @param array $params optional + * + * @return string + */ + public function connectUrl($params = []) + { + $query = Util::camelCaseToDelimiterArray($params, '_'); + $query['client_id'] = $this->_config->getClientId(); + $queryString = preg_replace('/\%5B\d+\%5D/', '%5B%5D', http_build_query($query)); + + return $this->_config->baseUrl() . '/oauth/connect?' . $queryString; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php new file mode 100644 index 00000000000..75d0e4bb9aa --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php @@ -0,0 +1,35 @@ +_attributes = $attribs; + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return OAuthResult + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php new file mode 100644 index 00000000000..f0947bd4872 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php @@ -0,0 +1,128 @@ + + * $result = MerchantAccount::all(); + * + * foreach($result as $merchantAccount) { + * print_r($merchantAccount->status); + * } + * + */ +class PaginatedCollection implements Iterator +{ + private $_pager; + private $_pageSize; + private $_currentPage; + private $_index; + private $_totalItems; + private $_items; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($pager) + { + $this->_pager = $pager; + $this->_pageSize = 0; + $this->_currentPage = 0; + $this->_totalItems = 0; + $this->_index = 0; + } + + /** + * Returns the current item when iterating with foreach + * + * @return object of the current item + */ + #[\ReturnTypeWillChange] + public function current() + { + return $this->_items[($this->_index % $this->_pageSize)]; + } + + /** + * Returns null + * + * @return null + */ + #[\ReturnTypeWillChange] + public function key() + { + return null; + } + + /** + * Advances to the next item in the collection when iterating with foreach + * + * @return object of the next item in the collection + */ + #[\ReturnTypeWillChange] + public function next() + { + ++$this->_index; + } + + /** + * Rewinds the collection to the first item when iterating with foreach + * + * @return mixed collection with index set to 0 + */ + #[\ReturnTypeWillChange] + public function rewind() + { + $this->_index = 0; + $this->_currentPage = 0; + $this->_pageSize = 0; + $this->_totalItems = 0; + $this->_items = []; + } + + /** + * Returns whether the current item is valid when iterating with foreach + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function valid() + { + if ($this->_currentPage == 0 || $this->_index % $this->_pageSize == 0 && $this->_index < $this->_totalItems) { + $this->_getNextPage(); + } + + return $this->_index < $this->_totalItems; + } + + private function _getNextPage() + { + $this->_currentPage++; + $object = $this->_pager['object']; + $method = $this->_pager['method']; + + if (isset($this->_pager['query'])) { + $query = $this->_pager['query']; + $result = call_user_func( + [$object, $method], + $query, + $this->_currentPage + ); + } else { + $result = call_user_func( + [$object, $method], + $this->_currentPage + ); + } + + $this->_totalItems = $result->getTotalItems(); + $this->_pageSize = $result->getPageSize(); + $this->_items = $result->getCurrentPage(); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php new file mode 100644 index 00000000000..cab403d71b6 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php @@ -0,0 +1,51 @@ +_totalItems = $totalItems; + $this->_pageSize = $pageSize; + $this->_currentPage = $currentPage; + } + + /* + * Getter method for totalItems + * + * @return int + */ + public function getTotalItems() + { + return $this->_totalItems; + } + + /* + * Getter method for page size + * + * @return int + */ + public function getPageSize() + { + return $this->_pageSize; + } + + /* + * Getter method for the current page index + * + * @return int + */ + public function getCurrentPage() + { + return $this->_currentPage; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php new file mode 100644 index 00000000000..c8c911997d5 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php @@ -0,0 +1,37 @@ +searchTerms["starts_with"] = strval($value); + return $this; + } + + /** + * Sets the value of the object's "ends_width" key to a string of $value + * + * @param object $value to have its string value set in $this + * + * @return object + */ + public function endsWith($value) + { + $this->searchTerms["ends_with"] = strval($value); + return $this; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php new file mode 100644 index 00000000000..fd6c56392eb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php @@ -0,0 +1,40 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php new file mode 100644 index 00000000000..59cf16640e9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php @@ -0,0 +1,130 @@ +_initialize($attributes); + return $instance; + } + + /* instance methods */ + + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * sets instance properties from an array of values + * + * @param array $paypalAccountAttribs array of paypalAccount data + * + * @return void + */ + protected function _initialize($paypalAccountAttribs) + { + // set the attributes + $this->_attributes = $paypalAccountAttribs; + + $subscriptionArray = []; + if (isset($paypalAccountAttribs['subscriptions'])) { + foreach ($paypalAccountAttribs['subscriptions'] as $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * Static methods redirecting to gateway class + * + * @param string $token paypal accountunique id + * + * @see PayPalGateway::find() + * + * @throws Exception\NotFound + * + * @return PayPalAccount + */ + public static function find($token) + { + return Configuration::gateway()->payPalAccount()->find($token); + } + + /** + * Static methods redirecting to gateway class + * + * if calling this method in context, $token + * is the 2nd attribute. $token is not sent in object context. + * + * @param string $token (optional) + * @param array $attributes including request parameters + * + * @see PayPalGateway::update() + * + * @return Result\Successful or Result\Error + */ + public static function update($token, $attributes) + { + return Configuration::gateway()->payPalAccount()->update($token, $attributes); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $token paypal account identifier + * + * @see PayPalGateway::delete() + * + * @return Result + */ + public static function delete($token) + { + return Configuration::gateway()->payPalAccount()->delete($token); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $token paypal account identifier + * @param array $transactionAttribs containing request parameters + * + * @see PayPalGateway::sale() + * + * @return Result\Successful|Result\Error + */ + public static function sale($token, $transactionAttribs) + { + return Configuration::gateway()->payPalAccount()->sale($token, $transactionAttribs); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php new file mode 100644 index 00000000000..638a81fa9a5 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php @@ -0,0 +1,173 @@ + + */ +class PayPalAccountGateway +{ + private $_gateway; + private $_config; + private $_http; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($gateway) + { + $this->_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + + /** + * Find a paypalAccount by token + * + * @param string $token paypal accountunique id + * + * @throws Exception\NotFound + * + * @return PayPalAccount + */ + public function find($token) + { + $this->_validateId($token); + try { + $path = $this->_config->merchantPath() . '/payment_methods/paypal_account/' . $token; + $response = $this->_http->get($path); + return PayPalAccount::factory($response['paypalAccount']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'paypal account with token ' . $token . ' not found' + ); + } + } + + /** + * updates the paypalAccount record + * + * if calling this method in context, $token + * is the 2nd attribute. $token is not sent in object context. + * + * @param string $token (optional) + * @param array $attributes including request parameters + * + * @return Result\Successful or Result\Error + */ + public function update($token, $attributes) + { + Util::verifyKeys(self::updateSignature(), $attributes); + $this->_validateId($token); + return $this->_doUpdate('put', '/payment_methods/paypal_account/' . $token, ['paypalAccount' => $attributes]); + } + + /** + * Delete a PayPal Account record + * + * @param string $token paypal account identifier + * + * @return Result + */ + public function delete($token) + { + $this->_validateId($token); + $path = $this->_config->merchantPath() . '/payment_methods/paypal_account/' . $token; + $this->_http->delete($path); + return new Result\Successful(); + } + + /** + * create a new sale for the current PayPal account + * + * @param string $token paypal account identifier + * @param array $transactionAttribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function sale($token, $transactionAttribs) + { + $this->_validateId($token); + return Transaction::sale( + array_merge( + $transactionAttribs, + ['paymentMethodToken' => $token] + ) + ); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function updateSignature() + { + return [ + 'token', + ['options' => ['makeDefault']] + ]; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + private function _doUpdate($httpVerb, $subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->$httpVerb($fullPath, $params); + return $this->_verifyGatewayResponse($response); + } + + /** + * generic method for validating incoming gateway responses + * + * creates a new PayPalAccount object and encapsulates + * it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid. + * + * @param array $response gateway response values + * + * @throws Exception\Unexpected + * + * @return Result\Successful|Result\Error + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['paypalAccount'])) { + // return a populated instance of PayPalAccount + return new Result\Successful( + PayPalAccount::factory($response['paypalAccount']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + 'Expected paypal account or apiErrorResponse' + ); + } + } + + /** + * verifies that a valid paypal account identifier is being used + * + * @param string $identifier + * @param Optional $string $identifierType type of identifier supplied, default 'token' + * + * @throws InvalidArgumentException + */ + private function _validateId($identifier = null, $identifierType = 'token') + { + if (empty($identifier)) { + throw new InvalidArgumentException( + 'expected paypal account id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) { + throw new InvalidArgumentException( + $identifier . ' is an invalid paypal account ' . $identifierType . '.' + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php new file mode 100644 index 00000000000..68b31bcf4b6 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php @@ -0,0 +1,22 @@ +== More information == + */ +class PaymentMethod extends Base +{ + /** + * Static method from gateway class + * + * @param array $attribs containing request parameterss + * + * @see PaymentMethodGateway::create() + * + * @throws Exception\ValidationError + * + * @return Result\Successful|Result\Error + */ + public static function create($attribs) + { + return Configuration::gateway()->paymentMethod()->create($attribs); + } + + /** + * Static method from gateway class + * + * @param string $token payment method unique id + * + * @see PaymentMethodGateway::find() + * + * @throws Exception\NotFound + * + * @return CreditCard|PayPalAccount + */ + public static function find($token) + { + return Configuration::gateway()->paymentMethod()->find($token); + } + + /** + * Static method from gateway class + * + * @param string $token payment method identifier + * @param array $attribs containing request parameters + * + * @see PaymentMethodGateway::update() + * + * @return Result\Successful|Result\Error + */ + public static function update($token, $attribs) + { + return Configuration::gateway()->paymentMethod()->update($token, $attribs); + } + + /** + * Static method from gateway class + * + * @param string $token payment method identifier + * @param mixed $options containing optional parameters + * + * @see PaymentMethodGateway::delete() + * + * @return Result + */ + public static function delete($token, $options = []) + { + return Configuration::gateway()->paymentMethod()->delete($token, $options); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php new file mode 100644 index 00000000000..b500bb459cd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php @@ -0,0 +1,49 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($metadataAttribs) + { + // set the attributes + $this->_attributes = $metadataAttribs; + if (isset($metadataAttribs['paymentMethod'])) { + $this->paymentMethod = PaymentMethodParser::parsePaymentMethod($metadataAttribs['paymentMethod']); + } + + if (isset($metadataAttribs['enrichedCustomerData'])) { + $this->_set( + 'enrichedCustomerData', + EnrichedCustomerData::factory( + $metadataAttribs['enrichedCustomerData'] + ) + ); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php new file mode 100644 index 00000000000..c4921d5abe4 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php @@ -0,0 +1,349 @@ + + */ +class PaymentMethodGateway +{ + private $_gateway; + private $_config; + private $_http; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($gateway) + { + $this->_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + + /** + * Attempts the create operation + * returns a Result on success or an Error on failure + * + * @param array $attribs containing request parameterss + * + * @throws Exception\ValidationError + * + * @return Result\Successful|Result\Error + */ + public function create($attribs) + { + Util::verifyKeys(self::createSignature(), $attribs); + return $this->_doCreate('/payment_methods', ['payment_method' => $attribs]); + } + + /** + * Find a PaymentMethod by token + * + * @param string $token payment method unique id + * + * @throws Exception\NotFound + * + * @return CreditCard|PayPalAccount + */ + public function find($token) + { + $this->_validateId($token); + try { + $path = $this->_config->merchantPath() . '/payment_methods/any/' . $token; + $response = $this->_http->get($path); + return PaymentMethodParser::parsePaymentMethod($response); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'payment method with token ' . $token . ' not found' + ); + } + } + + /** + * Updates the payment method's record + * + * @param string $token payment method identifier + * @param array $attribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function update($token, $attribs) + { + Util::verifyKeys(self::updateSignature(), $attribs); + return $this->_doUpdate('/payment_methods/any/' . $token, ['payment_method' => $attribs]); + } + + /** + * Delete a payment method record + * + * @param string $token payment method identifier + * @param mixed $options containing optional parameters + * + * @return Result + */ + public function delete($token, $options = []) + { + Util::verifyKeys(self::deleteSignature(), $options); + $this->_validateId($token); + $queryString = ""; + if (!empty($options)) { + $queryString = "?" . http_build_query(Util::camelCaseToDelimiterArray($options, '_')); + } + return $this->_doDelete('/payment_methods/any/' . $token . $queryString); + } + + /** + * Grant a payment method record + * + * See our {@link https://developer.paypal.com/braintree/docs/reference/request/payment-method/grant developer docs} for more info on the Grant API. + * + * @param string $sharedPaymentMethodToken payment method identifier + * @param mixed $attribs containing request parameters + * + * @return Result + */ + public function grant($sharedPaymentMethodToken, $attribs = []) + { + if (is_bool($attribs) === true) { + $attribs = ['allow_vaulting' => $attribs]; + } + $options = [ 'shared_payment_method_token' => $sharedPaymentMethodToken ]; + + return $this->_doGrant( + '/payment_methods/grant', + [ + 'payment_method' => array_merge($attribs, $options) + ] + ); + } + + /** + * Deletes the version of a granted payment method from the receiving merchant's vault. + * + * See our {@link https://developer.paypal.com/braintree/docs/reference/request/payment-method/revoke developer docs} for more info on the Grant API. + * + * @param string $sharedPaymentMethodToken payment method identifier + * + * @return Result + */ + public function revoke($sharedPaymentMethodToken) + { + return $this->_doRevoke( + '/payment_methods/revoke', + [ + 'payment_method' => [ + 'shared_payment_method_token' => $sharedPaymentMethodToken + ] + ] + ); + } + + private static function baseSignature() + { + $billingAddressSignature = AddressGateway::createSignature(); + $optionsSignature = [ + 'failOnDuplicatePaymentMethod', + 'makeDefault', + 'skipAdvancedFraudChecking', + 'usBankAccountVerificationMethod', + 'verificationAccountType', + 'verificationAmount', + 'verificationMerchantAccountId', + 'verifyCard', + ['paypal' => [ + 'payee_email', + 'payeeEmail', + 'order_id', + 'orderId', + 'custom_field', + 'customField', + 'description', + 'amount', + ['shipping' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', + 'extendedAddress', 'locality', 'postalCode', 'region', + 'streetAddress'], + ], + ]], + ]; + return [ + 'billingAddressId', + 'cardholderName', + 'cvv', + 'deviceData', + 'expirationDate', + 'expirationMonth', + 'expirationYear', + 'number', + 'paymentMethodNonce', + 'token', + ['options' => $optionsSignature], + ['billingAddress' => $billingAddressSignature] + ]; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function createSignature() + { + $signature = array_merge(self::baseSignature(), [ + 'customerId', + 'paypalRefreshToken', + CreditCardGateway::threeDSecurePassThruSignature() + ]); + return $signature; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function updateSignature() + { + $billingAddressSignature = AddressGateway::updateSignature(); + array_push($billingAddressSignature, [ + 'options' => [ + 'updateExisting' + ] + ]); + $threeDSPassThruSignature = [ + 'authenticationResponse', + 'cavv', + 'cavvAlgorithm', + 'directoryResponse', + 'dsTransactionId', + 'eciFlag', + 'threeDSecureVersion', + 'xid' + ]; + $signature = array_merge(self::baseSignature(), [ + 'venmoSdkPaymentMethodCode', + ['billingAddress' => $billingAddressSignature], + ['threeDSecurePassThru' => $threeDSPassThruSignature] + ]); + return $signature; + } + + private static function deleteSignature() + { + return ['revokeAllGrants']; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doCreate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doGrant($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGrantResponse($response); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doRevoke($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyRevokeResponse($response); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doUpdate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->put($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doDelete($subPath) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $this->_http->delete($fullPath); + return new Result\Successful(); + } + + /** + * Generic method for validating incoming gateway responses + * + * Creates a new CreditCard or PayPalAccount object + * and encapsulates it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid. + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } elseif (($response)) { + return new Result\Successful( + PaymentMethodParser::parsePaymentMethod($response), + 'paymentMethod' + ); + } else { + throw new Exception\Unexpected( + 'Expected payment method or apiErrorResponse' + ); + } + } + + private function _verifyGrantResponse($response) + { + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } elseif (isset($response['paymentMethodNonce'])) { + return new Result\Successful( + PaymentMethodNonce::factory($response['paymentMethodNonce']), + 'paymentMethodNonce' + ); + } else { + throw new Exception\Unexpected( + 'Expected paymentMethodNonce or apiErrorResponse' + ); + } + } + + private function _verifyRevokeResponse($response) + { + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } elseif (isset($response['success'])) { + return new Result\Successful(); + } else { + throw new Exception\Unexpected( + 'Expected success or apiErrorResponse' + ); + } + } + + /** + * Verifies that a valid payment method identifier is being used + */ + private function _validateId($identifier = null, $identifierType = 'token') + { + if (empty($identifier)) { + throw new InvalidArgumentException( + 'expected payment method id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) { + throw new InvalidArgumentException( + $identifier . ' is an invalid payment method ' . $identifierType . '.' + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php new file mode 100644 index 00000000000..85f905cac95 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php @@ -0,0 +1,77 @@ +paymentMethodNonce()->create($token, $params); + } + + /* + * Static method from gateway class + * + * @param string $nonce the payment method nonce string to return information about + * + * @see PaymentMethodNonceGateway::find() + * + * @return PaymentMethodNonce + */ + public static function find($nonce) + { + return Configuration::gateway()->paymentMethodNonce()->find($nonce); + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return PaymentMethodNonce + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + protected function _initialize($nonceAttributes) + { + $this->_attributes = $nonceAttributes; + $this->_set('nonce', $nonceAttributes['nonce']); + $this->_set('type', $nonceAttributes['type']); + + if (isset($nonceAttributes['authenticationInsight'])) { + $this->_set('authenticationInsight', $nonceAttributes['authenticationInsight']); + } + + if (isset($nonceAttributes['binData'])) { + $this->_set('binData', BinData::factory($nonceAttributes['binData'])); + } + + if (isset($nonceAttributes['threeDSecureInfo'])) { + $this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($nonceAttributes['threeDSecureInfo'])); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php new file mode 100644 index 00000000000..a158ebf125c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php @@ -0,0 +1,75 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_http = new Http($gateway->config); + } + + /** + * Create a payment method nonce from an existing payment method's token + * + * @param string $token the identifier of the payment method + * @param mixed|null $params additional parameters to be included in the request + * + * @return PaymentMethodNonce|Error + */ + public function create($token, $params = []) + { + $subPath = '/payment_methods/' . $token . '/nonces'; + $fullPath = $this->_config->merchantPath() . $subPath; + $schema = [[ + 'paymentMethodNonce' => [ + 'merchantAccountId', + 'authenticationInsight', + ['authenticationInsightOptions' => [ + 'amount', + 'recurringCustomerConsent', + 'recurringMaxAmount' + ] + ]] + ]]; + Util::verifyKeys($schema, $params); + $response = $this->_http->post($fullPath, $params); + + return new Result\Successful( + PaymentMethodNonce::factory($response['paymentMethodNonce']), + "paymentMethodNonce" + ); + } + + /** + * Find a Payment Method Nonce given the string value + * + * @param string $nonce to be found + * + * @throws NotFound + * + * @return PaymentMethodNonce + */ + public function find($nonce) + { + try { + $path = $this->_config->merchantPath() . '/payment_method_nonces/' . $nonce; + $response = $this->_http->get($path); + return PaymentMethodNonce::factory($response['paymentMethodNonce']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'payment method nonce with id ' . $nonce . ' not found' + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php new file mode 100644 index 00000000000..45a3a5ba651 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php @@ -0,0 +1,43 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + + $addOnArray = []; + if (isset($attributes['addOns'])) { + foreach ($attributes['addOns'] as $addOn) { + $addOnArray[] = AddOn::factory($addOn); + } + } + $this->_attributes['addOns'] = $addOnArray; + + $discountArray = []; + if (isset($attributes['discounts'])) { + foreach ($attributes['discounts'] as $discount) { + $discountArray[] = Discount::factory($discount); + } + } + $this->_attributes['discounts'] = $discountArray; + + $planArray = []; + if (isset($attributes['plans'])) { + foreach ($attributes['plans'] as $plan) { + $planArray[] = self::factory($plan); + } + } + $this->_attributes['plans'] = $planArray; + } + + /** + * static methods redirecting to gateway class + * + * @see PlanGateway::all() + * + * @return Plan[] + */ + public static function all() + { + return Configuration::gateway()->plan()->all(); + } + + /** + * static methods redirecting to gateway class + * + * @param array $attributes response object attributes + * + * @return Plan + */ + public static function create($attributes) + { + return Configuration::gateway()->plan()->create($attributes); + } + + /** + * static methods redirecting to gateway class + * + * @param $id int planId + * + * @return Plan + */ + public static function find($id) + { + return Configuration::gateway()->plan()->find($id); + } + + /** + * static methods redirecting to gateway class + * + * @param $planId int planId + * @param array $attributes response object attributes + * + * @return Plan + */ + public static function update($planId, $attributes) + { + return Configuration::gateway()->plan()->update($planId, $attributes); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php new file mode 100644 index 00000000000..5bf696baa77 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php @@ -0,0 +1,194 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /* + * Retrieve all plans + * + * @return array of Plan objects + */ + public function all() + { + $path = $this->_config->merchantPath() . '/plans'; + $response = $this->_http->get($path); + if (key_exists('plans', $response)) { + $plans = ["plan" => $response['plans']]; + } else { + $plans = ["plan" => []]; + } + + return Util::extractAttributeAsArray( + $plans, + 'plan' + ); + } + + /* + * Request a new plan be created + * + * @param array $attributes containing request params + * + * @return Result\Sucessful|Result\Error + */ + public function create($attributes) + { + Util::verifyKeys(self::_createSignature(), $attributes); + $path = $this->_config->merchantPath() . '/plans'; + $response = $this->_http->post($path, ['plan' => $attributes]); + return $this->_verifyGatewayResponse($response); + } + + /* + * Look up a single plan + * + * @param string $id of the plan to find + * + * @return plan|Exception\NotFound + */ + public function find($id) + { + $this->_validateId($id); + + try { + $path = $this->_config->merchantPath() . '/plans/' . $id; + $response = $this->_http->get($path); + return Plan::factory($response['plan']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('plan with id ' . $id . ' not found'); + } + } + + /* + * Updates a specific plan with given details + * + * @param string $planId the ID of the plan to be updated + * @param mixed $attributes + * + * @return plan|Exception\NotFound + */ + public function update($planId, $attributes) + { + Util::verifyKeys(self::_updateSignature(), $attributes); + $path = $this->_config->merchantPath() . '/plans/' . $planId; + $response = $this->_http->put($path, ['plan' => $attributes]); + return $this->_verifyGatewayResponse($response); + } + + private static function _createSignature() + { + return array_merge( + [ + "billingDayOfMonth", + "billingFrequency", + "currencyIsoCode", + "description", + "id", + "merchantId", + "name", + "numberOfBillingCycles", + "price", + "trialDuration", + "trialDurationUnit", + "trialPeriod" + ], + self::_addOnDiscountSignature() + ); + } + + private static function _updateSignature() + { + return array_merge( + [ + "billingDayOfMonth", + "billingFrequency", + "currencyIsoCode", + "description", + "id", + "merchantId", + "name", + "numberOfBillingCycles", + "price", + "trialDuration", + "trialDurationUnit", + "trialPeriod" + ], + self::_addOnDiscountSignature() + ); + } + + private static function _addOnDiscountSignature() + { + return [ + [ + 'addOns' => [ + ['add' => ['amount', 'inheritedFromId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['update' => ['amount', 'existingId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['remove' => ['_anyKey_']], + ] + ], + [ + 'discounts' => [ + ['add' => ['amount', 'inheritedFromId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['update' => ['amount', 'existingId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['remove' => ['_anyKey_']], + ] + ] + ]; + } + + /** + * * @ignore + * */ + private function _validateId($id = null) + { + if (empty($id)) { + throw new InvalidArgumentException( + 'expected plan id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { + throw new InvalidArgumentException( + $id . ' is an invalid plan id.' + ); + } + } + + /** + * * @ignore + * */ + private function _verifyGatewayResponse($response) + { + if (isset($response['plan'])) { + return new Result\Successful( + Plan::factory($response['plan']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected plan, or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php new file mode 100644 index 00000000000..4988a8c6ddd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php @@ -0,0 +1,13 @@ +name = $name; + $this->searchTerms = []; + } + + /** + * Sets the "min" value for search terms. + * + * @param string $value to be set for search terms + * + * @return object + */ + public function greaterThanOrEqualTo($value) + { + $this->searchTerms['min'] = $value; + return $this; + } + + /** + * Sets the "mixn" value for search terms. + * + * @param string $value to be set for search terms + * + * @return object + */ + public function lessThanOrEqualTo($value) + { + $this->searchTerms['max'] = $value; + return $this; + } + + /** + * Sets the "is" value for search terms. + * + * @param string $value to be set for search terms + * + * @return object + */ + public function is($value) + { + $this->searchTerms['is'] = $value; + return $this; + } + + /** + * Sets the "min" and "max" value for search terms. + * + * @param string $min minimum value to be set for search terms + * @param string $max maximum value to be set for search terms + * + * @return object + */ + public function between($min, $max) + { + return $this->greaterThanOrEqualTo($min)->lessThanOrEqualTo($max); + } + + /** + * To be used as a parameter + * + * @return object search terms + */ + public function toParam() + { + return $this->searchTerms; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php new file mode 100644 index 00000000000..def4edd140e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php @@ -0,0 +1,161 @@ + + * $result = Customer::all(); + * + * foreach($result as $transaction) { + * print_r($transaction->id); + * } + * + */ +class ResourceCollection implements Iterator +{ + private $_batchIndex; + private $_ids; + private $_index; + private $_items; + private $_pageSize; + private $_pager; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($response, $pager) + { + $this->_pageSize = $response["searchResults"]["pageSize"]; + $this->_ids = $response["searchResults"]["ids"]; + $this->_pager = $pager; + } + + /** + * returns the current item when iterating with foreachi + * + * @return object + */ + #[\ReturnTypeWillChange] + public function current() + { + return $this->_items[$this->_index]; + } + + /** + * returns the first item in the collection + * + * @return mixed + */ + public function firstItem() + { + $ids = $this->_ids; + $page = $this->_getPage([$ids[0]]); + return $page[0]; + } + + /* + * returns null + * + * @return null + */ + #[\ReturnTypeWillChange] + public function key() + { + return null; + } + + /** + * advances to the next item in the collection when iterating with foreach + * + * @return object + */ + #[\ReturnTypeWillChange] + public function next() + { + ++$this->_index; + } + + /** + * rewinds the testIterateOverResults collection to the first item when iterating with foreach + * + * @return object + */ + #[\ReturnTypeWillChange] + public function rewind() + { + $this->_batchIndex = 0; + $this->_getNextPage(); + } + + /** + * returns whether the current item is valid when iterating with foreach + * + * @return bool + */ + #[\ReturnTypeWillChange] + public function valid() + { + if ($this->_index == count($this->_items) && $this->_batchIndex < count($this->_ids)) { + $this->_getNextPage(); + } + + if ($this->_index < count($this->_items)) { + return true; + } else { + return false; + } + } + + /* + * returns a maximum count + * + * @return int + */ + public function maximumCount() + { + return count($this->_ids); + } + + private function _getNextPage() + { + if (empty($this->_ids)) { + $this->_items = []; + } else { + $this->_items = $this->_getPage(array_slice($this->_ids, $this->_batchIndex, $this->_pageSize)); + $this->_batchIndex += $this->_pageSize; + $this->_index = 0; + } + } + + private function _getPage($ids) + { + $object = $this->_pager['object']; + $method = $this->_pager['method']; + $methodArgs = []; + foreach ($this->_pager['methodArgs'] as $arg) { + array_push($methodArgs, $arg); + } + array_push($methodArgs, $ids); + + return call_user_func_array( + [$object, $method], + $methodArgs + ); + } + + /** + * returns all IDs in the collection + * + * @return array + */ + public function getIds() + { + return $this->_ids; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php new file mode 100644 index 00000000000..99a9e3a166c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php @@ -0,0 +1,96 @@ +_initializeFromArray($attributes); + } + + /** + * initializes instance properties from the keys/values of an array + * + * @param $aAttribs array of properties to set - single level + * + * @return void + */ + private function _initializeFromArray($attributes) + { + if (isset($attributes['riskData'])) { + $attributes['riskData'] = RiskData::factory($attributes['riskData']); + } + + if (isset($attributes['globalId'])) { + $attributes['graphQLId'] = $attributes['globalId']; + } + + if (isset($attributes['threeDSecureInfo'])) { + $attributes['threeDSecureInfo'] = ThreeDSecureInfo::factory($attributes['threeDSecureInfo']); + } + $this->_attributes = $attributes; + foreach ($attributes as $name => $value) { + $varName = "_$name"; + $this->$varName = $value; + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __get($name) + { + $varName = "_$name"; + return isset($this->$varName) ? $this->$varName : null; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * returns an array of all possible Credit Card Verification statuses + * + * @return array + */ + public static function allStatuses() + { + return [ + CreditCardVerification::FAILED, + CreditCardVerification::GATEWAY_REJECTED, + CreditCardVerification::PROCESSOR_DECLINED, + CreditCardVerification::VERIFIED + ]; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php new file mode 100644 index 00000000000..65d2671b9f3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php @@ -0,0 +1,116 @@ + + * $result = Transaction::void('abc123'); + * if ($result->success) { + * // Successful Result + * } else { + * // Result\Error + * } + * + * + * @property-read array $params original passed params + * @property-read \Braintree\Error\ErrorCollection $errors + * @property-read \Braintree\Result\CreditCardVerification $creditCardVerification credit card verification data + * + * See our {@link https://developer.paypal.com/braintree/docs/reference/general/result-objects developer docs} for more information + */ +class Error extends Base +{ + /** + * used to determine whether an API request was successful or not + * + * @var boolean always false + */ + public $success = false; + + /** + * return original value for a field + * For example, if a user tried to submit 'invalid-email' in the html field transaction[customer][email], + * $result->valueForHtmlField("transaction[customer][email]") would yield "invalid-email" + * + * @param string $field to check submitted value + * + * @return string + */ + public function valueForHtmlField($field) + { + $pieces = preg_split("/[\[\]]+/", $field, 0, PREG_SPLIT_NO_EMPTY); + $params = $this->params; + foreach (array_slice($pieces, 0, -1) as $key) { + $params = $params[Util::delimiterToCamelCase($key)]; + } + if ($key != 'custom_fields') { + $finalKey = Util::delimiterToCamelCase(end($pieces)); + } else { + $finalKey = end($pieces); + } + $fieldValue = isset($params[$finalKey]) ? $params[$finalKey] : null; + return $fieldValue; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($response) + { + $this->_attributes = $response; + $this->_set('errors', new ErrorCollection($response['errors'])); + + if (isset($response['verification'])) { + $this->_set('creditCardVerification', new CreditCardVerification($response['verification'])); + } else { + $this->_set('creditCardVerification', null); + } + + if (isset($response['transaction'])) { + $this->_set('transaction', Transaction::factory($response['transaction'])); + } else { + $this->_set('transaction', null); + } + + if (isset($response['subscription'])) { + $this->_set('subscription', Subscription::factory($response['subscription'])); + } else { + $this->_set('subscription', null); + } + + if (isset($response['merchantAccount'])) { + $this->_set('merchantAccount', MerchantAccount::factory($response['merchantAccount'])); + } else { + $this->_set('merchantAccount', null); + } + + if (isset($response['verification'])) { + $this->_set('verification', new CreditCardVerification($response['verification'])); + } else { + $this->_set('verification', null); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + $output = Util::attributesToString($this->_attributes); + if (isset($this->_creditCardVerification)) { + $output .= sprintf('%s', $this->_creditCardVerification); + } + return __CLASS__ . '[' . $output . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php new file mode 100644 index 00000000000..e7589fba487 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php @@ -0,0 +1,84 @@ +customer like so: + * + * + * $result = Customer::create(array('first_name' => "John")); + * if ($result->success) { + * // Successful + * echo "Created customer {$result->customer->id}"; + * } else { + * // Error + * } + * + */ +class Successful extends Instance +{ + /** + * + * @var boolean always true + */ + public $success = true; + /** + * + * @var string stores the internal name of the object providing access to + */ + private $_returnObjectNames; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($objsToReturn = [], $propertyNames = []) + { + // Sanitize arguments (preserves backwards compatibility) + if (!is_array($objsToReturn)) { + $objsToReturn = [$objsToReturn]; + } + if (!is_array($propertyNames)) { + $propertyNames = [$propertyNames]; + } + + $objects = $this->_mapPropertyNamesToObjsToReturn($propertyNames, $objsToReturn); + $this->_attributes = []; + $this->_returnObjectNames = []; + + foreach ($objects as $propertyName => $objToReturn) { + // save the name for indirect access + array_push($this->_returnObjectNames, $propertyName); + + // create the property! + $this->$propertyName = $objToReturn; + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + $objects = []; + foreach ($this->_returnObjectNames as $returnObjectName) { + array_push($objects, $returnObjectName); + } + return __CLASS__ . '[' . implode(', ', $objects) . ']'; + } + + private function _mapPropertyNamesToObjsToReturn($propertyNames, $objsToReturn) + { + if (count($objsToReturn) != count($propertyNames)) { + $propertyNames = []; + foreach ($objsToReturn as $obj) { + array_push($propertyNames, Util::cleanClassName(get_class($obj))); + } + } + return array_combine($propertyNames, $objsToReturn); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php new file mode 100644 index 00000000000..47d71a6bf86 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php @@ -0,0 +1,106 @@ +_initializeFromArray($attributes); + + $usBankAccount = isset($attributes['usBankAccount']) ? + UsBankAccount::factory($attributes['usBankAccount']) : + null; + $this->usBankAccount = $usBankAccount; + } + + /** + * initializes instance properties from the keys/values of an array + * + * @param $aAttribs array of properties to set - single level + * + * @return void + */ + private function _initializeFromArray($attributes) + { + $this->_attributes = $attributes; + foreach ($attributes as $name => $value) { + $varName = "_$name"; + $this->$varName = $value; + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __get($name) + { + $varName = "_$name"; + return isset($this->$varName) ? $this->$varName : null; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * returns an array of all possible US Bank Account Verification statuses + * + * @return array + */ + public static function allStatuses() + { + return [ + UsBankAccountVerification::FAILED, + UsBankAccountVerification::GATEWAY_REJECTED, + UsBankAccountVerification::PROCESSOR_DECLINED, + UsBankAccountVerification::VERIFIED, + UsBankAccountVerification::PENDING, + ]; + } + + /** + * returns an array of all possible US Bank Account Verification methods + * + * @return array + */ + public static function allVerificationMethods() + { + return [ + UsBankAccountVerification::TOKENIZED_CHECK, + UsBankAccountVerification::NETWORK_CHECK, + UsBankAccountVerification::INDEPENDENT_CHECK, + UsBankAccountVerification::MICRO_TRANSFERS, + ]; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php new file mode 100644 index 00000000000..374be59d056 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php @@ -0,0 +1,38 @@ +revokedPaymentMethod = PaymentMethodParser::parsePaymentMethod($attributes); + $instance->customerId = $instance->revokedPaymentMethod->customerId; + $instance->token = $instance->revokedPaymentMethod->token; + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php new file mode 100644 index 00000000000..2cfeb7ec850 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php @@ -0,0 +1,47 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } + + /** + * returns the rules triggered by the fraud provider when generating the decision. + * + * @return array of strings + */ + public function decisionReasons() + { + return $this->_attributes['decisionReasons']; + } + + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php new file mode 100644 index 00000000000..4f59111c0b4 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php @@ -0,0 +1,104 @@ +default; + } + + /** + * checks whether the card is expired based on the current date + * + * @return boolean + */ + public function isExpired() + { + return $this->expired; + } + + /** + * sets instance properties from an array of values + * + * @param array $creditCardAttribs array of creditcard data + * + * @return void + */ + protected function _initialize($creditCardAttribs) + { + // set the attributes + $this->_attributes = $creditCardAttribs; + + // map each address into its own object + $billingAddress = isset($creditCardAttribs['billingAddress']) ? + Address::factory($creditCardAttribs['billingAddress']) : + null; + + $subscriptionArray = []; + if (isset($creditCardAttribs['subscriptions'])) { + foreach ($creditCardAttribs['subscriptions'] as $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + $this->_set('billingAddress', $billingAddress); + $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); + $this->_set('maskedNumber', $this->bin . '******' . $this->last4); + } + + /** + * returns false if comparing object is not a SamsungPayCard, + * or is a SamsungPayCard with a different id + * + * @param object $otherSamsungPayCard customer to compare against + * + * @return boolean + */ + public function isEqual($otherSamsungPayCard) + { + return !($otherSamsungPayCard instanceof self) ? false : $this->token === $otherSamsungPayCard->token; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return SamsungPayCard + */ + public static function factory($attributes) + { + $defaultAttributes = [ + 'bin' => '', + 'expirationMonth' => '', + 'expirationYear' => '', + 'last4' => '', + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php new file mode 100644 index 00000000000..f242def944a --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php @@ -0,0 +1,57 @@ +_initialize($attributes); + return $instance; + } + + //phpcs:ignore Generic.Commenting + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } + + /** + * Returns the value for "records" + * + * @return mixed records + */ + public function records() + { + return $this->_attributes['records']; + } + + + /** + * static method redirecting to gateway + * + * @param string $settlement_date Date YYYY-MM-DD + * @param string $groupByCustomField optional + * + * @see SettlementBatchSummaryGateway::generate() + * + * @return Result\Successful|Result\Error + */ + public static function generate($settlement_date, $groupByCustomField = null) + { + return Configuration::gateway()->settlementBatchSummary()->generate($settlement_date, $groupByCustomField); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php new file mode 100644 index 00000000000..91f129fbf26 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php @@ -0,0 +1,80 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Create a Settlement Batch Summary report. + * + * @param string $settlement_date A string representing the date of the settlement batch + * @param string $groupByCustomField A string representing a transaction's custom field that you wish to group by + * + * @return SettlementBatchSummary|Result\Error + */ + public function generate($settlement_date, $groupByCustomField = null) + { + $criteria = ['settlement_date' => $settlement_date]; + if (isset($groupByCustomField)) { + $criteria['group_by_custom_field'] = $groupByCustomField; + } + $params = ['settlement_batch_summary' => $criteria]; + $path = $this->_config->merchantPath() . '/settlement_batch_summary'; + $response = $this->_http->post($path, $params); + + if (isset($groupByCustomField)) { + $response['settlementBatchSummary']['records'] = $this->_underscoreCustomField( + $groupByCustomField, + $response['settlementBatchSummary']['records'] + ); + } + + return $this->_verifyGatewayResponse($response); + } + + private function _underscoreCustomField($groupByCustomField, $records) + { + $updatedRecords = []; + + foreach ($records as $record) { + $camelized = Util::delimiterToCamelCase($groupByCustomField); + $record[$groupByCustomField] = $record[$camelized]; + unset($record[$camelized]); + $updatedRecords[] = $record; + } + + return $updatedRecords; + } + + private function _verifyGatewayResponse($response) + { + if (isset($response['settlementBatchSummary'])) { + return new Result\Successful( + SettlementBatchSummary::factory($response['settlementBatchSummary']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected settlementBatchSummary or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php new file mode 100644 index 00000000000..682521ef4fb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php @@ -0,0 +1,18 @@ +key = $key; + $this->digest = $digest; + } + + public function sign($payload) + { + return $this->hash($payload) . "|" . $payload; + } + + public function hash($data) + { + return call_user_func($this->digest, $this->key, $data); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php new file mode 100644 index 00000000000..a6fed89a96f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php @@ -0,0 +1,201 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + + $addOnArray = []; + if (isset($attributes['addOns'])) { + foreach ($attributes['addOns'] as $addOn) { + $addOnArray[] = AddOn::factory($addOn); + } + } + $this->_attributes['addOns'] = $addOnArray; + + $discountArray = []; + if (isset($attributes['discounts'])) { + foreach ($attributes['discounts'] as $discount) { + $discountArray[] = Discount::factory($discount); + } + } + $this->_attributes['discounts'] = $discountArray; + + if (isset($attributes['descriptor'])) { + $this->_set('descriptor', new Descriptor($attributes['descriptor'])); + } + + if (isset($attributes['description'])) { + $this->_set('description', $attributes['description']); + } + + $statusHistory = []; + if (isset($attributes['statusHistory'])) { + foreach ($attributes['statusHistory'] as $history) { + $statusHistory[] = new Subscription\StatusDetails($history); + } + } + $this->_attributes['statusHistory'] = $statusHistory; + + $transactionArray = []; + if (isset($attributes['transactions'])) { + foreach ($attributes['transactions'] as $transaction) { + $transactionArray[] = Transaction::factory($transaction); + } + } + $this->_attributes['transactions'] = $transactionArray; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + $excludedAttributes = ['statusHistory']; + + $displayAttributes = []; + foreach ($this->_attributes as $key => $val) { + if (!in_array($key, $excludedAttributes)) { + $displayAttributes[$key] = $val; + } + } + + return __CLASS__ . '[' . + Util::attributesToString($displayAttributes) . ']'; + } + + /** + * Static methods redirecting to gateway class + * + * @param array $attributes containing request params + * + * @see SubscriptionGateway::create() + * + * @return Result\Successful|Result\Error + */ + public static function create($attributes) + { + return Configuration::gateway()->subscription()->create($attributes); + } + + /* + * Static methods redirecting to gateway class + * + * @param string $id of the subscription to find + * + * @see SubscriptionGateway::find() + * + * @return Subscription|Exception\NotFound + */ + public static function find($id) + { + return Configuration::gateway()->subscription()->find($id); + } + + /* + * Static methods redirecting to gateway class + * + * @param mixed $query of search fields + * + * @see SubscriptionGateway::search() + * + * @return ResourceCollection of Subscription objects + */ + public static function search($query) + { + return Configuration::gateway()->subscription()->search($query); + } + + /* + * Static methods redirecting to gateway class + * + * @param mixed $query of search fields + * @param array $ids to be fetched + * + * @see SubscriptionGateway::fetch() + * + * @return ResourceCollection of Subscription objects + */ + public static function fetch($query, $ids) + { + return Configuration::gateway()->subscription()->fetch($query, $ids); + } + + /* + * Static methods redirecting to gateway class + * + * @param string $subscriptionId the ID of the subscription to be updated + * @param mixed $attributes + * + * @see SubscriptionGateway::update() + * + * @return Subscription|Exception\NotFound + */ + public static function update($subscriptionId, $attributes) + { + return Configuration::gateway()->subscription()->update($subscriptionId, $attributes); + } + + /* + * Static methods redirecting to gateway class + * + * @param string $subscriptionId the ID of the subscription with a charge being retried + * @param string $amount optional + * @param bool $submitForSettlement defaults to false unless specified true + * + * @see SubscriptionGateway::retryCharge() + * + * @return Transaction + */ + public static function retryCharge($subscriptionId, $amount = null, $submitForSettlement = false) + { + return Configuration::gateway()->subscription()->retryCharge($subscriptionId, $amount, $submitForSettlement); + } + + /* + * Static methods redirecting to gateway class + * + * @param string $subscriptionId to be canceled + * + * @see SubscriptionGateway::cancel() + * + * @return Subscription|Exception\NotFound + */ + public static function cancel($subscriptionId) + { + return Configuration::gateway()->subscription()->cancel($subscriptionId); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php new file mode 100644 index 00000000000..43b5f91fa21 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php @@ -0,0 +1,15 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /* + * Request a new subscription be created + * + * @param array $attributes containing request params + * + * @return Result\Sucessful|Result\Error + */ + public function create($attributes) + { + Util::verifyKeys(self::_createSignature(), $attributes); + $path = $this->_config->merchantPath() . '/subscriptions'; + $response = $this->_http->post($path, ['subscription' => $attributes]); + return $this->_verifyGatewayResponse($response); + } + + /* + * Look up a single subscription + * + * @param string $id of the subscription to find + * + * @return Subscription|Exception\NotFound + */ + public function find($id) + { + $this->_validateId($id); + + try { + $path = $this->_config->merchantPath() . '/subscriptions/' . $id; + $response = $this->_http->get($path); + return Subscription::factory($response['subscription']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('subscription with id ' . $id . ' not found'); + } + } + + /* + * Search for subscriptions using a variety of criteria + * + * @param mixed $query of search fields + * + * @return ResourceCollection of Subscription objects + */ + public function search($query) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + + + $path = $this->_config->merchantPath() . '/subscriptions/advanced_search_ids'; + $response = $this->_http->post($path, ['search' => $criteria]); + $pager = [ + 'object' => $this, + 'method' => 'fetch', + 'methodArgs' => [$query] + ]; + + return new ResourceCollection($response, $pager); + } + + /* + * Fetch subscriptions using a variety of criteria + * + * @param mixed $query of search fields + * @param array $ids to be fetched + * + * @return ResourceCollection of Subscription objects + */ + public function fetch($query, $ids) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + $criteria["ids"] = SubscriptionSearch::ids()->in($ids)->toparam(); + $path = $this->_config->merchantPath() . '/subscriptions/advanced_search'; + $response = $this->_http->post($path, ['search' => $criteria]); + + return Util::extractAttributeAsArray( + $response['subscriptions'], + 'subscription' + ); + } + + /* + * Updates a specific subscription with given details + * + * @param string $subscriptionId the ID of the subscription to be updated + * @param mixed $attributes + * + * @return Subscription|Exception\NotFound + */ + public function update($subscriptionId, $attributes) + { + Util::verifyKeys(self::_updateSignature(), $attributes); + $path = $this->_config->merchantPath() . '/subscriptions/' . $subscriptionId; + $response = $this->_http->put($path, ['subscription' => $attributes]); + return $this->_verifyGatewayResponse($response); + } + + /* + * Manually retry charging a past due subscription + * + * @param string $subscriptionId the ID of the subscription with a charge being retried + * @param string $amount optional + * @param bool $submitForSettlement defaults to false unless specified true + * + * @return Transaction + */ + public function retryCharge($subscriptionId, $amount = null, $submitForSettlement = false) + { + $transaction_params = ['type' => Transaction::SALE, + 'subscriptionId' => $subscriptionId]; + if (isset($amount)) { + $transaction_params['amount'] = $amount; + } + if ($submitForSettlement) { + $transaction_params['options'] = ['submitForSettlement' => $submitForSettlement]; + } + + $path = $this->_config->merchantPath() . '/transactions'; + $response = $this->_http->post($path, ['transaction' => $transaction_params]); + return $this->_verifyGatewayResponse($response); + } + + /* + * Stops billing a payment method for a subscription. Cannot be reactivated + * + * @param string $subscriptionId to be canceled + * + * @return Subscription|Exception\NotFound + */ + public function cancel($subscriptionId) + { + $path = $this->_config->merchantPath() . '/subscriptions/' . $subscriptionId . '/cancel'; + $response = $this->_http->put($path); + return $this->_verifyGatewayResponse($response); + } + + private static function _createSignature() + { + return array_merge( + [ + 'billingDayOfMonth', + 'firstBillingDate', + 'createdAt', + 'updatedAt', + 'id', + 'merchantAccountId', + 'neverExpires', + 'numberOfBillingCycles', + 'paymentMethodToken', + 'paymentMethodNonce', + 'planId', + 'price', + 'trialDuration', + 'trialDurationUnit', + 'trialPeriod', + ['descriptor' => ['name', 'phone', 'url']], + ['options' => [ + 'doNotInheritAddOnsOrDiscounts', + 'startImmediately', + ['paypal' => ['description']] + ]], + ], + self::_addOnDiscountSignature() + ); + } + + private static function _updateSignature() + { + return array_merge( + [ + 'merchantAccountId', 'numberOfBillingCycles', 'paymentMethodToken', 'planId', + 'paymentMethodNonce', 'id', 'neverExpires', 'price', + ['descriptor' => ['name', 'phone', 'url']], + ['options' => [ + 'prorateCharges', + 'replaceAllAddOnsAndDiscounts', + 'revertSubscriptionOnProrationFailure', + ['paypal' => ['description']] + ]], + ], + self::_addOnDiscountSignature() + ); + } + + private static function _addOnDiscountSignature() + { + return [ + [ + 'addOns' => [ + ['add' => ['amount', 'inheritedFromId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['update' => ['amount', 'existingId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['remove' => ['_anyKey_']], + ] + ], + [ + 'discounts' => [ + ['add' => ['amount', 'inheritedFromId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['update' => ['amount', 'existingId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], + ['remove' => ['_anyKey_']], + ] + ] + ]; + } + + private function _validateId($id = null) + { + if (empty($id)) { + throw new InvalidArgumentException( + 'expected subscription id to be set' + ); + } + if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { + throw new InvalidArgumentException( + $id . ' is an invalid subscription id.' + ); + } + } + + private function _verifyGatewayResponse($response) + { + if (isset($response['subscription'])) { + return new Result\Successful( + Subscription::factory($response['subscription']) + ); + } elseif (isset($response['transaction'])) { + // return a populated instance of Transaction, for subscription retryCharge + return new Result\Successful( + Transaction::factory($response['transaction']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected subscription, transaction, or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php new file mode 100644 index 00000000000..e4203de846e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php @@ -0,0 +1,135 @@ + '378734493671000', + 'Discover' => '6011000990139424', + 'MasterCard' => '5105105105105100', + 'Visa' => '4000111111111115', + ]; + + public static $amexPayWithPoints = [ + 'Success' => "371260714673002", + 'IneligibleCard' => "378267515471109", + 'InsufficientPoints' => "371544868764018", + ]; + + public static $disputes = [ + 'Chargeback' => '4023898493988028', + ]; + + /** + * Get all test credit cards in one array + * + * @return array + */ + public static function getAll() + { + return array_merge( + self::$amExes, + self::$discoverCards, + self::$eloCards, + self::$masterCards, + self::$visas + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php new file mode 100644 index 00000000000..37eb3013c42 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php @@ -0,0 +1,16 @@ +testing()->settle($transactionId); + } + + /** + * settlement confirm a transaction by id in sandbox + * + * @param string $id transaction id + * @param Configuration $config gateway config + * + * @return Transaction + */ + public static function settlementConfirm($transactionId) + { + return Configuration::gateway()->testing()->settlementConfirm($transactionId); + } + + /** + * settlement decline a transaction by id in sandbox + * + * @param string $id transaction id + * @param Configuration $config gateway config + * + * @return Transaction + */ + public static function settlementDecline($transactionId) + { + return Configuration::gateway()->testing()->settlementDecline($transactionId); + } + + /** + * settlement pending a transaction by id in sandbox + * + * @param string $id transaction id + * @param Configuration $config gateway config + * + * @return Transaction + */ + public static function settlementPending($transactionId) + { + return Configuration::gateway()->testing()->settlementPending($transactionId); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php new file mode 100644 index 00000000000..fee3828c702 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php @@ -0,0 +1,16 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_http = new Http($this->_config); + } + + public function settle($transactionId) + { + return self::_doTestRequest('/settle', $transactionId); + } + + public function settlementPending($transactionId) + { + return self::_doTestRequest('/settlement_pending', $transactionId); + } + + public function settlementConfirm($transactionId) + { + return self::_doTestRequest('/settlement_confirm', $transactionId); + } + + public function settlementDecline($transactionId) + { + return self::_doTestRequest('/settlement_decline', $transactionId); + } + + private function _doTestRequest($testPath, $transactionId) + { + self::_checkEnvironment(); + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . $testPath; + $response = $this->_http->put($path); + return Transaction::factory($response['transaction']); + } + + private function _checkEnvironment() + { + if (Configuration::$global->getEnvironment() === 'production') { + throw new Exception\TestOperationPerformedInProduction(); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TextNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TextNode.php new file mode 100644 index 00000000000..bc9eaa1cec9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TextNode.php @@ -0,0 +1,23 @@ +searchTerms["contains"] = strval($value); + return $this; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php new file mode 100644 index 00000000000..3f159a67c15 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php @@ -0,0 +1,38 @@ +_initialize($attributes); + + return $instance; + } + + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php new file mode 100644 index 00000000000..d3b7a5e58bd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php @@ -0,0 +1,785 @@ +Minimalistic example: + * + * Transaction::saleNoValidate(array( + * 'amount' => '100.00', + * 'creditCard' => array( + * 'number' => '5105105105105100', + * 'expirationDate' => '05/12', + * ), + * )); + * + * + * Full example: + * + * Transaction::saleNoValidate(array( + * 'amount' => '100.00', + * 'orderId' => '123', + * 'channel' => 'MyShoppingCardProvider', + * 'creditCard' => array( + * // if token is omitted, the gateway will generate a token + * 'token' => 'credit_card_123', + * 'number' => '5105105105105100', + * 'expirationDate' => '05/2011', + * 'cvv' => '123', + * ), + * 'customer' => array( + * // if id is omitted, the gateway will generate an id + * 'id' => 'customer_123', + * 'firstName' => 'Dan', + * 'lastName' => 'Smith', + * 'company' => 'Braintree', + * 'email' => 'dan@example.com', + * 'phone' => '419-555-1234', + * 'fax' => '419-555-1235', + * 'website' => 'http://braintreepayments.com' + * ), + * 'billing' => array( + * 'firstName' => 'Carl', + * 'lastName' => 'Jones', + * 'company' => 'Braintree', + * 'streetAddress' => '123 E Main St', + * 'extendedAddress' => 'Suite 403', + * 'locality' => 'Chicago', + * 'region' => 'IL', + * 'postalCode' => '60622', + * 'countryName' => 'United States of America' + * ), + * 'shipping' => array( + * 'firstName' => 'Andrew', + * 'lastName' => 'Mason', + * 'company' => 'Braintree', + * 'streetAddress' => '456 W Main St', + * 'extendedAddress' => 'Apt 2F', + * 'locality' => 'Bartlett', + * 'region' => 'IL', + * 'postalCode' => '60103', + * 'countryName' => 'United States of America' + * ), + * 'customFields' => array( + * 'birthdate' => '11/13/1954' + * ) + * ) + * + * + * == Storing in the Vault == + * + * The customer and credit card information used for + * a transaction can be stored in the vault by setting + * transaction[options][storeInVault] to true. + * + * $transaction = Transaction::saleNoValidate(array( + * 'customer' => array( + * 'firstName' => 'Adam', + * 'lastName' => 'Williams' + * ), + * 'creditCard' => array( + * 'number' => '5105105105105100', + * 'expirationDate' => '05/2012' + * ), + * 'options' => array( + * 'storeInVault' => true + * ) + * )); + * + * echo $transaction->customerDetails->id + * // '865534' + * echo $transaction->creditCardDetails->token + * // '6b6m' + * + * + * To also store the billing address in the vault, pass the + * addBillingAddressToPaymentMethod option. + * + * Transaction.saleNoValidate(array( + * ... + * 'options' => array( + * 'storeInVault' => true + * 'addBillingAddressToPaymentMethod' => true + * ) + * )); + * + * + * == Submitting for Settlement== + * + * This can only be done when the transction's + * status is authorized. If amount is not specified, + * the full authorized amount will be settled. If you would like to settle + * less than the full authorized amount, pass the desired amount. + * You cannot settle more than the authorized amount. + * + * A transaction can be submitted for settlement when created by setting + * $transaction[options][submitForSettlement] to true. + * + * + * $transaction = Transaction::saleNoValidate(array( + * 'amount' => '100.00', + * 'creditCard' => array( + * 'number' => '5105105105105100', + * 'expirationDate' => '05/2012' + * ), + * 'options' => array( + * 'submitForSettlement' => true + * ) + * )); + * + * + * For more detailed information on Transactions, see {@link https://developer.paypal.com/braintree/docs/reference/response/transaction our developer docs} +// phpcs:enable Generic.Files.LineLength + */ +class Transaction extends Base +{ + // Transaction Status + const AUTHORIZATION_EXPIRED = 'authorization_expired'; + const AUTHORIZING = 'authorizing'; + const AUTHORIZED = 'authorized'; + const GATEWAY_REJECTED = 'gateway_rejected'; + const FAILED = 'failed'; + const PROCESSOR_DECLINED = 'processor_declined'; + const SETTLED = 'settled'; + const SETTLING = 'settling'; + const SUBMITTED_FOR_SETTLEMENT = 'submitted_for_settlement'; + const VOIDED = 'voided'; + const UNRECOGNIZED = 'unrecognized'; + const SETTLEMENT_DECLINED = 'settlement_declined'; + const SETTLEMENT_PENDING = 'settlement_pending'; + const SETTLEMENT_CONFIRMED = 'settlement_confirmed'; + + // Transaction Escrow Status + const ESCROW_HOLD_PENDING = 'hold_pending'; + const ESCROW_HELD = 'held'; + const ESCROW_RELEASE_PENDING = 'release_pending'; + const ESCROW_RELEASED = 'released'; + const ESCROW_REFUNDED = 'refunded'; + + // Transaction Types + const SALE = 'sale'; + const CREDIT = 'credit'; + + // Transaction Created Using + const FULL_INFORMATION = 'full_information'; + const TOKEN = 'token'; + + // Transaction Sources + const API = 'api'; + const CONTROL_PANEL = 'control_panel'; + const RECURRING = 'recurring'; + + // Gateway Rejection Reason + const AVS = 'avs'; + const AVS_AND_CVV = 'avs_and_cvv'; + const CVV = 'cvv'; + const DUPLICATE = 'duplicate'; + const FRAUD = 'fraud'; + const RISK_THRESHOLD = 'risk_threshold'; + const THREE_D_SECURE = 'three_d_secure'; + const TOKEN_ISSUANCE = 'token_issuance'; + const APPLICATION_INCOMPLETE = 'application_incomplete'; + + // Industry Types + const LODGING_INDUSTRY = 'lodging'; + const TRAVEL_AND_CRUISE_INDUSTRY = 'travel_cruise'; + const TRAVEL_AND_FLIGHT_INDUSTRY = 'travel_flight'; + + // Additional Charge Types + const RESTAURANT = 'lodging'; + const GIFT_SHOP = 'gift_shop'; + const MINI_BAR = 'mini_bar'; + const TELEPHONE = 'telephone'; + const LAUNDRY = 'laundry'; + const OTHER = 'other'; + + /** + * sets instance properties from an array of values + * + * @param array $transactionAttribs array of transaction data + * + * @return void + */ + protected function _initialize($transactionAttribs) + { + $this->_attributes = $transactionAttribs; + + if (isset($transactionAttribs['applePay'])) { + $this->_set( + 'applePayCardDetails', + new Transaction\ApplePayCardDetails( + $transactionAttribs['applePay'] + ) + ); + } + + // Rename androidPayCard from API responses to GooglePayCard + if (isset($transactionAttribs['androidPayCard'])) { + $this->_set( + 'googlePayCardDetails', + new Transaction\GooglePayCardDetails( + $transactionAttribs['androidPayCard'] + ) + ); + } + + if (isset($transactionAttribs['visaCheckoutCard'])) { + $this->_set( + 'visaCheckoutCardDetails', + new Transaction\VisaCheckoutCardDetails( + $transactionAttribs['visaCheckoutCard'] + ) + ); + } + + if (isset($transactionAttribs['samsungPayCard'])) { + $this->_set( + 'samsungPayCardDetails', + new Transaction\SamsungPayCardDetails( + $transactionAttribs['samsungPayCard'] + ) + ); + } + + if (isset($transactionAttribs['venmoAccount'])) { + $this->_set( + 'venmoAccountDetails', + new Transaction\VenmoAccountDetails( + $transactionAttribs['venmoAccount'] + ) + ); + } + + if (isset($transactionAttribs['creditCard'])) { + $this->_set( + 'creditCardDetails', + new Transaction\CreditCardDetails( + $transactionAttribs['creditCard'] + ) + ); + } + + if (isset($transactionAttribs['usBankAccount'])) { + $this->_set( + 'usBankAccount', + new Transaction\UsBankAccountDetails( + $transactionAttribs['usBankAccount'] + ) + ); + } + + if (isset($transactionAttribs['paypal'])) { + $this->_set( + 'paypalDetails', + new Transaction\PayPalDetails( + $transactionAttribs['paypal'] + ) + ); + } + + if (isset($transactionAttribs['paypalHere'])) { + $this->_set( + 'paypalHereDetails', + new Transaction\PayPalHereDetails( + $transactionAttribs['paypalHere'] + ) + ); + } + + if (isset($transactionAttribs['localPayment'])) { + $this->_set( + 'localPaymentDetails', + new Transaction\LocalPaymentDetails( + $transactionAttribs['localPayment'] + ) + ); + } + + if (isset($transactionAttribs['customer'])) { + $this->_set( + 'customerDetails', + new Transaction\CustomerDetails( + $transactionAttribs['customer'] + ) + ); + } + + if (isset($transactionAttribs['billing'])) { + $this->_set( + 'billingDetails', + new Transaction\AddressDetails( + $transactionAttribs['billing'] + ) + ); + } + + if (isset($transactionAttribs['shipping'])) { + $this->_set( + 'shippingDetails', + new Transaction\AddressDetails( + $transactionAttribs['shipping'] + ) + ); + } + + if (isset($transactionAttribs['subscription'])) { + $this->_set( + 'subscriptionDetails', + new Transaction\SubscriptionDetails( + $transactionAttribs['subscription'] + ) + ); + } + + if (isset($transactionAttribs['descriptor'])) { + $this->_set( + 'descriptor', + new Descriptor( + $transactionAttribs['descriptor'] + ) + ); + } + + if (isset($transactionAttribs['disbursementDetails'])) { + $this->_set( + 'disbursementDetails', + new DisbursementDetails($transactionAttribs['disbursementDetails']) + ); + } + + $disputes = []; + if (isset($transactionAttribs['disputes'])) { + foreach ($transactionAttribs['disputes'] as $dispute) { + $disputes[] = Dispute::factory($dispute); + } + } + + $this->_set('disputes', $disputes); + + $statusHistory = []; + if (isset($transactionAttribs['statusHistory'])) { + foreach ($transactionAttribs['statusHistory'] as $history) { + $statusHistory[] = new Transaction\StatusDetails($history); + } + } + + $this->_set('statusHistory', $statusHistory); + + $addOnArray = []; + if (isset($transactionAttribs['addOns'])) { + foreach ($transactionAttribs['addOns'] as $addOn) { + $addOnArray[] = AddOn::factory($addOn); + } + } + $this->_set('addOns', $addOnArray); + + $discountArray = []; + if (isset($transactionAttribs['discounts'])) { + foreach ($transactionAttribs['discounts'] as $discount) { + $discountArray[] = Discount::factory($discount); + } + } + $this->_set('discounts', $discountArray); + + $authorizationAdjustments = []; + if (isset($transactionAttribs['authorizationAdjustments'])) { + foreach ($transactionAttribs['authorizationAdjustments'] as $authorizationAdjustment) { + $authorizationAdjustments[] = AuthorizationAdjustment::factory($authorizationAdjustment); + } + } + + $this->_set('authorizationAdjustments', $authorizationAdjustments); + + if (isset($transactionAttribs['riskData'])) { + $this->_set('riskData', RiskData::factory($transactionAttribs['riskData'])); + } + if (isset($transactionAttribs['threeDSecureInfo'])) { + $this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($transactionAttribs['threeDSecureInfo'])); + } + if (isset($transactionAttribs['facilitatedDetails'])) { + $this->_set('facilitatedDetails', FacilitatedDetails::factory($transactionAttribs['facilitatedDetails'])); + } + if (isset($transactionAttribs['facilitatorDetails'])) { + $this->_set('facilitatorDetails', FacilitatorDetails::factory($transactionAttribs['facilitatorDetails'])); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + // array of attributes to print + $display = [ + 'id', 'type', 'amount', 'status', + 'createdAt', 'creditCardDetails', 'customerDetails' + ]; + + $displayAttributes = []; + foreach ($display as $attrib) { + $displayAttributes[$attrib] = $this->$attrib; + } + return __CLASS__ . '[' . + Util::attributesToString($displayAttributes) . ']'; + } + + /* + * Checks if one transaction's ID is the same as another transaction's Id. + * + * @param string $otherTx to be compared + * + * @return bool + */ + public function isEqual($otherTx) + { + return $this->id === $otherTx->id; + } + + //NEXT_MAJOR_VERSION this function is only used for tests, the assertions this function provides are obfuscated. + //We should remove this function and update the tests to be more clear in what we're asserting. + public function vaultCreditCard() + { + $token = $this->creditCardDetails->token; + if (empty($token)) { + return null; + } else { + return CreditCard::find($token); + } + } + + //NEXT_MAJOR_VERSION this function is only used for tests, the assertions this function provides are obfuscated. + //We should remove this function and update the tests to be more clear in what we're asserting. + public function vaultCustomer() + { + $customerId = $this->customerDetails->id; + if (empty($customerId)) { + return null; + } else { + return Customer::find($customerId); + } + } + + /** + * Checks if transactions is disbursed + * + * @return boolean + */ + public function isDisbursed() + { + return $this->disbursementDetails->isValid(); + } + + /** + * Static methods redirecting to gateway class + * + * @see TransactionLineItemGateway::findAll() + * + * @return ResourceCollection of TransactionLineItem objects + */ + public function lineItems() + { + return Configuration::gateway()->transactionLineItem()->findAll($this->id); + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return Transaction + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unique identifier + * @param string $amount to be adjusted + * + * @see TransactionGateway::adjustAuthorization() + * + * @return Transction|Result\Error + */ + public static function adjustAuthorization($transactionId, $amount) + { + return Configuration::gateway()->transaction()->adjustAuthorization($transactionId, $amount); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId to be cloned + * @param mixed $attribs containing any additional request parameters + * + * @see TransactionGateway::cloneTransaction() + * + * @return Transction|Result\Error + */ + public static function cloneTransaction($transactionId, $attribs) + { + return Configuration::gateway()->transaction()->cloneTransaction($transactionId, $attribs); + } + + //NEXT_MAJOR_VERSION remove this function, it was only used for a Transparent Redirect test that no longer exists + public static function createTransactionUrl() + { + return Configuration::gateway()->transaction()->createTransactionUrl(); + } + + /** + * Static methods redirecting to gateway class + * + * @param mixed $attribs containing any request parameters + * + * @see TransactionGateway::credit() + * + * @return Result\Successful|Result\Error + */ + public static function credit($attribs) + { + return Configuration::gateway()->transaction()->credit($attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param mixed $attribs containing any request parameters + * + * @see TransactionGateway::creditNoValidate() + * + * @return Transaction|Result\Error + */ + public static function creditNoValidate($attribs) + { + return Configuration::gateway()->transaction()->creditNoValidate($attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param mixed $id unique identifier of the transaction to find + * + * @see TransactionGateway::find() + * + * @return Result\Successful|Exception\NotFound + */ + public static function find($id) + { + return Configuration::gateway()->transaction()->find($id); + } + + /** + * Static methods redirecting to gateway class + * + * @param mixed $attribs containing any request parameters + * + * @see TransactionGateway::sale() + * + * @return Result\Successful|Exception\NotFound + */ + public static function sale($attribs) + { + return Configuration::gateway()->transaction()->sale($attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param mixed $attribs containing any request parameters + * + * @see TransactionGateway::saleNoValidate() + * + * @return Transaction|Result\Error + */ + public static function saleNoValidate($attribs) + { + return Configuration::gateway()->transaction()->saleNoValidate($attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param mixed $query containing search fields + * + * @see TransactionGateway::search() + * + * @return ResourceCollection of Transaction objects + */ + public static function search($query) + { + return Configuration::gateway()->transaction()->search($query); + } + + /* + * Static methods redirecting to gateway class + * + * @param mixed $query of search fields + * @param array $ids to be fetched + * + * @see TransactionGateway::fetch() + * + * @return ResourceCollection of Transaction objects + */ + public static function fetch($query, $ids) + { + return Configuration::gateway()->transaction()->fetch($query, $ids); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be voided + * + * @see TransactionGateway::void() + * + * @return Result\Successful|Exception\NotFound + */ + public static function void($transactionId) + { + return Configuration::gateway()->transaction()->void($transactionId); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be voided + * + * @see TransactionGateway::voidNoValidate() + * + * @return Transaction|Result\Error + */ + public static function voidNoValidate($transactionId) + { + return Configuration::gateway()->transaction()->voidNoValidate($transactionId); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be submitted for settlement + * @param string $amount optional + * @param mixed $attribs any additional request parameters + * + * @see TransactionGateway::submitForSettlement() + * + * @return Result\Successful|Exception\NotFound + */ + public static function submitForSettlement($transactionId, $amount = null, $attribs = []) + { + return Configuration::gateway()->transaction()->submitForSettlement($transactionId, $amount, $attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be submitted for settlement + * @param string $amount optional + * @param mixed $attribs any additional request parameters + * + * @see TransactionGateway::submitForSettlement() + * + * @return Transaction|Result\Error + */ + public static function submitForSettlementNoValidate($transactionId, $amount = null, $attribs = []) + { + // phpcs:ignore Generic.Files.LineLength + return Configuration::gateway()->transaction()->submitForSettlementNoValidate($transactionId, $amount, $attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId to be updated + * @param array $attribs attributes to be updated in the request + * + * @see TransactionGateway::updateDetails() + * + * @return Result\Successful|Result\Error + */ + public static function updateDetails($transactionId, $attribs = []) + { + return Configuration::gateway()->transaction()->updateDetails($transactionId, $attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be submitted for settlement + * @param string $amount optional + * @param mixed $attribs any additional request parameters + * + * @see TransactionGateway::submitForPartialSettlement() + * + * @return Result\Successful|Exception\NotFound + */ + public static function submitForPartialSettlement($transactionId, $amount, $attribs = []) + { + return Configuration::gateway()->transaction()->submitForPartialSettlement($transactionId, $amount, $attribs); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be held in escrow + * + * @see TransactionGateway::holdInEscrow() + * + * @return Result\Successful|Exception\NotFound + */ + public static function holdInEscrow($transactionId) + { + return Configuration::gateway()->transaction()->holdInEscrow($transactionId); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be released from escrow + * + * @see TransactionGateway::releaseFromEscrow() + * + * @return Result\Successful|Exception\NotFound + */ + public static function releaseFromEscrow($transactionId) + { + return Configuration::gateway()->transaction()->releaseFromEscrow($transactionId); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction whose escrow release is to be canceled + * + * @see TransactionGateway::cancelRelease() + * + * @return Result\Successful|Exception\NotFound + */ + public static function cancelRelease($transactionId) + { + return Configuration::gateway()->transaction()->cancelRelease($transactionId); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $transactionId unque identifier of the transaction to be refunded + * @param string $amount to be refunded, optional + * + * @see TransactionGateway::refund() + * + * @return Result\Successful|Exception\NotFound + */ + public static function refund($transactionId, $amount = null) + { + return Configuration::gateway()->transaction()->refund($transactionId, $amount); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php new file mode 100644 index 00000000000..33cb06f3ab9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php @@ -0,0 +1,15 @@ +_attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear; + $this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php new file mode 100644 index 00000000000..4b1bc7d2983 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php @@ -0,0 +1,15 @@ +_attributes['cardType'] = $this->virtualCardType; + $this->_attributes['last4'] = $this->virtualCardLast4; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php new file mode 100644 index 00000000000..fdfd37f7613 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php @@ -0,0 +1,25 @@ +_attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear; + $this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php new file mode 100644 index 00000000000..742d1ee24b8 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php @@ -0,0 +1,15 @@ +achMandate = $achMandate; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php new file mode 100644 index 00000000000..1f7539966ac --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php @@ -0,0 +1,21 @@ +_attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear; + $this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php new file mode 100644 index 00000000000..537c54b9aea --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php @@ -0,0 +1,757 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Create a new transaction by copying all the attributes, except amount, of the original transaction + * + * Instead of cloning transactions, a better practice in most cases is to use the Vault to save and reuse payment method or customer information + * + * @param string $transactionId to be cloned + * @param mixed $attribs containing additional request parameters + * + * @see PaymentMethodGateway + * @see CustomerGateway + * + * @return Result\Successful|Result\Error + */ + public function cloneTransaction($transactionId, $attribs) + { + Util::verifyKeys(self::cloneSignature(), $attribs); + return $this->_doCreate('/transactions/' . $transactionId . '/clone', ['transactionClone' => $attribs]); + } + + private function create($attribs) + { + Util::verifyKeys(self::createSignature(), $attribs); + $attribs = Util::replaceKey($attribs, 'googlePayCard', 'androidPayCard'); + return $this->_doCreate('/transactions', ['transaction' => $attribs]); + } + + private function createNoValidate($attribs) + { + $result = $this->create($attribs); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * creates a full array signature of a valid gateway request + * + * @return array gateway request signature format + */ + public static function cloneSignature() + { + return ['amount', 'channel', ['options' => ['submitForSettlement']]]; + } + + /** + * creates a full array signature of a valid gateway request + * + * @return array gateway request signature format + */ + public static function createSignature() + { + return [ + 'amount', + 'billingAddressId', + 'channel', + 'customerId', + 'deviceData', + 'exchangeRateQuoteId', + 'merchantAccountId', + 'orderId', + 'paymentMethodNonce', + 'paymentMethodToken', + 'productSku', + 'purchaseOrderNumber', + 'recurring', + 'serviceFeeAmount', + 'sharedPaymentMethodToken', + 'sharedPaymentMethodNonce', + 'sharedCustomerId', + 'sharedShippingAddressId', + 'sharedBillingAddressId', + 'shippingAddressId', + 'taxAmount', + 'taxExempt', + 'threeDSecureToken', + 'threeDSecureAuthenticationId', + 'transactionSource', + 'type', + 'venmoSdkPaymentMethodCode', + 'scaExemption', + 'shippingAmount', + 'discountAmount', + 'shipsFromPostalCode', + ['riskData' => + [ + 'customerBrowser', 'customerIp', 'customerDeviceId', + 'customerLocationZip', 'customerTenure'], + ], + ['creditCard' => + [ + 'token', + 'cardholderName', + 'cvv', + 'expirationDate', + 'expirationMonth', + 'expirationYear', + 'number', + ['paymentReaderCardDetails' => ['encryptedCardData', 'keySerialNumber']], + ], + ], + ['customer' => + [ + 'id', 'company', 'email', 'fax', 'firstName', + 'lastName', 'phone', 'website'], + ], + ['billing' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', + 'extendedAddress', 'locality', 'phoneNumber', 'postalCode', 'region', + 'streetAddress'], + ], + ['shipping' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', + 'extendedAddress', 'locality', 'phoneNumber', 'postalCode', 'region', + 'shippingMethod', 'streetAddress'], + ], + ['threeDSecurePassThru' => + [ + 'eciFlag', + 'cavv', + 'xid', + 'threeDSecureVersion', + 'authenticationResponse', + 'directoryResponse', + 'cavvAlgorithm', + 'dsTransactionId'], + ], + ['options' => + [ + 'holdInEscrow', + 'storeInVault', + 'storeInVaultOnSuccess', + 'submitForSettlement', + 'addBillingAddressToPaymentMethod', + 'venmoSdkSession', + 'storeShippingAddressInVault', + 'payeeId', + 'payeeEmail', + 'skipAdvancedFraudChecking', + 'skipAvs', + 'skipCvv', + ['creditCard' => + ['accountType'] + ], + ['threeDSecure' => + ['required'] + ], + ['paypal' => + [ + 'payeeId', + 'payeeEmail', + 'customField', + 'description', + ['supplementaryData' => ['_anyKey_']], + ] + ], + ['amexRewards' => + [ + 'requestId', + 'points', + 'currencyAmount', + 'currencyIsoCode' + ] + ], + ['venmo' => + [ + 'profileId' + ] + ] + ], + ], + ['customFields' => ['_anyKey_']], + ['descriptor' => ['name', 'phone', 'url']], + ['paypalAccount' => ['payeeId', 'payeeEmail', 'payerId', 'paymentId']], + ['applePayCard' => + [ + 'cardholderName', + 'cryptogram', + 'eciIndicator', + 'expirationMonth', + 'expirationYear', + 'number' + ] + ], + ['industry' => + ['industryType', + ['data' => + [ + 'folioNumber', + 'checkInDate', + 'checkOutDate', + 'travelPackage', + 'departureDate', + 'lodgingCheckInDate', + 'lodgingCheckOutDate', + 'lodgingName', + 'roomRate', + 'roomTax', + 'passengerFirstName', + 'passengerLastName', + 'passengerMiddleInitial', + 'passengerTitle', + 'issuedDate', + 'travelAgencyName', + 'travelAgencyCode', + 'ticketNumber', + 'issuingCarrierCode', + 'customerCode', + 'fareAmount', + 'feeAmount', + 'taxAmount', + 'restrictedTicket', + 'noShow', + 'advancedDeposit', + 'fireSafe', + 'propertyPhone', + ['legs' => + [ + 'conjunctionTicket', + 'exchangeTicket', + 'couponNumber', + 'serviceClass', + 'carrierCode', + 'fareBasisCode', + 'flightNumber', + 'departureDate', + 'departureAirportCode', + 'departureTime', + 'arrivalAirportCode', + 'arrivalTime', + 'stopoverPermitted', + 'fareAmount', + 'feeAmount', + 'taxAmount', + 'endorsementOrRestrictions' + ] + ], + ['additionalCharges' => + [ + 'kind', + 'amount' + ] + ] + ] + ] + ] + ], + ['lineItems' => + [ + 'commodityCode', + 'description', + 'discountAmount', + 'kind', + 'name', + 'productCode', + 'quantity', + 'taxAmount', + 'totalAmount', + 'unitAmount', + 'unitOfMeasure', + 'unitTaxAmount', + 'url' + ] + ], + ['externalVault' => + ['status' , 'previousNetworkTransactionId'], + ], + ['googlePayCard' => + [ + 'cryptogram', + 'eciIndicator', + 'expirationMonth', + 'expirationYear', + 'googleTransactionId', + 'number', + 'sourceCardLastFour', + 'sourceCardType' + ] + ], + ['installments' => ['count']] + ]; + } + + /** + * creates a full array signature of a valid gateway request + * + * @return array gateway request signature format + */ + public static function submitForSettlementSignature() + { + return ['orderId', ['descriptor' => ['name', 'phone', 'url']], + 'purchaseOrderNumber', + 'taxAmount', + 'taxExempt', + 'shippingAmount', + 'discountAmount', + 'shipsFromPostalCode', + ['lineItems' => + [ + 'commodityCode', + 'description', + 'discountAmount', + 'kind', + 'name', + 'productCode', + 'quantity', + 'taxAmount', + 'totalAmount', + 'unitAmount', + 'unitOfMeasure', + 'unitTaxAmount', + 'url' + ] + ], + ]; + } + + /** + * creates a full array signature of a valid gateway request + * + * @return array gateway request signature format + */ + public static function updateDetailsSignature() + { + return ['amount', 'orderId', ['descriptor' => ['name', 'phone', 'url']]]; + } + + /** + * creates a full array signature of a valid gateway request + * + * @return array gateway request signature format + */ + public static function refundSignature() + { + return [ + 'amount', + 'merchantAccountId', + 'orderId' + ]; + } + + /** + * Request a credit to a payment method + * + * @param array $attribs containing request parameters + * + * @return Result\Successful|Result\Error + */ + public function credit($attribs) + { + return $this->create(array_merge($attribs, ['type' => Transaction::CREDIT])); + } + + /** + * Request a credit to a payment method. Returns either a Transaction or error + * + * @param array $attribs containing request parameters + * + * @return Transaction|Result\Error + */ + public function creditNoValidate($attribs) + { + $result = $this->credit($attribs); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * Retrieve transaction information given its ID + * + * @param string $id unique identifier of the transaction + * + * @return Transaction|Exception\NotFound + */ + public function find($id) + { + $this->_validateId($id); + try { + $path = $this->_config->merchantPath() . '/transactions/' . $id; + $response = $this->_http->get($path); + return Transaction::factory($response['transaction']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'transaction with id ' . $id . ' not found' + ); + } + } + /** + * Request a new sale + * + * @param array $attribs (Note: $recurring param is deprecated. Use $transactionSource instead) + * + * @return Result\Successful|Result\Error + */ + public function sale($attribs) + { + if (array_key_exists('recurring', $attribs)) { + trigger_error('$recurring is deprecated, use $transactionSource instead', E_USER_DEPRECATED); + } + return $this->create(array_merge(['type' => Transaction::SALE], $attribs)); + } + + /** + * Request a new sale. Returns a Transaction object instead of a Result + * + * @param mixed $attribs containing any request parameters + * + * @return Transaction|Result\Error + */ + public function saleNoValidate($attribs) + { + $result = $this->sale($attribs); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * Returns a ResourceCollection of transactions matching the search query. + * + * If query is a string, the search will be a basic search. + * If query is a hash, the search will be an advanced search. + * // phpcs:ignore Generic.Files.LineLength + * For more detailed information and examples, see {@link https://developer.paypal.com/braintree/docs/reference/request/transaction/search/php our developer docs} + * + * @param mixed $query search query + * + * @return ResourceCollection + */ + public function search($query) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + + $path = $this->_config->merchantPath() . '/transactions/advanced_search_ids'; + $response = $this->_http->post($path, ['search' => $criteria]); + if (array_key_exists('searchResults', $response)) { + $pager = [ + 'object' => $this, + 'method' => 'fetch', + 'methodArgs' => [$query] + ]; + + return new ResourceCollection($response, $pager); + } else { + throw new Exception\RequestTimeout(); + } + } + + /** + * Function to fetch results in building paged reults + * + * @param mixed $query including method arguments + * @param array $ids to use in searching + * + * @return array + */ + public function fetch($query, $ids) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + $criteria["ids"] = TransactionSearch::ids()->in($ids)->toparam(); + $path = $this->_config->merchantPath() . '/transactions/advanced_search'; + $response = $this->_http->post($path, ['search' => $criteria]); + + if (array_key_exists('creditCardTransactions', $response)) { + return Util::extractattributeasarray( + $response['creditCardTransactions'], + 'transaction' + ); + } else { + throw new Exception\RequestTimeout(); + } + } + + /** + * Adjusts the authorization amount of a transaction + * + * @param string $transactionId unique identifier + * @param string $amount tp be adjusted + * + * @return Result\Successful|Result\Error + */ + public function adjustAuthorization($transactionId, $amount) + { + self::_validateId($transactionId); + $params = ['amount' => $amount]; + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/adjust_authorization'; + $response = $this->_http->put($path, ['transaction' => $params]); + return $this->_verifyGatewayResponse($response); + } + + /** + * void a transaction by id + * + * @param string $transactionId unique identifier + * + * @return Result\Successful|Result\Error + */ + public function void($transactionId) + { + $this->_validateId($transactionId); + + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/void'; + $response = $this->_http->put($path); + return $this->_verifyGatewayResponse($response); + } + + /** + * void a transaction by id. Returns a Transaction instead of Result\Successful + * + * @param string $transactionId unique identifier + * + * @return Transaction|Result\Error + */ + public function voidNoValidate($transactionId) + { + $result = $this->void($transactionId); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * Submits an authorized transaction be captured and submitted for settlement. + * + * @param string $transactionId uniquq identifier + * @param string|null $amount to be submitted for settlement + * @param array $attribs containing any additional request parameters + * + * @return Result\Successful|Result\Error + */ + public function submitForSettlement($transactionId, $amount = null, $attribs = []) + { + $this->_validateId($transactionId); + Util::verifyKeys(self::submitForSettlementSignature(), $attribs); + $attribs['amount'] = $amount; + + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/submit_for_settlement'; + $response = $this->_http->put($path, ['transaction' => $attribs]); + return $this->_verifyGatewayResponse($response); + } + + /** + * Submits an authorized transaction be captured and submitted for settlement. Returns a Transaction object on success + * + * @param string $transactionId uniquq identifier + * @param string|null $amount to be submitted for settlement + * @param array $attribs containing any additional request parameters + * + * @return Transaction|Exception + */ + public function submitForSettlementNoValidate($transactionId, $amount = null, $attribs = []) + { + $result = $this->submitForSettlement($transactionId, $amount, $attribs); + return Util::returnObjectOrThrowException(__CLASS__, $result); + } + + /** + * Update certain details for a transaction that has been submitted for settlement + * + * @param string $transactionId to be updated + * @param array $attribs attributes to be updated in the request + * + * @return Result\Successful|Result\Error + */ + public function updateDetails($transactionId, $attribs = []) + { + $this->_validateId($transactionId); + Util::verifyKeys(self::updateDetailsSignature(), $attribs); + + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/update_details'; + $response = $this->_http->put($path, ['transaction' => $attribs]); + return $this->_verifyGatewayResponse($response); + } + + /** + * Settle multiple partial amounts against the same authorization + * + * @param string $transactionId unque identifier of the transaction to be submitted for settlement + * @param string $amount optional + * @param mixed $attribs any additional request parameters + * + * @return Result\Successful|Exception\NotFound + */ + public function submitForPartialSettlement($transactionId, $amount, $attribs = []) + { + $this->_validateId($transactionId); + Util::verifyKeys(self::submitForSettlementSignature(), $attribs); + $attribs['amount'] = $amount; + + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/submit_for_partial_settlement'; + $response = $this->_http->post($path, ['transaction' => $attribs]); + return $this->_verifyGatewayResponse($response); + } + + /** + * Specific to Marketplace merchants + * + * @param string $transactionId unque identifier of the transaction to be held in escrow + * + * @return Result\Successful|Exception\NotFound + */ + public function holdInEscrow($transactionId) + { + $this->_validateId($transactionId); + + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/hold_in_escrow'; + $response = $this->_http->put($path, []); + return $this->_verifyGatewayResponse($response); + } + + /** + * Specific to Marketplace merchants + * + * @param string $transactionId unque identifier of the transaction to be released from escrow + * + * @return Result\Successful|Exception\NotFound + */ + public function releaseFromEscrow($transactionId) + { + $this->_validateId($transactionId); + + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/release_from_escrow'; + $response = $this->_http->put($path, []); + return $this->_verifyGatewayResponse($response); + } + + /** + * Specific to Marketplace merchants + * + * @param string $transactionId unque identifier of the transaction whose escrow release is to be canceled + * + * @return Result\Successful|Exception\NotFound + */ + public function cancelRelease($transactionId) + { + $this->_validateId($transactionId); + + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/cancel_release'; + $response = $this->_http->put($path, []); + return $this->_verifyGatewayResponse($response); + } + + /** + * Request a refund to a payment method + * + * @param string $transactionId unque identifier of the transaction to be refunded + * @param mixed $amount_or_options if a string amount, the amount to be refunded, if array of options, additional request parameters + * + * @return Result\Successful|Exception\NotFound + */ + public function refund($transactionId, $amount_or_options = null) + { + self::_validateId($transactionId); + + if (gettype($amount_or_options) == "array") { + $options = $amount_or_options; + } else { + $options = [ + "amount" => $amount_or_options + ]; + } + Util::verifyKeys(self::refundSignature(), $options); + + $params = ['transaction' => $options]; + $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/refund'; + $response = $this->_http->post($path, $params); + return $this->_verifyGatewayResponse($response); + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function _doCreate($subPath, $params) + { + $fullPath = $this->_config->merchantPath() . $subPath; + $response = $this->_http->post($fullPath, $params); + + return $this->_verifyGatewayResponse($response); + } + + /** + * verifies that a valid transaction id is being used + * + * @param string transaction id + + * @throws InvalidArgumentException + * + * @return null + */ + private function _validateId($id = null) + { + if (empty($id)) { + throw new InvalidArgumentException( + 'expected transaction id to be set' + ); + } + } + + /** + * generic method for validating incoming gateway responses + * + * creates a new Transaction object and encapsulates + * it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid. + * + * @param array $response gateway response values + * + * @throws Exception\Unexpected + * + * @return Result\Successful|Result\Error + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['transaction'])) { + // return a populated instance of Transaction + return new Result\Successful( + Transaction::factory($response['transaction']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + "Expected transaction or apiErrorResponse" + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php new file mode 100644 index 00000000000..2674a45cde5 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php @@ -0,0 +1,39 @@ +transactionLineItem()->findAll($transactionId); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php new file mode 100644 index 00000000000..d914eaee679 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php @@ -0,0 +1,69 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * Find all Transaction Line Items or return an error + * + * @param string $id of the Transaction to search for line items + * + * @return TransactionLineItem|Exception + */ + public function findAll($id) + { + $this->_validateId($id); + try { + $path = $this->_config->merchantPath() . '/transactions/' . $id . '/line_items'; + $response = $this->_http->get($path); + + $lineItems = []; + if (isset($response['lineItems'])) { + foreach ($response['lineItems'] as $lineItem) { + $lineItems[] = new TransactionLineItem($lineItem); + } + } + return $lineItems; + } catch (Exception\NotFound $e) { + throw new Exception\NotFound('transaction line items with id ' . $id . ' not found'); + } + } + + /** + * verifies that a valid transaction id is being used + * + * @param string transaction id + * + * @throws InvalidArgumentException + */ + private function _validateId($id = null) + { + if (empty($id)) { + throw new InvalidArgumentException('expected transaction id to be set'); + } + if (!preg_match('/^[0-9a-z]+$/', $id)) { + throw new InvalidArgumentException($id . ' is an invalid transaction id.'); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php new file mode 100644 index 00000000000..6efc6d3c06f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php @@ -0,0 +1,34 @@ +_initialize($attributes); + + return $instance; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + protected function _initialize($attributes) + { + $this->_attributes = $attributes; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php new file mode 100644 index 00000000000..9abb438d81a --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php @@ -0,0 +1,691 @@ +_initialize(array_shift($values)); + return $instance; + } + + /* instance methods */ + + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * sets instance properties from an array of values + * + * @param array $unknownPaymentMethodAttribs array of unknownPaymentMethod data + * + * @return void + */ + protected function _initialize($unknownPaymentMethodAttribs) + { + // set the attributes + $this->imageUrl = 'https://assets.braintreegateway.com/payment_method_logo/unknown.png'; + $this->_attributes = $unknownPaymentMethodAttribs; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php new file mode 100644 index 00000000000..fe7b0d94cc2 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php @@ -0,0 +1,103 @@ +_initialize($attributes); + return $instance; + } + + /** + * sets instance properties from an array of values + * + * @param array $usBankAccountAttribs array of usBankAccount data + * + * @return mixed + */ + protected function _initialize($usBankAccountAttribs) + { + // set the attributes + $this->_attributes = $usBankAccountAttribs; + + $achMandate = isset($usBankAccountAttribs['achMandate']) ? + AchMandate::factory($usBankAccountAttribs['achMandate']) : + null; + $this->_set('achMandate', $achMandate); + + if (isset($usBankAccountAttribs['verifications'])) { + $verification_records = $usBankAccountAttribs['verifications']; + + $verifications = array(); + for ($i = 0; $i < count($verification_records); $i++) { + $verifications[$i] = UsBankAccountVerification::factory($verification_records[$i]); + } + $this->_set('verifications', $verifications); + } else { + $this->_set('verifications', null); + } + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * Static methods redirecting to gateway class + * + * @param string $token the payment method identifier + * + * @see USBankAccountGateway::find() + * + * @return UsBankAccount|Error + */ + public static function find($token) + { + return Configuration::gateway()->usBankAccount()->find($token); + } + + /** + * DO NOT USE, Use Transaction#sale instead. If you do choose to use this function, note that the subsequent transaction (if successful) will be automatically submitted for settlement. + * + * @param string $token the payment method identifier + * @param array $transactionAttribs all other transaction parameters + * + * @return UsBankAccount|Error + */ + public static function sale($token, $transactionAttribs) + { + $transactionAttribs['options'] = [ + 'submitForSettlement' => true + ]; + return Configuration::gateway()->usBankAccount()->sale($token, $transactionAttribs); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php new file mode 100644 index 00000000000..2687ac23352 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php @@ -0,0 +1,99 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + + /** + * find a usBankAccount by token + * + * @param string $token paypal accountunique id + * + * @throws Exception\NotFound + * + * @return UsBankAccount + */ + public function find($token) + { + try { + $path = $this->_config->merchantPath() . '/payment_methods/us_bank_account/' . $token; + $response = $this->_http->get($path); + return UsBankAccount::factory($response['usBankAccount']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'US bank account with token ' . $token . ' not found' + ); + } + } + + /** + * create a new sale for the current UsBank account + * + * @param string $token payment method identifier + * @param array $transactionAttribs request parameters + * + * @see Transaction::sale() + * + * @return Result\Successful|Result\Error + */ + public function sale($token, $transactionAttribs) + { + return Transaction::sale( + array_merge( + $transactionAttribs, + ['paymentMethodToken' => $token] + ) + ); + } + + /** + * generic method for validating incoming gateway responses + * + * creates a new UsBankAccount object and encapsulates + * it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid. + * + * @param array $response gateway response values + * + * @throws Exception\Unexpected + * + * @return Result\Successful|Result\Error + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['usBankAccount'])) { + // return a populated instance of UsBankAccount + return new Result\Successful( + UsBankAccount::factory($response['usBankAccount']) + ); + } elseif (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + 'Expected US bank account or apiErrorResponse' + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php new file mode 100644 index 00000000000..4f69fa03092 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php @@ -0,0 +1,94 @@ +== More information == + */ +class UsBankAccountVerification extends Result\UsBankAccountVerification +{ + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return UsBankAccountVerification + */ + public static function factory($attributes) + { + $instance = new self($attributes); + $instance->_initialize($attributes); + return $instance; + } + + /* instance methods */ + + /** + * sets instance properties from an array of values + * + * @param array $usBankAccountVerificationAttribs array of usBankAccountVerification data + * + * @return void + */ + protected function _initialize($usBankAccountVerificationAttribs) + { + // set the attributes + $this->_attributes = $usBankAccountVerificationAttribs; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; + } + + + /** + * Static methods redirecting to gateway class + * + * @param string $token unique id + * + * @see UsBankAccountVerificationGateway::find() + * + * @return UsBankAccountVerification + */ + public static function find($token) + { + return Configuration::gateway()->usBankAccountVerification()->find($token); + } + + /** + * Static methods redirecting to gateway class + * + * @param mixed $query search query + * + * @see UsBankAccountVerificationGateway::search() + * + * @return ResourceCollection + */ + public static function search($query) + { + return Configuration::gateway()->usBankAccountVerification()->search($query); + } + + /** + * Static methods redirecting to gateway class + * + * @param string $token unique id + * @param array $amounts micro transfer amounts + * + * @see UsBankAccountVerificationGateway::confirmMicroTransferAmounts() + * + * @return ResourceCollection + */ + public static function confirmMicroTransferAmounts($token, $amounts) + { + return Configuration::gateway()->usBankAccountVerification()->confirmMicroTransferAmounts($token, $amounts); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php new file mode 100644 index 00000000000..03ba5a95f41 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php @@ -0,0 +1,133 @@ +== More information == + */ +class UsBankAccountVerificationGateway +{ + private $_gateway; + private $_config; + private $_http; + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __construct($gateway) + { + $this->_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * find a usBankAccountVerification by token + * + * @param string $token unique id + * + * @throws Exception\NotFound + * + * @return UsBankAccountVerification + */ + public function find($token) + { + try { + $path = $this->_config->merchantPath() . '/us_bank_account_verifications/' . $token; + $response = $this->_http->get($path); + return UsBankAccountVerification::factory($response['usBankAccountVerification']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'US bank account with token ' . $token . ' not found' + ); + } + } + + /** + * Returns a ResourceCollection of US bank account verifications matching the search query. + * + * @param mixed $query search query + * + * @return ResourceCollection + */ + public function search($query) + { + $criteria = []; + foreach ($query as $term) { + $criteria[$term->name] = $term->toparam(); + } + + $path = $this->_config->merchantPath() . '/us_bank_account_verifications/advanced_search_ids'; + $response = $this->_http->post($path, ['search' => $criteria]); + $pager = [ + 'object' => $this, + 'method' => 'fetch', + 'methodArgs' => [$query] + ]; + + return new ResourceCollection($response, $pager); + } + + /** + * complete micro transfer verification by confirming the transfer amounts + * + * @param string $token unique id + * @param array $amounts amounts deposited in micro transfer + * + * @throws Exception\Unexpected + * + * @return UsBankAccountVerification + */ + public function confirmMicroTransferAmounts($token, $amounts) + { + try { + // phpcs:ignore Generic.Files.LineLength + $path = $this->_config->merchantPath() . '/us_bank_account_verifications/' . $token . '/confirm_micro_transfer_amounts'; + $response = $this->_http->put($path, [ + "us_bank_account_verification" => ["deposit_amounts" => $amounts] + ]); + return $this->_verifyGatewayResponse($response); + } catch (Exception\Unexpected $e) { + throw new Exception\Unexpected( + 'Unexpected exception.' + ); + } + } + + /** + * generic method for validating incoming gateway responses + * + * creates a new UsBankAccountVerification object and encapsulates + * it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid. + * + * @param array $response gateway response values + * + * @throws Exception\Unexpected + * + * @return Result\Successful|Result\Error + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } elseif (isset($response['usBankAccountVerification'])) { + // return a populated instance of UsBankAccountVerification + return new Result\Successful( + UsBankAccountVerification::factory($response['usBankAccountVerification']) + ); + } else { + throw new Exception\Unexpected( + 'Expected US bank account or apiErrorResponse' + ); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php new file mode 100644 index 00000000000..fb9628f104a --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php @@ -0,0 +1,136 @@ +success) { + return $resultObj->$resultObjName; + } else { + throw new Exception\ValidationsFailed(); + } + } + + /** + * removes the header from a classname + * + * @param string $name ClassName + * + * @return camelCased classname minus header + */ + public static function cleanClassName($name) + { + $classNamesToResponseKeys = [ + 'Braintree\CreditCard' => 'creditCard', + 'Braintree\CreditCardGateway' => 'creditCard', + 'Braintree\Customer' => 'customer', + 'Braintree\CustomerGateway' => 'customer', + 'Braintree\Subscription' => 'subscription', + 'Braintree\SubscriptionGateway' => 'subscription', + 'Braintree\Transaction' => 'transaction', + 'Braintree\TransactionGateway' => 'transaction', + 'Braintree\CreditCardVerification' => 'verification', + 'Braintree\CreditCardVerificationGateway' => 'verification', + 'Braintree\AddOn' => 'addOn', + 'Braintree\AddOnGateway' => 'addOn', + 'Braintree\Discount' => 'discount', + 'Braintree\DiscountGateway' => 'discount', + 'Braintree\Dispute' => 'dispute', + 'Braintree\Dispute\EvidenceDetails' => 'evidence', + 'Braintree\DocumentUpload' => 'documentUpload', + 'Braintree\Plan' => 'plan', + 'Braintree\PlanGateway' => 'plan', + 'Braintree\Address' => 'address', + 'Braintree\AddressGateway' => 'address', + 'Braintree\SettlementBatchSummary' => 'settlementBatchSummary', + 'Braintree\SettlementBatchSummaryGateway' => 'settlementBatchSummary', + 'Braintree\Merchant' => 'merchant', + 'Braintree\MerchantGateway' => 'merchant', + 'Braintree\MerchantAccount' => 'merchantAccount', + 'Braintree\MerchantAccountGateway' => 'merchantAccount', + 'Braintree\OAuthCredentials' => 'credentials', + 'Braintree\OAuthResult' => 'result', + 'Braintree\PayPalAccount' => 'paypalAccount', + 'Braintree\PayPalAccountGateway' => 'paypalAccount', + 'Braintree\UsBankAccountVerification' => 'usBankAccountVerification', + ]; + + return $classNamesToResponseKeys[$name]; + } + + /** + * Returns corresponding class name based on response keys + * + * @param string $name className + * + * @return string ClassName + */ + public static function buildClassName($name) + { + $responseKeysToClassNames = [ + 'creditCard' => 'Braintree\CreditCard', + 'customer' => 'Braintree\Customer', + 'dispute' => 'Braintree\Dispute', + 'documentUpload' => 'Braintree\DocumentUpload', + 'subscription' => 'Braintree\Subscription', + 'transaction' => 'Braintree\Transaction', + 'verification' => 'Braintree\CreditCardVerification', + 'addOn' => 'Braintree\AddOn', + 'discount' => 'Braintree\Discount', + 'plan' => 'Braintree\Plan', + 'address' => 'Braintree\Address', + 'settlementBatchSummary' => 'Braintree\SettlementBatchSummary', + 'merchantAccount' => 'Braintree\MerchantAccount', + ]; + + return (string) $responseKeysToClassNames[$name]; + } + + /** + * convert alpha-beta-gamma to alphaBetaGamma + * + * @param string $string to be scrubbed for camelCase formatting + * @param null|string $delimiter to be replaced + * + * @return string modified string + */ + public static function delimiterToCamelCase($string, $delimiter = '[\-\_]') + { + static $callback = null; + if ($callback === null) { + $callback = function ($matches) { + return strtoupper($matches[1]); + }; + } + + return preg_replace_callback('/' . $delimiter . '(\w)/', $callback, $string); + } + + /** + * convert alpha-beta-gamma to alpha_beta_gamma + * + * @param string $string to be modified + * + * @return string modified string + */ + public static function delimiterToUnderscore($string) + { + return preg_replace('/-/', '_', $string); + } + + + /** + * find capitals and convert to delimiter + lowercase + * + * @param string $string to be scrubbed + * @param null|string $delimiter to replace camelCase + * + * @return string modified string + */ + public static function camelCaseToDelimiter($string, $delimiter = '-') + { + return strtolower(preg_replace('/([A-Z])/', "$delimiter\\1", $string)); + } + + /** + * converts a-string-here to [aStringHere] + * + * @param array $array to be iterated over + * @param null|string $delimiter to be replaced with camelCase + * + * @return array modified array + */ + public static function delimiterToCamelCaseArray($array, $delimiter = '[\-\_]') + { + $converted = []; + foreach ($array as $key => $value) { + if (is_string($key)) { + $key = self::delimiterToCamelCase($key, $delimiter); + } + + if (is_array($value)) { + // Make an exception for custom fields, which must be underscore (can't be + // camelCase). + if ($key === 'customFields') { + $value = self::delimiterToUnderscoreArray($value); + } else { + $value = self::delimiterToCamelCaseArray($value, $delimiter); + } + } + $converted[$key] = $value; + } + return $converted; + } + + /** + * find capitals and convert to delimiter + lowercase + * + * @param array $array to be iterated over + * @param null|string $delimiter to replace camelCase + * + * @return array modified array + */ + public static function camelCaseToDelimiterArray($array, $delimiter = '-') + { + $converted = []; + foreach ($array as $key => $value) { + if (is_string($key)) { + $key = self::camelCaseToDelimiter($key, $delimiter); + } + if (is_array($value)) { + $value = self::camelCaseToDelimiterArray($value, $delimiter); + } + $converted[$key] = $value; + } + return $converted; + } + + /** + * converts a-string-here to [a_string_here] + * + * @param array $array to be iterated over + * + * @return array modified array + */ + public static function delimiterToUnderscoreArray($array) + { + $converted = []; + foreach ($array as $key => $value) { + $key = self::delimiterToUnderscore($key); + $converted[$key] = $value; + } + return $converted; + } + + /** + * Join arrays with string or return false + * + * @param array $array associative array to implode + * @param string $separator (optional, defaults to =) + * @param string $glue (optional, defaults to ', ') + * + * @return string|false + */ + public static function implodeAssociativeArray($array, $separator = '=', $glue = ', ') + { + // build a new array with joined keys and values + $tmpArray = null; + foreach ($array as $key => $value) { + if ($value instanceof DateTime) { + $value = $value->format('r'); + } + $tmpArray[] = $key . $separator . $value; + } + // implode and return the new array + return (is_array($tmpArray)) ? implode($glue, $tmpArray) : false; + } + + /* + * Turn all attributes into a string + * + * @param array $attributes to be turned into a string + * + * @return string|false + */ + public static function attributesToString($attributes) + { + $printableAttribs = []; + foreach ($attributes as $key => $value) { + if (is_array($value)) { + $pAttrib = self::attributesToString($value); + } elseif ($value instanceof DateTime) { + $pAttrib = $value->format(DateTime::RFC850); + } else { + $pAttrib = $value; + } + $printableAttribs[$key] = sprintf('%s', $pAttrib); + } + return self::implodeAssociativeArray($printableAttribs); + } + + /** + * verify user request structure + * + * compares the expected signature of a gateway request + * against the actual structure sent by the user + * + * @param array $signature expected signature + * @param array $attributes actual structure sent by user + * + * @throws InvalidArgumentException + * + * @return self + */ + public static function verifyKeys($signature, $attributes) + { + $validKeys = self::_flattenArray($signature); + $userKeys = self::_flattenUserKeys($attributes); + $invalidKeys = array_diff($userKeys, $validKeys); + $invalidKeys = self::_removeWildcardKeys($validKeys, $invalidKeys); + + if (!empty($invalidKeys)) { + asort($invalidKeys); + $sortedList = join(', ', $invalidKeys); + throw new InvalidArgumentException('invalid keys: ' . $sortedList); + } + } + + /** + * replaces the value of a key in an array + * + * @param array $array to have key replaced + * @param string $oldKey to be replace + * @param string $newKey to replace + * + * @return array + */ + public static function replaceKey($array, $oldKey, $newKey) + { + if (array_key_exists($oldKey, $array)) { + $array[$newKey] = $array[$oldKey]; + unset($array[$oldKey]); + } + return $array; + } + + /** + * flattens a numerically indexed nested array to a single level + * + * @param array $keys + * @param string $namespace + * + * @return array + */ + private static function _flattenArray($keys, $namespace = null) + { + $flattenedArray = []; + foreach ($keys as $key) { + if (is_array($key)) { + $theKeys = array_keys($key); + $theValues = array_values($key); + $scope = $theKeys[0]; + $fullKey = empty($namespace) ? $scope : $namespace . '[' . $scope . ']'; + $flattenedArray = array_merge($flattenedArray, self::_flattenArray($theValues[0], $fullKey)); + } else { + $fullKey = empty($namespace) ? $key : $namespace . '[' . $key . ']'; + $flattenedArray[] = $fullKey; + } + } + sort($flattenedArray); + return $flattenedArray; + } + + private static function _flattenUserKeys($keys, $namespace = null) + { + $flattenedArray = []; + + foreach ($keys as $key => $value) { + $fullKey = empty($namespace) ? $key : $namespace; + if (!is_numeric($key) && $namespace != null) { + $fullKey .= '[' . $key . ']'; + } + if (is_numeric($key) && is_string($value)) { + $fullKey .= '[' . $value . ']'; + } + if (is_array($value)) { + $more = self::_flattenUserKeys($value, $fullKey); + $flattenedArray = array_merge($flattenedArray, $more); + } else { + $flattenedArray[] = $fullKey; + } + } + sort($flattenedArray); + return $flattenedArray; + } + + /** + * removes wildcard entries from the invalid keys array + * + * @param array $validKeys + * @param $invalidKey) { + if (stristr($invalidKey, $wildcardKey)) { + unset($invalidKeys[$index]); + } + } + } + } + return $invalidKeys; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php new file mode 100644 index 00000000000..abdba83b479 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php @@ -0,0 +1,59 @@ +default; + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return VenmoAccount + */ + public static function factory($attributes) + { + + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + /** + * sets instance properties from an array of values + * + * @param array $venmoAccountAttribs array of Venmo account properties + * + * @return void + */ + protected function _initialize($venmoAccountAttribs) + { + $this->_attributes = $venmoAccountAttribs; + + $subscriptionArray = array(); + if (isset($venmoAccountAttribs['subscriptions'])) { + foreach ($venmoAccountAttribs['subscriptions'] as $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php new file mode 100644 index 00000000000..a9920d7c132 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php @@ -0,0 +1,36 @@ +_initialize($attributes); + return $instance; + } + + protected function _initialize($venmoProfileDataAttribs) + { + $this->_attributes = $venmoProfileDataAttribs; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php new file mode 100644 index 00000000000..b7e29367653 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php @@ -0,0 +1,28 @@ +default; + } + + /** + * checks whether the card is expired based on the current date + * + * @return boolean + */ + public function isExpired() + { + return $this->expired; + } + + /** + * sets instance properties from an array of values + * + * @param array $creditCardAttribs array of creditcard data + * + * @return void + */ + protected function _initialize($creditCardAttribs) + { + // set the attributes + $this->_attributes = $creditCardAttribs; + + // map each address into its own object + $billingAddress = isset($creditCardAttribs['billingAddress']) ? + Address::factory($creditCardAttribs['billingAddress']) : + null; + + $subscriptionArray = []; + if (isset($creditCardAttribs['subscriptions'])) { + foreach ($creditCardAttribs['subscriptions'] as $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + $this->_set('billingAddress', $billingAddress); + $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); + $this->_set('maskedNumber', $this->bin . '******' . $this->last4); + + if (isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) { + $verifications = $creditCardAttribs['verifications']; + usort($verifications, [$this, '_compareCreatedAtOnVerifications']); + + $this->_set('verification', CreditCardVerification::factory($verifications[0])); + } + } + + private function _compareCreatedAtOnVerifications($verificationAttrib1, $verificationAttrib2) + { + return ($verificationAttrib2['createdAt'] < $verificationAttrib1['createdAt']) ? -1 : 1; + } + + /** + * returns false if comparing object is not a VisaCheckoutCard, + * or is a VisaCheckoutCard with a different id + * + * @param object $otherVisaCheckoutCard customer to compare against + * + * @return boolean + */ + public function isEqual($otherVisaCheckoutCard) + { + return !($otherVisaCheckoutCard instanceof self) ? false : $this->token === $otherVisaCheckoutCard->token; + } + + // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return VisaCheckoutCard + */ + public static function factory($attributes) + { + $defaultAttributes = [ + 'bin' => '', + 'expirationMonth' => '', + 'expirationYear' => '', + 'last4' => '', + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php new file mode 100644 index 00000000000..dbd686d714c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php @@ -0,0 +1,188 @@ +webhookNotification()->parse($signature, $payload); + } + + /* + * Static methods redirecting to gateway class + * + * @param object $challenge to be verified + * + * @see WebHookNotificationGateway::verify() + * + * @return string|Exception + */ + public static function verify($challenge) + { + return Configuration::gateway()->webhookNotification()->verify($challenge); + } + + /** + * Creates an instance from given attributes + * + * @param array $attributes response object attributes + * + * @return WebhookNotification + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + protected function _initialize($attributes) + { + // phpcs:disable Generic.Files.LineLength + $this->_attributes = $attributes; + + if (!isset($attributes['sourceMerchantId'])) { + $this->_set('sourceMerchantId', null); + } + + if (isset($attributes['subject']['apiErrorResponse'])) { + $wrapperNode = $attributes['subject']['apiErrorResponse']; + } else { + $wrapperNode = $attributes['subject']; + } + + if (isset($wrapperNode['subscription'])) { + $this->_set('subscription', Subscription::factory($attributes['subject']['subscription'])); + } + + if (isset($wrapperNode['merchantAccount'])) { + $this->_set('merchantAccount', MerchantAccount::factory($wrapperNode['merchantAccount'])); + } + + if (isset($wrapperNode['transaction'])) { + $this->_set('transaction', Transaction::factory($wrapperNode['transaction'])); + } + + if (isset($wrapperNode['transactionReview'])) { + $this->_set('transactionReview', TransactionReview::factory($wrapperNode['transactionReview'])); + } + + if (isset($wrapperNode['disbursement'])) { + $this->_set('disbursement', Disbursement::factory($wrapperNode['disbursement'])); + } + + if (isset($wrapperNode['partnerMerchant'])) { + $this->_set('partnerMerchant', PartnerMerchant::factory($wrapperNode['partnerMerchant'])); + } + + if (isset($wrapperNode['oauthApplicationRevocation'])) { + $this->_set('oauthAccessRevocation', OAuthAccessRevocation::factory($wrapperNode['oauthApplicationRevocation'])); + } + + if (isset($wrapperNode['connectedMerchantStatusTransitioned'])) { + $this->_set('connectedMerchantStatusTransitioned', ConnectedMerchantStatusTransitioned::factory($wrapperNode['connectedMerchantStatusTransitioned'])); + } + + if (isset($wrapperNode['connectedMerchantPaypalStatusChanged'])) { + $this->_set('connectedMerchantPayPalStatusChanged', ConnectedMerchantPayPalStatusChanged::factory($wrapperNode['connectedMerchantPaypalStatusChanged'])); + } + + if (isset($wrapperNode['dispute'])) { + $this->_set('dispute', Dispute::factory($wrapperNode['dispute'])); + } + + if (isset($wrapperNode['accountUpdaterDailyReport'])) { + $this->_set('accountUpdaterDailyReport', AccountUpdaterDailyReport::factory($wrapperNode['accountUpdaterDailyReport'])); + } + + if (isset($wrapperNode['grantedPaymentInstrumentUpdate'])) { + $this->_set('grantedPaymentInstrumentUpdate', GrantedPaymentInstrumentUpdate::factory($wrapperNode['grantedPaymentInstrumentUpdate'])); + } + + if (in_array($attributes['kind'], [self::GRANTED_PAYMENT_METHOD_REVOKED, self::PAYMENT_METHOD_REVOKED_BY_CUSTOMER])) { + $this->_set('revokedPaymentMethodMetadata', RevokedPaymentMethodMetadata::factory($wrapperNode)); + } + + if (isset($wrapperNode['localPayment'])) { + $this->_set('localPaymentCompleted', LocalPaymentCompleted::factory($wrapperNode['localPayment'])); + } + + if (isset($wrapperNode['localPaymentExpired'])) { + $this->_set('localPaymentExpired', LocalPaymentExpired::factory($wrapperNode['localPaymentExpired'])); + } + + if (isset($wrapperNode['localPaymentFunded'])) { + $this->_set('localPaymentFunded', LocalPaymentFunded::factory($wrapperNode['localPaymentFunded'])); + } + + if (isset($wrapperNode['localPaymentReversed'])) { + $this->_set('localPaymentReversed', LocalPaymentReversed::factory($wrapperNode['localPaymentReversed'])); + } + + if (isset($wrapperNode['paymentMethodCustomerDataUpdatedMetadata'])) { + $this->_set('paymentMethodCustomerDataUpdatedMetadata', PaymentMethodCustomerDataUpdatedMetadata::factory($wrapperNode['paymentMethodCustomerDataUpdatedMetadata'])); + } + + if (isset($wrapperNode['errors'])) { + $this->_set('errors', new Error\ValidationErrorCollection($wrapperNode['errors'])); + $this->_set('message', $wrapperNode['message']); + } + // phpcs:enable Generic.Files.LineLength + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php new file mode 100644 index 00000000000..a84e1c2dd22 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php @@ -0,0 +1,98 @@ +config = $gateway->config; + $this->config->assertHasAccessTokenOrKeys(); + } + + /** + * Parses a webhook from the Braintree API + * + * @param string $signature used to verify before parsing + * @param mixed $payload to be parsed + * + * @throws Exception\InvalidSignature + * + * @return WebhookNotification object + */ + public function parse($signature, $payload) + { + if (is_null($signature)) { + throw new Exception\InvalidSignature("signature cannot be null"); + } + + if (is_null($payload)) { + throw new Exception\InvalidSignature("payload cannot be null"); + } + + if (preg_match("/[^A-Za-z0-9+=\/\n]/", $payload) === 1) { + throw new Exception\InvalidSignature("payload contains illegal characters"); + } + + self::_validateSignature($signature, $payload); + + $xml = base64_decode($payload); + $attributes = Xml::buildArrayFromXml($xml); + return WebhookNotification::factory($attributes['notification']); + } + + /* + * Verify a webhook challenge + * + * @param object $challenge to be verified + * + * @throws Exception\InvalidChallenge + * + * @return string + */ + public function verify($challenge) + { + if (!preg_match('/^[a-f0-9]{20,32}$/', $challenge)) { + throw new Exception\InvalidChallenge("challenge contains non-hex characters"); + } + $publicKey = $this->config->getPublicKey(); + $digest = Digest::hexDigestSha1($this->config->getPrivateKey(), $challenge); + return "{$publicKey}|{$digest}"; + } + + private function _payloadMatches($signature, $payload) + { + $payloadSignature = Digest::hexDigestSha1($this->config->getPrivateKey(), $payload); + return Digest::secureCompare($signature, $payloadSignature); + } + + private function _validateSignature($signatureString, $payload) + { + $signaturePairs = preg_split("/&/", $signatureString); + $signature = self::_matchingSignature($signaturePairs); + if (!$signature) { + throw new Exception\InvalidSignature("no matching public key"); + } + + if (!(self::_payloadMatches($signature, $payload) || self::_payloadMatches($signature, $payload . "\n"))) { + throw new Exception\InvalidSignature("signature does not match payload - one has been modified"); + } + } + + private function _matchingSignature($signaturePairs) + { + foreach ($signaturePairs as $pair) { + $components = preg_split("/\|/", $pair); + if ($components[0] == $this->config->getPublicKey()) { + return $components[1]; + } + } + + return null; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php new file mode 100644 index 00000000000..4c21356578d --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php @@ -0,0 +1,11 @@ +webhookTesting()->sampleNotification($kind, $id, $sourceMerchantId); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php new file mode 100644 index 00000000000..2fc0b17bbb7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php @@ -0,0 +1,813 @@ +config = $gateway->config; + $this->config->assertHasAccessTokenOrKeys(); + } + + /** + * Build a sample Webhook + * + * @param string $kind the kind of Webhook you want to generate + * @param string $id unique identifier + * @param string $sourceMerchantId optional + * + * @return Webhook + */ + public function sampleNotification($kind, $id, $sourceMerchantId = null) + { + $xml = self::_sampleXml($kind, $id, $sourceMerchantId); + $payload = base64_encode($xml) . "\n"; + $publicKey = $this->config->getPublicKey(); + $sha = Digest::hexDigestSha1($this->config->getPrivateKey(), $payload); + $signature = $publicKey . "|" . $sha; + + return [ + 'bt_signature' => $signature, + 'bt_payload' => $payload + ]; + } + + private static function _sampleXml($kind, $id, $sourceMerchantId) + { + switch ($kind) { + case WebhookNotification::SUB_MERCHANT_ACCOUNT_APPROVED: + $subjectXml = self::_merchantAccountApprovedSampleXml($id); + break; + case WebhookNotification::SUB_MERCHANT_ACCOUNT_DECLINED: + $subjectXml = self::_merchantAccountDeclinedSampleXml($id); + break; + case WebhookNotification::TRANSACTION_DISBURSED: + $subjectXml = self::_transactionDisbursedSampleXml($id); + break; + case WebhookNotification::TRANSACTION_REVIEWED: + $subjectXml = self::_transactionReviewedSampleXml($id); + break; + case WebhookNotification::TRANSACTION_SETTLED: + $subjectXml = self::_transactionSettledSampleXml($id); + break; + case WebhookNotification::TRANSACTION_SETTLEMENT_DECLINED: + $subjectXml = self::_transactionSettlementDeclinedSampleXml($id); + break; + case WebhookNotification::DISBURSEMENT_EXCEPTION: + $subjectXml = self::_disbursementExceptionSampleXml($id); + break; + case WebhookNotification::DISBURSEMENT: + $subjectXml = self::_disbursementSampleXml($id); + break; + case WebhookNotification::PARTNER_MERCHANT_CONNECTED: + $subjectXml = self::_partnerMerchantConnectedSampleXml($id); + break; + case WebhookNotification::PARTNER_MERCHANT_DISCONNECTED: + $subjectXml = self::_partnerMerchantDisconnectedSampleXml($id); + break; + case WebhookNotification::PARTNER_MERCHANT_DECLINED: + $subjectXml = self::_partnerMerchantDeclinedSampleXml($id); + break; + case WebhookNotification::OAUTH_ACCESS_REVOKED: + $subjectXml = self::_oauthAccessRevocationSampleXml($id); + break; + case WebhookNotification::CONNECTED_MERCHANT_STATUS_TRANSITIONED: + $subjectXml = self::_connectedMerchantStatusTransitionedSampleXml($id); + break; + case WebhookNotification::CONNECTED_MERCHANT_PAYPAL_STATUS_CHANGED: + $subjectXml = self::_connectedMerchantPayPalStatusChangedSampleXml($id); + break; + case WebhookNotification::DISPUTE_OPENED: + $subjectXml = self::_disputeOpenedSampleXml($id); + break; + case WebhookNotification::DISPUTE_LOST: + $subjectXml = self::_disputeLostSampleXml($id); + break; + case WebhookNotification::DISPUTE_WON: + $subjectXml = self::_disputeWonSampleXml($id); + break; + case WebhookNotification::DISPUTE_ACCEPTED: + $subjectXml = self::_disputeAcceptedSampleXml($id); + break; + case WebhookNotification::DISPUTE_DISPUTED: + $subjectXml = self::_disputeDisputedSampleXml($id); + break; + case WebhookNotification::DISPUTE_EXPIRED: + $subjectXml = self::_disputeExpiredSampleXml($id); + break; + case WebhookNotification::SUBSCRIPTION_CHARGED_SUCCESSFULLY: + $subjectXml = self::_subscriptionChargedSuccessfullySampleXml($id); + break; + case WebhookNotification::SUBSCRIPTION_CHARGED_UNSUCCESSFULLY: + $subjectXml = self::_subscriptionChargedUnsuccessfullySampleXml($id); + break; + case WebhookNotification::SUBSCRIPTION_EXPIRED: + $subjectXml = self::_subscriptionExpiredSampleXml($id); + break; + case WebhookNotification::SUBSCRIPTION_CANCELED: + $subjectXml = self::_subscriptionCanceledSampleXml($id); + break; + case WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE: + $subjectXml = self::_subscriptionWentPastDueSampleXml($id); + break; + case WebhookNotification::CHECK: + $subjectXml = self::_checkSampleXml(); + break; + case WebhookNotification::ACCOUNT_UPDATER_DAILY_REPORT: + $subjectXml = self::_accountUpdaterDailyReportSampleXml($id); + break; + case WebhookNotification::GRANTOR_UPDATED_GRANTED_PAYMENT_METHOD: + $subjectXml = self::_grantedPaymentInstrumentUpdateSampleXml(); + break; + case WebhookNotification::RECIPIENT_UPDATED_GRANTED_PAYMENT_METHOD: + $subjectXml = self::_grantedPaymentInstrumentUpdateSampleXml(); + break; + case WebhookNotification::GRANTED_PAYMENT_METHOD_REVOKED: + $subjectXml = self::_venmoAccountXml($id); + break; + case WebhookNotification::PAYMENT_METHOD_REVOKED_BY_CUSTOMER: + $subjectXml = self::_paymentMethodRevokedByCustomerSampleXml($id); + break; + case WebhookNotification::LOCAL_PAYMENT_COMPLETED: + $subjectXml = self::_localPaymentCompletedSampleXml(); + break; + case WebhookNotification::LOCAL_PAYMENT_EXPIRED: + $subjectXml = self::_localPaymentExpiredSampleXml(); + break; + case WebhookNotification::LOCAL_PAYMENT_FUNDED: + $subjectXml = self::_localPaymentFundedSampleXml(); + break; + case WebhookNotification::LOCAL_PAYMENT_REVERSED: + $subjectXml = self::_localPaymentReversedSampleXml(); + break; + case WebhookNotification::PAYMENT_METHOD_CUSTOMER_DATA_UPDATED: + $subjectXml = self::_paymentMethodCustomerDataUpdatedSampleXml($id); + break; + default: + $subjectXml = self::_subscriptionSampleXml($id); + break; + } + $timestamp = self::_timestamp(); + + $sourceMerchantIdXml = ''; + if (!is_null($sourceMerchantId)) { + $sourceMerchantIdXml = "{$sourceMerchantId}"; + } + + return " + + {$timestamp} + {$kind} + {$sourceMerchantIdXml} + {$subjectXml} + + "; + } + + private static function _merchantAccountApprovedSampleXml($id) + { + return " + + {$id} + + master_ma_for_{$id} + active + + active + + "; + } + + private static function _merchantAccountDeclinedSampleXml($id) + { + return " + + Credit score is too low + + + + + + 82621 + Credit score is too low + base + + + + + + {$id} + suspended + + master_ma_for_{$id} + suspended + + + + "; + } + + private static function _transactionDisbursedSampleXml($id) + { + return " + + ${id} + 100 + + 2013-07-09 + + + "; + } + + private static function _transactionReviewedSampleXml($id) + { + return " + + my_id + smart_decision + hey@girl.com + I reviewed this + 2018-10-11T21:28:37Z + + "; + } + + private static function _transactionSettledSampleXml($id) + { + return " + + ${id} + settled + sale + USD + 100.00 + ogaotkivejpfayqfeaimuktty + us_bank_account + + 123456789 + 1234 + checking + Dan Schulman + + + "; + } + + private static function _transactionSettlementDeclinedSampleXml($id) + { + return " + + ${id} + settlement_declined + sale + USD + 100.00 + ogaotkivejpfayqfeaimuktty + us_bank_account + + 123456789 + 1234 + checking + Dan Schulman + + + "; + } + + private static function _disbursementExceptionSampleXml($id) + { + return " + + ${id} + + asdfg + qwert + + false + false + + merchant_account_token + USD + false + active + + 100.00 + 2014-02-10 + bank_rejected + update_funding_information + + "; + } + + private static function _disbursementSampleXml($id) + { + return " + + ${id} + + asdfg + qwert + + true + false + + merchant_account_token + USD + false + active + + 100.00 + 2014-02-10 + + + + "; + } + + private static function _disputeOpenedSampleXml($id) + { + return " + + 250.00 + 250.0 + 245.00 + USD + 2014-03-01 + 2014-03-21 + chargeback + open + fraud + ${id} + + ${id} + 250.00 + + 2014-03-21 + + "; + } + + private static function _disputeLostSampleXml($id) + { + return " + + 250.00 + 250.0 + 245.00 + USD + 2014-03-01 + 2014-03-21 + chargeback + lost + fraud + ${id} + + ${id} + 250.00 + 2020-02-10 + + 2014-03-21 + + "; + } + + private static function _disputeWonSampleXml($id) + { + return " + + 250.00 + 250.0 + 245.00 + USD + 2014-03-01 + 2014-03-21 + chargeback + won + fraud + ${id} + + ${id} + 250.00 + + 2014-03-21 + 2014-03-22 + + "; + } + + private static function _disputeAcceptedSampleXml($id) + { + return " + + 250.00 + 250.0 + 245.00 + USD + 2014-03-01 + 2014-03-21 + chargeback + accepted + fraud + ${id} + + ${id} + 250.00 + + 2014-03-21 + + "; + } + + private static function _disputeDisputedSampleXml($id) + { + return " + + 250.00 + 250.0 + 245.00 + USD + 2014-03-01 + 2014-03-21 + chargeback + disputed + fraud + ${id} + + ${id} + 250.00 + + 2014-03-21 + + "; + } + + private static function _disputeExpiredSampleXml($id) + { + return " + + 250.00 + 250.0 + 245.00 + USD + 2014-03-01 + 2014-03-21 + chargeback + expired + fraud + ${id} + + ${id} + 250.00 + + 2014-03-21 + + "; + } + + private static function _subscriptionSampleXml($id) + { + return " + + {$id} + Active + + + + + + + + "; + } + + private static function _subscriptionChargedSuccessfullySampleXml($id) + { + return " + + {$id} + Active + 2016-03-21 + 2017-03-31 + + + {$id} + submitted_for_settlement + 49.99 + + + + + + + + "; + } + + private static function _subscriptionChargedUnsuccessfullySampleXml($id) + { + return " + + {$id} + Active + 2016-03-21 + 2017-03-31 + + + {$id} + failed + 49.99 + + + + + + + + "; + } + + private static function _subscriptionExpiredSampleXml($id) + { + return " + + {$id} + Expired + + + + + + + + "; + } + + private static function _subscriptionCanceledSampleXml($id) + { + return " + + {$id} + Canceled + + + + + + + + "; + } + + private static function _subscriptionWentPastDueSampleXml($id) + { + return " + + {$id} + Past Due + + + + + + + + "; + } + + private static function _checkSampleXml() + { + return " + true + "; + } + + private static function _partnerMerchantConnectedSampleXml($id) + { + return " + + public_id + public_key + private_key + abc123 + cse_key + + "; + } + + private static function _partnerMerchantDisconnectedSampleXml($id) + { + return " + + abc123 + + "; + } + + private static function _partnerMerchantDeclinedSampleXml($id) + { + return " + + abc123 + + "; + } + + private static function _oauthAccessRevocationSampleXml($id) + { + return " + + {$id} + oauth_application_client_id + + "; + } + + private static function _accountUpdaterDailyReportSampleXml($id) + { + return " + + 2016-01-14 + link-to-csv-report + + "; + } + + private static function _connectedMerchantStatusTransitionedSampleXml($id) + { + return " + + {$id} + new_status + oauth_application_client_id + + "; + } + + private static function _connectedMerchantPayPalStatusChangedSampleXml($id) + { + return " + + {$id} + link + oauth_application_client_id + + "; + } + + private static function _grantedPaymentInstrumentUpdateSampleXml() + { + return " + + vczo7jqrpwrsi2px + cf0i8wgarszuy6hc + + ee257d98-de40-47e8-96b3-a6954ea7a9a4 + false + false + + abc123z + + expiration-month + expiration-year + + + "; + } + + private static function _paymentMethodRevokedByCustomerSampleXml($id) + { + return " + + a-billing-agreement-id + 2019-01-01T12:00:00Z + a-customer-id + true + name@email.com + cGF5bWVudG1ldGhvZF9jaDZieXNz + https://assets.braintreegateway.com/payment_method_logo/paypal.png?environment=test + + {$id} + 2019-01-02T12:00:00Z + + a-payer-id + + + 2019-01-02T12:00:00Z + + "; + } + + private static function _localPaymentCompletedSampleXml() + { + return " + + a-payment-id + a-payer-id + ee257d98-de40-47e8-96b3-a6954ea7a9a4 + + 1 + authorizing + 10.00 + order1234 + + + "; + } + + private static function _localPaymentExpiredSampleXml() + { + return " + + a-payment-id + a-payment-context-id + + "; + } + + private static function _localPaymentFundedSampleXml() + { + return " + + a-payment-id + a-payment-context-id + + 1 + settled + 10.00 + order1234 + + + "; + } + + private static function _localPaymentReversedSampleXml() + { + return " + + a-payment-id + + "; + } + + private static function _paymentMethodCustomerDataUpdatedSampleXml($id) + { + $venmoAccountXml = self::_venmoAccountXml($id); + return " + + TOKEN-12345 + + {$venmoAccountXml} + + 2022-01-01T21:28:37Z + + + firstName + + + venmo_username + John + Doe + 1231231234 + john.doe@paypal.com + + + + "; + } + + private static function _venmoAccountXml($id) + { + return " + + 2018-10-11T21:28:37Z + 2018-10-11T21:28:37Z + true + https://assets.braintreegateway.com/payment_method_logo/venmo.png?environment=test + {$id} + Venmo Account: venmojoe + venmojoe + 456 + + venmo_customer_id + cGF5bWVudG1ldGhvZF92ZW5tb2FjY291bnQ + + "; + } + + private static function _timestamp() + { + $originalZone = date_default_timezone_get(); + date_default_timezone_set('UTC'); + $timestamp = date("Y-m-d\TH:i:s\Z", time()); + date_default_timezone_set($originalZone); + + return $timestamp; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php new file mode 100644 index 00000000000..801ceb639b1 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php @@ -0,0 +1,39 @@ +openMemory(); + + $writer->setIndent(true); + $writer->setIndentString(' '); + $writer->startDocument('1.0', 'UTF-8'); + + // get the root element name + $aKeys = array_keys($aData); + $rootElementName = $aKeys[0]; + // open the root element + $writer->startElement($rootElementName); + // create the body + self::_createElementsFromArray($writer, $aData[$rootElementName], $rootElementName); + + // close the root element and document + $writer->endElement(); + $writer->endDocument(); + + // send the output as string + return $writer->outputMemory(); + } + + /** + * Construct XML elements with attributes from an associative array. + * + * @param object $writer XMLWriter object + * @param array $aData contains attributes and values + * + * @return void + */ + private static function _createElementsFromArray(&$writer, $aData) + { + if (!is_array($aData)) { + if (is_bool($aData)) { + $writer->text($aData ? 'true' : 'false'); + } else { + $writer->text($aData); + } + return; + } + foreach ($aData as $elementName => $element) { + // handle child elements + $writer->startElement($elementName); + if (is_array($element)) { + if (array_key_exists(0, $element) || empty($element)) { + $writer->writeAttribute('type', 'array'); + foreach ($element as $ignored => $itemInArray) { + $writer->startElement('item'); + self::_createElementsFromArray($writer, $itemInArray); + $writer->endElement(); + } + } else { + self::_createElementsFromArray($writer, $element); + } + } else { + // generate attributes as needed + $attribute = self::_generateXmlAttribute($element); + if (is_array($attribute)) { + $writer->writeAttribute($attribute[0], $attribute[1]); + $element = $attribute[2]; + } + if (!is_null($element)) { + $writer->text($element); + } else { + $writer->text(""); + } + } + $writer->endElement(); + } + } + + /** + * convert passed data into an array of attributeType, attributeName, and value + * dates sent as DateTime objects will be converted to strings + * + * @param mixed $value + * + * @return array attributes and element value + */ + private static function _generateXmlAttribute($value) + { + if ($value instanceof DateTime || is_a($value, 'DateTimeImmutable')) { + return ['type', 'datetime', self::_convertDateTimeObjectToXmlTimestamp($value)]; + } + if (is_int($value)) { + return ['type', 'integer', $value]; + } + if (is_bool($value)) { + return ['type', 'boolean', ($value ? 'true' : 'false')]; + } + if ($value === null) { + return ['nil', 'true', $value]; + } + } + /** + * converts datetime back to xml schema format + * + * @param object $dateTime + * + * @return string XML schema formatted timestamp + */ + private static function _convertDateTimeObjectToXmlTimestamp($dateTime) + { + if (is_a($dateTime, 'DateTimeImmutable')) { + $dateTimeForUTC = DateTime::createFromImmutable($dateTime); + } else { + $dateTimeForUTC = clone $dateTime; + } + + $dateTimeForUTC->setTimeZone(new DateTimeZone('UTC')); + return ($dateTimeForUTC->format('Y-m-d\TH:i:s') . 'Z'); + } + + private static function _castDateTime($string) + { + try { + if (empty($string)) { + return false; + } + $dateTime = new DateTime($string); + return self::_convertDateTimeObjectToXmlTimestamp($dateTime); + } catch (Exception $e) { + // not a datetime + return false; + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php new file mode 100644 index 00000000000..bd52dc2d5f6 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php @@ -0,0 +1,144 @@ +loadXML($xml); + + $root = $document->documentElement->nodeName; + + return Util::delimiterToCamelCaseArray([ + $root => self::_nodeToValue($document->childNodes->item(0)), + ]); + } + + /** + * Converts a node to an array of values or nodes + * + * @param DOMNode @node + * + * @return mixed + */ + private static function _nodeToArray($node) + { + $type = null; + if ($node instanceof DOMElement) { + $type = $node->getAttribute('type'); + } + + switch ($type) { + case 'array': + $array = []; + foreach ($node->childNodes as $child) { + $value = self::_nodeToValue($child); + if ($value !== null) { + $array[] = $value; + } + } + return $array; + case 'collection': + $collection = []; + foreach ($node->childNodes as $child) { + $value = self::_nodetoValue($child); + if ($value !== null) { + if (!isset($collection[$child->nodeName])) { + $collection[$child->nodeName] = []; + } + $collection[$child->nodeName][] = self::_nodeToValue($child); + } + } + return $collection; + default: + $values = []; + if ($node->childNodes->length === 1 && $node->childNodes->item(0) instanceof DOMText) { + return $node->childNodes->item(0)->nodeValue; + } else { + foreach ($node->childNodes as $child) { + if (!$child instanceof DOMText) { + $values[$child->nodeName] = self::_nodeToValue($child); + } + } + return $values; + } + } + } + + /** + * Converts a node to a PHP value + * + * @param DOMNode $node + * + * @return mixed + */ + private static function _nodeToValue($node) + { + $type = null; + if ($node instanceof DOMElement) { + $type = $node->getAttribute('type'); + } + + switch ($type) { + case 'datetime': + return self::_timestampToUTC((string) $node->nodeValue); + case 'date': + return new DateTime((string) $node->nodeValue); + case 'integer': + return (int) $node->nodeValue; + case 'boolean': + $value = (string) $node->nodeValue; + if (is_numeric($value)) { + return (bool) $value; + } else { + return ($value !== "true") ? false : true; + } + case 'array': + case 'collection': + return self::_nodeToArray($node); + default: + if ($node->hasChildNodes()) { + return self::_nodeToArray($node); + } elseif (trim($node->nodeValue) === '') { + return null; + } else { + return $node->nodeValue; + } + } + } + + + /** + * Converts XML timestamps into DateTime instances + * + * @param string $timestamp + * + * @return DateTime + */ + private static function _timestampToUTC($timestamp) + { + $tz = new DateTimeZone('UTC'); + $dateTime = new DateTime($timestamp, $tz); + $dateTime->setTimezone($tz); + return $dateTime; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php b/upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php new file mode 100644 index 00000000000..84018011733 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php @@ -0,0 +1,22 @@ + + + Coding standard based on internal Braintree coding practices. + + + + + + + + tests/* + + + + + + tests/* + + + + + + + + + + + + + + + + + + + + + + + tests/* + lib/Braintree/Test/* + + + + + + + + + + tests/* + lib/Braintree/Test/* + + + + + + + + + + + + From 9b4929d3b7d54ecb53288b6d16daf5b1cdf30aa2 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 13:59:04 +0000 Subject: [PATCH 08/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/cardinity/cardinity-sdk-php | 1 - 1 file changed, 1 deletion(-) delete mode 160000 upload/system/storage/vendor/cardinity/cardinity-sdk-php diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php deleted file mode 160000 index f51f6fbacee..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f51f6fbacee393b4eeff7b80be2b1cee77896b4c From 0f1ae34401cd056b86b2df949e1abcad66bc2a4a Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:00:05 +0000 Subject: [PATCH 09/39] Support for PHP 8.0 and 8.1 --- .../cardinity/cardinity-sdk-php/.editorconfig | 15 + .../.github/workflows/php.yml | 39 ++ .../cardinity/cardinity-sdk-php/.gitignore | 12 + .../cardinity/cardinity-sdk-php/.travis.yml | 14 + .../cardinity/cardinity-sdk-php/CHANGELOG.md | 83 +++ .../cardinity/cardinity-sdk-php/LICENSE | 21 + .../cardinity/cardinity-sdk-php/README.md | 176 +++++++ .../cardinity/cardinity-sdk-php/composer.json | 33 ++ .../cardinity-sdk-php/docs/README.md | 394 +++++++++++++++ .../cardinity-sdk-php/phpspec.yml.dist | 4 + .../cardinity-sdk-php/phpunit.xml.dist | 33 ++ .../cardinity-sdk-php/spec/ClientSpec.php | 201 ++++++++ .../spec/Exception/DeclinedSpec.php | 27 + .../spec/Exception/ForbiddenSpec.php | 18 + .../Exception/InternalServerErrorSpec.php | 27 + .../Exception/InvalidAttributeValueSpec.php | 42 ++ .../spec/Exception/MethodNotAllowedSpec.php | 27 + .../spec/Exception/NotAcceptableSpec.php | 27 + .../spec/Exception/NotFoundSpec.php | 27 + .../spec/Exception/RequestSpec.php | 85 ++++ .../spec/Exception/RequestTimeoutSpec.php | 27 + .../spec/Exception/ServiceUnavailableSpec.php | 27 + .../spec/Exception/UnauthorizedSpec.php | 27 + .../spec/Exception/UnexpectedErrorSpec.php | 13 + .../spec/Exception/UnexpectedResponseSpec.php | 27 + .../spec/Exception/ValidationFailedSpec.php | 27 + .../spec/Http/Guzzle/ClientAdapterSpec.php | 84 +++ .../spec/Http/Guzzle/ExceptionMapperSpec.php | 100 ++++ .../spec/Method/ErrorSpec.php | 18 + .../Payment/AuthorizationInformationSpec.php | 13 + .../spec/Method/Payment/CreateSpec.php | 87 ++++ .../spec/Method/Payment/FinalizeSpec.php | 56 ++ .../spec/Method/Payment/GetAllSpec.php | 50 ++ .../spec/Method/Payment/GetSpec.php | 50 ++ .../Payment/PaymentInstrumentCardSpec.php | 13 + .../PaymentInstrumentRecurringSpec.php | 13 + .../spec/Method/Payment/PaymentSpec.php | 100 ++++ .../ThreeDS2AuthorizationInformationSpec.php | 41 ++ .../spec/Method/Refund/CreateSpec.php | 66 +++ .../spec/Method/Refund/GetAllSpec.php | 52 ++ .../spec/Method/Refund/GetSpec.php | 58 +++ .../spec/Method/Refund/RefundSpec.php | 18 + .../spec/Method/ResultObjectMapperSpec.php | 117 +++++ .../spec/Method/Settlement/CreateSpec.php | 66 +++ .../spec/Method/Settlement/GetAllSpec.php | 52 ++ .../spec/Method/Settlement/GetSpec.php | 58 +++ .../spec/Method/Settlement/SettlementSpec.php | 18 + .../spec/Method/ValidatorSpec.php | 64 +++ .../spec/Method/VoidPayment/CreateSpec.php | 62 +++ .../spec/Method/VoidPayment/GetAllSpec.php | 50 ++ .../spec/Method/VoidPayment/GetSpec.php | 58 +++ .../Method/VoidPayment/VoidPaymentSpec.php | 18 + .../cardinity-sdk-php/src/Client.php | 215 ++++++++ .../src/Exception/Declined.php | 9 + .../src/Exception/Forbidden.php | 9 + .../src/Exception/InternalServerError.php | 9 + .../src/Exception/InvalidAttributeValue.php | 24 + .../src/Exception/MethodNotAllowed.php | 9 + .../src/Exception/NotAcceptable.php | 9 + .../src/Exception/NotFound.php | 9 + .../src/Exception/Request.php | 63 +++ .../src/Exception/RequestTimeout.php | 9 + .../ResultObjectPropertyNotFound.php | 8 + .../src/Exception/Runtime.php | 8 + .../src/Exception/ServiceUnavailable.php | 10 + .../src/Exception/Unauthorized.php | 9 + .../src/Exception/UnexpectedError.php | 8 + .../src/Exception/UnexpectedResponse.php | 9 + .../src/Exception/ValidationFailed.php | 10 + .../src/Http/ClientInterface.php | 18 + .../src/Http/Guzzle/ClientAdapter.php | 58 +++ .../src/Http/Guzzle/ExceptionMapper.php | 93 ++++ .../cardinity-sdk-php/src/Method/Error.php | 116 +++++ .../src/Method/MethodInterface.php | 54 ++ .../MethodResultCollectionInterface.php | 11 + .../Payment/AuthorizationInformation.php | 56 ++ .../src/Method/Payment/Create.php | 226 +++++++++ .../src/Method/Payment/Finalize.php | 78 +++ .../src/Method/Payment/Get.php | 46 ++ .../src/Method/Payment/GetAll.php | 54 ++ .../src/Method/Payment/Payment.php | 478 ++++++++++++++++++ .../Method/Payment/PaymentInstrumentCard.php | 121 +++++ .../Payment/PaymentInstrumentInterface.php | 8 + .../Payment/PaymentInstrumentRecurring.php | 31 ++ .../ThreeDS2AuthorizationInformation.php | 58 +++ .../src/Method/Refund/Create.php | 64 +++ .../src/Method/Refund/Get.php | 57 +++ .../src/Method/Refund/GetAll.php | 50 ++ .../src/Method/Refund/Refund.php | 286 +++++++++++ .../src/Method/ResultObject.php | 160 ++++++ .../src/Method/ResultObjectInterface.php | 15 + .../src/Method/ResultObjectMapper.php | 121 +++++ .../Method/ResultObjectMapperInterface.php | 10 + .../src/Method/Settlement/Create.php | 64 +++ .../src/Method/Settlement/Get.php | 57 +++ .../src/Method/Settlement/GetAll.php | 50 ++ .../src/Method/Settlement/Settlement.php | 286 +++++++++++ .../src/Method/Validator.php | 48 ++ .../src/Method/ValidatorInterface.php | 19 + .../Validators/CallbackUrlConstraint.php | 17 + .../CallbackUrlConstraintValidator.php | 32 ++ .../src/Method/VoidPayment/Create.php | 56 ++ .../src/Method/VoidPayment/Get.php | 57 +++ .../src/Method/VoidPayment/GetAll.php | 50 ++ .../src/Method/VoidPayment/VoidPayment.php | 239 +++++++++ .../tests/ClientEndpointTest.php | 85 ++++ .../cardinity-sdk-php/tests/ClientTest.php | 183 +++++++ .../tests/ClientTestCase.php | 160 ++++++ .../cardinity-sdk-php/tests/ErrorTest.php | 102 ++++ .../cardinity-sdk-php/tests/PaymentTest.php | 267 ++++++++++ .../cardinity-sdk-php/tests/RefundTest.php | 130 +++++ .../tests/SettlementTest.php | 127 +++++ .../cardinity-sdk-php/tests/ThreeDS2Test.php | 55 ++ .../tests/VoidPaymentTest.php | 121 +++++ 114 files changed, 7736 insertions(+) create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Forbidden.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/InternalServerError.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/InvalidAttributeValue.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/NotAcceptable.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/NotFound.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Request.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ResultObjectPropertyNotFound.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Runtime.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ServiceUnavailable.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Unauthorized.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedError.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedResponse.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ValidationFailed.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/ClientInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ClientAdapter.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodResultCollectionInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/AuthorizationInformation.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentRecurring.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapper.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraint.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraintValidator.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig new file mode 100644 index 00000000000..9a9710a901b --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml new file mode 100644 index 00000000000..5e131c47002 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml @@ -0,0 +1,39 @@ +name: PHP Composer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + phpunit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + env: + CONSUMER_KEY: ${{secrets.CRD_KEY}} + CONSUMER_SECRET: ${{secrets.CRD_SECRET}} + run: composer run-script test diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore new file mode 100644 index 00000000000..ad78b24b878 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore @@ -0,0 +1,12 @@ +vendor/ +bin/ +build/ +specs/ +phpunit.xml +.phpunit.result.cache +phpspec.yml +tests/info.log +composer.lock +.idea/ +phpstan.neon +.phpunit.result.cache diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml new file mode 100644 index 00000000000..7751733d42d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml @@ -0,0 +1,14 @@ +language: php +dist: trusty + +php: + - 7.2 + - 7.3 + - 7.4 + +before_script: + - composer self-update + - composer update + +script: + - bin/phpspec run --format=pretty diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md new file mode 100644 index 00000000000..6e36d1fa831 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md @@ -0,0 +1,83 @@ +# Cardinity Client PHP Library + +## v3.0.3 + +### Added +- Added `Method\Validators\CallbackUrlConstraint` custom validation constraint class +- Added `Method\Validators\CallbackUrlConstraintValidator` custom constraint validation class +- Added `getInsideArray` method to `Method\Payment\Create` class +- Added `getNotificationUrlConstraints` method to `Method\Payment\Create` for `notification_url` parameter +- Added `getIpAddressConstraints` method to `Method\Payment\Create` for `ip_address` parameter. +- Added unit tests for new methods. +- Added `getStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. +- Added `setStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. + + +### Updated +- Updated `getThreeDS2DataConstraints` method of `Method\Payment\Create` class +- Updated `getBrowserInfoConstraints` method of `Method\Payment\Create` class. +- Updated `getValidationConstraints` method of `Method\Payment\Create` class + +## v3.0.2 + +### Changed + +- Changed `getThreeds2data` method to `getThreeds2Data` of class `Method\Payment\Payment` +- Changed `setThreeds2data` method to `setThreeds2Data` of class `Method\Payment\Payment` +- Changed `unserialize` method of `Method\ResultObject` class +- Changed `propertyName` method of `Method\ResultObject` class + + +## v3.0.1 + +### Fixed + +- Removed redundant comma in `Method\Payment\Create.php` line 84. + +## v3.0.0 + +### Added +- Added `threeDS2AuthorizationInformation` property to `Payment` class +- Added `getThreeds2data` method to `Payment` class +- Added `setThreeds2data` method to `Payment` class +- Added `isThreedsV1` method to `Payment` class +- Added `isThreedsV2` method to `Payment` class +- Added `getThreeDS2DataConstraints` method to `Create` class +- Added `getBrowserInfoConstraints` method to `Create` class +- Added `getAdressConstraints` method to `Create` class +- Added `getCardHolderInfoConstraints` method to `Create` class +- Added `buildElement` method to `Create` class +- Added `paymentId` property to `Finalize` class +- Added `finalizeKey` property to `Finalize` class +- Added `Method\Payment\ThreeDS2Data` parameters +- Added `Method\Payment\TreeDS2AthorizationInformation` class + +### Changed +- Updated `php` to version 7.2.x +- Updated `symfony/validator` to versin 5.x +- Updated `phpspec/phpspec` to version 6.2 +- Updated `phpunit/phpunit` to version 8.5 +- Updated `symfony/yaml` to version 4.4 +- Refactored `Create` class to build validation parameters using `buildElement` method +- Updated `getValidationConstraints` method of `Create` class +- Updated `getPaymentInstrumentConstraints` method of `Create` class +- Updated `__construct` method of `Finalize` class +- Updated `getAttributes` method of `Finalize` class +- Updated `getValidationConstraints` method of `Finalize` class + +## v2.1.0 + +### Added +- Added `isDeclined` method to `Payment` class +- Added `isApproved` and `isDeclined` methods to `Refund` class +- Added `isApproved` and `isDeclined` methods to `Settlement` class +- Added `isApproved` and `isDeclined` methods to `VoidPayment` class + +## v2.0.0 + +### Changed +- Renamed `Cardinity\Method\Void` to `Cardinity\Method\VoidPayment` +- Renamed `Void.php` to `VoidPayment.php` + +### Removed +- Removed `ResultObjectPropertyNotFound.php` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE new file mode 100644 index 00000000000..97bfca21cb6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Cardinity + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md new file mode 100644 index 00000000000..692fb347da4 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md @@ -0,0 +1,176 @@ + +Cardinity Client PHP Library +================================================ +[![Build Status](https://app.travis-ci.com/cardinity/cardinity-sdk-php.svg?branch=master)](https://app.travis-ci.com/cardinity/cardinity-sdk-php) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/?branch=master) + +This is official PHP client library for [Cardinity's](https://developers.cardinity.com/api/v1/) API. +Library includes all the functionality provided by API. Library was designed to be flexible and self-explanatory for developers to implement. + +## Documentation +More detailed documentation with usage examples can be found [here](https://github.com/cardinity/cardinity-sdk-php/tree/master/docs). + +## Usage +### Installing via [Composer](https://getcomposer.org) +```bash +$ php composer.phar require cardinity/cardinity-sdk-php +``` +### Direct Download +You can download the [latest release](https://github.com/cardinity/cardinity-sdk-php/releases/latest) file starting with ```cardinity-sdk-php-*.zip```. + +### Making API Calls +#### Initialize the client object +```php +use Cardinity\Client; +$client = Client::create([ + 'consumerKey' => 'YOUR_CONSUMER_KEY', + 'consumerSecret' => 'YOUR_CONSUMER_SECRET', +]); +``` + +#### Create new payment +```php +use Cardinity\Method\Payment; + +$method = new Payment\Create([ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => 2021, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], + 'threeds2_data' => [ + "notification_url" => "your_shop_url_for_handling_callback", + "browser_info" => [ + "accept_header" => "text/html", + "browser_language" => "en-US", + "screen_width" => 600, + "screen_height" => 400, + 'challenge_window_size' => "600x400", + "user_agent" => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0", + "color_depth" => 24, + "time_zone" => -60 + ], + ], +]); +``` +#### All the `threeds2_data` parameters should be set dynamically. +Parameters `screen_width`, `screen_height`, `browser_language`, `color_depth`, `time_zone` of `browser_info` could be collected dynamically using `javascript`: +```javascript +document.addEventListener("DOMContentLoaded", function() { + document.getElementById("screen_width").value = screen.availWidth; + document.getElementById("screen_height").value = screen.availHeight; + document.getElementById("browser_language").value = navigator.language; + document.getElementById("color_depth").value = screen.colorDepth; + document.getElementById("time_zone").value = new Date().getTimezoneOffset(); +}); +``` +and placed into a `html` form +```html + + + + + + + +``` +Then call to Cardinity API should be executed using `try ... catch` blocks: +```php +$errors = []; +try { + /** @type Cardinity\Method\Payment\Payment */ + $payment = $client->call($method); + $status = $payment->getStatus(); + if ($status == 'approved') { + echo '

    Your payment approved without 3D secure.

    '; + } elseif ($status == 'pending') { + if ($payment->isThreedsV2()) { + // $auth object for data required to finalize payment + $auth = $payment->getThreeds2Data(); + // finalize process should be done here. + }else if ($payment->isThreedsV1()) { + // $auth object for data required to finalize payment + $auth = $payment->getAuthorizationInformation(); + // finalize process should be done here. + } + } +} catch (Cardinity\Exception\InvalidAttributeValue $exception) { + foreach ($exception->getViolations() as $key => $violation) { + array_push($errors, $violation->getPropertyPath() . ' ' . $violation->getMessage()); + } +} catch (Cardinity\Exception\ValidationFailed $exception) { + foreach ($exception->getErrors() as $key => $error) { + array_push($errors, $error['message']); + } +} catch (Cardinity\Exception\Declined $exception) { + foreach ($exception->getErrors() as $key => $error) { + array_push($errors, $error['message']); + } +} catch (Cardinity\Exception\NotFound $exception) { + foreach ($exception->getErrors() as $key => $error) { + array_push($errors, $error['message']); + } +} catch (Exception $exception) { + $errors = [$exception->getMessage()]; +} +if ($errors) { + print_r($errors); +} +``` +#### Finalize payment +To finalize payment it should have status `pending`. Data received from 3D secure system should be used to create Finalize `$method`. +```php +use Cardinity\Method\Payment; + +$client = Client::create([ + 'consumerKey' => 'YOUR_CONSUMER_KEY', + 'consumerSecret' => 'YOUR_CONSUMER_SECRET', +]); + +if($v2){ + $method = new Payment\Finalize( + $payment->getId(), // payment object received from API call + $auth->getCreq(), // payment object received from API call + true // BOOL `true` to enable 3D secure V2 parameters + ); +}elseif($v1){ + $method = new Payment\Finalize( + $payment->getId(), // payment object received from API call + $auth->getData(), // payment object received from API call + false // BOOL `false` to enable 3D secure V1 parameters + ); +} + +// again use same try ... catch block +try { + $payment = $client->call($method); +} +// same catch blocks ... +// ... + +``` + +#### Get existing payment +```php +$method = new Payment\Get('cb5e1c95-7685-4499-a2b1-ae0f28297b92'); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +## API documentation +[https://developers.cardinity.com/api/v1/](https://developers.cardinity.com/api/v1/) + +## Development Status +All the API __v1__ methods are implemented. + +### Tests +for windows `php vendor/phpunit/phpunit/phpunit` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json new file mode 100644 index 00000000000..f131189a55e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json @@ -0,0 +1,33 @@ +{ + "name": "cardinity/cardinity-sdk-php", + "description": "Client library for Cardinity credit card processing API", + "type": "library", + "license": "MIT", + "homepage": "https://cardinity.com", + "require": { + "php" : ">=7.2.5", + "guzzlehttp/guzzle" : "^6.2.1", + "guzzlehttp/oauth-subscriber": "0.3.*", + "symfony/validator" : "^5.0.0" + }, + "require-dev": { + "monolog/monolog" : "~1.0", + "phpspec/phpspec" : "~6.2", + "phpunit/phpunit" : "^8.5", + "symfony/yaml" : "^4.4" + }, + "config": { + "bin-dir": "bin" + }, + "autoload": { + "psr-4": {"Cardinity\\": "src"} + }, + "autoload-dev": { + "psr-4": { + "Cardinity\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "phpunit" + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md new file mode 100644 index 00000000000..64884fb3325 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md @@ -0,0 +1,394 @@ +# Introduction +Library includes all the functionality provided by API. Library was designed to be flexible and self-explanatory for developers to implement. +Client provides use of API in OOP style. + +## Authentication +You don't have to bother about it. Authentication is handled auto-magically behind the scenes. + +## Initialize the client object +```php +use Cardinity\Client; +$client = Client::create([ + 'consumerKey' => 'YOUR_CONSUMER_KEY', + 'consumerSecret' => 'YOUR_CONSUMER_SECRET', +]); +``` + +## Payments [API](https://developers.cardinity.com/api/v1/#payments) +### Create new payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Create([ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => 2021, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], +]); + +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Handling declined payments +In case payment could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\Payment; + +$method = new Payment\Create([ + 'amount' => 150.01, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::RECURRING, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => 2021, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], +]); + +try { + /** @type Cardinity\Method\Payment\Payment */ + $payment = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\Payment\Payment */ + $payment = $exception->getResult(); + $status = $payment->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Create recurring payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Create([ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::RECURRING, + 'payment_instrument' => [ + 'payment_id' => $paymentId + ], +]); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Finalize pending payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Finalize($payment->getId(), $payment->getAuthorizationInformation()->getData()); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Get existing payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Get($payment->getId()); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Get all payments +```php +use Cardinity\Method\Payment; +$method = new Payment\GetAll(); +$result = $client->call($method); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $result[0]; +``` + +## Refunds [API](https://developers.cardinity.com/api/v1/#refunds) +### Create new refund +```php +use Cardinity\Method\Refund; +$method = new Refund\Create( + $payment->getId(), + 10.00, + 'my description' +); +/** @type Cardinity\Method\Refund\Refund */ +$refund = $client->call($method); +``` + +### Handling declined refunds +In case refund could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\Refund; + +$method = new Refund\Create( + $payment->getId(), + 10.00, + 'fail' +); + +try { + /** @type Cardinity\Method\Refund\Refund */ + $refund = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\Refund\Refund */ + $refund = $exception->getResult(); + $status = $refund->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Get existing refund +```php +use Cardinity\Method\Refund; +$method = new Refund\Get( + $payment->getId(), + $refund->getId() +); +/** @type Cardinity\Method\Refund\Refund */ +$refund = $client->call($method); +``` + +### Get all refunds +```php +use Cardinity\Method\Refund; +$method = new Refund\GetAll( + $payment->getId() +); +$result = $client->call($method); +/** @type Cardinity\Method\Refund\Refund */ +$refund = $result[0]; +``` + +## Settlements [API](https://developers.cardinity.com/api/v1/#settlements) +### Create new settlement +```php +use Cardinity\Method\Settlement; +$method = new Settlement\Create( + $payment->getId(), + 10.00, + 'my description' +); +/** @type Cardinity\Method\Settlement\Settlement */ +$result = $client->call($method); +``` + +### Handling declined settlements +In case settlement could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\Settlement; + +$method = new Settlement\Create( + $payment->getId(), + 10.00, + 'fail' +); + +try { + /** @type Cardinity\Method\Settlement\Settlement */ + $settlement = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\Settlement\Settlement */ + $settlement = $exception->getResult(); + $status = $settlement->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Get existing settlement +```php +use Cardinity\Method\Settlement; +$method = new Settlement\Get( + $payment->getId(), + $settlement->getId() +); +/** @type Cardinity\Method\Settlement\Settlement */ +$settlement = $client->call($method); +``` + +### Get all settlements +```php +use Cardinity\Method\Settlement; +$method = new Settlement\GetAll( + $payment->getId() +); +$result = $client->call($method); +/** @type Cardinity\Method\Settlement\Settlement */ +$settlement = $result[0]; +``` + +## Voids [API](https://developers.cardinity.com/api/v1/#voids) +### Create new void +```php +use Cardinity\Method\VoidPayment; +$method = new VoidPayment\Create( + $payment->getId(), + 'my description' +); +/** @type Cardinity\Method\VoidPayment\VoidPayment */ +$result = $client->call($method); +``` + +### Handling declined voids +In case void could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\VoidPayment; + +$method = new VoidPayment\Create( + $payment->getId(), + 'fail' +); + +try { + /** @type Cardinity\Method\VoidPayment\VoidPayment */ + $void = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\VoidPayment\VoidPayment */ + $void = $exception->getResult(); + $status = $void->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Get existing void +```php +use Cardinity\Method\VoidPayment; +$method = new VoidPayment\Get( + $payment->getId(), + $void->getId() +); +/** @type Cardinity\Method\VoidPayment\VoidPayment */ +$void = $client->call($method); +``` + +### Get all voids +```php +use Cardinity\Method\VoidPayment; +$method = new VoidPayment\GetAll( + $payment->getId() +); +$result = $client->call($method); +/** @type Cardinity\Method\VoidPayment\VoidPayment */ +$void = $result[0]; +``` + +## Exceptions +### Exceptions representing API error response + +#### Base class for API error response exceptions +Class: `Cardinity\Exception\Request` +Methods: +- `getErrors()` returns list of errors occurred +- `getErrorsAsString()` returns list of errors occurred in string form +- `getResult()` returns object, the instance of `ResultObjectInterface`. + +#### All classes +Class: `Cardinity\Exception\ValidationFailed` +HTTP status: `400` + +Class: `Cardinity\Exception\Unauthorized` +HTTP status: `401` + +Class: `Cardinity\Exception\Declined` +HTTP status: `402` + +Class: `Cardinity\Exception\Forbidden` +HTTP status: `403` + +Class: `Cardinity\Exception\MethodNotAllowed` +HTTP status: `405` + +Class: `Cardinity\Exception\NotAcceptable` +HTTP status: `406` + +Class: `Cardinity\Exception\NotFound` +HTTP status: `404` + +Class: `Cardinity\Exception\InternalServerError` +HTTP status: `500` + +Class: `Cardinity\Exception\ServiceUnavailable` +HTTP status: `503` + + +### Cardinity client exceptions + +#### Request timed out +Class: `Cardinity\Exception\RequestTimeout` + +#### Before-request data validation failed +Class: `Cardinity\Exception\InvalidAttributeValue` +Methods: +- `getViolations()` returns list of validation violations + +#### Unexpected error +Class: `Cardinity\Exception\UnexpectedError` + +#### Base exception class for Cardinity client +Class: `Cardinity\Exception\Runtime` +Catching this exception ensures that you handle all cardinity failure use cases. + + +## Advanced use cases + +### Debug, log request/response +`Client::create()` accepts second argument, which defines the logger. +Available values: `Client::LOG_NONE` or PSR-3 `LoggerInterface`. +- `Client::LOG_NONE` - log disabled. +- `LoggerInterface` - custom logger implementation, for eg. `Monolog`. + +```php +$client = Client::create($config, Client::LOG_NONE); +``` + +### Use Monolog for logging +#### 1. Add monolog to your project +```bash +$ composer require monolog/monolog +``` +#### 2. Register logger to the Cardinity client +```php +$logger = new Monolog\Logger('requests'); +$logger->pushHandler(new Monolog\Handler\StreamHandler(__DIR__ . '/requests.log', Logger::INFO)); +$client = Client::create($config, $logger); +``` + +### Extending components +Each part of client library can be easily extended or replaced with another suitable component +through the corresponding interfaces: +```php +public function __construct( + Cardinity\Http\ClientInterface $client, + Cardinity\Method\ValidatorInterface $validator, + Cardinity\Method\ResultObjectMapperInterface $mapper +) { ... } +``` + +For example to replace _Guzzle_ with another http client you want simply create adapter +for your client library, like `Cardinity\Http\Guzzle\ClientAdapter` which implements +`Cardinity\Http\ClientInterface`. That's it! diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist new file mode 100644 index 00000000000..6da04f0186e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist @@ -0,0 +1,4 @@ +suites: + cardinity_suite: + namespace: Cardinity + psr4_prefix: Cardinity diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist new file mode 100644 index 00000000000..badbd18809e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + ./tests + + + + + + ./src + + + diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php new file mode 100644 index 00000000000..37fe4c52ca4 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php @@ -0,0 +1,201 @@ +beConstructedWith( + $client, + $validator, + $mapper + ); + } + + function it_constructs_via_factory() + { + $this::create(['consumerKey' => '', 'consumerSecret' => ''])->shouldReturnAnInstanceOf('Cardinity\Client'); + } + + function it_maps_result_to_object_by_posting_json_body( + MethodInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = ['id' => '3c4e8dcf']; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('POST'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn([]); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'POST', + 'payment', + [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => '{}', + ] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn($resultObject); + } + + function it_maps_result_containing_collection_of_items( + MethodResultCollectionInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = [ + ['id' => '3c4e8dcf'] + ]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('POST'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn([]); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->mapCollection($result, $method)->shouldBeCalled()->willReturn([$resultObject]); + + $client + ->sendRequest( + $method, + 'POST', + 'payment', + [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => '{}', + ] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn([$resultObject]); + } + + function it_converts_float_numbers_to_string_for_json_body( + MethodInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = ['amount' => 50.00]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('POST'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn(['amount' => 50.00]); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'POST', + 'payment', + [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => '{"amount":"50.00"}', + ] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn($resultObject); + } + + function it_gets_result_object_by_sending_get_query_params( + MethodInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = ['amount' => 50.00]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('GET'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn(['field' => 'value']); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'GET', + 'payment', + ['query' => ['field' => 'value']] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn($resultObject); + } + + function it_performs_request_without_validation( + MethodInterface $method, + ClientInterface $client, + ResultObjectMapperInterface $mapper + ) { + $result = ['amount' => 50.00]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('GET'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn(['field' => 'value']); + $method->createResultObject()->willReturn($resultObject); + + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'GET', + 'payment', + ['query' => ['field' => 'value']] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->callNoValidate($method)->shouldReturn($resultObject); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php new file mode 100644 index 00000000000..031d0d887d9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\Declined'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(402); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php new file mode 100644 index 00000000000..0196eff1251 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php @@ -0,0 +1,18 @@ +shouldHaveType('Cardinity\Exception\Forbidden'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(403); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php new file mode 100644 index 00000000000..cbc9598f631 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(500); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php new file mode 100644 index 00000000000..03867c377ea --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php @@ -0,0 +1,42 @@ +__toString()->willReturn($this->violation); + + $this->beConstructedWith( + 'Message', + $violations + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('\RuntimeException'); + } + + function it_returns_message() + { + $this->getMessage()->shouldStartWith('Message'); + } + + function it_returns_violations(ConstraintViolationList $violations) + { + $this->getViolations()->shouldReturn($violations); + } + + function it_should_have_message_containing_violations() + { + $string = 'Violations: ' . $this->violation; + $this->getMessage()->shouldEndWith($string); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php new file mode 100644 index 00000000000..4e62a9edbb6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\MethodNotAllowed'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(405); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php new file mode 100644 index 00000000000..47f139004ff --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\NotAcceptable'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(406); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php new file mode 100644 index 00000000000..a00d66a46cd --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\NotFound'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(404); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php new file mode 100644 index 00000000000..33a8174f9f0 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php @@ -0,0 +1,85 @@ + [ + [ + 'field' => 'currency', + 'rejected' => 'EGR', + 'message' => 'invalid or unsupported currency', + ], + [ + 'field' => 'payment_instrument.exp_month', + 'rejected' => 13, + 'message' => 'must be between 1 and 12', + ] + ] + ]; + + private $error; + + function let(\RuntimeException $exception) + { + $this->error = new Error(); + $this->error->setErrors($this->result['errors']); + + $this->beConstructedWith( + $exception, + $this->error + ); + } + + function it_should_extend_runtime() + { + $this->shouldHaveType('Cardinity\Exception\Runtime'); + } + + function it_stores_previous_exception(\RuntimeException $exception) + { + $this->getPrevious()->shouldReturn($exception); + } + + function it_stores_result() + { + $this->getResult()->shouldReturn($this->error); + } + + function it_should_have_message_containing_response_data() + { + $string = 'Response data: ' . serialize($this->error); + $this->getMessage()->shouldEndWith($string); + } + + function it_returns_errors_from_error_result_object() + { + $this->getErrors()->shouldReturn($this->result['errors']); + } + + function it_returns_errors_as_string() + { + $this->getErrorsAsString()->shouldReturn("currency: invalid or unsupported currency ('EGR' given);\npayment_instrument.exp_month: must be between 1 and 12 ('13' given);"); + } + + function it_returns_errors_from_payment_result_object(\RuntimeException $exception) + { + $msg = 'Payment error'; + + $payment = new Payment(); + $payment->setError($msg); + $this->beConstructedWith( + $exception, + $payment + ); + + $this->getErrors()->shouldReturn([['field' => 'status', 'message' => $msg]]); + $this->getErrorsAsString()->shouldReturn("status: Payment error;"); + } + +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php new file mode 100644 index 00000000000..27b269ad879 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(0); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php new file mode 100644 index 00000000000..60f27ada78a --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\ServiceUnavailable'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(503); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php new file mode 100644 index 00000000000..7f4ad3f9d37 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\Unauthorized'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(401); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php new file mode 100644 index 00000000000..4280a54be1b --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php @@ -0,0 +1,13 @@ +shouldHaveType('\RuntimeException'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php new file mode 100644 index 00000000000..1cccb794fb9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(0); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php new file mode 100644 index 00000000000..d1e7b542bd2 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(400); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php new file mode 100644 index 00000000000..38c0e885075 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php @@ -0,0 +1,84 @@ +beConstructedWith($client, $mapper); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Http\Guzzle\ClientAdapter'); + } + + function it_sends_post_and_returns_result( + MethodInterface $method, + Client $client, + ResponseInterface $response + ) { + $response + ->getBody() + ->shouldBeCalled() + ->willReturn(json_encode(['foo' => 'bar'])) + ; + $client + ->request('POST', 'https://api.cardinity.com/v1/', []) + ->shouldBeCalled() + ->willReturn($response) + ; + $this + ->sendRequest($method, 'POST', 'https://api.cardinity.com/v1/', []) + ->shouldReturn(['foo' => 'bar']) + ; + } + + function it_wraps_client_exceptions_with_ours( + MethodInterface $method, + ClientInterface $client, + ExceptionMapper $mapper, + ClientException $exception + ) { + $client + ->request('POST', 'https://api.cardinity.com/v1/', []) + ->willThrow($exception->getWrappedObject()) + ; + $mapper + ->get($exception->getWrappedObject(), $method) + ->shouldBeCalled() + ->willThrow('Cardinity\Exception\Request') + ; + $this + ->shouldThrow('Cardinity\Exception\Request') + ->duringSendRequest($method, 'POST', 'https://api.cardinity.com/v1/') + ; + } + + function it_handles_unexpected_exceptions( + MethodInterface $method, + ClientInterface $client, + \Exception $exception + ) + { + $client + ->request('POST', 'https://api.cardinity.com/v1/', []) + ->willThrow($exception->getWrappedObject()) + ; + $this + ->shouldThrow('Cardinity\Exception\UnexpectedError') + ->duringSendRequest($method, 'POST', 'https://api.cardinity.com/v1/') + ; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php new file mode 100644 index 00000000000..eeb96faa515 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php @@ -0,0 +1,100 @@ +beConstructedWith($resultMapper); + + $exception->beConstructedWith([ + 'Message', + $request->getWrappedObject(), + $response->getWrappedObject() + ]); + } + + function it_maps_expected_exception_code( + ClientException $exception, + Response $response, + MethodInterface $method + ) { + $result = []; + + $response->getStatusCode()->willReturn(400); + $response->getBody()->willReturn(json_encode($result)); + + $exception->getResponse()->willReturn($response); + + $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\ValidationFailed'); + } + + function it_handles_unexpected_exception_code( + ClientException $exception, + Response $response, + MethodInterface $method + ) { + $result = []; + + $response->getStatusCode()->willReturn(999); + $response->getBody()->willReturn(json_encode($result)); + + $exception->getResponse()->willReturn($response); + + $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\UnexpectedResponse'); + } + + function it_maps_error_response_to_error_result_object( + ClientException $exception, + Response $response, + ResultObjectMapperInterface $resultMapper, + MethodInterface $method + ) { + $result = ['errors' => ['error' => 'Error string']]; + $resultObject = new Error(); + + $response->getStatusCode()->willReturn(400); + $response->getBody()->willReturn(json_encode($result)); + + $method->createResultObject()->willReturn($resultObject); + $exception->getResponse()->willReturn($response); + + $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $this->get($exception, $method)->getResult()->shouldReturn($resultObject); + } + + function it_maps_declined_response_402_to_payment_result_object( + ClientException $exception, + Response $response, + ResultObjectMapperInterface $resultMapper, + MethodInterface $method + ) { + $result = ['error' => 'Error string']; + $resultObject = new Payment(); + + $response->getStatusCode()->willReturn(402); + $response->getBody()->willReturn(json_encode($result)); + + $method->createResultObject()->willReturn($resultObject); + $exception->getResponse()->willReturn($response); + + $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $this->get($exception, $method)->getResult()->shouldReturn($resultObject); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php new file mode 100644 index 00000000000..9d0c2fd3585 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php new file mode 100644 index 00000000000..8bf92353da3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php @@ -0,0 +1,13 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php new file mode 100644 index 00000000000..a7d84069adc --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php @@ -0,0 +1,87 @@ + 'Some header', + 'browser_language' => 'LT', + 'screen_width' => 390, + 'screen_height' => 400, + 'challenge_window_size' => '390x400', + 'user_agent' => 'super user agent', + 'color_depth' => 24, + 'time_zone' => -60, + // 'ip_address' => '192.168.0.1', + ]; + $billingAddress = [ + 'address_line1' => 'first address line', + 'city' => 'balbieriskis', + 'country' => 'LT', + 'postal_code' => '0234' + ]; + $threeds2Data['notification_url'] = 'http://localhost:8000/3dsv2_callback.php'; + $threeds2Data['browser_info'] = $browserInfo; + + $this->options = [ + 'amount' => 12.99, + 'currency' => 'EUR', + 'settle' => true, + 'order_id' => 'ABC123', + 'description' => 'Description', + 'country' => 'LT', + 'payment_method' => 'card', + 'payment_instrument' => [ + 'pan' => '123456789123', + 'exp_year' => '2014', + 'exp_month' => '12', + 'cvc' => '456', + 'holder' => 'Mr Tester', + ], + 'threeds2_data' => $threeds2Data + ]; + $this->beConstructedWith($this->options); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn($this->options); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments'); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php new file mode 100644 index 00000000000..dbba8c38c0e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php @@ -0,0 +1,56 @@ +beConstructedWith($this->paymentId, $this->authorizeData); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_authorize_data() + { + $this->getAuthorizeData()->shouldReturn($this->authorizeData); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments/' . $this->paymentId); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('PATCH'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php new file mode 100644 index 00000000000..332a551bc7e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php @@ -0,0 +1,50 @@ +beConstructedWith($this->limit); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodResultCollectionInterface'); + } + + function it_has_limit() + { + $this->getLimit()->shouldReturn($this->limit); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments'); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php new file mode 100644 index 00000000000..09a27f38f27 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php @@ -0,0 +1,50 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments/' . $this->paymentId); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php new file mode 100644 index 00000000000..3009058caf2 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php @@ -0,0 +1,13 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php new file mode 100644 index 00000000000..c3ae7f82fcc --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php @@ -0,0 +1,13 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php new file mode 100644 index 00000000000..d2a0532fa78 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php @@ -0,0 +1,100 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + + $this->setId('foo'); + $this->setAmount(20.00); + $this->setType(null); + + $info = new AuthorizationInformation(); + $info->setUrl('http://...'); + $info->setData('some_data'); + + $this->setAuthorizationInformation($info); + $this->serialize()->shouldReturn('{"id":"foo","amount":"20.00","authorization_information":{"url":"http:\/\/...","data":"some_data"}}'); + } + + function it_is_able_to_unserialize_authorization_information() + { + $json = '{"id":"foo.bar.123","amount":"20.00","authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; + $this->unserialize($json); + + $this->getId()->shouldReturn('foo.bar.123'); + $this->getAmount()->shouldReturn(20.00); + $this->getType()->shouldReturn(null); + $this->getAuthorizationInformation()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\AuthorizationInformation'); + $this->getAuthorizationInformation()->getUrl()->shouldReturn('http://...'); + $this->getAuthorizationInformation()->getData()->shouldReturn('some_data'); + } + + function it_is_able_to_unserialize_card_payment_instrument() + { + $json = '{"payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":2024,"exp_month":5,"holder":"John Smith"}}'; + $this->unserialize($json); + + $this->getPaymentMethod()->shouldReturn('card'); + $this->getPaymentInstrument()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard'); + $this->getPaymentInstrument()->getCardBrand()->shouldReturn('Visa'); + $this->getPaymentInstrument()->getExpYear()->shouldReturn(2024); + } + + function it_is_able_to_unserialize_recurring_payment_instrument() + { + $json = '{"payment_method":"recurring","payment_instrument":{"payment_id":"ba3119f2-9a73"}}'; + $this->unserialize($json); + + $this->getPaymentMethod()->shouldReturn('recurring'); + $this->getPaymentInstrument()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\PaymentInstrumentRecurring'); + $this->getPaymentInstrument()->getPaymentId()->shouldReturn('ba3119f2-9a73'); + } + + + function it_is_able_to_take_threeds2_data() + { + + $tds2Auth = new ThreeDS2AuthorizationInformation(); + $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); + $tds2Auth->setCreq('eyJyZXR1c...'); + + $this->setThreeds2Data($tds2Auth); + $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); + $this->getThreeds2Data()->shouldReturn($tds2Auth); + + } + + function it_is_able_to_serialize_tdsv2(){ + $json = '{"acs_url":"https:\/\/acs.cardinity.com\/v2\/","c_req":"eyJyZXR1c..."}'; + + $tds2Auth = new ThreeDS2AuthorizationInformation(); + $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); + $tds2Auth->setCreq('eyJyZXR1c...'); + + $this->setThreeds2Data($tds2Auth); + $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); + $this->getThreeds2Data()->shouldReturn($tds2Auth); + + $this->getThreeds2Data()->serialize()->shouldReturn($json); + } + + + function it_handles_unexpected_values() + { + $json = '{"payment_instrument":{"payment_id":"ba3119f2-9a73"}}'; + $this->shouldThrow('Cardinity\Exception\Runtime')->duringUnserialize($json); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php new file mode 100644 index 00000000000..c6c18dfe907 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php @@ -0,0 +1,41 @@ +tds2_data['acs_url'] = 'http://mynotifactionurl.com'; + $this->tds2_data['creq'] = "asdf123xcxzcv"; + + $this->setAcsUrl($this->tds2_data['acs_url']); + $this->setCReq($this->tds2_data['creq']); + } + + function it_is_initalizable(){ + $this->shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_contains_acs_url() + { + $this->getAcsUrl()->shouldReturn($this->tds2_data['acs_url']); + } + + function it_contains_creq() + { + $this->getCReq()->shouldReturn($this->tds2_data['creq']); + } + + + + + + +} + + diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php new file mode 100644 index 00000000000..77162e53a23 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php @@ -0,0 +1,66 @@ +beConstructedWith($this->paymentId, $this->amount, $this->description); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + 'description' => $this->description, + ]); + } + + function it_does_not_contain_optional_properties() + { + $this->beConstructedWith($this->paymentId, $this->amount); + + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + ]); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + sprintf('payments/%s/refunds', $this->paymentId) + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php new file mode 100644 index 00000000000..22f662e9162 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php @@ -0,0 +1,52 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/refunds' + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php new file mode 100644 index 00000000000..0e9a297412d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php @@ -0,0 +1,58 @@ +beConstructedWith($this->paymentId, $this->refundId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_refund_id() + { + $this->getRefundId()->shouldReturn($this->refundId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/refunds/' . $this->refundId + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php new file mode 100644 index 00000000000..f9d43d10635 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php new file mode 100644 index 00000000000..6f3b185b6b7 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php @@ -0,0 +1,117 @@ +shouldImplement('Cardinity\Method\ResultObjectMapper'); + } + + function it_maps_array_to_object(Payment $object) + { + $data = [ + 'id' => 32, + 'type' => 'my_type', + ]; + + $object->setId(32)->shouldBeCalled(); + $object->setType('my_type')->shouldBeCalled(); + + $this->map($data, $object); + } + + function it_maps_card_payment_instrument(Payment $payment) + { + $data = [ + 'payment_method' => 'card', + 'payment_instrument' => [ + 'card_brand' => 'Visa', + 'pan' => '0067', + 'exp_year' => 2021, + 'exp_month' => 12, + 'holder' => 'Mike Dough' + ], + ]; + + $instrument = new PaymentInstrumentCard(); + $instrument->setCardBrand('Visa'); + $instrument->setPan('0067'); + $instrument->setExpYear(2021); + $instrument->setExpMonth(12); + $instrument->setHolder('Mike Dough'); + + $payment->setPaymentMethod('card')->shouldBeCalled(); + $payment->setPaymentInstrument($instrument)->shouldBeCalled(); + + $this->map($data, $payment)->shouldReturn($payment); + } + + function it_maps_recurring_payment_instrument(Payment $payment) + { + $data = [ + 'payment_method' => 'recurring', + 'payment_instrument' => [ + 'payment_id' => 'ba3119f2-9a73-11e4-89d3-123b93f75cba', + ], + ]; + + $instrument = new PaymentInstrumentRecurring(); + $instrument->setPaymentId('ba3119f2-9a73-11e4-89d3-123b93f75cba'); + + $payment->setPaymentMethod('recurring')->shouldBeCalled(); + $payment->setPaymentInstrument($instrument)->shouldBeCalled(); + + $this->map($data, $payment); + } + + function it_throws_exception_for_unknown_payment_method(Payment $payment) + { + $data = [ + 'payment_method' => 'non_existing_method', + 'payment_instrument' => [], + ]; + + $this->shouldThrow('Cardinity\Exception\Runtime')->duringMap($data, $payment); + } + + function it_maps_authorization_information(Payment $payment) + { + $data = [ + 'authorization_information' => [ + 'url' => 'https://authorization.url/auth', + 'data' => 'eJxdUl1vwj.......', + ], + ]; + + $info = new AuthorizationInformation(); + $info->setUrl('https://authorization.url/auth'); + $info->setData('eJxdUl1vwj.......'); + + $payment->setAuthorizationInformation($info)->shouldBeCalled(); + + $this->map($data, $payment); + } + + function it_maps_data_collection(MethodResultCollectionInterface $method, Payment $object) + { + $data = [ + ['id' => 32, 'type' => 'my_type'], + ]; + + $method->createResultObject()->shouldBeCalled()->willReturn($object); + + $object->setId(32)->shouldBeCalled(); + $object->setType('my_type')->shouldBeCalled(); + + $this->mapCollection($data, $method); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php new file mode 100644 index 00000000000..b94a2323099 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php @@ -0,0 +1,66 @@ +beConstructedWith($this->paymentId, $this->amount, $this->description); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + 'description' => $this->description, + ]); + } + + function it_does_not_contain_optional_properties() + { + $this->beConstructedWith($this->paymentId, $this->amount); + + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + ]); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + sprintf('payments/%s/settlements', $this->paymentId) + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php new file mode 100644 index 00000000000..8d17d7199ed --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php @@ -0,0 +1,52 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/settlements' + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php new file mode 100644 index 00000000000..cda82405141 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php @@ -0,0 +1,58 @@ +beConstructedWith($this->paymentId, $this->settlementId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_settlement_id() + { + $this->getSettlementId()->shouldReturn($this->settlementId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/settlements/' . $this->settlementId + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php new file mode 100644 index 00000000000..4175040b073 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php new file mode 100644 index 00000000000..8b7d9a9da9d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php @@ -0,0 +1,64 @@ +beConstructedWith($validator); + } + + function it_implements_validator_interface() + { + $this->shouldImplement('Cardinity\Method\ValidatorInterface'); + } + + function it_validates_given_method_instance(MethodInterface $method, ValidatorInterface $validator) + { + $attributes = ['field' => 'value']; + $constraints = ['constraints']; + + $method->getAttributes()->shouldBeCalled()->willReturn($attributes); + $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); + + $validator->validate($attributes, $constraints)->shouldBeCalled(); + + $this->validate($method); + } + + function it_throws_exception_on_validation_failure( + MethodInterface $method, + ValidatorInterface $validator, + ConstraintViolationList $violations + ) { + $attributes = ['field' => 'value']; + $constraints = ['constraints']; + + $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); + $method->getAttributes()->shouldBeCalled()->willReturn($attributes); + + $violations->count()->willReturn(1); + $violations->__toString()->willReturn(''); + + $validator->validate($attributes, $constraints)->willReturn($violations); + + $this->shouldThrow('Cardinity\Exception\InvalidAttributeValue')->duringValidate($method); + } + + function it_does_not_validate_method_with_no_constraints(MethodInterface $method, ValidatorInterface $validator) + { + $constraints = []; + + $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); + + $validator->validate([], $constraints)->shouldNotBeCalled(); + + $this->validate($method); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php new file mode 100644 index 00000000000..c84260d372d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php @@ -0,0 +1,62 @@ +beConstructedWith($this->paymentId, $this->description); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn([ + 'description' => $this->description, + ]); + } + + function it_does_not_contain_optional_properties() + { + $this->beConstructedWith($this->paymentId); + + $this->getAttributes()->shouldReturn([]); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + sprintf('payments/%s/voids', $this->paymentId) + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php new file mode 100644 index 00000000000..6cccb6bb261 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php @@ -0,0 +1,50 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments/' . $this->paymentId . '/voids'); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php new file mode 100644 index 00000000000..e41c5297b71 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php @@ -0,0 +1,58 @@ +beConstructedWith($this->paymentId, $this->voidId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_settlement_id() + { + $this->getvoidId()->shouldReturn($this->voidId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/voids/' . $this->voidId + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php new file mode 100644 index 00000000000..080ba892ce6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php new file mode 100644 index 00000000000..bd18aa9144f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php @@ -0,0 +1,215 @@ + 'foo', + * 'consumerSecret' => 'bar', + * ] + * @param LoggerInterface $logger Logs messages. + * @return self + */ + public static function create(array $options = [], $logger = Client::LOG_NONE) + { + $oauth = new Oauth1([ + 'token_secret' => '', + 'consumer_key' => $options['consumerKey'], + 'consumer_secret' => $options['consumerSecret'] + ]); + + $validator = Validation::createValidator(); + + if(isset($options['apiEndpoint'])){ + self::validateClientEndpoint($options, $validator); + self::$url = $options['apiEndpoint']; + } + + $stack = HandlerStack::create(); + $stack->push($oauth); + + if (!empty($logger)) { + $stack->push( + Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG)) + ); + } + + $client = new \GuzzleHttp\Client([ + 'base_uri' => self::$url, + 'handler' => $stack, + 'auth' => 'oauth' + ]); + + $mapper = new ResultObjectMapper(); + + return new self( + new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)), + new Validator($validator), + $mapper + ); + } + + /** + * @param ClientInterface $client + * @param ValidatorInterface $validator + * @param ResultObjectMapperInterface $mapper + */ + public function __construct( + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $this->client = $client; + $this->validator = $validator; + $this->mapper = $mapper; + } + + /** + * Call the given method. + * @param MethodInterface $method + * @return ResultObjectInterface|array + */ + public function call(MethodInterface $method) + { + $this->validator->validate($method); + + return $this->handleRequest($method); + } + + /** + * Call the particular method without data validation + * @param MethodInterface $method + * @return ResultObjectInterface|array + */ + public function callNoValidate(MethodInterface $method) + { + return $this->handleRequest($method); + } + + /** + * Handle all the request/response hard work + * @param MethodInterface $method + * @return ResultObjectInterface|array + */ + private function handleRequest(MethodInterface $method) + { + $result = $this->client->sendRequest( + $method, + $method->getMethod(), + $method->getAction(), + $this->getOptions($method) + ); + + if ($method instanceof MethodResultCollectionInterface) { + return $this->mapper->mapCollection($result, $method); + } + + return $this->mapper->map($result, $method->createResultObject()); + } + + /** + * Prepare request options for particular method + * @param MethodInterface $method + * @return array + */ + private function getOptions(MethodInterface $method) + { + if ($method->getMethod() == $method::GET) { + return [ + 'query' => $method->getAttributes(), + ]; + } + + return [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => json_encode( + $this->prepareAttributes($method->getAttributes()), + JSON_FORCE_OBJECT + ) + ]; + } + + /** + * Prepare request attributes + * @param array $data + * @return array + */ + private function prepareAttributes(array $data) + { + foreach ($data as $key => &$value) { + if (is_array($value)) { + $data[$key] = $this->prepareAttributes($value); + continue; + } + + if (is_float($value)) { + $value = sprintf("%01.2f", $value); + } + } + + return $data; + } + + /** + * Validate endPoint is a valid URL + * + * @param [array] $options + * @param [Validator] $validator + * @return void + */ + private static function validateClientEndpoint($options, $validator){ + $violations = $validator->validate($options['apiEndpoint'], [ + new Url(), + ]); + if(count($violations) != 0){ + throw new Exception\InvalidAttributeValue( + 'Your API endpoint is not a valid URL', + $violations + ); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php new file mode 100644 index 00000000000..29a2f085ea9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php @@ -0,0 +1,9 @@ +__toString(); + parent::__construct($message); + + $this->violations = $violations; + } + + public function getViolations() + { + return $this->violations; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php new file mode 100644 index 00000000000..8a0294e7a8f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php @@ -0,0 +1,9 @@ +message .= ' Response data: ' . serialize($result); + parent::__construct($this->message, $this->code, $previous); + + $this->result = $result; + } + + /** + * Get result object of particular response + * @return ResultObjectInterface + */ + public function getResult() + { + return $this->result; + } + + /** + * List of errors occured + * @return array + */ + public function getErrors() + { + return $this->result->getErrors(); + } + + /** + * Errors in string form + * @return string + */ + public function getErrorsAsString() + { + $string = ''; + foreach ($this->getErrors() as $error) { + $string .= sprintf( + "%s: %s", + $error['field'], + $error['message'] + ); + if (isset($error['rejected'])) { + $string .= sprintf(" ('%s' given)", $error['rejected']); + } + $string .= ";\n"; + } + + return trim($string); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php new file mode 100644 index 00000000000..dcb34d764b4 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php @@ -0,0 +1,9 @@ +client = $client; + $this->mapper = $mapper; + } + + /** + * Send HTTP request + * @param MethodInterface $method + * @param string $requestMethod POST|GET|PATCH + * @param string $url http URL + * @param array $options query options. Query values goes under 'body' key. + * + * @return array + */ + public function sendRequest( + MethodInterface $method, + $requestMethod, + $url, + array $options = [] + ) { + try { + $response = $this->client->request($requestMethod, $url, $options); + return json_decode($response->getBody(), true); + } catch (ClientException $e) { + throw $this->mapper->get($e, $method); + } catch (\Exception $e) { + throw new Exception\UnexpectedError('Unexpected error', $e->getCode(), $e); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php new file mode 100644 index 00000000000..b1d772fde66 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php @@ -0,0 +1,93 @@ +resultMapper = $resultMapper; + } + + /** + * Get mapped exception + * @param ClientException $exception + * @param MethodInterface $method + * @return Cardinity\Exception\Request + */ + public function get(ClientException $exception, MethodInterface $method) + { + $map = $this->getMap(); + if ($this->supports($exception, $map)) { + return $this->create( + $this->getMappedClass($exception, $map), + $exception, + $method + ); + } + + return $this->create( + 'Cardinity\\Exception\\UnexpectedResponse', + $exception, + $method + ); + } + + private function getMappedClass(ClientException $exception, $map) + { + return $map[$exception->getCode()]; + } + + private function supports(ClientException $exception, $map) + { + return array_key_exists($exception->getCode(), $map); + } + + private function getMap() + { + return [ + 400 => 'Cardinity\\Exception\\ValidationFailed', + 401 => 'Cardinity\\Exception\\Unauthorized', + 402 => 'Cardinity\\Exception\\Declined', + 403 => 'Cardinity\\Exception\\Forbidden', + 404 => 'Cardinity\\Exception\\NotFound', + 405 => 'Cardinity\\Exception\\MethodNotAllowed', + 406 => 'Cardinity\\Exception\\NotAcceptable', + 500 => 'Cardinity\\Exception\\InternalServerError', + 503 => 'Cardinity\\Exception\\ServiceUnavailable', + ]; + } + + private function create($class, ClientException $exception, MethodInterface $method) + { + $response = json_decode($exception->getResponse()->getBody(), true); + + // map declined response to result object + if ($exception->getCode() == 402) { + $resultObject = $method->createResultObject(); + } else { + $resultObject = new Error(); + } + + $response = $this->resultMapper->map( + $response, + $resultObject + ); + + return new $class( + $exception, + $response + ); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php new file mode 100644 index 00000000000..ceb3fd93d48 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php @@ -0,0 +1,116 @@ +type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of title. + * @return mixed + */ + public function getTitle() + { + return $this->title; + } + + /** + * Sets the value of title. + * @param mixed $title the title + * @return void + */ + public function setTitle($title) + { + $this->title = $title; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of detail. + * @return mixed + */ + public function getDetail() + { + return $this->detail; + } + + /** + * Sets the value of detail. + * @param mixed $detail the detail + * @return void + */ + public function setDetail($detail) + { + $this->detail = $detail; + } + + /** + * Gets the value of errors. + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Sets the value of errors. + * @param array $errors the errors + * @return void + */ + public function setErrors($errors) + { + $this->errors = $errors; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php new file mode 100644 index 00000000000..d494ab8731c --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php @@ -0,0 +1,54 @@ +url; + } + + /** + * Sets the value of url. + * @param mixed $url the url + * @return void + */ + public function setUrl($url) + { + $this->url = $url; + } + + /** + * Gets the value of data. + * @return mixed + */ + public function getData() + { + return $this->data; + } + + /** + * Sets the value of data. + * @param mixed $data the data + * @return void + */ + public function setData($data) + { + $this->data = $data; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php new file mode 100644 index 00000000000..817c6b074bf --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php @@ -0,0 +1,226 @@ +attributes = $attributes; + } + + public function getAction(): string + { + return 'payments'; + } + + public function getMethod(): string + { + return MethodInterface::POST; + } + + public function getAttributes(): array + { + return $this->attributes; + } + + public function createResultObject(): Payment + { + return new Payment(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'amount' => $this->buildElement('float', 1), + 'currency' => $this->buildElement('string', 1, ['min' => 3,'max' => 3]), + 'settle' => $this->buildElement('bool'), + 'order_id' => $this->buildElement('string', 0, ['min' => 2,'max' => 50]), + 'description' => $this->buildElement('string', 0, ['max' => 255]), + 'statement_descriptor_suffix' => $this->buildElement('string', 0, ['max' => 25]), + 'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]), + 'payment_method' => new Assert\Required([ + new Assert\Type([ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + new Assert\Choice([ + 'choices' => [ + self::CARD, + self::RECURRING + ] + ]) + ]), + 'payment_instrument' => $this->getPaymentInstrumentConstraints( + $this->getAttributes()['payment_method'] + ), + 'threeds2_data' => new Assert\Optional( + $this->getThreeDS2DataConstraints() + ) + ]); + } + + private function getPaymentInstrumentConstraints($method): ?object + { + switch ($method) { + case self::CARD: + return new Assert\Collection([ + 'pan' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Luhn() + ]), + 'exp_year' => $this->buildElement( + 'integer', 1, + ['min' => 4,'max' => 4], + new Assert\Range(['min' => date('Y')]) + ), + 'exp_month' => $this->buildElement('integer', 1), + 'cvc' => $this->buildElement('string', 1, ['min' => 3, 'max' => 4]), + 'holder' => $this->buildElement('string', 1, ['max' => 32]), + ]); + case self::RECURRING: + return new Assert\Collection([ + 'payment_id' => $this->buildElement('string', 1), + ]); + } + + throw new \InvalidArgumentException( + sprintf( + 'Payment instrument for payment method "%s" is not expected', + $method + ) + ); + } + + private function getThreeDS2DataConstraints(): object + { + return new Assert\Collection([ + 'notification_url' => $this->getNotificationUrlConstraints(), + 'browser_info' => $this->getBrowserInfoConstraints(), + 'billing_address' => new Assert\Optional( + $this->getAdressConstraints() + ), + 'delivery_address' => new Assert\Optional( + $this->getAdressConstraints() + ), + 'cardholder_info' => new Assert\Optional( + $this->getCardHolderInfoConstraints() + ), + ]); + } + + public function getNotificationUrlConstraints() + { + return new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type([ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + new CallbackUrlConstraint(), + new Assert\Url([ + 'message' => 'The protocol of {{ value }} should be "http" or "https".', + 'protocols' => ['http', 'https'], + ]), + ]); + } + + public function getIpAddressConstraints() + { + return new Assert\Optional([ + new Assert\NotBlank(), + new CallbackUrlConstraint(), + new Assert\Type([ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + ]); + } + + private function getBrowserInfoConstraints() + { + return new Assert\Collection([ + 'accept_header' => $this->buildElement('string', 1), + 'browser_language' => $this->buildElement('string', 1), + 'screen_width' => $this->buildElement('integer', 1), + 'screen_height' => $this->buildElement('integer', 1), + 'challenge_window_size' => $this->buildElement('string', 1), + 'user_agent' => $this->buildElement('string', 1), + 'color_depth' => $this->buildElement('integer', 1), + 'time_zone' => $this->buildElement('integer', 1), + 'ip_address' => $this->getIpAddressConstraints(), + 'javascript_enabled' => new Assert\Optional($this->buildElement('bool')), + 'java_enabled' => new Assert\Optional($this->buildElement('bool')), + ]); + } + + private function getAdressConstraints(): object + { + return new Assert\Collection([ + 'address_line1' => $this->buildElement('string', 1, ['max' => 50]), + 'address_line2' => new Assert\Optional( + $this->buildElement('string', 1, ['max' => 50]) + ), + 'address_line3' => new Assert\Optional( + $this->buildElement('string', 0, ['max' => 50]) + ), + 'city' => $this->buildElement('string', 1, ['max' => 50]), + 'country' => $this->buildElement('string', 1, ['max' => 10]), + 'postal_code' => $this->buildElement('string', 1, ['max' => 16]), + 'state' => new Assert\Optional( + $this->buildElement('string', 0, ['max' => 14]) + ), + ]); + } + + private function getCardHolderInfoConstraints(): object + { + return new Assert\Collection([ + 'email_address' => new Assert\Optional( + new Assert\Email(['mode' => 'loose']) + ), + 'mobile_phone_number' => new Assert\Optional($this->buildElement('string')), + 'work_phone_number' => new Assert\Optional($this->buildElement('string')), + 'home_phone_number' => new Assert\Optional($this->buildElement('string')), + ]); + } + + private function buildElement( + string $typeValue, + bool $isRequired = false, + array $length = null, + $args = null // TODO can it be null? + ): object + { + $inside_array = $this->getInsideArray($typeValue); + if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); + if ($length) array_push($inside_array, new Assert\Length($length)); + if ($args) array_push($inside_array, $args); + + return $isRequired + ? new Assert\Required($inside_array) + : new Assert\Optional($inside_array) + ; + } + + private function getInsideArray(string $typeValue): array + { + return [ + new Assert\Type([ + 'type' => $typeValue, + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + ]; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php new file mode 100644 index 00000000000..d344626515d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php @@ -0,0 +1,78 @@ +paymentId = $paymentId; + $this->authorizeData = $authorizeData; + $this->finalizeKey = $isV2 ? 'cres' : 'authorize_data'; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getAuthorizeData() + { + return $this->authorizeData; + } + + public function getAction() + { + return sprintf('payments/%s', $this->getPaymentId()); + } + + public function getMethod() + { + return MethodInterface::PATCH; + } + + public function createResultObject() + { + return new Payment(); + } + + public function getAttributes() + { + return [ + $this->finalizeKey => $this->getAuthorizeData(), + $this->paymentId => $this->getPaymentId(), + ]; + } + + public function getValidationConstraints() + { + $type_params = [ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]; + return new Assert\Collection([ + 'fields' => [ + $this->finalizeKey => new Assert\Required([ + new Assert\NotBlank(["message"=>"$this->finalizeKey missing."]), + new Assert\Type($type_params) + ]), + $this->paymentId => new Assert\Required([ + new Assert\NotBlank(["message"=>"paymentId missing."]), + new Assert\Type($type_params) + ]), + ], + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php new file mode 100644 index 00000000000..4ec5d3cb74f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php @@ -0,0 +1,46 @@ +paymentId = $paymentId; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getAction() + { + return sprintf('payments/%s', $this->getPaymentId()); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Payment(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php new file mode 100644 index 00000000000..155f4254ca7 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php @@ -0,0 +1,54 @@ +limit = $limit; + } + + public function getLimit() + { + return $this->limit; + } + + public function getAction() + { + return 'payments'; + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Payment(); + } + + public function getAttributes() + { + return [ + 'limit' => $this->getLimit() + ]; + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'limit' => new Assert\Optional([ + new Assert\NotNull(), + new Assert\Type(['type' => 'integer']), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php new file mode 100644 index 00000000000..64f8d32253a --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php @@ -0,0 +1,478 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of amount. + * @return mixed + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Sets the value of amount. + * @param mixed $amount the amount + * @return void + */ + public function setAmount($amount) + { + $this->amount = $amount; + } + + /** + * Gets the value of currency. + * @return mixed + */ + public function getCurrency() + { + return $this->currency; + } + + /** + * Sets the value of currency. + * @param mixed $currency the currency + * @return void + */ + public function setCurrency($currency) + { + $this->currency = $currency; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of settle. + * @return mixed + */ + public function getSettle() + { + return $this->settle; + } + + /** + * Sets the value of settle. + * @param mixed $settle the settle + * @return void + */ + public function setSettle($settle) + { + $this->settle = $settle; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Gets the value of country. + * @return mixed + */ + public function getCountry() + { + return $this->country; + } + + /** + * Sets the value of country. + * @param mixed $country the country + * @return void + */ + public function setCountry($country) + { + $this->country = $country; + } + + /** + * Gets the value of paymentMethod. + * @return mixed + */ + public function getPaymentMethod() + { + return $this->paymentMethod; + } + + /** + * Sets the value of paymentMethod. + * @param mixed $paymentMethod the payment method + * @return void + */ + public function setPaymentMethod($paymentMethod) + { + $this->paymentMethod = $paymentMethod; + } + + /** + * Gets the value of paymentInstrument. + * @return PaymentInstrumentInterface + */ + public function getPaymentInstrument() + { + return $this->paymentInstrument; + } + + /** + * Sets the value of paymentInstrument. + * @param PaymentInstrumentInterface $paymentInstrument the payment instrument + * @return void + */ + public function setPaymentInstrument(PaymentInstrumentInterface $paymentInstrument) + { + $this->paymentInstrument = $paymentInstrument; + } + + /** + * @deprecated method is deprecated and shouldn't be used. + * Gets the value of authorizeData. + * @return mixed + */ + public function getAuthorizeData() + { + return $this->authorizeData; + } + + /** + * @deprecated method is deprecated and shouldn't be used. + * Sets the value of authorizeData. + * @param mixed $authorizeData the authorize data + * @return void + */ + public function setAuthorizeData($authorizeData) + { + $this->authorizeData = $authorizeData; + } + + /** + * Gets the value of authorizationInformation. + * @return AuthorizationInformation + */ + public function getAuthorizationInformation() + { + return $this->authorizationInformation; + } + + /** + * Sets the value of authorizationInformation. + * @param AuthorizationInformation $authorizationInformation the authorization information + * @return void + */ + public function setAuthorizationInformation(AuthorizationInformation $authorizationInformation) + { + $this->authorizationInformation = $authorizationInformation; + } + + /** + * @return ThreeDS2AuthorizationInformation + */ + public function getThreeds2Data() + { + return $this->threeDS2AuthorizationInformation; + } + + /** + * @param ThreeDS2AuthorizationInformation + * @return VOID + */ + public function setThreeds2Data( + ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation + ){ + $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation; + } + + /** + * Gets the value of statementDescriptorSuffix. + * @return mixed + */ + public function getStatementDescriptorSuffix() + { + return $this->statementDescriptorSuffix; + } + + /** + * Sets the value of statementDescriptorSuffix. + * @param mixed $statementDescriptorSuffix the description included in statement + * @return void + */ + public function setStatementDescriptorSuffix($statementDescriptorSuffix) + { + $this->statementDescriptorSuffix = $statementDescriptorSuffix; + } + + + /** + * @return BOOL is it 3D secure v1? + */ + public function isThreedsV1() : bool + { + return $this->authorizationInformation != null; + } + + /** + * @return BOOL is it 3D secure v2? + */ + public function isThreedsV2() : bool + { + return $this->threeDS2AuthorizationInformation != null; + } + + /** + * Check if payment is pending + * @return boolean + */ + public function isPending() + { + return $this->getStatus() === 'pending'; + } + + /** + * Check if payment is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if payment is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php new file mode 100644 index 00000000000..35691823cda --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php @@ -0,0 +1,121 @@ +cardBrand; + } + + /** + * Sets the value of cardBrand. + * @param mixed $cardBrand the card brand + * @return void + */ + public function setCardBrand($cardBrand) + { + $this->cardBrand = $cardBrand; + } + + /** + * Gets the value of pan. + * @return mixed + */ + public function getPan() + { + return $this->pan; + } + + /** + * Sets the value of pan. + * @param mixed $pan the pan + * @return void + */ + public function setPan($pan) + { + $this->pan = $pan; + } + + /** + * Gets the value of expYear. + * @return mixed + */ + public function getExpYear() + { + return $this->expYear; + } + + /** + * Sets the value of expYear. + * @param mixed $expYear the exp year + * @return void + */ + public function setExpYear($expYear) + { + $this->expYear = $expYear; + } + + /** + * Gets the value of expMonth. + * @return mixed + */ + public function getExpMonth() + { + return $this->expMonth; + } + + /** + * Sets the value of expMonth. + * @param mixed $expMonth the exp month + * @return void + */ + public function setExpMonth($expMonth) + { + $this->expMonth = $expMonth; + } + + /** + * Gets the value of holder. + * @return mixed + */ + public function getHolder() + { + return $this->holder; + } + + /** + * Sets the value of holder. + * @param mixed $holder the holder + * @return void + */ + public function setHolder($holder) + { + $this->holder = $holder; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php new file mode 100644 index 00000000000..b844435dafe --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php @@ -0,0 +1,8 @@ +paymentId; + } + + /** + * Sets the value of paymentId. + * @param mixed $paymentId the payment id + * @return void + */ + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php new file mode 100644 index 00000000000..1511bff380f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php @@ -0,0 +1,58 @@ +acsUrl; + } + + + /** + * @param STRING + * @return VOID + */ + public function setAcsUrl(string $acsUrl) : void + { + $this->acsUrl = $acsUrl; + } + + + /** + * @return STRING + */ + public function getCReq() + { + return $this->cReq; + } + + + /** + * @param STRING + * @return VOID + */ + public function setCReq(string $cReq) : void + { + $this->cReq = $cReq; + } + + public function getErrors() + { + + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php new file mode 100644 index 00000000000..e5d3d42b44a --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php @@ -0,0 +1,64 @@ +paymentId = $paymentId; + $this->amount = $amount; + $this->description = $description; + } + + public function getAction() + { + return sprintf('payments/%s/refunds', $this->paymentId); + } + + public function getMethod() + { + return MethodInterface::POST; + } + + public function getAttributes() + { + $return = [ + 'amount' => $this->amount, + ]; + + if ($this->description !== null) { + $return['description'] = $this->description; + } + + return $return; + } + + public function createResultObject() + { + return new Refund(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'amount' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'float']) + ]), + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php new file mode 100644 index 00000000000..eda5e22c8b0 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php @@ -0,0 +1,57 @@ +paymentId = $paymentId; + $this->refundId = $refundId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/refunds/%s', + $this->getPaymentId(), + $this->getRefundId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Refund(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getRefundId() + { + return $this->refundId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php new file mode 100644 index 00000000000..1936fce7d24 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php @@ -0,0 +1,50 @@ +paymentId = $paymentId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/refunds', + $this->getPaymentId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Refund(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php new file mode 100644 index 00000000000..50a14b3e663 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php @@ -0,0 +1,286 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of amount. + * @return mixed + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Sets the value of amount. + * @param mixed $amount the amount + * @return void + */ + public function setAmount($amount) + { + $this->amount = $amount; + } + + /** + * Gets the value of currency. + * @return mixed + */ + public function getCurrency() + { + return $this->currency; + } + + /** + * Sets the value of currency. + * @param mixed $currency the currency + * @return void + */ + public function setCurrency($currency) + { + $this->currency = $currency; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of parentId. + * @return mixed + */ + public function getParentId() + { + return $this->parentId; + } + + /** + * Sets the value of parentId. + * @param mixed $parentId the parent id + * @return void + */ + public function setParentId($parentId) + { + $this->parentId = $parentId; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Check if refund is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if refund is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php new file mode 100644 index 00000000000..eb479c9e1ae --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php @@ -0,0 +1,160 @@ + 'status', + 'message' => $this->getError() + ] + ]; + } + + /** + * Return single error + */ + public function getError() + { + return ''; + } + + /** + * Serializes result object to json object + * @param boolean $toJson encode result to json + * @return array|object + */ + public function serialize($toJson = true) + { + $data = []; + + $getters = $this->classGetters(get_class($this)); + foreach ($getters as $method) { + $property = $this->propertyName($method); + $value = $this->$method(); + + if (is_float($value)) { + $value = sprintf("%01.2f", $value); + } elseif (is_object($value)) { + $value = $value->serialize(false); + } + + if ($value !== null) { + $data[$property] = $value; + } + } + + if ($toJson === true) { + return json_encode($data); + } + + return $data; + } + + /** + * Loads result object values from json object + * @param string $string json + * @return void + */ + public function unserialize($string) + { + $data = json_decode($string); + foreach ($data as $property => $value) { + $method = $this->setterName($property); + + if (is_numeric($value) && strstr($value, '.')) { + $value = floatval($value); + } elseif (is_object($value)) { + if ($property == 'authorization_information') { + $object = new AuthorizationInformation(); + $object->unserialize(json_encode($value)); + $value = $object; + } elseif ($property == 'threeds2_data') { + $object = new ThreeDS2AuthorizationInformation(); + $object->unserialize(json_encode($value)); + $value = $object; + } elseif ($property == 'payment_instrument') { + if (!isset($data->payment_method)) { + throw new Exception\Runtime('Property "payment_method" is missing'); + } + + switch ($data->payment_method) { + case Payment\Create::CARD: + $object = new PaymentInstrumentCard(); + break; + case Payment\Create::RECURRING: + $object = new PaymentInstrumentRecurring(); + break; + default: + $object = new PaymentInstrumentCard(); + break; + } + $object->unserialize(json_encode($value)); + $value = $object; + } + } + + $this->$method($value); + } + } + + /** + * @param string $class + * @return array + */ + private function classGetters($class) + { + $methods = get_class_methods($class); + return array_filter($methods, function ($value) use ($methods) { + if ($value == 'getErrors') { + return false; + } + + // no setter means it's inherited property, should be ignored + $setter = $this->setterName($this->propertyName($value)); + if (!in_array($setter, $methods)) { + return false; + } + + return substr($value, 0, 3) == 'get'; + }); + } + + /** + * @param string $method + * @return string + */ + private function propertyName($method) + { + $method = lcfirst(substr($method, 3)); + $method = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $method)); + + return $method; + } + + /** + * @param string $property + * @return string + */ + private function setterName($property) + { + $parts = explode('_', $property); + $parts = array_map('ucfirst', $parts); + $property = implode('', $parts); + + return 'set' . ucfirst($property); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php new file mode 100644 index 00000000000..9b7890d5562 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php @@ -0,0 +1,15 @@ +map($item, $method->createResultObject()); + } + + return $return; + } + + /** + * Map response data to instance of ResultObjectInterface + * @param array $response + * @param ResultObjectInterface $result + * + * @return ResultObjectInterface + */ + public function map(array $response, ResultObjectInterface $result) + { + foreach ($response as $field => $value) { + $method = $this->getSetterName($field); + + if (!method_exists($result, $method)) { + continue; + } + + if ($field == 'payment_instrument') { + $value = $this->transformPaymentInstrumentValue($value, $response['payment_method']); + } elseif ($field == 'authorization_information') { + $value = $this->transformAuthorizationInformationValue($value); + } elseif ($field == 'threeds2_data') { + $value = $this->transformThreeDS2DataValue($value); + } + + $result->$method($value); + } + + return $result; + } + + /** + * Extracts camelCased setter name from underscore notation. + * Eg. my_field_name => myFieldName + * @param string $field + * @return string + */ + private function getSetterName($field) + { + $parts = explode('_', $field); + array_map('ucfirst', $parts); + $name = 'set' . implode('', $parts); + + return $name; + } + + /** + * Transform PaymentInstrument result array to object + * @param array $data + * @param string $method + * @return PaymentInstrumentCard|PaymentInstrumentRecurring + * @throws Exception\Runtime for unsupported methods + */ + private function transformPaymentInstrumentValue(array $data, $method) + { + if ($method == 'card') { + $instrument = new PaymentInstrumentCard(); + } elseif ($method == 'recurring') { + $instrument = new PaymentInstrumentRecurring(); + } else { + throw new Exception\Runtime(sprintf('Method "%s" is not supported', $method)); + } + + $this->map($data, $instrument); + + return $instrument; + } + + /** + * Transform AuthorizationInformation result array to object + * @param array $data + * @return AuthorizationInformation + */ + private function transformAuthorizationInformationValue($data) + { + $info = new AuthorizationInformation(); + $this->map($data, $info); + + return $info; + } + + /** + * @param ARRAY $data + * @return ThreeDS2AuthorizationInformation + */ + private function transformThreeDS2DataValue($data) + { + $threeds2 = new ThreeDS2AuthorizationInformation(); + $this->map($data, $threeds2); + return $threeds2; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php new file mode 100644 index 00000000000..f7d9b3c78ee --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php @@ -0,0 +1,10 @@ +paymentId = $paymentId; + $this->amount = $amount; + $this->description = $description; + } + + public function getAction() + { + return sprintf('payments/%s/settlements', $this->paymentId); + } + + public function getMethod() + { + return MethodInterface::POST; + } + + public function getAttributes() + { + $return = [ + 'amount' => $this->amount, + ]; + + if ($this->description !== null) { + $return['description'] = $this->description; + } + + return $return; + } + + public function createResultObject() + { + return new Settlement(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'amount' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'float']) + ]), + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php new file mode 100644 index 00000000000..9d14e3a7263 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php @@ -0,0 +1,57 @@ +paymentId = $paymentId; + $this->settlementId = $settlementId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/settlements/%s', + $this->getPaymentId(), + $this->getSettlementId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Settlement(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getSettlementId() + { + return $this->settlementId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php new file mode 100644 index 00000000000..937fe0de032 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php @@ -0,0 +1,50 @@ +paymentId = $paymentId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/settlements', + $this->getPaymentId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Settlement(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php new file mode 100644 index 00000000000..8443b9f26cc --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php @@ -0,0 +1,286 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of amount. + * @return mixed + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Sets the value of amount. + * @param mixed $amount the amount + * @return void + */ + public function setAmount($amount) + { + $this->amount = $amount; + } + + /** + * Gets the value of currency. + * @return mixed + */ + public function getCurrency() + { + return $this->currency; + } + + /** + * Sets the value of currency. + * @param mixed $currency the currency + * @return void + */ + public function setCurrency($currency) + { + $this->currency = $currency; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of parentId. + * @return mixed + */ + public function getParentId() + { + return $this->parentId; + } + + /** + * Sets the value of parentId. + * @param mixed $parentId the parent id + * @return void + */ + public function setParentId($parentId) + { + $this->parentId = $parentId; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Check if settlement is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if settlement is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php new file mode 100644 index 00000000000..5a047382fc3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php @@ -0,0 +1,48 @@ +validator = $validator; + } + + /** + * Validates given method values against its constraints + * + * @param MethodInterface $method + * @throws Exception\InvalidAttributeValue + */ + public function validate(MethodInterface $method) + { + $constraints = $method->getValidationConstraints(); + if (empty($constraints)) { + return; + } + + $violations = $this->validator->validate( + $method->getAttributes(), + $constraints + ); + + $countable = is_array($violations) || $violations instanceof \Countable; + + if ($countable && count($violations) !== 0) { + throw new Exception\InvalidAttributeValue( + 'Your method contains invalid attribute value', + $violations + ); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php new file mode 100644 index 00000000000..b72aa1ba13d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php @@ -0,0 +1,19 @@ +context->buildViolation($constraint->message) + ->setParameter('{{ param }}', $value) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php new file mode 100644 index 00000000000..a05654aa6fa --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php @@ -0,0 +1,56 @@ +paymentId = $paymentId; + $this->description = $description; + } + + public function getAction() + { + return sprintf('payments/%s/voids', $this->paymentId); + } + + public function getMethod() + { + return MethodInterface::POST; + } + + public function getAttributes() + { + $return = []; + + if ($this->description !== null) { + $return['description'] = $this->description; + } + + return $return; + } + + public function createResultObject() + { + return new VoidPayment(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php new file mode 100644 index 00000000000..75165619d24 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php @@ -0,0 +1,57 @@ +paymentId = $paymentId; + $this->voidId = $voidId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/voids/%s', + $this->getPaymentId(), + $this->getvoidId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new VoidPayment(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getvoidId() + { + return $this->voidId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php new file mode 100644 index 00000000000..01ca7c9a11e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php @@ -0,0 +1,50 @@ +paymentId = $paymentId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/voids', + $this->getPaymentId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new VoidPayment(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php new file mode 100644 index 00000000000..9fba8392ac3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php @@ -0,0 +1,239 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of parentId. + * @return mixed + */ + public function getParentId() + { + return $this->parentId; + } + + /** + * Sets the value of parentId. + * @param mixed $parentId the parent id + * @return void + */ + public function setParentId($parentId) + { + $this->parentId = $parentId; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Check if void is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if void is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php new file mode 100644 index 00000000000..c010b0d5cf1 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php @@ -0,0 +1,85 @@ +baseConfig = [ + 'consumerKey' => $_ENV['CONSUMER_KEY'], + 'consumerSecret' => $_ENV['CONSUMER_SECRET'], + ]; + $this->log = Client::LOG_NONE; + } + + /** + * Test create client with invalid URL + * + * @return void + */ + public function testInvalidURLEndpoint(){ + + $this->baseConfig['apiEndpoint'] = '123abc'; + try { + Client::create($this->baseConfig, $this->log); + } catch (\Exception $e) { + $this->assertStringContainsString('Your API endpoint is not a valid URL', $e->getMessage()); + } + } + + /** + * Test create client with valid URL, + * + * @return void + */ + public function testValidUrlWrongEndpoint(){ + + $this->baseConfig['apiEndpoint'] = 'https://example.com/'; + + try { + $client = Client::create($this->baseConfig, $this->log); + } catch (\Exception $e) { + $this->assertStringContainsString('error', $e->getMessage()); + } + $this->assertInstanceOf('Cardinity\Client', $client); + } + + /** + * Test create client with valid URL, + * + * @return void + */ + public function testValidURLValidEndpoint(){ + + $this->baseConfig['apiEndpoint'] = 'https://api.cardinity.com/v1/'; + $client = Client::create($this->baseConfig, $this->log); + $this->assertInstanceOf('Cardinity\Client', $client); + } + + /** + * Test create client with valid URL, + * + * @return void + */ + public function testNoEndpoint(){ + + unset($this->baseConfig['apiEndpoint']); + $client = Client::create($this->baseConfig, $this->log); + + $reflection = new \ReflectionObject($client); + $urlProperty = $reflection->getProperty('url'); + $urlProperty->setAccessible(true); + + $this->assertSame($urlProperty->getValue(),'https://api.cardinity.com/v1/'); + $this->assertInstanceOf('Cardinity\Client', $client); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php new file mode 100644 index 00000000000..ba7b7dc07a9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php @@ -0,0 +1,183 @@ +payment3ds2Params = $this->get3ds2PaymentParams(); + parent::setUp(); + } + + /** + * @dataProvider localhostUrlValidationDataProvider + * @param string $address + * @param string $expectedMessage + * @return void + */ + public function testLocalhostUrlExeptionRised($address, $expectedMessage) + { + $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; + $method = new Payment\Create($this->payment3ds2Params); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function localhostUrlValidationDataProvider() + { + return [ + [ + 'http://localhost', + $this->getRestrictedHostnameErrorMsg('http://localhost'), + ],[ + 'https://localhost', + $this->getRestrictedHostnameErrorMsg('https://localhost'), + ],[ + 'http://127.0.0.1', + $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), + ],[ + 'https://127.0.0.1', + $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), + ] + ]; + } + + + /** + * @dataProvider protocolUrlValidationDataProvider + * @param string $address + * @param string $expectedMessage + * @return void + */ + public function testProtocolUrlExeptionRised($address, $expectedMessage) + { + $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; + $method = new Payment\Create($this->payment3ds2Params); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function protocolUrlValidationDataProvider() + { + return [ + [ + 'ftp://example.com', + 'The protocol of "ftp://example.com" should be "http" or "https".' + ],[ + 'htt://example.com', + 'The protocol of "htt://example.com" should be "http" or "https".' + ],[ + 'f://example.com', + 'The protocol of "f://example.com" should be "http" or "https".' + ] + ]; + } + + + /** + * @dataProvider localhostUrlNotStringDataProvider + * @return void + */ + public function testLocalhostUrlNotStringExeptionRised($address, $expectedMessage) + { + $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; + $method = new Payment\Create($this->payment3ds2Params); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function localhostUrlNotStringDataProvider() + { + return [ + [ + 123, + 'This value should be of type string.' + ],[ + null, + 'This value should not be blank.' + ], + ]; + } + + /** + * @dataProvider browserInfoIpAddressDataProvider + * @param array $address + * @param string $expectedMessage + * @return void + */ + public function testBrowserInfoIpAddressExeptionRised($address, $expectedMessage) + { + $paymentParams = $this->get3ds2PaymentParams($address); + $method = new Payment\Create($paymentParams); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function browserInfoIpAddressDataProvider() + { + return [ + [ + ['ip_address' => 123], + 'This value should be of type string.' + ],[ + ['ip_address' => ''], + 'This value should not be blank.' + ],[ + ['ip_address' => 'http://localhost'], + $this->getRestrictedHostnameErrorMsg('http://localhost'), + ],[ + ['ip_address' => 'https://localhost'], + $this->getRestrictedHostnameErrorMsg('https://localhost'), + ],[ + ['ip_address' => 'http://127.0.0.1'], + $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), + ],[ + ['ip_address' => 'https://127.0.0.1'], + $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), + ], + ]; + } + + /** + * @param string $address url or ip + * @return string + */ + private function getRestrictedHostnameErrorMsg(string $address) + { + return 'The url "' . $address . + '" contains restricted values. Do not use "localhost" or "127.0.0.1".'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php new file mode 100644 index 00000000000..1915cd264e7 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php @@ -0,0 +1,160 @@ +client = Client::create($this->getConfig(), $log); + + $this->assertInstanceOf('Cardinity\Client', $this->client); + } + + /** + * @return array + */ + protected function getConfig() + { + return [ + 'consumerKey' => $_ENV['CONSUMER_KEY'], + 'consumerSecret' => $_ENV['CONSUMER_SECRET'], + ]; + } + + /** + * @return array + */ + protected function getPaymentParams() + { + return [ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => date('Y') + 4, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], + ]; + } + + /** + * @param array optional + * @return array + */ + public function get3ds2PaymentParams($browserData = []) + { + return array_merge( + $this->getPaymentParams(), + [ + 'threeds2_data' => $this->getThreeDS2Data($browserData) + ] + ); + } + + /** + * @return Payment\Payment + */ + public function getPayment() + { + $payment = new Payment\Payment(); + $payment->setId('foo'); + $payment->setType('bar'); + $payment->setCurrency(null); + $payment->setAmount('55.00'); + $payment->setPaymentMethod(Payment\Create::CARD); + return $payment; + } + + /** + * @param array optional + * @return array + */ + public function getBrowserInfo($args = []) + { + $browserInfo = [ + 'accept_header' => 'Some header', + 'browser_language' => 'LT', + 'screen_width' => 390, + 'screen_height' => 400, + 'challenge_window_size' => '390x400', + 'user_agent' => 'super user agent', + 'color_depth' => 24, + 'time_zone' => -60, + ]; + if ($args) { + foreach($args as $key => $val) { + $browserInfo[$key] = $val; + } + } + return $browserInfo; + } + + /** + * @param array optional + * @return array + */ + public function getAddress($args = []) + { + $address = [ + 'address_line1' => 'first address line', + 'city' => 'balbieriskis', + 'country' => 'LT', + 'postal_code' => '0234' + ]; + if ($args && isset($args['address_line2'])) { + $address['address_line2'] = $args['address_line2']; + } + if ($args && isset($args['address_line3'])) { + $address['address_line3'] = $args['address_line3']; + } + if ($args && isset($args['state'])) { + $address['state'] = $args['state']; + } + return $address; + } + + /** + * @param array optional + * @return array + */ + public function getThreeDS2Data($browserData = []) + { + return [ + 'notification_url' => 'https://notification.url/', + 'browser_info' => $this->getBrowserInfo($browserData), + ]; + } + + /** + * @return Payment\PaymentInstrumentCard + */ + public function getCard() + { + $card = new Payment\PaymentInstrumentCard(); + $card->setCardBrand('Visa'); + $card->setPan('4447'); + $card->setExpYear(date('Y') + 4); + $card->setExpMonth(11); + $card->setHolder('James Bond'); + return $card; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php new file mode 100644 index 00000000000..0fc0cc87b3d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php @@ -0,0 +1,102 @@ +getMockBuilder('Cardinity\Method\Payment\Get') + ->disableOriginalConstructor() + ->getMock() + ; + } + + /** + * @return void + */ + public function testErrorResultObjectForErrorResponse() + { + $method = $this->getPaymentMethodMock(); + $method->method('getAction')->willReturn('payments'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn(Payment\Get::POST); + + try { + $this->client->call($method); + } catch (\Cardinity\Exception\ValidationFailed $e) { + $result = $e->getResult(); + $this->assertInstanceOf('Cardinity\Method\Error', $result); + $this->assertSame('https://developers.cardinity.com/api/v1/#400', $result->getType()); + $this->assertSame('Validation Failed', $result->getTitle()); + $this->assertStringContainsString('validation errors', $result->getDetail()); + $this->assertTrue(is_array($result->getErrors())); + $this->assertNotEmpty($result->getErrors()); + } + } + + /** + * @return void + */ + public function testUnauthorizedResponse() + { + $client = Client::create([ + 'consumerKey' => 'no', + 'consumerSecret' => 'yes', + ]); + $method = new Payment\Get('xxxyyy'); + $this->expectException(\Cardinity\Exception\Unauthorized::class); + + $client->call($method); + } + + /** + * @return void + */ + public function testBadRequest() + { + $method = $this->getPaymentMethodMock(); + $method->method('getAction')->willReturn('payments'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn(Payment\Get::POST); + + $this->expectException(\Cardinity\Exception\ValidationFailed::class); + $this->client->call($method); + } + + /** + * @return void + */ + public function testNotFound() + { + $method = $this->getPaymentMethodMock(); + $method->method('getAction')->willReturn('my_dreamy_action'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn(Payment\Get::POST); + + $this->expectException(\Cardinity\Exception\NotFound::class); + $this->client->call($method); + } + + /** + * @return void + */ + public function testMethodNotAllowed() + { + $method = $this->getPaymentMethodMock();; + $method->method('getAction')->willReturn('payments'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn('DELETE'); + + $this->expectException(\Cardinity\Exception\MethodNotAllowed::class); + $this->client->call($method); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php new file mode 100644 index 00000000000..70e825644f6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php @@ -0,0 +1,267 @@ +paymentParams = $this->getPaymentParams(); + parent::setUp(); + } + + /** + * @return void + */ + public function testResultObjectSerialization() + { + $payment = $this->getPayment(); + + $card = $this->getCard(); + $payment->setPaymentInstrument($card); + + $info = new Payment\AuthorizationInformation(); + $info->setUrl('http://...'); + $info->setData('some_data'); + $payment->setAuthorizationInformation($info); + + $this->assertSame( + '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}', + $payment->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; + + $payment = new Payment\Payment(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getCurrency()); + $this->assertSame(55.00, $payment->getAmount()); + $this->assertInstanceOf('Cardinity\Method\Payment\AuthorizationInformation', $payment->getAuthorizationInformation()); + $this->assertSame('http://...', $payment->getAuthorizationInformation()->getUrl()); + $this->assertInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard', $payment->getPaymentInstrument()); + $this->assertSame('James Bond', $payment->getPaymentInstrument()->getHolder()); + } + + /** + * @dataProvider invalidAmountValuesData + * @param mixed $amount + * @return void + */ + public function testAmountValidationConstraint($amount) + { + $this->paymentParams['amount'] = $amount; + $method = new Payment\Create($this->paymentParams); + + $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); + $this->client->call($method); + } + + /** + * @return array + */ + public function invalidAmountValuesData() + { + return [ + ['150.01'], + [150], + ]; + } + + /** + * @return void + */ + public function testMissingRequiredAttribute() + { + $params = $this->getPaymentParams(); + unset($params['currency']); + $method = new Payment\Create($params); + $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); + $this->client->call($method); + } + + /** + * Invalid data. Check error message. + * @return void + */ + public function testCreateFailPanValidation() + { + $this->paymentParams['payment_instrument']['pan'] = '4242424242424241'; + $method = new Payment\Create($this->paymentParams); + $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); + $this->client->call($method); + } + + /** + * Invalid data. Generic handling. + * @return void + */ + public function testCreateFailMonthValidation() + { + $this->paymentParams['payment_instrument']['exp_month'] = 13; + $method = new Payment\Create($this->paymentParams); + $this->expectException(\Cardinity\Exception\ValidationFailed::class); + $this->client->call($method); + } + + /** + * @return ResultObject + */ + public function testCreate() + { + $method = new Payment\Create($this->paymentParams); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Payment\Payment + * @return ResultObject + */ + public function testCreateRecurring(Payment\Payment $payment) + { + $params = $this->getPaymentParams(); + $params['payment_method'] = Payment\Create::RECURRING; + $params['payment_instrument'] = [ + 'payment_id' => $payment->getId() + ]; + + $method = new Payment\Create($params); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Payment\Payment + * @return void + */ + public function testGet(Payment\Payment $payment) + { + $method = new Payment\Get($payment->getId()); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + } + + /** + * @return void + */ + public function testGetAll() + { + $method = new Payment\GetAll(5); + $result = $this->client->call($method); + + $this->assertCount(5, $result); + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result[0]); + } + + /** + * @return ResultObject + */ + public function testCreate3dFail() + { + $this->paymentParams['description'] = '3d-fail'; + + $method = new Payment\Create($this->paymentParams); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('pending', $result->getStatus()); + $this->assertSame(true, $result->isPending()); + $this->assertSame('3d-fail', $result->getAuthorizationInformation()->getData()); + + return $result; + } + + /** + * @depends testCreate3dFail + * @param Payment\Payment + */ + public function testFinalizePaymentFail(Payment\Payment $payment) + { + $paymentId = $payment->getId(); + $authorizationInformation = $payment->getAuthorizationInformation()->getData(); + + try { + $method = new Payment\Finalize($paymentId, $authorizationInformation); + $this->client->call($method); + } catch (\Cardinity\Exception\Declined $e) { + $result = $e->getResult(); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('declined', $result->getStatus()); + $this->assertSame(true, $result->isDeclined()); + $this->assertStringContainsString('status: 33333: 3D Secure Authorization Failed.;', $e->getErrorsAsString()); + + return; + } + + $this->fail('An expected exception has not been raised.'); + } + + /** + * @return ResultObject + */ + public function testCreate3dPass() + { + $params = $this->getPaymentParams(); + $params['description'] = '3d-pass'; + + $method = new Payment\Create($params); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('pending', $result->getStatus()); + $this->assertSame(true, $result->isPending()); + $this->assertSame('3d-pass', $result->getAuthorizationInformation()->getData()); + + return $result; + } + + /** + * @depends testCreate3dPass + * @param Payment\Payment + * @return void + */ + public function testFinalizePaymentPass(Payment\Payment $payment) + { + $paymentId = $payment->getId(); + $authorizationInformation = $payment->getAuthorizationInformation()->getData(); + + $method = new Payment\Finalize($paymentId, $authorizationInformation); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php new file mode 100644 index 00000000000..411c7cba8d8 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php @@ -0,0 +1,130 @@ +setId('foo'); + $refund->setType('bar'); + $refund->setCurrency(null); + $refund->setAmount('55.00'); + + $this->assertSame( + '{"id":"foo","amount":"55.00","type":"bar"}', + $refund->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","amount":"55.00","type":"bar"}'; + + $payment = new Refund\Refund(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getCurrency()); + $this->assertSame(55.00, $payment->getAmount()); + } + + /** + * @return Cardinity\Method\ResultObject $result + */ + public function testCreatePayment() + { + $params = $this->getPaymentParams(); + $params['settle'] = true; + + $method = new Payment\Create($params); + $payment = $this->client->call($method); + + return $payment; + } + + /** + * @depends testCreatePayment + * @param Payment\Payment + * @return void + */ + public function testCreateFail(Payment\Payment $payment) + { + $method = new Refund\Create( + $payment->getId(), + 10.00, + 'fail' + ); + $this->expectException(\Cardinity\Exception\Declined::class); + $this->client->call($method); + } + + /** + * @depends testCreatePayment + * @param Payment\Payment + * @return Cardinity\Method\ResultObject $result + */ + public function testCreate(Payment\Payment $payment) + { + $method = new Refund\Create( + $payment->getId(), + 10.00, + 'my description' + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Refund\Refund + * @return void + */ + public function testGet(Refund\Refund $refund) + { + $method = new Refund\Get( + $refund->getParentId(), + $refund->getId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result); + $this->assertSame($refund->getParentId(), $result->getParentId()); + $this->assertSame('refund', $result->getType()); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame('my description', $result->getDescription()); + } + + /** + * @depends testCreate + * @param Refund\Refund + * @return void + */ + public function testGetAll(Refund\Refund $refund) + { + $method = new Refund\GetAll( + $refund->getParentId() + ); + $result = $this->client->call($method); + + $this->assertIsArray($result); + $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result[0]); + $this->assertSame($refund->getParentId(), $result[0]->getParentId()); + $this->assertSame($refund->getId(), $result[0]->getId()); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php new file mode 100644 index 00000000000..3151248c965 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php @@ -0,0 +1,127 @@ +setId('foo'); + $refund->setType('bar'); + $refund->setCurrency(null); + $refund->setAmount('55.00'); + + $this->assertSame( + '{"id":"foo","amount":"55.00","type":"bar"}', + $refund->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","amount":"55.00","type":"bar"}'; + + $payment = new Settlement\Settlement(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getCurrency()); + $this->assertSame(55.00, $payment->getAmount()); + } + + /** + * @return Cardinity\Method\ResultObject $payment + */ + public function testCreatePayment() + { + $method = new Payment\Create($this->getPaymentParams()); + $payment = $this->client->call($method); + + return $payment; + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return void + */ + public function testCreateFail(Payment\Payment $payment) + { + $method = new Settlement\Create( + $payment->getId(), + 10.00, + 'fail' + ); + $this->expectException(\Cardinity\Exception\Declined::class); + $this->client->call($method); + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return Cardinity\Method\ResultObject $result + */ + public function testCreate(Payment\Payment $payment) + { + $method = new Settlement\Create( + $payment->getId(), + 10.00, + 'my description' + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Settlement\Settlement $settlement + * @return void + */ + public function testGet(Settlement\Settlement $settlement) + { + $method = new Settlement\Get( + $settlement->getParentId(), + $settlement->getId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); + $this->assertSame($settlement->getParentId(), $result->getParentId()); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame('settlement', $result->getType()); + $this->assertSame('my description', $result->getDescription()); + } + + /** + * @depends testCreate + * @param Settlement\Settlement $settlement + * @return void + */ + public function testGetAll(Settlement\Settlement $settlement) + { + $method = new Settlement\GetAll( + $settlement->getParentId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result[0]); + $this->assertSame($settlement->getId(), $result[0]->getId()); + $this->assertSame($settlement->getParentId(), $result[0]->getParentId()); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php new file mode 100644 index 00000000000..48503a6ef01 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php @@ -0,0 +1,55 @@ +getThreeDS2Data(); + + $method = new Payment\Create([ + 'amount' => 59.01, + 'currency' => 'EUR', + 'settle' => true, + 'description' => '3ds2-Testing-for-pass', + 'order_id' => 'orderid123', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '5454545454545454', + 'exp_year' => date('Y') + 4, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Shb Mike Dough' + ], + 'threeds2_data' => $threeDS2Data + ]); + + try { + $payment = $this->client->call($method); + $this->assertEquals('pending', $payment->getStatus()); + } catch (Exception\Declined $exception) { + $payment = $exception->getResult(); + $status = $payment->getStatus(); + $errors = $exception->getErrors(); + } catch (Exception\ValidationFailed $exception) { + $payment = $exception->getResult(); + $status = $payment->getStatus(); + $errors = $exception->getErrors(); + } catch (Cardinity\Exception\InvalidAttributeValue $exception) { + $errors = $exception->getErrors(); + } + if (isset($errors)) { + $this->assertContains('[threeds2_data][notification_url]',$errors); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php new file mode 100644 index 00000000000..0fc72ad56c3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php @@ -0,0 +1,121 @@ +setId('foo'); + $refund->setType('bar'); + $refund->setCreated(null); + + $this->assertSame( + '{"id":"foo","type":"bar"}', + $refund->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","type":"bar"}'; + + $payment = new VoidPayment\VoidPayment(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getDescription()); + } + + /** + * @return Cardinity\Method\ResultObject $payment + */ + public function testCreatePayment() + { + $method = new Payment\Create($this->getPaymentParams()); + $payment = $this->client->call($method); + + return $payment; + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return void + */ + public function testCreateFail(Payment\Payment $payment) + { + $method = new VoidPayment\Create( + $payment->getId(), + 'fail' + ); + $this->expectException(\Cardinity\Exception\Declined::class); + $this->client->call($method); + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return Cardinity\Method\ResultObject $result + */ + public function testCreate(Payment\Payment $payment) + { + $method = new VoidPayment\Create( + $payment->getId(), + 'my description' + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param VoidPayment\VoidPayment $void + * @return void + */ + public function testGet(VoidPayment\VoidPayment $void) + { + $method = new VoidPayment\Get( + $void->getParentId(), + $void->getId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); + $this->assertSame($void->getParentId(), $result->getParentId()); + $this->assertSame('void', $result->getType()); + $this->assertSame('my description', $result->getDescription()); + } + + /** + * @depends testCreate + * @param VoidPayment\VoidPayment $void + * @return void + */ + public function testGetAll(VoidPayment\VoidPayment $void) + { + $method = new VoidPayment\GetAll( + $void->getParentId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result[0]); + $this->assertSame($void->getParentId(), $result[0]->getParentId()); + $this->assertSame($void->getId(), $result[0]->getId()); + } +} From b5de90599bab25e9f235344c1b76c7650068f352 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:05:20 +0000 Subject: [PATCH 10/39] Support for PHP 8.0 and 8.1 --- composer.json | 4 +- composer.lock | 333 ++++++++++++++--- .../vendor/composer/autoload_classmap.php | 2 + .../vendor/composer/autoload_files.php | 13 +- .../storage/vendor/composer/autoload_psr4.php | 2 + .../vendor/composer/autoload_static.php | 25 +- .../storage/vendor/composer/installed.json | 346 +++++++++++++++--- .../storage/vendor/composer/installed.php | 49 ++- .../vendor/composer/platform_check.php | 4 +- .../symfony/deprecation-contracts/.gitignore | 3 + .../deprecation-contracts/CHANGELOG.md | 5 + .../symfony/deprecation-contracts/LICENSE | 19 + .../symfony/deprecation-contracts/README.md | 26 ++ .../deprecation-contracts/composer.json | 35 ++ .../deprecation-contracts/function.php | 27 ++ .../vendor/symfony/polyfill-php73/LICENSE | 19 + .../vendor/symfony/polyfill-php73/Php73.php | 43 +++ .../vendor/symfony/polyfill-php73/README.md | 18 + .../Resources/stubs/JsonException.php | 16 + .../symfony/polyfill-php73/bootstrap.php | 31 ++ .../symfony/polyfill-php73/composer.json | 36 ++ .../vendor/symfony/polyfill-php81/LICENSE | 19 + .../vendor/symfony/polyfill-php81/Php81.php | 37 ++ .../vendor/symfony/polyfill-php81/README.md | 16 + .../Resources/stubs/ReturnTypeWillChange.php | 11 + .../symfony/polyfill-php81/bootstrap.php | 28 ++ .../symfony/polyfill-php81/composer.json | 36 ++ .../LocaleAwareInterface.php | 6 +- .../Test/TranslatorTest.php | 18 +- .../TranslatorInterface.php | 11 +- .../translation-contracts/TranslatorTrait.php | 6 +- .../translation-contracts/composer.json | 4 +- 32 files changed, 1093 insertions(+), 155 deletions(-) create mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore create mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md create mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE create mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/README.md create mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/composer.json create mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/function.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/LICENSE create mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/Php73.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/README.md create mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/composer.json create mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/LICENSE create mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/Php81.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/README.md create mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/composer.json diff --git a/composer.json b/composer.json index 9800bc909c3..e449dc85694 100644 --- a/composer.json +++ b/composer.json @@ -9,13 +9,13 @@ "vendor-dir": "./upload/system/storage/vendor/" }, "require": { - "cardinity/cardinity-sdk-php": "^1.0", "divido/divido-php": ">=1.1.1", "php": ">=5.4.0", "scssphp/scssphp": "1.1.1", "zoujingli/wechat-php-sdk": ">=1.3.10", "react/promise": "^2.9", "twig/twig": "^3.3", - "braintree/braintree_php": "^6.7" + "braintree/braintree_php": "^6.7", + "cardinity/cardinity-sdk-php": "^3.0" } } diff --git a/composer.lock b/composer.lock index a0d41005b4a..5682a2a4828 100644 --- a/composer.lock +++ b/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": "27a4e0507df2c53ca49096ffec9475f8", + "content-hash": "3dec0dabb8be44fbf7b638e30ce0d0d7", "packages": [ { "name": "braintree/braintree_php", @@ -57,28 +57,29 @@ }, { "name": "cardinity/cardinity-sdk-php", - "version": "v1.1.1", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/cardinity/cardinity-sdk-php.git", - "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3" + "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/b790656ee918b4686a6ee82b919ee74d2998c1c3", - "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3", + "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", + "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^6.2.1", "guzzlehttp/oauth-subscriber": "0.3.*", - "php": ">=5.5.9", - "symfony/validator": "~3.0 || ~4.0" + "php": ">=7.2.5", + "symfony/validator": "^5.0.0" }, "require-dev": { "monolog/monolog": "~1.0", - "phpspec/phpspec": "~2.1", - "phpunit/phpunit": "~4.3" + "phpspec/phpspec": "~6.2", + "phpunit/phpunit": "^8.5", + "symfony/yaml": "^4.4" }, "type": "library", "autoload": { @@ -94,9 +95,9 @@ "homepage": "https://cardinity.com", "support": { "issues": "https://github.com/cardinity/cardinity-sdk-php/issues", - "source": "https://github.com/cardinity/cardinity-sdk-php/tree/master" + "source": "https://github.com/cardinity/cardinity-sdk-php/tree/v3.0.4" }, - "time": "2018-04-16T08:35:53+00:00" + "time": "2022-02-02T11:25:15+00:00" }, { "name": "divido/divido-php", @@ -701,6 +702,73 @@ }, "time": "2020-06-04T17:30:40+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-01T23:48:49+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.25.0", @@ -1113,6 +1181,85 @@ ], "time": "2021-05-27T09:17:38+00:00" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, { "name": "symfony/polyfill-php80", "version": "v1.25.0", @@ -1196,22 +1343,101 @@ ], "time": "2022-03-04T08:16:47+00:00" }, + { + "name": "symfony/polyfill-php81", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:11+00:00" + }, { "name": "symfony/translation-contracts", - "version": "v2.5.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" }, "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/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -1219,7 +1445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1256,7 +1482,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" }, "funding": [ { @@ -1272,63 +1498,70 @@ "type": "tidelift" } ], - "time": "2021-08-17T14:20:01+00:00" + "time": "2021-09-07T12:43:40+00:00" }, { "name": "symfony/validator", - "version": "v4.4.38", + "version": "v5.4.5", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca" + "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/71f994225b20f6fdc594d494df762f0ad8c34aca", - "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca", + "url": "https://api.github.com/repos/symfony/validator/zipball/06c3d849fa19a0ece7b6eed240036772c4b5faaf", + "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^1.1|^2" + "symfony/polyfill-php81": "^1.22", + "symfony/translation-contracts": "^1.1|^2|^3" }, "conflict": { + "doctrine/annotations": "<1.13", + "doctrine/cache": "<1.11", "doctrine/lexer": "<1.1", - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", - "symfony/dependency-injection": "<3.4", + "phpunit/phpunit": "<5.4.3", + "symfony/dependency-injection": "<4.4", + "symfony/expression-language": "<5.1", "symfony/http-kernel": "<4.4", - "symfony/intl": "<4.3", - "symfony/translation": ">=5.0", - "symfony/yaml": "<3.4" + "symfony/intl": "<4.4", + "symfony/property-info": "<5.3", + "symfony/translation": "<4.4", + "symfony/yaml": "<4.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4", - "doctrine/cache": "^1.0|^2.0", + "doctrine/annotations": "^1.13", + "doctrine/cache": "^1.11|^2.0", "egulias/email-validator": "^2.1.10|^3", - "symfony/cache": "^3.4|^4.0|^5.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-client": "^4.3|^5.0", - "symfony/http-foundation": "^4.1|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/intl": "^4.3|^5.0", - "symfony/mime": "^4.4|^5.0", - "symfony/property-access": "^3.4|^4.0|^5.0", - "symfony/property-info": "^3.4|^4.0|^5.0", - "symfony/translation": "^4.2", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/cache": "^4.4|^5.0|^6.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", + "symfony/expression-language": "^5.1|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.0|^6.0", + "symfony/property-info": "^5.3|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader.", "egulias/email-validator": "Strict (RFC compliant) email validation", "psr/cache-implementation": "For using the mapping cache.", "symfony/config": "", - "symfony/expression-language": "For using the Expression validator", + "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints", "symfony/http-foundation": "", "symfony/intl": "", "symfony/property-access": "For accessing properties within comparison constraints", @@ -1362,7 +1595,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v4.4.38" + "source": "https://github.com/symfony/validator/tree/v5.4.5" }, "funding": [ { @@ -1378,7 +1611,7 @@ "type": "tidelift" } ], - "time": "2022-02-24T08:44:54+00:00" + "time": "2022-02-25T08:05:40+00:00" }, { "name": "twig/twig", diff --git a/upload/system/storage/vendor/composer/autoload_classmap.php b/upload/system/storage/vendor/composer/autoload_classmap.php index ea10880dd2f..75cf84ebf1c 100644 --- a/upload/system/storage/vendor/composer/autoload_classmap.php +++ b/upload/system/storage/vendor/composer/autoload_classmap.php @@ -8,8 +8,10 @@ return array( 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.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', 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/upload/system/storage/vendor/composer/autoload_files.php b/upload/system/storage/vendor/composer/autoload_files.php index 42105d2beac..8573fced910 100644 --- a/upload/system/storage/vendor/composer/autoload_files.php +++ b/upload/system/storage/vendor/composer/autoload_files.php @@ -6,15 +6,18 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index 84f3d59965c..e8e15603fe5 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -8,7 +8,9 @@ return array( 'Wechat\\' => array($vendorDir . '/zoujingli/wechat-php-sdk/Wechat'), 'Twig\\' => array($vendorDir . '/twig/twig/src'), + 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index a6bf30b0f4d..5ab01e592c1 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -7,16 +7,19 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 { public static $files = array ( - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', ); @@ -31,7 +34,9 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ), 'S' => array ( + 'Symfony\\Polyfill\\Php81\\' => 23, 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Polyfill\\Php73\\' => 23, 'Symfony\\Polyfill\\Php72\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, @@ -75,10 +80,18 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/twig/twig/src', ), + 'Symfony\\Polyfill\\Php81\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', + ), 'Symfony\\Polyfill\\Php80\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', ), + 'Symfony\\Polyfill\\Php73\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', + ), 'Symfony\\Polyfill\\Php72\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', @@ -158,8 +171,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 public static $classMap = array ( 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.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', 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index ee002d296a9..2bff6627e67 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -54,31 +54,32 @@ }, { "name": "cardinity/cardinity-sdk-php", - "version": "v1.1.1", - "version_normalized": "1.1.1.0", + "version": "v3.0.4", + "version_normalized": "3.0.4.0", "source": { "type": "git", "url": "https://github.com/cardinity/cardinity-sdk-php.git", - "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3" + "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/b790656ee918b4686a6ee82b919ee74d2998c1c3", - "reference": "b790656ee918b4686a6ee82b919ee74d2998c1c3", + "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", + "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^6.2.1", "guzzlehttp/oauth-subscriber": "0.3.*", - "php": ">=5.5.9", - "symfony/validator": "~3.0 || ~4.0" + "php": ">=7.2.5", + "symfony/validator": "^5.0.0" }, "require-dev": { "monolog/monolog": "~1.0", - "phpspec/phpspec": "~2.1", - "phpunit/phpunit": "~4.3" + "phpspec/phpspec": "~6.2", + "phpunit/phpunit": "^8.5", + "symfony/yaml": "^4.4" }, - "time": "2018-04-16T08:35:53+00:00", + "time": "2022-02-02T11:25:15+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -94,7 +95,7 @@ "homepage": "https://cardinity.com", "support": { "issues": "https://github.com/cardinity/cardinity-sdk-php/issues", - "source": "https://github.com/cardinity/cardinity-sdk-php/tree/master" + "source": "https://github.com/cardinity/cardinity-sdk-php/tree/v3.0.4" }, "install-path": "../cardinity/cardinity-sdk-php" }, @@ -724,6 +725,76 @@ ], "install-path": "../scssphp/scssphp" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "time": "2021-11-01T23:48:49+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, { "name": "symfony/polyfill-ctype", "version": "v1.25.0", @@ -1151,6 +1222,88 @@ ], "install-path": "../symfony/polyfill-php72" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-06-05T21:20:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php73" + }, { "name": "symfony/polyfill-php80", "version": "v1.25.0", @@ -1237,32 +1390,114 @@ ], "install-path": "../symfony/polyfill-php80" }, + { + "name": "symfony/polyfill-php81", + "version": "v1.25.0", + "version_normalized": "1.25.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2021-09-13T13:58:11+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php81" + }, { "name": "symfony/translation-contracts", - "version": "v2.5.0", - "version_normalized": "2.5.0.0", + "version": "v3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" }, "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/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" }, - "time": "2021-08-17T14:20:01+00:00", + "time": "2021-09-07T12:43:40+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1300,7 +1535,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" }, "funding": [ { @@ -1320,60 +1555,67 @@ }, { "name": "symfony/validator", - "version": "v4.4.38", - "version_normalized": "4.4.38.0", + "version": "v5.4.5", + "version_normalized": "5.4.5.0", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca" + "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/71f994225b20f6fdc594d494df762f0ad8c34aca", - "reference": "71f994225b20f6fdc594d494df762f0ad8c34aca", + "url": "https://api.github.com/repos/symfony/validator/zipball/06c3d849fa19a0ece7b6eed240036772c4b5faaf", + "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^1.1|^2" + "symfony/polyfill-php81": "^1.22", + "symfony/translation-contracts": "^1.1|^2|^3" }, "conflict": { + "doctrine/annotations": "<1.13", + "doctrine/cache": "<1.11", "doctrine/lexer": "<1.1", - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", - "symfony/dependency-injection": "<3.4", + "phpunit/phpunit": "<5.4.3", + "symfony/dependency-injection": "<4.4", + "symfony/expression-language": "<5.1", "symfony/http-kernel": "<4.4", - "symfony/intl": "<4.3", - "symfony/translation": ">=5.0", - "symfony/yaml": "<3.4" + "symfony/intl": "<4.4", + "symfony/property-info": "<5.3", + "symfony/translation": "<4.4", + "symfony/yaml": "<4.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4", - "doctrine/cache": "^1.0|^2.0", + "doctrine/annotations": "^1.13", + "doctrine/cache": "^1.11|^2.0", "egulias/email-validator": "^2.1.10|^3", - "symfony/cache": "^3.4|^4.0|^5.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-client": "^4.3|^5.0", - "symfony/http-foundation": "^4.1|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/intl": "^4.3|^5.0", - "symfony/mime": "^4.4|^5.0", - "symfony/property-access": "^3.4|^4.0|^5.0", - "symfony/property-info": "^3.4|^4.0|^5.0", - "symfony/translation": "^4.2", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/cache": "^4.4|^5.0|^6.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", + "symfony/expression-language": "^5.1|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.0|^6.0", + "symfony/property-info": "^5.3|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader.", "egulias/email-validator": "Strict (RFC compliant) email validation", "psr/cache-implementation": "For using the mapping cache.", "symfony/config": "", - "symfony/expression-language": "For using the Expression validator", + "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints", "symfony/http-foundation": "", "symfony/intl": "", "symfony/property-access": "For accessing properties within comparison constraints", @@ -1381,7 +1623,7 @@ "symfony/translation": "For translating validation errors.", "symfony/yaml": "" }, - "time": "2022-02-24T08:44:54+00:00", + "time": "2022-02-25T08:05:40+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1409,7 +1651,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v4.4.38" + "source": "https://github.com/symfony/validator/tree/v5.4.5" }, "funding": [ { diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 30a81e799c2..13e9abac64e 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '4053809bc83cf5a1fe507c10ecc741724c4a4362', + 'reference' => '0f1ae34401cd056b86b2df949e1abcad66bc2a4a', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -20,12 +20,12 @@ 'dev_requirement' => false, ), 'cardinity/cardinity-sdk-php' => array( - 'pretty_version' => 'v1.1.1', - 'version' => '1.1.1.0', + 'pretty_version' => 'v3.0.4', + 'version' => '3.0.4.0', 'type' => 'library', 'install_path' => __DIR__ . '/../cardinity/cardinity-sdk-php', 'aliases' => array(), - 'reference' => 'b790656ee918b4686a6ee82b919ee74d2998c1c3', + 'reference' => '8a3e79ebc89cf26777f27a061ff356e8eeb1c47f', 'dev_requirement' => false, ), 'divido/divido-php' => array( @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '4053809bc83cf5a1fe507c10ecc741724c4a4362', + 'reference' => '0f1ae34401cd056b86b2df949e1abcad66bc2a4a', 'dev_requirement' => false, ), 'psr/http-message' => array( @@ -124,6 +124,15 @@ 'reference' => '824e4cec10b2bfa88eec5dac23991cb9106622c1', 'dev_requirement' => false, ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.0.0', + 'version' => '3.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'reference' => 'c726b64c1ccfe2896cb7df2e1331c357ad1c8ced', + 'dev_requirement' => false, + ), 'symfony/polyfill-ctype' => array( 'pretty_version' => 'v1.25.0', 'version' => '1.25.0.0', @@ -169,6 +178,15 @@ 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', 'dev_requirement' => false, ), + 'symfony/polyfill-php73' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php73', + 'aliases' => array(), + 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5', + 'dev_requirement' => false, + ), 'symfony/polyfill-php80' => array( 'pretty_version' => 'v1.25.0', 'version' => '1.25.0.0', @@ -178,22 +196,31 @@ 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', 'dev_requirement' => false, ), + 'symfony/polyfill-php81' => array( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php81', + 'aliases' => array(), + 'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f', + 'dev_requirement' => false, + ), 'symfony/translation-contracts' => array( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', + 'pretty_version' => 'v3.0.0', + 'version' => '3.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation-contracts', 'aliases' => array(), - 'reference' => 'd28150f0f44ce854e942b671fc2620a98aae1b1e', + 'reference' => '1b6ea5a7442af5a12dba3dbd6d71034b5b234e77', 'dev_requirement' => false, ), 'symfony/validator' => array( - 'pretty_version' => 'v4.4.38', - 'version' => '4.4.38.0', + 'pretty_version' => 'v5.4.5', + 'version' => '5.4.5.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/validator', 'aliases' => array(), - 'reference' => '71f994225b20f6fdc594d494df762f0ad8c34aca', + 'reference' => '06c3d849fa19a0ece7b6eed240036772c4b5faaf', 'dev_requirement' => false, ), 'twig/twig' => array( diff --git a/upload/system/storage/vendor/composer/platform_check.php b/upload/system/storage/vendor/composer/platform_check.php index 92370c5a0c9..b168ddd5d91 100644 --- a/upload/system/storage/vendor/composer/platform_check.php +++ b/upload/system/storage/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 >= 80002)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore b/upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore new file mode 100644 index 00000000000..c49a5d8df5c --- /dev/null +++ b/upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md b/upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md new file mode 100644 index 00000000000..7932e26132d --- /dev/null +++ b/upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE b/upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE new file mode 100644 index 00000000000..ad85e173748 --- /dev/null +++ b/upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-2021 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/README.md b/upload/system/storage/vendor/symfony/deprecation-contracts/README.md new file mode 100644 index 00000000000..4957933a6cc --- /dev/null +++ b/upload/system/storage/vendor/symfony/deprecation-contracts/README.md @@ -0,0 +1,26 @@ +Symfony Deprecation Contracts +============================= + +A generic function and convention to trigger deprecation notices. + +This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. + +By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, +the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. + +The function requires at least 3 arguments: + - the name of the Composer package that is triggering the deprecation + - the version of the package that introduced the deprecation + - the message of the deprecation + - more arguments can be provided: they will be inserted in the message using `printf()` formatting + +Example: +```php +trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); +``` + +This will generate the following message: +`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` + +While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty +`function trigger_deprecation() {}` in your application. diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/composer.json b/upload/system/storage/vendor/symfony/deprecation-contracts/composer.json new file mode 100644 index 00000000000..1c1b4ba0e94 --- /dev/null +++ b/upload/system/storage/vendor/symfony/deprecation-contracts/composer.json @@ -0,0 +1,35 @@ +{ + "name": "symfony/deprecation-contracts", + "type": "library", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.0.2" + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/function.php b/upload/system/storage/vendor/symfony/deprecation-contracts/function.php new file mode 100644 index 00000000000..2d56512ba33 --- /dev/null +++ b/upload/system/storage/vendor/symfony/deprecation-contracts/function.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!function_exists('trigger_deprecation')) { + /** + * Triggers a silenced deprecation notice. + * + * @param string $package The name of the Composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string $message The message of the deprecation + * @param mixed ...$args Values to insert in the message using printf() formatting + * + * @author Nicolas Grekas + */ + function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void + { + @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php73/LICENSE new file mode 100644 index 00000000000..3f853aaf35f --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php73/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/Php73.php b/upload/system/storage/vendor/symfony/polyfill-php73/Php73.php new file mode 100644 index 00000000000..65c35a6a115 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php73/Php73.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php73; + +/** + * @author Gabriel Caruso + * @author Ion Bazan + * + * @internal + */ +final class Php73 +{ + public static $startAt = 1533462603; + + /** + * @param bool $asNum + * + * @return array|float|int + */ + public static function hrtime($asNum = false) + { + $ns = microtime(false); + $s = substr($ns, 11) - self::$startAt; + $ns = 1E9 * (float) $ns; + + if ($asNum) { + $ns += $s * 1E9; + + return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; + } + + return [$s, (int) $ns]; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/README.md b/upload/system/storage/vendor/symfony/polyfill-php73/README.md new file mode 100644 index 00000000000..b3ebbce511b --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php73/README.md @@ -0,0 +1,18 @@ +Symfony Polyfill / Php73 +======================== + +This component provides functions added to PHP 7.3 core: + +- [`array_key_first`](https://php.net/array_key_first) +- [`array_key_last`](https://php.net/array_key_last) +- [`hrtime`](https://php.net/function.hrtime) +- [`is_countable`](https://php.net/is_countable) +- [`JsonException`](https://php.net/JsonException) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php new file mode 100644 index 00000000000..f06d6c2694c --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 70300) { + class JsonException extends Exception + { + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php new file mode 100644 index 00000000000..d6b21538235 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php73 as p; + +if (\PHP_VERSION_ID >= 70300) { + return; +} + +if (!function_exists('is_countable')) { + function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } +} +if (!function_exists('hrtime')) { + require_once __DIR__.'/Php73.php'; + p\Php73::$startAt = (int) microtime(true); + function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } +} +if (!function_exists('array_key_first')) { + function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } +} +if (!function_exists('array_key_last')) { + function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/composer.json b/upload/system/storage/vendor/symfony/polyfill-php73/composer.json new file mode 100644 index 00000000000..a7fe4787528 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php73/composer.json @@ -0,0 +1,36 @@ +{ + "name": "symfony/polyfill-php73", + "type": "library", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php81/LICENSE new file mode 100644 index 00000000000..efb17f98e7d --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php81/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2021 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/Php81.php b/upload/system/storage/vendor/symfony/polyfill-php81/Php81.php new file mode 100644 index 00000000000..f0507b765c2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php81/Php81.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php81; + +/** + * @author Nicolas Grekas + * + * @internal + */ +final class Php81 +{ + public static function array_is_list(array $array): bool + { + if ([] === $array || $array === array_values($array)) { + return true; + } + + $nextKey = -1; + + foreach ($array as $k => $v) { + if ($k !== ++$nextKey) { + return false; + } + } + + return true; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/README.md b/upload/system/storage/vendor/symfony/polyfill-php81/README.md new file mode 100644 index 00000000000..5ef61be6a86 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php81/README.md @@ -0,0 +1,16 @@ +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 +- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php new file mode 100644 index 00000000000..f4cad34f646 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php @@ -0,0 +1,11 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php81 as p; + +if (\PHP_VERSION_ID >= 80100) { + return; +} + +if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { + define('MYSQLI_REFRESH_REPLICA', 64); +} + +if (!function_exists('array_is_list')) { + function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } +} + +if (!function_exists('enum_exists')) { + function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/composer.json b/upload/system/storage/vendor/symfony/polyfill-php81/composer.json new file mode 100644 index 00000000000..c39ccf47785 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-php81/composer.json @@ -0,0 +1,36 @@ +{ + "name": "symfony/polyfill-php81", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php index 693f92ba9b7..6923b977e45 100644 --- a/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php +++ b/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php @@ -16,16 +16,12 @@ interface LocaleAwareInterface /** * Sets the current locale. * - * @param string $locale The locale - * * @throws \InvalidArgumentException If the locale contains invalid characters */ public function setLocale(string $locale); /** * Returns the current locale. - * - * @return string */ - public function getLocale(); + public function getLocale(): string; } diff --git a/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php index 89036765784..c2c30a91729 100644 --- a/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ b/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -43,10 +43,7 @@ protected function tearDown(): void \Locale::setDefault($this->defaultLocale); } - /** - * @return TranslatorInterface - */ - public function getTranslator() + public function getTranslator(): TranslatorInterface { return new class() implements TranslatorInterface { use TranslatorTrait; @@ -317,10 +314,8 @@ public function testLangcodes($nplural, $langCodes) * This array should contain all currently known langcodes. * * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. - * - * @return array */ - public function successLangcodes() + public function successLangcodes(): array { return [ ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], @@ -339,7 +334,7 @@ public function successLangcodes() * * @return array with nplural together with langcodes */ - public function failingLangcodes() + public function failingLangcodes(): array { return [ ['1', ['fa']], @@ -353,11 +348,10 @@ public function failingLangcodes() /** * We validate only on the plural coverage. Thus the real rules is not tested. * - * @param string $nplural Plural expected - * @param array $matrix Containing langcodes and their plural index values - * @param bool $expectSuccess + * @param string $nplural Plural expected + * @param array $matrix Containing langcodes and their plural index values */ - protected function validateMatrix($nplural, $matrix, $expectSuccess = true) + protected function validateMatrix(string $nplural, array $matrix, bool $expectSuccess = true) { foreach ($matrix as $langCode => $data) { $indexes = array_flip($data); diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php index 77b7a9c5860..018db07ebf4 100644 --- a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php +++ b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php @@ -13,8 +13,6 @@ /** * @author Fabien Potencier - * - * @method string getLocale() Returns the default locale */ interface TranslatorInterface { @@ -59,9 +57,12 @@ interface TranslatorInterface * @param string|null $domain The domain for the message or null to use the default * @param string|null $locale The locale or null to use the default * - * @return string - * * @throws \InvalidArgumentException If the locale contains invalid characters */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null); + public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string; + + /** + * Returns the default locale. + */ + public function getLocale(): string; } diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php index 405ce8d70d3..9c264bd293f 100644 --- a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php +++ b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php @@ -20,7 +20,7 @@ */ trait TranslatorTrait { - private $locale; + private ?string $locale = null; /** * {@inheritdoc} @@ -32,10 +32,8 @@ public function setLocale(string $locale) /** * {@inheritdoc} - * - * @return string */ - public function getLocale() + public function getLocale(): string { return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); } diff --git a/upload/system/storage/vendor/symfony/translation-contracts/composer.json b/upload/system/storage/vendor/symfony/translation-contracts/composer.json index 65fe243a4ff..875242f6d9a 100644 --- a/upload/system/storage/vendor/symfony/translation-contracts/composer.json +++ b/upload/system/storage/vendor/symfony/translation-contracts/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -27,7 +27,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", From 6e71e465ce947d5d6b5bede75f26a5ccf0c87a0f Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:08:16 +0000 Subject: [PATCH 11/39] Support for PHP 8.0 and 8.1 --- .../cardinity/cardinity-sdk-php/.editorconfig | 15 - .../.github/workflows/php.yml | 39 -- .../cardinity/cardinity-sdk-php/.gitignore | 12 - .../cardinity/cardinity-sdk-php/.travis.yml | 14 - .../cardinity/cardinity-sdk-php/CHANGELOG.md | 83 --- .../cardinity/cardinity-sdk-php/LICENSE | 21 - .../cardinity/cardinity-sdk-php/README.md | 176 ------- .../cardinity/cardinity-sdk-php/composer.json | 33 -- .../cardinity-sdk-php/docs/README.md | 394 --------------- .../cardinity-sdk-php/phpspec.yml.dist | 4 - .../cardinity-sdk-php/phpunit.xml.dist | 33 -- .../cardinity-sdk-php/spec/ClientSpec.php | 201 -------- .../spec/Exception/DeclinedSpec.php | 27 - .../spec/Exception/ForbiddenSpec.php | 18 - .../Exception/InternalServerErrorSpec.php | 27 - .../Exception/InvalidAttributeValueSpec.php | 42 -- .../spec/Exception/MethodNotAllowedSpec.php | 27 - .../spec/Exception/NotAcceptableSpec.php | 27 - .../spec/Exception/NotFoundSpec.php | 27 - .../spec/Exception/RequestSpec.php | 85 ---- .../spec/Exception/RequestTimeoutSpec.php | 27 - .../spec/Exception/ServiceUnavailableSpec.php | 27 - .../spec/Exception/UnauthorizedSpec.php | 27 - .../spec/Exception/UnexpectedErrorSpec.php | 13 - .../spec/Exception/UnexpectedResponseSpec.php | 27 - .../spec/Exception/ValidationFailedSpec.php | 27 - .../spec/Http/Guzzle/ClientAdapterSpec.php | 84 --- .../spec/Http/Guzzle/ExceptionMapperSpec.php | 100 ---- .../spec/Method/ErrorSpec.php | 18 - .../Payment/AuthorizationInformationSpec.php | 13 - .../spec/Method/Payment/CreateSpec.php | 87 ---- .../spec/Method/Payment/FinalizeSpec.php | 56 -- .../spec/Method/Payment/GetAllSpec.php | 50 -- .../spec/Method/Payment/GetSpec.php | 50 -- .../Payment/PaymentInstrumentCardSpec.php | 13 - .../PaymentInstrumentRecurringSpec.php | 13 - .../spec/Method/Payment/PaymentSpec.php | 100 ---- .../ThreeDS2AuthorizationInformationSpec.php | 41 -- .../spec/Method/Refund/CreateSpec.php | 66 --- .../spec/Method/Refund/GetAllSpec.php | 52 -- .../spec/Method/Refund/GetSpec.php | 58 --- .../spec/Method/Refund/RefundSpec.php | 18 - .../spec/Method/ResultObjectMapperSpec.php | 117 ----- .../spec/Method/Settlement/CreateSpec.php | 66 --- .../spec/Method/Settlement/GetAllSpec.php | 52 -- .../spec/Method/Settlement/GetSpec.php | 58 --- .../spec/Method/Settlement/SettlementSpec.php | 18 - .../spec/Method/ValidatorSpec.php | 64 --- .../spec/Method/VoidPayment/CreateSpec.php | 62 --- .../spec/Method/VoidPayment/GetAllSpec.php | 50 -- .../spec/Method/VoidPayment/GetSpec.php | 58 --- .../Method/VoidPayment/VoidPaymentSpec.php | 18 - .../cardinity-sdk-php/src/Client.php | 215 -------- .../src/Exception/Declined.php | 9 - .../src/Exception/Forbidden.php | 9 - .../src/Exception/InternalServerError.php | 9 - .../src/Exception/InvalidAttributeValue.php | 24 - .../src/Exception/MethodNotAllowed.php | 9 - .../src/Exception/NotAcceptable.php | 9 - .../src/Exception/NotFound.php | 9 - .../src/Exception/Request.php | 63 --- .../src/Exception/RequestTimeout.php | 9 - .../ResultObjectPropertyNotFound.php | 8 - .../src/Exception/Runtime.php | 8 - .../src/Exception/ServiceUnavailable.php | 10 - .../src/Exception/Unauthorized.php | 9 - .../src/Exception/UnexpectedError.php | 8 - .../src/Exception/UnexpectedResponse.php | 9 - .../src/Exception/ValidationFailed.php | 10 - .../src/Http/ClientInterface.php | 18 - .../src/Http/Guzzle/ClientAdapter.php | 58 --- .../src/Http/Guzzle/ExceptionMapper.php | 93 ---- .../cardinity-sdk-php/src/Method/Error.php | 116 ----- .../src/Method/MethodInterface.php | 54 -- .../MethodResultCollectionInterface.php | 11 - .../Payment/AuthorizationInformation.php | 56 -- .../src/Method/Payment/Create.php | 226 --------- .../src/Method/Payment/Finalize.php | 78 --- .../src/Method/Payment/Get.php | 46 -- .../src/Method/Payment/GetAll.php | 54 -- .../src/Method/Payment/Payment.php | 478 ------------------ .../Method/Payment/PaymentInstrumentCard.php | 121 ----- .../Payment/PaymentInstrumentInterface.php | 8 - .../Payment/PaymentInstrumentRecurring.php | 31 -- .../ThreeDS2AuthorizationInformation.php | 58 --- .../src/Method/Refund/Create.php | 64 --- .../src/Method/Refund/Get.php | 57 --- .../src/Method/Refund/GetAll.php | 50 -- .../src/Method/Refund/Refund.php | 286 ----------- .../src/Method/ResultObject.php | 160 ------ .../src/Method/ResultObjectInterface.php | 15 - .../src/Method/ResultObjectMapper.php | 121 ----- .../Method/ResultObjectMapperInterface.php | 10 - .../src/Method/Settlement/Create.php | 64 --- .../src/Method/Settlement/Get.php | 57 --- .../src/Method/Settlement/GetAll.php | 50 -- .../src/Method/Settlement/Settlement.php | 286 ----------- .../src/Method/Validator.php | 48 -- .../src/Method/ValidatorInterface.php | 19 - .../Validators/CallbackUrlConstraint.php | 17 - .../CallbackUrlConstraintValidator.php | 32 -- .../src/Method/VoidPayment/Create.php | 56 -- .../src/Method/VoidPayment/Get.php | 57 --- .../src/Method/VoidPayment/GetAll.php | 50 -- .../src/Method/VoidPayment/VoidPayment.php | 239 --------- .../tests/ClientEndpointTest.php | 85 ---- .../cardinity-sdk-php/tests/ClientTest.php | 183 ------- .../tests/ClientTestCase.php | 160 ------ .../cardinity-sdk-php/tests/ErrorTest.php | 102 ---- .../cardinity-sdk-php/tests/PaymentTest.php | 267 ---------- .../cardinity-sdk-php/tests/RefundTest.php | 130 ----- .../tests/SettlementTest.php | 127 ----- .../cardinity-sdk-php/tests/ThreeDS2Test.php | 55 -- .../tests/VoidPaymentTest.php | 121 ----- 114 files changed, 7736 deletions(-) delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Forbidden.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/InternalServerError.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/InvalidAttributeValue.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/NotAcceptable.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/NotFound.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Request.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ResultObjectPropertyNotFound.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Runtime.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ServiceUnavailable.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Unauthorized.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedError.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedResponse.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ValidationFailed.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/ClientInterface.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ClientAdapter.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodResultCollectionInterface.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/AuthorizationInformation.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentRecurring.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapper.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Create.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraint.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraintValidator.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig deleted file mode 100644 index 9a9710a901b..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false - -[*.yml] -indent_size = 2 \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml deleted file mode 100644 index 5e131c47002..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: PHP Composer - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - phpunit-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: Run test suite - env: - CONSUMER_KEY: ${{secrets.CRD_KEY}} - CONSUMER_SECRET: ${{secrets.CRD_SECRET}} - run: composer run-script test diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore deleted file mode 100644 index ad78b24b878..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -vendor/ -bin/ -build/ -specs/ -phpunit.xml -.phpunit.result.cache -phpspec.yml -tests/info.log -composer.lock -.idea/ -phpstan.neon -.phpunit.result.cache diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml deleted file mode 100644 index 7751733d42d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: php -dist: trusty - -php: - - 7.2 - - 7.3 - - 7.4 - -before_script: - - composer self-update - - composer update - -script: - - bin/phpspec run --format=pretty diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md deleted file mode 100644 index 6e36d1fa831..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md +++ /dev/null @@ -1,83 +0,0 @@ -# Cardinity Client PHP Library - -## v3.0.3 - -### Added -- Added `Method\Validators\CallbackUrlConstraint` custom validation constraint class -- Added `Method\Validators\CallbackUrlConstraintValidator` custom constraint validation class -- Added `getInsideArray` method to `Method\Payment\Create` class -- Added `getNotificationUrlConstraints` method to `Method\Payment\Create` for `notification_url` parameter -- Added `getIpAddressConstraints` method to `Method\Payment\Create` for `ip_address` parameter. -- Added unit tests for new methods. -- Added `getStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. -- Added `setStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. - - -### Updated -- Updated `getThreeDS2DataConstraints` method of `Method\Payment\Create` class -- Updated `getBrowserInfoConstraints` method of `Method\Payment\Create` class. -- Updated `getValidationConstraints` method of `Method\Payment\Create` class - -## v3.0.2 - -### Changed - -- Changed `getThreeds2data` method to `getThreeds2Data` of class `Method\Payment\Payment` -- Changed `setThreeds2data` method to `setThreeds2Data` of class `Method\Payment\Payment` -- Changed `unserialize` method of `Method\ResultObject` class -- Changed `propertyName` method of `Method\ResultObject` class - - -## v3.0.1 - -### Fixed - -- Removed redundant comma in `Method\Payment\Create.php` line 84. - -## v3.0.0 - -### Added -- Added `threeDS2AuthorizationInformation` property to `Payment` class -- Added `getThreeds2data` method to `Payment` class -- Added `setThreeds2data` method to `Payment` class -- Added `isThreedsV1` method to `Payment` class -- Added `isThreedsV2` method to `Payment` class -- Added `getThreeDS2DataConstraints` method to `Create` class -- Added `getBrowserInfoConstraints` method to `Create` class -- Added `getAdressConstraints` method to `Create` class -- Added `getCardHolderInfoConstraints` method to `Create` class -- Added `buildElement` method to `Create` class -- Added `paymentId` property to `Finalize` class -- Added `finalizeKey` property to `Finalize` class -- Added `Method\Payment\ThreeDS2Data` parameters -- Added `Method\Payment\TreeDS2AthorizationInformation` class - -### Changed -- Updated `php` to version 7.2.x -- Updated `symfony/validator` to versin 5.x -- Updated `phpspec/phpspec` to version 6.2 -- Updated `phpunit/phpunit` to version 8.5 -- Updated `symfony/yaml` to version 4.4 -- Refactored `Create` class to build validation parameters using `buildElement` method -- Updated `getValidationConstraints` method of `Create` class -- Updated `getPaymentInstrumentConstraints` method of `Create` class -- Updated `__construct` method of `Finalize` class -- Updated `getAttributes` method of `Finalize` class -- Updated `getValidationConstraints` method of `Finalize` class - -## v2.1.0 - -### Added -- Added `isDeclined` method to `Payment` class -- Added `isApproved` and `isDeclined` methods to `Refund` class -- Added `isApproved` and `isDeclined` methods to `Settlement` class -- Added `isApproved` and `isDeclined` methods to `VoidPayment` class - -## v2.0.0 - -### Changed -- Renamed `Cardinity\Method\Void` to `Cardinity\Method\VoidPayment` -- Renamed `Void.php` to `VoidPayment.php` - -### Removed -- Removed `ResultObjectPropertyNotFound.php` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE deleted file mode 100644 index 97bfca21cb6..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Cardinity - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md deleted file mode 100644 index 692fb347da4..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md +++ /dev/null @@ -1,176 +0,0 @@ - -Cardinity Client PHP Library -================================================ -[![Build Status](https://app.travis-ci.com/cardinity/cardinity-sdk-php.svg?branch=master)](https://app.travis-ci.com/cardinity/cardinity-sdk-php) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/?branch=master) - -This is official PHP client library for [Cardinity's](https://developers.cardinity.com/api/v1/) API. -Library includes all the functionality provided by API. Library was designed to be flexible and self-explanatory for developers to implement. - -## Documentation -More detailed documentation with usage examples can be found [here](https://github.com/cardinity/cardinity-sdk-php/tree/master/docs). - -## Usage -### Installing via [Composer](https://getcomposer.org) -```bash -$ php composer.phar require cardinity/cardinity-sdk-php -``` -### Direct Download -You can download the [latest release](https://github.com/cardinity/cardinity-sdk-php/releases/latest) file starting with ```cardinity-sdk-php-*.zip```. - -### Making API Calls -#### Initialize the client object -```php -use Cardinity\Client; -$client = Client::create([ - 'consumerKey' => 'YOUR_CONSUMER_KEY', - 'consumerSecret' => 'YOUR_CONSUMER_SECRET', -]); -``` - -#### Create new payment -```php -use Cardinity\Method\Payment; - -$method = new Payment\Create([ - 'amount' => 50.00, - 'currency' => 'EUR', - 'settle' => false, - 'description' => 'some description', - 'order_id' => '12345678', - 'country' => 'LT', - 'payment_method' => Payment\Create::CARD, - 'payment_instrument' => [ - 'pan' => '4111111111111111', - 'exp_year' => 2021, - 'exp_month' => 12, - 'cvc' => '456', - 'holder' => 'Mike Dough' - ], - 'threeds2_data' => [ - "notification_url" => "your_shop_url_for_handling_callback", - "browser_info" => [ - "accept_header" => "text/html", - "browser_language" => "en-US", - "screen_width" => 600, - "screen_height" => 400, - 'challenge_window_size' => "600x400", - "user_agent" => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0", - "color_depth" => 24, - "time_zone" => -60 - ], - ], -]); -``` -#### All the `threeds2_data` parameters should be set dynamically. -Parameters `screen_width`, `screen_height`, `browser_language`, `color_depth`, `time_zone` of `browser_info` could be collected dynamically using `javascript`: -```javascript -document.addEventListener("DOMContentLoaded", function() { - document.getElementById("screen_width").value = screen.availWidth; - document.getElementById("screen_height").value = screen.availHeight; - document.getElementById("browser_language").value = navigator.language; - document.getElementById("color_depth").value = screen.colorDepth; - document.getElementById("time_zone").value = new Date().getTimezoneOffset(); -}); -``` -and placed into a `html` form -```html - - - - - - - -``` -Then call to Cardinity API should be executed using `try ... catch` blocks: -```php -$errors = []; -try { - /** @type Cardinity\Method\Payment\Payment */ - $payment = $client->call($method); - $status = $payment->getStatus(); - if ($status == 'approved') { - echo '

    Your payment approved without 3D secure.

    '; - } elseif ($status == 'pending') { - if ($payment->isThreedsV2()) { - // $auth object for data required to finalize payment - $auth = $payment->getThreeds2Data(); - // finalize process should be done here. - }else if ($payment->isThreedsV1()) { - // $auth object for data required to finalize payment - $auth = $payment->getAuthorizationInformation(); - // finalize process should be done here. - } - } -} catch (Cardinity\Exception\InvalidAttributeValue $exception) { - foreach ($exception->getViolations() as $key => $violation) { - array_push($errors, $violation->getPropertyPath() . ' ' . $violation->getMessage()); - } -} catch (Cardinity\Exception\ValidationFailed $exception) { - foreach ($exception->getErrors() as $key => $error) { - array_push($errors, $error['message']); - } -} catch (Cardinity\Exception\Declined $exception) { - foreach ($exception->getErrors() as $key => $error) { - array_push($errors, $error['message']); - } -} catch (Cardinity\Exception\NotFound $exception) { - foreach ($exception->getErrors() as $key => $error) { - array_push($errors, $error['message']); - } -} catch (Exception $exception) { - $errors = [$exception->getMessage()]; -} -if ($errors) { - print_r($errors); -} -``` -#### Finalize payment -To finalize payment it should have status `pending`. Data received from 3D secure system should be used to create Finalize `$method`. -```php -use Cardinity\Method\Payment; - -$client = Client::create([ - 'consumerKey' => 'YOUR_CONSUMER_KEY', - 'consumerSecret' => 'YOUR_CONSUMER_SECRET', -]); - -if($v2){ - $method = new Payment\Finalize( - $payment->getId(), // payment object received from API call - $auth->getCreq(), // payment object received from API call - true // BOOL `true` to enable 3D secure V2 parameters - ); -}elseif($v1){ - $method = new Payment\Finalize( - $payment->getId(), // payment object received from API call - $auth->getData(), // payment object received from API call - false // BOOL `false` to enable 3D secure V1 parameters - ); -} - -// again use same try ... catch block -try { - $payment = $client->call($method); -} -// same catch blocks ... -// ... - -``` - -#### Get existing payment -```php -$method = new Payment\Get('cb5e1c95-7685-4499-a2b1-ae0f28297b92'); -/** @type Cardinity\Method\Payment\Payment */ -$payment = $client->call($method); -``` - -## API documentation -[https://developers.cardinity.com/api/v1/](https://developers.cardinity.com/api/v1/) - -## Development Status -All the API __v1__ methods are implemented. - -### Tests -for windows `php vendor/phpunit/phpunit/phpunit` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json deleted file mode 100644 index f131189a55e..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "cardinity/cardinity-sdk-php", - "description": "Client library for Cardinity credit card processing API", - "type": "library", - "license": "MIT", - "homepage": "https://cardinity.com", - "require": { - "php" : ">=7.2.5", - "guzzlehttp/guzzle" : "^6.2.1", - "guzzlehttp/oauth-subscriber": "0.3.*", - "symfony/validator" : "^5.0.0" - }, - "require-dev": { - "monolog/monolog" : "~1.0", - "phpspec/phpspec" : "~6.2", - "phpunit/phpunit" : "^8.5", - "symfony/yaml" : "^4.4" - }, - "config": { - "bin-dir": "bin" - }, - "autoload": { - "psr-4": {"Cardinity\\": "src"} - }, - "autoload-dev": { - "psr-4": { - "Cardinity\\Tests\\": "tests/" - } - }, - "scripts": { - "test": "phpunit" - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md deleted file mode 100644 index 64884fb3325..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md +++ /dev/null @@ -1,394 +0,0 @@ -# Introduction -Library includes all the functionality provided by API. Library was designed to be flexible and self-explanatory for developers to implement. -Client provides use of API in OOP style. - -## Authentication -You don't have to bother about it. Authentication is handled auto-magically behind the scenes. - -## Initialize the client object -```php -use Cardinity\Client; -$client = Client::create([ - 'consumerKey' => 'YOUR_CONSUMER_KEY', - 'consumerSecret' => 'YOUR_CONSUMER_SECRET', -]); -``` - -## Payments [API](https://developers.cardinity.com/api/v1/#payments) -### Create new payment -```php -use Cardinity\Method\Payment; -$method = new Payment\Create([ - 'amount' => 50.00, - 'currency' => 'EUR', - 'settle' => false, - 'description' => 'some description', - 'order_id' => '12345678', - 'country' => 'LT', - 'payment_method' => Payment\Create::CARD, - 'payment_instrument' => [ - 'pan' => '4111111111111111', - 'exp_year' => 2021, - 'exp_month' => 12, - 'cvc' => '456', - 'holder' => 'Mike Dough' - ], -]); - -/** @type Cardinity\Method\Payment\Payment */ -$payment = $client->call($method); -``` - -### Handling declined payments -In case payment could not be processed `Cardinity\Exception\Declined` -exception will be thrown. - -```php -use Cardinity\Exception; -use Cardinity\Method\Payment; - -$method = new Payment\Create([ - 'amount' => 150.01, - 'currency' => 'EUR', - 'settle' => false, - 'description' => 'some description', - 'order_id' => '12345678', - 'country' => 'LT', - 'payment_method' => Payment\Create::RECURRING, - 'payment_instrument' => [ - 'pan' => '4111111111111111', - 'exp_year' => 2021, - 'exp_month' => 12, - 'cvc' => '456', - 'holder' => 'Mike Dough' - ], -]); - -try { - /** @type Cardinity\Method\Payment\Payment */ - $payment = $client->call($method); -} catch (Exception\Declined $exception) { - /** @type Cardinity\Method\Payment\Payment */ - $payment = $exception->getResult(); - $status = $payment->getStatus(); // value will be 'declined' - $errors = $exception->getErrors(); // list of errors occured -} -``` - -### Create recurring payment -```php -use Cardinity\Method\Payment; -$method = new Payment\Create([ - 'amount' => 50.00, - 'currency' => 'EUR', - 'settle' => false, - 'description' => 'some description', - 'order_id' => '12345678', - 'country' => 'LT', - 'payment_method' => Payment\Create::RECURRING, - 'payment_instrument' => [ - 'payment_id' => $paymentId - ], -]); -/** @type Cardinity\Method\Payment\Payment */ -$payment = $client->call($method); -``` - -### Finalize pending payment -```php -use Cardinity\Method\Payment; -$method = new Payment\Finalize($payment->getId(), $payment->getAuthorizationInformation()->getData()); -/** @type Cardinity\Method\Payment\Payment */ -$payment = $client->call($method); -``` - -### Get existing payment -```php -use Cardinity\Method\Payment; -$method = new Payment\Get($payment->getId()); -/** @type Cardinity\Method\Payment\Payment */ -$payment = $client->call($method); -``` - -### Get all payments -```php -use Cardinity\Method\Payment; -$method = new Payment\GetAll(); -$result = $client->call($method); -/** @type Cardinity\Method\Payment\Payment */ -$payment = $result[0]; -``` - -## Refunds [API](https://developers.cardinity.com/api/v1/#refunds) -### Create new refund -```php -use Cardinity\Method\Refund; -$method = new Refund\Create( - $payment->getId(), - 10.00, - 'my description' -); -/** @type Cardinity\Method\Refund\Refund */ -$refund = $client->call($method); -``` - -### Handling declined refunds -In case refund could not be processed `Cardinity\Exception\Declined` -exception will be thrown. - -```php -use Cardinity\Exception; -use Cardinity\Method\Refund; - -$method = new Refund\Create( - $payment->getId(), - 10.00, - 'fail' -); - -try { - /** @type Cardinity\Method\Refund\Refund */ - $refund = $client->call($method); -} catch (Exception\Declined $exception) { - /** @type Cardinity\Method\Refund\Refund */ - $refund = $exception->getResult(); - $status = $refund->getStatus(); // value will be 'declined' - $errors = $exception->getErrors(); // list of errors occured -} -``` - -### Get existing refund -```php -use Cardinity\Method\Refund; -$method = new Refund\Get( - $payment->getId(), - $refund->getId() -); -/** @type Cardinity\Method\Refund\Refund */ -$refund = $client->call($method); -``` - -### Get all refunds -```php -use Cardinity\Method\Refund; -$method = new Refund\GetAll( - $payment->getId() -); -$result = $client->call($method); -/** @type Cardinity\Method\Refund\Refund */ -$refund = $result[0]; -``` - -## Settlements [API](https://developers.cardinity.com/api/v1/#settlements) -### Create new settlement -```php -use Cardinity\Method\Settlement; -$method = new Settlement\Create( - $payment->getId(), - 10.00, - 'my description' -); -/** @type Cardinity\Method\Settlement\Settlement */ -$result = $client->call($method); -``` - -### Handling declined settlements -In case settlement could not be processed `Cardinity\Exception\Declined` -exception will be thrown. - -```php -use Cardinity\Exception; -use Cardinity\Method\Settlement; - -$method = new Settlement\Create( - $payment->getId(), - 10.00, - 'fail' -); - -try { - /** @type Cardinity\Method\Settlement\Settlement */ - $settlement = $client->call($method); -} catch (Exception\Declined $exception) { - /** @type Cardinity\Method\Settlement\Settlement */ - $settlement = $exception->getResult(); - $status = $settlement->getStatus(); // value will be 'declined' - $errors = $exception->getErrors(); // list of errors occured -} -``` - -### Get existing settlement -```php -use Cardinity\Method\Settlement; -$method = new Settlement\Get( - $payment->getId(), - $settlement->getId() -); -/** @type Cardinity\Method\Settlement\Settlement */ -$settlement = $client->call($method); -``` - -### Get all settlements -```php -use Cardinity\Method\Settlement; -$method = new Settlement\GetAll( - $payment->getId() -); -$result = $client->call($method); -/** @type Cardinity\Method\Settlement\Settlement */ -$settlement = $result[0]; -``` - -## Voids [API](https://developers.cardinity.com/api/v1/#voids) -### Create new void -```php -use Cardinity\Method\VoidPayment; -$method = new VoidPayment\Create( - $payment->getId(), - 'my description' -); -/** @type Cardinity\Method\VoidPayment\VoidPayment */ -$result = $client->call($method); -``` - -### Handling declined voids -In case void could not be processed `Cardinity\Exception\Declined` -exception will be thrown. - -```php -use Cardinity\Exception; -use Cardinity\Method\VoidPayment; - -$method = new VoidPayment\Create( - $payment->getId(), - 'fail' -); - -try { - /** @type Cardinity\Method\VoidPayment\VoidPayment */ - $void = $client->call($method); -} catch (Exception\Declined $exception) { - /** @type Cardinity\Method\VoidPayment\VoidPayment */ - $void = $exception->getResult(); - $status = $void->getStatus(); // value will be 'declined' - $errors = $exception->getErrors(); // list of errors occured -} -``` - -### Get existing void -```php -use Cardinity\Method\VoidPayment; -$method = new VoidPayment\Get( - $payment->getId(), - $void->getId() -); -/** @type Cardinity\Method\VoidPayment\VoidPayment */ -$void = $client->call($method); -``` - -### Get all voids -```php -use Cardinity\Method\VoidPayment; -$method = new VoidPayment\GetAll( - $payment->getId() -); -$result = $client->call($method); -/** @type Cardinity\Method\VoidPayment\VoidPayment */ -$void = $result[0]; -``` - -## Exceptions -### Exceptions representing API error response - -#### Base class for API error response exceptions -Class: `Cardinity\Exception\Request` -Methods: -- `getErrors()` returns list of errors occurred -- `getErrorsAsString()` returns list of errors occurred in string form -- `getResult()` returns object, the instance of `ResultObjectInterface`. - -#### All classes -Class: `Cardinity\Exception\ValidationFailed` -HTTP status: `400` - -Class: `Cardinity\Exception\Unauthorized` -HTTP status: `401` - -Class: `Cardinity\Exception\Declined` -HTTP status: `402` - -Class: `Cardinity\Exception\Forbidden` -HTTP status: `403` - -Class: `Cardinity\Exception\MethodNotAllowed` -HTTP status: `405` - -Class: `Cardinity\Exception\NotAcceptable` -HTTP status: `406` - -Class: `Cardinity\Exception\NotFound` -HTTP status: `404` - -Class: `Cardinity\Exception\InternalServerError` -HTTP status: `500` - -Class: `Cardinity\Exception\ServiceUnavailable` -HTTP status: `503` - - -### Cardinity client exceptions - -#### Request timed out -Class: `Cardinity\Exception\RequestTimeout` - -#### Before-request data validation failed -Class: `Cardinity\Exception\InvalidAttributeValue` -Methods: -- `getViolations()` returns list of validation violations - -#### Unexpected error -Class: `Cardinity\Exception\UnexpectedError` - -#### Base exception class for Cardinity client -Class: `Cardinity\Exception\Runtime` -Catching this exception ensures that you handle all cardinity failure use cases. - - -## Advanced use cases - -### Debug, log request/response -`Client::create()` accepts second argument, which defines the logger. -Available values: `Client::LOG_NONE` or PSR-3 `LoggerInterface`. -- `Client::LOG_NONE` - log disabled. -- `LoggerInterface` - custom logger implementation, for eg. `Monolog`. - -```php -$client = Client::create($config, Client::LOG_NONE); -``` - -### Use Monolog for logging -#### 1. Add monolog to your project -```bash -$ composer require monolog/monolog -``` -#### 2. Register logger to the Cardinity client -```php -$logger = new Monolog\Logger('requests'); -$logger->pushHandler(new Monolog\Handler\StreamHandler(__DIR__ . '/requests.log', Logger::INFO)); -$client = Client::create($config, $logger); -``` - -### Extending components -Each part of client library can be easily extended or replaced with another suitable component -through the corresponding interfaces: -```php -public function __construct( - Cardinity\Http\ClientInterface $client, - Cardinity\Method\ValidatorInterface $validator, - Cardinity\Method\ResultObjectMapperInterface $mapper -) { ... } -``` - -For example to replace _Guzzle_ with another http client you want simply create adapter -for your client library, like `Cardinity\Http\Guzzle\ClientAdapter` which implements -`Cardinity\Http\ClientInterface`. That's it! diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist deleted file mode 100644 index 6da04f0186e..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist +++ /dev/null @@ -1,4 +0,0 @@ -suites: - cardinity_suite: - namespace: Cardinity - psr4_prefix: Cardinity diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist deleted file mode 100644 index badbd18809e..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - ./tests - - - - - - ./src - - - diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php deleted file mode 100644 index 37fe4c52ca4..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php +++ /dev/null @@ -1,201 +0,0 @@ -beConstructedWith( - $client, - $validator, - $mapper - ); - } - - function it_constructs_via_factory() - { - $this::create(['consumerKey' => '', 'consumerSecret' => ''])->shouldReturnAnInstanceOf('Cardinity\Client'); - } - - function it_maps_result_to_object_by_posting_json_body( - MethodInterface $method, - ClientInterface $client, - ValidatorInterface $validator, - ResultObjectMapperInterface $mapper - ) { - $result = ['id' => '3c4e8dcf']; - $resultObject = new Payment(); - - $method->getMethod()->willReturn('POST'); - $method->getAction()->willReturn('payment'); - $method->getAttributes()->willReturn([]); - $method->createResultObject()->willReturn($resultObject); - - $validator->validate($method)->shouldBeCalled(); - $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $client - ->sendRequest( - $method, - 'POST', - 'payment', - [ - 'headers' => [ - 'Content-Type' => 'application/json', - ], - 'body' => '{}', - ] - ) - ->shouldBeCalled() - ->willReturn($result) - ; - - $this->call($method)->shouldReturn($resultObject); - } - - function it_maps_result_containing_collection_of_items( - MethodResultCollectionInterface $method, - ClientInterface $client, - ValidatorInterface $validator, - ResultObjectMapperInterface $mapper - ) { - $result = [ - ['id' => '3c4e8dcf'] - ]; - $resultObject = new Payment(); - - $method->getMethod()->willReturn('POST'); - $method->getAction()->willReturn('payment'); - $method->getAttributes()->willReturn([]); - $method->createResultObject()->willReturn($resultObject); - - $validator->validate($method)->shouldBeCalled(); - $mapper->mapCollection($result, $method)->shouldBeCalled()->willReturn([$resultObject]); - - $client - ->sendRequest( - $method, - 'POST', - 'payment', - [ - 'headers' => [ - 'Content-Type' => 'application/json', - ], - 'body' => '{}', - ] - ) - ->shouldBeCalled() - ->willReturn($result) - ; - - $this->call($method)->shouldReturn([$resultObject]); - } - - function it_converts_float_numbers_to_string_for_json_body( - MethodInterface $method, - ClientInterface $client, - ValidatorInterface $validator, - ResultObjectMapperInterface $mapper - ) { - $result = ['amount' => 50.00]; - $resultObject = new Payment(); - - $method->getMethod()->willReturn('POST'); - $method->getAction()->willReturn('payment'); - $method->getAttributes()->willReturn(['amount' => 50.00]); - $method->createResultObject()->willReturn($resultObject); - - $validator->validate($method)->shouldBeCalled(); - $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $client - ->sendRequest( - $method, - 'POST', - 'payment', - [ - 'headers' => [ - 'Content-Type' => 'application/json', - ], - 'body' => '{"amount":"50.00"}', - ] - ) - ->shouldBeCalled() - ->willReturn($result) - ; - - $this->call($method)->shouldReturn($resultObject); - } - - function it_gets_result_object_by_sending_get_query_params( - MethodInterface $method, - ClientInterface $client, - ValidatorInterface $validator, - ResultObjectMapperInterface $mapper - ) { - $result = ['amount' => 50.00]; - $resultObject = new Payment(); - - $method->getMethod()->willReturn('GET'); - $method->getAction()->willReturn('payment'); - $method->getAttributes()->willReturn(['field' => 'value']); - $method->createResultObject()->willReturn($resultObject); - - $validator->validate($method)->shouldBeCalled(); - $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $client - ->sendRequest( - $method, - 'GET', - 'payment', - ['query' => ['field' => 'value']] - ) - ->shouldBeCalled() - ->willReturn($result) - ; - - $this->call($method)->shouldReturn($resultObject); - } - - function it_performs_request_without_validation( - MethodInterface $method, - ClientInterface $client, - ResultObjectMapperInterface $mapper - ) { - $result = ['amount' => 50.00]; - $resultObject = new Payment(); - - $method->getMethod()->willReturn('GET'); - $method->getAction()->willReturn('payment'); - $method->getAttributes()->willReturn(['field' => 'value']); - $method->createResultObject()->willReturn($resultObject); - - $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $client - ->sendRequest( - $method, - 'GET', - 'payment', - ['query' => ['field' => 'value']] - ) - ->shouldBeCalled() - ->willReturn($result) - ; - - $this->callNoValidate($method)->shouldReturn($resultObject); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php deleted file mode 100644 index 031d0d887d9..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_is_initializable() - { - $this->shouldHaveType('Cardinity\Exception\Declined'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(402); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php deleted file mode 100644 index 0196eff1251..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldHaveType('Cardinity\Exception\Forbidden'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(403); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php deleted file mode 100644 index cbc9598f631..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_should_extend_request() - { - $this->shouldHaveType('Cardinity\Exception\Request'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(500); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php deleted file mode 100644 index 03867c377ea..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php +++ /dev/null @@ -1,42 +0,0 @@ -__toString()->willReturn($this->violation); - - $this->beConstructedWith( - 'Message', - $violations - ); - } - - function it_is_initializable() - { - $this->shouldHaveType('\RuntimeException'); - } - - function it_returns_message() - { - $this->getMessage()->shouldStartWith('Message'); - } - - function it_returns_violations(ConstraintViolationList $violations) - { - $this->getViolations()->shouldReturn($violations); - } - - function it_should_have_message_containing_violations() - { - $string = 'Violations: ' . $this->violation; - $this->getMessage()->shouldEndWith($string); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php deleted file mode 100644 index 4e62a9edbb6..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_is_initializable() - { - $this->shouldHaveType('Cardinity\Exception\MethodNotAllowed'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(405); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php deleted file mode 100644 index 47f139004ff..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_is_initializable() - { - $this->shouldHaveType('Cardinity\Exception\NotAcceptable'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(406); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php deleted file mode 100644 index a00d66a46cd..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_is_initializable() - { - $this->shouldHaveType('Cardinity\Exception\NotFound'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(404); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php deleted file mode 100644 index 33a8174f9f0..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php +++ /dev/null @@ -1,85 +0,0 @@ - [ - [ - 'field' => 'currency', - 'rejected' => 'EGR', - 'message' => 'invalid or unsupported currency', - ], - [ - 'field' => 'payment_instrument.exp_month', - 'rejected' => 13, - 'message' => 'must be between 1 and 12', - ] - ] - ]; - - private $error; - - function let(\RuntimeException $exception) - { - $this->error = new Error(); - $this->error->setErrors($this->result['errors']); - - $this->beConstructedWith( - $exception, - $this->error - ); - } - - function it_should_extend_runtime() - { - $this->shouldHaveType('Cardinity\Exception\Runtime'); - } - - function it_stores_previous_exception(\RuntimeException $exception) - { - $this->getPrevious()->shouldReturn($exception); - } - - function it_stores_result() - { - $this->getResult()->shouldReturn($this->error); - } - - function it_should_have_message_containing_response_data() - { - $string = 'Response data: ' . serialize($this->error); - $this->getMessage()->shouldEndWith($string); - } - - function it_returns_errors_from_error_result_object() - { - $this->getErrors()->shouldReturn($this->result['errors']); - } - - function it_returns_errors_as_string() - { - $this->getErrorsAsString()->shouldReturn("currency: invalid or unsupported currency ('EGR' given);\npayment_instrument.exp_month: must be between 1 and 12 ('13' given);"); - } - - function it_returns_errors_from_payment_result_object(\RuntimeException $exception) - { - $msg = 'Payment error'; - - $payment = new Payment(); - $payment->setError($msg); - $this->beConstructedWith( - $exception, - $payment - ); - - $this->getErrors()->shouldReturn([['field' => 'status', 'message' => $msg]]); - $this->getErrorsAsString()->shouldReturn("status: Payment error;"); - } - -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php deleted file mode 100644 index 27b269ad879..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_should_extend_request() - { - $this->shouldHaveType('Cardinity\Exception\Request'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(0); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php deleted file mode 100644 index 60f27ada78a..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_is_initializable() - { - $this->shouldHaveType('Cardinity\Exception\ServiceUnavailable'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(503); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php deleted file mode 100644 index 7f4ad3f9d37..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_is_initializable() - { - $this->shouldHaveType('Cardinity\Exception\Unauthorized'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(401); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php deleted file mode 100644 index 4280a54be1b..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php +++ /dev/null @@ -1,13 +0,0 @@ -shouldHaveType('\RuntimeException'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php deleted file mode 100644 index 1cccb794fb9..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_should_extend_request() - { - $this->shouldHaveType('Cardinity\Exception\Request'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(0); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php deleted file mode 100644 index d1e7b542bd2..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php +++ /dev/null @@ -1,27 +0,0 @@ -beConstructedWith( - $exception, - $error - ); - } - - function it_should_extend_request() - { - $this->shouldHaveType('Cardinity\Exception\Request'); - } - - function it_should_return_correct_code() - { - $this->getCode()->shouldReturn(400); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php deleted file mode 100644 index 38c0e885075..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php +++ /dev/null @@ -1,84 +0,0 @@ -beConstructedWith($client, $mapper); - } - - function it_is_initializable() - { - $this->shouldHaveType('Cardinity\Http\Guzzle\ClientAdapter'); - } - - function it_sends_post_and_returns_result( - MethodInterface $method, - Client $client, - ResponseInterface $response - ) { - $response - ->getBody() - ->shouldBeCalled() - ->willReturn(json_encode(['foo' => 'bar'])) - ; - $client - ->request('POST', 'https://api.cardinity.com/v1/', []) - ->shouldBeCalled() - ->willReturn($response) - ; - $this - ->sendRequest($method, 'POST', 'https://api.cardinity.com/v1/', []) - ->shouldReturn(['foo' => 'bar']) - ; - } - - function it_wraps_client_exceptions_with_ours( - MethodInterface $method, - ClientInterface $client, - ExceptionMapper $mapper, - ClientException $exception - ) { - $client - ->request('POST', 'https://api.cardinity.com/v1/', []) - ->willThrow($exception->getWrappedObject()) - ; - $mapper - ->get($exception->getWrappedObject(), $method) - ->shouldBeCalled() - ->willThrow('Cardinity\Exception\Request') - ; - $this - ->shouldThrow('Cardinity\Exception\Request') - ->duringSendRequest($method, 'POST', 'https://api.cardinity.com/v1/') - ; - } - - function it_handles_unexpected_exceptions( - MethodInterface $method, - ClientInterface $client, - \Exception $exception - ) - { - $client - ->request('POST', 'https://api.cardinity.com/v1/', []) - ->willThrow($exception->getWrappedObject()) - ; - $this - ->shouldThrow('Cardinity\Exception\UnexpectedError') - ->duringSendRequest($method, 'POST', 'https://api.cardinity.com/v1/') - ; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php deleted file mode 100644 index eeb96faa515..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php +++ /dev/null @@ -1,100 +0,0 @@ -beConstructedWith($resultMapper); - - $exception->beConstructedWith([ - 'Message', - $request->getWrappedObject(), - $response->getWrappedObject() - ]); - } - - function it_maps_expected_exception_code( - ClientException $exception, - Response $response, - MethodInterface $method - ) { - $result = []; - - $response->getStatusCode()->willReturn(400); - $response->getBody()->willReturn(json_encode($result)); - - $exception->getResponse()->willReturn($response); - - $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\ValidationFailed'); - } - - function it_handles_unexpected_exception_code( - ClientException $exception, - Response $response, - MethodInterface $method - ) { - $result = []; - - $response->getStatusCode()->willReturn(999); - $response->getBody()->willReturn(json_encode($result)); - - $exception->getResponse()->willReturn($response); - - $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\UnexpectedResponse'); - } - - function it_maps_error_response_to_error_result_object( - ClientException $exception, - Response $response, - ResultObjectMapperInterface $resultMapper, - MethodInterface $method - ) { - $result = ['errors' => ['error' => 'Error string']]; - $resultObject = new Error(); - - $response->getStatusCode()->willReturn(400); - $response->getBody()->willReturn(json_encode($result)); - - $method->createResultObject()->willReturn($resultObject); - $exception->getResponse()->willReturn($response); - - $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $this->get($exception, $method)->getResult()->shouldReturn($resultObject); - } - - function it_maps_declined_response_402_to_payment_result_object( - ClientException $exception, - Response $response, - ResultObjectMapperInterface $resultMapper, - MethodInterface $method - ) { - $result = ['error' => 'Error string']; - $resultObject = new Payment(); - - $response->getStatusCode()->willReturn(402); - $response->getBody()->willReturn(json_encode($result)); - - $method->createResultObject()->willReturn($resultObject); - $exception->getResponse()->willReturn($response); - - $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $this->get($exception, $method)->getResult()->shouldReturn($resultObject); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php deleted file mode 100644 index 9d0c2fd3585..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_is_serializable() - { - $this->shouldImplement('\Serializable'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php deleted file mode 100644 index 8bf92353da3..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php +++ /dev/null @@ -1,13 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php deleted file mode 100644 index a7d84069adc..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php +++ /dev/null @@ -1,87 +0,0 @@ - 'Some header', - 'browser_language' => 'LT', - 'screen_width' => 390, - 'screen_height' => 400, - 'challenge_window_size' => '390x400', - 'user_agent' => 'super user agent', - 'color_depth' => 24, - 'time_zone' => -60, - // 'ip_address' => '192.168.0.1', - ]; - $billingAddress = [ - 'address_line1' => 'first address line', - 'city' => 'balbieriskis', - 'country' => 'LT', - 'postal_code' => '0234' - ]; - $threeds2Data['notification_url'] = 'http://localhost:8000/3dsv2_callback.php'; - $threeds2Data['browser_info'] = $browserInfo; - - $this->options = [ - 'amount' => 12.99, - 'currency' => 'EUR', - 'settle' => true, - 'order_id' => 'ABC123', - 'description' => 'Description', - 'country' => 'LT', - 'payment_method' => 'card', - 'payment_instrument' => [ - 'pan' => '123456789123', - 'exp_year' => '2014', - 'exp_month' => '12', - 'cvc' => '456', - 'holder' => 'Mr Tester', - ], - 'threeds2_data' => $threeds2Data - ]; - $this->beConstructedWith($this->options); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_contains_loaded_options() - { - $this->getAttributes()->shouldReturn($this->options); - } - - function it_has_action() - { - $this->getAction()->shouldReturn('payments'); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('POST'); - } - - function it_has_body() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php deleted file mode 100644 index dbba8c38c0e..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php +++ /dev/null @@ -1,56 +0,0 @@ -beConstructedWith($this->paymentId, $this->authorizeData); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_authorize_data() - { - $this->getAuthorizeData()->shouldReturn($this->authorizeData); - } - - function it_has_action() - { - $this->getAction()->shouldReturn('payments/' . $this->paymentId); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('PATCH'); - } - - function it_has_body() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php deleted file mode 100644 index 332a551bc7e..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php +++ /dev/null @@ -1,50 +0,0 @@ -beConstructedWith($this->limit); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodResultCollectionInterface'); - } - - function it_has_limit() - { - $this->getLimit()->shouldReturn($this->limit); - } - - function it_has_action() - { - $this->getAction()->shouldReturn('payments'); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_body() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_has_create_result() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php deleted file mode 100644 index 09a27f38f27..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php +++ /dev/null @@ -1,50 +0,0 @@ -beConstructedWith($this->paymentId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn('payments/' . $this->paymentId); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php deleted file mode 100644 index 3009058caf2..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php +++ /dev/null @@ -1,13 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php deleted file mode 100644 index c3ae7f82fcc..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php +++ /dev/null @@ -1,13 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php deleted file mode 100644 index d2a0532fa78..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php +++ /dev/null @@ -1,100 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_is_serializable() - { - $this->shouldImplement('\Serializable'); - - $this->setId('foo'); - $this->setAmount(20.00); - $this->setType(null); - - $info = new AuthorizationInformation(); - $info->setUrl('http://...'); - $info->setData('some_data'); - - $this->setAuthorizationInformation($info); - $this->serialize()->shouldReturn('{"id":"foo","amount":"20.00","authorization_information":{"url":"http:\/\/...","data":"some_data"}}'); - } - - function it_is_able_to_unserialize_authorization_information() - { - $json = '{"id":"foo.bar.123","amount":"20.00","authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; - $this->unserialize($json); - - $this->getId()->shouldReturn('foo.bar.123'); - $this->getAmount()->shouldReturn(20.00); - $this->getType()->shouldReturn(null); - $this->getAuthorizationInformation()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\AuthorizationInformation'); - $this->getAuthorizationInformation()->getUrl()->shouldReturn('http://...'); - $this->getAuthorizationInformation()->getData()->shouldReturn('some_data'); - } - - function it_is_able_to_unserialize_card_payment_instrument() - { - $json = '{"payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":2024,"exp_month":5,"holder":"John Smith"}}'; - $this->unserialize($json); - - $this->getPaymentMethod()->shouldReturn('card'); - $this->getPaymentInstrument()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard'); - $this->getPaymentInstrument()->getCardBrand()->shouldReturn('Visa'); - $this->getPaymentInstrument()->getExpYear()->shouldReturn(2024); - } - - function it_is_able_to_unserialize_recurring_payment_instrument() - { - $json = '{"payment_method":"recurring","payment_instrument":{"payment_id":"ba3119f2-9a73"}}'; - $this->unserialize($json); - - $this->getPaymentMethod()->shouldReturn('recurring'); - $this->getPaymentInstrument()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\PaymentInstrumentRecurring'); - $this->getPaymentInstrument()->getPaymentId()->shouldReturn('ba3119f2-9a73'); - } - - - function it_is_able_to_take_threeds2_data() - { - - $tds2Auth = new ThreeDS2AuthorizationInformation(); - $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); - $tds2Auth->setCreq('eyJyZXR1c...'); - - $this->setThreeds2Data($tds2Auth); - $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); - $this->getThreeds2Data()->shouldReturn($tds2Auth); - - } - - function it_is_able_to_serialize_tdsv2(){ - $json = '{"acs_url":"https:\/\/acs.cardinity.com\/v2\/","c_req":"eyJyZXR1c..."}'; - - $tds2Auth = new ThreeDS2AuthorizationInformation(); - $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); - $tds2Auth->setCreq('eyJyZXR1c...'); - - $this->setThreeds2Data($tds2Auth); - $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); - $this->getThreeds2Data()->shouldReturn($tds2Auth); - - $this->getThreeds2Data()->serialize()->shouldReturn($json); - } - - - function it_handles_unexpected_values() - { - $json = '{"payment_instrument":{"payment_id":"ba3119f2-9a73"}}'; - $this->shouldThrow('Cardinity\Exception\Runtime')->duringUnserialize($json); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php deleted file mode 100644 index c6c18dfe907..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php +++ /dev/null @@ -1,41 +0,0 @@ -tds2_data['acs_url'] = 'http://mynotifactionurl.com'; - $this->tds2_data['creq'] = "asdf123xcxzcv"; - - $this->setAcsUrl($this->tds2_data['acs_url']); - $this->setCReq($this->tds2_data['creq']); - } - - function it_is_initalizable(){ - $this->shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_contains_acs_url() - { - $this->getAcsUrl()->shouldReturn($this->tds2_data['acs_url']); - } - - function it_contains_creq() - { - $this->getCReq()->shouldReturn($this->tds2_data['creq']); - } - - - - - - -} - - diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php deleted file mode 100644 index 77162e53a23..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php +++ /dev/null @@ -1,66 +0,0 @@ -beConstructedWith($this->paymentId, $this->amount, $this->description); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_contains_loaded_options() - { - $this->getAttributes()->shouldReturn([ - 'amount' => $this->amount, - 'description' => $this->description, - ]); - } - - function it_does_not_contain_optional_properties() - { - $this->beConstructedWith($this->paymentId, $this->amount); - - $this->getAttributes()->shouldReturn([ - 'amount' => $this->amount, - ]); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - sprintf('payments/%s/refunds', $this->paymentId) - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('POST'); - } - - function it_has_body() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php deleted file mode 100644 index 22f662e9162..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php +++ /dev/null @@ -1,52 +0,0 @@ -beConstructedWith($this->paymentId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - 'payments/' . $this->paymentId . '/refunds' - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_has_create_result() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php deleted file mode 100644 index 0e9a297412d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php +++ /dev/null @@ -1,58 +0,0 @@ -beConstructedWith($this->paymentId, $this->refundId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_refund_id() - { - $this->getRefundId()->shouldReturn($this->refundId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - 'payments/' . $this->paymentId . '/refunds/' . $this->refundId - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php deleted file mode 100644 index f9d43d10635..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_is_serializable() - { - $this->shouldImplement('\Serializable'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php deleted file mode 100644 index 6f3b185b6b7..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php +++ /dev/null @@ -1,117 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectMapper'); - } - - function it_maps_array_to_object(Payment $object) - { - $data = [ - 'id' => 32, - 'type' => 'my_type', - ]; - - $object->setId(32)->shouldBeCalled(); - $object->setType('my_type')->shouldBeCalled(); - - $this->map($data, $object); - } - - function it_maps_card_payment_instrument(Payment $payment) - { - $data = [ - 'payment_method' => 'card', - 'payment_instrument' => [ - 'card_brand' => 'Visa', - 'pan' => '0067', - 'exp_year' => 2021, - 'exp_month' => 12, - 'holder' => 'Mike Dough' - ], - ]; - - $instrument = new PaymentInstrumentCard(); - $instrument->setCardBrand('Visa'); - $instrument->setPan('0067'); - $instrument->setExpYear(2021); - $instrument->setExpMonth(12); - $instrument->setHolder('Mike Dough'); - - $payment->setPaymentMethod('card')->shouldBeCalled(); - $payment->setPaymentInstrument($instrument)->shouldBeCalled(); - - $this->map($data, $payment)->shouldReturn($payment); - } - - function it_maps_recurring_payment_instrument(Payment $payment) - { - $data = [ - 'payment_method' => 'recurring', - 'payment_instrument' => [ - 'payment_id' => 'ba3119f2-9a73-11e4-89d3-123b93f75cba', - ], - ]; - - $instrument = new PaymentInstrumentRecurring(); - $instrument->setPaymentId('ba3119f2-9a73-11e4-89d3-123b93f75cba'); - - $payment->setPaymentMethod('recurring')->shouldBeCalled(); - $payment->setPaymentInstrument($instrument)->shouldBeCalled(); - - $this->map($data, $payment); - } - - function it_throws_exception_for_unknown_payment_method(Payment $payment) - { - $data = [ - 'payment_method' => 'non_existing_method', - 'payment_instrument' => [], - ]; - - $this->shouldThrow('Cardinity\Exception\Runtime')->duringMap($data, $payment); - } - - function it_maps_authorization_information(Payment $payment) - { - $data = [ - 'authorization_information' => [ - 'url' => 'https://authorization.url/auth', - 'data' => 'eJxdUl1vwj.......', - ], - ]; - - $info = new AuthorizationInformation(); - $info->setUrl('https://authorization.url/auth'); - $info->setData('eJxdUl1vwj.......'); - - $payment->setAuthorizationInformation($info)->shouldBeCalled(); - - $this->map($data, $payment); - } - - function it_maps_data_collection(MethodResultCollectionInterface $method, Payment $object) - { - $data = [ - ['id' => 32, 'type' => 'my_type'], - ]; - - $method->createResultObject()->shouldBeCalled()->willReturn($object); - - $object->setId(32)->shouldBeCalled(); - $object->setType('my_type')->shouldBeCalled(); - - $this->mapCollection($data, $method); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php deleted file mode 100644 index b94a2323099..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php +++ /dev/null @@ -1,66 +0,0 @@ -beConstructedWith($this->paymentId, $this->amount, $this->description); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_contains_loaded_options() - { - $this->getAttributes()->shouldReturn([ - 'amount' => $this->amount, - 'description' => $this->description, - ]); - } - - function it_does_not_contain_optional_properties() - { - $this->beConstructedWith($this->paymentId, $this->amount); - - $this->getAttributes()->shouldReturn([ - 'amount' => $this->amount, - ]); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - sprintf('payments/%s/settlements', $this->paymentId) - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('POST'); - } - - function it_has_body() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php deleted file mode 100644 index 8d17d7199ed..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php +++ /dev/null @@ -1,52 +0,0 @@ -beConstructedWith($this->paymentId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - 'payments/' . $this->paymentId . '/settlements' - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_has_create_result() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php deleted file mode 100644 index cda82405141..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php +++ /dev/null @@ -1,58 +0,0 @@ -beConstructedWith($this->paymentId, $this->settlementId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_settlement_id() - { - $this->getSettlementId()->shouldReturn($this->settlementId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - 'payments/' . $this->paymentId . '/settlements/' . $this->settlementId - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php deleted file mode 100644 index 4175040b073..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_is_serializable() - { - $this->shouldImplement('\Serializable'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php deleted file mode 100644 index 8b7d9a9da9d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php +++ /dev/null @@ -1,64 +0,0 @@ -beConstructedWith($validator); - } - - function it_implements_validator_interface() - { - $this->shouldImplement('Cardinity\Method\ValidatorInterface'); - } - - function it_validates_given_method_instance(MethodInterface $method, ValidatorInterface $validator) - { - $attributes = ['field' => 'value']; - $constraints = ['constraints']; - - $method->getAttributes()->shouldBeCalled()->willReturn($attributes); - $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); - - $validator->validate($attributes, $constraints)->shouldBeCalled(); - - $this->validate($method); - } - - function it_throws_exception_on_validation_failure( - MethodInterface $method, - ValidatorInterface $validator, - ConstraintViolationList $violations - ) { - $attributes = ['field' => 'value']; - $constraints = ['constraints']; - - $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); - $method->getAttributes()->shouldBeCalled()->willReturn($attributes); - - $violations->count()->willReturn(1); - $violations->__toString()->willReturn(''); - - $validator->validate($attributes, $constraints)->willReturn($violations); - - $this->shouldThrow('Cardinity\Exception\InvalidAttributeValue')->duringValidate($method); - } - - function it_does_not_validate_method_with_no_constraints(MethodInterface $method, ValidatorInterface $validator) - { - $constraints = []; - - $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); - - $validator->validate([], $constraints)->shouldNotBeCalled(); - - $this->validate($method); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php deleted file mode 100644 index c84260d372d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php +++ /dev/null @@ -1,62 +0,0 @@ -beConstructedWith($this->paymentId, $this->description); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_contains_loaded_options() - { - $this->getAttributes()->shouldReturn([ - 'description' => $this->description, - ]); - } - - function it_does_not_contain_optional_properties() - { - $this->beConstructedWith($this->paymentId); - - $this->getAttributes()->shouldReturn([]); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - sprintf('payments/%s/voids', $this->paymentId) - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('POST'); - } - - function it_has_body() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php deleted file mode 100644 index 6cccb6bb261..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php +++ /dev/null @@ -1,50 +0,0 @@ -beConstructedWith($this->paymentId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn('payments/' . $this->paymentId . '/voids'); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_has_create_result() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php deleted file mode 100644 index e41c5297b71..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php +++ /dev/null @@ -1,58 +0,0 @@ -beConstructedWith($this->paymentId, $this->voidId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_settlement_id() - { - $this->getvoidId()->shouldReturn($this->voidId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - 'payments/' . $this->paymentId . '/voids/' . $this->voidId - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php deleted file mode 100644 index 080ba892ce6..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_is_serializable() - { - $this->shouldImplement('\Serializable'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php deleted file mode 100644 index bd18aa9144f..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php +++ /dev/null @@ -1,215 +0,0 @@ - 'foo', - * 'consumerSecret' => 'bar', - * ] - * @param LoggerInterface $logger Logs messages. - * @return self - */ - public static function create(array $options = [], $logger = Client::LOG_NONE) - { - $oauth = new Oauth1([ - 'token_secret' => '', - 'consumer_key' => $options['consumerKey'], - 'consumer_secret' => $options['consumerSecret'] - ]); - - $validator = Validation::createValidator(); - - if(isset($options['apiEndpoint'])){ - self::validateClientEndpoint($options, $validator); - self::$url = $options['apiEndpoint']; - } - - $stack = HandlerStack::create(); - $stack->push($oauth); - - if (!empty($logger)) { - $stack->push( - Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG)) - ); - } - - $client = new \GuzzleHttp\Client([ - 'base_uri' => self::$url, - 'handler' => $stack, - 'auth' => 'oauth' - ]); - - $mapper = new ResultObjectMapper(); - - return new self( - new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)), - new Validator($validator), - $mapper - ); - } - - /** - * @param ClientInterface $client - * @param ValidatorInterface $validator - * @param ResultObjectMapperInterface $mapper - */ - public function __construct( - ClientInterface $client, - ValidatorInterface $validator, - ResultObjectMapperInterface $mapper - ) { - $this->client = $client; - $this->validator = $validator; - $this->mapper = $mapper; - } - - /** - * Call the given method. - * @param MethodInterface $method - * @return ResultObjectInterface|array - */ - public function call(MethodInterface $method) - { - $this->validator->validate($method); - - return $this->handleRequest($method); - } - - /** - * Call the particular method without data validation - * @param MethodInterface $method - * @return ResultObjectInterface|array - */ - public function callNoValidate(MethodInterface $method) - { - return $this->handleRequest($method); - } - - /** - * Handle all the request/response hard work - * @param MethodInterface $method - * @return ResultObjectInterface|array - */ - private function handleRequest(MethodInterface $method) - { - $result = $this->client->sendRequest( - $method, - $method->getMethod(), - $method->getAction(), - $this->getOptions($method) - ); - - if ($method instanceof MethodResultCollectionInterface) { - return $this->mapper->mapCollection($result, $method); - } - - return $this->mapper->map($result, $method->createResultObject()); - } - - /** - * Prepare request options for particular method - * @param MethodInterface $method - * @return array - */ - private function getOptions(MethodInterface $method) - { - if ($method->getMethod() == $method::GET) { - return [ - 'query' => $method->getAttributes(), - ]; - } - - return [ - 'headers' => [ - 'Content-Type' => 'application/json', - ], - 'body' => json_encode( - $this->prepareAttributes($method->getAttributes()), - JSON_FORCE_OBJECT - ) - ]; - } - - /** - * Prepare request attributes - * @param array $data - * @return array - */ - private function prepareAttributes(array $data) - { - foreach ($data as $key => &$value) { - if (is_array($value)) { - $data[$key] = $this->prepareAttributes($value); - continue; - } - - if (is_float($value)) { - $value = sprintf("%01.2f", $value); - } - } - - return $data; - } - - /** - * Validate endPoint is a valid URL - * - * @param [array] $options - * @param [Validator] $validator - * @return void - */ - private static function validateClientEndpoint($options, $validator){ - $violations = $validator->validate($options['apiEndpoint'], [ - new Url(), - ]); - if(count($violations) != 0){ - throw new Exception\InvalidAttributeValue( - 'Your API endpoint is not a valid URL', - $violations - ); - } - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php deleted file mode 100644 index 29a2f085ea9..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php +++ /dev/null @@ -1,9 +0,0 @@ -__toString(); - parent::__construct($message); - - $this->violations = $violations; - } - - public function getViolations() - { - return $this->violations; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php deleted file mode 100644 index 8a0294e7a8f..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php +++ /dev/null @@ -1,9 +0,0 @@ -message .= ' Response data: ' . serialize($result); - parent::__construct($this->message, $this->code, $previous); - - $this->result = $result; - } - - /** - * Get result object of particular response - * @return ResultObjectInterface - */ - public function getResult() - { - return $this->result; - } - - /** - * List of errors occured - * @return array - */ - public function getErrors() - { - return $this->result->getErrors(); - } - - /** - * Errors in string form - * @return string - */ - public function getErrorsAsString() - { - $string = ''; - foreach ($this->getErrors() as $error) { - $string .= sprintf( - "%s: %s", - $error['field'], - $error['message'] - ); - if (isset($error['rejected'])) { - $string .= sprintf(" ('%s' given)", $error['rejected']); - } - $string .= ";\n"; - } - - return trim($string); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php deleted file mode 100644 index dcb34d764b4..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php +++ /dev/null @@ -1,9 +0,0 @@ -client = $client; - $this->mapper = $mapper; - } - - /** - * Send HTTP request - * @param MethodInterface $method - * @param string $requestMethod POST|GET|PATCH - * @param string $url http URL - * @param array $options query options. Query values goes under 'body' key. - * - * @return array - */ - public function sendRequest( - MethodInterface $method, - $requestMethod, - $url, - array $options = [] - ) { - try { - $response = $this->client->request($requestMethod, $url, $options); - return json_decode($response->getBody(), true); - } catch (ClientException $e) { - throw $this->mapper->get($e, $method); - } catch (\Exception $e) { - throw new Exception\UnexpectedError('Unexpected error', $e->getCode(), $e); - } - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php deleted file mode 100644 index b1d772fde66..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php +++ /dev/null @@ -1,93 +0,0 @@ -resultMapper = $resultMapper; - } - - /** - * Get mapped exception - * @param ClientException $exception - * @param MethodInterface $method - * @return Cardinity\Exception\Request - */ - public function get(ClientException $exception, MethodInterface $method) - { - $map = $this->getMap(); - if ($this->supports($exception, $map)) { - return $this->create( - $this->getMappedClass($exception, $map), - $exception, - $method - ); - } - - return $this->create( - 'Cardinity\\Exception\\UnexpectedResponse', - $exception, - $method - ); - } - - private function getMappedClass(ClientException $exception, $map) - { - return $map[$exception->getCode()]; - } - - private function supports(ClientException $exception, $map) - { - return array_key_exists($exception->getCode(), $map); - } - - private function getMap() - { - return [ - 400 => 'Cardinity\\Exception\\ValidationFailed', - 401 => 'Cardinity\\Exception\\Unauthorized', - 402 => 'Cardinity\\Exception\\Declined', - 403 => 'Cardinity\\Exception\\Forbidden', - 404 => 'Cardinity\\Exception\\NotFound', - 405 => 'Cardinity\\Exception\\MethodNotAllowed', - 406 => 'Cardinity\\Exception\\NotAcceptable', - 500 => 'Cardinity\\Exception\\InternalServerError', - 503 => 'Cardinity\\Exception\\ServiceUnavailable', - ]; - } - - private function create($class, ClientException $exception, MethodInterface $method) - { - $response = json_decode($exception->getResponse()->getBody(), true); - - // map declined response to result object - if ($exception->getCode() == 402) { - $resultObject = $method->createResultObject(); - } else { - $resultObject = new Error(); - } - - $response = $this->resultMapper->map( - $response, - $resultObject - ); - - return new $class( - $exception, - $response - ); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php deleted file mode 100644 index ceb3fd93d48..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php +++ /dev/null @@ -1,116 +0,0 @@ -type; - } - - /** - * Sets the value of type. - * @param mixed $type the type - * @return void - */ - public function setType($type) - { - $this->type = $type; - } - - /** - * Gets the value of title. - * @return mixed - */ - public function getTitle() - { - return $this->title; - } - - /** - * Sets the value of title. - * @param mixed $title the title - * @return void - */ - public function setTitle($title) - { - $this->title = $title; - } - - /** - * Gets the value of status. - * @return mixed - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets the value of status. - * @param mixed $status the status - * @return void - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * Gets the value of detail. - * @return mixed - */ - public function getDetail() - { - return $this->detail; - } - - /** - * Sets the value of detail. - * @param mixed $detail the detail - * @return void - */ - public function setDetail($detail) - { - $this->detail = $detail; - } - - /** - * Gets the value of errors. - * @return array - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Sets the value of errors. - * @param array $errors the errors - * @return void - */ - public function setErrors($errors) - { - $this->errors = $errors; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php deleted file mode 100644 index d494ab8731c..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php +++ /dev/null @@ -1,54 +0,0 @@ -url; - } - - /** - * Sets the value of url. - * @param mixed $url the url - * @return void - */ - public function setUrl($url) - { - $this->url = $url; - } - - /** - * Gets the value of data. - * @return mixed - */ - public function getData() - { - return $this->data; - } - - /** - * Sets the value of data. - * @param mixed $data the data - * @return void - */ - public function setData($data) - { - $this->data = $data; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php deleted file mode 100644 index 817c6b074bf..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php +++ /dev/null @@ -1,226 +0,0 @@ -attributes = $attributes; - } - - public function getAction(): string - { - return 'payments'; - } - - public function getMethod(): string - { - return MethodInterface::POST; - } - - public function getAttributes(): array - { - return $this->attributes; - } - - public function createResultObject(): Payment - { - return new Payment(); - } - - public function getValidationConstraints() - { - return new Assert\Collection([ - 'amount' => $this->buildElement('float', 1), - 'currency' => $this->buildElement('string', 1, ['min' => 3,'max' => 3]), - 'settle' => $this->buildElement('bool'), - 'order_id' => $this->buildElement('string', 0, ['min' => 2,'max' => 50]), - 'description' => $this->buildElement('string', 0, ['max' => 255]), - 'statement_descriptor_suffix' => $this->buildElement('string', 0, ['max' => 25]), - 'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]), - 'payment_method' => new Assert\Required([ - new Assert\Type([ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]), - new Assert\Choice([ - 'choices' => [ - self::CARD, - self::RECURRING - ] - ]) - ]), - 'payment_instrument' => $this->getPaymentInstrumentConstraints( - $this->getAttributes()['payment_method'] - ), - 'threeds2_data' => new Assert\Optional( - $this->getThreeDS2DataConstraints() - ) - ]); - } - - private function getPaymentInstrumentConstraints($method): ?object - { - switch ($method) { - case self::CARD: - return new Assert\Collection([ - 'pan' => new Assert\Required([ - new Assert\NotBlank(), - new Assert\Luhn() - ]), - 'exp_year' => $this->buildElement( - 'integer', 1, - ['min' => 4,'max' => 4], - new Assert\Range(['min' => date('Y')]) - ), - 'exp_month' => $this->buildElement('integer', 1), - 'cvc' => $this->buildElement('string', 1, ['min' => 3, 'max' => 4]), - 'holder' => $this->buildElement('string', 1, ['max' => 32]), - ]); - case self::RECURRING: - return new Assert\Collection([ - 'payment_id' => $this->buildElement('string', 1), - ]); - } - - throw new \InvalidArgumentException( - sprintf( - 'Payment instrument for payment method "%s" is not expected', - $method - ) - ); - } - - private function getThreeDS2DataConstraints(): object - { - return new Assert\Collection([ - 'notification_url' => $this->getNotificationUrlConstraints(), - 'browser_info' => $this->getBrowserInfoConstraints(), - 'billing_address' => new Assert\Optional( - $this->getAdressConstraints() - ), - 'delivery_address' => new Assert\Optional( - $this->getAdressConstraints() - ), - 'cardholder_info' => new Assert\Optional( - $this->getCardHolderInfoConstraints() - ), - ]); - } - - public function getNotificationUrlConstraints() - { - return new Assert\Required([ - new Assert\NotBlank(), - new Assert\Type([ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]), - new CallbackUrlConstraint(), - new Assert\Url([ - 'message' => 'The protocol of {{ value }} should be "http" or "https".', - 'protocols' => ['http', 'https'], - ]), - ]); - } - - public function getIpAddressConstraints() - { - return new Assert\Optional([ - new Assert\NotBlank(), - new CallbackUrlConstraint(), - new Assert\Type([ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]), - ]); - } - - private function getBrowserInfoConstraints() - { - return new Assert\Collection([ - 'accept_header' => $this->buildElement('string', 1), - 'browser_language' => $this->buildElement('string', 1), - 'screen_width' => $this->buildElement('integer', 1), - 'screen_height' => $this->buildElement('integer', 1), - 'challenge_window_size' => $this->buildElement('string', 1), - 'user_agent' => $this->buildElement('string', 1), - 'color_depth' => $this->buildElement('integer', 1), - 'time_zone' => $this->buildElement('integer', 1), - 'ip_address' => $this->getIpAddressConstraints(), - 'javascript_enabled' => new Assert\Optional($this->buildElement('bool')), - 'java_enabled' => new Assert\Optional($this->buildElement('bool')), - ]); - } - - private function getAdressConstraints(): object - { - return new Assert\Collection([ - 'address_line1' => $this->buildElement('string', 1, ['max' => 50]), - 'address_line2' => new Assert\Optional( - $this->buildElement('string', 1, ['max' => 50]) - ), - 'address_line3' => new Assert\Optional( - $this->buildElement('string', 0, ['max' => 50]) - ), - 'city' => $this->buildElement('string', 1, ['max' => 50]), - 'country' => $this->buildElement('string', 1, ['max' => 10]), - 'postal_code' => $this->buildElement('string', 1, ['max' => 16]), - 'state' => new Assert\Optional( - $this->buildElement('string', 0, ['max' => 14]) - ), - ]); - } - - private function getCardHolderInfoConstraints(): object - { - return new Assert\Collection([ - 'email_address' => new Assert\Optional( - new Assert\Email(['mode' => 'loose']) - ), - 'mobile_phone_number' => new Assert\Optional($this->buildElement('string')), - 'work_phone_number' => new Assert\Optional($this->buildElement('string')), - 'home_phone_number' => new Assert\Optional($this->buildElement('string')), - ]); - } - - private function buildElement( - string $typeValue, - bool $isRequired = false, - array $length = null, - $args = null // TODO can it be null? - ): object - { - $inside_array = $this->getInsideArray($typeValue); - if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); - if ($length) array_push($inside_array, new Assert\Length($length)); - if ($args) array_push($inside_array, $args); - - return $isRequired - ? new Assert\Required($inside_array) - : new Assert\Optional($inside_array) - ; - } - - private function getInsideArray(string $typeValue): array - { - return [ - new Assert\Type([ - 'type' => $typeValue, - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]), - ]; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php deleted file mode 100644 index d344626515d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php +++ /dev/null @@ -1,78 +0,0 @@ -paymentId = $paymentId; - $this->authorizeData = $authorizeData; - $this->finalizeKey = $isV2 ? 'cres' : 'authorize_data'; - } - - public function getPaymentId() - { - return $this->paymentId; - } - - public function getAuthorizeData() - { - return $this->authorizeData; - } - - public function getAction() - { - return sprintf('payments/%s', $this->getPaymentId()); - } - - public function getMethod() - { - return MethodInterface::PATCH; - } - - public function createResultObject() - { - return new Payment(); - } - - public function getAttributes() - { - return [ - $this->finalizeKey => $this->getAuthorizeData(), - $this->paymentId => $this->getPaymentId(), - ]; - } - - public function getValidationConstraints() - { - $type_params = [ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]; - return new Assert\Collection([ - 'fields' => [ - $this->finalizeKey => new Assert\Required([ - new Assert\NotBlank(["message"=>"$this->finalizeKey missing."]), - new Assert\Type($type_params) - ]), - $this->paymentId => new Assert\Required([ - new Assert\NotBlank(["message"=>"paymentId missing."]), - new Assert\Type($type_params) - ]), - ], - ]); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php deleted file mode 100644 index 4ec5d3cb74f..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php +++ /dev/null @@ -1,46 +0,0 @@ -paymentId = $paymentId; - } - - public function getPaymentId() - { - return $this->paymentId; - } - - public function getAction() - { - return sprintf('payments/%s', $this->getPaymentId()); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new Payment(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php deleted file mode 100644 index 155f4254ca7..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php +++ /dev/null @@ -1,54 +0,0 @@ -limit = $limit; - } - - public function getLimit() - { - return $this->limit; - } - - public function getAction() - { - return 'payments'; - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new Payment(); - } - - public function getAttributes() - { - return [ - 'limit' => $this->getLimit() - ]; - } - - public function getValidationConstraints() - { - return new Assert\Collection([ - 'limit' => new Assert\Optional([ - new Assert\NotNull(), - new Assert\Type(['type' => 'integer']), - ]), - ]); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php deleted file mode 100644 index 64f8d32253a..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php +++ /dev/null @@ -1,478 +0,0 @@ -id; - } - - /** - * Sets the value of id. - * @param mixed $id the id - * @return void - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * Gets the value of amount. - * @return mixed - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Sets the value of amount. - * @param mixed $amount the amount - * @return void - */ - public function setAmount($amount) - { - $this->amount = $amount; - } - - /** - * Gets the value of currency. - * @return mixed - */ - public function getCurrency() - { - return $this->currency; - } - - /** - * Sets the value of currency. - * @param mixed $currency the currency - * @return void - */ - public function setCurrency($currency) - { - $this->currency = $currency; - } - - /** - * Gets the value of created. - * @return mixed - */ - public function getCreated() - { - return $this->created; - } - - /** - * Sets the value of created. - * @param mixed $created the created - * @return void - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Gets the value of type. - * @return mixed - */ - public function getType() - { - return $this->type; - } - - /** - * Sets the value of type. - * @param mixed $type the type - * @return void - */ - public function setType($type) - { - $this->type = $type; - } - - /** - * Gets the value of live. - * @return mixed - */ - public function getLive() - { - return $this->live; - } - - /** - * Sets the value of live. - * @param mixed $live the live - * @return void - */ - public function setLive($live) - { - $this->live = $live; - } - - /** - * Gets the value of settle. - * @return mixed - */ - public function getSettle() - { - return $this->settle; - } - - /** - * Sets the value of settle. - * @param mixed $settle the settle - * @return void - */ - public function setSettle($settle) - { - $this->settle = $settle; - } - - /** - * Gets the value of status. - * @return mixed - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets the value of status. - * @param mixed $status the status - * @return void - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * Gets the value of error. - * @return mixed - */ - public function getError() - { - return $this->error; - } - - /** - * Sets the value of error. - * @param mixed $error the error - * @return void - */ - public function setError($error) - { - $this->error = $error; - } - - /** - * Gets the value of orderId. - * @return mixed - */ - public function getOrderId() - { - return $this->orderId; - } - - /** - * Sets the value of orderId. - * @param mixed $orderId the order id - * @return void - */ - public function setOrderId($orderId) - { - $this->orderId = $orderId; - } - - /** - * Gets the value of description. - * @return mixed - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the value of description. - * @param mixed $description the description - * @return void - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * Gets the value of country. - * @return mixed - */ - public function getCountry() - { - return $this->country; - } - - /** - * Sets the value of country. - * @param mixed $country the country - * @return void - */ - public function setCountry($country) - { - $this->country = $country; - } - - /** - * Gets the value of paymentMethod. - * @return mixed - */ - public function getPaymentMethod() - { - return $this->paymentMethod; - } - - /** - * Sets the value of paymentMethod. - * @param mixed $paymentMethod the payment method - * @return void - */ - public function setPaymentMethod($paymentMethod) - { - $this->paymentMethod = $paymentMethod; - } - - /** - * Gets the value of paymentInstrument. - * @return PaymentInstrumentInterface - */ - public function getPaymentInstrument() - { - return $this->paymentInstrument; - } - - /** - * Sets the value of paymentInstrument. - * @param PaymentInstrumentInterface $paymentInstrument the payment instrument - * @return void - */ - public function setPaymentInstrument(PaymentInstrumentInterface $paymentInstrument) - { - $this->paymentInstrument = $paymentInstrument; - } - - /** - * @deprecated method is deprecated and shouldn't be used. - * Gets the value of authorizeData. - * @return mixed - */ - public function getAuthorizeData() - { - return $this->authorizeData; - } - - /** - * @deprecated method is deprecated and shouldn't be used. - * Sets the value of authorizeData. - * @param mixed $authorizeData the authorize data - * @return void - */ - public function setAuthorizeData($authorizeData) - { - $this->authorizeData = $authorizeData; - } - - /** - * Gets the value of authorizationInformation. - * @return AuthorizationInformation - */ - public function getAuthorizationInformation() - { - return $this->authorizationInformation; - } - - /** - * Sets the value of authorizationInformation. - * @param AuthorizationInformation $authorizationInformation the authorization information - * @return void - */ - public function setAuthorizationInformation(AuthorizationInformation $authorizationInformation) - { - $this->authorizationInformation = $authorizationInformation; - } - - /** - * @return ThreeDS2AuthorizationInformation - */ - public function getThreeds2Data() - { - return $this->threeDS2AuthorizationInformation; - } - - /** - * @param ThreeDS2AuthorizationInformation - * @return VOID - */ - public function setThreeds2Data( - ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation - ){ - $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation; - } - - /** - * Gets the value of statementDescriptorSuffix. - * @return mixed - */ - public function getStatementDescriptorSuffix() - { - return $this->statementDescriptorSuffix; - } - - /** - * Sets the value of statementDescriptorSuffix. - * @param mixed $statementDescriptorSuffix the description included in statement - * @return void - */ - public function setStatementDescriptorSuffix($statementDescriptorSuffix) - { - $this->statementDescriptorSuffix = $statementDescriptorSuffix; - } - - - /** - * @return BOOL is it 3D secure v1? - */ - public function isThreedsV1() : bool - { - return $this->authorizationInformation != null; - } - - /** - * @return BOOL is it 3D secure v2? - */ - public function isThreedsV2() : bool - { - return $this->threeDS2AuthorizationInformation != null; - } - - /** - * Check if payment is pending - * @return boolean - */ - public function isPending() - { - return $this->getStatus() === 'pending'; - } - - /** - * Check if payment is approved - * @return boolean - */ - public function isApproved() - { - return $this->getStatus() === 'approved'; - } - - /** - * Check if payment is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php deleted file mode 100644 index 35691823cda..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php +++ /dev/null @@ -1,121 +0,0 @@ -cardBrand; - } - - /** - * Sets the value of cardBrand. - * @param mixed $cardBrand the card brand - * @return void - */ - public function setCardBrand($cardBrand) - { - $this->cardBrand = $cardBrand; - } - - /** - * Gets the value of pan. - * @return mixed - */ - public function getPan() - { - return $this->pan; - } - - /** - * Sets the value of pan. - * @param mixed $pan the pan - * @return void - */ - public function setPan($pan) - { - $this->pan = $pan; - } - - /** - * Gets the value of expYear. - * @return mixed - */ - public function getExpYear() - { - return $this->expYear; - } - - /** - * Sets the value of expYear. - * @param mixed $expYear the exp year - * @return void - */ - public function setExpYear($expYear) - { - $this->expYear = $expYear; - } - - /** - * Gets the value of expMonth. - * @return mixed - */ - public function getExpMonth() - { - return $this->expMonth; - } - - /** - * Sets the value of expMonth. - * @param mixed $expMonth the exp month - * @return void - */ - public function setExpMonth($expMonth) - { - $this->expMonth = $expMonth; - } - - /** - * Gets the value of holder. - * @return mixed - */ - public function getHolder() - { - return $this->holder; - } - - /** - * Sets the value of holder. - * @param mixed $holder the holder - * @return void - */ - public function setHolder($holder) - { - $this->holder = $holder; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php deleted file mode 100644 index b844435dafe..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -paymentId; - } - - /** - * Sets the value of paymentId. - * @param mixed $paymentId the payment id - * @return void - */ - public function setPaymentId($paymentId) - { - $this->paymentId = $paymentId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php deleted file mode 100644 index 1511bff380f..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php +++ /dev/null @@ -1,58 +0,0 @@ -acsUrl; - } - - - /** - * @param STRING - * @return VOID - */ - public function setAcsUrl(string $acsUrl) : void - { - $this->acsUrl = $acsUrl; - } - - - /** - * @return STRING - */ - public function getCReq() - { - return $this->cReq; - } - - - /** - * @param STRING - * @return VOID - */ - public function setCReq(string $cReq) : void - { - $this->cReq = $cReq; - } - - public function getErrors() - { - - } -} \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php deleted file mode 100644 index e5d3d42b44a..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php +++ /dev/null @@ -1,64 +0,0 @@ -paymentId = $paymentId; - $this->amount = $amount; - $this->description = $description; - } - - public function getAction() - { - return sprintf('payments/%s/refunds', $this->paymentId); - } - - public function getMethod() - { - return MethodInterface::POST; - } - - public function getAttributes() - { - $return = [ - 'amount' => $this->amount, - ]; - - if ($this->description !== null) { - $return['description'] = $this->description; - } - - return $return; - } - - public function createResultObject() - { - return new Refund(); - } - - public function getValidationConstraints() - { - return new Assert\Collection([ - 'amount' => new Assert\Required([ - new Assert\NotBlank(), - new Assert\Type(['type' => 'float']) - ]), - 'description' => new Assert\Optional([ - new Assert\Type(['type' => 'string']), - new Assert\Length([ - 'max' => 255 - ]), - ]), - ]); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php deleted file mode 100644 index eda5e22c8b0..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php +++ /dev/null @@ -1,57 +0,0 @@ -paymentId = $paymentId; - $this->refundId = $refundId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/refunds/%s', - $this->getPaymentId(), - $this->getRefundId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new Refund(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } - - public function getRefundId() - { - return $this->refundId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php deleted file mode 100644 index 1936fce7d24..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php +++ /dev/null @@ -1,50 +0,0 @@ -paymentId = $paymentId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/refunds', - $this->getPaymentId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new Refund(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php deleted file mode 100644 index 50a14b3e663..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php +++ /dev/null @@ -1,286 +0,0 @@ -id; - } - - /** - * Sets the value of id. - * @param mixed $id the id - * @return void - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * Gets the value of amount. - * @return mixed - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Sets the value of amount. - * @param mixed $amount the amount - * @return void - */ - public function setAmount($amount) - { - $this->amount = $amount; - } - - /** - * Gets the value of currency. - * @return mixed - */ - public function getCurrency() - { - return $this->currency; - } - - /** - * Sets the value of currency. - * @param mixed $currency the currency - * @return void - */ - public function setCurrency($currency) - { - $this->currency = $currency; - } - - /** - * Gets the value of type. - * @return mixed - */ - public function getType() - { - return $this->type; - } - - /** - * Sets the value of type. - * @param mixed $type the type - * @return void - */ - public function setType($type) - { - $this->type = $type; - } - - /** - * Gets the value of created. - * @return mixed - */ - public function getCreated() - { - return $this->created; - } - - /** - * Sets the value of created. - * @param mixed $created the created - * @return void - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Gets the value of live. - * @return mixed - */ - public function getLive() - { - return $this->live; - } - - /** - * Sets the value of live. - * @param mixed $live the live - * @return void - */ - public function setLive($live) - { - $this->live = $live; - } - - /** - * Gets the value of parentId. - * @return mixed - */ - public function getParentId() - { - return $this->parentId; - } - - /** - * Sets the value of parentId. - * @param mixed $parentId the parent id - * @return void - */ - public function setParentId($parentId) - { - $this->parentId = $parentId; - } - - /** - * Gets the value of status. - * @return mixed - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets the value of status. - * @param mixed $status the status - * @return void - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * Gets the value of error. - * @return mixed - */ - public function getError() - { - return $this->error; - } - - /** - * Sets the value of error. - * @param mixed $error the error - * @return void - */ - public function setError($error) - { - $this->error = $error; - } - - /** - * Gets the value of orderId. - * @return mixed - */ - public function getOrderId() - { - return $this->orderId; - } - - /** - * Sets the value of orderId. - * @param mixed $orderId the order id - * @return void - */ - public function setOrderId($orderId) - { - $this->orderId = $orderId; - } - - /** - * Gets the value of description. - * @return mixed - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the value of description. - * @param mixed $description the description - * @return void - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * Check if refund is approved - * @return boolean - */ - public function isApproved() - { - return $this->getStatus() === 'approved'; - } - - /** - * Check if refund is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php deleted file mode 100644 index eb479c9e1ae..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php +++ /dev/null @@ -1,160 +0,0 @@ - 'status', - 'message' => $this->getError() - ] - ]; - } - - /** - * Return single error - */ - public function getError() - { - return ''; - } - - /** - * Serializes result object to json object - * @param boolean $toJson encode result to json - * @return array|object - */ - public function serialize($toJson = true) - { - $data = []; - - $getters = $this->classGetters(get_class($this)); - foreach ($getters as $method) { - $property = $this->propertyName($method); - $value = $this->$method(); - - if (is_float($value)) { - $value = sprintf("%01.2f", $value); - } elseif (is_object($value)) { - $value = $value->serialize(false); - } - - if ($value !== null) { - $data[$property] = $value; - } - } - - if ($toJson === true) { - return json_encode($data); - } - - return $data; - } - - /** - * Loads result object values from json object - * @param string $string json - * @return void - */ - public function unserialize($string) - { - $data = json_decode($string); - foreach ($data as $property => $value) { - $method = $this->setterName($property); - - if (is_numeric($value) && strstr($value, '.')) { - $value = floatval($value); - } elseif (is_object($value)) { - if ($property == 'authorization_information') { - $object = new AuthorizationInformation(); - $object->unserialize(json_encode($value)); - $value = $object; - } elseif ($property == 'threeds2_data') { - $object = new ThreeDS2AuthorizationInformation(); - $object->unserialize(json_encode($value)); - $value = $object; - } elseif ($property == 'payment_instrument') { - if (!isset($data->payment_method)) { - throw new Exception\Runtime('Property "payment_method" is missing'); - } - - switch ($data->payment_method) { - case Payment\Create::CARD: - $object = new PaymentInstrumentCard(); - break; - case Payment\Create::RECURRING: - $object = new PaymentInstrumentRecurring(); - break; - default: - $object = new PaymentInstrumentCard(); - break; - } - $object->unserialize(json_encode($value)); - $value = $object; - } - } - - $this->$method($value); - } - } - - /** - * @param string $class - * @return array - */ - private function classGetters($class) - { - $methods = get_class_methods($class); - return array_filter($methods, function ($value) use ($methods) { - if ($value == 'getErrors') { - return false; - } - - // no setter means it's inherited property, should be ignored - $setter = $this->setterName($this->propertyName($value)); - if (!in_array($setter, $methods)) { - return false; - } - - return substr($value, 0, 3) == 'get'; - }); - } - - /** - * @param string $method - * @return string - */ - private function propertyName($method) - { - $method = lcfirst(substr($method, 3)); - $method = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $method)); - - return $method; - } - - /** - * @param string $property - * @return string - */ - private function setterName($property) - { - $parts = explode('_', $property); - $parts = array_map('ucfirst', $parts); - $property = implode('', $parts); - - return 'set' . ucfirst($property); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php deleted file mode 100644 index 9b7890d5562..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php +++ /dev/null @@ -1,15 +0,0 @@ -map($item, $method->createResultObject()); - } - - return $return; - } - - /** - * Map response data to instance of ResultObjectInterface - * @param array $response - * @param ResultObjectInterface $result - * - * @return ResultObjectInterface - */ - public function map(array $response, ResultObjectInterface $result) - { - foreach ($response as $field => $value) { - $method = $this->getSetterName($field); - - if (!method_exists($result, $method)) { - continue; - } - - if ($field == 'payment_instrument') { - $value = $this->transformPaymentInstrumentValue($value, $response['payment_method']); - } elseif ($field == 'authorization_information') { - $value = $this->transformAuthorizationInformationValue($value); - } elseif ($field == 'threeds2_data') { - $value = $this->transformThreeDS2DataValue($value); - } - - $result->$method($value); - } - - return $result; - } - - /** - * Extracts camelCased setter name from underscore notation. - * Eg. my_field_name => myFieldName - * @param string $field - * @return string - */ - private function getSetterName($field) - { - $parts = explode('_', $field); - array_map('ucfirst', $parts); - $name = 'set' . implode('', $parts); - - return $name; - } - - /** - * Transform PaymentInstrument result array to object - * @param array $data - * @param string $method - * @return PaymentInstrumentCard|PaymentInstrumentRecurring - * @throws Exception\Runtime for unsupported methods - */ - private function transformPaymentInstrumentValue(array $data, $method) - { - if ($method == 'card') { - $instrument = new PaymentInstrumentCard(); - } elseif ($method == 'recurring') { - $instrument = new PaymentInstrumentRecurring(); - } else { - throw new Exception\Runtime(sprintf('Method "%s" is not supported', $method)); - } - - $this->map($data, $instrument); - - return $instrument; - } - - /** - * Transform AuthorizationInformation result array to object - * @param array $data - * @return AuthorizationInformation - */ - private function transformAuthorizationInformationValue($data) - { - $info = new AuthorizationInformation(); - $this->map($data, $info); - - return $info; - } - - /** - * @param ARRAY $data - * @return ThreeDS2AuthorizationInformation - */ - private function transformThreeDS2DataValue($data) - { - $threeds2 = new ThreeDS2AuthorizationInformation(); - $this->map($data, $threeds2); - return $threeds2; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php deleted file mode 100644 index f7d9b3c78ee..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -paymentId = $paymentId; - $this->amount = $amount; - $this->description = $description; - } - - public function getAction() - { - return sprintf('payments/%s/settlements', $this->paymentId); - } - - public function getMethod() - { - return MethodInterface::POST; - } - - public function getAttributes() - { - $return = [ - 'amount' => $this->amount, - ]; - - if ($this->description !== null) { - $return['description'] = $this->description; - } - - return $return; - } - - public function createResultObject() - { - return new Settlement(); - } - - public function getValidationConstraints() - { - return new Assert\Collection([ - 'amount' => new Assert\Required([ - new Assert\NotBlank(), - new Assert\Type(['type' => 'float']) - ]), - 'description' => new Assert\Optional([ - new Assert\Type(['type' => 'string']), - new Assert\Length([ - 'max' => 255 - ]), - ]), - ]); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php deleted file mode 100644 index 9d14e3a7263..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php +++ /dev/null @@ -1,57 +0,0 @@ -paymentId = $paymentId; - $this->settlementId = $settlementId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/settlements/%s', - $this->getPaymentId(), - $this->getSettlementId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new Settlement(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } - - public function getSettlementId() - { - return $this->settlementId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php deleted file mode 100644 index 937fe0de032..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php +++ /dev/null @@ -1,50 +0,0 @@ -paymentId = $paymentId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/settlements', - $this->getPaymentId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new Settlement(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php deleted file mode 100644 index 8443b9f26cc..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php +++ /dev/null @@ -1,286 +0,0 @@ -id; - } - - /** - * Sets the value of id. - * @param mixed $id the id - * @return void - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * Gets the value of amount. - * @return mixed - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Sets the value of amount. - * @param mixed $amount the amount - * @return void - */ - public function setAmount($amount) - { - $this->amount = $amount; - } - - /** - * Gets the value of currency. - * @return mixed - */ - public function getCurrency() - { - return $this->currency; - } - - /** - * Sets the value of currency. - * @param mixed $currency the currency - * @return void - */ - public function setCurrency($currency) - { - $this->currency = $currency; - } - - /** - * Gets the value of type. - * @return mixed - */ - public function getType() - { - return $this->type; - } - - /** - * Sets the value of type. - * @param mixed $type the type - * @return void - */ - public function setType($type) - { - $this->type = $type; - } - - /** - * Gets the value of created. - * @return mixed - */ - public function getCreated() - { - return $this->created; - } - - /** - * Sets the value of created. - * @param mixed $created the created - * @return void - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Gets the value of live. - * @return mixed - */ - public function getLive() - { - return $this->live; - } - - /** - * Sets the value of live. - * @param mixed $live the live - * @return void - */ - public function setLive($live) - { - $this->live = $live; - } - - /** - * Gets the value of parentId. - * @return mixed - */ - public function getParentId() - { - return $this->parentId; - } - - /** - * Sets the value of parentId. - * @param mixed $parentId the parent id - * @return void - */ - public function setParentId($parentId) - { - $this->parentId = $parentId; - } - - /** - * Gets the value of status. - * @return mixed - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets the value of status. - * @param mixed $status the status - * @return void - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * Gets the value of error. - * @return mixed - */ - public function getError() - { - return $this->error; - } - - /** - * Sets the value of error. - * @param mixed $error the error - * @return void - */ - public function setError($error) - { - $this->error = $error; - } - - /** - * Gets the value of orderId. - * @return mixed - */ - public function getOrderId() - { - return $this->orderId; - } - - /** - * Sets the value of orderId. - * @param mixed $orderId the order id - * @return void - */ - public function setOrderId($orderId) - { - $this->orderId = $orderId; - } - - /** - * Gets the value of description. - * @return mixed - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the value of description. - * @param mixed $description the description - * @return void - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * Check if settlement is approved - * @return boolean - */ - public function isApproved() - { - return $this->getStatus() === 'approved'; - } - - /** - * Check if settlement is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php deleted file mode 100644 index 5a047382fc3..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php +++ /dev/null @@ -1,48 +0,0 @@ -validator = $validator; - } - - /** - * Validates given method values against its constraints - * - * @param MethodInterface $method - * @throws Exception\InvalidAttributeValue - */ - public function validate(MethodInterface $method) - { - $constraints = $method->getValidationConstraints(); - if (empty($constraints)) { - return; - } - - $violations = $this->validator->validate( - $method->getAttributes(), - $constraints - ); - - $countable = is_array($violations) || $violations instanceof \Countable; - - if ($countable && count($violations) !== 0) { - throw new Exception\InvalidAttributeValue( - 'Your method contains invalid attribute value', - $violations - ); - } - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php deleted file mode 100644 index b72aa1ba13d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -context->buildViolation($constraint->message) - ->setParameter('{{ param }}', $value) - ->addViolation(); - } - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php deleted file mode 100644 index a05654aa6fa..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php +++ /dev/null @@ -1,56 +0,0 @@ -paymentId = $paymentId; - $this->description = $description; - } - - public function getAction() - { - return sprintf('payments/%s/voids', $this->paymentId); - } - - public function getMethod() - { - return MethodInterface::POST; - } - - public function getAttributes() - { - $return = []; - - if ($this->description !== null) { - $return['description'] = $this->description; - } - - return $return; - } - - public function createResultObject() - { - return new VoidPayment(); - } - - public function getValidationConstraints() - { - return new Assert\Collection([ - 'description' => new Assert\Optional([ - new Assert\Type(['type' => 'string']), - new Assert\Length([ - 'max' => 255 - ]), - ]), - ]); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php deleted file mode 100644 index 75165619d24..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php +++ /dev/null @@ -1,57 +0,0 @@ -paymentId = $paymentId; - $this->voidId = $voidId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/voids/%s', - $this->getPaymentId(), - $this->getvoidId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new VoidPayment(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } - - public function getvoidId() - { - return $this->voidId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php deleted file mode 100644 index 01ca7c9a11e..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php +++ /dev/null @@ -1,50 +0,0 @@ -paymentId = $paymentId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/voids', - $this->getPaymentId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new VoidPayment(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php deleted file mode 100644 index 9fba8392ac3..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php +++ /dev/null @@ -1,239 +0,0 @@ -id; - } - - /** - * Sets the value of id. - * @param mixed $id the id - * @return void - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * Gets the value of type. - * @return mixed - */ - public function getType() - { - return $this->type; - } - - /** - * Sets the value of type. - * @param mixed $type the type - * @return void - */ - public function setType($type) - { - $this->type = $type; - } - - /** - * Gets the value of created. - * @return mixed - */ - public function getCreated() - { - return $this->created; - } - - /** - * Sets the value of created. - * @param mixed $created the created - * @return void - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Gets the value of live. - * @return mixed - */ - public function getLive() - { - return $this->live; - } - - /** - * Sets the value of live. - * @param mixed $live the live - * @return void - */ - public function setLive($live) - { - $this->live = $live; - } - - /** - * Gets the value of parentId. - * @return mixed - */ - public function getParentId() - { - return $this->parentId; - } - - /** - * Sets the value of parentId. - * @param mixed $parentId the parent id - * @return void - */ - public function setParentId($parentId) - { - $this->parentId = $parentId; - } - - /** - * Gets the value of status. - * @return mixed - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets the value of status. - * @param mixed $status the status - * @return void - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * Gets the value of error. - * @return mixed - */ - public function getError() - { - return $this->error; - } - - /** - * Sets the value of error. - * @param mixed $error the error - * @return void - */ - public function setError($error) - { - $this->error = $error; - } - - /** - * Gets the value of orderId. - * @return mixed - */ - public function getOrderId() - { - return $this->orderId; - } - - /** - * Sets the value of orderId. - * @param mixed $orderId the order id - * @return void - */ - public function setOrderId($orderId) - { - $this->orderId = $orderId; - } - - /** - * Gets the value of description. - * @return mixed - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the value of description. - * @param mixed $description the description - * @return void - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * Check if void is approved - * @return boolean - */ - public function isApproved() - { - return $this->getStatus() === 'approved'; - } - - /** - * Check if void is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php deleted file mode 100644 index c010b0d5cf1..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php +++ /dev/null @@ -1,85 +0,0 @@ -baseConfig = [ - 'consumerKey' => $_ENV['CONSUMER_KEY'], - 'consumerSecret' => $_ENV['CONSUMER_SECRET'], - ]; - $this->log = Client::LOG_NONE; - } - - /** - * Test create client with invalid URL - * - * @return void - */ - public function testInvalidURLEndpoint(){ - - $this->baseConfig['apiEndpoint'] = '123abc'; - try { - Client::create($this->baseConfig, $this->log); - } catch (\Exception $e) { - $this->assertStringContainsString('Your API endpoint is not a valid URL', $e->getMessage()); - } - } - - /** - * Test create client with valid URL, - * - * @return void - */ - public function testValidUrlWrongEndpoint(){ - - $this->baseConfig['apiEndpoint'] = 'https://example.com/'; - - try { - $client = Client::create($this->baseConfig, $this->log); - } catch (\Exception $e) { - $this->assertStringContainsString('error', $e->getMessage()); - } - $this->assertInstanceOf('Cardinity\Client', $client); - } - - /** - * Test create client with valid URL, - * - * @return void - */ - public function testValidURLValidEndpoint(){ - - $this->baseConfig['apiEndpoint'] = 'https://api.cardinity.com/v1/'; - $client = Client::create($this->baseConfig, $this->log); - $this->assertInstanceOf('Cardinity\Client', $client); - } - - /** - * Test create client with valid URL, - * - * @return void - */ - public function testNoEndpoint(){ - - unset($this->baseConfig['apiEndpoint']); - $client = Client::create($this->baseConfig, $this->log); - - $reflection = new \ReflectionObject($client); - $urlProperty = $reflection->getProperty('url'); - $urlProperty->setAccessible(true); - - $this->assertSame($urlProperty->getValue(),'https://api.cardinity.com/v1/'); - $this->assertInstanceOf('Cardinity\Client', $client); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php deleted file mode 100644 index ba7b7dc07a9..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php +++ /dev/null @@ -1,183 +0,0 @@ -payment3ds2Params = $this->get3ds2PaymentParams(); - parent::setUp(); - } - - /** - * @dataProvider localhostUrlValidationDataProvider - * @param string $address - * @param string $expectedMessage - * @return void - */ - public function testLocalhostUrlExeptionRised($address, $expectedMessage) - { - $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; - $method = new Payment\Create($this->payment3ds2Params); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function localhostUrlValidationDataProvider() - { - return [ - [ - 'http://localhost', - $this->getRestrictedHostnameErrorMsg('http://localhost'), - ],[ - 'https://localhost', - $this->getRestrictedHostnameErrorMsg('https://localhost'), - ],[ - 'http://127.0.0.1', - $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), - ],[ - 'https://127.0.0.1', - $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), - ] - ]; - } - - - /** - * @dataProvider protocolUrlValidationDataProvider - * @param string $address - * @param string $expectedMessage - * @return void - */ - public function testProtocolUrlExeptionRised($address, $expectedMessage) - { - $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; - $method = new Payment\Create($this->payment3ds2Params); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function protocolUrlValidationDataProvider() - { - return [ - [ - 'ftp://example.com', - 'The protocol of "ftp://example.com" should be "http" or "https".' - ],[ - 'htt://example.com', - 'The protocol of "htt://example.com" should be "http" or "https".' - ],[ - 'f://example.com', - 'The protocol of "f://example.com" should be "http" or "https".' - ] - ]; - } - - - /** - * @dataProvider localhostUrlNotStringDataProvider - * @return void - */ - public function testLocalhostUrlNotStringExeptionRised($address, $expectedMessage) - { - $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; - $method = new Payment\Create($this->payment3ds2Params); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function localhostUrlNotStringDataProvider() - { - return [ - [ - 123, - 'This value should be of type string.' - ],[ - null, - 'This value should not be blank.' - ], - ]; - } - - /** - * @dataProvider browserInfoIpAddressDataProvider - * @param array $address - * @param string $expectedMessage - * @return void - */ - public function testBrowserInfoIpAddressExeptionRised($address, $expectedMessage) - { - $paymentParams = $this->get3ds2PaymentParams($address); - $method = new Payment\Create($paymentParams); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function browserInfoIpAddressDataProvider() - { - return [ - [ - ['ip_address' => 123], - 'This value should be of type string.' - ],[ - ['ip_address' => ''], - 'This value should not be blank.' - ],[ - ['ip_address' => 'http://localhost'], - $this->getRestrictedHostnameErrorMsg('http://localhost'), - ],[ - ['ip_address' => 'https://localhost'], - $this->getRestrictedHostnameErrorMsg('https://localhost'), - ],[ - ['ip_address' => 'http://127.0.0.1'], - $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), - ],[ - ['ip_address' => 'https://127.0.0.1'], - $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), - ], - ]; - } - - /** - * @param string $address url or ip - * @return string - */ - private function getRestrictedHostnameErrorMsg(string $address) - { - return 'The url "' . $address . - '" contains restricted values. Do not use "localhost" or "127.0.0.1".'; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php deleted file mode 100644 index 1915cd264e7..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php +++ /dev/null @@ -1,160 +0,0 @@ -client = Client::create($this->getConfig(), $log); - - $this->assertInstanceOf('Cardinity\Client', $this->client); - } - - /** - * @return array - */ - protected function getConfig() - { - return [ - 'consumerKey' => $_ENV['CONSUMER_KEY'], - 'consumerSecret' => $_ENV['CONSUMER_SECRET'], - ]; - } - - /** - * @return array - */ - protected function getPaymentParams() - { - return [ - 'amount' => 50.00, - 'currency' => 'EUR', - 'settle' => false, - 'description' => 'some description', - 'order_id' => '12345678', - 'country' => 'LT', - 'payment_method' => Payment\Create::CARD, - 'payment_instrument' => [ - 'pan' => '4111111111111111', - 'exp_year' => date('Y') + 4, - 'exp_month' => 12, - 'cvc' => '456', - 'holder' => 'Mike Dough' - ], - ]; - } - - /** - * @param array optional - * @return array - */ - public function get3ds2PaymentParams($browserData = []) - { - return array_merge( - $this->getPaymentParams(), - [ - 'threeds2_data' => $this->getThreeDS2Data($browserData) - ] - ); - } - - /** - * @return Payment\Payment - */ - public function getPayment() - { - $payment = new Payment\Payment(); - $payment->setId('foo'); - $payment->setType('bar'); - $payment->setCurrency(null); - $payment->setAmount('55.00'); - $payment->setPaymentMethod(Payment\Create::CARD); - return $payment; - } - - /** - * @param array optional - * @return array - */ - public function getBrowserInfo($args = []) - { - $browserInfo = [ - 'accept_header' => 'Some header', - 'browser_language' => 'LT', - 'screen_width' => 390, - 'screen_height' => 400, - 'challenge_window_size' => '390x400', - 'user_agent' => 'super user agent', - 'color_depth' => 24, - 'time_zone' => -60, - ]; - if ($args) { - foreach($args as $key => $val) { - $browserInfo[$key] = $val; - } - } - return $browserInfo; - } - - /** - * @param array optional - * @return array - */ - public function getAddress($args = []) - { - $address = [ - 'address_line1' => 'first address line', - 'city' => 'balbieriskis', - 'country' => 'LT', - 'postal_code' => '0234' - ]; - if ($args && isset($args['address_line2'])) { - $address['address_line2'] = $args['address_line2']; - } - if ($args && isset($args['address_line3'])) { - $address['address_line3'] = $args['address_line3']; - } - if ($args && isset($args['state'])) { - $address['state'] = $args['state']; - } - return $address; - } - - /** - * @param array optional - * @return array - */ - public function getThreeDS2Data($browserData = []) - { - return [ - 'notification_url' => 'https://notification.url/', - 'browser_info' => $this->getBrowserInfo($browserData), - ]; - } - - /** - * @return Payment\PaymentInstrumentCard - */ - public function getCard() - { - $card = new Payment\PaymentInstrumentCard(); - $card->setCardBrand('Visa'); - $card->setPan('4447'); - $card->setExpYear(date('Y') + 4); - $card->setExpMonth(11); - $card->setHolder('James Bond'); - return $card; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php deleted file mode 100644 index 0fc0cc87b3d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php +++ /dev/null @@ -1,102 +0,0 @@ -getMockBuilder('Cardinity\Method\Payment\Get') - ->disableOriginalConstructor() - ->getMock() - ; - } - - /** - * @return void - */ - public function testErrorResultObjectForErrorResponse() - { - $method = $this->getPaymentMethodMock(); - $method->method('getAction')->willReturn('payments'); - $method->method('getAttributes')->willReturn([]); - $method->method('getMethod')->willReturn(Payment\Get::POST); - - try { - $this->client->call($method); - } catch (\Cardinity\Exception\ValidationFailed $e) { - $result = $e->getResult(); - $this->assertInstanceOf('Cardinity\Method\Error', $result); - $this->assertSame('https://developers.cardinity.com/api/v1/#400', $result->getType()); - $this->assertSame('Validation Failed', $result->getTitle()); - $this->assertStringContainsString('validation errors', $result->getDetail()); - $this->assertTrue(is_array($result->getErrors())); - $this->assertNotEmpty($result->getErrors()); - } - } - - /** - * @return void - */ - public function testUnauthorizedResponse() - { - $client = Client::create([ - 'consumerKey' => 'no', - 'consumerSecret' => 'yes', - ]); - $method = new Payment\Get('xxxyyy'); - $this->expectException(\Cardinity\Exception\Unauthorized::class); - - $client->call($method); - } - - /** - * @return void - */ - public function testBadRequest() - { - $method = $this->getPaymentMethodMock(); - $method->method('getAction')->willReturn('payments'); - $method->method('getAttributes')->willReturn([]); - $method->method('getMethod')->willReturn(Payment\Get::POST); - - $this->expectException(\Cardinity\Exception\ValidationFailed::class); - $this->client->call($method); - } - - /** - * @return void - */ - public function testNotFound() - { - $method = $this->getPaymentMethodMock(); - $method->method('getAction')->willReturn('my_dreamy_action'); - $method->method('getAttributes')->willReturn([]); - $method->method('getMethod')->willReturn(Payment\Get::POST); - - $this->expectException(\Cardinity\Exception\NotFound::class); - $this->client->call($method); - } - - /** - * @return void - */ - public function testMethodNotAllowed() - { - $method = $this->getPaymentMethodMock();; - $method->method('getAction')->willReturn('payments'); - $method->method('getAttributes')->willReturn([]); - $method->method('getMethod')->willReturn('DELETE'); - - $this->expectException(\Cardinity\Exception\MethodNotAllowed::class); - $this->client->call($method); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php deleted file mode 100644 index 70e825644f6..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php +++ /dev/null @@ -1,267 +0,0 @@ -paymentParams = $this->getPaymentParams(); - parent::setUp(); - } - - /** - * @return void - */ - public function testResultObjectSerialization() - { - $payment = $this->getPayment(); - - $card = $this->getCard(); - $payment->setPaymentInstrument($card); - - $info = new Payment\AuthorizationInformation(); - $info->setUrl('http://...'); - $info->setData('some_data'); - $payment->setAuthorizationInformation($info); - - $this->assertSame( - '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}', - $payment->serialize() - ); - } - - /** - * @return void - */ - public function testResultObjectUnserialization() - { - $json = '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; - - $payment = new Payment\Payment(); - $payment->unserialize($json); - - $this->assertSame('foo', $payment->getId()); - $this->assertSame('bar', $payment->getType()); - $this->assertSame(null, $payment->getCurrency()); - $this->assertSame(55.00, $payment->getAmount()); - $this->assertInstanceOf('Cardinity\Method\Payment\AuthorizationInformation', $payment->getAuthorizationInformation()); - $this->assertSame('http://...', $payment->getAuthorizationInformation()->getUrl()); - $this->assertInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard', $payment->getPaymentInstrument()); - $this->assertSame('James Bond', $payment->getPaymentInstrument()->getHolder()); - } - - /** - * @dataProvider invalidAmountValuesData - * @param mixed $amount - * @return void - */ - public function testAmountValidationConstraint($amount) - { - $this->paymentParams['amount'] = $amount; - $method = new Payment\Create($this->paymentParams); - - $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); - $this->client->call($method); - } - - /** - * @return array - */ - public function invalidAmountValuesData() - { - return [ - ['150.01'], - [150], - ]; - } - - /** - * @return void - */ - public function testMissingRequiredAttribute() - { - $params = $this->getPaymentParams(); - unset($params['currency']); - $method = new Payment\Create($params); - $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); - $this->client->call($method); - } - - /** - * Invalid data. Check error message. - * @return void - */ - public function testCreateFailPanValidation() - { - $this->paymentParams['payment_instrument']['pan'] = '4242424242424241'; - $method = new Payment\Create($this->paymentParams); - $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); - $this->client->call($method); - } - - /** - * Invalid data. Generic handling. - * @return void - */ - public function testCreateFailMonthValidation() - { - $this->paymentParams['payment_instrument']['exp_month'] = 13; - $method = new Payment\Create($this->paymentParams); - $this->expectException(\Cardinity\Exception\ValidationFailed::class); - $this->client->call($method); - } - - /** - * @return ResultObject - */ - public function testCreate() - { - $method = new Payment\Create($this->paymentParams); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); - $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); - - return $result; - } - - /** - * @depends testCreate - * @param Payment\Payment - * @return ResultObject - */ - public function testCreateRecurring(Payment\Payment $payment) - { - $params = $this->getPaymentParams(); - $params['payment_method'] = Payment\Create::RECURRING; - $params['payment_instrument'] = [ - 'payment_id' => $payment->getId() - ]; - - $method = new Payment\Create($params); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); - $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); - - return $result; - } - - /** - * @depends testCreate - * @param Payment\Payment - * @return void - */ - public function testGet(Payment\Payment $payment) - { - $method = new Payment\Get($payment->getId()); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); - $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); - } - - /** - * @return void - */ - public function testGetAll() - { - $method = new Payment\GetAll(5); - $result = $this->client->call($method); - - $this->assertCount(5, $result); - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result[0]); - } - - /** - * @return ResultObject - */ - public function testCreate3dFail() - { - $this->paymentParams['description'] = '3d-fail'; - - $method = new Payment\Create($this->paymentParams); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); - $this->assertSame('pending', $result->getStatus()); - $this->assertSame(true, $result->isPending()); - $this->assertSame('3d-fail', $result->getAuthorizationInformation()->getData()); - - return $result; - } - - /** - * @depends testCreate3dFail - * @param Payment\Payment - */ - public function testFinalizePaymentFail(Payment\Payment $payment) - { - $paymentId = $payment->getId(); - $authorizationInformation = $payment->getAuthorizationInformation()->getData(); - - try { - $method = new Payment\Finalize($paymentId, $authorizationInformation); - $this->client->call($method); - } catch (\Cardinity\Exception\Declined $e) { - $result = $e->getResult(); - - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); - $this->assertSame('declined', $result->getStatus()); - $this->assertSame(true, $result->isDeclined()); - $this->assertStringContainsString('status: 33333: 3D Secure Authorization Failed.;', $e->getErrorsAsString()); - - return; - } - - $this->fail('An expected exception has not been raised.'); - } - - /** - * @return ResultObject - */ - public function testCreate3dPass() - { - $params = $this->getPaymentParams(); - $params['description'] = '3d-pass'; - - $method = new Payment\Create($params); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); - $this->assertSame('pending', $result->getStatus()); - $this->assertSame(true, $result->isPending()); - $this->assertSame('3d-pass', $result->getAuthorizationInformation()->getData()); - - return $result; - } - - /** - * @depends testCreate3dPass - * @param Payment\Payment - * @return void - */ - public function testFinalizePaymentPass(Payment\Payment $payment) - { - $paymentId = $payment->getId(); - $authorizationInformation = $payment->getAuthorizationInformation()->getData(); - - $method = new Payment\Finalize($paymentId, $authorizationInformation); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); - $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php deleted file mode 100644 index 411c7cba8d8..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php +++ /dev/null @@ -1,130 +0,0 @@ -setId('foo'); - $refund->setType('bar'); - $refund->setCurrency(null); - $refund->setAmount('55.00'); - - $this->assertSame( - '{"id":"foo","amount":"55.00","type":"bar"}', - $refund->serialize() - ); - } - - /** - * @return void - */ - public function testResultObjectUnserialization() - { - $json = '{"id":"foo","amount":"55.00","type":"bar"}'; - - $payment = new Refund\Refund(); - $payment->unserialize($json); - - $this->assertSame('foo', $payment->getId()); - $this->assertSame('bar', $payment->getType()); - $this->assertSame(null, $payment->getCurrency()); - $this->assertSame(55.00, $payment->getAmount()); - } - - /** - * @return Cardinity\Method\ResultObject $result - */ - public function testCreatePayment() - { - $params = $this->getPaymentParams(); - $params['settle'] = true; - - $method = new Payment\Create($params); - $payment = $this->client->call($method); - - return $payment; - } - - /** - * @depends testCreatePayment - * @param Payment\Payment - * @return void - */ - public function testCreateFail(Payment\Payment $payment) - { - $method = new Refund\Create( - $payment->getId(), - 10.00, - 'fail' - ); - $this->expectException(\Cardinity\Exception\Declined::class); - $this->client->call($method); - } - - /** - * @depends testCreatePayment - * @param Payment\Payment - * @return Cardinity\Method\ResultObject $result - */ - public function testCreate(Payment\Payment $payment) - { - $method = new Refund\Create( - $payment->getId(), - 10.00, - 'my description' - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result); - $this->assertSame('10.00', $result->getAmount()); - $this->assertSame(true, $result->isApproved()); - - return $result; - } - - /** - * @depends testCreate - * @param Refund\Refund - * @return void - */ - public function testGet(Refund\Refund $refund) - { - $method = new Refund\Get( - $refund->getParentId(), - $refund->getId() - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result); - $this->assertSame($refund->getParentId(), $result->getParentId()); - $this->assertSame('refund', $result->getType()); - $this->assertSame('10.00', $result->getAmount()); - $this->assertSame('my description', $result->getDescription()); - } - - /** - * @depends testCreate - * @param Refund\Refund - * @return void - */ - public function testGetAll(Refund\Refund $refund) - { - $method = new Refund\GetAll( - $refund->getParentId() - ); - $result = $this->client->call($method); - - $this->assertIsArray($result); - $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result[0]); - $this->assertSame($refund->getParentId(), $result[0]->getParentId()); - $this->assertSame($refund->getId(), $result[0]->getId()); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php deleted file mode 100644 index 3151248c965..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php +++ /dev/null @@ -1,127 +0,0 @@ -setId('foo'); - $refund->setType('bar'); - $refund->setCurrency(null); - $refund->setAmount('55.00'); - - $this->assertSame( - '{"id":"foo","amount":"55.00","type":"bar"}', - $refund->serialize() - ); - } - - /** - * @return void - */ - public function testResultObjectUnserialization() - { - $json = '{"id":"foo","amount":"55.00","type":"bar"}'; - - $payment = new Settlement\Settlement(); - $payment->unserialize($json); - - $this->assertSame('foo', $payment->getId()); - $this->assertSame('bar', $payment->getType()); - $this->assertSame(null, $payment->getCurrency()); - $this->assertSame(55.00, $payment->getAmount()); - } - - /** - * @return Cardinity\Method\ResultObject $payment - */ - public function testCreatePayment() - { - $method = new Payment\Create($this->getPaymentParams()); - $payment = $this->client->call($method); - - return $payment; - } - - /** - * @depends testCreatePayment - * @param Payment\Payment $payment - * @return void - */ - public function testCreateFail(Payment\Payment $payment) - { - $method = new Settlement\Create( - $payment->getId(), - 10.00, - 'fail' - ); - $this->expectException(\Cardinity\Exception\Declined::class); - $this->client->call($method); - } - - /** - * @depends testCreatePayment - * @param Payment\Payment $payment - * @return Cardinity\Method\ResultObject $result - */ - public function testCreate(Payment\Payment $payment) - { - $method = new Settlement\Create( - $payment->getId(), - 10.00, - 'my description' - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); - $this->assertSame('10.00', $result->getAmount()); - $this->assertSame(true, $result->isApproved()); - - return $result; - } - - /** - * @depends testCreate - * @param Settlement\Settlement $settlement - * @return void - */ - public function testGet(Settlement\Settlement $settlement) - { - $method = new Settlement\Get( - $settlement->getParentId(), - $settlement->getId() - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); - $this->assertSame($settlement->getParentId(), $result->getParentId()); - $this->assertSame('10.00', $result->getAmount()); - $this->assertSame('settlement', $result->getType()); - $this->assertSame('my description', $result->getDescription()); - } - - /** - * @depends testCreate - * @param Settlement\Settlement $settlement - * @return void - */ - public function testGetAll(Settlement\Settlement $settlement) - { - $method = new Settlement\GetAll( - $settlement->getParentId() - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result[0]); - $this->assertSame($settlement->getId(), $result[0]->getId()); - $this->assertSame($settlement->getParentId(), $result[0]->getParentId()); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php deleted file mode 100644 index 48503a6ef01..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php +++ /dev/null @@ -1,55 +0,0 @@ -getThreeDS2Data(); - - $method = new Payment\Create([ - 'amount' => 59.01, - 'currency' => 'EUR', - 'settle' => true, - 'description' => '3ds2-Testing-for-pass', - 'order_id' => 'orderid123', - 'country' => 'LT', - 'payment_method' => Payment\Create::CARD, - 'payment_instrument' => [ - 'pan' => '5454545454545454', - 'exp_year' => date('Y') + 4, - 'exp_month' => 12, - 'cvc' => '456', - 'holder' => 'Shb Mike Dough' - ], - 'threeds2_data' => $threeDS2Data - ]); - - try { - $payment = $this->client->call($method); - $this->assertEquals('pending', $payment->getStatus()); - } catch (Exception\Declined $exception) { - $payment = $exception->getResult(); - $status = $payment->getStatus(); - $errors = $exception->getErrors(); - } catch (Exception\ValidationFailed $exception) { - $payment = $exception->getResult(); - $status = $payment->getStatus(); - $errors = $exception->getErrors(); - } catch (Cardinity\Exception\InvalidAttributeValue $exception) { - $errors = $exception->getErrors(); - } - if (isset($errors)) { - $this->assertContains('[threeds2_data][notification_url]',$errors); - } - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php deleted file mode 100644 index 0fc72ad56c3..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php +++ /dev/null @@ -1,121 +0,0 @@ -setId('foo'); - $refund->setType('bar'); - $refund->setCreated(null); - - $this->assertSame( - '{"id":"foo","type":"bar"}', - $refund->serialize() - ); - } - - /** - * @return void - */ - public function testResultObjectUnserialization() - { - $json = '{"id":"foo","type":"bar"}'; - - $payment = new VoidPayment\VoidPayment(); - $payment->unserialize($json); - - $this->assertSame('foo', $payment->getId()); - $this->assertSame('bar', $payment->getType()); - $this->assertSame(null, $payment->getDescription()); - } - - /** - * @return Cardinity\Method\ResultObject $payment - */ - public function testCreatePayment() - { - $method = new Payment\Create($this->getPaymentParams()); - $payment = $this->client->call($method); - - return $payment; - } - - /** - * @depends testCreatePayment - * @param Payment\Payment $payment - * @return void - */ - public function testCreateFail(Payment\Payment $payment) - { - $method = new VoidPayment\Create( - $payment->getId(), - 'fail' - ); - $this->expectException(\Cardinity\Exception\Declined::class); - $this->client->call($method); - } - - /** - * @depends testCreatePayment - * @param Payment\Payment $payment - * @return Cardinity\Method\ResultObject $result - */ - public function testCreate(Payment\Payment $payment) - { - $method = new VoidPayment\Create( - $payment->getId(), - 'my description' - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); - $this->assertSame(true, $result->isApproved()); - - return $result; - } - - /** - * @depends testCreate - * @param VoidPayment\VoidPayment $void - * @return void - */ - public function testGet(VoidPayment\VoidPayment $void) - { - $method = new VoidPayment\Get( - $void->getParentId(), - $void->getId() - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); - $this->assertSame($void->getParentId(), $result->getParentId()); - $this->assertSame('void', $result->getType()); - $this->assertSame('my description', $result->getDescription()); - } - - /** - * @depends testCreate - * @param VoidPayment\VoidPayment $void - * @return void - */ - public function testGetAll(VoidPayment\VoidPayment $void) - { - $method = new VoidPayment\GetAll( - $void->getParentId() - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result[0]); - $this->assertSame($void->getParentId(), $result[0]->getParentId()); - $this->assertSame($void->getId(), $result[0]->getId()); - } -} From cc662a9d6383788799b902dfbf4d28867d829d29 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:10:24 +0000 Subject: [PATCH 12/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/composer/autoload_files.php | 4 ++-- upload/system/storage/vendor/composer/autoload_static.php | 4 ++-- upload/system/storage/vendor/composer/installed.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/upload/system/storage/vendor/composer/autoload_files.php b/upload/system/storage/vendor/composer/autoload_files.php index 8573fced910..f5d17e462a7 100644 --- a/upload/system/storage/vendor/composer/autoload_files.php +++ b/upload/system/storage/vendor/composer/autoload_files.php @@ -6,12 +6,12 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index 5ab01e592c1..507e5f5b5ae 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -7,12 +7,12 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 { public static $files = array ( - '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 13e9abac64e..8afeb9502f6 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '0f1ae34401cd056b86b2df949e1abcad66bc2a4a', + 'reference' => '6e71e465ce947d5d6b5bede75f26a5ccf0c87a0f', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '0f1ae34401cd056b86b2df949e1abcad66bc2a4a', + 'reference' => '6e71e465ce947d5d6b5bede75f26a5ccf0c87a0f', 'dev_requirement' => false, ), 'psr/http-message' => array( From 2dc57c04167832cc898a55f9f81753c89147ed76 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:11:11 +0000 Subject: [PATCH 13/39] Support for PHP 8.0 and 8.1 --- .../cardinity/cardinity-sdk-php/.editorconfig | 15 + .../.github/workflows/php.yml | 39 ++ .../cardinity/cardinity-sdk-php/.gitignore | 12 + .../cardinity/cardinity-sdk-php/.travis.yml | 14 + .../cardinity/cardinity-sdk-php/CHANGELOG.md | 83 +++ .../cardinity/cardinity-sdk-php/LICENSE | 21 + .../cardinity/cardinity-sdk-php/README.md | 176 +++++++ .../cardinity/cardinity-sdk-php/composer.json | 33 ++ .../cardinity-sdk-php/docs/README.md | 394 +++++++++++++++ .../cardinity-sdk-php/phpspec.yml.dist | 4 + .../cardinity-sdk-php/phpunit.xml.dist | 33 ++ .../cardinity-sdk-php/spec/ClientSpec.php | 201 ++++++++ .../spec/Exception/DeclinedSpec.php | 27 + .../spec/Exception/ForbiddenSpec.php | 18 + .../Exception/InternalServerErrorSpec.php | 27 + .../Exception/InvalidAttributeValueSpec.php | 42 ++ .../spec/Exception/MethodNotAllowedSpec.php | 27 + .../spec/Exception/NotAcceptableSpec.php | 27 + .../spec/Exception/NotFoundSpec.php | 27 + .../spec/Exception/RequestSpec.php | 85 ++++ .../spec/Exception/RequestTimeoutSpec.php | 27 + .../spec/Exception/ServiceUnavailableSpec.php | 27 + .../spec/Exception/UnauthorizedSpec.php | 27 + .../spec/Exception/UnexpectedErrorSpec.php | 13 + .../spec/Exception/UnexpectedResponseSpec.php | 27 + .../spec/Exception/ValidationFailedSpec.php | 27 + .../spec/Http/Guzzle/ClientAdapterSpec.php | 84 +++ .../spec/Http/Guzzle/ExceptionMapperSpec.php | 100 ++++ .../spec/Method/ErrorSpec.php | 18 + .../Payment/AuthorizationInformationSpec.php | 13 + .../spec/Method/Payment/CreateSpec.php | 87 ++++ .../spec/Method/Payment/FinalizeSpec.php | 56 ++ .../spec/Method/Payment/GetAllSpec.php | 50 ++ .../spec/Method/Payment/GetSpec.php | 50 ++ .../Payment/PaymentInstrumentCardSpec.php | 13 + .../PaymentInstrumentRecurringSpec.php | 13 + .../spec/Method/Payment/PaymentSpec.php | 100 ++++ .../ThreeDS2AuthorizationInformationSpec.php | 41 ++ .../spec/Method/Refund/CreateSpec.php | 66 +++ .../spec/Method/Refund/GetAllSpec.php | 52 ++ .../spec/Method/Refund/GetSpec.php | 58 +++ .../spec/Method/Refund/RefundSpec.php | 18 + .../spec/Method/ResultObjectMapperSpec.php | 117 +++++ .../spec/Method/Settlement/CreateSpec.php | 66 +++ .../spec/Method/Settlement/GetAllSpec.php | 52 ++ .../spec/Method/Settlement/GetSpec.php | 58 +++ .../spec/Method/Settlement/SettlementSpec.php | 18 + .../spec/Method/ValidatorSpec.php | 64 +++ .../spec/Method/VoidPayment/CreateSpec.php | 62 +++ .../spec/Method/VoidPayment/GetAllSpec.php | 50 ++ .../spec/Method/VoidPayment/GetSpec.php | 58 +++ .../Method/VoidPayment/VoidPaymentSpec.php | 18 + .../cardinity-sdk-php/src/Client.php | 215 ++++++++ .../src/Exception/Declined.php | 9 + .../src/Exception/Forbidden.php | 9 + .../src/Exception/InternalServerError.php | 9 + .../src/Exception/InvalidAttributeValue.php | 24 + .../src/Exception/MethodNotAllowed.php | 9 + .../src/Exception/NotAcceptable.php | 9 + .../src/Exception/NotFound.php | 9 + .../src/Exception/Request.php | 63 +++ .../src/Exception/RequestTimeout.php | 9 + .../ResultObjectPropertyNotFound.php | 8 + .../src/Exception/Runtime.php | 8 + .../src/Exception/ServiceUnavailable.php | 10 + .../src/Exception/Unauthorized.php | 9 + .../src/Exception/UnexpectedError.php | 8 + .../src/Exception/UnexpectedResponse.php | 9 + .../src/Exception/ValidationFailed.php | 10 + .../src/Http/ClientInterface.php | 18 + .../src/Http/Guzzle/ClientAdapter.php | 58 +++ .../src/Http/Guzzle/ExceptionMapper.php | 93 ++++ .../cardinity-sdk-php/src/Method/Error.php | 116 +++++ .../src/Method/MethodInterface.php | 54 ++ .../MethodResultCollectionInterface.php | 11 + .../Payment/AuthorizationInformation.php | 56 ++ .../src/Method/Payment/Create.php | 226 +++++++++ .../src/Method/Payment/Finalize.php | 78 +++ .../src/Method/Payment/Get.php | 46 ++ .../src/Method/Payment/GetAll.php | 54 ++ .../src/Method/Payment/Payment.php | 478 ++++++++++++++++++ .../Method/Payment/PaymentInstrumentCard.php | 121 +++++ .../Payment/PaymentInstrumentInterface.php | 8 + .../Payment/PaymentInstrumentRecurring.php | 31 ++ .../ThreeDS2AuthorizationInformation.php | 58 +++ .../src/Method/Refund/Create.php | 64 +++ .../src/Method/Refund/Get.php | 57 +++ .../src/Method/Refund/GetAll.php | 50 ++ .../src/Method/Refund/Refund.php | 286 +++++++++++ .../src/Method/ResultObject.php | 160 ++++++ .../src/Method/ResultObjectInterface.php | 15 + .../src/Method/ResultObjectMapper.php | 121 +++++ .../Method/ResultObjectMapperInterface.php | 10 + .../src/Method/Settlement/Create.php | 64 +++ .../src/Method/Settlement/Get.php | 57 +++ .../src/Method/Settlement/GetAll.php | 50 ++ .../src/Method/Settlement/Settlement.php | 286 +++++++++++ .../src/Method/Validator.php | 48 ++ .../src/Method/ValidatorInterface.php | 19 + .../Validators/CallbackUrlConstraint.php | 17 + .../CallbackUrlConstraintValidator.php | 32 ++ .../src/Method/VoidPayment/Create.php | 56 ++ .../src/Method/VoidPayment/Get.php | 57 +++ .../src/Method/VoidPayment/GetAll.php | 50 ++ .../src/Method/VoidPayment/VoidPayment.php | 239 +++++++++ .../tests/ClientEndpointTest.php | 85 ++++ .../cardinity-sdk-php/tests/ClientTest.php | 183 +++++++ .../tests/ClientTestCase.php | 160 ++++++ .../cardinity-sdk-php/tests/ErrorTest.php | 102 ++++ .../cardinity-sdk-php/tests/PaymentTest.php | 267 ++++++++++ .../cardinity-sdk-php/tests/RefundTest.php | 130 +++++ .../tests/SettlementTest.php | 127 +++++ .../cardinity-sdk-php/tests/ThreeDS2Test.php | 55 ++ .../tests/VoidPaymentTest.php | 121 +++++ 114 files changed, 7736 insertions(+) create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Forbidden.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/InternalServerError.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/InvalidAttributeValue.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/NotAcceptable.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/NotFound.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Request.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ResultObjectPropertyNotFound.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Runtime.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ServiceUnavailable.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Unauthorized.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedError.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedResponse.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ValidationFailed.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/ClientInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ClientAdapter.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodResultCollectionInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/AuthorizationInformation.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentRecurring.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapper.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraint.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraintValidator.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig new file mode 100644 index 00000000000..9a9710a901b --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml new file mode 100644 index 00000000000..5e131c47002 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml @@ -0,0 +1,39 @@ +name: PHP Composer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + phpunit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + env: + CONSUMER_KEY: ${{secrets.CRD_KEY}} + CONSUMER_SECRET: ${{secrets.CRD_SECRET}} + run: composer run-script test diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore new file mode 100644 index 00000000000..ad78b24b878 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore @@ -0,0 +1,12 @@ +vendor/ +bin/ +build/ +specs/ +phpunit.xml +.phpunit.result.cache +phpspec.yml +tests/info.log +composer.lock +.idea/ +phpstan.neon +.phpunit.result.cache diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml new file mode 100644 index 00000000000..7751733d42d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml @@ -0,0 +1,14 @@ +language: php +dist: trusty + +php: + - 7.2 + - 7.3 + - 7.4 + +before_script: + - composer self-update + - composer update + +script: + - bin/phpspec run --format=pretty diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md new file mode 100644 index 00000000000..6e36d1fa831 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md @@ -0,0 +1,83 @@ +# Cardinity Client PHP Library + +## v3.0.3 + +### Added +- Added `Method\Validators\CallbackUrlConstraint` custom validation constraint class +- Added `Method\Validators\CallbackUrlConstraintValidator` custom constraint validation class +- Added `getInsideArray` method to `Method\Payment\Create` class +- Added `getNotificationUrlConstraints` method to `Method\Payment\Create` for `notification_url` parameter +- Added `getIpAddressConstraints` method to `Method\Payment\Create` for `ip_address` parameter. +- Added unit tests for new methods. +- Added `getStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. +- Added `setStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. + + +### Updated +- Updated `getThreeDS2DataConstraints` method of `Method\Payment\Create` class +- Updated `getBrowserInfoConstraints` method of `Method\Payment\Create` class. +- Updated `getValidationConstraints` method of `Method\Payment\Create` class + +## v3.0.2 + +### Changed + +- Changed `getThreeds2data` method to `getThreeds2Data` of class `Method\Payment\Payment` +- Changed `setThreeds2data` method to `setThreeds2Data` of class `Method\Payment\Payment` +- Changed `unserialize` method of `Method\ResultObject` class +- Changed `propertyName` method of `Method\ResultObject` class + + +## v3.0.1 + +### Fixed + +- Removed redundant comma in `Method\Payment\Create.php` line 84. + +## v3.0.0 + +### Added +- Added `threeDS2AuthorizationInformation` property to `Payment` class +- Added `getThreeds2data` method to `Payment` class +- Added `setThreeds2data` method to `Payment` class +- Added `isThreedsV1` method to `Payment` class +- Added `isThreedsV2` method to `Payment` class +- Added `getThreeDS2DataConstraints` method to `Create` class +- Added `getBrowserInfoConstraints` method to `Create` class +- Added `getAdressConstraints` method to `Create` class +- Added `getCardHolderInfoConstraints` method to `Create` class +- Added `buildElement` method to `Create` class +- Added `paymentId` property to `Finalize` class +- Added `finalizeKey` property to `Finalize` class +- Added `Method\Payment\ThreeDS2Data` parameters +- Added `Method\Payment\TreeDS2AthorizationInformation` class + +### Changed +- Updated `php` to version 7.2.x +- Updated `symfony/validator` to versin 5.x +- Updated `phpspec/phpspec` to version 6.2 +- Updated `phpunit/phpunit` to version 8.5 +- Updated `symfony/yaml` to version 4.4 +- Refactored `Create` class to build validation parameters using `buildElement` method +- Updated `getValidationConstraints` method of `Create` class +- Updated `getPaymentInstrumentConstraints` method of `Create` class +- Updated `__construct` method of `Finalize` class +- Updated `getAttributes` method of `Finalize` class +- Updated `getValidationConstraints` method of `Finalize` class + +## v2.1.0 + +### Added +- Added `isDeclined` method to `Payment` class +- Added `isApproved` and `isDeclined` methods to `Refund` class +- Added `isApproved` and `isDeclined` methods to `Settlement` class +- Added `isApproved` and `isDeclined` methods to `VoidPayment` class + +## v2.0.0 + +### Changed +- Renamed `Cardinity\Method\Void` to `Cardinity\Method\VoidPayment` +- Renamed `Void.php` to `VoidPayment.php` + +### Removed +- Removed `ResultObjectPropertyNotFound.php` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE new file mode 100644 index 00000000000..97bfca21cb6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Cardinity + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md new file mode 100644 index 00000000000..692fb347da4 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md @@ -0,0 +1,176 @@ + +Cardinity Client PHP Library +================================================ +[![Build Status](https://app.travis-ci.com/cardinity/cardinity-sdk-php.svg?branch=master)](https://app.travis-ci.com/cardinity/cardinity-sdk-php) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/?branch=master) + +This is official PHP client library for [Cardinity's](https://developers.cardinity.com/api/v1/) API. +Library includes all the functionality provided by API. Library was designed to be flexible and self-explanatory for developers to implement. + +## Documentation +More detailed documentation with usage examples can be found [here](https://github.com/cardinity/cardinity-sdk-php/tree/master/docs). + +## Usage +### Installing via [Composer](https://getcomposer.org) +```bash +$ php composer.phar require cardinity/cardinity-sdk-php +``` +### Direct Download +You can download the [latest release](https://github.com/cardinity/cardinity-sdk-php/releases/latest) file starting with ```cardinity-sdk-php-*.zip```. + +### Making API Calls +#### Initialize the client object +```php +use Cardinity\Client; +$client = Client::create([ + 'consumerKey' => 'YOUR_CONSUMER_KEY', + 'consumerSecret' => 'YOUR_CONSUMER_SECRET', +]); +``` + +#### Create new payment +```php +use Cardinity\Method\Payment; + +$method = new Payment\Create([ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => 2021, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], + 'threeds2_data' => [ + "notification_url" => "your_shop_url_for_handling_callback", + "browser_info" => [ + "accept_header" => "text/html", + "browser_language" => "en-US", + "screen_width" => 600, + "screen_height" => 400, + 'challenge_window_size' => "600x400", + "user_agent" => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0", + "color_depth" => 24, + "time_zone" => -60 + ], + ], +]); +``` +#### All the `threeds2_data` parameters should be set dynamically. +Parameters `screen_width`, `screen_height`, `browser_language`, `color_depth`, `time_zone` of `browser_info` could be collected dynamically using `javascript`: +```javascript +document.addEventListener("DOMContentLoaded", function() { + document.getElementById("screen_width").value = screen.availWidth; + document.getElementById("screen_height").value = screen.availHeight; + document.getElementById("browser_language").value = navigator.language; + document.getElementById("color_depth").value = screen.colorDepth; + document.getElementById("time_zone").value = new Date().getTimezoneOffset(); +}); +``` +and placed into a `html` form +```html + + + + + + + +``` +Then call to Cardinity API should be executed using `try ... catch` blocks: +```php +$errors = []; +try { + /** @type Cardinity\Method\Payment\Payment */ + $payment = $client->call($method); + $status = $payment->getStatus(); + if ($status == 'approved') { + echo '

    Your payment approved without 3D secure.

    '; + } elseif ($status == 'pending') { + if ($payment->isThreedsV2()) { + // $auth object for data required to finalize payment + $auth = $payment->getThreeds2Data(); + // finalize process should be done here. + }else if ($payment->isThreedsV1()) { + // $auth object for data required to finalize payment + $auth = $payment->getAuthorizationInformation(); + // finalize process should be done here. + } + } +} catch (Cardinity\Exception\InvalidAttributeValue $exception) { + foreach ($exception->getViolations() as $key => $violation) { + array_push($errors, $violation->getPropertyPath() . ' ' . $violation->getMessage()); + } +} catch (Cardinity\Exception\ValidationFailed $exception) { + foreach ($exception->getErrors() as $key => $error) { + array_push($errors, $error['message']); + } +} catch (Cardinity\Exception\Declined $exception) { + foreach ($exception->getErrors() as $key => $error) { + array_push($errors, $error['message']); + } +} catch (Cardinity\Exception\NotFound $exception) { + foreach ($exception->getErrors() as $key => $error) { + array_push($errors, $error['message']); + } +} catch (Exception $exception) { + $errors = [$exception->getMessage()]; +} +if ($errors) { + print_r($errors); +} +``` +#### Finalize payment +To finalize payment it should have status `pending`. Data received from 3D secure system should be used to create Finalize `$method`. +```php +use Cardinity\Method\Payment; + +$client = Client::create([ + 'consumerKey' => 'YOUR_CONSUMER_KEY', + 'consumerSecret' => 'YOUR_CONSUMER_SECRET', +]); + +if($v2){ + $method = new Payment\Finalize( + $payment->getId(), // payment object received from API call + $auth->getCreq(), // payment object received from API call + true // BOOL `true` to enable 3D secure V2 parameters + ); +}elseif($v1){ + $method = new Payment\Finalize( + $payment->getId(), // payment object received from API call + $auth->getData(), // payment object received from API call + false // BOOL `false` to enable 3D secure V1 parameters + ); +} + +// again use same try ... catch block +try { + $payment = $client->call($method); +} +// same catch blocks ... +// ... + +``` + +#### Get existing payment +```php +$method = new Payment\Get('cb5e1c95-7685-4499-a2b1-ae0f28297b92'); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +## API documentation +[https://developers.cardinity.com/api/v1/](https://developers.cardinity.com/api/v1/) + +## Development Status +All the API __v1__ methods are implemented. + +### Tests +for windows `php vendor/phpunit/phpunit/phpunit` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json new file mode 100644 index 00000000000..f131189a55e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json @@ -0,0 +1,33 @@ +{ + "name": "cardinity/cardinity-sdk-php", + "description": "Client library for Cardinity credit card processing API", + "type": "library", + "license": "MIT", + "homepage": "https://cardinity.com", + "require": { + "php" : ">=7.2.5", + "guzzlehttp/guzzle" : "^6.2.1", + "guzzlehttp/oauth-subscriber": "0.3.*", + "symfony/validator" : "^5.0.0" + }, + "require-dev": { + "monolog/monolog" : "~1.0", + "phpspec/phpspec" : "~6.2", + "phpunit/phpunit" : "^8.5", + "symfony/yaml" : "^4.4" + }, + "config": { + "bin-dir": "bin" + }, + "autoload": { + "psr-4": {"Cardinity\\": "src"} + }, + "autoload-dev": { + "psr-4": { + "Cardinity\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "phpunit" + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md new file mode 100644 index 00000000000..64884fb3325 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md @@ -0,0 +1,394 @@ +# Introduction +Library includes all the functionality provided by API. Library was designed to be flexible and self-explanatory for developers to implement. +Client provides use of API in OOP style. + +## Authentication +You don't have to bother about it. Authentication is handled auto-magically behind the scenes. + +## Initialize the client object +```php +use Cardinity\Client; +$client = Client::create([ + 'consumerKey' => 'YOUR_CONSUMER_KEY', + 'consumerSecret' => 'YOUR_CONSUMER_SECRET', +]); +``` + +## Payments [API](https://developers.cardinity.com/api/v1/#payments) +### Create new payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Create([ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => 2021, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], +]); + +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Handling declined payments +In case payment could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\Payment; + +$method = new Payment\Create([ + 'amount' => 150.01, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::RECURRING, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => 2021, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], +]); + +try { + /** @type Cardinity\Method\Payment\Payment */ + $payment = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\Payment\Payment */ + $payment = $exception->getResult(); + $status = $payment->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Create recurring payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Create([ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::RECURRING, + 'payment_instrument' => [ + 'payment_id' => $paymentId + ], +]); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Finalize pending payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Finalize($payment->getId(), $payment->getAuthorizationInformation()->getData()); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Get existing payment +```php +use Cardinity\Method\Payment; +$method = new Payment\Get($payment->getId()); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +``` + +### Get all payments +```php +use Cardinity\Method\Payment; +$method = new Payment\GetAll(); +$result = $client->call($method); +/** @type Cardinity\Method\Payment\Payment */ +$payment = $result[0]; +``` + +## Refunds [API](https://developers.cardinity.com/api/v1/#refunds) +### Create new refund +```php +use Cardinity\Method\Refund; +$method = new Refund\Create( + $payment->getId(), + 10.00, + 'my description' +); +/** @type Cardinity\Method\Refund\Refund */ +$refund = $client->call($method); +``` + +### Handling declined refunds +In case refund could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\Refund; + +$method = new Refund\Create( + $payment->getId(), + 10.00, + 'fail' +); + +try { + /** @type Cardinity\Method\Refund\Refund */ + $refund = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\Refund\Refund */ + $refund = $exception->getResult(); + $status = $refund->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Get existing refund +```php +use Cardinity\Method\Refund; +$method = new Refund\Get( + $payment->getId(), + $refund->getId() +); +/** @type Cardinity\Method\Refund\Refund */ +$refund = $client->call($method); +``` + +### Get all refunds +```php +use Cardinity\Method\Refund; +$method = new Refund\GetAll( + $payment->getId() +); +$result = $client->call($method); +/** @type Cardinity\Method\Refund\Refund */ +$refund = $result[0]; +``` + +## Settlements [API](https://developers.cardinity.com/api/v1/#settlements) +### Create new settlement +```php +use Cardinity\Method\Settlement; +$method = new Settlement\Create( + $payment->getId(), + 10.00, + 'my description' +); +/** @type Cardinity\Method\Settlement\Settlement */ +$result = $client->call($method); +``` + +### Handling declined settlements +In case settlement could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\Settlement; + +$method = new Settlement\Create( + $payment->getId(), + 10.00, + 'fail' +); + +try { + /** @type Cardinity\Method\Settlement\Settlement */ + $settlement = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\Settlement\Settlement */ + $settlement = $exception->getResult(); + $status = $settlement->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Get existing settlement +```php +use Cardinity\Method\Settlement; +$method = new Settlement\Get( + $payment->getId(), + $settlement->getId() +); +/** @type Cardinity\Method\Settlement\Settlement */ +$settlement = $client->call($method); +``` + +### Get all settlements +```php +use Cardinity\Method\Settlement; +$method = new Settlement\GetAll( + $payment->getId() +); +$result = $client->call($method); +/** @type Cardinity\Method\Settlement\Settlement */ +$settlement = $result[0]; +``` + +## Voids [API](https://developers.cardinity.com/api/v1/#voids) +### Create new void +```php +use Cardinity\Method\VoidPayment; +$method = new VoidPayment\Create( + $payment->getId(), + 'my description' +); +/** @type Cardinity\Method\VoidPayment\VoidPayment */ +$result = $client->call($method); +``` + +### Handling declined voids +In case void could not be processed `Cardinity\Exception\Declined` +exception will be thrown. + +```php +use Cardinity\Exception; +use Cardinity\Method\VoidPayment; + +$method = new VoidPayment\Create( + $payment->getId(), + 'fail' +); + +try { + /** @type Cardinity\Method\VoidPayment\VoidPayment */ + $void = $client->call($method); +} catch (Exception\Declined $exception) { + /** @type Cardinity\Method\VoidPayment\VoidPayment */ + $void = $exception->getResult(); + $status = $void->getStatus(); // value will be 'declined' + $errors = $exception->getErrors(); // list of errors occured +} +``` + +### Get existing void +```php +use Cardinity\Method\VoidPayment; +$method = new VoidPayment\Get( + $payment->getId(), + $void->getId() +); +/** @type Cardinity\Method\VoidPayment\VoidPayment */ +$void = $client->call($method); +``` + +### Get all voids +```php +use Cardinity\Method\VoidPayment; +$method = new VoidPayment\GetAll( + $payment->getId() +); +$result = $client->call($method); +/** @type Cardinity\Method\VoidPayment\VoidPayment */ +$void = $result[0]; +``` + +## Exceptions +### Exceptions representing API error response + +#### Base class for API error response exceptions +Class: `Cardinity\Exception\Request` +Methods: +- `getErrors()` returns list of errors occurred +- `getErrorsAsString()` returns list of errors occurred in string form +- `getResult()` returns object, the instance of `ResultObjectInterface`. + +#### All classes +Class: `Cardinity\Exception\ValidationFailed` +HTTP status: `400` + +Class: `Cardinity\Exception\Unauthorized` +HTTP status: `401` + +Class: `Cardinity\Exception\Declined` +HTTP status: `402` + +Class: `Cardinity\Exception\Forbidden` +HTTP status: `403` + +Class: `Cardinity\Exception\MethodNotAllowed` +HTTP status: `405` + +Class: `Cardinity\Exception\NotAcceptable` +HTTP status: `406` + +Class: `Cardinity\Exception\NotFound` +HTTP status: `404` + +Class: `Cardinity\Exception\InternalServerError` +HTTP status: `500` + +Class: `Cardinity\Exception\ServiceUnavailable` +HTTP status: `503` + + +### Cardinity client exceptions + +#### Request timed out +Class: `Cardinity\Exception\RequestTimeout` + +#### Before-request data validation failed +Class: `Cardinity\Exception\InvalidAttributeValue` +Methods: +- `getViolations()` returns list of validation violations + +#### Unexpected error +Class: `Cardinity\Exception\UnexpectedError` + +#### Base exception class for Cardinity client +Class: `Cardinity\Exception\Runtime` +Catching this exception ensures that you handle all cardinity failure use cases. + + +## Advanced use cases + +### Debug, log request/response +`Client::create()` accepts second argument, which defines the logger. +Available values: `Client::LOG_NONE` or PSR-3 `LoggerInterface`. +- `Client::LOG_NONE` - log disabled. +- `LoggerInterface` - custom logger implementation, for eg. `Monolog`. + +```php +$client = Client::create($config, Client::LOG_NONE); +``` + +### Use Monolog for logging +#### 1. Add monolog to your project +```bash +$ composer require monolog/monolog +``` +#### 2. Register logger to the Cardinity client +```php +$logger = new Monolog\Logger('requests'); +$logger->pushHandler(new Monolog\Handler\StreamHandler(__DIR__ . '/requests.log', Logger::INFO)); +$client = Client::create($config, $logger); +``` + +### Extending components +Each part of client library can be easily extended or replaced with another suitable component +through the corresponding interfaces: +```php +public function __construct( + Cardinity\Http\ClientInterface $client, + Cardinity\Method\ValidatorInterface $validator, + Cardinity\Method\ResultObjectMapperInterface $mapper +) { ... } +``` + +For example to replace _Guzzle_ with another http client you want simply create adapter +for your client library, like `Cardinity\Http\Guzzle\ClientAdapter` which implements +`Cardinity\Http\ClientInterface`. That's it! diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist new file mode 100644 index 00000000000..6da04f0186e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpspec.yml.dist @@ -0,0 +1,4 @@ +suites: + cardinity_suite: + namespace: Cardinity + psr4_prefix: Cardinity diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist new file mode 100644 index 00000000000..badbd18809e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + ./tests + + + + + + ./src + + + diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php new file mode 100644 index 00000000000..37fe4c52ca4 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php @@ -0,0 +1,201 @@ +beConstructedWith( + $client, + $validator, + $mapper + ); + } + + function it_constructs_via_factory() + { + $this::create(['consumerKey' => '', 'consumerSecret' => ''])->shouldReturnAnInstanceOf('Cardinity\Client'); + } + + function it_maps_result_to_object_by_posting_json_body( + MethodInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = ['id' => '3c4e8dcf']; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('POST'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn([]); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'POST', + 'payment', + [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => '{}', + ] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn($resultObject); + } + + function it_maps_result_containing_collection_of_items( + MethodResultCollectionInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = [ + ['id' => '3c4e8dcf'] + ]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('POST'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn([]); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->mapCollection($result, $method)->shouldBeCalled()->willReturn([$resultObject]); + + $client + ->sendRequest( + $method, + 'POST', + 'payment', + [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => '{}', + ] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn([$resultObject]); + } + + function it_converts_float_numbers_to_string_for_json_body( + MethodInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = ['amount' => 50.00]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('POST'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn(['amount' => 50.00]); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'POST', + 'payment', + [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => '{"amount":"50.00"}', + ] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn($resultObject); + } + + function it_gets_result_object_by_sending_get_query_params( + MethodInterface $method, + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $result = ['amount' => 50.00]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('GET'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn(['field' => 'value']); + $method->createResultObject()->willReturn($resultObject); + + $validator->validate($method)->shouldBeCalled(); + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'GET', + 'payment', + ['query' => ['field' => 'value']] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->call($method)->shouldReturn($resultObject); + } + + function it_performs_request_without_validation( + MethodInterface $method, + ClientInterface $client, + ResultObjectMapperInterface $mapper + ) { + $result = ['amount' => 50.00]; + $resultObject = new Payment(); + + $method->getMethod()->willReturn('GET'); + $method->getAction()->willReturn('payment'); + $method->getAttributes()->willReturn(['field' => 'value']); + $method->createResultObject()->willReturn($resultObject); + + $mapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $client + ->sendRequest( + $method, + 'GET', + 'payment', + ['query' => ['field' => 'value']] + ) + ->shouldBeCalled() + ->willReturn($result) + ; + + $this->callNoValidate($method)->shouldReturn($resultObject); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php new file mode 100644 index 00000000000..031d0d887d9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\Declined'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(402); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php new file mode 100644 index 00000000000..0196eff1251 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php @@ -0,0 +1,18 @@ +shouldHaveType('Cardinity\Exception\Forbidden'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(403); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php new file mode 100644 index 00000000000..cbc9598f631 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(500); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php new file mode 100644 index 00000000000..03867c377ea --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php @@ -0,0 +1,42 @@ +__toString()->willReturn($this->violation); + + $this->beConstructedWith( + 'Message', + $violations + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('\RuntimeException'); + } + + function it_returns_message() + { + $this->getMessage()->shouldStartWith('Message'); + } + + function it_returns_violations(ConstraintViolationList $violations) + { + $this->getViolations()->shouldReturn($violations); + } + + function it_should_have_message_containing_violations() + { + $string = 'Violations: ' . $this->violation; + $this->getMessage()->shouldEndWith($string); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php new file mode 100644 index 00000000000..4e62a9edbb6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\MethodNotAllowed'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(405); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php new file mode 100644 index 00000000000..47f139004ff --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\NotAcceptable'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(406); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php new file mode 100644 index 00000000000..a00d66a46cd --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\NotFound'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(404); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php new file mode 100644 index 00000000000..33a8174f9f0 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php @@ -0,0 +1,85 @@ + [ + [ + 'field' => 'currency', + 'rejected' => 'EGR', + 'message' => 'invalid or unsupported currency', + ], + [ + 'field' => 'payment_instrument.exp_month', + 'rejected' => 13, + 'message' => 'must be between 1 and 12', + ] + ] + ]; + + private $error; + + function let(\RuntimeException $exception) + { + $this->error = new Error(); + $this->error->setErrors($this->result['errors']); + + $this->beConstructedWith( + $exception, + $this->error + ); + } + + function it_should_extend_runtime() + { + $this->shouldHaveType('Cardinity\Exception\Runtime'); + } + + function it_stores_previous_exception(\RuntimeException $exception) + { + $this->getPrevious()->shouldReturn($exception); + } + + function it_stores_result() + { + $this->getResult()->shouldReturn($this->error); + } + + function it_should_have_message_containing_response_data() + { + $string = 'Response data: ' . serialize($this->error); + $this->getMessage()->shouldEndWith($string); + } + + function it_returns_errors_from_error_result_object() + { + $this->getErrors()->shouldReturn($this->result['errors']); + } + + function it_returns_errors_as_string() + { + $this->getErrorsAsString()->shouldReturn("currency: invalid or unsupported currency ('EGR' given);\npayment_instrument.exp_month: must be between 1 and 12 ('13' given);"); + } + + function it_returns_errors_from_payment_result_object(\RuntimeException $exception) + { + $msg = 'Payment error'; + + $payment = new Payment(); + $payment->setError($msg); + $this->beConstructedWith( + $exception, + $payment + ); + + $this->getErrors()->shouldReturn([['field' => 'status', 'message' => $msg]]); + $this->getErrorsAsString()->shouldReturn("status: Payment error;"); + } + +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php new file mode 100644 index 00000000000..27b269ad879 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(0); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php new file mode 100644 index 00000000000..60f27ada78a --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\ServiceUnavailable'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(503); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php new file mode 100644 index 00000000000..7f4ad3f9d37 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Exception\Unauthorized'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(401); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php new file mode 100644 index 00000000000..4280a54be1b --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php @@ -0,0 +1,13 @@ +shouldHaveType('\RuntimeException'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php new file mode 100644 index 00000000000..1cccb794fb9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(0); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php new file mode 100644 index 00000000000..d1e7b542bd2 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php @@ -0,0 +1,27 @@ +beConstructedWith( + $exception, + $error + ); + } + + function it_should_extend_request() + { + $this->shouldHaveType('Cardinity\Exception\Request'); + } + + function it_should_return_correct_code() + { + $this->getCode()->shouldReturn(400); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php new file mode 100644 index 00000000000..38c0e885075 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php @@ -0,0 +1,84 @@ +beConstructedWith($client, $mapper); + } + + function it_is_initializable() + { + $this->shouldHaveType('Cardinity\Http\Guzzle\ClientAdapter'); + } + + function it_sends_post_and_returns_result( + MethodInterface $method, + Client $client, + ResponseInterface $response + ) { + $response + ->getBody() + ->shouldBeCalled() + ->willReturn(json_encode(['foo' => 'bar'])) + ; + $client + ->request('POST', 'https://api.cardinity.com/v1/', []) + ->shouldBeCalled() + ->willReturn($response) + ; + $this + ->sendRequest($method, 'POST', 'https://api.cardinity.com/v1/', []) + ->shouldReturn(['foo' => 'bar']) + ; + } + + function it_wraps_client_exceptions_with_ours( + MethodInterface $method, + ClientInterface $client, + ExceptionMapper $mapper, + ClientException $exception + ) { + $client + ->request('POST', 'https://api.cardinity.com/v1/', []) + ->willThrow($exception->getWrappedObject()) + ; + $mapper + ->get($exception->getWrappedObject(), $method) + ->shouldBeCalled() + ->willThrow('Cardinity\Exception\Request') + ; + $this + ->shouldThrow('Cardinity\Exception\Request') + ->duringSendRequest($method, 'POST', 'https://api.cardinity.com/v1/') + ; + } + + function it_handles_unexpected_exceptions( + MethodInterface $method, + ClientInterface $client, + \Exception $exception + ) + { + $client + ->request('POST', 'https://api.cardinity.com/v1/', []) + ->willThrow($exception->getWrappedObject()) + ; + $this + ->shouldThrow('Cardinity\Exception\UnexpectedError') + ->duringSendRequest($method, 'POST', 'https://api.cardinity.com/v1/') + ; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php new file mode 100644 index 00000000000..eeb96faa515 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php @@ -0,0 +1,100 @@ +beConstructedWith($resultMapper); + + $exception->beConstructedWith([ + 'Message', + $request->getWrappedObject(), + $response->getWrappedObject() + ]); + } + + function it_maps_expected_exception_code( + ClientException $exception, + Response $response, + MethodInterface $method + ) { + $result = []; + + $response->getStatusCode()->willReturn(400); + $response->getBody()->willReturn(json_encode($result)); + + $exception->getResponse()->willReturn($response); + + $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\ValidationFailed'); + } + + function it_handles_unexpected_exception_code( + ClientException $exception, + Response $response, + MethodInterface $method + ) { + $result = []; + + $response->getStatusCode()->willReturn(999); + $response->getBody()->willReturn(json_encode($result)); + + $exception->getResponse()->willReturn($response); + + $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\UnexpectedResponse'); + } + + function it_maps_error_response_to_error_result_object( + ClientException $exception, + Response $response, + ResultObjectMapperInterface $resultMapper, + MethodInterface $method + ) { + $result = ['errors' => ['error' => 'Error string']]; + $resultObject = new Error(); + + $response->getStatusCode()->willReturn(400); + $response->getBody()->willReturn(json_encode($result)); + + $method->createResultObject()->willReturn($resultObject); + $exception->getResponse()->willReturn($response); + + $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $this->get($exception, $method)->getResult()->shouldReturn($resultObject); + } + + function it_maps_declined_response_402_to_payment_result_object( + ClientException $exception, + Response $response, + ResultObjectMapperInterface $resultMapper, + MethodInterface $method + ) { + $result = ['error' => 'Error string']; + $resultObject = new Payment(); + + $response->getStatusCode()->willReturn(402); + $response->getBody()->willReturn(json_encode($result)); + + $method->createResultObject()->willReturn($resultObject); + $exception->getResponse()->willReturn($response); + + $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); + + $this->get($exception, $method)->getResult()->shouldReturn($resultObject); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php new file mode 100644 index 00000000000..9d0c2fd3585 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php new file mode 100644 index 00000000000..8bf92353da3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php @@ -0,0 +1,13 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php new file mode 100644 index 00000000000..a7d84069adc --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php @@ -0,0 +1,87 @@ + 'Some header', + 'browser_language' => 'LT', + 'screen_width' => 390, + 'screen_height' => 400, + 'challenge_window_size' => '390x400', + 'user_agent' => 'super user agent', + 'color_depth' => 24, + 'time_zone' => -60, + // 'ip_address' => '192.168.0.1', + ]; + $billingAddress = [ + 'address_line1' => 'first address line', + 'city' => 'balbieriskis', + 'country' => 'LT', + 'postal_code' => '0234' + ]; + $threeds2Data['notification_url'] = 'http://localhost:8000/3dsv2_callback.php'; + $threeds2Data['browser_info'] = $browserInfo; + + $this->options = [ + 'amount' => 12.99, + 'currency' => 'EUR', + 'settle' => true, + 'order_id' => 'ABC123', + 'description' => 'Description', + 'country' => 'LT', + 'payment_method' => 'card', + 'payment_instrument' => [ + 'pan' => '123456789123', + 'exp_year' => '2014', + 'exp_month' => '12', + 'cvc' => '456', + 'holder' => 'Mr Tester', + ], + 'threeds2_data' => $threeds2Data + ]; + $this->beConstructedWith($this->options); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn($this->options); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments'); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php new file mode 100644 index 00000000000..dbba8c38c0e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php @@ -0,0 +1,56 @@ +beConstructedWith($this->paymentId, $this->authorizeData); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_authorize_data() + { + $this->getAuthorizeData()->shouldReturn($this->authorizeData); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments/' . $this->paymentId); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('PATCH'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php new file mode 100644 index 00000000000..332a551bc7e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php @@ -0,0 +1,50 @@ +beConstructedWith($this->limit); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodResultCollectionInterface'); + } + + function it_has_limit() + { + $this->getLimit()->shouldReturn($this->limit); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments'); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php new file mode 100644 index 00000000000..09a27f38f27 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php @@ -0,0 +1,50 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments/' . $this->paymentId); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php new file mode 100644 index 00000000000..3009058caf2 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php @@ -0,0 +1,13 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php new file mode 100644 index 00000000000..c3ae7f82fcc --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php @@ -0,0 +1,13 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php new file mode 100644 index 00000000000..d2a0532fa78 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php @@ -0,0 +1,100 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + + $this->setId('foo'); + $this->setAmount(20.00); + $this->setType(null); + + $info = new AuthorizationInformation(); + $info->setUrl('http://...'); + $info->setData('some_data'); + + $this->setAuthorizationInformation($info); + $this->serialize()->shouldReturn('{"id":"foo","amount":"20.00","authorization_information":{"url":"http:\/\/...","data":"some_data"}}'); + } + + function it_is_able_to_unserialize_authorization_information() + { + $json = '{"id":"foo.bar.123","amount":"20.00","authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; + $this->unserialize($json); + + $this->getId()->shouldReturn('foo.bar.123'); + $this->getAmount()->shouldReturn(20.00); + $this->getType()->shouldReturn(null); + $this->getAuthorizationInformation()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\AuthorizationInformation'); + $this->getAuthorizationInformation()->getUrl()->shouldReturn('http://...'); + $this->getAuthorizationInformation()->getData()->shouldReturn('some_data'); + } + + function it_is_able_to_unserialize_card_payment_instrument() + { + $json = '{"payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":2024,"exp_month":5,"holder":"John Smith"}}'; + $this->unserialize($json); + + $this->getPaymentMethod()->shouldReturn('card'); + $this->getPaymentInstrument()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard'); + $this->getPaymentInstrument()->getCardBrand()->shouldReturn('Visa'); + $this->getPaymentInstrument()->getExpYear()->shouldReturn(2024); + } + + function it_is_able_to_unserialize_recurring_payment_instrument() + { + $json = '{"payment_method":"recurring","payment_instrument":{"payment_id":"ba3119f2-9a73"}}'; + $this->unserialize($json); + + $this->getPaymentMethod()->shouldReturn('recurring'); + $this->getPaymentInstrument()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\PaymentInstrumentRecurring'); + $this->getPaymentInstrument()->getPaymentId()->shouldReturn('ba3119f2-9a73'); + } + + + function it_is_able_to_take_threeds2_data() + { + + $tds2Auth = new ThreeDS2AuthorizationInformation(); + $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); + $tds2Auth->setCreq('eyJyZXR1c...'); + + $this->setThreeds2Data($tds2Auth); + $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); + $this->getThreeds2Data()->shouldReturn($tds2Auth); + + } + + function it_is_able_to_serialize_tdsv2(){ + $json = '{"acs_url":"https:\/\/acs.cardinity.com\/v2\/","c_req":"eyJyZXR1c..."}'; + + $tds2Auth = new ThreeDS2AuthorizationInformation(); + $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); + $tds2Auth->setCreq('eyJyZXR1c...'); + + $this->setThreeds2Data($tds2Auth); + $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); + $this->getThreeds2Data()->shouldReturn($tds2Auth); + + $this->getThreeds2Data()->serialize()->shouldReturn($json); + } + + + function it_handles_unexpected_values() + { + $json = '{"payment_instrument":{"payment_id":"ba3119f2-9a73"}}'; + $this->shouldThrow('Cardinity\Exception\Runtime')->duringUnserialize($json); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php new file mode 100644 index 00000000000..c6c18dfe907 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php @@ -0,0 +1,41 @@ +tds2_data['acs_url'] = 'http://mynotifactionurl.com'; + $this->tds2_data['creq'] = "asdf123xcxzcv"; + + $this->setAcsUrl($this->tds2_data['acs_url']); + $this->setCReq($this->tds2_data['creq']); + } + + function it_is_initalizable(){ + $this->shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_contains_acs_url() + { + $this->getAcsUrl()->shouldReturn($this->tds2_data['acs_url']); + } + + function it_contains_creq() + { + $this->getCReq()->shouldReturn($this->tds2_data['creq']); + } + + + + + + +} + + diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php new file mode 100644 index 00000000000..77162e53a23 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php @@ -0,0 +1,66 @@ +beConstructedWith($this->paymentId, $this->amount, $this->description); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + 'description' => $this->description, + ]); + } + + function it_does_not_contain_optional_properties() + { + $this->beConstructedWith($this->paymentId, $this->amount); + + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + ]); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + sprintf('payments/%s/refunds', $this->paymentId) + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php new file mode 100644 index 00000000000..22f662e9162 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php @@ -0,0 +1,52 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/refunds' + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php new file mode 100644 index 00000000000..0e9a297412d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php @@ -0,0 +1,58 @@ +beConstructedWith($this->paymentId, $this->refundId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_refund_id() + { + $this->getRefundId()->shouldReturn($this->refundId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/refunds/' . $this->refundId + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php new file mode 100644 index 00000000000..f9d43d10635 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php new file mode 100644 index 00000000000..6f3b185b6b7 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php @@ -0,0 +1,117 @@ +shouldImplement('Cardinity\Method\ResultObjectMapper'); + } + + function it_maps_array_to_object(Payment $object) + { + $data = [ + 'id' => 32, + 'type' => 'my_type', + ]; + + $object->setId(32)->shouldBeCalled(); + $object->setType('my_type')->shouldBeCalled(); + + $this->map($data, $object); + } + + function it_maps_card_payment_instrument(Payment $payment) + { + $data = [ + 'payment_method' => 'card', + 'payment_instrument' => [ + 'card_brand' => 'Visa', + 'pan' => '0067', + 'exp_year' => 2021, + 'exp_month' => 12, + 'holder' => 'Mike Dough' + ], + ]; + + $instrument = new PaymentInstrumentCard(); + $instrument->setCardBrand('Visa'); + $instrument->setPan('0067'); + $instrument->setExpYear(2021); + $instrument->setExpMonth(12); + $instrument->setHolder('Mike Dough'); + + $payment->setPaymentMethod('card')->shouldBeCalled(); + $payment->setPaymentInstrument($instrument)->shouldBeCalled(); + + $this->map($data, $payment)->shouldReturn($payment); + } + + function it_maps_recurring_payment_instrument(Payment $payment) + { + $data = [ + 'payment_method' => 'recurring', + 'payment_instrument' => [ + 'payment_id' => 'ba3119f2-9a73-11e4-89d3-123b93f75cba', + ], + ]; + + $instrument = new PaymentInstrumentRecurring(); + $instrument->setPaymentId('ba3119f2-9a73-11e4-89d3-123b93f75cba'); + + $payment->setPaymentMethod('recurring')->shouldBeCalled(); + $payment->setPaymentInstrument($instrument)->shouldBeCalled(); + + $this->map($data, $payment); + } + + function it_throws_exception_for_unknown_payment_method(Payment $payment) + { + $data = [ + 'payment_method' => 'non_existing_method', + 'payment_instrument' => [], + ]; + + $this->shouldThrow('Cardinity\Exception\Runtime')->duringMap($data, $payment); + } + + function it_maps_authorization_information(Payment $payment) + { + $data = [ + 'authorization_information' => [ + 'url' => 'https://authorization.url/auth', + 'data' => 'eJxdUl1vwj.......', + ], + ]; + + $info = new AuthorizationInformation(); + $info->setUrl('https://authorization.url/auth'); + $info->setData('eJxdUl1vwj.......'); + + $payment->setAuthorizationInformation($info)->shouldBeCalled(); + + $this->map($data, $payment); + } + + function it_maps_data_collection(MethodResultCollectionInterface $method, Payment $object) + { + $data = [ + ['id' => 32, 'type' => 'my_type'], + ]; + + $method->createResultObject()->shouldBeCalled()->willReturn($object); + + $object->setId(32)->shouldBeCalled(); + $object->setType('my_type')->shouldBeCalled(); + + $this->mapCollection($data, $method); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php new file mode 100644 index 00000000000..b94a2323099 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php @@ -0,0 +1,66 @@ +beConstructedWith($this->paymentId, $this->amount, $this->description); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + 'description' => $this->description, + ]); + } + + function it_does_not_contain_optional_properties() + { + $this->beConstructedWith($this->paymentId, $this->amount); + + $this->getAttributes()->shouldReturn([ + 'amount' => $this->amount, + ]); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + sprintf('payments/%s/settlements', $this->paymentId) + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php new file mode 100644 index 00000000000..8d17d7199ed --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php @@ -0,0 +1,52 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/settlements' + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php new file mode 100644 index 00000000000..cda82405141 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php @@ -0,0 +1,58 @@ +beConstructedWith($this->paymentId, $this->settlementId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_settlement_id() + { + $this->getSettlementId()->shouldReturn($this->settlementId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/settlements/' . $this->settlementId + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php new file mode 100644 index 00000000000..4175040b073 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php new file mode 100644 index 00000000000..8b7d9a9da9d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php @@ -0,0 +1,64 @@ +beConstructedWith($validator); + } + + function it_implements_validator_interface() + { + $this->shouldImplement('Cardinity\Method\ValidatorInterface'); + } + + function it_validates_given_method_instance(MethodInterface $method, ValidatorInterface $validator) + { + $attributes = ['field' => 'value']; + $constraints = ['constraints']; + + $method->getAttributes()->shouldBeCalled()->willReturn($attributes); + $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); + + $validator->validate($attributes, $constraints)->shouldBeCalled(); + + $this->validate($method); + } + + function it_throws_exception_on_validation_failure( + MethodInterface $method, + ValidatorInterface $validator, + ConstraintViolationList $violations + ) { + $attributes = ['field' => 'value']; + $constraints = ['constraints']; + + $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); + $method->getAttributes()->shouldBeCalled()->willReturn($attributes); + + $violations->count()->willReturn(1); + $violations->__toString()->willReturn(''); + + $validator->validate($attributes, $constraints)->willReturn($violations); + + $this->shouldThrow('Cardinity\Exception\InvalidAttributeValue')->duringValidate($method); + } + + function it_does_not_validate_method_with_no_constraints(MethodInterface $method, ValidatorInterface $validator) + { + $constraints = []; + + $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); + + $validator->validate([], $constraints)->shouldNotBeCalled(); + + $this->validate($method); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php new file mode 100644 index 00000000000..c84260d372d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php @@ -0,0 +1,62 @@ +beConstructedWith($this->paymentId, $this->description); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn([ + 'description' => $this->description, + ]); + } + + function it_does_not_contain_optional_properties() + { + $this->beConstructedWith($this->paymentId); + + $this->getAttributes()->shouldReturn([]); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + sprintf('payments/%s/voids', $this->paymentId) + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php new file mode 100644 index 00000000000..6cccb6bb261 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php @@ -0,0 +1,50 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn('payments/' . $this->paymentId . '/voids'); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php new file mode 100644 index 00000000000..e41c5297b71 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php @@ -0,0 +1,58 @@ +beConstructedWith($this->paymentId, $this->voidId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_settlement_id() + { + $this->getvoidId()->shouldReturn($this->voidId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/voids/' . $this->voidId + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); + } + + function it_has_validation_constraints() + { + $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php new file mode 100644 index 00000000000..080ba892ce6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php @@ -0,0 +1,18 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php new file mode 100644 index 00000000000..bd18aa9144f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php @@ -0,0 +1,215 @@ + 'foo', + * 'consumerSecret' => 'bar', + * ] + * @param LoggerInterface $logger Logs messages. + * @return self + */ + public static function create(array $options = [], $logger = Client::LOG_NONE) + { + $oauth = new Oauth1([ + 'token_secret' => '', + 'consumer_key' => $options['consumerKey'], + 'consumer_secret' => $options['consumerSecret'] + ]); + + $validator = Validation::createValidator(); + + if(isset($options['apiEndpoint'])){ + self::validateClientEndpoint($options, $validator); + self::$url = $options['apiEndpoint']; + } + + $stack = HandlerStack::create(); + $stack->push($oauth); + + if (!empty($logger)) { + $stack->push( + Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG)) + ); + } + + $client = new \GuzzleHttp\Client([ + 'base_uri' => self::$url, + 'handler' => $stack, + 'auth' => 'oauth' + ]); + + $mapper = new ResultObjectMapper(); + + return new self( + new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)), + new Validator($validator), + $mapper + ); + } + + /** + * @param ClientInterface $client + * @param ValidatorInterface $validator + * @param ResultObjectMapperInterface $mapper + */ + public function __construct( + ClientInterface $client, + ValidatorInterface $validator, + ResultObjectMapperInterface $mapper + ) { + $this->client = $client; + $this->validator = $validator; + $this->mapper = $mapper; + } + + /** + * Call the given method. + * @param MethodInterface $method + * @return ResultObjectInterface|array + */ + public function call(MethodInterface $method) + { + $this->validator->validate($method); + + return $this->handleRequest($method); + } + + /** + * Call the particular method without data validation + * @param MethodInterface $method + * @return ResultObjectInterface|array + */ + public function callNoValidate(MethodInterface $method) + { + return $this->handleRequest($method); + } + + /** + * Handle all the request/response hard work + * @param MethodInterface $method + * @return ResultObjectInterface|array + */ + private function handleRequest(MethodInterface $method) + { + $result = $this->client->sendRequest( + $method, + $method->getMethod(), + $method->getAction(), + $this->getOptions($method) + ); + + if ($method instanceof MethodResultCollectionInterface) { + return $this->mapper->mapCollection($result, $method); + } + + return $this->mapper->map($result, $method->createResultObject()); + } + + /** + * Prepare request options for particular method + * @param MethodInterface $method + * @return array + */ + private function getOptions(MethodInterface $method) + { + if ($method->getMethod() == $method::GET) { + return [ + 'query' => $method->getAttributes(), + ]; + } + + return [ + 'headers' => [ + 'Content-Type' => 'application/json', + ], + 'body' => json_encode( + $this->prepareAttributes($method->getAttributes()), + JSON_FORCE_OBJECT + ) + ]; + } + + /** + * Prepare request attributes + * @param array $data + * @return array + */ + private function prepareAttributes(array $data) + { + foreach ($data as $key => &$value) { + if (is_array($value)) { + $data[$key] = $this->prepareAttributes($value); + continue; + } + + if (is_float($value)) { + $value = sprintf("%01.2f", $value); + } + } + + return $data; + } + + /** + * Validate endPoint is a valid URL + * + * @param [array] $options + * @param [Validator] $validator + * @return void + */ + private static function validateClientEndpoint($options, $validator){ + $violations = $validator->validate($options['apiEndpoint'], [ + new Url(), + ]); + if(count($violations) != 0){ + throw new Exception\InvalidAttributeValue( + 'Your API endpoint is not a valid URL', + $violations + ); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php new file mode 100644 index 00000000000..29a2f085ea9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Declined.php @@ -0,0 +1,9 @@ +__toString(); + parent::__construct($message); + + $this->violations = $violations; + } + + public function getViolations() + { + return $this->violations; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php new file mode 100644 index 00000000000..8a0294e7a8f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/MethodNotAllowed.php @@ -0,0 +1,9 @@ +message .= ' Response data: ' . serialize($result); + parent::__construct($this->message, $this->code, $previous); + + $this->result = $result; + } + + /** + * Get result object of particular response + * @return ResultObjectInterface + */ + public function getResult() + { + return $this->result; + } + + /** + * List of errors occured + * @return array + */ + public function getErrors() + { + return $this->result->getErrors(); + } + + /** + * Errors in string form + * @return string + */ + public function getErrorsAsString() + { + $string = ''; + foreach ($this->getErrors() as $error) { + $string .= sprintf( + "%s: %s", + $error['field'], + $error['message'] + ); + if (isset($error['rejected'])) { + $string .= sprintf(" ('%s' given)", $error['rejected']); + } + $string .= ";\n"; + } + + return trim($string); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php new file mode 100644 index 00000000000..dcb34d764b4 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/RequestTimeout.php @@ -0,0 +1,9 @@ +client = $client; + $this->mapper = $mapper; + } + + /** + * Send HTTP request + * @param MethodInterface $method + * @param string $requestMethod POST|GET|PATCH + * @param string $url http URL + * @param array $options query options. Query values goes under 'body' key. + * + * @return array + */ + public function sendRequest( + MethodInterface $method, + $requestMethod, + $url, + array $options = [] + ) { + try { + $response = $this->client->request($requestMethod, $url, $options); + return json_decode($response->getBody(), true); + } catch (ClientException $e) { + throw $this->mapper->get($e, $method); + } catch (\Exception $e) { + throw new Exception\UnexpectedError('Unexpected error', $e->getCode(), $e); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php new file mode 100644 index 00000000000..b1d772fde66 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php @@ -0,0 +1,93 @@ +resultMapper = $resultMapper; + } + + /** + * Get mapped exception + * @param ClientException $exception + * @param MethodInterface $method + * @return Cardinity\Exception\Request + */ + public function get(ClientException $exception, MethodInterface $method) + { + $map = $this->getMap(); + if ($this->supports($exception, $map)) { + return $this->create( + $this->getMappedClass($exception, $map), + $exception, + $method + ); + } + + return $this->create( + 'Cardinity\\Exception\\UnexpectedResponse', + $exception, + $method + ); + } + + private function getMappedClass(ClientException $exception, $map) + { + return $map[$exception->getCode()]; + } + + private function supports(ClientException $exception, $map) + { + return array_key_exists($exception->getCode(), $map); + } + + private function getMap() + { + return [ + 400 => 'Cardinity\\Exception\\ValidationFailed', + 401 => 'Cardinity\\Exception\\Unauthorized', + 402 => 'Cardinity\\Exception\\Declined', + 403 => 'Cardinity\\Exception\\Forbidden', + 404 => 'Cardinity\\Exception\\NotFound', + 405 => 'Cardinity\\Exception\\MethodNotAllowed', + 406 => 'Cardinity\\Exception\\NotAcceptable', + 500 => 'Cardinity\\Exception\\InternalServerError', + 503 => 'Cardinity\\Exception\\ServiceUnavailable', + ]; + } + + private function create($class, ClientException $exception, MethodInterface $method) + { + $response = json_decode($exception->getResponse()->getBody(), true); + + // map declined response to result object + if ($exception->getCode() == 402) { + $resultObject = $method->createResultObject(); + } else { + $resultObject = new Error(); + } + + $response = $this->resultMapper->map( + $response, + $resultObject + ); + + return new $class( + $exception, + $response + ); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php new file mode 100644 index 00000000000..ceb3fd93d48 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php @@ -0,0 +1,116 @@ +type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of title. + * @return mixed + */ + public function getTitle() + { + return $this->title; + } + + /** + * Sets the value of title. + * @param mixed $title the title + * @return void + */ + public function setTitle($title) + { + $this->title = $title; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of detail. + * @return mixed + */ + public function getDetail() + { + return $this->detail; + } + + /** + * Sets the value of detail. + * @param mixed $detail the detail + * @return void + */ + public function setDetail($detail) + { + $this->detail = $detail; + } + + /** + * Gets the value of errors. + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Sets the value of errors. + * @param array $errors the errors + * @return void + */ + public function setErrors($errors) + { + $this->errors = $errors; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php new file mode 100644 index 00000000000..d494ab8731c --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php @@ -0,0 +1,54 @@ +url; + } + + /** + * Sets the value of url. + * @param mixed $url the url + * @return void + */ + public function setUrl($url) + { + $this->url = $url; + } + + /** + * Gets the value of data. + * @return mixed + */ + public function getData() + { + return $this->data; + } + + /** + * Sets the value of data. + * @param mixed $data the data + * @return void + */ + public function setData($data) + { + $this->data = $data; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php new file mode 100644 index 00000000000..817c6b074bf --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php @@ -0,0 +1,226 @@ +attributes = $attributes; + } + + public function getAction(): string + { + return 'payments'; + } + + public function getMethod(): string + { + return MethodInterface::POST; + } + + public function getAttributes(): array + { + return $this->attributes; + } + + public function createResultObject(): Payment + { + return new Payment(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'amount' => $this->buildElement('float', 1), + 'currency' => $this->buildElement('string', 1, ['min' => 3,'max' => 3]), + 'settle' => $this->buildElement('bool'), + 'order_id' => $this->buildElement('string', 0, ['min' => 2,'max' => 50]), + 'description' => $this->buildElement('string', 0, ['max' => 255]), + 'statement_descriptor_suffix' => $this->buildElement('string', 0, ['max' => 25]), + 'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]), + 'payment_method' => new Assert\Required([ + new Assert\Type([ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + new Assert\Choice([ + 'choices' => [ + self::CARD, + self::RECURRING + ] + ]) + ]), + 'payment_instrument' => $this->getPaymentInstrumentConstraints( + $this->getAttributes()['payment_method'] + ), + 'threeds2_data' => new Assert\Optional( + $this->getThreeDS2DataConstraints() + ) + ]); + } + + private function getPaymentInstrumentConstraints($method): ?object + { + switch ($method) { + case self::CARD: + return new Assert\Collection([ + 'pan' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Luhn() + ]), + 'exp_year' => $this->buildElement( + 'integer', 1, + ['min' => 4,'max' => 4], + new Assert\Range(['min' => date('Y')]) + ), + 'exp_month' => $this->buildElement('integer', 1), + 'cvc' => $this->buildElement('string', 1, ['min' => 3, 'max' => 4]), + 'holder' => $this->buildElement('string', 1, ['max' => 32]), + ]); + case self::RECURRING: + return new Assert\Collection([ + 'payment_id' => $this->buildElement('string', 1), + ]); + } + + throw new \InvalidArgumentException( + sprintf( + 'Payment instrument for payment method "%s" is not expected', + $method + ) + ); + } + + private function getThreeDS2DataConstraints(): object + { + return new Assert\Collection([ + 'notification_url' => $this->getNotificationUrlConstraints(), + 'browser_info' => $this->getBrowserInfoConstraints(), + 'billing_address' => new Assert\Optional( + $this->getAdressConstraints() + ), + 'delivery_address' => new Assert\Optional( + $this->getAdressConstraints() + ), + 'cardholder_info' => new Assert\Optional( + $this->getCardHolderInfoConstraints() + ), + ]); + } + + public function getNotificationUrlConstraints() + { + return new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type([ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + new CallbackUrlConstraint(), + new Assert\Url([ + 'message' => 'The protocol of {{ value }} should be "http" or "https".', + 'protocols' => ['http', 'https'], + ]), + ]); + } + + public function getIpAddressConstraints() + { + return new Assert\Optional([ + new Assert\NotBlank(), + new CallbackUrlConstraint(), + new Assert\Type([ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + ]); + } + + private function getBrowserInfoConstraints() + { + return new Assert\Collection([ + 'accept_header' => $this->buildElement('string', 1), + 'browser_language' => $this->buildElement('string', 1), + 'screen_width' => $this->buildElement('integer', 1), + 'screen_height' => $this->buildElement('integer', 1), + 'challenge_window_size' => $this->buildElement('string', 1), + 'user_agent' => $this->buildElement('string', 1), + 'color_depth' => $this->buildElement('integer', 1), + 'time_zone' => $this->buildElement('integer', 1), + 'ip_address' => $this->getIpAddressConstraints(), + 'javascript_enabled' => new Assert\Optional($this->buildElement('bool')), + 'java_enabled' => new Assert\Optional($this->buildElement('bool')), + ]); + } + + private function getAdressConstraints(): object + { + return new Assert\Collection([ + 'address_line1' => $this->buildElement('string', 1, ['max' => 50]), + 'address_line2' => new Assert\Optional( + $this->buildElement('string', 1, ['max' => 50]) + ), + 'address_line3' => new Assert\Optional( + $this->buildElement('string', 0, ['max' => 50]) + ), + 'city' => $this->buildElement('string', 1, ['max' => 50]), + 'country' => $this->buildElement('string', 1, ['max' => 10]), + 'postal_code' => $this->buildElement('string', 1, ['max' => 16]), + 'state' => new Assert\Optional( + $this->buildElement('string', 0, ['max' => 14]) + ), + ]); + } + + private function getCardHolderInfoConstraints(): object + { + return new Assert\Collection([ + 'email_address' => new Assert\Optional( + new Assert\Email(['mode' => 'loose']) + ), + 'mobile_phone_number' => new Assert\Optional($this->buildElement('string')), + 'work_phone_number' => new Assert\Optional($this->buildElement('string')), + 'home_phone_number' => new Assert\Optional($this->buildElement('string')), + ]); + } + + private function buildElement( + string $typeValue, + bool $isRequired = false, + array $length = null, + $args = null // TODO can it be null? + ): object + { + $inside_array = $this->getInsideArray($typeValue); + if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); + if ($length) array_push($inside_array, new Assert\Length($length)); + if ($args) array_push($inside_array, $args); + + return $isRequired + ? new Assert\Required($inside_array) + : new Assert\Optional($inside_array) + ; + } + + private function getInsideArray(string $typeValue): array + { + return [ + new Assert\Type([ + 'type' => $typeValue, + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]), + ]; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php new file mode 100644 index 00000000000..d344626515d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php @@ -0,0 +1,78 @@ +paymentId = $paymentId; + $this->authorizeData = $authorizeData; + $this->finalizeKey = $isV2 ? 'cres' : 'authorize_data'; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getAuthorizeData() + { + return $this->authorizeData; + } + + public function getAction() + { + return sprintf('payments/%s', $this->getPaymentId()); + } + + public function getMethod() + { + return MethodInterface::PATCH; + } + + public function createResultObject() + { + return new Payment(); + } + + public function getAttributes() + { + return [ + $this->finalizeKey => $this->getAuthorizeData(), + $this->paymentId => $this->getPaymentId(), + ]; + } + + public function getValidationConstraints() + { + $type_params = [ + 'type' => 'string', + 'message' => 'The value {{ value }} is not a valid {{ type }}.' + ]; + return new Assert\Collection([ + 'fields' => [ + $this->finalizeKey => new Assert\Required([ + new Assert\NotBlank(["message"=>"$this->finalizeKey missing."]), + new Assert\Type($type_params) + ]), + $this->paymentId => new Assert\Required([ + new Assert\NotBlank(["message"=>"paymentId missing."]), + new Assert\Type($type_params) + ]), + ], + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php new file mode 100644 index 00000000000..4ec5d3cb74f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php @@ -0,0 +1,46 @@ +paymentId = $paymentId; + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getAction() + { + return sprintf('payments/%s', $this->getPaymentId()); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Payment(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php new file mode 100644 index 00000000000..155f4254ca7 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php @@ -0,0 +1,54 @@ +limit = $limit; + } + + public function getLimit() + { + return $this->limit; + } + + public function getAction() + { + return 'payments'; + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Payment(); + } + + public function getAttributes() + { + return [ + 'limit' => $this->getLimit() + ]; + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'limit' => new Assert\Optional([ + new Assert\NotNull(), + new Assert\Type(['type' => 'integer']), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php new file mode 100644 index 00000000000..64f8d32253a --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php @@ -0,0 +1,478 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of amount. + * @return mixed + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Sets the value of amount. + * @param mixed $amount the amount + * @return void + */ + public function setAmount($amount) + { + $this->amount = $amount; + } + + /** + * Gets the value of currency. + * @return mixed + */ + public function getCurrency() + { + return $this->currency; + } + + /** + * Sets the value of currency. + * @param mixed $currency the currency + * @return void + */ + public function setCurrency($currency) + { + $this->currency = $currency; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of settle. + * @return mixed + */ + public function getSettle() + { + return $this->settle; + } + + /** + * Sets the value of settle. + * @param mixed $settle the settle + * @return void + */ + public function setSettle($settle) + { + $this->settle = $settle; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Gets the value of country. + * @return mixed + */ + public function getCountry() + { + return $this->country; + } + + /** + * Sets the value of country. + * @param mixed $country the country + * @return void + */ + public function setCountry($country) + { + $this->country = $country; + } + + /** + * Gets the value of paymentMethod. + * @return mixed + */ + public function getPaymentMethod() + { + return $this->paymentMethod; + } + + /** + * Sets the value of paymentMethod. + * @param mixed $paymentMethod the payment method + * @return void + */ + public function setPaymentMethod($paymentMethod) + { + $this->paymentMethod = $paymentMethod; + } + + /** + * Gets the value of paymentInstrument. + * @return PaymentInstrumentInterface + */ + public function getPaymentInstrument() + { + return $this->paymentInstrument; + } + + /** + * Sets the value of paymentInstrument. + * @param PaymentInstrumentInterface $paymentInstrument the payment instrument + * @return void + */ + public function setPaymentInstrument(PaymentInstrumentInterface $paymentInstrument) + { + $this->paymentInstrument = $paymentInstrument; + } + + /** + * @deprecated method is deprecated and shouldn't be used. + * Gets the value of authorizeData. + * @return mixed + */ + public function getAuthorizeData() + { + return $this->authorizeData; + } + + /** + * @deprecated method is deprecated and shouldn't be used. + * Sets the value of authorizeData. + * @param mixed $authorizeData the authorize data + * @return void + */ + public function setAuthorizeData($authorizeData) + { + $this->authorizeData = $authorizeData; + } + + /** + * Gets the value of authorizationInformation. + * @return AuthorizationInformation + */ + public function getAuthorizationInformation() + { + return $this->authorizationInformation; + } + + /** + * Sets the value of authorizationInformation. + * @param AuthorizationInformation $authorizationInformation the authorization information + * @return void + */ + public function setAuthorizationInformation(AuthorizationInformation $authorizationInformation) + { + $this->authorizationInformation = $authorizationInformation; + } + + /** + * @return ThreeDS2AuthorizationInformation + */ + public function getThreeds2Data() + { + return $this->threeDS2AuthorizationInformation; + } + + /** + * @param ThreeDS2AuthorizationInformation + * @return VOID + */ + public function setThreeds2Data( + ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation + ){ + $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation; + } + + /** + * Gets the value of statementDescriptorSuffix. + * @return mixed + */ + public function getStatementDescriptorSuffix() + { + return $this->statementDescriptorSuffix; + } + + /** + * Sets the value of statementDescriptorSuffix. + * @param mixed $statementDescriptorSuffix the description included in statement + * @return void + */ + public function setStatementDescriptorSuffix($statementDescriptorSuffix) + { + $this->statementDescriptorSuffix = $statementDescriptorSuffix; + } + + + /** + * @return BOOL is it 3D secure v1? + */ + public function isThreedsV1() : bool + { + return $this->authorizationInformation != null; + } + + /** + * @return BOOL is it 3D secure v2? + */ + public function isThreedsV2() : bool + { + return $this->threeDS2AuthorizationInformation != null; + } + + /** + * Check if payment is pending + * @return boolean + */ + public function isPending() + { + return $this->getStatus() === 'pending'; + } + + /** + * Check if payment is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if payment is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php new file mode 100644 index 00000000000..35691823cda --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php @@ -0,0 +1,121 @@ +cardBrand; + } + + /** + * Sets the value of cardBrand. + * @param mixed $cardBrand the card brand + * @return void + */ + public function setCardBrand($cardBrand) + { + $this->cardBrand = $cardBrand; + } + + /** + * Gets the value of pan. + * @return mixed + */ + public function getPan() + { + return $this->pan; + } + + /** + * Sets the value of pan. + * @param mixed $pan the pan + * @return void + */ + public function setPan($pan) + { + $this->pan = $pan; + } + + /** + * Gets the value of expYear. + * @return mixed + */ + public function getExpYear() + { + return $this->expYear; + } + + /** + * Sets the value of expYear. + * @param mixed $expYear the exp year + * @return void + */ + public function setExpYear($expYear) + { + $this->expYear = $expYear; + } + + /** + * Gets the value of expMonth. + * @return mixed + */ + public function getExpMonth() + { + return $this->expMonth; + } + + /** + * Sets the value of expMonth. + * @param mixed $expMonth the exp month + * @return void + */ + public function setExpMonth($expMonth) + { + $this->expMonth = $expMonth; + } + + /** + * Gets the value of holder. + * @return mixed + */ + public function getHolder() + { + return $this->holder; + } + + /** + * Sets the value of holder. + * @param mixed $holder the holder + * @return void + */ + public function setHolder($holder) + { + $this->holder = $holder; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php new file mode 100644 index 00000000000..b844435dafe --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php @@ -0,0 +1,8 @@ +paymentId; + } + + /** + * Sets the value of paymentId. + * @param mixed $paymentId the payment id + * @return void + */ + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php new file mode 100644 index 00000000000..1511bff380f --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php @@ -0,0 +1,58 @@ +acsUrl; + } + + + /** + * @param STRING + * @return VOID + */ + public function setAcsUrl(string $acsUrl) : void + { + $this->acsUrl = $acsUrl; + } + + + /** + * @return STRING + */ + public function getCReq() + { + return $this->cReq; + } + + + /** + * @param STRING + * @return VOID + */ + public function setCReq(string $cReq) : void + { + $this->cReq = $cReq; + } + + public function getErrors() + { + + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php new file mode 100644 index 00000000000..e5d3d42b44a --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Create.php @@ -0,0 +1,64 @@ +paymentId = $paymentId; + $this->amount = $amount; + $this->description = $description; + } + + public function getAction() + { + return sprintf('payments/%s/refunds', $this->paymentId); + } + + public function getMethod() + { + return MethodInterface::POST; + } + + public function getAttributes() + { + $return = [ + 'amount' => $this->amount, + ]; + + if ($this->description !== null) { + $return['description'] = $this->description; + } + + return $return; + } + + public function createResultObject() + { + return new Refund(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'amount' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'float']) + ]), + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php new file mode 100644 index 00000000000..eda5e22c8b0 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php @@ -0,0 +1,57 @@ +paymentId = $paymentId; + $this->refundId = $refundId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/refunds/%s', + $this->getPaymentId(), + $this->getRefundId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Refund(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getRefundId() + { + return $this->refundId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php new file mode 100644 index 00000000000..1936fce7d24 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php @@ -0,0 +1,50 @@ +paymentId = $paymentId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/refunds', + $this->getPaymentId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Refund(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php new file mode 100644 index 00000000000..50a14b3e663 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php @@ -0,0 +1,286 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of amount. + * @return mixed + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Sets the value of amount. + * @param mixed $amount the amount + * @return void + */ + public function setAmount($amount) + { + $this->amount = $amount; + } + + /** + * Gets the value of currency. + * @return mixed + */ + public function getCurrency() + { + return $this->currency; + } + + /** + * Sets the value of currency. + * @param mixed $currency the currency + * @return void + */ + public function setCurrency($currency) + { + $this->currency = $currency; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of parentId. + * @return mixed + */ + public function getParentId() + { + return $this->parentId; + } + + /** + * Sets the value of parentId. + * @param mixed $parentId the parent id + * @return void + */ + public function setParentId($parentId) + { + $this->parentId = $parentId; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Check if refund is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if refund is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php new file mode 100644 index 00000000000..eb479c9e1ae --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php @@ -0,0 +1,160 @@ + 'status', + 'message' => $this->getError() + ] + ]; + } + + /** + * Return single error + */ + public function getError() + { + return ''; + } + + /** + * Serializes result object to json object + * @param boolean $toJson encode result to json + * @return array|object + */ + public function serialize($toJson = true) + { + $data = []; + + $getters = $this->classGetters(get_class($this)); + foreach ($getters as $method) { + $property = $this->propertyName($method); + $value = $this->$method(); + + if (is_float($value)) { + $value = sprintf("%01.2f", $value); + } elseif (is_object($value)) { + $value = $value->serialize(false); + } + + if ($value !== null) { + $data[$property] = $value; + } + } + + if ($toJson === true) { + return json_encode($data); + } + + return $data; + } + + /** + * Loads result object values from json object + * @param string $string json + * @return void + */ + public function unserialize($string) + { + $data = json_decode($string); + foreach ($data as $property => $value) { + $method = $this->setterName($property); + + if (is_numeric($value) && strstr($value, '.')) { + $value = floatval($value); + } elseif (is_object($value)) { + if ($property == 'authorization_information') { + $object = new AuthorizationInformation(); + $object->unserialize(json_encode($value)); + $value = $object; + } elseif ($property == 'threeds2_data') { + $object = new ThreeDS2AuthorizationInformation(); + $object->unserialize(json_encode($value)); + $value = $object; + } elseif ($property == 'payment_instrument') { + if (!isset($data->payment_method)) { + throw new Exception\Runtime('Property "payment_method" is missing'); + } + + switch ($data->payment_method) { + case Payment\Create::CARD: + $object = new PaymentInstrumentCard(); + break; + case Payment\Create::RECURRING: + $object = new PaymentInstrumentRecurring(); + break; + default: + $object = new PaymentInstrumentCard(); + break; + } + $object->unserialize(json_encode($value)); + $value = $object; + } + } + + $this->$method($value); + } + } + + /** + * @param string $class + * @return array + */ + private function classGetters($class) + { + $methods = get_class_methods($class); + return array_filter($methods, function ($value) use ($methods) { + if ($value == 'getErrors') { + return false; + } + + // no setter means it's inherited property, should be ignored + $setter = $this->setterName($this->propertyName($value)); + if (!in_array($setter, $methods)) { + return false; + } + + return substr($value, 0, 3) == 'get'; + }); + } + + /** + * @param string $method + * @return string + */ + private function propertyName($method) + { + $method = lcfirst(substr($method, 3)); + $method = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $method)); + + return $method; + } + + /** + * @param string $property + * @return string + */ + private function setterName($property) + { + $parts = explode('_', $property); + $parts = array_map('ucfirst', $parts); + $property = implode('', $parts); + + return 'set' . ucfirst($property); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php new file mode 100644 index 00000000000..9b7890d5562 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectInterface.php @@ -0,0 +1,15 @@ +map($item, $method->createResultObject()); + } + + return $return; + } + + /** + * Map response data to instance of ResultObjectInterface + * @param array $response + * @param ResultObjectInterface $result + * + * @return ResultObjectInterface + */ + public function map(array $response, ResultObjectInterface $result) + { + foreach ($response as $field => $value) { + $method = $this->getSetterName($field); + + if (!method_exists($result, $method)) { + continue; + } + + if ($field == 'payment_instrument') { + $value = $this->transformPaymentInstrumentValue($value, $response['payment_method']); + } elseif ($field == 'authorization_information') { + $value = $this->transformAuthorizationInformationValue($value); + } elseif ($field == 'threeds2_data') { + $value = $this->transformThreeDS2DataValue($value); + } + + $result->$method($value); + } + + return $result; + } + + /** + * Extracts camelCased setter name from underscore notation. + * Eg. my_field_name => myFieldName + * @param string $field + * @return string + */ + private function getSetterName($field) + { + $parts = explode('_', $field); + array_map('ucfirst', $parts); + $name = 'set' . implode('', $parts); + + return $name; + } + + /** + * Transform PaymentInstrument result array to object + * @param array $data + * @param string $method + * @return PaymentInstrumentCard|PaymentInstrumentRecurring + * @throws Exception\Runtime for unsupported methods + */ + private function transformPaymentInstrumentValue(array $data, $method) + { + if ($method == 'card') { + $instrument = new PaymentInstrumentCard(); + } elseif ($method == 'recurring') { + $instrument = new PaymentInstrumentRecurring(); + } else { + throw new Exception\Runtime(sprintf('Method "%s" is not supported', $method)); + } + + $this->map($data, $instrument); + + return $instrument; + } + + /** + * Transform AuthorizationInformation result array to object + * @param array $data + * @return AuthorizationInformation + */ + private function transformAuthorizationInformationValue($data) + { + $info = new AuthorizationInformation(); + $this->map($data, $info); + + return $info; + } + + /** + * @param ARRAY $data + * @return ThreeDS2AuthorizationInformation + */ + private function transformThreeDS2DataValue($data) + { + $threeds2 = new ThreeDS2AuthorizationInformation(); + $this->map($data, $threeds2); + return $threeds2; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php new file mode 100644 index 00000000000..f7d9b3c78ee --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php @@ -0,0 +1,10 @@ +paymentId = $paymentId; + $this->amount = $amount; + $this->description = $description; + } + + public function getAction() + { + return sprintf('payments/%s/settlements', $this->paymentId); + } + + public function getMethod() + { + return MethodInterface::POST; + } + + public function getAttributes() + { + $return = [ + 'amount' => $this->amount, + ]; + + if ($this->description !== null) { + $return['description'] = $this->description; + } + + return $return; + } + + public function createResultObject() + { + return new Settlement(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'amount' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'float']) + ]), + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php new file mode 100644 index 00000000000..9d14e3a7263 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php @@ -0,0 +1,57 @@ +paymentId = $paymentId; + $this->settlementId = $settlementId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/settlements/%s', + $this->getPaymentId(), + $this->getSettlementId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Settlement(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getSettlementId() + { + return $this->settlementId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php new file mode 100644 index 00000000000..937fe0de032 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php @@ -0,0 +1,50 @@ +paymentId = $paymentId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/settlements', + $this->getPaymentId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Settlement(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php new file mode 100644 index 00000000000..8443b9f26cc --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php @@ -0,0 +1,286 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of amount. + * @return mixed + */ + public function getAmount() + { + return $this->amount; + } + + /** + * Sets the value of amount. + * @param mixed $amount the amount + * @return void + */ + public function setAmount($amount) + { + $this->amount = $amount; + } + + /** + * Gets the value of currency. + * @return mixed + */ + public function getCurrency() + { + return $this->currency; + } + + /** + * Sets the value of currency. + * @param mixed $currency the currency + * @return void + */ + public function setCurrency($currency) + { + $this->currency = $currency; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of parentId. + * @return mixed + */ + public function getParentId() + { + return $this->parentId; + } + + /** + * Sets the value of parentId. + * @param mixed $parentId the parent id + * @return void + */ + public function setParentId($parentId) + { + $this->parentId = $parentId; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Check if settlement is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if settlement is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php new file mode 100644 index 00000000000..5a047382fc3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php @@ -0,0 +1,48 @@ +validator = $validator; + } + + /** + * Validates given method values against its constraints + * + * @param MethodInterface $method + * @throws Exception\InvalidAttributeValue + */ + public function validate(MethodInterface $method) + { + $constraints = $method->getValidationConstraints(); + if (empty($constraints)) { + return; + } + + $violations = $this->validator->validate( + $method->getAttributes(), + $constraints + ); + + $countable = is_array($violations) || $violations instanceof \Countable; + + if ($countable && count($violations) !== 0) { + throw new Exception\InvalidAttributeValue( + 'Your method contains invalid attribute value', + $violations + ); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php new file mode 100644 index 00000000000..b72aa1ba13d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php @@ -0,0 +1,19 @@ +context->buildViolation($constraint->message) + ->setParameter('{{ param }}', $value) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php new file mode 100644 index 00000000000..a05654aa6fa --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php @@ -0,0 +1,56 @@ +paymentId = $paymentId; + $this->description = $description; + } + + public function getAction() + { + return sprintf('payments/%s/voids', $this->paymentId); + } + + public function getMethod() + { + return MethodInterface::POST; + } + + public function getAttributes() + { + $return = []; + + if ($this->description !== null) { + $return['description'] = $this->description; + } + + return $return; + } + + public function createResultObject() + { + return new VoidPayment(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php new file mode 100644 index 00000000000..75165619d24 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php @@ -0,0 +1,57 @@ +paymentId = $paymentId; + $this->voidId = $voidId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/voids/%s', + $this->getPaymentId(), + $this->getvoidId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new VoidPayment(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getvoidId() + { + return $this->voidId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php new file mode 100644 index 00000000000..01ca7c9a11e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php @@ -0,0 +1,50 @@ +paymentId = $paymentId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/voids', + $this->getPaymentId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new VoidPayment(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php new file mode 100644 index 00000000000..9fba8392ac3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php @@ -0,0 +1,239 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of parentId. + * @return mixed + */ + public function getParentId() + { + return $this->parentId; + } + + /** + * Sets the value of parentId. + * @param mixed $parentId the parent id + * @return void + */ + public function setParentId($parentId) + { + $this->parentId = $parentId; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * Check if void is approved + * @return boolean + */ + public function isApproved() + { + return $this->getStatus() === 'approved'; + } + + /** + * Check if void is declined + * @return boolean + */ + public function isDeclined() + { + return $this->getStatus() === 'declined'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php new file mode 100644 index 00000000000..c010b0d5cf1 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php @@ -0,0 +1,85 @@ +baseConfig = [ + 'consumerKey' => $_ENV['CONSUMER_KEY'], + 'consumerSecret' => $_ENV['CONSUMER_SECRET'], + ]; + $this->log = Client::LOG_NONE; + } + + /** + * Test create client with invalid URL + * + * @return void + */ + public function testInvalidURLEndpoint(){ + + $this->baseConfig['apiEndpoint'] = '123abc'; + try { + Client::create($this->baseConfig, $this->log); + } catch (\Exception $e) { + $this->assertStringContainsString('Your API endpoint is not a valid URL', $e->getMessage()); + } + } + + /** + * Test create client with valid URL, + * + * @return void + */ + public function testValidUrlWrongEndpoint(){ + + $this->baseConfig['apiEndpoint'] = 'https://example.com/'; + + try { + $client = Client::create($this->baseConfig, $this->log); + } catch (\Exception $e) { + $this->assertStringContainsString('error', $e->getMessage()); + } + $this->assertInstanceOf('Cardinity\Client', $client); + } + + /** + * Test create client with valid URL, + * + * @return void + */ + public function testValidURLValidEndpoint(){ + + $this->baseConfig['apiEndpoint'] = 'https://api.cardinity.com/v1/'; + $client = Client::create($this->baseConfig, $this->log); + $this->assertInstanceOf('Cardinity\Client', $client); + } + + /** + * Test create client with valid URL, + * + * @return void + */ + public function testNoEndpoint(){ + + unset($this->baseConfig['apiEndpoint']); + $client = Client::create($this->baseConfig, $this->log); + + $reflection = new \ReflectionObject($client); + $urlProperty = $reflection->getProperty('url'); + $urlProperty->setAccessible(true); + + $this->assertSame($urlProperty->getValue(),'https://api.cardinity.com/v1/'); + $this->assertInstanceOf('Cardinity\Client', $client); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php new file mode 100644 index 00000000000..ba7b7dc07a9 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php @@ -0,0 +1,183 @@ +payment3ds2Params = $this->get3ds2PaymentParams(); + parent::setUp(); + } + + /** + * @dataProvider localhostUrlValidationDataProvider + * @param string $address + * @param string $expectedMessage + * @return void + */ + public function testLocalhostUrlExeptionRised($address, $expectedMessage) + { + $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; + $method = new Payment\Create($this->payment3ds2Params); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function localhostUrlValidationDataProvider() + { + return [ + [ + 'http://localhost', + $this->getRestrictedHostnameErrorMsg('http://localhost'), + ],[ + 'https://localhost', + $this->getRestrictedHostnameErrorMsg('https://localhost'), + ],[ + 'http://127.0.0.1', + $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), + ],[ + 'https://127.0.0.1', + $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), + ] + ]; + } + + + /** + * @dataProvider protocolUrlValidationDataProvider + * @param string $address + * @param string $expectedMessage + * @return void + */ + public function testProtocolUrlExeptionRised($address, $expectedMessage) + { + $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; + $method = new Payment\Create($this->payment3ds2Params); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function protocolUrlValidationDataProvider() + { + return [ + [ + 'ftp://example.com', + 'The protocol of "ftp://example.com" should be "http" or "https".' + ],[ + 'htt://example.com', + 'The protocol of "htt://example.com" should be "http" or "https".' + ],[ + 'f://example.com', + 'The protocol of "f://example.com" should be "http" or "https".' + ] + ]; + } + + + /** + * @dataProvider localhostUrlNotStringDataProvider + * @return void + */ + public function testLocalhostUrlNotStringExeptionRised($address, $expectedMessage) + { + $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; + $method = new Payment\Create($this->payment3ds2Params); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function localhostUrlNotStringDataProvider() + { + return [ + [ + 123, + 'This value should be of type string.' + ],[ + null, + 'This value should not be blank.' + ], + ]; + } + + /** + * @dataProvider browserInfoIpAddressDataProvider + * @param array $address + * @param string $expectedMessage + * @return void + */ + public function testBrowserInfoIpAddressExeptionRised($address, $expectedMessage) + { + $paymentParams = $this->get3ds2PaymentParams($address); + $method = new Payment\Create($paymentParams); + + $this->expectException(Exception\InvalidAttributeValue::class); + $this->expectErrorMessage($expectedMessage); + + $payment = $this->client->call($method); + } + + /** + * @return array + */ + public function browserInfoIpAddressDataProvider() + { + return [ + [ + ['ip_address' => 123], + 'This value should be of type string.' + ],[ + ['ip_address' => ''], + 'This value should not be blank.' + ],[ + ['ip_address' => 'http://localhost'], + $this->getRestrictedHostnameErrorMsg('http://localhost'), + ],[ + ['ip_address' => 'https://localhost'], + $this->getRestrictedHostnameErrorMsg('https://localhost'), + ],[ + ['ip_address' => 'http://127.0.0.1'], + $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), + ],[ + ['ip_address' => 'https://127.0.0.1'], + $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), + ], + ]; + } + + /** + * @param string $address url or ip + * @return string + */ + private function getRestrictedHostnameErrorMsg(string $address) + { + return 'The url "' . $address . + '" contains restricted values. Do not use "localhost" or "127.0.0.1".'; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php new file mode 100644 index 00000000000..1915cd264e7 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php @@ -0,0 +1,160 @@ +client = Client::create($this->getConfig(), $log); + + $this->assertInstanceOf('Cardinity\Client', $this->client); + } + + /** + * @return array + */ + protected function getConfig() + { + return [ + 'consumerKey' => $_ENV['CONSUMER_KEY'], + 'consumerSecret' => $_ENV['CONSUMER_SECRET'], + ]; + } + + /** + * @return array + */ + protected function getPaymentParams() + { + return [ + 'amount' => 50.00, + 'currency' => 'EUR', + 'settle' => false, + 'description' => 'some description', + 'order_id' => '12345678', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '4111111111111111', + 'exp_year' => date('Y') + 4, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Mike Dough' + ], + ]; + } + + /** + * @param array optional + * @return array + */ + public function get3ds2PaymentParams($browserData = []) + { + return array_merge( + $this->getPaymentParams(), + [ + 'threeds2_data' => $this->getThreeDS2Data($browserData) + ] + ); + } + + /** + * @return Payment\Payment + */ + public function getPayment() + { + $payment = new Payment\Payment(); + $payment->setId('foo'); + $payment->setType('bar'); + $payment->setCurrency(null); + $payment->setAmount('55.00'); + $payment->setPaymentMethod(Payment\Create::CARD); + return $payment; + } + + /** + * @param array optional + * @return array + */ + public function getBrowserInfo($args = []) + { + $browserInfo = [ + 'accept_header' => 'Some header', + 'browser_language' => 'LT', + 'screen_width' => 390, + 'screen_height' => 400, + 'challenge_window_size' => '390x400', + 'user_agent' => 'super user agent', + 'color_depth' => 24, + 'time_zone' => -60, + ]; + if ($args) { + foreach($args as $key => $val) { + $browserInfo[$key] = $val; + } + } + return $browserInfo; + } + + /** + * @param array optional + * @return array + */ + public function getAddress($args = []) + { + $address = [ + 'address_line1' => 'first address line', + 'city' => 'balbieriskis', + 'country' => 'LT', + 'postal_code' => '0234' + ]; + if ($args && isset($args['address_line2'])) { + $address['address_line2'] = $args['address_line2']; + } + if ($args && isset($args['address_line3'])) { + $address['address_line3'] = $args['address_line3']; + } + if ($args && isset($args['state'])) { + $address['state'] = $args['state']; + } + return $address; + } + + /** + * @param array optional + * @return array + */ + public function getThreeDS2Data($browserData = []) + { + return [ + 'notification_url' => 'https://notification.url/', + 'browser_info' => $this->getBrowserInfo($browserData), + ]; + } + + /** + * @return Payment\PaymentInstrumentCard + */ + public function getCard() + { + $card = new Payment\PaymentInstrumentCard(); + $card->setCardBrand('Visa'); + $card->setPan('4447'); + $card->setExpYear(date('Y') + 4); + $card->setExpMonth(11); + $card->setHolder('James Bond'); + return $card; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php new file mode 100644 index 00000000000..0fc0cc87b3d --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php @@ -0,0 +1,102 @@ +getMockBuilder('Cardinity\Method\Payment\Get') + ->disableOriginalConstructor() + ->getMock() + ; + } + + /** + * @return void + */ + public function testErrorResultObjectForErrorResponse() + { + $method = $this->getPaymentMethodMock(); + $method->method('getAction')->willReturn('payments'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn(Payment\Get::POST); + + try { + $this->client->call($method); + } catch (\Cardinity\Exception\ValidationFailed $e) { + $result = $e->getResult(); + $this->assertInstanceOf('Cardinity\Method\Error', $result); + $this->assertSame('https://developers.cardinity.com/api/v1/#400', $result->getType()); + $this->assertSame('Validation Failed', $result->getTitle()); + $this->assertStringContainsString('validation errors', $result->getDetail()); + $this->assertTrue(is_array($result->getErrors())); + $this->assertNotEmpty($result->getErrors()); + } + } + + /** + * @return void + */ + public function testUnauthorizedResponse() + { + $client = Client::create([ + 'consumerKey' => 'no', + 'consumerSecret' => 'yes', + ]); + $method = new Payment\Get('xxxyyy'); + $this->expectException(\Cardinity\Exception\Unauthorized::class); + + $client->call($method); + } + + /** + * @return void + */ + public function testBadRequest() + { + $method = $this->getPaymentMethodMock(); + $method->method('getAction')->willReturn('payments'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn(Payment\Get::POST); + + $this->expectException(\Cardinity\Exception\ValidationFailed::class); + $this->client->call($method); + } + + /** + * @return void + */ + public function testNotFound() + { + $method = $this->getPaymentMethodMock(); + $method->method('getAction')->willReturn('my_dreamy_action'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn(Payment\Get::POST); + + $this->expectException(\Cardinity\Exception\NotFound::class); + $this->client->call($method); + } + + /** + * @return void + */ + public function testMethodNotAllowed() + { + $method = $this->getPaymentMethodMock();; + $method->method('getAction')->willReturn('payments'); + $method->method('getAttributes')->willReturn([]); + $method->method('getMethod')->willReturn('DELETE'); + + $this->expectException(\Cardinity\Exception\MethodNotAllowed::class); + $this->client->call($method); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php new file mode 100644 index 00000000000..70e825644f6 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php @@ -0,0 +1,267 @@ +paymentParams = $this->getPaymentParams(); + parent::setUp(); + } + + /** + * @return void + */ + public function testResultObjectSerialization() + { + $payment = $this->getPayment(); + + $card = $this->getCard(); + $payment->setPaymentInstrument($card); + + $info = new Payment\AuthorizationInformation(); + $info->setUrl('http://...'); + $info->setData('some_data'); + $payment->setAuthorizationInformation($info); + + $this->assertSame( + '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}', + $payment->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; + + $payment = new Payment\Payment(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getCurrency()); + $this->assertSame(55.00, $payment->getAmount()); + $this->assertInstanceOf('Cardinity\Method\Payment\AuthorizationInformation', $payment->getAuthorizationInformation()); + $this->assertSame('http://...', $payment->getAuthorizationInformation()->getUrl()); + $this->assertInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard', $payment->getPaymentInstrument()); + $this->assertSame('James Bond', $payment->getPaymentInstrument()->getHolder()); + } + + /** + * @dataProvider invalidAmountValuesData + * @param mixed $amount + * @return void + */ + public function testAmountValidationConstraint($amount) + { + $this->paymentParams['amount'] = $amount; + $method = new Payment\Create($this->paymentParams); + + $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); + $this->client->call($method); + } + + /** + * @return array + */ + public function invalidAmountValuesData() + { + return [ + ['150.01'], + [150], + ]; + } + + /** + * @return void + */ + public function testMissingRequiredAttribute() + { + $params = $this->getPaymentParams(); + unset($params['currency']); + $method = new Payment\Create($params); + $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); + $this->client->call($method); + } + + /** + * Invalid data. Check error message. + * @return void + */ + public function testCreateFailPanValidation() + { + $this->paymentParams['payment_instrument']['pan'] = '4242424242424241'; + $method = new Payment\Create($this->paymentParams); + $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); + $this->client->call($method); + } + + /** + * Invalid data. Generic handling. + * @return void + */ + public function testCreateFailMonthValidation() + { + $this->paymentParams['payment_instrument']['exp_month'] = 13; + $method = new Payment\Create($this->paymentParams); + $this->expectException(\Cardinity\Exception\ValidationFailed::class); + $this->client->call($method); + } + + /** + * @return ResultObject + */ + public function testCreate() + { + $method = new Payment\Create($this->paymentParams); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Payment\Payment + * @return ResultObject + */ + public function testCreateRecurring(Payment\Payment $payment) + { + $params = $this->getPaymentParams(); + $params['payment_method'] = Payment\Create::RECURRING; + $params['payment_instrument'] = [ + 'payment_id' => $payment->getId() + ]; + + $method = new Payment\Create($params); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Payment\Payment + * @return void + */ + public function testGet(Payment\Payment $payment) + { + $method = new Payment\Get($payment->getId()); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + } + + /** + * @return void + */ + public function testGetAll() + { + $method = new Payment\GetAll(5); + $result = $this->client->call($method); + + $this->assertCount(5, $result); + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result[0]); + } + + /** + * @return ResultObject + */ + public function testCreate3dFail() + { + $this->paymentParams['description'] = '3d-fail'; + + $method = new Payment\Create($this->paymentParams); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('pending', $result->getStatus()); + $this->assertSame(true, $result->isPending()); + $this->assertSame('3d-fail', $result->getAuthorizationInformation()->getData()); + + return $result; + } + + /** + * @depends testCreate3dFail + * @param Payment\Payment + */ + public function testFinalizePaymentFail(Payment\Payment $payment) + { + $paymentId = $payment->getId(); + $authorizationInformation = $payment->getAuthorizationInformation()->getData(); + + try { + $method = new Payment\Finalize($paymentId, $authorizationInformation); + $this->client->call($method); + } catch (\Cardinity\Exception\Declined $e) { + $result = $e->getResult(); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('declined', $result->getStatus()); + $this->assertSame(true, $result->isDeclined()); + $this->assertStringContainsString('status: 33333: 3D Secure Authorization Failed.;', $e->getErrorsAsString()); + + return; + } + + $this->fail('An expected exception has not been raised.'); + } + + /** + * @return ResultObject + */ + public function testCreate3dPass() + { + $params = $this->getPaymentParams(); + $params['description'] = '3d-pass'; + + $method = new Payment\Create($params); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('pending', $result->getStatus()); + $this->assertSame(true, $result->isPending()); + $this->assertSame('3d-pass', $result->getAuthorizationInformation()->getData()); + + return $result; + } + + /** + * @depends testCreate3dPass + * @param Payment\Payment + * @return void + */ + public function testFinalizePaymentPass(Payment\Payment $payment) + { + $paymentId = $payment->getId(); + $authorizationInformation = $payment->getAuthorizationInformation()->getData(); + + $method = new Payment\Finalize($paymentId, $authorizationInformation); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('approved', $result->getStatus()); + $this->assertSame(true, $result->isApproved()); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php new file mode 100644 index 00000000000..411c7cba8d8 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php @@ -0,0 +1,130 @@ +setId('foo'); + $refund->setType('bar'); + $refund->setCurrency(null); + $refund->setAmount('55.00'); + + $this->assertSame( + '{"id":"foo","amount":"55.00","type":"bar"}', + $refund->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","amount":"55.00","type":"bar"}'; + + $payment = new Refund\Refund(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getCurrency()); + $this->assertSame(55.00, $payment->getAmount()); + } + + /** + * @return Cardinity\Method\ResultObject $result + */ + public function testCreatePayment() + { + $params = $this->getPaymentParams(); + $params['settle'] = true; + + $method = new Payment\Create($params); + $payment = $this->client->call($method); + + return $payment; + } + + /** + * @depends testCreatePayment + * @param Payment\Payment + * @return void + */ + public function testCreateFail(Payment\Payment $payment) + { + $method = new Refund\Create( + $payment->getId(), + 10.00, + 'fail' + ); + $this->expectException(\Cardinity\Exception\Declined::class); + $this->client->call($method); + } + + /** + * @depends testCreatePayment + * @param Payment\Payment + * @return Cardinity\Method\ResultObject $result + */ + public function testCreate(Payment\Payment $payment) + { + $method = new Refund\Create( + $payment->getId(), + 10.00, + 'my description' + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Refund\Refund + * @return void + */ + public function testGet(Refund\Refund $refund) + { + $method = new Refund\Get( + $refund->getParentId(), + $refund->getId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result); + $this->assertSame($refund->getParentId(), $result->getParentId()); + $this->assertSame('refund', $result->getType()); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame('my description', $result->getDescription()); + } + + /** + * @depends testCreate + * @param Refund\Refund + * @return void + */ + public function testGetAll(Refund\Refund $refund) + { + $method = new Refund\GetAll( + $refund->getParentId() + ); + $result = $this->client->call($method); + + $this->assertIsArray($result); + $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result[0]); + $this->assertSame($refund->getParentId(), $result[0]->getParentId()); + $this->assertSame($refund->getId(), $result[0]->getId()); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php new file mode 100644 index 00000000000..3151248c965 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php @@ -0,0 +1,127 @@ +setId('foo'); + $refund->setType('bar'); + $refund->setCurrency(null); + $refund->setAmount('55.00'); + + $this->assertSame( + '{"id":"foo","amount":"55.00","type":"bar"}', + $refund->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","amount":"55.00","type":"bar"}'; + + $payment = new Settlement\Settlement(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getCurrency()); + $this->assertSame(55.00, $payment->getAmount()); + } + + /** + * @return Cardinity\Method\ResultObject $payment + */ + public function testCreatePayment() + { + $method = new Payment\Create($this->getPaymentParams()); + $payment = $this->client->call($method); + + return $payment; + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return void + */ + public function testCreateFail(Payment\Payment $payment) + { + $method = new Settlement\Create( + $payment->getId(), + 10.00, + 'fail' + ); + $this->expectException(\Cardinity\Exception\Declined::class); + $this->client->call($method); + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return Cardinity\Method\ResultObject $result + */ + public function testCreate(Payment\Payment $payment) + { + $method = new Settlement\Create( + $payment->getId(), + 10.00, + 'my description' + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param Settlement\Settlement $settlement + * @return void + */ + public function testGet(Settlement\Settlement $settlement) + { + $method = new Settlement\Get( + $settlement->getParentId(), + $settlement->getId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); + $this->assertSame($settlement->getParentId(), $result->getParentId()); + $this->assertSame('10.00', $result->getAmount()); + $this->assertSame('settlement', $result->getType()); + $this->assertSame('my description', $result->getDescription()); + } + + /** + * @depends testCreate + * @param Settlement\Settlement $settlement + * @return void + */ + public function testGetAll(Settlement\Settlement $settlement) + { + $method = new Settlement\GetAll( + $settlement->getParentId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result[0]); + $this->assertSame($settlement->getId(), $result[0]->getId()); + $this->assertSame($settlement->getParentId(), $result[0]->getParentId()); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php new file mode 100644 index 00000000000..48503a6ef01 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php @@ -0,0 +1,55 @@ +getThreeDS2Data(); + + $method = new Payment\Create([ + 'amount' => 59.01, + 'currency' => 'EUR', + 'settle' => true, + 'description' => '3ds2-Testing-for-pass', + 'order_id' => 'orderid123', + 'country' => 'LT', + 'payment_method' => Payment\Create::CARD, + 'payment_instrument' => [ + 'pan' => '5454545454545454', + 'exp_year' => date('Y') + 4, + 'exp_month' => 12, + 'cvc' => '456', + 'holder' => 'Shb Mike Dough' + ], + 'threeds2_data' => $threeDS2Data + ]); + + try { + $payment = $this->client->call($method); + $this->assertEquals('pending', $payment->getStatus()); + } catch (Exception\Declined $exception) { + $payment = $exception->getResult(); + $status = $payment->getStatus(); + $errors = $exception->getErrors(); + } catch (Exception\ValidationFailed $exception) { + $payment = $exception->getResult(); + $status = $payment->getStatus(); + $errors = $exception->getErrors(); + } catch (Cardinity\Exception\InvalidAttributeValue $exception) { + $errors = $exception->getErrors(); + } + if (isset($errors)) { + $this->assertContains('[threeds2_data][notification_url]',$errors); + } + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php new file mode 100644 index 00000000000..0fc72ad56c3 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php @@ -0,0 +1,121 @@ +setId('foo'); + $refund->setType('bar'); + $refund->setCreated(null); + + $this->assertSame( + '{"id":"foo","type":"bar"}', + $refund->serialize() + ); + } + + /** + * @return void + */ + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","type":"bar"}'; + + $payment = new VoidPayment\VoidPayment(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getDescription()); + } + + /** + * @return Cardinity\Method\ResultObject $payment + */ + public function testCreatePayment() + { + $method = new Payment\Create($this->getPaymentParams()); + $payment = $this->client->call($method); + + return $payment; + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return void + */ + public function testCreateFail(Payment\Payment $payment) + { + $method = new VoidPayment\Create( + $payment->getId(), + 'fail' + ); + $this->expectException(\Cardinity\Exception\Declined::class); + $this->client->call($method); + } + + /** + * @depends testCreatePayment + * @param Payment\Payment $payment + * @return Cardinity\Method\ResultObject $result + */ + public function testCreate(Payment\Payment $payment) + { + $method = new VoidPayment\Create( + $payment->getId(), + 'my description' + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); + $this->assertSame(true, $result->isApproved()); + + return $result; + } + + /** + * @depends testCreate + * @param VoidPayment\VoidPayment $void + * @return void + */ + public function testGet(VoidPayment\VoidPayment $void) + { + $method = new VoidPayment\Get( + $void->getParentId(), + $void->getId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); + $this->assertSame($void->getParentId(), $result->getParentId()); + $this->assertSame('void', $result->getType()); + $this->assertSame('my description', $result->getDescription()); + } + + /** + * @depends testCreate + * @param VoidPayment\VoidPayment $void + * @return void + */ + public function testGetAll(VoidPayment\VoidPayment $void) + { + $method = new VoidPayment\GetAll( + $void->getParentId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result[0]); + $this->assertSame($void->getParentId(), $result[0]->getParentId()); + $this->assertSame($void->getId(), $result[0]->getId()); + } +} From 2a8cc0c0a97e32d4ef2e37efa8f2198331b854cc Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:16:57 +0000 Subject: [PATCH 14/39] Support for PHP 8.0 and 8.1 --- composer.json | 4 ++-- composer.lock | 2 +- .../storage/vendor/composer/autoload_files.php | 12 ++++++------ .../storage/vendor/composer/autoload_static.php | 12 ++++++------ upload/system/storage/vendor/composer/installed.php | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index e449dc85694..f733d699e96 100644 --- a/composer.json +++ b/composer.json @@ -9,13 +9,13 @@ "vendor-dir": "./upload/system/storage/vendor/" }, "require": { - "divido/divido-php": ">=1.1.1", "php": ">=5.4.0", "scssphp/scssphp": "1.1.1", "zoujingli/wechat-php-sdk": ">=1.3.10", "react/promise": "^2.9", "twig/twig": "^3.3", "braintree/braintree_php": "^6.7", - "cardinity/cardinity-sdk-php": "^3.0" + "cardinity/cardinity-sdk-php": "^3.0", + "divido/divido-php": "^1.15" } } diff --git a/composer.lock b/composer.lock index 5682a2a4828..bbef3aa7ee8 100644 --- a/composer.lock +++ b/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": "3dec0dabb8be44fbf7b638e30ce0d0d7", + "content-hash": "c8e6b0df75305d50d4931f63d0fae38a", "packages": [ { "name": "braintree/braintree_php", diff --git a/upload/system/storage/vendor/composer/autoload_files.php b/upload/system/storage/vendor/composer/autoload_files.php index f5d17e462a7..8426712e368 100644 --- a/upload/system/storage/vendor/composer/autoload_files.php +++ b/upload/system/storage/vendor/composer/autoload_files.php @@ -6,18 +6,18 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', + 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index 507e5f5b5ae..aaed2282f1f 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -7,19 +7,19 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 { public static $files = array ( + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', + 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', ); diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 8afeb9502f6..ee9b3608178 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '6e71e465ce947d5d6b5bede75f26a5ccf0c87a0f', + 'reference' => '2dc57c04167832cc898a55f9f81753c89147ed76', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '6e71e465ce947d5d6b5bede75f26a5ccf0c87a0f', + 'reference' => '2dc57c04167832cc898a55f9f81753c89147ed76', 'dev_requirement' => false, ), 'psr/http-message' => array( From dc52bce172cca03958278bbd16be21d592463aeb Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:18:43 +0000 Subject: [PATCH 15/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/divido/divido-php | 1 - 1 file changed, 1 deletion(-) delete mode 160000 upload/system/storage/vendor/divido/divido-php diff --git a/upload/system/storage/vendor/divido/divido-php b/upload/system/storage/vendor/divido/divido-php deleted file mode 160000 index 799c8945aae..00000000000 --- a/upload/system/storage/vendor/divido/divido-php +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 799c8945aae76caba1970e429e2e0ad0510a940f From 0af787bcce920d0fe76c289bd46e86968a1c68a3 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:19:18 +0000 Subject: [PATCH 16/39] Support for PHP 8.0 and 8.1 --- .../vendor/divido/divido-php/.gitignore | 1 + .../vendor/divido/divido-php/Example.php | 138 + .../vendor/divido/divido-php/README.md | 1771 ++++++ .../vendor/divido/divido-php/composer.json | 30 + .../vendor/divido/divido-php/lib/Divido.php | 45 + .../divido-php/lib/Divido/Activation.php | 50 + .../lib/Divido/ApiConnectionError.php | 5 + .../divido/divido-php/lib/Divido/ApiError.php | 5 + .../divido-php/lib/Divido/ApiRequestor.php | 475 ++ .../divido-php/lib/Divido/ApiResource.php | 218 + .../divido-php/lib/Divido/AttachedObject.php | 23 + .../lib/Divido/AuthenticationError.php | 5 + .../divido-php/lib/Divido/Cancellation.php | 50 + .../divido/divido-php/lib/Divido/Comments.php | 50 + .../divido-php/lib/Divido/CreditRequest.php | 62 + .../divido-php/lib/Divido/DealCalculator.php | 49 + .../divido/divido-php/lib/Divido/Divido.php | 185 + .../divido/divido-php/lib/Divido/Error.php | 29 + .../divido/divido-php/lib/Divido/Finances.php | 50 + .../divido-php/lib/Divido/Fulfillment.php | 50 + .../lib/Divido/InvalidRequestError.php | 12 + .../divido/divido-php/lib/Divido/List.php | 54 + .../divido/divido-php/lib/Divido/Object.php | 265 + .../divido-php/lib/Divido/PaymentError.php | 13 + .../divido-php/lib/Divido/RateLimitError.php | 11 + .../divido/divido-php/lib/Divido/Refund.php | 50 + .../divido-php/lib/Divido/SendApplication.php | 50 + .../lib/Divido/SingletonApiResource.php | 31 + .../divido/divido-php/lib/Divido/Util.php | 89 + .../divido/divido-php/lib/Divido/Util/Set.php | 39 + .../divido-php/lib/data/ca-certificates.crt | 5165 +++++++++++++++++ 31 files changed, 9070 insertions(+) create mode 100644 upload/system/storage/vendor/divido/divido-php/.gitignore create mode 100644 upload/system/storage/vendor/divido/divido-php/Example.php create mode 100644 upload/system/storage/vendor/divido/divido-php/README.md create mode 100644 upload/system/storage/vendor/divido/divido-php/composer.json create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Activation.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/ApiConnectionError.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/ApiError.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/ApiRequestor.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/ApiResource.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/AttachedObject.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/AuthenticationError.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Cancellation.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Comments.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/CreditRequest.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/DealCalculator.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Divido.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Error.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Finances.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Fulfillment.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/InvalidRequestError.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/List.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Object.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/PaymentError.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/RateLimitError.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Refund.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/SendApplication.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/SingletonApiResource.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Util.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/Divido/Util/Set.php create mode 100644 upload/system/storage/vendor/divido/divido-php/lib/data/ca-certificates.crt diff --git a/upload/system/storage/vendor/divido/divido-php/.gitignore b/upload/system/storage/vendor/divido/divido-php/.gitignore new file mode 100644 index 00000000000..e43b0f98895 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/upload/system/storage/vendor/divido/divido-php/Example.php b/upload/system/storage/vendor/divido/divido-php/Example.php new file mode 100644 index 00000000000..88de621d90e --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/Example.php @@ -0,0 +1,138 @@ + "GB", + "finance" => $_POST['finance'], + "reference"=>$_POST['reference'], + "customer" => array( + "title" => $_POST['title'], + "first_name" => $_POST['firstName'], + "middle_name" => $_POST['middleName'], + "last_name" => $_POST['lastName'], + "email" => $_POST['email'], + "mobileNumber" => $_POST['mobileNumber'], + "phoneNumber" => $_POST['phoneNumber'], + "postcode" => $_POST['postCode'], + "country" => $_POST['country'], + ), + "metadata"=>array( + "orderNumber"=>10001, + "checksum"=>md5('10001:mySecret') + ), + "products"=>array( + array( + "type"=>"product", + "text"=>"Gibson Les Paul Studio Raw Guitar", + "quantity"=>1, + "value"=>1153.00, + ), + array( + "type"=>"service", + "text"=>"Restring Upgrade", + "quantity"=>1, + "value"=>100.00, + ), + ), + "response_url"=>"http://www.webshop.com/callback.php", + 'checkout_url'=>'http://www.webshop.com/checkout', + "redirect_url"=>"http://www.webshop.com/success.php", + )); + + if ($response->status == 'ok') { + header("Location:".$response->url); + } else { + print_r($response->__toArray()); + } + +} else { + ?> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Finance:
    Reference:
    Amount:£
    Deposit:£
     
    Title:
    First Name:
    Middle Name:
    Last Name:
    Phone:
    Mobile:
    Email:
    Post Code:
    Country:
    + + + + + +
    + =5.2.0", + "ext-curl": "*" + }, + "autoload": { + "psr-0": { + "Divido":"lib" + } + }, + "extra": { + "branch-alias": { + "master":"2.0-dev", + "v1.1.1":"1.1.1-dev" + } + }, + "minimum-stability": "dev" +} \ No newline at end of file diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido.php new file mode 100644 index 00000000000..2b533ce67b3 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido.php @@ -0,0 +1,45 @@ +_apiKey = $apiKey; + $this->_sharedSecret = $sharedSecret; + } + + /** + * @param string $url The path to the API endpoint. + * + * @returns string The full path. + */ + public static function apiUrl($url = '') + { + $apiBase = Divido::$apiBase; + return "$apiBase$url"; + } + + /** + * @param string|mixed $value A string to UTF8-encode. + * + * @returns string|mixed The UTF8-encoded string, or the object passed in if + * it wasn't a string. + */ + public static function utf8($value) + { + if (is_string($value) + && mb_detect_encoding($value, "UTF-8", true) != "UTF-8") { + return utf8_encode($value); + } else { + return $value; + } + } + + private static function _encodeObjects($d) + { + if ($d instanceof Divido_ApiResource) { + return self::utf8($d->id); + } else if ($d === true) { + return 'true'; + } else if ($d === false) { + return 'false'; + } else if (is_array($d)) { + $res = array(); + foreach ($d as $k => $v) { + $res[$k] = self::_encodeObjects($v); + } + + return $res; + } else { + return self::utf8($d); + } + } + + /** + * @param array $arr An map of param keys to values. + * @param string|null $prefix (It doesn't look like we ever use $prefix...) + * + * @returns string A querystring, essentially. + */ + public static function encode($arr, $prefix = null) + { + if (!is_array($arr)) { + return $arr; + } + + $r = array(); + foreach ($arr as $k => $v) { + if (is_null($v)) { + continue; + } + + if ($prefix && $k && !is_int($k)) { + $k = $prefix . "[" . $k . "]"; + } else if ($prefix) { + $k = $prefix . "[]"; + } + + if (is_array($v)) { + $r[] = self::encode($v, $k, true); + } else { + $r[] = urlencode($k) . "=" . urlencode($v); + } + } + + return implode("&", $r); + } + + /** + * @param string $method + * @param string $url + * @param array|null $params + * + * @return array An array whose first element is the response and second + * element is the API key used to make the request. + */ + public function request($method, $url, $params = null) + { + if (!$params) { + $params = array(); + } + + list($rbody, $rcode, $myApiKey) = $this->_requestRaw($method, $url, $params); + + $resp = $this->_interpretResponse($rbody, $rcode); + return array($resp, $myApiKey); + } + + /** + * @param string $rbody A JSON string. + * @param int $rcode + * @param array $resp + * + * @throws Divido_InvalidRequestError if the error is caused by the user. + * @throws Divido_AuthenticationError if the error is caused by a lack of + * permissions. + * @throws Divido_PaymentError if the error is the error code is 402 (payment + * required) + * @throws Divido_ApiError otherwise. + */ + public function handleApiError($rbody, $rcode, $resp) + { + if (!is_array($resp) || !isset($resp['error'])) { + $msg = "Invalid response object from API: $rbody " + . "(HTTP response code was $rcode)"; + throw new Divido_ApiError($msg, $rcode, $rbody, $resp); + } + + $error = $resp['error']; + $msg = isset($error['message']) ? $error['message'] : null; + $param = isset($error['param']) ? $error['param'] : null; + $code = isset($error['code']) ? $error['code'] : null; + + switch ($rcode) { + case 400: + if ($code == 'rate_limit') { + throw new Divido_RateLimitError( + $msg, $param, $rcode, $rbody, $resp + ); + } + case 404: + throw new Divido_InvalidRequestError( + $msg, $param, $rcode, $rbody, $resp + ); + case 401: + throw new Divido_AuthenticationError($msg, $rcode, $rbody, $resp); + case 402: + throw new Divido_PaymentError($msg, $param, $code, $rcode, $rbody, $resp); + default: + throw new Divido_ApiError($msg, $rcode, $rbody, $resp); + } + } + + private function _requestRaw($method, $url, $params) + { + $myApiKey = $this->_apiKey; + if (!$myApiKey) { + $myApiKey = Divido::$apiKey; + } + + $sharedSecret = $this->_sharedSecret; + if (!$sharedSecret) { + $sharedSecret = Divido::$sharedSecret; + } + + if (!$myApiKey) { + $msg = 'No API key provided. (HINT: set your API key using ' + . '"Divido::setApiKey()". You can generate API keys from ' + . 'the Divido web interface. See http://docs.divido.com/api for ' + . 'details, or email support@divido.com if you have any questions.'; + throw new Divido_AuthenticationError($msg); + } + + $absUrl = $this->apiUrl($url); + $params = self::_encodeObjects($params); + $langVersion = phpversion(); + $uname = php_uname(); + $ua = array( + 'bindings_version' => Divido::VERSION, + 'lang' => 'php', + 'lang_version' => $langVersion, + 'publisher' => 'divido', + 'uname' => $uname, + ); + + $headers = array( + 'X-Divido-Client-User-Agent: ' . json_encode($ua), + 'User-Agent: Divido/v1 PhpBindings/' . Divido::VERSION, + 'Authorization: Bearer ' . $myApiKey, + 'Content-Type: application/x-www-form-urlencoded', + ); + + if (!empty($sharedSecret)) { + $queryString = http_build_query($params); + $string = (strlen($queryString)) ? $url . "?" . $queryString : $url; + $hmac = base64_encode(hash_hmac('sha256', $string, $sharedSecret, true)); + + $headers[] = 'X-DIVIDO-HMAC-SHA256: ' . $hmac; + } + + if (Divido::$apiVersion) { + $headers[] = 'Divido-Version: ' . Divido::$apiVersion; + } + list($rbody, $rcode) = $this->_curlRequest( + $method, + $absUrl, + $headers, + $params + ); + return array($rbody, $rcode, $myApiKey); + } + + private function _interpretResponse($rbody, $rcode) + { + try { + $resp = json_decode($rbody, true); + } catch (Exception $e) { + $msg = "Invalid response body from API: $rbody " + . "(HTTP response code was $rcode)"; + throw new Divido_ApiError($msg, $rcode, $rbody); + } + + if ($rcode < 200 || $rcode >= 300) { + $this->handleApiError($rbody, $rcode, $resp); + } + return $resp; + } + + private function _curlRequest($method, $absUrl, $headers, $params) + { + + if (!self::$_preFlight) { + self::$_preFlight = $this->checkSslCert($this->apiUrl()); + } + + /* + $myApiKey = $this->_apiKey; + if (!$myApiKey) + $myApiKey = Divido::$apiKey; + + if (!isset($params['merchant'])) { + $params['merchant'] = $myApiKey; + } + */ + + $curl = curl_init(); + $method = strtolower($method); + $opts = array(); + + if ($method == 'get') { + $opts[CURLOPT_HTTPGET] = 1; + if (count($params) > 0) { + $encoded = self::encode($params); + $absUrl = "$absUrl?$encoded"; + } + } else if ($method == 'post') { + $opts[CURLOPT_POST] = 1; + //$opts[CURLOPT_POSTFIELDS] = self::encode($params); + $opts[CURLOPT_POSTFIELDS] = http_build_query($params); + } else if ($method == 'delete') { + $opts[CURLOPT_CUSTOMREQUEST] = 'DELETE'; + if (count($params) > 0) { + $encoded = self::encode($params); + $absUrl = "$absUrl?$encoded"; + } + } else { + throw new Divido_ApiError("Unrecognized method $method"); + } + + $absUrl = self::utf8($absUrl); + // print "absUrl: ".$absUrl."
    "; + $opts[CURLOPT_URL] = $absUrl; + + /* + if (isset($myApiKey)) { + // $opts[CURLOPT_USERPWD] = $params['merchant'].":"; + curl_setopt($curl,CURLOPT_USERPWD,$myApiKey.":"); + } + */ + $opts[CURLOPT_RETURNTRANSFER] = true; + $opts[CURLOPT_CONNECTTIMEOUT] = 30; + $opts[CURLOPT_TIMEOUT] = 80; + $opts[CURLOPT_RETURNTRANSFER] = true; + $opts[CURLOPT_HTTPHEADER] = $headers; + if (!Divido::$verifySslCerts) { + $opts[CURLOPT_SSL_VERIFYPEER] = false; + } + + curl_setopt_array($curl, $opts); + $rbody = curl_exec($curl); + + // print_r($params);exit; + // print "url: ".$absUrl;Exit; + // print "rbody: " . $rbody;exit; + + if (!defined('CURLE_SSL_CACERT_BADFILE')) { + define('CURLE_SSL_CACERT_BADFILE', 77); // constant not defined in PHP + } + + $errno = curl_errno($curl); + if ($errno == CURLE_SSL_CACERT || + $errno == CURLE_SSL_PEER_CERTIFICATE || + $errno == CURLE_SSL_CACERT_BADFILE) { + array_push( + $headers, + 'X-Divido-Client-Info: {"ca":"using Divido-supplied CA bundle"}' + ); + $cert = $this->caBundle(); + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + curl_setopt($curl, CURLOPT_CAINFO, $cert); + $rbody = curl_exec($curl); + } + + if ($rbody === false) { + $errno = curl_errno($curl); + $message = curl_error($curl); + curl_close($curl); + $this->handleCurlError($errno, $message); + } + + $rcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + curl_close($curl); + return array($rbody, $rcode); + } + + /** + * @param number $errno + * @param string $message + * @throws Divido_ApiConnectionError + */ + public function handleCurlError($errno, $message) + { + $apiBase = Divido::$apiBase; + switch ($errno) { + case CURLE_COULDNT_CONNECT: + case CURLE_COULDNT_RESOLVE_HOST: + case CURLE_OPERATION_TIMEOUTED: + $msg = "Could not connect to Divido ($apiBase). Please check your " + . "internet connection and try again. If this problem persists, " + . "you should check Divido's service status at " + . "https://twitter.com/dividostatus, or"; + break; + case CURLE_SSL_CACERT: + case CURLE_SSL_PEER_CERTIFICATE: + $msg = "Could not verify Divido's SSL certificate. Please make sure " + . "that your network is not intercepting certificates. " + . "(Try going to $apiBase in your browser.) " + . "If this problem persists,"; + break; + default: + $msg = "Unexpected error communicating with Divido. " + . "If this problem persists,"; + } + $msg .= " let us know at support@divido.com."; + + $msg .= "\n\n(Network error [errno $errno]: $message)"; + throw new Divido_ApiConnectionError($msg); + } + + /** + * Preflight the SSL certificate presented by the backend. This isn't 100% + * bulletproof, in that we're not actually validating the transport used to + * communicate with Divido, merely that the first attempt to does not use a + * revoked certificate. + * + * Unfortunately the interface to OpenSSL doesn't make it easy to check the + * certificate before sending potentially sensitive data on the wire. This + * approach raises the bar for an attacker significantly. + */ + private function checkSslCert($url) + { + + return true; + + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + error_log( + 'Warning: This version of PHP is too old to check SSL certificates ' . + 'correctly. Divido cannot guarantee that the server has a ' . + 'certificate which is not blacklisted' + ); + return true; + } + + if (strpos(PHP_VERSION, 'hiphop') !== false) { + error_log( + 'Warning: HHVM does not support Divido\'s SSL certificate ' . + 'verification. (See http://docs.hhvm.com/manual/en/context.ssl.php) ' . + 'Divido cannot guarantee that the server has a certificate which is ' . + 'not blacklisted' + ); + return true; + } + + $url = parse_url($url); + $port = isset($url["port"]) ? $url["port"] : 443; + $url = "ssl://{$url["host"]}:{$port}"; + + $sslContext = stream_context_create( + array('ssl' => array( + 'capture_peer_cert' => true, + 'verify_peer' => true, + 'cafile' => $this->caBundle(), + )) + ); + $result = stream_socket_client( + $url, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $sslContext + ); + if ($errno !== 0) { + $apiBase = Divido::$apiBase; + throw new Divido_ApiConnectionError( + 'Could not connect to Divido (' . $apiBase . '). Please check your ' . + 'internet connection and try again. If this problem persists, ' . + 'you should check Divido\'s service status at ' . + 'https://twitter.com/dividostatus. Reason was: ' . $errstr + ); + } + + $params = stream_context_get_params($result); + + $cert = $params['options']['ssl']['peer_certificate']; + + openssl_x509_export($cert, $pemCert); + + if (self::isBlackListed($pemCert)) { + throw new Divido_ApiConnectionError( + 'Invalid server certificate. You tried to connect to a server that ' . + 'has a revoked SSL certificate, which means we cannot securely send ' . + 'data to that server. Please email support@divido.com if you need ' . + 'help connecting to the correct API server.' + ); + } + + return true; + } + + /* Checks if a valid PEM encoded certificate is blacklisted + * @return boolean + */ + public static function isBlackListed($certificate) + { + $certificate = trim($certificate); + $lines = explode("\n", $certificate); + + // Kludgily remove the PEM padding + array_shift($lines); + array_pop($lines); + + $derCert = base64_decode(implode("", $lines)); + $fingerprint = sha1($derCert); + return in_array($fingerprint, self::blacklistedCerts()); + } + + private function caBundle() + { + return dirname(__FILE__) . '/../data/ca-certificates.crt'; + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/ApiResource.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/ApiResource.php new file mode 100644 index 00000000000..6241ac192e4 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/ApiResource.php @@ -0,0 +1,218 @@ +refresh(); + return $instance; + } + + /** + * @returns Divido_ApiResource The refreshed resource. + */ + public function refresh() + { + $requestor = new Divido_ApiRequestor($this->_apiKey); + $url = $this->instanceUrl(); + + list($response, $apiKey) = $requestor->request( + 'get', + $url, + $this->_retrieveOptions + ); + $this->refreshFrom($response, $apiKey); + return $this; + } + + /** + * @param string $class + * + * @returns string The name of the class, with namespacing and underscores + * stripped. + */ + public static function className($class) + { + // Useful for namespaces: Foo\Divido_Charge + if ($postfixNamespaces = strrchr($class, '\\')) { + $class = substr($postfixNamespaces, 1); + } + // Useful for underscored 'namespaces': Foo_Divido_Charge + if ($postfixFakeNamespaces = strrchr($class, 'Divido_')) { + $class = $postfixFakeNamespaces; + } + if (substr($class, 0, strlen('Divido')) == 'Divido') { + $class = substr($class, strlen('Divido')); + } + $class = str_replace('_', '', $class); + $name = urlencode($class); + + $name = strtolower($name); + return $name; + } + + /** + * @param string $class + * + * @returns string The endpoint URL for the given class. + */ + public static function classUrl($class) + { + $base = self::_scopedLsb($class, 'className', $class); + return "/v1/${base}"; + } + + /** + * @returns string The full API URL for this API resource. + */ + public function instanceUrl() + { + $id = $this['id']; + $class = get_class($this); + if ($id === null) { + $message = "Could not determine which URL to request: " + . "$class instance has invalid ID: $id"; + throw new Divido_InvalidRequestError($message, null); + } + $id = Divido_ApiRequestor::utf8($id); + $base = $this->_lsb('classUrl', $class); + $extn = urlencode($id); + return "$base/$extn"; + } + + private static function _validateCall($method, $params=null, $apiKey=null) + { + if ($params && !is_array($params)) { + $message = "You must pass an array as the first argument to Divido API " + . "method calls. (HINT: an example call to create a charge " + . "would be: \"DividoCharge::create(array('amount' => 100, " + . "'currency' => 'usd', 'card' => array('number' => " + . "4242424242424242, 'exp_month' => 5, 'exp_year' => 2015)))\")"; + throw new Divido_Error($message); + } + + if ($apiKey && !is_string($apiKey)) { + $message = 'The second argument to Divido API method calls is an ' + . 'optional per-request apiKey, which must be a string. ' + . '(HINT: you can set a global apiKey by ' + . '"Divido::setApiKey()")'; + throw new Divido_Error($message); + } + } + + protected static function _scopedAll($class, $params=null, $apiKey=null) + { + self::_validateCall('all', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('get', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedSendApplicationRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('sendApplicationRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedCreditRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('creditRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedFinalizeRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('finalizeRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + $url = $url."/finalize"; + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedFulfillRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('fulfillRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedActivateRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('activateRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedCancellationRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('cancelRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedRefundRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('refundRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedCommentRequest($class, $params=null, $apiKey=null) + { + self::_validateCall('commentRequest', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected static function _scopedCreate($class, $params=null, $apiKey=null) + { + self::_validateCall('create', $params, $apiKey); + $requestor = new Divido_ApiRequestor($apiKey); + $url = self::_scopedLsb($class, 'classUrl', $class); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + protected function _scopedSave($class, $apiKey=null) + { + self::_validateCall('save'); + $requestor = new Divido_ApiRequestor($apiKey); + $params = $this->serializeParameters(); + + if (count($params) > 0) { + $url = $this->instanceUrl(); + list($response, $apiKey) = $requestor->request('post', $url, $params); + $this->refreshFrom($response, $apiKey); + } + return $this; + } + + protected function _scopedDelete($class, $params=null) + { + self::_validateCall('delete'); + $requestor = new Divido_ApiRequestor($this->_apiKey); + $url = $this->instanceUrl(); + list($response, $apiKey) = $requestor->request('delete', $url, $params); + $this->refreshFrom($response, $apiKey); + return $this; + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/AttachedObject.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/AttachedObject.php new file mode 100644 index 00000000000..c1f56fce22f --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/AttachedObject.php @@ -0,0 +1,23 @@ +_values), array_keys($properties)); + // Don't unset, but rather set to null so we send up '' for deletion. + foreach ($removed as $k) { + $this->$k = null; + } + + foreach ($properties as $k => $v) { + $this->$k = $v; + } + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/AuthenticationError.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/AuthenticationError.php new file mode 100644 index 00000000000..0c2602dcc43 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/AuthenticationError.php @@ -0,0 +1,5 @@ +httpStatus = $httpStatus; + $this->httpBody = $httpBody; + $this->jsonBody = $jsonBody; + } + + public function getHttpStatus() + { + return $this->httpStatus; + } + + public function getHttpBody() + { + return $this->httpBody; + } + + public function getJsonBody() + { + return $this->jsonBody; + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/Finances.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Finances.php new file mode 100644 index 00000000000..3d58f8c6ef2 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Finances.php @@ -0,0 +1,50 @@ +param = $param; + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/List.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/List.php new file mode 100644 index 00000000000..e707de600b4 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/List.php @@ -0,0 +1,54 @@ +extractPathAndUpdateParams($params); + + $requestor = new Divido_ApiRequestor($this->_apiKey); + list($response, $apiKey) = $requestor->request('get', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + public function create($params=null) + { + list($url, $params) = $this->extractPathAndUpdateParams($params); + + $requestor = new Divido_ApiRequestor($this->_apiKey); + list($response, $apiKey) = $requestor->request('post', $url, $params); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + public function retrieve($id, $params=null) + { + list($url, $params) = $this->extractPathAndUpdateParams($params); + + $requestor = new Divido_ApiRequestor($this->_apiKey); + $id = Divido_ApiRequestor::utf8($id); + $extn = urlencode($id); + list($response, $apiKey) = $requestor->request( + 'get', "$url/$extn", $params + ); + return Divido_Util::convertToDividoObject($response, $apiKey); + } + + private function extractPathAndUpdateParams($params) + { + $url = parse_url($this->url); + if (!isset($url['path'])) { + throw new Divido_APIError("Could not parse list url into parts: $url"); + } + + if (isset($url['query'])) { + // If the URL contains a query param, parse it out into $params so they + // don't interact weirdly with each other. + $query = array(); + parse_str($url['query'], $query); + // PHP 5.2 doesn't support the ?: operator :( + $params = array_merge($params ? $params : array(), $query); + } + + return array($url['path'], $params); + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/Object.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Object.php new file mode 100644 index 00000000000..f784b0e8c0a --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Object.php @@ -0,0 +1,265 @@ +_apiKey = $apiKey; + $this->_values = array(); + $this->_unsavedValues = new Divido_Util_Set(); + $this->_transientValues = new Divido_Util_Set(); + + $this->_retrieveOptions = array(); + if (is_array($id)) { + foreach ($id as $key => $value) { + if ($key != 'id') { + $this->_retrieveOptions[$key] = $value; + } + } + $id = $id['id']; + } + + if ($id !== null) { + $this->id = $id; + } + } + + // Standard accessor magic methods + public function __set($k, $v) + { + if ($v === "") { + throw new InvalidArgumentException( + 'You cannot set \''.$k.'\'to an empty string. ' + .'We interpret empty strings as NULL in requests. ' + .'You may set obj->'.$k.' = NULL to delete the property' + ); + } + + if (self::$nestedUpdatableAttributes->includes($k) + && isset($this->$k) && is_array($v)) { + $this->$k->replaceWith($v); + } else { + // TODO: may want to clear from $_transientValues (Won't be user-visible). + $this->_values[$k] = $v; + } + if (!self::$permanentAttributes->includes($k)) + $this->_unsavedValues->add($k); + } + public function __isset($k) + { + return isset($this->_values[$k]); + } + public function __unset($k) + { + unset($this->_values[$k]); + $this->_transientValues->add($k); + $this->_unsavedValues->discard($k); + } + public function __get($k) + { + if (array_key_exists($k, $this->_values)) { + return $this->_values[$k]; + } else if ($this->_transientValues->includes($k)) { + $class = get_class($this); + $attrs = join(', ', array_keys($this->_values)); + $message = "Divido Notice: Undefined property of $class instance: $k. " + . "HINT: The $k attribute was set in the past, however. " + . "It was then wiped when refreshing the object " + . "with the result returned by Divido's API, " + . "probably as a result of a save(). The attributes currently " + . "available on this object are: $attrs"; + error_log($message); + return null; + } else { + $class = get_class($this); + error_log("Divido Notice: Undefined property of $class instance: $k"); + return null; + } + } + + // ArrayAccess methods + public function offsetSet($k, $v) + { + $this->$k = $v; + } + + public function offsetExists($k) + { + return array_key_exists($k, $this->_values); + } + + public function offsetUnset($k) + { + unset($this->$k); + } + public function offsetGet($k) + { + return array_key_exists($k, $this->_values) ? $this->_values[$k] : null; + } + + public function keys() + { + return array_keys($this->_values); + } + + /** + * This unfortunately needs to be public to be used in Util.php + * + * @param string $class + * @param array $values + * @param string|null $apiKey + * + * @return Divido_Object The object constructed from the given values. + */ + public static function scopedConstructFrom($class, $values, $apiKey=null) + { + $obj = new $class(isset($values['id']) ? $values['id'] : null, $apiKey); + $obj->refreshFrom($values, $apiKey); + return $obj; + } + + /** + * @param array $values + * @param string|null $apiKey + * + * @return Divido_Object The object of the same class as $this constructed + * from the given values. + */ + public static function constructFrom($values, $apiKey=null) + { + return self::scopedConstructFrom(__CLASS__, $values, $apiKey); + } + + /** + * Refreshes this object using the provided values. + * + * @param array $values + * @param string $apiKey + * @param boolean $partial Defaults to false. + */ + public function refreshFrom($values, $apiKey, $partial=false) + { + $this->_apiKey = $apiKey; + + // Wipe old state before setting new. This is useful for e.g. updating a + // customer, where there is no persistent card parameter. Mark those values + // which don't persist as transient + if ($partial) { + $removed = new Divido_Util_Set(); + } else { + $removed = array_diff(array_keys($this->_values), array_keys($values)); + } + + foreach ($removed as $k) { + if (self::$permanentAttributes->includes($k)) + continue; + unset($this->$k); + } + + foreach ($values as $k => $v) { + if (self::$permanentAttributes->includes($k) && isset($this[$k])) + continue; + + if (self::$nestedUpdatableAttributes->includes($k) && is_array($v)) { + $this->_values[$k] = Divido_Object::scopedConstructFrom( + 'Divido_AttachedObject', $v, $apiKey + ); + } else { + $this->_values[$k] = Divido_Util::convertToDividoObject($v, $apiKey); + } + + $this->_transientValues->discard($k); + $this->_unsavedValues->discard($k); + } + } + + /** + * @return array A recursive mapping of attributes to values for this object, + * including the proper value for deleted attributes. + */ + public function serializeParameters() + { + $params = array(); + if ($this->_unsavedValues) { + foreach ($this->_unsavedValues->toArray() as $k) { + $v = $this->$k; + if ($v === NULL) { + $v = ''; + } + $params[$k] = $v; + } + } + + // Get nested updates. + foreach (self::$nestedUpdatableAttributes->toArray() as $property) { + if (isset($this->$property) + && $this->$property instanceOf Divido_Object) { + $params[$property] = $this->$property->serializeParameters(); + } + } + return $params; + } + + // Pretend to have late static bindings, even in PHP 5.2 + protected function _lsb($method) + { + $class = get_class($this); + $args = array_slice(func_get_args(), 1); + return call_user_func_array(array($class, $method), $args); + } + protected static function _scopedLsb($class, $method) + { + $args = array_slice(func_get_args(), 2); + return call_user_func_array(array($class, $method), $args); + } + + public function __toJSON() + { + if (defined('JSON_PRETTY_PRINT')) { + return json_encode($this->__toArray(true), JSON_PRETTY_PRINT); + } else { + return json_encode($this->__toArray(true)); + } + } + + public function __toString() + { + $class = get_class($this); + return $class . ' JSON: ' . $this->__toJSON(); + } + + public function __toArray($recursive=false) + { + if ($recursive) { + return Divido_Util::convertDividoObjectToArray($this->_values); + } else { + return $this->_values; + } + } +} + + +Divido_Object::init(); diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/PaymentError.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/PaymentError.php new file mode 100644 index 00000000000..dddf94e1a83 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/PaymentError.php @@ -0,0 +1,13 @@ +param = $param; + $this->code = $code; + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/RateLimitError.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/RateLimitError.php new file mode 100644 index 00000000000..e7baf6161b5 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/RateLimitError.php @@ -0,0 +1,11 @@ +refresh(); + return $instance; + } + + /** + * @param Divido_SingletonApiResource $class + * @return string The endpoint associated with this singleton class. + */ + public static function classUrl($class) + { + $base = self::className($class); + return "/v1/${base}"; + } + + /** + * @return string The endpoint associated with this singleton API resource. + */ + public function instanceUrl() + { + $class = get_class($this); + $base = self::classUrl($class); + return "$base"; + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/Util.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Util.php new file mode 100644 index 00000000000..c7031da1fc3 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Util.php @@ -0,0 +1,89 @@ + $v) { + // FIXME: this is an encapsulation violation + if ($k[0] == '_') { + continue; + } + if ($v instanceof Divido_Object) { + $results[$k] = $v->__toArray(true); + } else if (is_array($v)) { + $results[$k] = self::convertDividoObjectToArray($v); + } else { + $results[$k] = $v; + } + } + return $results; + } + + /** + * Converts a response from the Divido API to the corresponding PHP object. + * + * @param array $resp The response from the Divido API. + * @param string $apiKey + * @return Divido_Object|array + */ + public static function convertToDividoObject($resp, $apiKey) + { + $types = array( + 'customer' => 'Divido_Customer', + 'list' => 'Divido_List', + 'invoice' => 'Divido_Invoice', + 'invoiceitem' => 'Divido_InvoiceItem', + 'event' => 'Divido_Event', + 'transfer' => 'Divido_Transfer', + 'plan' => 'Divido_Plan', + 'recipient' => 'Divido_Recipient', + 'refund' => 'Divido_Refund', + 'subscription' => 'Divido_Subscription', + 'fee_refund' => 'Divido_ApplicationFeeRefund' + ); + if (self::isList($resp)) { + $mapped = array(); + foreach ($resp as $i) + array_push($mapped, self::convertToDividoObject($i, $apiKey)); + return $mapped; + } else if (is_array($resp)) { + if (isset($resp['object']) + && is_string($resp['object']) + && isset($types[$resp['object']])) { + $class = $types[$resp['object']]; + } else { + $class = 'Divido_Object'; + } + return Divido_Object::scopedConstructFrom($class, $resp, $apiKey); + } else { + return $resp; + } + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/Divido/Util/Set.php b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Util/Set.php new file mode 100644 index 00000000000..af6cef9d563 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/Divido/Util/Set.php @@ -0,0 +1,39 @@ +_elts = array(); + foreach ($members as $item) { + $this->_elts[$item] = true; + } + } + + public function includes($elt) + { + return isset($this->_elts[$elt]); + } + + public function add($elt) + { + $this->_elts[$elt] = true; + } + + public function discard($elt) + { + unset($this->_elts[$elt]); + } + + public function toArray() + { + return array_keys($this->_elts); + } + + public function getIterator() + { + return new ArrayIterator($this->toArray()); + } +} diff --git a/upload/system/storage/vendor/divido/divido-php/lib/data/ca-certificates.crt b/upload/system/storage/vendor/divido/divido-php/lib/data/ca-certificates.crt new file mode 100644 index 00000000000..0e11f6d8703 --- /dev/null +++ b/upload/system/storage/vendor/divido/divido-php/lib/data/ca-certificates.crt @@ -0,0 +1,5165 @@ +# Generated by https://gist.github.com/ab/9756531 on 2014-03-25 +# from Ubuntu ca-certificates 20130906. +# See http://www.ubuntu.com/usn/usn-2154-1/ for version info. + +================================================================ +C: AT +O: A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH +OU: A-Trust-nQual-03 +CN: A-Trust-nQual-03 +-----BEGIN CERTIFICATE----- +MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJB +VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp +bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5R +dWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5RdWFsLTAzMB4XDTA1MDgxNzIyMDAw +MFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgwRgYDVQQKDD9BLVRy +dXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0ZW52 +ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMM +EEEtVHJ1c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCtPWFuA/OQO8BBC4SAzewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUj +lUC5B3ilJfYKvUWG6Nm9wASOhURh73+nyfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZ +znF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPESU7l0+m0iKsMrmKS1GWH +2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4iHQF63n1 +k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs +2e3Vcuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYD +VR0OBAoECERqlWdVeRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC +AQEAVdRU0VlIXLOThaq/Yy/kgM40ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fG +KOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmrsQd7TZjTXLDR8KdCoLXEjq/+ +8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZdJXDRZslo+S4R +FGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS +mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmE +DNuxUCAKGkq6ahq97BvIxYSazQ== +-----END CERTIFICATE----- + +================================================================ +C: BE +O: GlobalSign nv-sa +OU: Root CA +CN: GlobalSign Root CA +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B +AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz +yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE +38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP +AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad +DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME +HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +================================================================ +C: BM +O: QuoVadis Limited +CN: QuoVadis Root CA 2 +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa +GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg +Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J +WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB +rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp ++ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1 +ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i +Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz +PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og +/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH +oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI +yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud +EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2 +A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL +MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f +BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn +g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl +fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K +WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha +B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc +hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR +TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD +mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z +ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y +4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza +8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +================================================================ +C: BM +O: QuoVadis Limited +CN: QuoVadis Root CA 3 +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM +V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB +4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr +H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd +8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv +vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT +mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe +btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc +T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt +WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ +c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A +4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD +VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG +CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0 +aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu +dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw +czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G +A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC +TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg +Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0 +7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem +d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd ++LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B +4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN +t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x +DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 +k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s +zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j +Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT +mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK +4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +================================================================ +C: BM +O: QuoVadis Limited +OU: Root Certification Authority +CN: QuoVadis Root Certification Authority +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC +TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz +MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw +IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR +dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp +li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D +rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ +WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug +F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU +xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC +Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv +dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw +ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl +IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh +c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy +ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI +KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T +KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq +y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p +dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD +VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL +MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk +fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8 +7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R +cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y +mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW +xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK +SnQ2+Q== +-----END CERTIFICATE----- + +================================================================ +C: CH +O: SwissSign AG +CN: SwissSign Gold CA - G2 +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln +biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF +MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT +d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8 +76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+ +bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c +6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE +emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd +MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt +MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y +MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y +FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi +aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM +gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB +qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7 +lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn +8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6 +45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO +UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5 +O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC +bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv +GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a +77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC +hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3 +92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp +Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w +ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt +Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +================================================================ +C: CH +O: SwissSign AG +CN: SwissSign Platinum CA - G2 +-----BEGIN CERTIFICATE----- +MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE +BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWdu +IFBsYXRpbnVtIENBIC0gRzIwHhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAw +WjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMSMwIQYDVQQD +ExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu669y +IIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2Htn +IuJpX+UFeNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+ +6ixuEFGSzH7VozPY1kneWCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5ob +jM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIoj5+saCB9bzuohTEJfwvH6GXp43gOCWcw +izSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/68++QHkwFix7qepF6w9fl ++zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34TaNhxKFrY +zt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaP +pZjydomyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtF +KwH3HBqi7Ri6Cr2D+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuW +ae5ogObnmLo2t/5u7Su9IPhlGdpVCX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMB +AAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O +BBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCvzAeHFUdvOMW0 +ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW +IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUA +A4ICAQAIhab1Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0 +uMoI3LQwnkAHFmtllXcBrqS3NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+ +FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4U99REJNi54Av4tHgvI42Rncz7Lj7 +jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8KV2LwUvJ4ooTHbG/ +u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl9x8D +YSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1 +puEa+S1BaYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXa +icYwu+uPyyIIoK6q8QNsOktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbG +DI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSYMdp08YSTcU1f+2BY0fvEwW2JorsgH51x +kcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAciIfNAChs0B0QTwoRqjt8Z +Wr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g== +-----END CERTIFICATE----- + +================================================================ +C: CH +O: SwissSign AG +CN: SwissSign Silver CA - G2 +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE +BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu +IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow +RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY +U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv +Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br +YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF +nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH +6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt +eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/ +c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ +MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH +HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf +jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6 +5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB +rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU +F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c +wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB +AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp +WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9 +xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ +2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ +IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8 +aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X +em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR +dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/ +OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+ +hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy +tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +================================================================ +C: CH +O: WISeKey +OU: Copyright (c) 2005 +OU: OISTE Foundation Endorsed +CN: OISTE WISeKey Global Root GA CA +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB +ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly +aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w +NTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G +A1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX +SVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR +VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2 +w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF +mQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg +4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9 +4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw +EAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx +SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2 +ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8 +vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi +Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ +/L7fCg0= +-----END CERTIFICATE----- + +================================================================ +C: CN +O: CNNIC +CN: CNNIC ROOT +-----BEGIN CERTIFICATE----- +MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJD +TjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2 +MDcwOTE0WhcNMjcwNDE2MDcwOTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMF +Q05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzDo+/hn7E7SIX1mlwh +IhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tizVHa6 +dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZO +V/kbZKKTVrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrC +GHn2emU1z5DrvTOTn1OrczvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gN +v7Sg2Ca+I19zN38m5pIEo3/PIKe38zrKy5nLAgMBAAGjczBxMBEGCWCGSAGG+EIB +AQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscCwQ7vptU7ETAPBgNVHRMB +Af8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991SlgrHAsEO +76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnK +OOK5Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvH +ugDnuL8BV8F3RTIMO/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7Hgvi +yJA/qIYM/PmLXoXLT1tLYhFHxUV8BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fL +buXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2G8kS1sHNzYDzAgE8yGnLRUhj +2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5mmxE= +-----END CERTIFICATE----- + +================================================================ +C: CN +O: China Internet Network Information Center +CN: China Internet Network Information Center EV Certificates Root +-----BEGIN CERTIFICATE----- +MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC +Q04xMjAwBgNVBAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24g +Q2VudGVyMUcwRQYDVQQDDD5DaGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0 +aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMgUm9vdDAeFw0xMDA4MzEwNzExMjVa +Fw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAGA1UECgwpQ2hpbmEg +SW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMMPkNo +aW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRp +ZmljYXRlcyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z +7r07eKpkQ0H1UN+U8i6yjUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA// +DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV98YPjUesWgbdYavi7NifFy2cyjw1l1Vx +zUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2HklY0bBoQCxfVWhyXWIQ8 +hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23KzhmBsUs +4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54u +gQEC7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oY +NJKiyoOCWTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E +FgQUfHJLOcfA22KlT5uqGDSSosqDglkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3 +j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd50XPFtQO3WKwMVC/GVhMPMdoG +52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM7+czV0I664zB +echNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws +ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrI +zo9uoV1/A3U05K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATy +wy39FCqQmbkHzJ8= +-----END CERTIFICATE----- + +================================================================ +C: CO +O: Sociedad Cameral de Certificación Digital - Certicámara S.A. +CN: AC Raíz Certicámara S.A. +-----BEGIN CERTIFICATE----- +MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsx +CzAJBgNVBAYTAkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRp +ZmljYWNpw7NuIERpZ2l0YWwgLSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwa +QUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4wHhcNMDYxMTI3MjA0NjI5WhcNMzAw +NDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+U29jaWVkYWQgQ2Ft +ZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJhIFMu +QS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkq +hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeG +qentLhM0R7LQcNzJPNCNyu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzL +fDe3fezTf3MZsGqy2IiKLUV0qPezuMDU2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQ +Y5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU34ojC2I+GdV75LaeHM/J4 +Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP2yYe68yQ +54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+b +MMCm8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48j +ilSH5L887uvDdUhfHjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++Ej +YfDIJss2yKHzMI+ko6Kh3VOz3vCaMh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/zt +A/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK5lw1omdMEWux+IBkAC1vImHF +rEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1bczwmPS9KvqfJ +pxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCB +lTCBkgYEVR0gADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFy +YS5jb20vZHBjLzBaBggrBgEFBQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW50 +7WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2UgcHVlZGVuIGVuY29udHJhciBlbiBs +YSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEfAygPU3zmpFmps4p6 +xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuXEpBc +unvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/ +Jre7Ir5v/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dp +ezy4ydV/NgIlqmjCMRW3MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42 +gzmRkBDI8ck1fj+404HGIGQatlDCIaR43NAvO2STdPCWkPHv+wlaNECW8DYSwaN0 +jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wkeZBWN7PGKX6jD/EpOe9+ +XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f/RWmnkJD +W2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/ +RL5hRqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35r +MDOhYil/SrnhLecUIw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxk +BYn8eNZcLCZDqQ== +-----END CERTIFICATE----- + +================================================================ +C: DE +O: D-Trust GmbH +CN: D-TRUST Root Class 3 CA 2 2009 +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha +ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM +HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03 +UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42 +tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R +ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM +lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp +/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G +A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G +A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj +dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy +MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl +cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js +L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL +BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni +acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K +zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8 +PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y +Johw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +================================================================ +C: DE +O: D-Trust GmbH +CN: D-TRUST Root Class 3 CA 2 EV 2009 +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw +NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV +BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn +ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0 +3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z +qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR +p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8 +HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw +ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea +HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw +Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh +c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E +RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt +dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku +Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp +3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 +nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF +CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na +xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX +KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1 +-----END CERTIFICATE----- + +================================================================ +C: DE +O: Deutsche Telekom AG +OU: T-TeleSec Trust Center +CN: Deutsche Telekom Root CA 2 +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc +MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj +IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB +IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE +RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl +U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290 +IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU +ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC +QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr +rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S +NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc +QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH +txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP +BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC +AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp +tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa +IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl +6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+ +xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +================================================================ +C: DE +O: T-Systems Enterprise Services GmbH +OU: T-Systems Trust Center +CN: T-TeleSec GlobalRoot Class 3 +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx +KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd +BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl +YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1 +OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy +aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 +ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN +8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/ +RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4 +hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5 +ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM +EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1 +A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy +WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ +1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30 +6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT +91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p +TpPDpFQUWw== +-----END CERTIFICATE----- + +================================================================ +C: DE +O: TC TrustCenter GmbH +OU: TC TrustCenter Class 2 CA +CN: TC TrustCenter Class 2 CA II +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV +BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 +Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1 +OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i +SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc +VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jf +tMjWQ+nEdVl//OEd+DFwIxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKg +uNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2J +XjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQXa7pIXSSTYtZgo+U4+lK +8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7uSNQZu+99 +5OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3 +kUrL84J6E1wIqzCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy +dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6 +Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz +JTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 +Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iS +GNn3Bzn1LL4GdXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprt +ZjluS5TmVfwLG4t3wVMTZonZKNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8 +au0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV +hgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI +dUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ== +-----END CERTIFICATE----- + +================================================================ +C: DE +O: TC TrustCenter GmbH +OU: TC TrustCenter Class 3 CA +CN: TC TrustCenter Class 3 CA II +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV +BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 +Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1 +OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i +SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UEAxMc +VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJW +Ht4bNwcwIi9v8Qbxq63WyKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+Q +Vl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo6SI7dYnWRBpl8huXJh0obazovVkdKyT2 +1oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZuV3bOx4a+9P/FRQI2Alq +ukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk2ZyqBwi1 +Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NX +XAek0CSnwPIA1DCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy +dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6 +Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz +JTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 +Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlN +irTzwppVMXzEO2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8 +TtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6 +g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB +95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj +S+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A== +-----END CERTIFICATE----- + +================================================================ +C: DE +O: TC TrustCenter GmbH +OU: TC TrustCenter Universal CA +CN: TC TrustCenter Universal CA I +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV +BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1 +c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcNMDYwMzIyMTU1NDI4WhcNMjUxMjMx +MjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIg +R21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYwJAYD +VQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSR +JJZ4Hgmgm5qVSkr1YnwCqMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3T +fCZdzHd55yx4Oagmcw6iXSVphU9VDprvxrlE4Vc93x9UIuVvZaozhDrzznq+VZeu +jRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtwag+1m7Z3W0hZneTvWq3z +wZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9OgdwZu5GQ +fezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYD +VR0jBBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0G +CSqGSIb3DQEBBQUAA4IBAQAo0uCG1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X1 +7caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/CyvwbZ71q+s2IhtNerNXxTPqYn +8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3ghUJGooWMNjs +ydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT +ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/ +2TYcuiUaUj0a7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY +-----END CERTIFICATE----- + +================================================================ +C: DE +ST: Baden-Wuerttemberg (BW) +L: Stuttgart +O: Deutscher Sparkassen Verlag GmbH +CN: S-TRUST Authentication and Encryption Root CA 2005:PN +-----BEGIN CERTIFICATE----- +MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCB +rjELMAkGA1UEBhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcp +MRIwEAYDVQQHEwlTdHV0dGdhcnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fz +c2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVTLVRSVVNUIEF1dGhlbnRpY2F0aW9u +IGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0wNTA2MjIwMDAwMDBa +Fw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFkZW4t +V3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMg +RGV1dHNjaGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJV +U1QgQXV0aGVudGljYXRpb24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBO +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1 +toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob4QSwI7+Vio5bG0F/WsPo +TUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXLg3KSwlOy +ggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1 +XgqfeN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteF +hy+S8dF2g08LOlk3KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm +7QIDAQABo4GSMIGPMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEG +MCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJvbmxpbmUxLTIwNDgtNTAdBgNV +HQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAUD8oeXHngovMp +ttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD +pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFo +LtU96G7m1R08P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersF +iXOMy6ZNwPv2AtawB6MDwidAnwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0y +h9WUUpY6RsZxlj33mA6ykaqP2vROJAA5VeitF7nTNCtKqUDMFypVZUF0Qn71wK/I +k63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8bHz2eBIPdltkdOpQ= +-----END CERTIFICATE----- + +================================================================ +C: DK +O: TDC +CN: TDC OCES CA +-----BEGIN CERTIFICATE----- +MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJE +SzEMMAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEw +ODM5MzBaFw0zNzAyMTEwOTA5MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNU +REMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuHnEz9pPPEXyG9VhDr +2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0zY0s +2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItU +GBxIYXvViGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKj +dGqPqcNiKXEx5TukYBdedObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+r +TpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB5DCB4TCB3gYIKoFQgSkB +AQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5kay9yZXBv +c2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRl +ciBmcmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEu +MS4xLiBDZXJ0aWZpY2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIg +T0lEIDEuMi4yMDguMTY5LjEuMS4xLjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1Ud +HwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEMMAoGA1UEChMDVERDMRQwEgYD +VQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYmaHR0cDovL2Ny +bC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy +MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZ +J2cdUBVLc647+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqG +SIb2fQdBAAQQMA4bCFY2LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACrom +JkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4A9G28kNBKWKnctj7fAXmMXAnVBhO +inxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYscA+UYyAFMP8uXBV2Y +caaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9AOoB +mbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQ +YqbsFbS1AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9 +BKNDLdr8C2LqL19iUw== +-----END CERTIFICATE----- + +================================================================ +C: DK +O: TDC Internet +OU: TDC Internet Root CA +-----BEGIN CERTIFICATE----- +MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJE +SzEVMBMGA1UEChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQg +Um9vdCBDQTAeFw0wMTA0MDUxNjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNV +BAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJuZXQxHTAbBgNVBAsTFFREQyBJbnRl +cm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxLhA +vJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20jxsNu +Zp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a +0vnRrEvLznWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc1 +4izbSysseLlJ28TQx5yc5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGN +eGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcD +R0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZIAYb4QgEBBAQDAgAHMGUG +A1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMMVERDIElu +dGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxME +Q1JMMTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3 +WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAw +HQYDVR0OBBYEFGxkAcf9hW2syNqeUAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJ +KoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4IBAQBO +Q8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540mgwV5dOy0uaOX +wTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ +2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm89 +9qNLPg7kbWzbO0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0 +jUNAE4z9mQNUecYu6oah9jrUCbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38 +aQNiuJkFBT1reBK9sG9l +-----END CERTIFICATE----- + +================================================================ +C: EE +O: AS Sertifitseerimiskeskus +CN: EE Certification Centre Root CA +emailAddress: pki@sk.ee +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1 +MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1 +czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG +CSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy +MTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl +ZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS +b290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy +euuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO +bntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw +WFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d +MtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE +1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/ +zQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB +BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF +BQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV +v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG +E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u +uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW +iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v +GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0= +-----END CERTIFICATE----- + +================================================================ +C: ES +CN: Autoridad de Certificacion Firmaprofesional CIF A62634068 +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE +BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h +cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy +MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg +Q2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9 +thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM +cas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG +L9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i +NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h +X68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b +m8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy +Z/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja +EbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T +KI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF +6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh +OSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD +VR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv +ACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl +AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF +661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9 +am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1 +ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481 +PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS +3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k +SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF +3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM +ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g +StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz +Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB +jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +================================================================ +C: ES +L: C/ Muntaner 244 Barcelona +CN: Autoridad de Certificacion Firmaprofesional CIF A62634068 +emailAddress: ca@firmaprofesional.com +-----BEGIN CERTIFICATE----- +MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMx +IjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1 +dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20w +HhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTELMAkGA1UEBhMCRVMx +IjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1 +dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20w +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5u +Cp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5Vj1H5WuretXDE7aTt/6MNbg9kUDGvASdY +rv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJHlShbz++AbOCQl4oBPB3z +hxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf3H5idPay +BQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcL +iam8NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcb +AgMBAAGjgZ8wgZwwKgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lv +bmFsLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0 +MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E +FgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQADggEBAEdz/o0n +VPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq +u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36m +hoEyIwOdyPdfwUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzfl +ZKG+TQyTmAyX9odtsz/ny4Cm7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBp +QWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YGVM+h4k0460tQtcsm9MracEpqoeJ5 +quGnM/b9Sh/22WA= +-----END CERTIFICATE----- + +================================================================ +C: ES +O: Agencia Catalana de Certificacio (NIF Q-0801176-I) +OU: Serveis Publics de Certificacio +OU: Vegeu https://www.catcert.net/verarrel (c)03 +OU: Jerarquia Entitats de Certificacio Catalanes +CN: EC-ACC +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB +8zELMAkGA1UEBhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2Vy +dGlmaWNhY2lvIChOSUYgUS0wODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1 +YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYDVQQLEyxWZWdldSBodHRwczovL3d3 +dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UECxMsSmVyYXJxdWlh +IEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMTBkVD +LUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQG +EwJFUzE7MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8g +KE5JRiBRLTA4MDExNzYtSSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBD +ZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZlZ2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQu +bmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJhcnF1aWEgRW50aXRhdHMg +ZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUNDMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R +85iKw5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm +4CgPukLjbo73FCeTae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaV +HMf5NLWUhdWZXqBIoH7nF2W4onW4HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNd +QlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0aE9jD2z3Il3rucO2n5nzbcc8t +lGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw0JDnJwIDAQAB +o4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4 +opvpXY0wfwYDVR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBo +dHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidW +ZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAwDQYJKoZIhvcN +AQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJlF7W2u++AVtd0x7Y +/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNaAl6k +SBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhy +Rp/7SNVel+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOS +Agu+TGbrIP65y7WZf+a2E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xl +nJ2lYJU6Un/10asIbvPuW/mIPX64b24D5EI= +-----END CERTIFICATE----- + +================================================================ +C: ES +O: Generalitat Valenciana +OU: PKIGVA +CN: Root CA Generalitat Valenciana +-----BEGIN CERTIFICATE----- +MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJF +UzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJ +R1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcN +MDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3WjBoMQswCQYDVQQGEwJFUzEfMB0G +A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScw +JQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+ +WmmmO3I2F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKj +SgbwJ/BXufjpTjJ3Cj9BZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGl +u6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQD0EbtFpKd71ng+CT516nDOeB0/RSrFOy +A8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXteJajCq+TA81yc477OMUxk +Hl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMBAAGjggM7 +MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBr +aS5ndmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIIC +IwYKKwYBBAG/VQIBADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8A +cgBpAGQAYQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIA +YQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIAYQBsAGkAdABhAHQAIABWAGEA +bABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQByAGEAYwBpAPMA +bgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA +aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMA +aQBvAG4AYQBtAGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQA +ZQAgAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEA +YwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBuAHQAcgBhACAAZQBuACAAbABhACAA +ZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAAOgAvAC8AdwB3AHcA +LgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0dHA6 +Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+y +eAT8MIGVBgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQsw +CQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0G +A1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVu +Y2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRhTvW1yEICKrNcda3Fbcrn +lD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdzCkj+IHLt +b8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg +9J63NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XF +ducTZnV+ZfsBn5OHiJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmC +IoaZM3Fa6hlXPZHNqcCjbgcTpsnt+GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= +-----END CERTIFICATE----- + +================================================================ +C: ES +O: IZENPE S.A. +CN: Izenpe.com +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4 +MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6 +ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD +VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j +b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq +scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO +xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H +LmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX +uaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD +yCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+ +JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q +rLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN +BjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L +hij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB +QFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+ +HMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu +Zm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg +QTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB +BgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA +A4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb +laQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56 +awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo +JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw +LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT +VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk +LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb +UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/ +QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+ +naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls +QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +================================================================ +C: EU +L: Madrid (see current address at www.camerfirma.com/address) +serialNumber: A82743287 +O: AC Camerfirma S.A. +CN: Chambers of Commerce Root - 2008 +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz +IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz +MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj +dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw +EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp +MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9 +28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq +VKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q +DuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR +5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL +ZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a +Sd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl +UlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s ++12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5 +Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx +hduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV +HQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1 ++HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN +YWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t +L2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy +ZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt +IDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV +HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w +DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW +PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF +5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1 +glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH +FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2 +pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD +xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG +tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq +jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De +fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ +d0jQ +-----END CERTIFICATE----- + +================================================================ +C: EU +L: Madrid (see current address at www.camerfirma.com/address) +serialNumber: A82743287 +O: AC Camerfirma S.A. +CN: Global Chambersign Root - 2008 +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx +MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy +cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG +A1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl +BgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI +hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed +KYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7 +G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2 +zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4 +ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG +HoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2 +Id3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V +yJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e +beksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r +6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog +zCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW +BBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr +ru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp +ZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk +cmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt +YSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC +CQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow +KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI +hvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ +UohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz +X1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x +fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz +a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd +Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd +SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O +AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso +M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge +v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +================================================================ +C: EU +O: AC Camerfirma SA CIF A82743287 +OU: http://www.chambersign.org +CN: Chambers of Commerce Root +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn +MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL +ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg +b2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAxNjEzNDNaFw0zNzA5MzAxNjEzNDRa +MH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZpcm1hIFNBIENJRiBB +ODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3JnMSIw +IAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0B +AQEFAAOCAQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtb +unXF/KGIJPov7coISjlUxFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0d +BmpAPrMMhe5cG3nCYsS4No41XQEMIwRHNaqbYE6gZj3LJgqcQKH0XZi/caulAGgq +7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jWDA+wWFjbw2Y3npuRVDM3 +0pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFVd9oKDMyX +roDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIG +A1UdEwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5j +aGFtYmVyc2lnbi5vcmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p +26EpW1eLTXYGduHRooowDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIA +BzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hhbWJlcnNpZ24ub3JnMCcGA1Ud +EgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYDVR0gBFEwTzBN +BgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz +aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB +AAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd +p0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi +1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc +XCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0 +eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu +tGWaIZDgqtCYvDi1czyL+Nw= +-----END CERTIFICATE----- + +================================================================ +C: EU +O: AC Camerfirma SA CIF A82743287 +OU: http://www.chambersign.org +CN: Global Chambersign Root +-----BEGIN CERTIFICATE----- +MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEn +MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL +ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENo +YW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYxNDE4WhcNMzcwOTMwMTYxNDE4WjB9 +MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgy +NzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4G +A1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUA +A4IBDQAwggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0 +Mi+ITaFgCPS3CU6gSS9J1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/s +QJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8Oby4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpV +eAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl6DJWk0aJqCWKZQbua795 +B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c8lCrEqWh +z0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0T +AQH/BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1i +ZXJzaWduLm9yZy9jaGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4w +TcbOX60Qq+UDpfqpFDAOBgNVHQ8BAf8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAH +MCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBjaGFtYmVyc2lnbi5vcmcwKgYD +VR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9yZzBbBgNVHSAE +VDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh +bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0B +AQUFAAOCAQEAPDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUM +bKGKfKX0j//U2K0X1S0E0T9YgOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXi +ryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJPJ7oKXqJ1/6v/2j1pReQvayZzKWG +VwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4IBHNfTIzSJRUTN3c +ecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREest2d/ +AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== +-----END CERTIFICATE----- + +================================================================ +C: FI +O: Sonera +CN: Sonera Class1 CA +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP +MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAx +MDQwNjEwNDkxM1oXDTIxMDQwNjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNV +BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMSBDQTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H887dF+2rDNbS82rDTG +29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9EJUk +oVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk +3w0LBUXl0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBL +qdReLjVQCfOAl/QMF6452F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIIN +nvmLVz5MxxftLItyM19yejhW1ebZrgUaHXVFsculJRwSVzb9IjcCAwEAAaMzMDEw +DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZTiFIwCwYDVR0PBAQDAgEG +MA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE928Jj2VuX +ZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0H +DjxVyhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VO +TzF2nBBhjrZTOqMRvq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2Uv +kVrCqIexVmiUefkl98HVrhq4uz2PqYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4w +zMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9ZIRlXvVWa +-----END CERTIFICATE----- + +================================================================ +C: FI +O: Sonera +CN: Sonera Class2 CA +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP +MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx +MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV +BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o +Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt +5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s +3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej +vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu +8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw +DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG +MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil +zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/ +3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD +FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6 +Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2 +ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M +-----END CERTIFICATE----- + +================================================================ +C: FR +O: Certinomis +OU: 0002 433998903 +CN: Certinomis - Autorité Racine +-----BEGIN CERTIFICATE----- +MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjET +MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAk +BgNVBAMMHUNlcnRpbm9taXMgLSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4 +Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNl +cnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYwJAYDVQQDDB1DZXJ0 +aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jY +F1AMnmHawE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N +8y4oH3DfVS9O7cdxbwlyLu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWe +rP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K +/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92NjMD2AR5vpTESOH2VwnHu +7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9qc1pkIuVC +28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6 +lSTClrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1E +nn1So2+WLhl+HPNbxxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB +0iSVL1N6aaLwD4ZFjliCK0wi1F6g530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql09 +5gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna4NH4+ej9Uji29YnfAgMBAAGj +WzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQN +jLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ +KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9s +ov3/4gbIOZ/xWqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZM +OH8oMDX/nyNTt7buFHAAQCvaR6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q +619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40nJ+U8/aGH88bc62UeYdocMMzpXDn +2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1BCxMjidPJC+iKunqj +o3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjvJL1v +nxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG +5ERQL1TEqkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWq +pdEdnV1j6CTmNhTih60bWfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZb +dsLLO7XSAPCjDuGtbkD326C00EauFddEwk01+dIL8hf2rGbVJLJP0RyZwG71fet0 +BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/vgt2Fl43N+bYdJeimUV5 +-----END CERTIFICATE----- + +================================================================ +C: FR +O: Certplus +CN: Class 2 Primary CA +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAw +PTELMAkGA1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFz +cyAyIFByaW1hcnkgQ0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9 +MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNz +IDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANxQ +ltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR5aiR +VhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyL +kcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCd +EgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas +H7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0 +HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1Ud +DwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4 +QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu +Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/ +AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8 +yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR +FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA +ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB +kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- + +================================================================ +C: FR +O: Dhimyotis +CN: Certigna +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV +BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X +DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ +BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4 +QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny +gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw +zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q +130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2 +JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw +ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT +AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj +AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG +9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h +bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc +fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu +HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w +t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +================================================================ +C: FR +ST: France +L: Paris +O: PM/SGDN +OU: DCSSI +CN: IGC/A +emailAddress: igca@sgdn.pm.gouv.fr +-----BEGIN CERTIFICATE----- +MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYT +AkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQ +TS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG +9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMB4XDTAyMTIxMzE0MjkyM1oXDTIw +MTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAM +BgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEO +MAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2 +LmZyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaI +s9z4iPf930Pfeo2aSVz2TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2 +xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCWSo7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4 +u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYyHF2fYPepraX/z9E0+X1b +F8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNdfrGoRpAx +Vs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGd +PDPQtQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNV +HSAEDjAMMAoGCCqBegF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAx +NjAfBgNVHSMEGDAWgBSjBS8YYFDCiQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUF +AAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RKq89toB9RlPhJy3Q2FLwV3duJ +L92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3QMZsyK10XZZOY +YLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg +Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2a +NjSaTFR+FwNIlQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R +0982gaEbeC9xs/FZTEYYKKuF0mBWWg== +-----END CERTIFICATE----- + +================================================================ +C: GB +O: Trustis Limited +OU: Trustis FPS Root CA +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL +ExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx +MzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc +MBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+ +AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH +iTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj +vSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA +0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB +OrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/ +BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E +FgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01 +GX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW +zaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4 +1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE +f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F +jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN +ZetX2fNXlrtIzYE= +-----END CERTIFICATE----- + +================================================================ +C: GB +ST: Greater Manchester +L: Salford +O: Comodo CA Limited +CN: AAA Certificate Services +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj +YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM +GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua +BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe +3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 +YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR +rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm +ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU +oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v +QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t +b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF +AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q +GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 +G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi +l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 +smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +================================================================ +C: GB +ST: Greater Manchester +L: Salford +O: Comodo CA Limited +CN: Secure Certificate Services +-----BEGIN CERTIFICATE----- +MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp +ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow +fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV +BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM +cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S +HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996 +CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk +3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz +6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV +HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud +EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv +Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw +Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww +DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0 +5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj +Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI +gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ +aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl +izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk= +-----END CERTIFICATE----- + +================================================================ +C: GB +ST: Greater Manchester +L: Salford +O: Comodo CA Limited +CN: Trusted Certificate Services +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0 +aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla +MH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO +BgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD +VQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW +fnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt +TGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL +fhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW +1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7 +kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G +A1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v +ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo +dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu +Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/ +HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 +pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS +jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+ +xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn +dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi +-----END CERTIFICATE----- + +================================================================ +C: GB +ST: Greater Manchester +L: Salford +O: COMODO CA Limited +CN: COMODO Certification Authority +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB +gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV +BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw +MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl +YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P +RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 +UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI +2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 +Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp ++2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ +DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O +nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW +/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g +PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u +QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY +SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv +IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 +zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd +BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB +ZQ== +-----END CERTIFICATE----- + +================================================================ +C: GB +ST: Greater Manchester +L: Salford +O: COMODO CA Limited +CN: COMODO ECC Certification Authority +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT +IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw +MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy +ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N +T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR +FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J +cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW +BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm +fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv +GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +================================================================ +C: GR +O: Hellenic Academic and Research Institutions Cert. Authority +CN: Hellenic Academic and Research Institutions RootCA 2011 +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix +RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p +YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw +NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK +EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl +cnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz +dYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ +fel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns +bgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD +75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP +FEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV +HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp +5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu +b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA +A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p +6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7 +dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys +Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI +l7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +================================================================ +C: HK +O: Hongkong Post +CN: Hongkong Post Root CA 1 +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx +FjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg +Um9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG +A1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr +b25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ +jVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn +PzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh +ZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9 +nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h +q5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED +MA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC +mEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3 +7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB +oiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs +EhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO +fMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi +AmvZWg== +-----END CERTIFICATE----- + +================================================================ +C: HU +L: Budapest +O: Microsec Ltd. +CN: Microsec e-Szigno Root CA 2009 +emailAddress: info@e-szigno.hu +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD +VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0 +ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G +CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y +OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx +FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp +Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP +kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc +cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U +fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7 +N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC +xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1 ++rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM +Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG +SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h +mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk +ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c +2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t +HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +================================================================ +C: HU +L: Budapest +O: NetLock Kft. +OU: Tanúsítványkiadók (Certification Services) +CN: NetLock Arany (Class Gold) Főtanúsítvány +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG +EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3 +MDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl +cnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR +dGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB +pzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM +b2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm +aWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz +IEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT +lF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz +AZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5 +VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG +ILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2 +BJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG +AQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M +U9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh +bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C ++C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F +uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2 +XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +================================================================ +C: HU +L: Budapest +O: Microsec Ltd. +OU: e-Szigno CA +CN: Microsec e-Szigno Root CA +-----BEGIN CERTIFICATE----- +MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAw +cjELMAkGA1UEBhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNy +b3NlYyBMdGQuMRQwEgYDVQQLEwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9z +ZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0MDYxMjI4NDRaFw0xNzA0MDYxMjI4 +NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEWMBQGA1UEChMN +TWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMTGU1p +Y3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2u +uO/TEdyB5s87lozWbxXGd36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+ +LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/NoqdNAoI/gqyFxuEPkEeZlApxcpMqyabA +vjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjcQR/Ji3HWVBTji1R4P770 +Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJPqW+jqpx +62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcB +AQRbMFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3Aw +LQYIKwYBBQUHMAKGIWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAP +BgNVHRMBAf8EBTADAQH/MIIBcwYDVR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIB +AQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3LmUtc3ppZ25vLmh1L1NaU1ov +MIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0AdAB2AOEAbgB5 +ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn +AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABT +AHoAbwBsAGcA4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABh +ACAAcwB6AGUAcgBpAG4AdAAgAGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABo +AHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMAegBpAGcAbgBvAC4AaAB1AC8AUwBa +AFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6Ly93d3cuZS1zemln +bm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NOPU1p +Y3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxP +PU1pY3Jvc2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZv +Y2F0aW9uTGlzdDtiaW5hcnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuB +EGluZm9AZS1zemlnbm8uaHWkdzB1MSMwIQYDVQQDDBpNaWNyb3NlYyBlLVN6aWdu +w7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhTWjEWMBQGA1UEChMNTWlj +cm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhVMIGsBgNV +HSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJI +VTERMA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDAS +BgNVBAsTC2UtU3ppZ25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBS +b290IENBghEAzLjnv04pGv2i3GalHCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS +8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMTnGZjWS7KXHAM/IO8VbH0jgds +ZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FEaGAHQzAxQmHl +7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a +86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfR +hUZLphK3dehKyVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/ +MPMMNz7UwiiAc7EBt51alhQBS6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= +-----END CERTIFICATE----- + +================================================================ +C: HU +L: Budapest +O: NetLock Halozatbiztonsagi Kft. +OU: Tanusitvanykiadok +CN: NetLock Expressz (Class C) Tanusitvanykiado +-----BEGIN CERTIFICATE----- +MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUx +ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0 +b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQD +EytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBDKSBUYW51c2l0dmFueWtpYWRvMB4X +DTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJBgNVBAYTAkhVMREw +DwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9u +c2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMr +TmV0TG9jayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzAN +BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNA +OoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3ZW3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC +2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63euyucYT2BDMIJTLrdKwW +RMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQwDgYDVR0P +AQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEW +ggJNRklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0 +YWxhbm9zIFN6b2xnYWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFz +b2sgYWxhcGphbiBrZXN6dWx0LiBBIGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBO +ZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1iaXp0b3NpdGFzYSB2ZWRpLiBB +IGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0ZWxlIGF6IGVs +b2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs +ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25s +YXBqYW4gYSBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kg +a2VyaGV0byBheiBlbGxlbm9yemVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4g +SU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5kIHRoZSB1c2Ugb2YgdGhpcyBjZXJ0 +aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQUyBhdmFpbGFibGUg +YXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwgYXQg +Y3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmY +ta3UzbM2xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2g +pO0u9f38vf5NNwgMvOOWgyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4 +Fp1hBWeAyNDYpQcCNJgEjTME1A== +-----END CERTIFICATE----- + +================================================================ +C: HU +L: Budapest +O: NetLock Halozatbiztonsagi Kft. +OU: Tanusitvanykiadok +CN: NetLock Minositett Kozjegyzoi (Class QA) Tanusitvanykiado +emailAddress: info@netlock.hu +-----BEGIN CERTIFICATE----- +MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUx +ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0 +b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQD +EzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVneXpvaSAoQ2xhc3MgUUEpIFRhbnVz +aXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0bG9jay5odTAeFw0w +MzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTERMA8G +A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh +Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5l +dExvY2sgTWlub3NpdGV0dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZh +bnlraWFkbzEeMBwGCSqGSIb3DQEJARYPaW5mb0BuZXRsb2NrLmh1MIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRVCacbvWy5FPSKAtt2/Goq +eKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e8ia6AFQe +r7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO5 +3Lhbm+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWd +vLrqOU+L73Sa58XQ0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0l +mT+1fMptsK6ZmfoIYOcZwvK9UdPM0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4IC +wDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8EBAMCAQYwggJ1Bglg +hkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2YW55IGEgTmV0 +TG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh +biBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQg +ZWxla3Ryb25pa3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywg +dmFsYW1pbnQgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6 +b2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwgYXogQWx0YWxhbm9zIFN6ZXJ6b2Rl +c2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kgZWxqYXJhcyBtZWd0 +ZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczovL3d3 +dy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0Bu +ZXRsb2NrLm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBh +bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRo +ZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMgYXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3 +Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0IGluZm9AbmV0bG9jay5u +ZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3DQEBBQUA +A4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQ +MznNwNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+ +NFAwLvt/MpqNPfMgW/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCR +VCHnpgu0mfVRQdzNo0ci2ccBgcTcR08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY +83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR5qq5aKrN9p2QdRLqOBrKROi3 +macqaJVmlaut74nLYKkGEsaUR+ko +-----END CERTIFICATE----- + +================================================================ +C: HU +L: Budapest +O: NetLock Halozatbiztonsagi Kft. +OU: Tanusitvanykiadok +CN: NetLock Uzleti (Class B) Tanusitvanykiado +-----BEGIN CERTIFICATE----- +MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUx +ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0 +b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQD +EylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikgVGFudXNpdHZhbnlraWFkbzAeFw05 +OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYDVQQGEwJIVTERMA8G +A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh +Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5l +dExvY2sgVXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xK +gZjupNTKihe5In+DCnVMm8Bp2GQ5o+2So/1bXHQawEfKOml2mrriRBf8TKPV/riX +iK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr1nGTLbO/CVRY7QbrqHvc +Q7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8E +BAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1G +SUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFu +b3MgU3pvbGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBh +bGFwamFuIGtlc3p1bHQuIEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExv +Y2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGln +aXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0 +IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh +c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGph +biBhIGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJo +ZXRvIGF6IGVsbGVub3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBP +UlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmlj +YXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBo +dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNA +bmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06 +sPgzTEdM43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXa +n3BukxowOR0w2y7jfLKRstE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKS +NitjrFgBazMpUIaD8QFI +-----END CERTIFICATE----- + +================================================================ +C: HU +ST: Hungary +L: Budapest +O: NetLock Halozatbiztonsagi Kft. +OU: Tanusitvanykiadok +CN: NetLock Kozjegyzoi (Class A) Tanusitvanykiado +-----BEGIN CERTIFICATE----- +MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhV +MRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMe +TmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0 +dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFzcyBB +KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oXDTE5MDIxOTIzMTQ0 +N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhC +dWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQu +MRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBL +b3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSMD7tM9DceqQWC2ObhbHDqeLVu0ThEDaiD +zl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZz+qMkjvN9wfcZnSX9EUi +3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC/tmwqcm8 +WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LY +Oph7tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2Esi +NCubMvJIH5+hCoR64sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCC +ApswDgYDVR0PAQH/BAQDAgAGMBIGA1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4 +QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZRUxFTSEgRXplbiB0 +YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRhdGFz +aSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu +IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtm +ZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMg +ZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVs +amFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJhc2EgbWVndGFsYWxoYXRv +IGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBzOi8vd3d3 +Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6 +ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1 +YW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3Qg +dG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRs +b2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNAbmV0bG9jay5uZXQuMA0G +CSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5ayZrU3/b39/zcT0mwBQO +xmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjPytoUMaFP +0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQ +QeJBCWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxk +f1qbFFgBJ34TUMdrKuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK +8CtmdWOMovsEPoMOmzbwGOQmIMOM8CgHrTwXZoi1/baI +-----END CERTIFICATE----- + +================================================================ +C: IE +O: Baltimore +OU: CyberTrust +CN: Baltimore CyberTrust Root +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ +RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD +VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX +DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y +ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy +VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr +mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr +IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK +mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu +XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy +dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye +jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 +BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 +DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 +9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx +jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 +Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz +ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS +R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +================================================================ +C: IL +O: StartCom Ltd. +CN: StartCom Certification Authority G2 +-----BEGIN CERTIFICATE----- +MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1 +OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG +A1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ +JZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD +vfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo +D/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/ +Q0kGi4xDuFby2X8hQxfqp0iVAXV16iulQ5XqFYSdCI0mblWbq9zSOdIxHWDirMxW +RST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbsO+wmETRIjfaAKxojAuuK +HDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8HvKTlXcxN +nw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM +0D4LnMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/i +UUjXuG+v+E5+M5iSFGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9 +Ha90OrInwMEePnWjFqmveiJdnxMaz6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHg +TuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL +BQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K +2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX +UfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl +6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK +9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ +HgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI +wpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY +XzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l +IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo +hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr +so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI +-----END CERTIFICATE----- + +================================================================ +C: IL +O: StartCom Ltd. +OU: Secure Digital Certificate Signing +CN: StartCom Certification Authority +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9j +ZXJ0LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3Js +LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFM +BgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFy +dGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYgU3Rh +cnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlh +YmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2Yg +dGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp +bGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ +YIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT +TCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ +9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8 +jhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW +FjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz +ewT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1 +ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L +EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu +L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC +O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V +um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh +NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14= +-----END CERTIFICATE----- + +================================================================ +C: IL +O: StartCom Ltd. +OU: Secure Digital Certificate Signing +CN: StartCom Certification Authority +-----BEGIN CERTIFICATE----- +MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul +F2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC +ATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w +ZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk +aWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0 +YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg +c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93 +d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG +CWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF +wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS +Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst +0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc +pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl +CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF +P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK +1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm +KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE +JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ +8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm +fyWl8kgAwKQB2j8= +-----END CERTIFICATE----- + +================================================================ +C: IT +L: Milan +O: Actalis S.p.A./03358520967 +CN: Actalis Authentication Root CA +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE +BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w +MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC +SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 +ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv +UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX +4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 +KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ +gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb +rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ +51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F +be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe +KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F +v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn +fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 +jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz +ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL +e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 +jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz +WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V +SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j +pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX +X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok +fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R +K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU +ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU +LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT +LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +================================================================ +C: JP +O: Japan Certification Services, Inc. +CN: SecureSign RootCA11 +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr +MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG +A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0 +MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp +Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD +QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz +i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8 +h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV +MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9 +UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni +8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC +h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD +VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB +AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm +KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ +X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr +QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5 +pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN +QSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +================================================================ +C: JP +O: Japanese Government +OU: ApplicationCA +-----BEGIN CERTIFICATE----- +MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEc +MBoGA1UEChMTSmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRp +b25DQTAeFw0wNzEyMTIxNTAwMDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYT +AkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zlcm5tZW50MRYwFAYDVQQLEw1BcHBs +aWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp23gdE6H +j6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4fl+K +f5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55 +IrmTwcrNwVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cw +FO5cjFW6WY2H/CPek9AEjP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDiht +QWEjdnjDuGWk81quzMKq2edY3rZ+nYVunyoKb58DKTCXKB28t89UKU5RMfkntigm +/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRUWssmP3HMlEYNllPqa0jQ +k/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNVBAYTAkpQ +MRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOC +seODvOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBADlqRHZ3ODrso2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJ +hyzjVOGjprIIC8CFqMjSnHH2HZ9g/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+ +eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYDio+nEhEMy/0/ecGc/WLuo89U +DNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmWdupwX3kSa+Sj +B1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL +rosot4LKGAfmt1t06SAZf7IbiVQ= +-----END CERTIFICATE----- + +================================================================ +C: JP +O: SECOM Trust Systems CO.,LTD. +OU: Security Communication EV RootCA1 +-----BEGIN CERTIFICATE----- +MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDEl +MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMh +U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIz +MloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09N +IFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNlY3VyaXR5IENvbW11 +bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSE +RMqm4miO/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gO +zXppFodEtZDkBp2uoQSXWHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5 +bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4zZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDF +MxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4bepJz11sS6/vmsJWXMY1 +VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK9U2vP9eC +OKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G +CSqGSIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HW +tWS3irO4G8za+6xmiEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZ +q51ihPZRwSzJIxXYKLerJRO1RuGGAv8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDb +EJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnWmHyojf6GPgcWkuF75x3sM3Z+ +Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEWT1MKZPlO9L9O +VL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 +-----END CERTIFICATE----- + +================================================================ +C: JP +O: SECOM Trust Systems CO.,LTD. +OU: Security Communication RootCA2 +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl +MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe +U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX +DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy +dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj +YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV +OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr +zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM +VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ +hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO +ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw +awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs +OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF +coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc +okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8 +t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy +1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/ +SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +================================================================ +C: JP +O: SECOM Trust.net +OU: Security Communication RootCA1 +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY +MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t +dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5 +WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD +VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8 +9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ +DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9 +Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N +QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ +xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G +A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG +kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr +Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5 +Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU +JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot +RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw== +-----END CERTIFICATE----- + +================================================================ +C: NL +O: Staat der Nederlanden +CN: Staat der Nederlanden Root CA - G2 +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX +DTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl +ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv +b3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ5291 +qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8Sp +uOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPU +Z5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE +pMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp +5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/M +UGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTN +GmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy +5V6548r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv +6q012iDTiIJh8BIitrzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEK +eN5KzlW/HdXZt1bv8Hb/C3m1r737qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6 +B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMBAAGjgZcwgZQwDwYDVR0TAQH/ +BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcCARYxaHR0cDov +L3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqG +SIb3DQEBCwUAA4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLyS +CZa59sCrI2AGeYwRTlHSeYAz+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen +5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897 +IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK +gnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL ++63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL +vJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm +bEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk +N1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC +Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z +ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ== +-----END CERTIFICATE----- + +================================================================ +C: NL +O: Staat der Nederlanden +CN: Staat der Nederlanden Root CA +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO +TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy +MTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVk +ZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENB +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFtvszn +ExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw71 +9tV2U02PjLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MO +hXeiD+EwR+4A5zN9RGcaC1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+U +tFE5A3+y3qcym7RHjm+0Sq7lr7HcsBthvJly3uSJt3omXdozSVtSnA71iq3DuD3o +BmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn622r+I/q85Ej0ZytqERAh +SQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRVHSAAMDww +OgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMv +cm9vdC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA +7Jbg0zTBLL9s+DANBgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k +/rvuFbQvBgwp8qiSpGEN/KtcCFtREytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzm +eafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbwMVcoEoJz6TMvplW0C5GUR5z6 +u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3ynGQI0DvDKcWy +7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR +iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== +-----END CERTIFICATE----- + +================================================================ +C: NO +O: Buypass AS-983163327 +CN: Buypass Class 2 CA 1 +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg +Q2xhc3MgMiBDQSAxMB4XDTA2MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzEL +MAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD +VQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7McXA0 +ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLX +l18xoS830r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVB +HfCuuCkslFJgNJQ72uA40Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B +5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/RuFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3 +WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0PAQH/BAQD +AgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLP +gcIV1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+ +DKhQ7SLHrQVMdvvt7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKu +BctN518fV4bVIJwo+28TOPX2EZL2fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHs +h7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5wwDX3OaJdZtB7WZ+oRxKaJyOk +LY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho +-----END CERTIFICATE----- + +================================================================ +C: NO +O: Buypass AS-983163327 +CN: Buypass Class 2 Root CA +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr +6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV +L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91 +1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx +MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ +QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB +arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr +Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi +FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS +P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN +9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz +uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h +9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t +OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo ++fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7 +KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2 +DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us +H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ +I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7 +5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h +3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz +Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA= +-----END CERTIFICATE----- + +================================================================ +C: NO +O: Buypass AS-983163327 +CN: Buypass Class 3 CA 1 +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg +Q2xhc3MgMyBDQSAxMB4XDTA1MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzEL +MAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD +VQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKxifZg +isRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//z +NIqeKNc0n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI ++MkcVyzwPX6UvCWThOiaAJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2R +hzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+ +mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0PAQH/BAQD +AgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFP +Bdy7pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27s +EzNxZy5p+qksP2bAEllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2 +mSlf56oBzKwzqBwKu5HEA6BvtjT5htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yC +e/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQjel/wroQk5PMr+4okoyeYZdow +dXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 +-----END CERTIFICATE----- + +================================================================ +C: NO +O: Buypass AS-983163327 +CN: Buypass Class 3 Root CA +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y +ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E +N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9 +tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX +0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c +/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X +KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY +zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS +O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D +34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP +K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3 +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv +Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj +QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS +IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2 +HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa +O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv +033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u +dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE +kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41 +3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD +u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq +4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc= +-----END CERTIFICATE----- + +================================================================ +C: PL +O: Unizeto Sp. z o.o. +CN: Certum CA +-----BEGIN CERTIFICATE----- +MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM +MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD +QTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM +MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD +QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E +jG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo +ePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI +ULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu +Ob7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg +AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7 +HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA +uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa +TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg +xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q +CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x +O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs +6GAqm4VKQPNriiTsBhYscw== +-----END CERTIFICATE----- + +================================================================ +C: PL +O: Unizeto Technologies S.A. +OU: Certum Certification Authority +CN: Certum Trusted Network CA +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM +MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D +ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU +cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3 +WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg +Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw +IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH +UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM +TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU +BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM +kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x +AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV +HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y +sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL +I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8 +J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY +VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +================================================================ +C: RO +O: certSIGN +OU: certSIGN ROOT CA +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT +AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD +QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP +MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do +0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ +UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d +RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ +OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv +JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C +AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O +BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ +LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY +MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ +44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I +Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw +i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN +9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +================================================================ +C: SE +O: AddTrust AB +OU: AddTrust External TTP Network +CN: AddTrust External CA Root +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs +IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 +MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h +bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt +H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 +uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX +mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX +a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN +E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 +WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD +VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 +Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU +cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx +IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN +AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH +YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC +Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX +c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a +mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +================================================================ +C: SE +O: AddTrust AB +OU: AddTrust TTP Network +CN: AddTrust Class 1 CA Root +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw +MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD +VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul +CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n +tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl +dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch +PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC ++Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O +BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl +MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk +ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X +7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz +43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl +pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA +WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- + +================================================================ +C: SE +O: AddTrust AB +OU: AddTrust TTP Network +CN: AddTrust Public CA Root +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx +MDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB +ZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV +BAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV +6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX +GCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP +dzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH +1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF +62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW +BBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL +MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU +cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv +b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6 +IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/ +iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao +GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh +4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm +XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY= +-----END CERTIFICATE----- + +================================================================ +C: SE +O: AddTrust AB +OU: AddTrust TTP Network +CN: AddTrust Qualified CA Root +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1 +MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK +EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh +BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq +xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G +87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i +2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U +WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1 +0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G +A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr +pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL +ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm +aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv +hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm +hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X +dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3 +P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y +iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no +xqE= +-----END CERTIFICATE----- + +================================================================ +C: SK +L: Bratislava +O: Disig a.s. +CN: CA Disig +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzET +MBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UE +AxMIQ0EgRGlzaWcwHhcNMDYwMzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQsw +CQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcg +YS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgmGErE +Nx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnX +mjxUizkDPw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYD +XcDtab86wYqg6I7ZuUUohwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhW +S8+2rT+MitcE5eN4TPWGqvWP+j1scaMtymfraHtuM6kMgiioTGohQBUgDCZbg8Kp +FhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8wgfwwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0PAQH/BAQD +AgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cu +ZGlzaWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5z +ay9jYS9jcmwvY2FfZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2sv +Y2EvY3JsL2NhX2Rpc2lnLmNybDAaBgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEw +DQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59tWDYcPQuBDRIrRhCA/ec8J9B6 +yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3mkkp7M5+cTxq +EEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ +CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeB +EicTXxChds6KezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFN +PGO+I++MzVpQuGhU+QqZMxEA4Z7CRneC9VkGjCFMhwnN5ag= +-----END CERTIFICATE----- + +================================================================ +C: SK +L: Bratislava +O: Disig a.s. +CN: CA Disig Root R1 +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNV +BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu +MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQy +MDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx +EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjEw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy3QRk +D2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/o +OI7bm+V8u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3A +fQ+lekLZWnDZv6fXARz2m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJe +IgpFy4QxTaz+29FHuvlglzmxZcfe+5nkCiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8n +oc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTaYVKvJrT1cU/J19IG32PK +/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6vpmumwKj +rckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD +3AjLLhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE +7cderVC6xkGbrPAXZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkC +yC2fg69naQanMVXVz0tv/wQFx1isXxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLd +qvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ04IwDQYJKoZI +hvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR +xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaA +SfX8MPWbTx9BLxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXo +HqJPYNcHKfyyo6SdbhWSVhlMCrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpB +emOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5GfbVSUZP/3oNn6z4eGBrxEWi1CXYBmC +AMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85YmLLW1AL14FABZyb +7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKSds+x +DzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvk +F7mGnjixlAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqF +a3qdnom2piiZk4hA9z7NUaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsT +Q6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJa7+h89n07eLw4+1knj0vllJPgFOL +-----END CERTIFICATE----- + +================================================================ +C: SK +L: Bratislava +O: Disig a.s. +CN: CA Disig Root R2 +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV +BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu +MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy +MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx +EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe +NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH +PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I +x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe +QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR +yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO +QG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912 +H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ +QfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD +i/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs +nLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1 +rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI +hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM +tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf +GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb +lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka ++elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal +TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i +nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3 +gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr +G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os +zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x +L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL +-----END CERTIFICATE----- + +================================================================ +C: TR +L: Gebze - Kocaeli +O: Türkiye Bilimsel ve Teknolojik Araştırma Kurumu - TÜBİTAK +OU: Ulusal Elektronik ve Kriptoloji Araştırma Enstitüsü - UEKAE +OU: Kamu Sertifikasyon Merkezi +CN: TÜBİTAK UEKAE Kök Sertifika Hizmet Sağlayıcısı - Sürüm 3 +-----BEGIN CERTIFICATE----- +MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRS +MRgwFgYDVQQHDA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJp +bGltc2VsIHZlIFRla25vbG9qaWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSw +VEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ryb25payB2ZSBLcmlwdG9sb2ppIEFy +YcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNVBAsMGkthbXUgU2Vy +dGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUgS8O2 +ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAe +Fw0wNzA4MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIx +GDAWBgNVBAcMD0dlYnplIC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmls +aW1zZWwgdmUgVGVrbm9sb2ppayBBcmHFn3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBU +QUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZlIEtyaXB0b2xvamkgQXJh +xZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2FtdSBTZXJ0 +aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7Zr +IFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4h +gb46ezzb8R1Sf1n68yJMlaCQvEhOEav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yK +O7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1xnnRFDDtG1hba+818qEhTsXO +fJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR6Oqeyjh1jmKw +lZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL +hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQID +AQABo0IwQDAdBgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/ +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmP +NOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4N5EY3ATIZJkrGG2AA1nJrvhY0D7t +wyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLTy9LQQfMmNkqblWwM +7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYhLBOh +gLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5n +oN+J1q2MdqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUs +yZyQ2uypQjyttgI= +-----END CERTIFICATE----- + +================================================================ +C: TR +O: Elektronik Bilgi Guvenligi A.S. +CN: e-Guven Kok Elektronik Sertifika Hizmet Saglayicisi +-----BEGIN CERTIFICATE----- +MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1 +MQswCQYDVQQGEwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxp +Z2kgQS5TLjE8MDoGA1UEAxMzZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZp +a2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3MDEwNDExMzI0OFoXDTE3MDEwNDEx +MzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0cm9uaWsgQmlsZ2kg +R3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9uaWsg +U2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdU +MZTe1RK6UxYC6lhj71vY8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlT +L/jDj/6z/P2douNffb7tC+Bg62nsM+3YjfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H +5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAIJjjcJRFHLfO6IxClv7wC +90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk9Ok0oSy1 +c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/ +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoE +VtstxNulMA0GCSqGSIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLP +qk/CaOv/gKlR6D1id4k9CnU58W5dF4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S +/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwqD2fK/A+JYZ1lpTzlvBNbCNvj +/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4Vwpm+Vganf2X +KWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq +fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX +-----END CERTIFICATE----- + +================================================================ +C: TW +O: Chunghwa Telecom Co., Ltd. +OU: ePKI Root Certification Authority +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe +MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0 +ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw +IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL +SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH +SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh +ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X +DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1 +TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ +fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA +sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU +WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS +nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH +dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip +NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC +AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF +MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB +uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl +PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP +JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/ +gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2 +j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6 +5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB +o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS +/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z +Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE +W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D +hNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +================================================================ +C: TW +O: Government Root Certification Authority +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/ +MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow +PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR +IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q +gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy +yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts +F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2 +jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx +ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC +VGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK +YS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH +EgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN +Xo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud +DgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE +MTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK +UWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf +qzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK +ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE +JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7 +hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1 +EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm +nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX +udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz +ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe +LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl +pYYsfPQS +-----END CERTIFICATE----- + +================================================================ +C: TW +O: TAIWAN-CA +OU: Root CA +CN: TWCA Root Certification Authority +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES +MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU +V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz +WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO +LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE +AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH +K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX +RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z +rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx +3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq +hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC +MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls +XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D +lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn +aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ +YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +================================================================ +C: US +O: AffirmTrust +CN: AffirmTrust Commercial +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP +Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr +ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL +MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 +yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr +VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ +nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG +XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj +vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt +Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g +N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC +nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +================================================================ +C: US +O: AffirmTrust +CN: AffirmTrust Networking +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y +YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua +kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL +QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp +6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG +yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i +QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO +tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu +QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ +Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u +olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 +x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +================================================================ +C: US +O: AffirmTrust +CN: AffirmTrust Premium +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz +dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG +A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U +cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf +qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ +JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ ++jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS +s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 +HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 +70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG +V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S +qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S +5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia +C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX +OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE +FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 +KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B +8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ +MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc +0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ +u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF +u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH +YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 +GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO +RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e +KeC2uAloGRwYQw== +-----END CERTIFICATE----- + +================================================================ +C: US +O: AffirmTrust +CN: AffirmTrust Premium ECC +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC +VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ +cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ +BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt +VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D +0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 +ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G +A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs +aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I +flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== +-----END CERTIFICATE----- + +================================================================ +C: US +O: America Online Inc. +CN: America Online Root Certification Authority 1 +-----BEGIN CERTIFICATE----- +MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP +bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2 +MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft +ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk +hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym +1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW +OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb +2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko +O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU +AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF +Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb +LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir +oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C +MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds +sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 +-----END CERTIFICATE----- + +================================================================ +C: US +O: America Online Inc. +CN: America Online Root Certification Authority 2 +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP +bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2 +MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft +ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC +206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci +KtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2 +JxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9 +BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e +Xz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B +PeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67 +Xnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq +Z8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ +o2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3 ++L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj +YzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj +FNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn +xPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2 +LHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc +obGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8 +CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe +IjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA +DjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F +AjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX +Om/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb +AZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl +Zvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw +RY8mkaKO/qk= +-----END CERTIFICATE----- + +================================================================ +C: US +O: DigiCert Inc +OU: www.digicert.com +CN: DigiCert Assured ID Root CA +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c +JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP +mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ +wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 +VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ +AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB +AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW +BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun +pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC +dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf +fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm +NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx +H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +================================================================ +C: US +O: DigiCert Inc +OU: www.digicert.com +CN: DigiCert Global Root CA +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD +QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB +CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 +nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt +43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P +T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 +gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR +TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw +DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr +hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg +06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF +PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls +YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +================================================================ +C: US +O: DigiCert Inc +OU: www.digicert.com +CN: DigiCert High Assurance EV Root CA +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- + +================================================================ +C: US +O: Digital Signature Trust +OU: DST ACES +CN: DST ACES CA X6 +-----BEGIN CERTIFICATE----- +MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx +ETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w +MzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD +VQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx +FzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPu +ktKe1jzIDZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7 +gLFViYsx+tC3dr5BPTCapCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZH +fAjIgrrep4c9oW24MFbCswKBXy314powGCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4a +ahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPyMjwmR/onJALJfh1biEIT +ajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1UdEwEB/wQF +MAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rk +c3QuY29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjto +dHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt +aW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI +hvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk +QIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/ +h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq +nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR +rscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2 +9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis= +-----END CERTIFICATE----- + +================================================================ +C: US +O: Digital Signature Trust Co. +OU: DSTCA E1 +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV +UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL +EwhEU1RDQSBFMTAeFw05ODEyMTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJ +BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x +ETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCg +bIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJENySZ +j9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlV +Sn5JTe2io74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCG +SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx +JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI +RFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMTAxODEw +MjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFGp5 +fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i ++DAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG +SIb3DQEBBQUAA4GBACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lN +QseSJqBcNJo4cvj9axY+IO6CizEqkzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+ +gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4RbyhkwS7hp86W0N6w4pl +-----END CERTIFICATE----- + +================================================================ +C: US +O: Digital Signature Trust Co. +OU: DSTCA E2 +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV +UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL +EwhEU1RDQSBFMjAeFw05ODEyMDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJ +BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x +ETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQC/ +k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGODVvso +LeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3o +TQPMx7JSxhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCG +SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx +JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI +RFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkxOTE3 +MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFB6C +TShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5 +WzAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG +SIb3DQEBBQUAA4GBAEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHR +xdf0CiUPPXiBng+xZ8SQTGPdXqfiup/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVL +B3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1mPnHfxsb1gYgAlihw6ID +-----END CERTIFICATE----- + +================================================================ +C: US +O: Entrust, Inc. +OU: www.entrust.net/CPS is incorporated by reference +OU: (c) 2006 Entrust, Inc. +CN: Entrust Root Certification Authority +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 +Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW +KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw +NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw +NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy +ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV +BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo +Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 +4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 +KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI +rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi +94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB +sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi +gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo +kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE +vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t +O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua +AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP +9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ +eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m +0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +================================================================ +C: US +O: Entrust.net +OU: www.entrust.net/CPS incorp. by ref. (limits liab.) +OU: (c) 1999 Entrust.net Limited +CN: Entrust.net Secure Server Certification Authority +-----BEGIN CERTIFICATE----- +MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC +VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u +ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc +KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u +ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 +MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE +ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j +b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF +bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg +U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/ +I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3 +wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC +AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb +oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5 +BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p +dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk +MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp +b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu +dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0 +MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi +E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa +MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI +hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN +95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd +2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= +-----END CERTIFICATE----- + +================================================================ +C: US +O: Equifax +OU: Equifax Secure Certificate Authority +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV +UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy +dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 +MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx +dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f +BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A +cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC +AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm +aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw +ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj +IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF +MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA +A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y +7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh +1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 +-----END CERTIFICATE----- + +================================================================ +C: US +O: Equifax Secure Inc. +CN: Equifax Secure Global eBusiness CA-1 +-----BEGIN CERTIFICATE----- +MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT +ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw +MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj +dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l +c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC +UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc +58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/ +o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH +MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr +aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA +A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA +Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv +8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV +-----END CERTIFICATE----- + +================================================================ +C: US +O: Equifax Secure Inc. +CN: Equifax Secure eBusiness CA-1 +-----BEGIN CERTIFICATE----- +MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT +ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw +MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j +LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ +KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo +RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu +WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw +Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD +AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK +eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM +zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+ +WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN +/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ== +-----END CERTIFICATE----- + +================================================================ +C: US +O: GTE Corporation +OU: GTE CyberTrust Solutions, Inc. +CN: GTE CyberTrust Global Root +-----BEGIN CERTIFICATE----- +MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD +VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv +bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv +b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV +UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU +cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds +b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH +iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS +r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4 +04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r +GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9 +3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P +lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ +-----END CERTIFICATE----- + +================================================================ +C: US +O: GeoTrust Inc. +CN: GeoTrust Global CA +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- + +================================================================ +C: US +O: GeoTrust Inc. +CN: GeoTrust Global CA 2 +-----BEGIN CERTIFICATE----- +MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs +IENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg +R2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A +PRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8 +Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL +TytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL +5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7 +S4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe +2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap +EBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td +EPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv +/NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN +A0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0 +abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF +I8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz +4iIprn2DQKi6bA== +-----END CERTIFICATE----- + +================================================================ +C: US +O: GeoTrust Inc. +CN: GeoTrust Primary Certification Authority +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo +R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx +MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 +AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA +ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 +7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W +kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI +mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ +KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 +6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl +4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K +oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj +UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU +AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +================================================================ +C: US +O: GeoTrust Inc. +CN: GeoTrust Universal CA +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy +c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0 +IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV +VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8 +cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT +QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh +F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v +c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w +mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd +VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX +teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ +f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe +Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+ +nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB +/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY +MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG +9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX +IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn +ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z +uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN +Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja +QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW +koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9 +ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt +DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm +bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +================================================================ +C: US +O: GeoTrust Inc. +CN: GeoTrust Universal CA 2 +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy +c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD +VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1 +c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81 +WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG +FF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq +XbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL +se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb +KNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd +IgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73 +y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt +hAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc +QIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4 +Lt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV +HSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ +KoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ +L1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr +Fg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo +ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY +T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz +GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m +1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV +OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH +6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX +QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +================================================================ +C: US +O: GeoTrust Inc. +OU: (c) 2007 GeoTrust Inc. - For authorized use only +CN: GeoTrust Primary Certification Authority - G2 +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj +KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 +MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw +NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV +BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH +MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL +So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal +tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG +CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT +qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz +rD6ogRLQy7rQkgu2npaqBA+K +-----END CERTIFICATE----- + +================================================================ +C: US +O: GeoTrust Inc. +OU: (c) 2008 GeoTrust Inc. - For authorized use only +CN: GeoTrust Primary Certification Authority - G3 +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB +mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT +MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ +BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0 +BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz ++uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm +hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn +5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W +JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL +DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC +huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw +HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB +AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB +zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN +kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH +SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G +spki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +================================================================ +C: US +O: Network Solutions L.L.C. +CN: Network Solutions Certificate Authority +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi +MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp +dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV +UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO +ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz +c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP +OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl +mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF +BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 +qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw +gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu +bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp +dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 +6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ +h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH +/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN +pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +================================================================ +C: US +O: SecureTrust Corporation +CN: Secure Global CA +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx +MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg +Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ +iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa +/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ +jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI +HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 +sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w +gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw +KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG +AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L +URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO +H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm +I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY +iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +================================================================ +C: US +O: SecureTrust Corporation +CN: SecureTrust CA +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz +MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv +cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz +Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO +0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao +wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj +7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS +8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT +BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg +JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3 +6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/ +3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm +D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS +CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +================================================================ +C: US +O: Starfield Technologies, Inc. +OU: Starfield Class 2 Certification Authority +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl +MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp +U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw +NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE +ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp +ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 +DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf +8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN ++lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 +X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa +K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA +1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G +A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR +zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 +YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD +bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 +L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D +eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp +VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY +WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +================================================================ +C: US +O: The Go Daddy Group, Inc. +OU: Go Daddy Class 2 Certification Authority +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh +MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE +YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 +MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo +ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg +MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN +ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA +PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w +wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi +EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY +avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ +YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE +sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h +/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 +IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy +OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P +TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER +dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf +ReYNnyicsbkqWletNw+vHX/bvZ8= +-----END CERTIFICATE----- + +================================================================ +C: US +O: VISA +OU: Visa International Service Association +CN: Visa eCommerce Root +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr +MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl +cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw +CQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h +dGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l +cmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h +2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E +lpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV +ZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq +299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t +vz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL +dXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF +AAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR +zCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3 +LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd +7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw +++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: Class 1 Public Primary Certification Authority +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f +zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi +TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G +CSqGSIb3DQEBBQUAA4GBAFgVKTk8d6PaXCUDfGD67gmZPCcQcMgMCeazh88K4hiW +NWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n0a3hUKw8fGJLj7qE1xIV +Gx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZRjXZ+Hxb +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: Class 1 Public Primary Certification Authority - G2 +OU: (c) 1998 VeriSign, Inc. - For authorized use only +OU: VeriSign Trust Network +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh +c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy +MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp +emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X +DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw +FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMg +UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo +YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 +MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgdk4xWArzZbxpvUjZudVYK +VdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIqWpDBucSm +Fc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQID +AQABMA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0J +h9ZrbWB85a7FkCMMXErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2ul +uIncrKTdcu1OofdPvAbT6shkdHvClUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68 +DzFc6PLZ +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: Class 2 Public Primary Certification Authority - G2 +OU: (c) 1998 VeriSign, Inc. - For authorized use only +OU: VeriSign Trust Network +-----BEGIN CERTIFICATE----- +MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns +YXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH +MjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y +aXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe +Fw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX +MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj +IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx +KGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM +HiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw +DqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC +AwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji +nb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX +rXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn +jBJ7xUS0rg== +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: Class 3 Public Primary Certification Authority +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do +lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc +AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: Class 3 Public Primary Certification Authority +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i +2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ +2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: Class 3 Public Primary Certification Authority - G2 +OU: (c) 1998 VeriSign, Inc. - For authorized use only +OU: VeriSign Trust Network +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh +c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy +MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp +emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X +DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw +FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg +UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo +YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 +MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4 +pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0 +13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID +AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk +U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i +F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY +oJ2daZH9 +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: VeriSign Trust Network +OU: (c) 1999 VeriSign, Inc. - For authorized use only +CN: VeriSign Class 1 Public Primary Certification Authority - G3 +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl +cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu +LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT +aWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT +aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ +bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu +IENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN2E1Lm0+afY8wR4 +nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/EbRrsC+MO +8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjV +ojYJrKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjb +PG7PoBMAGrgnoeS+Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP2 +6KbqxzcSXKMpHgLZ2x87tNcPVkeBFQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vr +n5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAq2aN17O6x5q25lXQBfGfMY1a +qtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/Ny9Sn2WCVhDr4 +wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3 +ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrs +pSCAaWihT37ha88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4 +E1Z5T21Q6huwtVexN2ZYI/PcD98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g== +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: VeriSign Trust Network +OU: (c) 1999 VeriSign, Inc. - For authorized use only +CN: VeriSign Class 2 Public Primary Certification Authority - G3 +-----BEGIN CERTIFICATE----- +MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVy +aVNpZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24s +IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNp +Z24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJBgNV +BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp +Z24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIElu +Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24g +Q2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt +IEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwoNwtUs22e5LeWU +J92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6tW8UvxDO +JxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUY +wZF7C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9o +koqQHgiBVrKtaaNS0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjN +qWm6o+sdDZykIKbBoMXRRkwXbdKsZj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/E +Srg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0JhU8wI1NQ0kdvekhktdmnLfe +xbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf0xwLRtxyID+u +7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU +sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RI +sH/7NiXaldDxJBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTP +cjnhsUPgKM+351psE2tJs//jGHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: VeriSign Trust Network +OU: (c) 1999 VeriSign, Inc. - For authorized use only +CN: VeriSign Class 3 Public Primary Certification Authority - G3 +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl +cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu +LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT +aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT +aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ +bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu +IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b +N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t +KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu +kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm +CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ +Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu +imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te +2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe +DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p +F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt +TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: VeriSign Trust Network +OU: (c) 1999 VeriSign, Inc. - For authorized use only +CN: VeriSign Class 4 Public Primary Certification Authority - G3 +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl +cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu +LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT +aWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT +aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ +bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu +IENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1 +GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ ++mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd +U6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm +NxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY +ufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ +ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1 +CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq +g6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm +fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c +2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/ +bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: VeriSign Trust Network +OU: (c) 2006 VeriSign, Inc. - For authorized use only +CN: VeriSign Class 3 Public Primary Certification Authority - G5 +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: VeriSign Trust Network +OU: (c) 2007 VeriSign, Inc. - For authorized use only +CN: VeriSign Class 3 Public Primary Certification Authority - G4 +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp +U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg +SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln +biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm +GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve +fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ +aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj +aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW +kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC +4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga +FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +================================================================ +C: US +O: VeriSign, Inc. +OU: VeriSign Trust Network +OU: (c) 2008 VeriSign, Inc. - For authorized use only +CN: VeriSign Universal Root Certification Authority +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB +vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W +ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX +MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0 +IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y +IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh +bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF +9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH +H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H +LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN +/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT +rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw +WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs +exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4 +sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+ +seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz +4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+ +BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR +lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 +7M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +================================================================ +C: US +O: Wells Fargo +OU: Wells Fargo Certification Authority +CN: Wells Fargo Root Certificate Authority +-----BEGIN CERTIFICATE----- +MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMC +VVMxFDASBgNVBAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9v +dCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDAxMDExMTY0MTI4WhcNMjEwMTE0 +MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dlbGxzIEZhcmdvMSww +KgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEvMC0G +A1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n13 +5zHCLielTWi5MbqNQ1mXx3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHE +SxP9cMIlrCL1dQu3U+SlK93OvRw6esP3E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4O +JgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5OEL8pahbSCOz6+MlsoCu +ltQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4jsNtlAHCE +AQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMB +AAGjYTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcB +CzAyMDAGCCsGAQUFBwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRw +b2xpY3kwDQYJKoZIhvcNAQEFBQADggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo +7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrvm+0fazbuSCUlFLZWohDo7qd/ +0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0ROhPs7fpvcmR7 +nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx +x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ +33ZwmVxwQ023tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s= +-----END CERTIFICATE----- + +================================================================ +C: US +O: Wells Fargo WellsSecure +OU: Wells Fargo Bank NA +CN: WellsSecure Public Root Certificate Authority +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMx +IDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxs +cyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9v +dCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcxMjEzMTcwNzU0WhcNMjIxMjE0 +MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdl +bGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQD +DC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+r +WxxTkqxtnt3CxC5FlAM1iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjU +Dk/41itMpBb570OYj7OeUt9tkTmPOL13i0Nj67eT/DBMHAGTthP796EfvyXhdDcs +HqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8bJVhHlfXBIEyg1J55oNj +z7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiBK0HmOFaf +SZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/Slwxl +AgMBAAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqG +KGh0dHA6Ly9jcmwucGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0P +AQH/BAQDAgHGMB0GA1UdDgQWBBQmlRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0j +BIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGBi6SBiDCBhTELMAkGA1UEBhMC +VVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNX +ZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEB +ALkVsUSRzCPIK0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd +/ZDJPHV3V3p9+N701NX3leZ0bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pB +A4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSljqHyita04pO2t/caaH/+Xc/77szWn +k4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+esE2fDbbFwRnzVlhE9 +iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJtylv +2G0xffX8oRAHh84vWdw+WNs= +-----END CERTIFICATE----- + +================================================================ +C: US +O: thawte, Inc. +OU: (c) 2007 thawte, Inc. - For authorized use only +CN: thawte Primary Root CA - G2 +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp +IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi +BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw +MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig +YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v +dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/ +BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6 +papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K +DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3 +KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox +XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +================================================================ +C: US +O: thawte, Inc. +OU: Certification Services Division +OU: (c) 2006 thawte, Inc. - For authorized use only +CN: thawte Primary Root CA +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB +qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV +BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw +NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j +LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG +A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs +W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta +3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk +6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6 +Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J +NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP +r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU +DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz +YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 +/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ +LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 +jVaMaA== +-----END CERTIFICATE----- + +================================================================ +C: US +O: thawte, Inc. +OU: Certification Services Division +OU: (c) 2008 thawte, Inc. - For authorized use only +CN: thawte Primary Root CA - G3 +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB +rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV +BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa +Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl +LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u +MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm +gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 +YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf +b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 +9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S +zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk +OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV +HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA +2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW +oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c +KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM +m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu +MdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +================================================================ +C: US +OU: www.xrampsecurity.com +O: XRamp Security Services Inc +CN: XRamp Global Certification Authority +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB +gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk +MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY +UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx +NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 +dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy +dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 +38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP +KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q +DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 +qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa +JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi +PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P +BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs +jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 +eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR +vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa +IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy +i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ +O+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +================================================================ +C: US +ST: Arizona +L: Scottsdale +O: GoDaddy.com, Inc. +CN: Go Daddy Root Certificate Authority - G2 +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT +EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp +ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz +NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH +EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE +AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD +E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH +/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy +DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh +GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR +tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA +AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX +WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu +9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr +gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo +2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI +4uJEvlz36hz1 +-----END CERTIFICATE----- + +================================================================ +C: US +ST: Arizona +L: Scottsdale +O: Starfield Technologies, Inc. +CN: Starfield Root Certificate Authority - G2 +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs +ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw +MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj +aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp +Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg +nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 +HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N +Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN +dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 +HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G +CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU +sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 +4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg +8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 +mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +================================================================ +C: US +ST: Arizona +L: Scottsdale +O: Starfield Technologies, Inc. +CN: Starfield Services Root Certificate Authority - G2 +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs +ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy +ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy +dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p +OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 +8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K +Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe +hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk +6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q +AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI +bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB +ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z +qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn +0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN +sSi6 +-----END CERTIFICATE----- + +================================================================ +C: US +ST: Indiana +L: Indianapolis +O: Software in the Public Interest +OU: hostmaster +CN: Certificate Authority +emailAddress: hostmaster@spi-inc.org +-----BEGIN CERTIFICATE----- +MIIIDjCCBfagAwIBAgIJAOiOtsn4KhQoMA0GCSqGSIb3DQEBBQUAMIG8MQswCQYD +VQQGEwJVUzEQMA4GA1UECBMHSW5kaWFuYTEVMBMGA1UEBxMMSW5kaWFuYXBvbGlz +MSgwJgYDVQQKEx9Tb2Z0d2FyZSBpbiB0aGUgUHVibGljIEludGVyZXN0MRMwEQYD +VQQLEwpob3N0bWFzdGVyMR4wHAYDVQQDExVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkx +JTAjBgkqhkiG9w0BCQEWFmhvc3RtYXN0ZXJAc3BpLWluYy5vcmcwHhcNMDgwNTEz +MDgwNzU2WhcNMTgwNTExMDgwNzU2WjCBvDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0luZGlhbmExFTATBgNVBAcTDEluZGlhbmFwb2xpczEoMCYGA1UEChMfU29mdHdh +cmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDETMBEGA1UECxMKaG9zdG1hc3RlcjEe +MBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MSUwIwYJKoZIhvcNAQkBFhZo +b3N0bWFzdGVyQHNwaS1pbmMub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEA3DbmR0LCxFF1KYdAw9iOIQbSGE7r7yC9kDyFEBOMKVuUY/b0LfEGQpG5 +GcRCaQi/izZF6igFM0lIoCdDkzWKQdh4s/Dvs24t3dHLfer0dSbTPpA67tfnLAS1 +fOH1fMVO73e9XKKTM5LOfYFIz2u1IiwIg/3T1c87Lf21SZBb9q1NE8re06adU1Fx +Y0b4ShZcmO4tbZoWoXaQ4mBDmdaJ1mwuepiyCwMs43pPx93jzONKao15Uvr0wa8u +jyoIyxspgpJyQ7zOiKmqp4pRQ1WFmjcDeJPI8L20QcgHQprLNZd6ioFl3h1UCAHx +ZFy3FxpRvB7DWYd2GBaY7r/2Z4GLBjXFS21ZGcfSxki+bhQog0oQnBv1b7ypjvVp +/rLBVcznFMn5WxRTUQfqzj3kTygfPGEJ1zPSbqdu1McTCW9rXRTunYkbpWry9vjQ +co7qch8vNGopCsUK7BxAhRL3pqXTT63AhYxMfHMgzFMY8bJYTAH1v+pk1Vw5xc5s +zFNaVrpBDyXfa1C2x4qgvQLCxTtVpbJkIoRRKFauMe5e+wsWTUYFkYBE7axt8Feo ++uthSKDLG7Mfjs3FIXcDhB78rKNDCGOM7fkn77SwXWfWT+3Qiz5dW8mRvZYChD3F +TbxCP3T9PF2sXEg2XocxLxhsxGjuoYvJWdAY4wCAs1QnLpnwFVMCAwEAAaOCAg8w +ggILMB0GA1UdDgQWBBQ0cdE41xU2g0dr1zdkQjuOjVKdqzCB8QYDVR0jBIHpMIHm +gBQ0cdE41xU2g0dr1zdkQjuOjVKdq6GBwqSBvzCBvDELMAkGA1UEBhMCVVMxEDAO +BgNVBAgTB0luZGlhbmExFTATBgNVBAcTDEluZGlhbmFwb2xpczEoMCYGA1UEChMf +U29mdHdhcmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDETMBEGA1UECxMKaG9zdG1h +c3RlcjEeMBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MSUwIwYJKoZIhvcN +AQkBFhZob3N0bWFzdGVyQHNwaS1pbmMub3JnggkA6I62yfgqFCgwDwYDVR0TAQH/ +BAUwAwEB/zARBglghkgBhvhCAQEEBAMCAAcwCQYDVR0SBAIwADAuBglghkgBhvhC +AQ0EIRYfU29mdHdhcmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDAwBglghkgBhvhC +AQQEIxYhaHR0cHM6Ly9jYS5zcGktaW5jLm9yZy9jYS1jcmwucGVtMDIGCWCGSAGG ++EIBAwQlFiNodHRwczovL2NhLnNwaS1pbmMub3JnL2NlcnQtY3JsLnBlbTAhBgNV +HREEGjAYgRZob3N0bWFzdGVyQHNwaS1pbmMub3JnMA4GA1UdDwEB/wQEAwIBBjAN +BgkqhkiG9w0BAQUFAAOCAgEAtM294LnqsgMrfjLp3nI/yUuCXp3ir1UJogxU6M8Y +PCggHam7AwIvUjki+RfPrWeQswN/2BXja367m1YBrzXU2rnHZxeb1NUON7MgQS4M +AcRb+WU+wmHo0vBqlXDDxm/VNaSsWXLhid+hoJ0kvSl56WEq2dMeyUakCHhBknIP +qxR17QnwovBc78MKYiC3wihmrkwvLo9FYyaW8O4x5otVm6o6+YI5HYg84gd1GuEP +sTC8cTLSOv76oYnzQyzWcsR5pxVIBcDYLXIC48s9Fmq6ybgREOJJhcyWR2AFJS7v +dVkz9UcZFu/abF8HyKZQth3LZjQl/GaD68W2MEH4RkRiqMEMVObqTFoo5q7Gt/5/ +O5aoLu7HaD7dAD0prypjq1/uSSotxdz70cbT0ZdWUoa2lOvUYFG3/B6bzAKb1B+P ++UqPti4oOxfMxaYF49LTtcYDyeFIQpvLP+QX4P4NAZUJurgNceQJcHdC2E3hQqlg +g9cXiUPS1N2nGLar1CQlh7XU4vwuImm9rWgs/3K1mKoGnOcqarihk3bOsPN/nOHg +T7jYhkalMwIsJWE3KpLIrIF0aGOHM3a9BX9e1dUCbb2v/ypaqknsmHlHU5H2DjRa +yaXG67Ljxay2oHA1u8hRadDytaIybrw/oDc5fHE2pgXfDBLkFqfF1stjo5VwP+YE +o2A= +-----END CERTIFICATE----- + +================================================================ +C: US +ST: UT +L: Salt Lake City +O: The USERTRUST Network +OU: http://www.usertrust.com +CN: UTN - DATACorp SGC +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB +kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw +IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG +EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD +VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu +dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6 +E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ +D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK +4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq +lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW +bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB +o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT +MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js +LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr +BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB +AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft +Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj +j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH +KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv +2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3 +mfnGV/TJVTl4uix5yaaIK/QI +-----END CERTIFICATE----- + +================================================================ +C: US +ST: UT +L: Salt Lake City +O: The USERTRUST Network +OU: http://www.usertrust.com +CN: UTN-USERFirst-Client Authentication and Email +-----BEGIN CERTIFICATE----- +MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCB +rjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0BgNVBAMTLVVUTi1VU0VSRmlyc3Qt +Q2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05OTA3MDkxNzI4NTBa +Fw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAV +BgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5l +dHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UE +AxMtVVROLVVTRVJGaXJzdC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWls +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3B +YHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIxB8dOtINknS4p1aJkxIW9 +hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8om+rWV6l +L8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLm +SGHGTPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM +1tZUOt4KpLoDd7NlyP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws +6wIDAQABo4G5MIG2MAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNVHR8EUTBPME2gS6BJhkdodHRw +Oi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGllbnRBdXRoZW50 +aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH +AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u +7mFVbwQ+zznexRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0 +xtcgBEXkzYABurorbs6q15L+5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQ +rfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarVNZ1yQAOJujEdxRBoUp7fooXFXAim +eOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZw7JHpsIyYdfHb0gk +USeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ= +-----END CERTIFICATE----- + +================================================================ +C: US +ST: UT +L: Salt Lake City +O: The USERTRUST Network +OU: http://www.usertrust.com +CN: UTN-USERFirst-Hardware +-----BEGIN CERTIFICATE----- +MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB +lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt +SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG +A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe +MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v +d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh +cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn +0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ +M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a +MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd +oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI +DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy +oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0 +dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy +bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF +BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM +//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli +CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE +CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t +3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS +KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA== +-----END CERTIFICATE----- + +================================================================ +C: ZA +ST: Western Cape +L: Cape Town +O: Thawte Consulting cc +OU: Certification Services Division +CN: Thawte Premium Server CA +emailAddress: premium-server@thawte.com +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- + +================================================================ +C: ZA +ST: Western Cape +L: Cape Town +O: Thawte Consulting cc +OU: Certification Services Division +CN: Thawte Server CA +emailAddress: server-certs@thawte.com +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm +MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx +MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 +dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl +cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 +DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 +yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX +L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj +EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG +7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e +QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ +qdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- + +================================================================ +C: ch +O: Swisscom +OU: Digital Certificate Services +CN: Swisscom Root CA 1 +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBk +MQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0 +YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg +Q0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4MTgyMjA2MjBaMGQxCzAJBgNVBAYT +AmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp +Y2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9 +m2BtRsiMMW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdih +FvkcxC7mlSpnzNApbjyFNDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/ +TilftKaNXXsLmREDA/7n29uj/x2lzZAeAR81sH8A25Bvxn570e56eqeqDFdvpG3F +EzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkCb6dJtDZd0KTeByy2dbco +kdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn7uHbHaBu +HYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNF +vJbNcA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo +19AOeCMgkckkKmUpWyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjC +L3UcPX7ape8eYIVpQtPM+GP+HkM5haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJW +bjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNYMUJDLXT5xp6mig/p/r+D5kNX +JLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw +FDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j +BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzc +K6FptWfUjNP9MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzf +ky9NfEBWMXrrpA9gzXrzvsMnjgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7Ik +Vh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQMbFamIp1TpBcahQq4FJHgmDmHtqB +sfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4HVtA4oJVwIHaM190e +3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtlvrsR +ls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ip +mXeascClOS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HH +b6D0jqTsNFFbjCYDcKF31QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksf +rK/7DZBaZmBwXarNeNQk7shBoJMBkpxqnvy5JMWzFYJ+vq6VK+uxwNrjAWALXmms +hFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCyx/yP2FS1k2Kdzs9Z+z0Y +zirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMWNY6E0F/6 +MBr1mmz0DlP5OlvRHA== +-----END CERTIFICATE----- + +================================================================ +C: ch +O: Swisscom +OU: Digital Certificate Services +CN: Swisscom Root CA 2 +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBk +MQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0 +YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg +Q0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2MjUwNzM4MTRaMGQxCzAJBgNVBAYT +AmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp +Y2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvEr +jw0DzpPMLgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r +0rk0X2s682Q2zsKwzxNoysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f +2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJwDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVP +ACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpHWrumnf2U5NGKpV+GY3aF +y6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1aSgJA/MTA +tukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL +6yxSNLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0 +uPoTXGiTOmekl9AbmbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrAL +acywlKinh/LTSlDcX3KwFnUey7QYYpqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velh +k6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3qPyZ7iVNTA6z00yPhOgpD/0Q +VAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw +FDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O +BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqh +b97iEoHF8TwuMA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4R +fbgZPnm3qKhyN2abGu2sEzsOv2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv +/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ82YqZh6NM4OKb3xuqFp1mrjX2lhI +REeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLzo9v/tdhZsnPdTSpx +srpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcsa0vv +aGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciAT +woCqISxxOQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99n +Bjx8Oto0QuFmtEYE3saWmA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5W +t6NlUe07qxS/TFED6F+KBZvuim6c779o+sjaC+NCydAXFJy3SuCvkychVSa1ZC+N +8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TCrvJcwhbtkj6EPnNgiLx2 +9CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX5OfNeOI5 +wSsSnqaeG8XmDtkx2Q== +-----END CERTIFICATE----- + +================================================================ +C: ch +O: Swisscom +OU: Digital Certificate Services +CN: Swisscom Root EV CA 2 +-----BEGIN CERTIFICATE----- +MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAw +ZzELMAkGA1UEBhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdp +dGFsIENlcnRpZmljYXRlIFNlcnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290 +IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcNMzEwNjI1MDg0NTA4WjBnMQswCQYD +VQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2Vy +dGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYgQ0Eg +MjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7Bx +UglgRCgzo3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD +1ycfMQ4jFrclyxy0uYAyXhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPH +oCE2G3pXKSinLr9xJZDzRINpUKTk4RtiGZQJo/PDvO/0vezbE53PnUgJUmfANykR +HvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8LiqG12W0OfvrSdsyaGOx9/ +5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaHZa0zKcQv +idm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHL +OdAGalNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaC +NYGu+HuB5ur+rPQam3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f +46Fq9mDU5zXNysRojddxyNMkM3OxbPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCB +UWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDixzgHcgplwLa7JSnaFp6LNYth +7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/BAQDAgGGMB0G +A1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED +MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWB +bj2ITY1x0kbBbkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6x +XCX5145v9Ydkn+0UjrgEjihLj6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98T +PLr+flaYC/NUn81ETm484T4VvwYmneTwkLbUwp4wLh/vx3rEUMfqe9pQy3omywC0 +Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7XwgiG/W9mR4U9s70 +WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH59yL +Gn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm +7JFe3VE/23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4S +nr8PyQUQ3nqjsTzyP6WqJ3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VN +vBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyAHmBR3NdUIR7KYndP+tiPsys6DXhyyWhB +WkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/giuMod89a2GQ+fYWVq6nTI +fI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuWl8PVP3wb +I+2ksx0WckNLIOFZfsLorSa/ovc= +-----END CERTIFICATE----- + +================================================================ +CN: ACEDICOM Root +OU: PKI +O: EDICOM +C: ES +-----BEGIN CERTIFICATE----- +MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UE +AwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00x +CzAJBgNVBAYTAkVTMB4XDTA4MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEW +MBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZF +RElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC +AgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHkWLn7 +09gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7 +XBZXehuDYAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5P +Grjm6gSSrj0RuVFCPYewMYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAK +t0SdE3QrwqXrIhWYENiLxQSfHY9g5QYbm8+5eaA9oiM/Qj9r+hwDezCNzmzAv+Yb +X79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbkHQl/Sog4P75n/TSW9R28 +MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTTxKJxqvQU +fecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI +2Sf23EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyH +K9caUPgn6C9D4zq92Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEae +ZAwUswdbxcJzbPEHXEUkFDWug/FqTYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAP +BgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz4SsrSbbXc6GqlPUB53NlTKxQ +MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU9QHnc2VMrFAw +RAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv +bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWIm +fQwng4/F9tqgaHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3 +gvoFNTPhNahXwOf9jU8/kzJPeGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKe +I6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1PwkzQSulgUV1qzOMPPKC8W64iLgpq0i +5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1ThCojz2GuHURwCRi +ipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oIKiMn +MCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZ +o5NjEFIqnxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6 +zqylfDJKZ0DcMDQj3dcEI2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacN +GHk0vFQYXlPKNFHtRQrmjseCNj6nOGOpMCwXEGCSn1WHElkQwg9naRHMTh5+Spqt +r0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3otkYNbn5XOmeUwssfnHdK +Z05phkOTOPu220+DkdRgfks+KzgHVZhepA== +-----END CERTIFICATE----- + +================================================================ +CN: ComSign CA +O: ComSign +C: IL +-----BEGIN CERTIFICATE----- +MIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0 +MRMwEQYDVQQDEwpDb21TaWduIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQG +EwJJTDAeFw0wNDAzMjQxMTMyMThaFw0yOTAzMTkxNTAyMThaMDQxEzARBgNVBAMT +CkNvbVNpZ24gQ0ExEDAOBgNVBAoTB0NvbVNpZ24xCzAJBgNVBAYTAklMMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8ORUaSvTx49qROR+WCf4C9DklBKK +8Rs4OC8fMZwG1Cyn3gsqrhqg455qv588x26i+YtkbDqthVVRVKU4VbirgwTyP2Q2 +98CNQ0NqZtH3FyrV7zb6MBBC11PN+fozc0yz6YQgitZBJzXkOPqUm7h65HkfM/sb +2CEJKHxNGGleZIp6GZPKfuzzcuc3B1hZKKxC+cX/zT/npfo4sdAMx9lSGlPWgcxC +ejVb7Us6eva1jsz/D3zkYDaHL63woSV9/9JLEYhwVKZBqGdTUkJe5DSe5L6j7Kpi +Xd3DTKaCQeQzC6zJMw9kglcq/QytNuEMrkvF7zuZ2SOzW120V+x0cAwqTwIDAQAB +o4GgMIGdMAwGA1UdEwQFMAMBAf8wPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2Zl +ZGlyLmNvbXNpZ24uY28uaWwvY3JsL0NvbVNpZ25DQS5jcmwwDgYDVR0PAQH/BAQD +AgGGMB8GA1UdIwQYMBaAFEsBmz5WGmU2dst7l6qSBe4y5ygxMB0GA1UdDgQWBBRL +AZs+VhplNnbLe5eqkgXuMucoMTANBgkqhkiG9w0BAQUFAAOCAQEA0Nmlfv4pYEWd +foPPbrxHbvUanlR2QnG0PFg/LUAlQvaBnPGJEMgOqnhPOAlXsDzACPw1jvFIUY0M +cXS6hMTXcpuEfDhOZAYnKuGntewImbQKDdSFc8gS4TXt8QUxHXOZDOuWyt3T5oWq +8Ir7dcHyCTxlZWTzTNity4hp8+SDtwy9F1qWF8pb/627HOkthIDYIb6FUtnUdLlp +hbpN7Sgy6/lhSuTENh4Z3G+EER+V9YMoGKgzkkMn3V0TBEVPh9VGzT2ouvDzuFYk +Res3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U +AGegcQCCSA== +-----END CERTIFICATE----- + +================================================================ +CN: ComSign Secured CA +O: ComSign +C: IL +-----BEGIN CERTIFICATE----- +MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAw +PDEbMBkGA1UEAxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWdu +MQswCQYDVQQGEwJJTDAeFw0wNDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwx +GzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBDQTEQMA4GA1UEChMHQ29tU2lnbjEL +MAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGtWhf +HZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs49oh +gHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sW +v+bznkqH7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ue +Mv5WJDmyVIRD9YTC2LxBkMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr +9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d19guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt +6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUwAwEB/zBEBgNVHR8EPTA7 +MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29tU2lnblNl +Y3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58 +ADsAj8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkq +hkiG9w0BAQUFAAOCAQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7p +iL1DRYHjZiM/EoZNGeQFsOY3wo3aBijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtC +dsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtpFhpFfTMDZflScZAmlaxMDPWL +kz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP51qJThRv4zdL +hfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz +OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== +-----END CERTIFICATE----- + +================================================================ +CN: EBG Elektronik Sertifika Hizmet Sağlayıcısı +O: EBG Bilişim Teknolojileri ve Hizmetleri A.Ş. +C: TR +-----BEGIN CERTIFICATE----- +MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNV +BAMML0VCRyBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx +c8SxMTcwNQYDVQQKDC5FQkcgQmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXpt +ZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAeFw0wNjA4MTcwMDIxMDlaFw0xNjA4 +MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25payBTZXJ0aWZpa2Eg +SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2ltIFRl +a25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h +4fuXd7hxlugTlkaDT7byX3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAk +tiHq6yOU/im/+4mRDGSaBUorzAzu8T2bgmmkTPiab+ci2hC6X5L8GCcKqKpE+i4s +tPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfreYteIAbTdgtsApWjluTL +dlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZTqNGFav4 +c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8Um +TDGyY5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z ++kI2sSXFCjEmN1ZnuqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0O +Lna9XvNRiYuoP1Vzv9s6xiQFlpJIqkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMW +OeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vmExH8nYQKE3vwO9D8owrXieqW +fo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0Nokb+Clsi7n2 +l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgw +FoAU587GT/wWZ5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+ +8ygjdsZs93/mQJ7ANtyVDR2tFcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI +6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgmzJNSroIBk5DKd8pNSe/iWtkqvTDO +TLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64kXPBfrAowzIpAoHME +wfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqTbCmY +Iai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJn +xk1Gj7sURT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4Q +DgZxGhBM/nV+/x5XOULK1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9q +Kd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11t +hie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQY9iJSrSq3RZj9W6+YKH4 +7ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9AahH3eU7 +QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT +-----END CERTIFICATE----- + +================================================================ +CN: TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı +C: TR +L: ANKARA +O: (c) 2005 TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş. +-----BEGIN CERTIFICATE----- +MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOc +UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx +c8SxMQswCQYDVQQGDAJUUjEPMA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykg +MjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8 +dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMxMDI3MTdaFw0xNTAz +MjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2Vy +dGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYD +VQQHDAZBTktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kg +xLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEu +xZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7 +XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GXyGl8hMW0kWxsE2qkVa2k +heiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8iSi9BB35J +YbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5C +urKZ8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1 +JuTm5Rh8i27fbMx4W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51 +b0dewQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV +9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46sWrv7/hg0Uw2ZkUd82YCdAR7 +kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxEq8Sn5RTOPEFh +fEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy +B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdA +aLX/7KfS0zgYnNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKS +RGQDJereW26fyfJOrN3H +-----END CERTIFICATE----- + +================================================================ +CN: TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı +C: TR +L: Ankara +O: TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş. (c) Aralık 2007 +-----BEGIN CERTIFICATE----- +MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOc +UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx +c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xS +S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg +SGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4XDTA3MTIyNTE4Mzcx +OVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxla3Ry +b25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMC +VFIxDzANBgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDE +sGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7F +ni4gKGMpIEFyYWzEsWsgMjAwNzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9NYvDdE3ePYakqtdTyuTFY +KTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQvKUmi8wUG ++7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveG +HtyaKhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6P +IzdezKKqdfcYbwnTrqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M +733WB2+Y8a+xwXrXgTW4qhe04MsCAwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHk +Yb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G +CSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/sPx+EnWVUXKgW +AkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I +aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5 +mxRZNTZPz/OOXl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsa +XRik7r4EW5nVcV9VZWRi1aKbBFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZ +qxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAKpoRq0Tl9 +-----END CERTIFICATE----- + +================================================================ +CN: TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı +C: TR +L: Ankara +O: TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş. (c) Kasım 2005 +-----BEGIN CERTIFICATE----- +MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOc +UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx +c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xS +S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg +SGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcNMDUxMTA3MTAwNzU3 +WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVrdHJv +bmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJU +UjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSw +bGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWe +LiAoYykgS2FzxLFtIDIwMDUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqeLCDe2JAOCtFp0if7qnef +J1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKIx+XlZEdh +R3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJ +Qv2gQrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGX +JHpsmxcPbe9TmJEr5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1p +zpwACPI2/z7woQ8arBT9pmAPAgMBAAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58S +Fq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8GA1UdEwEB/wQFMAMBAf8wDQYJ +KoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/nttRbj2hWyfIvwq +ECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 +Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFz +gw2lGh1uEpJ+hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotH +uFEJjOp9zYhys2AzsfAKRO8P9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LS +y3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5UrbnBEI= +-----END CERTIFICATE----- + +================================================================ +L: ValiCert Validation Network +O: ValiCert, Inc. +OU: ValiCert Class 1 Policy Validation Authority +CN: http://www.valicert.com/ +emailAddress: info@valicert.com +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 +IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz +BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y +aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG +9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy +NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y +azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw +Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl +cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y +LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+ +TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y +TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0 +LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW +I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw +nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI +-----END CERTIFICATE----- + +================================================================ +L: ValiCert Validation Network +O: ValiCert, Inc. +OU: ValiCert Class 2 Policy Validation Authority +CN: http://www.valicert.com/ +emailAddress: info@valicert.com +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 +IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz +BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y +aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG +9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy +NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y +azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw +Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl +cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY +dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9 +WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS +v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v +UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu +IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC +W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd +-----END CERTIFICATE----- + +================================================================ +L: ValiCert Validation Network +O: ValiCert, Inc. +OU: ValiCert Class 3 Policy Validation Authority +CN: http://www.valicert.com/ +emailAddress: info@valicert.com +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 +IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz +BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y +aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG +9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy +NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y +azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw +Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl +cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD +cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs +2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY +JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE +Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ +n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A +PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu +-----END CERTIFICATE----- + +================================================================ +O: Cybertrust, Inc +CN: Cybertrust Global Root +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG +A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh +bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE +ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS +b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 +7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS +J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y +HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP +t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz +FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY +XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ +MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw +hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js +MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA +A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj +Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx +XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o +omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc +A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +================================================================ +O: Digital Signature Trust Co. +CN: DST Root CA X3 +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O +rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq +OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b +xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw +7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD +aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG +SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 +ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr +AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz +R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 +JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo +Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +================================================================ +O: Entrust.net +OU: www.entrust.net/CPS_2048 incorp. by ref. (limits liab.) +OU: (c) 1999 Entrust.net Limited +CN: Entrust.net Certification Authority (2048) +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML +RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp +bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 +IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3 +MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 +LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp +YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG +A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq +K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe +sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX +MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT +XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ +HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH +4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub +j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo +U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b +u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+ +bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er +fF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +================================================================ +O: RSA Security Inc +OU: RSA Security 2048 V3 +-----BEGIN CERTIFICATE----- +MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6 +MRkwFwYDVQQKExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJp +dHkgMjA0OCBWMzAeFw0wMTAyMjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAX +BgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAbBgNVBAsTFFJTQSBTZWN1cml0eSAy +MDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt49VcdKA3Xtp +eafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7Jylg +/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGl +wSMiuLgbWhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnh +AMFRD0xS+ARaqn1y07iHKrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2 +PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpu +AWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4EFgQUB8NR +MKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYc +HnmYv/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/ +Zb5gEydxiKRz44Rj0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+ +f00/FGj1EVDVwfSQpQgdMWD/YIwjVAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVO +rSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395nzIlQnQFgCi/vcEkllgVsRch +6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kApKnXwiJPZ9d3 +7CAFYd4= +-----END CERTIFICATE----- + +================================================================ +OU: GlobalSign Root CA - R2 +O: GlobalSign +CN: GlobalSign +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 +MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL +v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 +eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq +tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd +C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa +zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB +mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH +V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n +bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG +3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs +J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO +291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS +ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd +AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +================================================================ +OU: GlobalSign Root CA - R3 +O: GlobalSign +CN: GlobalSign +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 +MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 +RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT +gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm +KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd +QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ +XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o +LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU +RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp +jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK +6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX +mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs +Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH +WD9f +-----END CERTIFICATE----- + +================================================================ +emailAddress: contacto@procert.net.ve +L: Chacao +ST: Miranda +OU: Proveedor de Certificados PROCERT +O: Sistema Nacional de Certificacion Electronica +C: VE +CN: PSCProcert +-----BEGIN CERTIFICATE----- +MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1 +dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9s +YW5vMQswCQYDVQQGEwJWRTEQMA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlz +dHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0 +aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBlcmludGVuZGVuY2lh +IGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUwIwYJ +KoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEw +MFoXDTIwMTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHBy +b2NlcnQubmV0LnZlMQ8wDQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGEx +KjAoBgNVBAsTIVByb3ZlZWRvciBkZSBDZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQG +A1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9u +aWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIwDQYJKoZI +hvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo9 +7BVCwfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74 +BCXfgI8Qhd19L3uA3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38G +ieU89RLAu9MLmV+QfI4tL3czkkohRqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9 +JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmOEO8GqQKJ/+MMbpfg353bIdD0 +PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG20qCZyFSTXai2 +0b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH +0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/ +6mnbVSKVUyqUtd+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1m +v6JpIzi4mWCZDlZTOpx+FIywBm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7 +K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvpr2uKGcfLFFb14dq12fy/czja+eev +bqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/AgEBMDcGA1UdEgQw +MC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAzNi0w +MB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFD +gBStuyIdxuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0 +b3JpZGFkIGRlIENlcnRpZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xh +bm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQHEwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0 +cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5hY2lvbmFsIGRlIENlcnRp +ZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5kZW5jaWEg +ZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkq +hkiG9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQD +AgEGME0GA1UdEQRGMESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0w +MDAwMDKgGwYFYIZeAgKgEgwQUklGLUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEag +RKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9sY3IvQ0VSVElGSUNBRE8t +UkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNyYWl6LnN1c2Nl +cnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v +Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsG +AQUFBwIBFh5odHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcN +AQELBQADggIBACtZ6yKZu4SqT96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS +1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmNg7+mvTV+LFwxNG9s2/NkAZiqlCxB +3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4quxtxj7mkoP3Yldmv +Wb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1n8Gh +HVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHm +pHmJWhSnFFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXz +sOfIt+FTvZLm8wyWuevo5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bE +qCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq3TNWOByyrYDT13K9mmyZY+gAu0F2Bbdb +mRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5poLWccret9W6aAjtmcz9 +opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3YeMLEYC/H +YvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km +-----END CERTIFICATE----- + +================================================================ +emailAddress: pki@sk.ee +C: EE +O: AS Sertifitseerimiskeskus +CN: Juur-SK +-----BEGIN CERTIFICATE----- +MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcN +AQkBFglwa2lAc2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZp +dHNlZXJpbWlza2Vza3VzMRAwDgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMw +MVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMQsw +CQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEQ +MA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOB +SvZiF3tfTQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkz +ABpTpyHhOEvWgxutr2TC+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvH +LCu3GFH+4Hv2qEivbDtPL+/40UceJlfwUR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMP +PbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDaTpxt4brNj3pssAki14sL +2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQFMAMBAf8w +ggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwIC +MIHDHoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDk +AGwAagBhAHMAdABhAHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0 +AHMAZQBlAHIAaQBtAGkAcwBrAGUAcwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABz +AGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABrAGkAbgBuAGkAdABhAG0AaQBz +AGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nwcy8wKwYDVR0f +BCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE +FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcY +P2/v6X2+MA4GA1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOi +CfP+JmeaUOTDBS8rNXiRTHyoERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+g +kcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyLabVAyJRld/JXIWY7zoVAtjNjGr95 +HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678IIbsSt4beDI3poHS +na9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkhMp6q +qIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0Z +TbvGRNs2yyqcjg== +-----END CERTIFICATE----- From 595d679b8458e5e8027a5fc00a2b43ce2abbf1c5 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:31:59 +0000 Subject: [PATCH 17/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/guzzlehttp/guzzle | 1 - upload/system/storage/vendor/guzzlehttp/oauth-subscriber | 1 - 2 files changed, 2 deletions(-) delete mode 160000 upload/system/storage/vendor/guzzlehttp/guzzle delete mode 160000 upload/system/storage/vendor/guzzlehttp/oauth-subscriber diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle b/upload/system/storage/vendor/guzzlehttp/guzzle deleted file mode 160000 index 93bbdb30d59..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 93bbdb30d59be6cd9839495306c65f2907370eb9 diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber deleted file mode 160000 index 03f1ebe31d3..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 03f1ebe31d3112526106d0570c80eba6820e86e5 From 827de6020e0d160a05a467e96c33379a39558c08 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:32:51 +0000 Subject: [PATCH 18/39] Support for PHP 8.0 and 8.1 --- .../guzzlehttp/oauth-subscriber/.gitignore | 6 + .../guzzlehttp/oauth-subscriber/.travis.yml | 19 + .../guzzlehttp/oauth-subscriber/CHANGELOG.md | 6 + .../guzzlehttp/oauth-subscriber/LICENSE | 19 + .../guzzlehttp/oauth-subscriber/README.rst | 110 +++++ .../guzzlehttp/oauth-subscriber/composer.json | 29 ++ .../oauth-subscriber/phpunit.xml.dist | 21 + .../oauth-subscriber/src/Oauth1.php | 340 +++++++++++++++ .../oauth-subscriber/tests/Oauth1Test.php | 397 ++++++++++++++++++ 9 files changed, 947 insertions(+) create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.gitignore create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.travis.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/CHANGELOG.md create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/LICENSE create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/README.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php create mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.gitignore b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.gitignore new file mode 100644 index 00000000000..c33d3965fdd --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.gitignore @@ -0,0 +1,6 @@ +.idea +.DS_STORE +coverage +phpunit.xml +composer.lock +vendor/ diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.travis.yml b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.travis.yml new file mode 100644 index 00000000000..d01db9a3576 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/.travis.yml @@ -0,0 +1,19 @@ +language: php + +php: + - 5.5 + - 5.6 + - 7.0 + - hhvm + +matrix: + allow_failures: + - php: hhvm + - php: 7.0 + fast_finish: true + +install: + - travis_retry composer self-update + - travis_retry composer install --no-interaction --prefer-source + +script: vendor/bin/phpunit diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/CHANGELOG.md new file mode 100644 index 00000000000..282ef7ca1d1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/CHANGELOG.md @@ -0,0 +1,6 @@ +# CHANGELOG + +## 0.3.0 - 2015-08-15 + +* Updated to work with Guzzle 6 as a middleware. + diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/LICENSE b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/LICENSE new file mode 100644 index 00000000000..71d3b783cb5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/README.rst b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/README.rst new file mode 100644 index 00000000000..bd127fa9e54 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/README.rst @@ -0,0 +1,110 @@ +======================= +Guzzle OAuth Subscriber +======================= + +Signs HTTP requests using OAuth 1.0. Requests are signed using a consumer key, +consumer secret, OAuth token, and OAuth secret. + +This version only works with Guzzle 6.0 and up! + +Installing +========== + +This project can be installed using Composer. Add the following to your +composer.json: + +.. code-block:: javascript + + { + "require": { + "guzzlehttp/oauth-subscriber": "0.2.*" + } + } + + + +Using the Subscriber +==================== + +Here's an example showing how to send an authenticated request to the Twitter +REST API: + +.. code-block:: php + + use GuzzleHttp\Client; + use GuzzleHttp\HandlerStack; + use GuzzleHttp\Subscriber\Oauth\Oauth1; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1([ + 'consumer_key' => 'my_key', + 'consumer_secret' => 'my_secret', + 'token' => 'my_token', + 'token_secret' => 'my_token_secret' + ]); + $stack->push($middleware); + + $client = new Client([ + 'base_uri' => 'https://api.twitter.com/1.1/', + 'handler' => $stack + ]); + + // Set the "auth" request option to "oauth" to sign using oauth + $res = $client->get('statuses/home_timeline.json', ['auth' => 'oauth']); + +You can set the ``auth`` request option to ``oauth`` for all requests sent by +the client by extending the array you feed to ``new Client`` with auth => oauth. + +.. code-block:: php + + use GuzzleHttp\Client; + use GuzzleHttp\HandlerStack; + use GuzzleHttp\Subscriber\Oauth\Oauth1; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1([ + 'consumer_key' => 'my_key', + 'consumer_secret' => 'my_secret', + 'token' => 'my_token', + 'token_secret' => 'my_token_secret' + ]); + $stack->push($middleware); + + $client = new Client([ + 'base_uri' => 'https://api.twitter.com/1.1/', + 'handler' => $stack, + 'auth' => 'oauth' + ]); + + // Now you don't need to add the auth parameter + $res = $client->get('statuses/home_timeline.json'); + +.. note:: + + You can omit the token and token_secret options to use two-legged OAuth. + +Using the RSA-SH1 signature method +================================== + +.. code-block:: php + + use GuzzleHttp\Subscriber\Oauth\Oauth1; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1([ + 'consumer_key' => 'my_key', + 'consumer_secret' => 'my_secret', + 'private_key_file' => 'my_path_to_private_key_file', + 'private_key_passphrase' => 'my_passphrase', + 'signature_method' => Oauth1::SIGNATURE_METHOD_RSA, + ]); + $stack->push($middleware); + + $client = new Client([ + 'handler' => $stack + ]); + + $response = $client->get('http://httpbin.org', ['auth' => 'oauth']); diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json new file mode 100644 index 00000000000..0d0ddbfaba1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json @@ -0,0 +1,29 @@ +{ + "name": "guzzlehttp/oauth-subscriber", + "description": "Guzzle OAuth 1.0 subscriber", + "homepage": "http://guzzlephp.org/", + "keywords": ["oauth", "guzzle"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.5.0", + "guzzlehttp/guzzle": "~6.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "autoload": { + "psr-4": { "GuzzleHttp\\Subscriber\\Oauth\\": "src" } + }, + "extra": { + "branch-alias": { + "dev-master": "0.3-dev" + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/phpunit.xml.dist b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/phpunit.xml.dist new file mode 100644 index 00000000000..36f5598adf5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/phpunit.xml.dist @@ -0,0 +1,21 @@ + + + + + + + + + + + + tests + + + + + src + + + diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php new file mode 100644 index 00000000000..a81c10940d9 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php @@ -0,0 +1,340 @@ + + * @author Joseph Bielawski + * @author Francisco Facioni + * @link https://github.com/hwi/HWIOAuthBundle + * @link https://github.com/guzzle/guzzle/pull/563 Original Guzzle 3 pull req. + * + * @link http://oauth.net/core/1.0/#rfc.section.9.1.1 OAuth specification + */ +class Oauth1 +{ + /** + * Consumer request method constants. See http://oauth.net/core/1.0/#consumer_req_param + */ + const REQUEST_METHOD_HEADER = 'header'; + const REQUEST_METHOD_QUERY = 'query'; + + const SIGNATURE_METHOD_HMAC = 'HMAC-SHA1'; + const SIGNATURE_METHOD_RSA = 'RSA-SHA1'; + const SIGNATURE_METHOD_PLAINTEXT = 'PLAINTEXT'; + + /** @var array Configuration settings */ + private $config; + + /** + * Create a new OAuth 1.0 plugin. + * + * The configuration array accepts the following options: + * + * - request_method: Consumer request method. One of 'header' or 'query'. + * Defaults to 'header'. + * - callback: OAuth callback + * - consumer_key: Consumer key string. Defaults to "anonymous". + * - consumer_secret: Consumer secret. Defaults to "anonymous". + * - private_key_file: The location of your private key file (RSA-SHA1 signature method only) + * - private_key_passphrase: The passphrase for your private key file (RSA-SHA1 signature method only) + * - token: Client token + * - token_secret: Client secret token + * - verifier: OAuth verifier. + * - version: OAuth version. Defaults to '1.0'. + * - realm: OAuth realm. + * - signature_method: Signature method. One of 'HMAC-SHA1', 'RSA-SHA1', or + * 'PLAINTEXT'. Defaults to 'HMAC-SHA1'. + * + * @param array $config Configuration array. + */ + public function __construct($config) + { + $this->config = [ + 'version' => '1.0', + 'request_method' => self::REQUEST_METHOD_HEADER, + 'consumer_key' => 'anonymous', + 'consumer_secret' => 'anonymous', + 'signature_method' => self::SIGNATURE_METHOD_HMAC, + ]; + + foreach ($config as $key => $value) { + $this->config[$key] = $value; + } + } + + /** + * Called when the middleware is handled. + * + * @param callable $handler + * + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function ($request, array $options) use ($handler) { + + if (isset($options['auth']) && $options['auth'] == 'oauth') { + $request = $this->onBefore($request); + } + + return $handler($request, $options); + }; + } + + private function onBefore(RequestInterface $request) + { + $oauthparams = $this->getOauthParams( + $this->generateNonce($request), + $this->config + ); + + $oauthparams['oauth_signature'] = $this->getSignature($request, $oauthparams); + uksort($oauthparams, 'strcmp'); + + switch ($this->config['request_method']) { + case self::REQUEST_METHOD_HEADER: + list($header, $value) = $this->buildAuthorizationHeader($oauthparams); + $request = $request->withHeader($header, $value); + break; + case self::REQUEST_METHOD_QUERY: + $queryparams = \GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery()); + $preparedParams = \GuzzleHttp\Psr7\build_query($oauthparams + $queryparams); + $request = $request->withUri($request->getUri()->withQuery($preparedParams)); + break; + default: + throw new \InvalidArgumentException(sprintf( + 'Invalid consumer method "%s"', + $this->config['request_method'] + )); + } + + return $request; + } + + /** + * Calculate signature for request + * + * @param RequestInterface $request Request to generate a signature for + * @param array $params Oauth parameters. + * + * @return string + * + * @throws \RuntimeException + */ + public function getSignature(RequestInterface $request, array $params) + { + // Remove oauth_signature if present + // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") + unset($params['oauth_signature']); + + // Add POST fields if the request uses POST fields and no files + if ($request->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded') { + $body = \GuzzleHttp\Psr7\parse_query($request->getBody()->getContents()); + $params += $body; + } + + // Parse & add query string parameters as base string parameters + $query = $request->getUri()->getQuery(); + $params += \GuzzleHttp\Psr7\parse_query($query); + + $baseString = $this->createBaseString( + $request, + $this->prepareParameters($params) + ); + + // Implements double-dispatch to sign requests + switch ($this->config['signature_method']) { + case Oauth1::SIGNATURE_METHOD_HMAC: + $signature = $this->signUsingHmacSha1($baseString); + break; + case Oauth1::SIGNATURE_METHOD_RSA: + $signature = $this->signUsingRsaSha1($baseString); + break; + case Oauth1::SIGNATURE_METHOD_PLAINTEXT: + $signature = $this->signUsingPlaintext($baseString); + break; + default: + throw new \RuntimeException('Unknown signature method: ' . $this->config['signature_method']); + break; + } + + return base64_encode($signature); + } + + /** + * Returns a Nonce Based on the unique id and URL. + * + * This will allow for multiple requests in parallel with the same exact + * timestamp to use separate nonce's. + * + * @param RequestInterface $request Request to generate a nonce for + * + * @return string + */ + public function generateNonce(RequestInterface $request) + { + return sha1(uniqid('', true) . $request->getUri()->getHost() . $request->getUri()->getPath()); + } + + /** + * Creates the Signature Base String. + * + * The Signature Base String is a consistent reproducible concatenation of + * the request elements into a single string. The string is used as an + * input in hashing or signing algorithms. + * + * @param RequestInterface $request Request being signed + * @param array $params Associative array of OAuth parameters + * + * @return string Returns the base string + * @link http://oauth.net/core/1.0/#sig_base_example + */ + protected function createBaseString(RequestInterface $request, array $params) + { + // Remove query params from URL. Ref: Spec: 9.1.2. + $url = $request->getUri()->withQuery(''); + $query = http_build_query($params, '', '&', PHP_QUERY_RFC3986); + + return strtoupper($request->getMethod()) + . '&' . rawurlencode($url) + . '&' . rawurlencode($query); + } + + /** + * Convert booleans to strings, removed unset parameters, and sorts the array + * + * @param array $data Data array + * + * @return array + */ + private function prepareParameters($data) + { + // Parameters are sorted by name, using lexicographical byte value + // ordering. Ref: Spec: 9.1.1 (1). + uksort($data, 'strcmp'); + + foreach ($data as $key => $value) { + if ($value === null) { + unset($data[$key]); + } + } + + return $data; + } + + /** + * @param string $baseString + * + * @return string + */ + private function signUsingHmacSha1($baseString) + { + $key = rawurlencode($this->config['consumer_secret']) + . '&' . rawurlencode($this->config['token_secret']); + + return hash_hmac('sha1', $baseString, $key, true); + } + + /** + * @param string $baseString + * + * @return string + */ + private function signUsingRsaSha1($baseString) + { + if (!function_exists('openssl_pkey_get_private')) { + throw new \RuntimeException('RSA-SHA1 signature method ' + . 'requires the OpenSSL extension.'); + } + + $privateKey = openssl_pkey_get_private( + file_get_contents($this->config['private_key_file']), + $this->config['private_key_passphrase'] + ); + + $signature = ''; + openssl_sign($baseString, $signature, $privateKey); + openssl_free_key($privateKey); + + return $signature; + } + + /** + * @param string $baseString + * + * @return string + */ + private function signUsingPlaintext($baseString) + { + return $baseString; + } + + /** + * Builds the Authorization header for a request + * + * @param array $params Associative array of authorization parameters. + * + * @return array + */ + private function buildAuthorizationHeader(array $params) + { + foreach ($params as $key => $value) { + $params[$key] = $key . '="' . rawurlencode($value) . '"'; + } + + if (isset($this->config['realm'])) { + array_unshift( + $params, + 'realm="' . rawurlencode($this->config['realm']) . '"' + ); + } + + return ['Authorization', 'OAuth ' . implode(', ', $params)]; + } + + /** + * Get the oauth parameters as named by the oauth spec + * + * @param string $nonce Unique nonce + * @param array $config Configuration options of the plugin. + * + * @return array + */ + private function getOauthParams($nonce, array $config) + { + $params = [ + 'oauth_consumer_key' => $config['consumer_key'], + 'oauth_nonce' => $nonce, + 'oauth_signature_method' => $config['signature_method'], + 'oauth_timestamp' => time(), + ]; + + // Optional parameters should not be set if they have not been set in + // the config as the parameter may be considered invalid by the Oauth + // service. + $optionalParams = [ + 'callback' => 'oauth_callback', + 'token' => 'oauth_token', + 'verifier' => 'oauth_verifier', + 'version' => 'oauth_version' + ]; + + foreach ($optionalParams as $optionName => $oauthName) { + if (isset($config[$optionName])) { + $params[$oauthName] = $config[$optionName]; + } + } + + return $params; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php new file mode 100644 index 00000000000..0da6e3a6f99 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php @@ -0,0 +1,397 @@ + 'foo', + 'consumer_secret' => 'bar', + 'token' => 'count', + 'token_secret' => 'dracula' + ]; + + public function testAcceptsConfigurationData() + { + $p = new Oauth1($this->config); + + // Access the config object + $class = new \ReflectionClass($p); + $property = $class->getProperty('config'); + $property->setAccessible(true); + $config = $property->getValue($p); + + $this->assertEquals('foo', $config['consumer_key']); + $this->assertEquals('bar', $config['consumer_secret']); + $this->assertEquals('count', $config['token']); + $this->assertEquals('dracula', $config['token_secret']); + $this->assertEquals('1.0', $config['version']); + $this->assertEquals('HMAC-SHA1', $config['signature_method']); + $this->assertEquals('header', $config['request_method']); + } + + public function testCreatesStringToSignFromPostRequest() + { + $stack = HandlerStack::create(); + + $middleware = new Oauth1($this->config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->post('http://httpbin.org/post', [ + 'auth' => 'oauth', + 'form_params' => [ + 'foo' => [ + 'baz' => ['bar'], + 'bam' => [null, true, false] + ] + ] + ]); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertTrue($request->hasHeader('Authorization')); + } + + public function testSignsPlainText() + { + $config = $this->config; + $config['signature_method'] = Oauth1::SIGNATURE_METHOD_PLAINTEXT; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org', ['auth' => 'oauth']); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertTrue($request->hasHeader('Authorization')); + $this->assertContains('oauth_signature_method="PLAINTEXT"', $request->getHeader('Authorization')[0]); + $this->assertContains('oauth_signature="', $request->getHeader('Authorization')[0]); + } + + public function testSignsOauthRequestsInHeader() + { + $stack = HandlerStack::create(); + + $middleware = new Oauth1($this->config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->post('http://httpbin.org/post', [ + 'auth' => 'oauth', + ]); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertTrue($request->hasHeader('Authorization')); + $this->assertCount(0, \GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())); + $check = ['oauth_consumer_key', 'oauth_nonce', 'oauth_signature', + 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', + 'oauth_version']; + foreach ($check as $name) { + $this->assertContains($name . '=', $request->getHeader('Authorization')[0]); + } + } + + public function testSignsOauthQueryStringRequest() + { + $config = $this->config; + $config['request_method'] = Oauth1::REQUEST_METHOD_QUERY; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org', ['auth' => 'oauth']); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertFalse($request->hasHeader('Authorization')); + $check = ['oauth_consumer_key', 'oauth_nonce', 'oauth_signature', + 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', + 'oauth_version']; + foreach ($check as $name) { + $this->assertNotEmpty(\GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())[$name]); + } + + // Ensure that no extra keys were added + $keys = array_keys(\GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())); + sort($keys); + $this->assertSame($keys, $check); + } + + public function testOnlyTouchesWhenAuthConfigIsOauth() + { + $stack = HandlerStack::create(); + + $middleware = new Oauth1($this->config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org'); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertCount(0, \GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())); + $this->assertEmpty($request->getHeader('Authorization')); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testValidatesRequestMethod() + { + $stack = HandlerStack::create(); + + $config = $this->config; + $config['request_method'] = 'Foo'; + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org', ['auth' => 'oauth']); + } + + /** + * @expectedException \RuntimeException + */ + public function testExceptionOnSignatureError() + { + $stack = HandlerStack::create(); + + $config = $this->config; + $config['signature_method'] = 'Foo'; + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org', ['auth' => 'oauth']); + } + + public function testDoesNotAddEmptyValuesToAuthorization() + { + $config = $this->config; + unset($config['token']); + + $stack = HandlerStack::create(); + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org', ['auth' => 'oauth']); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertTrue($request->hasHeader('Authorization')); + $this->assertNotContains('oauth_token=', $request->getHeader('Authorization')[0]); + } + + public function testRandomParametersAreNotAutomaticallyAdded() + { + $config = $this->config; + $config['foo'] = 'bar'; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org', ['auth' => 'oauth']); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertTrue($request->hasHeader('Authorization')); + $this->assertNotContains('foo=bar', $request->getHeader('Authorization')[0]); + } + + public function testAllowsRealm() + { + $config = $this->config; + $config['realm'] = 'foo'; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + $client->get('http://httpbin.org', ['auth' => 'oauth']); + + /* @var Request $request */ + $request = $container[0]['request']; + + $this->assertTrue($request->hasHeader('Authorization')); + $this->assertContains('OAuth realm="foo",', $request->getHeader('Authorization')[0]); + } + + public function testTwitterIntegration() + { + if (empty(getenv('OAUTH_CONSUMER_SECRET'))) { + $this->markTestSkipped('No OAUTH_CONSUMER_SECRET provided in phpunit.xml'); + return; + } + + $config = $this->config; + $config['consumer_key'] = getenv('OAUTH_CONSUMER_KEY'); + $config['consumer_secret'] = getenv('OAUTH_CONSUMER_SECRET'); + $config['token'] = getenv('OAUTH_TOKEN'); + $config['token_secret'] = getenv('OAUTH_TOKEN_SECRET'); + + $stack = HandlerStack::create(); + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'handler' => $stack + ]); + + try { + $client->get('https://api.twitter.com/1.1/account/settings.json', ['auth' => 'oauth']); + } catch (ClientException $e) { + if ($e->getResponse()->getStatusCode() == 429) { + $this->markTestIncomplete('You are being throttled'); + } else { + throw $e; + } + } + } + + public function testTwitterStreamingIntegration() + { + if (empty(getenv('OAUTH_CONSUMER_SECRET'))) { + $this->markTestSkipped('No OAUTH_CONSUMER_SECRET provided in phpunit.xml'); + return; + } + + $config = $this->config; + $config['consumer_key'] = $_SERVER['OAUTH_CONSUMER_KEY']; + $config['consumer_secret'] = $_SERVER['OAUTH_CONSUMER_SECRET']; + $config['token'] = $_SERVER['OAUTH_TOKEN']; + $config['token_secret'] = $_SERVER['OAUTH_TOKEN_SECRET']; + + $stack = HandlerStack::create(); + + $middleware = new Oauth1($config); + $stack->push($middleware); + + $container = []; + $history = Middleware::history($container); + $stack->push($history); + + $client = new Client([ + 'base_uri' => 'https://stream.twitter.com/1.1/', + 'handler' => $stack, + 'auth' => 'oauth' + ]); + + try { + $response = $client->post('statuses/filter.json', [ + 'query' => ['track' => 'bieber'], + 'stream' => true + ]); + $body = $response->getBody()->getContents(); + $this->assertContains('bieber', strtolower($body)); + $this->assertNotEmpty(json_decode($body, true)); + } catch (ClientException $e) { + if ($e->getResponse()->getStatusCode() == 429) { + $this->markTestIncomplete('You are being throttled'); + } else { + throw $e; + } + } + } +} From 8d7225761e35a026e0b3c3442715edfd36f0ae61 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:33:54 +0000 Subject: [PATCH 19/39] Support for PHP 8.0 and 8.1 --- .../storage/vendor/guzzlehttp/guzzle/.php_cs | 23 + .../vendor/guzzlehttp/guzzle/CHANGELOG.md | 1338 +++++++++++++++++ .../vendor/guzzlehttp/guzzle/Dockerfile | 18 + .../storage/vendor/guzzlehttp/guzzle/LICENSE | 19 + .../vendor/guzzlehttp/guzzle/README.md | 90 ++ .../vendor/guzzlehttp/guzzle/UPGRADING.md | 1203 +++++++++++++++ .../vendor/guzzlehttp/guzzle/composer.json | 59 + .../vendor/guzzlehttp/guzzle/src/Client.php | 501 ++++++ .../guzzlehttp/guzzle/src/ClientInterface.php | 87 ++ .../guzzle/src/Cookie/CookieJar.php | 316 ++++ .../guzzle/src/Cookie/CookieJarInterface.php | 84 ++ .../guzzle/src/Cookie/FileCookieJar.php | 91 ++ .../guzzle/src/Cookie/SessionCookieJar.php | 72 + .../guzzle/src/Cookie/SetCookie.php | 403 +++++ .../src/Exception/BadResponseException.php | 27 + .../guzzle/src/Exception/ClientException.php | 9 + .../guzzle/src/Exception/ConnectException.php | 37 + .../guzzle/src/Exception/GuzzleException.php | 23 + .../Exception/InvalidArgumentException.php | 7 + .../guzzle/src/Exception/RequestException.php | 192 +++ .../guzzle/src/Exception/SeekException.php | 27 + .../guzzle/src/Exception/ServerException.php | 9 + .../Exception/TooManyRedirectsException.php | 6 + .../src/Exception/TransferException.php | 6 + .../guzzle/src/Handler/CurlFactory.php | 585 +++++++ .../src/Handler/CurlFactoryInterface.php | 27 + .../guzzle/src/Handler/CurlHandler.php | 45 + .../guzzle/src/Handler/CurlMultiHandler.php | 219 +++ .../guzzle/src/Handler/EasyHandle.php | 92 ++ .../guzzle/src/Handler/MockHandler.php | 195 +++ .../guzzlehttp/guzzle/src/Handler/Proxy.php | 55 + .../guzzle/src/Handler/StreamHandler.php | 545 +++++++ .../guzzlehttp/guzzle/src/HandlerStack.php | 277 ++++ .../guzzle/src/MessageFormatter.php | 185 +++ .../guzzlehttp/guzzle/src/Middleware.php | 254 ++++ .../vendor/guzzlehttp/guzzle/src/Pool.php | 134 ++ .../guzzle/src/PrepareBodyMiddleware.php | 111 ++ .../guzzle/src/RedirectMiddleware.php | 255 ++++ .../guzzlehttp/guzzle/src/RequestOptions.php | 263 ++++ .../guzzlehttp/guzzle/src/RetryMiddleware.php | 128 ++ .../guzzlehttp/guzzle/src/TransferStats.php | 126 ++ .../guzzlehttp/guzzle/src/UriTemplate.php | 237 +++ .../vendor/guzzlehttp/guzzle/src/Utils.php | 92 ++ .../guzzlehttp/guzzle/src/functions.php | 334 ++++ .../guzzle/src/functions_include.php | 6 + 45 files changed, 8812 insertions(+) create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/README.md create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/composer.json create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs b/upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs new file mode 100644 index 00000000000..2dd5036c1f2 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs @@ -0,0 +1,23 @@ +setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'declare_strict_types' => false, + 'concat_space' => ['spacing'=>'one'], + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'ordered_imports' => true, + // 'phpdoc_align' => ['align'=>'vertical'], + // 'native_function_invocation' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ) +; + +return $config; diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md new file mode 100644 index 00000000000..464cf1c5007 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -0,0 +1,1338 @@ +# Change Log + +## 6.5.5 - 2020-06-16 + +* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678) + +## 6.5.4 - 2020-05-25 + +* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) + +## 6.5.3 - 2020-04-18 + +* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) +* Remove use of internal functions [#2548](https://github.com/guzzle/guzzle/pull/2548) + +## 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) +* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) +* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: `RetryMiddleware` did not do exponential delay between retries due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) + Previously, `RetryMiddleware` would sleep for 1 millisecond, then 2 milliseconds, then 4 milliseconds. + **After this change, `RetryMiddleware` will sleep for 1 second, then 2 seconds, then 4 seconds.** + `Middleware::retry()` accepts a second callback parameter to override the default timeouts if needed. +* 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) +* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) +* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) +* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) +* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) +* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) +* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) +* 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 + + +## 6.3.2 - 2018-03-26 + +* Fix: Release process + + +## 6.3.1 - 2018-03-26 + +* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) +* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) +* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) +* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) +* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) +* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) +* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.3.0 - 2017-06-22 + +* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) +* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) +* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) +* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) +* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) +* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) +* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) +* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) +* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) +* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) +* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) +* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) +* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) +* 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 +* Only add scheme when host is present +* 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: + https://httpoxy.org/ +* Fixing timeout bug with StreamHandler: + https://github.com/guzzle/guzzle/pull/1488 +* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when + 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`. + https://github.com/guzzle/guzzle/pull/1389 +* Bug fix: Fix sleep calculation when waiting for delayed requests. + https://github.com/guzzle/guzzle/pull/1324 +* Feature: More flexible history containers. + https://github.com/guzzle/guzzle/pull/1373 +* Bug fix: defer sink stream opening in StreamHandler. + https://github.com/guzzle/guzzle/pull/1377 +* Bug fix: do not attempt to escape cookie values. + https://github.com/guzzle/guzzle/pull/1406 +* Feature: report original content encoding and length on decoded responses. + https://github.com/guzzle/guzzle/pull/1409 +* Bug fix: rewind seekable request bodies before dispatching to cURL. + https://github.com/guzzle/guzzle/pull/1422 +* 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 + https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 +* Feature: HandlerStack is now more generic. + https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e +* Bug fix: setting verify to false in the StreamHandler now disables peer + verification. https://github.com/guzzle/guzzle/issues/1256 +* Feature: Middleware now uses an exception factory, including more error + context. https://github.com/guzzle/guzzle/pull/1282 +* Feature: better support for disabled functions. + https://github.com/guzzle/guzzle/pull/1287 +* 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 + statistics for requests. https://github.com/guzzle/guzzle/pull/1202 +* Feature: Added the ability to persist session cookies in CookieJars. + https://github.com/guzzle/guzzle/pull/1195 +* Feature: Some compatibility updates for Google APP Engine + https://github.com/guzzle/guzzle/pull/1216 +* Feature: Added support for NO_PROXY to prevent the use of a proxy based on + a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 +* Feature: Cookies can now contain square brackets. + https://github.com/guzzle/guzzle/pull/1237 +* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. + https://github.com/guzzle/guzzle/pull/1232 +* Bug fix: Cusotm cURL options now correctly override curl options of the + same name. https://github.com/guzzle/guzzle/pull/1221 +* Bug fix: Content-Type header is now added when using an explicitly provided + multipart body. https://github.com/guzzle/guzzle/pull/1218 +* Bug fix: Now ignoring Set-Cookie headers that have no name. +* Bug fix: Reason phrase is no longer cast to an int in some cases in the + cURL handler. https://github.com/guzzle/guzzle/pull/1187 +* Bug fix: Remove the Authorization header when redirecting if the Host + header changes. https://github.com/guzzle/guzzle/pull/1207 +* Bug fix: Cookie path matching fixes + https://github.com/guzzle/guzzle/issues/1129 +* Bug fix: Fixing the cURL `body_as_string` setting + https://github.com/guzzle/guzzle/pull/1201 +* Bug fix: quotes are no longer stripped when parsing cookies. + https://github.com/guzzle/guzzle/issues/1172 +* Bug fix: `form_params` and `query` now always uses the `&` separator. + https://github.com/guzzle/guzzle/pull/1163 +* 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 + were not being removed by `curl_reset`. +* Cookies are now extracted properly before redirects. +* Cookies now allow more character ranges. +* Decoded Content-Encoding responses are now modified to correctly reflect + their state if the encoding was automatically removed by a handler. This + means that the `Content-Encoding` header may be removed an the + `Content-Length` modified to reflect the message size after removing the + encoding. +* Added a more explicit error message when trying to use `form_params` and + `multipart` in the same request. +* Several fixes for HHVM support. +* 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 `&` + separator was missing. +* Added a better error message for when `body` is provided as an array. Please + use `form_params` or `multipart` instead. +* Various doc fixes. + +## 6.0.0 - 2015-05-26 + +* See the UPGRADING.md document for more information. +* Added `multipart` and `form_params` request options. +* Added `synchronous` request option. +* Added the `on_headers` request option. +* Fixed `expect` handling. +* No longer adding default middlewares in the client ctor. These need to be + present on the provided handler in order to work. +* Requests are no longer initiated when sending async requests with the + CurlMultiHandler. This prevents unexpected recursion from requests completing + while ticking the cURL loop. +* Removed the semantics of setting `default` to `true`. This is no longer + required now that the cURL loop is not ticked for async requests. +* Added request and response logging middleware. +* No longer allowing self signed certificates when using the StreamHandler. +* Ensuring that `sink` is valid if saving to a file. +* Request exceptions now include a "handler context" which provides handler + specific contextual information. +* Added `GuzzleHttp\RequestOptions` to allow request options to be applied + using constants. +* `$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` +* Marked `AbstractRequestEvent::getTransaction()` as public. +* Fixed a bug in which multiple headers using different casing would overwrite + previous headers in the associative array. +* Added `Utils::getDefaultHandler()` +* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. +* URL scheme is now always lowercased. + +## 6.0.0-beta.1 + +* Requires PHP >= 5.5 +* Updated to use PSR-7 + * Requires immutable messages, which basically means an event based system + owned by a request instance is no longer possible. + * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). + * Removed the dependency on `guzzlehttp/streams`. These stream abstractions + are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` + namespace. +* Added middleware and handler system + * Replaced the Guzzle event and subscriber system with a middleware system. + * No longer depends on RingPHP, but rather places the HTTP handlers directly + in Guzzle, operating on PSR-7 messages. + * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which + means the `guzzlehttp/retry-subscriber` is now obsolete. + * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. +* Asynchronous responses + * No longer supports the `future` request option to send an async request. + Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, + `getAsync`, etc.). + * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid + recursion required by chaining and forwarding react promises. See + https://github.com/guzzle/promises + * Added `requestAsync` and `sendAsync` to send request asynchronously. + * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests + asynchronously. +* Request options + * POST and form updates + * Added the `form_fields` and `form_files` request options. + * Removed the `GuzzleHttp\Post` namespace. + * The `body` request option no longer accepts an array for POST requests. + * The `exceptions` request option has been deprecated in favor of the + `http_errors` request options. + * The `save_to` request option has been deprecated in favor of `sink` request + option. +* Clients no longer accept an array of URI template string and variables for + URI variables. You will need to expand URI templates before passing them + into a client constructor or request method. +* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are + now magic methods that will send synchronous requests. +* Replaced `Utils.php` with plain functions in `functions.php`. +* Removed `GuzzleHttp\Collection`. +* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as + an array. +* Removed `GuzzleHttp\Query`. Query string handling is now handled using an + associative array passed into the `query` request option. The query string + is serialized using PHP's `http_build_query`. If you need more control, you + can pass the query string in as a string. +* `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 + on the body more generic and not specific to `PostBodyInterface`. +* Reduced the number of stack frames needed to send requests. +* Nested futures are now resolved in the client rather than the RequestFsm +* Finishing state transitions is now handled in the RequestFsm rather than the + 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. +* The size of a Pool can now be dynamically adjusted using a callback. + See https://github.com/guzzle/guzzle/pull/943. +* Setting a request option to `null` when creating a request with a client will + ensure that the option is not set. This allows you to overwrite default + request options on a per-request basis. + See https://github.com/guzzle/guzzle/pull/937. +* Added the ability to limit which protocols are allowed for redirects by + specifying a `protocols` array in the `allow_redirects` request option. +* Nested futures due to retries are now resolved when waiting for synchronous + responses. See https://github.com/guzzle/guzzle/pull/947. +* `"0"` is now an allowed URI path. See + https://github.com/guzzle/guzzle/pull/935. +* `Query` no longer typehints on the `$query` argument in the constructor, + allowing for strings and arrays. +* 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 +by default where the value represents an un-encoded value to send over the +wire. A Query object then encodes the value before sending over the wire. This +means that even value query string values (e.g., ":") are url encoded. This +makes the Query class match PHP's http_build_query function. However, if you +want to send requests over the wire using valid query string characters that do +not need to be encoded, then you can provide a string to Url::setQuery() and +pass true as the second argument to specify that the query string is a raw +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 + https://github.com/guzzle/guzzle/pull/871 +* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. +* Status codes are now returned as integers. See + https://github.com/guzzle/guzzle/issues/881 +* No longer overwriting an existing `application/x-www-form-urlencoded` header + when sending POST requests, allowing for customized headers. See + https://github.com/guzzle/guzzle/issues/877 +* Improved path URL serialization. + + * No longer double percent-encoding characters in the path or query string if + they are already encoded. + * Now properly encoding the supplied path to a URL object, instead of only + encoding ' ' and '?'. + * Note: This has been changed in 5.0.3 to now encode query string values by + default unless the `rawString` argument is provided when setting the query + string on a URL: Now allowing many more characters to be present in the + query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A + +## 5.0.1 - 2014-10-16 + +Bugfix release. + +* Fixed an issue where connection errors still returned response object in + error and end events event though the response is unusable. This has been + corrected so that a response is not returned in the `getResponse` method of + these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 +* 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. + +### New Features + +* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. +* Added a public API for creating a default HTTP adapter. +* Updated the redirect plugin to be non-blocking so that redirects are sent + concurrently. Other plugins like this can now be updated to be non-blocking. +* Added a "progress" event so that you can get upload and download progress + events. +* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers + requests concurrently using a capped pool size as efficiently as possible. +* Added `hasListeners()` to EmitterInterface. +* Removed `GuzzleHttp\ClientInterface::sendAll` and marked + `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the + recommended way). + +### Breaking changes + +The breaking changes in this release are relatively minor. The biggest thing to +look out for is that request and response objects no longer implement fluent +interfaces. + +* Removed the fluent interfaces (i.e., `return $this`) from requests, + responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, + `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and + `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of + why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/. + This also makes the Guzzle message interfaces compatible with the current + PSR-7 message proposal. +* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except + for the HTTP request functions from function.php, these functions are now + implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` + moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to + `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to + `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be + `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php + caused problems for many users: they aren't PSR-4 compliant, require an + explicit include, and needed an if-guard to ensure that the functions are not + declared multiple times. +* Rewrote adapter layer. + * Removing all classes from `GuzzleHttp\Adapter`, these are now + implemented as callables that are stored in `GuzzleHttp\Ring\Client`. + * Removed the concept of "parallel adapters". Sending requests serially or + concurrently is now handled using a single adapter. + * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The + Transaction object now exposes the request, response, and client as public + properties. The getters and setters have been removed. +* Removed the "headers" event. This event was only useful for changing the + body a response once the headers of the response were known. You can implement + a similar behavior in a number of ways. One example might be to use a + FnStream that has access to the transaction being sent. For example, when the + first byte is written, you could check if the response headers match your + expectations, and if so, change the actual stream body that is being + written to. +* Removed the `asArray` parameter from + `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header + value as an array, then use the newly added `getHeaderAsArray()` method of + `MessageInterface`. This change makes the Guzzle interfaces compatible with + the PSR-7 interfaces. +* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add + custom request options using double-dispatch (this was an implementation + detail). Instead, you should now provide an associative array to the + constructor which is a mapping of the request option name mapping to a + function that applies the option value to a request. +* Removed the concept of "throwImmediately" from exceptions and error events. + This control mechanism was used to stop a transfer of concurrent requests + from completing. This can now be handled by throwing the exception or by + cancelling a pool of requests or each outstanding future request individually. +* Updated to "GuzzleHttp\Streams" 3.0. + * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a + `maxLen` parameter. This update makes the Guzzle streams project + compatible with the current PSR-7 proposal. + * `GuzzleHttp\Stream\Stream::__construct`, + `GuzzleHttp\Stream\Stream::factory`, and + `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second + 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. +* No longer using `request_fulluri` in stream adapter proxies. +* Relative redirects are now based on the last response, not the first response. + +## 4.2.1 - 2014-08-19 + +* Ensuring that the StreamAdapter does not always add a Content-Type header +* Adding automated github releases with a phar and zip + +## 4.2.0 - 2014-08-17 + +* Now merging in default options using a case-insensitive comparison. + Closes https://github.com/guzzle/guzzle/issues/767 +* Added the ability to automatically decode `Content-Encoding` response bodies + using the `decode_content` request option. This is set to `true` by default + to decode the response body if it comes over the wire with a + `Content-Encoding`. Set this value to `false` to disable decoding the + response content, and pass a string to provide a request `Accept-Encoding` + header and turn on automatic response decoding. This feature now allows you + to pass an `Accept-Encoding` header in the headers of a request but still + disable automatic response decoding. + Closes https://github.com/guzzle/guzzle/issues/764 +* Added the ability to throw an exception immediately when transferring + requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 +* Updating guzzlehttp/streams dependency to ~2.1 +* No longer utilizing the now deprecated namespaced methods from the stream + package. + +## 4.1.8 - 2014-08-14 + +* Fixed an issue in the CurlFactory that caused setting the `stream=false` + request option to throw an exception. + See: https://github.com/guzzle/guzzle/issues/769 +* TransactionIterator now calls rewind on the inner iterator. + See: https://github.com/guzzle/guzzle/pull/765 +* You can now set the `Content-Type` header to `multipart/form-data` + when creating POST requests to force multipart bodies. + See https://github.com/guzzle/guzzle/issues/768 + +## 4.1.7 - 2014-08-07 + +* Fixed an error in the HistoryPlugin that caused the same request and response + to be logged multiple times when an HTTP protocol error occurs. +* Ensuring that cURL does not add a default Content-Type when no Content-Type + has been supplied by the user. This prevents the adapter layer from modifying + the request that is sent over the wire after any listeners may have already + put the request in a desired state (e.g., signed the request). +* Throwing an exception when you attempt to send requests that have the + "stream" set to true in parallel using the MultiAdapter. +* Only calling curl_multi_select when there are active cURL handles. This was + previously changed and caused performance problems on some systems due to PHP + always selecting until the maximum select timeout. +* Fixed a bug where multipart/form-data POST fields were not correctly + aggregated (e.g., values with "&"). + +## 4.1.6 - 2014-08-03 + +* Added helper methods to make it easier to represent messages as strings, + including getting the start line and getting headers as a string. + +## 4.1.5 - 2014-08-02 + +* Automatically retrying cURL "Connection died, retrying a fresh connect" + errors when possible. +* cURL implementation cleanup +* Allowing multiple event subscriber listeners to be registered per event by + passing an array of arrays of listener configuration. + +## 4.1.4 - 2014-07-22 + +* Fixed a bug that caused multi-part POST requests with more than one field to + serialize incorrectly. +* Paths can now be set to "0" +* `ResponseInterface::xml` now accepts a `libxml_options` option and added a + missing default argument that was required when parsing XML response bodies. +* A `save_to` stream is now created lazily, which means that files are not + created on disk unless a request succeeds. + +## 4.1.3 - 2014-07-15 + +* Various fixes to multipart/form-data POST uploads +* Wrapping function.php in an if-statement to ensure Guzzle can be used + globally and in a Composer install +* Fixed an issue with generating and merging in events to an event array +* POST headers are only applied before sending a request to allow you to change + the query aggregator used before uploading +* Added much more robust query string parsing +* Fixed various parsing and normalization issues with URLs +* Fixing an issue where multi-valued headers were not being utilized correctly + in the StreamAdapter + +## 4.1.2 - 2014-06-18 + +* Added support for sending payloads with GET requests + +## 4.1.1 - 2014-06-08 + +* Fixed an issue related to using custom message factory options in subclasses +* Fixed an issue with nested form fields in a multi-part POST +* Fixed an issue with using the `json` request option for POST requests +* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` + +## 4.1.0 - 2014-05-27 + +* Added a `json` request option to easily serialize JSON payloads. +* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. +* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. +* Added the ability to provide an emitter to a client in the client constructor. +* Added the ability to persist a cookie session using $_SESSION. +* Added a trait that can be used to add event listeners to an iterator. +* Removed request method constants from RequestInterface. +* Fixed warning when invalid request start-lines are received. +* Updated MessageFactory to work with custom request option methods. +* Updated cacert bundle to latest build. + +4.0.2 (2014-04-16) +------------------ + +* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) +* Added the ability to set scalars as POST fields (#628) + +## 4.0.1 - 2014-04-04 + +* The HTTP status code of a response is now set as the exception code of + RequestException objects. +* 303 redirects will now correctly switch from POST to GET requests. +* The default parallel adapter of a client now correctly uses the MultiAdapter. +* HasDataTrait now initializes the internal data array as an empty array so + that the toArray() method always returns an array. + +## 4.0.0 - 2014-03-29 + +* For more information on the 4.0 transition, see: + http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/ +* For information on changes and upgrading, see: + https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 +* Added `GuzzleHttp\batch()` as a convenience function for sending requests in + parallel without needing to write asynchronous code. +* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. + You can now pass a callable or an array of associative arrays where each + associative array contains the "fn", "priority", and "once" keys. + +## 4.0.0.rc-2 - 2014-03-25 + +* Removed `getConfig()` and `setConfig()` from clients to avoid confusion + around whether things like base_url, message_factory, etc. should be able to + be retrieved or modified. +* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface +* functions.php functions were renamed using snake_case to match PHP idioms +* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and + `GUZZLE_CURL_SELECT_TIMEOUT` environment variables +* Added the ability to specify custom `sendAll()` event priorities +* Added the ability to specify custom stream context options to the stream + adapter. +* Added a functions.php function for `get_path()` and `set_path()` +* CurlAdapter and MultiAdapter now use a callable to generate curl resources +* MockAdapter now properly reads a body and emits a `headers` event +* Updated Url class to check if a scheme and host are set before adding ":" + and "//". This allows empty Url (e.g., "") to be serialized as "". +* Parsing invalid XML no longer emits warnings +* Curl classes now properly throw AdapterExceptions +* Various performance optimizations +* Streams are created with the faster `Stream\create()` function +* Marked deprecation_proxy() as internal +* Test server is now a collection of static methods on a class + +## 4.0.0-rc.1 - 2014-03-15 + +* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 + +## 3.8.1 - 2014-01-28 + +* Bug: Always using GET requests when redirecting from a 303 response +* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in + `Guzzle\Http\ClientInterface::setSslVerification()` +* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL +* Bug: The body of a request can now be set to `"0"` +* Sending PHP stream requests no longer forces `HTTP/1.0` +* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of + each sub-exception +* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than + clobbering everything). +* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) +* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. + For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. +* Now properly escaping the regular expression delimiter when matching Cookie domains. +* Network access is now disabled when loading XML documents + +## 3.8.0 - 2013-12-05 + +* Added the ability to define a POST name for a file +* JSON response parsing now properly walks additionalProperties +* cURL error code 18 is now retried automatically in the BackoffPlugin +* Fixed a cURL error when URLs contain fragments +* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were + CurlExceptions +* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) +* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` +* Fixed a bug that was encountered when parsing empty header parameters +* UriTemplate now has a `setRegex()` method to match the docs +* The `debug` request parameter now checks if it is truthy rather than if it exists +* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin +* Added the ability to combine URLs using strict RFC 3986 compliance +* Command objects can now return the validation errors encountered by the command +* Various fixes to cache revalidation (#437 and 29797e5) +* Various fixes to the AsyncPlugin +* Cleaned up build scripts + +## 3.7.4 - 2013-10-02 + +* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) +* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp + (see https://github.com/aws/aws-sdk-php/issues/147) +* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots +* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) +* Updated the bundled cacert.pem (#419) +* OauthPlugin now supports adding authentication to headers or query string (#425) + +## 3.7.3 - 2013-09-08 + +* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and + `CommandTransferException`. +* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description +* Schemas are only injected into response models when explicitly configured. +* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of + an EntityBody. +* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. +* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. +* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() +* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin +* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests +* Bug fix: Properly parsing headers that contain commas contained in quotes +* Bug fix: mimetype guessing based on a filename is now case-insensitive + +## 3.7.2 - 2013-08-02 + +* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander + See https://github.com/guzzle/guzzle/issues/371 +* Bug fix: Cookie domains are now matched correctly according to RFC 6265 + See https://github.com/guzzle/guzzle/issues/377 +* Bug fix: GET parameters are now used when calculating an OAuth signature +* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted +* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched +* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. + See https://github.com/guzzle/guzzle/issues/379 +* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See + https://github.com/guzzle/guzzle/pull/380 +* cURL multi cleanup and optimizations + +## 3.7.1 - 2013-07-05 + +* Bug fix: Setting default options on a client now works +* Bug fix: Setting options on HEAD requests now works. See #352 +* Bug fix: Moving stream factory before send event to before building the stream. See #353 +* Bug fix: Cookies no longer match on IP addresses per RFC 6265 +* Bug fix: Correctly parsing header parameters that are in `<>` and quotes +* Added `cert` and `ssl_key` as request options +* `Host` header can now diverge from the host part of a URL if the header is set manually +* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter +* OAuth parameters are only added via the plugin if they aren't already set +* Exceptions are now thrown when a URL cannot be parsed +* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails +* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin + +## 3.7.0 - 2013-06-10 + +* See UPGRADING.md for more information on how to upgrade. +* Requests now support the ability to specify an array of $options when creating a request to more easily modify a + request. You can pass a 'request.options' configuration setting to a client to apply default request options to + every request created by a client (e.g. default query string variables, headers, curl options, etc.). +* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. + See `Guzzle\Http\StaticClient::mount`. +* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests + created by a command (e.g. custom headers, query string variables, timeout settings, etc.). +* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the + headers of a response +* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key + (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) +* ServiceBuilders now support storing and retrieving arbitrary data +* CachePlugin can now purge all resources for a given URI +* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource +* CachePlugin now uses the Vary header to determine if a resource is a cache hit +* `Guzzle\Http\Message\Response` now implements `\Serializable` +* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters +* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable +* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` +* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size +* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message +* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older + Symfony users can still use the old version of Monolog. +* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. + Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. +* Several performance improvements to `Guzzle\Common\Collection` +* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +* Added `Guzzle\Stream\StreamInterface::isRepeatable` +* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. +* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. +* Removed `Guzzle\Http\ClientInterface::expandTemplate()` +* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` +* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` +* Removed `Guzzle\Http\Message\RequestInterface::canCache` +* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` +* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` +* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. +* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting + `Guzzle\Common\Version::$emitWarnings` to true. +* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use + `$request->getResponseBody()->isRepeatable()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. + These will work through Guzzle 4.0 +* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. +* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. +* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. +* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +* Marked `Guzzle\Common\Collection::inject()` as deprecated. +* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` +* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +* Always setting X-cache headers on cached responses +* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +* Added `CacheStorageInterface::purge($url)` +* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +## 3.6.0 - 2013-05-29 + +* ServiceDescription now implements ToArrayInterface +* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters +* Guzzle can now correctly parse incomplete URLs +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess +* Added the ability to cast Model objects to a string to view debug information. + +## 3.5.0 - 2013-05-13 + +* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times +* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove + itself from the EventDispatcher) +* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values +* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too +* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a + non-existent key +* Bug: All __call() method arguments are now required (helps with mocking frameworks) +* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference + to help with refcount based garbage collection of resources created by sending a request +* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the + HistoryPlugin for a history. +* Added a `responseBody` alias for the `response_body` location +* Refactored internals to no longer rely on Response::getRequest() +* HistoryPlugin can now be cast to a string +* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests + and responses that are sent over the wire +* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects + +## 3.4.3 - 2013-04-30 + +* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response +* Added a check to re-extract the temp cacert bundle from the phar before sending each request + +## 3.4.2 - 2013-04-29 + +* Bug fix: Stream objects now work correctly with "a" and "a+" modes +* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present +* Bug fix: AsyncPlugin no longer forces HEAD requests +* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter +* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails +* Setting a response on a request will write to the custom request body from the response body if one is specified +* LogPlugin now writes to php://output when STDERR is undefined +* Added the ability to set multiple POST files for the same key in a single call +* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default +* Added the ability to queue CurlExceptions to the MockPlugin +* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) +* Configuration loading now allows remote files + +## 3.4.1 - 2013-04-16 + +* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti + handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. +* Exceptions are now properly grouped when sending requests in parallel +* Redirects are now properly aggregated when a multi transaction fails +* Redirects now set the response on the original object even in the event of a failure +* Bug fix: Model names are now properly set even when using $refs +* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax +* Added support for oauth_callback in OAuth signatures +* Added support for oauth_verifier in OAuth signatures +* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection + +## 3.4.0 - 2013-04-11 + +* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289 +* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 +* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 +* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. +* Bug fix: Added `number` type to service descriptions. +* Bug fix: empty parameters are removed from an OAuth signature +* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header +* Bug fix: Fixed "array to string" error when validating a union of types in a service description +* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream +* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. +* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. +* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. +* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if + the Content-Type can be determined based on the entity body or the path of the request. +* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. +* Added support for a PSR-3 LogAdapter. +* Added a `command.after_prepare` event +* Added `oauth_callback` parameter to the OauthPlugin +* Added the ability to create a custom stream class when using a stream factory +* Added a CachingEntityBody decorator +* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. +* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. +* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies +* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This + means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use + POST fields or files (the latter is only used when emulating a form POST in the browser). +* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest + +## 3.3.1 - 2013-03-10 + +* Added the ability to create PHP streaming responses from HTTP requests +* Bug fix: Running any filters when parsing response headers with service descriptions +* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing +* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across + response location visitors. +* Bug fix: Removed the possibility of creating configuration files with circular dependencies +* RequestFactory::create() now uses the key of a POST file when setting the POST file name +* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set + +## 3.3.0 - 2013-03-03 + +* A large number of performance optimizations have been made +* Bug fix: Added 'wb' as a valid write mode for streams +* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned +* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` +* BC: Removed `Guzzle\Http\Utils` class +* BC: Setting a service description on a client will no longer modify the client's command factories. +* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using + the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' +* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to + lowercase +* Operation parameter objects are now lazy loaded internally +* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses +* Added support for instantiating responseType=class responseClass classes. Classes must implement + `Guzzle\Service\Command\ResponseClassInterface` +* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These + additional properties also support locations and can be used to parse JSON responses where the outermost part of the + JSON is an array +* Added support for nested renaming of JSON models (rename sentAs to name) +* CachePlugin + * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error + * Debug headers can now added to cached response in the CachePlugin + +## 3.2.0 - 2013-02-14 + +* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. +* URLs with no path no longer contain a "/" by default +* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. +* BadResponseException no longer includes the full request and response message +* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface +* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface +* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription +* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list +* xmlEncoding can now be customized for the XML declaration of a XML service description operation +* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value + aggregation and no longer uses callbacks +* The URL encoding implementation of Guzzle\Http\QueryString can now be customized +* Bug fix: Filters were not always invoked for array service description parameters +* Bug fix: Redirects now use a target response body rather than a temporary response body +* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded +* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives + +## 3.1.2 - 2013-01-27 + +* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the + response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. +* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent +* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) +* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() +* Setting default headers on a client after setting the user-agent will not erase the user-agent setting + +## 3.1.1 - 2013-01-20 + +* Adding wildcard support to Guzzle\Common\Collection::getPath() +* Adding alias support to ServiceBuilder configs +* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface + +## 3.1.0 - 2013-01-12 + +* BC: CurlException now extends from RequestException rather than BadResponseException +* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() +* Added getData to ServiceDescriptionInterface +* Added context array to RequestInterface::setState() +* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http +* Bug: Adding required content-type when JSON request visitor adds JSON to a command +* Bug: Fixing the serialization of a service description with custom data +* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing + an array of successful and failed responses +* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection +* Added Guzzle\Http\IoEmittingEntityBody +* Moved command filtration from validators to location visitors +* Added `extends` attributes to service description parameters +* Added getModels to ServiceDescriptionInterface + +## 3.0.7 - 2012-12-19 + +* Fixing phar detection when forcing a cacert to system if null or true +* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` +* Cleaning up `Guzzle\Common\Collection::inject` method +* Adding a response_body location to service descriptions + +## 3.0.6 - 2012-12-09 + +* CurlMulti performance improvements +* Adding setErrorResponses() to Operation +* composer.json tweaks + +## 3.0.5 - 2012-11-18 + +* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin +* Bug: Response body can now be a string containing "0" +* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert +* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs +* Added support for XML attributes in service description responses +* DefaultRequestSerializer now supports array URI parameter values for URI template expansion +* Added better mimetype guessing to requests and post files + +## 3.0.4 - 2012-11-11 + +* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value +* Bug: Cookies can now be added that have a name, domain, or value set to "0" +* Bug: Using the system cacert bundle when using the Phar +* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures +* Enhanced cookie jar de-duplication +* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added +* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies +* Added the ability to create any sort of hash for a stream rather than just an MD5 hash + +## 3.0.3 - 2012-11-04 + +* Implementing redirects in PHP rather than cURL +* Added PECL URI template extension and using as default parser if available +* Bug: Fixed Content-Length parsing of Response factory +* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. +* Adding ToArrayInterface throughout library +* Fixing OauthPlugin to create unique nonce values per request + +## 3.0.2 - 2012-10-25 + +* Magic methods are enabled by default on clients +* Magic methods return the result of a command +* Service clients no longer require a base_url option in the factory +* Bug: Fixed an issue with URI templates where null template variables were being expanded + +## 3.0.1 - 2012-10-22 + +* Models can now be used like regular collection objects by calling filter, map, etc. +* Models no longer require a Parameter structure or initial data in the constructor +* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` + +## 3.0.0 - 2012-10-15 + +* Rewrote service description format to be based on Swagger + * Now based on JSON schema + * Added nested input structures and nested response models + * Support for JSON and XML input and output models + * Renamed `commands` to `operations` + * Removed dot class notation + * Removed custom types +* Broke the project into smaller top-level namespaces to be more component friendly +* Removed support for XML configs and descriptions. Use arrays or JSON files. +* Removed the Validation component and Inspector +* Moved all cookie code to Guzzle\Plugin\Cookie +* Magic methods on a Guzzle\Service\Client now return the command un-executed. +* Calling getResult() or getResponse() on a command will lazily execute the command if needed. +* Now shipping with cURL's CA certs and using it by default +* Added previousResponse() method to response objects +* No longer sending Accept and Accept-Encoding headers on every request +* Only sending an Expect header by default when a payload is greater than 1MB +* Added/moved client options: + * curl.blacklist to curl.option.blacklist + * Added ssl.certificate_authority +* Added a Guzzle\Iterator component +* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin +* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) +* Added a more robust caching plugin +* Added setBody to response objects +* Updating LogPlugin to use a more flexible MessageFormatter +* Added a completely revamped build process +* Cleaning up Collection class and removing default values from the get method +* Fixed ZF2 cache adapters + +## 2.8.8 - 2012-10-15 + +* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did + +## 2.8.7 - 2012-09-30 + +* Bug: Fixed config file aliases for JSON includes +* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests +* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload +* Bug: Hardening request and response parsing to account for missing parts +* Bug: Fixed PEAR packaging +* Bug: Fixed Request::getInfo +* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail +* Adding the ability for the namespace Iterator factory to look in multiple directories +* Added more getters/setters/removers from service descriptions +* Added the ability to remove POST fields from OAuth signatures +* OAuth plugin now supports 2-legged OAuth + +## 2.8.6 - 2012-09-05 + +* Added the ability to modify and build service descriptions +* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command +* Added a `json` parameter location +* Now allowing dot notation for classes in the CacheAdapterFactory +* Using the union of two arrays rather than an array_merge when extending service builder services and service params +* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references + in service builder config files. +* Services defined in two different config files that include one another will by default replace the previously + defined service, but you can now create services that extend themselves and merge their settings over the previous +* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like + '_default' with a default JSON configuration file. + +## 2.8.5 - 2012-08-29 + +* Bug: Suppressed empty arrays from URI templates +* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching +* Added support for HTTP responses that do not contain a reason phrase in the start-line +* AbstractCommand commands are now invokable +* Added a way to get the data used when signing an Oauth request before a request is sent + +## 2.8.4 - 2012-08-15 + +* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin +* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. +* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream +* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream +* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) +* Added additional response status codes +* Removed SSL information from the default User-Agent header +* DELETE requests can now send an entity body +* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries +* Added the ability of the MockPlugin to consume mocked request bodies +* LogPlugin now exposes request and response objects in the extras array + +## 2.8.3 - 2012-07-30 + +* Bug: Fixed a case where empty POST requests were sent as GET requests +* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body +* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new +* Added multiple inheritance to service description commands +* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` +* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything +* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles + +## 2.8.2 - 2012-07-24 + +* Bug: Query string values set to 0 are no longer dropped from the query string +* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` +* Bug: `+` is now treated as an encoded space when parsing query strings +* QueryString and Collection performance improvements +* Allowing dot notation for class paths in filters attribute of a service descriptions + +## 2.8.1 - 2012-07-16 + +* Loosening Event Dispatcher dependency +* POST redirects can now be customized using CURLOPT_POSTREDIR + +## 2.8.0 - 2012-07-15 + +* BC: Guzzle\Http\Query + * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) + * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() + * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) + * Changed the aggregation functions of QueryString to be static methods + * Can now use fromString() with querystrings that have a leading ? +* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters +* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body +* Cookies are no longer URL decoded by default +* Bug: URI template variables set to null are no longer expanded + +## 2.7.2 - 2012-07-02 + +* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. +* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() +* CachePlugin now allows for a custom request parameter function to check if a request can be cached +* Bug fix: CachePlugin now only caches GET and HEAD requests by default +* Bug fix: Using header glue when transferring headers over the wire +* Allowing deeply nested arrays for composite variables in URI templates +* Batch divisors can now return iterators or arrays + +## 2.7.1 - 2012-06-26 + +* Minor patch to update version number in UA string +* Updating build process + +## 2.7.0 - 2012-06-25 + +* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. +* BC: Removed magic setX methods from commands +* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method +* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. +* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) +* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace +* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin +* Added the ability to set POST fields and files in a service description +* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method +* Adding a command.before_prepare event to clients +* Added BatchClosureTransfer and BatchClosureDivisor +* BatchTransferException now includes references to the batch divisor and transfer strategies +* Fixed some tests so that they pass more reliably +* Added Guzzle\Common\Log\ArrayLogAdapter + +## 2.6.6 - 2012-06-10 + +* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin +* BC: Removing Guzzle\Service\Command\CommandSet +* Adding generic batching system (replaces the batch queue plugin and command set) +* Updating ZF cache and log adapters and now using ZF's composer repository +* Bug: Setting the name of each ApiParam when creating through an ApiCommand +* Adding result_type, result_doc, deprecated, and doc_url to service descriptions +* Bug: Changed the default cookie header casing back to 'Cookie' + +## 2.6.5 - 2012-06-03 + +* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() +* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from +* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data +* BC: Renaming methods in the CookieJarInterface +* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations +* Making the default glue for HTTP headers ';' instead of ',' +* Adding a removeValue to Guzzle\Http\Message\Header +* Adding getCookies() to request interface. +* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() + +## 2.6.4 - 2012-05-30 + +* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. +* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand +* Bug: Fixing magic method command calls on clients +* Bug: Email constraint only validates strings +* Bug: Aggregate POST fields when POST files are present in curl handle +* Bug: Fixing default User-Agent header +* Bug: Only appending or prepending parameters in commands if they are specified +* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes +* Allowing the use of dot notation for class namespaces when using instance_of constraint +* Added any_match validation constraint +* Added an AsyncPlugin +* Passing request object to the calculateWait method of the ExponentialBackoffPlugin +* Allowing the result of a command object to be changed +* Parsing location and type sub values when instantiating a service description rather than over and over at runtime + +## 2.6.3 - 2012-05-23 + +* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. +* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. +* You can now use an array of data when creating PUT request bodies in the request factory. +* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. +* [Http] Adding support for Content-Type in multipart POST uploads per upload +* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) +* Adding more POST data operations for easier manipulation of POST data. +* You can now set empty POST fields. +* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. +* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. +* CS updates + +## 2.6.2 - 2012-05-19 + +* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. + +## 2.6.1 - 2012-05-19 + +* [BC] Removing 'path' support in service descriptions. Use 'uri'. +* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. +* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. +* [BC] Removing Guzzle\Common\XmlElement. +* All commands, both dynamic and concrete, have ApiCommand objects. +* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. +* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. +* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. + +## 2.6.0 - 2012-05-15 + +* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder +* [BC] Executing a Command returns the result of the command rather than the command +* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. +* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. +* [BC] Moving ResourceIterator* to Guzzle\Service\Resource +* [BC] Completely refactored ResourceIterators to iterate over a cloned command object +* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate +* [BC] Guzzle\Guzzle is now deprecated +* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject +* Adding Guzzle\Version class to give version information about Guzzle +* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() +* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data +* ServiceDescription and ServiceBuilder are now cacheable using similar configs +* Changing the format of XML and JSON service builder configs. Backwards compatible. +* Cleaned up Cookie parsing +* Trimming the default Guzzle User-Agent header +* Adding a setOnComplete() method to Commands that is called when a command completes +* Keeping track of requests that were mocked in the MockPlugin +* Fixed a caching bug in the CacheAdapterFactory +* Inspector objects can be injected into a Command object +* Refactoring a lot of code and tests to be case insensitive when dealing with headers +* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL +* Adding the ability to set global option overrides to service builder configs +* Adding the ability to include other service builder config files from within XML and JSON files +* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. + +## 2.5.0 - 2012-05-08 + +* Major performance improvements +* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. +* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. +* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" +* Added the ability to passed parameters to all requests created by a client +* Added callback functionality to the ExponentialBackoffPlugin +* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. +* Rewinding request stream bodies when retrying requests +* Exception is thrown when JSON response body cannot be decoded +* Added configurable magic method calls to clients and commands. This is off by default. +* Fixed a defect that added a hash to every parsed URL part +* Fixed duplicate none generation for OauthPlugin. +* Emitting an event each time a client is generated by a ServiceBuilder +* Using an ApiParams object instead of a Collection for parameters of an ApiCommand +* cache.* request parameters should be renamed to params.cache.* +* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. +* Added the ability to disable type validation of service descriptions +* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile b/upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile new file mode 100644 index 00000000000..f6a095230e8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile @@ -0,0 +1,18 @@ +FROM composer:latest as setup + +RUN mkdir /guzzle + +WORKDIR /guzzle + +RUN set -xe \ + && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ + && composer require guzzlehttp/guzzle + + +FROM php:7.3 + +RUN mkdir /guzzle + +WORKDIR /guzzle + +COPY --from=setup /guzzle /guzzle diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE b/upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE new file mode 100644 index 00000000000..50a177b0320 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/README.md b/upload/system/storage/vendor/guzzlehttp/guzzle/README.md new file mode 100644 index 00000000000..5fdb6c5f42d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/README.md @@ -0,0 +1,90 @@ +Guzzle, PHP HTTP client +======================= + +[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) +[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) +[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) + +Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and +trivial to integrate with web services. + +- Simple interface for building query strings, POST requests, streaming large + uploads, streaming large downloads, using HTTP cookies, uploading JSON data, + etc... +- Can send both synchronous and asynchronous requests using the same interface. +- Uses PSR-7 interfaces for requests, responses, and streams. This allows you + to utilize other PSR-7 compatible libraries with Guzzle. +- Abstracts away the underlying HTTP transport, allowing you to write + environment and transport agnostic code; i.e., no hard dependency on cURL, + PHP streams, sockets, or non-blocking event loops. +- Middleware system allows you to augment and compose client behavior. + +```php +$client = new \GuzzleHttp\Client(); +$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); + +echo $response->getStatusCode(); # 200 +echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8' +echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}' + +# Send an asynchronous request. +$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); +$promise = $client->sendAsync($request)->then(function ($response) { + echo 'I completed! ' . $response->getBody(); +}); + +$promise->wait(); +``` + +## Help and docs + +- [Documentation](http://guzzlephp.org/) +- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) +- [Gitter](https://gitter.im/guzzle/guzzle) + + +## Installing Guzzle + +The recommended way to install Guzzle is through +[Composer](http://getcomposer.org). + +```bash +# Install Composer +curl -sS https://getcomposer.org/installer | php +``` + +Next, run the Composer command to install the latest stable version of Guzzle: + +```bash +composer require guzzlehttp/guzzle +``` + +After installing, you need to require Composer's autoloader: + +```php +require 'vendor/autoload.php'; +``` + +You can then later update Guzzle using composer: + + ```bash +composer update + ``` + + +## 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 | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | + +[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 +[guzzle-3-docs]: http://guzzle3.readthedocs.org +[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ +[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md b/upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md new file mode 100644 index 00000000000..91d1dcc9931 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -0,0 +1,1203 @@ +Guzzle Upgrade Guide +==================== + +5.0 to 6.0 +---------- + +Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages. +Due to the fact that these messages are immutable, this prompted a refactoring +of Guzzle to use a middleware based system rather than an event system. Any +HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be +updated to work with the new immutable PSR-7 request and response objects. Any +event listeners or subscribers need to be updated to become middleware +functions that wrap handlers (or are injected into a +`GuzzleHttp\HandlerStack`). + +- Removed `GuzzleHttp\BatchResults` +- Removed `GuzzleHttp\Collection` +- Removed `GuzzleHttp\HasDataTrait` +- Removed `GuzzleHttp\ToArrayInterface` +- The `guzzlehttp/streams` dependency has been removed. Stream functionality + is now present in the `GuzzleHttp\Psr7` namespace provided by the + `guzzlehttp/psr7` package. +- Guzzle no longer uses ReactPHP promises and now uses the + `guzzlehttp/promises` library. We use a custom promise library for three + significant reasons: + 1. React promises (at the time of writing this) are recursive. Promise + chaining and promise resolution will eventually blow the stack. Guzzle + promises are not recursive as they use a sort of trampolining technique. + Note: there has been movement in the React project to modify promises to + no longer utilize recursion. + 2. Guzzle needs to have the ability to synchronously block on a promise to + wait for a result. Guzzle promises allows this functionality (and does + not require the use of recursion). + 3. Because we need to be able to wait on a result, doing so using React + promises requires wrapping react promises with RingPHP futures. This + overhead is no longer needed, reducing stack sizes, reducing complexity, + and improving performance. +- `GuzzleHttp\Mimetypes` has been moved to a function in + `GuzzleHttp\Psr7\mimetype_from_extension` and + `GuzzleHttp\Psr7\mimetype_from_filename`. +- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query + strings must now be passed into request objects as strings, or provided to + the `query` request option when creating requests with clients. The `query` + option uses PHP's `http_build_query` to convert an array to a string. If you + need a different serialization technique, you will need to pass the query + string in as a string. There are a couple helper functions that will make + working with query strings easier: `GuzzleHttp\Psr7\parse_query` and + `GuzzleHttp\Psr7\build_query`. +- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware + system based on PSR-7, using RingPHP and it's middleware system as well adds + more complexity than the benefits it provides. All HTTP handlers that were + present in RingPHP have been modified to work directly with PSR-7 messages + and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces + complexity in Guzzle, removes a dependency, and improves performance. RingPHP + will be maintained for Guzzle 5 support, but will no longer be a part of + Guzzle 6. +- As Guzzle now uses a middleware based systems the event system and RingPHP + integration has been removed. Note: while the event system has been removed, + it is possible to add your own type of event system that is powered by the + middleware system. + - Removed the `Event` namespace. + - Removed the `Subscriber` namespace. + - Removed `Transaction` class + - Removed `RequestFsm` + - Removed `RingBridge` + - `GuzzleHttp\Subscriber\Cookie` is now provided by + `GuzzleHttp\Middleware::cookies` + - `GuzzleHttp\Subscriber\HttpError` is now provided by + `GuzzleHttp\Middleware::httpError` + - `GuzzleHttp\Subscriber\History` is now provided by + `GuzzleHttp\Middleware::history` + - `GuzzleHttp\Subscriber\Mock` is now provided by + `GuzzleHttp\Handler\MockHandler` + - `GuzzleHttp\Subscriber\Prepare` is now provided by + `GuzzleHttp\PrepareBodyMiddleware` + - `GuzzleHttp\Subscriber\Redirect` is now provided by + `GuzzleHttp\RedirectMiddleware` +- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in + `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. +- Static functions in `GuzzleHttp\Utils` have been moved to namespaced + functions under the `GuzzleHttp` namespace. This requires either a Composer + based autoloader or you to include functions.php. +- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to + `GuzzleHttp\ClientInterface::getConfig`. +- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. +- The `json` and `xml` methods of response objects has been removed. With the + migration to strictly adhering to PSR-7 as the interface for Guzzle messages, + adding methods to message interfaces would actually require Guzzle messages + to extend from PSR-7 messages rather then work with them directly. + +## Migrating to middleware + +The change to PSR-7 unfortunately required significant refactoring to Guzzle +due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event +system from plugins. The event system relied on mutability of HTTP messages and +side effects in order to work. With immutable messages, you have to change your +workflow to become more about either returning a value (e.g., functional +middlewares) or setting a value on an object. Guzzle v6 has chosen the +functional middleware approach. + +Instead of using the event system to listen for things like the `before` event, +you now create a stack based middleware function that intercepts a request on +the way in and the promise of the response on the way out. This is a much +simpler and more predictable approach than the event system and works nicely +with PSR-7 middleware. Due to the use of promises, the middleware system is +also asynchronous. + +v5: + +```php +use GuzzleHttp\Event\BeforeEvent; +$client = new GuzzleHttp\Client(); +// Get the emitter and listen to the before event. +$client->getEmitter()->on('before', function (BeforeEvent $e) { + // Guzzle v5 events relied on mutation + $e->getRequest()->setHeader('X-Foo', 'Bar'); +}); +``` + +v6: + +In v6, you can modify the request before it is sent using the `mapRequest` +middleware. The idiomatic way in v6 to modify the request/response lifecycle is +to setup a handler middleware stack up front and inject the handler into a +client. + +```php +use GuzzleHttp\Middleware; +// Create a handler stack that has all of the default middlewares attached +$handler = GuzzleHttp\HandlerStack::create(); +// Push the handler onto the handler stack +$handler->push(Middleware::mapRequest(function (RequestInterface $request) { + // Notice that we have to return a request object + return $request->withHeader('X-Foo', 'Bar'); +})); +// Inject the handler into the client +$client = new GuzzleHttp\Client(['handler' => $handler]); +``` + +## POST Requests + +This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) +and `multipart` request options. `form_params` is an associative array of +strings or array of strings and is used to serialize an +`application/x-www-form-urlencoded` POST request. The +[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) +option is now used to send a multipart/form-data POST request. + +`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add +POST files to a multipart/form-data request. + +The `body` option no longer accepts an array to send POST requests. Please use +`multipart` or `form_params` instead. + +The `base_url` option has been renamed to `base_uri`. + +4.x to 5.0 +---------- + +## Rewritten Adapter Layer + +Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send +HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor +is still supported, but it has now been renamed to `handler`. Instead of +passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP +`callable` that follows the RingPHP specification. + +## Removed Fluent Interfaces + +[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil) +from the following classes: + +- `GuzzleHttp\Collection` +- `GuzzleHttp\Url` +- `GuzzleHttp\Query` +- `GuzzleHttp\Post\PostBody` +- `GuzzleHttp\Cookie\SetCookie` + +## Removed functions.php + +Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following +functions can be used as replacements. + +- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` +- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` +- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` +- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, + deprecated in favor of using `GuzzleHttp\Pool::batch()`. + +The "procedural" global client has been removed with no replacement (e.g., +`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` +object as a replacement. + +## `throwImmediately` has been removed + +The concept of "throwImmediately" has been removed from exceptions and error +events. This control mechanism was used to stop a transfer of concurrent +requests from completing. This can now be handled by throwing the exception or +by cancelling a pool of requests or each outstanding future request +individually. + +## headers event has been removed + +Removed the "headers" event. This event was only useful for changing the +body a response once the headers of the response were known. You can implement +a similar behavior in a number of ways. One example might be to use a +FnStream that has access to the transaction being sent. For example, when the +first byte is written, you could check if the response headers match your +expectations, and if so, change the actual stream body that is being +written to. + +## Updates to HTTP Messages + +Removed the `asArray` parameter from +`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header +value as an array, then use the newly added `getHeaderAsArray()` method of +`MessageInterface`. This change makes the Guzzle interfaces compatible with +the PSR-7 interfaces. + +3.x to 4.0 +---------- + +## Overarching changes: + +- Now requires PHP 5.4 or greater. +- No longer requires cURL to send requests. +- Guzzle no longer wraps every exception it throws. Only exceptions that are + recoverable are now wrapped by Guzzle. +- Various namespaces have been removed or renamed. +- No longer requiring the Symfony EventDispatcher. A custom event dispatcher + based on the Symfony EventDispatcher is + now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant + speed and functionality improvements). + +Changes per Guzzle 3.x namespace are described below. + +## Batch + +The `Guzzle\Batch` namespace has been removed. This is best left to +third-parties to implement on top of Guzzle's core HTTP library. + +## Cache + +The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement +has been implemented yet, but hoping to utilize a PSR cache interface). + +## Common + +- Removed all of the wrapped exceptions. It's better to use the standard PHP + library for unrecoverable exceptions. +- `FromConfigInterface` has been removed. +- `Guzzle\Common\Version` has been removed. The VERSION constant can be found + at `GuzzleHttp\ClientInterface::VERSION`. + +### Collection + +- `getAll` has been removed. Use `toArray` to convert a collection to an array. +- `inject` has been removed. +- `keySearch` has been removed. +- `getPath` no longer supports wildcard expressions. Use something better like + JMESPath for this. +- `setPath` now supports appending to an existing array via the `[]` notation. + +### Events + +Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses +`GuzzleHttp\Event\Emitter`. + +- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by + `GuzzleHttp\Event\EmitterInterface`. +- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by + `GuzzleHttp\Event\Emitter`. +- `Symfony\Component\EventDispatcher\Event` is replaced by + `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in + `GuzzleHttp\Event\EventInterface`. +- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and + `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the + event emitter of a request, client, etc. now uses the `getEmitter` method + rather than the `getDispatcher` method. + +#### Emitter + +- Use the `once()` method to add a listener that automatically removes itself + the first time it is invoked. +- Use the `listeners()` method to retrieve a list of event listeners rather than + the `getListeners()` method. +- Use `emit()` instead of `dispatch()` to emit an event from an emitter. +- Use `attach()` instead of `addSubscriber()` and `detach()` instead of + `removeSubscriber()`. + +```php +$mock = new Mock(); +// 3.x +$request->getEventDispatcher()->addSubscriber($mock); +$request->getEventDispatcher()->removeSubscriber($mock); +// 4.x +$request->getEmitter()->attach($mock); +$request->getEmitter()->detach($mock); +``` + +Use the `on()` method to add a listener rather than the `addListener()` method. + +```php +// 3.x +$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); +// 4.x +$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); +``` + +## Http + +### General changes + +- The cacert.pem certificate has been moved to `src/cacert.pem`. +- Added the concept of adapters that are used to transfer requests over the + wire. +- Simplified the event system. +- Sending requests in parallel is still possible, but batching is no longer a + concept of the HTTP layer. Instead, you must use the `complete` and `error` + events to asynchronously manage parallel request transfers. +- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. +- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. +- QueryAggregators have been rewritten so that they are simply callable + functions. +- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in + `functions.php` for an easy to use static client instance. +- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from + `GuzzleHttp\Exception\TransferException`. + +### Client + +Calling methods like `get()`, `post()`, `head()`, etc. no longer create and +return a request, but rather creates a request, sends the request, and returns +the response. + +```php +// 3.0 +$request = $client->get('/'); +$response = $request->send(); + +// 4.0 +$response = $client->get('/'); + +// or, to mirror the previous behavior +$request = $client->createRequest('GET', '/'); +$response = $client->send($request); +``` + +`GuzzleHttp\ClientInterface` has changed. + +- The `send` method no longer accepts more than one request. Use `sendAll` to + send multiple requests in parallel. +- `setUserAgent()` has been removed. Use a default request option instead. You + could, for example, do something like: + `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. +- `setSslVerification()` has been removed. Use default request options instead, + like `$client->setConfig('defaults/verify', true)`. + +`GuzzleHttp\Client` has changed. + +- The constructor now accepts only an associative array. You can include a + `base_url` string or array to use a URI template as the base URL of a client. + You can also specify a `defaults` key that is an associative array of default + request options. You can pass an `adapter` to use a custom adapter, + `batch_adapter` to use a custom adapter for sending requests in parallel, or + a `message_factory` to change the factory used to create HTTP requests and + responses. +- The client no longer emits a `client.create_request` event. +- Creating requests with a client no longer automatically utilize a URI + template. You must pass an array into a creational method (e.g., + `createRequest`, `get`, `put`, etc.) in order to expand a URI template. + +### Messages + +Messages no longer have references to their counterparts (i.e., a request no +longer has a reference to it's response, and a response no loger has a +reference to its request). This association is now managed through a +`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to +these transaction objects using request events that are emitted over the +lifecycle of a request. + +#### Requests with a body + +- `GuzzleHttp\Message\EntityEnclosingRequest` and + `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The + separation between requests that contain a body and requests that do not + contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` + handles both use cases. +- Any method that previously accepts a `GuzzleHttp\Response` object now accept a + `GuzzleHttp\Message\ResponseInterface`. +- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to + `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create + both requests and responses and is implemented in + `GuzzleHttp\Message\MessageFactory`. +- POST field and file methods have been removed from the request object. You + must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` + to control the format of a POST body. Requests that are created using a + standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use + a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if + the method is POST and no body is provided. + +```php +$request = $client->createRequest('POST', '/'); +$request->getBody()->setField('foo', 'bar'); +$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); +``` + +#### Headers + +- `GuzzleHttp\Message\Header` has been removed. Header values are now simply + represented by an array of values or as a string. Header values are returned + as a string by default when retrieving a header value from a message. You can + pass an optional argument of `true` to retrieve a header value as an array + of strings instead of a single concatenated string. +- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to + `GuzzleHttp\Post`. This interface has been simplified and now allows the + addition of arbitrary headers. +- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most + of the custom headers are now handled separately in specific + subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has + been updated to properly handle headers that contain parameters (like the + `Link` header). + +#### Responses + +- `GuzzleHttp\Message\Response::getInfo()` and + `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event + system to retrieve this type of information. +- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. +- `GuzzleHttp\Message\Response::getMessage()` has been removed. +- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific + methods have moved to the CacheSubscriber. +- Header specific helper functions like `getContentMd5()` have been removed. + Just use `getHeader('Content-MD5')` instead. +- `GuzzleHttp\Message\Response::setRequest()` and + `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event + system to work with request and response objects as a transaction. +- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the + Redirect subscriber instead. +- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have + been removed. Use `getStatusCode()` instead. + +#### Streaming responses + +Streaming requests can now be created by a client directly, returning a +`GuzzleHttp\Message\ResponseInterface` object that contains a body stream +referencing an open PHP HTTP stream. + +```php +// 3.0 +use Guzzle\Stream\PhpStreamRequestFactory; +$request = $client->get('/'); +$factory = new PhpStreamRequestFactory(); +$stream = $factory->fromRequest($request); +$data = $stream->read(1024); + +// 4.0 +$response = $client->get('/', ['stream' => true]); +// Read some data off of the stream in the response body +$data = $response->getBody()->read(1024); +``` + +#### Redirects + +The `configureRedirects()` method has been removed in favor of a +`allow_redirects` request option. + +```php +// Standard redirects with a default of a max of 5 redirects +$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); + +// Strict redirects with a custom number of redirects +$request = $client->createRequest('GET', '/', [ + 'allow_redirects' => ['max' => 5, 'strict' => true] +]); +``` + +#### EntityBody + +EntityBody interfaces and classes have been removed or moved to +`GuzzleHttp\Stream`. All classes and interfaces that once required +`GuzzleHttp\EntityBodyInterface` now require +`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no +longer uses `GuzzleHttp\EntityBody::factory` but now uses +`GuzzleHttp\Stream\Stream::factory` or even better: +`GuzzleHttp\Stream\create()`. + +- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` +- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` +- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` +- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` +- `Guzzle\Http\IoEmittyinEntityBody` has been removed. + +#### Request lifecycle events + +Requests previously submitted a large number of requests. The number of events +emitted over the lifecycle of a request has been significantly reduced to make +it easier to understand how to extend the behavior of a request. All events +emitted during the lifecycle of a request now emit a custom +`GuzzleHttp\Event\EventInterface` object that contains context providing +methods and a way in which to modify the transaction at that specific point in +time (e.g., intercept the request and set a response on the transaction). + +- `request.before_send` has been renamed to `before` and now emits a + `GuzzleHttp\Event\BeforeEvent` +- `request.complete` has been renamed to `complete` and now emits a + `GuzzleHttp\Event\CompleteEvent`. +- `request.sent` has been removed. Use `complete`. +- `request.success` has been removed. Use `complete`. +- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. +- `request.exception` has been removed. Use `error`. +- `request.receive.status_line` has been removed. +- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to + maintain a status update. +- `curl.callback.write` has been removed. Use a custom `StreamInterface` to + intercept writes. +- `curl.callback.read` has been removed. Use a custom `StreamInterface` to + intercept reads. + +`headers` is a new event that is emitted after the response headers of a +request have been received before the body of the response is downloaded. This +event emits a `GuzzleHttp\Event\HeadersEvent`. + +You can intercept a request and inject a response using the `intercept()` event +of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and +`GuzzleHttp\Event\ErrorEvent` event. + +See: http://docs.guzzlephp.org/en/latest/events.html + +## Inflection + +The `Guzzle\Inflection` namespace has been removed. This is not a core concern +of Guzzle. + +## Iterator + +The `Guzzle\Iterator` namespace has been removed. + +- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and + `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of + Guzzle itself. +- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent + class is shipped with PHP 5.4. +- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because + it's easier to just wrap an iterator in a generator that maps values. + +For a replacement of these iterators, see https://github.com/nikic/iter + +## Log + +The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The +`Guzzle\Log` namespace has been removed. Guzzle now relies on +`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been +moved to `GuzzleHttp\Subscriber\Log\Formatter`. + +## Parser + +The `Guzzle\Parser` namespace has been removed. This was previously used to +make it possible to plug in custom parsers for cookies, messages, URI +templates, and URLs; however, this level of complexity is not needed in Guzzle +so it has been removed. + +- Cookie: Cookie parsing logic has been moved to + `GuzzleHttp\Cookie\SetCookie::fromString`. +- Message: Message parsing logic for both requests and responses has been moved + to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only + used in debugging or deserializing messages, so it doesn't make sense for + Guzzle as a library to add this level of complexity to parsing messages. +- UriTemplate: URI template parsing has been moved to + `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL + URI template library if it is installed. +- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously + it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, + then developers are free to subclass `GuzzleHttp\Url`. + +## Plugin + +The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. +Several plugins are shipping with the core Guzzle library under this namespace. + +- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar + code has moved to `GuzzleHttp\Cookie`. +- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. +- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is + received. +- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. +- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before + sending. This subscriber is attached to all requests by default. +- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. + +The following plugins have been removed (third-parties are free to re-implement +these if needed): + +- `GuzzleHttp\Plugin\Async` has been removed. +- `GuzzleHttp\Plugin\CurlAuth` has been removed. +- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This + functionality should instead be implemented with event listeners that occur + after normal response parsing occurs in the guzzle/command package. + +The following plugins are not part of the core Guzzle package, but are provided +in separate repositories: + +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler + to build custom retry policies using simple functions rather than various + chained classes. See: https://github.com/guzzle/retry-subscriber +- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to + https://github.com/guzzle/cache-subscriber +- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to + https://github.com/guzzle/log-subscriber +- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to + https://github.com/guzzle/message-integrity-subscriber +- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to + `GuzzleHttp\Subscriber\MockSubscriber`. +- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to + https://github.com/guzzle/oauth-subscriber + +## Service + +The service description layer of Guzzle has moved into two separate packages: + +- http://github.com/guzzle/command Provides a high level abstraction over web + services by representing web service operations using commands. +- http://github.com/guzzle/guzzle-services Provides an implementation of + guzzle/command that provides request serialization and response parsing using + Guzzle service descriptions. + +## Stream + +Stream have moved to a separate package available at +https://github.com/guzzle/streams. + +`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take +on the responsibilities of `Guzzle\Http\EntityBody` and +`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number +of methods implemented by the `StreamInterface` has been drastically reduced to +allow developers to more easily extend and decorate stream behavior. + +## Removed methods from StreamInterface + +- `getStream` and `setStream` have been removed to better encapsulate streams. +- `getMetadata` and `setMetadata` have been removed in favor of + `GuzzleHttp\Stream\MetadataStreamInterface`. +- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been + removed. This data is accessible when + using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. +- `rewind` has been removed. Use `seek(0)` for a similar behavior. + +## Renamed methods + +- `detachStream` has been renamed to `detach`. +- `feof` has been renamed to `eof`. +- `ftell` has been renamed to `tell`. +- `readLine` has moved from an instance method to a static class method of + `GuzzleHttp\Stream\Stream`. + +## Metadata streams + +`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams +that contain additional metadata accessible via `getMetadata()`. +`GuzzleHttp\Stream\StreamInterface::getMetadata` and +`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. + +## StreamRequestFactory + +The entire concept of the StreamRequestFactory has been removed. The way this +was used in Guzzle 3 broke the actual interface of sending streaming requests +(instead of getting back a Response, you got a StreamInterface). Streaming +PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. + +3.6 to 3.7 +---------- + +### Deprecations + +- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: + +```php +\Guzzle\Common\Version::$emitWarnings = true; +``` + +The following APIs and options have been marked as deprecated: + +- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +- Marked `Guzzle\Common\Collection::inject()` as deprecated. +- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use + `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or + `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` + +3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational +request methods. When paired with a client's configuration settings, these options allow you to specify default settings +for various aspects of a request. Because these options make other previous configuration options redundant, several +configuration options and methods of a client and AbstractCommand have been deprecated. + +- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. +- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. +- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` +- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 + + $command = $client->getCommand('foo', array( + 'command.headers' => array('Test' => '123'), + 'command.response_body' => '/path/to/file' + )); + + // Should be changed to: + + $command = $client->getCommand('foo', array( + 'command.request_options' => array( + 'headers' => array('Test' => '123'), + 'save_as' => '/path/to/file' + ) + )); + +### Interface changes + +Additions and changes (you will need to update any implementations or subclasses you may have created): + +- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +- Added `Guzzle\Stream\StreamInterface::isRepeatable` +- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. + +The following methods were removed from interfaces. All of these methods are still available in the concrete classes +that implement them, but you should update your code to use alternative methods: + +- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or + `$client->setDefaultOption('headers/{header_name}', 'value')`. or + `$client->setDefaultOption('headers', array('header_name' => 'value'))`. +- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. +- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. +- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. +- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. +- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. + +### Cache plugin breaking changes + +- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +- Always setting X-cache headers on cached responses +- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +- Added `CacheStorageInterface::purge($url)` +- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +3.5 to 3.6 +---------- + +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). + For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). + Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Moved getLinks() from Response to just be used on a Link header object. + +If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the +HeaderInterface (e.g. toArray(), getAll(), etc.). + +### Interface changes + +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() + +### Removed deprecated functions + +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). + +### Deprecations + +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. + +### Other changes + +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess + +3.3 to 3.4 +---------- + +Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. + +3.2 to 3.3 +---------- + +### Response::getEtag() quote stripping removed + +`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header + +### Removed `Guzzle\Http\Utils` + +The `Guzzle\Http\Utils` class was removed. This class was only used for testing. + +### Stream wrapper and type + +`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. + +### curl.emit_io became emit_io + +Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the +'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' + +3.1 to 3.2 +---------- + +### CurlMulti is no longer reused globally + +Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added +to a single client can pollute requests dispatched from other clients. + +If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the +ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is +created. + +```php +$multi = new Guzzle\Http\Curl\CurlMulti(); +$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); +$builder->addListener('service_builder.create_client', function ($event) use ($multi) { + $event['client']->setCurlMulti($multi); +} +}); +``` + +### No default path + +URLs no longer have a default path value of '/' if no path was specified. + +Before: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com/ +``` + +After: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com +``` + +### Less verbose BadResponseException + +The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and +response information. You can, however, get access to the request and response object by calling `getRequest()` or +`getResponse()` on the exception object. + +### Query parameter aggregation + +Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a +setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is +responsible for handling the aggregation of multi-valued query string variables into a flattened hash. + +2.8 to 3.x +---------- + +### Guzzle\Service\Inspector + +Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` + +**Before** + +```php +use Guzzle\Service\Inspector; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Inspector::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +**After** + +```php +use Guzzle\Common\Collection; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Collection::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +### Convert XML Service Descriptions to JSON + +**Before** + +```xml + + + + + + Get a list of groups + + + Uses a search query to get a list of groups + + + + Create a group + + + + + Delete a group by ID + + + + + + + Update a group + + + + + + +``` + +**After** + +```json +{ + "name": "Zendesk REST API v2", + "apiVersion": "2012-12-31", + "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", + "operations": { + "list_groups": { + "httpMethod":"GET", + "uri": "groups.json", + "summary": "Get a list of groups" + }, + "search_groups":{ + "httpMethod":"GET", + "uri": "search.json?query=\"{query} type:group\"", + "summary": "Uses a search query to get a list of groups", + "parameters":{ + "query":{ + "location": "uri", + "description":"Zendesk Search Query", + "type": "string", + "required": true + } + } + }, + "create_group": { + "httpMethod":"POST", + "uri": "groups.json", + "summary": "Create a group", + "parameters":{ + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + }, + "delete_group": { + "httpMethod":"DELETE", + "uri": "groups/{id}.json", + "summary": "Delete a group", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to delete by ID", + "type": "integer", + "required": true + } + } + }, + "get_group": { + "httpMethod":"GET", + "uri": "groups/{id}.json", + "summary": "Get a ticket", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to get by ID", + "type": "integer", + "required": true + } + } + }, + "update_group": { + "httpMethod":"PUT", + "uri": "groups/{id}.json", + "summary": "Update a group", + "parameters":{ + "id": { + "location": "uri", + "description":"Group to update by ID", + "type": "integer", + "required": true + }, + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + } +} +``` + +### Guzzle\Service\Description\ServiceDescription + +Commands are now called Operations + +**Before** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getCommands(); // @returns ApiCommandInterface[] +$sd->hasCommand($name); +$sd->getCommand($name); // @returns ApiCommandInterface|null +$sd->addCommand($command); // @param ApiCommandInterface $command +``` + +**After** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getOperations(); // @returns OperationInterface[] +$sd->hasOperation($name); +$sd->getOperation($name); // @returns OperationInterface|null +$sd->addOperation($operation); // @param OperationInterface $operation +``` + +### Guzzle\Common\Inflection\Inflector + +Namespace is now `Guzzle\Inflection\Inflector` + +### Guzzle\Http\Plugin + +Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. + +### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log + +Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. + +**Before** + +```php +use Guzzle\Common\Log\ClosureLogAdapter; +use Guzzle\Http\Plugin\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $verbosity is an integer indicating desired message verbosity level +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); +``` + +**After** + +```php +use Guzzle\Log\ClosureLogAdapter; +use Guzzle\Log\MessageFormatter; +use Guzzle\Plugin\Log\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $format is a string indicating desired message format -- @see MessageFormatter +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); +``` + +### Guzzle\Http\Plugin\CurlAuthPlugin + +Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. + +### Guzzle\Http\Plugin\ExponentialBackoffPlugin + +Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. + +**Before** + +```php +use Guzzle\Http\Plugin\ExponentialBackoffPlugin; + +$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( + ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) + )); + +$client->addSubscriber($backoffPlugin); +``` + +**After** + +```php +use Guzzle\Plugin\Backoff\BackoffPlugin; +use Guzzle\Plugin\Backoff\HttpBackoffStrategy; + +// Use convenient factory method instead -- see implementation for ideas of what +// you can do with chaining backoff strategies +$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( + HttpBackoffStrategy::getDefaultFailureCodes(), array(429) + )); +$client->addSubscriber($backoffPlugin); +``` + +### Known Issues + +#### [BUG] Accept-Encoding header behavior changed unintentionally. + +(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) + +In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to +properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. +See issue #217 for a workaround, or use a version containing the fix. diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/composer.json b/upload/system/storage/vendor/guzzlehttp/guzzle/composer.json new file mode 100644 index 00000000000..c01864f013f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/composer.json @@ -0,0 +1,59 @@ +{ + "name": "guzzlehttp/guzzle", + "type": "library", + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "framework", + "http", + "rest", + "web service", + "curl", + "client", + "HTTP client" + ], + "homepage": "http://guzzlephp.org/", + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.5", + "ext-json": "*", + "symfony/polyfill-intl-idn": "^1.17.0", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php new file mode 100644 index 00000000000..315a022cf4b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php @@ -0,0 +1,501 @@ + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. + * If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!is_callable($config['handler'])) { + throw new \InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\uri_for($config['base_uri']); + } + + $this->configureDefaults($config); + } + + /** + * @param string $method + * @param array $args + * + * @return Promise\PromiseInterface + */ + public function __call($method, $args) + { + if (count($args) < 1) { + throw new \InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = isset($args[1]) ? $args[1] : []; + + return substr($method, -5) === 'Async' + ? $this->requestAsync(substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + /** + * Asynchronously send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + public function sendAsync(RequestInterface $request, array $options = []) + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + /** + * Send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @return ResponseInterface + * @throws GuzzleException + */ + public function send(RequestInterface $request, array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->sendAsync($request, $options)->wait(); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + public function requestAsync($method, $uri = '', array $options = []) + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = isset($options['headers']) ? $options['headers'] : []; + $body = isset($options['body']) ? $options['body'] : null; + $version = isset($options['version']) ? $options['version'] : '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri($uri, $options); + if (is_array($body)) { + $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + /** + * Create and send an HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string $method HTTP method. + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @return ResponseInterface + * @throws GuzzleException + */ + public function request($method, $uri = '', array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->requestAsync($method, $uri, $options)->wait(); + } + + /** + * Get a client configuration option. + * + * These options include default request options of the client, a "handler" + * (if utilized by the concrete client), and a "base_uri" if utilized by + * the concrete client. + * + * @param string|null $option The config option to retrieve. + * + * @return mixed + */ + public function getConfig($option = null) + { + return $option === null + ? $this->config + : (isset($this->config[$option]) ? $this->config[$option] : null); + } + + /** + * @param string|null $uri + * + * @return UriInterface + */ + private function buildUri($uri, array $config) + { + // for BC we accept null which would otherwise fail in uri_for + $uri = Psr7\uri_for($uri === null ? '' : $uri); + + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); + } + + if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { + $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + * + * @param array $config + * @return void + */ + private function configureDefaults(array $config) + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false, + 'idn_conversion' => true, + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) { + $defaults['proxy']['http'] = getenv('HTTP_PROXY'); + } + + if ($proxy = getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = getenv('NO_PROXY')) { + $cleanedNoProxy = str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => default_user_agent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (array_keys($this->config['headers']) as $name) { + if (strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = default_user_agent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + * + * @return array + */ + private function prepareDefaults(array $options) + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = []; + unset($options['headers']); + } elseif (!is_array($options['headers'])) { + throw new \InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param array $options See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + private function transfer(RequestInterface $request, array $options) + { + // save_to -> sink + if (isset($options['save_to'])) { + $options['sink'] = $options['save_to']; + unset($options['save_to']); + } + + // exceptions -> http_errors + if (isset($options['exceptions'])) { + $options['http_errors'] = $options['exceptions']; + unset($options['exceptions']); + } + + $request = $this->applyOptions($request, $options); + /** @var HandlerStack $handler */ + $handler = $options['handler']; + + try { + return Promise\promise_for($handler($request, $options)); + } catch (\Exception $e) { + return Promise\rejection_for($e); + } + } + + /** + * Applies the array of request options to a request. + * + * @param RequestInterface $request + * @param array $options + * + * @return RequestInterface + */ + private function applyOptions(RequestInterface $request, array &$options) + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + 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.'); + } + $options['body'] = http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = \GuzzleHttp\json_encode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (is_array($options['body'])) { + $this->invalidBody(); + } + $modify['body'] = Psr7\stream_for($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + . base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (is_array($value)) { + $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986); + } + if (!is_string($value)) { + throw new \InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (is_bool($options['sink'])) { + throw new \InvalidArgumentException('sink must not be a boolean'); + } + } + + $request = Psr7\modify_request($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\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + . $request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\modify_request($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + /** + * Throw Exception with pre-set message. + * @return void + * @throws \InvalidArgumentException Invalid body. + */ + private function invalidBody() + { + throw new \InvalidArgumentException('Passing in the "body" request ' + . 'option as an array to send a POST request has been deprecated. ' + . '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/upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php new file mode 100644 index 00000000000..638b75dca4d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -0,0 +1,87 @@ +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + * + * @return self + */ + public static function fromArray(array $cookies, $domain) + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true + ])); + } + + return $cookieJar; + } + + /** + * @deprecated + */ + public static function getCookieValue($value) + { + return $value; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + * @return bool + */ + public static function shouldPersist( + SetCookie $cookie, + $allowSessionCookies = false + ) { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName($name) + { + // don't allow a non string name + if ($name === null || !is_scalar($name)) { + return null; + } + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + + return null; + } + + public function toArray() + { + return array_map(function (SetCookie $cookie) { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + public function clear($domain = null, $path = null, $name = null) + { + if (!$domain) { + $this->cookies = []; + return; + } elseif (!$path) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($domain) { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain) { + return !($cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name && + $cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } + } + + public function clearSessionCookies() + { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + public function setCookie(SetCookie $cookie) + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: ' . $result); + } else { + $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() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count() + { + return count($this->cookies); + } + + public function getIterator() + { + return new \ArrayIterator(array_values($this->cookies)); + } + + public function extractCookies( + RequestInterface $request, + ResponseInterface $response + ) { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 + * + * @param RequestInterface $request + * @return string + */ + private function getCookiePathFromRequest(RequestInterface $request) + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + if (0 === $lastSlashPos = strrpos($uriPath, '/')) { + return '/'; + } + + return substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request) + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) && + $cookie->matchesDomain($host) && + !$cookie->isExpired() && + (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName() . '=' + . $cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + * + * @param SetCookie $cookie + */ + private function removeCookieIfEmpty(SetCookie $cookie) + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php new file mode 100644 index 00000000000..6ee11885e1f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -0,0 +1,84 @@ +filename = $cookieFile; + $this->storeSessionCookies = $storeSessionCookies; + + if (file_exists($cookieFile)) { + $this->load($cookieFile); + } + } + + /** + * Saves the file when shutting down + */ + public function __destruct() + { + $this->save($this->filename); + } + + /** + * Saves the cookies to a file. + * + * @param string $filename File to save + * @throws \RuntimeException if the file cannot be found or created + */ + public function save($filename) + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $jsonStr = \GuzzleHttp\json_encode($json); + if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) { + throw new \RuntimeException("Unable to save file {$filename}"); + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename Cookie file to load. + * @throws \RuntimeException if the file cannot be loaded. + */ + public function load($filename) + { + $json = file_get_contents($filename); + if (false === $json) { + throw new \RuntimeException("Unable to load file {$filename}"); + } elseif ($json === '') { + return; + } + + $data = \GuzzleHttp\json_decode($json, true); + if (is_array($data)) { + foreach (json_decode($json, true) as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php new file mode 100644 index 00000000000..0224a2447b1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -0,0 +1,72 @@ +sessionKey = $sessionKey; + $this->storeSessionCookies = $storeSessionCookies; + $this->load(); + } + + /** + * Saves cookies to session when shutting down + */ + public function __destruct() + { + $this->save(); + } + + /** + * Save cookies to the client session + */ + public function save() + { + $json = []; + foreach ($this as $cookie) { + /** @var SetCookie $cookie */ + if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + $json[] = $cookie->toArray(); + } + } + + $_SESSION[$this->sessionKey] = json_encode($json); + } + + /** + * Load the contents of the client session into the data array + */ + protected function load() + { + if (!isset($_SESSION[$this->sessionKey])) { + return; + } + $data = json_decode($_SESSION[$this->sessionKey], true); + if (is_array($data)) { + foreach ($data as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (strlen($data)) { + throw new \RuntimeException("Invalid cookie data"); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php new file mode 100644 index 00000000000..3d776a70bc7 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -0,0 +1,403 @@ + null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false + ]; + + /** @var array Cookie data */ + private $data; + + /** + * Create a new SetCookie object from a string + * + * @param string $cookie Set-Cookie header string + * + * @return self + */ + public static function fromString($cookie) + { + // Create the default return array + $data = self::$defaults; + // Explode the cookie string using a series of semicolons + $pieces = array_filter(array_map('trim', explode(';', $cookie))); + // The name of the cookie (first kvp) must exist and include an equal sign. + if (empty($pieces[0]) || !strpos($pieces[0], '=')) { + return new self($data); + } + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + $cookieParts = explode('=', $part, 2); + $key = trim($cookieParts[0]); + $value = isset($cookieParts[1]) + ? trim($cookieParts[1], " \n\r\t\0\x0B") + : true; + + // Only check for non-cookies when cookies have been found + if (empty($data['Name'])) { + $data['Name'] = $key; + $data['Value'] = $value; + } else { + foreach (array_keys(self::$defaults) as $search) { + if (!strcasecmp($search, $key)) { + $data[$search] = $value; + continue 2; + } + } + $data[$key] = $value; + } + } + + return new self($data); + } + + /** + * @param array $data Array of cookie data provided by a Cookie parser + */ + public function __construct(array $data = []) + { + $this->data = array_replace(self::$defaults, $data); + // Extract the Expires value and turn it into a UNIX timestamp if needed + if (!$this->getExpires() && $this->getMaxAge()) { + // Calculate the Expires date + $this->setExpires(time() + $this->getMaxAge()); + } elseif ($this->getExpires() && !is_numeric($this->getExpires())) { + $this->setExpires($this->getExpires()); + } + } + + public function __toString() + { + $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) . '; '; + } else { + $str .= ($v === true ? $k : "{$k}={$v}") . '; '; + } + } + } + + return rtrim($str, '; '); + } + + public function toArray() + { + return $this->data; + } + + /** + * Get the cookie name + * + * @return string + */ + public function getName() + { + return $this->data['Name']; + } + + /** + * Set the cookie name + * + * @param string $name Cookie name + */ + public function setName($name) + { + $this->data['Name'] = $name; + } + + /** + * Get the cookie value + * + * @return string + */ + public function getValue() + { + return $this->data['Value']; + } + + /** + * Set the cookie value + * + * @param string $value Cookie value + */ + public function setValue($value) + { + $this->data['Value'] = $value; + } + + /** + * Get the domain + * + * @return string|null + */ + public function getDomain() + { + return $this->data['Domain']; + } + + /** + * Set the domain of the cookie + * + * @param string $domain + */ + public function setDomain($domain) + { + $this->data['Domain'] = $domain; + } + + /** + * Get the path + * + * @return string + */ + public function getPath() + { + return $this->data['Path']; + } + + /** + * Set the path of the cookie + * + * @param string $path Path of the cookie + */ + public function setPath($path) + { + $this->data['Path'] = $path; + } + + /** + * Maximum lifetime of the cookie in seconds + * + * @return int|null + */ + public function getMaxAge() + { + return $this->data['Max-Age']; + } + + /** + * Set the max-age of the cookie + * + * @param int $maxAge Max age of the cookie in seconds + */ + public function setMaxAge($maxAge) + { + $this->data['Max-Age'] = $maxAge; + } + + /** + * The UNIX timestamp when the cookie Expires + * + * @return mixed + */ + public function getExpires() + { + return $this->data['Expires']; + } + + /** + * Set the unix timestamp for which the cookie will expire + * + * @param int $timestamp Unix timestamp + */ + public function setExpires($timestamp) + { + $this->data['Expires'] = is_numeric($timestamp) + ? (int) $timestamp + : strtotime($timestamp); + } + + /** + * Get whether or not this is a secure cookie + * + * @return bool|null + */ + public function getSecure() + { + return $this->data['Secure']; + } + + /** + * Set whether or not the cookie is secure + * + * @param bool $secure Set to true or false if secure + */ + public function setSecure($secure) + { + $this->data['Secure'] = $secure; + } + + /** + * Get whether or not this is a session cookie + * + * @return bool|null + */ + public function getDiscard() + { + return $this->data['Discard']; + } + + /** + * Set whether or not this is a session cookie + * + * @param bool $discard Set to true or false if this is a session cookie + */ + public function setDiscard($discard) + { + $this->data['Discard'] = $discard; + } + + /** + * Get whether or not this is an HTTP only cookie + * + * @return bool + */ + public function getHttpOnly() + { + return $this->data['HttpOnly']; + } + + /** + * Set whether or not this is an HTTP only cookie + * + * @param bool $httpOnly Set to true or false if this is HTTP only + */ + public function setHttpOnly($httpOnly) + { + $this->data['HttpOnly'] = $httpOnly; + } + + /** + * Check if the cookie matches a path value. + * + * A request-path path-matches a given cookie-path if at least one of + * the following conditions holds: + * + * - The cookie-path and the request-path are identical. + * - The cookie-path is a prefix of the request-path, and the last + * character of the cookie-path is %x2F ("/"). + * - The cookie-path is a prefix of the request-path, and the first + * character of the request-path that is not included in the cookie- + * path is a %x2F ("/") character. + * + * @param string $requestPath Path to check against + * + * @return bool + */ + public function matchesPath($requestPath) + { + $cookiePath = $this->getPath(); + + // Match on exact matches or when path is the default empty "/" + if ($cookiePath === '/' || $cookiePath == $requestPath) { + return true; + } + + // Ensure that the cookie-path is a prefix of the request path. + if (0 !== strpos($requestPath, $cookiePath)) { + return false; + } + + // Match if the last character of the cookie-path is "/" + if (substr($cookiePath, -1, 1) === '/') { + return true; + } + + // Match if the first character not included in cookie path is "/" + return substr($requestPath, strlen($cookiePath), 1) === '/'; + } + + /** + * Check if the cookie matches a domain value + * + * @param string $domain Domain to check against + * + * @return bool + */ + public function matchesDomain($domain) + { + // Remove the leading '.' as per spec in RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.2.3 + $cookieDomain = ltrim($this->getDomain(), '.'); + + // Domain not set or exact match. + if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) { + return true; + } + + // Matching the subdomain according to RFC 6265. + // http://tools.ietf.org/html/rfc6265#section-5.1.3 + if (filter_var($domain, FILTER_VALIDATE_IP)) { + return false; + } + + return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain); + } + + /** + * Check if the cookie is expired + * + * @return bool + */ + public function isExpired() + { + return $this->getExpires() !== null && time() > $this->getExpires(); + } + + /** + * Check if the cookie is valid according to RFC 6265 + * + * @return bool|string Returns true if valid or an error message if invalid + */ + public function validate() + { + // Names must not be empty, but can be 0 + $name = $this->getName(); + if (empty($name) && !is_numeric($name)) { + return 'The cookie name must not be empty'; + } + + // Check if any of the invalid characters are present in the cookie name + if (preg_match( + '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', + $name + )) { + return 'Cookie name must not contain invalid characters: ASCII ' + . 'Control characters (0-31;127), space, tab and the ' + . 'following characters: ()<>@,;:\"/?={}'; + } + + // Value must not be empty, but can be 0 + $value = $this->getValue(); + if (empty($value) && !is_numeric($value)) { + return 'The cookie value must not be empty'; + } + + // Domains must not be empty, but can be 0 + // A "0" is not a valid internet domain, but may be used as server name + // in a private network. + $domain = $this->getDomain(); + if (empty($domain) && !is_numeric($domain)) { + return 'The cookie domain must not be empty'; + } + + return true; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 00000000000..427d896fb2f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,27 @@ +getStatusCode() + : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + * + * @param RequestInterface $request + * @param \Exception $e + * + * @return RequestException + */ + public static function wrapException(RequestInterface $request, \Exception $e) + { + return $e instanceof RequestException + ? $e + : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request + * @param ResponseInterface $response Response received + * @param \Exception $previous Previous exception + * @param array $ctx Optional handler context. + * + * @return self + */ + public static function create( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $previous = null, + array $ctx = [] + ) { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $ctx + ); + } + + $level = (int) floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = $request->getUri(); + $uri = static::obfuscateUri($uri); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri, + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = static::getResponseBodySummary($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $ctx); + } + + /** + * Get a short summary of the response + * + * Will return `null` if the response is not printable. + * + * @param ResponseInterface $response + * + * @return string|null + */ + public static function getResponseBodySummary(ResponseInterface $response) + { + return \GuzzleHttp\Psr7\get_message_body_summary($response); + } + + /** + * Obfuscates URI if there is a username and a password present + * + * @param UriInterface $uri + * + * @return UriInterface + */ + private static function obfuscateUri(UriInterface $uri) + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = strpos($userInfo, ':'))) { + return $uri->withUserInfo(substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Get the request that caused the exception + * + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Get the associated response + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Check if a response was received + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + * + * @return array + */ + public function getHandlerContext() + { + return $this->handlerContext; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php new file mode 100644 index 00000000000..a77c28926cf --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php @@ -0,0 +1,27 @@ +stream = $stream; + $msg = $msg ?: 'Could not seek the stream to position ' . $pos; + parent::__construct($msg); + } + + /** + * @return StreamInterface + */ + public function getStream() + { + return $this->stream; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php new file mode 100644 index 00000000000..127094c1499 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -0,0 +1,9 @@ +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options) + { + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle; + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = array_replace($conf, $options['curl']); + } + + $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles + ? array_pop($this->handles) + : curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + public function release(EasyHandle $easy) + { + $resource = $easy->handle; + unset($easy->handle); + + if (count($this->handles) >= $this->maxHandles) { + curl_close($resource); + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + curl_setopt($resource, CURLOPT_HEADERFUNCTION, null); + curl_setopt($resource, CURLOPT_READFUNCTION, null); + curl_setopt($resource, CURLOPT_WRITEFUNCTION, null); + curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null); + curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable $handler + * @param EasyHandle $easy + * @param CurlFactoryInterface $factory Dictates how the handle is released + * + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public static function finish( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy) + { + $curlStats = curl_getinfo($easy->handle); + $curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + call_user_func($easy->options['on_stats'], $stats); + } + + private static function finishError( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => curl_error($easy->handle), + 'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME), + ] + curl_getinfo($easy->handle); + $ctx[self::CURL_VERSION_STR] = curl_version()['version']; + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) + && (!$easy->errno || $easy->errno == 65) + ) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function createRejection(EasyHandle $easy, array $ctx) + { + static $connectionErrors = [ + CURLE_OPERATION_TIMEOUTED => true, + CURLE_COULDNT_RESOLVE_HOST => true, + CURLE_COULDNT_CONNECT => true, + CURLE_SSL_CONNECT_ERROR => true, + CURLE_GOT_NOTHING => true, + ]; + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return \GuzzleHttp\Promise\rejection_for( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) { + $message = sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + } else { + $message = sprintf( + 'cURL error %s: %s (%s) for %s', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html', + $easy->request->getUri() + ); + } + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return \GuzzleHttp\Promise\rejection_for($error); + } + + private function getDefaultConf(EasyHandle $easy) + { + $conf = [ + '_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, + ]; + + if (defined('CURLOPT_PROTOCOLS')) { + $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + if ($version == 1.1) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; + } elseif ($version == 2.0) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; + } else { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf) + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See http://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[CURLOPT_NOBODY] = true; + unset( + $conf[CURLOPT_WRITEFUNCTION], + $conf[CURLOPT_READFUNCTION], + $conf[CURLOPT_FILE], + $conf[CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf) + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || + !empty($options['_body_as_string']) + ) { + $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf) + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader($name, array &$options) + { + foreach (array_keys($options['_headers']) as $key) { + if (!strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf) + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[CURLOPT_CAINFO]); + $conf[CURLOPT_SSL_VERIFYHOST] = 0; + $conf[CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[CURLOPT_SSL_VERIFYHOST] = 2; + $conf[CURLOPT_SSL_VERIFYPEER] = true; + if (is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!file_exists($options['verify'])) { + throw new \InvalidArgumentException( + "SSL CA bundle not found: {$options['verify']}" + ); + } + // 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']) && is_dir(readlink($options['verify'])))) { + $conf[CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[CURLOPT_ENCODING] = $accept; + } else { + $conf[CURLOPT_ENCODING] = ''; + // Don't let curl send the header over the wire + $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (isset($options['sink'])) { + $sink = $options['sink']; + if (!is_string($sink)) { + $sink = \GuzzleHttp\Psr7\stream_for($sink); + } elseif (!is_dir(dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(sprintf( + 'Directory %s does not exist for sink value of %s', + dirname($sink), + $sink + )); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { + return $sink->write($write); + }; + } else { + // Use a default temp stream if no sink was set. + $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); + $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); + } + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + $conf[CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!is_array($options['proxy'])) { + $conf[CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (!isset($options['proxy']['no']) || + !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no']) + ) { + $conf[CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (is_array($cert)) { + $conf[CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!file_exists($cert)) { + throw new \InvalidArgumentException( + "SSL certificate not found: {$cert}" + ); + } + $conf[CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + if (is_array($options['ssl_key'])) { + if (count($options['ssl_key']) === 2) { + list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key']; + } else { + list($sslKey) = $options['ssl_key']; + } + } + + $sslKey = isset($sslKey) ? $sslKey: $options['ssl_key']; + + if (!file_exists($sslKey)) { + throw new \InvalidArgumentException( + "SSL private key not found: {$sslKey}" + ); + } + $conf[CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!is_callable($progress)) { + throw new \InvalidArgumentException( + 'progress client option must be callable' + ); + } + $conf[CURLOPT_NOPROGRESS] = false; + $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) { + $args = func_get_args(); + // PHP 5.5 pushed the handle onto the start of the args + if (is_resource($args[0])) { + array_shift($args); + } + call_user_func_array($progress, $args); + }; + } + + if (!empty($options['debug'])) { + $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']); + $conf[CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + */ + private static function retryFailedRewind( + callable $handler, + EasyHandle $easy, + array $ctx + ) { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } 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; + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $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.'; + return self::createRejection($easy, $ctx); + } else { + $easy->options['_curl_retries']++; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy) + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = trim($h); + if ($value === '') { + $startingResponse = true; + $easy->createResponse(); + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + return strlen($h); + }; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php new file mode 100644 index 00000000000..b0fc236850b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -0,0 +1,27 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] + : new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options) + { + if (isset($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + curl_exec($easy->handle); + $easy->errno = curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php new file mode 100644 index 00000000000..564c95f481e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -0,0 +1,219 @@ +factory = isset($options['handle_factory']) + ? $options['handle_factory'] : new CurlFactory(50); + + if (isset($options['select_timeout'])) { + $this->selectTimeout = $options['select_timeout']; + } elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { + $this->selectTimeout = $selectTimeout; + } else { + $this->selectTimeout = 1; + } + + $this->options = isset($options['options']) ? $options['options'] : []; + } + + public function __get($name) + { + if ($name === '_mh') { + $this->_mh = curl_multi_init(); + + foreach ($this->options as $option => $value) { + // A warning is raised in case of a wrong option. + curl_multi_setopt($this->_mh, $option, $value); + } + + // Further calls to _mh will return the value directly, without entering the + // __get() method at all. + return $this->_mh; + } + + throw new \BadMethodCallException(); + } + + public function __destruct() + { + if (isset($this->_mh)) { + curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick() + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = Utils::currentTime(); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Step through the task queue which may add additional requests. + P\queue()->run(); + + if ($this->active && + curl_multi_select($this->_mh, $this->selectTimeout) === -1 + ) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + usleep(250); + } + + while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM); + + $this->processMessages(); + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute() + { + $queue = P\queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry) + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id) + { + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + curl_multi_remove_handle($this->_mh, $handle); + curl_close($handle); + + return true; + } + + private function processMessages() + { + while ($done = curl_multi_info_read($this->_mh)) { + $id = (int) $done['handle']; + curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish( + $this, + $entry['easy'], + $this->factory + ) + ); + } + } + + private function timeToNext() + { + $currentTime = Utils::currentTime(); + $nextTime = PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return max(0, $nextTime - $currentTime) * 1000000; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php new file mode 100644 index 00000000000..7754e9111b7 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -0,0 +1,92 @@ +headers)) { + throw new \RuntimeException('No headers have been received'); + } + + // HTTP-version SP status-code SP reason-phrase + $startLine = explode(' ', array_shift($this->headers), 3); + $headers = \GuzzleHttp\headers_from_lines($this->headers); + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + + if (!empty($this->options['decode_content']) + && isset($normalizedKeys['content-encoding']) + ) { + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $startLine[1], + $headers, + $this->sink, + substr($startLine[0], 5), + isset($startLine[2]) ? (string) $startLine[2] : null + ); + } + + public function __get($name) + { + $msg = $name === 'handle' + ? 'The EasyHandle has been released' + : 'Invalid property: ' . $name; + throw new \BadMethodCallException($msg); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php new file mode 100644 index 00000000000..5b312bc0428 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -0,0 +1,195 @@ +onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + call_user_func_array([$this, 'append'], $queue); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay']) && is_numeric($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (is_callable($response)) { + $response = call_user_func($response, $request, $options); + } + + $response = $response instanceof \Exception + ? \GuzzleHttp\Promise\rejection_for($response) + : \GuzzleHttp\Promise\promise_for($response); + + return $response->then( + function ($value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + call_user_func($this->onFulfilled, $value); + } + if (isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (is_resource($sink)) { + fwrite($sink, $contents); + } elseif (is_string($sink)) { + file_put_contents($sink, $contents); + } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + call_user_func($this->onRejected, $reason); + } + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + */ + public function append() + { + foreach (func_get_args() as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Exception + || $value instanceof PromiseInterface + || is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \InvalidArgumentException('Expected a response or ' + . 'exception. Found ' . \GuzzleHttp\describe_type($value)); + } + } + } + + /** + * Get the last received request. + * + * @return RequestInterface + */ + public function getLastRequest() + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + * + * @return array + */ + public function getLastOptions() + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + * + * @return int + */ + public function count() + { + return count($this->queue); + } + + public function reset() + { + $this->queue = []; + } + + private function invokeStats( + RequestInterface $request, + array $options, + ResponseInterface $response = null, + $reason = null + ) { + if (isset($options['on_stats'])) { + $transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0; + $stats = new TransferStats($request, $response, $transferTime, $reason); + call_user_func($options['on_stats'], $stats); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php new file mode 100644 index 00000000000..f8b00be0b99 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -0,0 +1,55 @@ +withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // cURL's behavior. + if (0 === $request->getBody()->getSize()) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (strpos($message, 'getaddrinfo') // DNS lookup failed + || strpos($message, 'Connection refused') + || strpos($message, "couldn't connect to host") // error on HHVM + || strpos($message, "connection attempt failed") + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } + $e = RequestException::wrapException($request, $e); + $this->invokeStats($options, $request, $startTime, null, $e); + + return \GuzzleHttp\Promise\rejection_for($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + $startTime, + ResponseInterface $response = null, + $error = null + ) { + if (isset($options['on_stats'])) { + $stats = new TransferStats( + $request, + $response, + Utils::currentTime() - $startTime, + $error, + [] + ); + call_user_func($options['on_stats'], $stats); + } + } + + private function createResponse( + RequestInterface $request, + array $options, + $stream, + $startTime + ) { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + $parts = explode(' ', array_shift($hdrs), 3); + $ver = explode('/', $parts[0])[1]; + $status = $parts[1]; + $reason = isset($parts[2]) ? $parts[2] : null; + $headers = \GuzzleHttp\headers_from_lines($hdrs); + list($stream, $headers) = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\stream_for($stream); + $sink = $stream; + + if (strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $ex = new RequestException($msg, $request, $response, $e); + return \GuzzleHttp\Promise\rejection_for($ex); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain( + $stream, + $sink, + $response->getHeaderLine('Content-Length') + ); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options) + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = isset($options['sink']) + ? $options['sink'] + : fopen('php://temp', 'r+'); + + return is_string($sink) + ? new Psr7\LazyOpenStream($sink, 'w+') + : Psr7\stream_for($sink); + } + + private function checkDecode(array $options, array $headers, $stream) + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream( + Psr7\stream_for($stream) + ); + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param StreamInterface $source + * @param StreamInterface $sink + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @return StreamInterface + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain( + StreamInterface $source, + StreamInterface $sink, + $contentLength + ) { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\copy_to_stream( + $source, + $sink, + (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = null; + set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line + ]; + return true; + }); + + $resource = $callback(); + restore_error_handler(); + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value" . PHP_EOL; + } + } + throw new \RuntimeException(trim($message)); + } + + return $resource; + } + + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = array_flip(get_class_methods(__CLASS__)); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() == '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = array_replace_recursive( + $context, + $options['stream_context'] + ); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth']) + && is_array($options['auth']) + && isset($options['auth'][2]) + && 'ntlm' == $options['auth'][2] + ) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $context = $this->createResource( + function () use ($context, $params) { + return stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, &$http_response_header, $context, $options) { + $resource = fopen((string) $uri, 'r', null, $context); + $this->lastHeaders = $http_response_header; + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options) + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_A); + if (!isset($records[0]['ip'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv4 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost($records[0]['ip']); + } elseif ('v6' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_AAAA); + if (!isset($records[0]['ipv6'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv6 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request) + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + ]; + + $body = (string) $request->getBody(); + + if (!empty($body)) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = rtrim($context['http']['header']); + + return $context; + } + + private function add_proxy(RequestInterface $request, &$options, $value, &$params) + { + if (!is_array($value)) { + $options['http']['proxy'] = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) + || !\GuzzleHttp\is_host_in_noproxy( + $request->getUri()->getHost(), + $value['no'] + ) + ) { + $options['http']['proxy'] = $value[$scheme]; + } + } + } + } + + private function add_timeout(RequestInterface $request, &$options, $value, &$params) + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + private function add_verify(RequestInterface $request, &$options, $value, &$params) + { + if ($value === true) { + // PHP 5.6 or greater will find the system cert by default. When + // < 5.6, use the Guzzle bundled cacert. + if (PHP_VERSION_ID < 50600) { + $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle(); + } + } elseif (is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + return; + } else { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + private function add_cert(RequestInterface $request, &$options, $value, &$params) + { + if (is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + private function add_progress(RequestInterface $request, &$options, $value, &$params) + { + $this->addNotification( + $params, + function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == STREAM_NOTIFY_PROGRESS) { + $value($total, $transferred, null, null); + } + } + ); + } + + private function add_debug(RequestInterface $request, &$options, $value, &$params) + { + if ($value === false) { + return; + } + + static $map = [ + 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', + ]; + static $args = ['severity', 'message', 'message_code', + 'bytes_transferred', 'bytes_max']; + + $value = \GuzzleHttp\debug_resource($value); + $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); + $this->addNotification( + $params, + function () use ($ident, $value, $map, $args) { + $passed = func_get_args(); + $code = array_shift($passed); + fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (array_filter($passed) as $i => $v) { + fwrite($value, $args[$i] . ': "' . $v . '" '); + } + fwrite($value, "\n"); + } + ); + } + + private function addNotification(array &$params, callable $notify) + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = $this->callArray([ + $params['notification'], + $notify + ]); + } + } + + private function callArray(array $functions) + { + return function () use ($functions) { + $args = func_get_args(); + foreach ($functions as $fn) { + call_user_func_array($fn, $args); + } + }; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php new file mode 100644 index 00000000000..6a49cc0690c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -0,0 +1,277 @@ +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param callable $handler Underlying HTTP handler. + */ + public function __construct(callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @param RequestInterface $request + * @param array $options + * + * @return ResponseInterface|PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + if ($this->handler) { + $stack[] = "0) Handler: " . $this->debugCallable($this->handler); + } + + $result = ''; + foreach (array_reverse($this->stack) as $tuple) { + $depth++; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= "Function: " . $this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler) + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + * + * @return bool + */ + public function hasHandler() + { + return (bool) $this->handler; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, $name = null) + { + array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, $name = '') + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove) + { + $this->cached = null; + $idx = is_callable($remove) ? 0 : 1; + $this->stack = array_values(array_filter( + $this->stack, + function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable + */ + public function resolve() + { + if (!$this->cached) { + if (!($prev = $this->handler)) { + throw new \LogicException('No handler has been specified'); + } + + foreach (array_reverse($this->stack) as $fn) { + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + /** + * @param string $name + * @return int + */ + private function findByName($name) + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + * + * @param string $findName + * @param string $withName + * @param callable $middleware + * @param bool $before + */ + private function splice($findName, $withName, callable $middleware, $before) + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param array|callable $fn Function to write as a string. + * + * @return string + */ + private function debugCallable($fn) + { + if (is_string($fn)) { + return "callable({$fn})"; + } + + if (is_array($fn)) { + return is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])"; + } + + return 'callable(' . spl_object_hash($fn) . ')'; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php new file mode 100644 index 00000000000..dc36bb524d4 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -0,0 +1,185 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** @var string Template used to format log messages */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct($template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + * @param \Exception $error Exception that was received + * + * @return string + */ + public function format( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $error = null + ) { + $cache = []; + + return preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\str($request); + break; + case 'response': + $result = $response ? Psr7\str($response) : ''; + break; + case 'req_headers': + $result = trim($request->getMethod() + . ' ' . $request->getRequestTarget()) + . ' HTTP/' . $request->getProtocolVersion() . "\r\n" + . $this->headers($request); + break; + case 'res_headers': + $result = $response ? + sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ) . "\r\n" . $this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody(); + break; + case 'res_body': + $result = $response ? $response->getBody() : 'NULL'; + break; + case 'ts': + case 'date_iso_8601': + $result = gmdate('c'); + break; + case 'date_common_log': + $result = date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(substr($matches[1], 11)); + } elseif (strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + return $result; + }, + $this->template + ); + } + + /** + * Get headers from message as string + * + * @return string + */ + private function headers(MessageInterface $message) + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name . ': ' . implode(', ', $values) . "\r\n"; + } + + return trim($result); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php new file mode 100644 index 00000000000..bffc1974bbe --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php @@ -0,0 +1,254 @@ +withCookieHeader($request); + return $handler($request, $options) + ->then( + function ($response) use ($cookieJar, $request) { + $cookieJar->extractCookies($request, $response); + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_error" request option is set to true. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function httpErrors() + { + return function (callable $handler) { + return function ($request, array $options) use ($handler) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + return $handler($request, $options)->then( + function (ResponseInterface $response) use ($request) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable Returns a function that accepts the next handler. + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container) + { + if (!is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return function (callable $handler) use (&$container) { + return function ($request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options + ]; + return $value; + }, + function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options + ]; + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(callable $before = null, callable $after = null) + { + return function (callable $handler) use ($before, $after) { + return function ($request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect() + { + return function (callable $handler) { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, callable $delay = null) + { + return function (callable $handler) use ($decider, $delay) { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */) + { + return function (callable $handler) use ($logger, $formatter, $logLevel) { + return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + function ($response) use ($logger, $request, $formatter, $logLevel) { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + return $response; + }, + function ($reason) use ($logger, $request, $formatter) { + $response = $reason instanceof RequestException + ? $reason->getResponse() + : null; + $message = $formatter->format($request, $response, $reason); + $logger->notice($message); + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + * + * @return callable + */ + public static function prepareBody() + { + return function (callable $handler) { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + * @return callable + */ + public static function mapRequest(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + * @return callable + */ + public static function mapResponse(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php new file mode 100644 index 00000000000..5838db4f4cf --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php @@ -0,0 +1,134 @@ + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by ' + . 'the iterator must be a Psr7\Http\Message\RequestInterface ' + . 'or a callable that returns a promise that fulfills ' + . 'with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + /** + * Get promise + * + * @return PromiseInterface + */ + public function promise() + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see GuzzleHttp\Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch( + ClientInterface $client, + $requests, + array $options = [] + ) { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + ksort($res); + + return $res; + } + + /** + * Execute callback(s) + * + * @return void + */ + private static function cmpCallback(array &$options, $name, array &$results) + { + if (!isset($options[$name])) { + $options[$name] = function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php new file mode 100644 index 00000000000..568a1e906c9 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -0,0 +1,111 @@ +nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if ($type = Psr7\mimetype_from_filename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\modify_request($request, $modify), $options); + } + + /** + * Add expect header + * + * @return void + */ + private function addExpectHeader( + RequestInterface $request, + array $options, + array &$modify + ) { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = isset($options['expect']) ? $options['expect'] : null; + + // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 + if ($expect === false || $request->getProtocolVersion() < 1.1) { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php new file mode 100644 index 00000000000..e4644b7ac1d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -0,0 +1,255 @@ + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** @var callable */ + private $nextHandler; + + /** + * @param callable $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + if (substr($response->getStatusCode(), 0, 1) != '3' + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + if (isset($options['allow_redirects']['on_redirect'])) { + call_user_func( + $options['allow_redirects']['on_redirect'], + $request, + $response, + $nextRequest->getUri() + ); + } + + /** @var PromiseInterface|ResponseInterface $promise */ + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + /** + * Enable tracking on promise. + * + * @return PromiseInterface + */ + private function withTracking(PromiseInterface $promise, $uri, $statusCode) + { + return $promise->then( + function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + array_unshift($historyHeader, $uri); + array_unshift($statusHeader, $statusCode); + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + /** + * Check for too many redirects + * + * @return void + * + * @throws TooManyRedirectsException Too many redirects. + */ + private function guardMax(RequestInterface $request, array &$options) + { + $current = isset($options['__redirect_count']) + ? $options['__redirect_count'] + : 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException( + "Will not follow more than {$max} redirects", + $request + ); + } + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return RequestInterface + */ + public function modifyRequest( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 || + ($statusCode <= 302 && !$options['allow_redirects']['strict']) + ) { + $modify['method'] = 'GET'; + $modify['body'] = ''; + } + + $uri = $this->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); + } + + $modify['uri'] = $uri; + Psr7\rewind_body($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo(''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization header if host is different. + if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + $modify['remove_headers'][] = 'Authorization'; + } + + return Psr7\modify_request($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param array $protocols + * + * @return UriInterface + */ + private function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ) { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!in_array($location->getScheme(), $protocols)) { + throw new BadResponseException( + sprintf( + 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s', + $location, + implode(', ', $protocols) + ), + $request, + $response + ); + } + + return $location; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php new file mode 100644 index 00000000000..355f658f034 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -0,0 +1,263 @@ +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @param int $retries + * + * @return int milliseconds. + */ + public static function exponentialDelay($retries) + { + return (int) pow(2, $retries - 1) * 1000; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + /** + * Execute fulfilled closure + * + * @return mixed + */ + private function onFulfilled(RequestInterface $req, array $options) + { + return function ($value) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + $value, + null + )) { + return $value; + } + return $this->doRetry($req, $options, $value); + }; + } + + /** + * Execute rejected closure + * + * @return callable + */ + private function onRejected(RequestInterface $req, array $options) + { + return function ($reason) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + null, + $reason + )) { + return \GuzzleHttp\Promise\rejection_for($reason); + } + return $this->doRetry($req, $options); + }; + } + + /** + * @return self + */ + private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) + { + $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); + + return $this($request, $options); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php new file mode 100644 index 00000000000..87fb3c00164 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -0,0 +1,126 @@ +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + /** + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Returns true if a response was received. + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + * + * @return UriInterface + */ + public function getEffectiveUri() + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float|null Time in seconds. + */ + public function getTransferTime() + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + * + * @return array + */ + public function getHandlerStats() + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat($stat) + { + return isset($this->handlerStats[$stat]) + ? $this->handlerStats[$stat] + : null; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php new file mode 100644 index 00000000000..96dcfd09cd7 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php @@ -0,0 +1,237 @@ + ['prefix' => '', 'joiner' => ',', 'query' => false], + '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], + '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], + '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], + '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], + ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], + '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], + '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true] + ]; + + /** @var array Delimiters */ + private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', + '&', '\'', '(', ')', '*', '+', ',', ';', '=']; + + /** @var array Percent encoded delimiters */ + private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', + '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', + '%3B', '%3D']; + + public function expand($template, array $variables) + { + if (false === strpos($template, '{')) { + return $template; + } + + $this->template = $template; + $this->variables = $variables; + + return preg_replace_callback( + '/\{([^\}]+)\}/', + [$this, 'expandMatch'], + $this->template + ); + } + + /** + * Parse an expression into parts + * + * @param string $expression Expression to parse + * + * @return array Returns an associative array of parts + */ + private function parseExpression($expression) + { + $result = []; + + if (isset(self::$operatorHash[$expression[0]])) { + $result['operator'] = $expression[0]; + $expression = substr($expression, 1); + } else { + $result['operator'] = ''; + } + + foreach (explode(',', $expression) as $value) { + $value = trim($value); + $varspec = []; + if ($colonPos = strpos($value, ':')) { + $varspec['value'] = substr($value, 0, $colonPos); + $varspec['modifier'] = ':'; + $varspec['position'] = (int) substr($value, $colonPos + 1); + } elseif (substr($value, -1) === '*') { + $varspec['modifier'] = '*'; + $varspec['value'] = substr($value, 0, -1); + } else { + $varspec['value'] = (string) $value; + $varspec['modifier'] = ''; + } + $result['values'][] = $varspec; + } + + return $result; + } + + /** + * Process an expansion + * + * @param array $matches Matches met in the preg_replace_callback + * + * @return string Returns the replacement string + */ + private function expandMatch(array $matches) + { + static $rfc1738to3986 = ['+' => '%20', '%7e' => '~']; + + $replacements = []; + $parsed = self::parseExpression($matches[1]); + $prefix = self::$operatorHash[$parsed['operator']]['prefix']; + $joiner = self::$operatorHash[$parsed['operator']]['joiner']; + $useQuery = self::$operatorHash[$parsed['operator']]['query']; + + foreach ($parsed['values'] as $value) { + if (!isset($this->variables[$value['value']])) { + continue; + } + + $variable = $this->variables[$value['value']]; + $actuallyUseQuery = $useQuery; + $expanded = ''; + + if (is_array($variable)) { + $isAssoc = $this->isAssoc($variable); + $kvp = []; + foreach ($variable as $key => $var) { + if ($isAssoc) { + $key = rawurlencode($key); + $isNestedArray = is_array($var); + } else { + $isNestedArray = false; + } + + if (!$isNestedArray) { + $var = rawurlencode($var); + if ($parsed['operator'] === '+' || + $parsed['operator'] === '#' + ) { + $var = $this->decodeReserved($var); + } + } + + if ($value['modifier'] === '*') { + if ($isAssoc) { + if ($isNestedArray) { + // Nested arrays must allow for deeply nested + // structures. + $var = strtr( + http_build_query([$key => $var]), + $rfc1738to3986 + ); + } else { + $var = $key . '=' . $var; + } + } elseif ($key > 0 && $actuallyUseQuery) { + $var = $value['value'] . '=' . $var; + } + } + + $kvp[$key] = $var; + } + + if (empty($variable)) { + $actuallyUseQuery = false; + } elseif ($value['modifier'] === '*') { + $expanded = implode($joiner, $kvp); + if ($isAssoc) { + // Don't prepend the value name when using the explode + // modifier with an associative array. + $actuallyUseQuery = false; + } + } else { + if ($isAssoc) { + // When an associative array is encountered and the + // explode modifier is not set, then the result must be + // a comma separated list of keys followed by their + // respective values. + foreach ($kvp as $k => &$v) { + $v = $k . ',' . $v; + } + } + $expanded = implode(',', $kvp); + } + } else { + if ($value['modifier'] === ':') { + $variable = substr($variable, 0, $value['position']); + } + $expanded = rawurlencode($variable); + if ($parsed['operator'] === '+' || $parsed['operator'] === '#') { + $expanded = $this->decodeReserved($expanded); + } + } + + if ($actuallyUseQuery) { + if (!$expanded && $joiner !== '&') { + $expanded = $value['value']; + } else { + $expanded = $value['value'] . '=' . $expanded; + } + } + + $replacements[] = $expanded; + } + + $ret = implode($joiner, $replacements); + if ($ret && $prefix) { + return $prefix . $ret; + } + + return $ret; + } + + /** + * Determines if an array is associative. + * + * This makes the assumption that input arrays are sequences or hashes. + * This assumption is a tradeoff for accuracy in favor of speed, but it + * should work in almost every case where input is supplied for a URI + * template. + * + * @param array $array Array to check + * + * @return bool + */ + private function isAssoc(array $array) + { + return $array && array_keys($array)[0] !== 0; + } + + /** + * Removes percent encoding on reserved characters (used with + and # + * modifiers). + * + * @param string $string String to fix + * + * @return string + */ + private function decodeReserved($string) + { + return str_replace(self::$delimsPct, self::$delims, $string); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php new file mode 100644 index 00000000000..c698acbf02f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php @@ -0,0 +1,92 @@ +getHost()) { + $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); + if ($asciiHost === false) { + $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; + + $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) { + return substr($name, 0, 11) === 'IDNA_ERROR_'; + }); + + $errors = []; + foreach ($errorConstants as $errorConstant) { + if ($errorBitSet & constant($errorConstant)) { + $errors[] = $errorConstant; + } + } + + $errorMessage = 'IDN conversion failed'; + if ($errors) { + $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; + } + + throw new InvalidArgumentException($errorMessage); + } else { + if ($uri->getHost() !== $asciiHost) { + // Replace URI only if the ASCII version is different + $uri = $uri->withHost($asciiHost); + } + } + } + + return $uri; + } + + /** + * @param string $domain + * @param int $options + * @param array $info + * + * @return string|false + */ + private static function idnToAsci($domain, $options, &$info = []) + { + if (\preg_match('%^[ -~]+$%', $domain) === 1) { + return $domain; + } + + if (\extension_loaded('intl') && defined('INTL_IDNA_VARIANT_UTS46')) { + return \idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $info); + } + + /* + * The Idn class is marked as @internal. Verify that class and method exists. + */ + if (method_exists(Idn::class, 'idn_to_ascii')) { + return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php new file mode 100644 index 00000000000..c2afd8c7bb1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php @@ -0,0 +1,334 @@ +expand($template, $variables); +} + +/** + * Debug function used to describe the provided value type and class. + * + * @param mixed $input + * + * @return string Returns a string containing the type of the variable and + * if a class is provided, the class name. + */ +function describe_type($input) +{ + switch (gettype($input)) { + case 'object': + return 'object(' . get_class($input) . ')'; + case 'array': + return 'array(' . count($input) . ')'; + default: + ob_start(); + var_dump($input); + // normalize float vs double + return str_replace('double(', 'float(', rtrim(ob_get_clean())); + } +} + +/** + * Parses an array of header lines into an associative array of headers. + * + * @param iterable $lines Header lines array of strings in the following + * format: "Name: Value" + * @return array + */ +function headers_from_lines($lines) +{ + $headers = []; + + foreach ($lines as $line) { + $parts = explode(':', $line, 2); + $headers[trim($parts[0])][] = isset($parts[1]) + ? trim($parts[1]) + : null; + } + + return $headers; +} + +/** + * Returns a debug stream based on the provided variable. + * + * @param mixed $value Optional value + * + * @return resource + */ +function debug_resource($value = null) +{ + if (is_resource($value)) { + return $value; + } elseif (defined('STDOUT')) { + return STDOUT; + } + + return fopen('php://output', 'w'); +} + +/** + * Chooses and creates a default handler to use based on the environment. + * + * The returned handler is not wrapped by any default middlewares. + * + * @return callable Returns the best handler for the given system. + * @throws \RuntimeException if no viable Handler is available. + */ +function choose_handler() +{ + $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 (ini_get('allow_url_fopen')) { + $handler = $handler + ? Proxy::wrapStreaming($handler, new StreamHandler()) + : new StreamHandler(); + } elseif (!$handler) { + throw new \RuntimeException('GuzzleHttp requires cURL, the ' + . 'allow_url_fopen ini setting, or a custom HTTP handler.'); + } + + return $handler; +} + +/** + * Get the default User-Agent string to use with Guzzle + * + * @return string + */ +function default_user_agent() +{ + static $defaultAgent = ''; + + if (!$defaultAgent) { + $defaultAgent = 'GuzzleHttp/' . Client::VERSION; + if (extension_loaded('curl') && function_exists('curl_version')) { + $defaultAgent .= ' curl/' . \curl_version()['version']; + } + $defaultAgent .= ' PHP/' . PHP_VERSION; + } + + return $defaultAgent; +} + +/** + * Returns the default cacert bundle for the current system. + * + * First, the openssl.cafile and curl.cainfo php.ini settings are checked. + * If those settings are not configured, then the common locations for + * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X + * and Windows are checked. If any of these file locations are found on + * disk, they will be utilized. + * + * Note: the result of this function is cached for subsequent calls. + * + * @return string + * @throws \RuntimeException if no bundle can be found. + */ +function default_ca_bundle() +{ + static $cached = null; + static $cafiles = [ + // Red Hat, CentOS, Fedora (provided by the ca-certificates package) + '/etc/pki/tls/certs/ca-bundle.crt', + // Ubuntu, Debian (provided by the ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', + // FreeBSD (provided by the ca_root_nss package) + '/usr/local/share/certs/ca-root-nss.crt', + // SLES 12 (provided by the ca-certificates package) + '/var/lib/ca-certificates/ca-bundle.pem', + // OS X provided by homebrew (using the default path) + '/usr/local/etc/openssl/cert.pem', + // Google app engine + '/etc/ca-certificates.crt', + // Windows? + 'C:\\windows\\system32\\curl-ca-bundle.crt', + 'C:\\windows\\curl-ca-bundle.crt', + ]; + + if ($cached) { + return $cached; + } + + if ($ca = ini_get('openssl.cafile')) { + return $cached = $ca; + } + + if ($ca = ini_get('curl.cainfo')) { + return $cached = $ca; + } + + foreach ($cafiles as $filename) { + if (file_exists($filename)) { + return $cached = $filename; + } + } + + throw new \RuntimeException( + <<< EOT +No system CA bundle could be found in any of the the common system locations. +PHP versions earlier than 5.6 are not properly configured to use the system's +CA bundle by default. In order to verify peer certificates, you will need to +supply the path on disk to a certificate bundle to the 'verify' request +option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not +need a specific certificate bundle, then Mozilla provides a commonly used CA +bundle which can be downloaded here (provided by the maintainer of cURL): +https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once +you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP +ini setting to point to the path to the file, allowing you to omit the 'verify' +request option. See http://curl.haxx.se/docs/sslcerts.html for more +information. +EOT + ); +} + +/** + * Creates an associative array of lowercase header names to the actual + * header casing. + * + * @param array $headers + * + * @return array + */ +function normalize_header_keys(array $headers) +{ + $result = []; + foreach (array_keys($headers) as $key) { + $result[strtolower($key)] = $key; + } + + return $result; +} + +/** + * Returns true if the provided host matches any of the no proxy areas. + * + * This method will strip a port from the host if it is present. Each pattern + * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a + * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == + * "baz.foo.com", but ".foo.com" != "foo.com"). + * + * Areas are matched in the following cases: + * 1. "*" (without quotes) always matches any hosts. + * 2. An exact match. + * 3. The area starts with "." and the area is the last part of the host. e.g. + * '.mit.edu' will match any host that ends with '.mit.edu'. + * + * @param string $host Host to check against the patterns. + * @param array $noProxyArray An array of host patterns. + * + * @return bool + */ +function is_host_in_noproxy($host, array $noProxyArray) +{ + if (strlen($host) === 0) { + throw new \InvalidArgumentException('Empty host provided'); + } + + // Strip port if present. + if (strpos($host, ':')) { + $host = explode($host, ':', 2)[0]; + } + + foreach ($noProxyArray as $area) { + // Always match on wildcards. + if ($area === '*') { + return true; + } elseif (empty($area)) { + // Don't match on empty values. + continue; + } elseif ($area === $host) { + // Exact matches. + return true; + } else { + // 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) { + return true; + } + } + } + + return false; +} + +/** + * Wrapper for json_decode that throws when an error occurs. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return mixed + * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. + * @link http://www.php.net/manual/en/function.json-decode.php + */ +function json_decode($json, $assoc = false, $depth = 512, $options = 0) +{ + $data = \json_decode($json, $assoc, $depth, $options); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_decode error: ' . json_last_error_msg() + ); + } + + return $data; +} + +/** + * Wrapper for JSON encoding that throws when an error occurs. + * + * @param mixed $value The value being encoded + * @param int $options JSON encode option bitmask + * @param int $depth Set the maximum depth. Must be greater than zero. + * + * @return string + * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. + * @link http://www.php.net/manual/en/function.json-encode.php + */ +function json_encode($value, $options = 0, $depth = 512) +{ + $json = \json_encode($value, $options, $depth); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_encode error: ' . json_last_error_msg() + ); + } + + return $json; +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php new file mode 100644 index 00000000000..a93393acc4e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php @@ -0,0 +1,6 @@ + Date: Fri, 4 Mar 2022 14:55:21 +0000 Subject: [PATCH 20/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/symfony/validator | 1 - 1 file changed, 1 deletion(-) delete mode 160000 upload/system/storage/vendor/symfony/validator diff --git a/upload/system/storage/vendor/symfony/validator b/upload/system/storage/vendor/symfony/validator deleted file mode 160000 index d5d2090bba3..00000000000 --- a/upload/system/storage/vendor/symfony/validator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d5d2090bba3139d8ddb79959fbf516e87238fe3a From 1f7d114504912fac74278da7b6d67b73586a65ff Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:55:32 +0000 Subject: [PATCH 21/39] Support for PHP 8.0 and 8.1 --- .../vendor/symfony/validator/CHANGELOG.md | 355 ++++++++ .../validator/Command/DebugCommand.php | 203 +++++ .../vendor/symfony/validator/Constraint.php | 313 +++++++ .../symfony/validator/ConstraintValidator.php | 159 ++++ .../validator/ConstraintValidatorFactory.php | 48 ++ .../ConstraintValidatorFactoryInterface.php | 27 + .../ConstraintValidatorInterface.php | 32 + .../symfony/validator/ConstraintViolation.php | 181 ++++ .../ConstraintViolationInterface.php | 120 +++ .../validator/ConstraintViolationList.php | 203 +++++ .../ConstraintViolationListInterface.php | 67 ++ .../Constraints/AbstractComparison.php | 69 ++ .../AbstractComparisonValidator.php | 122 +++ .../symfony/validator/Constraints/All.php | 44 + .../validator/Constraints/AllValidator.php | 49 ++ .../validator/Constraints/AtLeastOneOf.php | 57 ++ .../Constraints/AtLeastOneOfValidator.php | 63 ++ .../symfony/validator/Constraints/Bic.php | 79 ++ .../validator/Constraints/BicValidator.php | 165 ++++ .../symfony/validator/Constraints/Blank.php | 39 + .../validator/Constraints/BlankValidator.php | 39 + .../validator/Constraints/Callback.php | 66 ++ .../Constraints/CallbackValidator.php | 61 ++ .../validator/Constraints/CardScheme.php | 79 ++ .../Constraints/CardSchemeValidator.php | 134 +++ .../symfony/validator/Constraints/Cascade.php | 42 + .../symfony/validator/Constraints/Choice.php | 89 ++ .../validator/Constraints/ChoiceValidator.php | 109 +++ .../symfony/validator/Constraints/Cidr.php | 80 ++ .../validator/Constraints/CidrValidator.php | 77 ++ .../validator/Constraints/Collection.php | 91 ++ .../Constraints/CollectionValidator.php | 87 ++ .../validator/Constraints/Composite.php | 159 ++++ .../validator/Constraints/Compound.php | 52 ++ .../Constraints/CompoundValidator.php | 35 + .../symfony/validator/Constraints/Count.php | 92 +++ .../validator/Constraints/CountValidator.php | 83 ++ .../symfony/validator/Constraints/Country.php | 52 ++ .../Constraints/CountryValidator.php | 53 ++ .../validator/Constraints/CssColor.php | 106 +++ .../Constraints/CssColorValidator.php | 86 ++ .../validator/Constraints/Currency.php | 46 ++ .../Constraints/CurrencyValidator.php | 54 ++ .../symfony/validator/Constraints/Date.php | 41 + .../validator/Constraints/DateTime.php | 60 ++ .../Constraints/DateTimeValidator.php | 81 ++ .../validator/Constraints/DateValidator.php | 75 ++ .../Constraints/DisableAutoMapping.php | 46 ++ .../validator/Constraints/DivisibleBy.php | 30 + .../Constraints/DivisibleByValidator.php | 56 ++ .../symfony/validator/Constraints/Email.php | 79 ++ .../validator/Constraints/EmailValidator.php | 107 +++ .../Constraints/EnableAutoMapping.php | 46 ++ .../symfony/validator/Constraints/EqualTo.php | 31 + .../Constraints/EqualToValidator.php | 37 + .../validator/Constraints/Existence.php | 30 + .../validator/Constraints/Expression.php | 101 +++ .../Constraints/ExpressionLanguageSyntax.php | 51 ++ .../ExpressionLanguageSyntaxValidator.php | 60 ++ .../Constraints/ExpressionValidator.php | 61 ++ .../symfony/validator/Constraints/File.php | 174 ++++ .../validator/Constraints/FileValidator.php | 252 ++++++ .../validator/Constraints/GreaterThan.php | 31 + .../Constraints/GreaterThanOrEqual.php | 31 + .../GreaterThanOrEqualValidator.php | 37 + .../Constraints/GreaterThanValidator.php | 37 + .../validator/Constraints/GroupSequence.php | 90 ++ .../Constraints/GroupSequenceProvider.php | 25 + .../validator/Constraints/Hostname.php | 46 ++ .../Constraints/HostnameValidator.php | 69 ++ .../symfony/validator/Constraints/Iban.php | 49 ++ .../validator/Constraints/IbanValidator.php | 259 ++++++ .../validator/Constraints/IdenticalTo.php | 31 + .../Constraints/IdenticalToValidator.php | 37 + .../symfony/validator/Constraints/Image.php | 193 +++++ .../validator/Constraints/ImageValidator.php | 237 ++++++ .../symfony/validator/Constraints/Ip.php | 104 +++ .../validator/Constraints/IpValidator.php | 107 +++ .../symfony/validator/Constraints/IsFalse.php | 39 + .../Constraints/IsFalseValidator.php | 41 + .../symfony/validator/Constraints/IsNull.php | 39 + .../validator/Constraints/IsNullValidator.php | 39 + .../symfony/validator/Constraints/IsTrue.php | 39 + .../validator/Constraints/IsTrueValidator.php | 43 + .../symfony/validator/Constraints/Isbn.php | 86 ++ .../validator/Constraints/IsbnValidator.php | 184 +++++ .../symfony/validator/Constraints/Isin.php | 46 ++ .../validator/Constraints/IsinValidator.php | 81 ++ .../symfony/validator/Constraints/Issn.php | 60 ++ .../validator/Constraints/IssnValidator.php | 131 +++ .../symfony/validator/Constraints/Json.php | 39 + .../validator/Constraints/JsonValidator.php | 51 ++ .../validator/Constraints/Language.php | 52 ++ .../Constraints/LanguageValidator.php | 53 ++ .../symfony/validator/Constraints/Length.php | 105 +++ .../validator/Constraints/LengthValidator.php | 96 +++ .../validator/Constraints/LessThan.php | 31 + .../validator/Constraints/LessThanOrEqual.php | 31 + .../Constraints/LessThanOrEqualValidator.php | 37 + .../Constraints/LessThanValidator.php | 37 + .../symfony/validator/Constraints/Locale.php | 52 ++ .../validator/Constraints/LocaleValidator.php | 57 ++ .../symfony/validator/Constraints/Luhn.php | 49 ++ .../validator/Constraints/LuhnValidator.php | 96 +++ .../validator/Constraints/Negative.php | 26 + .../validator/Constraints/NegativeOrZero.php | 26 + .../validator/Constraints/NotBlank.php | 49 ++ .../Constraints/NotBlankValidator.php | 48 ++ .../Constraints/NotCompromisedPassword.php | 49 ++ .../NotCompromisedPasswordValidator.php | 105 +++ .../validator/Constraints/NotEqualTo.php | 31 + .../Constraints/NotEqualToValidator.php | 37 + .../validator/Constraints/NotIdenticalTo.php | 31 + .../Constraints/NotIdenticalToValidator.php | 37 + .../symfony/validator/Constraints/NotNull.php | 39 + .../Constraints/NotNullValidator.php | 39 + .../Constraints/NumberConstraintTrait.php | 45 + .../validator/Constraints/Optional.php | 22 + .../validator/Constraints/Positive.php | 26 + .../validator/Constraints/PositiveOrZero.php | 26 + .../symfony/validator/Constraints/Range.php | 120 +++ .../validator/Constraints/RangeValidator.php | 211 +++++ .../symfony/validator/Constraints/Regex.php | 135 +++ .../validator/Constraints/RegexValidator.php | 57 ++ .../validator/Constraints/Required.php | 22 + .../validator/Constraints/Sequentially.php | 52 ++ .../Constraints/SequentiallyValidator.php | 44 + .../symfony/validator/Constraints/Time.php | 45 + .../validator/Constraints/TimeValidator.php | 71 ++ .../validator/Constraints/Timezone.php | 89 ++ .../Constraints/TimezoneValidator.php | 124 +++ .../validator/Constraints/Traverse.php | 54 ++ .../symfony/validator/Constraints/Type.php | 67 ++ .../validator/Constraints/TypeValidator.php | 87 ++ .../symfony/validator/Constraints/Ulid.php | 48 ++ .../validator/Constraints/UlidValidator.php | 69 ++ .../symfony/validator/Constraints/Unique.php | 51 ++ .../validator/Constraints/UniqueValidator.php | 68 ++ .../symfony/validator/Constraints/Url.php | 57 ++ .../validator/Constraints/UrlValidator.php | 86 ++ .../symfony/validator/Constraints/Uuid.php | 111 +++ .../validator/Constraints/UuidValidator.php | 258 ++++++ .../symfony/validator/Constraints/Valid.php | 46 ++ .../validator/Constraints/ValidValidator.php | 38 + .../ZeroComparisonConstraintTrait.php | 45 + .../ContainerConstraintValidatorFactory.php | 62 ++ .../validator/Context/ExecutionContext.php | 372 +++++++++ .../Context/ExecutionContextFactory.php | 47 ++ .../ExecutionContextFactoryInterface.php | 35 + .../Context/ExecutionContextInterface.php | 339 ++++++++ .../DataCollector/ValidatorDataCollector.php | 108 +++ .../AddAutoMappingConfigurationPass.php | 100 +++ .../AddConstraintValidatorsPass.php | 60 ++ .../AddValidatorInitializersPass.php | 50 ++ .../Exception/BadMethodCallException.php | 21 + .../ConstraintDefinitionException.php | 16 + .../Exception/ExceptionInterface.php | 21 + .../Exception/GroupDefinitionException.php | 16 + .../Exception/InvalidArgumentException.php | 21 + .../Exception/InvalidOptionsException.php | 29 + .../validator/Exception/LogicException.php | 16 + .../validator/Exception/MappingException.php | 16 + .../Exception/MissingOptionsException.php | 29 + .../Exception/NoSuchMetadataException.php | 19 + .../Exception/OutOfBoundsException.php | 21 + .../validator/Exception/RuntimeException.php | 21 + .../Exception/UnexpectedTypeException.php | 20 + .../Exception/UnexpectedValueException.php | 32 + .../UnsupportedMetadataException.php | 19 + .../Exception/ValidationFailedException.php | 40 + .../Exception/ValidatorException.php | 16 + .../GroupSequenceProviderInterface.php | 28 + .../storage/vendor/symfony/validator/LICENSE | 19 + .../validator/Mapping/AutoMappingStrategy.php | 42 + .../validator/Mapping/CascadingStrategy.php | 52 ++ .../validator/Mapping/ClassMetadata.php | 513 ++++++++++++ .../Mapping/ClassMetadataInterface.php | 100 +++ .../Factory/BlackHoleMetadataFactory.php | 42 + .../Factory/LazyLoadingMetadataFactory.php | 165 ++++ .../Factory/MetadataFactoryInterface.php | 43 + .../validator/Mapping/GenericMetadata.php | 240 ++++++ .../validator/Mapping/GetterMetadata.php | 80 ++ .../Mapping/Loader/AbstractLoader.php | 85 ++ .../Mapping/Loader/AnnotationLoader.php | 123 +++ .../Mapping/Loader/AutoMappingTrait.php | 34 + .../validator/Mapping/Loader/FileLoader.php | 51 ++ .../validator/Mapping/Loader/FilesLoader.php | 57 ++ .../validator/Mapping/Loader/LoaderChain.php | 67 ++ .../Mapping/Loader/LoaderInterface.php | 29 + .../Mapping/Loader/PropertyInfoLoader.php | 179 ++++ .../Mapping/Loader/StaticMethodLoader.php | 66 ++ .../Mapping/Loader/XmlFileLoader.php | 231 ++++++ .../Mapping/Loader/XmlFilesLoader.php | 31 + .../Mapping/Loader/YamlFileLoader.php | 189 +++++ .../Mapping/Loader/YamlFilesLoader.php | 31 + .../constraint-mapping-1.0.xsd | 160 ++++ .../validator/Mapping/MemberMetadata.php | 194 +++++ .../validator/Mapping/MetadataInterface.php | 66 ++ .../validator/Mapping/PropertyMetadata.php | 93 +++ .../Mapping/PropertyMetadataInterface.php | 47 ++ .../validator/Mapping/TraversalStrategy.php | 55 ++ .../validator/ObjectInitializerInterface.php | 26 + .../vendor/symfony/validator/README.md | 16 + .../Resources/translations/validators.af.xlf | 387 +++++++++ .../Resources/translations/validators.ar.xlf | 407 +++++++++ .../Resources/translations/validators.az.xlf | 391 +++++++++ .../Resources/translations/validators.be.xlf | 407 +++++++++ .../Resources/translations/validators.bg.xlf | 407 +++++++++ .../Resources/translations/validators.bs.xlf | 407 +++++++++ .../Resources/translations/validators.ca.xlf | 407 +++++++++ .../Resources/translations/validators.cs.xlf | 407 +++++++++ .../Resources/translations/validators.cy.xlf | 335 ++++++++ .../Resources/translations/validators.da.xlf | 407 +++++++++ .../Resources/translations/validators.de.xlf | 407 +++++++++ .../Resources/translations/validators.el.xlf | 407 +++++++++ .../Resources/translations/validators.en.xlf | 407 +++++++++ .../Resources/translations/validators.es.xlf | 407 +++++++++ .../Resources/translations/validators.et.xlf | 407 +++++++++ .../Resources/translations/validators.eu.xlf | 395 +++++++++ .../Resources/translations/validators.fa.xlf | 407 +++++++++ .../Resources/translations/validators.fi.xlf | 407 +++++++++ .../Resources/translations/validators.fr.xlf | 407 +++++++++ .../Resources/translations/validators.gl.xlf | 407 +++++++++ .../Resources/translations/validators.he.xlf | 391 +++++++++ .../Resources/translations/validators.hr.xlf | 407 +++++++++ .../Resources/translations/validators.hu.xlf | 407 +++++++++ .../Resources/translations/validators.hy.xlf | 395 +++++++++ .../Resources/translations/validators.id.xlf | 407 +++++++++ .../Resources/translations/validators.it.xlf | 407 +++++++++ .../Resources/translations/validators.ja.xlf | 407 +++++++++ .../Resources/translations/validators.lb.xlf | 391 +++++++++ .../Resources/translations/validators.lt.xlf | 407 +++++++++ .../Resources/translations/validators.lv.xlf | 407 +++++++++ .../Resources/translations/validators.mn.xlf | 391 +++++++++ .../Resources/translations/validators.my.xlf | 395 +++++++++ .../Resources/translations/validators.nb.xlf | 391 +++++++++ .../Resources/translations/validators.nl.xlf | 407 +++++++++ .../Resources/translations/validators.nn.xlf | 391 +++++++++ .../Resources/translations/validators.no.xlf | 391 +++++++++ .../Resources/translations/validators.pl.xlf | 407 +++++++++ .../Resources/translations/validators.pt.xlf | 407 +++++++++ .../translations/validators.pt_BR.xlf | 407 +++++++++ .../Resources/translations/validators.ro.xlf | 403 +++++++++ .../Resources/translations/validators.ru.xlf | 407 +++++++++ .../Resources/translations/validators.sk.xlf | 407 +++++++++ .../Resources/translations/validators.sl.xlf | 407 +++++++++ .../Resources/translations/validators.sq.xlf | 391 +++++++++ .../translations/validators.sr_Cyrl.xlf | 407 +++++++++ .../translations/validators.sr_Latn.xlf | 407 +++++++++ .../Resources/translations/validators.sv.xlf | 407 +++++++++ .../Resources/translations/validators.th.xlf | 407 +++++++++ .../Resources/translations/validators.tl.xlf | 399 +++++++++ .../Resources/translations/validators.tr.xlf | 407 +++++++++ .../Resources/translations/validators.uk.xlf | 407 +++++++++ .../Resources/translations/validators.uz.xlf | 407 +++++++++ .../Resources/translations/validators.vi.xlf | 407 +++++++++ .../translations/validators.zh_CN.xlf | 407 +++++++++ .../translations/validators.zh_TW.xlf | 407 +++++++++ .../Test/ConstraintValidatorTestCase.php | 584 +++++++++++++ .../symfony/validator/Util/PropertyPath.php | 53 ++ .../vendor/symfony/validator/Validation.php | 96 +++ .../ContextualValidatorInterface.php | 80 ++ .../validator/Validator/LazyProperty.php | 32 + .../RecursiveContextualValidator.php | 782 ++++++++++++++++++ .../Validator/RecursiveValidator.php | 117 +++ .../Validator/TraceableValidator.php | 136 +++ .../Validator/ValidatorInterface.php | 91 ++ .../symfony/validator/ValidatorBuilder.php | 444 ++++++++++ .../Violation/ConstraintViolationBuilder.php | 174 ++++ .../ConstraintViolationBuilderInterface.php | 114 +++ .../vendor/symfony/validator/composer.json | 80 ++ 271 files changed, 40873 insertions(+) create mode 100644 upload/system/storage/vendor/symfony/validator/CHANGELOG.md create mode 100644 upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraint.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactoryInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintViolation.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php create mode 100644 upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/All.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Bic.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Blank.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Callback.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Choice.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Collection.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Composite.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Compound.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Count.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Country.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Currency.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Date.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Email.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/EqualToValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Existence.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Expression.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/File.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Iban.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IdenticalToValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Image.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Ip.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Isin.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Issn.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Json.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Language.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Length.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Locale.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Negative.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotEqualToValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalToValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Optional.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Positive.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Range.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Regex.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Required.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Time.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Type.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Unique.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Url.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Valid.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php create mode 100644 upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php create mode 100644 upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php create mode 100644 upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php create mode 100644 upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php create mode 100644 upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/BadMethodCallException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/ConstraintDefinitionException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/GroupDefinitionException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/InvalidArgumentException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/LogicException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/MappingException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/NoSuchMetadataException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/OutOfBoundsException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/RuntimeException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/UnsupportedMetadataException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php create mode 100644 upload/system/storage/vendor/symfony/validator/Exception/ValidatorException.php create mode 100644 upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/LICENSE create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php create mode 100644 upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/README.md create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf create mode 100644 upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php create mode 100644 upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validation.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php create mode 100644 upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php create mode 100644 upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/composer.json diff --git a/upload/system/storage/vendor/symfony/validator/CHANGELOG.md b/upload/system/storage/vendor/symfony/validator/CHANGELOG.md new file mode 100644 index 00000000000..35f7a3e0e1a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/CHANGELOG.md @@ -0,0 +1,355 @@ +CHANGELOG +========= + +5.4 +--- + + * Add a `Cidr` constraint to validate CIDR notations + * Add a `CssColor` constraint to validate CSS colors + * Add support for `ConstraintViolationList::createFromMessage()` + * Add error's uid to `Count` and `Length` constraints with "exactly" option enabled + +5.3 +--- + + * Add the `normalizer` option to the `Unique` constraint + * Add `Validation::createIsValidCallable()` that returns true/false instead of throwing exceptions + +5.2.0 +----- + + * added a `Cascade` constraint to ease validating nested typed object properties + * deprecated the `allowEmptyString` option of the `Length` constraint + + Before: + + ```php + use Symfony\Component\Validator\Constraints as Assert; + + /** + * @Assert\Length(min=5, allowEmptyString=true) + */ + ``` + + After: + + ```php + use Symfony\Component\Validator\Constraints as Assert; + + /** + * @Assert\AtLeastOneOf({ + * @Assert\Blank(), + * @Assert\Length(min=5) + * }) + */ + ``` + * added the `Isin` constraint and validator + * added the `ULID` constraint and validator + * added support for UUIDv6 in `Uuid` constraint + * enabled the validator to load constraints from PHP attributes + * deprecated the `NumberConstraintTrait` trait + * deprecated setting or creating a Doctrine annotation reader via `ValidatorBuilder::enableAnnotationMapping()`, pass `true` as first parameter and additionally call `setDoctrineAnnotationReader()` or `addDefaultDoctrineAnnotationReader()` to set up the annotation reader + +5.1.0 +----- + + * added the `Hostname` constraint and validator + * added the `alpha3` option to the `Country` and `Language` constraints + * allow to define a reusable set of constraints by extending the `Compound` constraint + * added `Sequentially` constraint, to sequentially validate a set of constraints (any violation raised will prevent further validation of the nested constraints) + * added the `divisibleBy` option to the `Count` constraint + * added the `ExpressionLanguageSyntax` constraint + +5.0.0 +----- + + * an `ExpressionLanguage` instance or null must be passed as the first argument of `ExpressionValidator::__construct()` + * removed the `checkDNS` and `dnsMessage` options of the `Url` constraint + * removed the `checkMX`, `checkHost` and `strict` options of the `Email` constraint + * removed support for validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator` + * removed support for using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl` + * removed support for using the `Email` constraint without `egulias/email-validator` + * removed support for using the `Expression` constraint without `symfony/expression-language` + * changed default value of `canonicalize` option of `Locale` constraint to `true` + * removed `ValidatorBuilderInterface` + * passing a null message when instantiating a `ConstraintViolation` is not allowed + * changed the default value of `Length::$allowEmptyString` to `false` and made it optional + * removed `Symfony\Component\Validator\Mapping\Cache\CacheInterface` in favor of PSR-6. + * removed `ValidatorBuilder::setMetadataCache`, use `ValidatorBuilder::setMappingCache` instead. + +4.4.0 +----- + + * [BC BREAK] using null as `$classValidatorRegexp` value in `PropertyInfoLoader::__construct` will not enable auto-mapping for all classes anymore, use `'{.*}'` instead. + * added `EnableAutoMapping` and `DisableAutoMapping` constraints to enable or disable auto mapping for class or a property + * using anything else than a `string` as the code of a `ConstraintViolation` is deprecated, a `string` type-hint will + be added to the constructor of the `ConstraintViolation` class and to the `ConstraintViolationBuilder::setCode()` + method in 5.0 + * deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`. Pass it as the first argument instead. + * added the `compared_value_path` parameter in violations when using any + comparison constraint with the `propertyPath` option. + * added support for checking an array of types in `TypeValidator` + * added a new `allowEmptyString` option to the `Length` constraint to allow rejecting empty strings when `min` is set, by setting it to `false`. + * Added new `minPropertyPath` and `maxPropertyPath` options + to `Range` constraint in order to get the value to compare + from an array or object + * added the `min_limit_path` and `max_limit_path` parameters in violations when using + `Range` constraint with respectively the `minPropertyPath` and + `maxPropertyPath` options + * added a new `notInRangeMessage` option to the `Range` constraint that will + be used in the violation builder when both `min` and `max` are not null + * added ability to use stringable objects as violation messages + * Overriding the methods `ConstraintValidatorTestCase::setUp()` and `ConstraintValidatorTestCase::tearDown()` without the `void` return-type is deprecated. + * deprecated `Symfony\Component\Validator\Mapping\Cache\CacheInterface` in favor of PSR-6. + * deprecated `ValidatorBuilder::setMetadataCache`, use `ValidatorBuilder::setMappingCache` instead. + * Marked the `ValidatorDataCollector` class as `@final`. + +4.3.0 +----- + + * added `Timezone` constraint + * added `NotCompromisedPassword` constraint + * added options `iban` and `ibanPropertyPath` to Bic constraint + * added UATP cards support to `CardSchemeValidator` + * added option `allowNull` to NotBlank constraint + * added `Json` constraint + * added `Unique` constraint + * added a new `normalizer` option to the string constraints and to the `NotBlank` constraint + * added `Positive` constraint + * added `PositiveOrZero` constraint + * added `Negative` constraint + * added `NegativeOrZero` constraint + +4.2.0 +----- + + * added a new `UnexpectedValueException` that can be thrown by constraint validators, these exceptions are caught by + the validator and are converted into constraint violations + * added `DivisibleBy` constraint + * decoupled from `symfony/translation` by using `Symfony\Contracts\Translation\TranslatorInterface` + * deprecated `ValidatorBuilderInterface` + * made `ValidatorBuilder::setTranslator()` final + * marked `format` the default option in `DateTime` constraint + * deprecated validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator`. + * deprecated using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl` + * deprecated using the `Email` constraint without `egulias/email-validator` + * deprecated using the `Expression` constraint without `symfony/expression-language` + +4.1.0 +----- + + * Deprecated the `checkDNS` and `dnsMessage` options of the `Url` constraint. + * added a `values` option to the `Expression` constraint + * Deprecated use of `Locale` constraint without setting `true` at "canonicalize" option, which will be the default value in 5.0 + +4.0.0 +----- + + * Setting the `strict` option of the `Choice` constraint to anything but `true` + is not supported anymore. + * removed the `DateTimeValidator::PATTERN` constant + * removed the `AbstractConstraintValidatorTest` class + * removed support for setting the `checkDNS` option of the `Url` constraint to `true` + +3.4.0 +----- + + * added support for validation groups to the `Valid` constraint + * not setting the `strict` option of the `Choice` constraint to `true` is + deprecated and will throw an exception in Symfony 4.0 + * setting the `checkDNS` option of the `Url` constraint to `true` is deprecated in favor of + the `Url::CHECK_DNS_TYPE_*` constants values and will throw an exception in Symfony 4.0 + * added min/max amount of pixels check to `Image` constraint via `minPixels` and `maxPixels` + * added a new "propertyPath" option to comparison constraints in order to get the value to compare from an array or object + +3.3.0 +----- + + * added `AddValidatorInitializersPass` + * added `AddConstraintValidatorsPass` + * added `ContainerConstraintValidatorFactory` + +3.2.0 +----- + + * deprecated `Tests\Constraints\AbstractConstraintValidatorTest` in favor of `Test\ConstraintValidatorTestCase` + * added support for PHP constants in YAML configuration files + +3.1.0 +----- + + * deprecated `DateTimeValidator::PATTERN` constant + * added a `format` option to the `DateTime` constraint + +2.8.0 +----- + + * added the BIC (SWIFT-Code) validator + +2.7.0 +----- + + * deprecated `DefaultTranslator` in favor of `Symfony\Component\Translation\IdentityTranslator` + * deprecated PHP7-incompatible constraints (Null, True, False) and related validators (NullValidator, TrueValidator, FalseValidator) in favor of their `Is`-prefixed equivalent + +2.6.0 +----- + + * [BC BREAK] `FileValidator` disallow empty files + * [BC BREAK] `UserPasswordValidator` source message change + * [BC BREAK] added internal `ExecutionContextInterface::setConstraint()` + * added `ConstraintViolation::getConstraint()` + * [BC BREAK] The `ExpressionValidator` will now evaluate the Expression even when the property value is null or an empty string + * deprecated `ClassMetadata::hasMemberMetadatas()` + * deprecated `ClassMetadata::getMemberMetadatas()` + * deprecated `ClassMetadata::addMemberMetadata()` + * [BC BREAK] added `Mapping\MetadataInterface::getConstraints()` + * added generic "payload" option to all constraints for attaching domain-specific data + * [BC BREAK] added `ConstraintViolationBuilderInterface::setCause()` + +2.5.0 +----- + + * deprecated `ApcCache` in favor of `DoctrineCache` + * added `DoctrineCache` to adapt any Doctrine cache + * `GroupSequence` now implements `ArrayAccess`, `Countable` and `Traversable` + * [BC BREAK] changed `ClassMetadata::getGroupSequence()` to return a `GroupSequence` instance instead of an array + * `Callback` can now be put onto properties (useful when you pass a closure to the constraint) + * deprecated `ClassBasedInterface` + * deprecated `MetadataInterface` + * deprecated `PropertyMetadataInterface` + * deprecated `PropertyMetadataContainerInterface` + * deprecated `Mapping\ElementMetadata` + * added `Mapping\MetadataInterface` + * added `Mapping\ClassMetadataInterface` + * added `Mapping\PropertyMetadataInterface` + * added `Mapping\GenericMetadata` + * added `Mapping\CascadingStrategy` + * added `Mapping\TraversalStrategy` + * deprecated `Mapping\ClassMetadata::accept()` + * deprecated `Mapping\MemberMetadata::accept()` + * removed array type hint of `Mapping\ClassMetadata::setGroupSequence()` + * deprecated `MetadataFactoryInterface` + * deprecated `Mapping\BlackholeMetadataFactory` + * deprecated `Mapping\ClassMetadataFactory` + * added `Mapping\Factory\MetadataFactoryInterface` + * added `Mapping\Factory\BlackHoleMetadataFactory` + * added `Mapping\Factory\LazyLoadingMetadataFactory` + * deprecated `ExecutionContextInterface` + * deprecated `ExecutionContext` + * deprecated `GlobalExecutionContextInterface` + * added `Context\ExecutionContextInterface` + * added `Context\ExecutionContext` + * added `Context\ExecutionContextFactoryInterface` + * added `Context\ExecutionContextFactory` + * deprecated `ValidatorInterface` + * deprecated `Validator` + * deprecated `ValidationVisitorInterface` + * deprecated `ValidationVisitor` + * added `Validator\ValidatorInterface` + * added `Validator\RecursiveValidator` + * added `Validator\ContextualValidatorInterface` + * added `Validator\RecursiveContextualValidator` + * added `Violation\ConstraintViolationBuilderInterface` + * added `Violation\ConstraintViolationBuilder` + * added `ConstraintViolation::getParameters()` + * added `ConstraintViolation::getPlural()` + * added `Constraints\Traverse` + * deprecated `$deep` property in `Constraints\Valid` + * added `ValidatorBuilderInterface::setApiVersion()` + * added `Validation::API_VERSION_2_4` + * added `Validation::API_VERSION_2_5` + * added `Exception\OutOfBoundsException` + * added `Exception\UnsupportedMetadataException` + * made `Exception\ValidatorException` extend `Exception\RuntimeException` + * added `Util\PropertyPath` + * made the PropertyAccess component an optional dependency + * deprecated `ValidatorBuilder::setPropertyAccessor()` + * deprecated `validate` and `validateValue` on `Validator\Context\ExecutionContext` use `getValidator()` together with `inContext()` instead + +2.4.0 +----- + + * added a constraint the uses the expression language + * added `minRatio`, `maxRatio`, `allowSquare`, `allowLandscape`, and `allowPortrait` to Image validator + +2.3.29 +------ + + * fixed compatibility with PHP7 and up by introducing new constraints (IsNull, IsTrue, IsFalse) and related validators (IsNullValidator, IsTrueValidator, IsFalseValidator) + +2.3.0 +----- + + * added the ISBN, ISSN, and IBAN validators + * copied the constraints `Optional` and `Required` to the + `Symfony\Component\Validator\Constraints\` namespace and deprecated the original + classes. + * added comparison validators (EqualTo, NotEqualTo, LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, IdenticalTo, NotIdenticalTo) + +2.2.0 +----- + + * added a CardScheme validator + * added a Luhn validator + * moved @api-tags from `Validator` to `ValidatorInterface` + * moved @api-tags from `ConstraintViolation` to the new `ConstraintViolationInterface` + * moved @api-tags from `ConstraintViolationList` to the new `ConstraintViolationListInterface` + * moved @api-tags from `ExecutionContext` to the new `ExecutionContextInterface` + * [BC BREAK] `ConstraintValidatorInterface::initialize` is now type hinted against `ExecutionContextInterface` instead of `ExecutionContext` + * [BC BREAK] changed the visibility of the properties in `Validator` from protected to private + * deprecated `ClassMetadataFactoryInterface` in favor of the new `MetadataFactoryInterface` + * deprecated `ClassMetadataFactory::getClassMetadata` in favor of `getMetadataFor` + * created `MetadataInterface`, `PropertyMetadataInterface`, `ClassBasedInterface` and `PropertyMetadataContainerInterface` + * deprecated `GraphWalker` in favor of the new `ValidationVisitorInterface` + * deprecated `ExecutionContext::addViolationAtPath` + * deprecated `ExecutionContext::addViolationAtSubPath` in favor of `ExecutionContextInterface::addViolationAt` + * deprecated `ExecutionContext::getCurrentClass` in favor of `ExecutionContextInterface::getClassName` + * deprecated `ExecutionContext::getCurrentProperty` in favor of `ExecutionContextInterface::getPropertyName` + * deprecated `ExecutionContext::getCurrentValue` in favor of `ExecutionContextInterface::getValue` + * deprecated `ExecutionContext::getGraphWalker` in favor of `ExecutionContextInterface::validate` and `ExecutionContextInterface::validateValue` + * improved `ValidatorInterface::validateValue` to accept arrays of constraints + * changed `ValidatorInterface::getMetadataFactory` to return a `MetadataFactoryInterface` instead of a `ClassMetadataFactoryInterface` + * removed `ClassMetadataFactoryInterface` type hint from `ValidatorBuilderInterface::setMetadataFactory`. + As of Symfony 2.3, this method will be typed against `MetadataFactoryInterface` instead. + * [BC BREAK] the switches `traverse` and `deep` in the `Valid` constraint and in `GraphWalker::walkReference` + are ignored for arrays now. Arrays are always traversed recursively. + * added dependency to Translation component + * violation messages are now translated with a TranslatorInterface implementation + * [BC BREAK] inserted argument `$message` in the constructor of `ConstraintViolation` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `ExecutionContext` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `GraphWalker` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `ValidationVisitor` + * [BC BREAK] inserted arguments `$translator` and `$translationDomain` in the constructor of `Validator` + * [BC BREAK] added `setTranslator()` and `setTranslationDomain()` to `ValidatorBuilderInterface` + * improved the Validator to support pluralized messages by default + * [BC BREAK] changed the source of all pluralized messages in the translation files to the pluralized version + * added ExceptionInterface, BadMethodCallException and InvalidArgumentException + +2.1.0 +----- + + * added support for `ctype_*` assertions in `TypeValidator` + * improved the ImageValidator with min width, max width, min height, and max height constraints + * added support for MIME with wildcard in FileValidator + * changed Collection validator to add "missing" and "extra" errors to + individual fields + * changed default value for `extraFieldsMessage` and `missingFieldsMessage` + in Collection constraint + * made ExecutionContext immutable + * deprecated Constraint methods `setMessage`, `getMessageTemplate` and + `getMessageParameters` + * added support for dynamic group sequences with the GroupSequenceProvider pattern + * [BC BREAK] ConstraintValidatorInterface method `isValid` has been renamed to + `validate`, its return value was dropped. ConstraintValidator still contains + `isValid` for BC + * [BC BREAK] collections in fields annotated with `Valid` are not traversed + recursively anymore by default. `Valid` contains a new property `deep` + which enables the BC behavior. + * added Count constraint + * added Length constraint + * added Range constraint + * deprecated the Min and Max constraints + * deprecated the MinLength and MaxLength constraints + * added Validation and ValidatorBuilderInterface + * deprecated ValidatorContext, ValidatorContextInterface and ValidatorFactory diff --git a/upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php b/upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php new file mode 100644 index 00000000000..ad0ebba0213 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php @@ -0,0 +1,203 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Command; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\Dumper; +use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Finder\Exception\DirectoryNotFoundException; +use Symfony\Component\Finder\Finder; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Mapping\ClassMetadataInterface; +use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; + +/** + * A console command to debug Validators information. + * + * @author Loïc Frémont + */ +class DebugCommand extends Command +{ + protected static $defaultName = 'debug:validator'; + protected static $defaultDescription = 'Display validation constraints for classes'; + + private $validator; + + public function __construct(MetadataFactoryInterface $validator) + { + parent::__construct(); + + $this->validator = $validator; + } + + protected function configure() + { + $this + ->addArgument('class', InputArgument::REQUIRED, 'A fully qualified class name or a path') + ->addOption('show-all', null, InputOption::VALUE_NONE, 'Show all classes even if they have no validation constraints') + ->setDescription(self::$defaultDescription) + ->setHelp(<<<'EOF' +The %command.name% 'App\Entity\Dummy' command dumps the validators for the dummy class. + +The %command.name% src/ command dumps the validators for the `src` directory. +EOF + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $class = $input->getArgument('class'); + + if (class_exists($class)) { + $this->dumpValidatorsForClass($input, $output, $class); + + return 0; + } + + try { + foreach ($this->getResourcesByPath($class) as $class) { + $this->dumpValidatorsForClass($input, $output, $class); + } + } catch (DirectoryNotFoundException $exception) { + $io = new SymfonyStyle($input, $output); + $io->error(sprintf('Neither class nor path were found with "%s" argument.', $input->getArgument('class'))); + + return 1; + } + + return 0; + } + + private function dumpValidatorsForClass(InputInterface $input, OutputInterface $output, string $class): void + { + $io = new SymfonyStyle($input, $output); + $title = sprintf('%s', $class); + $rows = []; + $dump = new Dumper($output); + + foreach ($this->getConstrainedPropertiesData($class) as $propertyName => $constraintsData) { + foreach ($constraintsData as $data) { + $rows[] = [ + $propertyName, + $data['class'], + implode(', ', $data['groups']), + $dump($data['options']), + ]; + } + } + + if (!$rows) { + if (false === $input->getOption('show-all')) { + return; + } + + $io->section($title); + $io->text('No validators were found for this class.'); + + return; + } + + $io->section($title); + + $table = new Table($output); + $table->setHeaders(['Property', 'Name', 'Groups', 'Options']); + $table->setRows($rows); + $table->setColumnMaxWidth(3, 80); + $table->render(); + } + + private function getConstrainedPropertiesData(string $class): array + { + $data = []; + + /** @var ClassMetadataInterface $classMetadata */ + $classMetadata = $this->validator->getMetadataFor($class); + + foreach ($classMetadata->getConstrainedProperties() as $constrainedProperty) { + $data[$constrainedProperty] = $this->getPropertyData($classMetadata, $constrainedProperty); + } + + return $data; + } + + private function getPropertyData(ClassMetadataInterface $classMetadata, string $constrainedProperty): array + { + $data = []; + + $propertyMetadata = $classMetadata->getPropertyMetadata($constrainedProperty); + foreach ($propertyMetadata as $metadata) { + foreach ($metadata->getConstraints() as $constraint) { + $data[] = [ + 'class' => \get_class($constraint), + 'groups' => $constraint->groups, + 'options' => $this->getConstraintOptions($constraint), + ]; + } + } + + return $data; + } + + private function getConstraintOptions(Constraint $constraint): array + { + $options = []; + + foreach (array_keys(get_object_vars($constraint)) as $propertyName) { + // Groups are dumped on a specific column. + if ('groups' === $propertyName) { + continue; + } + + $options[$propertyName] = $constraint->$propertyName; + } + + ksort($options); + + return $options; + } + + private function getResourcesByPath(string $path): array + { + $finder = new Finder(); + $finder->files()->in($path)->name('*.php')->sortByName(true); + $classes = []; + + foreach ($finder as $file) { + $fileContent = file_get_contents($file->getRealPath()); + + preg_match('/namespace (.+);/', $fileContent, $matches); + + $namespace = $matches[1] ?? null; + + if (!preg_match('/class +([^{ ]+)/', $fileContent, $matches)) { + // no class found + continue; + } + + $className = trim($matches[1]); + + if (null !== $namespace) { + $classes[] = $namespace.'\\'.$className; + } else { + $classes[] = $className; + } + } + + return $classes; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraint.php b/upload/system/storage/vendor/symfony/validator/Constraint.php new file mode 100644 index 00000000000..27ddcb88913 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraint.php @@ -0,0 +1,313 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\InvalidArgumentException; +use Symfony\Component\Validator\Exception\InvalidOptionsException; +use Symfony\Component\Validator\Exception\MissingOptionsException; + +/** + * Contains the properties of a constraint definition. + * + * A constraint can be defined on a class, a property or a getter method. + * The Constraint class encapsulates all the configuration required for + * validating this class, property or getter result successfully. + * + * Constraint instances are immutable and serializable. + * + * @author Bernhard Schussek + */ +abstract class Constraint +{ + /** + * The name of the group given to all constraints with no explicit group. + */ + public const DEFAULT_GROUP = 'Default'; + + /** + * Marks a constraint that can be put onto classes. + */ + public const CLASS_CONSTRAINT = 'class'; + + /** + * Marks a constraint that can be put onto properties. + */ + public const PROPERTY_CONSTRAINT = 'property'; + + /** + * Maps error codes to the names of their constants. + */ + protected static $errorNames = []; + + /** + * Domain-specific data attached to a constraint. + * + * @var mixed + */ + public $payload; + + /** + * The groups that the constraint belongs to. + * + * @var string[] + */ + public $groups; + + /** + * Returns the name of the given error code. + * + * @return string + * + * @throws InvalidArgumentException If the error code does not exist + */ + public static function getErrorName(string $errorCode) + { + if (!isset(static::$errorNames[$errorCode])) { + throw new InvalidArgumentException(sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, static::class)); + } + + return static::$errorNames[$errorCode]; + } + + /** + * Initializes the constraint with options. + * + * You should pass an associative array. The keys should be the names of + * existing properties in this class. The values should be the value for these + * properties. + * + * Alternatively you can override the method getDefaultOption() to return the + * name of an existing property. If no associative array is passed, this + * property is set instead. + * + * You can force that certain options are set by overriding + * getRequiredOptions() to return the names of these options. If any + * option is not set here, an exception is thrown. + * + * @param mixed $options The options (as associative array) + * or the value for the default + * option (any other type) + * @param string[] $groups An array of validation groups + * @param mixed $payload Domain-specific data attached to a constraint + * + * @throws InvalidOptionsException When you pass the names of non-existing + * options + * @throws MissingOptionsException When you don't pass any of the options + * returned by getRequiredOptions() + * @throws ConstraintDefinitionException When you don't pass an associative + * array, but getDefaultOption() returns + * null + */ + public function __construct($options = null, array $groups = null, $payload = null) + { + unset($this->groups); // enable lazy initialization + + $options = $this->normalizeOptions($options); + if (null !== $groups) { + $options['groups'] = $groups; + } + $options['payload'] = $payload ?? $options['payload'] ?? null; + + foreach ($options as $name => $value) { + $this->$name = $value; + } + } + + protected function normalizeOptions($options): array + { + $normalizedOptions = []; + $defaultOption = $this->getDefaultOption(); + $invalidOptions = []; + $missingOptions = array_flip((array) $this->getRequiredOptions()); + $knownOptions = get_class_vars(static::class); + + if (\is_array($options) && isset($options['value']) && !property_exists($this, 'value')) { + if (null === $defaultOption) { + throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', static::class)); + } + + $options[$defaultOption] = $options['value']; + unset($options['value']); + } + + if (\is_array($options)) { + reset($options); + } + if ($options && \is_array($options) && \is_string(key($options))) { + foreach ($options as $option => $value) { + if (\array_key_exists($option, $knownOptions)) { + $normalizedOptions[$option] = $value; + unset($missingOptions[$option]); + } else { + $invalidOptions[] = $option; + } + } + } elseif (null !== $options && !(\is_array($options) && 0 === \count($options))) { + if (null === $defaultOption) { + throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', static::class)); + } + + if (\array_key_exists($defaultOption, $knownOptions)) { + $normalizedOptions[$defaultOption] = $options; + unset($missingOptions[$defaultOption]); + } else { + $invalidOptions[] = $defaultOption; + } + } + + if (\count($invalidOptions) > 0) { + throw new InvalidOptionsException(sprintf('The options "%s" do not exist in constraint "%s".', implode('", "', $invalidOptions), static::class), $invalidOptions); + } + + if (\count($missingOptions) > 0) { + throw new MissingOptionsException(sprintf('The options "%s" must be set for constraint "%s".', implode('", "', array_keys($missingOptions)), static::class), array_keys($missingOptions)); + } + + return $normalizedOptions; + } + + /** + * Sets the value of a lazily initialized option. + * + * Corresponding properties are added to the object on first access. Hence + * this method will be called at most once per constraint instance and + * option name. + * + * @param mixed $value The value to set + * + * @throws InvalidOptionsException If an invalid option name is given + */ + public function __set(string $option, $value) + { + if ('groups' === $option) { + $this->groups = (array) $value; + + return; + } + + throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]); + } + + /** + * Returns the value of a lazily initialized option. + * + * Corresponding properties are added to the object on first access. Hence + * this method will be called at most once per constraint instance and + * option name. + * + * @return mixed + * + * @throws InvalidOptionsException If an invalid option name is given + */ + public function __get(string $option) + { + if ('groups' === $option) { + $this->groups = [self::DEFAULT_GROUP]; + + return $this->groups; + } + + throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]); + } + + /** + * @return bool + */ + public function __isset(string $option) + { + return 'groups' === $option; + } + + /** + * Adds the given group if this constraint is in the Default group. + */ + public function addImplicitGroupName(string $group) + { + if (null === $this->groups && \array_key_exists('groups', (array) $this)) { + throw new \LogicException(sprintf('"%s::$groups" is set to null. Did you forget to call "%s::__construct()"?', static::class, self::class)); + } + + if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) { + $this->groups[] = $group; + } + } + + /** + * Returns the name of the default option. + * + * Override this method to define a default option. + * + * @return string|null + * + * @see __construct() + */ + public function getDefaultOption() + { + return null; + } + + /** + * Returns the name of the required options. + * + * Override this method if you want to define required options. + * + * @return string[] + * + * @see __construct() + */ + public function getRequiredOptions() + { + return []; + } + + /** + * Returns the name of the class that validates this constraint. + * + * By default, this is the fully qualified name of the constraint class + * suffixed with "Validator". You can override this method to change that + * behavior. + * + * @return string + */ + public function validatedBy() + { + return static::class.'Validator'; + } + + /** + * Returns whether the constraint can be put onto classes, properties or + * both. + * + * This method should return one or more of the constants + * Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT. + * + * @return string|string[] One or more constant values + */ + public function getTargets() + { + return self::PROPERTY_CONSTRAINT; + } + + /** + * Optimizes the serialized value to minimize storage space. + * + * @internal + */ + public function __sleep(): array + { + // Initialize "groups" option if it is not set + $this->groups; + + return array_keys(get_object_vars($this)); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintValidator.php b/upload/system/storage/vendor/symfony/validator/ConstraintValidator.php new file mode 100644 index 00000000000..1473c69353e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintValidator.php @@ -0,0 +1,159 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Symfony\Component\Validator\Context\ExecutionContextInterface; + +/** + * Base class for constraint validators. + * + * @author Bernhard Schussek + */ +abstract class ConstraintValidator implements ConstraintValidatorInterface +{ + /** + * Whether to format {@link \DateTime} objects, either with the {@link \IntlDateFormatter} + * (if it is available) or as RFC-3339 dates ("Y-m-d H:i:s"). + */ + public const PRETTY_DATE = 1; + + /** + * Whether to cast objects with a "__toString()" method to strings. + */ + public const OBJECT_TO_STRING = 2; + + /** + * @var ExecutionContextInterface + */ + protected $context; + + /** + * {@inheritdoc} + */ + public function initialize(ExecutionContextInterface $context) + { + $this->context = $context; + } + + /** + * Returns a string representation of the type of the value. + * + * This method should be used if you pass the type of a value as + * message parameter to a constraint violation. Note that such + * parameters should usually not be included in messages aimed at + * non-technical people. + * + * @param mixed $value The value to return the type of + * + * @return string + */ + protected function formatTypeOf($value) + { + return get_debug_type($value); + } + + /** + * Returns a string representation of the value. + * + * This method returns the equivalent PHP tokens for most scalar types + * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped + * in double quotes ("). Objects, arrays and resources are formatted as + * "object", "array" and "resource". If the $format bitmask contains + * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted + * with the {@link \IntlDateFormatter}. If it is not available, they will be + * formatted as RFC-3339 dates ("Y-m-d H:i:s"). + * + * Be careful when passing message parameters to a constraint violation + * that (may) contain objects, arrays or resources. These parameters + * should only be displayed for technical users. Non-technical users + * won't know what an "object", "array" or "resource" is and will be + * confused by the violation message. + * + * @param mixed $value The value to format as string + * @param int $format A bitwise combination of the format + * constants in this class + * + * @return string + */ + protected function formatValue($value, int $format = 0) + { + if (($format & self::PRETTY_DATE) && $value instanceof \DateTimeInterface) { + if (class_exists(\IntlDateFormatter::class)) { + $formatter = new \IntlDateFormatter(\Locale::getDefault(), \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT, 'UTC'); + + return $formatter->format(new \DateTime( + $value->format('Y-m-d H:i:s.u'), + new \DateTimeZone('UTC') + )); + } + + return $value->format('Y-m-d H:i:s'); + } + + if (\is_object($value)) { + if (($format & self::OBJECT_TO_STRING) && method_exists($value, '__toString')) { + return $value->__toString(); + } + + return 'object'; + } + + if (\is_array($value)) { + return 'array'; + } + + if (\is_string($value)) { + return '"'.$value.'"'; + } + + if (\is_resource($value)) { + return 'resource'; + } + + if (null === $value) { + return 'null'; + } + + if (false === $value) { + return 'false'; + } + + if (true === $value) { + return 'true'; + } + + return (string) $value; + } + + /** + * Returns a string representation of a list of values. + * + * Each of the values is converted to a string using + * {@link formatValue()}. The values are then concatenated with commas. + * + * @param array $values A list of values + * @param int $format A bitwise combination of the format + * constants in this class + * + * @return string + * + * @see formatValue() + */ + protected function formatValues(array $values, int $format = 0) + { + foreach ($values as $key => $value) { + $values[$key] = $this->formatValue($value, $format); + } + + return implode(', ', $values); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php new file mode 100644 index 00000000000..45f3ca94e8e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Symfony\Component\Validator\Constraints\ExpressionValidator; + +/** + * Default implementation of the ConstraintValidatorFactoryInterface. + * + * This enforces the convention that the validatedBy() method on any + * Constraint will return the class name of the ConstraintValidator that + * should validate the Constraint. + * + * @author Bernhard Schussek + */ +class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface +{ + protected $validators = []; + + public function __construct() + { + } + + /** + * {@inheritdoc} + */ + public function getInstance(Constraint $constraint) + { + $className = $constraint->validatedBy(); + + if (!isset($this->validators[$className])) { + $this->validators[$className] = 'validator.expression' === $className + ? new ExpressionValidator() + : new $className(); + } + + return $this->validators[$className]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactoryInterface.php b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactoryInterface.php new file mode 100644 index 00000000000..b6476456218 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactoryInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Specifies an object able to return the correct ConstraintValidatorInterface + * instance given a Constraint object. + */ +interface ConstraintValidatorFactoryInterface +{ + /** + * Given a Constraint, this returns the ConstraintValidatorInterface + * object that should be used to verify its validity. + * + * @return ConstraintValidatorInterface + */ + public function getInstance(Constraint $constraint); +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php new file mode 100644 index 00000000000..308c1e61913 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Symfony\Component\Validator\Context\ExecutionContextInterface; + +/** + * @author Bernhard Schussek + */ +interface ConstraintValidatorInterface +{ + /** + * Initializes the constraint validator. + */ + public function initialize(ExecutionContextInterface $context); + + /** + * Checks if the passed value is valid. + * + * @param mixed $value The value that should be validated + */ + public function validate($value, Constraint $constraint); +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolation.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolation.php new file mode 100644 index 00000000000..33aa42a1be3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolation.php @@ -0,0 +1,181 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Default implementation of {@ConstraintViolationInterface}. + * + * @author Bernhard Schussek + */ +class ConstraintViolation implements ConstraintViolationInterface +{ + private $message; + private $messageTemplate; + private $parameters; + private $plural; + private $root; + private $propertyPath; + private $invalidValue; + private $constraint; + private $code; + private $cause; + + /** + * Creates a new constraint violation. + * + * @param string|\Stringable $message The violation message as a string or a stringable object + * @param string|null $messageTemplate The raw violation message + * @param array $parameters The parameters to substitute in the + * raw violation message + * @param mixed $root The value originally passed to the + * validator + * @param string|null $propertyPath The property path from the root + * value to the invalid value + * @param mixed $invalidValue The invalid value that caused this + * violation + * @param int|null $plural The number for determining the plural + * form when translating the message + * @param string|null $code The error code of the violation + * @param Constraint|null $constraint The constraint whose validation + * caused the violation + * @param mixed $cause The cause of the violation + */ + public function __construct($message, ?string $messageTemplate, array $parameters, $root, ?string $propertyPath, $invalidValue, int $plural = null, string $code = null, Constraint $constraint = null, $cause = null) + { + if (!\is_string($message) && !(\is_object($message) && method_exists($message, '__toString'))) { + throw new \TypeError('Constraint violation message should be a string or an object which implements the __toString() method.'); + } + + $this->message = $message; + $this->messageTemplate = $messageTemplate; + $this->parameters = $parameters; + $this->plural = $plural; + $this->root = $root; + $this->propertyPath = $propertyPath; + $this->invalidValue = $invalidValue; + $this->constraint = $constraint; + $this->code = $code; + $this->cause = $cause; + } + + /** + * Converts the violation into a string for debugging purposes. + * + * @return string + */ + public function __toString() + { + if (\is_object($this->root)) { + $class = 'Object('.\get_class($this->root).')'; + } elseif (\is_array($this->root)) { + $class = 'Array'; + } else { + $class = (string) $this->root; + } + + $propertyPath = (string) $this->propertyPath; + + if ('' !== $propertyPath && '[' !== $propertyPath[0] && '' !== $class) { + $class .= '.'; + } + + if (null !== ($code = $this->code) && '' !== $code) { + $code = ' (code '.$code.')'; + } + + return $class.$propertyPath.":\n ".$this->getMessage().$code; + } + + /** + * {@inheritdoc} + */ + public function getMessageTemplate() + { + return (string) $this->messageTemplate; + } + + /** + * {@inheritdoc} + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * {@inheritdoc} + */ + public function getPlural() + { + return $this->plural; + } + + /** + * {@inheritdoc} + */ + public function getMessage() + { + return $this->message; + } + + /** + * {@inheritdoc} + */ + public function getRoot() + { + return $this->root; + } + + /** + * {@inheritdoc} + */ + public function getPropertyPath() + { + return (string) $this->propertyPath; + } + + /** + * {@inheritdoc} + */ + public function getInvalidValue() + { + return $this->invalidValue; + } + + /** + * Returns the constraint whose validation caused the violation. + * + * @return Constraint|null + */ + public function getConstraint() + { + return $this->constraint; + } + + /** + * Returns the cause of the violation. + * + * @return mixed + */ + public function getCause() + { + return $this->cause; + } + + /** + * {@inheritdoc} + */ + public function getCode() + { + return $this->code; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php new file mode 100644 index 00000000000..fd7d414d7cd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * A violation of a constraint that happened during validation. + * + * For each constraint that fails during validation one or more violations are + * created. The violations store the violation message, the path to the failing + * element in the validation graph and the root element that was originally + * passed to the validator. For example, take the following graph: + * + * (Person)---(firstName: string) + * \ + * (address: Address)---(street: string) + * + * If the Person object is validated and validation fails for the + * "firstName" property, the generated violation has the Person + * instance as root and the property path "firstName". If validation fails + * for the "street" property of the related Address instance, the root + * element is still the person, but the property path is "address.street". + * + * @author Bernhard Schussek + */ +interface ConstraintViolationInterface +{ + /** + * Returns the violation message. + * + * @return string|\Stringable + */ + public function getMessage(); + + /** + * Returns the raw violation message. + * + * The raw violation message contains placeholders for the parameters + * returned by {@link getParameters}. Typically you'll pass the + * message template and parameters to a translation engine. + * + * @return string The raw violation message + */ + public function getMessageTemplate(); + + /** + * Returns the parameters to be inserted into the raw violation message. + * + * @return array a possibly empty list of parameters indexed by the names + * that appear in the message template + * + * @see getMessageTemplate() + */ + public function getParameters(); + + /** + * Returns a number for pluralizing the violation message. + * + * For example, the message template could have different translation based + * on a parameter "choices": + * + *
      + *
    • Please select exactly one entry. (choices=1)
    • + *
    • Please select two entries. (choices=2)
    • + *
    + * + * This method returns the value of the parameter for choosing the right + * pluralization form (in this case "choices"). + * + * @return int|null The number to use to pluralize of the message + */ + public function getPlural(); + + /** + * Returns the root element of the validation. + * + * @return mixed The value that was passed originally to the validator when + * the validation was started. Because the validator traverses + * the object graph, the value at which the violation occurs + * is not necessarily the value that was originally validated. + */ + public function getRoot(); + + /** + * Returns the property path from the root element to the violation. + * + * @return string The property path indicates how the validator reached + * the invalid value from the root element. If the root + * element is a Person instance with a property + * "address" that contains an Address instance + * with an invalid property "street", the generated property + * path is "address.street". Property access is denoted by + * dots, while array access is denoted by square brackets, + * for example "addresses[1].street". + */ + public function getPropertyPath(); + + /** + * Returns the value that caused the violation. + * + * @return mixed the invalid value that caused the validated constraint to + * fail + */ + public function getInvalidValue(); + + /** + * Returns a machine-digestible error code for the violation. + * + * @return string|null + */ + public function getCode(); +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php new file mode 100644 index 00000000000..3d459b2c18c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php @@ -0,0 +1,203 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Default implementation of {@ConstraintViolationListInterface}. + * + * @author Bernhard Schussek + * + * @implements \IteratorAggregate + */ +class ConstraintViolationList implements \IteratorAggregate, ConstraintViolationListInterface +{ + /** + * @var list + */ + private $violations = []; + + /** + * Creates a new constraint violation list. + * + * @param iterable $violations The constraint violations to add to the list + */ + public function __construct(iterable $violations = []) + { + foreach ($violations as $violation) { + $this->add($violation); + } + } + + public static function createFromMessage(string $message): self + { + $self = new self(); + $self->add(new ConstraintViolation($message, '', [], null, '', null)); + + return $self; + } + + /** + * Converts the violation into a string for debugging purposes. + * + * @return string + */ + public function __toString() + { + $string = ''; + + foreach ($this->violations as $violation) { + $string .= $violation."\n"; + } + + return $string; + } + + /** + * {@inheritdoc} + */ + public function add(ConstraintViolationInterface $violation) + { + $this->violations[] = $violation; + } + + /** + * {@inheritdoc} + */ + public function addAll(ConstraintViolationListInterface $otherList) + { + foreach ($otherList as $violation) { + $this->violations[] = $violation; + } + } + + /** + * {@inheritdoc} + */ + public function get(int $offset) + { + if (!isset($this->violations[$offset])) { + throw new \OutOfBoundsException(sprintf('The offset "%s" does not exist.', $offset)); + } + + return $this->violations[$offset]; + } + + /** + * {@inheritdoc} + */ + public function has(int $offset) + { + return isset($this->violations[$offset]); + } + + /** + * {@inheritdoc} + */ + public function set(int $offset, ConstraintViolationInterface $violation) + { + $this->violations[$offset] = $violation; + } + + /** + * {@inheritdoc} + */ + public function remove(int $offset) + { + unset($this->violations[$offset]); + } + + /** + * {@inheritdoc} + * + * @return \ArrayIterator + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->violations); + } + + /** + * @return int + */ + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->violations); + } + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return $this->has($offset); + } + + /** + * {@inheritdoc} + * + * @return ConstraintViolationInterface + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->get($offset); + } + + /** + * {@inheritdoc} + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $violation) + { + if (null === $offset) { + $this->add($violation); + } else { + $this->set($offset, $violation); + } + } + + /** + * {@inheritdoc} + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $this->remove($offset); + } + + /** + * Creates iterator for errors with specific codes. + * + * @param string|string[] $codes The codes to find + * + * @return static + */ + public function findByCodes($codes) + { + $codes = (array) $codes; + $violations = []; + foreach ($this as $violation) { + if (\in_array($violation->getCode(), $codes, true)) { + $violations[] = $violation; + } + } + + return new static($violations); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php new file mode 100644 index 00000000000..f994668caa6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * A list of constraint violations. + * + * @author Bernhard Schussek + * + * @extends \ArrayAccess + * @extends \Traversable + */ +interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess +{ + /** + * Adds a constraint violation to this list. + */ + public function add(ConstraintViolationInterface $violation); + + /** + * Merges an existing violation list into this list. + */ + public function addAll(self $otherList); + + /** + * Returns the violation at a given offset. + * + * @param int $offset The offset of the violation + * + * @return ConstraintViolationInterface + * + * @throws \OutOfBoundsException if the offset does not exist + */ + public function get(int $offset); + + /** + * Returns whether the given offset exists. + * + * @param int $offset The violation offset + * + * @return bool + */ + public function has(int $offset); + + /** + * Sets a violation at a given offset. + * + * @param int $offset The violation offset + */ + public function set(int $offset, ConstraintViolationInterface $violation); + + /** + * Removes a violation at a given offset. + * + * @param int $offset The offset to remove + */ + public function remove(int $offset); +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php new file mode 100644 index 00000000000..d492655d931 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * Used for the comparison of values. + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +abstract class AbstractComparison extends Constraint +{ + public $message; + public $value; + public $propertyPath; + + /** + * {@inheritdoc} + * + * @param mixed $value the value to compare or a set of options + */ + public function __construct($value = null, $propertyPath = null, string $message = null, array $groups = null, $payload = null, array $options = []) + { + if (\is_array($value)) { + $options = array_merge($value, $options); + } elseif (null !== $value) { + $options['value'] = $value; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->propertyPath = $propertyPath ?? $this->propertyPath; + + if (null === $this->value && null === $this->propertyPath) { + throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires either the "value" or "propertyPath" option to be set.', static::class)); + } + + if (null !== $this->value && null !== $this->propertyPath) { + throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "value" or "propertyPath" options to be set, not both.', static::class)); + } + + if (null !== $this->propertyPath && !class_exists(PropertyAccess::class)) { + throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "propertyPath" option.', static::class)); + } + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'value'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php new file mode 100644 index 00000000000..c3a117d2cff --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\PropertyAccess\PropertyAccessorInterface; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * Provides a base class for the validation of property comparisons. + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +abstract class AbstractComparisonValidator extends ConstraintValidator +{ + private $propertyAccessor; + + public function __construct(PropertyAccessorInterface $propertyAccessor = null) + { + $this->propertyAccessor = $propertyAccessor; + } + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof AbstractComparison) { + throw new UnexpectedTypeException($constraint, AbstractComparison::class); + } + + if (null === $value) { + return; + } + + if ($path = $constraint->propertyPath) { + if (null === $object = $this->context->getObject()) { + return; + } + + try { + $comparedValue = $this->getPropertyAccessor()->getValue($object, $path); + } catch (NoSuchPropertyException $e) { + throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } + } else { + $comparedValue = $constraint->value; + } + + // Convert strings to DateTimes if comparing another DateTime + // This allows to compare with any date/time value supported by + // the DateTime constructor: + // https://php.net/datetime.formats + if (\is_string($comparedValue) && $value instanceof \DateTimeInterface) { + // If $value is immutable, convert the compared value to a DateTimeImmutable too, otherwise use DateTime + $dateTimeClass = $value instanceof \DateTimeImmutable ? \DateTimeImmutable::class : \DateTime::class; + + try { + $comparedValue = new $dateTimeClass($comparedValue); + } catch (\Exception $e) { + throw new ConstraintDefinitionException(sprintf('The compared value "%s" could not be converted to a "%s" instance in the "%s" constraint.', $comparedValue, $dateTimeClass, get_debug_type($constraint))); + } + } + + if (!$this->compareValues($value, $comparedValue)) { + $violationBuilder = $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE)) + ->setParameter('{{ compared_value }}', $this->formatValue($comparedValue, self::OBJECT_TO_STRING | self::PRETTY_DATE)) + ->setParameter('{{ compared_value_type }}', $this->formatTypeOf($comparedValue)) + ->setCode($this->getErrorCode()); + + if (null !== $path) { + $violationBuilder->setParameter('{{ compared_value_path }}', $path); + } + + $violationBuilder->addViolation(); + } + } + + private function getPropertyAccessor(): PropertyAccessorInterface + { + if (null === $this->propertyAccessor) { + $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); + } + + return $this->propertyAccessor; + } + + /** + * Compares the two given values to find if their relationship is valid. + * + * @param mixed $value1 The first value to compare + * @param mixed $value2 The second value to compare + * + * @return bool + */ + abstract protected function compareValues($value1, $value2); + + /** + * Returns the error code used if the comparison fails. + * + * @return string|null + */ + protected function getErrorCode() + { + return null; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/All.php b/upload/system/storage/vendor/symfony/validator/Constraints/All.php new file mode 100644 index 00000000000..5b4297647da --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/All.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class All extends Composite +{ + public $constraints = []; + + public function __construct($constraints = null, array $groups = null, $payload = null) + { + parent::__construct($constraints ?? [], $groups, $payload); + } + + public function getDefaultOption() + { + return 'constraints'; + } + + public function getRequiredOptions() + { + return ['constraints']; + } + + protected function getCompositeOption() + { + return 'constraints'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php new file mode 100644 index 00000000000..611ac8deae3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class AllValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof All) { + throw new UnexpectedTypeException($constraint, All::class); + } + + if (null === $value) { + return; + } + + if (!\is_array($value) && !$value instanceof \Traversable) { + throw new UnexpectedValueException($value, 'iterable'); + } + + $context = $this->context; + + $validator = $context->getValidator()->inContext($context); + + foreach ($value as $key => $element) { + $validator->atPath('['.$key.']')->validate($element, $constraint->constraints); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php b/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php new file mode 100644 index 00000000000..f01ed9cf4cf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Przemysław Bogusz + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class AtLeastOneOf extends Composite +{ + public const AT_LEAST_ONE_OF_ERROR = 'f27e6d6c-261a-4056-b391-6673a623531c'; + + protected static $errorNames = [ + self::AT_LEAST_ONE_OF_ERROR => 'AT_LEAST_ONE_OF_ERROR', + ]; + + public $constraints = []; + public $message = 'This value should satisfy at least one of the following constraints:'; + public $messageCollection = 'Each element of this collection should satisfy its own set of constraints.'; + public $includeInternalMessages = true; + + public function __construct($constraints = null, array $groups = null, $payload = null, string $message = null, string $messageCollection = null, bool $includeInternalMessages = null) + { + parent::__construct($constraints ?? [], $groups, $payload); + + $this->message = $message ?? $this->message; + $this->messageCollection = $messageCollection ?? $this->messageCollection; + $this->includeInternalMessages = $includeInternalMessages ?? $this->includeInternalMessages; + } + + public function getDefaultOption() + { + return 'constraints'; + } + + public function getRequiredOptions() + { + return ['constraints']; + } + + protected function getCompositeOption() + { + return 'constraints'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php new file mode 100644 index 00000000000..95558519d85 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Przemysław Bogusz + */ +class AtLeastOneOfValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof AtLeastOneOf) { + throw new UnexpectedTypeException($constraint, AtLeastOneOf::class); + } + + $validator = $this->context->getValidator(); + + $messages = [$constraint->message]; + + foreach ($constraint->constraints as $key => $item) { + $executionContext = clone $this->context; + $executionContext->setNode($value, $this->context->getObject(), $this->context->getMetadata(), $this->context->getPropertyPath()); + $violations = $validator->inContext($executionContext)->validate($value, $item, $this->context->getGroup())->getViolations(); + + if (\count($this->context->getViolations()) === \count($violations)) { + return; + } + + if ($constraint->includeInternalMessages) { + $message = ' ['.($key + 1).'] '; + + if ($item instanceof All || $item instanceof Collection) { + $message .= $constraint->messageCollection; + } else { + $message .= $violations->get(\count($violations) - 1)->getMessage(); + } + + $messages[] = $message; + } + } + + $this->context->buildViolation(implode('', $messages)) + ->setCode(AtLeastOneOf::AT_LEAST_ONE_OF_ERROR) + ->addViolation() + ; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Bic.php b/upload/system/storage/vendor/symfony/validator/Constraints/Bic.php new file mode 100644 index 00000000000..1cd98b41d26 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Bic.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Countries; +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\PropertyAccess\PropertyPathInterface; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Michael Hirschler + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Bic extends Constraint +{ + public const INVALID_LENGTH_ERROR = '66dad313-af0b-4214-8566-6c799be9789c'; + public const INVALID_CHARACTERS_ERROR = 'f424c529-7add-4417-8f2d-4b656e4833e2'; + public const INVALID_BANK_CODE_ERROR = '00559357-6170-4f29-aebd-d19330aa19cf'; + public const INVALID_COUNTRY_CODE_ERROR = '1ce76f8d-3c1f-451c-9e62-fe9c3ed486ae'; + public const INVALID_CASE_ERROR = '11884038-3312-4ae5-9d04-699f782130c7'; + public const INVALID_IBAN_COUNTRY_CODE_ERROR = '29a2c3bb-587b-4996-b6f5-53081364cea5'; + + protected static $errorNames = [ + self::INVALID_LENGTH_ERROR => 'INVALID_LENGTH_ERROR', + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::INVALID_BANK_CODE_ERROR => 'INVALID_BANK_CODE_ERROR', + self::INVALID_COUNTRY_CODE_ERROR => 'INVALID_COUNTRY_CODE_ERROR', + self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR', + ]; + + public $message = 'This is not a valid Business Identifier Code (BIC).'; + public $ibanMessage = 'This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.'; + public $iban; + public $ibanPropertyPath; + + /** + * {@inheritdoc} + * + * @param string|PropertyPathInterface|null $ibanPropertyPath + */ + public function __construct(array $options = null, string $message = null, string $iban = null, $ibanPropertyPath = null, string $ibanMessage = null, array $groups = null, $payload = null) + { + if (!class_exists(Countries::class)) { + throw new LogicException('The Intl component is required to use the Bic constraint. Try running "composer require symfony/intl".'); + } + if (null !== $ibanPropertyPath && !\is_string($ibanPropertyPath) && !$ibanPropertyPath instanceof PropertyPathInterface) { + throw new \TypeError(sprintf('"%s": Expected argument $ibanPropertyPath to be either null, a string or an instance of "%s", got "%s".', __METHOD__, PropertyPathInterface::class, get_debug_type($ibanPropertyPath))); + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->ibanMessage = $ibanMessage ?? $this->ibanMessage; + $this->iban = $iban ?? $this->iban; + $this->ibanPropertyPath = $ibanPropertyPath ?? $this->ibanPropertyPath; + + if (null !== $this->iban && null !== $this->ibanPropertyPath) { + throw new ConstraintDefinitionException('The "iban" and "ibanPropertyPath" options of the Iban constraint cannot be used at the same time.'); + } + + if (null !== $this->ibanPropertyPath && !class_exists(PropertyAccess::class)) { + throw new LogicException(sprintf('The "symfony/property-access" component is required to use the "%s" constraint with the "ibanPropertyPath" option.', self::class)); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php new file mode 100644 index 00000000000..ff87b6e0e69 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php @@ -0,0 +1,165 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Countries; +use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\PropertyAccess\PropertyAccessor; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\LogicException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Michael Hirschler + * + * @see https://en.wikipedia.org/wiki/ISO_9362#Structure + */ +class BicValidator extends ConstraintValidator +{ + private const BIC_COUNTRY_TO_IBAN_COUNTRY_MAP = [ + // Reference: https://www.ecbs.org/iban/france-bank-account-number.html + 'GF' => 'FR', // French Guiana + 'PF' => 'FR', // French Polynesia + 'TF' => 'FR', // French Southern Territories + 'GP' => 'FR', // Guadeloupe + 'MQ' => 'FR', // Martinique + 'YT' => 'FR', // Mayotte + 'NC' => 'FR', // New Caledonia + 'RE' => 'FR', // Reunion + 'PM' => 'FR', // Saint Pierre and Miquelon + 'WF' => 'FR', // Wallis and Futuna Islands + // Reference: https://www.ecbs.org/iban/united-kingdom-uk-bank-account-number.html + 'JE' => 'GB', // Jersey + 'IM' => 'GB', // Isle of Man + 'GG' => 'GB', // Guernsey + 'VG' => 'GB', // British Virgin Islands + ]; + + private $propertyAccessor; + + public function __construct(PropertyAccessor $propertyAccessor = null) + { + $this->propertyAccessor = $propertyAccessor; + } + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Bic) { + throw new UnexpectedTypeException($constraint, Bic::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $canonicalize = str_replace(' ', '', $value); + + // the bic must be either 8 or 11 characters long + if (!\in_array(\strlen($canonicalize), [8, 11])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Bic::INVALID_LENGTH_ERROR) + ->addViolation(); + + return; + } + + // must contain alphanumeric values only + if (!ctype_alnum($canonicalize)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Bic::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + + // first 4 letters must be alphabetic (bank code) + if (!ctype_alpha(substr($canonicalize, 0, 4))) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Bic::INVALID_BANK_CODE_ERROR) + ->addViolation(); + + return; + } + + if (!Countries::exists(substr($canonicalize, 4, 2))) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Bic::INVALID_COUNTRY_CODE_ERROR) + ->addViolation(); + + return; + } + + // should contain uppercase characters only + if (strtoupper($canonicalize) !== $canonicalize) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Bic::INVALID_CASE_ERROR) + ->addViolation(); + + return; + } + + // check against an IBAN + $iban = $constraint->iban; + $path = $constraint->ibanPropertyPath; + if ($path && null !== $object = $this->context->getObject()) { + try { + $iban = $this->getPropertyAccessor()->getValue($object, $path); + } catch (NoSuchPropertyException $e) { + throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } + } + if (!$iban) { + return; + } + $ibanCountryCode = substr($iban, 0, 2); + if (ctype_alpha($ibanCountryCode) && !$this->bicAndIbanCountriesMatch(substr($canonicalize, 4, 2), $ibanCountryCode)) { + $this->context->buildViolation($constraint->ibanMessage) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ iban }}', $iban) + ->setCode(Bic::INVALID_IBAN_COUNTRY_CODE_ERROR) + ->addViolation(); + } + } + + private function getPropertyAccessor(): PropertyAccessor + { + if (null === $this->propertyAccessor) { + if (!class_exists(PropertyAccess::class)) { + throw new LogicException('Unable to use property path as the Symfony PropertyAccess component is not installed.'); + } + $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); + } + + return $this->propertyAccessor; + } + + private function bicAndIbanCountriesMatch(string $bicCountryCode, string $ibanCountryCode): bool + { + return $ibanCountryCode === $bicCountryCode || $ibanCountryCode === (self::BIC_COUNTRY_TO_IBAN_COUNTRY_MAP[$bicCountryCode] ?? null); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Blank.php b/upload/system/storage/vendor/symfony/validator/Constraints/Blank.php new file mode 100644 index 00000000000..a9ee5259a18 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Blank.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Blank extends Constraint +{ + public const NOT_BLANK_ERROR = '183ad2de-533d-4796-a439-6d3c3852b549'; + + protected static $errorNames = [ + self::NOT_BLANK_ERROR => 'NOT_BLANK_ERROR', + ]; + + public $message = 'This value should be blank.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options ?? [], $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php new file mode 100644 index 00000000000..3fd7fcc9fe1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class BlankValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Blank) { + throw new UnexpectedTypeException($constraint, Blank::class); + } + + if ('' !== $value && null !== $value) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Blank::NOT_BLANK_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Callback.php b/upload/system/storage/vendor/symfony/validator/Constraints/Callback.php new file mode 100644 index 00000000000..7b9c3c37c83 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Callback.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Callback extends Constraint +{ + /** + * @var string|callable + */ + public $callback; + + /** + * {@inheritdoc} + * + * @param array|string|callable $callback The callback or a set of options + */ + public function __construct($callback = null, array $groups = null, $payload = null, array $options = []) + { + // Invocation through annotations with an array parameter only + if (\is_array($callback) && 1 === \count($callback) && isset($callback['value'])) { + $callback = $callback['value']; + } + + if (!\is_array($callback) || (!isset($callback['callback']) && !isset($callback['groups']) && !isset($callback['payload']))) { + $options['callback'] = $callback; + } else { + $options = array_merge($callback, $options); + } + + parent::__construct($options, $groups, $payload); + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'callback'; + } + + /** + * {@inheritdoc} + */ + public function getTargets() + { + return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php new file mode 100644 index 00000000000..71cff2a7668 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * Validator for Callback constraint. + * + * @author Bernhard Schussek + */ +class CallbackValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($object, Constraint $constraint) + { + if (!$constraint instanceof Callback) { + throw new UnexpectedTypeException($constraint, Callback::class); + } + + $method = $constraint->callback; + if ($method instanceof \Closure) { + $method($object, $this->context, $constraint->payload); + } elseif (\is_array($method)) { + if (!\is_callable($method)) { + if (isset($method[0]) && \is_object($method[0])) { + $method[0] = \get_class($method[0]); + } + throw new ConstraintDefinitionException(json_encode($method).' targeted by Callback constraint is not a valid callable.'); + } + + $method($object, $this->context, $constraint->payload); + } elseif (null !== $object) { + if (!method_exists($object, $method)) { + throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist in class "%s".', $method, get_debug_type($object))); + } + + $reflMethod = new \ReflectionMethod($object, $method); + + if ($reflMethod->isStatic()) { + $reflMethod->invoke(null, $object, $this->context, $constraint->payload); + } else { + $reflMethod->invoke($object, $this->context, $constraint->payload); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php b/upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php new file mode 100644 index 00000000000..e9d66b9bbe5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * Metadata for the CardSchemeValidator. + * + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Tim Nagel + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class CardScheme extends Constraint +{ + public const AMEX = 'AMEX'; + public const CHINA_UNIONPAY = 'CHINA_UNIONPAY'; + public const DINERS = 'DINERS'; + public const DISCOVER = 'DISCOVER'; + public const INSTAPAYMENT = 'INSTAPAYMENT'; + public const JCB = 'JCB'; + public const LASER = 'LASER'; + public const MAESTRO = 'MAESTRO'; + public const MASTERCARD = 'MASTERCARD'; + public const MIR = 'MIR'; + public const UATP = 'UATP'; + public const VISA = 'VISA'; + + public const NOT_NUMERIC_ERROR = 'a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e'; + public const INVALID_FORMAT_ERROR = 'a8faedbf-1c2f-4695-8d22-55783be8efed'; + + protected static $errorNames = [ + self::NOT_NUMERIC_ERROR => 'NOT_NUMERIC_ERROR', + self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', + ]; + + public $message = 'Unsupported card type or invalid card number.'; + public $schemes; + + /** + * {@inheritdoc} + * + * @param array|string $schemes The schemes to validate against or a set of options + */ + public function __construct($schemes, string $message = null, array $groups = null, $payload = null, array $options = []) + { + if (\is_array($schemes) && \is_string(key($schemes))) { + $options = array_merge($schemes, $options); + } else { + $options['value'] = $schemes; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } + + public function getDefaultOption() + { + return 'schemes'; + } + + public function getRequiredOptions() + { + return ['schemes']; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php new file mode 100644 index 00000000000..faef7ec5ba5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php @@ -0,0 +1,134 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * Validates that a card number belongs to a specified scheme. + * + * @author Tim Nagel + * @author Bernhard Schussek + * + * @see https://en.wikipedia.org/wiki/Payment_card_number + * @see https://www.regular-expressions.info/creditcard.html + */ +class CardSchemeValidator extends ConstraintValidator +{ + protected $schemes = [ + // American Express card numbers start with 34 or 37 and have 15 digits. + CardScheme::AMEX => [ + '/^3[47][0-9]{13}$/', + ], + // China UnionPay cards start with 62 and have between 16 and 19 digits. + // Please note that these cards do not follow Luhn Algorithm as a checksum. + CardScheme::CHINA_UNIONPAY => [ + '/^62[0-9]{14,17}$/', + ], + // Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. + // There are Diners Club cards that begin with 5 and have 16 digits. + // These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard. + CardScheme::DINERS => [ + '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/', + ], + // Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65. + // All have 16 digits. + CardScheme::DISCOVER => [ + '/^6011[0-9]{12}$/', + '/^64[4-9][0-9]{13}$/', + '/^65[0-9]{14}$/', + '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/', + ], + // InstaPayment cards begin with 637 through 639 and have 16 digits. + CardScheme::INSTAPAYMENT => [ + '/^63[7-9][0-9]{13}$/', + ], + // JCB cards beginning with 2131 or 1800 have 15 digits. + // JCB cards beginning with 35 have 16 digits. + CardScheme::JCB => [ + '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/', + ], + // Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits. + CardScheme::LASER => [ + '/^(6304|670[69]|6771)[0-9]{12,15}$/', + ], + // Maestro international cards begin with 675900..675999 and have between 12 and 19 digits. + // Maestro UK cards begin with either 500000..509999 or 560000..699999 and have between 12 and 19 digits. + CardScheme::MAESTRO => [ + '/^(6759[0-9]{2})[0-9]{6,13}$/', + '/^(50[0-9]{4})[0-9]{6,13}$/', + '/^5[6-9][0-9]{10,17}$/', + '/^6[0-9]{11,18}$/', + ], + // All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. + // October 2016 MasterCard numbers can also start with 222100 through 272099. + CardScheme::MASTERCARD => [ + '/^5[1-5][0-9]{14}$/', + '/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/', + ], + // Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then between 12 and 15 digits + CardScheme::MIR => [ + '/^220[0-4][0-9]{12,15}$/', + ], + // All UATP card numbers start with a 1 and have a length of 15 digits. + CardScheme::UATP => [ + '/^1[0-9]{14}$/', + ], + // All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits. + CardScheme::VISA => [ + '/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/', + ], + ]; + + /** + * Validates a creditcard belongs to a specified scheme. + * + * @param mixed $value + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof CardScheme) { + throw new UnexpectedTypeException($constraint, CardScheme::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_numeric($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(CardScheme::NOT_NUMERIC_ERROR) + ->addViolation(); + + return; + } + + $schemes = array_flip((array) $constraint->schemes); + $schemeRegexes = array_intersect_key($this->schemes, $schemes); + + foreach ($schemeRegexes as $regexes) { + foreach ($regexes as $regex) { + if (preg_match($regex, $value)) { + return; + } + } + } + + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(CardScheme::INVALID_FORMAT_ERROR) + ->addViolation(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php b/upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php new file mode 100644 index 00000000000..2458d5c3164 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * @Annotation + * @Target({"CLASS"}) + * + * @author Jules Pietri + */ +#[\Attribute(\Attribute::TARGET_CLASS)] +class Cascade extends Constraint +{ + public function __construct(array $options = null) + { + if (\is_array($options) && \array_key_exists('groups', $options)) { + throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); + } + + parent::__construct($options); + } + + /** + * {@inheritdoc} + */ + public function getTargets() + { + return self::CLASS_CONSTRAINT; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Choice.php b/upload/system/storage/vendor/symfony/validator/Constraints/Choice.php new file mode 100644 index 00000000000..b5bcc6d3d98 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Choice.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Choice extends Constraint +{ + public const NO_SUCH_CHOICE_ERROR = '8e179f1b-97aa-4560-a02f-2a8b42e49df7'; + public const TOO_FEW_ERROR = '11edd7eb-5872-4b6e-9f12-89923999fd0e'; + public const TOO_MANY_ERROR = '9bd98e49-211c-433f-8630-fd1c2d0f08c3'; + + protected static $errorNames = [ + self::NO_SUCH_CHOICE_ERROR => 'NO_SUCH_CHOICE_ERROR', + self::TOO_FEW_ERROR => 'TOO_FEW_ERROR', + self::TOO_MANY_ERROR => 'TOO_MANY_ERROR', + ]; + + public $choices; + public $callback; + public $multiple = false; + public $strict = true; + public $min; + public $max; + public $message = 'The value you selected is not a valid choice.'; + public $multipleMessage = 'One or more of the given values is invalid.'; + public $minMessage = 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.'; + public $maxMessage = 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.'; + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'choices'; + } + + public function __construct( + $options = [], + array $choices = null, + $callback = null, + bool $multiple = null, + bool $strict = null, + int $min = null, + int $max = null, + string $message = null, + string $multipleMessage = null, + string $minMessage = null, + string $maxMessage = null, + $groups = null, + $payload = null + ) { + if (\is_array($options) && $options && array_is_list($options)) { + $choices = $choices ?? $options; + $options = []; + } + if (null !== $choices) { + $options['value'] = $choices; + } + + parent::__construct($options, $groups, $payload); + + $this->callback = $callback ?? $this->callback; + $this->multiple = $multiple ?? $this->multiple; + $this->strict = $strict ?? $this->strict; + $this->min = $min ?? $this->min; + $this->max = $max ?? $this->max; + $this->message = $message ?? $this->message; + $this->multipleMessage = $multipleMessage ?? $this->multipleMessage; + $this->minMessage = $minMessage ?? $this->minMessage; + $this->maxMessage = $maxMessage ?? $this->maxMessage; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php new file mode 100644 index 00000000000..a1c47a6bb22 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php @@ -0,0 +1,109 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * ChoiceValidator validates that the value is one of the expected values. + * + * @author Fabien Potencier + * @author Florian Eckerstorfer + * @author Bernhard Schussek + */ +class ChoiceValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Choice) { + throw new UnexpectedTypeException($constraint, Choice::class); + } + + if (!\is_array($constraint->choices) && !$constraint->callback) { + throw new ConstraintDefinitionException('Either "choices" or "callback" must be specified on constraint Choice.'); + } + + if (null === $value) { + return; + } + + if ($constraint->multiple && !\is_array($value)) { + throw new UnexpectedValueException($value, 'array'); + } + + if ($constraint->callback) { + if (!\is_callable($choices = [$this->context->getObject(), $constraint->callback]) + && !\is_callable($choices = [$this->context->getClassName(), $constraint->callback]) + && !\is_callable($choices = $constraint->callback) + ) { + throw new ConstraintDefinitionException('The Choice constraint expects a valid callback.'); + } + $choices = $choices(); + } else { + $choices = $constraint->choices; + } + + if (true !== $constraint->strict) { + throw new \RuntimeException('The "strict" option of the Choice constraint should not be used.'); + } + + if ($constraint->multiple) { + foreach ($value as $_value) { + if (!\in_array($_value, $choices, true)) { + $this->context->buildViolation($constraint->multipleMessage) + ->setParameter('{{ value }}', $this->formatValue($_value)) + ->setParameter('{{ choices }}', $this->formatValues($choices)) + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->setInvalidValue($_value) + ->addViolation(); + + return; + } + } + + $count = \count($value); + + if (null !== $constraint->min && $count < $constraint->min) { + $this->context->buildViolation($constraint->minMessage) + ->setParameter('{{ limit }}', $constraint->min) + ->setPlural((int) $constraint->min) + ->setCode(Choice::TOO_FEW_ERROR) + ->addViolation(); + + return; + } + + if (null !== $constraint->max && $count > $constraint->max) { + $this->context->buildViolation($constraint->maxMessage) + ->setParameter('{{ limit }}', $constraint->max) + ->setPlural((int) $constraint->max) + ->setCode(Choice::TOO_MANY_ERROR) + ->addViolation(); + + return; + } + } elseif (!\in_array($value, $choices, true)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ choices }}', $this->formatValues($choices)) + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php b/upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php new file mode 100644 index 00000000000..387c5996a05 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * Validates that a value is a valid CIDR notation. + * + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Sorin Pop + * @author Calin Bolea + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Cidr extends Constraint +{ + public const INVALID_CIDR_ERROR = '5649e53a-5afb-47c5-a360-ffbab3be8567'; + public const OUT_OF_RANGE_ERROR = 'b9f14a51-acbd-401a-a078-8c6b204ab32f'; + + protected static $errorNames = [ + self::INVALID_CIDR_ERROR => 'INVALID_CIDR_ERROR', + self::OUT_OF_RANGE_ERROR => 'OUT_OF_RANGE_VIOLATION', + ]; + + private const NET_MAXES = [ + Ip::ALL => 128, + Ip::V4 => 32, + Ip::V6 => 128, + ]; + + public $version = Ip::ALL; + + public $message = 'This value is not a valid CIDR notation.'; + + public $netmaskRangeViolationMessage = 'The value of the netmask should be between {{ min }} and {{ max }}.'; + + public $netmaskMin = 0; + + public $netmaskMax; + + public function __construct( + array $options = null, + string $version = null, + int $netmaskMin = null, + int $netmaskMax = null, + string $message = null, + array $groups = null, + $payload = null + ) { + $this->version = $version ?? $options['version'] ?? $this->version; + + if (!\in_array($this->version, array_keys(self::NET_MAXES))) { + throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s".', implode('", "', array_keys(self::NET_MAXES)))); + } + + $this->netmaskMin = $netmaskMin ?? $options['netmaskMin'] ?? $this->netmaskMin; + $this->netmaskMax = $netmaskMax ?? $options['netmaskMax'] ?? self::NET_MAXES[$this->version]; + $this->message = $message ?? $this->message; + + unset($options['netmaskMin'], $options['netmaskMax'], $options['version']); + + if ($this->netmaskMin < 0 || $this->netmaskMax > self::NET_MAXES[$this->version] || $this->netmaskMin > $this->netmaskMax) { + throw new ConstraintDefinitionException(sprintf('The netmask range must be between 0 and %d.', self::NET_MAXES[$this->version])); + } + + parent::__construct($options, $groups, $payload); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php new file mode 100644 index 00000000000..c90ebcfae35 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +class CidrValidator extends ConstraintValidator +{ + public function validate($value, Constraint $constraint): void + { + if (!$constraint instanceof Cidr) { + throw new UnexpectedTypeException($constraint, Cidr::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!\is_string($value)) { + throw new UnexpectedValueException($value, 'string'); + } + + $cidrParts = explode('/', $value, 2); + + if (!isset($cidrParts[1]) + || !ctype_digit($cidrParts[1]) + || '' === $cidrParts[0] + ) { + $this->context + ->buildViolation($constraint->message) + ->setCode(Cidr::INVALID_CIDR_ERROR) + ->addViolation(); + + return; + } + + $ipAddress = $cidrParts[0]; + $netmask = (int) $cidrParts[1]; + + $validV4 = Ip::V6 !== $constraint->version + && filter_var($ipAddress, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4) + && $netmask <= 32; + + $validV6 = Ip::V4 !== $constraint->version + && filter_var($ipAddress, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6); + + if (!$validV4 && !$validV6) { + $this->context + ->buildViolation($constraint->message) + ->setCode(Cidr::INVALID_CIDR_ERROR) + ->addViolation(); + + return; + } + + if ($netmask < $constraint->netmaskMin || $netmask > $constraint->netmaskMax) { + $this->context + ->buildViolation($constraint->netmaskRangeViolationMessage) + ->setParameter('{{ min }}', $constraint->netmaskMin) + ->setParameter('{{ max }}', $constraint->netmaskMax) + ->setCode(Cidr::OUT_OF_RANGE_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Collection.php b/upload/system/storage/vendor/symfony/validator/Constraints/Collection.php new file mode 100644 index 00000000000..3f4adb5ac52 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Collection.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Collection extends Composite +{ + public const MISSING_FIELD_ERROR = '2fa2158c-2a7f-484b-98aa-975522539ff8'; + public const NO_SUCH_FIELD_ERROR = '7703c766-b5d5-4cef-ace7-ae0dd82304e9'; + + protected static $errorNames = [ + self::MISSING_FIELD_ERROR => 'MISSING_FIELD_ERROR', + self::NO_SUCH_FIELD_ERROR => 'NO_SUCH_FIELD_ERROR', + ]; + + public $fields = []; + public $allowExtraFields = false; + public $allowMissingFields = false; + public $extraFieldsMessage = 'This field was not expected.'; + public $missingFieldsMessage = 'This field is missing.'; + + /** + * {@inheritdoc} + */ + public function __construct($fields = null, array $groups = null, $payload = null, bool $allowExtraFields = null, bool $allowMissingFields = null, string $extraFieldsMessage = null, string $missingFieldsMessage = null) + { + // no known options set? $fields is the fields array + if (\is_array($fields) + && !array_intersect(array_keys($fields), ['groups', 'fields', 'allowExtraFields', 'allowMissingFields', 'extraFieldsMessage', 'missingFieldsMessage'])) { + $fields = ['fields' => $fields]; + } + + parent::__construct($fields, $groups, $payload); + + $this->allowExtraFields = $allowExtraFields ?? $this->allowExtraFields; + $this->allowMissingFields = $allowMissingFields ?? $this->allowMissingFields; + $this->extraFieldsMessage = $extraFieldsMessage ?? $this->extraFieldsMessage; + $this->missingFieldsMessage = $missingFieldsMessage ?? $this->missingFieldsMessage; + } + + /** + * {@inheritdoc} + */ + protected function initializeNestedConstraints() + { + parent::initializeNestedConstraints(); + + if (!\is_array($this->fields)) { + throw new ConstraintDefinitionException(sprintf('The option "fields" is expected to be an array in constraint "%s".', __CLASS__)); + } + + foreach ($this->fields as $fieldName => $field) { + // the XmlFileLoader and YamlFileLoader pass the field Optional + // and Required constraint as an array with exactly one element + if (\is_array($field) && 1 == \count($field)) { + $this->fields[$fieldName] = $field = $field[0]; + } + + if (!$field instanceof Optional && !$field instanceof Required) { + $this->fields[$fieldName] = new Required($field); + } + } + } + + public function getRequiredOptions() + { + return ['fields']; + } + + protected function getCompositeOption() + { + return 'fields'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php new file mode 100644 index 00000000000..7cea7d01df9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class CollectionValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Collection) { + throw new UnexpectedTypeException($constraint, Collection::class); + } + + if (null === $value) { + return; + } + + if (!\is_array($value) && !($value instanceof \Traversable && $value instanceof \ArrayAccess)) { + throw new UnexpectedValueException($value, 'array|(Traversable&ArrayAccess)'); + } + + // We need to keep the initialized context when CollectionValidator + // calls itself recursively (Collection constraints can be nested). + // Since the context of the validator is overwritten when initialize() + // is called for the nested constraint, the outer validator is + // acting on the wrong context when the nested validation terminates. + // + // A better solution - which should be approached in Symfony 3.0 - is to + // remove the initialize() method and pass the context as last argument + // to validate() instead. + $context = $this->context; + + foreach ($constraint->fields as $field => $fieldConstraint) { + // bug fix issue #2779 + $existsInArray = \is_array($value) && \array_key_exists($field, $value); + $existsInArrayAccess = $value instanceof \ArrayAccess && $value->offsetExists($field); + + if ($existsInArray || $existsInArrayAccess) { + if (\count($fieldConstraint->constraints) > 0) { + $context->getValidator() + ->inContext($context) + ->atPath('['.$field.']') + ->validate($value[$field], $fieldConstraint->constraints); + } + } elseif (!$fieldConstraint instanceof Optional && !$constraint->allowMissingFields) { + $context->buildViolation($constraint->missingFieldsMessage) + ->atPath('['.$field.']') + ->setParameter('{{ field }}', $this->formatValue($field)) + ->setInvalidValue(null) + ->setCode(Collection::MISSING_FIELD_ERROR) + ->addViolation(); + } + } + + if (!$constraint->allowExtraFields) { + foreach ($value as $field => $fieldValue) { + if (!isset($constraint->fields[$field])) { + $context->buildViolation($constraint->extraFieldsMessage) + ->atPath('['.$field.']') + ->setParameter('{{ field }}', $this->formatValue($field)) + ->setInvalidValue($fieldValue) + ->setCode(Collection::NO_SUCH_FIELD_ERROR) + ->addViolation(); + } + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Composite.php b/upload/system/storage/vendor/symfony/validator/Constraints/Composite.php new file mode 100644 index 00000000000..2f6eadffdd5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Composite.php @@ -0,0 +1,159 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * A constraint that is composed of other constraints. + * + * You should never use the nested constraint instances anywhere else, because + * their groups are adapted when passed to the constructor of this class. + * + * If you want to create your own composite constraint, extend this class and + * let {@link getCompositeOption()} return the name of the property which + * contains the nested constraints. + * + * @author Bernhard Schussek + */ +abstract class Composite extends Constraint +{ + /** + * {@inheritdoc} + * + * The groups of the composite and its nested constraints are made + * consistent using the following strategy: + * + * - If groups are passed explicitly to the composite constraint, but + * not to the nested constraints, the options of the composite + * constraint are copied to the nested constraints; + * + * - If groups are passed explicitly to the nested constraints, but not + * to the composite constraint, the groups of all nested constraints + * are merged and used as groups for the composite constraint; + * + * - If groups are passed explicitly to both the composite and its nested + * constraints, the groups of the nested constraints must be a subset + * of the groups of the composite constraint. If not, a + * {@link ConstraintDefinitionException} is thrown. + * + * All this is done in the constructor, because constraints can then be + * cached. When constraints are loaded from the cache, no more group + * checks need to be done. + */ + public function __construct($options = null, array $groups = null, $payload = null) + { + parent::__construct($options, $groups, $payload); + + $this->initializeNestedConstraints(); + + /* @var Constraint[] $nestedConstraints */ + $compositeOption = $this->getCompositeOption(); + $nestedConstraints = $this->$compositeOption; + + if (!\is_array($nestedConstraints)) { + $nestedConstraints = [$nestedConstraints]; + } + + foreach ($nestedConstraints as $constraint) { + if (!$constraint instanceof Constraint) { + if (\is_object($constraint)) { + $constraint = \get_class($constraint); + } + + throw new ConstraintDefinitionException(sprintf('The value "%s" is not an instance of Constraint in constraint "%s".', $constraint, static::class)); + } + + if ($constraint instanceof Valid) { + throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint "%s". You can only declare the Valid constraint directly on a field or method.', static::class)); + } + } + + if (!isset(((array) $this)['groups'])) { + $mergedGroups = []; + + foreach ($nestedConstraints as $constraint) { + foreach ($constraint->groups as $group) { + $mergedGroups[$group] = true; + } + } + + // prevent empty composite constraint to have empty groups + $this->groups = array_keys($mergedGroups) ?: [self::DEFAULT_GROUP]; + $this->$compositeOption = $nestedConstraints; + + return; + } + + foreach ($nestedConstraints as $constraint) { + if (isset(((array) $constraint)['groups'])) { + $excessGroups = array_diff($constraint->groups, $this->groups); + + if (\count($excessGroups) > 0) { + throw new ConstraintDefinitionException(sprintf('The group(s) "%s" passed to the constraint "%s" should also be passed to its containing constraint "%s".', implode('", "', $excessGroups), get_debug_type($constraint), static::class)); + } + } else { + $constraint->groups = $this->groups; + } + } + + $this->$compositeOption = $nestedConstraints; + } + + /** + * {@inheritdoc} + * + * Implicit group names are forwarded to nested constraints. + */ + public function addImplicitGroupName(string $group) + { + parent::addImplicitGroupName($group); + + /** @var Constraint[] $nestedConstraints */ + $nestedConstraints = $this->{$this->getCompositeOption()}; + + foreach ($nestedConstraints as $constraint) { + $constraint->addImplicitGroupName($group); + } + } + + /** + * Returns the name of the property that contains the nested constraints. + * + * @return string + */ + abstract protected function getCompositeOption(); + + /** + * @internal Used by metadata + * + * @return Constraint[] + */ + public function getNestedConstraints() + { + /* @var Constraint[] $nestedConstraints */ + return $this->{$this->getCompositeOption()}; + } + + /** + * Initializes the nested constraints. + * + * This method can be overwritten in subclasses to clean up the nested + * constraints passed to the constructor. + * + * @see Collection::initializeNestedConstraints() + */ + protected function initializeNestedConstraints() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Compound.php b/upload/system/storage/vendor/symfony/validator/Constraints/Compound.php new file mode 100644 index 00000000000..54dcd6c86f9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Compound.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * Extend this class to create a reusable set of constraints. + * + * @author Maxime Steinhausser + */ +abstract class Compound extends Composite +{ + /** @var Constraint[] */ + public $constraints = []; + + public function __construct($options = null) + { + if (isset($options[$this->getCompositeOption()])) { + throw new ConstraintDefinitionException(sprintf('You can\'t redefine the "%s" option. Use the "%s::getConstraints()" method instead.', $this->getCompositeOption(), __CLASS__)); + } + + $this->constraints = $this->getConstraints($this->normalizeOptions($options)); + + parent::__construct($options); + } + + final protected function getCompositeOption(): string + { + return 'constraints'; + } + + final public function validatedBy(): string + { + return CompoundValidator::class; + } + + /** + * @return Constraint[] + */ + abstract protected function getConstraints(array $options): array; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php new file mode 100644 index 00000000000..2ba993f31b4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Maxime Steinhausser + */ +class CompoundValidator extends ConstraintValidator +{ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Compound) { + throw new UnexpectedTypeException($constraint, Compound::class); + } + + $context = $this->context; + + $validator = $context->getValidator()->inContext($context); + + $validator->validate($value, $constraint->constraints); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Count.php b/upload/system/storage/vendor/symfony/validator/Constraints/Count.php new file mode 100644 index 00000000000..0d759031079 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Count.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\MissingOptionsException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Count extends Constraint +{ + public const TOO_FEW_ERROR = 'bef8e338-6ae5-4caf-b8e2-50e7b0579e69'; + public const TOO_MANY_ERROR = '756b1212-697c-468d-a9ad-50dd783bb169'; + public const NOT_EQUAL_COUNT_ERROR = '9fe5d43f-3784-4ece-a0e1-473fc02dadbc'; + public const NOT_DIVISIBLE_BY_ERROR = DivisibleBy::NOT_DIVISIBLE_BY; + + protected static $errorNames = [ + self::TOO_FEW_ERROR => 'TOO_FEW_ERROR', + self::TOO_MANY_ERROR => 'TOO_MANY_ERROR', + self::NOT_EQUAL_COUNT_ERROR => 'NOT_EQUAL_COUNT_ERROR', + self::NOT_DIVISIBLE_BY_ERROR => 'NOT_DIVISIBLE_BY_ERROR', + ]; + + public $minMessage = 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.'; + public $maxMessage = 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.'; + public $exactMessage = 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.'; + public $divisibleByMessage = 'The number of elements in this collection should be a multiple of {{ compared_value }}.'; + public $min; + public $max; + public $divisibleBy; + + /** + * {@inheritdoc} + * + * @param int|array|null $exactly The expected exact count or a set of options + */ + public function __construct( + $exactly = null, + int $min = null, + int $max = null, + int $divisibleBy = null, + string $exactMessage = null, + string $minMessage = null, + string $maxMessage = null, + string $divisibleByMessage = null, + array $groups = null, + $payload = null, + array $options = [] + ) { + if (\is_array($exactly)) { + $options = array_merge($exactly, $options); + $exactly = $options['value'] ?? null; + } + + $min = $min ?? $options['min'] ?? null; + $max = $max ?? $options['max'] ?? null; + + unset($options['value'], $options['min'], $options['max']); + + if (null !== $exactly && null === $min && null === $max) { + $min = $max = $exactly; + } + + parent::__construct($options, $groups, $payload); + + $this->min = $min; + $this->max = $max; + $this->divisibleBy = $divisibleBy ?? $this->divisibleBy; + $this->exactMessage = $exactMessage ?? $this->exactMessage; + $this->minMessage = $minMessage ?? $this->minMessage; + $this->maxMessage = $maxMessage ?? $this->maxMessage; + $this->divisibleByMessage = $divisibleByMessage ?? $this->divisibleByMessage; + + if (null === $this->min && null === $this->max && null === $this->divisibleBy) { + throw new MissingOptionsException(sprintf('Either option "min", "max" or "divisibleBy" must be given for constraint "%s".', __CLASS__), ['min', 'max', 'divisibleBy']); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php new file mode 100644 index 00000000000..ff991ac2b46 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class CountValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Count) { + throw new UnexpectedTypeException($constraint, Count::class); + } + + if (null === $value) { + return; + } + + if (!\is_array($value) && !$value instanceof \Countable) { + throw new UnexpectedValueException($value, 'array|\Countable'); + } + + $count = \count($value); + + if (null !== $constraint->max && $count > $constraint->max) { + $exactlyOptionEnabled = $constraint->min == $constraint->max; + + $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->maxMessage) + ->setParameter('{{ count }}', $count) + ->setParameter('{{ limit }}', $constraint->max) + ->setInvalidValue($value) + ->setPlural((int) $constraint->max) + ->setCode($exactlyOptionEnabled ? Count::NOT_EQUAL_COUNT_ERROR : Count::TOO_MANY_ERROR) + ->addViolation(); + + return; + } + + if (null !== $constraint->min && $count < $constraint->min) { + $exactlyOptionEnabled = $constraint->min == $constraint->max; + + $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->minMessage) + ->setParameter('{{ count }}', $count) + ->setParameter('{{ limit }}', $constraint->min) + ->setInvalidValue($value) + ->setPlural((int) $constraint->min) + ->setCode($exactlyOptionEnabled ? Count::NOT_EQUAL_COUNT_ERROR : Count::TOO_FEW_ERROR) + ->addViolation(); + + return; + } + + if (null !== $constraint->divisibleBy) { + $this->context + ->getValidator() + ->inContext($this->context) + ->validate($count, [ + new DivisibleBy([ + 'value' => $constraint->divisibleBy, + 'message' => $constraint->divisibleByMessage, + ]), + ], $this->context->getGroup()); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Country.php b/upload/system/storage/vendor/symfony/validator/Constraints/Country.php new file mode 100644 index 00000000000..ccd815cfe57 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Country.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Countries; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Country extends Constraint +{ + public const NO_SUCH_COUNTRY_ERROR = '8f900c12-61bd-455d-9398-996cd040f7f0'; + + protected static $errorNames = [ + self::NO_SUCH_COUNTRY_ERROR => 'NO_SUCH_COUNTRY_ERROR', + ]; + + public $message = 'This value is not a valid country.'; + public $alpha3 = false; + + public function __construct( + array $options = null, + string $message = null, + bool $alpha3 = null, + array $groups = null, + $payload = null + ) { + if (!class_exists(Countries::class)) { + throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".'); + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->alpha3 = $alpha3 ?? $this->alpha3; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php new file mode 100644 index 00000000000..895cca3df1f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Countries; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether a value is a valid country code. + * + * @author Bernhard Schussek + */ +class CountryValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Country) { + throw new UnexpectedTypeException($constraint, Country::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if ($constraint->alpha3 ? !Countries::alpha3CodeExists($value) : !Countries::exists($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Country::NO_SUCH_COUNTRY_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php b/upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php new file mode 100644 index 00000000000..e1510dafe38 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Mathieu Santostefano + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class CssColor extends Constraint +{ + public const HEX_LONG = 'hex_long'; + public const HEX_LONG_WITH_ALPHA = 'hex_long_with_alpha'; + public const HEX_SHORT = 'hex_short'; + public const HEX_SHORT_WITH_ALPHA = 'hex_short_with_alpha'; + public const BASIC_NAMED_COLORS = 'basic_named_colors'; + public const EXTENDED_NAMED_COLORS = 'extended_named_colors'; + public const SYSTEM_COLORS = 'system_colors'; + public const KEYWORDS = 'keywords'; + public const RGB = 'rgb'; + public const RGBA = 'rgba'; + public const HSL = 'hsl'; + public const HSLA = 'hsla'; + public const INVALID_FORMAT_ERROR = '454ab47b-aacf-4059-8f26-184b2dc9d48d'; + + protected static $errorNames = [ + self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', + ]; + + /** + * @var string[] + */ + private static $validationModes = [ + self::HEX_LONG, + self::HEX_LONG_WITH_ALPHA, + self::HEX_SHORT, + self::HEX_SHORT_WITH_ALPHA, + self::BASIC_NAMED_COLORS, + self::EXTENDED_NAMED_COLORS, + self::SYSTEM_COLORS, + self::KEYWORDS, + self::RGB, + self::RGBA, + self::HSL, + self::HSLA, + ]; + + public $message = 'This value is not a valid CSS color.'; + public $formats; + + /** + * @param array|string $formats The types of CSS colors allowed (e.g. hexadecimal only, RGB and HSL only, etc.). + */ + public function __construct($formats = [], string $message = null, array $groups = null, $payload = null, array $options = null) + { + $validationModesAsString = implode(', ', self::$validationModes); + + if (!$formats) { + $options['value'] = self::$validationModes; + } elseif (\is_array($formats) && \is_string(key($formats))) { + $options = array_merge($formats, $options ?? []); + } elseif (\is_array($formats)) { + if ([] === array_intersect(self::$validationModes, $formats)) { + throw new InvalidArgumentException(sprintf('The "formats" parameter value is not valid. It must contain one or more of the following values: "%s".', $validationModesAsString)); + } + + $options['value'] = $formats; + } elseif (\is_string($formats)) { + if (!\in_array($formats, self::$validationModes)) { + throw new InvalidArgumentException(sprintf('The "formats" parameter value is not valid. It must contain one or more of the following values: "%s".', $validationModesAsString)); + } + + $options['value'] = [$formats]; + } else { + throw new InvalidArgumentException('The "formats" parameter type is not valid. It should be a string or an array.'); + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } + + public function getDefaultOption(): string + { + return 'formats'; + } + + public function getRequiredOptions(): array + { + return ['formats']; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php new file mode 100644 index 00000000000..b34ef9303fc --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Mathieu Santostefano + */ +class CssColorValidator extends ConstraintValidator +{ + private const PATTERN_HEX_LONG = '/^#[0-9a-f]{6}$/i'; + private const PATTERN_HEX_LONG_WITH_ALPHA = '/^#[0-9a-f]{8}$/i'; + private const PATTERN_HEX_SHORT = '/^#[0-9a-f]{3}$/i'; + private const PATTERN_HEX_SHORT_WITH_ALPHA = '/^#[0-9a-f]{4}$/i'; + // List comes from https://www.w3.org/wiki/CSS/Properties/color/keywords#Basic_Colors + private const PATTERN_BASIC_NAMED_COLORS = '/^(black|silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua)$/i'; + // List comes from https://www.w3.org/wiki/CSS/Properties/color/keywords#Extended_colors + private const PATTERN_EXTENDED_NAMED_COLORS = '/^(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)$/i'; + // List comes from https://drafts.csswg.org/css-color/#css-system-colors + private const PATTERN_SYSTEM_COLORS = '/^(Canvas|CanvasText|LinkText|VisitedText|ActiveText|ButtonFace|ButtonText|ButtonBorder|Field|FieldText|Highlight|HighlightText|SelectedItem|SelectedItemText|Mark|MarkText|GrayText)$/i'; + private const PATTERN_KEYWORDS = '/^(transparent|currentColor)$/i'; + private const PATTERN_RGB = '/^rgb\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d)\s*\)$/i'; + private const PATTERN_RGBA = '/^rgba\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|0?\.\d+|1(\.0)?)\s*\)$/i'; + private const PATTERN_HSL = '/^hsl\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%\s*\)$/i'; + private const PATTERN_HSLA = '/^hsla\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%,\s*(0|0?\.\d+|1(\.0)?)\s*\)$/i'; + + private const COLOR_PATTERNS = [ + CssColor::HEX_LONG => self::PATTERN_HEX_LONG, + CssColor::HEX_LONG_WITH_ALPHA => self::PATTERN_HEX_LONG_WITH_ALPHA, + CssColor::HEX_SHORT => self::PATTERN_HEX_SHORT, + CssColor::HEX_SHORT_WITH_ALPHA => self::PATTERN_HEX_SHORT_WITH_ALPHA, + CssColor::BASIC_NAMED_COLORS => self::PATTERN_BASIC_NAMED_COLORS, + CssColor::EXTENDED_NAMED_COLORS => self::PATTERN_EXTENDED_NAMED_COLORS, + CssColor::SYSTEM_COLORS => self::PATTERN_SYSTEM_COLORS, + CssColor::KEYWORDS => self::PATTERN_KEYWORDS, + CssColor::RGB => self::PATTERN_RGB, + CssColor::RGBA => self::PATTERN_RGBA, + CssColor::HSL => self::PATTERN_HSL, + CssColor::HSLA => self::PATTERN_HSLA, + ]; + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint): void + { + if (!$constraint instanceof CssColor) { + throw new UnexpectedTypeException($constraint, CssColor::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!\is_string($value)) { + throw new UnexpectedValueException($value, 'string'); + } + + $formats = array_flip((array) $constraint->formats); + $formatRegexes = array_intersect_key(self::COLOR_PATTERNS, $formats); + + foreach ($formatRegexes as $regex) { + if (preg_match($regex, (string) $value)) { + return; + } + } + + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(CssColor::INVALID_FORMAT_ERROR) + ->addViolation(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Currency.php b/upload/system/storage/vendor/symfony/validator/Constraints/Currency.php new file mode 100644 index 00000000000..cac2dfffc88 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Currency.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Currencies; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Miha Vrhovnik + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Currency extends Constraint +{ + public const NO_SUCH_CURRENCY_ERROR = '69945ac1-2db4-405f-bec7-d2772f73df52'; + + protected static $errorNames = [ + self::NO_SUCH_CURRENCY_ERROR => 'NO_SUCH_CURRENCY_ERROR', + ]; + + public $message = 'This value is not a valid currency.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + if (!class_exists(Currencies::class)) { + throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".'); + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php new file mode 100644 index 00000000000..4f294e42bf7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Currencies; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether a value is a valid currency. + * + * @author Miha Vrhovnik + * @author Bernhard Schussek + */ +class CurrencyValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Currency) { + throw new UnexpectedTypeException($constraint, Currency::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (!Currencies::exists($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Currency::NO_SUCH_CURRENCY_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Date.php b/upload/system/storage/vendor/symfony/validator/Constraints/Date.php new file mode 100644 index 00000000000..7c9666f7caa --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Date.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Date extends Constraint +{ + public const INVALID_FORMAT_ERROR = '69819696-02ac-4a99-9ff0-14e127c4d1bc'; + public const INVALID_DATE_ERROR = '3c184ce5-b31d-4de7-8b76-326da7b2be93'; + + protected static $errorNames = [ + self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', + self::INVALID_DATE_ERROR => 'INVALID_DATE_ERROR', + ]; + + public $message = 'This value is not a valid date.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php b/upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php new file mode 100644 index 00000000000..94c3dd6adcf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class DateTime extends Constraint +{ + public const INVALID_FORMAT_ERROR = '1a9da513-2640-4f84-9b6a-4d99dcddc628'; + public const INVALID_DATE_ERROR = 'd52afa47-620d-4d99-9f08-f4d85b36e33c'; + public const INVALID_TIME_ERROR = '5e797c9d-74f7-4098-baa3-94390c447b27'; + + protected static $errorNames = [ + self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', + self::INVALID_DATE_ERROR => 'INVALID_DATE_ERROR', + self::INVALID_TIME_ERROR => 'INVALID_TIME_ERROR', + ]; + + public $format = 'Y-m-d H:i:s'; + public $message = 'This value is not a valid datetime.'; + + /** + * {@inheritdoc} + * + * @param string|array|null $format + */ + public function __construct($format = null, string $message = null, array $groups = null, $payload = null, array $options = []) + { + if (\is_array($format)) { + $options = array_merge($format, $options); + } elseif (null !== $format) { + $options['value'] = $format; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } + + public function getDefaultOption() + { + return 'format'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php new file mode 100644 index 00000000000..e93f795e86e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + * @author Diego Saint Esteben + */ +class DateTimeValidator extends DateValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof DateTime) { + throw new UnexpectedTypeException($constraint, DateTime::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + \DateTime::createFromFormat($constraint->format, $value); + + $errors = \DateTime::getLastErrors(); + + if (0 < $errors['error_count']) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(DateTime::INVALID_FORMAT_ERROR) + ->addViolation(); + + return; + } + + if (str_ends_with($constraint->format, '+')) { + $errors['warnings'] = array_filter($errors['warnings'], function ($warning) { + return 'Trailing data' !== $warning; + }); + } + + foreach ($errors['warnings'] as $warning) { + if ('The parsed date was invalid' === $warning) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(DateTime::INVALID_DATE_ERROR) + ->addViolation(); + } elseif ('The parsed time was invalid' === $warning) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(DateTime::INVALID_TIME_ERROR) + ->addViolation(); + } else { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(DateTime::INVALID_FORMAT_ERROR) + ->addViolation(); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php new file mode 100644 index 00000000000..3f18cac7c1f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class DateValidator extends ConstraintValidator +{ + public const PATTERN = '/^(?\d{4})-(?\d{2})-(?\d{2})$/'; + + /** + * Checks whether a date is valid. + * + * @internal + */ + public static function checkDate(int $year, int $month, int $day): bool + { + return checkdate($month, $day, $year); + } + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Date) { + throw new UnexpectedTypeException($constraint, Date::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (!preg_match(static::PATTERN, $value, $matches)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Date::INVALID_FORMAT_ERROR) + ->addViolation(); + + return; + } + + if (!self::checkDate( + $matches['year'] ?? $matches[1], + $matches['month'] ?? $matches[2], + $matches['day'] ?? $matches[3] + )) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Date::INVALID_DATE_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php b/upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php new file mode 100644 index 00000000000..9a91f009c8b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * Disables auto mapping. + * + * Using the annotations on a property has higher precedence than using it on a class, + * which has higher precedence than any configuration that might be defined outside the class. + * + * @Annotation + * + * @author Kévin Dunglas + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)] +class DisableAutoMapping extends Constraint +{ + public function __construct(array $options = null) + { + if (\is_array($options) && \array_key_exists('groups', $options)) { + throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); + } + + parent::__construct($options); + } + + /** + * {@inheritdoc} + */ + public function getTargets() + { + return [self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php b/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php new file mode 100644 index 00000000000..d3f5cd713ad --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Colin O'Dell + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class DivisibleBy extends AbstractComparison +{ + public const NOT_DIVISIBLE_BY = '6d99d6c3-1464-4ccf-bdc7-14d083cf455c'; + + protected static $errorNames = [ + self::NOT_DIVISIBLE_BY => 'NOT_DIVISIBLE_BY', + ]; + + public $message = 'This value should be a multiple of {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php new file mode 100644 index 00000000000..53b8d38930c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates that values are a multiple of the given number. + * + * @author Colin O'Dell + */ +class DivisibleByValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + if (!is_numeric($value1)) { + throw new UnexpectedValueException($value1, 'numeric'); + } + + if (!is_numeric($value2)) { + throw new UnexpectedValueException($value2, 'numeric'); + } + + if (!$value2 = abs($value2)) { + return false; + } + if (\is_int($value1 = abs($value1)) && \is_int($value2)) { + return 0 === ($value1 % $value2); + } + if (!$remainder = fmod($value1, $value2)) { + return true; + } + + return sprintf('%.12e', $value2) === sprintf('%.12e', $remainder); + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return DivisibleBy::NOT_DIVISIBLE_BY; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Email.php b/upload/system/storage/vendor/symfony/validator/Constraints/Email.php new file mode 100644 index 00000000000..7976cc4ee38 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Email.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Egulias\EmailValidator\EmailValidator as StrictEmailValidator; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Email extends Constraint +{ + public const VALIDATION_MODE_HTML5 = 'html5'; + public const VALIDATION_MODE_STRICT = 'strict'; + public const VALIDATION_MODE_LOOSE = 'loose'; + + public const INVALID_FORMAT_ERROR = 'bd79c0ab-ddba-46cc-a703-a7a4b08de310'; + + protected static $errorNames = [ + self::INVALID_FORMAT_ERROR => 'STRICT_CHECK_FAILED_ERROR', + ]; + + /** + * @var string[] + * + * @internal + */ + public static $validationModes = [ + self::VALIDATION_MODE_HTML5, + self::VALIDATION_MODE_STRICT, + self::VALIDATION_MODE_LOOSE, + ]; + + public $message = 'This value is not a valid email address.'; + public $mode; + public $normalizer; + + public function __construct( + array $options = null, + string $message = null, + string $mode = null, + callable $normalizer = null, + array $groups = null, + $payload = null + ) { + if (\is_array($options) && \array_key_exists('mode', $options) && !\in_array($options['mode'], self::$validationModes, true)) { + throw new InvalidArgumentException('The "mode" parameter value is not valid.'); + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->mode = $mode ?? $this->mode; + $this->normalizer = $normalizer ?? $this->normalizer; + + if (self::VALIDATION_MODE_STRICT === $this->mode && !class_exists(StrictEmailValidator::class)) { + throw new LogicException(sprintf('The "egulias/email-validator" component is required to use the "%s" constraint in strict mode.', __CLASS__)); + } + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php new file mode 100644 index 00000000000..c879ee466e3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Egulias\EmailValidator\EmailValidator as EguliasEmailValidator; +use Egulias\EmailValidator\Validation\EmailValidation; +use Egulias\EmailValidator\Validation\NoRFCWarningsValidation; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class EmailValidator extends ConstraintValidator +{ + private const PATTERN_HTML5 = '/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/'; + private const PATTERN_LOOSE = '/^.+\@\S+\.\S+$/'; + + private const EMAIL_PATTERNS = [ + Email::VALIDATION_MODE_LOOSE => self::PATTERN_LOOSE, + Email::VALIDATION_MODE_HTML5 => self::PATTERN_HTML5, + ]; + + private $defaultMode; + + public function __construct(string $defaultMode = Email::VALIDATION_MODE_LOOSE) + { + if (!\in_array($defaultMode, Email::$validationModes, true)) { + throw new \InvalidArgumentException('The "defaultMode" parameter value is not valid.'); + } + + $this->defaultMode = $defaultMode; + } + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Email) { + throw new UnexpectedTypeException($constraint, Email::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + if ('' === $value) { + return; + } + + if (null !== $constraint->normalizer) { + $value = ($constraint->normalizer)($value); + } + + if (null === $constraint->mode) { + $constraint->mode = $this->defaultMode; + } + + if (!\in_array($constraint->mode, Email::$validationModes, true)) { + throw new \InvalidArgumentException(sprintf('The "%s::$mode" parameter value is not valid.', get_debug_type($constraint))); + } + + if (Email::VALIDATION_MODE_STRICT === $constraint->mode) { + $strictValidator = new EguliasEmailValidator(); + + if (interface_exists(EmailValidation::class) && !$strictValidator->isValid($value, new NoRFCWarningsValidation())) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::INVALID_FORMAT_ERROR) + ->addViolation(); + + return; + } elseif (!interface_exists(EmailValidation::class) && !$strictValidator->isValid($value, false, true)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::INVALID_FORMAT_ERROR) + ->addViolation(); + + return; + } + } elseif (!preg_match(self::EMAIL_PATTERNS[$constraint->mode], $value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::INVALID_FORMAT_ERROR) + ->addViolation(); + + return; + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php b/upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php new file mode 100644 index 00000000000..3136fd3ed7a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * Enables auto mapping. + * + * Using the annotations on a property has higher precedence than using it on a class, + * which has higher precedence than any configuration that might be defined outside the class. + * + * @Annotation + * + * @author Kévin Dunglas + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)] +class EnableAutoMapping extends Constraint +{ + public function __construct(array $options = null) + { + if (\is_array($options) && \array_key_exists('groups', $options)) { + throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); + } + + parent::__construct($options); + } + + /** + * {@inheritdoc} + */ + public function getTargets() + { + return [self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php new file mode 100644 index 00000000000..09ab4f0f52d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class EqualTo extends AbstractComparison +{ + public const NOT_EQUAL_ERROR = '478618a7-95ba-473d-9101-cabd45e49115'; + + protected static $errorNames = [ + self::NOT_EQUAL_ERROR => 'NOT_EQUAL_ERROR', + ]; + + public $message = 'This value should be equal to {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/EqualToValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/EqualToValidator.php new file mode 100644 index 00000000000..fe1f3620fff --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/EqualToValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values are equal (==). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class EqualToValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return $value1 == $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return EqualTo::NOT_EQUAL_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Existence.php b/upload/system/storage/vendor/symfony/validator/Constraints/Existence.php new file mode 100644 index 00000000000..903cf63913c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Existence.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @author Bernhard Schussek + */ +abstract class Existence extends Composite +{ + public $constraints = []; + + public function getDefaultOption() + { + return 'constraints'; + } + + protected function getCompositeOption() + { + return 'constraints'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Expression.php b/upload/system/storage/vendor/symfony/validator/Constraints/Expression.php new file mode 100644 index 00000000000..01cf429b287 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Expression.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\ExpressionLanguage\Expression as ExpressionObject; +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * @Annotation + * @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Fabien Potencier + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] +class Expression extends Constraint +{ + public const EXPRESSION_FAILED_ERROR = '6b3befbc-2f01-4ddf-be21-b57898905284'; + + protected static $errorNames = [ + self::EXPRESSION_FAILED_ERROR => 'EXPRESSION_FAILED_ERROR', + ]; + + public $message = 'This value is not valid.'; + public $expression; + public $values = []; + + /** + * {@inheritdoc} + * + * @param string|ExpressionObject|array $expression The expression to evaluate or an array of options + */ + public function __construct( + $expression, + string $message = null, + array $values = null, + array $groups = null, + $payload = null, + array $options = [] + ) { + if (!class_exists(ExpressionLanguage::class)) { + throw new LogicException(sprintf('The "symfony/expression-language" component is required to use the "%s" constraint.', __CLASS__)); + } + + if (\is_array($expression)) { + $options = array_merge($expression, $options); + } elseif (!\is_string($expression) && !$expression instanceof ExpressionObject) { + throw new \TypeError(sprintf('"%s": Expected argument $expression to be either a string, an instance of "%s" or an array, got "%s".', __METHOD__, ExpressionObject::class, get_debug_type($expression))); + } else { + $options['value'] = $expression; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->values = $values ?? $this->values; + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'expression'; + } + + /** + * {@inheritdoc} + */ + public function getRequiredOptions() + { + return ['expression']; + } + + /** + * {@inheritdoc} + */ + public function getTargets() + { + return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT]; + } + + /** + * {@inheritdoc} + */ + public function validatedBy() + { + return 'validator.expression'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php new file mode 100644 index 00000000000..d5c1f6f9fc2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Andrey Sevastianov + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class ExpressionLanguageSyntax extends Constraint +{ + public const EXPRESSION_LANGUAGE_SYNTAX_ERROR = '1766a3f3-ff03-40eb-b053-ab7aa23d988a'; + + protected static $errorNames = [ + self::EXPRESSION_LANGUAGE_SYNTAX_ERROR => 'EXPRESSION_LANGUAGE_SYNTAX_ERROR', + ]; + + public $message = 'This value should be a valid expression.'; + public $service; + public $allowedVariables; + + public function __construct(array $options = null, string $message = null, string $service = null, array $allowedVariables = null, array $groups = null, $payload = null) + { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->service = $service ?? $this->service; + $this->allowedVariables = $allowedVariables ?? $this->allowedVariables; + } + + /** + * {@inheritdoc} + */ + public function validatedBy() + { + return $this->service ?? static::class.'Validator'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php new file mode 100644 index 00000000000..4b67da2c2be --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\ExpressionLanguage\SyntaxError; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Andrey Sevastianov + */ +class ExpressionLanguageSyntaxValidator extends ConstraintValidator +{ + private $expressionLanguage; + + public function __construct(ExpressionLanguage $expressionLanguage = null) + { + $this->expressionLanguage = $expressionLanguage; + } + + /** + * {@inheritdoc} + */ + public function validate($expression, Constraint $constraint): void + { + if (!$constraint instanceof ExpressionLanguageSyntax) { + throw new UnexpectedTypeException($constraint, ExpressionLanguageSyntax::class); + } + + if (!\is_string($expression)) { + throw new UnexpectedValueException($expression, 'string'); + } + + if (null === $this->expressionLanguage) { + $this->expressionLanguage = new ExpressionLanguage(); + } + + try { + $this->expressionLanguage->lint($expression, $constraint->allowedVariables); + } catch (SyntaxError $exception) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ syntax_error }}', $this->formatValue($exception->getMessage())) + ->setInvalidValue((string) $expression) + ->setCode(ExpressionLanguageSyntax::EXPRESSION_LANGUAGE_SYNTAX_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php new file mode 100644 index 00000000000..3ae47f48023 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Fabien Potencier + * @author Bernhard Schussek + */ +class ExpressionValidator extends ConstraintValidator +{ + private $expressionLanguage; + + public function __construct(ExpressionLanguage $expressionLanguage = null) + { + $this->expressionLanguage = $expressionLanguage; + } + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Expression) { + throw new UnexpectedTypeException($constraint, Expression::class); + } + + $variables = $constraint->values; + $variables['value'] = $value; + $variables['this'] = $this->context->getObject(); + + if (!$this->getExpressionLanguage()->evaluate($constraint->expression, $variables)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING)) + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->addViolation(); + } + } + + private function getExpressionLanguage(): ExpressionLanguage + { + if (null === $this->expressionLanguage) { + $this->expressionLanguage = new ExpressionLanguage(); + } + + return $this->expressionLanguage; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/File.php b/upload/system/storage/vendor/symfony/validator/Constraints/File.php new file mode 100644 index 00000000000..e28473ac846 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/File.php @@ -0,0 +1,174 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @property int $maxSize + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class File extends Constraint +{ + // Check the Image constraint for clashes if adding new constants here + + public const NOT_FOUND_ERROR = 'd2a3fb6e-7ddc-4210-8fbf-2ab345ce1998'; + public const NOT_READABLE_ERROR = 'c20c92a4-5bfa-4202-9477-28e800e0f6ff'; + public const EMPTY_ERROR = '5d743385-9775-4aa5-8ff5-495fb1e60137'; + public const TOO_LARGE_ERROR = 'df8637af-d466-48c6-a59d-e7126250a654'; + public const INVALID_MIME_TYPE_ERROR = '744f00bc-4389-4c74-92de-9a43cde55534'; + + protected static $errorNames = [ + self::NOT_FOUND_ERROR => 'NOT_FOUND_ERROR', + self::NOT_READABLE_ERROR => 'NOT_READABLE_ERROR', + self::EMPTY_ERROR => 'EMPTY_ERROR', + self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', + self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', + ]; + + public $binaryFormat; + public $mimeTypes = []; + public $notFoundMessage = 'The file could not be found.'; + public $notReadableMessage = 'The file is not readable.'; + public $maxSizeMessage = 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.'; + public $mimeTypesMessage = 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.'; + public $disallowEmptyMessage = 'An empty file is not allowed.'; + + public $uploadIniSizeErrorMessage = 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.'; + public $uploadFormSizeErrorMessage = 'The file is too large.'; + public $uploadPartialErrorMessage = 'The file was only partially uploaded.'; + public $uploadNoFileErrorMessage = 'No file was uploaded.'; + public $uploadNoTmpDirErrorMessage = 'No temporary folder was configured in php.ini.'; + public $uploadCantWriteErrorMessage = 'Cannot write temporary file to disk.'; + public $uploadExtensionErrorMessage = 'A PHP extension caused the upload to fail.'; + public $uploadErrorMessage = 'The file could not be uploaded.'; + + protected $maxSize; + + /** + * {@inheritdoc} + * + * @param int|string|null $maxSize + * @param string[]|string|null $mimeTypes + */ + public function __construct( + array $options = null, + $maxSize = null, + bool $binaryFormat = null, + $mimeTypes = null, + string $notFoundMessage = null, + string $notReadableMessage = null, + string $maxSizeMessage = null, + string $mimeTypesMessage = null, + string $disallowEmptyMessage = null, + + string $uploadIniSizeErrorMessage = null, + string $uploadFormSizeErrorMessage = null, + string $uploadPartialErrorMessage = null, + string $uploadNoFileErrorMessage = null, + string $uploadNoTmpDirErrorMessage = null, + string $uploadCantWriteErrorMessage = null, + string $uploadExtensionErrorMessage = null, + string $uploadErrorMessage = null, + array $groups = null, + $payload = null + ) { + if (null !== $maxSize && !\is_int($maxSize) && !\is_string($maxSize)) { + throw new \TypeError(sprintf('"%s": Expected argument $maxSize to be either null, an integer or a string, got "%s".', __METHOD__, get_debug_type($maxSize))); + } + if (null !== $mimeTypes && !\is_array($mimeTypes) && !\is_string($mimeTypes)) { + throw new \TypeError(sprintf('"%s": Expected argument $mimeTypes to be either null, an array or a string, got "%s".', __METHOD__, get_debug_type($mimeTypes))); + } + + parent::__construct($options, $groups, $payload); + + $this->maxSize = $maxSize ?? $this->maxSize; + $this->binaryFormat = $binaryFormat ?? $this->binaryFormat; + $this->mimeTypes = $mimeTypes ?? $this->mimeTypes; + $this->notFoundMessage = $notFoundMessage ?? $this->notFoundMessage; + $this->notReadableMessage = $notReadableMessage ?? $this->notReadableMessage; + $this->maxSizeMessage = $maxSizeMessage ?? $this->maxSizeMessage; + $this->mimeTypesMessage = $mimeTypesMessage ?? $this->mimeTypesMessage; + $this->disallowEmptyMessage = $disallowEmptyMessage ?? $this->disallowEmptyMessage; + $this->uploadIniSizeErrorMessage = $uploadIniSizeErrorMessage ?? $this->uploadIniSizeErrorMessage; + $this->uploadFormSizeErrorMessage = $uploadFormSizeErrorMessage ?? $this->uploadFormSizeErrorMessage; + $this->uploadPartialErrorMessage = $uploadPartialErrorMessage ?? $this->uploadPartialErrorMessage; + $this->uploadNoFileErrorMessage = $uploadNoFileErrorMessage ?? $this->uploadNoFileErrorMessage; + $this->uploadNoTmpDirErrorMessage = $uploadNoTmpDirErrorMessage ?? $this->uploadNoTmpDirErrorMessage; + $this->uploadCantWriteErrorMessage = $uploadCantWriteErrorMessage ?? $this->uploadCantWriteErrorMessage; + $this->uploadExtensionErrorMessage = $uploadExtensionErrorMessage ?? $this->uploadExtensionErrorMessage; + $this->uploadErrorMessage = $uploadErrorMessage ?? $this->uploadErrorMessage; + + if (null !== $this->maxSize) { + $this->normalizeBinaryFormat($this->maxSize); + } + } + + public function __set(string $option, $value) + { + if ('maxSize' === $option) { + $this->normalizeBinaryFormat($value); + + return; + } + + parent::__set($option, $value); + } + + public function __get(string $option) + { + if ('maxSize' === $option) { + return $this->maxSize; + } + + return parent::__get($option); + } + + public function __isset(string $option) + { + if ('maxSize' === $option) { + return true; + } + + return parent::__isset($option); + } + + /** + * @param int|string $maxSize + */ + private function normalizeBinaryFormat($maxSize) + { + $factors = [ + 'k' => 1000, + 'ki' => 1 << 10, + 'm' => 1000 * 1000, + 'mi' => 1 << 20, + 'g' => 1000 * 1000 * 1000, + 'gi' => 1 << 30, + ]; + if (ctype_digit((string) $maxSize)) { + $this->maxSize = (int) $maxSize; + $this->binaryFormat = $this->binaryFormat ?? false; + } elseif (preg_match('/^(\d++)('.implode('|', array_keys($factors)).')$/i', $maxSize, $matches)) { + $this->maxSize = $matches[1] * $factors[$unit = strtolower($matches[2])]; + $this->binaryFormat = $this->binaryFormat ?? (2 === \strlen($unit)); + } else { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size.', $this->maxSize)); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php new file mode 100644 index 00000000000..cebb6eda296 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php @@ -0,0 +1,252 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\HttpFoundation\File\File as FileObject; +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Symfony\Component\Mime\MimeTypes; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\LogicException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class FileValidator extends ConstraintValidator +{ + public const KB_BYTES = 1000; + public const MB_BYTES = 1000000; + public const KIB_BYTES = 1024; + public const MIB_BYTES = 1048576; + + private const SUFFICES = [ + 1 => 'bytes', + self::KB_BYTES => 'kB', + self::MB_BYTES => 'MB', + self::KIB_BYTES => 'KiB', + self::MIB_BYTES => 'MiB', + ]; + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof File) { + throw new UnexpectedTypeException($constraint, File::class); + } + + if (null === $value || '' === $value) { + return; + } + + if ($value instanceof UploadedFile && !$value->isValid()) { + switch ($value->getError()) { + case \UPLOAD_ERR_INI_SIZE: + $iniLimitSize = UploadedFile::getMaxFilesize(); + if ($constraint->maxSize && $constraint->maxSize < $iniLimitSize) { + $limitInBytes = $constraint->maxSize; + $binaryFormat = $constraint->binaryFormat; + } else { + $limitInBytes = $iniLimitSize; + $binaryFormat = $constraint->binaryFormat ?? true; + } + + [, $limitAsString, $suffix] = $this->factorizeSizes(0, $limitInBytes, $binaryFormat); + $this->context->buildViolation($constraint->uploadIniSizeErrorMessage) + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setCode((string) \UPLOAD_ERR_INI_SIZE) + ->addViolation(); + + return; + case \UPLOAD_ERR_FORM_SIZE: + $this->context->buildViolation($constraint->uploadFormSizeErrorMessage) + ->setCode((string) \UPLOAD_ERR_FORM_SIZE) + ->addViolation(); + + return; + case \UPLOAD_ERR_PARTIAL: + $this->context->buildViolation($constraint->uploadPartialErrorMessage) + ->setCode((string) \UPLOAD_ERR_PARTIAL) + ->addViolation(); + + return; + case \UPLOAD_ERR_NO_FILE: + $this->context->buildViolation($constraint->uploadNoFileErrorMessage) + ->setCode((string) \UPLOAD_ERR_NO_FILE) + ->addViolation(); + + return; + case \UPLOAD_ERR_NO_TMP_DIR: + $this->context->buildViolation($constraint->uploadNoTmpDirErrorMessage) + ->setCode((string) \UPLOAD_ERR_NO_TMP_DIR) + ->addViolation(); + + return; + case \UPLOAD_ERR_CANT_WRITE: + $this->context->buildViolation($constraint->uploadCantWriteErrorMessage) + ->setCode((string) \UPLOAD_ERR_CANT_WRITE) + ->addViolation(); + + return; + case \UPLOAD_ERR_EXTENSION: + $this->context->buildViolation($constraint->uploadExtensionErrorMessage) + ->setCode((string) \UPLOAD_ERR_EXTENSION) + ->addViolation(); + + return; + default: + $this->context->buildViolation($constraint->uploadErrorMessage) + ->setCode((string) $value->getError()) + ->addViolation(); + + return; + } + } + + if (!is_scalar($value) && !$value instanceof FileObject && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $path = $value instanceof FileObject ? $value->getPathname() : (string) $value; + + if (!is_file($path)) { + $this->context->buildViolation($constraint->notFoundMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::NOT_FOUND_ERROR) + ->addViolation(); + + return; + } + + if (!is_readable($path)) { + $this->context->buildViolation($constraint->notReadableMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::NOT_READABLE_ERROR) + ->addViolation(); + + return; + } + + $sizeInBytes = filesize($path); + $basename = $value instanceof UploadedFile ? $value->getClientOriginalName() : basename($path); + + if (0 === $sizeInBytes) { + $this->context->buildViolation($constraint->disallowEmptyMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setParameter('{{ name }}', $this->formatValue($basename)) + ->setCode(File::EMPTY_ERROR) + ->addViolation(); + + return; + } + + if ($constraint->maxSize) { + $limitInBytes = $constraint->maxSize; + + if ($sizeInBytes > $limitInBytes) { + [$sizeAsString, $limitAsString, $suffix] = $this->factorizeSizes($sizeInBytes, $limitInBytes, $constraint->binaryFormat); + $this->context->buildViolation($constraint->maxSizeMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setParameter('{{ size }}', $sizeAsString) + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setParameter('{{ name }}', $this->formatValue($basename)) + ->setCode(File::TOO_LARGE_ERROR) + ->addViolation(); + + return; + } + } + + if ($constraint->mimeTypes) { + if ($value instanceof FileObject) { + $mime = $value->getMimeType(); + } elseif (class_exists(MimeTypes::class)) { + $mime = MimeTypes::getDefault()->guessMimeType($path); + } elseif (!class_exists(FileObject::class)) { + throw new LogicException('You cannot validate the mime-type of files as the Mime component is not installed. Try running "composer require symfony/mime".'); + } else { + $mime = (new FileObject($value))->getMimeType(); + } + + $mimeTypes = (array) $constraint->mimeTypes; + + foreach ($mimeTypes as $mimeType) { + if ($mimeType === $mime) { + return; + } + + if ($discrete = strstr($mimeType, '/*', true)) { + if (strstr($mime, '/', true) === $discrete) { + return; + } + } + } + + $this->context->buildViolation($constraint->mimeTypesMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setParameter('{{ type }}', $this->formatValue($mime)) + ->setParameter('{{ types }}', $this->formatValues($mimeTypes)) + ->setParameter('{{ name }}', $this->formatValue($basename)) + ->setCode(File::INVALID_MIME_TYPE_ERROR) + ->addViolation(); + } + } + + private static function moreDecimalsThan(string $double, int $numberOfDecimals): bool + { + return \strlen($double) > \strlen(round($double, $numberOfDecimals)); + } + + /** + * Convert the limit to the smallest possible number + * (i.e. try "MB", then "kB", then "bytes"). + * + * @param int|float $limit + */ + private function factorizeSizes(int $size, $limit, bool $binaryFormat): array + { + if ($binaryFormat) { + $coef = self::MIB_BYTES; + $coefFactor = self::KIB_BYTES; + } else { + $coef = self::MB_BYTES; + $coefFactor = self::KB_BYTES; + } + + $limitAsString = (string) ($limit / $coef); + + // Restrict the limit to 2 decimals (without rounding! we + // need the precise value) + while (self::moreDecimalsThan($limitAsString, 2)) { + $coef /= $coefFactor; + $limitAsString = (string) ($limit / $coef); + } + + // Convert size to the same measure, but round to 2 decimals + $sizeAsString = (string) round($size / $coef, 2); + + // If the size and limit produce the same string output + // (due to rounding), reduce the coefficient + while ($sizeAsString === $limitAsString) { + $coef /= $coefFactor; + $limitAsString = (string) ($limit / $coef); + $sizeAsString = (string) round($size / $coef, 2); + } + + return [$sizeAsString, $limitAsString, self::SUFFICES[$coef]]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php new file mode 100644 index 00000000000..41648752a2f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class GreaterThan extends AbstractComparison +{ + public const TOO_LOW_ERROR = '778b7ae0-84d3-481a-9dec-35fdb64b1d78'; + + protected static $errorNames = [ + self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', + ]; + + public $message = 'This value should be greater than {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php new file mode 100644 index 00000000000..86ff44e8c34 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class GreaterThanOrEqual extends AbstractComparison +{ + public const TOO_LOW_ERROR = 'ea4e51d1-3342-48bd-87f1-9e672cd90cad'; + + protected static $errorNames = [ + self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', + ]; + + public $message = 'This value should be greater than or equal to {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php new file mode 100644 index 00000000000..290408ac0cc --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values are greater than or equal to the previous (>=). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class GreaterThanOrEqualValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return null === $value2 || $value1 >= $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return GreaterThanOrEqual::TOO_LOW_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php new file mode 100644 index 00000000000..062503ab3f4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values are greater than the previous (>). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class GreaterThanValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return null === $value2 || $value1 > $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return GreaterThan::TOO_LOW_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php new file mode 100644 index 00000000000..522c5fdf59d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * A sequence of validation groups. + * + * When validating a group sequence, each group will only be validated if all + * of the previous groups in the sequence succeeded. For example: + * + * $validator->validate($address, null, new GroupSequence(['Basic', 'Strict'])); + * + * In the first step, all constraints that belong to the group "Basic" will be + * validated. If none of the constraints fail, the validator will then validate + * the constraints in group "Strict". This is useful, for example, if "Strict" + * contains expensive checks that require a lot of CPU or slow, external + * services. You usually don't want to run expensive checks if any of the cheap + * checks fail. + * + * When adding metadata to a class, you can override the "Default" group of + * that class with a group sequence: + * /** + * * @GroupSequence({"Address", "Strict"}) + * *\/ + * class Address + * { + * // ... + * } + * + * Whenever you validate that object in the "Default" group, the group sequence + * will be validated: + * + * $validator->validate($address); + * + * If you want to execute the constraints of the "Default" group for a class + * with an overridden default group, pass the class name as group name instead: + * + * $validator->validate($address, null, "Address") + * + * @Annotation + * @Target({"CLASS", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_CLASS)] +class GroupSequence +{ + /** + * The groups in the sequence. + * + * @var array + */ + public $groups; + + /** + * The group in which cascaded objects are validated when validating + * this sequence. + * + * By default, cascaded objects are validated in each of the groups of + * the sequence. + * + * If a class has a group sequence attached, that sequence replaces the + * "Default" group. When validating that class in the "Default" group, the + * group sequence is used instead, but still the "Default" group should be + * cascaded to other objects. + * + * @var string|GroupSequence + */ + public $cascadedGroup; + + /** + * Creates a new group sequence. + * + * @param array $groups The groups in the sequence + */ + public function __construct(array $groups) + { + // Support for Doctrine annotations + $this->groups = $groups['value'] ?? $groups; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php new file mode 100644 index 00000000000..489a449e838 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Annotation to define a group sequence provider. + * + * @Annotation + * @Target({"CLASS", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_CLASS)] +class GroupSequenceProvider +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php b/upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php new file mode 100644 index 00000000000..d0d02d1f565 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Dmitrii Poddubnyi + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Hostname extends Constraint +{ + public const INVALID_HOSTNAME_ERROR = '7057ffdb-0af4-4f7e-bd5e-e9acfa6d7a2d'; + + protected static $errorNames = [ + self::INVALID_HOSTNAME_ERROR => 'INVALID_HOSTNAME_ERROR', + ]; + + public $message = 'This value is not a valid hostname.'; + public $requireTld = true; + + public function __construct( + array $options = null, + string $message = null, + bool $requireTld = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->requireTld = $requireTld ?? $this->requireTld; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php new file mode 100644 index 00000000000..144d57e37dd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Dmitrii Poddubnyi + */ +class HostnameValidator extends ConstraintValidator +{ + /** + * https://tools.ietf.org/html/rfc2606. + */ + private const RESERVED_TLDS = [ + 'example', + 'invalid', + 'localhost', + 'test', + ]; + + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Hostname) { + throw new UnexpectedTypeException($constraint, Hostname::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + if ('' === $value) { + return; + } + if (!$this->isValid($value) || ($constraint->requireTld && !$this->hasValidTld($value))) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Hostname::INVALID_HOSTNAME_ERROR) + ->addViolation(); + } + } + + private function isValid(string $domain): bool + { + return false !== filter_var($domain, \FILTER_VALIDATE_DOMAIN, \FILTER_FLAG_HOSTNAME); + } + + private function hasValidTld(string $domain): bool + { + return false !== strpos($domain, '.') && !\in_array(substr($domain, strrpos($domain, '.') + 1), self::RESERVED_TLDS, true); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Iban.php b/upload/system/storage/vendor/symfony/validator/Constraints/Iban.php new file mode 100644 index 00000000000..2f7a61e982f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Iban.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Manuel Reinhard + * @author Michael Schummel + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Iban extends Constraint +{ + public const INVALID_COUNTRY_CODE_ERROR = 'de78ee2c-bd50-44e2-aec8-3d8228aeadb9'; + public const INVALID_CHARACTERS_ERROR = '8d3d85e4-784f-4719-a5bc-d9e40d45a3a5'; + public const CHECKSUM_FAILED_ERROR = 'b9401321-f9bf-4dcb-83c1-f31094440795'; + public const INVALID_FORMAT_ERROR = 'c8d318f1-2ecc-41ba-b983-df70d225cf5a'; + public const NOT_SUPPORTED_COUNTRY_CODE_ERROR = 'e2c259f3-4b46-48e6-b72e-891658158ec8'; + + protected static $errorNames = [ + self::INVALID_COUNTRY_CODE_ERROR => 'INVALID_COUNTRY_CODE_ERROR', + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', + self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', + self::NOT_SUPPORTED_COUNTRY_CODE_ERROR => 'NOT_SUPPORTED_COUNTRY_CODE_ERROR', + ]; + + public $message = 'This is not a valid International Bank Account Number (IBAN).'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php new file mode 100644 index 00000000000..0f39a3a9cea --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php @@ -0,0 +1,259 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Manuel Reinhard + * @author Michael Schummel + * @author Bernhard Schussek + * + * @see http://www.michael-schummel.de/2007/10/05/iban-prufung-mit-php/ + */ +class IbanValidator extends ConstraintValidator +{ + /** + * IBAN country specific formats. + * + * The first 2 characters from an IBAN format are the two-character ISO country code. + * The following 2 characters represent the check digits calculated from the rest of the IBAN characters. + * The rest are up to thirty alphanumeric characters for + * a BBAN (Basic Bank Account Number) which has a fixed length per country and, + * included within it, a bank identifier with a fixed position and a fixed length per country + * + * @see https://www.swift.com/sites/default/files/resources/iban_registry.pdf + */ + private const FORMATS = [ + 'AD' => 'AD\d{2}\d{4}\d{4}[\dA-Z]{12}', // Andorra + 'AE' => 'AE\d{2}\d{3}\d{16}', // United Arab Emirates + 'AL' => 'AL\d{2}\d{8}[\dA-Z]{16}', // Albania + 'AO' => 'AO\d{2}\d{21}', // Angola + 'AT' => 'AT\d{2}\d{5}\d{11}', // Austria + 'AX' => 'FI\d{2}\d{6}\d{7}\d{1}', // Aland Islands + 'AZ' => 'AZ\d{2}[A-Z]{4}[\dA-Z]{20}', // Azerbaijan + 'BA' => 'BA\d{2}\d{3}\d{3}\d{8}\d{2}', // Bosnia and Herzegovina + 'BE' => 'BE\d{2}\d{3}\d{7}\d{2}', // Belgium + 'BF' => 'BF\d{2}\d{23}', // Burkina Faso + 'BG' => 'BG\d{2}[A-Z]{4}\d{4}\d{2}[\dA-Z]{8}', // Bulgaria + 'BH' => 'BH\d{2}[A-Z]{4}[\dA-Z]{14}', // Bahrain + 'BI' => 'BI\d{2}\d{12}', // Burundi + 'BJ' => 'BJ\d{2}[A-Z]{1}\d{23}', // Benin + 'BY' => 'BY\d{2}[\dA-Z]{4}\d{4}[\dA-Z]{16}', // Belarus - https://bank.codes/iban/structure/belarus/ + 'BL' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Saint Barthelemy + 'BR' => 'BR\d{2}\d{8}\d{5}\d{10}[A-Z][\dA-Z]', // Brazil + 'CG' => 'CG\d{2}\d{23}', // Congo + 'CH' => 'CH\d{2}\d{5}[\dA-Z]{12}', // Switzerland + 'CI' => 'CI\d{2}[A-Z]{1}\d{23}', // Ivory Coast + 'CM' => 'CM\d{2}\d{23}', // Cameron + 'CR' => 'CR\d{2}0\d{3}\d{14}', // Costa Rica + 'CV' => 'CV\d{2}\d{21}', // Cape Verde + 'CY' => 'CY\d{2}\d{3}\d{5}[\dA-Z]{16}', // Cyprus + 'CZ' => 'CZ\d{2}\d{20}', // Czech Republic + 'DE' => 'DE\d{2}\d{8}\d{10}', // Germany + 'DO' => 'DO\d{2}[\dA-Z]{4}\d{20}', // Dominican Republic + 'DK' => 'DK\d{2}\d{4}\d{10}', // Denmark + 'DZ' => 'DZ\d{2}\d{20}', // Algeria + 'EE' => 'EE\d{2}\d{2}\d{2}\d{11}\d{1}', // Estonia + 'ES' => 'ES\d{2}\d{4}\d{4}\d{1}\d{1}\d{10}', // Spain (also includes Canary Islands, Ceuta and Melilla) + 'FI' => 'FI\d{2}\d{6}\d{7}\d{1}', // Finland + 'FO' => 'FO\d{2}\d{4}\d{9}\d{1}', // Faroe Islands + 'FR' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // France + 'GF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // French Guyana + 'GB' => 'GB\d{2}[A-Z]{4}\d{6}\d{8}', // United Kingdom of Great Britain and Northern Ireland + 'GE' => 'GE\d{2}[A-Z]{2}\d{16}', // Georgia + 'GI' => 'GI\d{2}[A-Z]{4}[\dA-Z]{15}', // Gibraltar + 'GL' => 'GL\d{2}\d{4}\d{9}\d{1}', // Greenland + 'GP' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Guadeloupe + 'GR' => 'GR\d{2}\d{3}\d{4}[\dA-Z]{16}', // Greece + 'GT' => 'GT\d{2}[\dA-Z]{4}[\dA-Z]{20}', // Guatemala + 'HR' => 'HR\d{2}\d{7}\d{10}', // Croatia + 'HU' => 'HU\d{2}\d{3}\d{4}\d{1}\d{15}\d{1}', // Hungary + 'IE' => 'IE\d{2}[A-Z]{4}\d{6}\d{8}', // Ireland + 'IL' => 'IL\d{2}\d{3}\d{3}\d{13}', // Israel + 'IR' => 'IR\d{2}\d{22}', // Iran + 'IS' => 'IS\d{2}\d{4}\d{2}\d{6}\d{10}', // Iceland + 'IT' => 'IT\d{2}[A-Z]{1}\d{5}\d{5}[\dA-Z]{12}', // Italy + 'JO' => 'JO\d{2}[A-Z]{4}\d{4}[\dA-Z]{18}', // Jordan + 'KW' => 'KW\d{2}[A-Z]{4}\d{22}', // KUWAIT + 'KZ' => 'KZ\d{2}\d{3}[\dA-Z]{13}', // Kazakhstan + 'LB' => 'LB\d{2}\d{4}[\dA-Z]{20}', // LEBANON + 'LI' => 'LI\d{2}\d{5}[\dA-Z]{12}', // Liechtenstein (Principality of) + 'LT' => 'LT\d{2}\d{5}\d{11}', // Lithuania + 'LU' => 'LU\d{2}\d{3}[\dA-Z]{13}', // Luxembourg + 'LV' => 'LV\d{2}[A-Z]{4}[\dA-Z]{13}', // Latvia + 'MC' => 'MC\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Monaco + 'MD' => 'MD\d{2}[\dA-Z]{2}[\dA-Z]{18}', // Moldova + 'ME' => 'ME\d{2}\d{3}\d{13}\d{2}', // Montenegro + 'MF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Saint Martin (French part) + 'MG' => 'MG\d{2}\d{23}', // Madagascar + 'MK' => 'MK\d{2}\d{3}[\dA-Z]{10}\d{2}', // Macedonia, Former Yugoslav Republic of + 'ML' => 'ML\d{2}[A-Z]{1}\d{23}', // Mali + 'MQ' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Martinique + 'MR' => 'MR13\d{5}\d{5}\d{11}\d{2}', // Mauritania + 'MT' => 'MT\d{2}[A-Z]{4}\d{5}[\dA-Z]{18}', // Malta + 'MU' => 'MU\d{2}[A-Z]{4}\d{2}\d{2}\d{12}\d{3}[A-Z]{3}', // Mauritius + 'MZ' => 'MZ\d{2}\d{21}', // Mozambique + 'NC' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // New Caledonia + 'NL' => 'NL\d{2}[A-Z]{4}\d{10}', // The Netherlands + 'NO' => 'NO\d{2}\d{4}\d{6}\d{1}', // Norway + 'PF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // French Polynesia + 'PK' => 'PK\d{2}[A-Z]{4}[\dA-Z]{16}', // Pakistan + 'PL' => 'PL\d{2}\d{8}\d{16}', // Poland + 'PM' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Saint Pierre et Miquelon + 'PS' => 'PS\d{2}[A-Z]{4}[\dA-Z]{21}', // Palestine, State of + 'PT' => 'PT\d{2}\d{4}\d{4}\d{11}\d{2}', // Portugal (plus Azores and Madeira) + 'QA' => 'QA\d{2}[A-Z]{4}[\dA-Z]{21}', // Qatar + 'RE' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Reunion + 'RO' => 'RO\d{2}[A-Z]{4}[\dA-Z]{16}', // Romania + 'RS' => 'RS\d{2}\d{3}\d{13}\d{2}', // Serbia + 'SA' => 'SA\d{2}\d{2}[\dA-Z]{18}', // Saudi Arabia + 'SE' => 'SE\d{2}\d{3}\d{16}\d{1}', // Sweden + 'SI' => 'SI\d{2}\d{5}\d{8}\d{2}', // Slovenia + 'SK' => 'SK\d{2}\d{4}\d{6}\d{10}', // Slovak Republic + 'SM' => 'SM\d{2}[A-Z]{1}\d{5}\d{5}[\dA-Z]{12}', // San Marino + 'SN' => 'SN\d{2}[A-Z]{1}\d{23}', // Senegal + 'TF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // French Southern Territories + 'TL' => 'TL\d{2}\d{3}\d{14}\d{2}', // Timor-Leste + 'TN' => 'TN59\d{2}\d{3}\d{13}\d{2}', // Tunisia + 'TR' => 'TR\d{2}\d{5}[\dA-Z]{1}[\dA-Z]{16}', // Turkey + 'UA' => 'UA\d{2}\d{6}[\dA-Z]{19}', // Ukraine + 'VA' => 'VA\d{2}\d{3}\d{15}', // Vatican City State + 'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands, British + 'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Wallis and Futuna Islands + 'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Republic of Kosovo + 'YT' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Mayotte + ]; + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Iban) { + throw new UnexpectedTypeException($constraint, Iban::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + // Remove spaces and convert to uppercase + $canonicalized = str_replace(' ', '', strtoupper($value)); + + // The IBAN must contain only digits and characters... + if (!ctype_alnum($canonicalized)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + + // ...start with a two-letter country code + $countryCode = substr($canonicalized, 0, 2); + + if (!ctype_alpha($countryCode)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_COUNTRY_CODE_ERROR) + ->addViolation(); + + return; + } + + // ...have a format available + if (!\array_key_exists($countryCode, self::FORMATS)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::NOT_SUPPORTED_COUNTRY_CODE_ERROR) + ->addViolation(); + + return; + } + + // ...and have a valid format + if (!preg_match('/^'.self::FORMATS[$countryCode].'$/', $canonicalized) + ) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_FORMAT_ERROR) + ->addViolation(); + + return; + } + + // Move the first four characters to the end + // e.g. CH93 0076 2011 6238 5295 7 + // -> 0076 2011 6238 5295 7 CH93 + $canonicalized = substr($canonicalized, 4).substr($canonicalized, 0, 4); + + // Convert all remaining letters to their ordinals + // The result is an integer, which is too large for PHP's int + // data type, so we store it in a string instead. + // e.g. 0076 2011 6238 5295 7 CH93 + // -> 0076 2011 6238 5295 7 121893 + $checkSum = self::toBigInt($canonicalized); + + // Do a modulo-97 operation on the large integer + // We cannot use PHP's modulo operator, so we calculate the + // modulo step-wisely instead + if (1 !== self::bigModulo97($checkSum)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } + } + + private static function toBigInt(string $string): string + { + $chars = str_split($string); + $bigInt = ''; + + foreach ($chars as $char) { + // Convert uppercase characters to ordinals, starting with 10 for "A" + if (ctype_upper($char)) { + $bigInt .= (\ord($char) - 55); + + continue; + } + + // Simply append digits + $bigInt .= $char; + } + + return $bigInt; + } + + private static function bigModulo97(string $bigInt): int + { + $parts = str_split($bigInt, 7); + $rest = 0; + + foreach ($parts as $part) { + $rest = ($rest.$part) % 97; + } + + return $rest; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php new file mode 100644 index 00000000000..b3d6b92cba7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class IdenticalTo extends AbstractComparison +{ + public const NOT_IDENTICAL_ERROR = '2a8cc50f-58a2-4536-875e-060a2ce69ed5'; + + protected static $errorNames = [ + self::NOT_IDENTICAL_ERROR => 'NOT_IDENTICAL_ERROR', + ]; + + public $message = 'This value should be identical to {{ compared_value_type }} {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalToValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalToValidator.php new file mode 100644 index 00000000000..304f71f1912 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalToValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values are identical (===). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class IdenticalToValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return $value1 === $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return IdenticalTo::NOT_IDENTICAL_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Image.php b/upload/system/storage/vendor/symfony/validator/Constraints/Image.php new file mode 100644 index 00000000000..83fc9f9dd24 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Image.php @@ -0,0 +1,193 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Benjamin Dulau + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Image extends File +{ + public const SIZE_NOT_DETECTED_ERROR = '6d55c3f4-e58e-4fe3-91ee-74b492199956'; + public const TOO_WIDE_ERROR = '7f87163d-878f-47f5-99ba-a8eb723a1ab2'; + public const TOO_NARROW_ERROR = '9afbd561-4f90-4a27-be62-1780fc43604a'; + public const TOO_HIGH_ERROR = '7efae81c-4877-47ba-aa65-d01ccb0d4645'; + public const TOO_LOW_ERROR = 'aef0cb6a-c07f-4894-bc08-1781420d7b4c'; + public const TOO_FEW_PIXEL_ERROR = '1b06b97d-ae48-474e-978f-038a74854c43'; + public const TOO_MANY_PIXEL_ERROR = 'ee0804e8-44db-4eac-9775-be91aaf72ce1'; + public const RATIO_TOO_BIG_ERROR = '70cafca6-168f-41c9-8c8c-4e47a52be643'; + public const RATIO_TOO_SMALL_ERROR = '59b8c6ef-bcf2-4ceb-afff-4642ed92f12e'; + public const SQUARE_NOT_ALLOWED_ERROR = '5d41425b-facb-47f7-a55a-de9fbe45cb46'; + public const LANDSCAPE_NOT_ALLOWED_ERROR = '6f895685-7cf2-4d65-b3da-9029c5581d88'; + public const PORTRAIT_NOT_ALLOWED_ERROR = '65608156-77da-4c79-a88c-02ef6d18c782'; + public const CORRUPTED_IMAGE_ERROR = '5d4163f3-648f-4e39-87fd-cc5ea7aad2d1'; + + // Include the mapping from the base class + + protected static $errorNames = [ + self::NOT_FOUND_ERROR => 'NOT_FOUND_ERROR', + self::NOT_READABLE_ERROR => 'NOT_READABLE_ERROR', + self::EMPTY_ERROR => 'EMPTY_ERROR', + self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', + self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', + self::SIZE_NOT_DETECTED_ERROR => 'SIZE_NOT_DETECTED_ERROR', + self::TOO_WIDE_ERROR => 'TOO_WIDE_ERROR', + self::TOO_NARROW_ERROR => 'TOO_NARROW_ERROR', + self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', + self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', + self::TOO_FEW_PIXEL_ERROR => 'TOO_FEW_PIXEL_ERROR', + self::TOO_MANY_PIXEL_ERROR => 'TOO_MANY_PIXEL_ERROR', + self::RATIO_TOO_BIG_ERROR => 'RATIO_TOO_BIG_ERROR', + self::RATIO_TOO_SMALL_ERROR => 'RATIO_TOO_SMALL_ERROR', + self::SQUARE_NOT_ALLOWED_ERROR => 'SQUARE_NOT_ALLOWED_ERROR', + self::LANDSCAPE_NOT_ALLOWED_ERROR => 'LANDSCAPE_NOT_ALLOWED_ERROR', + self::PORTRAIT_NOT_ALLOWED_ERROR => 'PORTRAIT_NOT_ALLOWED_ERROR', + self::CORRUPTED_IMAGE_ERROR => 'CORRUPTED_IMAGE_ERROR', + ]; + + public $mimeTypes = 'image/*'; + public $minWidth; + public $maxWidth; + public $maxHeight; + public $minHeight; + public $maxRatio; + public $minRatio; + public $minPixels; + public $maxPixels; + public $allowSquare = true; + public $allowLandscape = true; + public $allowPortrait = true; + public $detectCorrupted = false; + + // The constant for a wrong MIME type is taken from the parent class. + public $mimeTypesMessage = 'This file is not a valid image.'; + public $sizeNotDetectedMessage = 'The size of the image could not be detected.'; + public $maxWidthMessage = 'The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.'; + public $minWidthMessage = 'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.'; + public $maxHeightMessage = 'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.'; + public $minHeightMessage = 'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.'; + public $minPixelsMessage = 'The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels.'; + public $maxPixelsMessage = 'The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels.'; + public $maxRatioMessage = 'The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.'; + public $minRatioMessage = 'The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.'; + public $allowSquareMessage = 'The image is square ({{ width }}x{{ height }}px). Square images are not allowed.'; + public $allowLandscapeMessage = 'The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.'; + public $allowPortraitMessage = 'The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.'; + public $corruptedMessage = 'The image file is corrupted.'; + + /** + * {@inheritdoc} + * + * @param int|float $maxRatio + * @param int|float $minRatio + * @param int|float $minPixels + * @param int|float $maxPixels + */ + public function __construct( + array $options = null, + $maxSize = null, + bool $binaryFormat = null, + array $mimeTypes = null, + int $minWidth = null, + int $maxWidth = null, + int $maxHeight = null, + int $minHeight = null, + $maxRatio = null, + $minRatio = null, + $minPixels = null, + $maxPixels = null, + bool $allowSquare = null, + bool $allowLandscape = null, + bool $allowPortrait = null, + bool $detectCorrupted = null, + string $notFoundMessage = null, + string $notReadableMessage = null, + string $maxSizeMessage = null, + string $mimeTypesMessage = null, + string $disallowEmptyMessage = null, + string $uploadIniSizeErrorMessage = null, + string $uploadFormSizeErrorMessage = null, + string $uploadPartialErrorMessage = null, + string $uploadNoFileErrorMessage = null, + string $uploadNoTmpDirErrorMessage = null, + string $uploadCantWriteErrorMessage = null, + string $uploadExtensionErrorMessage = null, + string $uploadErrorMessage = null, + string $sizeNotDetectedMessage = null, + string $maxWidthMessage = null, + string $minWidthMessage = null, + string $maxHeightMessage = null, + string $minHeightMessage = null, + string $minPixelsMessage = null, + string $maxPixelsMessage = null, + string $maxRatioMessage = null, + string $minRatioMessage = null, + string $allowSquareMessage = null, + string $allowLandscapeMessage = null, + string $allowPortraitMessage = null, + string $corruptedMessage = null, + array $groups = null, + $payload = null + ) { + parent::__construct( + $options, + $maxSize, + $binaryFormat, + $mimeTypes, + $notFoundMessage, + $notReadableMessage, + $maxSizeMessage, + $mimeTypesMessage, + $disallowEmptyMessage, + $uploadIniSizeErrorMessage, + $uploadFormSizeErrorMessage, + $uploadPartialErrorMessage, + $uploadNoFileErrorMessage, + $uploadNoTmpDirErrorMessage, + $uploadCantWriteErrorMessage, + $uploadExtensionErrorMessage, + $uploadErrorMessage, + $groups, + $payload + ); + + $this->minWidth = $minWidth ?? $this->minWidth; + $this->maxWidth = $maxWidth ?? $this->maxWidth; + $this->maxHeight = $maxHeight ?? $this->maxHeight; + $this->minHeight = $minHeight ?? $this->minHeight; + $this->maxRatio = $maxRatio ?? $this->maxRatio; + $this->minRatio = $minRatio ?? $this->minRatio; + $this->minPixels = $minPixels ?? $this->minPixels; + $this->maxPixels = $maxPixels ?? $this->maxPixels; + $this->allowSquare = $allowSquare ?? $this->allowSquare; + $this->allowLandscape = $allowLandscape ?? $this->allowLandscape; + $this->allowPortrait = $allowPortrait ?? $this->allowPortrait; + $this->detectCorrupted = $detectCorrupted ?? $this->detectCorrupted; + $this->sizeNotDetectedMessage = $sizeNotDetectedMessage ?? $this->sizeNotDetectedMessage; + $this->maxWidthMessage = $maxWidthMessage ?? $this->maxWidthMessage; + $this->minWidthMessage = $minWidthMessage ?? $this->minWidthMessage; + $this->maxHeightMessage = $maxHeightMessage ?? $this->maxHeightMessage; + $this->minHeightMessage = $minHeightMessage ?? $this->minHeightMessage; + $this->minPixelsMessage = $minPixelsMessage ?? $this->minPixelsMessage; + $this->maxPixelsMessage = $maxPixelsMessage ?? $this->maxPixelsMessage; + $this->maxRatioMessage = $maxRatioMessage ?? $this->maxRatioMessage; + $this->minRatioMessage = $minRatioMessage ?? $this->minRatioMessage; + $this->allowSquareMessage = $allowSquareMessage ?? $this->allowSquareMessage; + $this->allowLandscapeMessage = $allowLandscapeMessage ?? $this->allowLandscapeMessage; + $this->allowPortraitMessage = $allowPortraitMessage ?? $this->allowPortraitMessage; + $this->corruptedMessage = $corruptedMessage ?? $this->corruptedMessage; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php new file mode 100644 index 00000000000..f199f1d177d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php @@ -0,0 +1,237 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\LogicException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * Validates whether a value is a valid image file and is valid + * against minWidth, maxWidth, minHeight and maxHeight constraints. + * + * @author Benjamin Dulau + * @author Bernhard Schussek + */ +class ImageValidator extends FileValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Image) { + throw new UnexpectedTypeException($constraint, Image::class); + } + + $violations = \count($this->context->getViolations()); + + parent::validate($value, $constraint); + + $failed = \count($this->context->getViolations()) !== $violations; + + if ($failed || null === $value || '' === $value) { + return; + } + + if (null === $constraint->minWidth && null === $constraint->maxWidth + && null === $constraint->minHeight && null === $constraint->maxHeight + && null === $constraint->minPixels && null === $constraint->maxPixels + && null === $constraint->minRatio && null === $constraint->maxRatio + && $constraint->allowSquare && $constraint->allowLandscape && $constraint->allowPortrait + && !$constraint->detectCorrupted) { + return; + } + + $size = @getimagesize($value); + + if (empty($size) || (0 === $size[0]) || (0 === $size[1])) { + $this->context->buildViolation($constraint->sizeNotDetectedMessage) + ->setCode(Image::SIZE_NOT_DETECTED_ERROR) + ->addViolation(); + + return; + } + + $width = $size[0]; + $height = $size[1]; + + if ($constraint->minWidth) { + if (!ctype_digit((string) $constraint->minWidth)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum width.', $constraint->minWidth)); + } + + if ($width < $constraint->minWidth) { + $this->context->buildViolation($constraint->minWidthMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ min_width }}', $constraint->minWidth) + ->setCode(Image::TOO_NARROW_ERROR) + ->addViolation(); + + return; + } + } + + if ($constraint->maxWidth) { + if (!ctype_digit((string) $constraint->maxWidth)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum width.', $constraint->maxWidth)); + } + + if ($width > $constraint->maxWidth) { + $this->context->buildViolation($constraint->maxWidthMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ max_width }}', $constraint->maxWidth) + ->setCode(Image::TOO_WIDE_ERROR) + ->addViolation(); + + return; + } + } + + if ($constraint->minHeight) { + if (!ctype_digit((string) $constraint->minHeight)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum height.', $constraint->minHeight)); + } + + if ($height < $constraint->minHeight) { + $this->context->buildViolation($constraint->minHeightMessage) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ min_height }}', $constraint->minHeight) + ->setCode(Image::TOO_LOW_ERROR) + ->addViolation(); + + return; + } + } + + if ($constraint->maxHeight) { + if (!ctype_digit((string) $constraint->maxHeight)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum height.', $constraint->maxHeight)); + } + + if ($height > $constraint->maxHeight) { + $this->context->buildViolation($constraint->maxHeightMessage) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ max_height }}', $constraint->maxHeight) + ->setCode(Image::TOO_HIGH_ERROR) + ->addViolation(); + } + } + + $pixels = $width * $height; + + if (null !== $constraint->minPixels) { + if (!ctype_digit((string) $constraint->minPixels)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum amount of pixels.', $constraint->minPixels)); + } + + if ($pixels < $constraint->minPixels) { + $this->context->buildViolation($constraint->minPixelsMessage) + ->setParameter('{{ pixels }}', $pixels) + ->setParameter('{{ min_pixels }}', $constraint->minPixels) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ width }}', $width) + ->setCode(Image::TOO_FEW_PIXEL_ERROR) + ->addViolation(); + } + } + + if (null !== $constraint->maxPixels) { + if (!ctype_digit((string) $constraint->maxPixels)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum amount of pixels.', $constraint->maxPixels)); + } + + if ($pixels > $constraint->maxPixels) { + $this->context->buildViolation($constraint->maxPixelsMessage) + ->setParameter('{{ pixels }}', $pixels) + ->setParameter('{{ max_pixels }}', $constraint->maxPixels) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ width }}', $width) + ->setCode(Image::TOO_MANY_PIXEL_ERROR) + ->addViolation(); + } + } + + $ratio = round($width / $height, 2); + + if (null !== $constraint->minRatio) { + if (!is_numeric((string) $constraint->minRatio)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum ratio.', $constraint->minRatio)); + } + + if ($ratio < round($constraint->minRatio, 2)) { + $this->context->buildViolation($constraint->minRatioMessage) + ->setParameter('{{ ratio }}', $ratio) + ->setParameter('{{ min_ratio }}', round($constraint->minRatio, 2)) + ->setCode(Image::RATIO_TOO_SMALL_ERROR) + ->addViolation(); + } + } + + if (null !== $constraint->maxRatio) { + if (!is_numeric((string) $constraint->maxRatio)) { + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum ratio.', $constraint->maxRatio)); + } + + if ($ratio > round($constraint->maxRatio, 2)) { + $this->context->buildViolation($constraint->maxRatioMessage) + ->setParameter('{{ ratio }}', $ratio) + ->setParameter('{{ max_ratio }}', round($constraint->maxRatio, 2)) + ->setCode(Image::RATIO_TOO_BIG_ERROR) + ->addViolation(); + } + } + + if (!$constraint->allowSquare && $width == $height) { + $this->context->buildViolation($constraint->allowSquareMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::SQUARE_NOT_ALLOWED_ERROR) + ->addViolation(); + } + + if (!$constraint->allowLandscape && $width > $height) { + $this->context->buildViolation($constraint->allowLandscapeMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::LANDSCAPE_NOT_ALLOWED_ERROR) + ->addViolation(); + } + + if (!$constraint->allowPortrait && $width < $height) { + $this->context->buildViolation($constraint->allowPortraitMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::PORTRAIT_NOT_ALLOWED_ERROR) + ->addViolation(); + } + + if ($constraint->detectCorrupted) { + if (!\function_exists('imagecreatefromstring')) { + throw new LogicException('Corrupted images detection requires installed and enabled GD extension.'); + } + + $resource = @imagecreatefromstring(file_get_contents($value)); + + if (false === $resource) { + $this->context->buildViolation($constraint->corruptedMessage) + ->setCode(Image::CORRUPTED_IMAGE_ERROR) + ->addViolation(); + + return; + } + + imagedestroy($resource); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Ip.php b/upload/system/storage/vendor/symfony/validator/Constraints/Ip.php new file mode 100644 index 00000000000..0e4124074fd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Ip.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * Validates that a value is a valid IP address. + * + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + * @author Joseph Bielawski + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Ip extends Constraint +{ + public const V4 = '4'; + public const V6 = '6'; + public const ALL = 'all'; + + // adds FILTER_FLAG_NO_PRIV_RANGE flag (skip private ranges) + public const V4_NO_PRIV = '4_no_priv'; + public const V6_NO_PRIV = '6_no_priv'; + public const ALL_NO_PRIV = 'all_no_priv'; + + // adds FILTER_FLAG_NO_RES_RANGE flag (skip reserved ranges) + public const V4_NO_RES = '4_no_res'; + public const V6_NO_RES = '6_no_res'; + public const ALL_NO_RES = 'all_no_res'; + + // adds FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE flags (skip both) + public const V4_ONLY_PUBLIC = '4_public'; + public const V6_ONLY_PUBLIC = '6_public'; + public const ALL_ONLY_PUBLIC = 'all_public'; + + public const INVALID_IP_ERROR = 'b1b427ae-9f6f-41b0-aa9b-84511fbb3c5b'; + + protected static $versions = [ + self::V4, + self::V6, + self::ALL, + + self::V4_NO_PRIV, + self::V6_NO_PRIV, + self::ALL_NO_PRIV, + + self::V4_NO_RES, + self::V6_NO_RES, + self::ALL_NO_RES, + + self::V4_ONLY_PUBLIC, + self::V6_ONLY_PUBLIC, + self::ALL_ONLY_PUBLIC, + ]; + + protected static $errorNames = [ + self::INVALID_IP_ERROR => 'INVALID_IP_ERROR', + ]; + + public $version = self::V4; + + public $message = 'This is not a valid IP address.'; + + public $normalizer; + + /** + * {@inheritdoc} + */ + public function __construct( + array $options = null, + string $version = null, + string $message = null, + callable $normalizer = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->version = $version ?? $this->version; + $this->message = $message ?? $this->message; + $this->normalizer = $normalizer ?? $this->normalizer; + + if (!\in_array($this->version, self::$versions)) { + throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s".', implode('", "', self::$versions))); + } + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php new file mode 100644 index 00000000000..e48d41e6d4b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether a value is a valid IP address. + * + * @author Bernhard Schussek + * @author Joseph Bielawski + */ +class IpValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Ip) { + throw new UnexpectedTypeException($constraint, Ip::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (null !== $constraint->normalizer) { + $value = ($constraint->normalizer)($value); + } + + switch ($constraint->version) { + case Ip::V4: + $flag = \FILTER_FLAG_IPV4; + break; + + case Ip::V6: + $flag = \FILTER_FLAG_IPV6; + break; + + case Ip::V4_NO_PRIV: + $flag = \FILTER_FLAG_IPV4 | \FILTER_FLAG_NO_PRIV_RANGE; + break; + + case Ip::V6_NO_PRIV: + $flag = \FILTER_FLAG_IPV6 | \FILTER_FLAG_NO_PRIV_RANGE; + break; + + case Ip::ALL_NO_PRIV: + $flag = \FILTER_FLAG_NO_PRIV_RANGE; + break; + + case Ip::V4_NO_RES: + $flag = \FILTER_FLAG_IPV4 | \FILTER_FLAG_NO_RES_RANGE; + break; + + case Ip::V6_NO_RES: + $flag = \FILTER_FLAG_IPV6 | \FILTER_FLAG_NO_RES_RANGE; + break; + + case Ip::ALL_NO_RES: + $flag = \FILTER_FLAG_NO_RES_RANGE; + break; + + case Ip::V4_ONLY_PUBLIC: + $flag = \FILTER_FLAG_IPV4 | \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE; + break; + + case Ip::V6_ONLY_PUBLIC: + $flag = \FILTER_FLAG_IPV6 | \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE; + break; + + case Ip::ALL_ONLY_PUBLIC: + $flag = \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE; + break; + + default: + $flag = 0; + break; + } + + if (!filter_var($value, \FILTER_VALIDATE_IP, $flag)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Ip::INVALID_IP_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php new file mode 100644 index 00000000000..460aafc6d97 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class IsFalse extends Constraint +{ + public const NOT_FALSE_ERROR = 'd53a91b0-def3-426a-83d7-269da7ab4200'; + + protected static $errorNames = [ + self::NOT_FALSE_ERROR => 'NOT_FALSE_ERROR', + ]; + + public $message = 'This value should be false.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options ?? [], $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php new file mode 100644 index 00000000000..79c42348fec --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class IsFalseValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof IsFalse) { + throw new UnexpectedTypeException($constraint, IsFalse::class); + } + + if (null === $value || false === $value || 0 === $value || '0' === $value) { + return; + } + + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsFalse::NOT_FALSE_ERROR) + ->addViolation(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php new file mode 100644 index 00000000000..2a8439f429b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class IsNull extends Constraint +{ + public const NOT_NULL_ERROR = '60d2f30b-8cfa-4372-b155-9656634de120'; + + protected static $errorNames = [ + self::NOT_NULL_ERROR => 'NOT_NULL_ERROR', + ]; + + public $message = 'This value should be null.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options ?? [], $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php new file mode 100644 index 00000000000..b6e78170f92 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class IsNullValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof IsNull) { + throw new UnexpectedTypeException($constraint, IsNull::class); + } + + if (null !== $value) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsNull::NOT_NULL_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php new file mode 100644 index 00000000000..7b95475e381 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class IsTrue extends Constraint +{ + public const NOT_TRUE_ERROR = '2beabf1c-54c0-4882-a928-05249b26e23b'; + + protected static $errorNames = [ + self::NOT_TRUE_ERROR => 'NOT_TRUE_ERROR', + ]; + + public $message = 'This value should be true.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options ?? [], $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php new file mode 100644 index 00000000000..6088f6d7a7a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class IsTrueValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof IsTrue) { + throw new UnexpectedTypeException($constraint, IsTrue::class); + } + + if (null === $value) { + return; + } + + if (true !== $value && 1 !== $value && '1' !== $value) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsTrue::NOT_TRUE_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php b/upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php new file mode 100644 index 00000000000..b95dfebca99 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author The Whole Life To Learn + * @author Manuel Reinhard + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Isbn extends Constraint +{ + public const ISBN_10 = 'isbn10'; + public const ISBN_13 = 'isbn13'; + + public const TOO_SHORT_ERROR = '949acbb0-8ef5-43ed-a0e9-032dfd08ae45'; + public const TOO_LONG_ERROR = '3171387d-f80a-47b3-bd6e-60598545316a'; + public const INVALID_CHARACTERS_ERROR = '23d21cea-da99-453d-98b1-a7d916fbb339'; + public const CHECKSUM_FAILED_ERROR = '2881c032-660f-46b6-8153-d352d9706640'; + public const TYPE_NOT_RECOGNIZED_ERROR = 'fa54a457-f042-441f-89c4-066ee5bdd3e1'; + + protected static $errorNames = [ + self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', + self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', + self::TYPE_NOT_RECOGNIZED_ERROR => 'TYPE_NOT_RECOGNIZED_ERROR', + ]; + + public $isbn10Message = 'This value is not a valid ISBN-10.'; + public $isbn13Message = 'This value is not a valid ISBN-13.'; + public $bothIsbnMessage = 'This value is neither a valid ISBN-10 nor a valid ISBN-13.'; + public $type; + public $message; + + /** + * {@inheritdoc} + * + * @param string|array|null $type The ISBN standard to validate or a set of options + */ + public function __construct( + $type = null, + string $message = null, + string $isbn10Message = null, + string $isbn13Message = null, + string $bothIsbnMessage = null, + array $groups = null, + $payload = null, + array $options = [] + ) { + if (\is_array($type)) { + $options = array_merge($type, $options); + } elseif (null !== $type) { + $options['value'] = $type; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->isbn10Message = $isbn10Message ?? $this->isbn10Message; + $this->isbn13Message = $isbn13Message ?? $this->isbn13Message; + $this->bothIsbnMessage = $bothIsbnMessage ?? $this->bothIsbnMessage; + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'type'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php new file mode 100644 index 00000000000..d015a1df7af --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php @@ -0,0 +1,184 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether the value is a valid ISBN-10 or ISBN-13. + * + * @author The Whole Life To Learn + * @author Manuel Reinhard + * @author Bernhard Schussek + * + * @see https://en.wikipedia.org/wiki/Isbn + */ +class IsbnValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Isbn) { + throw new UnexpectedTypeException($constraint, Isbn::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + $canonical = str_replace('-', '', $value); + + // Explicitly validate against ISBN-10 + if (Isbn::ISBN_10 === $constraint->type) { + if (true !== ($code = $this->validateIsbn10($canonical))) { + $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } + + return; + } + + // Explicitly validate against ISBN-13 + if (Isbn::ISBN_13 === $constraint->type) { + if (true !== ($code = $this->validateIsbn13($canonical))) { + $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } + + return; + } + + // Try both ISBNs + + // First, try ISBN-10 + $code = $this->validateIsbn10($canonical); + + // The ISBN can only be an ISBN-13 if the value was too long for ISBN-10 + if (Isbn::TOO_LONG_ERROR === $code) { + // Try ISBN-13 now + $code = $this->validateIsbn13($canonical); + + // If too short, this means we have 11 or 12 digits + if (Isbn::TOO_SHORT_ERROR === $code) { + $code = Isbn::TYPE_NOT_RECOGNIZED_ERROR; + } + } + + if (true !== $code) { + $this->context->buildViolation($this->getMessage($constraint)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } + } + + protected function validateIsbn10(string $isbn) + { + // Choose an algorithm so that ERROR_INVALID_CHARACTERS is preferred + // over ERROR_TOO_SHORT/ERROR_TOO_LONG + // Otherwise "0-45122-5244" passes, but "0-45122_5244" reports + // "too long" + + // Error priority: + // 1. ERROR_INVALID_CHARACTERS + // 2. ERROR_TOO_SHORT/ERROR_TOO_LONG + // 3. ERROR_CHECKSUM_FAILED + + $checkSum = 0; + + for ($i = 0; $i < 10; ++$i) { + // If we test the length before the loop, we get an ERROR_TOO_SHORT + // when actually an ERROR_INVALID_CHARACTERS is wanted, e.g. for + // "0-45122_5244" (typo) + if (!isset($isbn[$i])) { + return Isbn::TOO_SHORT_ERROR; + } + + if ('X' === $isbn[$i]) { + $digit = 10; + } elseif (ctype_digit($isbn[$i])) { + $digit = $isbn[$i]; + } else { + return Isbn::INVALID_CHARACTERS_ERROR; + } + + $checkSum += $digit * (10 - $i); + } + + if (isset($isbn[$i])) { + return Isbn::TOO_LONG_ERROR; + } + + return 0 === $checkSum % 11 ? true : Isbn::CHECKSUM_FAILED_ERROR; + } + + protected function validateIsbn13(string $isbn) + { + // Error priority: + // 1. ERROR_INVALID_CHARACTERS + // 2. ERROR_TOO_SHORT/ERROR_TOO_LONG + // 3. ERROR_CHECKSUM_FAILED + + if (!ctype_digit($isbn)) { + return Isbn::INVALID_CHARACTERS_ERROR; + } + + $length = \strlen($isbn); + + if ($length < 13) { + return Isbn::TOO_SHORT_ERROR; + } + + if ($length > 13) { + return Isbn::TOO_LONG_ERROR; + } + + $checkSum = 0; + + for ($i = 0; $i < 13; $i += 2) { + $checkSum += $isbn[$i]; + } + + for ($i = 1; $i < 12; $i += 2) { + $checkSum += $isbn[$i] * 3; + } + + return 0 === $checkSum % 10 ? true : Isbn::CHECKSUM_FAILED_ERROR; + } + + protected function getMessage(Isbn $constraint, string $type = null) + { + if (null !== $constraint->message) { + return $constraint->message; + } elseif (Isbn::ISBN_10 === $type) { + return $constraint->isbn10Message; + } elseif (Isbn::ISBN_13 === $type) { + return $constraint->isbn13Message; + } + + return $constraint->bothIsbnMessage; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Isin.php b/upload/system/storage/vendor/symfony/validator/Constraints/Isin.php new file mode 100644 index 00000000000..08fa60d41b9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Isin.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Laurent Masforné + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Isin extends Constraint +{ + public const VALIDATION_LENGTH = 12; + public const VALIDATION_PATTERN = '/[A-Z]{2}[A-Z0-9]{9}[0-9]{1}/'; + + public const INVALID_LENGTH_ERROR = '88738dfc-9ed5-ba1e-aebe-402a2a9bf58e'; + public const INVALID_PATTERN_ERROR = '3d08ce0-ded9-a93d-9216-17ac21265b65e'; + public const INVALID_CHECKSUM_ERROR = '32089b-0ee1-93ba-399e-aa232e62f2d29d'; + + protected static $errorNames = [ + self::INVALID_LENGTH_ERROR => 'INVALID_LENGTH_ERROR', + self::INVALID_PATTERN_ERROR => 'INVALID_PATTERN_ERROR', + self::INVALID_CHECKSUM_ERROR => 'INVALID_CHECKSUM_ERROR', + ]; + + public $message = 'This value is not a valid International Securities Identification Number (ISIN).'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php new file mode 100644 index 00000000000..d5e4d9dbc97 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Laurent Masforné + * + * @see https://en.wikipedia.org/wiki/International_Securities_Identification_Number + */ +class IsinValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Isin) { + throw new UnexpectedTypeException($constraint, Isin::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = strtoupper($value); + + if (Isin::VALIDATION_LENGTH !== \strlen($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Isin::INVALID_LENGTH_ERROR) + ->addViolation(); + + return; + } + + if (!preg_match(Isin::VALIDATION_PATTERN, $value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Isin::INVALID_PATTERN_ERROR) + ->addViolation(); + + return; + } + + if (!$this->isCorrectChecksum($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Isin::INVALID_CHECKSUM_ERROR) + ->addViolation(); + } + } + + private function isCorrectChecksum(string $input): bool + { + $characters = str_split($input); + foreach ($characters as $i => $char) { + $characters[$i] = \intval($char, 36); + } + $number = implode('', $characters); + + return 0 === $this->context->getValidator()->validate($number, new Luhn())->count(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Issn.php b/upload/system/storage/vendor/symfony/validator/Constraints/Issn.php new file mode 100644 index 00000000000..b3b7b21f6c9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Issn.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Antonio J. García Lagar + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Issn extends Constraint +{ + public const TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb'; + public const TOO_LONG_ERROR = '37cef893-5871-464e-8b12-7fb79324833c'; + public const MISSING_HYPHEN_ERROR = '2983286f-8134-4693-957a-1ec4ef887b15'; + public const INVALID_CHARACTERS_ERROR = 'a663d266-37c2-4ece-a914-ae891940c588'; + public const INVALID_CASE_ERROR = '7b6dd393-7523-4a6c-b84d-72b91bba5e1a'; + public const CHECKSUM_FAILED_ERROR = 'b0f92dbc-667c-48de-b526-ad9586d43e85'; + + protected static $errorNames = [ + self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', + self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', + self::MISSING_HYPHEN_ERROR => 'MISSING_HYPHEN_ERROR', + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR', + self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', + ]; + + public $message = 'This value is not a valid ISSN.'; + public $caseSensitive = false; + public $requireHyphen = false; + + public function __construct( + array $options = null, + string $message = null, + bool $caseSensitive = null, + bool $requireHyphen = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->caseSensitive = $caseSensitive ?? $this->caseSensitive; + $this->requireHyphen = $requireHyphen ?? $this->requireHyphen; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php new file mode 100644 index 00000000000..aa83201cdab --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php @@ -0,0 +1,131 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether the value is a valid ISSN. + * + * @author Antonio J. García Lagar + * @author Bernhard Schussek + * + * @see https://en.wikipedia.org/wiki/Issn + */ +class IssnValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Issn) { + throw new UnexpectedTypeException($constraint, Issn::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + $canonical = $value; + + // 1234-567X + // ^ + if (isset($canonical[4]) && '-' === $canonical[4]) { + // remove hyphen + $canonical = substr($canonical, 0, 4).substr($canonical, 5); + } elseif ($constraint->requireHyphen) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::MISSING_HYPHEN_ERROR) + ->addViolation(); + + return; + } + + $length = \strlen($canonical); + + if ($length < 8) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::TOO_SHORT_ERROR) + ->addViolation(); + + return; + } + + if ($length > 8) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::TOO_LONG_ERROR) + ->addViolation(); + + return; + } + + // 1234567X + // ^^^^^^^ digits only + if (!ctype_digit(substr($canonical, 0, 7))) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + + // 1234567X + // ^ digit, x or X + if (!ctype_digit($canonical[7]) && 'x' !== $canonical[7] && 'X' !== $canonical[7]) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + + // 1234567X + // ^ case-sensitive? + if ($constraint->caseSensitive && 'x' === $canonical[7]) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CASE_ERROR) + ->addViolation(); + + return; + } + + // Calculate a checksum. "X" equals 10. + $checkSum = 'X' === $canonical[7] || 'x' === $canonical[7] ? 10 : $canonical[7]; + + for ($i = 0; $i < 7; ++$i) { + // Multiply the first digit by 8, the second by 7, etc. + $checkSum += (8 - $i) * (int) $canonical[$i]; + } + + if (0 !== $checkSum % 11) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Json.php b/upload/system/storage/vendor/symfony/validator/Constraints/Json.php new file mode 100644 index 00000000000..4388858540b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Json.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Imad ZAIRIG + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Json extends Constraint +{ + public const INVALID_JSON_ERROR = '0789c8ad-2d2b-49a4-8356-e2ce63998504'; + + protected static $errorNames = [ + self::INVALID_JSON_ERROR => 'INVALID_JSON_ERROR', + ]; + + public $message = 'This value should be valid JSON.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php new file mode 100644 index 00000000000..e553ae359b1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Imad ZAIRIG + */ +class JsonValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Json) { + throw new UnexpectedTypeException($constraint, Json::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedTypeException($value, 'string'); + } + + $value = (string) $value; + + json_decode($value); + + if (\JSON_ERROR_NONE !== json_last_error()) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Json::INVALID_JSON_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Language.php b/upload/system/storage/vendor/symfony/validator/Constraints/Language.php new file mode 100644 index 00000000000..a8204da718a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Language.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Languages; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Language extends Constraint +{ + public const NO_SUCH_LANGUAGE_ERROR = 'ee65fec4-9a20-4202-9f39-ca558cd7bdf7'; + + protected static $errorNames = [ + self::NO_SUCH_LANGUAGE_ERROR => 'NO_SUCH_LANGUAGE_ERROR', + ]; + + public $message = 'This value is not a valid language.'; + public $alpha3 = false; + + public function __construct( + array $options = null, + string $message = null, + bool $alpha3 = null, + array $groups = null, + $payload = null + ) { + if (!class_exists(Languages::class)) { + throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".'); + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->alpha3 = $alpha3 ?? $this->alpha3; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php new file mode 100644 index 00000000000..911a7133148 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Languages; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether a value is a valid language code. + * + * @author Bernhard Schussek + */ +class LanguageValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Language) { + throw new UnexpectedTypeException($constraint, Language::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if ($constraint->alpha3 ? !Languages::alpha3CodeExists($value) : !Languages::exists($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Language::NO_SUCH_LANGUAGE_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Length.php b/upload/system/storage/vendor/symfony/validator/Constraints/Length.php new file mode 100644 index 00000000000..29a89a3f3d3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Length.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; +use Symfony\Component\Validator\Exception\MissingOptionsException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Length extends Constraint +{ + public const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45'; + public const TOO_LONG_ERROR = 'd94b19cc-114f-4f44-9cc4-4138e80a87b9'; + public const NOT_EQUAL_LENGTH_ERROR = '4b6f5c76-22b4-409d-af16-fbe823ba9332'; + public const INVALID_CHARACTERS_ERROR = '35e6a710-aa2e-4719-b58e-24b35749b767'; + + protected static $errorNames = [ + self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', + self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', + self::NOT_EQUAL_LENGTH_ERROR => 'NOT_EQUAL_LENGTH_ERROR', + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + ]; + + public $maxMessage = 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.'; + public $minMessage = 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.'; + public $exactMessage = 'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.'; + public $charsetMessage = 'This value does not match the expected {{ charset }} charset.'; + public $max; + public $min; + public $charset = 'UTF-8'; + public $normalizer; + public $allowEmptyString = false; + + /** + * {@inheritdoc} + * + * @param int|array|null $exactly The expected exact length or a set of options + */ + public function __construct( + $exactly = null, + int $min = null, + int $max = null, + string $charset = null, + callable $normalizer = null, + string $exactMessage = null, + string $minMessage = null, + string $maxMessage = null, + string $charsetMessage = null, + array $groups = null, + $payload = null, + array $options = [] + ) { + if (\is_array($exactly)) { + $options = array_merge($exactly, $options); + $exactly = $options['value'] ?? null; + } + + $min = $min ?? $options['min'] ?? null; + $max = $max ?? $options['max'] ?? null; + + unset($options['value'], $options['min'], $options['max']); + + if (null !== $exactly && null === $min && null === $max) { + $min = $max = $exactly; + } + + parent::__construct($options, $groups, $payload); + + $this->min = $min; + $this->max = $max; + $this->charset = $charset ?? $this->charset; + $this->normalizer = $normalizer ?? $this->normalizer; + $this->exactMessage = $exactMessage ?? $this->exactMessage; + $this->minMessage = $minMessage ?? $this->minMessage; + $this->maxMessage = $maxMessage ?? $this->maxMessage; + $this->charsetMessage = $charsetMessage ?? $this->charsetMessage; + + if (null === $this->min && null === $this->max) { + throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint "%s".', __CLASS__), ['min', 'max']); + } + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + + if (isset($options['allowEmptyString'])) { + trigger_deprecation('symfony/validator', '5.2', sprintf('The "allowEmptyString" option of the "%s" constraint is deprecated.', self::class)); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php new file mode 100644 index 00000000000..c4bbffeb275 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class LengthValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Length) { + throw new UnexpectedTypeException($constraint, Length::class); + } + + if (null === $value || ('' === $value && $constraint->allowEmptyString)) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $stringValue = (string) $value; + + if (null !== $constraint->normalizer) { + $stringValue = ($constraint->normalizer)($stringValue); + } + + try { + $invalidCharset = !@mb_check_encoding($stringValue, $constraint->charset); + } catch (\ValueError $e) { + if (!str_starts_with($e->getMessage(), 'mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding')) { + throw $e; + } + + $invalidCharset = true; + } + + if ($invalidCharset) { + $this->context->buildViolation($constraint->charsetMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ charset }}', $constraint->charset) + ->setInvalidValue($value) + ->setCode(Length::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + + $length = mb_strlen($stringValue, $constraint->charset); + + if (null !== $constraint->max && $length > $constraint->max) { + $exactlyOptionEnabled = $constraint->min == $constraint->max; + + $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->maxMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ limit }}', $constraint->max) + ->setInvalidValue($value) + ->setPlural((int) $constraint->max) + ->setCode($exactlyOptionEnabled ? Length::NOT_EQUAL_LENGTH_ERROR : Length::TOO_LONG_ERROR) + ->addViolation(); + + return; + } + + if (null !== $constraint->min && $length < $constraint->min) { + $exactlyOptionEnabled = $constraint->min == $constraint->max; + + $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->minMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ limit }}', $constraint->min) + ->setInvalidValue($value) + ->setPlural((int) $constraint->min) + ->setCode($exactlyOptionEnabled ? Length::NOT_EQUAL_LENGTH_ERROR : Length::TOO_SHORT_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php new file mode 100644 index 00000000000..acd6c9e66ff --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class LessThan extends AbstractComparison +{ + public const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2'; + + protected static $errorNames = [ + self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', + ]; + + public $message = 'This value should be less than {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php new file mode 100644 index 00000000000..6f728459407 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class LessThanOrEqual extends AbstractComparison +{ + public const TOO_HIGH_ERROR = '30fbb013-d015-4232-8b3b-8f3be97a7e14'; + + protected static $errorNames = [ + self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', + ]; + + public $message = 'This value should be less than or equal to {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php new file mode 100644 index 00000000000..f7f4c8be5f3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values are less than or equal to the previous (<=). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class LessThanOrEqualValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return null === $value2 || $value1 <= $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return LessThanOrEqual::TOO_HIGH_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php new file mode 100644 index 00000000000..64e107547ac --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values are less than the previous (<). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class LessThanValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return null === $value2 || $value1 < $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return LessThan::TOO_HIGH_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Locale.php b/upload/system/storage/vendor/symfony/validator/Constraints/Locale.php new file mode 100644 index 00000000000..43c46cc7b17 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Locale.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Locales; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\LogicException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Locale extends Constraint +{ + public const NO_SUCH_LOCALE_ERROR = 'a0af4293-1f1a-4a1c-a328-979cba6182a2'; + + protected static $errorNames = [ + self::NO_SUCH_LOCALE_ERROR => 'NO_SUCH_LOCALE_ERROR', + ]; + + public $message = 'This value is not a valid locale.'; + public $canonicalize = true; + + public function __construct( + array $options = null, + string $message = null, + bool $canonicalize = null, + array $groups = null, + $payload = null + ) { + if (!class_exists(Locales::class)) { + throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".'); + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->canonicalize = $canonicalize ?? $this->canonicalize; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php new file mode 100644 index 00000000000..860273d4f7e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Locales; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether a value is a valid locale code. + * + * @author Bernhard Schussek + */ +class LocaleValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Locale) { + throw new UnexpectedTypeException($constraint, Locale::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $inputValue = (string) $value; + $value = $inputValue; + if ($constraint->canonicalize) { + $value = \Locale::canonicalize($value); + } + + if (!Locales::exists($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($inputValue)) + ->setCode(Locale::NO_SUCH_LOCALE_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php b/upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php new file mode 100644 index 00000000000..b2d2c297948 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * Metadata for the LuhnValidator. + * + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Tim Nagel + * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/ + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Luhn extends Constraint +{ + public const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e'; + public const CHECKSUM_FAILED_ERROR = '4d760774-3f50-4cd5-a6d5-b10a3299d8d3'; + + protected static $errorNames = [ + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', + ]; + + public $message = 'Invalid card number.'; + + public function __construct( + array $options = null, + string $message = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php new file mode 100644 index 00000000000..0f568fa6e49 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates a PAN using the LUHN Algorithm. + * + * For a list of example card numbers that are used to test this + * class, please see the LuhnValidatorTest class. + * + * @see http://en.wikipedia.org/wiki/Luhn_algorithm + * + * @author Tim Nagel + * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/ + * @author Bernhard Schussek + */ +class LuhnValidator extends ConstraintValidator +{ + /** + * Validates a credit card number with the Luhn algorithm. + * + * @param mixed $value + * + * @throws UnexpectedTypeException when the given credit card number is no string + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Luhn) { + throw new UnexpectedTypeException($constraint, Luhn::class); + } + + if (null === $value || '' === $value) { + return; + } + + // Work with strings only, because long numbers are represented as floats + // internally and don't work with strlen() + if (!\is_string($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (!ctype_digit($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Luhn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + + $checkSum = 0; + $length = \strlen($value); + + // Starting with the last digit and walking left, add every second + // digit to the check sum + // e.g. 7 9 9 2 7 3 9 8 7 1 3 + // ^ ^ ^ ^ ^ ^ + // = 7 + 9 + 7 + 9 + 7 + 3 + for ($i = $length - 1; $i >= 0; $i -= 2) { + $checkSum += $value[$i]; + } + + // Starting with the second last digit and walking left, double every + // second digit and add it to the check sum + // For doubles greater than 9, sum the individual digits + // e.g. 7 9 9 2 7 3 9 8 7 1 3 + // ^ ^ ^ ^ ^ + // = 1+8 + 4 + 6 + 1+6 + 2 + for ($i = $length - 2; $i >= 0; $i -= 2) { + $checkSum += array_sum(str_split((int) $value[$i] * 2)); + } + + if (0 === $checkSum || 0 !== $checkSum % 10) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Luhn::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Negative.php b/upload/system/storage/vendor/symfony/validator/Constraints/Negative.php new file mode 100644 index 00000000000..c13ebcb4a8b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Negative.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Jan Schädlich + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Negative extends LessThan +{ + use ZeroComparisonConstraintTrait; + + public $message = 'This value should be negative.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php b/upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php new file mode 100644 index 00000000000..5be735c312d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Jan Schädlich + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class NegativeOrZero extends LessThanOrEqual +{ + use ZeroComparisonConstraintTrait; + + public $message = 'This value should be either negative or zero.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php new file mode 100644 index 00000000000..6f98d5a6179 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + * @author Kévin Dunglas + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class NotBlank extends Constraint +{ + public const IS_BLANK_ERROR = 'c1051bb4-d103-4f74-8988-acbcafc7fdc3'; + + protected static $errorNames = [ + self::IS_BLANK_ERROR => 'IS_BLANK_ERROR', + ]; + + public $message = 'This value should not be blank.'; + public $allowNull = false; + public $normalizer; + + public function __construct(array $options = null, string $message = null, bool $allowNull = null, callable $normalizer = null, array $groups = null, $payload = null) + { + parent::__construct($options ?? [], $groups, $payload); + + $this->message = $message ?? $this->message; + $this->allowNull = $allowNull ?? $this->allowNull; + $this->normalizer = $normalizer ?? $this->normalizer; + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php new file mode 100644 index 00000000000..86af06123d7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + * @author Kévin Dunglas + */ +class NotBlankValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof NotBlank) { + throw new UnexpectedTypeException($constraint, NotBlank::class); + } + + if ($constraint->allowNull && null === $value) { + return; + } + + if (\is_string($value) && null !== $constraint->normalizer) { + $value = ($constraint->normalizer)($value); + } + + if (false === $value || (empty($value) && '0' != $value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(NotBlank::IS_BLANK_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php new file mode 100644 index 00000000000..213bde2f8d4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * Checks if a password has been leaked in a data breach. + * + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Kévin Dunglas + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class NotCompromisedPassword extends Constraint +{ + public const COMPROMISED_PASSWORD_ERROR = 'd9bcdbfe-a9d6-4bfa-a8ff-da5fd93e0f6d'; + + protected static $errorNames = [self::COMPROMISED_PASSWORD_ERROR => 'COMPROMISED_PASSWORD_ERROR']; + + public $message = 'This password has been leaked in a data breach, it must not be used. Please use another password.'; + public $threshold = 1; + public $skipOnError = false; + + public function __construct( + array $options = null, + string $message = null, + int $threshold = null, + bool $skipOnError = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->threshold = $threshold ?? $this->threshold; + $this->skipOnError = $skipOnError ?? $this->skipOnError; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php new file mode 100644 index 00000000000..adcdb7a59ff --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\HttpClient\HttpClient; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; +use Symfony\Contracts\HttpClient\Exception\ExceptionInterface; +use Symfony\Contracts\HttpClient\HttpClientInterface; + +/** + * Checks if a password has been leaked in a data breach using haveibeenpwned.com's API. + * Use a k-anonymity model to protect the password being searched for. + * + * @see https://haveibeenpwned.com/API/v2#SearchingPwnedPasswordsByRange + * + * @author Kévin Dunglas + */ +class NotCompromisedPasswordValidator extends ConstraintValidator +{ + private const DEFAULT_API_ENDPOINT = 'https://api.pwnedpasswords.com/range/%s'; + + private $httpClient; + private $charset; + private $enabled; + private $endpoint; + + public function __construct(HttpClientInterface $httpClient = null, string $charset = 'UTF-8', bool $enabled = true, string $endpoint = null) + { + if (null === $httpClient && !class_exists(HttpClient::class)) { + throw new \LogicException(sprintf('The "%s" class requires the "HttpClient" component. Try running "composer require symfony/http-client".', self::class)); + } + + $this->httpClient = $httpClient ?? HttpClient::create(); + $this->charset = $charset; + $this->enabled = $enabled; + $this->endpoint = $endpoint ?? self::DEFAULT_API_ENDPOINT; + } + + /** + * {@inheritdoc} + * + * @throws ExceptionInterface + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof NotCompromisedPassword) { + throw new UnexpectedTypeException($constraint, NotCompromisedPassword::class); + } + + if (!$this->enabled) { + return; + } + + if (null !== $value && !is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + if ('' === $value) { + return; + } + + if ('UTF-8' !== $this->charset) { + $value = mb_convert_encoding($value, 'UTF-8', $this->charset); + } + + $hash = strtoupper(sha1($value)); + $hashPrefix = substr($hash, 0, 5); + $url = sprintf($this->endpoint, $hashPrefix); + + try { + $result = $this->httpClient->request('GET', $url)->getContent(); + } catch (ExceptionInterface $e) { + if ($constraint->skipOnError) { + return; + } + + throw $e; + } + + foreach (explode("\r\n", $result) as $line) { + [$hashSuffix, $count] = explode(':', $line); + + if ($hashPrefix.$hashSuffix === $hash && $constraint->threshold <= (int) $count) { + $this->context->buildViolation($constraint->message) + ->setCode(NotCompromisedPassword::COMPROMISED_PASSWORD_ERROR) + ->addViolation(); + + return; + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php new file mode 100644 index 00000000000..4b2accdf752 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class NotEqualTo extends AbstractComparison +{ + public const IS_EQUAL_ERROR = 'aa2e33da-25c8-4d76-8c6c-812f02ea89dd'; + + protected static $errorNames = [ + self::IS_EQUAL_ERROR => 'IS_EQUAL_ERROR', + ]; + + public $message = 'This value should not be equal to {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualToValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualToValidator.php new file mode 100644 index 00000000000..b80c5eaedab --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualToValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values are all unequal (!=). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class NotEqualToValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return $value1 != $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return NotEqualTo::IS_EQUAL_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php new file mode 100644 index 00000000000..82ee014eb6f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class NotIdenticalTo extends AbstractComparison +{ + public const IS_IDENTICAL_ERROR = '4aaac518-0dda-4129-a6d9-e216b9b454a0'; + + protected static $errorNames = [ + self::IS_IDENTICAL_ERROR => 'IS_IDENTICAL_ERROR', + ]; + + public $message = 'This value should not be identical to {{ compared_value_type }} {{ compared_value }}.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalToValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalToValidator.php new file mode 100644 index 00000000000..3ea8b5ac25e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalToValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Validates values aren't identical (!==). + * + * @author Daniel Holmes + * @author Bernhard Schussek + */ +class NotIdenticalToValidator extends AbstractComparisonValidator +{ + /** + * {@inheritdoc} + */ + protected function compareValues($value1, $value2) + { + return $value1 !== $value2; + } + + /** + * {@inheritdoc} + */ + protected function getErrorCode() + { + return NotIdenticalTo::IS_IDENTICAL_ERROR; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php new file mode 100644 index 00000000000..85783c70816 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class NotNull extends Constraint +{ + public const IS_NULL_ERROR = 'ad32d13f-c3d4-423b-909a-857b961eb720'; + + protected static $errorNames = [ + self::IS_NULL_ERROR => 'IS_NULL_ERROR', + ]; + + public $message = 'This value should not be null.'; + + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + parent::__construct($options ?? [], $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php new file mode 100644 index 00000000000..d02fcc43988 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class NotNullValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof NotNull) { + throw new UnexpectedTypeException($constraint, NotNull::class); + } + + if (null === $value) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(NotNull::IS_NULL_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php b/upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php new file mode 100644 index 00000000000..3229871fff3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +trigger_deprecation('symfony/validator', '5.2', '%s is deprecated.', NumberConstraintTrait::class); + +/** + * @author Jan Schädlich + * + * @deprecated since Symfony 5.2 + */ +trait NumberConstraintTrait +{ + private function configureNumberConstraintOptions($options): array + { + if (null === $options) { + $options = []; + } elseif (!\is_array($options)) { + $options = [$this->getDefaultOption() => $options]; + } + + if (isset($options['propertyPath'])) { + throw new ConstraintDefinitionException(sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class)); + } + + if (isset($options['value'])) { + throw new ConstraintDefinitionException(sprintf('The "value" option of the "%s" constraint cannot be set.', static::class)); + } + + $options['value'] = 0; + + return $options; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Optional.php b/upload/system/storage/vendor/symfony/validator/Constraints/Optional.php new file mode 100644 index 00000000000..dab8b4371f2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Optional.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"ANNOTATION"}) + * + * @author Bernhard Schussek + */ +class Optional extends Existence +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Positive.php b/upload/system/storage/vendor/symfony/validator/Constraints/Positive.php new file mode 100644 index 00000000000..951e944c9a7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Positive.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Jan Schädlich + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Positive extends GreaterThan +{ + use ZeroComparisonConstraintTrait; + + public $message = 'This value should be positive.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php b/upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php new file mode 100644 index 00000000000..a7669c61070 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Jan Schädlich + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class PositiveOrZero extends GreaterThanOrEqual +{ + use ZeroComparisonConstraintTrait; + + public $message = 'This value should be either positive or zero.'; +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Range.php b/upload/system/storage/vendor/symfony/validator/Constraints/Range.php new file mode 100644 index 00000000000..906057ebaae --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Range.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\PropertyAccess\PropertyPathInterface; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\LogicException; +use Symfony\Component\Validator\Exception\MissingOptionsException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Range extends Constraint +{ + public const INVALID_CHARACTERS_ERROR = 'ad9a9798-7a99-4df7-8ce9-46e416a1e60b'; + public const NOT_IN_RANGE_ERROR = '04b91c99-a946-4221-afc5-e65ebac401eb'; + public const TOO_HIGH_ERROR = '2d28afcb-e32e-45fb-a815-01c431a86a69'; + public const TOO_LOW_ERROR = '76454e69-502c-46c5-9643-f447d837c4d5'; + + protected static $errorNames = [ + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::NOT_IN_RANGE_ERROR => 'NOT_IN_RANGE_ERROR', + self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', + self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', + ]; + + public $notInRangeMessage = 'This value should be between {{ min }} and {{ max }}.'; + public $minMessage = 'This value should be {{ limit }} or more.'; + public $maxMessage = 'This value should be {{ limit }} or less.'; + public $invalidMessage = 'This value should be a valid number.'; + public $invalidDateTimeMessage = 'This value should be a valid datetime.'; + public $min; + public $minPropertyPath; + public $max; + public $maxPropertyPath; + + /** + * @internal + */ + public $deprecatedMinMessageSet = false; + + /** + * @internal + */ + public $deprecatedMaxMessageSet = false; + + /** + * {@inheritdoc} + * + * @param string|PropertyPathInterface|null $minPropertyPath + * @param string|PropertyPathInterface|null $maxPropertyPath + */ + public function __construct( + array $options = null, + string $notInRangeMessage = null, + string $minMessage = null, + string $maxMessage = null, + string $invalidMessage = null, + string $invalidDateTimeMessage = null, + $min = null, + $minPropertyPath = null, + $max = null, + $maxPropertyPath = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->notInRangeMessage = $notInRangeMessage ?? $this->notInRangeMessage; + $this->minMessage = $minMessage ?? $this->minMessage; + $this->maxMessage = $maxMessage ?? $this->maxMessage; + $this->invalidMessage = $invalidMessage ?? $this->invalidMessage; + $this->invalidDateTimeMessage = $invalidDateTimeMessage ?? $this->invalidDateTimeMessage; + $this->min = $min ?? $this->min; + $this->minPropertyPath = $minPropertyPath ?? $this->minPropertyPath; + $this->max = $max ?? $this->max; + $this->maxPropertyPath = $maxPropertyPath ?? $this->maxPropertyPath; + + if (null === $this->min && null === $this->minPropertyPath && null === $this->max && null === $this->maxPropertyPath) { + throw new MissingOptionsException(sprintf('Either option "min", "minPropertyPath", "max" or "maxPropertyPath" must be given for constraint "%s".', __CLASS__), ['min', 'minPropertyPath', 'max', 'maxPropertyPath']); + } + + if (null !== $this->min && null !== $this->minPropertyPath) { + throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "min" or "minPropertyPath" options to be set, not both.', static::class)); + } + + if (null !== $this->max && null !== $this->maxPropertyPath) { + throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "max" or "maxPropertyPath" options to be set, not both.', static::class)); + } + + if ((null !== $this->minPropertyPath || null !== $this->maxPropertyPath) && !class_exists(PropertyAccess::class)) { + throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option.', static::class)); + } + + if (null !== $this->min && null !== $this->max) { + $this->deprecatedMinMessageSet = isset($options['minMessage']) || null !== $minMessage; + $this->deprecatedMaxMessageSet = isset($options['maxMessage']) || null !== $maxMessage; + + // BC layer, should throw a ConstraintDefinitionException in 6.0 + if ($this->deprecatedMinMessageSet || $this->deprecatedMaxMessageSet) { + trigger_deprecation('symfony/validator', '4.4', '"minMessage" and "maxMessage" are deprecated when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php new file mode 100644 index 00000000000..e24cd8746e6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php @@ -0,0 +1,211 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\PropertyAccess\PropertyAccessorInterface; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class RangeValidator extends ConstraintValidator +{ + private $propertyAccessor; + + public function __construct(PropertyAccessorInterface $propertyAccessor = null) + { + $this->propertyAccessor = $propertyAccessor; + } + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Range) { + throw new UnexpectedTypeException($constraint, Range::class); + } + + if (null === $value) { + return; + } + + $min = $this->getLimit($constraint->minPropertyPath, $constraint->min, $constraint); + $max = $this->getLimit($constraint->maxPropertyPath, $constraint->max, $constraint); + + if (!is_numeric($value) && !$value instanceof \DateTimeInterface) { + if ($this->isParsableDatetimeString($min) && $this->isParsableDatetimeString($max)) { + $this->context->buildViolation($constraint->invalidDateTimeMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setCode(Range::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->context->buildViolation($constraint->invalidMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setCode(Range::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } + + return; + } + + // Convert strings to DateTimes if comparing another DateTime + // This allows to compare with any date/time value supported by + // the DateTime constructor: + // https://php.net/datetime.formats + if ($value instanceof \DateTimeInterface) { + $dateTimeClass = null; + + if (\is_string($min)) { + $dateTimeClass = $value instanceof \DateTimeImmutable ? \DateTimeImmutable::class : \DateTime::class; + + try { + $min = new $dateTimeClass($min); + } catch (\Exception $e) { + throw new ConstraintDefinitionException(sprintf('The min value "%s" could not be converted to a "%s" instance in the "%s" constraint.', $min, $dateTimeClass, get_debug_type($constraint))); + } + } + + if (\is_string($max)) { + $dateTimeClass = $dateTimeClass ?: ($value instanceof \DateTimeImmutable ? \DateTimeImmutable::class : \DateTime::class); + + try { + $max = new $dateTimeClass($max); + } catch (\Exception $e) { + throw new ConstraintDefinitionException(sprintf('The max value "%s" could not be converted to a "%s" instance in the "%s" constraint.', $max, $dateTimeClass, get_debug_type($constraint))); + } + } + } + + $hasLowerLimit = null !== $min; + $hasUpperLimit = null !== $max; + + if ($hasLowerLimit && $hasUpperLimit && ($value < $min || $value > $max)) { + $message = $constraint->notInRangeMessage; + $code = Range::NOT_IN_RANGE_ERROR; + + if ($value < $min && $constraint->deprecatedMinMessageSet) { + $message = $constraint->minMessage; + $code = Range::TOO_LOW_ERROR; + } + + if ($value > $max && $constraint->deprecatedMaxMessageSet) { + $message = $constraint->maxMessage; + $code = Range::TOO_HIGH_ERROR; + } + + $violationBuilder = $this->context->buildViolation($message) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setParameter('{{ min }}', $this->formatValue($min, self::PRETTY_DATE)) + ->setParameter('{{ max }}', $this->formatValue($max, self::PRETTY_DATE)) + ->setCode($code); + + if (null !== $constraint->maxPropertyPath) { + $violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath); + } + + if (null !== $constraint->minPropertyPath) { + $violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath); + } + + $violationBuilder->addViolation(); + + return; + } + + if ($hasUpperLimit && $value > $max) { + $violationBuilder = $this->context->buildViolation($constraint->maxMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setParameter('{{ limit }}', $this->formatValue($max, self::PRETTY_DATE)) + ->setCode(Range::TOO_HIGH_ERROR); + + if (null !== $constraint->maxPropertyPath) { + $violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath); + } + + if (null !== $constraint->minPropertyPath) { + $violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath); + } + + $violationBuilder->addViolation(); + + return; + } + + if ($hasLowerLimit && $value < $min) { + $violationBuilder = $this->context->buildViolation($constraint->minMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setParameter('{{ limit }}', $this->formatValue($min, self::PRETTY_DATE)) + ->setCode(Range::TOO_LOW_ERROR); + + if (null !== $constraint->maxPropertyPath) { + $violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath); + } + + if (null !== $constraint->minPropertyPath) { + $violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath); + } + + $violationBuilder->addViolation(); + } + } + + private function getLimit(?string $propertyPath, $default, Constraint $constraint) + { + if (null === $propertyPath) { + return $default; + } + + if (null === $object = $this->context->getObject()) { + return $default; + } + + try { + return $this->getPropertyAccessor()->getValue($object, $propertyPath); + } catch (NoSuchPropertyException $e) { + throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $propertyPath, get_debug_type($constraint)).$e->getMessage(), 0, $e); + } + } + + private function getPropertyAccessor(): PropertyAccessorInterface + { + if (null === $this->propertyAccessor) { + $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); + } + + return $this->propertyAccessor; + } + + private function isParsableDatetimeString($boundary): bool + { + if (null === $boundary) { + return true; + } + + if (!\is_string($boundary)) { + return false; + } + + try { + new \DateTime($boundary); + } catch (\Exception $e) { + return false; + } + + return true; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Regex.php b/upload/system/storage/vendor/symfony/validator/Constraints/Regex.php new file mode 100644 index 00000000000..63bbd8d4c1f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Regex.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Regex extends Constraint +{ + public const REGEX_FAILED_ERROR = 'de1e3db3-5ed4-4941-aae4-59f3667cc3a3'; + + protected static $errorNames = [ + self::REGEX_FAILED_ERROR => 'REGEX_FAILED_ERROR', + ]; + + public $message = 'This value is not valid.'; + public $pattern; + public $htmlPattern; + public $match = true; + public $normalizer; + + /** + * {@inheritdoc} + * + * @param string|array $pattern The pattern to evaluate or an array of options + */ + public function __construct( + $pattern, + string $message = null, + string $htmlPattern = null, + bool $match = null, + callable $normalizer = null, + array $groups = null, + $payload = null, + array $options = [] + ) { + if (\is_array($pattern)) { + $options = array_merge($pattern, $options); + } elseif (null !== $pattern) { + $options['value'] = $pattern; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->htmlPattern = $htmlPattern ?? $this->htmlPattern; + $this->match = $match ?? $this->match; + $this->normalizer = $normalizer ?? $this->normalizer; + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'pattern'; + } + + /** + * {@inheritdoc} + */ + public function getRequiredOptions() + { + return ['pattern']; + } + + /** + * Converts the htmlPattern to a suitable format for HTML5 pattern. + * Example: /^[a-z]+$/ would be converted to [a-z]+ + * However, if options are specified, it cannot be converted. + * + * @see http://dev.w3.org/html5/spec/single-page.html#the-pattern-attribute + * + * @return string|null + */ + public function getHtmlPattern() + { + // If htmlPattern is specified, use it + if (null !== $this->htmlPattern) { + return empty($this->htmlPattern) + ? null + : $this->htmlPattern; + } + + // Quit if delimiters not at very beginning/end (e.g. when options are passed) + if ($this->pattern[0] !== $this->pattern[\strlen($this->pattern) - 1]) { + return null; + } + + $delimiter = $this->pattern[0]; + + // Unescape the delimiter + $pattern = str_replace('\\'.$delimiter, $delimiter, substr($this->pattern, 1, -1)); + + // If the pattern is inverted, we can wrap it in + // ((?!pattern).)* + if (!$this->match) { + return '((?!'.$pattern.').)*'; + } + + // If the pattern contains an or statement, wrap the pattern in + // .*(pattern).* and quit. Otherwise we'd need to parse the pattern + if (str_contains($pattern, '|')) { + return '.*('.$pattern.').*'; + } + + // Trim leading ^, otherwise prepend .* + $pattern = '^' === $pattern[0] ? substr($pattern, 1) : '.*'.$pattern; + + // Trim trailing $, otherwise append .* + $pattern = '$' === $pattern[\strlen($pattern) - 1] ? substr($pattern, 0, -1) : $pattern.'.*'; + + return $pattern; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php new file mode 100644 index 00000000000..7fadf7682b0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether a value match or not given regexp pattern. + * + * @author Bernhard Schussek + * @author Joseph Bielawski + */ +class RegexValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Regex) { + throw new UnexpectedTypeException($constraint, Regex::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (null !== $constraint->normalizer) { + $value = ($constraint->normalizer)($value); + } + + if ($constraint->match xor preg_match($constraint->pattern, $value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Regex::REGEX_FAILED_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Required.php b/upload/system/storage/vendor/symfony/validator/Constraints/Required.php new file mode 100644 index 00000000000..bd77a909f97 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Required.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * @Annotation + * @Target({"ANNOTATION"}) + * + * @author Bernhard Schussek + */ +class Required extends Existence +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php b/upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php new file mode 100644 index 00000000000..36a801a4e28 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +/** + * Use this constraint to sequentially validate nested constraints. + * Validation for the nested constraints collection will stop at first violation. + * + * @Annotation + * @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Maxime Steinhausser + */ +#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Sequentially extends Composite +{ + public $constraints = []; + + public function __construct($constraints = null, array $groups = null, $payload = null) + { + parent::__construct($constraints ?? [], $groups, $payload); + } + + public function getDefaultOption() + { + return 'constraints'; + } + + public function getRequiredOptions() + { + return ['constraints']; + } + + protected function getCompositeOption() + { + return 'constraints'; + } + + public function getTargets() + { + return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php new file mode 100644 index 00000000000..434d2aba22f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Maxime Steinhausser + */ +class SequentiallyValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Sequentially) { + throw new UnexpectedTypeException($constraint, Sequentially::class); + } + + $context = $this->context; + + $validator = $context->getValidator()->inContext($context); + + $originalCount = $validator->getViolations()->count(); + + foreach ($constraint->constraints as $c) { + if ($originalCount !== $validator->validate($value, $c)->getViolations()->count()) { + break; + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Time.php b/upload/system/storage/vendor/symfony/validator/Constraints/Time.php new file mode 100644 index 00000000000..366d6237666 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Time.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Time extends Constraint +{ + public const INVALID_FORMAT_ERROR = '9d27b2bb-f755-4fbf-b725-39b1edbdebdf'; + public const INVALID_TIME_ERROR = '8532f9e1-84b2-4d67-8989-0818bc38533b'; + + protected static $errorNames = [ + self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', + self::INVALID_TIME_ERROR => 'INVALID_TIME_ERROR', + ]; + + public $message = 'This value is not a valid time.'; + + public function __construct( + array $options = null, + string $message = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php new file mode 100644 index 00000000000..5a71e4439c7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class TimeValidator extends ConstraintValidator +{ + public const PATTERN = '/^(\d{2}):(\d{2}):(\d{2})$/'; + + /** + * Checks whether a time is valid. + * + * @internal + */ + public static function checkTime(int $hour, int $minute, float $second): bool + { + return $hour >= 0 && $hour < 24 && $minute >= 0 && $minute < 60 && $second >= 0 && $second < 60; + } + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Time) { + throw new UnexpectedTypeException($constraint, Time::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (!preg_match(static::PATTERN, $value, $matches)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Time::INVALID_FORMAT_ERROR) + ->addViolation(); + + return; + } + + if (!self::checkTime($matches[1], $matches[2], $matches[3])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Time::INVALID_TIME_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php b/upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php new file mode 100644 index 00000000000..409fbc1d12b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Javier Spagnoletti + * @author Hugo Hamon + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Timezone extends Constraint +{ + public const TIMEZONE_IDENTIFIER_ERROR = '5ce113e6-5e64-4ea2-90fe-d2233956db13'; + public const TIMEZONE_IDENTIFIER_IN_ZONE_ERROR = 'b57767b1-36c0-40ac-a3d7-629420c775b8'; + public const TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR = 'c4a22222-dc92-4fc0-abb0-d95b268c7d0b'; + public const TIMEZONE_IDENTIFIER_INTL_ERROR = '45863c26-88dc-41ba-bf53-c73bd1f7e90d'; + + public $zone = \DateTimeZone::ALL; + public $countryCode; + public $intlCompatible = false; + public $message = 'This value is not a valid timezone.'; + + protected static $errorNames = [ + self::TIMEZONE_IDENTIFIER_ERROR => 'TIMEZONE_IDENTIFIER_ERROR', + self::TIMEZONE_IDENTIFIER_IN_ZONE_ERROR => 'TIMEZONE_IDENTIFIER_IN_ZONE_ERROR', + self::TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR => 'TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR', + self::TIMEZONE_IDENTIFIER_INTL_ERROR => 'TIMEZONE_IDENTIFIER_INTL_ERROR', + ]; + + /** + * {@inheritdoc} + * + * @param int|array|null $zone A combination of {@see \DateTimeZone} class constants or a set of options + */ + public function __construct( + $zone = null, + string $message = null, + string $countryCode = null, + bool $intlCompatible = null, + array $groups = null, + $payload = null, + array $options = [] + ) { + if (\is_array($zone)) { + $options = array_merge($zone, $options); + } elseif (null !== $zone) { + $options['value'] = $zone; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->countryCode = $countryCode ?? $this->countryCode; + $this->intlCompatible = $intlCompatible ?? $this->intlCompatible; + + if (null === $this->countryCode) { + if (0 >= $this->zone || \DateTimeZone::ALL_WITH_BC < $this->zone) { + throw new ConstraintDefinitionException('The option "zone" must be a valid range of "\DateTimeZone" constants.'); + } + } elseif (\DateTimeZone::PER_COUNTRY !== (\DateTimeZone::PER_COUNTRY & $this->zone)) { + throw new ConstraintDefinitionException('The option "countryCode" can only be used when the "zone" option is configured with "\DateTimeZone::PER_COUNTRY".'); + } + if ($this->intlCompatible && !class_exists(\IntlTimeZone::class)) { + throw new ConstraintDefinitionException('The option "intlCompatible" can only be used when the PHP intl extension is available.'); + } + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'zone'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php new file mode 100644 index 00000000000..ab6b4eed626 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Intl\Exception\MissingResourceException; +use Symfony\Component\Intl\Timezones; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether a value is a valid timezone identifier. + * + * @author Javier Spagnoletti + * @author Hugo Hamon + */ +class TimezoneValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Timezone) { + throw new UnexpectedTypeException($constraint, Timezone::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if ($constraint->intlCompatible && 'Etc/Unknown' === \IntlTimeZone::createTimeZone($value)->getID()) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Timezone::TIMEZONE_IDENTIFIER_INTL_ERROR) + ->addViolation(); + + return; + } + + if ( + \in_array($value, self::getPhpTimezones($constraint->zone, $constraint->countryCode), true) || + \in_array($value, self::getIntlTimezones($constraint->zone, $constraint->countryCode), true) + ) { + return; + } + + if ($constraint->countryCode) { + $code = Timezone::TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR; + } elseif (\DateTimeZone::ALL !== $constraint->zone) { + $code = Timezone::TIMEZONE_IDENTIFIER_IN_ZONE_ERROR; + } else { + $code = Timezone::TIMEZONE_IDENTIFIER_ERROR; + } + + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } + + private static function getPhpTimezones(int $zone, string $countryCode = null): array + { + if (null !== $countryCode) { + try { + return @\DateTimeZone::listIdentifiers($zone, $countryCode) ?: []; + } catch (\ValueError $e) { + return []; + } + } + + return \DateTimeZone::listIdentifiers($zone); + } + + private static function getIntlTimezones(int $zone, string $countryCode = null): array + { + if (!class_exists(Timezones::class)) { + return []; + } + + if (null !== $countryCode) { + try { + return Timezones::forCountryCode($countryCode); + } catch (MissingResourceException $e) { + return []; + } + } + + $timezones = Timezones::getIds(); + + if (\DateTimeZone::ALL === (\DateTimeZone::ALL & $zone)) { + return $timezones; + } + + $filtered = []; + foreach ((new \ReflectionClass(\DateTimeZone::class))->getConstants() as $const => $flag) { + if ($flag !== ($flag & $zone)) { + continue; + } + + $filtered[] = array_filter($timezones, static function ($id) use ($const) { + return 0 === stripos($id, $const.'/'); + }); + } + + return $filtered ? array_merge(...$filtered) : []; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php b/upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php new file mode 100644 index 00000000000..fe6527dae3a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * @Annotation + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_CLASS)] +class Traverse extends Constraint +{ + public $traverse = true; + + /** + * @param bool|array|null $traverse + */ + public function __construct($traverse = null) + { + if (\is_array($traverse) && \array_key_exists('groups', $traverse)) { + throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); + } + + parent::__construct($traverse); + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'traverse'; + } + + /** + * {@inheritdoc} + */ + public function getTargets() + { + return self::CLASS_CONSTRAINT; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Type.php b/upload/system/storage/vendor/symfony/validator/Constraints/Type.php new file mode 100644 index 00000000000..220c2191a3c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Type.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Type extends Constraint +{ + public const INVALID_TYPE_ERROR = 'ba785a8c-82cb-4283-967c-3cf342181b40'; + + protected static $errorNames = [ + self::INVALID_TYPE_ERROR => 'INVALID_TYPE_ERROR', + ]; + + public $message = 'This value should be of type {{ type }}.'; + public $type; + + /** + * {@inheritdoc} + * + * @param string|array $type One ore multiple types to validate against or a set of options + */ + public function __construct($type, string $message = null, array $groups = null, $payload = null, array $options = []) + { + if (\is_array($type) && \is_string(key($type))) { + $options = array_merge($type, $options); + } elseif (null !== $type) { + $options['value'] = $type; + } + + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } + + /** + * {@inheritdoc} + */ + public function getDefaultOption() + { + return 'type'; + } + + /** + * {@inheritdoc} + */ + public function getRequiredOptions() + { + return ['type']; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php new file mode 100644 index 00000000000..0a938c6d95a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class TypeValidator extends ConstraintValidator +{ + private const VALIDATION_FUNCTIONS = [ + 'bool' => 'is_bool', + 'boolean' => 'is_bool', + 'int' => 'is_int', + 'integer' => 'is_int', + 'long' => 'is_int', + 'float' => 'is_float', + 'double' => 'is_float', + 'real' => 'is_float', + 'numeric' => 'is_numeric', + 'string' => 'is_string', + 'scalar' => 'is_scalar', + 'array' => 'is_array', + 'iterable' => 'is_iterable', + 'countable' => 'is_countable', + 'callable' => 'is_callable', + 'object' => 'is_object', + 'resource' => 'is_resource', + 'null' => 'is_null', + 'alnum' => 'ctype_alnum', + 'alpha' => 'ctype_alpha', + 'cntrl' => 'ctype_cntrl', + 'digit' => 'ctype_digit', + 'graph' => 'ctype_graph', + 'lower' => 'ctype_lower', + 'print' => 'ctype_print', + 'punct' => 'ctype_punct', + 'space' => 'ctype_space', + 'upper' => 'ctype_upper', + 'xdigit' => 'ctype_xdigit', + ]; + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Type) { + throw new UnexpectedTypeException($constraint, Type::class); + } + + if (null === $value) { + return; + } + + $types = (array) $constraint->type; + + foreach ($types as $type) { + $type = strtolower($type); + if (isset(self::VALIDATION_FUNCTIONS[$type]) && self::VALIDATION_FUNCTIONS[$type]($value)) { + return; + } + + if ($value instanceof $type) { + return; + } + } + + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ type }}', implode('|', $types)) + ->setCode(Type::INVALID_TYPE_ERROR) + ->addViolation(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php b/upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php new file mode 100644 index 00000000000..d1644b8b34b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * + * @author Laurent Clouet + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Ulid extends Constraint +{ + public const TOO_SHORT_ERROR = '7b44804e-37d5-4df4-9bdd-b738d4a45bb4'; + public const TOO_LONG_ERROR = '9608249f-6da1-4d53-889e-9864b58c4d37'; + public const INVALID_CHARACTERS_ERROR = 'e4155739-5135-4258-9c81-ae7b44b5311e'; + public const TOO_LARGE_ERROR = 'df8cfb9a-ce6d-4a69-ae5a-eea7ab6f278b'; + + protected static $errorNames = [ + self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', + self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', + ]; + + public $message = 'This is not a valid ULID.'; + + public function __construct( + array $options = null, + string $message = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php new file mode 100644 index 00000000000..45f85b852d2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether the value is a valid ULID (Universally Unique Lexicographically Sortable Identifier). + * Cf https://github.com/ulid/spec for ULID specifications. + * + * @author Laurent Clouet + */ +class UlidValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Ulid) { + throw new UnexpectedTypeException($constraint, Ulid::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (26 !== \strlen($value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(26 > \strlen($value) ? Ulid::TOO_SHORT_ERROR : Ulid::TOO_LONG_ERROR) + ->addViolation(); + } + + if (\strlen($value) !== strspn($value, '0123456789ABCDEFGHJKMNPQRSTVWXYZabcdefghjkmnpqrstvwxyz')) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Ulid::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } + + // Largest valid ULID is '7ZZZZZZZZZZZZZZZZZZZZZZZZZ' + // Cf https://github.com/ulid/spec#overflow-errors-when-parsing-base32-strings + if ($value[0] > '7') { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Ulid::TOO_LARGE_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Unique.php b/upload/system/storage/vendor/symfony/validator/Constraints/Unique.php new file mode 100644 index 00000000000..6280e9771fd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Unique.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Yevgeniy Zholkevskiy + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Unique extends Constraint +{ + public const IS_NOT_UNIQUE = '7911c98d-b845-4da0-94b7-a8dac36bc55a'; + + protected static $errorNames = [ + self::IS_NOT_UNIQUE => 'IS_NOT_UNIQUE', + ]; + + public $message = 'This collection should contain only unique elements.'; + public $normalizer; + + public function __construct( + array $options = null, + string $message = null, + callable $normalizer = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->normalizer = $normalizer ?? $this->normalizer; + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php new file mode 100644 index 00000000000..2758a3faa11 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Yevgeniy Zholkevskiy + */ +class UniqueValidator extends ConstraintValidator +{ + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Unique) { + throw new UnexpectedTypeException($constraint, Unique::class); + } + + if (null === $value) { + return; + } + + if (!\is_array($value) && !$value instanceof \IteratorAggregate) { + throw new UnexpectedValueException($value, 'array|IteratorAggregate'); + } + + $collectionElements = []; + $normalizer = $this->getNormalizer($constraint); + foreach ($value as $element) { + $element = $normalizer($element); + + if (\in_array($element, $collectionElements, true)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Unique::IS_NOT_UNIQUE) + ->addViolation(); + + return; + } + $collectionElements[] = $element; + } + } + + private function getNormalizer(Unique $unique): callable + { + if (null === $unique->normalizer) { + return static function ($value) { + return $value; + }; + } + + return $unique->normalizer; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Url.php b/upload/system/storage/vendor/symfony/validator/Constraints/Url.php new file mode 100644 index 00000000000..23cd77cad60 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Url.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Url extends Constraint +{ + public const INVALID_URL_ERROR = '57c2f299-1154-4870-89bb-ef3b1f5ad229'; + + protected static $errorNames = [ + self::INVALID_URL_ERROR => 'INVALID_URL_ERROR', + ]; + + public $message = 'This value is not a valid URL.'; + public $protocols = ['http', 'https']; + public $relativeProtocol = false; + public $normalizer; + + public function __construct( + array $options = null, + string $message = null, + array $protocols = null, + bool $relativeProtocol = null, + callable $normalizer = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->protocols = $protocols ?? $this->protocols; + $this->relativeProtocol = $relativeProtocol ?? $this->relativeProtocol; + $this->normalizer = $normalizer ?? $this->normalizer; + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php new file mode 100644 index 00000000000..a72eac6aae2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * @author Bernhard Schussek + */ +class UrlValidator extends ConstraintValidator +{ + public const PATTERN = '~^ + (%s):// # protocol + (((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+)@)? # basic auth + ( + (?: + (?:xn--[a-z0-9-]++\.)*+xn--[a-z0-9-]++ # a domain name using punycode + | + (?:[\pL\pN\pS\pM\-\_]++\.)+[\pL\pN\pM]++ # a multi-level domain name + | + [a-z0-9\-\_]++ # a single-level domain name + )\.? + | # or + \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address + | # or + \[ + (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) + \] # an IPv6 address + ) + (:[0-9]+)? # a port (optional) + (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path + (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional) + (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional) + $~ixu'; + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Url) { + throw new UnexpectedTypeException($constraint, Url::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + if ('' === $value) { + return; + } + + if (null !== $constraint->normalizer) { + $value = ($constraint->normalizer)($value); + } + + $pattern = $constraint->relativeProtocol ? str_replace('(%s):', '(?:(%s):)?', static::PATTERN) : static::PATTERN; + $pattern = sprintf($pattern, implode('|', $constraint->protocols)); + + if (!preg_match($pattern, $value)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Url::INVALID_URL_ERROR) + ->addViolation(); + + return; + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php b/upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php new file mode 100644 index 00000000000..84f83f896fc --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * @Annotation + * + * @author Colin O'Dell + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Uuid extends Constraint +{ + public const TOO_SHORT_ERROR = 'aa314679-dac9-4f54-bf97-b2049df8f2a3'; + public const TOO_LONG_ERROR = '494897dd-36f8-4d31-8923-71a8d5f3000d'; + public const INVALID_CHARACTERS_ERROR = '51120b12-a2bc-41bf-aa53-cd73daf330d0'; + public const INVALID_HYPHEN_PLACEMENT_ERROR = '98469c83-0309-4f5d-bf95-a496dcaa869c'; + public const INVALID_VERSION_ERROR = '21ba13b4-b185-4882-ac6f-d147355987eb'; + public const INVALID_VARIANT_ERROR = '164ef693-2b9d-46de-ad7f-836201f0c2db'; + + protected static $errorNames = [ + self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', + self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::INVALID_HYPHEN_PLACEMENT_ERROR => 'INVALID_HYPHEN_PLACEMENT_ERROR', + self::INVALID_VERSION_ERROR => 'INVALID_VERSION_ERROR', + self::INVALID_VARIANT_ERROR => 'INVALID_VARIANT_ERROR', + ]; + + // Possible versions defined by RFC 4122 + public const V1_MAC = 1; + public const V2_DCE = 2; + public const V3_MD5 = 3; + public const V4_RANDOM = 4; + public const V5_SHA1 = 5; + public const V6_SORTABLE = 6; + + public const ALL_VERSIONS = [ + self::V1_MAC, + self::V2_DCE, + self::V3_MD5, + self::V4_RANDOM, + self::V5_SHA1, + self::V6_SORTABLE, + ]; + + /** + * Message to display when validation fails. + * + * @var string + */ + public $message = 'This is not a valid UUID.'; + + /** + * Strict mode only allows UUIDs that meet the formal definition and formatting per RFC 4122. + * + * Set this to `false` to allow legacy formats with different dash positioning or wrapping characters + * + * @var bool + */ + public $strict = true; + + /** + * Array of allowed versions (see version constants above). + * + * All UUID versions are allowed by default + * + * @var int[] + */ + public $versions = self::ALL_VERSIONS; + + public $normalizer; + + /** + * {@inheritdoc} + * + * @param int[]|null $versions + */ + public function __construct( + array $options = null, + string $message = null, + array $versions = null, + bool $strict = null, + callable $normalizer = null, + array $groups = null, + $payload = null + ) { + parent::__construct($options, $groups, $payload); + + $this->message = $message ?? $this->message; + $this->versions = $versions ?? $this->versions; + $this->strict = $strict ?? $this->strict; + $this->normalizer = $normalizer ?? $this->normalizer; + + if (null !== $this->normalizer && !\is_callable($this->normalizer)) { + throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php new file mode 100644 index 00000000000..06629667848 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php @@ -0,0 +1,258 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; + +/** + * Validates whether the value is a valid UUID (also known as GUID). + * + * Strict validation will allow a UUID as specified per RFC 4122. + * Loose validation will allow any type of UUID. + * + * @author Colin O'Dell + * @author Bernhard Schussek + * + * @see http://tools.ietf.org/html/rfc4122 + * @see https://en.wikipedia.org/wiki/Universally_unique_identifier + */ +class UuidValidator extends ConstraintValidator +{ + // The strict pattern matches UUIDs like this: + // xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx + + // Roughly speaking: + // x = any hexadecimal character + // M = any allowed version {1..6} + // N = any allowed variant {8, 9, a, b} + + public const STRICT_LENGTH = 36; + public const STRICT_FIRST_HYPHEN_POSITION = 8; + public const STRICT_LAST_HYPHEN_POSITION = 23; + public const STRICT_VERSION_POSITION = 14; + public const STRICT_VARIANT_POSITION = 19; + + // The loose pattern validates similar yet non-compliant UUIDs. + // Hyphens are completely optional. If present, they should only appear + // between every fourth character: + // xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx + // xxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx + // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + + // The value can also be wrapped with characters like []{}: + // {xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx} + + // Neither the version nor the variant is validated by this pattern. + + public const LOOSE_MAX_LENGTH = 39; + public const LOOSE_FIRST_HYPHEN_POSITION = 4; + + /** + * {@inheritdoc} + */ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Uuid) { + throw new UnexpectedTypeException($constraint, Uuid::class); + } + + if (null === $value || '' === $value) { + return; + } + + if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { + throw new UnexpectedValueException($value, 'string'); + } + + $value = (string) $value; + + if (null !== $constraint->normalizer) { + $value = ($constraint->normalizer)($value); + } + + if ($constraint->strict) { + $this->validateStrict($value, $constraint); + + return; + } + + $this->validateLoose($value, $constraint); + } + + private function validateLoose(string $value, Uuid $constraint) + { + // Error priority: + // 1. ERROR_INVALID_CHARACTERS + // 2. ERROR_INVALID_HYPHEN_PLACEMENT + // 3. ERROR_TOO_SHORT/ERROR_TOO_LONG + + // Trim any wrapping characters like [] or {} used by some legacy systems + $trimmed = trim($value, '[]{}'); + + // Position of the next expected hyphen + $h = self::LOOSE_FIRST_HYPHEN_POSITION; + + // Expected length + $l = self::LOOSE_MAX_LENGTH; + + for ($i = 0; $i < $l; ++$i) { + // Check length + if (!isset($trimmed[$i])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_SHORT_ERROR) + ->addViolation(); + + return; + } + + // Hyphens must occur every fifth position + // xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx + // ^ ^ ^ ^ ^ ^ ^ + if ('-' === $trimmed[$i]) { + if ($i !== $h) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + + return; + } + + $h += 5; + + continue; + } + + // Missing hyphens are ignored + if ($i === $h) { + $h += 4; + --$l; + } + + // Check characters + if (!ctype_xdigit($trimmed[$i])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + } + + // Check length again + if (isset($trimmed[$i])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_LONG_ERROR) + ->addViolation(); + } + } + + private function validateStrict(string $value, Uuid $constraint) + { + // Error priority: + // 1. ERROR_INVALID_CHARACTERS + // 2. ERROR_INVALID_HYPHEN_PLACEMENT + // 3. ERROR_TOO_SHORT/ERROR_TOO_LONG + // 4. ERROR_INVALID_VERSION + // 5. ERROR_INVALID_VARIANT + + // Position of the next expected hyphen + $h = self::STRICT_FIRST_HYPHEN_POSITION; + + for ($i = 0; $i < self::STRICT_LENGTH; ++$i) { + // Check length + if (!isset($value[$i])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_SHORT_ERROR) + ->addViolation(); + + return; + } + + // Check hyphen placement + // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + // ^ ^ ^ ^ + if ('-' === $value[$i]) { + if ($i !== $h) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + + return; + } + + // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + // ^ + if ($h < self::STRICT_LAST_HYPHEN_POSITION) { + $h += 5; + } + + continue; + } + + // Check characters + if (!ctype_xdigit($value[$i])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_CHARACTERS_ERROR) + ->addViolation(); + + return; + } + + // Missing hyphen + if ($i === $h) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + + return; + } + } + + // Check length again + if (isset($value[$i])) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_LONG_ERROR) + ->addViolation(); + } + + // Check version + if (!\in_array($value[self::STRICT_VERSION_POSITION], $constraint->versions)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_VERSION_ERROR) + ->addViolation(); + } + + // Check variant - first two bits must equal "10" + // 0b10xx + // & 0b1100 (12) + // = 0b1000 (8) + if (8 !== (hexdec($value[self::STRICT_VARIANT_POSITION]) & 12)) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_VARIANT_ERROR) + ->addViolation(); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Valid.php b/upload/system/storage/vendor/symfony/validator/Constraints/Valid.php new file mode 100644 index 00000000000..9ee69fdd47b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Valid.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + */ +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] +class Valid extends Constraint +{ + public $traverse = true; + + public function __get(string $option) + { + if ('groups' === $option) { + // when this is reached, no groups have been configured + return null; + } + + return parent::__get($option); + } + + /** + * {@inheritdoc} + */ + public function addImplicitGroupName(string $group) + { + if (null !== $this->groups) { + parent::addImplicitGroupName($group); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php new file mode 100644 index 00000000000..85eabb80ae8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * @author Christian Flothmann + */ +class ValidValidator extends ConstraintValidator +{ + public function validate($value, Constraint $constraint) + { + if (!$constraint instanceof Valid) { + throw new UnexpectedTypeException($constraint, Valid::class); + } + + if (null === $value) { + return; + } + + $this->context + ->getValidator() + ->inContext($this->context) + ->validate($value, null, $this->context->getGroup()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php b/upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php new file mode 100644 index 00000000000..b65fcf206a6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * @internal + * + * @author Jan Schädlich + * @author Alexander M. Turek + */ +trait ZeroComparisonConstraintTrait +{ + public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) + { + if (null === $options) { + $options = []; + } + + if (isset($options['propertyPath'])) { + throw new ConstraintDefinitionException(sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class)); + } + + if (isset($options['value'])) { + throw new ConstraintDefinitionException(sprintf('The "value" option of the "%s" constraint cannot be set.', static::class)); + } + + parent::__construct(0, null, $message, $groups, $payload, $options); + } + + public function validatedBy(): string + { + return parent::class.'Validator'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php b/upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php new file mode 100644 index 00000000000..0b5baed4b9a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Psr\Container\ContainerInterface; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; +use Symfony\Component\Validator\Exception\ValidatorException; + +/** + * Uses a service container to create constraint validators. + * + * @author Kris Wallsmith + */ +class ContainerConstraintValidatorFactory implements ConstraintValidatorFactoryInterface +{ + private $container; + private $validators; + + public function __construct(ContainerInterface $container) + { + $this->container = $container; + $this->validators = []; + } + + /** + * {@inheritdoc} + * + * @throws ValidatorException When the validator class does not exist + * @throws UnexpectedTypeException When the validator is not an instance of ConstraintValidatorInterface + */ + public function getInstance(Constraint $constraint) + { + $name = $constraint->validatedBy(); + + if (!isset($this->validators[$name])) { + if ($this->container->has($name)) { + $this->validators[$name] = $this->container->get($name); + } else { + if (!class_exists($name)) { + throw new ValidatorException(sprintf('Constraint validator "%s" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "%s".', $name, get_debug_type($constraint))); + } + + $this->validators[$name] = new $name(); + } + } + + if (!$this->validators[$name] instanceof ConstraintValidatorInterface) { + throw new UnexpectedTypeException($this->validators[$name], ConstraintValidatorInterface::class); + } + + return $this->validators[$name]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php new file mode 100644 index 00000000000..c640da36320 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php @@ -0,0 +1,372 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Context; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Validator\ConstraintViolationList; +use Symfony\Component\Validator\ConstraintViolationListInterface; +use Symfony\Component\Validator\Mapping\ClassMetadataInterface; +use Symfony\Component\Validator\Mapping\MemberMetadata; +use Symfony\Component\Validator\Mapping\MetadataInterface; +use Symfony\Component\Validator\Mapping\PropertyMetadataInterface; +use Symfony\Component\Validator\Util\PropertyPath; +use Symfony\Component\Validator\Validator\LazyProperty; +use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Component\Validator\Violation\ConstraintViolationBuilder; +use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * The context used and created by {@link ExecutionContextFactory}. + * + * @author Bernhard Schussek + * + * @see ExecutionContextInterface + * + * @internal since version 2.5. Code against ExecutionContextInterface instead. + */ +class ExecutionContext implements ExecutionContextInterface +{ + /** + * @var ValidatorInterface + */ + private $validator; + + /** + * The root value of the validated object graph. + * + * @var mixed + */ + private $root; + + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @var string|null + */ + private $translationDomain; + + /** + * The violations generated in the current context. + * + * @var ConstraintViolationList + */ + private $violations; + + /** + * The currently validated value. + * + * @var mixed + */ + private $value; + + /** + * The currently validated object. + * + * @var object|null + */ + private $object; + + /** + * The property path leading to the current value. + * + * @var string + */ + private $propertyPath = ''; + + /** + * The current validation metadata. + * + * @var MetadataInterface|null + */ + private $metadata; + + /** + * The currently validated group. + * + * @var string|null + */ + private $group; + + /** + * The currently validated constraint. + * + * @var Constraint|null + */ + private $constraint; + + /** + * Stores which objects have been validated in which group. + * + * @var bool[][] + */ + private $validatedObjects = []; + + /** + * Stores which class constraint has been validated for which object. + * + * @var bool[] + */ + private $validatedConstraints = []; + + /** + * Stores which objects have been initialized. + * + * @var bool[] + */ + private $initializedObjects; + + /** + * @var \SplObjectStorage + */ + private $cachedObjectsRefs; + + /** + * @param mixed $root The root value of the validated object graph + * + * @internal Called by {@link ExecutionContextFactory}. Should not be used in user code. + */ + public function __construct(ValidatorInterface $validator, $root, TranslatorInterface $translator, string $translationDomain = null) + { + $this->validator = $validator; + $this->root = $root; + $this->translator = $translator; + $this->translationDomain = $translationDomain; + $this->violations = new ConstraintViolationList(); + $this->cachedObjectsRefs = new \SplObjectStorage(); + } + + /** + * {@inheritdoc} + */ + public function setNode($value, ?object $object, MetadataInterface $metadata = null, string $propertyPath) + { + $this->value = $value; + $this->object = $object; + $this->metadata = $metadata; + $this->propertyPath = $propertyPath; + } + + /** + * {@inheritdoc} + */ + public function setGroup(?string $group) + { + $this->group = $group; + } + + /** + * {@inheritdoc} + */ + public function setConstraint(Constraint $constraint) + { + $this->constraint = $constraint; + } + + /** + * {@inheritdoc} + */ + public function addViolation(string $message, array $parameters = []) + { + $this->violations->add(new ConstraintViolation( + $this->translator->trans($message, $parameters, $this->translationDomain), + $message, + $parameters, + $this->root, + $this->propertyPath, + $this->getValue(), + null, + null, + $this->constraint + )); + } + + /** + * {@inheritdoc} + */ + public function buildViolation(string $message, array $parameters = []): ConstraintViolationBuilderInterface + { + return new ConstraintViolationBuilder( + $this->violations, + $this->constraint, + $message, + $parameters, + $this->root, + $this->propertyPath, + $this->getValue(), + $this->translator, + $this->translationDomain + ); + } + + /** + * {@inheritdoc} + */ + public function getViolations(): ConstraintViolationListInterface + { + return $this->violations; + } + + /** + * {@inheritdoc} + */ + public function getValidator(): ValidatorInterface + { + return $this->validator; + } + + /** + * {@inheritdoc} + */ + public function getRoot() + { + return $this->root; + } + + /** + * {@inheritdoc} + */ + public function getValue() + { + if ($this->value instanceof LazyProperty) { + return $this->value->getPropertyValue(); + } + + return $this->value; + } + + /** + * {@inheritdoc} + */ + public function getObject() + { + return $this->object; + } + + /** + * {@inheritdoc} + */ + public function getMetadata(): ?MetadataInterface + { + return $this->metadata; + } + + /** + * {@inheritdoc} + */ + public function getGroup(): ?string + { + return $this->group; + } + + public function getConstraint(): ?Constraint + { + return $this->constraint; + } + + /** + * {@inheritdoc} + */ + public function getClassName(): ?string + { + return $this->metadata instanceof MemberMetadata || $this->metadata instanceof ClassMetadataInterface ? $this->metadata->getClassName() : null; + } + + /** + * {@inheritdoc} + */ + public function getPropertyName(): ?string + { + return $this->metadata instanceof PropertyMetadataInterface ? $this->metadata->getPropertyName() : null; + } + + /** + * {@inheritdoc} + */ + public function getPropertyPath(string $subPath = ''): string + { + return PropertyPath::append($this->propertyPath, $subPath); + } + + /** + * {@inheritdoc} + */ + public function markGroupAsValidated(string $cacheKey, string $groupHash) + { + if (!isset($this->validatedObjects[$cacheKey])) { + $this->validatedObjects[$cacheKey] = []; + } + + $this->validatedObjects[$cacheKey][$groupHash] = true; + } + + /** + * {@inheritdoc} + */ + public function isGroupValidated(string $cacheKey, string $groupHash): bool + { + return isset($this->validatedObjects[$cacheKey][$groupHash]); + } + + /** + * {@inheritdoc} + */ + public function markConstraintAsValidated(string $cacheKey, string $constraintHash) + { + $this->validatedConstraints[$cacheKey.':'.$constraintHash] = true; + } + + /** + * {@inheritdoc} + */ + public function isConstraintValidated(string $cacheKey, string $constraintHash): bool + { + return isset($this->validatedConstraints[$cacheKey.':'.$constraintHash]); + } + + /** + * {@inheritdoc} + */ + public function markObjectAsInitialized(string $cacheKey) + { + $this->initializedObjects[$cacheKey] = true; + } + + /** + * {@inheritdoc} + */ + public function isObjectInitialized(string $cacheKey): bool + { + return isset($this->initializedObjects[$cacheKey]); + } + + /** + * @internal + */ + public function generateCacheKey(object $object): string + { + if (!isset($this->cachedObjectsRefs[$object])) { + $this->cachedObjectsRefs[$object] = spl_object_hash($object); + } + + return $this->cachedObjectsRefs[$object]; + } + + public function __clone() + { + $this->violations = clone $this->violations; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php new file mode 100644 index 00000000000..623bd16eedf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Context; + +use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * Creates new {@link ExecutionContext} instances. + * + * @author Bernhard Schussek + * + * @internal version 2.5. Code against ExecutionContextFactoryInterface instead. + */ +class ExecutionContextFactory implements ExecutionContextFactoryInterface +{ + private $translator; + private $translationDomain; + + public function __construct(TranslatorInterface $translator, string $translationDomain = null) + { + $this->translator = $translator; + $this->translationDomain = $translationDomain; + } + + /** + * {@inheritdoc} + */ + public function createContext(ValidatorInterface $validator, $root) + { + return new ExecutionContext( + $validator, + $root, + $this->translator, + $this->translationDomain + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php new file mode 100644 index 00000000000..a300086ce6b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Context; + +use Symfony\Component\Validator\Validator\ValidatorInterface; + +/** + * Creates instances of {@link ExecutionContextInterface}. + * + * You can use a custom factory if you want to customize the execution context + * that is passed through the validation run. + * + * @author Bernhard Schussek + */ +interface ExecutionContextFactoryInterface +{ + /** + * Creates a new execution context. + * + * @param mixed $root The root value of the validated + * object graph + * + * @return ExecutionContextInterface + */ + public function createContext(ValidatorInterface $validator, $root); +} diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php new file mode 100644 index 00000000000..093aa71740a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php @@ -0,0 +1,339 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Context; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintViolationListInterface; +use Symfony\Component\Validator\Mapping; +use Symfony\Component\Validator\Mapping\MetadataInterface; +use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; + +/** + * The context of a validation run. + * + * The context collects all violations generated during the validation. By + * default, validators execute all validations in a new context: + * + * $violations = $validator->validate($object); + * + * When you make another call to the validator, while the validation is in + * progress, the violations will be isolated from each other: + * + * public function validate($value, Constraint $constraint) + * { + * $validator = $this->context->getValidator(); + * + * // The violations are not added to $this->context + * $violations = $validator->validate($value); + * } + * + * However, if you want to add the violations to the current context, use the + * {@link ValidatorInterface::inContext()} method: + * + * public function validate($value, Constraint $constraint) + * { + * $validator = $this->context->getValidator(); + * + * // The violations are added to $this->context + * $validator + * ->inContext($this->context) + * ->validate($value) + * ; + * } + * + * Additionally, the context provides information about the current state of + * the validator, such as the currently validated class, the name of the + * currently validated property and more. These values change over time, so you + * cannot store a context and expect that the methods still return the same + * results later on. + * + * @author Bernhard Schussek + */ +interface ExecutionContextInterface +{ + /** + * Adds a violation at the current node of the validation graph. + * + * @param string|\Stringable $message The error message as a string or a stringable object + * @param array $params The parameters substituted in the error message + */ + public function addViolation(string $message, array $params = []); + + /** + * Returns a builder for adding a violation with extended information. + * + * Call {@link ConstraintViolationBuilderInterface::addViolation()} to + * add the violation when you're done with the configuration: + * + * $context->buildViolation('Please enter a number between %min% and %max%.') + * ->setParameter('%min%', '3') + * ->setParameter('%max%', '10') + * ->setTranslationDomain('number_validation') + * ->addViolation(); + * + * @param string|\Stringable $message The error message as a string or a stringable object + * @param array $parameters The parameters substituted in the error message + * + * @return ConstraintViolationBuilderInterface + */ + public function buildViolation(string $message, array $parameters = []); + + /** + * Returns the validator. + * + * Useful if you want to validate additional constraints: + * + * public function validate($value, Constraint $constraint) + * { + * $validator = $this->context->getValidator(); + * + * $violations = $validator->validate($value, new Length(['min' => 3])); + * + * if (count($violations) > 0) { + * // ... + * } + * } + * + * @return ValidatorInterface + */ + public function getValidator(); + + /** + * Returns the currently validated object. + * + * If the validator is currently validating a class constraint, the + * object of that class is returned. If it is validating a property or + * getter constraint, the object that the property/getter belongs to is + * returned. + * + * In other cases, null is returned. + * + * @return object|null + */ + public function getObject(); + + /** + * Sets the currently validated value. + * + * @param mixed $value The validated value + * @param object|null $object The currently validated object + * @param string $propertyPath The property path to the current value + * + * @internal Used by the validator engine. Should not be called by user + * code. + */ + public function setNode($value, ?object $object, MetadataInterface $metadata = null, string $propertyPath); + + /** + * Sets the currently validated group. + * + * @param string|null $group The validated group + * + * @internal Used by the validator engine. Should not be called by user + * code. + */ + public function setGroup(?string $group); + + /** + * Sets the currently validated constraint. + * + * @internal Used by the validator engine. Should not be called by user + * code. + */ + public function setConstraint(Constraint $constraint); + + /** + * Marks an object as validated in a specific validation group. + * + * @param string $cacheKey The hash of the object + * @param string $groupHash The group's name or hash, if it is group + * sequence + * + * @internal Used by the validator engine. Should not be called by user + * code. + */ + public function markGroupAsValidated(string $cacheKey, string $groupHash); + + /** + * Returns whether an object was validated in a specific validation group. + * + * @param string $cacheKey The hash of the object + * @param string $groupHash The group's name or hash, if it is group + * sequence + * + * @return bool + * + * @internal Used by the validator engine. Should not be called by user + * code. + */ + public function isGroupValidated(string $cacheKey, string $groupHash); + + /** + * Marks a constraint as validated for an object. + * + * @param string $cacheKey The hash of the object + * @param string $constraintHash The hash of the constraint + * + * @internal Used by the validator engine. Should not be called by user + * code. + */ + public function markConstraintAsValidated(string $cacheKey, string $constraintHash); + + /** + * Returns whether a constraint was validated for an object. + * + * @param string $cacheKey The hash of the object + * @param string $constraintHash The hash of the constraint + * + * @return bool + * + * @internal Used by the validator engine. Should not be called by user + * code. + */ + public function isConstraintValidated(string $cacheKey, string $constraintHash); + + /** + * Marks that an object was initialized. + * + * @param string $cacheKey The hash of the object + * + * @internal Used by the validator engine. Should not be called by user + * code. + * + * @see ObjectInitializerInterface + */ + public function markObjectAsInitialized(string $cacheKey); + + /** + * Returns whether an object was initialized. + * + * @param string $cacheKey The hash of the object + * + * @return bool + * + * @internal Used by the validator engine. Should not be called by user + * code. + * + * @see ObjectInitializerInterface + */ + public function isObjectInitialized(string $cacheKey); + + /** + * Returns the violations generated by the validator so far. + * + * @return ConstraintViolationListInterface + */ + public function getViolations(); + + /** + * Returns the value at which validation was started in the object graph. + * + * The validator, when given an object, traverses the properties and + * related objects and their properties. The root of the validation is the + * object from which the traversal started. + * + * The current value is returned by {@link getValue}. + * + * @return mixed + */ + public function getRoot(); + + /** + * Returns the value that the validator is currently validating. + * + * If you want to retrieve the object that was originally passed to the + * validator, use {@link getRoot}. + * + * @return mixed + */ + public function getValue(); + + /** + * Returns the metadata for the currently validated value. + * + * With the core implementation, this method returns a + * {@link Mapping\ClassMetadataInterface} instance if the current value is an object, + * a {@link Mapping\PropertyMetadata} instance if the current value is + * the value of a property and a {@link Mapping\GetterMetadata} instance if + * the validated value is the result of a getter method. + * + * If the validated value is neither of these, for example if the validator + * has been called with a plain value and constraint, this method returns + * null. + * + * @return MetadataInterface|null + */ + public function getMetadata(); + + /** + * Returns the validation group that is currently being validated. + * + * @return string|null + */ + public function getGroup(); + + /** + * Returns the class name of the current node. + * + * If the metadata of the current node does not implement + * {@link Mapping\ClassMetadataInterface} or if no metadata is available for the + * current node, this method returns null. + * + * @return string|null + */ + public function getClassName(); + + /** + * Returns the property name of the current node. + * + * If the metadata of the current node does not implement + * {@link PropertyMetadataInterface} or if no metadata is available for the + * current node, this method returns null. + * + * @return string|null + */ + public function getPropertyName(); + + /** + * Returns the property path to the value that the validator is currently + * validating. + * + * For example, take the following object graph: + * + *
    +     * (Person)---($address: Address)---($street: string)
    +     * 
    + * + * When the Person instance is passed to the validator, the + * property path is initially empty. When the $address property + * of that person is validated, the property path is "address". When + * the $street property of the related Address instance + * is validated, the property path is "address.street". + * + * Properties of objects are prefixed with a dot in the property path. + * Indices of arrays or objects implementing the {@link \ArrayAccess} + * interface are enclosed in brackets. For example, if the property in + * the previous example is $addresses and contains an array + * of Address instance, the property path generated for the + * $street property of one of these addresses is for example + * "addresses[0].street". + * + * @param string $subPath Optional. The suffix appended to the current + * property path. + * + * @return string The current property path. The result may be an empty + * string if the validator is currently validating the + * root value of the validation graph. + */ + public function getPropertyPath(string $subPath = ''); +} diff --git a/upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php b/upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php new file mode 100644 index 00000000000..2b36267fbec --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\DataCollector; + +use Symfony\Component\Form\FormInterface; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\DataCollector\DataCollector; +use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; +use Symfony\Component\Validator\Validator\TraceableValidator; +use Symfony\Component\VarDumper\Caster\Caster; +use Symfony\Component\VarDumper\Caster\ClassStub; +use Symfony\Component\VarDumper\Cloner\Data; +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Maxime Steinhausser + * + * @final + */ +class ValidatorDataCollector extends DataCollector implements LateDataCollectorInterface +{ + private $validator; + + public function __construct(TraceableValidator $validator) + { + $this->validator = $validator; + $this->reset(); + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Throwable $exception = null) + { + // Everything is collected once, on kernel terminate. + } + + public function reset() + { + $this->data = [ + 'calls' => $this->cloneVar([]), + 'violations_count' => 0, + ]; + } + + /** + * {@inheritdoc} + */ + public function lateCollect() + { + $collected = $this->validator->getCollectedData(); + $this->data['calls'] = $this->cloneVar($collected); + $this->data['violations_count'] = array_reduce($collected, function ($previous, $item) { + return $previous + \count($item['violations']); + }, 0); + } + + public function getCalls(): Data + { + return $this->data['calls']; + } + + public function getViolationsCount(): int + { + return $this->data['violations_count']; + } + + /** + * {@inheritdoc} + */ + public function getName(): string + { + return 'validator'; + } + + protected function getCasters(): array + { + return parent::getCasters() + [ + \Exception::class => function (\Exception $e, array $a, Stub $s) { + foreach (["\0Exception\0previous", "\0Exception\0trace"] as $k) { + if (isset($a[$k])) { + unset($a[$k]); + ++$s->cut; + } + } + + return $a; + }, + FormInterface::class => function (FormInterface $f, array $a) { + return [ + Caster::PREFIX_VIRTUAL.'name' => $f->getName(), + Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(\get_class($f->getConfig()->getType()->getInnerType())), + Caster::PREFIX_VIRTUAL.'data' => $f->getData(), + ]; + }, + ]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php new file mode 100644 index 00000000000..dca06ee1b43 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; + +/** + * Injects the automapping configuration as last argument of loaders tagged with the "validator.auto_mapper" tag. + * + * @author Kévin Dunglas + */ +class AddAutoMappingConfigurationPass implements CompilerPassInterface +{ + private $validatorBuilderService; + private $tag; + + public function __construct(string $validatorBuilderService = 'validator.builder', string $tag = 'validator.auto_mapper') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/validator', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->validatorBuilderService = $validatorBuilderService; + $this->tag = $tag; + } + + /** + * {@inheritdoc} + */ + public function process(ContainerBuilder $container) + { + if (!$container->hasParameter('validator.auto_mapping') || !$container->hasDefinition($this->validatorBuilderService)) { + return; + } + + $config = $container->getParameter('validator.auto_mapping'); + + $globalNamespaces = []; + $servicesToNamespaces = []; + foreach ($config as $namespace => $value) { + if ([] === $value['services']) { + $globalNamespaces[] = $namespace; + + continue; + } + + foreach ($value['services'] as $service) { + $servicesToNamespaces[$service][] = $namespace; + } + } + + $validatorBuilder = $container->getDefinition($this->validatorBuilderService); + foreach ($container->findTaggedServiceIds($this->tag) as $id => $tags) { + $regexp = $this->getRegexp(array_merge($globalNamespaces, $servicesToNamespaces[$id] ?? [])); + $validatorBuilder->addMethodCall('addLoader', [new Reference($id)]); + $container->getDefinition($id)->setArgument('$classValidatorRegexp', $regexp); + } + + $container->getParameterBag()->remove('validator.auto_mapping'); + } + + /** + * Builds a regexp to check if a class is auto-mapped. + */ + private function getRegexp(array $patterns): ?string + { + if (!$patterns) { + return null; + } + + $regexps = []; + foreach ($patterns as $pattern) { + // Escape namespace + $regex = preg_quote(ltrim($pattern, '\\')); + + // Wildcards * and ** + $regex = strtr($regex, ['\\*\\*' => '.*?', '\\*' => '[^\\\\]*?']); + + // If this class does not end by a slash, anchor the end + if (!str_ends_with($regex, '\\')) { + $regex .= '$'; + } + + $regexps[] = '^'.$regex; + } + + return sprintf('{%s}', implode('|', $regexps)); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php new file mode 100644 index 00000000000..a3c65598929 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; + +/** + * @author Johannes M. Schmitt + * @author Robin Chalas + */ +class AddConstraintValidatorsPass implements CompilerPassInterface +{ + private $validatorFactoryServiceId; + private $constraintValidatorTag; + + public function __construct(string $validatorFactoryServiceId = 'validator.validator_factory', string $constraintValidatorTag = 'validator.constraint_validator') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/validator', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->validatorFactoryServiceId = $validatorFactoryServiceId; + $this->constraintValidatorTag = $constraintValidatorTag; + } + + public function process(ContainerBuilder $container) + { + if (!$container->hasDefinition($this->validatorFactoryServiceId)) { + return; + } + + $validators = []; + foreach ($container->findTaggedServiceIds($this->constraintValidatorTag, true) as $id => $attributes) { + $definition = $container->getDefinition($id); + + if (isset($attributes[0]['alias'])) { + $validators[$attributes[0]['alias']] = new Reference($id); + } + + $validators[$definition->getClass()] = new Reference($id); + } + + $container + ->getDefinition($this->validatorFactoryServiceId) + ->replaceArgument(0, ServiceLocatorTagPass::register($container, $validators)) + ; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php new file mode 100644 index 00000000000..0ea8eef7157 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; + +/** + * @author Fabien Potencier + * @author Robin Chalas + */ +class AddValidatorInitializersPass implements CompilerPassInterface +{ + private $builderService; + private $initializerTag; + + public function __construct(string $builderService = 'validator.builder', string $initializerTag = 'validator.initializer') + { + if (0 < \func_num_args()) { + trigger_deprecation('symfony/validator', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); + } + + $this->builderService = $builderService; + $this->initializerTag = $initializerTag; + } + + public function process(ContainerBuilder $container) + { + if (!$container->hasDefinition($this->builderService)) { + return; + } + + $initializers = []; + foreach ($container->findTaggedServiceIds($this->initializerTag, true) as $id => $attributes) { + $initializers[] = new Reference($id); + } + + $container->getDefinition($this->builderService)->addMethodCall('addObjectInitializers', [$initializers]); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/BadMethodCallException.php b/upload/system/storage/vendor/symfony/validator/Exception/BadMethodCallException.php new file mode 100644 index 00000000000..939161bff3f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/BadMethodCallException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base BadMethodCallException for the Validator component. + * + * @author Bernhard Schussek + */ +class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/ConstraintDefinitionException.php b/upload/system/storage/vendor/symfony/validator/Exception/ConstraintDefinitionException.php new file mode 100644 index 00000000000..b24fdd68d29 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/ConstraintDefinitionException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class ConstraintDefinitionException extends ValidatorException +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php b/upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php new file mode 100644 index 00000000000..390e8c053fe --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base ExceptionInterface for the Validator component. + * + * @author Bernhard Schussek + */ +interface ExceptionInterface extends \Throwable +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/GroupDefinitionException.php b/upload/system/storage/vendor/symfony/validator/Exception/GroupDefinitionException.php new file mode 100644 index 00000000000..ab7e91d9e6e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/GroupDefinitionException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class GroupDefinitionException extends ValidatorException +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/InvalidArgumentException.php b/upload/system/storage/vendor/symfony/validator/Exception/InvalidArgumentException.php new file mode 100644 index 00000000000..22da39bb262 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/InvalidArgumentException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base InvalidArgumentException for the Validator component. + * + * @author Bernhard Schussek + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php b/upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php new file mode 100644 index 00000000000..79d064f5377 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class InvalidOptionsException extends ValidatorException +{ + private $options; + + public function __construct(string $message, array $options) + { + parent::__construct($message); + + $this->options = $options; + } + + public function getOptions() + { + return $this->options; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/LogicException.php b/upload/system/storage/vendor/symfony/validator/Exception/LogicException.php new file mode 100644 index 00000000000..41d0975c388 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/LogicException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class LogicException extends \LogicException implements ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/MappingException.php b/upload/system/storage/vendor/symfony/validator/Exception/MappingException.php new file mode 100644 index 00000000000..4c8c057b9f4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/MappingException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class MappingException extends ValidatorException +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php b/upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php new file mode 100644 index 00000000000..61de56755de --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class MissingOptionsException extends ValidatorException +{ + private $options; + + public function __construct(string $message, array $options) + { + parent::__construct($message); + + $this->options = $options; + } + + public function getOptions() + { + return $this->options; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/NoSuchMetadataException.php b/upload/system/storage/vendor/symfony/validator/Exception/NoSuchMetadataException.php new file mode 100644 index 00000000000..4cac74cf306 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/NoSuchMetadataException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * @author Bernhard Schussek + */ +class NoSuchMetadataException extends ValidatorException +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/OutOfBoundsException.php b/upload/system/storage/vendor/symfony/validator/Exception/OutOfBoundsException.php new file mode 100644 index 00000000000..30906e8a82c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/OutOfBoundsException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base OutOfBoundsException for the Validator component. + * + * @author Bernhard Schussek + */ +class OutOfBoundsException extends \OutOfBoundsException implements ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/RuntimeException.php b/upload/system/storage/vendor/symfony/validator/Exception/RuntimeException.php new file mode 100644 index 00000000000..df4a50c4743 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/RuntimeException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * Base RuntimeException for the Validator component. + * + * @author Bernhard Schussek + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php b/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php new file mode 100644 index 00000000000..86a7c03211a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class UnexpectedTypeException extends ValidatorException +{ + public function __construct($value, string $expectedType) + { + parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, get_debug_type($value))); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php b/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php new file mode 100644 index 00000000000..7a7f7f7bf29 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * @author Christian Flothmann + */ +class UnexpectedValueException extends UnexpectedTypeException +{ + private $expectedType; + + public function __construct($value, string $expectedType) + { + parent::__construct($value, $expectedType); + + $this->expectedType = $expectedType; + } + + public function getExpectedType(): string + { + return $this->expectedType; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/UnsupportedMetadataException.php b/upload/system/storage/vendor/symfony/validator/Exception/UnsupportedMetadataException.php new file mode 100644 index 00000000000..aff569b9575 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/UnsupportedMetadataException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +/** + * @author Bernhard Schussek + */ +class UnsupportedMetadataException extends InvalidArgumentException +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php b/upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php new file mode 100644 index 00000000000..ca0314cf6e7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +use Symfony\Component\Validator\ConstraintViolationListInterface; + +/** + * @author Jan Vernieuwe + */ +class ValidationFailedException extends RuntimeException +{ + private $violations; + private $value; + + public function __construct($value, ConstraintViolationListInterface $violations) + { + $this->violations = $violations; + $this->value = $value; + parent::__construct($violations); + } + + public function getValue() + { + return $this->value; + } + + public function getViolations(): ConstraintViolationListInterface + { + return $this->violations; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/ValidatorException.php b/upload/system/storage/vendor/symfony/validator/Exception/ValidatorException.php new file mode 100644 index 00000000000..28bd4704e8f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Exception/ValidatorException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Exception; + +class ValidatorException extends RuntimeException +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php b/upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php new file mode 100644 index 00000000000..0374a8b3eed --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Symfony\Component\Validator\Constraints\GroupSequence; + +/** + * Defines the interface for a group sequence provider. + */ +interface GroupSequenceProviderInterface +{ + /** + * Returns which validation groups should be used for a certain state + * of the object. + * + * @return string[]|string[][]|GroupSequence + */ + public function getGroupSequence(); +} diff --git a/upload/system/storage/vendor/symfony/validator/LICENSE b/upload/system/storage/vendor/symfony/validator/LICENSE new file mode 100644 index 00000000000..88bf75bb4d6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php b/upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php new file mode 100644 index 00000000000..4012ddcff9c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +/** + * Specifies how the auto-mapping feature should behave. + * + * @author Maxime Steinhausser + */ +final class AutoMappingStrategy +{ + /** + * Nothing explicitly set, rely on auto-mapping configured regex. + */ + public const NONE = 0; + + /** + * Explicitly enabled. + */ + public const ENABLED = 1; + + /** + * Explicitly disabled. + */ + public const DISABLED = 2; + + /** + * Not instantiable. + */ + private function __construct() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php b/upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php new file mode 100644 index 00000000000..6bab8ac4e69 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +/** + * Specifies whether an object should be cascaded. + * + * Cascading is relevant for any node type but class nodes. If such a node + * contains an object of value, and if cascading is enabled, then the node + * traverser will try to find class metadata for that object and validate the + * object against that metadata. + * + * If no metadata is found for a cascaded object, and if that object implements + * {@link \Traversable}, the node traverser will iterate over the object and + * cascade each object or collection contained within, unless iteration is + * prohibited by the specified {@link TraversalStrategy}. + * + * Although the constants currently represent a boolean switch, they are + * implemented as bit mask in order to allow future extensions. + * + * @author Bernhard Schussek + * + * @see TraversalStrategy + */ +class CascadingStrategy +{ + /** + * Specifies that a node should not be cascaded. + */ + public const NONE = 1; + + /** + * Specifies that a node should be cascaded. + */ + public const CASCADE = 2; + + /** + * Not instantiable. + */ + private function __construct() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php new file mode 100644 index 00000000000..31f54848e23 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php @@ -0,0 +1,513 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Cascade; +use Symfony\Component\Validator\Constraints\Composite; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\Constraints\Traverse; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\GroupDefinitionException; + +/** + * Default implementation of {@link ClassMetadataInterface}. + * + * This class supports serialization and cloning. + * + * @author Bernhard Schussek + * @author Fabien Potencier + */ +class ClassMetadata extends GenericMetadata implements ClassMetadataInterface +{ + /** + * @var string + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getClassName()} instead. + */ + public $name; + + /** + * @var string + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getDefaultGroup()} instead. + */ + public $defaultGroup; + + /** + * @var MemberMetadata[][] + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getPropertyMetadata()} instead. + */ + public $members = []; + + /** + * @var PropertyMetadata[] + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getPropertyMetadata()} instead. + */ + public $properties = []; + + /** + * @var GetterMetadata[] + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getPropertyMetadata()} instead. + */ + public $getters = []; + + /** + * @var array + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getGroupSequence()} instead. + */ + public $groupSequence = []; + + /** + * @var bool + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link isGroupSequenceProvider()} instead. + */ + public $groupSequenceProvider = false; + + /** + * The strategy for traversing traversable objects. + * + * By default, only instances of {@link \Traversable} are traversed. + * + * @var int + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getTraversalStrategy()} instead. + */ + public $traversalStrategy = TraversalStrategy::IMPLICIT; + + /** + * @var \ReflectionClass + */ + private $reflClass; + + public function __construct(string $class) + { + $this->name = $class; + // class name without namespace + if (false !== $nsSep = strrpos($class, '\\')) { + $this->defaultGroup = substr($class, $nsSep + 1); + } else { + $this->defaultGroup = $class; + } + } + + /** + * {@inheritdoc} + */ + public function __sleep() + { + $parentProperties = parent::__sleep(); + + // Don't store the cascading strategy. Classes never cascade. + unset($parentProperties[array_search('cascadingStrategy', $parentProperties)]); + + return array_merge($parentProperties, [ + 'getters', + 'groupSequence', + 'groupSequenceProvider', + 'members', + 'name', + 'properties', + 'defaultGroup', + ]); + } + + /** + * {@inheritdoc} + */ + public function getClassName() + { + return $this->name; + } + + /** + * Returns the name of the default group for this class. + * + * For each class, the group "Default" is an alias for the group + * "", where is the non-namespaced name of the + * class. All constraints implicitly or explicitly assigned to group + * "Default" belong to both of these groups, unless the class defines + * a group sequence. + * + * If a class defines a group sequence, validating the class in "Default" + * will validate the group sequence. The constraints assigned to "Default" + * can still be validated by validating the class in "". + * + * @return string + */ + public function getDefaultGroup() + { + return $this->defaultGroup; + } + + /** + * {@inheritdoc} + * + * If the constraint {@link Cascade} is added, the cascading strategy will be + * changed to {@link CascadingStrategy::CASCADE}. + * + * If the constraint {@link Traverse} is added, the traversal strategy will be + * changed. Depending on the $traverse property of that constraint, + * the traversal strategy will be set to one of the following: + * + * - {@link TraversalStrategy::IMPLICIT} by default + * - {@link TraversalStrategy::NONE} if $traverse is disabled + * - {@link TraversalStrategy::TRAVERSE} if $traverse is enabled + */ + public function addConstraint(Constraint $constraint) + { + $this->checkConstraint($constraint); + + if ($constraint instanceof Traverse) { + if ($constraint->traverse) { + // If traverse is true, traversal should be explicitly enabled + $this->traversalStrategy = TraversalStrategy::TRAVERSE; + } else { + // If traverse is false, traversal should be explicitly disabled + $this->traversalStrategy = TraversalStrategy::NONE; + } + + // The constraint is not added + return $this; + } + + if ($constraint instanceof Cascade) { + if (\PHP_VERSION_ID < 70400) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" requires PHP 7.4.', Cascade::class)); + } + + $this->cascadingStrategy = CascadingStrategy::CASCADE; + + foreach ($this->getReflectionClass()->getProperties() as $property) { + if ($property->hasType() && (('array' === $type = $property->getType()->getName()) || class_exists(($type)))) { + $this->addPropertyConstraint($property->getName(), new Valid()); + } + } + + // The constraint is not added + return $this; + } + + $constraint->addImplicitGroupName($this->getDefaultGroup()); + + parent::addConstraint($constraint); + + return $this; + } + + /** + * Adds a constraint to the given property. + * + * @return $this + */ + public function addPropertyConstraint(string $property, Constraint $constraint) + { + if (!isset($this->properties[$property])) { + $this->properties[$property] = new PropertyMetadata($this->getClassName(), $property); + + $this->addPropertyMetadata($this->properties[$property]); + } + + $constraint->addImplicitGroupName($this->getDefaultGroup()); + + $this->properties[$property]->addConstraint($constraint); + + return $this; + } + + /** + * @param Constraint[] $constraints + * + * @return $this + */ + public function addPropertyConstraints(string $property, array $constraints) + { + foreach ($constraints as $constraint) { + $this->addPropertyConstraint($property, $constraint); + } + + return $this; + } + + /** + * Adds a constraint to the getter of the given property. + * + * The name of the getter is assumed to be the name of the property with an + * uppercased first letter and the prefix "get", "is" or "has". + * + * @return $this + */ + public function addGetterConstraint(string $property, Constraint $constraint) + { + if (!isset($this->getters[$property])) { + $this->getters[$property] = new GetterMetadata($this->getClassName(), $property); + + $this->addPropertyMetadata($this->getters[$property]); + } + + $constraint->addImplicitGroupName($this->getDefaultGroup()); + + $this->getters[$property]->addConstraint($constraint); + + return $this; + } + + /** + * Adds a constraint to the getter of the given property. + * + * @return $this + */ + public function addGetterMethodConstraint(string $property, string $method, Constraint $constraint) + { + if (!isset($this->getters[$property])) { + $this->getters[$property] = new GetterMetadata($this->getClassName(), $property, $method); + + $this->addPropertyMetadata($this->getters[$property]); + } + + $constraint->addImplicitGroupName($this->getDefaultGroup()); + + $this->getters[$property]->addConstraint($constraint); + + return $this; + } + + /** + * @param Constraint[] $constraints + * + * @return $this + */ + public function addGetterConstraints(string $property, array $constraints) + { + foreach ($constraints as $constraint) { + $this->addGetterConstraint($property, $constraint); + } + + return $this; + } + + /** + * @param Constraint[] $constraints + * + * @return $this + */ + public function addGetterMethodConstraints(string $property, string $method, array $constraints) + { + foreach ($constraints as $constraint) { + $this->addGetterMethodConstraint($property, $method, $constraint); + } + + return $this; + } + + /** + * Merges the constraints of the given metadata into this object. + */ + public function mergeConstraints(self $source) + { + if ($source->isGroupSequenceProvider()) { + $this->setGroupSequenceProvider(true); + } + + foreach ($source->getConstraints() as $constraint) { + $this->addConstraint(clone $constraint); + } + + foreach ($source->getConstrainedProperties() as $property) { + foreach ($source->getPropertyMetadata($property) as $member) { + $member = clone $member; + + foreach ($member->getConstraints() as $constraint) { + if (\in_array($constraint::DEFAULT_GROUP, $constraint->groups, true)) { + $member->constraintsByGroup[$this->getDefaultGroup()][] = $constraint; + } + + $constraint->addImplicitGroupName($this->getDefaultGroup()); + } + + $this->addPropertyMetadata($member); + + if ($member instanceof MemberMetadata && !$member->isPrivate($this->name)) { + $property = $member->getPropertyName(); + + if ($member instanceof PropertyMetadata && !isset($this->properties[$property])) { + $this->properties[$property] = $member; + } elseif ($member instanceof GetterMetadata && !isset($this->getters[$property])) { + $this->getters[$property] = $member; + } + } + } + } + } + + /** + * {@inheritdoc} + */ + public function hasPropertyMetadata(string $property) + { + return \array_key_exists($property, $this->members); + } + + /** + * {@inheritdoc} + */ + public function getPropertyMetadata(string $property) + { + return $this->members[$property] ?? []; + } + + /** + * {@inheritdoc} + */ + public function getConstrainedProperties() + { + return array_keys($this->members); + } + + /** + * Sets the default group sequence for this class. + * + * @param string[]|GroupSequence $groupSequence An array of group names + * + * @return $this + * + * @throws GroupDefinitionException + */ + public function setGroupSequence($groupSequence) + { + if ($this->isGroupSequenceProvider()) { + throw new GroupDefinitionException('Defining a static group sequence is not allowed with a group sequence provider.'); + } + + if (\is_array($groupSequence)) { + $groupSequence = new GroupSequence($groupSequence); + } + + if (\in_array(Constraint::DEFAULT_GROUP, $groupSequence->groups, true)) { + throw new GroupDefinitionException(sprintf('The group "%s" is not allowed in group sequences.', Constraint::DEFAULT_GROUP)); + } + + if (!\in_array($this->getDefaultGroup(), $groupSequence->groups, true)) { + throw new GroupDefinitionException(sprintf('The group "%s" is missing in the group sequence.', $this->getDefaultGroup())); + } + + $this->groupSequence = $groupSequence; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function hasGroupSequence() + { + return $this->groupSequence && \count($this->groupSequence->groups) > 0; + } + + /** + * {@inheritdoc} + */ + public function getGroupSequence() + { + return $this->groupSequence; + } + + /** + * Returns a ReflectionClass instance for this class. + * + * @return \ReflectionClass + */ + public function getReflectionClass() + { + if (!$this->reflClass) { + $this->reflClass = new \ReflectionClass($this->getClassName()); + } + + return $this->reflClass; + } + + /** + * Sets whether a group sequence provider should be used. + * + * @throws GroupDefinitionException + */ + public function setGroupSequenceProvider(bool $active) + { + if ($this->hasGroupSequence()) { + throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence.'); + } + + if (!$this->getReflectionClass()->implementsInterface('Symfony\Component\Validator\GroupSequenceProviderInterface')) { + throw new GroupDefinitionException(sprintf('Class "%s" must implement GroupSequenceProviderInterface.', $this->name)); + } + + $this->groupSequenceProvider = $active; + } + + /** + * {@inheritdoc} + */ + public function isGroupSequenceProvider() + { + return $this->groupSequenceProvider; + } + + /** + * {@inheritdoc} + */ + public function getCascadingStrategy() + { + return $this->cascadingStrategy; + } + + private function addPropertyMetadata(PropertyMetadataInterface $metadata) + { + $property = $metadata->getPropertyName(); + + $this->members[$property][] = $metadata; + } + + private function checkConstraint(Constraint $constraint) + { + if (!\in_array(Constraint::CLASS_CONSTRAINT, (array) $constraint->getTargets(), true)) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', get_debug_type($constraint))); + } + + if ($constraint instanceof Composite) { + foreach ($constraint->getNestedConstraints() as $nestedConstraint) { + $this->checkConstraint($nestedConstraint); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php new file mode 100644 index 00000000000..99764c53464 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\GroupSequenceProviderInterface; + +/** + * Stores all metadata needed for validating objects of specific class. + * + * Most importantly, the metadata stores the constraints against which an object + * and its properties should be validated. + * + * Additionally, the metadata stores whether the "Default" group is overridden + * by a group sequence for that class and whether instances of that class + * should be traversed or not. + * + * @author Bernhard Schussek + * + * @see MetadataInterface + * @see GroupSequence + * @see GroupSequenceProviderInterface + * @see TraversalStrategy + */ +interface ClassMetadataInterface extends MetadataInterface +{ + /** + * Returns the names of all constrained properties. + * + * @return string[] + */ + public function getConstrainedProperties(); + + /** + * Returns whether the "Default" group is overridden by a group sequence. + * + * If it is, you can access the group sequence with {@link getGroupSequence()}. + * + * @return bool + */ + public function hasGroupSequence(); + + /** + * Returns the group sequence that overrides the "Default" group for this + * class. + * + * @return GroupSequence|null + */ + public function getGroupSequence(); + + /** + * Returns whether the "Default" group is overridden by a dynamic group + * sequence obtained by the validated objects. + * + * If this method returns true, the class must implement + * {@link GroupSequenceProviderInterface}. + * This interface will be used to obtain the group sequence when an object + * of this class is validated. + * + * @return bool + */ + public function isGroupSequenceProvider(); + + /** + * Check if there's any metadata attached to the given named property. + * + * @param string $property The property name + * + * @return bool + */ + public function hasPropertyMetadata(string $property); + + /** + * Returns all metadata instances for the given named property. + * + * If your implementation does not support properties, throw an exception + * in this method (for example a BadMethodCallException). + * + * @param string $property The property name + * + * @return PropertyMetadataInterface[] + */ + public function getPropertyMetadata(string $property); + + /** + * Returns the name of the backing PHP class. + * + * @return string + */ + public function getClassName(); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php new file mode 100644 index 00000000000..ec21d54a6ef --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Factory; + +use Symfony\Component\Validator\Exception\LogicException; + +/** + * Metadata factory that does not store metadata. + * + * This implementation is useful if you want to validate values against + * constraints only and you don't need to add constraints to classes and + * properties. + * + * @author Fabien Potencier + */ +class BlackHoleMetadataFactory implements MetadataFactoryInterface +{ + /** + * {@inheritdoc} + */ + public function getMetadataFor($value) + { + throw new LogicException('This class does not support metadata.'); + } + + /** + * {@inheritdoc} + */ + public function hasMetadataFor($value) + { + return false; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php new file mode 100644 index 00000000000..42ed0508d80 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php @@ -0,0 +1,165 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Factory; + +use Psr\Cache\CacheItemPoolInterface; +use Symfony\Component\Validator\Exception\NoSuchMetadataException; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; + +/** + * Creates new {@link ClassMetadataInterface} instances. + * + * Whenever {@link getMetadataFor()} is called for the first time with a given + * class name or object of that class, a new metadata instance is created and + * returned. On subsequent requests for the same class, the same metadata + * instance will be returned. + * + * You can optionally pass a {@link LoaderInterface} instance to the constructor. + * Whenever a new metadata instance is created, it is passed to the loader, + * which can configure the metadata based on configuration loaded from the + * filesystem or a database. If you want to use multiple loaders, wrap them in a + * {@link LoaderChain}. + * + * You can also optionally pass a {@link CacheInterface} instance to the + * constructor. This cache will be used for persisting the generated metadata + * between multiple PHP requests. + * + * @author Bernhard Schussek + */ +class LazyLoadingMetadataFactory implements MetadataFactoryInterface +{ + protected $loader; + protected $cache; + + /** + * The loaded metadata, indexed by class name. + * + * @var ClassMetadata[] + */ + protected $loadedClasses = []; + + public function __construct(LoaderInterface $loader = null, CacheItemPoolInterface $cache = null) + { + $this->loader = $loader; + $this->cache = $cache; + } + + /** + * {@inheritdoc} + * + * If the method was called with the same class name (or an object of that + * class) before, the same metadata instance is returned. + * + * If the factory was configured with a cache, this method will first look + * for an existing metadata instance in the cache. If an existing instance + * is found, it will be returned without further ado. + * + * Otherwise, a new metadata instance is created. If the factory was + * configured with a loader, the metadata is passed to the + * {@link LoaderInterface::loadClassMetadata()} method for further + * configuration. At last, the new object is returned. + */ + public function getMetadataFor($value) + { + if (!\is_object($value) && !\is_string($value)) { + throw new NoSuchMetadataException(sprintf('Cannot create metadata for non-objects. Got: "%s".', get_debug_type($value))); + } + + $class = ltrim(\is_object($value) ? \get_class($value) : $value, '\\'); + + if (isset($this->loadedClasses[$class])) { + return $this->loadedClasses[$class]; + } + + if (!class_exists($class) && !interface_exists($class, false)) { + throw new NoSuchMetadataException(sprintf('The class or interface "%s" does not exist.', $class)); + } + + $cacheItem = null === $this->cache ? null : $this->cache->getItem($this->escapeClassName($class)); + if ($cacheItem && $cacheItem->isHit()) { + $metadata = $cacheItem->get(); + + // Include constraints from the parent class + $this->mergeConstraints($metadata); + + return $this->loadedClasses[$class] = $metadata; + } + + $metadata = new ClassMetadata($class); + + if (null !== $this->loader) { + $this->loader->loadClassMetadata($metadata); + } + + if (null !== $cacheItem) { + $this->cache->save($cacheItem->set($metadata)); + } + + // Include constraints from the parent class + $this->mergeConstraints($metadata); + + return $this->loadedClasses[$class] = $metadata; + } + + private function mergeConstraints(ClassMetadata $metadata) + { + if ($metadata->getReflectionClass()->isInterface()) { + return; + } + + // Include constraints from the parent class + if ($parent = $metadata->getReflectionClass()->getParentClass()) { + $metadata->mergeConstraints($this->getMetadataFor($parent->name)); + } + + // Include constraints from all directly implemented interfaces + foreach ($metadata->getReflectionClass()->getInterfaces() as $interface) { + if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->name) { + continue; + } + + if ($parent && \in_array($interface->getName(), $parent->getInterfaceNames(), true)) { + continue; + } + + $metadata->mergeConstraints($this->getMetadataFor($interface->name)); + } + } + + /** + * {@inheritdoc} + */ + public function hasMetadataFor($value) + { + if (!\is_object($value) && !\is_string($value)) { + return false; + } + + $class = ltrim(\is_object($value) ? \get_class($value) : $value, '\\'); + + return class_exists($class) || interface_exists($class, false); + } + + /** + * Replaces backslashes by dots in a class name. + */ + private function escapeClassName(string $class): string + { + if (str_contains($class, '@')) { + // anonymous class: replace all PSR6-reserved characters + return str_replace(["\0", '\\', '/', '@', ':', '{', '}', '(', ')'], '.', $class); + } + + return str_replace('\\', '.', $class); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php new file mode 100644 index 00000000000..d3517c52e18 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Factory; + +use Symfony\Component\Validator\Exception\NoSuchMetadataException; +use Symfony\Component\Validator\Mapping\MetadataInterface; + +/** + * Returns {@link \Symfony\Component\Validator\Mapping\MetadataInterface} instances for values. + * + * @author Bernhard Schussek + */ +interface MetadataFactoryInterface +{ + /** + * Returns the metadata for the given value. + * + * @param mixed $value Some value + * + * @return MetadataInterface + * + * @throws NoSuchMetadataException If no metadata exists for the given value + */ + public function getMetadataFor($value); + + /** + * Returns whether the class is able to return metadata for the given value. + * + * @param mixed $value Some value + * + * @return bool + */ + public function hasMetadataFor($value); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php new file mode 100644 index 00000000000..06971e8f925 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php @@ -0,0 +1,240 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Cascade; +use Symfony\Component\Validator\Constraints\DisableAutoMapping; +use Symfony\Component\Validator\Constraints\EnableAutoMapping; +use Symfony\Component\Validator\Constraints\Traverse; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * A generic container of {@link Constraint} objects. + * + * This class supports serialization and cloning. + * + * @author Bernhard Schussek + */ +class GenericMetadata implements MetadataInterface +{ + /** + * @var Constraint[] + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getConstraints()} and {@link findConstraints()} instead. + */ + public $constraints = []; + + /** + * @var array + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link findConstraints()} instead. + */ + public $constraintsByGroup = []; + + /** + * The strategy for cascading objects. + * + * By default, objects are not cascaded. + * + * @var int + * + * @see CascadingStrategy + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getCascadingStrategy()} instead. + */ + public $cascadingStrategy = CascadingStrategy::NONE; + + /** + * The strategy for traversing traversable objects. + * + * By default, traversable objects are not traversed. + * + * @var int + * + * @see TraversalStrategy + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getTraversalStrategy()} instead. + */ + public $traversalStrategy = TraversalStrategy::NONE; + + /** + * Is auto-mapping enabled? + * + * @var int + * + * @see AutoMappingStrategy + * + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getAutoMappingStrategy()} instead. + */ + public $autoMappingStrategy = AutoMappingStrategy::NONE; + + /** + * Returns the names of the properties that should be serialized. + * + * @return string[] + */ + public function __sleep() + { + return [ + 'constraints', + 'constraintsByGroup', + 'cascadingStrategy', + 'traversalStrategy', + 'autoMappingStrategy', + ]; + } + + /** + * Clones this object. + */ + public function __clone() + { + $constraints = $this->constraints; + + $this->constraints = []; + $this->constraintsByGroup = []; + + foreach ($constraints as $constraint) { + $this->addConstraint(clone $constraint); + } + } + + /** + * Adds a constraint. + * + * If the constraint {@link Valid} is added, the cascading strategy will be + * changed to {@link CascadingStrategy::CASCADE}. Depending on the + * $traverse property of that constraint, the traversal strategy + * will be set to one of the following: + * + * - {@link TraversalStrategy::IMPLICIT} if $traverse is enabled + * - {@link TraversalStrategy::NONE} if $traverse is disabled + * + * @return $this + * + * @throws ConstraintDefinitionException When trying to add the {@link Cascade} + * or {@link Traverse} constraint + */ + public function addConstraint(Constraint $constraint) + { + if ($constraint instanceof Traverse || $constraint instanceof Cascade) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" can only be put on classes. Please use "Symfony\Component\Validator\Constraints\Valid" instead.', get_debug_type($constraint))); + } + + if ($constraint instanceof Valid && null === $constraint->groups) { + $this->cascadingStrategy = CascadingStrategy::CASCADE; + + if ($constraint->traverse) { + $this->traversalStrategy = TraversalStrategy::IMPLICIT; + } else { + $this->traversalStrategy = TraversalStrategy::NONE; + } + + return $this; + } + + if ($constraint instanceof DisableAutoMapping || $constraint instanceof EnableAutoMapping) { + $this->autoMappingStrategy = $constraint instanceof EnableAutoMapping ? AutoMappingStrategy::ENABLED : AutoMappingStrategy::DISABLED; + + // The constraint is not added + return $this; + } + + $this->constraints[] = $constraint; + + foreach ($constraint->groups as $group) { + $this->constraintsByGroup[$group][] = $constraint; + } + + return $this; + } + + /** + * Adds an list of constraints. + * + * @param Constraint[] $constraints The constraints to add + * + * @return $this + */ + public function addConstraints(array $constraints) + { + foreach ($constraints as $constraint) { + $this->addConstraint($constraint); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getConstraints() + { + return $this->constraints; + } + + /** + * Returns whether this element has any constraints. + * + * @return bool + */ + public function hasConstraints() + { + return \count($this->constraints) > 0; + } + + /** + * {@inheritdoc} + * + * Aware of the global group (* group). + */ + public function findConstraints(string $group) + { + return $this->constraintsByGroup[$group] ?? []; + } + + /** + * {@inheritdoc} + */ + public function getCascadingStrategy() + { + return $this->cascadingStrategy; + } + + /** + * {@inheritdoc} + */ + public function getTraversalStrategy() + { + return $this->traversalStrategy; + } + + /** + * @see AutoMappingStrategy + */ + public function getAutoMappingStrategy(): int + { + return $this->autoMappingStrategy; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php new file mode 100644 index 00000000000..0be3329342b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +use Symfony\Component\Validator\Exception\ValidatorException; + +/** + * Stores all metadata needed for validating a class property via its getter + * method. + * + * A property getter is any method that is equal to the property's name, + * prefixed with "get", "is" or "has". That method will be used to access the + * property's value. + * + * The getter will be invoked by reflection, so the access of private and + * protected getters is supported. + * + * This class supports serialization and cloning. + * + * @author Bernhard Schussek + * + * @see PropertyMetadataInterface + */ +class GetterMetadata extends MemberMetadata +{ + /** + * @param string $class The class the getter is defined on + * @param string $property The property which the getter returns + * @param string|null $method The method that is called to retrieve the value being validated (null for auto-detection) + * + * @throws ValidatorException + */ + public function __construct(string $class, string $property, string $method = null) + { + if (null === $method) { + $getMethod = 'get'.ucfirst($property); + $isMethod = 'is'.ucfirst($property); + $hasMethod = 'has'.ucfirst($property); + + if (method_exists($class, $getMethod)) { + $method = $getMethod; + } elseif (method_exists($class, $isMethod)) { + $method = $isMethod; + } elseif (method_exists($class, $hasMethod)) { + $method = $hasMethod; + } else { + throw new ValidatorException(sprintf('Neither of these methods exist in class "%s": "%s", "%s", "%s".', $class, $getMethod, $isMethod, $hasMethod)); + } + } elseif (!method_exists($class, $method)) { + throw new ValidatorException(sprintf('The "%s()" method does not exist in class "%s".', $method, $class)); + } + + parent::__construct($class, $method, $property); + } + + /** + * {@inheritdoc} + */ + public function getPropertyValue($object) + { + return $this->newReflectionMember($object)->invoke($object); + } + + /** + * {@inheritdoc} + */ + protected function newReflectionMember($objectOrClassName) + { + return new \ReflectionMethod($objectOrClassName, $this->getName()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php new file mode 100644 index 00000000000..9f6667f836f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\MappingException; + +/** + * Base loader for validation metadata. + * + * This loader supports the loading of constraints from Symfony's default + * namespace (see {@link DEFAULT_NAMESPACE}) using the short class names of + * those constraints. Constraints can also be loaded using their fully + * qualified class names. At last, namespace aliases can be defined to load + * constraints with the syntax "alias:ShortName". + * + * @author Bernhard Schussek + */ +abstract class AbstractLoader implements LoaderInterface +{ + /** + * The namespace to load constraints from by default. + */ + public const DEFAULT_NAMESPACE = '\\Symfony\\Component\\Validator\\Constraints\\'; + + protected $namespaces = []; + + /** + * Adds a namespace alias. + * + * The namespace alias can be used to reference constraints from specific + * namespaces in {@link newConstraint()}: + * + * $this->addNamespaceAlias('mynamespace', '\\Acme\\Package\\Constraints\\'); + * + * $constraint = $this->newConstraint('mynamespace:NotNull'); + */ + protected function addNamespaceAlias(string $alias, string $namespace) + { + $this->namespaces[$alias] = $namespace; + } + + /** + * Creates a new constraint instance for the given constraint name. + * + * @param string $name The constraint name. Either a constraint relative + * to the default constraint namespace, or a fully + * qualified class name. Alternatively, the constraint + * may be preceded by a namespace alias and a colon. + * The namespace alias must have been defined using + * {@link addNamespaceAlias()}. + * @param mixed $options The constraint options + * + * @return Constraint + * + * @throws MappingException If the namespace prefix is undefined + */ + protected function newConstraint(string $name, $options = null) + { + if (str_contains($name, '\\') && class_exists($name)) { + $className = $name; + } elseif (str_contains($name, ':')) { + [$prefix, $className] = explode(':', $name, 2); + + if (!isset($this->namespaces[$prefix])) { + throw new MappingException(sprintf('Undefined namespace prefix "%s".', $prefix)); + } + + $className = $this->namespaces[$prefix].$className; + } else { + $className = self::DEFAULT_NAMESPACE.$name; + } + + return new $className($options); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php new file mode 100644 index 00000000000..6968927e3d6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php @@ -0,0 +1,123 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Doctrine\Common\Annotations\Reader; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\Constraints\GroupSequenceProvider; +use Symfony\Component\Validator\Exception\MappingException; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Loads validation metadata using a Doctrine annotation {@link Reader} or using PHP 8 attributes. + * + * @author Bernhard Schussek + * @author Alexander M. Turek + */ +class AnnotationLoader implements LoaderInterface +{ + protected $reader; + + public function __construct(Reader $reader = null) + { + $this->reader = $reader; + } + + /** + * {@inheritdoc} + */ + public function loadClassMetadata(ClassMetadata $metadata) + { + $reflClass = $metadata->getReflectionClass(); + $className = $reflClass->name; + $success = false; + + foreach ($this->getAnnotations($reflClass) as $constraint) { + if ($constraint instanceof GroupSequence) { + $metadata->setGroupSequence($constraint->groups); + } elseif ($constraint instanceof GroupSequenceProvider) { + $metadata->setGroupSequenceProvider(true); + } elseif ($constraint instanceof Constraint) { + $metadata->addConstraint($constraint); + } + + $success = true; + } + + foreach ($reflClass->getProperties() as $property) { + if ($property->getDeclaringClass()->name === $className) { + foreach ($this->getAnnotations($property) as $constraint) { + if ($constraint instanceof Constraint) { + $metadata->addPropertyConstraint($property->name, $constraint); + } + + $success = true; + } + } + } + + foreach ($reflClass->getMethods() as $method) { + if ($method->getDeclaringClass()->name === $className) { + foreach ($this->getAnnotations($method) as $constraint) { + if ($constraint instanceof Callback) { + $constraint->callback = $method->getName(); + + $metadata->addConstraint($constraint); + } elseif ($constraint instanceof Constraint) { + if (preg_match('/^(get|is|has)(.+)$/i', $method->name, $matches)) { + $metadata->addGetterMethodConstraint(lcfirst($matches[2]), $matches[0], $constraint); + } else { + throw new MappingException(sprintf('The constraint on "%s::%s()" cannot be added. Constraints can only be added on methods beginning with "get", "is" or "has".', $className, $method->name)); + } + } + + $success = true; + } + } + } + + return $success; + } + + /** + * @param \ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflection + */ + private function getAnnotations(object $reflection): iterable + { + if (\PHP_VERSION_ID >= 80000) { + foreach ($reflection->getAttributes(GroupSequence::class) as $attribute) { + yield $attribute->newInstance(); + } + foreach ($reflection->getAttributes(GroupSequenceProvider::class) as $attribute) { + yield $attribute->newInstance(); + } + foreach ($reflection->getAttributes(Constraint::class, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) { + yield $attribute->newInstance(); + } + } + if (!$this->reader) { + return; + } + + if ($reflection instanceof \ReflectionClass) { + yield from $this->reader->getClassAnnotations($reflection); + } + if ($reflection instanceof \ReflectionMethod) { + yield from $this->reader->getMethodAnnotations($reflection); + } + if ($reflection instanceof \ReflectionProperty) { + yield from $this->reader->getPropertyAnnotations($reflection); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php new file mode 100644 index 00000000000..f76442f06c0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Validator\Mapping\AutoMappingStrategy; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Utility methods to create auto mapping loaders. + * + * @author Kévin Dunglas + */ +trait AutoMappingTrait +{ + private function isAutoMappingEnabledForClass(ClassMetadata $metadata, string $classValidatorRegexp = null): bool + { + // Check if AutoMapping constraint is set first + if (AutoMappingStrategy::NONE !== $strategy = $metadata->getAutoMappingStrategy()) { + return AutoMappingStrategy::ENABLED === $strategy; + } + + // Fallback on the config + return null !== $classValidatorRegexp && preg_match($classValidatorRegexp, $metadata->getClassName()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php new file mode 100644 index 00000000000..0fc01729884 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Validator\Exception\MappingException; + +/** + * Base loader for loading validation metadata from a file. + * + * @author Bernhard Schussek + * + * @see YamlFileLoader + * @see XmlFileLoader + */ +abstract class FileLoader extends AbstractLoader +{ + protected $file; + + /** + * Creates a new loader. + * + * @param string $file The mapping file to load + * + * @throws MappingException If the file does not exist or is not readable + */ + public function __construct(string $file) + { + if (!is_file($file)) { + throw new MappingException(sprintf('The mapping file "%s" does not exist.', $file)); + } + + if (!is_readable($file)) { + throw new MappingException(sprintf('The mapping file "%s" is not readable.', $file)); + } + + if (!stream_is_local($this->file)) { + throw new MappingException(sprintf('The mapping file "%s" is not a local file.', $file)); + } + + $this->file = $file; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php new file mode 100644 index 00000000000..f6574f4664b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +/** + * Base loader for loading validation metadata from a list of files. + * + * @author Bulat Shakirzyanov + * @author Bernhard Schussek + * + * @see YamlFilesLoader + * @see XmlFilesLoader + */ +abstract class FilesLoader extends LoaderChain +{ + /** + * Creates a new loader. + * + * @param array $paths An array of file paths + */ + public function __construct(array $paths) + { + parent::__construct($this->getFileLoaders($paths)); + } + + /** + * Returns an array of file loaders for the given file paths. + * + * @return LoaderInterface[] + */ + protected function getFileLoaders(array $paths) + { + $loaders = []; + + foreach ($paths as $path) { + $loaders[] = $this->getFileLoaderInstance($path); + } + + return $loaders; + } + + /** + * Creates a loader for the given file path. + * + * @return LoaderInterface + */ + abstract protected function getFileLoaderInstance(string $path); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php new file mode 100644 index 00000000000..b3d61846527 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Validator\Exception\MappingException; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Loads validation metadata from multiple {@link LoaderInterface} instances. + * + * Pass the loaders when constructing the chain. Once + * {@link loadClassMetadata()} is called, that method will be called on all + * loaders in the chain. + * + * @author Bernhard Schussek + */ +class LoaderChain implements LoaderInterface +{ + protected $loaders; + + /** + * @param LoaderInterface[] $loaders The metadata loaders to use + * + * @throws MappingException If any of the loaders has an invalid type + */ + public function __construct(array $loaders) + { + foreach ($loaders as $loader) { + if (!$loader instanceof LoaderInterface) { + throw new MappingException(sprintf('Class "%s" is expected to implement LoaderInterface.', get_debug_type($loader))); + } + } + + $this->loaders = $loaders; + } + + /** + * {@inheritdoc} + */ + public function loadClassMetadata(ClassMetadata $metadata) + { + $success = false; + + foreach ($this->loaders as $loader) { + $success = $loader->loadClassMetadata($metadata) || $success; + } + + return $success; + } + + /** + * @return LoaderInterface[] + */ + public function getLoaders() + { + return $this->loaders; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php new file mode 100644 index 00000000000..974214c4fc3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Loads validation metadata into {@link ClassMetadata} instances. + * + * @author Bernhard Schussek + */ +interface LoaderInterface +{ + /** + * Loads validation metadata into a {@link ClassMetadata} instance. + * + * @return bool + */ + public function loadClassMetadata(ClassMetadata $metadata); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php new file mode 100644 index 00000000000..118c1594452 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php @@ -0,0 +1,179 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface; +use Symfony\Component\PropertyInfo\PropertyListExtractorInterface; +use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; +use Symfony\Component\PropertyInfo\Type as PropertyInfoType; +use Symfony\Component\Validator\Constraints\All; +use Symfony\Component\Validator\Constraints\NotBlank; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Type; +use Symfony\Component\Validator\Mapping\AutoMappingStrategy; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Guesses and loads the appropriate constraints using PropertyInfo. + * + * @author Kévin Dunglas + */ +final class PropertyInfoLoader implements LoaderInterface +{ + use AutoMappingTrait; + + private $listExtractor; + private $typeExtractor; + private $accessExtractor; + private $classValidatorRegexp; + + public function __construct(PropertyListExtractorInterface $listExtractor, PropertyTypeExtractorInterface $typeExtractor, PropertyAccessExtractorInterface $accessExtractor, string $classValidatorRegexp = null) + { + $this->listExtractor = $listExtractor; + $this->typeExtractor = $typeExtractor; + $this->accessExtractor = $accessExtractor; + $this->classValidatorRegexp = $classValidatorRegexp; + } + + /** + * {@inheritdoc} + */ + public function loadClassMetadata(ClassMetadata $metadata): bool + { + $className = $metadata->getClassName(); + if (!$properties = $this->listExtractor->getProperties($className)) { + return false; + } + + $loaded = false; + $enabledForClass = $this->isAutoMappingEnabledForClass($metadata, $this->classValidatorRegexp); + foreach ($properties as $property) { + if (false === $this->accessExtractor->isWritable($className, $property)) { + continue; + } + + if (!property_exists($className, $property)) { + continue; + } + + $types = $this->typeExtractor->getTypes($className, $property); + if (null === $types) { + continue; + } + + $enabledForProperty = $enabledForClass; + $hasTypeConstraint = false; + $hasNotNullConstraint = false; + $hasNotBlankConstraint = false; + $allConstraint = null; + foreach ($metadata->getPropertyMetadata($property) as $propertyMetadata) { + // Enabling or disabling auto-mapping explicitly always takes precedence + if (AutoMappingStrategy::DISABLED === $propertyMetadata->getAutoMappingStrategy()) { + continue 2; + } + + if (AutoMappingStrategy::ENABLED === $propertyMetadata->getAutoMappingStrategy()) { + $enabledForProperty = true; + } + + foreach ($propertyMetadata->getConstraints() as $constraint) { + if ($constraint instanceof Type) { + $hasTypeConstraint = true; + } elseif ($constraint instanceof NotNull) { + $hasNotNullConstraint = true; + } elseif ($constraint instanceof NotBlank) { + $hasNotBlankConstraint = true; + } elseif ($constraint instanceof All) { + $allConstraint = $constraint; + } + } + } + + if (!$enabledForProperty) { + continue; + } + + $loaded = true; + $builtinTypes = []; + $nullable = false; + $scalar = true; + foreach ($types as $type) { + $builtinTypes[] = $type->getBuiltinType(); + + if ($scalar && !\in_array($type->getBuiltinType(), [PropertyInfoType::BUILTIN_TYPE_INT, PropertyInfoType::BUILTIN_TYPE_FLOAT, PropertyInfoType::BUILTIN_TYPE_STRING, PropertyInfoType::BUILTIN_TYPE_BOOL], true)) { + $scalar = false; + } + + if (!$nullable && $type->isNullable()) { + $nullable = true; + } + } + if (!$hasTypeConstraint) { + if (1 === \count($builtinTypes)) { + if ($types[0]->isCollection() && \count($collectionValueType = $types[0]->getCollectionValueTypes()) > 0) { + [$collectionValueType] = $collectionValueType; + $this->handleAllConstraint($property, $allConstraint, $collectionValueType, $metadata); + } + + $metadata->addPropertyConstraint($property, $this->getTypeConstraint($builtinTypes[0], $types[0])); + } elseif ($scalar) { + $metadata->addPropertyConstraint($property, new Type(['type' => 'scalar'])); + } + } + + if (!$nullable && !$hasNotBlankConstraint && !$hasNotNullConstraint) { + $metadata->addPropertyConstraint($property, new NotNull()); + } + } + + return $loaded; + } + + private function getTypeConstraint(string $builtinType, PropertyInfoType $type): Type + { + if (PropertyInfoType::BUILTIN_TYPE_OBJECT === $builtinType && null !== $className = $type->getClassName()) { + return new Type(['type' => $className]); + } + + return new Type(['type' => $builtinType]); + } + + private function handleAllConstraint(string $property, ?All $allConstraint, PropertyInfoType $propertyInfoType, ClassMetadata $metadata) + { + $containsTypeConstraint = false; + $containsNotNullConstraint = false; + if (null !== $allConstraint) { + foreach ($allConstraint->constraints as $constraint) { + if ($constraint instanceof Type) { + $containsTypeConstraint = true; + } elseif ($constraint instanceof NotNull) { + $containsNotNullConstraint = true; + } + } + } + + $constraints = []; + if (!$containsNotNullConstraint && !$propertyInfoType->isNullable()) { + $constraints[] = new NotNull(); + } + + if (!$containsTypeConstraint) { + $constraints[] = $this->getTypeConstraint($propertyInfoType->getBuiltinType(), $propertyInfoType); + } + + if (null === $allConstraint) { + $metadata->addPropertyConstraint($property, new All(['constraints' => $constraints])); + } else { + $allConstraint->constraints = array_merge($allConstraint->constraints, $constraints); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php new file mode 100644 index 00000000000..256700e1ef6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Validator\Exception\MappingException; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Loads validation metadata by calling a static method on the loaded class. + * + * @author Bernhard Schussek + */ +class StaticMethodLoader implements LoaderInterface +{ + protected $methodName; + + /** + * Creates a new loader. + * + * @param string $methodName The name of the static method to call + */ + public function __construct(string $methodName = 'loadValidatorMetadata') + { + $this->methodName = $methodName; + } + + /** + * {@inheritdoc} + */ + public function loadClassMetadata(ClassMetadata $metadata) + { + /** @var \ReflectionClass $reflClass */ + $reflClass = $metadata->getReflectionClass(); + + if (!$reflClass->isInterface() && $reflClass->hasMethod($this->methodName)) { + $reflMethod = $reflClass->getMethod($this->methodName); + + if ($reflMethod->isAbstract()) { + return false; + } + + if (!$reflMethod->isStatic()) { + throw new MappingException(sprintf('The method "%s::%s()" should be static.', $reflClass->name, $this->methodName)); + } + + if ($reflMethod->getDeclaringClass()->name != $reflClass->name) { + return false; + } + + $reflMethod->invoke(null, $metadata); + + return true; + } + + return false; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php new file mode 100644 index 00000000000..66cfe8ff6f4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php @@ -0,0 +1,231 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Config\Util\XmlUtils; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\MappingException; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Loads validation metadata from an XML file. + * + * @author Bernhard Schussek + */ +class XmlFileLoader extends FileLoader +{ + /** + * The XML nodes of the mapping file. + * + * @var \SimpleXMLElement[]|null + */ + protected $classes; + + /** + * {@inheritdoc} + */ + public function loadClassMetadata(ClassMetadata $metadata) + { + if (null === $this->classes) { + $this->loadClassesFromXml(); + } + + if (isset($this->classes[$metadata->getClassName()])) { + $classDescription = $this->classes[$metadata->getClassName()]; + + $this->loadClassMetadataFromXml($metadata, $classDescription); + + return true; + } + + return false; + } + + /** + * Return the names of the classes mapped in this file. + * + * @return string[] + */ + public function getMappedClasses() + { + if (null === $this->classes) { + $this->loadClassesFromXml(); + } + + return array_keys($this->classes); + } + + /** + * Parses a collection of "constraint" XML nodes. + * + * @param \SimpleXMLElement $nodes The XML nodes + * + * @return Constraint[] + */ + protected function parseConstraints(\SimpleXMLElement $nodes) + { + $constraints = []; + + foreach ($nodes as $node) { + if (\count($node) > 0) { + if (\count($node->value) > 0) { + $options = $this->parseValues($node->value); + } elseif (\count($node->constraint) > 0) { + $options = $this->parseConstraints($node->constraint); + } elseif (\count($node->option) > 0) { + $options = $this->parseOptions($node->option); + } else { + $options = []; + } + } elseif ('' !== (string) $node) { + $options = XmlUtils::phpize(trim($node)); + } else { + $options = null; + } + + $constraints[] = $this->newConstraint((string) $node['name'], $options); + } + + return $constraints; + } + + /** + * Parses a collection of "value" XML nodes. + * + * @param \SimpleXMLElement $nodes The XML nodes + * + * @return array + */ + protected function parseValues(\SimpleXMLElement $nodes) + { + $values = []; + + foreach ($nodes as $node) { + if (\count($node) > 0) { + if (\count($node->value) > 0) { + $value = $this->parseValues($node->value); + } elseif (\count($node->constraint) > 0) { + $value = $this->parseConstraints($node->constraint); + } else { + $value = []; + } + } else { + $value = trim($node); + } + + if (isset($node['key'])) { + $values[(string) $node['key']] = $value; + } else { + $values[] = $value; + } + } + + return $values; + } + + /** + * Parses a collection of "option" XML nodes. + * + * @param \SimpleXMLElement $nodes The XML nodes + * + * @return array + */ + protected function parseOptions(\SimpleXMLElement $nodes) + { + $options = []; + + foreach ($nodes as $node) { + if (\count($node) > 0) { + if (\count($node->value) > 0) { + $value = $this->parseValues($node->value); + } elseif (\count($node->constraint) > 0) { + $value = $this->parseConstraints($node->constraint); + } else { + $value = []; + } + } else { + $value = XmlUtils::phpize($node); + if (\is_string($value)) { + $value = trim($value); + } + } + + $options[(string) $node['name']] = $value; + } + + return $options; + } + + /** + * Loads the XML class descriptions from the given file. + * + * @return \SimpleXMLElement + * + * @throws MappingException If the file could not be loaded + */ + protected function parseFile(string $path) + { + try { + $dom = XmlUtils::loadFile($path, __DIR__.'/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd'); + } catch (\Exception $e) { + throw new MappingException($e->getMessage(), $e->getCode(), $e); + } + + return simplexml_import_dom($dom); + } + + private function loadClassesFromXml() + { + // This method may throw an exception. Do not modify the class' + // state before it completes + $xml = $this->parseFile($this->file); + + $this->classes = []; + + foreach ($xml->namespace as $namespace) { + $this->addNamespaceAlias((string) $namespace['prefix'], trim((string) $namespace)); + } + + foreach ($xml->class as $class) { + $this->classes[(string) $class['name']] = $class; + } + } + + private function loadClassMetadataFromXml(ClassMetadata $metadata, \SimpleXMLElement $classDescription) + { + if (\count($classDescription->{'group-sequence-provider'}) > 0) { + $metadata->setGroupSequenceProvider(true); + } + + foreach ($classDescription->{'group-sequence'} as $groupSequence) { + if (\count($groupSequence->value) > 0) { + $metadata->setGroupSequence($this->parseValues($groupSequence[0]->value)); + } + } + + foreach ($this->parseConstraints($classDescription->constraint) as $constraint) { + $metadata->addConstraint($constraint); + } + + foreach ($classDescription->property as $property) { + foreach ($this->parseConstraints($property->constraint) as $constraint) { + $metadata->addPropertyConstraint((string) $property['name'], $constraint); + } + } + + foreach ($classDescription->getter as $getter) { + foreach ($this->parseConstraints($getter->constraint) as $constraint) { + $metadata->addGetterConstraint((string) $getter['property'], $constraint); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php new file mode 100644 index 00000000000..5a242b02567 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +/** + * Loads validation metadata from a list of XML files. + * + * @author Bulat Shakirzyanov + * @author Bernhard Schussek + * + * @see FilesLoader + */ +class XmlFilesLoader extends FilesLoader +{ + /** + * {@inheritdoc} + */ + public function getFileLoaderInstance(string $file) + { + return new XmlFileLoader($file); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php new file mode 100644 index 00000000000..8d44ad60eaa --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php @@ -0,0 +1,189 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Yaml\Exception\ParseException; +use Symfony\Component\Yaml\Parser as YamlParser; +use Symfony\Component\Yaml\Yaml; + +/** + * Loads validation metadata from a YAML file. + * + * @author Bernhard Schussek + */ +class YamlFileLoader extends FileLoader +{ + /** + * An array of YAML class descriptions. + * + * @var array + */ + protected $classes = null; + + /** + * Caches the used YAML parser. + * + * @var YamlParser + */ + private $yamlParser; + + /** + * {@inheritdoc} + */ + public function loadClassMetadata(ClassMetadata $metadata) + { + if (null === $this->classes) { + $this->loadClassesFromYaml(); + } + + if (isset($this->classes[$metadata->getClassName()])) { + $classDescription = $this->classes[$metadata->getClassName()]; + + $this->loadClassMetadataFromYaml($metadata, $classDescription); + + return true; + } + + return false; + } + + /** + * Return the names of the classes mapped in this file. + * + * @return string[] + */ + public function getMappedClasses() + { + if (null === $this->classes) { + $this->loadClassesFromYaml(); + } + + return array_keys($this->classes); + } + + /** + * Parses a collection of YAML nodes. + * + * @param array $nodes The YAML nodes + * + * @return array + */ + protected function parseNodes(array $nodes) + { + $values = []; + + foreach ($nodes as $name => $childNodes) { + if (is_numeric($name) && \is_array($childNodes) && 1 === \count($childNodes)) { + $options = current($childNodes); + + if (\is_array($options)) { + $options = $this->parseNodes($options); + } + + $values[] = $this->newConstraint(key($childNodes), $options); + } else { + if (\is_array($childNodes)) { + $childNodes = $this->parseNodes($childNodes); + } + + $values[$name] = $childNodes; + } + } + + return $values; + } + + /** + * Loads the YAML class descriptions from the given file. + * + * @throws \InvalidArgumentException If the file could not be loaded or did + * not contain a YAML array + */ + private function parseFile(string $path): array + { + try { + $classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT); + } catch (ParseException $e) { + throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: ', $path).$e->getMessage(), 0, $e); + } + + // empty file + if (null === $classes) { + return []; + } + + // not an array + if (!\is_array($classes)) { + throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $this->file)); + } + + return $classes; + } + + private function loadClassesFromYaml() + { + if (null === $this->yamlParser) { + $this->yamlParser = new YamlParser(); + } + + $this->classes = $this->parseFile($this->file); + + if (isset($this->classes['namespaces'])) { + foreach ($this->classes['namespaces'] as $alias => $namespace) { + $this->addNamespaceAlias($alias, $namespace); + } + + unset($this->classes['namespaces']); + } + } + + private function loadClassMetadataFromYaml(ClassMetadata $metadata, array $classDescription) + { + if (isset($classDescription['group_sequence_provider'])) { + $metadata->setGroupSequenceProvider( + (bool) $classDescription['group_sequence_provider'] + ); + } + + if (isset($classDescription['group_sequence'])) { + $metadata->setGroupSequence($classDescription['group_sequence']); + } + + if (isset($classDescription['constraints']) && \is_array($classDescription['constraints'])) { + foreach ($this->parseNodes($classDescription['constraints']) as $constraint) { + $metadata->addConstraint($constraint); + } + } + + if (isset($classDescription['properties']) && \is_array($classDescription['properties'])) { + foreach ($classDescription['properties'] as $property => $constraints) { + if (null !== $constraints) { + foreach ($this->parseNodes($constraints) as $constraint) { + $metadata->addPropertyConstraint($property, $constraint); + } + } + } + } + + if (isset($classDescription['getters']) && \is_array($classDescription['getters'])) { + foreach ($classDescription['getters'] as $getter => $constraints) { + if (null !== $constraints) { + foreach ($this->parseNodes($constraints) as $constraint) { + $metadata->addGetterConstraint($getter, $constraint); + } + } + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php new file mode 100644 index 00000000000..f32c67c74d9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Loader; + +/** + * Loads validation metadata from a list of YAML files. + * + * @author Bulat Shakirzyanov + * @author Bernhard Schussek + * + * @see FilesLoader + */ +class YamlFilesLoader extends FilesLoader +{ + /** + * {@inheritdoc} + */ + public function getFileLoaderInstance(string $file) + { + return new YamlFileLoader($file); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd new file mode 100644 index 00000000000..1ca840b05db --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php new file mode 100644 index 00000000000..33934c62836 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php @@ -0,0 +1,194 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Composite; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +/** + * Stores all metadata needed for validating a class property. + * + * The method of accessing the property's value must be specified by subclasses + * by implementing the {@link newReflectionMember()} method. + * + * This class supports serialization and cloning. + * + * @author Bernhard Schussek + * + * @see PropertyMetadataInterface + */ +abstract class MemberMetadata extends GenericMetadata implements PropertyMetadataInterface +{ + /** + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getClassName()} instead. + */ + public $class; + + /** + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getName()} instead. + */ + public $name; + + /** + * @internal This property is public in order to reduce the size of the + * class' serialized representation. Do not access it. Use + * {@link getPropertyName()} instead. + */ + public $property; + + /** + * @var \ReflectionMethod[]|\ReflectionProperty[] + */ + private $reflMember = []; + + /** + * @param string $class The name of the class this member is defined on + * @param string $name The name of the member + * @param string $property The property the member belongs to + */ + public function __construct(string $class, string $name, string $property) + { + $this->class = $class; + $this->name = $name; + $this->property = $property; + } + + /** + * {@inheritdoc} + */ + public function addConstraint(Constraint $constraint) + { + $this->checkConstraint($constraint); + + parent::addConstraint($constraint); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function __sleep() + { + return array_merge(parent::__sleep(), [ + 'class', + 'name', + 'property', + ]); + } + + /** + * Returns the name of the member. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * {@inheritdoc} + */ + public function getClassName() + { + return $this->class; + } + + /** + * {@inheritdoc} + */ + public function getPropertyName() + { + return $this->property; + } + + /** + * Returns whether this member is public. + * + * @param object|string $objectOrClassName The object or the class name + * + * @return bool + */ + public function isPublic($objectOrClassName) + { + return $this->getReflectionMember($objectOrClassName)->isPublic(); + } + + /** + * Returns whether this member is protected. + * + * @param object|string $objectOrClassName The object or the class name + * + * @return bool + */ + public function isProtected($objectOrClassName) + { + return $this->getReflectionMember($objectOrClassName)->isProtected(); + } + + /** + * Returns whether this member is private. + * + * @param object|string $objectOrClassName The object or the class name + * + * @return bool + */ + public function isPrivate($objectOrClassName) + { + return $this->getReflectionMember($objectOrClassName)->isPrivate(); + } + + /** + * Returns the reflection instance for accessing the member's value. + * + * @param object|string $objectOrClassName The object or the class name + * + * @return \ReflectionMethod|\ReflectionProperty + */ + public function getReflectionMember($objectOrClassName) + { + $className = \is_string($objectOrClassName) ? $objectOrClassName : \get_class($objectOrClassName); + if (!isset($this->reflMember[$className])) { + $this->reflMember[$className] = $this->newReflectionMember($objectOrClassName); + } + + return $this->reflMember[$className]; + } + + /** + * Creates a new reflection instance for accessing the member's value. + * + * @param object|string $objectOrClassName The object or the class name + * + * @return \ReflectionMethod|\ReflectionProperty + */ + abstract protected function newReflectionMember($objectOrClassName); + + private function checkConstraint(Constraint $constraint) + { + if (!\in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets(), true)) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on properties or getters.', get_debug_type($constraint))); + } + + if ($constraint instanceof Composite) { + foreach ($constraint->getNestedConstraints() as $nestedConstraint) { + $this->checkConstraint($nestedConstraint); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php new file mode 100644 index 00000000000..efb32ce7267 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +use Symfony\Component\Validator\Constraint; + +/** + * A container for validation metadata. + * + * Most importantly, the metadata stores the constraints against which an object + * and its properties should be validated. + * + * Additionally, the metadata stores whether objects should be validated + * against their class' metadata and whether traversable objects should be + * traversed or not. + * + * @author Bernhard Schussek + * + * @see CascadingStrategy + * @see TraversalStrategy + */ +interface MetadataInterface +{ + /** + * Returns the strategy for cascading objects. + * + * @return int + * + * @see CascadingStrategy + */ + public function getCascadingStrategy(); + + /** + * Returns the strategy for traversing traversable objects. + * + * @return int + * + * @see TraversalStrategy + */ + public function getTraversalStrategy(); + + /** + * Returns all constraints of this element. + * + * @return Constraint[] + */ + public function getConstraints(); + + /** + * Returns all constraints for a given validation group. + * + * @param string $group The validation group + * + * @return Constraint[] + */ + public function findConstraints(string $group); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php new file mode 100644 index 00000000000..8c18e5dcd9c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +use Symfony\Component\Validator\Exception\ValidatorException; + +/** + * Stores all metadata needed for validating a class property. + * + * The value of the property is obtained by directly accessing the property. + * The property will be accessed by reflection, so the access of private and + * protected properties is supported. + * + * This class supports serialization and cloning. + * + * @author Bernhard Schussek + * + * @see PropertyMetadataInterface + */ +class PropertyMetadata extends MemberMetadata +{ + /** + * @param string $class The class this property is defined on + * @param string $name The name of this property + * + * @throws ValidatorException + */ + public function __construct(string $class, string $name) + { + if (!property_exists($class, $name)) { + throw new ValidatorException(sprintf('Property "%s" does not exist in class "%s".', $name, $class)); + } + + parent::__construct($class, $name, $name); + } + + /** + * {@inheritdoc} + */ + public function getPropertyValue($object) + { + $reflProperty = $this->getReflectionMember($object); + + if (\PHP_VERSION_ID >= 70400 && $reflProperty->hasType() && !$reflProperty->isInitialized($object)) { + // There is no way to check if a property has been unset or if it is uninitialized. + // When trying to access an uninitialized property, __get method is triggered. + + // If __get method is not present, no fallback is possible + // Otherwise we need to catch an Error in case we are trying to access an uninitialized but set property. + if (!method_exists($object, '__get')) { + return null; + } + + try { + return $reflProperty->getValue($object); + } catch (\Error $e) { + return null; + } + } + + return $reflProperty->getValue($object); + } + + /** + * {@inheritdoc} + */ + protected function newReflectionMember($objectOrClassName) + { + $originalClass = \is_string($objectOrClassName) ? $objectOrClassName : \get_class($objectOrClassName); + + while (!property_exists($objectOrClassName, $this->getName())) { + $objectOrClassName = get_parent_class($objectOrClassName); + + if (false === $objectOrClassName) { + throw new ValidatorException(sprintf('Property "%s" does not exist in class "%s".', $this->getName(), $originalClass)); + } + } + + $member = new \ReflectionProperty($objectOrClassName, $this->getName()); + $member->setAccessible(true); + + return $member; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php new file mode 100644 index 00000000000..f4bbbb907df --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +/** + * Stores all metadata needed for validating the value of a class property. + * + * Most importantly, the metadata stores the constraints against which the + * property's value should be validated. + * + * Additionally, the metadata stores whether objects stored in the property + * should be validated against their class' metadata and whether traversable + * objects should be traversed or not. + * + * @author Bernhard Schussek + * + * @see MetadataInterface + * @see CascadingStrategy + * @see TraversalStrategy + */ +interface PropertyMetadataInterface extends MetadataInterface +{ + /** + * Returns the name of the property. + * + * @return string + */ + public function getPropertyName(); + + /** + * Extracts the value of the property from the given container. + * + * @param mixed $containingValue The container to extract the property value from + * + * @return mixed + */ + public function getPropertyValue($containingValue); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php b/upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php new file mode 100644 index 00000000000..0df5a7ee8a9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +/** + * Specifies whether and how a traversable object should be traversed. + * + * If the node traverser traverses a node whose value is an instance of + * {@link \Traversable}, and if that node is either a class node or if + * cascading is enabled, then the node's traversal strategy will be checked. + * Depending on the requested traversal strategy, the node traverser will + * iterate over the object and cascade each object or collection returned by + * the iterator. + * + * The traversal strategy is ignored for arrays. Arrays are always iterated. + * + * @author Bernhard Schussek + * + * @see CascadingStrategy + */ +class TraversalStrategy +{ + /** + * Specifies that a node's value should be iterated only if it is an + * instance of {@link \Traversable}. + */ + public const IMPLICIT = 1; + + /** + * Specifies that a node's value should never be iterated. + */ + public const NONE = 2; + + /** + * Specifies that a node's value should always be iterated. If the value is + * not an instance of {@link \Traversable}, an exception should be thrown. + */ + public const TRAVERSE = 4; + + /** + * Not instantiable. + */ + private function __construct() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php b/upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php new file mode 100644 index 00000000000..6f3ac5e2f6b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Prepares an object for validation. + * + * Concrete implementations of this interface are used by {@link Validator\ContextualValidatorInterface} + * to initialize objects just before validating them. + * + * @author Fabien Potencier + * @author Bernhard Schussek + */ +interface ObjectInitializerInterface +{ + public function initialize(object $object); +} diff --git a/upload/system/storage/vendor/symfony/validator/README.md b/upload/system/storage/vendor/symfony/validator/README.md new file mode 100644 index 00000000000..8f3fd0efb25 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/README.md @@ -0,0 +1,16 @@ +Validator Component +=================== + +The Validator component provides tools to validate values following the +[JSR-303 Bean Validation specification][1]. + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/validator.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://jcp.org/en/jsr/detail?id=303 diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf new file mode 100644 index 00000000000..61b9eac232c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf @@ -0,0 +1,387 @@ + + + + + + This value should be false. + Hierdie waarde moet vals wees. + + + This value should be true. + Hierdie waarde moet waar wees. + + + This value should be of type {{ type }}. + Hierdie waarde moet van die soort {{type}} wees. + + + This value should be blank. + Hierdie waarde moet leeg wees. + + + The value you selected is not a valid choice. + Die waarde wat jy gekies het is nie 'n geldige keuse nie. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Jy moet ten minste {{ limit }} kies.|Jy moet ten minste {{ limit }} keuses kies. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Jy moet by die meeste {{ limit }} keuse kies.|Jy moet by die meeste {{ limit }} keuses kies. + + + One or more of the given values is invalid. + Een of meer van die gegewe waardes is ongeldig. + + + This field was not expected. + Die veld is nie verwag nie. + + + This field is missing. + Hierdie veld ontbreek. + + + This value is not a valid date. + Hierdie waarde is nie 'n geldige datum nie. + + + This value is not a valid datetime. + Hierdie waarde is nie 'n geldige datum en tyd nie. + + + This value is not a valid email address. + Hierdie waarde is nie 'n geldige e-pos adres nie. + + + The file could not be found. + Die lêer kon nie gevind word nie. + + + The file is not readable. + Die lêer kan nie gelees word nie. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Die lêer is te groot ({{ size }} {{ suffix }}). Toegelaat maksimum grootte is {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Die MIME-tipe van die lêer is ongeldig ({{ type }}). Toegelaat MIME-tipes is {{ types }}. + + + This value should be {{ limit }} or less. + Hierdie waarde moet {{ limit }} of minder wees. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Hierdie waarde is te lank. Dit moet {{ limit }} karakter of minder wees.|Hierdie waarde is te lank. Dit moet {{ limit }} karakters of minder wees. + + + This value should be {{ limit }} or more. + Hierdie waarde moet {{ limit }} of meer wees. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Hierdie waarde is te kort. Dit moet {{ limit }} karakter of meer wees.|Hierdie waarde is te kort. Dit moet {{ limit }} karakters of meer wees. + + + This value should not be blank. + Hierdie waarde moet nie leeg wees nie. + + + This value should not be null. + Hierdie waarde moet nie nul wees nie. + + + This value should be null. + Hierdie waarde moet nul wees. + + + This value is not valid. + Hierdie waarde is nie geldig nie. + + + This value is not a valid time. + Hierdie waarde is nie 'n geldige tyd nie. + + + This value is not a valid URL. + Hierdie waarde is nie 'n geldige URL nie. + + + The two values should be equal. + Die twee waardes moet gelyk wees. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Die lêer is te groot. Toegelaat maksimum grootte is {{ limit }} {{ suffix }}. + + + The file is too large. + Die lêer is te groot. + + + The file could not be uploaded. + Die lêer kan nie opgelaai word nie. + + + This value should be a valid number. + Hierdie waarde moet 'n geldige nommer wees. + + + This file is not a valid image. + Hierdie lêer is nie 'n geldige beeld nie. + + + This is not a valid IP address. + Hierdie is nie 'n geldige IP-adres nie. + + + This value is not a valid language. + Hierdie waarde is nie 'n geldige taal nie. + + + This value is not a valid locale. + Hierdie waarde is nie 'n geldige land instelling nie. + + + This value is not a valid country. + Hierdie waarde is nie 'n geldige land nie. + + + This value is already used. + Hierdie waarde word reeds gebruik. + + + The size of the image could not be detected. + Die grootte van die beeld kon nie opgespoor word nie. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Die beeld breedte is te groot ({{ width }}px). Toegelaat maksimum breedte is {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Die beeld breedte is te klein ({{ width }}px). Minimum breedte verwag is {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Die beeld hoogte is te groot ({{ height }}px). Toegelaat maksimum hoogte is {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Die beeld hoogte is te klein ({{ height }}px). Minimum hoogte verwag is {{ min_height }}px. + + + This value should be the user's current password. + Hierdie waarde moet die huidige wagwoord van die gebruiker wees. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Hierdie waarde moet presies {{ limit }} karakter wees.|Hierdie waarde moet presies {{ limit }} karakters wees. + + + The file was only partially uploaded. + Die lêer is slegs gedeeltelik opgelaai. + + + No file was uploaded. + Geen lêer is opgelaai nie. + + + No temporary folder was configured in php.ini. + Geen tydelike lêer is ingestel in php.ini nie. + + + Cannot write temporary file to disk. + Kan nie tydelike lêer skryf op skyf nie. + + + A PHP extension caused the upload to fail. + 'n PHP-uitbreiding veroorsaak die oplaai van die lêer om te misluk. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Hierdie versameling moet {{ limit }} element of meer bevat.|Hierdie versameling moet {{ limit }} elemente of meer bevat. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Hierdie versameling moet {{ limit }} element of minder bevat.|Hierdie versameling moet {{ limit }} elemente of meer bevat. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Hierdie versameling moet presies {{ limit }} element bevat.|Hierdie versameling moet presies {{ limit }} elemente bevat. + + + Invalid card number. + Ongeldige kredietkaart nommer. + + + Unsupported card type or invalid card number. + Nie-ondersteunde tipe kaart of ongeldige kredietkaart nommer. + + + This is not a valid International Bank Account Number (IBAN). + Hierdie is nie 'n geldige Internationale Bank Rekening Nommer (IBAN) nie. + + + This value is not a valid ISBN-10. + Hierdie waarde is nie 'n geldige ISBN-10 nie. + + + This value is not a valid ISBN-13. + Hierdie waarde is nie 'n geldige ISBN-13 nie. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Hierdie waarde is nie 'n geldige ISBN-10 of ISBN-13 nie. + + + This value is not a valid ISSN. + Hierdie waarde is nie 'n geldige ISSN nie. + + + This value is not a valid currency. + Hierdie waarde is nie 'n geldige geldeenheid nie. + + + This value should be equal to {{ compared_value }}. + Hierdie waarde moet gelyk aan {{ compared_value }} wees. + + + This value should be greater than {{ compared_value }}. + Hierdie waarde moet meer as {{ compared_value }} wees. + + + This value should be greater than or equal to {{ compared_value }}. + Hierdie waarde moet meer of gelyk aan {{ compared_value }} wees. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Hierdie waarde moet identies aan {{ compared_value_type }} {{ compared_value }} wees. + + + This value should be less than {{ compared_value }}. + Hierdie waarde moet minder as {{ compared_value }} wees. + + + This value should be less than or equal to {{ compared_value }}. + Hierdie waarde moet minder of gelyk aan {{ compared_value }} wees. + + + This value should not be equal to {{ compared_value }}. + Hierdie waarde moet nie dieselfde as {{ compared_value }} wees nie. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Hierdie waarde moet nie identies as {{ compared_value_type }} {{ compared_value }} wees nie. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Die beeld aspek is te groot ({{ ratio }}). Die maksimum toegelate aspek is {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Die beeld aspek is te klein ({{ ratio }}). Die minimum toegelate aspek is {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Die beeld is vierkantig ({{ width }}x{{ height }}px). Vierkantige beelde word nie toegelaat nie. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Die beeld is landskap georiënteerd ({{ width }}x{{ height }}px). Landskap georiënteerde beelde word nie toegelaat nie. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Die beeld dis portret georiënteerd ({{ width }}x{{ height }}px). Portret georiënteerde beelde word nie toegelaat nie. + + + An empty file is not allowed. + 'n Leë lêer word nie toegelaat nie. + + + The host could not be resolved. + Die gasheer kon nie opgelos word nie. + + + This value does not match the expected {{ charset }} charset. + Die waarde stem nie ooreen met die verwagte {{ charset }} karakterstel nie. + + + This is not a valid Business Identifier Code (BIC). + Hierdie is nie 'n geldige Besigheids Identifikasie Kode (BIC) nie. + + + Error + Fout + + + This is not a valid UUID. + Hierdie is nie 'n geldige UUID nie. + + + This value should be a multiple of {{ compared_value }}. + Hierdie waarde moet 'n veelvoud van {{ compared_value }} wees. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Hierdie Besigheids Identifikasie Kode (BIK) is nie geassosieer met IBAN {{ iban }} nie. + + + This value should be valid JSON. + Hierdie waarde moet geldige JSON wees. + + + This collection should contain only unique elements. + Hierdie versameling moet net unieke elemente bevat. + + + This value should be positive. + Hierdie waarde moet positief wees. + + + This value should be either positive or zero. + Hierdie waarde moet positief of nul wees. + + + This value should be negative. + Hierdie waarde moet negatief wees. + + + This value should be either negative or zero. + Hierdie waarde moet negatief of nul wees. + + + This value is not a valid timezone. + Hierdie waarde is nie 'n geldige tydsone nie. + + + This value should be between {{ min }} and {{ max }}. + Hierdie waarde moet tussen {{ min }} en {{ max }} wees. + + + This value is not a valid hostname. + Hierdie waarde is nie 'n geldige gasheernaam nie. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Die hoeveelheid elemente in hierdie versameling moet 'n meelvoud van {{ compared_value }} wees. + + + This value should satisfy at least one of the following constraints: + Hierdie waarde moet voldoen aan ten minste een van hierdie beperkings: + + + Each element of this collection should satisfy its own set of constraints. + Elke element van hierdie versameling moet voldoen aan hulle eie beperkings. + + + This value is not a valid International Securities Identification Number (ISIN). + Hierdie waarde is nie 'n geldige Internasionale veiligheidsidentifikasienommer (ISIN) nie. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf new file mode 100644 index 00000000000..6aa0d594843 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + هذه القيمة يجب أن تكون خاطئة. + + + This value should be true. + هذه القيمة يجب أن تكون حقيقية. + + + This value should be of type {{ type }}. + هذه القيمة يجب ان تكون من نوع {{ type }}. + + + This value should be blank. + هذه القيمة يجب ان تكون Ùارغة. + + + The value you selected is not a valid choice. + القيمة المختارة ليست خيارا صحيحا. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + يجب ان تختار {{ limit }} اختيار على الاقل.|يجب ان تختار {{ limit }} اختيار على الاقل.|يجب ان تختار {{ limit }} اختيارات على الاقل.|يجب ان تختار {{ limit }} اختيار على الاقل.|يجب ان تختار {{ limit }} اختيار على الاقل.|يجب ان تختار {{ limit }} اختيار على الاقل. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + يجب ان تختار {{ limit }} اختيار على الاكثر.|يجب ان تختار {{ limit }} اختيار على الاكثر.|يجب ان تختار {{ limit }} اختيارات على الاكثر.|يجب ان تختار {{ limit }} اختيار على الاكثر.|يجب ان تختار {{ limit }} اختيار على الاكثر.|يجب ان تختار {{ limit }} اختيار على الاكثر. + + + One or more of the given values is invalid. + واحد أو أكثر من القيم المعطاه خاطئ. + + + This field was not expected. + لم يكن من المتوقع هذا المجال. + + + This field is missing. + هذا المجال Ù…Ùقود. + + + This value is not a valid date. + هذه القيمة ليست تاريخا صالحا. + + + This value is not a valid datetime. + هذه القيمة ليست تاريخا Ùˆ وقتا صالحا. + + + This value is not a valid email address. + هذه القيمة ليست عنوان بريد إلكتروني صحيح. + + + The file could not be found. + لا يمكن العثور على الملÙ. + + + The file is not readable. + المل٠غير قابل للقراءة. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + المل٠كبير جدا ({{ size }} {{ suffix }}).اقصى مساحه مسموح بها ({{ limit }} {{ suffix }}). + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + نوع المل٠غير صحيح ({{ type }}). الانواع المسموح بها هى {{ types }}. + + + This value should be {{ limit }} or less. + هذه القيمة يجب ان تكون {{ limit }} او اقل. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + هذه القيمة طويلة جدا. يجب ان تكون {{ limit }} حر٠او اقل.|هذه القيمة طويلة جدا. يجب ان تكون {{ limit }} حر٠او اقل.|هذه القيمة طويلة جدا. يجب ان تكون {{ limit }} حرو٠او اقل.|هذه القيمة طويلة جدا. يجب ان تكون {{ limit }} حر٠او اقل.|هذه القيمة طويلة جدا. يجب ان تكون {{ limit }} حر٠او اقل.|هذه القيمة طويلة جدا. يجب ان تكون {{ limit }} حر٠او اقل. + + + This value should be {{ limit }} or more. + هذه القيمة يجب ان تكون {{ limit }} او اكثر. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + هذه القيمة قصيرة جدا. يجب ان تكون {{ limit }} حر٠او اكثر.|هذه القيمة قصيرة جدا. يجب ان تكون {{ limit }} حر٠او اكثر.|هذه القيمة قصيرة جدا. يجب ان تكون {{ limit }} حرو٠او اكثر.|هذه القيمة قصيرة جدا. يجب ان تكون {{ limit }} حر٠او اكثر.|هذه القيمة قصيرة جدا. يجب ان تكون {{ limit }} حر٠او اكثر.|هذه القيمة قصيرة جدا. يجب ان تكون {{ limit }} حر٠او اكثر. + + + This value should not be blank. + هذه القيمة يجب الا تكون Ùارغة. + + + This value should not be null. + هذه القيمة يجب الا تكون Ùارغة. + + + This value should be null. + هذه القيمة يجب ان تكون Ùارغة. + + + This value is not valid. + هذه القيمة غير صحيحة. + + + This value is not a valid time. + هذه القيمة ليست وقت صحيح. + + + This value is not a valid URL. + هذه القيمة ليست رابط الكترونى صحيح. + + + The two values should be equal. + القيمتان يجب ان تكونا متساويتان. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + المل٠كبير جدا. اقصى مساحه مسموح بها {{ limit }} {{ suffix }}. + + + The file is too large. + المل٠كبير جدا. + + + The file could not be uploaded. + لم استطع استقبال الملÙ. + + + This value should be a valid number. + هذه القيمة يجب ان تكون رقم. + + + This file is not a valid image. + هذا المل٠ليس صورة صحيحة. + + + This is not a valid IP address. + هذه القيمة ليست عنوان رقمى صحيح. + + + This value is not a valid language. + هذه القيمة ليست لغة صحيحة. + + + This value is not a valid locale. + هذه القيمة ليست موقع صحيح. + + + This value is not a valid country. + هذه القيمة ليست بلدا صالحا. + + + This value is already used. + هذه القيمة مستخدمة بالÙعل. + + + The size of the image could not be detected. + لم استطع معرÙØ© حجم الصورة. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + عرض الصورة كبير جدا ({{ width }}px). اقصى عرض مسموح به هو{{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + عرض الصورة صغير جدا ({{ width }}px). اقل عرض مسموح به هو{{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + طول الصورة كبير جدا ({{ height }}px). اقصى طول مسموح به هو{{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + طول الصورة صغير جدا ({{ height }}px). اقل طول مسموح به هو{{ min_height }}px. + + + This value should be the user's current password. + هذه القيمة يجب ان تكون كلمة سر المستخدم الحالية. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + هذه القيمة يجب ان تحتوى على {{ limit }} حر٠Ùقط.|هذه القيمة يجب ان تحتوى على {{ limit }} حر٠Ùقط.|هذه القيمة يجب ان تحتوى على {{ limit }} حرو٠Ùقط.|هذه القيمة يجب ان تحتوى على {{ limit }} حر٠Ùقط.|هذه القيمة يجب ان تحتوى على {{ limit }} حر٠Ùقط.|هذه القيمة يجب ان تحتوى على {{ limit }} حر٠Ùقط. + + + The file was only partially uploaded. + تم استقبال جزء من المل٠Ùقط. + + + No file was uploaded. + لم يتم ارسال اى ملÙ. + + + No temporary folder was configured in php.ini. + لم يتم تهيئة حاÙظة مؤقتة ÙÙ‰ مل٠php.ini. + + + Cannot write temporary file to disk. + لم استطع كتابة المل٠المؤقت. + + + A PHP extension caused the upload to fail. + احد اضاÙات PHP تسببت ÙÙ‰ Ùشل استقبال الملÙ. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اكثر.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اكثر.|هذه المجموعة يجب ان تحتوى على {{ limit }} عناصر او اكثر.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اكثر.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اكثر.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اكثر. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اقل.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اقل.|هذه المجموعة يجب ان تحتوى على {{ limit }} عناصر او اقل.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اقل.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اقل.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر او اقل. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر Ùقط.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر Ùقط.|هذه المجموعة يجب ان تحتوى على {{ limit }} عناصر Ùقط.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر Ùقط.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر Ùقط.|هذه المجموعة يجب ان تحتوى على {{ limit }} عنصر Ùقط. + + + Invalid card number. + رقم البطاقه غير صحيح. + + + Unsupported card type or invalid card number. + نوع البطاقه غير مدعوم او الرقم غير صحيح. + + + This is not a valid International Bank Account Number (IBAN). + الرقم IBAN (رقم الحساب المصرÙÙŠ الدولي) الذي تم إدخاله غير صالح. + + + This value is not a valid ISBN-10. + هذه القيمة ليست ISBN-10 صالحة. + + + This value is not a valid ISBN-13. + هذه القيمة ليست ISBN-13 صالحة. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + هذه القيمة ليست ISBN-10 صالحة ولا ISBN-13 صالحة. + + + This value is not a valid ISSN. + هذه القيمة ليست ISSN صالحة. + + + This value is not a valid currency. + العÙملة غير صحيحة. + + + This value should be equal to {{ compared_value }}. + القيمة يجب ان تساوي {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + القيمة يجب ان تكون اعلي من {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + القيمة يجب ان تكون مساوية او اعلي من {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + القيمة يجب ان تطابق {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + القيمة يجب ان تكون اقل من {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + القيمة يجب ان تساوي او تقل عن {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + القيمة يجب ان لا تساوي {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + القيمة يجب ان لا تطابق {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + نسبة العرض على الارتÙاع للصورة كبيرة جدا ({{ ratio }}). الحد الأقصى للنسبة المسموح به هو {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + نسبة العرض على الارتÙاع للصورة صغيرة جدا ({{ ratio }}). الحد الأدنى للنسبة المسموح به هو {{ max_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + الصورة مربعة ({{ width }}x{{ height }}px). الصور المربعة غير مسموح بها. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + الصورة ÙÙŠ وضع Ø£Ùقي ({{ width }}x{{ height }}px). الصور ÙÙŠ وضع Ø£Ùقي غير مسموح بها. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + الصورة ÙÙŠ وضع عمودي ({{ width }}x{{ height }}px). الصور ÙÙŠ وضع عمودي غير مسموح بها. + + + An empty file is not allowed. + مل٠Ùارغ غير مسموح به. + + + The host could not be resolved. + يتعذر الإتصال بالنطاق. + + + This value does not match the expected {{ charset }} charset. + هذه القيمة غير متطابقة مع صيغة التحويل {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + هذه القيمة ليست رمز معرّ٠نشاط تجاري صالح (BIC). + + + Error + خطأ + + + This is not a valid UUID. + هذا ليس UUID صالح. + + + This value should be a multiple of {{ compared_value }}. + هذه القيمة يجب أن تكون مضاع٠ل {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + رمز المعرّ٠نشاط تجاري (BIC) هذا لا يرتبط مع IBAN {{ iban }}. + + + This value should be valid JSON. + هذه القيمة يجب أن تكون صالحة Ù„ JSON. + + + This collection should contain only unique elements. + يجب أن تحتوي هذه المجموعة علي عناصر Ùريدة Ùقط. + + + This value should be positive. + يجب أن تكون هذه القيمة موجبة. + + + This value should be either positive or zero. + يجب أن تكون هذه القيمة إما موجبة او صÙر. + + + This value should be negative. + يجب أن تكون هذه القيمة سالبة. + + + This value should be either negative or zero. + يجب أن تكون هذه القيمة إما سالبة او صÙر. + + + This value is not a valid timezone. + هذه القيمة ليست منطقة زمنية صحيحة. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + تم تسريب كلمة المرور هذه ÙÙŠ خرق للبيانات، ويجب عدم استخدامها. يرجي استخدام كلمة مرور أخري. + + + This value should be between {{ min }} and {{ max }}. + يجب أن تكون هذه القيمة بين {{ min }} Ùˆ {{ max }}. + + + This value is not a valid hostname. + هذه القيمة ليست اسم مضي٠صالح. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + يجب أن يكون عدد العناصر ÙÙŠ هذه المجموعة مضاع٠{{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + يجب أن تستوÙÙŠ هذه القيمة واحدة من القيود التالية: + + + Each element of this collection should satisfy its own set of constraints. + يجب أن ÙŠÙÙŠ كل عنصر من عناصر هذه المجموعة بمجموعة القيود الخاصة به. + + + This value is not a valid International Securities Identification Number (ISIN). + صالح (ISIN) هذه القيمة ليست رقم تعري٠الأوراق المالية الدولي. + + + This value should be a valid expression. + يجب أن تكون هذه القيمة تعبيرًا صالحًا. + + + This value is not a valid CSS color. + هذه القيمة ليست لون CSS صالحًا. + + + This value is not a valid CIDR notation. + هذه القيمة ليست تدوين CIDR صالحًا. + + + The value of the netmask should be between {{ min }} and {{ max }}. + يجب أن تكون قيمة netmask بين {{ min }} Ùˆ {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf new file mode 100644 index 00000000000..59480874fd3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + Bu dÉ™yÉ™r false olmalıdır. + + + This value should be true. + Bu dÉ™yÉ™r true olmalıdır. + + + This value should be of type {{ type }}. + Bu dÉ™yÉ™rin tipi {{ type }} olmalıdır. + + + This value should be blank. + Bu dÉ™yÉ™r boÅŸ olmalıdır. + + + The value you selected is not a valid choice. + Seçdiyiniz dÉ™yÉ™r düzgün bir seçim deÄŸil. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Æn az {{ limit }} seçim qeyd edilmÉ™lidir. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Æn çox {{ limit }} seçim qeyd edilmÉ™lidir. + + + One or more of the given values is invalid. + TÉ™qdim edilÉ™n dÉ™yÉ™rlÉ™rdÉ™n bir vÉ™ ya bir neçəsi yanlışdır. + + + This field was not expected. + Bu sahÉ™ gözlÉ™nilmirdi. + + + This field is missing. + Bu sahÉ™ É™ksikdir. + + + This value is not a valid date. + Bu dÉ™yÉ™r düzgün bir tarix deyil. + + + This value is not a valid datetime. + Bu dÉ™yÉ™r düzgün bir tarixsaat deyil. + + + This value is not a valid email address. + Bu dÉ™yÉ™r düzgün bir e-poçt adresi deyil. + + + The file could not be found. + Fayl tapılmadı. + + + The file is not readable. + Fayl oxunabilÉ™n deyil. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Fayl çox böyükdür ({{ size }} {{ suffix }}). Ä°cazÉ™ verilÉ™n maksimum fayl ölçüsü {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Faylın mime tipi yanlışdr ({{ type }}). Ä°cazÉ™ verilÉ™n mime tiplÉ™ri {{ types }}. + + + This value should be {{ limit }} or less. + Bu dÉ™yÉ™r {{ limit }} vÉ™ ya altında olmalıdır. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Bu dÉ™yÉ™r çox uzundur. {{ limit }} vÉ™ ya daha az simvol olmalıdır. + + + This value should be {{ limit }} or more. + Bu dÉ™yÉ™r {{ limit }} veya daha fazla olmalıdır. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Bu dÉ™yÉ™r çox qısadır. {{ limit }} vÉ™ ya daha çox simvol olmalıdır. + + + This value should not be blank. + Bu dÉ™yÉ™r boÅŸ olmamalıdır. + + + This value should not be null. + Bu dÉ™yÉ™r boÅŸ olmamalıdır. + + + This value should be null. + Bu dÉ™yÉ™r boÅŸ olmamalıdır. + + + This value is not valid. + Bu dÉ™yÉ™r doÄŸru deyil. + + + This value is not a valid time. + Bu dÉ™yÉ™r doÄŸru bir saat deyil. + + + This value is not a valid URL. + Bu dÉ™yÉ™r doÄŸru bir URL deÄŸil. + + + The two values should be equal. + Ä°ki dÉ™yÉ™r eyni olmalıdır. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Fayl çox böyükdür. Ä°cazÉ™ verilÉ™n É™n böyük fayl ölçüsü {{ limit }} {{ suffix }}. + + + The file is too large. + Fayl çox böyükdür. + + + The file could not be uploaded. + Fayl yüklÉ™nÉ™bilmir. + + + This value should be a valid number. + Bu dÉ™yÉ™r rÉ™qÉ™m olmalıdır. + + + This file is not a valid image. + Bu fayl düzgün bir ÅŸÉ™kil deyil. + + + This is not a valid IP address. + Bu düzgün bir IP adresi deyil. + + + This value is not a valid language. + Bu dÉ™yÉ™r düzgün bir dil deyil. + + + This value is not a valid locale. + Bu dÉ™yÉ™r düzgün bir dil deyil. + + + This value is not a valid country. + Bu dÉ™yÉ™r düzgün bir ölkÉ™ deyil. + + + This value is already used. + Bu dÉ™yÉ™r hal-hazırda istifadÉ™dÉ™dir. + + + The size of the image could not be detected. + Şəklin ölçüsü hesablana bilmir. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Şəklin geniÅŸliyi çox böyükdür ({{ width }}px). Ä°cazÉ™ verilÉ™n É™n böyük geniÅŸlik {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Şəklin geniÅŸliyi çox kiçikdir ({{ width }}px). Æn az {{ min_width }}px olmalıdır. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Şəklin yüksÉ™kliyi çox böyükdür ({{ height }}px). Ä°cazÉ™ verilÉ™n É™n böyük yüksÉ™klik {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Şəklin yüksÉ™kliyi çox kiçikdir ({{ height }}px). Æn az {{ min_height }}px olmalıdır. + + + This value should be the user's current password. + Bu dÉ™yÉ™r istifadəçinin hazırkı parolu olmalıdır. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Bu dÉ™yÉ™r tam olaraq {{ limit }} simvol olmaldır. + + + The file was only partially uploaded. + Fayl qismÉ™n yüklÉ™ndi. + + + No file was uploaded. + Fayl yüklÉ™nmÉ™di. + + + No temporary folder was configured in php.ini. + php.ini'dÉ™ müvÉ™qqÉ™ti qovluq quraÅŸdırılmayıb. + + + Cannot write temporary file to disk. + MüvÉ™qqÉ™ti fayl diskÉ™ yazıla bilmir. + + + A PHP extension caused the upload to fail. + Bir PHP É™lavÉ™si faylın yüklÉ™nmÉ™sinÉ™ mane oldu. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Bu kolleksiyada {{ limit }} vÉ™ ya daha çox element olmalıdır. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Bu kolleksiyada {{ limit }} vÉ™ ya daha az element olmalıdır. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Bu kolleksiyada tam olaraq {{ limit }} element olmalıdır. + + + Invalid card number. + Yanlış kart nömrÉ™si. + + + Unsupported card type or invalid card number. + DÉ™stÉ™klÉ™nmÉ™yÉ™n kart tipi vÉ™ ya yanlış kart nömrÉ™si. + + + This is not a valid International Bank Account Number (IBAN). + Bu dÉ™yÉ™r doÄŸru bir BeynÉ™lxalq Bank Hesap NömrÉ™si (IBAN) deyil. + + + This value is not a valid ISBN-10. + Bu dÉ™yÉ™r doÄŸru bir ISBN-10 deyil. + + + This value is not a valid ISBN-13. + Bu dÉ™yÉ™r doÄŸru bir ISBN-13 deyil. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Bu dÉ™yÉ™r doÄŸru bir ISBN-10 vÉ™ ya ISBN-13 deyil. + + + This value is not a valid ISSN. + Bu dÉ™yÉ™r doÄŸru bir ISSN deyil. + + + This value is not a valid currency. + Bu dÉ™yÉ™r doÄŸru bir valyuta deyil. + + + This value should be equal to {{ compared_value }}. + Bu dÉ™yÉ™r {{ compared_value }} ilÉ™ bÉ™rabÉ™r olmalıdır. + + + This value should be greater than {{ compared_value }}. + Bu dÉ™yÉ™r {{ compared_value }} dÉ™yÉ™rindÉ™n büyük olmalıdır. + + + This value should be greater than or equal to {{ compared_value }}. + Bu dÉ™yÉ™r {{ compared_value }} ilÉ™ bÉ™rabÉ™r vÉ™ ya daha böyük olmaldır. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Bu dÉ™yÉ™r {{ compared_value_type }} {{ compared_value }} ilÉ™ eyni olmalıdır. + + + This value should be less than {{ compared_value }}. + Bu dÉ™yÉ™r {{ compared_value }} dÉ™yÉ™rindÉ™n kiçik olmalıdır. + + + This value should be less than or equal to {{ compared_value }}. + Bu dÉ™yÉ™r {{ compared_value }} dÉ™yÉ™rindÉ™n kiçik vÉ™ ya bÉ™rabÉ™r olmalıdır. + + + This value should not be equal to {{ compared_value }}. + Bu deÄŸer {{ compared_value }} ile eÅŸit olmamalıdır. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Bu dÉ™yÉ™r {{ compared_value_type }} {{ compared_value }} ilÉ™ eyni olmamalıdır. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Şəkil nisbÉ™ti çox büyükdür ({{ ratio }}). Ä°cazÉ™ verilÉ™n maksimum nisbÉ™t: {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Şəkil nisbÉ™ti çox balacadır ({{ ratio }}). Ä°cazÉ™ verilÉ™n minimum nisbÉ™t: {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Şəkil kvadratdır ({{ width }}x{{ height }}px). Kvadrat ÅŸÉ™killÉ™rÉ™ icazÉ™ verilmir. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Şəkil albom rejimindÉ™dir ({{ width }}x{{ height }}px). Albom rejimli ÅŸÉ™killÉ™rÉ™ icazÉ™ verilmir. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Şəkil portret rejimindÉ™dir ({{ width }}x{{ height }}px). Portret rejimli ÅŸÉ™killÉ™rÉ™ icazÉ™ verilmir. + + + An empty file is not allowed. + BoÅŸ fayla icazÉ™ verilmir. + + + The host could not be resolved. + Ãœnvan tapılmadı. + + + This value does not match the expected {{ charset }} charset. + Bu dÉ™yÉ™r gözlÉ™nilÉ™n {{ charset }} simvol cÉ™dvÉ™li ilÉ™ uyÄŸun gÉ™lmir. + + + This is not a valid Business Identifier Code (BIC). + Bu dÉ™yÉ™r doÄŸru bir Biznes TÉ™yinedici Kodu (BIC) deyil. + + + Error + XÉ™ta + + + This is not a valid UUID. + Bu dÉ™yÉ™r doÄŸru bir UUID deyil. + + + This value should be a multiple of {{ compared_value }}. + Bu dÉ™yÉ™r {{ compare_value }} dÉ™yÉ™rinin bölÉ™nlÉ™rindÉ™n biri olmalıdır. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Bu Biznes TÉ™yinedici Kodu (BIC) {{ iban }} IBAN kodu ilÉ™ É™laqÉ™li deyil. + + + This value should be valid JSON. + Bu dÉ™yÉ™r doÄŸru bir JSON olmalıdır. + + + This collection should contain only unique elements. + Bu kolleksiyada sadÉ™cÉ™ unikal elementlÉ™r olmalıdır. + + + This value should be positive. + Bu dÉ™yÉ™r müsbÉ™t olmalıdır. + + + This value should be either positive or zero. + Bu dÉ™yÉ™r müsbÉ™t vÉ™ ya sıfır olmalıdır. + + + This value should be negative. + Bu dÉ™yÉ™r mÉ™nfi olmaldır. + + + This value should be either negative or zero. + Bu dÉ™yÉ™r mÉ™nfi vÉ™ ya sıfır olmaldır. + + + This value is not a valid timezone. + Bu dÉ™yÉ™r doÄŸru bir zaman zolağı deyil. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Bu parol data oÄŸurluÄŸunda tapıldığı üçün iÅŸlÉ™dilmÉ™mÉ™lidir. ZÉ™hmÉ™t olmasa, baÅŸqa parol seçin. + + + This value should be between {{ min }} and {{ max }}. + Bu dÉ™yÉ™r {{ min }} vÉ™ {{ max }} arasında olmaldır. + + + This value is not a valid hostname. + Bu dÉ™yÉ™r doÄŸru bir host adı deyil. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Bu kolleksiyadakı elementlerin sayı {{ compared_value }} tam bölünÉ™ni olmalıdır. + + + This value should satisfy at least one of the following constraints: + Bu dÉ™yÉ™r aÅŸağıdakı mÉ™cburiyyÉ™tlÉ™rdÉ™n birini qarşılamalıdır: + + + Each element of this collection should satisfy its own set of constraints. + Bu kolleksiyadakı hÉ™r element öz mÉ™cburiyyÉ™tlÉ™rini qarşılamalıdır. + + + This value is not a valid International Securities Identification Number (ISIN). + Bu dÉ™yÉ™r doÄŸru bir QiymÉ™tli Kağızın BeynÉ™lxalq Ä°dentifikasiya Kodu (ISIN) deyil. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf new file mode 100644 index 00000000000..648955684ba --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + ЗначÑнне павінна быць Ðе. + + + This value should be true. + ЗначÑнне павінна быць Так. + + + This value should be of type {{ type }}. + Тып значÑÐ½Ð½Ñ Ð¿Ð°Ð²Ñ–Ð½ÐµÐ½ быць {{ type }}. + + + This value should be blank. + ЗначÑнне павінна быць пуÑтым. + + + The value you selected is not a valid choice. + Ðбранае вамі значÑнне не Ñапраўднае. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Ð’Ñ‹ павінны выбраць Ñ…Ð°Ñ†Ñ Ð± {{ limit }} варыÑнт.|Ð’Ñ‹ павінны выбраць Ñ…Ð°Ñ†Ñ Ð± {{ limit }} варыÑнтаў. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Ð’Ñ‹ павінны выбраць не больш за {{ limit }} варыÑнт.|Ð’Ñ‹ павінны выбраць не больш за {{ limit }} варыÑнтаў. + + + One or more of the given values is invalid. + Ðдзін або некалькі пазначаных значÑннÑÑž з'ÑўлÑецца неÑапраўдным. + + + This field was not expected. + ГÑта поле не чакаецца. + + + This field is missing. + ГÑта поле адÑутнічае. + + + This value is not a valid date. + ГÑта значÑнне не з'ÑўлÑецца карÑктнай датай. + + + This value is not a valid datetime. + ГÑта значÑнне не з'ÑўлÑецца карÑктнай датай i чаÑом. + + + This value is not a valid email address. + ГÑта значÑнне не з'ÑўлÑецца карÑктным адраÑам Ñлектроннай пошты. + + + The file could not be found. + Файл не знойдзен. + + + The file is not readable. + Файл не чытаецца. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Файл занадта вÑлікі ({{ size }} {{ suffix }}). МакÑімальна дазволены памер {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + MIME-тып файлу некарÑкты ({{ type }}). Ð”Ð°Ð·Ð²Ð¾Ð»ÐµÐ½Ñ‹Ñ MIME-тыпы файлу {{ types }}. + + + This value should be {{ limit }} or less. + ЗначÑнне павінна быць {{ limit }} або менш. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + ЗначÑнне занадта доўгае. Яно павінна мець {{ limit }} Ñімвал або менш.|ЗначÑнне занадта доўгае. Яно павінна мець {{ limit }} Ñімвалаў або менш. + + + This value should be {{ limit }} or more. + ЗначÑнне павінна быць {{ limit }} або больш. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + ЗначÑнне занадта кароткае. Яно павінна мець прынамÑÑ– {{ limit }} Ñімвал.|ЗначÑнне занадта кароткае. Яно павінна мець прынамÑÑ– {{ limit }} Ñімвалаў. + + + This value should not be blank. + ЗначÑнне не павінна быць пуÑтым. + + + This value should not be null. + ЗначÑнне не павінна быць null. + + + This value should be null. + ЗначÑнне павінна быць null. + + + This value is not valid. + ЗначÑнне з'ÑўлÑецца не Ñапраўдным. + + + This value is not a valid time. + ЗначÑнне не з'ÑўлÑецца Ñапраўдным чаÑам. + + + This value is not a valid URL. + ЗначÑнне не з'ÑўлÑецца Ñапраўдным URL-адраÑам. + + + The two values should be equal. + Ðбодва значÑнні павінны быць аднолькавымі. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Файл занадта вÑлікі. МакÑімальна дазволены памер {{ limit }} {{ suffix }}. + + + The file is too large. + Файл занадта вÑлікі. + + + The file could not be uploaded. + Ðемагчыма запампаваць файл. + + + This value should be a valid number. + ЗначÑнне павінна быць лікам. + + + This file is not a valid image. + ГÑÑ‚Ñ‹ файл не з'ÑўлÑецца Ñапраўднай выÑвай. + + + This is not a valid IP address. + ЗначÑнне не з'ÑўлÑецца Ñапраўдным IP-адраÑам. + + + This value is not a valid language. + ЗначÑнне не з'ÑўлÑецца Ñапраўдным мовай. + + + This value is not a valid locale. + ЗначÑнне не з'ÑўлÑецца Ñапраўднай лакаллю. + + + This value is not a valid country. + ЗначÑнне не з'ÑўлÑецца Ñапраўднай краінай. + + + This value is already used. + ГÑта значÑнне ўжо выкарыÑтоўваецца. + + + The size of the image could not be detected. + Ðемагчыма вызначыць памер выÑвы. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ГÑта выÑва занадта вÑÐ»Ñ–ÐºÐ°Ñ ({{ width }}px). ДазвалÑецца макÑÑ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ ÑˆÑ‹Ñ€Ñ‹Ð½Ñ {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ГÑта выÑва занадта Ð¼Ð°Ð»ÐµÐ½ÑŒÐºÐ°Ñ ({{ width }}px). ДазвалÑецца Ð¼Ñ–Ð½Ñ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ ÑˆÑ‹Ñ€Ñ‹Ð½Ñ {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ГÑÑ‚Ñ‹ выÑва занадта вÑÐ»Ñ–ÐºÐ°Ñ ({{ width }}px). ДазвалÑецца макÑÑ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð²Ñ‹ÑˆÑ‹Ð½Ñ {{ max_width }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ГÑта выÑва занадта Ð¼Ð°Ð»ÐµÐ½ÑŒÐºÐ°Ñ ({{ width }}px). ДазвалÑецца Ð¼Ñ–Ð½Ñ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð²Ñ‹ÑˆÑ‹Ð½Ñ {{ min_width }}px. + + + This value should be the user's current password. + ЗначÑнне павінна быць цÑперашнім паролем карыÑтальніка. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + ЗначÑнне павінна мець {{ limit }} Ñімвал.|ЗначÑнне павінна мець {{ limit }} Ñімвалаў. + + + The file was only partially uploaded. + Файл быў запампаваны толькі чаÑткова. + + + No file was uploaded. + Файл не быў запампаваны. + + + No temporary folder was configured in php.ini. + У php.ini не была налажана чаÑÐ¾Ð²Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°, або чаÑÐ¾Ð²Ð°Ñ Ð¿Ð°Ð¿ÐºÐ° не Ñ–Ñнуе. + + + Cannot write temporary file to disk. + Ðемагчыма запіÑаць чаÑовы файл на дыÑк. + + + A PHP extension caused the upload to fail. + ПашырÑнне PHP выклікала памылку загрузкі. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць прынамÑÑ– {{ limit }} Ñлемент.|ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць прынамÑÑ– {{ limit }} Ñлементаў. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць {{ limit }} або менш Ñлемент.|ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць {{ limit }} або менш Ñлементаў. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць роўна {{ limit }} Ñлемент.|ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць роўна {{ limit }} Ñлементаў. + + + Invalid card number. + ÐеÑапраўдны нумар карты. + + + Unsupported card type or invalid card number. + Тып карты не падтрымліваецца або неÑапраўдны нумар карты. + + + This is not a valid International Bank Account Number (IBAN). + ÐеÑапраўдны міжнародны нумар банкаўÑкага рахунку (IBAN). + + + This value is not a valid ISBN-10. + ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISBN-10. + + + This value is not a valid ISBN-13. + ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISBN-10 або ISBN-13. + + + This value is not a valid ISSN. + ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISSN. + + + This value is not a valid currency. + ГÑта значÑнне не з'ÑўлÑецца Ñапраўднай валютай. + + + This value should be equal to {{ compared_value }}. + ЗначÑнне павінна раўнÑцца {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + ЗначÑнне павінна быць больш чым {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + ЗначÑнне павінна быць больш чым або раўнÑцца {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + ЗначÑнне павінна быць ідÑнтычным {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + ЗначÑнне павінна быць менш чым {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + ЗначÑнне павінна быць менш чым або раўнÑцца {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + ЗначÑнне не павінна раўнÑцца {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + ЗначÑнне не павінна быць ідÑнтычным {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + СуадноÑіны бакоў выÑвы з'ÑўлÑецца занадта вÑлікім ({{ ratio }}). ДазвалÑецца макÑÑ–Ð¼Ð°Ð»ÑŒÐ½Ñ‹Ñ ÑуадноÑіны {{max_ratio}} . + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + СуадноÑіны бакоў выÑвы з'ÑўлÑецца занадта маленькімі ({{ ratio }}). ДазвалÑецца Ð¼Ñ–Ð½Ñ–Ð¼Ð°Ð»ÑŒÐ½Ñ‹Ñ ÑуадноÑіны {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Ð’Ñ‹Ñва ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ð°Ñ ({{width}}x{{height}}px). ÐšÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ñ‹Ñ Ð²Ñ‹Ñвы не дазволены. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Ð’Ñ‹Ñва Ñž альбомнай арыентацыі ({{ width }}x{{ height }}px). Ð’Ñ‹Ñвы Ñž альбомнай арыентацыі не дазволены. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Ð’Ñ‹Ñва Ñž партрÑтнай арыентацыі ({{ width }}x{{ height }}px). Ð’Ñ‹Ñвы Ñž партрÑтнай арыентацыі не дазволены. + + + An empty file is not allowed. + ПуÑÑ‚Ñ‹ файл не дазволены. + + + The host could not be resolved. + Ðе магчыма знайÑці Ñ–Ð¼Ñ Ñ…Ð¾Ñта. + + + This value does not match the expected {{ charset }} charset. + ГÑта значÑнне не Ñупадае з чаканай {{ charset }} кадыроўкай. + + + This is not a valid Business Identifier Code (BIC). + ÐеÑапраўдны банкаўÑкі ідÑнтыфікацыйны код (BIC). + + + Error + Памылка + + + This is not a valid UUID. + ГÑта неÑапраўдны UUID. + + + This value should be a multiple of {{ compared_value }}. + ЗначÑнне павінна быць кратным {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + БанкаўÑкі ідÑнтыфікацыйны код (BIC) не звÑзан з IBAN {{ iban }}. + + + This value should be valid JSON. + ГÑта значÑнне павінна быць у фармаце JSON. + + + This collection should contain only unique elements. + ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць толькі ÑžÐ½Ñ–ÐºÐ°Ð»ÑŒÐ½Ñ‹Ñ Ñлементы. + + + This value should be positive. + ЗначÑнне павінна быць дадатным. + + + This value should be either positive or zero. + ЗначÑнне павінна быць дадатным ці нуль. + + + This value should be negative. + ЗначÑнне павінна быць адмоўным. + + + This value should be either negative or zero. + ЗначÑнне павінна быць адмоўным ці нуль. + + + This value is not a valid timezone. + ЗначÑнне не з'ÑўлÑецца Ñапраўдным гадзінным поÑÑам. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + ГÑÑ‚Ñ‹ пароль быў выкрадзены Ñž выніку ўзлому дадзеных, таму Ñго нельга выкарыÑтоўваць. Калі лаÑка, выкарыÑтоўвайце іншы пароль. + + + This value should be between {{ min }} and {{ max }}. + ЗначÑнне павінна быць паміж {{min}} Ñ– {{max}}. + + + This value is not a valid hostname. + ЗначÑнне не з'ÑўлÑецца карÑктным імем хаÑта. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + КолькаÑць Ñлементаў у гÑтай калекцыі павінна быць кратным {{compared_value}}. + + + This value should satisfy at least one of the following constraints: + ЗначÑнне павінна задавальнÑць Ñк мінімум аднаму з наÑтупных абмежаваннÑÑž: + + + Each element of this collection should satisfy its own set of constraints. + Кожны Ñлемент гÑтай калекцыі павінен задавальнÑць Ñвайму ўлаÑнаму набору абмежаваннÑÑž. + + + This value is not a valid International Securities Identification Number (ISIN). + ЗначÑнне не з'ÑўлÑецца карÑктным міжнародным ідÑнтыфікацыйным нумарам каштоўных папер (ISIN). + + + This value should be a valid expression. + ЗначÑнне не з'ÑўлÑецца Ñапраўдным выразам. + + + This value is not a valid CSS color. + ЗначÑнне не з'ÑўлÑецца дапушчальным колерам CSS. + + + This value is not a valid CIDR notation. + ЗначÑнне не з'ÑўлÑецца Ñапраўднай натацыÑй CIDR. + + + The value of the netmask should be between {{ min }} and {{ max }}. + ЗначÑнне Ñеткавай маÑкі павінна быць ад {{min}} да {{max}}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf new file mode 100644 index 00000000000..455ff81679a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде лъжа (false). + + + This value should be true. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде иÑтина (true). + + + This value should be of type {{ type }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде от тип {{ type }}. + + + This value should be blank. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде празна. + + + The value you selected is not a valid choice. + Избраната ÑтойноÑÑ‚ е невалидна. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + ТрÑбва да изберете поне {{ limit }} опциÑ.|ТрÑбва да изберете поне {{ limit }} опции. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + ТрÑбва да изберете най-много {{ limit }} опциÑ.|ТрÑбва да изберете най-много {{ limit }} опции. + + + One or more of the given values is invalid. + Една или повече от зададените ÑтойноÑти е невалидна. + + + This field was not expected. + Полето не Ñе е очаквало. + + + This field is missing. + Полето липÑва. + + + This value is not a valid date. + СтойноÑтта не е валидна дата. + + + This value is not a valid datetime. + СтойноÑтта не е валидна дата и чаÑ. + + + This value is not a valid email address. + СтойноÑтта не е валиден имейл адреÑ. + + + The file could not be found. + Файлът не беше открит. + + + The file is not readable. + Файлът не може да бъде прочетен. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Файлът е твърде голÑм ({{ size }} {{ suffix }}). МакÑималниÑÑ‚ размер е {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mime типа на файла е невалиден ({{ type }}). Разрешени mime типове Ñа {{ types }}. + + + This value should be {{ limit }} or less. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде {{ limit }} или по-малко. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + СтойноÑтта е твърде дълга. ТрÑбва да Ñъдържа най-много {{ limit }} Ñимвол.|СтойноÑтта е твърде дълга. ТрÑбва да Ñъдържа най-много {{ limit }} Ñимвола. + + + This value should be {{ limit }} or more. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде {{ limit }} или повече. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + СтойноÑтта е твърде кратка. ТрÑбва да Ñъдържа поне {{ limit }} Ñимвол.|СтойноÑтта е твърде кратка. ТрÑбва да Ñъдържа поне {{ limit }} Ñимвола. + + + This value should not be blank. + СтойноÑтта не Ñ‚Ñ€Ñбва да бъде празна. + + + This value should not be null. + СтойноÑтта не Ñ‚Ñ€Ñбва да бъде null. + + + This value should be null. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде null. + + + This value is not valid. + СтойноÑтта не е валидна. + + + This value is not a valid time. + СтойноÑтта не е валидно време. + + + This value is not a valid URL. + СтойноÑтта не е валиден URL. + + + The two values should be equal. + Двете ÑтойноÑти Ñ‚Ñ€Ñбва да бъдат равни. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Файлът е твърде голÑм. РазрешениÑÑ‚ макÑимален размер е {{ limit }} {{ suffix }}. + + + The file is too large. + Файлът е твърде голÑм. + + + The file could not be uploaded. + Файлът не може да бъде качен. + + + This value should be a valid number. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде валиден номер. + + + This file is not a valid image. + Файлът не е валидно изображение. + + + This is not a valid IP address. + Това не е валиден IP адреÑ. + + + This value is not a valid language. + СтойноÑтта не е валиден език. + + + This value is not a valid locale. + СтойноÑтта не е валидна локализациÑ. + + + This value is not a valid country. + СтойноÑтта не е валидна държава. + + + This value is already used. + СтойноÑтта вече е в употреба. + + + The size of the image could not be detected. + Размера на изображението не може да бъде определен. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Изображението е твърде широко ({{ width }}px). Широчината Ñ‚Ñ€Ñбва да бъде макÑимум {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Изображението е Ñ Ñ‚Ð²ÑŠÑ€Ð´Ðµ малка широчина ({{ width }}px). Широчината Ñ‚Ñ€Ñбва да бъде минимум {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Изображението е Ñ Ñ‚Ð²ÑŠÑ€Ð´Ðµ голÑма виÑочина ({{ height }}px). ВиÑочината Ñ‚Ñ€Ñбва да бъде макÑимум {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Изображението е Ñ Ñ‚Ð²ÑŠÑ€Ð´Ðµ малка виÑочина ({{ height }}px). ВиÑочина Ñ‚Ñ€Ñбва да бъде минимум {{ min_height }}px. + + + This value should be the user's current password. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде текущата потребителÑка парола. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде точно {{ limit }} Ñимвол.|СтойноÑтта Ñ‚Ñ€Ñбва да бъде точно {{ limit }} Ñимвола. + + + The file was only partially uploaded. + Файлът е качен чаÑтично. + + + No file was uploaded. + Файлът не беше качен. + + + No temporary folder was configured in php.ini. + Ðе е поÑочена Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð·Ð° временни файлове в php.ini. + + + Cannot write temporary file to disk. + Ðе може да запише временен файл на диÑка. + + + A PHP extension caused the upload to fail. + PHP разширение предизвика прекъÑване на качването. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа поне {{ limit }} елемент.|КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа поне {{ limit }} елемента. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа най-много {{ limit }} елемент.|КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа най-много {{ limit }} елемента. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа точно {{ limit }} елемент.|КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа точно {{ limit }} елемента. + + + Invalid card number. + Ðевалиден номер на карта. + + + Unsupported card type or invalid card number. + Ðеподдържан тип карта или невалиден номер на карта. + + + This is not a valid International Bank Account Number (IBAN). + Това не е валиден Международен номер на банкова Ñметка (IBAN). + + + This value is not a valid ISBN-10. + СтойноÑтта не е валиден ISBN-10. + + + This value is not a valid ISBN-13. + СтойноÑтта не е валиден ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + СтойноÑтта не е нито валиден ISBN-10, нито валиден ISBN-13. + + + This value is not a valid ISSN. + СтойноÑтта не е валиден ISSN. + + + This value is not a valid currency. + СтойноÑтта не е валидна валута. + + + This value should be equal to {{ compared_value }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде равна на {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде по-голÑма от {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде по-голÑма или равна на {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде идентична Ñ {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде по-малка {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде по-малка или равна на {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + СтойноÑтта не Ñ‚Ñ€Ñбва да бъде равна на {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + СтойноÑтта не Ñ‚Ñ€Ñбва да бъде идентична Ñ {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Изображението е Ñ Ñ‚Ð²ÑŠÑ€Ð´Ðµ голÑма Ð¿Ñ€Ð¾Ð¿Ð¾Ñ€Ñ†Ð¸Ñ ({{ ratio }}). МакÑималната Ð¿Ñ€Ð¾Ð¿Ð¾Ñ€Ñ†Ð¸Ñ Ñ‚Ñ€Ñбва да е {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Изображението е Ñ Ñ‚Ð²ÑŠÑ€Ð´Ðµ малка Ð¿Ñ€Ð¾Ð¿Ð¾Ñ€Ñ†Ð¸Ñ ({{ ratio }}). Минималната Ð¿Ñ€Ð¾Ð¿Ð¾Ñ€Ñ†Ð¸Ñ Ñ‚Ñ€Ñбва да е {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Изображението е квадрат ({{ width }}x{{ height }}px). Такива Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð½Ðµ Ñа разрешени. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Изображението е Ñ Ð¿ÐµÐ¹Ð·Ð°Ð¶Ð½Ð° Ð¾Ñ€Ð¸ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ ({{ width }}x{{ height }}px). Ð˜Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñ Ñ‚Ð°ÐºÐ°Ð²Ð° Ð¾Ñ€Ð¸ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ Ð½Ðµ Ñа разрешени. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Изображението е Ñ Ð¿Ð¾Ñ€Ñ‚Ñ€ÐµÑ‚Ð½Ð° Ð¾Ñ€Ð¸ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ ({{ width }}x{{ height }}px). Ð˜Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñ Ñ‚Ð°ÐºÐ°Ð²Ð° Ð¾Ñ€Ð¸ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ Ð½Ðµ Ñа разрешени. + + + An empty file is not allowed. + Празни файлове не Ñа разрешени. + + + The host could not be resolved. + ХоÑÑ‚ÑŠÑ‚ е недоÑтъпен. + + + This value does not match the expected {{ charset }} charset. + СтойноÑтта не Ñъвпада Ñ Ð¾Ñ‡Ð°ÐºÐ²Ð°Ð½Ð°Ñ‚Ð° {{ charset }} кодировка. + + + This is not a valid Business Identifier Code (BIC). + Това не е валиден Ð‘Ð¸Ð·Ð½ÐµÑ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ð¾Ð½ÐµÐ½ код (BIC). + + + Error + Грешка + + + This is not a valid UUID. + Това не е валиден UUID. + + + This value should be a multiple of {{ compared_value }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде кратно чиÑло на {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ð‘Ð¸Ð·Ð½ÐµÑ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ ÐºÐ¾Ð´ (BIC) не е Ñвързан Ñ IBAN {{ iban }}. + + + This value should be valid JSON. + СтойноÑтта Ñ‚Ñ€Ñбва да е валиден JSON. + + + This collection should contain only unique elements. + КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа Ñамо уникални елементи. + + + This value should be positive. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде положително чиÑло. + + + This value should be either positive or zero. + СтойноÑтта Ñ‚Ñ€Ñбва бъде положително чиÑло или нула. + + + This value should be negative. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде отрицателно чиÑло. + + + This value should be either negative or zero. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде отрицателно чиÑло или нула. + + + This value is not a valid timezone. + СтойноÑтта не е валидна чаÑова зона. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Тази парола е компрометирана, не Ñ‚Ñ€Ñбва да бъде използвана. ÐœÐ¾Ð»Ñ Ð¸Ð·Ð¿Ð¾Ð»Ð·Ð²Ð°Ð¹Ñ‚Ðµ друга парола. + + + This value should be between {{ min }} and {{ max }}. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде между {{ min }} и {{ max }}. + + + This value is not a valid hostname. + СтойноÑтта не е валиден hostname. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + БроÑÑ‚ на елементите в тази ÐºÐ¾Ð»ÐµÐºÑ†Ð¸Ñ Ñ‚Ñ€Ñбва да бъде кратен на {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + СтойноÑтта Ñ‚Ñ€Ñбва да Ð¾Ñ‚Ð³Ð¾Ð²Ð°Ñ€Ñ Ð½Ð° поне едно от Ñледните ограничениÑ: + + + Each element of this collection should satisfy its own set of constraints. + Ð’Ñеки елемент от тази ÐºÐ¾Ð»ÐµÐºÑ†Ð¸Ñ Ñ‚Ñ€Ñбва да Ð¾Ñ‚Ð³Ð¾Ð²Ð°Ñ€Ñ Ð½Ð° ÑобÑÑ‚Ð²ÐµÐ½Ð¸Ñ Ñи набор от ограничениÑ. + + + This value is not a valid International Securities Identification Number (ISIN). + СтойноÑтта не е валиден Международен идентификационен номер на ценни книжа (ISIN). + + + This value should be a valid expression. + СтойноÑтта Ñ‚Ñ€Ñбва да бъде валиден израз. + + + This value is not a valid CSS color. + СтойноÑтта не е валиден CSS цвÑÑ‚. + + + This value is not a valid CIDR notation. + СтойноÑтта не е валидна CIDR нотациÑ. + + + The value of the netmask should be between {{ min }} and {{ max }}. + СтойноÑтта на мрежовата маÑка Ñ‚Ñ€Ñбва да бъде между {{ min }} и {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf new file mode 100644 index 00000000000..43102cca2c0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Ova vrijednost bi trebalo da bude "netaÄno" (false). + + + This value should be true. + Ova vrijednost bi trebalo da bude "taÄno" (true). + + + This value should be of type {{ type }}. + Ova vrijednost bi trebalo da bude tipa {{ type }}. + + + This value should be blank. + Ova vrijednost bi trebalo da bude prazna. + + + The value you selected is not a valid choice. + Odabrana vrijednost nije validan izbor. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Morate odabrati barem {{ limit }} mogućnost.|Morate odabrati barem {{ limit }} mogućnosti.|Morate odabrati barem {{ limit }} mogućnosti. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Morate odabrati najviÅ¡e {{ limit }} mogućnost.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti. + + + One or more of the given values is invalid. + Jedna ili viÅ¡e datih vrijednosti nisu validne. + + + This field was not expected. + Ovo polje nije oÄekivano. + + + This field is missing. + Ovo polje nedostaje. + + + This value is not a valid date. + Ova vrijednost nije ispravan datum. + + + This value is not a valid datetime. + Ova vrijednost nije ispravnog datum-vrijeme (datetime) formata. + + + This value is not a valid email address. + Ova vrijednost nije ispravna e-mail adresa. + + + The file could not be found. + Ova datoteka ne može biti pronaÄ‘ena. + + + The file is not readable. + Ova datoteka nije Äitljiva. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Ova datoteka je prevelika ({{ size }} {{ suffix }}). Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mime tip datoteke nije ispravan ({{ type }}). Dozvoljeni mime tipovi su {{ types }}. + + + This value should be {{ limit }} or less. + Ova vrijednost bi trebalo da bude {{ limit }} ili manje. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ova vrijednost je predugaÄka. Trebalo bi da ima {{ limit }} karakter ili manje.|Ova vrijednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje.|Ova vrijednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje. + + + This value should be {{ limit }} or more. + Ova vrijednost bi trebalo da bude {{ limit }} ili viÅ¡e. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ova vrijednost je prekratka. Trebalo bi da ima {{ limit }} karakter ili viÅ¡e.|Ova vrijednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e.|Ova vrijednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e. + + + This value should not be blank. + Ova vrijednost ne bi trebalo da bude prazna. + + + This value should not be null. + Ova vrijednost ne bi trebalo da bude null. + + + This value should be null. + Ova vrijednost bi trebalo da bude null. + + + This value is not valid. + Ova vrijednost nije ispravna. + + + This value is not a valid time. + Ova vrijednost nije ispravno vrijeme. + + + This value is not a valid URL. + Ova vrijednost nije ispravan URL. + + + The two values should be equal. + Obje vrijednosti bi trebalo da budu jednake. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Ova datoteka je prevelika. Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. + + + The file is too large. + Ova datoteka je prevelika. + + + The file could not be uploaded. + Ova datoteka ne može biti prenijeta (uploaded). + + + This value should be a valid number. + Ova vrijednost bi trebalo da bude ispravan broj. + + + This file is not a valid image. + Ova datoteka nije validna slika. + + + This is not a valid IP address. + Ovo nije ispravna IP adresa. + + + This value is not a valid language. + Ova vrijednost nije validan jezik. + + + This value is not a valid locale. + Ova vrijednost nije validna regionalna oznaka. + + + This value is not a valid country. + Ova vrijednost nije validna država. + + + This value is already used. + Ova vrijednost je već upotrebljena. + + + The size of the image could not be detected. + Nije moguće otkriti veliÄinu ove slike. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Å irina slike je prevelika ({{ width }}px). Najveća dozvoljena Å¡irina je {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Å irina slike je premala ({{ width }}px). Najmanja dozvoljena Å¡irina je {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Dužina slike je prevelika ({{ height }}px). Najveća dozvoljena dužina je {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Dužina slike je premala ({{ height }}px). Najmanja dozvoljena dužina je {{ min_height }}px. + + + This value should be the user's current password. + Ova vrijednost bi trebalo da bude trenutna korisniÄka lozinka. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ova vrijednost bi trebalo da ima taÄno {{ limit }} karakter.|Ova vrijednost bi trebalo da ima taÄno {{ limit }} karaktera. + + + The file was only partially uploaded. + Datoteka je samo djelimiÄno prenijeta (uploaded). + + + No file was uploaded. + Nijedna datoteka nije prenijeta (uploaded). + + + No temporary folder was configured in php.ini. + Privremeni direktorijum nije konfigurisan u datoteci php.ini. + + + Cannot write temporary file to disk. + Privremenu datoteku nije moguće upisati na disk. + + + A PHP extension caused the upload to fail. + Prenos datoteke nije uspio zbog PHP ekstenzije. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} element.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elementa.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elemenata. + + + Invalid card number. + Broj kartice je neispravan. + + + Unsupported card type or invalid card number. + Tip kartice nije podržan ili je broj kartice neispravan. + + + This is not a valid International Bank Account Number (IBAN). + Ova vrijednost nije ispravan meÄ‘unarodni broj bankovnog raÄuna (IBAN). + + + This value is not a valid ISBN-10. + Ova vrijednost nije ispravan ISBN-10. + + + This value is not a valid ISBN-13. + Ova vrijednost nije ispravan ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ova vrijednost nije ispravan ISBN-10 niti ISBN-13. + + + This value is not a valid ISSN. + Ova vrijednost nije ispravan ISSN. + + + This value is not a valid currency. + Ova vrijednost nije ispravna valuta. + + + This value should be equal to {{ compared_value }}. + Ova vrijednost bi trebalo da bude jednaka {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ova vrijednost bi trebalo da bude veća od {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ova vrijednost bi trebalo da bude jednaka ili veća od {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ova vrijednost bi trebalo da bude identiÄna {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ova vrijednost bi trebalo da bude manja od {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ova vrijednost bi trebalo da bude jednaka ili manja od {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ova vrijednost bi trebalo da bude razliÄita od {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ova vrijednost bi trebalo da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Razmjera ove slike je prevelika ({{ ratio }}). Maksimalna dozvoljena razmjera je {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Razmjera ove slike je premala ({{ ratio }}). Minimalna oÄekivana razmjera je {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Ova slika je kvadratnog oblika ({{ width }}x{{ height }}px). Kvadratne slike nisu dozvoljene. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Ova slika je orijentisana horizontalno (landscape) ({{ width }}x{{ height }}px). Horizontalno orijentisane slike nisu dozvoljene. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Ova slika je orijentisana vertikalno (portrait) ({{ width }}x{{ height }}px). Vertikalno orijentisane slike nisu dozvoljene. + + + An empty file is not allowed. + Prazna datoteka nije dozvoljena. + + + The host could not be resolved. + Nije moguće odrediti poslužitelja (host). + + + This value does not match the expected {{ charset }} charset. + Ova vrijednost ne odgovara oÄekivanom {{ charset }} setu karaktera (charset). + + + This is not a valid Business Identifier Code (BIC). + Ovo nije validan poslovni identifikacioni kod (BIC). + + + Error + GreÅ¡ka + + + This is not a valid UUID. + Ovo nije validan UUID. + + + This value should be a multiple of {{ compared_value }}. + Ova vrijednost bi trebalo da bude djeljiva sa {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ovaj poslovni identifikacioni kod (BIC) nije povezan sa IBAN-om {{ iban }}. + + + This value should be valid JSON. + Ova vrijednost bi trebalo da bude validan JSON. + + + This collection should contain only unique elements. + Ova kolekcija bi trebala da sadrži samo jedinstvene elemente. + + + This value should be positive. + Ova vrijednost bi trebalo da bude pozitivna. + + + This value should be either positive or zero. + Ova vrijednost bi trebalo da bude pozitivna ili jednaka nuli. + + + This value should be negative. + Ova vrijednost bi trebalo da bude negativna. + + + This value should be either negative or zero. + Ova vrijednost bi trebalo da bude negativna ili jednaka nuli. + + + This value is not a valid timezone. + Ova vrijednost nije validna vremenska zona. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ova lozinka je procurila u nekom od sluÄajeva kompromitovanja podataka, nemojte je koristiti. Koristite drugu lozinku. + + + This value should be between {{ min }} and {{ max }}. + Ova vrijednosti bi trebala biti izmeÄ‘u {{ min }} i {{ max }}. + + + This value is not a valid hostname. + Ova vrijednost nije ispravno ime poslužitelja (hostname). + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Broj elemenata u ovoj kolekciji bi trebalo da bude djeljiv sa {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ova vrijednost bi trebalo da zadovoljava namjanje jedno od narednih ograniÄenja: + + + Each element of this collection should satisfy its own set of constraints. + Svaki element ove kolekcije bi trebalo da zadovolji sopstveni skup ograniÄenja. + + + This value is not a valid International Securities Identification Number (ISIN). + Ova vrijednost nije ispravna meÄ‘unarodna identifikaciona oznaka hartija od vrijednosti (ISIN). + + + This value should be a valid expression. + Ova vrijednost bi trebala biti važeći izraz. + + + This value is not a valid CSS color. + Ova vrijednost nije važeća CSS boja. + + + This value is not a valid CIDR notation. + Ova vrijednost nije važeća CIDR notacija. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Vrijednost NetMask bi trebala biti izmeÄ‘u {{min}} i {{max}}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf new file mode 100644 index 00000000000..04f3e9abf21 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Aquest valor hauria de ser fals. + + + This value should be true. + Aquest valor hauria de ser cert. + + + This value should be of type {{ type }}. + Aquest valor hauria de ser del tipus {{ type }}. + + + This value should be blank. + Aquest valor hauria d'estar buit. + + + The value you selected is not a valid choice. + El valor seleccionat no és una opció vàlida. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Ha de seleccionar almenys {{ limit }} opció.|Ha de seleccionar almenys {{ limit }} opcions. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Ha de seleccionar com a màxim {{ limit }} opció.|Ha de seleccionar com a màxim {{ limit }} opcions. + + + One or more of the given values is invalid. + Un o més dels valors facilitats són incorrectes. + + + This field was not expected. + Aquest camp no s'esperava. + + + This field is missing. + Aquest camp està desaparegut. + + + This value is not a valid date. + Aquest valor no és una data vàlida. + + + This value is not a valid datetime. + Aquest valor no és una data i hora vàlida. + + + This value is not a valid email address. + Aquest valor no és una adreça d'email vàlida. + + + The file could not be found. + No s'ha pogut trobar l'arxiu. + + + The file is not readable. + No es pot llegir l'arxiu. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + L'arxiu és massa gran ({{ size }} {{ suffix }}). La grandària màxima permesa és {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + El tipus mime de l'arxiu no és vàlid ({{ type }}). Els tipus mime vàlids són {{ types }}. + + + This value should be {{ limit }} or less. + Aquest valor hauria de ser {{ limit }} o menys. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Aquest valor és massa llarg. Hauria de tenir {{ limit }} caràcter o menys.|Aquest valor és massa llarg. Hauria de tenir {{ limit }} caràcters o menys. + + + This value should be {{ limit }} or more. + Aquest valor hauria de ser {{ limit }} o més. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Aquest valor és massa curt. Hauria de tenir {{ limit }} caràcters o més. + + + This value should not be blank. + Aquest valor no hauria d'estar buit. + + + This value should not be null. + Aquest valor no hauria de ser null. + + + This value should be null. + Aquest valor hauria de ser null. + + + This value is not valid. + Aquest valor no és vàlid. + + + This value is not a valid time. + Aquest valor no és una hora vàlida. + + + This value is not a valid URL. + Aquest valor no és una URL vàlida. + + + The two values should be equal. + Els dos valors haurien de ser iguals. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + L'arxiu és massa gran. El tamany màxim permés és {{ limit }} {{ suffix }}. + + + The file is too large. + L'arxiu és massa gran. + + + The file could not be uploaded. + No es pot pujar l'arxiu. + + + This value should be a valid number. + Aquest valor hauria de ser un nombre vàlid. + + + This file is not a valid image. + L'arxiu no és una imatge vàlida. + + + This is not a valid IP address. + Això no és una adreça IP vàlida. + + + This value is not a valid language. + Aquest valor no és un idioma vàlid. + + + This value is not a valid locale. + Aquest valor no és una localització vàlida. + + + This value is not a valid country. + Aquest valor no és un país vàlid. + + + This value is already used. + Aquest valor ja s'ha utilitzat. + + + The size of the image could not be detected. + No s'ha pogut determinar la grandària de la imatge. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + L'amplària de la imatge és massa gran ({{ width }}px). L'amplària màxima permesa són {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + L'amplària de la imatge és massa petita ({{ width }}px). L'amplària mínima requerida són {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + L'altura de la imatge és massa gran ({{ height }}px). L'altura màxima permesa són {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + L'altura de la imatge és massa petita ({{ height }}px). L'altura mínima requerida són {{ min_height }}px. + + + This value should be the user's current password. + Aquest valor hauria de ser la contrasenya actual de l'usuari. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Aquest valor hauria de tenir exactament {{ limit }} caràcter.|Aquest valor hauria de tenir exactament {{ limit }} caràcters. + + + The file was only partially uploaded. + L'arxiu va ser només pujat parcialment. + + + No file was uploaded. + Cap arxiu va ser pujat. + + + No temporary folder was configured in php.ini. + Cap carpeta temporal va ser configurada en php.ini. + + + Cannot write temporary file to disk. + No es va poder escriure l'arxiu temporal en el disc. + + + A PHP extension caused the upload to fail. + Una extensió de PHP va fer que la pujada fallara. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Aquesta col·lecció ha de contenir {{ limit }} element o més.|Aquesta col·lecció ha de contenir {{ limit }} elements o més. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Aquesta col·lecció ha de contenir {{ limit }} element o menys.|Aquesta col·lecció ha de contenir {{ limit }} elements o menys. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Aquesta col·lecció ha de contenir exactament {{ limit }} element.|Aquesta col·lecció ha de contenir exactament {{ limit }} elements. + + + Invalid card number. + Número de targeta invàlid. + + + Unsupported card type or invalid card number. + Tipus de targeta no suportada o número de targeta invàlid. + + + This is not a valid International Bank Account Number (IBAN). + Això no és un nombre de compte bancari internacional (IBAN) vàlid. + + + This value is not a valid ISBN-10. + Aquest valor no és un ISBN-10 vàlid. + + + This value is not a valid ISBN-13. + Aquest valor no és un ISBN-13 vàlid. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Aquest valor no és ni un ISBN-10 vàlid ni un ISBN-13 vàlid. + + + This value is not a valid ISSN. + Aquest valor no és un ISSN vàlid. + + + This value is not a valid currency. + Aquest valor no és una divisa vàlida. + + + This value should be equal to {{ compared_value }}. + Aquest valor hauria de ser igual a {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Aquest valor hauria de ser més gran a {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Aquest valor hauria de ser major o igual a {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Aquest valor hauria de ser idèntic a {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Aquest valor hauria de ser menor a {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Aquest valor hauria de ser menor o igual a {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Aquest valor no hauria de ser igual a {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Aquest valor no hauria de idèntic a {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + La proporció de l'imatge és massa gran ({{ ratio }}). La màxima proporció permesa és {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + La proporció de l'imatge és massa petita ({{ ratio }}). La mínima proporció permesa és {{ max_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + L'imatge és quadrada({{ width }}x{{ height }}px). Les imatges quadrades no estan permeses. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + L'imatge està orientada horitzontalment ({{ width }}x{{ height }}px). Les imatges orientades horitzontalment no estan permeses. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + L'imatge està orientada verticalment ({{ width }}x{{ height }}px). Les imatges orientades verticalment no estan permeses. + + + An empty file is not allowed. + No està permès un fixter buit. + + + The host could not be resolved. + No s'ha pogut resoldre l'amfitrió. + + + This value does not match the expected {{ charset }} charset. + Aquest valor no coincideix amb l'esperat {{ charset }} joc de caràcters. + + + This is not a valid Business Identifier Code (BIC). + Aquest no és un codi d'identificació bancari (BIC) vàlid. + + + Error + Error + + + This is not a valid UUID. + Aquest valor no és un UUID vàlid. + + + This value should be a multiple of {{ compared_value }}. + Aquest valor ha de ser múltiple de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Aquest Codi d'identificació bancari (BIC) no està associat amb l'IBAN {{ iban }}. + + + This value should be valid JSON. + Aquest valor hauria de ser un JSON vàlid. + + + This collection should contain only unique elements. + Aquesta col·lecció només hauria de contenir elements únics. + + + This value should be positive. + Aquest valor hauria de ser positiu. + + + This value should be either positive or zero. + Aquest valor ha de ser positiu o zero. + + + This value should be negative. + Aquest valor ha de ser negatiu. + + + This value should be either negative or zero. + Aquest valor ha de ser negatiu o zero. + + + This value is not a valid timezone. + Aquest valor no és una zona horària vàlida. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Aquesta contrasenya s'ha filtrat en cas de violació de dades, no s'ha d'utilitzar. Utilitzeu una altra contrasenya. + + + This value should be between {{ min }} and {{ max }}. + Aquest valor ha d'estar entre {{ min }} i {{ max }}. + + + This value is not a valid hostname. + Aquest valor no és un nom d'amfitrió vàlid. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + El nombre d'elements d'aquesta col·lecció ha de ser múltiple de {{compared_value}}. + + + This value should satisfy at least one of the following constraints: + Aquest valor ha de satisfer almenys una de les restriccions següents: + + + Each element of this collection should satisfy its own set of constraints. + Cada element d'aquesta col·lecció hauria de satisfer el seu propi conjunt de restriccions. + + + This value is not a valid International Securities Identification Number (ISIN). + Aquest valor no és un número d'identificació de valors internacionals (ISIN) vàlid. + + + This value should be a valid expression. + Aquest valor hauria de ser una expressió vàlida. + + + This value is not a valid CSS color. + Aquest valor no és un color CSS vàlid. + + + This value is not a valid CIDR notation. + Aquest valor no és una notació CIDR vàlida. + + + The value of the netmask should be between {{ min }} and {{ max }}. + El valor de la màscara de xarxa hauria d'estar entre {{ min }} i {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf new file mode 100644 index 00000000000..75410192190 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Tato hodnota musí být nepravdivá (false). + + + This value should be true. + Tato hodnota musí být pravdivá (true). + + + This value should be of type {{ type }}. + Tato hodnota musí být typu {{ type }}. + + + This value should be blank. + Tato hodnota musí být prázdná. + + + The value you selected is not a valid choice. + Vybraná hodnota není platnou možností. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Musí být vybrána nejménÄ› {{ limit }} možnost.|Musí být vybrány nejménÄ› {{ limit }} možnosti.|Musí být vybráno nejménÄ› {{ limit }} možností. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Musí být vybrána maximálnÄ› {{ limit }} možnost.|Musí být vybrány maximálnÄ› {{ limit }} možnosti.|Musí být vybráno maximálnÄ› {{ limit }} možností. + + + One or more of the given values is invalid. + NÄ›které z uvedených hodnot jsou neplatné. + + + This field was not expected. + Toto pole nebylo oÄekáváno. + + + This field is missing. + Toto pole chybí. + + + This value is not a valid date. + Tato hodnota není platné datum. + + + This value is not a valid datetime. + Tato hodnota není platné datum s Äasovým údajem. + + + This value is not a valid email address. + Tato hodnota není platná e-mailová adresa. + + + The file could not be found. + Soubor nebyl nalezen. + + + The file is not readable. + Soubor je neÄitelný. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Soubor je příliÅ¡ velký ({{ size }} {{ suffix }}). Maximální povolená velikost souboru je {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Neplatný mime typ souboru ({{ type }}). Povolené mime typy souborů jsou {{ types }}. + + + This value should be {{ limit }} or less. + Tato hodnota musí být {{ limit }} nebo ménÄ›. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Tato hodnota je příliÅ¡ dlouhá. Musí obsahovat maximálnÄ› {{ limit }} znak.|Tato hodnota je příliÅ¡ dlouhá. Musí obsahovat maximálnÄ› {{ limit }} znaky.|Tato hodnota je příliÅ¡ dlouhá. Musí obsahovat maximálnÄ› {{ limit }} znaků. + + + This value should be {{ limit }} or more. + Tato hodnota musí být {{ limit }} nebo více. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Tato hodnota je příliÅ¡ krátká. Musí obsahovat minimálnÄ› {{ limit }} znak.|Tato hodnota je příliÅ¡ krátká. Musí obsahovat minimálnÄ› {{ limit }} znaky.|Tato hodnota je příliÅ¡ krátká. Musí obsahovat minimálnÄ› {{ limit }} znaků. + + + This value should not be blank. + Tato hodnota nesmí být prázdná. + + + This value should not be null. + Tato hodnota nesmí být null. + + + This value should be null. + Tato hodnota musí být null. + + + This value is not valid. + Tato hodnota není platná. + + + This value is not a valid time. + Tato hodnota není platný Äasový údaj. + + + This value is not a valid URL. + Tato hodnota není platná URL adresa. + + + The two values should be equal. + Tyto dvÄ› hodnoty musí být stejné. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Soubor je příliÅ¡ velký. Maximální povolená velikost souboru je {{ limit }} {{ suffix }}. + + + The file is too large. + Soubor je příliÅ¡ velký. + + + The file could not be uploaded. + Soubor se nepodaÅ™ilo nahrát. + + + This value should be a valid number. + Tato hodnota musí být Äíslo. + + + This file is not a valid image. + Tento soubor není obrázek. + + + This is not a valid IP address. + Toto není platná IP adresa. + + + This value is not a valid language. + Tento jazyk neexistuje. + + + This value is not a valid locale. + Tato lokalizace neexistuje. + + + This value is not a valid country. + Tato zemÄ› neexistuje. + + + This value is already used. + Tato hodnota je již používána. + + + The size of the image could not be detected. + NepodaÅ™ily se zjistit rozmÄ›ry obrázku. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Obrázek je příliÅ¡ Å¡iroký ({{ width }}px). Maximální povolená šířka obrázku je {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Obrázek je příliÅ¡ úzký ({{ width }}px). Minimální šířka musí být {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Obrázek je příliÅ¡ vysoký ({{ height }}px). Maximální povolená výška obrázku je {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Obrázek je příliÅ¡ nízký ({{ height }}px). Minimální výška obrázku musí být {{ min_height }}px. + + + This value should be the user's current password. + Tato hodnota musí být aktuální heslo uživatele. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Tato hodnota musí mít pÅ™esnÄ› {{ limit }} znak.|Tato hodnota musí mít pÅ™esnÄ› {{ limit }} znaky.|Tato hodnota musí mít pÅ™esnÄ› {{ limit }} znaků. + + + The file was only partially uploaded. + Byla nahrána jen Äást souboru. + + + No file was uploaded. + Žádný soubor nebyl nahrán. + + + No temporary folder was configured in php.ini. + V php.ini není nastavena cesta k adresáři pro doÄasné soubory. + + + Cannot write temporary file to disk. + DoÄasný soubor se nepodaÅ™ilo zapsat na disk. + + + A PHP extension caused the upload to fail. + Rozšíření PHP zabránilo nahrání souboru. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Tato kolekce musí obsahovat minimálnÄ› {{ limit }} prvek.|Tato kolekce musí obsahovat minimálnÄ› {{ limit }} prvky.|Tato kolekce musí obsahovat minimálnÄ› {{ limit }} prvků. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Tato kolekce musí obsahovat maximálnÄ› {{ limit }} prvek.|Tato kolekce musí obsahovat maximálnÄ› {{ limit }} prvky.|Tato kolekce musí obsahovat maximálnÄ› {{ limit }} prvků. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Tato kolekce musí obsahovat pÅ™esnÄ› {{ limit }} prvek.|Tato kolekce musí obsahovat pÅ™esnÄ› {{ limit }} prvky.|Tato kolekce musí obsahovat pÅ™esnÄ› {{ limit }} prvků. + + + Invalid card number. + Neplatné Äíslo karty. + + + Unsupported card type or invalid card number. + Nepodporovaný typ karty nebo neplatné Äíslo karty. + + + This is not a valid International Bank Account Number (IBAN). + Toto je neplatný IBAN. + + + This value is not a valid ISBN-10. + Tato hodnota není platné ISBN-10. + + + This value is not a valid ISBN-13. + Tato hodnota není platné ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Tato hodnota není platné ISBN-10 ani ISBN-13. + + + This value is not a valid ISSN. + Tato hodnota není platné ISSN. + + + This value is not a valid currency. + Tato mÄ›na neexistuje. + + + This value should be equal to {{ compared_value }}. + Tato hodnota musí být rovna {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Tato hodnota musí být vÄ›tší než {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Tato hodnota musí být vÄ›tší nebo rovna {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Tato hodnota musí být typu {{ compared_value_type }} a zároveň musí být rovna {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Tato hodnota musí být menší než {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Tato hodnota musí být menší nebo rovna {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Tato hodnota nesmí být rovna {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Tato hodnota nesmí být typu {{ compared_value_type }} a zároveň nesmí být rovna {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + PomÄ›r stran obrázku je příliÅ¡ velký ({{ ratio }}). Maximální povolený pomÄ›r stran obrázku je {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + PomÄ›r stran obrázku je příliÅ¡ malý ({{ ratio }}). Minimální povolený pomÄ›r stran obrázku je {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Strany obrázku jsou Ätvercové ({{ width }}x{{ height }}px). ÄŒtvercové obrázky nejsou povolené. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Obrázek je orientovaný na šířku ({{ width }}x{{ height }}px). Obrázky orientované na šířku nejsou povolené. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Obrázek je orientovaný na výšku ({{ width }}x{{ height }}px). Obrázky orientované na výšku nejsou povolené. + + + An empty file is not allowed. + Soubor nesmí být prázdný. + + + The host could not be resolved. + Hostitele nebylo možné rozpoznat. + + + This value does not match the expected {{ charset }} charset. + Tato hodnota neodpovídá oÄekávané znakové sadÄ› {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Tato hodnota není platný identifikaÄní kód podniku (BIC). + + + Error + Chyba + + + This is not a valid UUID. + Tato hodnota není platné UUID. + + + This value should be a multiple of {{ compared_value }}. + Tato hodnota musí být násobek hodnoty {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Bankovní identifikaÄní kód (BIC) neodpovídá mezinárodnímu Äíslu úÄtu (IBAN) {{ iban }}. + + + This value should be valid JSON. + Tato hodnota musí být validní JSON. + + + This collection should contain only unique elements. + Tato kolekce musí obsahovat pouze unikátní prvky. + + + This value should be positive. + Tato hodnota musí být kladná. + + + This value should be either positive or zero. + Tato hodnota musí být buÄ kladná nebo nula. + + + This value should be negative. + Tato hodnota musí být záporná. + + + This value should be either negative or zero. + Tato hodnota musí být buÄ záporná nebo nula. + + + This value is not a valid timezone. + Tato Äasová zóna neexistuje. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Zadané heslo bylo souÄástí úniku dat, takže ho není možné použít. Použijte prosím jiné heslo. + + + This value should be between {{ min }} and {{ max }}. + Hodnota musí být mezi {{ min }} a {{ max }}. + + + This value is not a valid hostname. + Tato hodnota není platný hostname. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + PoÄet prvků v této kolekci musí být násobek {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Tato hodnota musí splňovat alespoň jedno z následujících omezení: + + + Each element of this collection should satisfy its own set of constraints. + Každý prvek v této kolekci musí splňovat svá vlastní omezení. + + + This value is not a valid International Securities Identification Number (ISIN). + Tato hodnota není platné mezinárodní identifikaÄní Äíslo cenného papíru (ISIN). + + + This value should be a valid expression. + Tato hodnota musí být platný výraz. + + + This value is not a valid CSS color. + Tato hodnota není platná barva CSS. + + + This value is not a valid CIDR notation. + Tato hodnota není platná notace CIDR. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Hodnota masky sítÄ› musí být mezi {{ min }} a {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf new file mode 100644 index 00000000000..752b6c2ae51 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf @@ -0,0 +1,335 @@ + + + + + + This value should be false. + Dylid bod y gwerth hwn yn ffug. + + + This value should be true. + Dylid bod y gwerth hwn yn wir. + + + This value should be of type {{ type }}. + Dylid bod y gwerth hwn bod o fath {{ type }}. + + + This value should be blank. + Dylid bod y gwerth hwn yn wag. + + + The value you selected is not a valid choice. + Nid yw'r gwerth â ddewiswyd yn ddilys. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Rhaid dewis o leiaf {{ limit }} opsiwn. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Rhaid dewis dim mwy na {{ limit }} opsiwn. + + + One or more of the given values is invalid. + Mae un neu fwy o'r gwerthoedd a roddwyd yn annilys. + + + This field was not expected. + Nid oedd disgwyl y maes hwn. + + + This field is missing. + Mae'r maes hwn ar goll. + + + This value is not a valid date. + Nid yw'r gwerth yn ddyddiad dilys. + + + This value is not a valid datetime. + Nid yw'r gwerth yn datetime dilys. + + + This value is not a valid email address. + Nid yw'r gwerth yn gyfeiriad ebost dilys. + + + The file could not be found. + Ni ddarganfyddwyd y ffeil. + + + The file is not readable. + Ni ellir darllen y ffeil. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Mae'r ffeil yn rhy fawr ({{ size }} {{ suffix }}). Yr uchafswm â ganiateir yw {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Nid yw math mime y ffeil yn ddilys ({{ type }}). Dyma'r mathau â ganiateir {{ types }}. + + + This value should be {{ limit }} or less. + Dylai'r gwerth hwn fod yn {{ limit }} neu lai. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Mae'r gwerth hwn rhy hir. Dylai gynnwys {{ limit }} nodyn cyfrifiadurol neu lai. + + + This value should be {{ limit }} or more. + Dylai'r gwerth hwn fod yn {{ limit }} neu fwy. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Mae'r gwerth hwn yn rhy fyr. Dylai gynnwys {{ limit }} nodyn cyfrifiadurol neu fwy. + + + This value should not be blank. + Ni ddylai'r gwerth hwn fod yn wag. + + + This value should not be null. + Ni ddylai'r gwerth hwn fod yn null. + + + This value should be null. + Dylai'r gwerth fod yn null. + + + This value is not valid. + Nid yw'r gwerth hwn yn ddilys. + + + This value is not a valid time. + Nid yw'r gwerth hwn yn amser dilys. + + + This value is not a valid URL. + Nid yw'r gwerth hwn yn URL dilys. + + + The two values should be equal. + Rhaid i'r ddau werth fod yn gyfystyr a'u gilydd. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Mae'r ffeil yn rhy fawr. Yr uchafswm â ganiateir yw {{ limit }} {{ suffix }}. + + + The file is too large. + Mae'r ffeil yn rhy fawr. + + + The file could not be uploaded. + Methwyd ag uwchlwytho'r ffeil. + + + This value should be a valid number. + Dylai'r gwerth hwn fod yn rif dilys. + + + This file is not a valid image. + Nid yw'r ffeil hon yn ddelwedd dilys. + + + This is not a valid IP address. + Nid yw hwn yn gyfeiriad IP dilys. + + + This value is not a valid language. + Nid yw'r gwerth hwn yn iaith ddilys. + + + This value is not a valid locale. + Nid yw'r gwerth hwn yn locale dilys. + + + This value is not a valid country. + Nid yw'r gwerth hwn yn wlad dilys. + + + This value is already used. + Mae'r gwerth hwn eisoes yn cael ei ddefnyddio. + + + The size of the image could not be detected. + Methwyd â darganfod maint y ddelwedd. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Mae lled y ddelwedd yn rhy fawr ({{ width }}px). Y lled mwyaf â ganiateir yw {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Mae lled y ddelwedd yn rhy fach ({{ width }}px). Y lled lleiaf â ganiateir yw {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Mae uchder y ddelwedd yn rhy fawr ({{ width }}px). Yr uchder mwyaf â ganiateir yw {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Mae uchder y ddelwedd yn rhy fach ({{ width }}px). Yr uchder lleiaf â ganiateir yw {{ min_height }}px. + + + This value should be the user's current password. + Dylaid bod y gwerth hwn yn gyfrinair presenol y defnyddiwr. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Dylai'r gwerth hwn fod yn union {{ limit }} nodyn cyfrifiadurol o hyd. + + + The file was only partially uploaded. + Dim ond rhan o'r ffeil ag uwchlwythwyd. + + + No file was uploaded. + Ni uwchlwythwyd unrhyw ffeil. + + + No temporary folder was configured in php.ini. + Nid oes ffolder dros-dro wedi'i gosod yn php.ini. + + + Cannot write temporary file to disk. + Methwyd ag ysgrifennu'r ffeil dros-dro ar ddisg. + + + A PHP extension caused the upload to fail. + Methwyd ag uwchlwytho oherwydd ategyn PHP. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Dylai'r casgliad hwn gynnwys {{ limit }} elfen neu fwy. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Dylai'r casgliad hwn gynnwys {{ limit }} elfen neu lai. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Dylai'r casgliad hwn gynnwys union {{ limit }} elfen. + + + Invalid card number. + Nid oedd rhif y cerdyn yn ddilys. + + + Unsupported card type or invalid card number. + Unai ni dderbynir y math yna o gerdyn, neu nid yw rhif y cerdyn yn ddilys. + + + This is not a valid International Bank Account Number (IBAN). + Nid yw hwn yn Rhif Cyfrif Banc Rhyngwladol (IBAN) dilys. + + + This value is not a valid ISBN-10. + Nid yw'r gwerth hwn yn ISBN-10 dilys. + + + This value is not a valid ISBN-13. + Nid yw'r gwerth hwn yn ISBN-13 dilys. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Nid yw'r gwerth hwn yn Rhif ISBN-10 dilys nac yn ISBN-13 dilys. + + + This value is not a valid ISSN. + Nid yw'r gwerth hwn yn ISSN dilys. + + + This value is not a valid currency. + Nid yw'r gwerth hwn yn arian dilys. + + + This value should be equal to {{ compared_value }}. + Dylai'r gwerth hwn fod yn gyfartal â {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Dylai'r gwerth hwn fod yn fwy na {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Dylai'r gwerth hwn fod yn fwy na neu'n hafal i {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Dylai'r gwerth hwn fod yn union yr un fath â {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Dylai'r gwerth hwn fod yn llai na {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Dylai'r gwerth hwn fod yn llai na neu'n hafal i {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ni ddylai'r gwerth hwn fod yn hafal i {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ni ddylai'r gwerth hwn fod yn union yr un fath â {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Mae'r gymhareb delwedd yn rhy fawr ({{ ratio }}). Y gymhareb uchaf a ganiateir yw {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Mae'r gymhareb delwedd yn rhy fach ({{ ratio }}). Y gymhareb isaf a ddisgwylir yw {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Mae'r ddelwedd yn sgwâr ({{ width }}x{{ height }}px). Ni chaniateir delweddau sgwâr. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Mae'r ddelwedd mewn fformat tirlun ({{ width }}x{{ height }}px). Ni chaniateir delweddau mewn fformat tirlun. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Mae'r ddelwedd mewn fformat portread ({{ width }}x{{ height }}px). Ni chaniateir delweddau mewn fformat portread. + + + An empty file is not allowed. + Ni chaniateir ffeil wag. + + + The host could not be resolved. + Ni fu modd datrys y gwesteiwr. + + + This value does not match the expected {{ charset }} charset. + Nid yw'r gwerth hwn yn cyfateb â'r {{ charset }} set nodau ddisgwyliedig. + + + This is not a valid Business Identifier Code (BIC). + Nid yw hwn yn God Adnabod Busnes (BIC) dilys. + + + Error + Gwall + + + This is not a valid UUID. + Nid yw hyn yn UUID dilys. + + + This value should be a multiple of {{ compared_value }}. + Dylai'r gwerth hwn fod yn luosrif o {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Nid yw'r Cod Adnabod Busnes (BIC) hwn yn gysylltiedig ag IBAN {{ iban }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf new file mode 100644 index 00000000000..b76624e7934 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Værdien skal være falsk. + + + This value should be true. + Værdien skal være sand. + + + This value should be of type {{ type }}. + Værdien skal være af typen {{ type }}. + + + This value should be blank. + Værdien skal være blank. + + + The value you selected is not a valid choice. + Den valgte værdi er ikke gyldig. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Du skal vælge mindst én mulighed.|Du skal vælge mindst {{ limit }} muligheder. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Du kan højst vælge én mulighed.|Du kan højst vælge {{ limit }} muligheder. + + + One or more of the given values is invalid. + En eller flere af de angivne værdier er ugyldige. + + + This field was not expected. + Feltet blev ikke forventet. + + + This field is missing. + Dette felt mangler. + + + This value is not a valid date. + Værdien er ikke en gyldig dato. + + + This value is not a valid datetime. + Værdien er ikke et gyldigt tidspunkt. + + + This value is not a valid email address. + Værdien er ikke en gyldig e-mailadresse. + + + The file could not be found. + Filen kunne ikke findes. + + + The file is not readable. + Filen kan ikke læses. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Filen er for stor ({{ size }} {{ suffix }}). Maksimale tilladte størrelse er {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Filens MIME-type er ugyldig ({{ type }}). Tilladte MIME-typer er {{ types }}. + + + This value should be {{ limit }} or less. + Værdien skal være {{ limit }} eller mindre. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Værdien er for lang. Den mÃ¥ højst indeholde {{ limit }} tegn. + + + This value should be {{ limit }} or more. + Værdien skal være {{ limit }} eller mere. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Værdien er for kort. Den skal indeholde mindst {{ limit }} tegn. + + + This value should not be blank. + Værdien mÃ¥ ikke være blank. + + + This value should not be null. + Værdien mÃ¥ ikke være tom (null). + + + This value should be null. + Værdien skal være tom (null). + + + This value is not valid. + Værdien er ikke gyldig. + + + This value is not a valid time. + Værdien er ikke et gyldigt klokkeslæt. + + + This value is not a valid URL. + Værdien er ikke en gyldig URL. + + + The two values should be equal. + De to værdier skal være ens. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Filen er for stor. Den maksimale størrelse er {{ limit }} {{ suffix }}. + + + The file is too large. + Filen er for stor. + + + The file could not be uploaded. + Filen kunne ikke uploades. + + + This value should be a valid number. + Værdien skal være et gyldigt tal. + + + This file is not a valid image. + Filen er ikke gyldigt billede. + + + This is not a valid IP address. + Dette er ikke en gyldig IP-adresse. + + + This value is not a valid language. + Værdien er ikke et gyldigt sprog. + + + This value is not a valid locale. + Værdien er ikke en gyldig lokalitet. + + + This value is not a valid country. + Værdien er ikke et gyldigt land. + + + This value is already used. + Værdien er allerede i brug. + + + The size of the image could not be detected. + Størrelsen pÃ¥ billedet kunne ikke detekteres. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Billedet er for bredt ({{ width }}px). Største tilladte bredde er {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Billedet er for smalt ({{ width }}px). Mindste forventede bredde er {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Billedet er for højt ({{ height }}px). Største tilladte højde er {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Billedet er for lavt ({{ height }}px). Mindste forventede højde er {{ min_height }}px. + + + This value should be the user's current password. + Værdien skal være brugerens nuværende adgangskode. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Værdien skal være pÃ¥ præcis {{ limit }} tegn. + + + The file was only partially uploaded. + Filen blev kun delvist uploadet. + + + No file was uploaded. + Ingen fil blev uploadet. + + + No temporary folder was configured in php.ini. + Ingen midlertidig mappe er konfigureret i php.ini. + + + Cannot write temporary file to disk. + Kan ikke skrive midlertidig fil til disk. + + + A PHP extension caused the upload to fail. + En PHP-udvidelse forÃ¥rsagede fejl i upload. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Denne samling skal indeholde mindst ét element.|Denne samling skal indeholde mindst {{ limit }} elementer. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Denne samling skal indeholde højst ét element.|Denne samling skal indeholde højst {{ limit }} elementer. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Denne samling skal indeholde præcis ét element.|Denne samling skal indeholde præcis {{ limit }} elementer. + + + Invalid card number. + Ugyldigt kortnummer. + + + Unsupported card type or invalid card number. + Ikke-understøttet korttype eller ugyldigt kortnummer. + + + This is not a valid International Bank Account Number (IBAN). + Det er ikke et gyldigt International Bank Account Number (IBAN). + + + This value is not a valid ISBN-10. + Værdien er ikke en gyldig ISBN-10. + + + This value is not a valid ISBN-13. + Værdien er ikke en gyldig ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Værdien er hverken en gyldig ISBN-10 eller en gyldig ISBN-13. + + + This value is not a valid ISSN. + Værdien er ikke en gyldig ISSN. + + + This value is not a valid currency. + Denne værdi er ikke en gyldig valuta. + + + This value should be equal to {{ compared_value }}. + Denne værdi skal være lig med {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Denne værdi skal være større end {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Denne værdi skal være større end eller lig med {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Denne værdi skal være identisk med {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Denne værdi skal være mindre end {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Denne værdi skal være mindre end eller lig med {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Denne værdi bør ikke være lig med {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Denne værdi bør ikke være identisk med {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Billedforholdet er for stort ({{ratio}}). Tilladt maksimumsforhold er {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Billedforholdet er for lille ({{ ratio }}). Minimumsforventet forventet er {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Billedet er firkantet ({{ width }} x {{ height }} px). Firkantede billeder er ikke tilladt. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Billedet er landskabsorienteret ({{width}} x {{height}} px). Landskabsorienterede billeder er ikke tilladt + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Billedet er portrætorienteret ({{ width }}x{{ height }}px). Portrætorienterede billeder er ikke tilladt. + + + An empty file is not allowed. + En tom fil er ikke tilladt. + + + The host could not be resolved. + Værten kunne ikke løses. + + + This value does not match the expected {{ charset }} charset. + Denne værdi stemmer ikke overens med den forventede {{ charset }} charset. + + + This is not a valid Business Identifier Code (BIC). + Dette er ikke en gyldig Business Identifier Code (BIC).a + + + Error + Fejl + + + This is not a valid UUID. + Dette er ikke en gyldig UUID. + + + This value should be a multiple of {{ compared_value }}. + Denne værdi skal være et multiplikation af {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Denne Business Identifier Code (BIC) er ikke forbundet med IBAN {{ iban }}. + + + This value should be valid JSON. + Denne værdi skal være gyldig JSON. + + + This collection should contain only unique elements. + Denne samling bør kun indeholde unikke elementer. + + + This value should be positive. + Denne værdi skal være positiv. + + + This value should be either positive or zero. + Denne værdi skal være enten positiv eller nul. + + + This value should be negative. + Denne værdi skal være negativ. + + + This value should be either negative or zero. + Denne værdi skal være enten negativ eller nul. + + + This value is not a valid timezone. + Denne værdi er ikke en gyldig tidszone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Denne adgangskode er blevet lækket i et databrud, det mÃ¥ ikke bruges. Brug venligst en anden adgangskode. + + + This value should be between {{ min }} and {{ max }}. + Værdien skal være mellem {{ min }} og {{ max }}. + + + This value is not a valid hostname. + Værdien er ikke et gyldigt værtsnavn. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Antallet af elementer i denne samling skal være en multiplikation af {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Værdien skal overholde mindst én af følgende krav: + + + Each element of this collection should satisfy its own set of constraints. + Hvert element i denne samling skal overholde dens egne krav. + + + This value is not a valid International Securities Identification Number (ISIN). + Værdien er ikke et gyldig International Securities Identification Number (ISIN). + + + This value should be a valid expression. + Værdien skal være et gyldigt udtryk. + + + This value is not a valid CSS color. + Værdien skal være en gyldig CSS farve. + + + This value is not a valid CIDR notation. + Værdien er ikke en gyldig CIDR notation. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Værdien af netmasken skal være mellem {{ min }} og {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf new file mode 100644 index 00000000000..00be24fb8ac --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Dieser Wert sollte false sein. + + + This value should be true. + Dieser Wert sollte true sein. + + + This value should be of type {{ type }}. + Dieser Wert sollte vom Typ {{ type }} sein. + + + This value should be blank. + Dieser Wert sollte leer sein. + + + The value you selected is not a valid choice. + Sie haben einen ungültigen Wert ausgewählt. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Sie müssen mindestens {{ limit }} Möglichkeit wählen.|Sie müssen mindestens {{ limit }} Möglichkeiten wählen. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Sie dürfen höchstens {{ limit }} Möglichkeit wählen.|Sie dürfen höchstens {{ limit }} Möglichkeiten wählen. + + + One or more of the given values is invalid. + Einer oder mehrere der angegebenen Werte sind ungültig. + + + This field was not expected. + Dieses Feld wurde nicht erwartet. + + + This field is missing. + Dieses Feld fehlt. + + + This value is not a valid date. + Dieser Wert entspricht keiner gültigen Datumsangabe. + + + This value is not a valid datetime. + Dieser Wert entspricht keiner gültigen Datums- und Zeitangabe. + + + This value is not a valid email address. + Dieser Wert ist keine gültige E-Mail-Adresse. + + + The file could not be found. + Die Datei wurde nicht gefunden. + + + The file is not readable. + Die Datei ist nicht lesbar. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Die Datei ist zu groß ({{ size }} {{ suffix }}). Die maximal zulässige Größe beträgt {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Der Dateityp ist ungültig ({{ type }}). Erlaubte Dateitypen sind {{ types }}. + + + This value should be {{ limit }} or less. + Dieser Wert sollte kleiner oder gleich {{ limit }} sein. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Diese Zeichenkette ist zu lang. Sie sollte höchstens {{ limit }} Zeichen haben.|Diese Zeichenkette ist zu lang. Sie sollte höchstens {{ limit }} Zeichen haben. + + + This value should be {{ limit }} or more. + Dieser Wert sollte größer oder gleich {{ limit }} sein. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Diese Zeichenkette ist zu kurz. Sie sollte mindestens {{ limit }} Zeichen haben.|Diese Zeichenkette ist zu kurz. Sie sollte mindestens {{ limit }} Zeichen haben. + + + This value should not be blank. + Dieser Wert sollte nicht leer sein. + + + This value should not be null. + Dieser Wert sollte nicht null sein. + + + This value should be null. + Dieser Wert sollte null sein. + + + This value is not valid. + Dieser Wert ist nicht gültig. + + + This value is not a valid time. + Dieser Wert entspricht keiner gültigen Zeitangabe. + + + This value is not a valid URL. + Dieser Wert ist keine gültige URL. + + + The two values should be equal. + Die beiden Werte sollten identisch sein. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Die Datei ist zu groß. Die maximal zulässige Größe beträgt {{ limit }} {{ suffix }}. + + + The file is too large. + Die Datei ist zu groß. + + + The file could not be uploaded. + Die Datei konnte nicht hochgeladen werden. + + + This value should be a valid number. + Dieser Wert sollte eine gültige Zahl sein. + + + This file is not a valid image. + Diese Datei ist kein gültiges Bild. + + + This is not a valid IP address. + Dies ist keine gültige IP-Adresse. + + + This value is not a valid language. + Dieser Wert entspricht keiner gültigen Sprache. + + + This value is not a valid locale. + Dieser Wert entspricht keinem gültigen Gebietsschema. + + + This value is not a valid country. + Dieser Wert entspricht keinem gültigen Land. + + + This value is already used. + Dieser Wert wird bereits verwendet. + + + The size of the image could not be detected. + Die Größe des Bildes konnte nicht ermittelt werden. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Die Bildbreite ist zu groß ({{ width }}px). Die maximal zulässige Breite beträgt {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Die Bildbreite ist zu gering ({{ width }}px). Die erwartete Mindestbreite beträgt {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Die Bildhöhe ist zu groß ({{ height }}px). Die maximal zulässige Höhe beträgt {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Die Bildhöhe ist zu gering ({{ height }}px). Die erwartete Mindesthöhe beträgt {{ min_height }}px. + + + This value should be the user's current password. + Dieser Wert sollte dem aktuellen Benutzerpasswort entsprechen. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Dieser Wert sollte genau {{ limit }} Zeichen lang sein.|Dieser Wert sollte genau {{ limit }} Zeichen lang sein. + + + The file was only partially uploaded. + Die Datei wurde nur teilweise hochgeladen. + + + No file was uploaded. + Es wurde keine Datei hochgeladen. + + + No temporary folder was configured in php.ini. + Es wurde kein temporärer Ordner in der php.ini konfiguriert oder der temporäre Ordner existiert nicht. + + + Cannot write temporary file to disk. + Kann die temporäre Datei nicht speichern. + + + A PHP extension caused the upload to fail. + Eine PHP-Erweiterung verhinderte den Upload. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Diese Sammlung sollte {{ limit }} oder mehr Elemente beinhalten.|Diese Sammlung sollte {{ limit }} oder mehr Elemente beinhalten. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Diese Sammlung sollte {{ limit }} oder weniger Elemente beinhalten.|Diese Sammlung sollte {{ limit }} oder weniger Elemente beinhalten. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Diese Sammlung sollte genau {{ limit }} Element beinhalten.|Diese Sammlung sollte genau {{ limit }} Elemente beinhalten. + + + Invalid card number. + Ungültige Kartennummer. + + + Unsupported card type or invalid card number. + Nicht unterstützer Kartentyp oder ungültige Kartennummer. + + + This is not a valid International Bank Account Number (IBAN). + Dieser Wert ist keine gültige internationale Bankkontonummer (IBAN). + + + This value is not a valid ISBN-10. + Dieser Wert entspricht keiner gültigen ISBN-10. + + + This value is not a valid ISBN-13. + Dieser Wert entspricht keiner gültigen ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Dieser Wert ist weder eine gültige ISBN-10 noch eine gültige ISBN-13. + + + This value is not a valid ISSN. + Dieser Wert ist keine gültige ISSN. + + + This value is not a valid currency. + Dieser Wert ist keine gültige Währung. + + + This value should be equal to {{ compared_value }}. + Dieser Wert sollte gleich {{ compared_value }} sein. + + + This value should be greater than {{ compared_value }}. + Dieser Wert sollte größer als {{ compared_value }} sein. + + + This value should be greater than or equal to {{ compared_value }}. + Dieser Wert sollte größer oder gleich {{ compared_value }} sein. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Dieser Wert sollte identisch sein mit {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Dieser Wert sollte kleiner als {{ compared_value }} sein. + + + This value should be less than or equal to {{ compared_value }}. + Dieser Wert sollte kleiner oder gleich {{ compared_value }} sein. + + + This value should not be equal to {{ compared_value }}. + Dieser Wert sollte nicht {{ compared_value }} sein. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Dieser Wert sollte nicht identisch sein mit {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Das Seitenverhältnis des Bildes ist zu groß ({{ ratio }}). Der erlaubte Maximalwert ist {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Das Seitenverhältnis des Bildes ist zu klein ({{ ratio }}). Der erwartete Minimalwert ist {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Das Bild ist quadratisch ({{ width }}x{{ height }}px). Quadratische Bilder sind nicht erlaubt. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Das Bild ist im Querformat ({{ width }}x{{ height }}px). Bilder im Querformat sind nicht erlaubt. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Das Bild ist im Hochformat ({{ width }}x{{ height }}px). Bilder im Hochformat sind nicht erlaubt. + + + An empty file is not allowed. + Eine leere Datei ist nicht erlaubt. + + + The host could not be resolved. + Der Hostname konnte nicht aufgelöst werden. + + + This value does not match the expected {{ charset }} charset. + Dieser Wert entspricht nicht dem erwarteten Zeichensatz {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Dieser Wert ist kein gültiger BIC. + + + Error + Fehler + + + This is not a valid UUID. + Dies ist keine gültige UUID. + + + This value should be a multiple of {{ compared_value }}. + Dieser Wert sollte ein Vielfaches von {{ compared_value }} sein. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Diese internationale Bankleitzahl (BIC) ist nicht mit der IBAN {{ iban }} assoziiert. + + + This value should be valid JSON. + Dieser Wert sollte gültiges JSON sein. + + + This collection should contain only unique elements. + Diese Sammlung darf keine doppelten Elemente enthalten. + + + This value should be positive. + Diese Zahl sollte positiv sein. + + + This value should be either positive or zero. + Diese Zahl sollte entweder positiv oder 0 sein. + + + This value should be negative. + Diese Zahl sollte negativ sein. + + + This value should be either negative or zero. + Diese Zahl sollte entweder negativ oder 0 sein. + + + This value is not a valid timezone. + Dieser Wert ist keine gültige Zeitzone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Dieses Passwort ist Teil eines Datenlecks, es darf nicht verwendet werden. + + + This value should be between {{ min }} and {{ max }}. + Dieser Wert sollte zwischen {{ min }} und {{ max }} sein. + + + This value is not a valid hostname. + Dieser Wert ist kein gültiger Hostname. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Die Anzahl an Elementen in dieser Sammlung sollte ein Vielfaches von {{ compared_value }} sein. + + + This value should satisfy at least one of the following constraints: + Dieser Wert sollte eine der folgenden Bedingungen erfüllen: + + + Each element of this collection should satisfy its own set of constraints. + Jedes Element dieser Sammlung sollte seine eigene Menge an Bedingungen erfüllen. + + + This value is not a valid International Securities Identification Number (ISIN). + Dieser Wert ist keine gültige Internationale Wertpapierkennnummer (ISIN). + + + This value should be a valid expression. + Dieser Wert sollte eine gültige Expression sein. + + + This value is not a valid CSS color. + Dieser Wert ist keine gültige CSS-Farbe. + + + This value is not a valid CIDR notation. + Dieser Wert entspricht nicht der CIDR-Notation. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Der Wert der Subnetzmaske sollte zwischen {{ min }} und {{ max }} liegen. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf new file mode 100644 index 00000000000..768986d537b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Αυτή η τιμή Ï€Ïέπει να είναι ψευδής. + + + This value should be true. + Αυτή η τιμή Ï€Ïέπει να είναι αληθής. + + + This value should be of type {{ type }}. + Αυτή η τιμή Ï€Ïέπει να είναι Ï„Ïπου {{ type }}. + + + This value should be blank. + Αυτή η τιμή Ï€Ïέπει να είναι κενή. + + + The value you selected is not a valid choice. + Η τιμή που επιλέχθηκε δεν αντιστοιχεί σε έγκυÏη επιλογή. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + ΠÏέπει να επιλέξτε τουλάχιστον {{ limit }} επιλογή.|ΠÏέπει να επιλέξτε τουλάχιστον {{ limit }} επιλογές. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + ΠÏέπει να επιλέξτε το Ï€Î¿Î»Ï {{ limit }} επιλογή.|ΠÏέπει να επιλέξτε το Ï€Î¿Î»Ï {{ limit }} επιλογές. + + + One or more of the given values is invalid. + Μια ή πεÏισσότεÏες τιμές δεν είναι έγκυÏες. + + + This field was not expected. + Αυτό το πεδίο δεν ήταν αναμενόμενο. + + + This field is missing. + Λείπει αυτό το πεδίο. + + + This value is not a valid date. + Η τιμή δεν αντιστοιχεί σε έγκυÏη ημεÏομηνία. + + + This value is not a valid datetime. + Η τιμή δεν αντιστοιχεί σε έγκυÏη ημεÏομηνία και ÏŽÏα. + + + This value is not a valid email address. + Η τιμή δεν αντιστοιχεί σε έγκυÏο email. + + + The file could not be found. + Το αÏχείο δε μποÏεί να βÏεθεί. + + + The file is not readable. + Το αÏχείο δεν είναι αναγνώσιμο. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Το αÏχείο είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿ ({{ size }} {{ suffix }}). Το μέγιστο επιτÏεπτό μέγεθος είναι {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Ο Ï„Ïπος mime του αÏχείου δεν είναι έγκυÏος ({{ type }}). Οι έγκυÏοι Ï„Ïποι mime είναι {{ types }}. + + + This value should be {{ limit }} or less. + Αυτή η τιμή θα έπÏεπε να είναι {{ limit }} ή λιγότεÏο. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Αυτή η τιμή είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î·. Θα έπÏεπε να έχει {{ limit }} χαÏακτήÏα ή λιγότεÏο.|Αυτή η τιμή είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î·. Θα έπÏεπε να έχει {{ limit }} χαÏακτήÏες ή λιγότεÏο. + + + This value should be {{ limit }} or more. + Αυτή η τιμή θα έπÏεπε να είναι {{ limit }} ή πεÏισσότεÏο. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Αυτή η τιμή είναι Ï€Î¿Î»Ï Î¼Î¹ÎºÏή. Θα έπÏεπε να έχει {{ limit }} χαÏακτήÏα ή πεÏισσότεÏο.|Αυτή η τιμή είναι Ï€Î¿Î»Ï Î¼Î¹ÎºÏή. Θα έπÏεπε να έχει {{ limit }} χαÏακτήÏες ή πεÏισσότεÏο. + + + This value should not be blank. + Αυτή η τιμή δεν Ï€Ïέπει να είναι κενή. + + + This value should not be null. + Αυτή η τιμή δεν Ï€Ïέπει να είναι μηδενική. + + + This value should be null. + Αυτή η τιμή Ï€Ïέπει να είναι μηδενική. + + + This value is not valid. + Αυτή η τιμή δεν είναι έγκυÏη. + + + This value is not a valid time. + Αυτή η τιμή δεν αντιστοιχεί σε έγκυÏη ÏŽÏα. + + + This value is not a valid URL. + Αυτή η τιμή δεν αντιστοιχεί σε έγκυÏο URL. + + + The two values should be equal. + Οι δÏο τιμές θα Ï€Ïέπει να είναι ίδιες. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Το αÏχείο είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿. Το μέγιστο επιτÏεπτό μέγεθος είναι {{ limit }} {{ suffix }}. + + + The file is too large. + Το αÏχείο είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿. + + + The file could not be uploaded. + Το αÏχείο δε μποÏεί να ανέβει. + + + This value should be a valid number. + Αυτή η τιμή θα Ï€Ïέπει να είναι ένας έγκυÏος αÏιθμός. + + + This file is not a valid image. + Το αÏχείο δεν αποτελεί έγκυÏη εικόνα. + + + This is not a valid IP address. + Αυτό δεν είναι μια έγκυÏη διεÏθυνση IP. + + + This value is not a valid language. + Αυτή η τιμή δεν αντιστοιχεί σε μια έγκυÏη γλώσσα. + + + This value is not a valid locale. + Αυτή η τιμή δεν αντιστοιχεί σε έγκυÏο κωδικό τοποθεσίας. + + + This value is not a valid country. + Αυτή η τιμή δεν αντιστοιχεί σε μια έγκυÏη χώÏα. + + + This value is already used. + Αυτή η τιμή χÏησιμοποιείται ήδη. + + + The size of the image could not be detected. + Το μέγεθος της εικόνας δεν ήταν δυνατό να ανιχνευθεί. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Το πλάτος της εικόνας είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿ ({{ width }}px). Το μέγιστο επιτÏεπτό πλάτος είναι {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Το πλάτος της εικόνας είναι Ï€Î¿Î»Ï Î¼Î¹ÎºÏÏŒ ({{ width }}px). Το ελάχιστο επιτÏεπτό πλάτος είναι {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Το Ïψος της εικόνας είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î¿ ({{ height }}px). Το μέγιστο επιτÏεπτό Ïψος είναι {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Το Ïψος της εικόνας είναι Ï€Î¿Î»Ï Î¼Î¹ÎºÏÏŒ ({{ height }}px). Το ελάχιστο επιτÏεπτό Ïψος είναι {{ min_height }}px. + + + This value should be the user's current password. + Αυτή η τιμή θα έπÏεπε να είναι ο Ï„Ïέχων κωδικός. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Αυτή η τιμή θα έπÏεπε να έχει ακÏιβώς {{ limit }} χαÏακτήÏα.|Αυτή η τιμή θα έπÏεπε να έχει ακÏιβώς {{ limit }} χαÏακτήÏες. + + + The file was only partially uploaded. + Το αÏχείο δεν ανέβηκε ολόκληÏο. + + + No file was uploaded. + Δεν ανέβηκε κανένα αÏχείο. + + + No temporary folder was configured in php.ini. + Κανένας Ï€ÏοσωÏινός φάκελος δεν έχει Ïυθμιστεί στο php.ini. + + + Cannot write temporary file to disk. + Αδυναμία εγγÏαφής Ï€ÏοσωÏÎ¹Î½Î¿Ï Î±Ïχείου στο δίσκο. + + + A PHP extension caused the upload to fail. + Μια επέκταση PHP Ï€Ïοκάλεσε αδυναμία ανεβάσματος. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει {{ limit }} στοιχείο ή πεÏισσότεÏα.|Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει {{ limit }} στοιχεία ή πεÏισσότεÏα. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει {{ limit }} στοιχείo ή λιγότεÏα.|Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει {{ limit }} στοιχεία ή λιγότεÏα. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει ακÏιβώς {{ limit }} στοιχείo.|Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει ακÏιβώς {{ limit }} στοιχεία. + + + Invalid card number. + Μη έγκυÏος αÏιθμός κάÏτας. + + + Unsupported card type or invalid card number. + Μη υποστηÏιζόμενος Ï„Ïπος κάÏτας ή μη έγκυÏος αÏιθμός κάÏτας. + + + This is not a valid International Bank Account Number (IBAN). + Αυτό δεν αντιστοιχεί σε έγκυÏο διεθνή αÏιθμό Ï„ÏÎ±Ï€ÎµÎ¶Î¹ÎºÎ¿Ï Î»Î¿Î³Î±ÏÎ¹Î±ÏƒÎ¼Î¿Ï (IBAN). + + + This value is not a valid ISBN-10. + Αυτό δεν είναι έγκυÏος κωδικός ISBN-10. + + + This value is not a valid ISBN-13. + Αυτό δεν είναι έγκυÏος κωδικός ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Αυτό δεν είναι οÏτε έγκυÏος κωδικός ISBN-10 οÏτε έγκυÏος κωδικός ISBN-13. + + + This value is not a valid ISSN. + Αυτό δεν είναι έγκυÏος κωδικός ISSN. + + + This value is not a valid currency. + Αυτό δεν αντιστοιχεί σε έγκυÏο νόμισμα. + + + This value should be equal to {{ compared_value }}. + Αυτή η τιμή θα Ï€Ïέπει να είναι ίση με {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Αυτή η τιμή θα Ï€Ïέπει να είναι μεγαλÏτεÏη από {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Αυτή η τιμή θα Ï€Ïέπει να είναι μεγαλÏτεÏη ή ίση με {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Αυτή η τιμή θα Ï€Ïέπει να είναι πανομοιότυπη με {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Αυτή η τιμή θα Ï€Ïέπει να είναι μικÏότεÏη από {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Αυτή η τιμή θα Ï€Ïέπει να είναι μικÏότεÏη ή ίση με {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Αυτή η τιμή δεν θα Ï€Ïέπει να είναι ίση με {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Αυτή η τιμή δεν Ï€Ïέπει να είναι πανομοιότυπη με {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Η αναλογία πλάτους-Ïψους της εικόνας είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î· ({{ ratio }}). Μέγιστη επιτÏεπτή αναλογία {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Η αναλογία πλάτους-Ïψους της εικόνας είναι Ï€Î¿Î»Ï Î¼Î¹ÎºÏή ({{ ratio }}). Ελάχιστη επιτÏεπτή αναλογία {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Η εικόνα είναι τετÏάγωνη ({{ width }}x{{ height }}px). Δεν επιτÏέπονται τετÏάγωνες εικόνες. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Η εικόνα έχει οÏιζόντιο Ï€Ïοσανατολισμό ({{ width }}x{{ height }}px). Δεν επιτÏέπονται εικόνες με οÏιζόντιο Ï€Ïοσανατολισμό. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Η εικόνα έχει κάθετο Ï€Ïοσανατολισμό ({{ width }}x{{ height }}px). Δεν επιτÏέπονται εικόνες με κάθετο Ï€Ïοσανατολισμό. + + + An empty file is not allowed. + Δεν επιτÏέπεται κενό αÏχείο. + + + The host could not be resolved. + Η διεÏθυνση δεν μπόÏεσε να επιλυθεί. + + + This value does not match the expected {{ charset }} charset. + Αυτή η τιμή δεν ταιÏιάζει στο αναμενόμενο {{ charset }} σÏνολο χαÏακτήÏων. + + + This is not a valid Business Identifier Code (BIC). + Αυτός δεν είναι ένας έγκυÏος κωδικός BIC. + + + Error + Σφάλμα + + + This is not a valid UUID. + Αυτό δεν είναι ένα έγκυÏο UUID. + + + This value should be a multiple of {{ compared_value }}. + Αυτή η τιμή θα έπÏεπε να είναι πολλαπλάσιο του {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Αυτός ο κωδικός BIC δεν σχετίζεται με το IBAN {{ iban }}. + + + This value should be valid JSON. + Αυτή η τιμή θα Ï€Ïέπει να είναι έγκυÏο JSON. + + + This collection should contain only unique elements. + Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει μόνο μοναδικά στοιχεία. + + + This value should be positive. + Αυτή η τιμή θα Ï€Ïέπει να είναι θετική. + + + This value should be either positive or zero. + Αυτή η τιμή θα Ï€Ïέπει να είναι θετική ή μηδενική. + + + This value should be negative. + Αυτή η τιμή θα Ï€Ïέπει να είναι αÏνητική. + + + This value should be either negative or zero. + Αυτή η τιμή θα Ï€Ïέπει να είναι αÏνητική ή μηδενική. + + + This value is not a valid timezone. + Αυτή η τιμή θα δεν είναι έγκυÏη ζώνη ÏŽÏας. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Αυτός ο κωδικός Ï€Ïόσβασης έχει διαÏÏεÏσει σε παÏαβίαση δεδομένων. ΠαÏακαλοÏμε να χÏησιμοποιήσετε έναν άλλο κωδικό. + + + This value should be between {{ min }} and {{ max }}. + Αυτή η τιμή θα Ï€Ïέπει να είναι Î¼ÎµÏ„Î±Î¾Ï {{ min }} και {{ max }}. + + + This value is not a valid hostname. + Αυτή η τιμή δεν είναι έγκυÏο όνομα υποδοχής. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Το νοÏμεÏο των στοιχείων σε αυτή τη συλλογή θα Ï€Ïέπει να είναι πολλαπλάσιο του {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Αυτή η τιμή θα Ï€Ïέπει να ικανοποιεί τουλάχιστον έναν από τους παÏακάτω πεÏιοÏισμοÏÏ‚: + + + Each element of this collection should satisfy its own set of constraints. + Κάθε στοιχείο σε αυτή τη συλλογή θα Ï€Ïέπει να ικανοποιεί το δικό του σÏνολο πεÏιοÏισμών. + + + This value is not a valid International Securities Identification Number (ISIN). + Αυτή η τιμή δεν είναι έγκυÏο International Securities Identification Number (ISIN). + + + This value should be a valid expression. + Αυτή η τιμή θα Ï€Ïέπει να είναι μία έγκυÏη έκφÏαση. + + + This value is not a valid CSS color. + Αυτή η τιμή δεν είναι έγκυÏο χÏώμα CSS. + + + This value is not a valid CIDR notation. + Αυτή η τιμή δεν είναι έγκυÏη CIDR σημειογÏαφία. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Η τιμή του netmask Ï€Ïέπει να είναι ανάμεσα σε {{ min }} και {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf new file mode 100644 index 00000000000..34c54212d84 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + This value should be false. + + + This value should be true. + This value should be true. + + + This value should be of type {{ type }}. + This value should be of type {{ type }}. + + + This value should be blank. + This value should be blank. + + + The value you selected is not a valid choice. + The value you selected is not a valid choice. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + + + One or more of the given values is invalid. + One or more of the given values is invalid. + + + This field was not expected. + This field was not expected. + + + This field is missing. + This field is missing. + + + This value is not a valid date. + This value is not a valid date. + + + This value is not a valid datetime. + This value is not a valid datetime. + + + This value is not a valid email address. + This value is not a valid email address. + + + The file could not be found. + The file could not be found. + + + The file is not readable. + The file is not readable. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + + + This value should be {{ limit }} or less. + This value should be {{ limit }} or less. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + + + This value should be {{ limit }} or more. + This value should be {{ limit }} or more. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + + + This value should not be blank. + This value should not be blank. + + + This value should not be null. + This value should not be null. + + + This value should be null. + This value should be null. + + + This value is not valid. + This value is not valid. + + + This value is not a valid time. + This value is not a valid time. + + + This value is not a valid URL. + This value is not a valid URL. + + + The two values should be equal. + The two values should be equal. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + + + The file is too large. + The file is too large. + + + The file could not be uploaded. + The file could not be uploaded. + + + This value should be a valid number. + This value should be a valid number. + + + This file is not a valid image. + This file is not a valid image. + + + This is not a valid IP address. + This is not a valid IP address. + + + This value is not a valid language. + This value is not a valid language. + + + This value is not a valid locale. + This value is not a valid locale. + + + This value is not a valid country. + This value is not a valid country. + + + This value is already used. + This value is already used. + + + The size of the image could not be detected. + The size of the image could not be detected. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + + + This value should be the user's current password. + This value should be the user's current password. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + + + The file was only partially uploaded. + The file was only partially uploaded. + + + No file was uploaded. + No file was uploaded. + + + No temporary folder was configured in php.ini. + No temporary folder was configured in php.ini, or the configured folder does not exist. + + + Cannot write temporary file to disk. + Cannot write temporary file to disk. + + + A PHP extension caused the upload to fail. + A PHP extension caused the upload to fail. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + + + Invalid card number. + Invalid card number. + + + Unsupported card type or invalid card number. + Unsupported card type or invalid card number. + + + This is not a valid International Bank Account Number (IBAN). + This is not a valid International Bank Account Number (IBAN). + + + This value is not a valid ISBN-10. + This value is not a valid ISBN-10. + + + This value is not a valid ISBN-13. + This value is not a valid ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + This value is neither a valid ISBN-10 nor a valid ISBN-13. + + + This value is not a valid ISSN. + This value is not a valid ISSN. + + + This value is not a valid currency. + This value is not a valid currency. + + + This value should be equal to {{ compared_value }}. + This value should be equal to {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + This value should be greater than {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + This value should be greater than or equal to {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + This value should be less than {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + This value should be less than or equal to {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + This value should not be equal to {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + + + An empty file is not allowed. + An empty file is not allowed. + + + The host could not be resolved. + The host could not be resolved. + + + This value does not match the expected {{ charset }} charset. + This value does not match the expected {{ charset }} charset. + + + This is not a valid Business Identifier Code (BIC). + This is not a valid Business Identifier Code (BIC). + + + Error + Error + + + This is not a valid UUID. + This is not a valid UUID. + + + This value should be a multiple of {{ compared_value }}. + This value should be a multiple of {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + + + This value should be valid JSON. + This value should be valid JSON. + + + This collection should contain only unique elements. + This collection should contain only unique elements. + + + This value should be positive. + This value should be positive. + + + This value should be either positive or zero. + This value should be either positive or zero. + + + This value should be negative. + This value should be negative. + + + This value should be either negative or zero. + This value should be either negative or zero. + + + This value is not a valid timezone. + This value is not a valid timezone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + This password has been leaked in a data breach, it must not be used. Please use another password. + + + This value should be between {{ min }} and {{ max }}. + This value should be between {{ min }} and {{ max }}. + + + This value is not a valid hostname. + This value is not a valid hostname. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + The number of elements in this collection should be a multiple of {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + This value should satisfy at least one of the following constraints: + + + Each element of this collection should satisfy its own set of constraints. + Each element of this collection should satisfy its own set of constraints. + + + This value is not a valid International Securities Identification Number (ISIN). + This value is not a valid International Securities Identification Number (ISIN). + + + This value should be a valid expression. + This value should be a valid expression. + + + This value is not a valid CSS color. + This value is not a valid CSS color. + + + This value is not a valid CIDR notation. + This value is not a valid CIDR notation. + + + The value of the netmask should be between {{ min }} and {{ max }}. + The value of the netmask should be between {{ min }} and {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf new file mode 100644 index 00000000000..897d0a45d74 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Este valor debería ser falso. + + + This value should be true. + Este valor debería ser verdadero. + + + This value should be of type {{ type }}. + Este valor debería ser de tipo {{ type }}. + + + This value should be blank. + Este valor debería estar vacío. + + + The value you selected is not a valid choice. + El valor seleccionado no es una opción válida. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Debe seleccionar al menos {{ limit }} opción.|Debe seleccionar al menos {{ limit }} opciones. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Debe seleccionar como máximo {{ limit }} opción.|Debe seleccionar como máximo {{ limit }} opciones. + + + One or more of the given values is invalid. + Uno o más de los valores indicados no son válidos. + + + This field was not expected. + Este campo no se esperaba. + + + This field is missing. + Este campo está desaparecido. + + + This value is not a valid date. + Este valor no es una fecha válida. + + + This value is not a valid datetime. + Este valor no es una fecha y hora válidas. + + + This value is not a valid email address. + Este valor no es una dirección de email válida. + + + The file could not be found. + No se pudo encontrar el archivo. + + + The file is not readable. + No se puede leer el archivo. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + El archivo es demasiado grande ({{ size }} {{ suffix }}). El tamaño máximo permitido es {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + El tipo mime del archivo no es válido ({{ type }}). Los tipos mime válidos son {{ types }}. + + + This value should be {{ limit }} or less. + Este valor debería ser {{ limit }} o menos. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Este valor es demasiado largo. Debería tener {{ limit }} carácter o menos.|Este valor es demasiado largo. Debería tener {{ limit }} caracteres o menos. + + + This value should be {{ limit }} or more. + Este valor debería ser {{ limit }} o más. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Este valor es demasiado corto. Debería tener {{ limit }} carácter o más.|Este valor es demasiado corto. Debería tener {{ limit }} caracteres o más. + + + This value should not be blank. + Este valor no debería estar vacío. + + + This value should not be null. + Este valor no debería ser nulo. + + + This value should be null. + Este valor debería ser nulo. + + + This value is not valid. + Este valor no es válido. + + + This value is not a valid time. + Este valor no es una hora válida. + + + This value is not a valid URL. + Este valor no es una URL válida. + + + The two values should be equal. + Los dos valores deberían ser iguales. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + El archivo es demasiado grande. El tamaño máximo permitido es {{ limit }} {{ suffix }}. + + + The file is too large. + El archivo es demasiado grande. + + + The file could not be uploaded. + No se pudo subir el archivo. + + + This value should be a valid number. + Este valor debería ser un número válido. + + + This file is not a valid image. + El archivo no es una imagen válida. + + + This is not a valid IP address. + Esto no es una dirección IP válida. + + + This value is not a valid language. + Este valor no es un idioma válido. + + + This value is not a valid locale. + Este valor no es una localización válida. + + + This value is not a valid country. + Este valor no es un país válido. + + + This value is already used. + Este valor ya se ha utilizado. + + + The size of the image could not be detected. + No se pudo determinar el tamaño de la imagen. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + El ancho de la imagen es demasiado grande ({{ width }}px). El ancho máximo permitido es de {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + El ancho de la imagen es demasiado pequeño ({{ width }}px). El ancho mínimo requerido es {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + La altura de la imagen es demasiado grande ({{ height }}px). La altura máxima permitida es de {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + La altura de la imagen es demasiado pequeña ({{ height }}px). La altura mínima requerida es de {{ min_height }}px. + + + This value should be the user's current password. + Este valor debería ser la contraseña actual del usuario. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Este valor debería tener exactamente {{ limit }} carácter.|Este valor debería tener exactamente {{ limit }} caracteres. + + + The file was only partially uploaded. + El archivo fue sólo subido parcialmente. + + + No file was uploaded. + Ningún archivo fue subido. + + + No temporary folder was configured in php.ini. + Ninguna carpeta temporal fue configurada en php.ini o la carpeta configurada no existe. + + + Cannot write temporary file to disk. + No se pudo escribir el archivo temporal en el disco. + + + A PHP extension caused the upload to fail. + Una extensión de PHP hizo que la subida fallara. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Esta colección debe contener {{ limit }} elemento o más.|Esta colección debe contener {{ limit }} elementos o más. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Esta colección debe contener {{ limit }} elemento o menos.|Esta colección debe contener {{ limit }} elementos o menos. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Esta colección debe contener exactamente {{ limit }} elemento.|Esta colección debe contener exactamente {{ limit }} elementos. + + + Invalid card number. + Número de tarjeta inválido. + + + Unsupported card type or invalid card number. + Tipo de tarjeta no soportado o número de tarjeta inválido. + + + This is not a valid International Bank Account Number (IBAN). + Esto no es un International Bank Account Number (IBAN) válido. + + + This value is not a valid ISBN-10. + Este valor no es un ISBN-10 válido. + + + This value is not a valid ISBN-13. + Este valor no es un ISBN-13 válido. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Este valor no es ni un ISBN-10 válido ni un ISBN-13 válido. + + + This value is not a valid ISSN. + Este valor no es un ISSN válido. + + + This value is not a valid currency. + Este valor no es una divisa válida. + + + This value should be equal to {{ compared_value }}. + Este valor debería ser igual que {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Este valor debería ser mayor que {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Este valor debería ser mayor o igual que {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor debería ser idéntico a {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Este valor debería ser menor que {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Este valor debería ser menor o igual que {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Este valor debería ser distinto de {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor no debería ser idéntico a {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + La proporción de la imagen es demasiado grande ({{ ratio }}). La máxima proporción permitida es {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + La proporción de la imagen es demasiado pequeña ({{ ratio }}). La mínima proporción permitida es {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + La imagen es cuadrada ({{ width }}x{{ height }}px). Las imágenes cuadradas no están permitidas. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + La imagen está orientada horizontalmente ({{ width }}x{{ height }}px). Las imágenes orientadas horizontalmente no están permitidas. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + La imagen está orientada verticalmente ({{ width }}x{{ height }}px). Las imágenes orientadas verticalmente no están permitidas. + + + An empty file is not allowed. + No está permitido un archivo vacío. + + + The host could not be resolved. + No se puede resolver el host. + + + This value does not match the expected {{ charset }} charset. + La codificación de caracteres para este valor debería ser {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + No es un Código de Identificación Bancaria (BIC) válido. + + + Error + Error + + + This is not a valid UUID. + Este valor no es un UUID válido. + + + This value should be a multiple of {{ compared_value }}. + Este valor debería ser múltiplo de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Este Código de Identificación Bancaria (BIC) no está asociado con el IBAN {{ iban }}. + + + This value should be valid JSON. + Este valor debería ser un JSON válido. + + + This collection should contain only unique elements. + Esta colección debería tener exclusivamente elementos únicos. + + + This value should be positive. + Este valor debería ser positivo. + + + This value should be either positive or zero. + Este valor debería ser positivo o igual a cero. + + + This value should be negative. + Este valor debería ser negativo. + + + This value should be either negative or zero. + Este valor debería ser negativo o igual a cero. + + + This value is not a valid timezone. + Este valor no es una zona horaria válida. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Esta contraseña no se puede utilizar porque está incluida en un listado de contraseñas públicas obtenido gracias a fallos de seguridad de otros sitios y aplicaciones. Por favor utilice otra contraseña. + + + This value should be between {{ min }} and {{ max }}. + Este valor debería estar entre {{ min }} y {{ max }}. + + + This value is not a valid hostname. + Este valor no es un nombre de host válido. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + El número de elementos en esta colección debería ser múltiplo de {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Este valor debería satisfacer al menos una de las siguientes restricciones: + + + Each element of this collection should satisfy its own set of constraints. + Cada elemento de esta colección debería satisfacer su propio conjunto de restricciones. + + + This value is not a valid International Securities Identification Number (ISIN). + Este valor no es un número de identificación internacional de valores (ISIN) válido. + + + This value should be a valid expression. + Este valor debería ser una expresión válida. + + + This value is not a valid CSS color. + Este valor no es un color CSS válido. + + + This value is not a valid CIDR notation. + Este valor no es una notación CIDR válida. + + + The value of the netmask should be between {{ min }} and {{ max }}. + El valor de la máscara de red debería estar entre {{ min }} y {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf new file mode 100644 index 00000000000..b323dcd9616 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Väärtus peaks olema väär. + + + This value should be true. + Väärtus peaks oleme tõene. + + + This value should be of type {{ type }}. + Väärtus peaks olema {{ type }}-tüüpi. + + + This value should be blank. + Väärtus peaks olema tühi. + + + The value you selected is not a valid choice. + Väärtus peaks olema üks etteantud valikutest. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Valima peaks vähemalt {{ limit }} valikut. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Valima peaks mitte rohkem kui {{ limit }} valikut. + + + One or more of the given values is invalid. + Ãœks või rohkem väärtustest on vigane. + + + This field was not expected. + See väli ei olnud oodatud. + + + This field is missing. + See väli on puudu. + + + This value is not a valid date. + Väärtus pole korrektne kuupäev. + + + This value is not a valid datetime. + Väärtus pole korrektne kuupäev ja kellaeg. + + + This value is not a valid email address. + Väärtus pole korrektne e-maili aadress. + + + The file could not be found. + Faili ei leita. + + + The file is not readable. + Fail ei ole loetav. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Fail on liiga suur ({{ size }} {{ suffix }}). Suurim lubatud suurus on {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Faili sisutüüp on vigane ({{ type }}). Lubatud sisutüübid on {{ types }}. + + + This value should be {{ limit }} or less. + Väärtus peaks olema {{ limit }} või vähem. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Väärtus on liiga pikk. Pikkus peaks olema {{ limit }} tähemärki või vähem. + + + This value should be {{ limit }} or more. + Väärtus peaks olema {{ limit }} või rohkem. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Väärtus on liiga lühike. Pikkus peaks olema {{ limit }} tähemärki või rohkem. + + + This value should not be blank. + Väärtus ei tohiks olla tühi. + + + This value should not be null. + Väärtus ei tohiks olla 'null'. + + + This value should be null. + Väärtus peaks olema 'null'. + + + This value is not valid. + Väärtus on vigane. + + + This value is not a valid time. + Väärtus pole korrektne aeg. + + + This value is not a valid URL. + Väärtus pole korrektne URL. + + + The two values should be equal. + Väärtused peaksid olema võrdsed. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Fail on liiga suur. Maksimaalne lubatud suurus on {{ limit }} {{ suffix }}. + + + The file is too large. + Fail on liiga suur. + + + The file could not be uploaded. + Faili ei saa üles laadida. + + + This value should be a valid number. + Väärtus peaks olema korrektne number. + + + This file is not a valid image. + Fail ei ole korrektne pilt. + + + This is not a valid IP address. + IP aadress pole korrektne. + + + This value is not a valid language. + Väärtus pole korrektne keel. + + + This value is not a valid locale. + Väärtus pole korrektne asukohakeel. + + + This value is not a valid country. + Väärtus pole olemasolev riik. + + + This value is already used. + Väärtust on juba kasutatud. + + + The size of the image could not be detected. + Pildi suurust polnud võimalik tuvastada. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Pilt on liiga lai ({{ width }}px). Suurim lubatud laius on {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Pilt on liiga kitsas ({{ width }}px). Vähim lubatud laius on {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Pilt on liiga pikk ({{ height }}px). Lubatud suurim pikkus on {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Pilt pole piisavalt pikk ({{ height }}px). Lubatud vähim pikkus on {{ min_height }}px. + + + This value should be the user's current password. + Väärtus peaks olema kasutaja kehtiv salasõna. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Väärtus peaks olema täpselt {{ limit }} tähemärk pikk.|Väärtus peaks olema täpselt {{ limit }} tähemärki pikk. + + + The file was only partially uploaded. + Fail ei laetud täielikult üles. + + + No file was uploaded. + Ãœhtegi faili ei laetud üles. + + + No temporary folder was configured in php.ini. + Ãœhtegi ajutist kausta polnud php.ini-s seadistatud. + + + Cannot write temporary file to disk. + Ajutist faili ei saa kettale kirjutada. + + + A PHP extension caused the upload to fail. + PHP laiendi tõttu ebaõnnestus faili üleslaadimine. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Kogumikus peaks olema vähemalt {{ limit }} element.|Kogumikus peaks olema vähemalt {{ limit }} elementi. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Kogumikus peaks olema ülimalt {{ limit }} element.|Kogumikus peaks olema ülimalt {{ limit }} elementi. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Kogumikus peaks olema täpselt {{ limit }} element.|Kogumikus peaks olema täpselt {{ limit }}|elementi. + + + Invalid card number. + Vigane kaardi number. + + + Unsupported card type or invalid card number. + Kaardi tüüpi ei toetata või kaardi number on vigane. + + + This is not a valid International Bank Account Number (IBAN). + Väärtus pole korrektne IBAN-number. + + + This value is not a valid ISBN-10. + Väärtus pole korrektne ISBN-10. + + + This value is not a valid ISBN-13. + Väärtus pole korrektne ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Väärtus pole korrektne ISBN-10 ega ISBN-13. + + + This value is not a valid ISSN. + Väärtus pole korrektne ISSN. + + + This value is not a valid currency. + Väärtus pole korrektne valuuta. + + + This value should be equal to {{ compared_value }}. + Väärtus peaks olema võrdne {{ compared_value }}-ga. + + + This value should be greater than {{ compared_value }}. + Väärtus peaks olema suurem kui {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Väärtus peaks olema suurem kui või võrduma {{ compared_value }}-ga. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Väärtus peaks olema identne väärtusega {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Väärtus peaks olema väiksem kui {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Väärtus peaks olema väiksem kui või võrduma {{ compared_value }}-ga. + + + This value should not be equal to {{ compared_value }}. + Väärtus ei tohiks võrduda {{ compared_value }}-ga. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Väärtus ei tohiks olla identne väärtusega {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Kuvasuhe on liiga suur ({{ ratio }}). Lubatud maksimaalne suhe on {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Kuvasuhe on liiga väike ({{ ratio }}). Oodatav minimaalne suhe on {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Pilt on ruudukujuline ({{ width }}x{{ height }}px). Ruudukujulised pildid pole lubatud. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Pilt on horisontaalselt orienteeritud ({{ width }}x{{ height }}px). Maastikulised pildid pole lubatud. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Pilt on vertikaalselt orienteeritud ({{ width }}x{{ height }}px). Portreepildid pole lubatud. + + + An empty file is not allowed. + Tühi fail pole lubatud. + + + The host could not be resolved. + Sellist domeeni ei õnnestunud leida. + + + This value does not match the expected {{ charset }} charset. + See väärtus ei ühti eeldatava tähemärgiga {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + See ei ole kehtiv ettevõtte identifitseerimiskood (BIC). + + + Error + Viga + + + This is not a valid UUID. + See pole kehtiv UUID. + + + This value should be a multiple of {{ compared_value }}. + See väärtus peaks olema väärtuse {{ compared_value }} kordne. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + See ettevõtte identifitseerimiskood (BIC) ei ole seotud IBAN-iga {{ iban }}. + + + This value should be valid JSON. + See väärtus peaks olema kehtiv JSON. + + + This collection should contain only unique elements. + See kogu peaks sisaldama ainult unikaalseid elemente. + + + This value should be positive. + See väärtus peaks olema positiivne. + + + This value should be either positive or zero. + See väärtus peaks olema kas positiivne või null. + + + This value should be negative. + See väärtus peaks olema negatiivne. + + + This value should be either negative or zero. + See väärtus peaks olema kas negatiivne või null. + + + This value is not a valid timezone. + See väärtus pole kehtiv ajavöönd. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + See parool on lekkinud andmerikkumise korral, seda ei tohi kasutada. Palun kasutage muud parooli. + + + This value should be between {{ min }} and {{ max }}. + See väärtus peaks olema vahemikus {{ min }} kuni {{ max }}. + + + This value is not a valid hostname. + See väärtus pole korrektne domeeninimi. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Selles kogus olevate elementide arv peab olema arvu {{ compared_value }} kordne. + + + This value should satisfy at least one of the following constraints: + See väärtus peab vastama vähemalt ühele järgmistest tingimustest: + + + Each element of this collection should satisfy its own set of constraints. + Kõik väärtused selles kogus peavad vastama oma tingimustele. + + + This value is not a valid International Securities Identification Number (ISIN). + See väärtus pole korrektne ISIN-kood. + + + This value should be a valid expression. + See väärtus pole korrektne avaldis. + + + This value is not a valid CSS color. + See väärtus pole korrektne CSS-i värv. + + + This value is not a valid CIDR notation. + See väärtus pole korrektne CIDR võrguaadress. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Võrgumaski väärtus peaks olema vahemikus {{ min }} kuni {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf new file mode 100644 index 00000000000..ec58c60369b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf @@ -0,0 +1,395 @@ + + + + + + This value should be false. + Balio hau faltsua izan beharko litzateke. + + + This value should be true. + Balio hau egia izan beharko litzateke. + + + This value should be of type {{ type }}. + Balio hau {{ type }} motakoa izan beharko litzateke. + + + This value should be blank. + Balio hau hutsik egon beharko litzateke. + + + The value you selected is not a valid choice. + Hautatu duzun balioa ez da aukera egoki bat. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Gutxienez aukera {{ limit }} hautatu behar duzu.|Gutxienez {{ limit }} aukera hautatu behar dituzu. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Gehienez aukera {{ limit }} hautatu behar duzu.|Gehienez {{ limit }} aukera hautatu behar dituzu. + + + One or more of the given values is invalid. + Emandako balioetatik gutxienez bat ez da egokia. + + + This field was not expected. + Eremu hau ez zen espero. + + + This field is missing. + Eremu hau falta da. + + + This value is not a valid date. + Balio hau ez da data egoki bat. + + + This value is not a valid datetime. + Balio hau ez da data-ordu egoki bat. + + + This value is not a valid email address. + Balio hau ez da posta elektroniko egoki bat. + + + The file could not be found. + Ezin izan da fitxategia aurkitu. + + + The file is not readable. + Fitxategia ez da irakurgarria. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Fitxategia handiegia da ({{ size }} {{ suffix }}). Baimendutako tamaina handiena {{ limit }} {{ suffix }} da. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Fitxategiaren mime mota ez da egokia ({{ type }}). Hauek dira baimendutako mime motak: {{ types }}. + + + This value should be {{ limit }} or less. + Balio hau gehienez {{ limit }} izan beharko litzateke. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Balio hau luzeegia da. Gehienez karaktere {{ limit }} eduki beharko luke.|Balio hau luzeegia da. Gehienez {{ limit }} karaktere eduki beharko lituzke. + + + This value should be {{ limit }} or more. + Balio hau gutxienez {{ limit }} izan beharko litzateke. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Balio hau motzegia da. Karaktere {{ limit }} gutxienez eduki beharko luke.|Balio hau motzegia da. Gutxienez {{ limit }} karaktere eduki beharko lituzke. + + + This value should not be blank. + Balio hau ez litzateke hutsik egon behar. + + + This value should not be null. + Balio hau ez litzateke nulua izan behar. + + + This value should be null. + Balio hau nulua izan beharko litzateke. + + + This value is not valid. + Balio hau ez da egokia. + + + This value is not a valid time. + Balio hau ez da ordu egoki bat. + + + This value is not a valid URL. + Balio hau ez da baliabideen kokatzaile uniforme (URL) egoki bat. + + + The two values should be equal. + Bi balioak berdinak izan beharko lirateke. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Fitxategia handiegia da. Baimendutako tamaina handiena {{ limit }} {{ suffix }} da. + + + The file is too large. + Fitxategia handiegia da. + + + The file could not be uploaded. + Ezin izan da fitxategia igo. + + + This value should be a valid number. + Balio hau zenbaki egoki bat izan beharko litzateke. + + + This file is not a valid image. + Fitxategi hau ez da irudi egoki bat. + + + This is not a valid IP address. + Honako hau ez da IP helbide egoki bat. + + + This value is not a valid language. + Balio hau ez da hizkuntza egoki bat. + + + This value is not a valid locale. + Balio hau ez da kokapen egoki bat. + + + This value is not a valid country. + Balio hau ez da herrialde egoki bat. + + + This value is already used. + Balio hau jadanik erabilia izan da. + + + The size of the image could not be detected. + Ezin izan da irudiaren tamaina detektatu. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Irudiaren zabalera handiegia da ({{ width }}px). Onartutako gehienezko zabalera {{ max_width }}px dira. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Irudiaren zabalera txikiegia da ({{ width }}px). Onartutako gutxieneko zabalera {{ min_width }}px dira. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Irudiaren altuera handiegia da ({{ height }}px). Onartutako gehienezko altuera {{ max_height }}px dira. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Irudiaren altuera txikiegia da ({{ height }}px). Onartutako gutxieneko altuera {{ min_height }}px dira. + + + This value should be the user's current password. + Balio hau uneko erabiltzailearen pasahitza izan beharko litzateke. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Balio honek zehazki karaktere {{ limit }} izan beharko luke.|Balio honek zehazki {{ limit }} karaktere izan beharko lituzke. + + + The file was only partially uploaded. + Fitxategiaren zati bat bakarrik igo da. + + + No file was uploaded. + Ez da fitxategirik igo. + + + No temporary folder was configured in php.ini. + Ez da aldi baterako karpetarik konfiguratu php.ini fitxategian. + + + Cannot write temporary file to disk. + Ezin izan da aldi baterako fitxategia diskoan idatzi. + + + A PHP extension caused the upload to fail. + PHP luzapen batek igoeraren hutsa eragin du. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Bilduma honek gutxienez elementu {{ limit }} eduki beharko luke.|Bilduma honek gutxienez {{ limit }} elementu eduki beharko lituzke. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Bilduma honek gehienez elementu {{ limit }} eduki beharko luke.|Bilduma honek gehienez {{ limit }} elementu eduki beharko lituzke. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Bilduma honek zehazki elementu {{ limit }} eduki beharko luke.|Bilduma honek zehazki {{ limit }} elementu eduki beharko lituzke. + + + Invalid card number. + Txartel zenbaki baliogabea. + + + Unsupported card type or invalid card number. + Txartel mota onartezina edo txartel zenbaki baliogabea. + + + This is not a valid International Bank Account Number (IBAN). + Hau ez da baliozko banku internazionaleko kontu zenbaki (IBAN) bat. + + + This value is not a valid ISBN-10. + Balio hau ez da onartutako ISBN-10 bat. + + + This value is not a valid ISBN-13. + Balio hau ez da onartutako ISBN-13 bat. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Balio hau ez da onartutako ISBN-10 edo ISBN-13 bat. + + + This value is not a valid ISSN. + Balio hau ez da onartutako ISSN bat. + + + This value is not a valid currency. + Balio hau ez da baliozko moneta bat. + + + This value should be equal to {{ compared_value }}. + Balio hau {{ compared_value }}-(r)en berbera izan beharko litzateke. + + + This value should be greater than {{ compared_value }}. + Balio hau {{ compared_value }} baino handiagoa izan beharko litzateke. + + + This value should be greater than or equal to {{ compared_value }}. + Balio hau {{ compared_value }}-(r)en berdina edota handiagoa izan beharko litzateke. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Balio hau {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan beharko litzateke. + + + This value should be less than {{ compared_value }}. + Balio hau {{ compared_value }} baino txikiagoa izan beharko litzateke. + + + This value should be less than or equal to {{ compared_value }}. + Balio hau {{ compared_value }}-(r)en berdina edota txikiagoa izan beharko litzateke. + + + This value should not be equal to {{ compared_value }}. + Balio hau ez litzateke {{ compared_value }}-(r)en berdina izan behar. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Irudiaren proportzioa oso handia da ({{ ratio }}). Onartutako proportzio handienda {{ max_ratio }} da. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Irudiaren proportzioa oso txikia da ({{ ratio }}). Onartutako proportzio txikiena {{ min_ratio }} da. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Irudia karratua da ({{ width }}x{{ height }}px). Karratuak diren irudiak ez dira onartzen. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Irudia horizontalki bideratua dago ({{ width }}x{{ height }}px). Horizontalki bideratutako irudiak ez dira onartzen. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Irudia bertikalki bideratua dago ({{ width }}x{{ height }}px). Bertikalki bideratutako irudiak ez dira onartzen. + + + An empty file is not allowed. + Hutsik dagoen fitxategia ez da onartzen. + + + The host could not be resolved. + Host-a ezin da ebatzi. + + + This value does not match the expected {{ charset }} charset. + Balio honen karaktere kodea ez da esperotakoa {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Ez da balizko Banku Identifikazioko Kodea (BIC). + + + Error + Errore + + + This is not a valid UUID. + Balio hau ez da onartutako UUID bat. + + + This value should be a multiple of {{ compared_value }}. + Balio honek {{ compared_value }}-ren multiploa izan beharko luke. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Banku Identifikazioko Kode hau ez dago lotuta {{ IBAN }} IBAN-rekin. + + + This value should be valid JSON. + Balio honek baliozko JSON bat izan behar luke. + + + This collection should contain only unique elements. + Bilduma honek elementu bakarrak soilik izan beharko lituzke. + + + This value should be positive. + Balio honek positiboa izan beharko luke. + + + This value should be either positive or zero. + Balio honek positiboa edo zero izan behar luke. + + + This value should be negative. + Balio honek negatiboa izan behar luke. + + + This value should be either negative or zero. + Balio honek negatiboa edo zero izan behar luke. + + + This value is not a valid timezone. + Balio hori ez da baliozko ordu-eremua. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Pasahitz hori ezin da erabili, beste gune eta aplikazio batzuetako segurtasun-akatsei esker lortutako pasahitz publikoen zerrendan sartuta dagoelako. Mesedez, erabili beste pasahitz bat. + + + This value should be between {{ min }} and {{ max }}. + Balio honek {{ min }} eta {{ max }} artean egon behar luke. + + + This value is not a valid hostname. + Balio hori ez da ostalari-izen onargarria. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Bilduma honetako elementu-kopuruak {{ compared_value }}-ren multiploa izan behar luke. + + + This value should satisfy at least one of the following constraints: + Balio honek, gutxienez, murrizketa hauetako bat bete behar du: + + + Each element of this collection should satisfy its own set of constraints. + Bilduma honetako elementu bakoitzak bere murriztapen-multzoa bete behar du. + + + This value is not a valid International Securities Identification Number (ISIN). + Balio hori ez da baliozko baloreen nazioarteko identifikazio-zenbaki bat (ISIN). + + + This value should be a valid expression. + Balio hori baliozko adierazpena izan beharko litzateke. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf new file mode 100644 index 00000000000..b72bc6e03e9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + این مقدار باید نادرست (False) باشد. + + + This value should be true. + این مقدار باید درست (True) باشد. + + + This value should be of type {{ type }}. + این مقدار باید از نوع {{ type }} باشد. + + + This value should be blank. + این مقدار باید خالی باشد. + + + The value you selected is not a valid choice. + مقدار انتخاب شده یک گزینه معتبر نمی‌باشد. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + شما باید حداقل {{ limit }} گزینه انتخاب نمایید.|شما باید حداقل {{ limit }} گزینه انتخاب نمایید. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + شما باید حداکثر {{ limit }} گزینه انتخاب نمایید.|شما باید حداکثر {{ limit }} گزینه انتخاب نمایید. + + + One or more of the given values is invalid. + یک یا چند مقدار داده شده نامعتبر است. + + + The fields {{ fields }} were not expected. + Ùیلدهای {{ fields }} مورد انتظار نبود. + + + The fields {{ fields }} are missing. + Ùیلدهای {{ fields }} Ù…Ùقود شده اند. + + + This value is not a valid date. + این مقدار یک تاریخ معتبر نمی‌باشد. + + + This value is not a valid datetime. + این مقدار یک تاریخ Ùˆ زمان معتبر نمی‌باشد. + + + This value is not a valid email address. + این یک آدرس رایانامه (ایمیل) معتبر نمی‌باشد. + + + The file could not be found. + Ùایل یاÙت نشد. + + + The file is not readable. + Ùایل قابل خواندن نیست. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Ùایل بیش از اندازه بزرگ است({{ size }} {{ suffix }}). بیشینه (حداکثر) اندازه مجاز برابر با {{ limit }} {{ suffix }} می‌باشد. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + نوع mime این Ùایل نامعتبر است({{ type }}). انواع mime مجاز {{ types }} هستند. + + + This value should be {{ limit }} or less. + این مقدار باید کوچکتر Ùˆ یا مساوی {{ limit }} باشد. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + این مقدار بسیار طولانی است. باید دارای {{limit}} کاراکتر یا کمتر باشد. | این مقدار بسیار طولانی است. باید دارای {{limit}} کاراکتر یا کمتر باشد. + + + This value should be {{ limit }} or more. + این مقدار باید بزرگتر Ùˆ یا مساوی {{ limit }} باشد. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + این مقدار بیش از اندازه کوتاه است. باید {{ limit }} کاراکتر یا بیشتر داشته باشد.|این مقدار بیش از اندازه کوتاه است. باید {{ limit }} کاراکتر یا بیشتر داشته باشد. + + + This value should not be blank. + این مقدار نباید خالی باشد. + + + This value should not be null. + این مقدار نباید خالی باشد. + + + This value should be null. + این مقدار باید خالی باشد. + + + This value is not valid. + این مقدار معتبر نمی‌باشد. + + + This value is not a valid time. + این مقدار یک زمان معتبر نمی‌باشد. + + + This value is not a valid URL. + این مقدار شامل یک URL معتبر نمی‌باشد. + + + The two values should be equal. + دو مقدار باید با یکدیگر برابر باشند. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Ùایل بیش از اندازه بزرگ است. بیشینه (حداکثر) اندازه مجاز {{ limit }} {{ suffix }} است. + + + The file is too large. + Ùایل بیش از اندازه بزرگ است. + + + The file could not be uploaded. + بارگذاری Ùایل با شکست مواجه گردید. + + + This value should be a valid number. + این مقدار باید یک عدد معتبر باشد. + + + This file is not a valid image. + این Ùایل یک تصویر معتبر نمی‌باشد. + + + This is not a valid IP address. + این آدرس IP معتبر نیست. + + + This value is not a valid language. + این مقدار یک زبان معتبر نمی‌باشد. + + + This value is not a valid locale. + این مقدار یک محل (locale) معتبر نمی‌باشد. + + + This value is not a valid country. + این مقدار یک کشور معتبر نمی‌باشد. + + + This value is already used. + این مقدار قبلاً استÙاده شده است. + + + The size of the image could not be detected. + اندازه تصویر قابل شناسایی نمی‌باشد. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + عرض تصویر بسیار بزرگ است({{ width }}px). بیشینه (حداکثر) عرض مجاز {{ max_width }}px می‌باشد. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + عرض تصویر بسیار Ú©ÙˆÚ†Ú© است({{ width }}px). کمینه (حداقل) عرض مورد انتظار {{ min_width }}px می‌باشد. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ارتÙاع تصویر بسیار بزرگ است({{ height }}px). بیشینه (حداکثر) ارتÙاع مجاز {{ max_height }}px می‌باشد. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ارتÙاع تصویر بسیار Ú©ÙˆÚ†Ú© است({{ height }}px). کمینه (حداقل) ارتÙاع مورد انتظار {{ min_height }}px می‌باشد. + + + This value should be the user's current password. + این مقدار باید رمزعبور Ùعلی کاربر باشد. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + این مقدار باید دقیقا {{ limit }} کاراکتر داشته باشد.| این مقدار باید دقیقا {{ limit }} کاراکتر داشته باشد. + + + The file was only partially uploaded. + Ùایل به صورت جزئی بارگذاری گردیده است. + + + No file was uploaded. + هیچ Ùایلی بارگذاری نشد. + + + No temporary folder was configured in php.ini. + پوشه موقتی در php.ini پیکربندی نگردیده است. + + + Cannot write temporary file to disk. + Ùایل موقتی را نمی‌توان در دیسک نوشت. + + + A PHP extension caused the upload to fail. + یک اÙزونه PHP باعث شد بارگذاری ناموÙÙ‚ باشد. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + این مجموعه باید حاوی {{ limit }} عنصر یا بیشتر باشد.|این مجموعه باید حاوی {{ limit }} عنصر یا بیشتر باشد. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + این مجموعه باید حاوی {{ limit }} عنصر یا کمتر باشد.|این مجموعه باید حاوی {{ limit }} عنصر یا کمتر باشد. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + این مجموعه باید دقیقا حاوی {{ limit }} عنصر باشد.|این مجموعه باید دقیقا حاوی {{ limit }} عنصر باشد. + + + Invalid card number. + شماره کارت نامعتبر است. + + + Unsupported card type or invalid card number. + نوع کارت پشتیبانی نمی‌شود Ùˆ یا شماره کارت نامعتبر می‌باشد. + + + This is not a valid International Bank Account Number (IBAN). + این یک شماره حساب بانک بین المللی معتبر نمی‌باشد(IBAN). + + + This value is not a valid ISBN-10. + این مقدار یک ISBN-10 معتبر نمی‌باشد. + + + This value is not a valid ISBN-13. + این مقدار یک ISBN-13 معتبر نمی‌باشد. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + این مقدار یک ISBN-10 معتبر Ùˆ یا ISBN-13 معتبر نمی‌باشد. + + + This value is not a valid ISSN. + این مقدار یک ISSN معتبر نمی‌باشد. + + + This value is not a valid currency. + این مقدار یک واحد پول معتبر نمی‌باشد. + + + This value should be equal to {{ compared_value }}. + این مقدار باید برابر با {{ compared_value }} باشد. + + + This value should be greater than {{ compared_value }}. + این مقدار باید از {{ compared_value }} بیشتر باشد. + + + This value should be greater than or equal to {{ compared_value }}. + این مقدار باید بزرگتر Ùˆ یا مساوی با {{ compared_value }} باشد. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + این مقدار باید برابر {{ compared_value_type }} {{ compared_value }} باشد. + + + This value should be less than {{ compared_value }}. + این مقدار باید کمتر از {{ compared_value }} باشد. + + + This value should be less than or equal to {{ compared_value }}. + این مقدار باید کمتر Ùˆ یا مساوی با {{ compared_value }} باشد. + + + This value should not be equal to {{ compared_value }}. + این مقدار نباید با {{ compared_value }} برابر باشد. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + این مقدار نباید برابر {{ compared_value_type }} {{ compared_value }} باشد. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + ابعاد ({{ ratio }}) عکس بیش از حد بزرگ است. بیشینه (حداکثر) ابعاد مجاز {{ max_ratio }} می‌باشد. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ابعاد ({{ ratio }}) عکس بیش از حد Ú©ÙˆÚ†Ú© است. کمینه (حداقل) ابعاد مورد انتظار {{ min_ratio }} می‌باشد. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + این تصویر یک مربع ({{ width }}x{{ height }}px) می‌باشد. تصاویر مربع Ø´Ú©Ù„ مجاز نمی‌باشند. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + این تصویر اÙÙ‚ÛŒ ({{ width }}x{{ height }}px) می‌باشد. تصاویر اÙÙ‚ÛŒ مجاز نمی‌باشند. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + این تصویر عمودی ({{ width }}x{{ height }}px) می‌باشد. تصاویر عمودی مجاز نمی‌باشند. + + + An empty file is not allowed. + Ùایل خالی مجاز نمی‌باشد. + + + The host could not be resolved. + میزبان (Host) شناسایی نشد. + + + This value does not match the expected {{ charset }} charset. + این مقدار مطابق charset مورد انتظار {{ charset }} نمی باشد. + + + This is not a valid Business Identifier Code (BIC). + این مقدار یک کد شناسایی کسب‌و‌کار معتبر (BIC) نیست. + + + Error + خطا + + + This is not a valid UUID. + این مقدار یک UUID معتبر نمی‌باشد. + + + This value should be a multiple of {{ compared_value }}. + این مقدار باید چند برابر {{ compared_value }} باشد. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + این کد شناسایی کسب‌و‌کار (BIC) با شماره حساب بانکی بین‌المللی (IBAN) {{ iban }} مرتبط نیست. + + + This value should be valid JSON. + این مقدار باید یک JSON معتبر باشد. + + + This collection should contain only unique elements. + این مجموعه باید Ùقط حاوی عناصر یکتا باشد. + + + This value should be positive. + این مقدار باید مثبت باشد. + + + This value should be either positive or zero. + این مقدار باید مثبت یا صÙر باشد. + + + This value should be negative. + این مقدار باید منÙÛŒ باشد. + + + This value should be either negative or zero. + این مقدار باید منÙÛŒ یا صÙر باشد. + + + This value is not a valid timezone. + این مقدار یک منطقه‌زمانی (timezone) معتبر نیست. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + این رمزعبور در یک رخنه‌ی اطلاعاتی نشت کرده است. لطÙاً از یک رمزعبور دیگر استÙاده کنید. + + + This value should be between {{ min }} and {{ max }}. + این مقدار باید بین {{ min }} Ùˆ {{ max }} باشد + + + This value is not a valid hostname. + این مقدار یک hostname معتبر نیست. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + تعداد عناصر این مجموعه باید ضریبی از {{ compared_value }} باشد. + + + This value should satisfy at least one of the following constraints: + این مقدار باید حداقل یکی از محدودیت‌های زیر را ارضا کند: + + + Each element of this collection should satisfy its own set of constraints. + هر یک از عناصر این مجموعه باید دسته محدودیت‌های خودش را ارضا کند. + + + This value is not a valid International Securities Identification Number (ISIN). + این مقدار یک شماره شناسایی بین‌المللی اوراق بهادار (ISIN) معتبر نیست. + + + This value should be a valid expression. + این مقدار باید یک عبارت معتبر باشد. + + + This value is not a valid CSS color. + این مقدار یک رنگ معتبر در CSS نیست. + + + This value is not a valid CIDR notation. + این مقدار یک نماد معتبر در CIDR نیست. + + + The value of the netmask should be between {{ min }} and {{ max }}. + مقدار ماسک شبکه (NetMask) باید بین {{ min }} Ùˆ {{ max }} باشد. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf new file mode 100644 index 00000000000..9a6bfe4b6a6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Arvon tulee olla epätosi. + + + This value should be true. + Arvon tulee olla tosi. + + + This value should be of type {{ type }}. + Arvon tulee olla tyyppiä {{ type }}. + + + This value should be blank. + Arvon tulee olla tyhjä. + + + The value you selected is not a valid choice. + Arvon tulee olla yksi annetuista vaihtoehdoista. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Sinun tulee valita vähintään {{ limit }} vaihtoehtoa. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Sinun tulee valitan enintään {{ limit }} vaihtoehtoa. + + + One or more of the given values is invalid. + Yksi tai useampi annetuista arvoista on virheellinen. + + + This field was not expected. + Tässä kentässä ei odotettu. + + + This field is missing. + Tämä kenttä puuttuu. + + + This value is not a valid date. + Annettu arvo ei ole kelvollinen päivämäärä. + + + This value is not a valid datetime. + Annettu arvo ei ole kelvollinen päivämäärä ja kellonaika. + + + This value is not a valid email address. + Annettu arvo ei ole kelvollinen sähköpostiosoite. + + + The file could not be found. + Tiedostoa ei löydy. + + + The file is not readable. + Tiedostoa ei voida lukea. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Tiedostonkoko ({{ size }} {{ suffix }}) on liian iso. Suurin sallittu tiedostonkoko on {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Tiedostotyyppi ({{ type }}) on virheellinen. Sallittuja tiedostotyyppejä ovat {{ types }}. + + + This value should be {{ limit }} or less. + Arvon tulee olla {{ limit }} tai vähemmän. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Liian pitkä syöte. Syöte saa olla enintään {{ limit }} merkkiä. + + + This value should be {{ limit }} or more. + Arvon tulee olla {{ limit }} tai enemmän. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Liian lyhyt syöte. Syötteen tulee olla vähintään {{ limit }} merkkiä. + + + This value should not be blank. + Kenttä ei voi olla tyhjä. + + + This value should not be null. + Syöte ei voi olla null. + + + This value should be null. + Syötteen tulee olla null. + + + This value is not valid. + Virheellinen arvo. + + + This value is not a valid time. + Annettu arvo ei ole kelvollinen kellonaika. + + + This value is not a valid URL. + Annettu arvo ei ole kelvollinen URL-osoite. + + + The two values should be equal. + Kahden annetun arvon tulee olla samat. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Annettu tiedosto on liian iso. Suurin sallittu tiedostokoko on {{ limit }} {{ suffix }}. + + + The file is too large. + Tiedosto on liian iso. + + + The file could not be uploaded. + Tiedoston siirto epäonnistui. + + + This value should be a valid number. + Tämän arvon tulee olla numero. + + + This file is not a valid image. + Tämä tiedosto ei ole kelvollinen kuva. + + + This is not a valid IP address. + Tämä ei ole kelvollinen IP-osoite. + + + This value is not a valid language. + Tämä arvo ei ole kelvollinen kieli. + + + This value is not a valid locale. + Tämä arvo ei ole kelvollinen kieli- ja alueasetus (locale). + + + This value is not a valid country. + Tämä arvo ei ole kelvollinen maa. + + + This value is already used. + Tämä arvo on jo käytetty. + + + The size of the image could not be detected. + Kuvan kokoa ei voitu tunnistaa. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Kuva on liian leveä ({{ width }}px). Sallittu maksimileveys on {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Kuva on liian kapea ({{ width }}px). Leveyden tulisi olla vähintään {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Kuva on liian korkea ({{ width }}px). Sallittu maksimikorkeus on {{ max_width }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Kuva on liian matala ({{ height }}px). Korkeuden tulisi olla vähintään {{ min_height }}px. + + + This value should be the user's current password. + Tämän arvon tulisi olla käyttäjän tämänhetkinen salasana. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Tämän arvon tulisi olla tasan yhden merkin pituinen.|Tämän arvon tulisi olla tasan {{ limit }} merkkiä pitkä. + + + The file was only partially uploaded. + Tiedosto ladattiin vain osittain. + + + No file was uploaded. + Tiedostoa ei ladattu. + + + No temporary folder was configured in php.ini. + Väliaikaishakemistoa ei ole asetettu php.ini -tiedostoon. + + + Cannot write temporary file to disk. + Väliaikaistiedostoa ei voitu kirjoittaa levylle. + + + A PHP extension caused the upload to fail. + PHP-laajennoksen vuoksi tiedoston lataus epäonnistui. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Tässä ryhmässä tulisi olla yksi tai useampi elementti.|Tässä ryhmässä tulisi olla vähintään {{ limit }} elementtiä. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Tässä ryhmässä tulisi olla enintään yksi elementti.|Tässä ryhmässä tulisi olla enintään {{ limit }} elementtiä. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Tässä ryhmässä tulisi olla tasan yksi elementti.|Tässä ryhmässä tulisi olla enintään {{ limit }} elementtiä. + + + Invalid card number. + Virheellinen korttinumero. + + + Unsupported card type or invalid card number. + Tätä korttityyppiä ei tueta tai korttinumero on virheellinen. + + + This is not a valid International Bank Account Number (IBAN). + Arvo ei ole kelvollinen kansainvälinen pankkitilinumero (IBAN). + + + This value is not a valid ISBN-10. + Arvo ei ole kelvollinen ISBN-10. + + + This value is not a valid ISBN-13. + Arvo ei ole kelvollinen ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Arvo ei ole kelvollinen ISBN-10 tai kelvollinen ISBN-13. + + + This value is not a valid ISSN. + Arvo ei ole kelvollinen ISSN. + + + This value is not a valid currency. + Arvo ei ole kelvollinen valuutta. + + + This value should be equal to {{ compared_value }}. + Arvo ei ole sama kuin {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Arvon tulee olla suurempi kuin {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Arvon tulee olla suurempi tai yhtä suuri kuin {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Tämä arvo tulee olla sama kuin {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Arvon tulee olla pienempi kuin {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Arvon tulee olla pienempi tai yhtä suuri {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Arvon ei tule olla sama kuin {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Tämä arvo ei tule olla sama kuin {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Kuvasuhde on liian suuri ({{ ratio }}). Suurin sallittu suhde on {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Kuvasuhde on liian pieni ({{ ratio }}). Pienin sallittu arvo on {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Kuva on neliä ({{ width }}x{{ height }}px). Neliöt kuvat eivät ole sallittuja. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Kuva on vaakasuuntainen ({{ width }}x{{ height }}px). Vaakasuuntaiset kuvat eivät ole sallittuja. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Kuva on pystysuuntainen ({{ width }}x{{ height }}px). Pystysuuntaiset kuvat eivät ole sallittuja. + + + An empty file is not allowed. + Tyhjä tiedosto ei ole sallittu. + + + The host could not be resolved. + Palvelimeen ei saatu yhteyttä. + + + This value does not match the expected {{ charset }} charset. + Arvo ei vastaa odotettua merkistöä {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Arvo ei ole kelvollinen yritystunnus (BIC). + + + Error + Virhe + + + This is not a valid UUID. + Arvo ei ole kelvollinen UUID. + + + This value should be a multiple of {{ compared_value }}. + Tämän arvon tulisi olla kerrannainen {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Tämä yritystunnus (BIC) ei ole liitetty IBAN {{ iban }}. + + + This value should be valid JSON. + Arvon tulee olla kelvollinen JSON. + + + This collection should contain only unique elements. + Tämän ryhmän tulisi sisältää vain yksilöllisiä arvoja. + + + This value should be positive. + Arvon tulisi olla positiivinen. + + + This value should be either positive or zero. + Arvon tulisi olla joko positiivinen tai nolla. + + + This value should be negative. + Arvon tulisi olla negatiivinen. + + + This value should be either negative or zero. + Arvon tulisi olla joko negatiivinen tai nolla. + + + This value is not a valid timezone. + Arvo ei ole kelvollinen aikavyöhyke. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Tämä salasana on vuotanut tietomurrossa, sitä ei saa käyttää. Käytä toista salasanaa. + + + This value should be between {{ min }} and {{ max }}. + Arvon tulisi olla välillä {{ min }} - {{ max }}. + + + This value is not a valid hostname. + Arvo ei ole kelvollinen laitenimi (hostname). + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Ryhmässä olevien elementtien määrän pitää olla monikerta luvulle {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Tämän arvon tulee läpäistä vähintään yksi seuraavista tarkistuksista: + + + Each element of this collection should satisfy its own set of constraints. + Ryhmän jokaisen elementin tulee läpäistä omat tarkistuksensa. + + + This value is not a valid International Securities Identification Number (ISIN). + Tämä arvo ei ole kelvollinen ISIN-koodi (International Securities Identification Number). + + + This value should be a valid expression. + Tämän arvon on oltava kelvollinen lauseke. + + + This value is not a valid CSS color. + Tämä arvo ei ole kelvollinen CSS-värimääritys. + + + This value is not a valid CIDR notation. + Tämä arvo ei ole kelvollinen CIDR-merkintä. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Verkkomaskille annetun arvon tulisi olla {{ min }} ja {{ max }} välillä. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf new file mode 100644 index 00000000000..92127773178 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Cette valeur doit être fausse. + + + This value should be true. + Cette valeur doit être vraie. + + + This value should be of type {{ type }}. + Cette valeur doit être de type {{ type }}. + + + This value should be blank. + Cette valeur doit être vide. + + + The value you selected is not a valid choice. + Cette valeur doit être l'un des choix proposés. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Vous devez sélectionner au moins {{ limit }} choix.|Vous devez sélectionner au moins {{ limit }} choix. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Vous devez sélectionner au maximum {{ limit }} choix.|Vous devez sélectionner au maximum {{ limit }} choix. + + + One or more of the given values is invalid. + Une ou plusieurs des valeurs soumises sont invalides. + + + This field was not expected. + Ce champ n'a pas été prévu. + + + This field is missing. + Ce champ est manquant. + + + This value is not a valid date. + Cette valeur n'est pas une date valide. + + + This value is not a valid datetime. + Cette valeur n'est pas une date valide. + + + This value is not a valid email address. + Cette valeur n'est pas une adresse email valide. + + + The file could not be found. + Le fichier n'a pas été trouvé. + + + The file is not readable. + Le fichier n'est pas lisible. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Le fichier est trop volumineux ({{ size }} {{ suffix }}). Sa taille ne doit pas dépasser {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Le type du fichier est invalide ({{ type }}). Les types autorisés sont {{ types }}. + + + This value should be {{ limit }} or less. + Cette valeur doit être inférieure ou égale à {{ limit }}. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractère.|Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractères. + + + This value should be {{ limit }} or more. + Cette valeur doit être supérieure ou égale à {{ limit }}. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractère.|Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractères. + + + This value should not be blank. + Cette valeur ne doit pas être vide. + + + This value should not be null. + Cette valeur ne doit pas être nulle. + + + This value should be null. + Cette valeur doit être nulle. + + + This value is not valid. + Cette valeur n'est pas valide. + + + This value is not a valid time. + Cette valeur n'est pas une heure valide. + + + This value is not a valid URL. + Cette valeur n'est pas une URL valide. + + + The two values should be equal. + Les deux valeurs doivent être identiques. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Le fichier est trop volumineux. Sa taille ne doit pas dépasser {{ limit }} {{ suffix }}. + + + The file is too large. + Le fichier est trop volumineux. + + + The file could not be uploaded. + Le téléchargement de ce fichier est impossible. + + + This value should be a valid number. + Cette valeur doit être un nombre. + + + This file is not a valid image. + Ce fichier n'est pas une image valide. + + + This is not a valid IP address. + Cette adresse IP n'est pas valide. + + + This value is not a valid language. + Cette langue n'est pas valide. + + + This value is not a valid locale. + Ce paramètre régional n'est pas valide. + + + This value is not a valid country. + Ce pays n'est pas valide. + + + This value is already used. + Cette valeur est déjà utilisée. + + + The size of the image could not be detected. + La taille de l'image n'a pas pu être détectée. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + La largeur de l'image est trop grande ({{ width }}px). La largeur maximale autorisée est de {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + La largeur de l'image est trop petite ({{ width }}px). La largeur minimale attendue est de {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + La hauteur de l'image est trop grande ({{ height }}px). La hauteur maximale autorisée est de {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + La hauteur de l'image est trop petite ({{ height }}px). La hauteur minimale attendue est de {{ min_height }}px. + + + This value should be the user's current password. + Cette valeur doit être le mot de passe actuel de l'utilisateur. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Cette chaîne doit avoir exactement {{ limit }} caractère.|Cette chaîne doit avoir exactement {{ limit }} caractères. + + + The file was only partially uploaded. + Le fichier a été partiellement transféré. + + + No file was uploaded. + Aucun fichier n'a été transféré. + + + No temporary folder was configured in php.ini. + Aucun répertoire temporaire n'a été configuré dans le php.ini, ou le répertoire configuré n'existe pas. + + + Cannot write temporary file to disk. + Impossible d'écrire le fichier temporaire sur le disque. + + + A PHP extension caused the upload to fail. + Une extension PHP a empêché le transfert du fichier. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Cette collection doit contenir {{ limit }} élément ou plus.|Cette collection doit contenir {{ limit }} éléments ou plus. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Cette collection doit contenir {{ limit }} élément ou moins.|Cette collection doit contenir {{ limit }} éléments ou moins. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Cette collection doit contenir exactement {{ limit }} élément.|Cette collection doit contenir exactement {{ limit }} éléments. + + + Invalid card number. + Numéro de carte invalide. + + + Unsupported card type or invalid card number. + Type de carte non supporté ou numéro invalide. + + + This is not a valid International Bank Account Number (IBAN). + Le numéro IBAN (International Bank Account Number) saisi n'est pas valide. + + + This value is not a valid ISBN-10. + Cette valeur n'est pas un code ISBN-10 valide. + + + This value is not a valid ISBN-13. + Cette valeur n'est pas un code ISBN-13 valide. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Cette valeur n'est ni un code ISBN-10, ni un code ISBN-13 valide. + + + This value is not a valid ISSN. + Cette valeur n'est pas un code ISSN valide. + + + This value is not a valid currency. + Cette valeur n'est pas une devise valide. + + + This value should be equal to {{ compared_value }}. + Cette valeur doit être égale à {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Cette valeur doit être supérieure à {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Cette valeur doit être supérieure ou égale à {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Cette valeur doit être identique à {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Cette valeur doit être inférieure à {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Cette valeur doit être inférieure ou égale à {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Cette valeur ne doit pas être égale à {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Cette valeur ne doit pas être identique à {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Le rapport largeur/hauteur de l'image est trop grand ({{ ratio }}). Le rapport maximal autorisé est {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Le rapport largeur/hauteur de l'image est trop petit ({{ ratio }}). Le rapport minimal attendu est {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + L'image est carrée ({{ width }}x{{ height }}px). Les images carrées ne sont pas autorisées. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + L'image est au format paysage ({{ width }}x{{ height }}px). Les images au format paysage ne sont pas autorisées. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + L'image est au format portrait ({{ width }}x{{ height }}px). Les images au format portrait ne sont pas autorisées. + + + An empty file is not allowed. + Un fichier vide n'est pas autorisé. + + + The host could not be resolved. + Le nom de domaine n'a pas pu être résolu. + + + This value does not match the expected {{ charset }} charset. + Cette valeur ne correspond pas au jeu de caractères {{ charset }} attendu. + + + This is not a valid Business Identifier Code (BIC). + Ce n'est pas un code universel d'identification des banques (BIC) valide. + + + Error + Erreur + + + This is not a valid UUID. + Ceci n'est pas un UUID valide. + + + This value should be a multiple of {{ compared_value }}. + Cette valeur doit être un multiple de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ce code d'identification d'entreprise (BIC) n'est pas associé à l'IBAN {{ iban }}. + + + This value should be valid JSON. + Cette valeur doit être un JSON valide. + + + This collection should contain only unique elements. + Cette collection ne doit pas comporter de doublons. + + + This value should be positive. + Cette valeur doit être strictement positive. + + + This value should be either positive or zero. + Cette valeur doit être supérieure ou égale à zéro. + + + This value should be negative. + Cette valeur doit être strictement négative. + + + This value should be either negative or zero. + Cette valeur doit être inférieure ou égale à zéro. + + + This value is not a valid timezone. + Cette valeur n'est pas un fuseau horaire valide. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ce mot de passe a été divulgué lors d'une fuite de données, il ne doit plus être utilisé. Veuillez utiliser un autre mot de passe. + + + This value should be between {{ min }} and {{ max }}. + Cette valeur doit être comprise entre {{ min }} et {{ max }}. + + + This value is not a valid hostname. + Cette valeur n'est pas un nom d'hôte valide. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Le nombre d'éléments de cette collection doit être un multiple de {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Cette valeur doit satisfaire à au moins une des contraintes suivantes : + + + Each element of this collection should satisfy its own set of constraints. + Chaque élément de cette collection doit satisfaire à son propre jeu de contraintes. + + + This value is not a valid International Securities Identification Number (ISIN). + Cette valeur n'est pas un code international de sécurité valide (ISIN). + + + This value should be a valid expression. + Cette valeur doit être une expression valide. + + + This value is not a valid CSS color. + Cette valeur n'est pas une couleur CSS valide. + + + This value is not a valid CIDR notation. + Cette valeur n'est pas une notation CIDR valide. + + + The value of the netmask should be between {{ min }} and {{ max }}. + La valeur du masque de réseau doit être comprise entre {{ min }} et {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf new file mode 100644 index 00000000000..f8c5c0493f7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Este valor debería ser falso. + + + This value should be true. + Este valor debería ser verdadeiro. + + + This value should be of type {{ type }}. + Este valor debería ser de tipo {{ type }}. + + + This value should be blank. + Este valor debería estar baleiro. + + + The value you selected is not a valid choice. + O valor seleccionado non é unha opción válida. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Debe seleccionar polo menos {{ limit }} opción.|Debe seleccionar polo menos {{ limit }} opcions. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Debe seleccionar como máximo {{ limit }} opción.|Debe seleccionar como máximo {{ limit }} opcions. + + + One or more of the given values is invalid. + Un ou máis dos valores indicados non son válidos. + + + This field was not expected. + Este campo non era esperado. + + + This field is missing. + Este campo falta. + + + This value is not a valid date. + Este valor non é unha data válida. + + + This value is not a valid datetime. + Este valor non é unha data e hora válidas. + + + This value is not a valid email address. + Este valor non é unha dirección de correo electrónico válida. + + + The file could not be found. + Non se puido atopar o arquivo. + + + The file is not readable. + O arquivo non se pode ler. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + O arquivo é demasiado grande ({{ size }} {{ suffix }}). O tamaño máximo permitido é {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + O tipo mime do arquivo non é válido ({{ type }}). Os tipos mime válidos son {{ types }}. + + + This value should be {{ limit }} or less. + Este valor debería ser {{ limit }} ou menos. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Este valor é demasiado longo. Debería ter {{ limit }} carácter ou menos.|Este valor é demasiado longo. Debería ter {{ limit }} caracteres ou menos. + + + This value should be {{ limit }} or more. + Este valor debería ser {{ limit }} ou máis. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Este valor é demasiado curto. Debería ter {{ limit }} carácter ou máis.|Este valor é demasiado corto. Debería ter {{ limit }} caracteres ou máis. + + + This value should not be blank. + Este valor non debería estar baleiro. + + + This value should not be null. + Este valor non debería ser null. + + + This value should be null. + Este valor debería ser null. + + + This value is not valid. + Este valor non é válido. + + + This value is not a valid time. + Este valor non é unha hora válida. + + + This value is not a valid URL. + Este valor non é unha URL válida. + + + The two values should be equal. + Os dous valores deberían ser iguais. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + O arquivo é demasiado grande. O tamaño máximo permitido é {{ limit }} {{ suffix }}. + + + The file is too large. + O arquivo é demasiado grande. + + + The file could not be uploaded. + No se puido cargar o arquivo. + + + This value should be a valid number. + Este valor debería ser un número válido. + + + This file is not a valid image. + O arquivo non é unha imaxe válida. + + + This is not a valid IP address. + Isto non é unha dirección IP válida. + + + This value is not a valid language. + Este valor non é un idioma válido. + + + This value is not a valid locale. + Este valor non é unha localización válida. + + + This value is not a valid country. + Este valor non é un país válido. + + + This value is already used. + Este valor xa está a ser empregado. + + + The size of the image could not be detected. + Non se puido determinar o tamaño da imaxe. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A largura da imaxe é demasiado grande ({{ width }}px). A largura máxima permitida son {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A largura da imaxe é demasiado pequena ({{ width }}px). A largura mínima requerida son {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A altura da imaxe é demasiado grande ({{ height }}px). A altura máxima permitida son {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A altura da imaxe é demasiado pequena ({{ height }}px). A altura mínima requerida son {{ min_height }}px. + + + This value should be the user's current password. + Este valor debería ser a contrasinal actual do usuario. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Este valor debería ter exactamente {{ limit }} carácter.|Este valor debería ter exactamente {{ limit }} caracteres. + + + The file was only partially uploaded. + O arquivo foi só subido parcialmente. + + + No file was uploaded. + Non se subiu ningún arquivo. + + + No temporary folder was configured in php.ini. + Ningunha carpeta temporal foi configurada en php.ini, ou a carpeta non existe. + + + Cannot write temporary file to disk. + Non se puido escribir o arquivo temporal no disco. + + + A PHP extension caused the upload to fail. + Unha extensión de PHP provocou que a subida fallara. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Esta colección debe conter {{ limit }} elemento ou máis.|Esta colección debe conter {{ limit }} elementos ou máis. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Esta colección debe conter {{ limit }} elemento ou menos.|Esta colección debe conter {{ limit }} elementos ou menos. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Esta colección debe conter exactamente {{ limit }} elemento.|Esta colección debe conter exactamente {{ limit }} elementos. + + + Invalid card number. + Número de tarxeta non válido. + + + Unsupported card type or invalid card number. + Tipo de tarxeta non soportado ou número de tarxeta non válido. + + + This is not a valid International Bank Account Number (IBAN). + Este valor non é un International Bank Account Number (IBAN) válido. + + + This value is not a valid ISBN-10. + Este valor non é un ISBN-10 válido. + + + This value is not a valid ISBN-13. + Este valor non é un ISBN-13 válido. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Este valor non é nin un ISBN-10 válido nin un ISBN-13 válido. + + + This value is not a valid ISSN. + Este valor non é un ISSN válido. + + + This value is not a valid currency. + Este valor non é unha moeda válida. + + + This value should be equal to {{ compared_value }}. + Este valor debería ser igual a {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Este valor debería ser maior que {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Este valor debería ser maior ou igual que {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor debería ser identico a {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Este valor debería ser menor que {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Este valor debería ser menor ou igual que {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Este valor non debería ser igual a {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor non debería ser identico a {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + A proporción da imaxe é demasiado grande ({{ ratio }}). A proporción máxima permitida é {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + A proporción da é demasiado pequena ({{ ratio }}). A proporción mínima permitida é {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + A imaxe é cadrada ({{ width }}x{{ height }}px). As imáxenes cadradas non están permitidas. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + A imaxe está orientada horizontalmente ({{ width }}x{{ height }}px). As imáxenes orientadas horizontalmente non están permitidas. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + A imaxe está orientada verticalmente ({{ width }}x{{ height }}px). As imáxenes orientadas verticalmente non están permitidas. + + + An empty file is not allowed. + Non está permitido un arquivo baleiro. + + + The host could not be resolved. + Non se puido resolver o host. + + + This value does not match the expected {{ charset }} charset. + A codificación de caracteres para este valor debería ser {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Non é un Código de Identificación Bancaria (BIC) válido. + + + Error + Erro + + + This is not a valid UUID. + Isto non é un UUID válido. + + + This value should be a multiple of {{ compared_value }}. + Este valor debería ser multiplo de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Este Código de identificación bancaria (BIC) non está asociado co IBAN {{ iban }}. + + + This value should be valid JSON. + Este valor debería ser un JSON válido. + + + This collection should contain only unique elements. + Esta colección só debería ter elementos únicos. + + + This value should be positive. + Este valor debería ser positivo. + + + This value should be either positive or zero. + Este valor debe ser positivo ou igual a cero. + + + This value should be negative. + Este valor debe ser negativo. + + + This value should be either negative or zero. + Este valor debe ser negativo ou igual a cero. + + + This value is not a valid timezone. + Este valor non é unha zona horaria válida. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Este contrasinal non se pode usar porque está incluído nunha lista de contrasinais públicos obtidos grazas a fallos de seguridade noutros sitios e aplicacións. Utiliza outro contrasinal. + + + This value should be between {{ min }} and {{ max }}. + Este valor debe estar comprendido entre {{ min }} e {{ max }}. + + + This value is not a valid hostname. + Este valor non é un nome de host válido. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + O número de elementos desta colección debería ser múltiplo de {{compare_value}}. + + + This value should satisfy at least one of the following constraints: + Este valor debe cumprir polo menos unha das seguintes restricións: + + + Each element of this collection should satisfy its own set of constraints. + Cada elemento desta colección debe satisfacer o seu propio conxunto de restricións. + + + This value is not a valid International Securities Identification Number (ISIN). + Este valor non é un número de identificación de valores internacionais (ISIN) válido. + + + This value should be a valid expression. + Este valor debe ser unha expresión válida. + + + This value is not a valid CSS color. + Este valor non é unha cor CSS válida. + + + This value is not a valid CIDR notation. + Este valor non ten unha notación CIDR válida. + + + The value of the netmask should be between {{ min }} and {{ max }}. + O valor da máscara de rede debería estar entre {{ min }} e {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf new file mode 100644 index 00000000000..4c10d6462be --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + הערך צריך להיות שקר. + + + This value should be true. + הערך צריך להיות ×מת. + + + This value should be of type {{ type }}. + הערך צריך להיות מסוג {{ type }}. + + + This value should be blank. + הערך צריך להיות ריק. + + + The value you selected is not a valid choice. + הערך שבחרת ×ינו חוקי. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + ×תה צריך לבחור לפחות {{ limit }} ×פשרויות.|×תה צריך לבחור לפחות {{ limit }} ×פשרויות. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + ×תה צריך לבחור לכל היותר {{ limit }} ×פשרויות.|×תה צריך לבחור לכל היותר {{ limit }} ×פשרויות. + + + One or more of the given values is invalid. + ×חד ×ו יותר ×ž×”×¢×¨×›×™× ×ינו חוקי. + + + This field was not expected. + שדה ×–×” ×œ× ×”×™×” צפוי + + + This field is missing. + שדה ×–×” חסר. + + + This value is not a valid date. + הערך ×ינו ת×ריך חוקי. + + + This value is not a valid datetime. + הערך ×ינו ת×ריך ושעה חוקיי×. + + + This value is not a valid email address. + כתובת המייל ××™× ×” תקינה. + + + The file could not be found. + הקובץ ×œ× × ×ž×¦×. + + + The file is not readable. + ×œ× × ×™×ª×Ÿ ×œ×§×¨×•× ×ת הקובץ. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + הקובץ גדול מדי ({{ size }} {{ suffix }}). הגודל המרבי המותר ×”×•× {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + סוג MIME של הקובץ ×ינו חוקי ({{ type }}). ×ž×•×ª×¨×™× ×¡×•×’×™ MIME {{ types }}. + + + This value should be {{ limit }} or less. + הערך צריך להכיל {{ limit }} ×ª×•×•×™× ×œ×›×œ היותר. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + הערך ×רוך מידי. ×”×•× ×¦×¨×™×š להכיל {{ limit }} ×ª×•×•×™× ×œ×›×œ היותר.|הערך ×רוך מידי. ×”×•× ×¦×¨×™×š להכיל {{ limit }} ×ª×•×•×™× ×œ×›×œ היותר. + + + This value should be {{ limit }} or more. + הערך צריך להכיל {{ limit }} ×ª×•×•×™× ×œ×¤×—×•×ª. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + הערך קצר מידי. ×”×•× ×¦×¨×™×š להכיל {{ limit }} ×ª×•×•×™× ×œ×¤×—×•×ª.|הערך קצר מידי. הערך צריך להכיל {{ limit }} ×ª×•×•×™× ×œ×¤×—×•×ª. + + + This value should not be blank. + הערך ×œ× ×מור להיות ריק. + + + This value should not be null. + הערך ×œ× ×מור להיות ריק. + + + This value should be null. + הערך צריך להיות ריק. + + + This value is not valid. + הערך ×ינו חוקי. + + + This value is not a valid time. + הערך ×ינו זמן תקין. + + + This value is not a valid URL. + ×–×ת ××™× ×” כתובת ×תר תקינה. + + + The two values should be equal. + שני ×”×¢×¨×›×™× ×¦×¨×™×›×™× ×œ×”×™×•×ª שווי×. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + הקובץ גדול מדי. הגודל המרבי המותר ×”×•× {{ limit }} {{ suffix }}. + + + The file is too large. + הקובץ גדול מדי. + + + The file could not be uploaded. + ×œ× × ×™×ª×Ÿ לעלות ×ת הקובץ. + + + This value should be a valid number. + הערך צריך להיות מספר חוקי. + + + This file is not a valid image. + הקובץ ×”×–×” ×ינו תמונה תקינה. + + + This is not a valid IP address. + זו ××™× ×” כתובת IP חוקית. + + + This value is not a valid language. + הערך ×ינו שפה חוקית. + + + This value is not a valid locale. + הערך ×ינו ×זור תקף. + + + This value is not a valid country. + הערך ×ינו ×רץ חוקית. + + + This value is already used. + הערך כבר בשימוש. + + + The size of the image could not be detected. + ×œ× × ×™×ª×Ÿ לקבוע ×ת גודל התמונה. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + רוחב התמונה גדול מדי ({{ width }}px). הרוחב המקסימלי ×”×•× {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + רוחב התמונה קטן מדי ({{ width }}px). הרוחב המינימלי ×”×•× {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + גובה התמונה גדול מדי ({{ height }}px). הגובה המקסימלי ×”×•× {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + גובה התמונה קטן מדי ({{ height }}px). הגובה המינימלי ×”×•× {{ min_height }}px. + + + This value should be the user's current password. + הערך צריך להיות סיסמת המשתמש הנוכחי. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + הערך צריך להיות בדיוק {{ limit }} תווי×.|הערך צריך להיות בדיוק {{ limit }} תווי×. + + + The file was only partially uploaded. + הקובץ הועלה ב×ופן חלקי. + + + No file was uploaded. + הקובץ ×œ× ×”×•×¢×œ×”. + + + No temporary folder was configured in php.ini. + ×œ× ×”×•×’×“×¨×” תיקייה זמנית ב php.ini. + + + Cannot write temporary file to disk. + ×œ× × ×™×ª×Ÿ לכתוב קובץ זמני לדיסק. + + + A PHP extension caused the upload to fail. + סיומת PHP ×’×¨× ×œ×”×¢×œ××” להיכשל. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + ×”×וסף ×מור להכיל {{ limit }} ××œ×ž× ×˜×™× ×ו יותר.|×”×וסף ×מור להכיל {{ limit }} ××œ×ž× ×˜×™× ×ו יותר. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + ×”×וסף ×מור להכיל {{ limit }} ××œ×ž× ×˜×™× ×ו פחות.|×”×וסף ×מור להכיל {{ limit }} ××œ×ž× ×˜×™× ×ו פחות. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + ×”×וסף צריך להכיל בדיוק {{ limit }} ×למנטי×.|×”×וסף צריך להכיל בדיוק {{ limit }} ×למנטי×. + + + Invalid card number. + מספר הכרטיס ×ינו חוקי. + + + Unsupported card type or invalid card number. + סוג הכרטיס ×ינו נתמך ×ו ×œ× ×—×•×§×™. + + + This is not a valid International Bank Account Number (IBAN). + מספר חשבון בנק בינל×ומי ×ינו חוקי (IBAN). + + + This value is not a valid ISBN-10. + הערך ×ינו ערך ISBN-10 חוקי. + + + This value is not a valid ISBN-13. + הערך ×ינו ערך ISBN-13 חוקי. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + הערך ×ינו ערך ISBN-10 חוקי ×ו ערך ISBN-13 חוקי. + + + This value is not a valid ISSN. + הערך ×ינו ערך ISSN חוקי. + + + This value is not a valid currency. + הערך ×ינו ערך מטבע חוקי. + + + This value should be equal to {{ compared_value }}. + הערך חייב להיות שווה ל {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + הערך חייב להיות גדול מ {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + הערך חייב להיות גדול ×ו שווה ל {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + הערך חייב להיות ×–×”×” ל {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + הערך חייב להיות קטן מ {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + הערך חייב להיות קטן ×ו שווה ל {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + הערך חייב להיות ×œ× ×©×•×•×” ל {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + הערך חייב להיות ×œ× ×–×”×” ל {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + היחס של התמונה ×”×•× ×’×“×•×œ מדי ({{ ratio }}). היחס המקסימלי ×”×פשרי ×”×•× {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + היחס של התמונה ×”×•× ×§×˜×Ÿ מדי ({{ ratio }}). היחס המינימלי ×”×פשרי ×”×•× {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + התמונה מרובעת ({{ width }}x{{ height }}px). ×סורות תמונות מרובעות. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + התמונה ×”×™× ×œ×¨×•×—×‘ ({{ width }}x{{ height }}px). ×סורות תמונות לרוחב. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + התמונה ×”×™× ×œ×ורך ({{ width }}x{{ height }}px). ×סורות תמונות ל×ורך. + + + An empty file is not allowed. + ×סור קובץ ריק. + + + The host could not be resolved. + ×œ× ×”×™×™×ª×” ×פשרות לזהות ×ת המ×רח. + + + This value does not match the expected {{ charset }} charset. + הערך ×ינו תו×× ×œ×ž×¢×¨×š ×”×ª×•×•×™× {{ charset }} הצפוי. + + + This is not a valid Business Identifier Code (BIC). + קוד זיהוי עסקי ×ינו חוקי (BIC). + + + Error + שגי××” + + + This is not a valid UUID. + הערך ×ינו ערך UUID חוקי. + + + This value should be a multiple of {{ compared_value }}. + הערך חייב להיות כפולה של {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + הקוד זיהוי עסקי (BIC) ×ינו משוייך ל IBAN {{ iban }}. + + + This value should be valid JSON. + הערך ×ינו ערך JSON תקין. + + + This collection should contain only unique elements. + ×”×וסף חייב להכיל רק ××œ×ž× ×˜×™× ×™×™×—×•×“×™×™×. + + + This value should be positive. + הערך חייב להיות חיובי. + + + This value should be either positive or zero. + הערך חייב להיות חיובי ×ו ×פס. + + + This value should be negative. + הערך חייב להיות שלילי. + + + This value should be either negative or zero. + הערך חייב להיות שלילי ×ו ×פס. + + + This value is not a valid timezone. + הערך ×ינו ×זור זמן תקין. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + ×¡×™×¡×ž× ×–×• הודלפה בהדלפת מידע, ×סור להשתמש בה. ×× × ×”×©×ª×ž×© בסיסמה ×חרת. + + + This value should be between {{ min }} and {{ max }}. + הערך חייב להיות בין {{ min }} ו- {{ max }}. + + + This value is not a valid hostname. + ערך ×–×” ×ינו ×©× ×ž×רח חוקי. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + מספר ×”××œ×ž× ×˜×™× ×‘×וסף ×–×” צריך להיות מכפיל של {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + ערך ×–×” ×מור לעמוד לפחות ב×חד התנ××™× ×”×‘××™×: + + + Each element of this collection should satisfy its own set of constraints. + כל ×למנט ב×וסף ×–×” ×מור לעמוד בקבוצת התנ××™× ×©×œ×•. + + + This value is not a valid International Securities Identification Number (ISIN). + ערך ×–×” ×ינו מספר זיהוי ניירות ערך בינל×ומי תקף (ISIN). + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf new file mode 100644 index 00000000000..34384b40155 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Ova vrijednost treba biti netoÄna (false). + + + This value should be true. + Ova vrijednost treba biti toÄna (true). + + + This value should be of type {{ type }}. + Ova vrijednost treba biti tipa {{ type }}. + + + This value should be blank. + Ova vrijednost treba biti prazna. + + + The value you selected is not a valid choice. + Ova vrijednost nije valjan izbor. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Izaberite barem {{ limit }} mogućnosti. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Izaberite najviÅ¡e {{ limit }} mogućnosti. + + + One or more of the given values is invalid. + Jedna ili viÅ¡e danih vrijednosti nije ispravna. + + + This field was not expected. + Ovo polje nije oÄekivano. + + + This field is missing. + Ovo polje nedostaje. + + + This value is not a valid date. + Ova vrijednost nije ispravan datum. + + + This value is not a valid datetime. + Ova vrijednost nije ispravnog datum-vrijeme formata. + + + This value is not a valid email address. + Ova vrijednost nije ispravna e-mail adresa. + + + The file could not be found. + Datoteka ne može biti pronaÄ‘ena. + + + The file is not readable. + Datoteka nije Äitljiva. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Datoteka je prevelika ({{ size }} {{ suffix }}). Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mime tip datoteke nije ispravan ({{ type }}). Dozvoljeni mime tipovi su {{ types }}. + + + This value should be {{ limit }} or less. + Ova vrijednost treba biti {{ limit }} ili manje. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ova vrijednost je predugaÄka. Treba imati {{ limit }} znakova ili manje. + + + This value should be {{ limit }} or more. + Ova vrijednost treba biti {{ limit }} ili viÅ¡e. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ova vrijednost je prekratka. Treba imati {{ limit }} znakova ili viÅ¡e. + + + This value should not be blank. + Ova vrijednost ne bi trebala biti prazna. + + + This value should not be null. + Ova vrijednost ne bi trebala biti null. + + + This value should be null. + Ova vrijednost treba biti null. + + + This value is not valid. + Ova vrijednost nije ispravna. + + + This value is not a valid time. + Ova vrijednost nije ispravno vrijeme. + + + This value is not a valid URL. + Ova vrijednost nije ispravan URL. + + + The two values should be equal. + Obje vrijednosti trebaju biti jednake. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Ova datoteka je prevelika. Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. + + + The file is too large. + Ova datoteka je prevelika. + + + The file could not be uploaded. + Ova datoteka ne može biti prenesena. + + + This value should be a valid number. + Ova vrijednost treba biti ispravan broj. + + + This file is not a valid image. + Ova datoteka nije ispravna slika. + + + This is not a valid IP address. + Ovo nije ispravna IP adresa. + + + This value is not a valid language. + Ova vrijednost nije ispravan jezik. + + + This value is not a valid locale. + Ova vrijednost nije ispravana regionalna oznaka. + + + This value is not a valid country. + Ova vrijednost nije ispravna država. + + + This value is already used. + Ova vrijednost je već iskoriÅ¡tena. + + + The size of the image could not be detected. + VeliÄina slike se ne može odrediti. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Å irina slike je prevelika ({{ width }}px). Najveća dozvoljena Å¡irina je {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Å irina slike je premala ({{ width }}px). Najmanja dozvoljena Å¡irina je {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Visina slike je prevelika ({{ height }}px). Najveća dozvoljena visina je {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Visina slike je premala ({{ height }}px). Najmanja dozvoljena visina je {{ min_height }}px. + + + This value should be the user's current password. + Ova vrijednost treba biti trenutna korisniÄka lozinka. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ova vrijednost treba imati toÄno {{ limit }} znakova. + + + The file was only partially uploaded. + Datoteka je samo djelomiÄno prenesena. + + + No file was uploaded. + Niti jedna datoteka nije prenesena. + + + No temporary folder was configured in php.ini. + U php.ini datoteci nije konfiguriran privremeni direktorij. + + + Cannot write temporary file to disk. + Ne mogu zapisati privremenu datoteku na disk. + + + A PHP extension caused the upload to fail. + Prijenos datoteke nije uspio zbog PHP ekstenzije. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ova kolekcija treba sadržavati {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija treba sadržavati {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija treba sadržavati {{ limit }} ili viÅ¡e elemenata. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ova kolekcija treba sadržavati {{ limit }} ili manje elemenata.|Ova kolekcija treba sadržavati {{ limit }} ili manje elemenata.|Ova kolekcija treba sadržavati {{ limit }} ili manje elemenata. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ova kolekcija treba sadržavati toÄno {{ limit }} element.|Ova kolekcija treba sadržavati toÄno {{ limit }} elementa.|Ova kolekcija treba sadržavati toÄno {{ limit }} elemenata. + + + Invalid card number. + Neispravan broj kartice. + + + Unsupported card type or invalid card number. + Tip kartice nije podržan ili je broj kartice neispravan. + + + This is not a valid International Bank Account Number (IBAN). + Ova vrijednost nije ispravan meÄ‘unarodni broj bankovnog raÄuna (IBAN). + + + This value is not a valid ISBN-10. + Ova vrijednost nije ispravan ISBN-10. + + + This value is not a valid ISBN-13. + Ova vrijednost nije ispravan ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ova vrijednost nije ispravan ISBN-10 niti ISBN-13. + + + This value is not a valid ISSN. + Ova vrijednost nije ispravan ISSN. + + + This value is not a valid currency. + Ova vrijednost nije ispravna valuta. + + + This value should be equal to {{ compared_value }}. + Ova vrijednost treba biti jednaka {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ova vrijednost treba biti veća od {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ova vrijednost treba biti veća od ili jednaka {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ova vrijednost treba biti {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ova vrijednost treba biti manja od {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ova vrijednost treba biti manja od ili jednaka {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ova vrijednost treba biti razliÄita od {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ova vrijednost treba biti razliÄita od {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Omjer slike je prevelik ({{ ratio }}). Dozvoljeni maksimalni omjer je {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Omjer slike je premali ({{ ratio }}). Minimalni oÄekivani omjer je {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Slika je kvadratnog oblika ({{ width }}x{{ height }}px). Kvadratne slike nisu dozvoljene. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Slika je orijentirana horizontalno ({{ width }}x{{ height }}px). Horizontalno orijentirane slike nisu dozvoljene. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Slika je orijentirana vertikalno ({{ width }}x{{ height }}px). Vertikalno orijentirane slike nisu dozvoljene. + + + An empty file is not allowed. + Prazna datoteka nije dozvoljena. + + + The host could not be resolved. + Poslužitelj ne može biti pronaÄ‘en. + + + This value does not match the expected {{ charset }} charset. + Ova vrijednost ne odgovara oÄekivanom {{ charset }} znakovnom skupu. + + + This is not a valid Business Identifier Code (BIC). + Ovo nije validan poslovni identifikacijski broj (BIC). + + + Error + GreÅ¡ka + + + This is not a valid UUID. + Ovo nije validan UUID. + + + This value should be a multiple of {{ compared_value }}. + Ova vrijednost treba biti viÅ¡ekratnik od {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Poslovni identifikacijski broj (BIC) nije povezan sa IBAN brojem {{ iban }}. + + + This value should be valid JSON. + Ova vrijednost treba biti validan JSON. + + + This collection should contain only unique elements. + Ova kolekcija treba sadržavati samo unikatne elemente. + + + This value should be positive. + Ova vrijednost treba biti pozitivna. + + + This value should be either positive or zero. + Ova vrijednost treba biti pozitivna ili jednaka nuli. + + + This value should be negative. + Ova vrijednost treba biti negativna. + + + This value should be either negative or zero. + Ova vrijednost treba biti negativna ili jednaka nuli. + + + This value is not a valid timezone. + Ova vrijednost nije validna vremenska zona. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ova lozinka je procurila u nekom od sigurnosnih propusta, te je potrebno koristiti drugu lozinku. + + + This value should be between {{ min }} and {{ max }}. + Ova vrijednost treba biti izmeÄ‘u {{ min }} i {{ max }}. + + + This value is not a valid hostname. + Ova vrijednost nije ispravno ime poslužitelja (engl. hostname). + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Broj elemenata u kolekciji treba biti djeljiv s {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ova vrijednost mora zadovoljiti jedan od sljedećih ograniÄenja: + + + Each element of this collection should satisfy its own set of constraints. + Svaki element ove kolekcije mora zadovoljiti vlastiti skup ograniÄenja. + + + This value is not a valid International Securities Identification Number (ISIN). + Ova vrijednost nije ispravan meÄ‘unarodni identifikacijski broj vrijednosnih papira (ISIN). + + + This value should be a valid expression. + Ova vrijednost mora biti valjani izraz. + + + This value is not a valid CSS color. + Ova vrijednost nije važeća CSS boja. + + + This value is not a valid CIDR notation. + Ova vrijednost nije valjana CIDR notacija. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Vrijednost mrežne maske trebala bi biti izmeÄ‘u {{ min }} i {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf new file mode 100644 index 00000000000..30b0dbedbbf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Ennek az értéknek hamisnak kell lennie. + + + This value should be true. + Ennek az értéknek igaznak kell lennie. + + + This value should be of type {{ type }}. + Ennek az értéknek {{ type }} típusúnak kell lennie. + + + This value should be blank. + Ennek az értéknek üresnek kell lennie. + + + The value you selected is not a valid choice. + A választott érték érvénytelen. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Legalább {{ limit }} értéket kell kiválasztani.|Legalább {{ limit }} értéket kell kiválasztani. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Legfeljebb {{ limit }} értéket lehet kiválasztani.|Legfeljebb {{ limit }} értéket lehet kiválasztani. + + + One or more of the given values is invalid. + A megadott értékek közül legalább egy érvénytelen. + + + This field was not expected. + Nem várt mezÅ‘. + + + This field is missing. + Ez a mezÅ‘ hiányzik. + + + This value is not a valid date. + Ez az érték nem egy érvényes dátum. + + + This value is not a valid datetime. + Ez az érték nem egy érvényes idÅ‘pont. + + + This value is not a valid email address. + Ez az érték nem egy érvényes e-mail cím. + + + The file could not be found. + A fájl nem található. + + + The file is not readable. + A fájl nem olvasható. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + A fájl túl nagy ({{ size }} {{ suffix }}). A legnagyobb megengedett méret {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + A fájl MIME típusa érvénytelen ({{ type }}). Az engedélyezett MIME típusok: {{ types }}. + + + This value should be {{ limit }} or less. + Ez az érték legfeljebb {{ limit }} lehet. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ez az érték túl hosszú. Legfeljebb {{ limit }} karaktert tartalmazhat.|Ez az érték túl hosszú. Legfeljebb {{ limit }} karaktert tartalmazhat. + + + This value should be {{ limit }} or more. + Ez az érték legalább {{ limit }} kell, hogy legyen. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ez az érték túl rövid. Legalább {{ limit }} karaktert kell tartalmaznia.|Ez az érték túl rövid. Legalább {{ limit }} karaktert kell tartalmaznia. + + + This value should not be blank. + Ez az érték nem lehet üres. + + + This value should not be null. + Ez az érték nem lehet null. + + + This value should be null. + Ennek az értéknek nullnak kell lennie. + + + This value is not valid. + Ez az érték nem érvényes. + + + This value is not a valid time. + Ez az érték nem egy érvényes idÅ‘pont. + + + This value is not a valid URL. + Ez az érték nem egy érvényes URL. + + + The two values should be equal. + A két értéknek azonosnak kell lennie. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + A fájl túl nagy. A megengedett maximális méret: {{ limit }} {{ suffix }}. + + + The file is too large. + A fájl túl nagy. + + + The file could not be uploaded. + A fájl nem tölthetÅ‘ fel. + + + This value should be a valid number. + Ennek az értéknek érvényes számnak kell lennie. + + + This file is not a valid image. + Ez a fájl nem egy érvényes kép. + + + This is not a valid IP address. + Ez az érték nem egy érvényes IP cím. + + + This value is not a valid language. + Ez az érték nem egy érvényes nyelv. + + + This value is not a valid locale. + Ez az érték nem egy érvényes területi beállítás. + + + This value is not a valid country. + Ez az érték nem egy érvényes ország. + + + This value is already used. + Ez az érték már használatban van. + + + The size of the image could not be detected. + A kép méretét nem lehet megállapítani. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A kép szélessége túl nagy ({{ width }}px). A megengedett legnagyobb szélesség {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A kép szélessége túl kicsi ({{ width }}px). Az elvárt legkisebb szélesség {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A kép magassága túl nagy ({{ height }}px). A megengedett legnagyobb magasság {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A kép magassága túl kicsi ({{ height }}px). Az elvárt legkisebb magasság {{ min_height }}px. + + + This value should be the user's current password. + Ez az érték a felhasználó jelenlegi jelszavával kell megegyezzen. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ennek az értéknek pontosan {{ limit }} karaktert kell tartalmaznia.|Ennek az értéknek pontosan {{ limit }} karaktert kell tartalmaznia. + + + The file was only partially uploaded. + A fájl csak részben lett feltöltve. + + + No file was uploaded. + Nem lett fájl feltöltve. + + + No temporary folder was configured in php.ini. + Nincs ideiglenes könyvtár beállítva a php.ini-ben. + + + Cannot write temporary file to disk. + Az ideiglenes fájl nem írható a lemezre. + + + A PHP extension caused the upload to fail. + Egy PHP bÅ‘vítmény miatt a feltöltés nem sikerült. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ennek a gyűjteménynek legalább {{ limit }} elemet kell tartalmaznia.|Ennek a gyűjteménynek legalább {{ limit }} elemet kell tartalmaznia. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ez a gyűjtemény legfeljebb {{ limit }} elemet tartalmazhat.|Ez a gyűjtemény legfeljebb {{ limit }} elemet tartalmazhat. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ennek a gyűjteménynek pontosan {{ limit }} elemet kell tartalmaznia.|Ennek a gyűjteménynek pontosan {{ limit }} elemet kell tartalmaznia. + + + Invalid card number. + Érvénytelen kártyaszám. + + + Unsupported card type or invalid card number. + Nem támogatott kártyatípus vagy érvénytelen kártyaszám. + + + This is not a valid International Bank Account Number (IBAN). + Érvénytelen nemzetközi bankszámlaszám (IBAN). + + + This value is not a valid ISBN-10. + Ez az érték nem egy érvényes ISBN-10. + + + This value is not a valid ISBN-13. + Ez az érték nem egy érvényes ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ez az érték nem egy érvényes ISBN-10 vagy ISBN-13. + + + This value is not a valid ISSN. + Ez az érték nem egy érvényes ISSN. + + + This value is not a valid currency. + Ez az érték nem egy érvényes pénznem. + + + This value should be equal to {{ compared_value }}. + Ez az érték legyen {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ez az érték nagyobb legyen, mint {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ez az érték nagyobb vagy egyenlÅ‘ legyen, mint {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ez az érték ugyanolyan legyen, mint {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ez az érték kisebb legyen, mint {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ez az érték kisebb vagy egyenlÅ‘ legyen, mint {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ez az érték ne legyen {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ez az érték ne legyen ugyanolyan, mint {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + A képarány túl nagy ({{ ratio }}). A megengedett legnagyobb képarány {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + A képarány túl kicsi ({{ ratio }}). A megengedett legkisebb képarány {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + A kép négyzet alakú ({{ width }}x{{ height }}px). A négyzet alakú képek nem engedélyezettek. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + A kép fekvÅ‘ tájolású ({{ width }}x{{ height }}px). A fekvÅ‘ tájolású képek nem engedélyezettek. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + A kép álló tájolású ({{ width }}x{{ height }}px). Az álló tájolású képek nem engedélyezettek. + + + An empty file is not allowed. + Ãœres fájl nem megengedett. + + + The host could not be resolved. + Az állomásnevet nem lehet feloldani. + + + This value does not match the expected {{ charset }} charset. + Ez az érték nem az elvárt {{ charset }} karakterkódolást használja. + + + This is not a valid Business Identifier Code (BIC). + Érvénytelen nemzetközi bankazonosító kód (BIC/SWIFT). + + + Error + Hiba + + + This is not a valid UUID. + Érvénytelen egyedi azonosító (UUID). + + + This value should be a multiple of {{ compared_value }}. + Ennek az értéknek oszthatónak kell lennie a következÅ‘vel: {{ compared_value }} + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ez a Bankazonosító kód (BIC) nem kapcsolódik az IBAN kódhoz ({{ iban }}). + + + This value should be valid JSON. + Ez az érték érvényes JSON kell, hogy legyen. + + + This value should be positive. + Ennek az értéknek pozitívnak kell lennie. + + + This value should be either positive or zero. + Ennek az értéknek pozitívnak vagy nullának kell lennie. + + + This value should be negative. + Ennek az értéknek negatívnak kell lennie. + + + This value should be either negative or zero. + Ennek az értéknek negatívnak vagy nullának kell lennie. + + + This collection should contain only unique elements. + Ez a gyűjtemény csak egyedi elemeket tartalmazhat. + + + This value is not a valid timezone. + Ez az érték nem egy érvényes idÅ‘zóna. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ez a jelszó korábban egy adatvédelmi incidens során illetéktelenek kezébe került, így nem használható. Kérjük, használjon másik jelszót. + + + This value should be between {{ min }} and {{ max }}. + Ennek az értéknek {{ min }} és {{ max }} között kell lennie. + + + This value is not a valid hostname. + Ez az érték nem egy érvényes állomásnév (hosztnév). + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + A gyűjteményben lévÅ‘ elemek számának oszthatónak kell lennie a következÅ‘vel: {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ennek az értéknek meg kell felelni legalább egynek a következÅ‘ feltételek közül: + + + Each element of this collection should satisfy its own set of constraints. + A gyűjtemény minden elemének meg kell felelni a saját feltételeinek. + + + This value is not a valid International Securities Identification Number (ISIN). + Ez az érték nem egy érvényes nemzetközi értékpapír-azonosító szám (ISIN). + + + This value should be a valid expression. + Ennek az értéknek érvényes kifejezésnek kell lennie. + + + This value is not a valid CSS color. + Ez az érték nem egy érvényes CSS szín. + + + This value is not a valid CIDR notation. + Ez az érték nem egy érvényes CIDR jelölés. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Ennek a netmask értéknek {{ min }} és {{ max }} között kell lennie. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf new file mode 100644 index 00000000000..f53df123423 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf @@ -0,0 +1,395 @@ + + + + + + This value should be false. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¯Õ¥Õ²Õ®Ö‰ + + + This value should be true. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ«Ö€Õ¡Õ¯Õ¡Õ¶Ö‰ + + + This value should be of type {{ type }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« {{ type }} Õ¿Õ¥Õ½Õ¡Õ¯Õ«Ö‰ + + + This value should be blank. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¤Õ¡Õ¿Õ¡Ö€Õ¯Ö‰ + + + The value you selected is not a valid choice. + ÕÕ¥Ö€ Õ¨Õ¶Õ¿Ö€Õ¡Õ® Õ¡Ö€ÕªÕ¥Ö„Õ¨ Õ¡Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ Õ¨Õ¶Õ¿Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶ Õ§Ö‰ + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Ô´Õ¸Ö‚Ö„ ÕºÕ¥Õ¿Ö„ Õ§ Õ¨Õ¶Õ¿Ö€Õ¥Ö„ Õ¡Õ´Õ¥Õ¶Õ¡Ö„Õ«Õ¹Õ¨ {{ limit }} Õ¿Õ¡Ö€Õ¢Õ¥Ö€Õ¡Õ¯Õ¶Õ¥Ö€Ö‰ + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Ô´Õ¸Ö‚Ö„ ÕºÕ¥Õ¿Ö„ Õ§ Õ¨Õ¶Õ¿Ö€Õ¥Ö„ Õ¸Õ¹ Õ¡Õ¾Õ¥Õ¬Õ« Ö„Õ¡Õ¶ {{ limit }} Õ¿Õ¡Ö€Õ¢Õ¥Ö€Õ¡Õ¯Õ¶Õ¥Ö€Ö‰ + + + One or more of the given values is invalid. + Õ„Õ¥Õ¯ Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ« Õ¿Ö€Õ¾Õ¡Õ® Õ¡Ö€ÕªÕ¥Ö„Õ¶Õ¥Ö€Õ¨ Õ¡Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ Õ¥Õ¶Ö‰ + + + This field was not expected. + Ô±ÕµÕ½ Õ¤Õ¡Õ·Õ¿Õ¨ Õ¹Õ« Õ½ÕºÕ¡Õ½Õ¾Õ¸Ö‚Õ´Ö‰ + + + This field is missing. + Ô±ÕµÕ½ Õ¤Õ¡Õ·Õ¿Õ¨ Õ¢Õ¡ÖÕ¡Õ¯Õ¡ÕµÕ¸Ö‚Õ´ Õ§Ö‰ + + + This value is not a valid date. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ½Õ­Õ¡Õ¬ Õ¡Õ´Õ½Õ¡Õ©Õ«Õ¾ Õ§Ö‰ + + + This value is not a valid datetime. + Ô±Õ´Õ½Õ¡Õ©Õ¾Õ« Ö‡ ÕªÕ¡Õ´Õ¡Õ¶Õ¡Õ¯Õ« Õ¡Ö€ÕªÕ¥Ö„Õ¨ Õ¡Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ Õ§Ö‰ + + + This value is not a valid email address. + Ô±Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ Õ§Õ¬ÖŠÖƒÕ¸Õ½Õ¿Õ« Õ¡Ö€ÕªÕ¥Ö„Ö‰ + + + The file could not be found. + Õ†Õ«Õ·Ö„Õ¨ Õ¹Õ« Õ£Õ¿Õ¶Õ¾Õ¥Õ¬Ö‰ + + + The file is not readable. + Õ†Õ«Õ·Ö„Õ¨ Õ¡Õ¶Õ¨Õ¶Õ©Õ¥Õ¼Õ¶Õ¥Õ¬Õ« Õ§Ö‰ + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Õ†Õ«Õ·Ö„Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö Õ´Õ¥Õ® Õ§ ({{ size }} {{ suffix }}): Õ„Õ¡Ö„Õ½Õ«Õ´Õ¡Õ¬ Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¥Õ¬Õ« Õ¹Õ¡ÖƒÕ½Õ¨Õ {{ limit }} {{ suffix }}Ö‰ + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + MIME-Õ¿Õ¥Õ½Õ¡Õ¯Õ¨ Õ¡Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ Õ§ Õ§({{ type }}): Õ†Õ«Õ·Ö„Õ¥Ö€Õ« Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¥Õ¬Õ« MIME-Õ¿Õ¥Õ½Õ¡Õ¯Õ¶Õ¥Ö€Õ¶ Õ¥Õ¶: {{ types }}Ö‰ + + + This value should be {{ limit }} or less. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« {{ limit }} Õ¯Õ¡Õ´ ÖƒÕ¸Ö„Ö€Ö‰ + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö Õ¥Ö€Õ¯Õ¡Ö€ Õ§: ÕŠÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« {{ limit }} Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬ Õ½Õ«Õ´Õ¾Õ¸Õ¬Õ¶Õ¥Ö€Ö‰ + + + This value should be {{ limit }} or more. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿ Õ§ Õ¬Õ«Õ¶Õ« {{ limit }} Õ¯Õ¡Õ´ Õ·Õ¡Õ¿Ö‰ + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö Õ¯Õ¡Ö€Õ³ Õ§: ÕŠÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« {{ limit }} Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ« Õ½Õ«Õ´Õ¾Õ¸Õ¬Õ¶Õ¥Ö€Ö‰ + + + This value should not be blank. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹ÕºÕ¥Õ¿Ö„ Õ§ Õ¤Õ¡Õ¿Õ¡Ö€Õ¯ Õ¬Õ«Õ¶Õ«Ö‰ + + + This value should not be null. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« nullÖ‰ + + + This value should be null. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« nullÖ‰ + + + This value is not valid. + Ô±Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ Õ¡Ö€ÕªÕ¥Ö„Ö‰ + + + This value is not a valid time. + ÔºÕ¡Õ´Õ¡Õ¶Õ¡Õ¯Õ« Õ¡Ö€ÕªÕ¥Ö„Õ¨ Õ¡Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ Õ§Ö‰ + + + This value is not a valid URL. + Ô±Ö€ÕªÕ¥Ö„Õ¨ URL Õ¹Õ§Ö‰ + + + The two values should be equal. + ÔµÖ€Õ¯Õ¸Ö‚ Õ¡Ö€ÕªÕ¥Ö„Õ¶Õ¥Ö€Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¶Õ¸Ö‚ÕµÕ¶Õ¨ Õ¬Õ«Õ¶Õ¥Õ¶Ö‰ + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Õ†Õ«Õ·Ö„Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö Õ´Õ¥Õ® Õ§: Õ„Õ¡Ö„Õ½Õ«Õ´Õ¡Õ¬ Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¥Õ¬Õ« Õ¹Õ¡ÖƒÕ½Õ¨ {{ limit }} {{ suffix }} Õ§Ö‰ + + + The file is too large. + Õ†Õ«Õ·Ö„Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö Õ´Õ¥Õ® Õ§Ö‰ + + + The file could not be uploaded. + Õ†Õ«Õ·Ö„Õ¨ Õ¹Õ« Õ¯Õ¡Ö€Õ¸Õ² Õ¢Õ¥Õ¼Õ¶Õ¾Õ¥Õ¬Ö‰ + + + This value should be a valid number. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ©Õ«Õ¾Ö‰ + + + This file is not a valid image. + Õ†Õ«Õ·Ö„Õ¨ Õ¶Õ¯Õ¡Ö€Õ« Õ¾Õ¡Õ¾Õ¥Ö€ Ö†Õ¸Ö€Õ´Õ¡Õ¿ Õ¹Õ§Ö‰ + + + This is not a valid IP address. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ IP Õ°Õ¡Õ½ÖÕ¥ Õ¹Õ§Ö‰ + + + This value is not a valid language. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¬Õ¥Õ¦Õ¸Ö‚ Õ¹Õ§Ö‰ + + + This value is not a valid locale. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ« Õ°Õ¡Õ¶Õ¤Õ«Õ½Õ¡Õ¶Õ¸Ö‚Õ´ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¿Õ¥Õ²Õ¡ÕµÕ¶Õ¡ÖÕ¸Ö‚Õ´Ö‰ + + + This value is not a valid country. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¥Ö€Õ¯Õ«Ö€Ö‰ + + + This value is already used. + Ô±ÕµÕ¤ Õ¡Ö€ÕªÕ¥Ö„Õ¶ Õ¡Ö€Õ¤Õ¥Õ¶ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¾Õ¸Ö‚Õ´ Õ§Ö‰ + + + The size of the image could not be detected. + Õ†Õ¯Õ¡Ö€Õ« Õ¹Õ¡ÖƒÕ½Õ¥Ö€Õ¨ Õ¹Õ½Õ¿Õ¡ÖÕ¾Õ¥Ö Õ¸Ö€Õ¸Õ·Õ¥Õ¬Ö‰ + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Õ†Õ¯Õ¡Ö€Õ« Õ¬Õ¡ÕµÕ¶Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö Õ´Õ¥Õ® Õ§({{ width }}px). Õ„Õ¡Ö„Õ½Õ«Õ´Õ¡Õ¬ Õ¹Õ¡ÖƒÕ¶ Õ§ {{ max_width }}pxÖ‰ + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Õ†Õ¯Õ¡Ö€Õ« Õ¬Õ¡ÕµÕ¶Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö ÖƒÕ¸Ö„Ö€ Õ§ ({{ width }}px). Õ„Õ«Õ¶Õ«Õ´Õ¡Õ¬ Õ¹Õ¡ÖƒÕ¶ Õ§ {{ min_ width }}pxÖ‰ + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Õ†Õ¯Õ¡Ö€Õ« Õ¢Õ¡Ö€Õ±Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö Õ´Õ¥Õ® Õ§ ({{ height }}px). Õ„Õ¡Ö„Õ½Õ«Õ´Õ¡Õ¬ Õ¹Õ¡ÖƒÕ¶ Õ§ {{ max_height }}pxÖ‰ + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Õ†Õ¯Õ¡Ö€Õ« Õ¢Õ¡Ö€Õ±Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ¹Õ¡ÖƒÕ¡Õ¦Õ¡Õ¶Ö ÖƒÕ¸Ö„Ö€ Õ§ ({{ height }}px). Õ„Õ«Õ¶Õ«Õ´Õ¡Õ¬ Õ¹Õ¡ÖƒÕ¶ Õ§ {{ min_height }}pxÖ‰ + + + This value should be the user's current password. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¸Õ²Õ« Õ¶Õ¥Ö€Õ¯Õ¡ Õ®Õ¡Õ®Õ¯Õ¡Õ£Õ«Ö€Õ¨Ö‰ + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¸Ö‚Õ¶Õ¥Õ¶Õ¡ Õ³Õ«Õ·Õ¿ {{ limit }} Õ½Õ«Õ´Õ¾Õ¸Õ¬Õ¶Õ¥Ö€Ö‰ + + + The file was only partially uploaded. + Õ†Õ«Õ·Ö„Õ« Õ´Õ¡Õ½Õ¶Õ¡Õ¯Õ« Õ¢Õ¥Õ¼Õ¶Õ´Õ¡Õ¶ Õ½Õ­Õ¡Õ¬Ö‰ + + + No file was uploaded. + Õ†Õ«Õ·Ö„Õ¨ Õ¹Õ« Õ¢Õ¥Õ¼Õ¶Õ¾Õ¥Õ¬Ö‰ + + + No temporary folder was configured in php.ini. + php.ini Õ¶Õ«Õ·Ö„Õ¸Ö‚Õ´ ÕªÕ¡Õ´Õ¡Õ¶Õ¡Õ¯Õ¡Õ¾Õ¸Ö€ ÕºÕ¡Õ¶Õ¡Õ¯ Õ¶Õ·Õ¾Õ¡Õ® Õ¹Õ§Ö‰ + + + Cannot write temporary file to disk. + ÔºÕ¡Õ´Õ¡Õ¶Õ¡Õ¯Õ¡Õ¾Õ¸Ö€ Õ¶Õ«Õ·Ö„Õ¨ Õ°Õ¶Õ¡Ö€Õ¡Õ¾Õ¸Ö€ Õ¹Õ§ Õ£Ö€Õ¥Õ¬ Õ½Õ¯Õ¡Õ¾Õ¡Õ¼Õ¡Õ¯Õ« Õ¾Ö€Õ¡Ö‰ + + + A PHP extension caused the upload to fail. + PHP Ö†Õ¸Ö€Õ´Õ¡Õ¿Õ¨ Õ¤Õ¡Ö€Õ±Õ¥Õ¬ Õ§ Õ¢Õ¥Õ¼Õ¶Õ´Õ¡Õ¶ Õ¹Õ°Õ¡Õ»Õ¸Õ²Õ´Õ¡Õ¶ ÕºÕ¡Õ¿Õ³Õ¡Õ¼Ö‰ + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ« Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¥Õ¬Õ¾Õ¡Õ®Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« limit }} Õ¿Õ¡Ö€Ö€ Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ«Õ¶Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Õ«Õ¶ Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ«Ö‰ + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰ + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« Õ¸Ö‚Õ²Õ«Õ² {{ limit }} Õ¿Õ¡Ö€Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« Õ¸Ö‚Õ²Õ«Õ² {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰ + + + Invalid card number. + Õ”Õ¡Ö€Õ¿Õ« Õ½Õ­Õ¡Õ¬ Õ°Õ¡Õ´Õ¡Ö€: + + + Unsupported card type or invalid card number. + Õ‰Õ½ÕºÕ¡Õ½Õ¡Ö€Õ¯Õ¾Õ¸Õ² Õ¯Õ¡Õ´ Õ½Õ­Õ¡Õ¬ Ö„Õ¡Ö€Õ¿Õ« Õ°Õ¡Õ´Õ¡Ö€: + + + This is not a valid International Bank Account Number (IBAN). + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ´Õ«Õ»Õ¡Õ¦Õ¡ÕµÕ«Õ¶ Õ¢Õ¡Õ¶Õ¯Õ¡ÕµÕ«Õ¶ Õ°Õ¡Õ·Õ¾Õ« Õ°Õ¡Õ´Õ¡Ö€ Õ¹Õ§ (IBAN)Ö‰ + + + This value is not a valid ISBN-10. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¸Ö‚Õ¶Õ« Õ¡Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ ISBN-10 Õ±Ö‡Õ¡Õ¹Õ¡ÖƒÖ‰ + + + This value is not a valid ISBN-13. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¸Ö‚Õ¶Õ« Õ¡Õ¶Õ¾Õ¡Õ¾Õ¥Ö€ ISBN-13 Õ±Ö‡Õ¡Õ¹Õ¡ÖƒÖ‰ + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ« Õ°Õ¡Õ´Õ¡ÕºÕ¡Õ¿Õ¡Õ½Õ­Õ¡Õ¶Õ¸Ö‚Õ´ ISBN-10 Ö‡ ISBN-13 Õ±Ö‡Õ¡Õ¹Õ¡ÖƒÕ¥Ö€Õ«Õ¶Ö‰ + + + This value is not a valid ISSN. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ« Õ°Õ¡Õ´Õ¡ÕºÕ¡Õ½Õ¿Õ¡Õ½Õ­Õ¡Õ¶Õ¸Ö‚Õ´ ISSN Õ±Ö‡Õ¡Õ¹Õ¡ÖƒÕ«Õ¶Ö‰ + + + This value is not a valid currency. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¿Õ¡Ö€Õ¡Õ¤Ö€Õ¡Õ´ Õ¹Õ§Ö‰ + + + This value should be equal to {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« {{ compared_value }}Ö‰ + + + This value should be greater than {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ´Õ¥Õ® Õ¬Õ«Õ¶Õ«, Ö„Õ¡Õ¶ {{ compared_value }}Ö‰ + + + This value should be greater than or equal to {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ°Õ¡Õ¾Õ¡Õ½Õ¡Ö€ Õ¯Õ¡Õ´ Õ´Õ¥Õ® Ö„Õ¡Õ¶ {{ compared_value }}Ö‰ + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ«Õ¶Õ¹ÕºÕ¥Õ½ {{ compared_value_type }} {{ compared_value }}Ö‰ + + + This value should be less than {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« ÖƒÕ¸Ö„Ö€ Ö„Õ¡Õ¶ {{ compared_value }}Ö‰ + + + This value should be less than or equal to {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« ÖƒÕ¸Ö„Ö€ Õ¯Õ¡Õ´ Õ°Õ¡Õ¾Õ¡Õ½Õ¡Ö€ {{ compared_value }}Ö‰ + + + This value should not be equal to {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ°Õ¡Õ¾Õ¡Õ½Õ¡Ö€ {{ compared_value }}Ö‰ + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¶Õ¸Ö‚Õ¶Õ¨ {{ compared_value_type }} {{ compared_value }}: + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + ÕŠÕ¡Õ¿Õ¯Õ¥Ö€Õ« Õ¯Õ¸Õ²Õ´Õ¥Ö€Õ« Õ°Õ¡Ö€Õ¡Õ¢Õ¥Ö€Õ¡Õ¯ÖÕ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ­Õ«Õ½Õ¿ Õ´Õ¥Õ® Õ§ ({{ ratio }}). Õ„Õ¡Ö„Õ½Õ«Õ´Õ¡Õ¬ Õ°Õ¡Ö€Õ¡Õ¢Õ¥Ö€Õ¡Õ¯ÖÕ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨Õ {{ max_ratio }}Ö‰ + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ÕŠÕ¡Õ¿Õ¯Õ¥Ö€Õ« Õ¯Õ¸Õ²Õ´Õ¥Ö€Õ« Õ°Õ¡Ö€Õ¡Õ¢Õ¥Ö€Õ¡Õ¯ÖÕ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ Õ­Õ«Õ½Õ¿ ÖƒÕ¸Ö„Ö€ Õ§ ({{ ratio }}). Õ„Õ«Õ¶Õ«Õ´Õ¡Õ¬ Õ°Õ¡Ö€Õ¡Õ¢Õ¥Ö€Õ¡Õ¯ÖÕ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨Õ {{ min_ratio }}Ö‰ + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + ÕŠÕ¡Õ¿Õ¯Õ¥Ö€Õ¨ Ö„Õ¡Õ¼Õ¡Õ¯Õ¸Ö‚Õ½Õ« Õ§({{ width }}x{{ height }}px)Ö‰ Õ”Õ¡Õ¼Õ¡Õ¯Õ¸Ö‚Õ½Õ« Õ¶Õ¯Õ¡Ö€Õ¶Õ¥Ö€ Õ¹Õ¥Õ¶ Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¾Õ¸Ö‚Õ´Ö‰ + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + ÕŠÕ¡Õ¿Õ¯Õ¥Ö€Õ¨ Õ¡Õ¬Õ¢Õ¸Õ´Õ¡ÕµÕ«Õ¶ Õ¸Ö‚Õ²Õ²Õ¾Õ¡Õ®Õ¸Ö‚Õ©ÕµÕ¡Õ¶ Õ§({{ width }}x{{ height }}px)․ Õ¤Õ¡ Õ¹Õ« Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¾Õ¸Ö‚Õ´Ö‰ + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + ÕŠÕ¡Õ¿Õ¯Õ¥Ö€Õ¨ ÕºÕ¸Ö€Õ¿Ö€Õ¥Õ¿Õ¡ÕµÕ«Õ¶ Õ¸Ö‚Õ²Õ²Õ¾Õ¡Õ®Õ¸Ö‚Õ©ÕµÕ¡Õ¶ Õ§ ({{ width }}x{{ height }}px)․ Õ¤Õ¡ Õ¹Õ« Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¾Õ¸Ö‚Õ´Ö‰ + + + An empty file is not allowed. + Ô´Õ¡Õ¿Õ¡Ö€Õ¯ Õ¶Õ«Õ·Ö„ Õ¹Õ« Õ©Õ¸Ö‚ÕµÕ¬Õ¡Õ¿Ö€Õ¾Õ¸Ö‚Õ´Ö‰ + + + The host could not be resolved. + Õ€Õ¸Õ½Õ©Õ« Õ¡Õ¶Õ¸Ö‚Õ¶Õ¨ Õ°Õ¶Õ¡Ö€Õ¡Õ¾Õ¸Ö€ Õ¹Õ« ÕºÕ¡Ö€Õ¦Õ¥Õ¬Ö‰ + + + This value does not match the expected {{ charset }} charset. + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ« Õ°Õ¡Õ´Õ¨Õ¶Õ¯Õ¶Õ¸Ö‚Õ´ {{ charset }} Õ¯Õ¸Õ¤Õ¡Õ¾Õ¸Ö€Õ´Õ¡Õ¶ Õ°Õ¥Õ¿Ö‰ + + + This is not a valid Business Identifier Code (BIC). + ÕÕ¡ Õ¾Õ¡Õ¾Õ¥Ö€ Business Identifier Code (BIC) Õ¹Õ§Ö‰ + + + Error + ÕÕ­Õ¡Õ¬ + + + This is not a valid UUID. + ÕÕ¡ Õ¾Õ¡Õ¾Õ¥Ö€ UUID Õ¹Õ§Ö‰ + + + This value should be a multiple of {{ compared_value }}. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¢Õ¡Õ¦Õ´Õ¡Õ¯Õ« {{ compared_value }}Ö‰ + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ô²Õ«Õ¦Õ¶Õ¥Õ½Õ« Õ¶Õ¸Ö‚ÕµÕ¶Õ¡Õ¯Õ¡Õ¶Õ¡ÖÕ´Õ¡Õ¶ Õ¯Õ¸Õ¤Õ¨ (BIC) Õ¯Õ¡ÕºÕ¾Õ¡Õ® Õ¹Õ§ IBAN- Õ« Õ°Õ¥Õ¿ {{ iban }}Ö‰ + + + This value should be valid JSON. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¾Õ¡Õ¾Õ¥Ö€ JSONÖ‰ + + + This collection should contain only unique elements. + Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« Õ´Õ«Õ¡ÕµÕ¶ Õ¥Õ¦Õ¡Õ¯Õ« Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰ + + + This value should be positive. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¤Ö€Õ¡Õ¯Õ¡Õ¶Ö‰ + + + This value should be either positive or zero. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¤Ö€Õ¡Õ¯Õ¡Õ¶ Õ¯Õ¡Õ´ Õ¦Ö€Õ¸ÕµÕ¡Õ¯Õ¡Õ¶Ö‰ + + + This value should be negative. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¢Õ¡ÖÕ¡Õ½Õ¡Õ¯Õ¡Õ¶Ö‰ + + + This value should be either negative or zero. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¢Õ¡ÖÕ¡Õ½Õ¡Õ¯Õ¡Õ¶ Õ¯Õ¡Õ´ Õ¦Ö€Õ¸ÕµÕ¡Õ¯Õ¡Õ¶Ö‰ + + + This value is not a valid timezone. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ ÕªÕ¡Õ´Õ¡ÕµÕ«Õ¶ Õ£Õ¸Õ¿Õ« Õ¹Õ§Ö‰ + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ô³Õ¡Õ²Õ¿Õ¶Õ¡Õ¢Õ¡Õ¼Õ¨ Õ£Õ¿Õ¶Õ¾Õ¥Õ¬ Õ§ Õ¿Õ¾ÕµÕ¡Õ¬Õ¶Õ¥Ö€Õ« Õ¡Ö€Õ¿Õ¡Õ°Õ¸Õ½Ö„Õ¸Ö‚Õ´. Õ¡ÕµÕ¶ Õ¹ÕºÕ¥Õ¿Ö„ Õ§ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¾Õ«: Ô½Õ¶Õ¤Ö€Õ¸Ö‚Õ´ Õ¥Õ¶Ö„ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¥Õ¬ Õ´Õ¥Õ¯ Õ¡ÕµÕ¬ Õ£Õ¡Õ²Õ¿Õ¶Õ¡Õ¢Õ¡Õ¼Ö‰ + + + This value should be between {{ min }} and {{ max }}. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« {{ min }}-Õ« Ö‡ {{ max }}-Õ« Õ´Õ«Õ»Ö‡Ö‰ + + + This value is not a valid hostname. + Ô±ÕµÕ½ Õ°Õ¸Õ½Õ¿Õ« Õ¡Õ¶Õ¸Ö‚Õ¶Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¹Õ§Ö‰ + + + The number of elements in this collection should be a multiple of {{ compared_value }}․ + Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ´Õ¢Õ« Õ¿Õ¡Ö€Ö€Õ¥Ö€Õ« Ö„Õ¡Õ¶Õ¡Õ¯Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ°Õ¡Õ¾Õ¡Õ½Õ¡Ö€ Õ¬Õ«Õ¶Õ« {{ compared_value }}-Õ« Õ¢Õ¡Õ¦Õ´Õ¡ÕºÕ¡Õ¿Õ«Õ¯Õ¶Õ¥Ö€Õ«Õ¶Ö‰ + + + This value should satisfy at least one of the following constraints: + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¢Õ¡Õ¾Õ¡Ö€Õ¡Ö€Õ« Õ°Õ¥Õ¿Ö‡ÕµÕ¡Õ¬ Õ½Õ¡Õ°Õ´Õ¡Õ¶Õ¡ÖƒÕ¡Õ¯Õ¸Ö‚Õ´Õ¶Õ¥Ö€Õ«Ö Õ¡Õ¼Õ¶Õ¾Õ¡Õ¦Õ¶ Õ´Õ¥Õ¯Õ¨Ö‰ + + + Each element of this collection should satisfy its own set of constraints. + Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ´Õ¢Õ« ÕµÕ¸Ö‚Ö€Õ¡Ö„Õ¡Õ¶Õ¹ÕµÕ¸Ö‚Ö€ Õ¿Õ¡Ö€Ö€ ÕºÕ¥Õ¿Ö„ Õ§ Õ¢Õ¡Õ¾Õ¡Ö€Õ¡Ö€Õ« Õ«Ö€ Õ½Õ¥ÖƒÕ¡Õ¯Õ¡Õ¶ Õ½Õ¡Õ°Õ´Õ¡Õ¶Õ¡ÖƒÕ¡Õ¯Õ¸Ö‚Õ´Õ¶Õ¥Ö€Õ¨Ö‰ + + + This value is not a valid International Securities Identification Number (ISIN). + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ Õ¡Ö€ÕªÕ¥Õ©Õ²Õ©Õ¥Ö€Õ« Õ¶Õ¸Ö‚ÕµÕ¶Õ¡Õ¯Õ¡Õ¶Õ¡ÖÕ´Õ¡Õ¶ Õ´Õ«Õ»Õ¡Õ¦Õ£Õ¡ÕµÕ«Õ¶ Õ°Õ¡Õ´Õ¡Ö€Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¹Õ§(ISIN)Ö‰ + + + This value should be a valid expression. + Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¾Õ¡Õ¾Õ¥Ö€ Õ¡Ö€Õ¿Õ¡Õ°Õ¡ÕµÕ¿Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶: + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf new file mode 100644 index 00000000000..1687f330bc5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Nilai ini harus bernilai salah. + + + This value should be true. + Nilai ini harus bernilai benar. + + + This value should be of type {{ type }}. + Nilai ini harus bertipe {{ type }}. + + + This value should be blank. + Nilai ini harus kosong. + + + The value you selected is not a valid choice. + Nilai yang dipilih tidak tepat. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Anda harus memilih paling tidak {{ limit }} pilihan. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Anda harus memilih paling banyak {{ limit }} pilihan. + + + One or more of the given values is invalid. + Satu atau lebih nilai yang diberikan tidak sah. + + + This field was not expected. + Ruas ini tidak diharapkan. + + + This field is missing. + Ruas ini hilang. + + + This value is not a valid date. + Nilai ini bukan merupakan tanggal yang sah. + + + This value is not a valid datetime. + Nilai ini bukan merupakan tanggal dan waktu yang sah. + + + This value is not a valid email address. + Nilai ini bukan alamat surel yang sah. + + + The file could not be found. + Berkas tidak dapat ditemukan. + + + The file is not readable. + Berkas tidak dapat dibaca. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Ukuran berkas terlalu besar ({{ size }} {{ suffix }}). Ukuran maksimum yang diizinkan adalah {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Jenis berkas ({{ type }}) tidak sah. Jenis berkas yang diizinkan adalah {{ types }}. + + + This value should be {{ limit }} or less. + Nilai ini harus {{ limit }} atau kurang. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Nilai ini terlalu panjang. Seharusnya {{ limit }} karakter atau kurang. + + + This value should be {{ limit }} or more. + Nilai ini harus {{ limit }} atau lebih. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Nilai ini terlalu pendek. Seharusnya {{ limit }} karakter atau lebih. + + + This value should not be blank. + Nilai ini tidak boleh kosong. + + + This value should not be null. + Nilai ini tidak boleh 'null'. + + + This value should be null. + Nilai ini harus 'null'. + + + This value is not valid. + Nilai ini tidak sah. + + + This value is not a valid time. + Nilai ini bukan merupakan waktu yang sah. + + + This value is not a valid URL. + Nilai ini bukan URL yang sah. + + + The two values should be equal. + Isi keduanya harus sama. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Ukuran berkas terlalu besar. Ukuran maksimum yang diizinkan adalah {{ limit }} {{ suffix }}. + + + The file is too large. + Ukuran berkas terlalu besar. + + + The file could not be uploaded. + Berkas tidak dapat diunggah. + + + This value should be a valid number. + Nilai ini harus angka yang sah. + + + This file is not a valid image. + Berkas ini tidak termasuk citra. + + + This is not a valid IP address. + Ini bukan alamat IP yang sah. + + + This value is not a valid language. + Nilai ini bukan bahasa yang sah. + + + This value is not a valid locale. + Nilai ini bukan lokal yang sah. + + + This value is not a valid country. + Nilai ini bukan negara yang sah. + + + This value is already used. + Nilai ini sudah digunakan. + + + The size of the image could not be detected. + Ukuran dari citra tidak bisa dideteksi. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Lebar citra terlalu besar ({{ width }}px). Ukuran lebar maksimum adalah {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Lebar citra terlalu kecil ({{ width }}px). Ukuran lebar minimum yang diharapkan adalah {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Tinggi citra terlalu besar ({{ height }}px). Ukuran tinggi maksimum adalah {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Tinggi citra terlalu kecil ({{ height }}px). Ukuran tinggi minimum yang diharapkan adalah {{ min_height }}px. + + + This value should be the user's current password. + Nilai ini harus kata sandi pengguna saat ini. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Nilai ini harus memiliki tepat {{ limit }} karakter. + + + The file was only partially uploaded. + Berkas hanya terunggah sebagian. + + + No file was uploaded. + Tidak ada berkas terunggah. + + + No temporary folder was configured in php.ini. + Direktori sementara tidak dikonfiguasi pada php.ini. + + + Cannot write temporary file to disk. + Tidak dapat menuliskan berkas sementara ke dalam media penyimpanan. + + + A PHP extension caused the upload to fail. + Sebuah ekstensi PHP menyebabkan kegagalan unggah. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Kumpulan ini harus memiliki {{ limit }} elemen atau lebih. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Kumpulan ini harus memiliki kurang dari {{ limit }} elemen. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Kumpulan ini harus memiliki tepat {{ limit }} elemen. + + + Invalid card number. + Nomor kartu tidak sah. + + + Unsupported card type or invalid card number. + Jenis kartu tidak didukung atau nomor kartu tidak sah. + + + This is not a valid International Bank Account Number (IBAN). + Ini bukan Nomor Rekening Bank Internasional (IBAN) yang sah. + + + This value is not a valid ISBN-10. + Nilai ini bukan ISBN-10 yang sah. + + + This value is not a valid ISBN-13. + Nilai ini bukan ISBN-13 yang sah. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Nilai ini bukan ISBN-10 maupun ISBN-13 yang sah. + + + This value is not a valid ISSN. + Nilai ini bukan ISSN yang sah. + + + This value is not a valid currency. + Nilai ini bukan mata uang yang sah. + + + This value should be equal to {{ compared_value }}. + Nilai ini seharusnya sama dengan {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Nilai ini seharusnya lebih dari {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Nilai ini seharusnya lebih dari atau sama dengan {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Nilai ini seharusnya identik dengan {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Nilai ini seharusnya kurang dari {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Nilai ini seharusnya kurang dari atau sama dengan {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Nilai ini seharusnya tidak sama dengan {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Nilai ini seharusnya tidak identik dengan {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Rasio citra terlalu besar ({{ ratio }}). Rasio maksimum yang diizinkan adalah {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Rasio citra terlalu kecil ({{ ratio }}). Rasio minimum yang diharapkan adalah {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Citra persegi ({{ width }}x{{ height }}px). Citra persegi tidak diizinkan. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Citra berorientasi lanskap ({{ width }}x{{ height }}px). Citra berorientasi lanskap tidak diizinkan. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Citra berorientasi potret ({{ width }}x{{ height }}px). Citra berorientasi potret tidak diizinkan. + + + An empty file is not allowed. + Berkas kosong tidak diizinkan. + + + The host could not be resolved. + Host tidak dapat diselesaikan. + + + This value does not match the expected {{ charset }} charset. + Nilai ini tidak memenuhi set karakter {{ charset }} yang diharapkan. + + + This is not a valid Business Identifier Code (BIC). + Ini bukan Business Identifier Code (BIC) yang sah. + + + Error + Galat + + + This is not a valid UUID. + Ini bukan UUID yang sah. + + + This value should be a multiple of {{ compared_value }}. + Nilai ini harus kelipatan dari {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Business Identifier Code (BIC) ini tidak terkait dengan IBAN {{ iban }}. + + + This value should be valid JSON. + Nilai ini harus berisi JSON yang sah. + + + This collection should contain only unique elements. + Kumpulan ini harus mengandung elemen yang unik. + + + This value should be positive. + Nilai ini harus positif. + + + This value should be either positive or zero. + Nilai ini harus positif atau nol. + + + This value should be negative. + Nilai ini harus negatif. + + + This value should be either negative or zero. + Nilai ini harus negatif atau nol. + + + This value is not a valid timezone. + Nilai ini harus merupakan zona waktu yang sah. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Kata sandi ini telah bocor di data breach, harus tidak digunakan kembali. Silahkan gunakan kata sandi yang lain. + + + This value should be between {{ min }} and {{ max }}. + Nilai ini harus berada diantara {{ min }} dan {{ max }}. + + + This value is not a valid hostname. + Nilai ini bukan merupakan hostname yang sah. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Angka dari setiap elemen di dalam kumpulan ini harus kelipatan dari {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Nilai ini harus memenuhi setidaknya satu dari batasan berikut: + + + Each element of this collection should satisfy its own set of constraints. + Setiap elemen koleksi ini harus memenuhi batasannya sendiri. + + + This value is not a valid International Securities Identification Number (ISIN). + Nilai ini bukan merupakan International Securities Identification Number (ISIN) yang sah. + + + This value should be a valid expression. + Nilai ini harus berupa ekspresi yang sah. + + + This value is not a valid CSS color. + Nilai ini bukan merupakan warna CSS yang sah. + + + This value is not a valid CIDR notation. + Nilai ini bukan merupakan notasi CIDR yang sah. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Nilai dari netmask harus berada diantara {{ min }} dan {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf new file mode 100644 index 00000000000..c7cd43784ee --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Questo valore dovrebbe essere falso. + + + This value should be true. + Questo valore dovrebbe essere vero. + + + This value should be of type {{ type }}. + Questo valore dovrebbe essere di tipo {{ type }}. + + + This value should be blank. + Questo valore dovrebbe essere vuoto. + + + The value you selected is not a valid choice. + Questo valore dovrebbe essere una delle opzioni disponibili. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Si dovrebbe selezionare almeno {{ limit }} opzione.|Si dovrebbero selezionare almeno {{ limit }} opzioni. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Si dovrebbe selezionare al massimo {{ limit }} opzione.|Si dovrebbero selezionare al massimo {{ limit }} opzioni. + + + One or more of the given values is invalid. + Uno o più valori inseriti non sono validi. + + + This field was not expected. + Questo campo non è stato previsto. + + + This field is missing. + Questo campo è mancante. + + + This value is not a valid date. + Questo valore non è una data valida. + + + This value is not a valid datetime. + Questo valore non è una data e ora valida. + + + This value is not a valid email address. + Questo valore non è un indirizzo email valido. + + + The file could not be found. + Non è stato possibile trovare il file. + + + The file is not readable. + Il file non è leggibile. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Il file è troppo grande ({{ size }} {{ suffix }}). La dimensione massima consentita è {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Il mime type del file non è valido ({{ type }}). I tipi permessi sono {{ types }}. + + + This value should be {{ limit }} or less. + Questo valore dovrebbe essere {{ limit }} o inferiore. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Questo valore è troppo lungo. Dovrebbe essere al massimo di {{ limit }} carattere.|Questo valore è troppo lungo. Dovrebbe essere al massimo di {{ limit }} caratteri. + + + This value should be {{ limit }} or more. + Questo valore dovrebbe essere {{ limit }} o superiore. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Questo valore è troppo corto. Dovrebbe essere almeno di {{ limit }} carattere.|Questo valore è troppo corto. Dovrebbe essere almeno di {{ limit }} caratteri. + + + This value should not be blank. + Questo valore non dovrebbe essere vuoto. + + + This value should not be null. + Questo valore non dovrebbe essere nullo. + + + This value should be null. + Questo valore dovrebbe essere nullo. + + + This value is not valid. + Questo valore non è valido. + + + This value is not a valid time. + Questo valore non è un'ora valida. + + + This value is not a valid URL. + Questo valore non è un URL valido. + + + The two values should be equal. + I due valori dovrebbero essere uguali. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Il file è troppo grande. La dimensione massima è {{ limit }} {{ suffix }}. + + + The file is too large. + Il file è troppo grande. + + + The file could not be uploaded. + Il file non può essere caricato. + + + This value should be a valid number. + Questo valore dovrebbe essere un numero. + + + This file is not a valid image. + Questo file non è una immagine valida. + + + This is not a valid IP address. + Questo valore non è un indirizzo IP valido. + + + This value is not a valid language. + Questo valore non è una lingua valida. + + + This value is not a valid locale. + Questo valore non è una impostazione regionale valida. + + + This value is not a valid country. + Questo valore non è una nazione valida. + + + This value is already used. + Questo valore è già stato utilizzato. + + + The size of the image could not be detected. + La dimensione dell'immagine non può essere determinata. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + La larghezza dell'immagine è troppo grande ({{ width }}px). La larghezza massima è di {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + La larghezza dell'immagine è troppo piccola ({{ width }}px). La larghezza minima è di {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + L'altezza dell'immagine è troppo grande ({{ height }}px). L'altezza massima è di {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + L'altezza dell'immagine è troppo piccola ({{ height }}px). L'altezza minima è di {{ min_height }}px. + + + This value should be the user's current password. + Questo valore dovrebbe essere la password attuale dell'utente. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Questo valore dovrebbe contenere esattamente {{ limit }} carattere.|Questo valore dovrebbe contenere esattamente {{ limit }} caratteri. + + + The file was only partially uploaded. + Il file è stato caricato solo parzialmente. + + + No file was uploaded. + Nessun file è stato caricato. + + + No temporary folder was configured in php.ini. + Nessuna cartella temporanea è stata configurata nel php.ini. + + + Cannot write temporary file to disk. + Impossibile scrivere il file temporaneo sul disco. + + + A PHP extension caused the upload to fail. + Un'estensione PHP ha causato il fallimento del caricamento. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Questa collezione dovrebbe contenere almeno {{ limit }} elemento.|Questa collezione dovrebbe contenere almeno {{ limit }} elementi. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Questa collezione dovrebbe contenere massimo {{ limit }} elemento.|Questa collezione dovrebbe contenere massimo {{ limit }} elementi. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Questa collezione dovrebbe contenere esattamente {{ limit }} elemento.|Questa collezione dovrebbe contenere esattamente {{ limit }} elementi. + + + Invalid card number. + Numero di carta non valido. + + + Unsupported card type or invalid card number. + Tipo di carta non supportato o numero non valido. + + + This is not a valid International Bank Account Number (IBAN). + Questo valore non è un IBAN (International Bank Account Number) valido. + + + This value is not a valid ISBN-10. + Questo valore non è un codice ISBN-10 valido. + + + This value is not a valid ISBN-13. + Questo valore non è un codice ISBN-13 valido. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Questo valore non è un codice ISBN-10 o ISBN-13 valido. + + + This value is not a valid ISSN. + Questo valore non è un codice ISSN valido. + + + This value is not a valid currency. + Questo valore non è una valuta valida. + + + This value should be equal to {{ compared_value }}. + Questo valore dovrebbe essere uguale a {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Questo valore dovrebbe essere maggiore di {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Questo valore dovrebbe essere maggiore o uguale a {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Questo valore dovrebbe essere identico a {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Questo valore dovrebbe essere minore di {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Questo valore dovrebbe essere minore o uguale a {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Questo valore dovrebbe essere diverso da {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Questo valore dovrebbe essere diverso da {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Il rapporto di aspetto dell'immagine è troppo grande ({{ ratio }}). Il rapporto massimo consentito è {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Il rapporto di aspetto dell'immagine è troppo piccolo ({{ ratio }}). Il rapporto minimo consentito è {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + L'immagine è quadrata ({{ width }}x{{ height }}px). Le immagini quadrate non sono consentite. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + L'immagine è orizzontale ({{ width }}x{{ height }}px). Le immagini orizzontali non sono consentite. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + L'immagine è verticale ({{ width }}x{{ height }}px). Le immagini verticali non sono consentite. + + + An empty file is not allowed. + Un file vuoto non è consentito. + + + The host could not be resolved. + L'host non può essere risolto. + + + This value does not match the expected {{ charset }} charset. + Questo valore non corrisponde al charset {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Questo valore non è un codice BIC valido. + + + Error + Errore + + + This is not a valid UUID. + Questo non è un UUID valido. + + + This value should be a multiple of {{ compared_value }}. + Questo valore dovrebbe essere un multiplo di {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Questo codice identificativo bancario (BIC) non è associato all'IBAN {{ iban }}. + + + This value should be valid JSON. + Questo valore dovrebbe essere un JSON valido. + + + This collection should contain only unique elements. + Questa collezione dovrebbe contenere solo elementi unici. + + + This value should be positive. + Questo valore dovrebbe essere positivo. + + + This value should be either positive or zero. + Questo valore dovrebbe essere positivo oppure zero. + + + This value should be negative. + Questo valore dovrebbe essere negativo. + + + This value should be either negative or zero. + Questo valore dovrebbe essere negativo oppure zero. + + + This value is not a valid timezone. + Questo valore non è un fuso orario valido. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Questa password è trapelata durante una compromissione di dati, non deve essere usata. Si prega di usare una password diversa. + + + This value should be between {{ min }} and {{ max }}. + Questo valore dovrebbe essere compreso tra {{ min }} e {{ max }}. + + + This value is not a valid hostname. + Questo valore non è un nome di host valido. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Il numero di elementi in questa collezione dovrebbe essere un multiplo di {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Questo valore dovrebbe soddisfare almeno uno dei vincoli seguenti: + + + Each element of this collection should satisfy its own set of constraints. + Ciascun elemento di questa collezione dovrebbe soddisfare il suo insieme di vincoli. + + + This value is not a valid International Securities Identification Number (ISIN). + Questo valore non è un codice identificativo internazionale di valori mobiliari (ISIN) valido. + + + This value should be a valid expression. + Questo valore dovrebbe essere un'espressione valida. + + + This value is not a valid CSS color. + Questo valore non è un colore CSS valido. + + + This value is not a valid CIDR notation. + Questo valore non è una notazione CIDR valida. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Il valore della netmask dovrebbe essere compreso tra {{ min }} e {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf new file mode 100644 index 00000000000..9feed48d04c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + falseã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be true. + trueã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be of type {{ type }}. + åž‹ã¯{{ type }}ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be blank. + 空ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + The value you selected is not a valid choice. + 有効ãªé¸æŠžè‚¢ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + {{ limit }}個以上é¸æŠžã—ã¦ãã ã•ã„。 + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + {{ limit }}個以内ã§é¸æŠžã—ã¦ãã ã•ã„。 + + + One or more of the given values is invalid. + 無効ãªé¸æŠžè‚¢ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ + + + This field was not expected. + ã“ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã¯äºˆæœŸã•ã‚Œã¦ã„ã¾ã›ã‚“ã§ã—ãŸã€‚ + + + This field is missing. + ã“ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã¯ã€æ¬ è½ã—ã¦ã„ã¾ã™ã€‚ + + + This value is not a valid date. + 有効ãªæ—¥ä»˜ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid datetime. + 有効ãªæ—¥æ™‚ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid email address. + 有効ãªãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + The file could not be found. + ファイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。 + + + The file is not readable. + ファイルを読ã¿è¾¼ã‚ã¾ã›ã‚“。 + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + ファイルã®ã‚µã‚¤ã‚ºãŒå¤§ãã™ãŽã¾ã™({{ size }} {{ suffix }})。有効ãªæœ€å¤§ã‚µã‚¤ã‚ºã¯{{ limit }} {{ suffix }}ã§ã™ã€‚ + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + ファイルã®MIMEタイプãŒç„¡åŠ¹ã§ã™({{ type }})。有効ãªMIMEタイプã¯{{ types }}ã§ã™ã€‚ + + + This value should be {{ limit }} or less. + {{ limit }}以下ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + 値ãŒé•·ã™ãŽã¾ã™ã€‚{{ limit }}文字以内ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be {{ limit }} or more. + {{ limit }}以上ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + 値ãŒçŸ­ã™ãŽã¾ã™ã€‚{{ limit }}文字以上ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should not be blank. + 空ã§ã‚ã£ã¦ã¯ãªã‚Šã¾ã›ã‚“。 + + + This value should not be null. + nullã§ã‚ã£ã¦ã¯ãªã‚Šã¾ã›ã‚“。 + + + This value should be null. + nullã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value is not valid. + 有効ãªå€¤ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid time. + 有効ãªæ™‚刻ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid URL. + 有効ãªURLã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + The two values should be equal. + 2ã¤ã®å€¤ãŒåŒã˜ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + ファイルã®ã‚µã‚¤ã‚ºãŒå¤§ãã™ãŽã¾ã™ã€‚有効ãªæœ€å¤§ã‚µã‚¤ã‚ºã¯{{ limit }} {{ suffix }}ã§ã™ã€‚ + + + The file is too large. + ファイルã®ã‚µã‚¤ã‚ºãŒå¤§ãã™ãŽã¾ã™ã€‚ + + + The file could not be uploaded. + ファイルをアップロードã§ãã¾ã›ã‚“ã§ã—ãŸã€‚ + + + This value should be a valid number. + 有効ãªæ•°å­—ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This file is not a valid image. + ファイルãŒç”»åƒã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This is not a valid IP address. + 有効ãªIPアドレスã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid language. + 有効ãªè¨€èªžåã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid locale. + 有効ãªãƒ­ã‚±ãƒ¼ãƒ«ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid country. + 有効ãªå›½åã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is already used. + æ—¢ã«ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™ã€‚ + + + The size of the image could not be detected. + ç”»åƒã®ã‚µã‚¤ã‚ºãŒæ¤œå‡ºã§ãã¾ã›ã‚“。 + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ç”»åƒã®å¹…ãŒå¤§ãã™ãŽã¾ã™({{ width }}ピクセル)。{{ max_width }}ピクセルã¾ã§ã«ã—ã¦ãã ã•ã„。 + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ç”»åƒã®å¹…ãŒå°ã•ã™ãŽã¾ã™({{ width }}ピクセル)。{{ min_width }}ピクセル以上ã«ã—ã¦ãã ã•ã„。 + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ç”»åƒã®é«˜ã•ãŒå¤§ãã™ãŽã¾ã™({{ height }}ピクセル)。{{ max_height }}ピクセルã¾ã§ã«ã—ã¦ãã ã•ã„。 + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ç”»åƒã®é«˜ã•ãŒå°ã•ã™ãŽã¾ã™({{ height }}ピクセル)。{{ min_height }}ピクセル以上ã«ã—ã¦ãã ã•ã„。 + + + This value should be the user's current password. + ユーザーã®ç¾åœ¨ã®ãƒ‘スワードã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + ã¡ã‚‡ã†ã©{{ limit }}文字ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + The file was only partially uploaded. + ファイルã®ã‚¢ãƒƒãƒ—ロードã¯å®Œå…¨ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + No file was uploaded. + ファイルãŒã‚¢ãƒƒãƒ—ロードã•ã‚Œã¦ã„ã¾ã›ã‚“。 + + + No temporary folder was configured in php.ini. + php.iniã§ä¸€æ™‚フォルダãŒè¨­å®šã•ã‚Œã¦ã„ã¾ã›ã‚“。 + + + Cannot write temporary file to disk. + 一時ファイルをディスクã«æ›¸ã込むã“ã¨ãŒã§ãã¾ã›ã‚“。 + + + A PHP extension caused the upload to fail. + PHPæ‹¡å¼µã«ã‚ˆã£ã¦ã‚¢ãƒƒãƒ—ロードã«å¤±æ•—ã—ã¾ã—ãŸã€‚ + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + {{ limit }}個以上ã®è¦ç´ ã‚’å«ã‚“ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“。 + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + è¦ç´ ã¯{{ limit }}個ã¾ã§ã§ã™ã€‚ + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + è¦ç´ ã¯ã¡ã‚‡ã†ã©{{ limit }}個ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + Invalid card number. + 無効ãªã‚«ãƒ¼ãƒ‰ç•ªå·ã§ã™ã€‚ + + + Unsupported card type or invalid card number. + 未対応ã®ã‚«ãƒ¼ãƒ‰ç¨®é¡žåˆã¯ç„¡åŠ¹ãªã‚«ãƒ¼ãƒ‰ç•ªå·ã§ã™ã€‚ + + + This is not a valid International Bank Account Number (IBAN). + 有効ãªIBANコードã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid ISBN-10. + 有効ãªISBN-10コードã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid ISBN-13. + 有効ãªISBN-13コードã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + 有効ãªISBN-10コードåˆã¯ISBN-13コードã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid ISSN. + 有効ãªISSNコードã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid currency. + 有効ãªè²¨å¹£ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value should be equal to {{ compared_value }}. + {{ compared_value }}ã¨ç­‰ã—ããªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be greater than {{ compared_value }}. + {{ compared_value }}より大ãããªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be greater than or equal to {{ compared_value }}. + {{ compared_value }}以上ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + {{ compared_value_type }}ã¨ã—ã¦ã®{{ compared_value }}ã¨ç­‰ã—ããªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be less than {{ compared_value }}. + {{ compared_value }}未満ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be less than or equal to {{ compared_value }}. + {{ compared_value }}以下ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should not be equal to {{ compared_value }}. + {{ compared_value }}ã¨ç­‰ã—ãã¦ã¯ã„ã‘ã¾ã›ã‚“。 + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + {{ compared_value_type }}ã¨ã—ã¦ã®{{ compared_value }}ã¨ç­‰ã—ãã¦ã¯ã„ã‘ã¾ã›ã‚“。 + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + ç”»åƒã®ã‚¢ã‚¹ãƒšã‚¯ãƒˆæ¯”ãŒå¤§ãã™ãŽã¾ã™({{ ratio }})。{{ max_ratio }}ã¾ã§ã«ã—ã¦ãã ã•ã„。 + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ç”»åƒã®ã‚¢ã‚¹ãƒšã‚¯ãƒˆæ¯”ãŒå°ã•ã™ãŽã¾ã™({{ ratio }})。{{ min_ratio }}以上ã«ã—ã¦ãã ã•ã„。 + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + ç”»åƒãŒæ­£æ–¹å½¢ã«ãªã£ã¦ã„ã¾ã™({{ width }}x{{ height }}ピクセル)。正方形ã®ç”»åƒã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“。 + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + ç”»åƒãŒæ¨ªå‘ãã«ãªã£ã¦ã„ã¾ã™({{ width }}x{{ height }}ピクセル)。横å‘ãã®ç”»åƒã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“。 + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + ç”»åƒãŒç¸¦å‘ãã«ãªã£ã¦ã„ã¾ã™({{ width }}x{{ height }}ピクセル)。縦å‘ãã®ç”»åƒã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“。 + + + An empty file is not allowed. + 空ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“。 + + + The host could not be resolved. + ホストを解決ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚ + + + This value does not match the expected {{ charset }} charset. + ã“ã®å€¤ã¯äºˆæœŸã•ã‚Œã‚‹æ–‡å­—コード({{ charset }})ã¨ç•°ãªã‚Šã¾ã™ã€‚ + + + This is not a valid Business Identifier Code (BIC). + 有効ãªSWIFTコードã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + Error + エラー + + + This is not a valid UUID. + 有効ãªUUIDã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value should be a multiple of {{ compared_value }}. + {{ compared_value }}ã®å€æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + ã“ã®SWIFTコードã¯IBANコード({{ iban }})ã«é–¢é€£ä»˜ã‘られã¦ã„ã¾ã›ã‚“。 + + + This value should be valid JSON. + JSONã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This collection should contain only unique elements. + è¦ç´ ã¯é‡è¤‡ã—ã¦ã¯ãªã‚Šã¾ã›ã‚“。 + + + This value should be positive. + æ­£ã®æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be either positive or zero. + æ­£ã®æ•°ã€ã¾ãŸã¯0ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be negative. + è² ã®æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should be either negative or zero. + è² ã®æ•°ã€ã¾ãŸã¯0ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value is not a valid timezone. + 有効ãªã‚¿ã‚¤ãƒ ã‚¾ãƒ¼ãƒ³ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This password has been leaked in a data breach, it must not be used. Please use another password. + ã“ã®ãƒ‘スワードã¯æ¼æ´©ã—ã¦ã„る為使用ã§ãã¾ã›ã‚“。 + + + This value should be between {{ min }} and {{ max }}. + {{ min }}以上{{ max }}以下ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value is not a valid hostname. + 有効ãªãƒ›ã‚¹ãƒˆåã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + è¦ç´ ã®æ•°ã¯{{ compared_value }}ã®å€æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value should satisfy at least one of the following constraints: + 以下ã®åˆ¶ç´„ã®ã†ã¡å°‘ãªãã¨ã‚‚1ã¤ã‚’満ãŸã™å¿…è¦ãŒã‚ã‚Šã¾ã™: + + + Each element of this collection should satisfy its own set of constraints. + コレクションã®å„è¦ç´ ã¯ã€ãã‚Œãžã‚Œã®åˆ¶ç´„を満ãŸã™å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ + + + This value is not a valid International Securities Identification Number (ISIN). + ã“ã®å€¤ã¯æœ‰åŠ¹ãªå›½éš›è¨¼åˆ¸è­˜åˆ¥ç•ªå·ï¼ˆISIN)ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value should be a valid expression. + å¼ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 + + + This value is not a valid CSS color. + ã“ã®å€¤ã¯æœ‰åŠ¹ãªCSSカラーã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + This value is not a valid CIDR notation. + ã“ã®å€¤ã¯æœ‰åŠ¹ãªCIDR表記ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + + + The value of the netmask should be between {{ min }} and {{ max }}. + ãƒãƒƒãƒˆãƒžã‚¹ã‚¯ã®å€¤ã¯ã€{{ min }}ã‹ã‚‰{{ max }}ã®é–“ã«ã‚ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf new file mode 100644 index 00000000000..f27bbd4bca0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + Dëse Wäert sollt falsch sinn. + + + This value should be true. + Dëse Wäert sollt wouer sinn. + + + This value should be of type {{ type }}. + Dëse Wäert sollt vum Typ {{ type }} sinn. + + + This value should be blank. + Dëse Wäert sollt eidel sinn. + + + The value you selected is not a valid choice. + Dëse Wäert sollt enger vun de Wielméiglechkeeten entspriechen. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Et muss mindestens {{ limit }} Méiglechkeet ausgewielt ginn.|Et musse mindestens {{ limit }} Méiglechkeeten ausgewielt ginn. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Et dierf héchstens {{ limit }} Méiglechkeet ausgewielt ginn.|Et dierfen héchstens {{ limit }} Méiglechkeeten ausgewielt ginn. + + + One or more of the given values is invalid. + Een oder méi vun de Wäerter ass ongëlteg. + + + This field was not expected. + D'Feld gouf net erwaart. + + + This field is missing. + D'Feld feelt. + + + This value is not a valid date. + Dëse Wäert entsprécht kenger gëlteger Datumsangab. + + + This value is not a valid datetime. + Dëse Wäert entsprécht kenger gëlteger Datums- an Zäitangab. + + + This value is not a valid email address. + Dëse Wäert ass keng gëlteg Email-Adress. + + + The file could not be found. + De Fichier gouf net fonnt. + + + The file is not readable. + De Fichier ass net liesbar. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + De Fichier ass ze grouss ({{ size }} {{ suffix }}). Déi zougeloosse Maximalgréisst bedréit {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Den Typ vum Fichier ass ongëlteg ({{ type }}). Erlaabten Type sinn {{ types }}. + + + This value should be {{ limit }} or less. + Dëse Wäert soll méi kleng oder gläich {{ limit }} sinn. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Dës Zeecheketten ass ze laang. Se sollt héchstens {{ limit }} Zeechen hunn. + + + This value should be {{ limit }} or more. + Dëse Wäert sollt méi grouss oder gläich {{ limit }} sinn. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Dës Zeecheketten ass ze kuerz. Se sollt mindestens {{ limit }} Zeechen hunn. + + + This value should not be blank. + Dëse Wäert sollt net eidel sinn. + + + This value should not be null. + Dëst sollt keen Null-Wäert sinn. + + + This value should be null. + Dëst sollt keen Null-Wäert sinn. + + + This value is not valid. + Dëse Wäert ass net gëlteg. + + + This value is not a valid time. + Dëse Wäert entsprécht kenger gëlteger Zäitangab. + + + This value is not a valid URL. + Dëse Wäert ass keng gëlteg URL. + + + The two values should be equal. + Béid Wäerter sollten identesch sinn. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + De fichier ass ze grouss. Déi maximal Gréisst dierf {{ limit }} {{ suffix }} net depasséieren. + + + The file is too large. + De Fichier ass ze grouss. + + + The file could not be uploaded. + De Fichier konnt net eropgeluede ginn. + + + This value should be a valid number. + Dëse Wäert sollt eng gëlteg Zuel sinn. + + + This file is not a valid image. + Dëse Fichier ass kee gëltegt Bild. + + + This is not a valid IP address. + Dëst ass keng gëlteg IP-Adress. + + + This value is not a valid language. + Dëse Wäert entsprécht kenger gëlteger Sprooch. + + + This value is not a valid locale. + Dëse Wäert entsprécht kengem gëltege Gebittsschema. + + + This value is not a valid country. + Dëse Wäert entsprécht kengem gëltege Land. + + + This value is already used. + Dëse Wäert gëtt scho benotzt. + + + The size of the image could not be detected. + D'Gréisst vum Bild konnt net detektéiert ginn. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + D'Breet vum Bild ass ze grouss ({{ width }}px). Déi erlaabte maximal Breet ass {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + D'Breet vum Bild ass ze kleng ({{ width }}px). Déi minimal Breet ass {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + D'Héicht vum Bild ass ze grouss ({{ height }}px). Déi erlaabte maximal Héicht ass {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + D'Héicht vum Bild ass ze kleng ({{ height }}px). Déi minimal Héicht ass {{ min_height }}px. + + + This value should be the user's current password. + Dëse Wäert sollt dem aktuelle Benotzerpasswuert entspriechen. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Dëse Wäert sollt exakt {{ limit }} Buschtaf hunn.|Dëse Wäert sollt exakt {{ limit }} Buschtawen hunn. + + + The file was only partially uploaded. + De Fichier gouf just deelweis eropgelueden. + + + No file was uploaded. + Et gouf kee Fichier eropgelueden. + + + No temporary folder was configured in php.ini. + Et gouf keen temporären Dossier an der php.ini konfiguréiert oder den temporären Dossier existéiert net. + + + Cannot write temporary file to disk. + Den temporäre Fichier kann net gespäichert ginn. + + + A PHP extension caused the upload to fail. + Eng PHP-Erweiderung huet den Upload verhënnert. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Dës Sammlung sollt {{ limit }} oder méi Elementer hunn. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Dës Sammlung sollt {{ limit }} oder manner Elementer hunn. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Dës Sammlung sollt exakt {{ limit }} Element hunn.|Dës Sammlung sollt exakt {{ limit }} Elementer hunn. + + + Invalid card number. + Ongëlteg Kaartennummer. + + + Unsupported card type or invalid card number. + Net ënnerstëtzte Kaartentyp oder ongëlteg Kaartennummer. + + + This is not a valid International Bank Account Number (IBAN). + Dëst ass keng gëlteg IBAN-Kontonummer. + + + This value is not a valid ISBN-10. + Dëse Wäert ass keng gëlteg ISBN-10. + + + This value is not a valid ISBN-13. + Dëse Wäert ass keng gëlteg ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Dëse Wäert ass weder eng gëlteg ISBN-10 nach eng gëlteg ISBN-13. + + + This value is not a valid ISSN. + Dëse Wäert ass keng gëlteg ISSN. + + + This value is not a valid currency. + Dëse Wäert ass keng gëlteg Währung. + + + This value should be equal to {{ compared_value }}. + Dëse Wäert sollt {{ compared_value }} sinn. + + + This value should be greater than {{ compared_value }}. + Dëse Wäert sollt méi grouss wéi {{ compared_value }} sinn. + + + This value should be greater than or equal to {{ compared_value }}. + Dëse Wäert sollt méi grouss wéi oder gläich {{ compared_value }} sinn. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Dëse Wäert sollt identesch si mat {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Dëse Wäert sollt méi kleng wéi {{ compared_value }} sinn. + + + This value should be less than or equal to {{ compared_value }}. + Dëse Wäert sollt méi kleng wéi oder gläich {{ compared_value }} sinn. + + + This value should not be equal to {{ compared_value }}. + Dëse Wäert sollt net {{ compared_value }} sinn. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Dëse Wäert sollt net identesch si mat {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + D'Säiteverhältnis vum Bild ass ze grouss ({{ ratio }}). Den erlaabte Maximalwäert ass {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + D'Säiteverhältnis vum Bild ass ze kleng ({{ ratio }}). Den erwaarte Minimalwäert ass {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + D'Bild ass quadratesch ({{ width }}x{{ height }}px). Quadratesch Biller sinn net erlaabt. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + D'Bild ass am Queeschformat ({{ width }}x{{ height }}px). Biller am Queeschformat sinn net erlaabt. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + D'Bild ass am Héichformat ({{ width }}x{{ height }}px). Biller am Héichformat sinn net erlaabt. + + + An empty file is not allowed. + En eidele Fichier ass net erlaabt. + + + The host could not be resolved. + Den Host-Numm konnt net opgeléist ginn. + + + This value does not match the expected {{ charset }} charset. + Dëse Wäert entsprécht net dem erwaarten Zeechesaz {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Dëst ass kee gëltege "Business Identifier Code" (BIC). + + + Error + Feeler + + + This is not a valid UUID. + Dëst ass keng gëlteg UUID. + + + This value should be a multiple of {{ compared_value }}. + Dëse Wäert sollt e puer vun {{ compared_value }} sinn. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Dëse "Business Identifier Code" (BIC) ass net mat IBAN verbonnen {{ iban }}. + + + This value should be valid JSON. + Dëse Wäert sollt gëlteg JSON. + + + This collection should contain only unique elements. + Dës Sammlung sollt just eenzegaarteg Elementer enthalen. + + + This value should be positive. + Dëse Wäert sollt positiv sinn. + + + This value should be either positive or zero. + Dëse Wäert sollt entweeder positiv oder null sinn. + + + This value should be negative. + Dëse Wäert sollt negativ sinn. + + + This value should be either negative or zero. + Dëse Wäert sollt entweeder negativ oder null sinn. + + + This value is not a valid timezone. + Dëse Wäert ass keng gëlteg Zäitzon. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Dëst Passwuert war Deel vun engem Dateleck an dierf net benotzt ginn. Benotzt w.e.g. en anert Passwuert . + + + This value should be between {{ min }} and {{ max }}. + De Wäert sollt tëscht {{ min }} a(n) {{ max }} leien. + + + This value is not a valid hostname. + Dëse Wäert ass kee gëltegen Hostnumm. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + D'Unzuel un Elementer an dëser Sammlung sollt e multipel vu(n) {{ compared_value }} sinn. + + + This value should satisfy at least one of the following constraints: + Dëse Wäert sollt op d'mannst ee vun dësen Aschränkungen erfëllen: + + + Each element of this collection should satisfy its own set of constraints. + All Element aus dëser Sammlung sollt seng eegen Aschränkungen erfëllen. + + + This value is not a valid International Securities Identification Number (ISIN). + Dëse Wäert ass keng gëlteg International Wäertpabeiererkennnummer (ISIN). + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf new file mode 100644 index 00000000000..7a2c4c521b5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + ReikÅ¡mÄ— turi bÅ«ti neigiama. + + + This value should be true. + ReikÅ¡mÄ— turi bÅ«ti teigiama. + + + This value should be of type {{ type }}. + Å ios reikÅ¡mÄ—s tipas turi bÅ«ti {{ type }}. + + + This value should be blank. + Å i reikÅ¡mÄ— turi bÅ«ti tuÅ¡Äia. + + + The value you selected is not a valid choice. + Neteisingas pasirinkimas. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Turite pasirinkti bent {{ limit }} variantÄ….|Turite pasirinkti bent {{ limit }} variantus.|Turite pasirinkti bent {{ limit }} variantų. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Turite pasirinkti ne daugiau kaip {{ limit }} variantÄ….|Turite pasirinkti ne daugiau kaip {{ limit }} variantus.|Turite pasirinkti ne daugiau kaip {{ limit }} variantų. + + + One or more of the given values is invalid. + Viena ar daugiau įvestų reikÅ¡mių yra netinkamos. + + + This field was not expected. + Nebuvo tikimasi Å is laukas. + + + This field is missing. + Å iame lauke yra dingÄ™s. + + + This value is not a valid date. + Å i reikÅ¡mÄ— nÄ—ra data. + + + This value is not a valid datetime. + Å i reikÅ¡mÄ— nera data ir laikas. + + + This value is not a valid email address. + Å i reikÅ¡mÄ— nÄ—ra tinkamas el. paÅ¡to adresas. + + + The file could not be found. + Byla nerasta. + + + The file is not readable. + Negalima nuskaityti bylos. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Byla yra per didelÄ— ({{ size }} {{ suffix }}). Maksimalus dydis {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Netinkamas bylos tipas (mime type) ({{ type }}). Galimi bylų tipai {{ types }}. + + + This value should be {{ limit }} or less. + ReikÅ¡mÄ— turi bÅ«ti {{ limit }} arba mažiau. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Per didelis simbolių skaiÄius. Turi susidaryti iÅ¡ {{ limit }} arba mažiau simbolių.|Per didelis simbolių skaiÄius. Turi susidaryti iÅ¡ {{ limit }} arba mažiau simbolių.|Per didelis simbolių skaiÄius. Turi susidaryti iÅ¡ {{ limit }} arba mažiau simbolių. + + + This value should be {{ limit }} or more. + ReikÅ¡mÄ— turi bÅ«ti {{ limit }} arba daugiau. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Per mažas simbolių skaiÄius. Turi susidaryti iÅ¡ {{ limit }} arba daugiau simbolių.|Per mažas simbolių skaiÄius. Turi susidaryti iÅ¡ {{ limit }} arba daugiau simbolių.|Per mažas simbolių skaiÄius. Turi susidaryti iÅ¡ {{ limit }} arba daugiau simbolių. + + + This value should not be blank. + Å i reikÅ¡mÄ— negali bÅ«ti tuÅ¡Äia. + + + This value should not be null. + Å i reikÅ¡mÄ— negali bÅ«ti null. + + + This value should be null. + Å i reikÅ¡mÄ— turi bÅ«ti null. + + + This value is not valid. + Netinkama reikÅ¡mÄ—. + + + This value is not a valid time. + Å i reikÅ¡mÄ— nÄ—ra laikas. + + + This value is not a valid URL. + Å i reikÅ¡mÄ— nÄ—ra tinkamas interneto adresas. + + + The two values should be equal. + Abi reikÅ¡mÄ—s turi bÅ«ti identiÅ¡kos. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Byla yra per didelÄ—. Maksimalus dydis yra {{ limit }} {{ suffix }}. + + + The file is too large. + Byla per didelÄ—. + + + The file could not be uploaded. + Byla negali bÅ«ti įkelta. + + + This value should be a valid number. + Å i reikÅ¡mÄ— turi bÅ«ti skaiÄius. + + + This file is not a valid image. + Byla nÄ—ra paveikslÄ—lis. + + + This is not a valid IP address. + Å i reikÅ¡mÄ— nÄ—ra tinkamas IP adresas. + + + This value is not a valid language. + Å i reikÅ¡mÄ— nÄ—ra tinkama kalba. + + + This value is not a valid locale. + Å i reikÅ¡mÄ— nÄ—ra tinkama lokalÄ—. + + + This value is not a valid country. + Å i reikÅ¡mÄ— nÄ—ra tinkama Å¡alis. + + + This value is already used. + Å i reikÅ¡mÄ— jau yra naudojama. + + + The size of the image could not be detected. + Nepavyko nustatyti nuotraukos dydžio. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Nuotraukos plotis per didelis ({{ width }}px). Maksimalus leidžiamas plotis yra {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Nuotraukos plotis per mažas ({{ width }}px). Minimalus leidžiamas plotis yra {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Nuotraukos aukÅ¡tis per didelis ({{ height }}px). Maksimalus leidžiamas aukÅ¡tis yra {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Nuotraukos aukÅ¡tis per mažas ({{ height }}px). Minimalus leidžiamas aukÅ¡tis yra {{ min_height }}px. + + + This value should be the user's current password. + Å i reikÅ¡mÄ— turi sutapti su dabartiniu naudotojo slaptažodžiu. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Å i reikÅ¡mÄ— turi turÄ—ti lygiai {{ limit }} simbolį.|Å i reikÅ¡mÄ— turi turÄ—ti lygiai {{ limit }} simbolius.|Å i reikÅ¡mÄ— turi turÄ—ti lygiai {{ limit }} simbolių. + + + The file was only partially uploaded. + Failas buvo tik dalinai įkeltas. + + + No file was uploaded. + Nebuvo įkelta jokių failų. + + + No temporary folder was configured in php.ini. + NÄ—ra sukonfiguruoto jokio laikino katalogo php.ini faile. + + + Cannot write temporary file to disk. + Nepavyko iÅ¡saugoti laikino failo. + + + A PHP extension caused the upload to fail. + PHP plÄ—tinys sutrukdÄ— failo įkÄ—limÄ… ir jis nepavyko. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + SÄ…raÅ¡e turi bÅ«ti {{ limit }} arba daugiau įrašų.|SÄ…raÅ¡e turi bÅ«ti {{ limit }} arba daugiau įrašų.|SÄ…raÅ¡e turi bÅ«ti {{ limit }} arba daugiau įrašų. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + SÄ…raÅ¡e turi bÅ«ti {{ limit }} arba mažiau įrašų.|SÄ…raÅ¡e turi bÅ«ti {{ limit }} arba mažiau įrašų.|SÄ…raÅ¡e turi bÅ«ti {{ limit }} arba mažiau įrašų. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + SÄ…raÅ¡e turi bÅ«ti lygiai {{ limit }} įraÅ¡as.|SÄ…raÅ¡e turi bÅ«ti lygiai {{ limit }} įraÅ¡ai.|SÄ…raÅ¡e turi bÅ«ti lygiai {{ limit }} įrašų. + + + Invalid card number. + Klaidingas kortelÄ—s numeris. + + + Unsupported card type or invalid card number. + KortelÄ—s tipas nepalaikomas arba klaidingas kortelÄ—s numeris. + + + This is not a valid International Bank Account Number (IBAN). + Å i reiÅ¡mÄ— neatitinka tarptautinio banko sÄ…skaitos numerio formato (IBAN). + + + This value is not a valid ISBN-10. + Å i reikÅ¡mÄ— neatitinka ISBN-10 formato. + + + This value is not a valid ISBN-13. + Å i reikÅ¡mÄ— neatitinka ISBN-13 formato. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Å i reikÅ¡mÄ— neatitinka nei ISBN-10, nei ISBN-13 formato. + + + This value is not a valid ISSN. + Å i reiÅ¡mÄ— neatitinka ISSN formato. + + + This value is not a valid currency. + Netinkamas valiutos formatas. + + + This value should be equal to {{ compared_value }}. + Å i reikÅ¡mÄ— turi bÅ«ti lygi {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Å i reikÅ¡mÄ— turi bÅ«ti didesnÄ— už {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Å i reikÅ¡mÄ— turi bÅ«ti didesnÄ— už arba lygi {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Å i reikÅ¡mÄ— turi bÅ«ti identiÅ¡ka {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Å i reikÅ¡mÄ— turi bÅ«ti mažesnÄ— už {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Å i reikÅ¡mÄ— turi bÅ«ti mažesnÄ— už arba lygi {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Å i reikÅ¡mÄ— neturi bÅ«ti lygi {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Å i reikÅ¡mÄ— neturi bÅ«ti identiÅ¡ka {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Nuotraukos santykis yra per didelis ({{ ratio }}). Didžiausias leistinas santykis yra {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Nuotraukos santykis yra per mažas ({{ ratio }}). Mažiausias leistinas santykis yra {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Nuotrauka yra kvadratinÄ— ({{ width }}x{{ height }}px). KvadratinÄ—s nuotraukos nÄ—ra leistinos. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Nuotrauka orientuota į plotį ({{ width }}x{{ height }}px). Nuotraukos orientuotos į plotį nÄ—ra leistinos. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Nuotrauka orientuota į aukÅ¡tį ({{ width }}x{{ height }}px). Nuotraukos orientuotos į aukÅ¡tį nÄ—ra leistinos. + + + An empty file is not allowed. + Failas negali bÅ«ti tuÅ¡Äias. + + + The host could not be resolved. + Serveris nepasiekiamas. + + + This value does not match the expected {{ charset }} charset. + Å i reikÅ¡mÄ— neatitinka {{ charset }} koduotÄ—s. + + + This is not a valid Business Identifier Code (BIC). + BendrovÄ—s Identifikavimo Kodas (BIC) nÄ—ra tinkamas. + + + Error + Klaida + + + This is not a valid UUID. + Å i reikÅ¡mÄ— nÄ—ra tinkamas UUID. + + + This value should be a multiple of {{ compared_value }}. + Å i reikÅ¡mÄ— turi bÅ«ti skaiÄiaus {{ compared_value }} kartotinis. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Å is bendrovÄ—s identifikavimo kodas (BIC) nesusijÄ™s su IBAN {{ iban }}. + + + This value should be valid JSON. + Å i reikÅ¡mÄ— turi bÅ«ti tinkamo JSON formato. + + + This collection should contain only unique elements. + SÄ…raÅ¡e turi bÅ«ti tik unikalios reikÅ¡mÄ—s. + + + This value should be positive. + ReikÅ¡mÄ— turi bÅ«ti teigiama. + + + This value should be either positive or zero. + ReikÅ¡mÄ— turi bÅ«ti teigiama arba lygi nuliui. + + + This value should be negative. + ReikÅ¡mÄ— turi bÅ«ti neigiama. + + + This value should be either negative or zero. + ReikÅ¡mÄ— turi bÅ«ti neigiama arba lygi nuliui. + + + This value is not a valid timezone. + ReikÅ¡mÄ— nÄ—ra tinkama laiko juosta. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Slaptažodis yra nutekÄ—jÄ™s duomenų saugumo pažeidime, jo naudoti negalima. PraÅ¡ome naudoti kitÄ… slaptažodį. + + + This value should be between {{ min }} and {{ max }}. + Å i reikÅ¡mÄ— turi bÅ«ti tarp {{ min }} ir {{ max }}. + + + This value is not a valid hostname. + Å i reikÅ¡mÄ— nÄ—ra tinkamas svetainÄ—s adresas. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Å io sÄ…raÅ¡o elementų skaiÄius turÄ—tų bÅ«ti skaiÄiaus {{ compared_value }} kartotinis. + + + This value should satisfy at least one of the following constraints: + Å i reikÅ¡mÄ— turÄ—tų atitikti bent vienÄ… iÅ¡ Å¡ių nurodymų: + + + Each element of this collection should satisfy its own set of constraints. + Kiekvienas Å¡io sÄ…raÅ¡o elementas turi atitikti savo nurodymų rinkinį. + + + This value is not a valid International Securities Identification Number (ISIN). + Å i reiÅ¡mÄ— neatitinka tarptautinio vertybinių popierių identifikavimo numerio formato (ISIN). + + + This value should be a valid expression. + Å i vertÄ— turÄ—tų bÅ«ti teisinga iÅ¡raiÅ¡ka. + + + This value is not a valid CSS color. + Å i reikÅ¡mÄ— nÄ—ra tinkama CSS spalva. + + + This value is not a valid CIDR notation. + Å i vertÄ— nÄ—ra tinkamas CIDR žymÄ—jimas. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Tinklo kaukÄ—s reikÅ¡mÄ— turi bÅ«ti nuo {{ min }} iki {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf new file mode 100644 index 00000000000..fc71d5f9943 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t nepatiesai. + + + This value should be true. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t patiesai. + + + This value should be of type {{ type }}. + Å Ä«s vÄ“rtÄ«bas tipam ir jÄbÅ«t {{ type }}. + + + This value should be blank. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t tukÅ¡ai. + + + The value you selected is not a valid choice. + VÄ“rtÄ«ba, kuru jÅ«s izvÄ“lÄ“jÄties nav derÄ«ga izvÄ“le. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Jums nav jÄveic izvÄ“le.|Jums ir jÄveic vismaz {{ limit }} izvÄ“le.|Jums ir jÄveic vismaz {{ limit }} izvÄ“les. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Jums nav jÄveic izvÄ“le.|Jums ir jÄveic ne vairÄk kÄ {{ limit }} izvÄ“le.|Jums ir jÄveic ne vairÄk kÄ {{ limit }} izvÄ“les. + + + One or more of the given values is invalid. + Viena vai vairÄkas no dotajÄm vÄ“rtÄ«bÄm ir nederÄ«gas. + + + This field was not expected. + Å is lauks netika gaidÄ«ts. + + + This field is missing. + Å is lauks ir pazudis. + + + This value is not a valid date. + Å Ä« vÄ“rtÄ«ba ir nederÄ«gs datums. + + + This value is not a valid datetime. + Å Ä« vÄ“rtÄ«ba ir nederÄ«gs datums un laiks + + + This value is not a valid email address. + Å Ä« vÄ“rtÄ«ba ir nederÄ«ga e-pasta adrese. + + + The file could not be found. + Fails nav atrasts. + + + The file is not readable. + Fails nav lasÄms. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Fails ir pÄrÄk liels ({{ size }} {{ suffix }}). Atļautais maksimÄlais izmÄ“rs ir {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Faila mime tips nav derÄ«gs ({{ type }}). Atļautie mime tipi ir {{ types }}. + + + This value should be {{ limit }} or less. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t ne vairÄk kÄ {{ limit }}. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Å Ä«s vÄ“rtÄ«bas garums ir 0 rakstzÄ«mju.|Å Ä« vÄ“rtÄ«ba ir pÄrÄk gara. Tai bÅ«tu jÄbÅ«t ne vairÄk kÄ {{ limit }} rakstzÄ«mei.|Å Ä« vÄ“rtÄ«ba ir pÄrÄk gara. Tai bÅ«tu jÄbÅ«t ne vairÄk kÄ {{ limit }} rakstzÄ«mÄ“m. + + + This value should be {{ limit }} or more. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t ne mazÄk kÄ {{ limit }}. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Å Ä«s vÄ“rtÄ«bas garums ir 0 rakstzÄ«mju.|Å Ä« vÄ“rtÄ«ba ir pÄrÄk Ä«sa. Tai bÅ«tu jÄbÅ«t ne mazÄk kÄ {{ limit }} rakstzÄ«mei.|Å Ä« vÄ“rtÄ«ba ir pÄrÄk Ä«sa. Tai bÅ«tu jÄbÅ«t ne mazÄk kÄ {{ limit }} rakstzÄ«mÄ“m. + + + This value should not be blank. + Å ai vÄ“rtÄ«bai nav jÄbÅ«t tukÅ¡ai. + + + This value should not be null. + Å ai vÄ“rtÄ«bai nav jÄbÅ«t null. + + + This value should be null. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t null. + + + This value is not valid. + Å Ä« vÄ“rtÄ«ba ir nederÄ«ga. + + + This value is not a valid time. + Å Ä« vÄ“rtÄ«ba ir nederÄ«gs laiks. + + + This value is not a valid URL. + Å Ä« vÄ“rtÄ«ba ir nederÄ«gs URL. + + + The two values should be equal. + AbÄm vÄ“rtÄ«bÄm jÄbÅ«t vienÄdam. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Fails ir pÄrÄk liels. Atļautais maksimÄlais izmÄ“rs ir {{ limit }} {{ suffix }}. + + + The file is too large. + Fails ir pÄrÄk liels. + + + The file could not be uploaded. + Failu nevarÄ“ja augÅ¡upielÄdÄ“t. + + + This value should be a valid number. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t derÄ«gam skaitlim. + + + This file is not a valid image. + Å is fails nav derÄ«gs attÄ“ls. + + + This is not a valid IP address. + Å Ä« nav derÄ«ga IP adrese. + + + This value is not a valid language. + Å Ä« vÄ“rtÄ«ba nav derÄ«ga valoda. + + + This value is not a valid locale. + Å Ä« vÄ“rtÄ«ba nav derÄ«ga lokalizÄcija. + + + This value is not a valid country. + Å Ä« vÄ“rtÄ«ba nav derÄ«ga valsts. + + + This value is already used. + Å Ä« vÄ“rtÄ«ba jau tiek izmantota. + + + The size of the image could not be detected. + Nevar noteikt attÄ“la izmÄ“ru. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + AttÄ“la platums ir pÄrÄk liels ({{ width }}px). Atļautais maksimÄlais platums ir {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + AttÄ“la platums ir pÄrÄk mazs ({{ width }}px). MinimÄlais sagaidÄmais platums ir {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + AttÄ“la augstums ir pÄrÄk liels ({{ height }}px). Atļautais maksimÄlais augstums ir {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + AttÄ“la augstums ir pÄrÄk mazs ({{ height }}px). MinimÄlais sagaidÄmais augstums ir {{ min_height }}px. + + + This value should be the user's current password. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t lietotÄja paÅ¡reizÄ“jai parolei. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Å Ä«s vÄ“rtÄ«bas garums ir 0 rakstzÄ«mju.|Å ai vÄ“rtÄ«bai ir jÄbÅ«t tieÅ¡i {{ limit }} rakstzÄ«mei.|Å ai vÄ“rtÄ«bai ir jÄbÅ«t tieÅ¡i {{ limit }} rakstzÄ«mÄ“m. + + + The file was only partially uploaded. + Fails bija tikai daļēji augÅ¡upielÄdÄ“ts. + + + No file was uploaded. + Fails netika augÅ¡upielÄdÄ“ts. + + + No temporary folder was configured in php.ini. + Pagaidu mape php.ini failÄ nav nokonfigurÄ“ta. + + + Cannot write temporary file to disk. + Nevar ierakstÄ«t pagaidu failu uz diska. + + + A PHP extension caused the upload to fail. + PHP paplaÅ¡inÄjums izraisÄ«ja augÅ¡upielÄdes neizdoÅ¡anos. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Å is krÄjums satur 0 elementu.|Å im krÄjumam jÄsatur vismaz {{ limit }} elementu.|Å im krÄjumam jÄsatur vismaz {{ limit }} elementus. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Å is krÄjums satur 0 elementu.|Å im krÄjumam jÄsatur ne vairÄk kÄ {{ limit }} elementu.|Å im krÄjumam jÄsatur ne vairÄk kÄ {{ limit }} elementus. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Å is krÄjums satur 0 elementu.|Å im krÄjumam jÄsatur tieÅ¡i {{ limit }} elementu.|Å im krÄjumam jÄsatur tieÅ¡i {{ limit }} elementus. + + + Invalid card number. + NederÄ«gs kartes numurs. + + + Unsupported card type or invalid card number. + NeatbalstÄ«ts kartes tips vai nederÄ«gs kartes numurs. + + + This is not a valid International Bank Account Number (IBAN). + Å is nav derÄ«gs starptautisks banku konta numurs (IBAN). + + + This value is not a valid ISBN-10. + Å Ä« vÄ“rtÄ«ba nav derÄ«gs ISBN-10 numurs. + + + This value is not a valid ISBN-13. + Å Ä« vÄ“rtÄ«ba nav derÄ«gs ISBN-13 numurs + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Å Ä« vÄ“rtÄ«ba neatbilst ne derÄ«gam ISBN-10 numuram, ne derÄ«gm ISBN-13 numuram. + + + This value is not a valid ISSN. + Å Ä« vÄ“rtÄ«ba nav derÄ«gs ISSN numurs + + + This value is not a valid currency. + Å Ä« vÄ“rtÄ«ba nav derÄ«ga valÅ«ta + + + This value should be equal to {{ compared_value }}. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t vienÄdai ar {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t lielÄkai par {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t lielÄkai vai vienÄdai ar {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t identiskai ar {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t mazÄkai par {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t mazÄkai vai vienÄdai ar {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Å ai vÄ“rtÄ«bai ir jÄbÅ«t vienÄdai ar {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Å ai vÄ“rtÄ«bai nav jÄbÅ«t identiskai ar {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + AttÄ“la attiecÄ«ba ir pÄrÄk liela ({{ ratio }}). AtļautÄ maksimÄlÄ attiecÄ«ba ir {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + AttÄ“la attiecÄ«ba ir pÄrÄk maza ({{ ratio }}). MinimÄlÄ sagaidÄmÄ attiecÄ«ba ir {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Å is attÄ“ls ir kvadrÄts ({{ width }}x{{ height }}px). KvadrÄtveida attÄ“li nav atļauti. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + AttÄ“ls ir orientÄ“ts kÄ ainava ({{ width }}x{{ height }}px). AttÄ“li, kas ir orientÄ“ti kÄ ainavas nav atļauti. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + AttÄ“ls ir orientÄ“ts kÄ portrets ({{ width }}x{{ height }}px). AttÄ“li, kas ir orientÄ“ti kÄ portreti nav atļauti. + + + An empty file is not allowed. + TukÅ¡s fails nav atļauts. + + + The host could not be resolved. + Resursdatora nosaukumu nevar atrisinÄt. + + + This value does not match the expected {{ charset }} charset. + Å Ä« vÄ“rtÄ«ba neatbilst sagaidÄmajai rakstzÄ«mju kopai {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Å Ä« vÄ“rtÄ«ba nav derÄ«gs Biznesa IdentifikÄcijas Kods (BIC). + + + Error + Kļūda + + + This is not a valid UUID. + Å is nav derÄ«gs UUID. + + + This value should be a multiple of {{ compared_value }}. + Å ai vÄ“rtÄ«bai jÄbÅ«t vairÄkas reizes atkÄrtotai {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Å is Biznesa IdentifikÄcijas Kods (BIC) neatbilst {{ iban }} konta numuram (IBAN). + + + This value should be valid JSON. + Å ai vÄ“rtÄ«bai jÄbÅ«t derÄ«gam JSON. + + + This collection should contain only unique elements. + Å ai kolekcijai jÄsatur tikai unikÄli elementi. + + + This value should be positive. + Å ai vÄ“rtÄ«bai jÄbÅ«t pozitÄ«vai. + + + This value should be either positive or zero. + Å ai vÄ“rtÄ«bai jÄbÅ«t pozitÄ«vai vai vienÄdai ar nulli. + + + This value should be negative. + Å ai vÄ“rtÄ«bai jÄbÅ«t negatÄ«vai. + + + This value should be either negative or zero. + Å ai vÄ“rtÄ«bai jÄbÅ«t negatÄ«vai vai vienÄdai ar nulli. + + + This value is not a valid timezone. + Å Ä« vÄ“rtÄ«ba nav derÄ«ga laika zona. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Å Ä« parole tika publicÄ“ta datu noplÅ«dÄ“, viņu nedrÄ«kst izmantot. LÅ«dzu, izvÄ“lieties citu paroli. + + + This value should be between {{ min }} and {{ max }}. + Å ai vÄ“rtÄ«bai jÄbÅ«t starp {{ min }} un {{ max }}. + + + This value is not a valid hostname. + Å Ä« vÄ“rtÄ«ba nav derÄ«gs tÄ«mekļa servera nosaukums. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Elementu skaitam Å¡ajÄ kolekcijÄ jÄbÅ«t {{ compared_value }} reizinÄjumam. + + + This value should satisfy at least one of the following constraints: + Å ai vÄ“rtÄ«bai jÄiekļaujas vismaz vienÄ no sekojoÅ¡iem ierobežojumiem: + + + Each element of this collection should satisfy its own set of constraints. + Å Ä«s kolekcijas katram elementam jÄiekļaujas savÄ ierobežojumu kopÄ. + + + This value is not a valid International Securities Identification Number (ISIN). + Å Ä« vÄ“rtÄ«ba nav derÄ«gs starptautiskais vÄ“rtspapÄ«ru identifikÄcijas numurs (ISIN). + + + This value should be a valid expression. + Å ai vÄ“rtÄ«bai jÄbÅ«t korektai izteiksmei. + + + This value is not a valid CSS color. + Å Ä« vÄ“rtÄ«ba nav korekta CSS krÄsa. + + + This value is not a valid CIDR notation. + Å Ä« vÄ“rtÄ«ba nav korekts CIDR apzÄ«mÄ“jums. + + + The value of the netmask should be between {{ min }} and {{ max }}. + TÄ«kla maskas (netmask) vÄ“rtÄ«bai jÄbÅ«t starp {{ min }} un {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf new file mode 100644 index 00000000000..b767dc87c84 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу байх Ñ‘Ñтой. + + + This value should be true. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн байх Ñ‘Ñтой. + + + This value should be of type {{ type }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ type }} -н төрөл байх Ñ‘Ñтой. + + + This value should be blank. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° хооÑон байх Ñ‘Ñтой. + + + The value you selected is not a valid choice. + СонгоÑон утга буруу байна. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Хамгийн багадаа {{ limit }} утга ÑонгогдÑон байх Ñ‘Ñтой. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Хамгийн ихдÑÑ {{ limit }} утга Ñонгогдох боломжтой. + + + One or more of the given values is invalid. + ӨгөгдÑөн нÑг ÑÑвÑл нÑгÑÑÑ Ð¾Ð»Ð¾Ð½ утга буруу байна. + + + This field was not expected. + Ð­Ð½Ñ Ñ‚Ð°Ð»Ð±Ð°Ñ€ нь хүлÑÑгдÑж байÑан юм. + + + This field is missing. + Ð­Ð½Ñ Ñ‚Ð°Ð»Ð±Ð°Ñ€ нь алга болÑон байна. + + + This value is not a valid date. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу date төрөл байна . + + + This value is not a valid datetime. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу цаг төрөл байна. + + + This value is not a valid email address. + И-майл хаÑг буруу байна. + + + The file could not be found. + Файл олдÑонгүй. + + + The file is not readable. + Файл уншигдахуйц биш байна. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Файл Ñ…ÑÑ‚Ñрхий том байна ({{ size }} {{ suffix }}). Зөвшөөрөгдөх дÑÑд Ñ…ÑмжÑÑ {{ limit }} {{ suffix }} байна. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Файлын MIME-төрөл нь буруу байна ({{ type }}). Зөвшөөрөгдөх MIME-төрлүүд {{ types }}. + + + This value should be {{ limit }} or less. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ limit }} юмуу ÑÑвÑл бага байна. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñ…ÑÑ‚Ñрхий урт байна. {{ limit }} Ñ‚ÑмдÑгтийн урттай юмуу ÑÑвÑл бага байна. + + + This value should be {{ limit }} or more. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ limit }} юмуу ÑÑвÑл их байна. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñ…ÑÑ‚Ñрхий богино байна. {{ limit }} Ñ‚ÑмдÑгт ÑÑвÑл их байна. + + + This value should not be blank. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° хооÑон байж болохгүй. + + + This value should not be null. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° null байж болохгүй. + + + This value should be null. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° null байна. + + + This value is not valid. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу байна. + + + This value is not a valid time. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу цаг төрөл байна. + + + This value is not a valid URL. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу URL байна . + + + The two values should be equal. + Хоёр утгууд ижил байх Ñ‘Ñтой. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Файл Ñ…ÑÑ‚Ñрхий том байна. Зөвшөөрөгдөх дÑÑд Ñ…ÑмжÑÑ Ð½ÑŒ {{ limit }} {{ suffix }} байна. + + + The file is too large. + Файл Ñ…ÑÑ‚Ñрхий том байна. + + + The file could not be uploaded. + Файл upload хийгдÑÑнгүй. + + + This value should be a valid number. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° зөвхөн тоо байна. + + + This file is not a valid image. + Файл зураг биш байна. + + + This is not a valid IP address. + IP хаÑг зөв биш байна. + + + This value is not a valid language. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв Ñ…Ñл биш байна. + + + This value is not a valid locale. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв байршил биш байна. + + + This value is not a valid country. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн бодит ÑƒÐ»Ñ Ð±Ð¸Ñˆ байна. + + + This value is already used. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° аль Ñ…ÑдийнÑÑ Ñ…ÑÑ€ÑглÑгдÑÑн байна. + + + The size of the image could not be detected. + Зургийн Ñ…ÑмжÑÑ Ñ‚Ð¾Ð³Ñ‚Ð¾Ð¾Ð³Ð´Ð¾Ð¶ чадÑангүй. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Зургийн өргөн Ñ…ÑÑ‚Ñрхий том байна ({{ width }}px). Өргөн нь хамгийн ихдÑÑ {{ max_width }}px байх боломжтой. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Зургийн өргөн Ñ…ÑÑ‚Ñрхий жижиг байна ({{ width }}px). Өргөн нь хамгийн багадаа {{ min_width }}px байх боломжтой. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Зургийн өндөр Ñ…ÑÑ‚Ñрхий том байна ({{ height }}px). Өндөр нь хамгийн ихдÑÑ {{ max_height }}px байх боломжтой. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Зургийн өндөр Ñ…ÑÑ‚Ñрхий жижиг байна ({{ height }}px). Өндөр нь хамгийн багадаа {{ min_height }}px байх боломжтой. + + + This value should be the user's current password. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñ…ÑÑ€ÑглÑгчийн одоогийн нууц үг байх Ñ‘Ñтой. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñг {{ limit }} Ñ‚ÑмдÑгт байх Ñ‘Ñтой.|Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñг {{ limit }} Ñ‚ÑмдÑгт байх Ñ‘Ñтой. + + + The file was only partially uploaded. + Файлын зөвхөн Ñ…Ð°Ð³Ð°Ñ Ð½ÑŒ upload хийгдÑÑн. + + + No file was uploaded. + Ямар ч файл upload хийгдÑÑнгүй. + + + No temporary folder was configured in php.ini. + php.ini дÑÑÑ€ түр зуурын хавтÑыг тохируулаагүй байна, ÑÑвÑл тохируулÑан Ñ…Ð°Ð²Ñ‚Ð°Ñ Ð±Ð°Ð¹Ñ…Ð³Ò¯Ð¹ байна. + + + Cannot write temporary file to disk. + Түр зуурын файлыг диÑк руу бичиж болохгүй байна. + + + A PHP extension caused the upload to fail. + PHP extension нь upload -г амжилтгүй болгоод байна. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´ÑÑш тооны Ñлемент агуулах Ñ‘Ñтой.|Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´ÑÑш тооны Ñлемент агуулах Ñ‘Ñтой. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´Ð¾Ð¾Ñˆ тооны Ñлемент агуулах Ñ‘Ñтой.|Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´Ð¾Ð¾Ñˆ тооны Ñлемент агуулах Ñ‘Ñтой. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† Ñг {{ limit }} Ñлемент агуулах Ñ‘Ñтой.|Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† Ñг {{ limit }} Ñлемент агуулах Ñ‘Ñтой. + + + Invalid card number. + Картын дугаар буруу байна. + + + Unsupported card type or invalid card number. + ДÑмжигдÑÑгүй картын төрөл ÑÑвÑл картын дугаар буруу байна. + + + This is not a valid International Bank Account Number (IBAN). + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв Олон УлÑын Банкны ДанÑны Дугаар (IBAN) биш байна. + + + This value is not a valid ISBN-10. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISBN-10 биш байна. + + + This value is not a valid ISBN-13. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISBN-13 биш байна. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISBN-10 юмуу ISBN-13 биш байна. + + + This value is not a valid ISSN. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISSN биш байна. + + + This value is not a valid currency. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн бодит валют биш байна. + + + This value should be equal to {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -Ñ‚aй Ñ‚Ñнцүү байх Ñ‘Ñтой. + + + This value should be greater than {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -Ñ Ð¸Ñ… байх Ñ‘Ñтой. + + + This value should be greater than or equal to {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -тай Ñ‚Ñнцүү юмуу ÑÑвÑл их байх Ñ‘Ñтой. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value_type }} {{ compared_value }} -тай Ñг ижил байх Ñ‘Ñтой. + + + This value should be less than {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -Ñ Ð±Ð°Ð³Ð° байх Ñ‘Ñтой. + + + This value should be less than or equal to {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -тай ижил юмуу ÑÑвÑл бага байх Ñ‘Ñтой. + + + This value should not be equal to {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -тай Ñ‚Ñнцүү байх Ñ‘Ñгүй. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value_type }} {{ compared_value }} -тай Ñг ижил байх Ñ‘Ñгүй. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Зургийн харьцаа Ñ…ÑÑ‚Ñрхий том байна ({{ ratio }}). Харьцаа нь хамгийн ихдÑÑ {{ max_ratio }} байна. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Зургийн харьцаа Ñ…ÑÑ‚Ñрхий жижиг байна ({{ ratio }}). Харьцаа нь хамгийн багадаа {{ min_ratio }} байна. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Зураг дөрвөлжин Ñ…ÑлбÑртÑй байна ({{ width }}x{{ height }}px). Дөрвөлжин зургууд оруулах боломжгүй. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Зураг Ñ…ÑвтÑÑ Ð±Ð°Ð¹Ñ€Ð»Ð°Ð»Ñ‚Ð°Ð¹ байна ({{ width }}x{{ height }}px). Ð¥ÑвтÑÑ Ð±Ð°Ð¹Ñ€Ð»Ð°Ð»Ñ‚Ð°Ð¹ зургууд оруулах боломжгүй. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Зургууд боÑоо байрлалтай байна ({{ width }}x{{ height }}px). БоÑоо байрлалтай зургууд оруулах боломжгүй. + + + An empty file is not allowed. + ХооÑон файл оруулах боломжгүй. + + + The host could not be resolved. + ХоÑÑ‚ зөв тохирогдоогүй байна. + + + This value does not match the expected {{ charset }} charset. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° тооцоолÑон {{ charset }} Ñ‚ÑмдÑгттÑй таарахгүй байна. + + + This is not a valid Business Identifier Code (BIC). + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв Business Identifier Code (BIC) биш байна. + + + Error + Ðлдаа + + + This is not a valid UUID. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв UUID биш байна. + + + This value should be a multiple of {{ compared_value }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -н үржвÑÑ€ байх Ñ‘Ñтой. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ð­Ð½Ñ Business Identifier Code (BIC) код нь IBAN {{ iban }} -тай холбоогүй байна. + + + This value should be valid JSON. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° JSON байх Ñ‘Ñтой. + + + This collection should contain only unique elements. + Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† зөвхөн давтагдахгүй Ñлементүүд агуулах Ñ‘Ñтой. + + + This value should be positive. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° ÑерÑг байх Ñ‘Ñтой. + + + This value should be either positive or zero. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñ‚Ñг ÑÑвÑл ÑерÑг байх Ñ‘Ñтой. + + + This value should be negative. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñөрөг байх Ñ‘Ñтой. + + + This value should be either negative or zero. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñөрөг ÑÑвÑл Ñ‚Ñг байх Ñ‘Ñтой. + + + This value is not a valid timezone. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв цагийн Ð±Ò¯Ñ Ð±Ð¸Ñˆ байна. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ð­Ð½Ñ Ð½ÑƒÑƒÑ† үгийн мÑдÑÑлÑл алдагдÑан байх магадлалтай ÑƒÑ‡Ñ€Ð°Ð°Ñ Ð´Ð°Ñ…Ð¸Ð½ ашиглагдах Ñ‘Ñгүй. Ó¨Ó©Ñ€ нууц үг ашиглана уу. + + + This value should be between {{ min }} and {{ max }}. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ min }} -Ñ {{ max }} хооронд байх Ñ‘Ñтой. + + + This value is not a valid hostname. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу hostname байна. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + ЭнÑÑ…Ò¯Ò¯ цуглуулган дахь ÑлемÑнтийн тоо, {{ compared_value }}-н үржвÑÑ€ байх Ñ‘Ñтой. + + + This value should satisfy at least one of the following constraints: + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° доорх болзолуудын Ñдаж нÑгийг хангах Ñ‘Ñтой: + + + Each element of this collection should satisfy its own set of constraints. + ЭнÑÑ…Ò¯Ò¯ цуглуулган дахь ÑлемÑнтүүд Ó©Ó©Ñ€ Ó©Ó©Ñ€Ñдийн болзолуудаа хангах Ñ‘Ñтой. + + + This value is not a valid International Securities Identification Number (ISIN). + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° зөв International Securities Identification Number (ISIN) биш байна. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf new file mode 100644 index 00000000000..7f45aaed64f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf @@ -0,0 +1,395 @@ + + + + + + This value should be false. + ဤá€á€”်ဖိုးသည် false ဖြစ်ရမည်ዠ+ + + This value should be true. + ဤá€á€”်ဖိုးသည် true ဖြစ်ရမည်ዠ+ + + This value should be of type {{ type }}. + ဤá€á€”်ဖိုးသည် {{ type }} အမျိုးအစားဖြစ်ရမည်ዠ+ + + This value should be blank. + ဤá€á€”်ဖိုးသည် ကွပ်လပ်မဖြစ်သင့်ပါዠ+ + + The value you selected is not a valid choice. + သင်ရွေးá€á€»á€šá€ºá€žá€±á€¬á€á€”်ဖိုးသည် သင့်လျှော်သော် á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + သင်သည် အနည်းဆုံးရွေးá€á€»á€šá€ºá€™á€¾á€¯ {{ limit }} á€á€¯á€›á€½á€±á€¸á€á€»á€šá€ºá€›á€™á€Šá€ºá‹ + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + သင်သည်အများဆုံး {{ limit }} á€á€¯á€žá€¬á€›á€½á€±á€¸á€á€»á€šá€ºá€á€½á€„့်ရှိသည်ዠ+ + + One or more of the given values is invalid. + ပေးထားသောá€á€”်ဖိုးá€á€…်á€á€¯ (သို့မဟုá€á€º) á€á€…်á€á€¯á€‘က်ပိုáမမှန်ကန်ပါዠ+ + + This field was not expected. + ဤကွက်လပ်ကိုမမျှော်လင့်ထားပါዠ+ + + This field is missing. + ဤကွက်လပ်ကိုမမျှော်လင့်ထားပါዠ+ + + This value is not a valid date. + ဤá€á€”်ဖိုးသည်မှန်ကန်သော်ရက်စွဲမဟုá€á€ºá€•á€«á‹ + + + This value is not a valid datetime. + ဤá€á€”်ဖိုးသည် မှန်ကန်သော် ရက်စွဲ/အá€á€»á€­á€”် မဟုá€á€ºá€•á€«á‹ + + + This value is not a valid email address. + ဤá€á€”်ဖိုးသည် မှန်ကန်သော် အီးမေးလိပ်စာ မဟုá€á€ºá€•á€«á‹ + + + The file could not be found. + ဖိုင်ရှာမá€á€½á€±á€·á€•á€«á‹ + + + The file is not readable. + ဤဖိုင်ကို ဖá€á€ºáမရပါዠ+ + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + ဖိုင်အရွယ်အစား အလွန်ကြီးနေသည် ({{ size }} {{ suffix }}). á€á€½á€„့်ပြုထားသော အများဆုံး ဖိုင်ဆိုဒ်သည် {{ limit }} {{ suffix }} ဖြစ်သည်ዠ+ + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + ဖိုင်á mime အမျိုးအစားမမှန်ကန်ပါ ({{ type }})á‹ á€á€½á€„့်ပြုထားသော mime အမျိုးအစားများမှာ {{ types }}. + + + This value should be {{ limit }} or less. + ဤá€á€”်ဖိုးသည် {{ limit }} (သို့မဟုá€á€º) {{ limit }} ထက်နည်းသင့်သည်ዠ+ + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + ဤá€á€”်ဖိုးသည် အလွန်ရှည်လွန်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{ limit }} (သို့မဟုá€á€º) áŽá€„်းထက်နည်းသင့်သည်ዠ| ဤá€á€”်ဖိုးသည် အလွန်ရှည်လွန်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{limit}} á€á€¯á€”ှင့်အထက်ရှိသင့်သည်ዠ+ + + This value should be {{ limit }} or more. + ဤá€á€”်ဖိုးသည် {{limit}} (သို့မဟုá€á€º) ထို့ထက်ပိုသင့်သည်ዠ+ + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + ဤá€á€”်ဖိုးသည် အလွန်á€á€­á€¯á€œá€½á€”်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{limit}} (သို့မဟုá€á€º) ထို့ထက်ပိုရှိသင့်သည်ዠ| ဤá€á€”်ဖိုးသည်á€á€­á€¯á€œá€½á€”်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{limit}} လုံးနှင့်အထက်ရှိသင့်သည်ዠ+ + + This value should not be blank. + ဤá€á€”်ဖိုးသည်ကွက်လပ်မဖြစ်သင့်ပါዠ+ + + This value should not be null. + ဤá€á€”်ဖိုးသည် null မဖြစ်သင့်ပါዠ+ + + This value should be null. + ဤá€á€”်ဖိုးသည် null ဖြစ်သင့်သည်ዠ+ + + This value is not valid. + ဤá€á€”်ဖိုးသည်မှန်ကန်သောá€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ + + + This value is not a valid time. + ဤá€á€”်ဖိုးသည်မှန်ကန်သော အá€á€»á€­á€”်á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ + + + This value is not a valid URL. + ဤá€á€”်ဖိုးသည်မှန်ကန်သော URL á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ + + + The two values should be equal. + á€á€”်ဖိုးနှစ်á€á€¯á€žá€Šá€º á€á€°á€Šá€®á€žá€„့်သည်ዠ+ + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + ဤဖိုင်သည် အလွန်ကြီးသည်ዠá€á€½á€„့်ပြုထားသည့်အများဆုံးဖိုင်အရွယ်အစားသည် {{ limit }} {{ suffix }} ဖြစ်သည်ዠ+ + + The file is too large. + ဤဖိုင်သည် အလွန်ကြီးသည်ዠ+ + + The file could not be uploaded. + ဤဖိုင်ကိုá€á€„်áမရပါዠ+ + + This value should be a valid number. + ဤá€á€”်ဖိုးသည်မှန်ကန်သောနံပါá€á€ºá€–ြစ်သင့်သည်ዠ+ + + This file is not a valid image. + ဤဖိုင်သည်မှန်ကန်သော ဓါá€á€ºá€•á€¯á€¶á€™á€Ÿá€¯á€á€ºá€•á€«á‹ + + + This is not a valid IP address. + áŽá€„်းသည်á€á€›á€¬á€¸á€á€„် IP လိပ်စာမဟုá€á€ºá€•á€«á‹ + + + This value is not a valid language. + ဤá€á€”်ဖိုးသည် မှန်ကန်သောဘာသာစကားမဟုá€á€ºá€•á€«á‹ + + + This value is not a valid locale. + ဤá€á€”်ဖိုးသည်မှန်ကန်သောဘာသာပြန်မဟုá€á€ºá€•á€«á‹ + + + This value is not a valid country. + ဤá€á€”်ဖိုးသည်မှန်ကန်သောနိုင်ငံမဟုá€á€ºá€•á€«á‹ + + + This value is already used. + ဤá€á€”်ဖိုးသည် အသုံးပြုပြီးသားဖြစ်သည်ዠ+ + + The size of the image could not be detected. + ဓါá€á€ºá€•á€¯á€¶á€¡á€›á€½á€šá€ºá€¡á€…ားကိုရှာမá€á€½á€±á€·á€•á€«á‹ + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ပုံáအလျားသည် ကြီးလွန်းသည် ({{ width }}px)á‹ á€á€½á€„့်ပြုထားသည့်အများဆုံးအလျားသည် {{max_width}}px ဖြစ်သည်ዠ+ + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ပုံáအလျားသည် သေးလွန်းသည် ({{ width }}px)á‹ á€á€½á€„့်ပြုထားသည့်အနည်းဆုံးအလျားသည် {{max_width}}px ဖြစ်သည်ዠ+ + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ပုံáအနံသည် ကြီးလွန်းသည် ({{ height }}px)á‹ á€á€½á€„့်ပြုထားသည့်အများဆုံးအနံသည် {{max_height}}px ဖြစ်သည်ዠ+ + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ပုံáအနံသည် သေးလွန်းသည် ({{ height }}px)á‹ á€á€½á€„့်ပြုထားသည့်အနည်းဆုံးအနံသည် {{min_height}}px ဖြစ်သည်ዠ+ + + This value should be the user's current password. + ဤá€á€”်ဖိုးသည်အသုံးပြုသူá လက်ရှိစကားá€á€¾á€€á€ºá€–ြစ်သင့်သည်ዠ+ + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + ဤá€á€”်ဖိုးသည်စာလုံး {{limit}} အá€á€­á€¡á€€á€»á€›á€¾á€­á€žá€„့်သည်ዠ+ + + The file was only partially uploaded. + ဤဖိုင်သည်á€á€…်စိá€á€ºá€á€…်ပိုင်းသာ upload á€á€„်á€á€²á€·á€žá€Šá€ºá‹ + + + No file was uploaded. + မည်သည့် ဖိုင်မျှ upload မလုပ်á€á€²á€·á€•á€«á‹ + + + No temporary folder was configured in php.ini. + php.ini á€á€½á€„်ယာယီဖိုင်á€á€½á€²á€€á€­á€¯á€•á€¼á€„်ဆင်ထားá€á€¼á€„်းမရှိပါአ+ + + Cannot write temporary file to disk. + ယာရီဖိုင်ကို disk မရေးနိုင်ပါዠ+ + + A PHP extension caused the upload to fail. + PHP extension á€á€…်á€á€¯á€€á€¼á€±á€¬á€„့် upload á€á€„်áမရနိုင်ပါዠ+ + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + ဤ collection á€á€½á€„် {{limit}} element (သို့မဟုá€á€º) ထို့ထက်မပိုသင့်ပါዠ+ + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + ဤ collection á€á€½á€„် {{limit}} element (သို့မဟုá€á€º) áŽá€„်းထက်နည်းသင့်သည်ዠ+ + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + ဤစုစည်းမှုá€á€½á€„် {{limit}} element အá€á€­á€¡á€€á€»á€•á€«á€žá€„့်သည်ዠ+ + + Invalid card number. + ကဒ်နံပါá€á€ºá€™á€™á€¾á€”်ပါዠ+ + + Unsupported card type or invalid card number. + ကဒ်အမျိုးအစားမမှန်ပါ (သို့မဟုá€á€º) ကဒ်နံပါá€á€ºá€™á€™á€¾á€”်ပါዠ+ + + This is not a valid International Bank Account Number (IBAN). + ဤá€á€”်ဖိုးသည် á€á€›á€¬á€¸á€á€„်နိုင်ငံá€á€€á€¬á€˜á€á€ºá€¡á€€á€±á€¬á€„့်နံပါá€á€º (International Bank Account Number, IBAN) မဟုá€á€ºá€•á€«á‹ + + + This value is not a valid ISBN-10. + ဤá€á€”်ဖိုးသည် မှန်ကန်သော ISBN-10 á€á€”်ဖိုးမဟုá€á€ºá€•á€«áŠ + + + This value is not a valid ISBN-13. + ဤá€á€”်ဖိုးသည် မှန်ကန်သော ISBN-13 á€á€”်ဖိုးမဟုá€á€ºá€•á€«áŠ + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် ISBN-10 (သို့မဟုá€á€º) ISBN-13 á€á€”်ဖိုးမဟုá€á€ºá€•á€«áŠ + + + This value is not a valid ISSN. + ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် ISSN á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ + + + This value is not a valid currency. + ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် ငွေကြေးá€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ + + + This value should be equal to {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value }} နှင့်ညီသင့်သည်ዠ+ + + This value should be greater than {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက်ကြီးသင့်သည်ዠ+ + + This value should be greater than or equal to {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက်ကြီးသင့်သည် (သို့မဟုá€á€º) ဤá€á€”်ဖိုးသည် {{ compared_value }} ညီသင့်သည်ዠ+ + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value_type }} {{ compared_value }} နှင့်ထပ်á€á€°á€Šá€®á€™á€»á€¾á€žá€„့်သည်ዠ+ + + This value should be less than {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက်မနဲသောá€á€²á€· á€á€”်ဖိုးဖြစ်သင့်သည်ዠ+ + + This value should be less than or equal to {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက် မနည်းသောá€á€”်ဖိုး (သို့မဟုá€á€º) ညီမျှသောá€á€”်ဖိုးဖြစ်သင့်သည်ዠ+ + + This value should not be equal to {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value }} နှင့်မညီသင့်ပါዠ+ + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{ compared_value_type }} {{ compared_value }} နှင့်ထပ်á€á€°á€™á€Šá€®á€™á€»á€¾á€žá€„့်သည်ዠ+ + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + ဤဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€…ားသည်အလွန်ကြီးလွန်းသည်ዠ({{ ratio }})á‹ á€á€½á€„့်ပြုထားသောဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€žá€¬á€¸á€žá€Šá€º {{ max_ratio }} ဖြစ်သည်ዠ+ + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + ဤဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€…ားသည်အလွန်သေးလွန်းသည်ዠ({{ ratio }})á‹ á€á€½á€„့်ပြုထားသောဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€žá€¬á€¸á€žá€Šá€º {{ min_ratio }} ဖြစ်သည်ዠ+ + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + ဤဓာá€á€ºá€•á€¯á€¶á€žá€Šá€º စá€á€¯á€›á€”်းဖြစ်နေသည် ({{ width }}x{{ height }}px)ዠစá€á€¯á€›á€”်းဓာá€á€ºá€•á€¯á€¶á€™á€»á€¬á€¸á€€á€­á€¯ á€á€½á€„့်မပြုပါዠ+ + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + ဤဓာá€á€ºá€•á€¯á€¶á€žá€Šá€º အလျှားလိုက်ဖြစ်နေသည် ({{ width }}x{{ height }}px). အလျှားလိုက်ဓာá€á€ºá€•á€¯á€¶á€™á€»á€¬á€¸á€á€½á€„့်မပြုပါዠ+ + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + ဤဓာá€á€ºá€•á€¯á€¶á€žá€Šá€º ဒေါင်လိုက်ဖြစ်နေသည် ({{ width }}x{{ height }}px). ဒေါင်လိုက်ဓာá€á€ºá€•á€¯á€¶á€™á€»á€¬á€¸á€á€½á€„့်မပြုပါዠ+ + + An empty file is not allowed. + ဖိုင်အလွá€á€ºá€€á€­á€¯á€á€„်á€á€½á€„့်မပြုပါዠ+ + + The host could not be resolved. + host ဖြေရှင်းáမနိုင်ပါዠ+ + + This value does not match the expected {{ charset }} charset. + ဤá€á€”်ဖိုးသည် မျှော်မှန်းထားသော {{ charset }} စားလုံးနှင့် ကိုက်ညီမှုမရှိပါዠ+ + + This is not a valid Business Identifier Code (BIC). + áŽá€„်းသည်မှန်ကန်သော Business Identifier Code (BIC) မဟုá€á€ºá€•á€«á‹ + + + Error + အမှား + + + This is not a valid UUID. + ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် UUID မဟုá€á€ºá€•á€«á‹ + + + This value should be a multiple of {{ compared_value }}. + ဤá€á€”်ဖိုးသည် {{compared_value}} á စá€á€°á€á€”်ဖိုးဖြစ်သင့်သည်ዠ+ + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + ဤ Business Identifier Code (BIC) သည် IBAN {{ iban }} နှင့်ဆက်စပ်မှုမရှိပါዠ+ + + This value should be valid JSON. + ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် JSON á€á€”်ဖိုးဖြစ်သင့်သည်ዠ+ + + This collection should contain only unique elements. + ဤ collection ကိုယ်ပိုင် elements များ ပါသင့်သည်ዠ+ + + This value should be positive. + ဤá€á€”်ဖိုးသည် အပေါင်းဖြစ်သင့်သည်ዠ+ + + This value should be either positive or zero. + ဤá€á€”်ဖိုးသည် အပေါင်း (သို့မဟုá€á€º) သုည ဖြစ်သင့်သည်ዠ+ + + This value should be negative. + ဤá€á€”်ဖိုးသည် အနုá€á€º ဖြစ်သင့်သည်ዠ+ + + This value should be either negative or zero. + ဤá€á€”်ဖိုးသည် အနုá€á€º (သို့မဟုá€á€º) သုည ဖြစ်သင့်သည်ዠ+ + + This value is not a valid timezone. + ဤá€á€”်ဖိုးသည် မှန်ကန်သော အá€á€»á€­á€”်ဇုန်မဟုá€á€ºá€•á€«á‹ + + + This password has been leaked in a data breach, it must not be used. Please use another password. + ဤစကားá€á€¾á€€á€º သည် ဒေá€á€¬á€•á€±á€«á€€á€ºá€€á€¼á€¬á€¸á€™á€¾á€¯á€á€…်á€á€¯á€–ြစ်á€á€²á€·á€žá€Šá€ºá‹ ဤစကားá€á€¾á€€á€ºá€€á€­á€¯á€¡á€žá€¯á€¶á€¸á€™á€•á€¼á€¯á€›á€•á€«á‹ ကျေးဇူးပြုá အá€á€¼á€¬á€¸á€…ကားá€á€¾á€€á€ºá€€á€­á€¯á€žá€¯á€¶á€¸á€•á€«á‹ + + + This value should be between {{ min }} and {{ max }}. + ဤá€á€”်ဖိုးသည် {{ min }} နှင့် {{ max }} ကြားရှိသင့်သည်ዠ+ + + This value is not a valid hostname. + ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် hostname မဟုá€á€ºá€•á€«á‹ + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + ဤ collection á€á€½á€„်ပါပါá€á€„်သော elements အရေအá€á€½á€€á€ºá€žá€Šá€º {{ compared_value }} á စá€á€°á€–ြစ်သင့်သည်ዠ+ + + This value should satisfy at least one of the following constraints: + ဤá€á€”်ဖိုးသည် အောက်ပါကန့်သá€á€ºá€á€»á€€á€ºá€™á€»á€¬á€¸á€¡á€”က်မှအနည်းဆုံးá€á€…်á€á€¯ ဖြည့်ဆည်းပေးသင့်သည်ዠ+ + + Each element of this collection should satisfy its own set of constraints. + ဤ collection á element á€á€…်á€á€¯á€…ီသည်áŽá€„်းáကိုယ်ပိုင်ကန့်သá€á€ºá€á€»á€€á€ºá€™á€»á€¬á€¸á€€á€­á€¯á€–ြည့်ဆည်းသင့်သည်ዠ+ + + This value is not a valid International Securities Identification Number (ISIN). + ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် အပြည်ပြည်ဆိုင်ရာငွေá€á€»á€±á€¸á€žá€€á€ºá€žá€±á€á€¶á€”ံပါá€á€º ,International Securities Identification Number (ISIN) မဟုá€á€ºá€•á€«á‹ + + + This value should be a valid expression. + ဤá€á€”်ဖိုးသည်မှန်ကန်သောစကားရပ်ဖြစ်သင့်သည်ዠ+ + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf new file mode 100644 index 00000000000..93132ec57cd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + Verdien mÃ¥ være usann. + + + This value should be true. + Verdien mÃ¥ være sann. + + + This value should be of type {{ type }}. + Verdien skal ha typen {{ type }}. + + + This value should be blank. + Verdien skal være blank. + + + The value you selected is not a valid choice. + Den valgte verdien er ikke gyldig. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Du mÃ¥ velge minst {{ limit }} valg. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Du kan maks velge {{ limit }} valg. + + + One or more of the given values is invalid. + En eller flere av de oppgitte verdiene er ugyldige. + + + This field was not expected. + Dette feltet var ikke forventet. + + + This field is missing. + Dette feltet mangler. + + + This value is not a valid date. + Verdien er ikke en gyldig dato. + + + This value is not a valid datetime. + Verdien er ikke en gyldig dato/tid. + + + This value is not a valid email address. + Verdien er ikke en gyldig e-postadresse. + + + The file could not be found. + Filen kunne ikke finnes. + + + The file is not readable. + Filen er ikke lesbar. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Filen er for stor ({{ size }} {{ suffix }}). Tilatte maksimale størrelse {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mimetypen av filen er ugyldig ({{ type }}). Tilatte mimetyper er {{ types }}. + + + This value should be {{ limit }} or less. + Verdien mÃ¥ være {{ limit }} tegn lang eller mindre. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Verdien er for lang. Den mÃ¥ ha {{ limit }} tegn eller mindre. + + + This value should be {{ limit }} or more. + Verdien mÃ¥ være {{ limit }} eller mer. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Verdien er for kort. Den mÃ¥ ha {{ limit }} tegn eller flere. + + + This value should not be blank. + Verdien kan ikke være blank. + + + This value should not be null. + Verdien kan ikke være tom (null). + + + This value should be null. + Verdien skal være tom (null). + + + This value is not valid. + Verdien er ugyldig. + + + This value is not a valid time. + Verdien er ikke en gyldig tid. + + + This value is not a valid URL. + Verdien er ikke en gyldig URL. + + + The two values should be equal. + Verdiene skal være identiske. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Filen er for stor. Den maksimale størrelsen er {{ limit }} {{ suffix }}. + + + The file is too large. + Filen er for stor. + + + The file could not be uploaded. + Filen kunne ikke lastes opp. + + + This value should be a valid number. + Verdien skal være et gyldig tall. + + + This file is not a valid image. + Denne filen er ikke et gyldig bilde. + + + This is not a valid IP address. + Dette er ikke en gyldig IP adresse. + + + This value is not a valid language. + Verdien er ikke et gyldig sprÃ¥k. + + + This value is not a valid locale. + Verdien er ikke en gyldig lokalitet. + + + This value is not a valid country. + Verdien er ikke et gyldig navn pÃ¥ land. + + + This value is already used. + Verdien er allerede brukt. + + + The size of the image could not be detected. + Bildestørrelsen kunne ikke oppdages. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Bildebredden er for stor ({{ width }} piksler). Tillatt maksimumsbredde er {{ max_width }} piksler. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Bildebredden er for liten ({{ width }} piksler). Forventet minimumsbredde er {{ min_width }} piksler. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Bildehøyden er for stor ({{ height }} piksler). Tillatt maksimumshøyde er {{ max_height }} piksler. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Bildehøyden er for liten ({{ height }} piksler). Forventet minimumshøyde er {{ min_height }} piksler. + + + This value should be the user's current password. + Verdien skal være brukerens sitt nÃ¥værende passord. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Verdien skal være nøyaktig {{ limit }} tegn. + + + The file was only partially uploaded. + Filen var kun delvis opplastet. + + + No file was uploaded. + Ingen fil var lastet opp. + + + No temporary folder was configured in php.ini. + Den midlertidige mappen (tmp) er ikke konfigurert i php.ini. + + + Cannot write temporary file to disk. + Kan ikke skrive midlertidig fil til disk. + + + A PHP extension caused the upload to fail. + En PHP-utvidelse forÃ¥rsaket en feil under opplasting. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Denne samlingen mÃ¥ inneholde {{ limit }} element eller flere.|Denne samlingen mÃ¥ inneholde {{ limit }} elementer eller flere. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Denne samlingen mÃ¥ inneholde {{ limit }} element eller færre.|Denne samlingen mÃ¥ inneholde {{ limit }} elementer eller færre. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Denne samlingen mÃ¥ inneholde nøyaktig {{ limit }} element.|Denne samlingen mÃ¥ inneholde nøyaktig {{ limit }} elementer. + + + Invalid card number. + Ugyldig kortnummer. + + + Unsupported card type or invalid card number. + Korttypen er ikke støttet eller kortnummeret er ugyldig. + + + This is not a valid International Bank Account Number (IBAN). + Dette er ikke et gyldig IBAN-nummer. + + + This value is not a valid ISBN-10. + Verdien er ikke en gyldig ISBN-10. + + + This value is not a valid ISBN-13. + Verdien er ikke en gyldig ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Verdien er hverken en gyldig ISBN-10 eller ISBN-13. + + + This value is not a valid ISSN. + Verdien er ikke en gyldig ISSN. + + + This value is not a valid currency. + Verdien er ikke gyldig valuta. + + + This value should be equal to {{ compared_value }}. + Verdien skal være lik {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Verdien skal være større enn {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Verdien skal være større enn eller lik {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Verdien skal være identisk med {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Verdien skal være mindre enn {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Verdien skal være mindre enn eller lik {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Verdien skal ikke være lik {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Verdien skal ikke være identisk med {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Bildeforholdet er for stort ({{ ratio }}). Tillatt bildeforhold er maks {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Bildeforholdet er for lite ({{ ratio }}). Forventet bildeforhold er minst {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Bildet er en kvadrat ({{ width }}x{{ height }}px). Kvadratiske bilder er ikke tillatt. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Bildet er i liggende retning ({{ width }}x{{ height }}px). Bilder i liggende retning er ikke tillatt. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Bildet er i stÃ¥ende retning ({{ width }}x{{ height }}px). Bilder i stÃ¥ende retning er ikke tillatt. + + + An empty file is not allowed. + Tomme filer er ikke tilatt. + + + The host could not be resolved. + Vertsnavn kunne ikke løses. + + + This value does not match the expected {{ charset }} charset. + Verdien samsvarer ikke med forventet tegnsett {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Dette er ikke en gyldig BIC. + + + Error + Feil + + + This is not a valid UUID. + Dette er ikke en gyldig UUID. + + + This value should be a multiple of {{ compared_value }}. + Verdien skal være flertall av {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Business Identifier Code (BIC) er ikke tilknyttet en IBAN {{ iban }}. + + + This value should be valid JSON. + Verdien er ikke gyldig JSON. + + + This collection should contain only unique elements. + Samlingen kan kun inneholde unike elementer. + + + This value should be positive. + Denne verdien mÃ¥ være positiv. + + + This value should be either positive or zero. + Denne verdien mÃ¥ være positiv eller null. + + + This value should be negative. + Denne verdien mÃ¥ være negativ. + + + This value should be either negative or zero. + Denne verdien mÃ¥ være negativ eller null. + + + This value is not a valid timezone. + Verdien er ikke en gyldig tidssone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Dette passordet er lekket i et datainnbrudd, det mÃ¥ ikke tas i bruk. Vennligst bruk et annet passord. + + + This value should be between {{ min }} and {{ max }}. + Verdien mÃ¥ være mellom {{ min }} og {{ max }}. + + + This value is not a valid hostname. + Denne verdien er ikke et gyldig vertsnavn. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Antall elementer i denne samlingen bør være et multiplum av {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Denne verdien skal tilfredsstille minst en av følgende begrensninger: + + + Each element of this collection should satisfy its own set of constraints. + Hvert element i denne samlingen skal tilfredsstille sitt eget sett med begrensninger. + + + This value is not a valid International Securities Identification Number (ISIN). + Denne verdien er ikke et gyldig International Securities Identification Number (ISIN). + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf new file mode 100644 index 00000000000..97d1da00e9a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Deze waarde moet onwaar zijn. + + + This value should be true. + Deze waarde moet waar zijn. + + + This value should be of type {{ type }}. + Deze waarde moet van het type {{ type }} zijn. + + + This value should be blank. + Deze waarde moet leeg zijn. + + + The value you selected is not a valid choice. + De geselecteerde waarde is geen geldige optie. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Selecteer ten minste {{ limit }} optie.|Selecteer ten minste {{ limit }} opties. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Selecteer maximaal {{ limit }} optie.|Selecteer maximaal {{ limit }} opties. + + + One or more of the given values is invalid. + Eén of meer van de ingegeven waarden zijn ongeldig. + + + This field was not expected. + Dit veld werd niet verwacht. + + + This field is missing. + Dit veld ontbreekt. + + + This value is not a valid date. + Deze waarde is geen geldige datum. + + + This value is not a valid datetime. + Deze waarde is geen geldige datum en tijd. + + + This value is not a valid email address. + Deze waarde is geen geldig e-mailadres. + + + The file could not be found. + Het bestand kon niet gevonden worden. + + + The file is not readable. + Het bestand is niet leesbaar. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Het bestand is te groot ({{ size }} {{ suffix }}). Toegestane maximum grootte is {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Het mime type van het bestand is ongeldig ({{ type }}). Toegestane mime types zijn {{ types }}. + + + This value should be {{ limit }} or less. + Deze waarde moet {{ limit }} of minder zijn. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Deze waarde is te lang. Hij mag maximaal {{ limit }} teken bevatten.|Deze waarde is te lang. Hij mag maximaal {{ limit }} tekens bevatten. + + + This value should be {{ limit }} or more. + Deze waarde moet {{ limit }} of meer zijn. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Deze waarde is te kort. Hij moet tenminste {{ limit }} teken bevatten.|Deze waarde is te kort. Hij moet tenminste {{ limit }} tekens bevatten. + + + This value should not be blank. + Deze waarde mag niet leeg zijn. + + + This value should not be null. + Deze waarde mag niet null zijn. + + + This value should be null. + Deze waarde moet null zijn. + + + This value is not valid. + Deze waarde is niet geldig. + + + This value is not a valid time. + Deze waarde is geen geldige tijd. + + + This value is not a valid URL. + Deze waarde is geen geldige URL. + + + The two values should be equal. + De twee waarden moeten gelijk zijn. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Het bestand is te groot. Toegestane maximum grootte is {{ limit }} {{ suffix }}. + + + The file is too large. + Het bestand is te groot. + + + The file could not be uploaded. + Het bestand kon niet worden geüpload. + + + This value should be a valid number. + Deze waarde moet een geldig getal zijn. + + + This file is not a valid image. + Dit bestand is geen geldige afbeelding. + + + This is not a valid IP address. + Dit is geen geldig IP-adres. + + + This value is not a valid language. + Deze waarde is geen geldige taal. + + + This value is not a valid locale. + Deze waarde is geen geldige locale. + + + This value is not a valid country. + Deze waarde is geen geldig land. + + + This value is already used. + Deze waarde wordt al gebruikt. + + + The size of the image could not be detected. + De grootte van de afbeelding kon niet bepaald worden. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + De afbeelding is te breed ({{ width }}px). De maximaal toegestane breedte is {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + De afbeelding is niet breed genoeg ({{ width }}px). De minimaal verwachte breedte is {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + De afbeelding is te hoog ({{ height }}px). De maximaal toegestane hoogte is {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + De afbeelding is niet hoog genoeg ({{ height }}px). De minimaal verwachte hoogte is {{ min_height }}px. + + + This value should be the user's current password. + Deze waarde moet het huidige wachtwoord van de gebruiker zijn. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Deze waarde moet exact {{ limit }} teken lang zijn.|Deze waarde moet exact {{ limit }} tekens lang zijn. + + + The file was only partially uploaded. + Het bestand is slechts gedeeltelijk geüpload. + + + No file was uploaded. + Er is geen bestand geüpload. + + + No temporary folder was configured in php.ini. + Er is geen tijdelijke map geconfigureerd in php.ini, of de gespecificeerde map bestaat niet. + + + Cannot write temporary file to disk. + Kan het tijdelijke bestand niet wegschrijven op disk. + + + A PHP extension caused the upload to fail. + De upload is mislukt vanwege een PHP-extensie. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Deze collectie moet {{ limit }} element of meer bevatten.|Deze collectie moet {{ limit }} elementen of meer bevatten. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Deze collectie moet {{ limit }} element of minder bevatten.|Deze collectie moet {{ limit }} elementen of minder bevatten. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Deze collectie moet exact {{ limit }} element bevatten.|Deze collectie moet exact {{ limit }} elementen bevatten. + + + Invalid card number. + Ongeldig creditcardnummer. + + + Unsupported card type or invalid card number. + Niet-ondersteund type creditcard of ongeldig nummer. + + + This is not a valid International Bank Account Number (IBAN). + Dit is geen geldig internationaal bankrekeningnummer (IBAN). + + + This value is not a valid ISBN-10. + Deze waarde is geen geldige ISBN-10. + + + This value is not a valid ISBN-13. + Deze waarde is geen geldige ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Deze waarde is geen geldige ISBN-10 of ISBN-13 waarde. + + + This value is not a valid ISSN. + Deze waarde is geen geldige ISSN waarde. + + + This value is not a valid currency. + Deze waarde is geen geldige valuta. + + + This value should be equal to {{ compared_value }}. + Deze waarde moet gelijk zijn aan {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Deze waarde moet groter zijn dan {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Deze waarde moet groter dan of gelijk aan {{ compared_value }} zijn. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Deze waarde moet identiek zijn aan {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Deze waarde moet minder zijn dan {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Deze waarde moet minder dan of gelijk aan {{ compared_value }} zijn. + + + This value should not be equal to {{ compared_value }}. + Deze waarde mag niet gelijk zijn aan {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Deze waarde mag niet identiek zijn aan {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + De afbeeldingsverhouding is te groot ({{ ratio }}). Maximale verhouding is {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + De afbeeldingsverhouding is te klein ({{ ratio }}). Minimale verhouding is {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + De afbeelding is vierkant ({{ width }}x{{ height }}px). Vierkante afbeeldingen zijn niet toegestaan. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + De afbeelding is liggend ({{ width }}x{{ height }}px). Liggende afbeeldingen zijn niet toegestaan. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + De afbeelding is staand ({{ width }}x{{ height }}px). Staande afbeeldingen zijn niet toegestaan. + + + An empty file is not allowed. + Lege bestanden zijn niet toegestaan. + + + The host could not be resolved. + De hostnaam kon niet worden bepaald. + + + This value does not match the expected {{ charset }} charset. + Deze waarde is niet in de verwachte tekencodering {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Dit is geen geldige bedrijfsidentificatiecode (BIC/SWIFT). + + + Error + Fout + + + This is not a valid UUID. + Dit is geen geldige UUID. + + + This value should be a multiple of {{ compared_value }}. + Deze waarde zou een meervoud van {{ compared_value }} moeten zijn. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Deze bedrijfsidentificatiecode (BIC) is niet gekoppeld aan IBAN {{ iban }}. + + + This value should be valid JSON. + Deze waarde moet geldige JSON zijn. + + + This collection should contain only unique elements. + Deze collectie moet alleen unieke elementen bevatten. + + + This value should be positive. + Deze waarde moet positief zijn. + + + This value should be either positive or zero. + Deze waarde moet positief of gelijk aan nul zijn. + + + This value should be negative. + Deze waarde moet negatief zijn. + + + This value should be either negative or zero. + Deze waarde moet negatief of gelijk aan nul zijn. + + + This value is not a valid timezone. + Deze waarde is geen geldige tijdzone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Dit wachtwoord is gelekt vanwege een data-inbreuk, het moet niet worden gebruikt. Kies een ander wachtwoord. + + + This value should be between {{ min }} and {{ max }}. + Deze waarde moet zich tussen {{ min }} en {{ max }} bevinden. + + + This value is not a valid hostname. + Deze waarde is geen geldige hostnaam. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Het aantal elementen van deze collectie moet een veelvoud zijn van {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Deze waarde moet voldoen aan tenminste een van de volgende voorwaarden: + + + Each element of this collection should satisfy its own set of constraints. + Elk element van deze collectie moet voldoen aan zijn eigen set voorwaarden. + + + This value is not a valid International Securities Identification Number (ISIN). + Deze waarde is geen geldig International Securities Identification Number (ISIN). + + + This value should be a valid expression. + Deze waarde moet een geldige expressie zijn. + + + This value is not a valid CSS color. + Deze waarde is geen geldige CSS kleur. + + + This value is not a valid CIDR notation. + Deze waarde is geen geldige CIDR notatie. + + + The value of the netmask should be between {{ min }} and {{ max }}. + De waarde van de netmask moet zich tussen {{ min }} en {{ max }} bevinden. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf new file mode 100644 index 00000000000..8963ba2d8c2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + Verdien skulle ha vore tom/nei. + + + This value should be true. + Verdien skulla ha vore satt/ja. + + + This value should be of type {{ type }}. + Verdien mÃ¥ vere av typen {{ type }}. + + + This value should be blank. + Verdien skal vere blank. + + + The value you selected is not a valid choice. + Verdien du valde er ikkje gyldig. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Du mÃ¥ gjere minst {{ limit }} val. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Du kan maksimalt gjere {{ limit }} val. + + + One or more of the given values is invalid. + Ein eller fleire av dei opplyste verdiane er ugyldige. + + + This field was not expected. + Dette feltet var ikkje forventa. + + + This field is missing. + Dette feltet mangler. + + + This value is not a valid date. + Verdien er ikkje ein gyldig dato. + + + This value is not a valid datetime. + Verdien er ikkje ein gyldig dato og tid. + + + This value is not a valid email address. + Verdien er ikkje ei gyldig e-postadresse. + + + The file could not be found. + Fila er ikkje funnen. + + + The file is not readable. + Fila kan ikkje lesast. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Fila er for stor ({{ size }} {{ suffix }}). Maksimal storleik er {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mime-typen av fila er ugyldig ({{ type }}). Tillatne mime-typar er {{ types }}. + + + This value should be {{ limit }} or less. + Verdien mÃ¥ vere {{ limit }} eller mindre. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Verdien er for lang. Den mÃ¥ vere {{ limit }} bokstavar eller mindre. + + + This value should be {{ limit }} or more. + Verdien mÃ¥ vere {{ limit }} eller meir. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Verdien er for kort. Den mÃ¥ ha {{ limit }} teikn eller fleire. + + + This value should not be blank. + Verdien kan ikkje vere blank. + + + This value should not be null. + Verdien kan ikkje vere tom (null). + + + This value should be null. + Verdien mÃ¥ vere tom (null). + + + This value is not valid. + Verdien er ikkje gyldig. + + + This value is not a valid time. + Verdien er ikkje ei gyldig tidseining. + + + This value is not a valid URL. + Verdien er ikkje ein gyldig URL. + + + The two values should be equal. + Dei to verdiane mÃ¥ vere like. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Fila er for stor. Den maksimale storleiken er {{ limit }} {{ suffix }}. + + + The file is too large. + Fila er for stor. + + + The file could not be uploaded. + Fila kunne ikkje bli lasta opp. + + + This value should be a valid number. + Verdien mÃ¥ vere eit gyldig tal. + + + This file is not a valid image. + Fila er ikkje eit gyldig bilete. + + + This is not a valid IP address. + Dette er ikkje ei gyldig IP-adresse. + + + This value is not a valid language. + Verdien er ikkje eit gyldig sprÃ¥k. + + + This value is not a valid locale. + Verdien er ikkje ein gyldig lokalitet (sprÃ¥k/region). + + + This value is not a valid country. + Verdien er ikkje eit gyldig land. + + + This value is already used. + Verdien er allereie i bruk. + + + The size of the image could not be detected. + Storleiken pÃ¥ biletet kunne ikkje oppdagast. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Biletbreidda er for stor, ({{ width }} pikslar). Tillaten maksimumsbreidde er {{ max_width }} pikslar. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Biletbreidda er for liten, ({{ width }} pikslar). Forventa minimumsbreidde er {{ min_width }} pikslar. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Bilethøgda er for stor, ({{ height }} pikslar). Tillaten maksimumshøgde er {{ max_height }} pikslar. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Billethøgda er for lÃ¥g, ({{ height }} pikslar). Forventa minimumshøgde er {{ min_height }} pikslar. + + + This value should be the user's current password. + Verdien mÃ¥ vere brukaren sitt noverande passord. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Verdien mÃ¥ vere nøyaktig {{ limit }} teikn. + + + The file was only partially uploaded. + Fila vart berre delvis lasta opp. + + + No file was uploaded. + Inga fil vart lasta opp. + + + No temporary folder was configured in php.ini. + Førebels mappe (tmp) er ikkje konfigurert i php.ini. + + + Cannot write temporary file to disk. + Kan ikkje skrive førebels fil til disk. + + + A PHP extension caused the upload to fail. + Ei PHP-udviding forÃ¥rsaka feil under opplasting. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Denne samlinga mÃ¥ innehalde {{ limit }} element eller meir.|Denne samlinga mÃ¥ innehalde {{ limit }} element eller meir. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Denne samlinga mÃ¥ innehalde {{ limit }} element eller færre.|Denne samlinga mÃ¥ innehalde {{ limit }} element eller færre. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Denne samlinga mÃ¥ innehalde nøyaktig {{ limit }} element.|Denne samlinga mÃ¥ innehalde nøyaktig {{ limit }} element. + + + Invalid card number. + Ugyldig kortnummer. + + + Unsupported card type or invalid card number. + Korttypen er ikkje støtta, eller kortnummeret er ugyldig. + + + This is not a valid International Bank Account Number (IBAN). + Dette er ikkje eit gyldig internasjonalt bankkontonummer (IBAN). + + + This value is not a valid ISBN-10. + Verdien er ikkje eit gyldig ISBN-10. + + + This value is not a valid ISBN-13. + Verdien er ikkje eit gyldig ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Verdien er verken eit gyldig ISBN-10 eller eit gyldig ISBN-13. + + + This value is not a valid ISSN. + Verdien er ikkje eit gyldig ISSN. + + + This value is not a valid currency. + Verdien er ikkje ein gyldig valuta. + + + This value should be equal to {{ compared_value }}. + Verdien bør vera eins med {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Verdien bør vera større enn {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Verdien bør vera større enn eller eins med {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Verdien bør vera eins med {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Verdien bør vera mindre enn {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Verdi bør vera mindre enn eller eins med {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Verdi bør ikkje vera eins med {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Denne verdien bør ikkje vera eins med {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Sideforholdet til biletet er for stort ({{ ratio }}). Sideforholdet kan ikkje vere større enn {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Sideforholdet til biletet er for lite ({{ ratio }}). Sideforholdet kan ikkje vere mindre enn {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Biletet er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske bilete er ikkje tillatne. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Biletet er landskapsorientert ({{ width }}x{{ height }}px). Landskapsorienterte bilete er ikkje tillatne. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Biletet er portrettorientert ({{ width }}x{{ height }}px). Portrettorienterte bilete er ikkje tillatne. + + + An empty file is not allowed. + Ei tom fil er ikkje tillate. + + + The host could not be resolved. + Verten kunne ikkje finnast. + + + This value does not match the expected {{ charset }} charset. + Verdien stemmer ikkje med forventa {{ charset }} charset. + + + This is not a valid Business Identifier Code (BIC). + Dette er ikkje ein gyldig Business Identifier Code (BIC). + + + Error + Feil + + + This is not a valid UUID. + Dette er ikkje ein gyldig UUID. + + + This value should be a multiple of {{ compared_value }}. + Verdien bør vera eit multipel av {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Denne Business Identifier Code (BIC) er ikkje kopla til IBAN {{ iban }}. + + + This value should be valid JSON. + Verdien bør vera gyldig JSON. + + + This collection should contain only unique elements. + Denne samlinga bør berre innehalda unike element. + + + This value should be positive. + Verdien bør vera positiv. + + + This value should be either positive or zero. + Verdien bør vera anten positiv eller null. + + + This value should be negative. + Verdien bør vera negativ. + + + This value should be either negative or zero. + Verdien bør vera negativ eller null. + + + This value is not a valid timezone. + Verdien er ikkje ei gyldig tidssone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Dette passordet har lekt ut ved eit datainnbrot, det fÃ¥r ikkje nyttast. Gje opp eit anna passord. + + + This value should be between {{ min }} and {{ max }}. + Denne verdien bør liggje mellom {{ min }} og {{ max }}. + + + This value is not a valid hostname. + Verdien er ikkje eit gyldig vertsnamn. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Talet pÃ¥ element i denne samlinga bør vera eit multippel av {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Verdien burde oppfylla minst ein av følgjande avgrensingar: + + + Each element of this collection should satisfy its own set of constraints. + Kvart element i denne samlinga bør oppfylla sine eigne avgrensingar. + + + This value is not a valid International Securities Identification Number (ISIN). + Verdien er ikkje eit gyldig International Securities Identification Number (ISIN). + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf new file mode 100644 index 00000000000..93132ec57cd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + Verdien mÃ¥ være usann. + + + This value should be true. + Verdien mÃ¥ være sann. + + + This value should be of type {{ type }}. + Verdien skal ha typen {{ type }}. + + + This value should be blank. + Verdien skal være blank. + + + The value you selected is not a valid choice. + Den valgte verdien er ikke gyldig. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Du mÃ¥ velge minst {{ limit }} valg. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Du kan maks velge {{ limit }} valg. + + + One or more of the given values is invalid. + En eller flere av de oppgitte verdiene er ugyldige. + + + This field was not expected. + Dette feltet var ikke forventet. + + + This field is missing. + Dette feltet mangler. + + + This value is not a valid date. + Verdien er ikke en gyldig dato. + + + This value is not a valid datetime. + Verdien er ikke en gyldig dato/tid. + + + This value is not a valid email address. + Verdien er ikke en gyldig e-postadresse. + + + The file could not be found. + Filen kunne ikke finnes. + + + The file is not readable. + Filen er ikke lesbar. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Filen er for stor ({{ size }} {{ suffix }}). Tilatte maksimale størrelse {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mimetypen av filen er ugyldig ({{ type }}). Tilatte mimetyper er {{ types }}. + + + This value should be {{ limit }} or less. + Verdien mÃ¥ være {{ limit }} tegn lang eller mindre. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Verdien er for lang. Den mÃ¥ ha {{ limit }} tegn eller mindre. + + + This value should be {{ limit }} or more. + Verdien mÃ¥ være {{ limit }} eller mer. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Verdien er for kort. Den mÃ¥ ha {{ limit }} tegn eller flere. + + + This value should not be blank. + Verdien kan ikke være blank. + + + This value should not be null. + Verdien kan ikke være tom (null). + + + This value should be null. + Verdien skal være tom (null). + + + This value is not valid. + Verdien er ugyldig. + + + This value is not a valid time. + Verdien er ikke en gyldig tid. + + + This value is not a valid URL. + Verdien er ikke en gyldig URL. + + + The two values should be equal. + Verdiene skal være identiske. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Filen er for stor. Den maksimale størrelsen er {{ limit }} {{ suffix }}. + + + The file is too large. + Filen er for stor. + + + The file could not be uploaded. + Filen kunne ikke lastes opp. + + + This value should be a valid number. + Verdien skal være et gyldig tall. + + + This file is not a valid image. + Denne filen er ikke et gyldig bilde. + + + This is not a valid IP address. + Dette er ikke en gyldig IP adresse. + + + This value is not a valid language. + Verdien er ikke et gyldig sprÃ¥k. + + + This value is not a valid locale. + Verdien er ikke en gyldig lokalitet. + + + This value is not a valid country. + Verdien er ikke et gyldig navn pÃ¥ land. + + + This value is already used. + Verdien er allerede brukt. + + + The size of the image could not be detected. + Bildestørrelsen kunne ikke oppdages. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Bildebredden er for stor ({{ width }} piksler). Tillatt maksimumsbredde er {{ max_width }} piksler. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Bildebredden er for liten ({{ width }} piksler). Forventet minimumsbredde er {{ min_width }} piksler. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Bildehøyden er for stor ({{ height }} piksler). Tillatt maksimumshøyde er {{ max_height }} piksler. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Bildehøyden er for liten ({{ height }} piksler). Forventet minimumshøyde er {{ min_height }} piksler. + + + This value should be the user's current password. + Verdien skal være brukerens sitt nÃ¥værende passord. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Verdien skal være nøyaktig {{ limit }} tegn. + + + The file was only partially uploaded. + Filen var kun delvis opplastet. + + + No file was uploaded. + Ingen fil var lastet opp. + + + No temporary folder was configured in php.ini. + Den midlertidige mappen (tmp) er ikke konfigurert i php.ini. + + + Cannot write temporary file to disk. + Kan ikke skrive midlertidig fil til disk. + + + A PHP extension caused the upload to fail. + En PHP-utvidelse forÃ¥rsaket en feil under opplasting. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Denne samlingen mÃ¥ inneholde {{ limit }} element eller flere.|Denne samlingen mÃ¥ inneholde {{ limit }} elementer eller flere. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Denne samlingen mÃ¥ inneholde {{ limit }} element eller færre.|Denne samlingen mÃ¥ inneholde {{ limit }} elementer eller færre. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Denne samlingen mÃ¥ inneholde nøyaktig {{ limit }} element.|Denne samlingen mÃ¥ inneholde nøyaktig {{ limit }} elementer. + + + Invalid card number. + Ugyldig kortnummer. + + + Unsupported card type or invalid card number. + Korttypen er ikke støttet eller kortnummeret er ugyldig. + + + This is not a valid International Bank Account Number (IBAN). + Dette er ikke et gyldig IBAN-nummer. + + + This value is not a valid ISBN-10. + Verdien er ikke en gyldig ISBN-10. + + + This value is not a valid ISBN-13. + Verdien er ikke en gyldig ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Verdien er hverken en gyldig ISBN-10 eller ISBN-13. + + + This value is not a valid ISSN. + Verdien er ikke en gyldig ISSN. + + + This value is not a valid currency. + Verdien er ikke gyldig valuta. + + + This value should be equal to {{ compared_value }}. + Verdien skal være lik {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Verdien skal være større enn {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Verdien skal være større enn eller lik {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Verdien skal være identisk med {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Verdien skal være mindre enn {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Verdien skal være mindre enn eller lik {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Verdien skal ikke være lik {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Verdien skal ikke være identisk med {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Bildeforholdet er for stort ({{ ratio }}). Tillatt bildeforhold er maks {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Bildeforholdet er for lite ({{ ratio }}). Forventet bildeforhold er minst {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Bildet er en kvadrat ({{ width }}x{{ height }}px). Kvadratiske bilder er ikke tillatt. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Bildet er i liggende retning ({{ width }}x{{ height }}px). Bilder i liggende retning er ikke tillatt. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Bildet er i stÃ¥ende retning ({{ width }}x{{ height }}px). Bilder i stÃ¥ende retning er ikke tillatt. + + + An empty file is not allowed. + Tomme filer er ikke tilatt. + + + The host could not be resolved. + Vertsnavn kunne ikke løses. + + + This value does not match the expected {{ charset }} charset. + Verdien samsvarer ikke med forventet tegnsett {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Dette er ikke en gyldig BIC. + + + Error + Feil + + + This is not a valid UUID. + Dette er ikke en gyldig UUID. + + + This value should be a multiple of {{ compared_value }}. + Verdien skal være flertall av {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Business Identifier Code (BIC) er ikke tilknyttet en IBAN {{ iban }}. + + + This value should be valid JSON. + Verdien er ikke gyldig JSON. + + + This collection should contain only unique elements. + Samlingen kan kun inneholde unike elementer. + + + This value should be positive. + Denne verdien mÃ¥ være positiv. + + + This value should be either positive or zero. + Denne verdien mÃ¥ være positiv eller null. + + + This value should be negative. + Denne verdien mÃ¥ være negativ. + + + This value should be either negative or zero. + Denne verdien mÃ¥ være negativ eller null. + + + This value is not a valid timezone. + Verdien er ikke en gyldig tidssone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Dette passordet er lekket i et datainnbrudd, det mÃ¥ ikke tas i bruk. Vennligst bruk et annet passord. + + + This value should be between {{ min }} and {{ max }}. + Verdien mÃ¥ være mellom {{ min }} og {{ max }}. + + + This value is not a valid hostname. + Denne verdien er ikke et gyldig vertsnavn. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Antall elementer i denne samlingen bør være et multiplum av {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Denne verdien skal tilfredsstille minst en av følgende begrensninger: + + + Each element of this collection should satisfy its own set of constraints. + Hvert element i denne samlingen skal tilfredsstille sitt eget sett med begrensninger. + + + This value is not a valid International Securities Identification Number (ISIN). + Denne verdien er ikke et gyldig International Securities Identification Number (ISIN). + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf new file mode 100644 index 00000000000..b983b2d6c87 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Ta wartość powinna być faÅ‚szem. + + + This value should be true. + Ta wartość powinna być prawdÄ…. + + + This value should be of type {{ type }}. + Ta wartość powinna być typu {{ type }}. + + + This value should be blank. + Ta wartość powinna być pusta. + + + The value you selected is not a valid choice. + Ta wartość powinna być jednÄ… z podanych opcji. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + PowinieneÅ› wybrać co najmniej {{ limit }} opcjÄ™.|PowinieneÅ› wybrać co najmniej {{ limit }} opcje.|PowinieneÅ› wybrać co najmniej {{ limit }} opcji. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + PowinieneÅ› wybrać maksymalnie {{ limit }} opcjÄ™.|PowinieneÅ› wybrać maksymalnie {{ limit }} opcje.|PowinieneÅ› wybrać maksymalnie {{ limit }} opcji. + + + One or more of the given values is invalid. + Jedna lub wiÄ™cej z podanych wartoÅ›ci jest nieprawidÅ‚owa. + + + This field was not expected. + Tego pola siÄ™ nie spodziewano. + + + This field is missing. + Tego pola brakuje. + + + This value is not a valid date. + Ta wartość nie jest prawidÅ‚owÄ… datÄ…. + + + This value is not a valid datetime. + Ta wartość nie jest prawidÅ‚owÄ… datÄ… i czasem. + + + This value is not a valid email address. + Ta wartość nie jest prawidÅ‚owym adresem email. + + + The file could not be found. + Plik nie mógÅ‚ zostać odnaleziony. + + + The file is not readable. + Nie można odczytać pliku. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Plik jest za duży ({{ size }} {{ suffix }}). Maksymalny dozwolony rozmiar to {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + NieprawidÅ‚owy typ mime pliku ({{ type }}). Dozwolone typy mime to {{ types }}. + + + This value should be {{ limit }} or less. + Ta wartość powinna wynosić {{ limit }} lub mniej. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ta wartość jest zbyt dÅ‚uga. Powinna mieć {{ limit }} lub mniej znaków.|Ta wartość jest zbyt dÅ‚uga. Powinna mieć {{ limit }} lub mniej znaków.|Ta wartość jest zbyt dÅ‚uga. Powinna mieć {{ limit }} lub mniej znaków. + + + This value should be {{ limit }} or more. + Ta wartość powinna wynosić {{ limit }} lub wiÄ™cej. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ta wartość jest zbyt krótka. Powinna mieć {{ limit }} lub wiÄ™cej znaków.|Ta wartość jest zbyt krótka. Powinna mieć {{ limit }} lub wiÄ™cej znaków.|Ta wartość jest zbyt krótka. Powinna mieć {{ limit }} lub wiÄ™cej znaków. + + + This value should not be blank. + Ta wartość nie powinna być pusta. + + + This value should not be null. + Ta wartość nie powinna być nullem. + + + This value should be null. + Ta wartość powinna być nullem. + + + This value is not valid. + Ta wartość jest nieprawidÅ‚owa. + + + This value is not a valid time. + Ta wartość nie jest prawidÅ‚owym czasem. + + + This value is not a valid URL. + Ta wartość nie jest prawidÅ‚owym adresem URL. + + + The two values should be equal. + Obie wartoÅ›ci powinny być równe. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Plik jest za duży. Maksymalny dozwolony rozmiar to {{ limit }} {{ suffix }}. + + + The file is too large. + Plik jest za duży. + + + The file could not be uploaded. + Plik nie mógÅ‚ być wgrany. + + + This value should be a valid number. + Ta wartość powinna być prawidÅ‚owÄ… liczbÄ…. + + + This file is not a valid image. + Ten plik nie jest obrazem. + + + This is not a valid IP address. + To nie jest prawidÅ‚owy adres IP. + + + This value is not a valid language. + Ta wartość nie jest prawidÅ‚owym jÄ™zykiem. + + + This value is not a valid locale. + Ta wartość nie jest prawidÅ‚owÄ… lokalizacjÄ…. + + + This value is not a valid country. + Ta wartość nie jest prawidÅ‚owÄ… nazwÄ… kraju. + + + This value is already used. + Ta wartość jest już wykorzystywana. + + + The size of the image could not be detected. + Nie można wykryć rozmiaru obrazka. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Szerokość obrazka jest zbyt duża ({{ width }}px). Maksymalna dopuszczalna szerokość to {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Szerokość obrazka jest zbyt maÅ‚a ({{ width }}px). Oczekiwana minimalna szerokość to {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Wysokość obrazka jest zbyt duża ({{ height }}px). Maksymalna dopuszczalna wysokość to {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Wysokość obrazka jest zbyt maÅ‚a ({{ height }}px). Oczekiwana minimalna wysokość to {{ min_height }}px. + + + This value should be the user's current password. + Ta wartość powinna być aktualnym hasÅ‚em użytkownika. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ta wartość powinna mieć dokÅ‚adnie {{ limit }} znak.|Ta wartość powinna mieć dokÅ‚adnie {{ limit }} znaki.|Ta wartość powinna mieć dokÅ‚adnie {{ limit }} znaków. + + + The file was only partially uploaded. + Plik zostaÅ‚ wgrany tylko częściowo. + + + No file was uploaded. + Å»aden plik nie zostaÅ‚ wgrany. + + + No temporary folder was configured in php.ini. + Nie skonfigurowano folderu tymczasowego w php.ini lub skonfigurowany folder nie istnieje. + + + Cannot write temporary file to disk. + Nie można zapisać pliku tymczasowego na dysku. + + + A PHP extension caused the upload to fail. + Rozszerzenie PHP spowodowaÅ‚o bÅ‚Ä…d podczas wgrywania. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ten zbiór powinien zawierać {{ limit }} lub wiÄ™cej elementów. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ten zbiór powinien zawierać {{ limit }} lub mniej elementów. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ten zbiór powinien zawierać dokÅ‚adnie {{ limit }} element.|Ten zbiór powinien zawierać dokÅ‚adnie {{ limit }} elementy.|Ten zbiór powinien zawierać dokÅ‚adnie {{ limit }} elementów. + + + Invalid card number. + NieprawidÅ‚owy numer karty. + + + Unsupported card type or invalid card number. + NieobsÅ‚ugiwany rodzaj karty lub nieprawidÅ‚owy numer karty. + + + This is not a valid International Bank Account Number (IBAN). + NieprawidÅ‚owy miÄ™dzynarodowy numer rachunku bankowego (IBAN). + + + This value is not a valid ISBN-10. + Ta wartość nie jest prawidÅ‚owym numerem ISBN-10. + + + This value is not a valid ISBN-13. + Ta wartość nie jest prawidÅ‚owym numerem ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ta wartość nie jest prawidÅ‚owym numerem ISBN-10 ani ISBN-13. + + + This value is not a valid ISSN. + Ta wartość nie jest prawidÅ‚owym numerem ISSN. + + + This value is not a valid currency. + Ta wartość nie jest prawidÅ‚owÄ… walutÄ…. + + + This value should be equal to {{ compared_value }}. + Ta wartość powinna być równa {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ta wartość powinna być wiÄ™ksza niż {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ta wartość powinna być wiÄ™ksza bÄ…dź równa {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ta wartość powinna być identycznego typu {{ compared_value_type }} oraz wartoÅ›ci {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ta wartość powinna być mniejsza niż {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ta wartość powinna być mniejsza bÄ…dź równa {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ta wartość nie powinna być równa {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ta wartość nie powinna być identycznego typu {{ compared_value_type }} oraz wartoÅ›ci {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Proporcje obrazu sÄ… zbyt duże ({{ ratio }}). Maksymalne proporcje to {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Proporcje obrazu sÄ… zbyt maÅ‚e ({{ ratio }}). Minimalne proporcje to {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Obraz jest kwadratem ({{ width }}x{{ height }}px). Kwadratowe obrazy nie sÄ… akceptowane. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Obraz jest panoramiczny ({{ width }}x{{ height }}px). Panoramiczne zdjÄ™cia nie sÄ… akceptowane. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Obraz jest portretowy ({{ width }}x{{ height }}px). Portretowe zdjÄ™cia nie sÄ… akceptowane. + + + An empty file is not allowed. + Plik nie może być pusty. + + + The host could not be resolved. + Nazwa hosta nie zostaÅ‚a rozpoznana. + + + This value does not match the expected {{ charset }} charset. + Ta wartość nie pasuje do oczekiwanego zestawu znaków {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Ta wartość nie jest poprawnym kodem BIC (Business Identifier Code). + + + Error + BÅ‚Ä…d + + + This is not a valid UUID. + To nie jest poprawne UUID. + + + This value should be a multiple of {{ compared_value }}. + Ta wartość powinna być wielokrotnoÅ›ciÄ… {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ten kod BIC (Business Identifier Code) nie jest powiÄ…zany z miÄ™dzynarodowym numerem rachunku bankowego (IBAN) {{ iban }}. + + + This value should be valid JSON. + Ta wartość powinna być prawidÅ‚owym formatem JSON. + + + This collection should contain only unique elements. + Ten zbiór powinien zawierać tylko unikalne elementy. + + + This value should be positive. + Ta wartość powinna być dodatnia. + + + This value should be either positive or zero. + Ta wartość powinna być dodatnia lub równa zero. + + + This value should be negative. + Ta wartość powinna być ujemna. + + + This value should be either negative or zero. + Ta wartość powinna być ujemna lub równa zero. + + + This value is not a valid timezone. + Ta wartość nie jest prawidÅ‚owÄ… strefÄ… czasowÄ…. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + To hasÅ‚o wyciekÅ‚o w wyniku naruszenia danych i nie może być użyte. ProszÄ™ użyć innego hasÅ‚a. + + + This value should be between {{ min }} and {{ max }}. + Ta wartość powinna być pomiÄ™dzy {{ min }} a {{ max }}. + + + This value is not a valid hostname. + Ta wartość nie jest prawidÅ‚owÄ… nazwÄ… hosta. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Liczba elementów w tym zbiorze powinna być wielokrotnoÅ›ciÄ… {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ta wartość powinna speÅ‚niać co najmniej jednÄ… z nastÄ™pujÄ…cych reguÅ‚: + + + Each element of this collection should satisfy its own set of constraints. + Każdy element w tym zbiorze powinien speÅ‚niać wÅ‚asny zestaw reguÅ‚. + + + This value is not a valid International Securities Identification Number (ISIN). + Ta wartość nie jest prawidÅ‚owym MiÄ™dzynarodowym Numerem Identyfikacyjnym Papierów WartoÅ›ciowych (ISIN). + + + This value should be a valid expression. + Ta wartość powinna być prawidÅ‚owym wyrażeniem. + + + This value is not a valid CSS color. + Ta wartość nie jest prawidÅ‚owym kolorem CSS. + + + This value is not a valid CIDR notation. + Ta wartość nie jest prawidÅ‚owÄ… notacjÄ… CIDR. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Wartość maski podsieci powinna być pomiÄ™dzy {{ min }} i {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf new file mode 100644 index 00000000000..090add6bd34 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Este valor deveria ser falso. + + + This value should be true. + Este valor deveria ser verdadeiro. + + + This value should be of type {{ type }}. + Este valor deveria ser do tipo {{ type }}. + + + This value should be blank. + Este valor deveria ser vazio. + + + The value you selected is not a valid choice. + O valor selecionado não é uma opção válida. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Você deveria selecionar {{ limit }} opção no mínimo.|Você deveria selecionar {{ limit }} opções no mínimo. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Você deve selecionar, no máximo {{ limit }} opção.|Você deve selecionar, no máximo {{ limit }} opções. + + + One or more of the given values is invalid. + Um ou mais dos valores introduzidos não são válidos. + + + This field was not expected. + Este campo não era esperado. + + + This field is missing. + Este campo está faltando. + + + This value is not a valid date. + Este valor não é uma data válida. + + + This value is not a valid datetime. + Este valor não é uma data-hora válida. + + + This value is not a valid email address. + Este valor não é um endereço de e-mail válido. + + + The file could not be found. + O arquivo não pôde ser encontrado. + + + The file is not readable. + O arquivo não pôde ser lido. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + O arquivo é muito grande ({{ size }} {{ suffix }}). O tamanho máximo permitido é de {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + O tipo mime do arquivo é inválido ({{ type }}). Os tipos mime permitidos são {{ types }}. + + + This value should be {{ limit }} or less. + Este valor deveria ser {{ limit }} ou menor. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + O valor é muito longo. Deveria ter {{ limit }} caracteres ou menos. + + + This value should be {{ limit }} or more. + Este valor deveria ser {{ limit }} ou mais. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + O valor é muito curto. Deveria de ter {{ limit }} caractere ou mais.|O valor é muito curto. Deveria de ter {{ limit }} caracteres ou mais. + + + This value should not be blank. + Este valor não deveria ser branco/vazio. + + + This value should not be null. + Este valor não deveria ser nulo. + + + This value should be null. + Este valor deveria ser nulo. + + + This value is not valid. + Este valor não é válido. + + + This value is not a valid time. + Este valor não é uma hora válida. + + + This value is not a valid URL. + Este valor não é um URL válido. + + + The two values should be equal. + Os dois valores deveriam ser iguais. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + O arquivo é muito grande. O tamanho máximo permitido é de {{ limit }} {{ suffix }}. + + + The file is too large. + O ficheiro é muito grande. + + + The file could not be uploaded. + Não foi possível carregar o ficheiro. + + + This value should be a valid number. + Este valor deveria ser um número válido. + + + This file is not a valid image. + Este ficheiro não é uma imagem. + + + This is not a valid IP address. + Este endereço de IP não é válido. + + + This value is not a valid language. + Este valor não é uma linguagem válida. + + + This value is not a valid locale. + Este valor não é um 'locale' válido. + + + This value is not a valid country. + Este valor não é um País válido. + + + This value is already used. + Este valor já está a ser usado. + + + The size of the image could not be detected. + O tamanho da imagem não foi detetado. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A largura da imagem ({{ width }}px) é muito grande. A largura máxima da imagem é: {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A largura da imagem ({{ width }}px) é muito pequena. A largura miníma da imagem é de: {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A altura da imagem ({{ height }}px) é muito grande. A altura máxima da imagem é de: {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A altura da imagem ({{ height }}px) é muito pequena. A altura miníma da imagem é de: {{ min_height }}px. + + + This value should be the user's current password. + Este valor deveria ser a senha atual do usuário. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Este valor deve possuir exatamente {{ limit }} caracteres. + + + The file was only partially uploaded. + Só foi enviada uma parte do arquivo. + + + No file was uploaded. + Nenhum arquivo foi enviado. + + + No temporary folder was configured in php.ini. + Não existe uma pasta temporária configurada no arquivo php.ini. + + + Cannot write temporary file to disk. + Não foi possível escrever os arquivos temporários no disco. + + + A PHP extension caused the upload to fail. + Uma extensão PHP causou a falha no envio. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Esta coleção deve conter {{ limit }} elemento ou mais.|Esta coleção deve conter {{ limit }} elementos ou mais. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Esta coleção deve conter {{ limit }} elemento ou menos.|Esta coleção deve conter {{ limit }} elementos ou menos. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Esta coleção deve conter exatamente {{ limit }} elemento.|Esta coleção deve conter exatamente {{ limit }} elementos. + + + Invalid card number. + Número de cartão inválido. + + + Unsupported card type or invalid card number. + Tipo de cartão não suportado ou número de cartão inválido. + + + This is not a valid International Bank Account Number (IBAN). + Este não é um Número Internacional de Conta Bancária (IBAN) válido. + + + This value is not a valid ISBN-10. + Este valor não é um ISBN-10 válido. + + + This value is not a valid ISBN-13. + Este valor não é um ISBN-13 válido. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Este valor não é um ISBN-10 ou ISBN-13 válido. + + + This value is not a valid ISSN. + Este valor não é um ISSN válido. + + + This value is not a valid currency. + Este não é um valor monetário válido. + + + This value should be equal to {{ compared_value }}. + Este valor deve ser igual a {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Este valor deve ser superior a {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Este valor deve ser igual ou superior a {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor deve ser idêntico a {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Este valor deve ser inferior a {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Este valor deve ser igual ou inferior a {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Este valor não deve ser igual a {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor não deve ser idêntico a {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + O formato da imagem é muito grande ({{ ratio }}). O formato máximo é {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + O formato da imagem é muito pequeno ({{ ratio }}). O formato mínimo esperado é {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + A imagem é um quadrado ({{ width }}x{{ height }}px). Imagens quadradas não são permitidas. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + A imagem está em orientação de paisagem ({{ width }}x{{ height }}px). Imagens orientadas em paisagem não são permitidas. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + A imagem está em orientação de retrato ({{ width }}x{{ height }}px). Imagens orientadas em retrato não são permitidas. + + + An empty file is not allowed. + Um arquivo vazio não é permitido. + + + The host could not be resolved. + O host não pode ser resolvido. + + + This value does not match the expected {{ charset }} charset. + O valor não corresponde ao conjunto de caracteres {{ charset }} esperado. + + + This is not a valid Business Identifier Code (BIC). + O Código de Identificação de Empresa (BIC) não é válido. + + + Error + Erro + + + This is not a valid UUID. + Este valor não é um UUID válido. + + + This value should be a multiple of {{ compared_value }}. + Este valor deve ser um múltiplo de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + O Código de Identificação de Empresa (BIC) não está associado ao IBAN {{ iban }}. + + + This value should be valid JSON. + Este valor deve ser um JSON válido. + + + This collection should contain only unique elements. + Esta coleção deve conter só elementos únicos. + + + This value should be positive. + Este valor deve ser estritamente positivo. + + + This value should be either positive or zero. + Este valor deve ser superior ou igual a zero. + + + This value should be negative. + Este valor deve ser estritamente negativo. + + + This value should be either negative or zero. + Este valor deve ser inferior ou igual a zero. + + + This value is not a valid timezone. + Este valor não é um fuso horário válido. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Esta senha foi divulgada durante uma fuga de dados, não deve ser usada de novamente. Por favor usar uma senha outra. + + + This value should be between {{ min }} and {{ max }}. + Este valor deve situar-se entre {{ min }} e {{ max }}. + + + This value is not a valid hostname. + Este valor não é um nome de host válido. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + O número de elementos desta coleção deve ser um múltiplo de {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Este valor deve satisfazer pelo menos uma das seguintes restrições : + + + Each element of this collection should satisfy its own set of constraints. + Cada elemento desta coleção deve satisfazer o seu próprio conjunto de restrições. + + + This value is not a valid International Securities Identification Number (ISIN). + Este valor não é um Número Internacional de Identificação de Segurança (ISIN) válido. + + + This value should be a valid expression. + Este valor deve ser uma expressão válida. + + + This value is not a valid CSS color. + Este valor não é uma cor de CSS válida. + + + This value is not a valid CIDR notation. + Este valor não é uma notação CIDR válida. + + + The value of the netmask should be between {{ min }} and {{ max }}. + O valor da máscara de rede deve estar entre {{ min }} e {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf new file mode 100644 index 00000000000..e88b81f9eaf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Este valor deve ser falso. + + + This value should be true. + Este valor deve ser verdadeiro. + + + This value should be of type {{ type }}. + Este valor deve ser do tipo {{ type }}. + + + This value should be blank. + Este valor deve ser vazio. + + + The value you selected is not a valid choice. + O valor selecionado não é uma opção válida. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Você deve selecionar, no mínimo, {{ limit }} opção.|Você deve selecionar, no mínimo, {{ limit }} opções. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Você deve selecionar, no máximo, {{ limit }} opção.|Você deve selecionar, no máximo, {{ limit }} opções. + + + One or more of the given values is invalid. + Um ou mais valores informados são inválidos. + + + This field was not expected. + Este campo não era esperado. + + + This field is missing. + Este campo está ausente. + + + This value is not a valid date. + Este valor não é uma data válida. + + + This value is not a valid datetime. + Este valor não é uma data e hora válida. + + + This value is not a valid email address. + Este valor não é um endereço de e-mail válido. + + + The file could not be found. + O arquivo não foi encontrado. + + + The file is not readable. + O arquivo não pode ser lido. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + O arquivo é muito grande ({{ size }} {{ suffix }}). O tamanho máximo permitido é {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + O tipo mime do arquivo é inválido ({{ type }}). Os tipos mime permitidos são {{ types }}. + + + This value should be {{ limit }} or less. + Este valor deve ser {{ limit }} ou menos. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Este valor é muito longo. Deve ter {{ limit }} caractere ou menos.|Este valor é muito longo. Deve ter {{ limit }} caracteres ou menos. + + + This value should be {{ limit }} or more. + Este valor deve ser {{ limit }} ou mais. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Este valor é muito curto. Deve ter {{ limit }} caractere ou mais.|Este valor é muito curto. Deve ter {{ limit }} caracteres ou mais. + + + This value should not be blank. + Este valor não deve ser vazio. + + + This value should not be null. + Este valor não deve ser nulo. + + + This value should be null. + Este valor deve ser nulo. + + + This value is not valid. + Este valor não é válido. + + + This value is not a valid time. + Este valor não é uma hora válida. + + + This value is not a valid URL. + Este valor não é uma URL válida. + + + The two values should be equal. + Os dois valores devem ser iguais. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + O arquivo é muito grande. O tamanho máximo permitido é de {{ limit }} {{ suffix }}. + + + The file is too large. + O arquivo é muito grande. + + + The file could not be uploaded. + O arquivo não pode ser enviado. + + + This value should be a valid number. + Este valor deve ser um número válido. + + + This file is not a valid image. + Este arquivo não é uma imagem válida. + + + This is not a valid IP address. + Este não é um endereço de IP válido. + + + This value is not a valid language. + Este valor não é um idioma válido. + + + This value is not a valid locale. + Este valor não é uma localidade válida. + + + This value is not a valid country. + Este valor não é um país válido. + + + This value is already used. + Este valor já está sendo usado. + + + The size of the image could not be detected. + O tamanho da imagem não pode ser detectado. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + A largura da imagem é muito grande ({{ width }}px). A largura máxima permitida é de {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + A largura da imagem é muito pequena ({{ width }}px). A largura mínima esperada é de {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + A altura da imagem é muito grande ({{ height }}px). A altura máxima permitida é de {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + A altura da imagem é muito pequena ({{ height }}px). A altura mínima esperada é de {{ min_height }}px. + + + This value should be the user's current password. + Este valor deve ser a senha atual do usuário. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Este valor deve ter exatamente {{ limit }} caractere.|Este valor deve ter exatamente {{ limit }} caracteres. + + + The file was only partially uploaded. + O arquivo foi enviado apenas parcialmente. + + + No file was uploaded. + Nenhum arquivo foi enviado. + + + No temporary folder was configured in php.ini. + Nenhum diretório temporário foi configurado no php.ini. + + + Cannot write temporary file to disk. + Não foi possível escrever o arquivo temporário no disco. + + + A PHP extension caused the upload to fail. + Uma extensão PHP fez com que o envio falhasse. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Esta coleção deve conter {{ limit }} elemento ou mais.|Esta coleção deve conter {{ limit }} elementos ou mais. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Esta coleção deve conter {{ limit }} elemento ou menos.|Esta coleção deve conter {{ limit }} elementos ou menos. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Esta coleção deve conter exatamente {{ limit }} elemento.|Esta coleção deve conter exatamente {{ limit }} elementos. + + + Invalid card number. + Número de cartão inválido. + + + Unsupported card type or invalid card number. + Tipo de cartão não suportado ou número de cartão inválido. + + + This is not a valid International Bank Account Number (IBAN). + Este não é um Número Internacional de Conta Bancária (IBAN) válido. + + + This value is not a valid ISBN-10. + Este valor não é um ISBN-10 válido. + + + This value is not a valid ISBN-13. + Este valor não é um ISBN-13 válido. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Este valor não é um ISBN-10 e nem um ISBN-13 válido. + + + This value is not a valid ISSN. + Este valor não é um ISSN válido. + + + This value is not a valid currency. + Este não é um valor monetário válido. + + + This value should be equal to {{ compared_value }}. + Este valor deve ser igual a {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Este valor deve ser maior que {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Este valor deve ser maior ou igual a {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor deve ser idêntico a {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Este valor deve ser menor que {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Este valor deve ser menor ou igual a {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Este valor não deve ser igual a {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Este valor não deve ser idêntico a {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + A proporção da imagem é muito grande ({{ ratio }}). A proporção máxima permitida é {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + A proporção da imagem é muito pequena ({{ ratio }}). A proporção mínima esperada é {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + A imagem está num formato quadrado ({{ width }}x{{ height }}px). Imagens com formato quadrado não são permitidas. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + A imagem está orientada à paisagem ({{ width }}x{{ height }}px). Imagens orientadas à paisagem não são permitidas. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + A imagem está orientada ao retrato ({{ width }}x{{ height }}px). Imagens orientadas ao retrato não são permitidas. + + + An empty file is not allowed. + Arquivo vazio não é permitido. + + + The host could not be resolved. + O host não pôde ser resolvido. + + + This value does not match the expected {{ charset }} charset. + Este valor não corresponde ao charset {{ charset }} esperado. + + + This is not a valid Business Identifier Code (BIC). + Este não é um Código Identificador Bancário (BIC) válido. + + + Error + Erro + + + This is not a valid UUID. + Este não é um UUID válido. + + + This value should be a multiple of {{ compared_value }}. + Este valor deve ser múltiplo de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Este Código Identificador Bancário (BIC) não está associado ao IBAN {{ iban }}. + + + This value should be valid JSON. + Este valor deve ser um JSON válido. + + + This collection should contain only unique elements. + Esta coleção deve conter somente elementos únicos. + + + This value should be positive. + Este valor deve ser positivo. + + + This value should be either positive or zero. + Este valor deve ser positivo ou zero. + + + This value should be negative. + Este valor deve ser negativo. + + + This value should be either negative or zero. + Este valor deve ser negativo ou zero. + + + This value is not a valid timezone. + Este valor não representa um fuso horário válido. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Esta senha foi divulgada num vazamento de dados e não deve ser utilizada. Por favor, utilize outra senha. + + + This value should be between {{ min }} and {{ max }}. + Este valor deve estar entre {{ min }} e {{ max }}. + + + This value is not a valid hostname. + Este valor não é um nome de host válido. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + O número de elementos desta coleção deve ser um múltiplo de {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Este valor deve satisfazer pelo menos uma das seguintes restrições: + + + Each element of this collection should satisfy its own set of constraints. + Cada elemento desta coleção deve satisfazer seu próprio grupo de restrições. + + + This value is not a valid International Securities Identification Number (ISIN). + Este valor não é um Número de Identificação de Títulos Internacionais (ISIN) válido. + + + This value should be a valid expression. + Este valor deve ser uma expressão válida. + + + This value is not a valid CSS color. + Este valor não é uma cor CSS válida. + + + This value is not a valid CIDR notation. + Este valor não é uma notação CIDR válida. + + + The value of the netmask should be between {{ min }} and {{ max }}. + O valor da máscara de rede deve estar entre {{ min }} e {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf new file mode 100644 index 00000000000..7fba2cd1e0e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf @@ -0,0 +1,403 @@ + + + + + + This value should be false. + Această valoare ar trebui să fie falsă (false). + + + This value should be true. + Această valoare ar trebui să fie adevărată (true). + + + This value should be of type {{ type }}. + Această valoare ar trebui să fie de tipul {{ type }}. + + + This value should be blank. + Această valoare ar trebui sa fie goală. + + + The value you selected is not a valid choice. + Valoarea selectată nu este o opÈ›iune validă. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Trebuie să selectaÈ›i cel puÈ›in {{ limit }} opÈ›iune.|Trebuie să selectaÈ›i cel puÈ›in {{ limit }} opÈ›iuni.|Trebuie să selectaÈ›i cel puÈ›in {{ limit }} de opÈ›iuni + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Trebuie să selectaÈ›i cel mult {{ limit }} opÈ›iune.|Trebuie să selectaÈ›i cel mult {{ limit }} opÈ›iuni.|Trebuie să selectaÈ›i cel mult {{ limit }} de opÈ›iuni. + + + One or more of the given values is invalid. + Una sau mai multe dintre valorile furnizate sunt invalide. + + + This field was not expected. + Acest câmp nu era de aÅŸteptat. + + + This field is missing. + Acest câmp este lipsă. + + + This value is not a valid date. + Această valoare nu reprezintă o dată validă. + + + This value is not a valid datetime. + Această valoare nu reprezintă o dată È™i oră validă. + + + This value is not a valid email address. + Această valoare nu reprezintă o adresă de e-mail validă. + + + The file could not be found. + FiÈ™ierul nu a putut fi găsit. + + + The file is not readable. + FiÈ™ierul nu poate fi citit. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + FiÈ™ierul este prea mare ({{ size }} {{ suffix }}). Dimensiunea maximă permisă este {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Tipul fiÈ™ierului este invalid ({{ type }}). Tipurile permise de fiÈ™iere sunt ({{ types }}). + + + This value should be {{ limit }} or less. + Această valoare ar trebui să fie cel mult {{ limit }}. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caracter.|Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} caractere.|Această valoare este prea lungă. Ar trebui să aibă maxim {{ limit }} de caractere. + + + This value should be {{ limit }} or more. + Această valoare ar trebui să fie cel puÈ›in {{ limit }}. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caracter.|Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} caractere.|Această valoare este prea scurtă. Ar trebui să aibă minim {{ limit }} de caractere. + + + This value should not be blank. + Această valoare nu ar trebui să fie goală. + + + This value should not be null. + Această valoare nu ar trebui să fie nulă (null). + + + This value should be null. + Această valoare ar trebui să fie nulă (null). + + + This value is not valid. + Această valoare nu este validă. + + + This value is not a valid time. + Această valoare nu reprezintă o oră validă. + + + This value is not a valid URL. + Această valoare nu reprezintă un URL (link) valid. + + + The two values should be equal. + Cele două valori ar trebui să fie egale. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + FiÈ™ierul este prea mare. Mărimea maximă permisă este {{ limit }} {{ suffix }}. + + + The file is too large. + FiÈ™ierul este prea mare. + + + The file could not be uploaded. + FiÈ™ierul nu a putut fi încărcat. + + + This value should be a valid number. + Această valoare nu reprezintă un număr valid. + + + This file is not a valid image. + Acest fiÈ™ier nu este o imagine validă. + + + This is not a valid IP address. + Această valoare nu este o adresă IP validă. + + + This value is not a valid language. + Această valoare nu reprezintă o limbă corectă. + + + This value is not a valid locale. + Această valoare nu reprezintă un dialect (o limbă) corect. + + + This value is not a valid country. + Această valoare nu este o È›ară validă. + + + This value is already used. + Această valoare este folosită deja. + + + The size of the image could not be detected. + Mărimea imaginii nu a putut fi detectată. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Lățimea imaginii este prea mare ({{ width }}px). Lățimea maximă permisă este de {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Lățimea imaginii este prea mică ({{ width }}px). Lățimea minimă permisă este de {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ÃŽnălÈ›imea imaginii este prea mare ({{ height }}px). ÃŽnălÈ›imea maximă permisă este de {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ÃŽnălÈ›imea imaginii este prea mică ({{ height }}px). ÃŽnălÈ›imea minimă permisă este de {{ min_height }}px. + + + This value should be the user's current password. + Această valoare trebuie să fie parola curentă a utilizatorului. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Această valoare trebuie să conÈ›ină exact {{ limit }} caracter.|Această valoare trebuie să conÈ›ină exact {{ limit }} caractere.|Această valoare trebuie să conÈ›ină exact {{ limit }} de caractere. + + + The file was only partially uploaded. + FiÈ™ierul a fost încărcat parÈ›ial. + + + No file was uploaded. + Nu a fost încărcat nici un fiÈ™ier. + + + No temporary folder was configured in php.ini. + Nu este configurat nici un director temporar in php.ini. + + + Cannot write temporary file to disk. + Nu a fost posibilă scrierea fiÈ™ierului temporar pe disk. + + + A PHP extension caused the upload to fail. + O extensie PHP a prevenit încărcarea cu succes a fiÈ™ierului. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Această colecÈ›ie trebuie să conÈ›ină cel puÈ›in {{ limit }} element.|Această colecÈ›ie trebuie să conÈ›ină cel puÈ›in {{ limit }} elemente.|Această colecÈ›ie trebuie să conÈ›ină cel puÈ›in {{ limit }} de elemente. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Această colecÈ›ie trebuie să conÈ›ină cel mult {{ limit }} element.|Această colecÈ›ie trebuie să conÈ›ină cel mult {{ limit }} elemente.|Această colecÈ›ie trebuie să conÈ›ină cel mult {{ limit }} de elemente. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Această colecÈ›ie trebuie să conÈ›ină {{ limit }} element.|Această colecÈ›ie trebuie să conÈ›ină {{ limit }} elemente.|Această colecÈ›ie trebuie să conÈ›ină {{ limit }} de elemente. + + + Invalid card number. + Numărul card invalid. + + + Unsupported card type or invalid card number. + Tipul sau numărul cardului nu sunt valide. + + + This is not a valid International Bank Account Number (IBAN). + Acesta nu este un cod IBAN (International Bank Account Number) valid. + + + This value is not a valid ISBN-10. + Această valoare nu este un cod ISBN-10 valid. + + + This value is not a valid ISBN-13. + Această valoare nu este un cod ISBN-13 valid. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Această valoare nu este un cod ISBN-10 sau ISBN-13 valid. + + + This value is not a valid ISSN. + Această valoare nu este un cod ISSN valid. + + + This value is not a valid currency. + Această valoare nu este o monedă validă. + + + This value should be equal to {{ compared_value }}. + Această valoare trebuie să fie egală cu {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Această valoare trebuie să fie mai mare de {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Această valoare trebuie să fie mai mare sau egală cu {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Această valoare trebuie identică cu {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Această valoare trebuie să fie mai mică de {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Această valoare trebuie să fie mai mică sau egală cu {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Această valoare nu trebuie să fie egală cu {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Această valoare nu trebuie să fie identică cu {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Raportul imaginii este prea mare ({{ ratio }}). Raportul maxim permis este {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Raportul imaginii este prea mic ({{ ratio }}). Raportul minim permis este {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Imaginea este un pătrat ({{ width }}x{{ height }}px). Imaginile pătrat nu sunt permise. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Imaginea are orientarea peisaj ({{ width }}x{{ height }}px). Imaginile cu orientare peisaj nu sunt permise. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Imaginea are orientarea portret ({{ width }}x{{ height }}px). Imaginile cu orientare portret nu sunt permise. + + + An empty file is not allowed. + Nu se permite un fiÈ™ier gol. + + + The host could not be resolved. + Numele host nu a putut fi rezolvat către o adresă IP. + + + This value does not match the expected {{ charset }} charset. + Această valoare nu corespunde setului de caractere {{ charset }} aÈ™teptat. + + + This is not a valid Business Identifier Code (BIC). + Codul BIC (Business Identifier Code) nu este valid. + + + Error + Eroare + + + This is not a valid UUID. + Identificatorul universal unic (UUID) nu este valid. + + + This value should be a multiple of {{ compared_value }}. + Această valoare trebuie să fie un multiplu de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Codul BIC (Business Identifier Code) nu este asociat cu codul IBAN {{ iban }}. + + + This value should be valid JSON. + Această valoare trebuie să fie un JSON valid. + + + This collection should contain only unique elements. + Acest set ar trebui să conÈ›ină numai elemente unice. + + + This value should be positive. + Această valoare ar trebui să fie pozitivă. + + + This value should be either positive or zero. + Această valoare trebuie să fie pozitivă sau zero. + + + This value should be negative. + Această valoare ar trebui să fie negativă. + + + This value should be either negative or zero. + Această valoare trebuie să fie negativă sau zero. + + + This value is not a valid timezone. + Această valoare nu este un fus orar valid. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Această parolă a fost compromisă È™i nu poate fi utilizată. Vă rugăm să utilizaÈ›i o altă parolă. + + + This value should be between {{ min }} and {{ max }}. + Această valoare trebuie să fie între {{ min }} È™i {{ max }}. + + + This value is not a valid hostname. + Această valoare nu este un numele gazdei valid. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Numărul de elemente din această colecÈ›ie ar trebui să fie un multiplu al {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Această valoare trebuie să îndeplinească cel puÈ›in una dintre următoarele reguli: + + + Each element of this collection should satisfy its own set of constraints. + Fiecare element din acest set ar trebui să îndeplinească propriul set de reguli. + + + This value is not a valid International Securities Identification Number (ISIN). + Această valoare nu este un număr internaÈ›ional de identificare (ISIN) valabil. + + + This value should be a valid expression. + Această valoare ar trebui să fie o expresie validă. + + + This value is not a valid CIDR notation. + Această valoare nu este o notaÈ›ie CIDR validă. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Valoarea netmask-ului trebuie sa fie intre {{ min }} si {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf new file mode 100644 index 00000000000..8705cbb55d0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Значение должно быть ложным. + + + This value should be true. + Значение должно быть иÑтинным. + + + This value should be of type {{ type }}. + Тип Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð´Ð¾Ð»Ð¶ÐµÐ½ быть {{ type }}. + + + This value should be blank. + Значение должно быть пуÑтым. + + + The value you selected is not a valid choice. + Выбранное Вами значение недопуÑтимо. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Ð’Ñ‹ должны выбрать Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ {{ limit }} вариант.|Ð’Ñ‹ должны выбрать Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ {{ limit }} варианта.|Ð’Ñ‹ должны выбрать Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ {{ limit }} вариантов. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Ð’Ñ‹ должны выбрать не более чем {{ limit }} вариант.|Ð’Ñ‹ должны выбрать не более чем {{ limit }} варианта.|Ð’Ñ‹ должны выбрать не более чем {{ limit }} вариантов. + + + One or more of the given values is invalid. + Одно или неÑколько заданных значений недопуÑтимо. + + + This field was not expected. + Это поле не ожидалоÑÑŒ. + + + This field is missing. + Это поле отÑутÑтвует. + + + This value is not a valid date. + Значение не ÑвлÑетÑÑ Ð¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾Ð¹ датой. + + + This value is not a valid datetime. + Значение даты и времени недопуÑтимо. + + + This value is not a valid email address. + Значение адреÑа Ñлектронной почты недопуÑтимо. + + + The file could not be found. + Файл не может быть найден. + + + The file is not readable. + Файл не может быть прочитан. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Файл Ñлишком большой ({{ size }} {{ suffix }}). МакÑимально допуÑтимый размер {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + MIME-тип файла недопуÑтим ({{ type }}). ДопуÑтимы MIME-типы файлов {{ types }}. + + + This value should be {{ limit }} or less. + Значение должно быть {{ limit }} или меньше. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Значение Ñлишком длинное. Должно быть равно {{ limit }} Ñимволу или меньше.|Значение Ñлишком длинное. Должно быть равно {{ limit }} Ñимволам или меньше.|Значение Ñлишком длинное. Должно быть равно {{ limit }} Ñимволам или меньше. + + + This value should be {{ limit }} or more. + Значение должно быть {{ limit }} или больше. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Значение Ñлишком короткое. Должно быть равно {{ limit }} Ñимволу или больше.|Значение Ñлишком короткое. Должно быть равно {{ limit }} Ñимволам или больше.|Значение Ñлишком короткое. Должно быть равно {{ limit }} Ñимволам или больше. + + + This value should not be blank. + Значение не должно быть пуÑтым. + + + This value should not be null. + Значение не должно быть null. + + + This value should be null. + Значение должно быть null. + + + This value is not valid. + Значение недопуÑтимо. + + + This value is not a valid time. + Значение времени недопуÑтимо. + + + This value is not a valid URL. + Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым URL. + + + The two values should be equal. + Оба Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ñ‹ быть одинаковыми. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Файл Ñлишком большой. МакÑимально допуÑтимый размер {{ limit }} {{ suffix }}. + + + The file is too large. + Файл Ñлишком большой. + + + The file could not be uploaded. + Файл не может быть загружен. + + + This value should be a valid number. + Значение должно быть чиÑлом. + + + This file is not a valid image. + Файл не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым форматом изображениÑ. + + + This is not a valid IP address. + Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым IP адреÑом. + + + This value is not a valid language. + Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым Ñзыком. + + + This value is not a valid locale. + Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимой локалью. + + + This value is not a valid country. + Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимой Ñтраной. + + + This value is already used. + Это значение уже иÑпользуетÑÑ. + + + The size of the image could not be detected. + Ðе удалоÑÑŒ определить размер изображениÑ. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширина Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñлишком велика ({{ width }}px). МакÑимально допуÑÑ‚Ð¸Ð¼Ð°Ñ ÑˆÐ¸Ñ€Ð¸Ð½Ð° {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширина Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñлишком мала ({{ width }}px). Минимально допуÑÑ‚Ð¸Ð¼Ð°Ñ ÑˆÐ¸Ñ€Ð¸Ð½Ð° {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Ð’Ñ‹Ñота Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñлишком велика ({{ height }}px). МакÑимально допуÑÑ‚Ð¸Ð¼Ð°Ñ Ð²Ñ‹Ñота {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Ð’Ñ‹Ñота Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñлишком мала ({{ height }}px). Минимально допуÑÑ‚Ð¸Ð¼Ð°Ñ Ð²Ñ‹Ñота {{ min_height }}px. + + + This value should be the user's current password. + Значение должно быть текущим паролем пользователÑ. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Значение должно быть равно {{ limit }} Ñимволу.|Значение должно быть равно {{ limit }} Ñимволам.|Значение должно быть равно {{ limit }} Ñимволам. + + + The file was only partially uploaded. + Файл был загружен только чаÑтично. + + + No file was uploaded. + Файл не был загружен. + + + No temporary folder was configured in php.ini. + Ðе наÑтроена Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ Ð² php.ini. + + + Cannot write temporary file to disk. + Ðевозможно запиÑать временный файл на диÑк. + + + A PHP extension caused the upload to fail. + РаÑширение PHP вызвало ошибку при загрузке. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать {{ limit }} Ñлемент или больше.|Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать {{ limit }} Ñлемента или больше.|Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать {{ limit }} Ñлементов или больше. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать {{ limit }} Ñлемент или меньше.|Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать {{ limit }} Ñлемента или меньше.|Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать {{ limit }} Ñлементов или меньше. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать ровно {{ limit }} Ñлемент.|Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать ровно {{ limit }} Ñлемента.|Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать ровно {{ limit }} Ñлементов. + + + Invalid card number. + Ðеверный номер карты. + + + Unsupported card type or invalid card number. + Ðеподдерживаемый тип или неверный номер карты. + + + This is not a valid International Bank Account Number (IBAN). + Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым международным номером банковÑкого Ñчета (IBAN). + + + This value is not a valid ISBN-10. + Значение имеет неверный формат ISBN-10. + + + This value is not a valid ISBN-13. + Значение имеет неверный формат ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Значение не ÑоответÑтвует форматам ISBN-10 и ISBN-13. + + + This value is not a valid ISSN. + Значение не ÑоответÑтвует формату ISSN. + + + This value is not a valid currency. + Ðекорректный формат валюты. + + + This value should be equal to {{ compared_value }}. + Значение должно быть равно {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Значение должно быть больше чем {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Значение должно быть больше или равно {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Значение должно быть идентичным {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Значение должно быть меньше чем {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Значение должно быть меньше или равно {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Значение не должно быть равно {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Значение не должно быть идентичным {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Соотношение Ñторон Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñлишком велико ({{ ratio }}). МакÑимальное Ñоотношение Ñторон {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Соотношение Ñторон Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñлишком мало ({{ ratio }}). Минимальное Ñоотношение Ñторон {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Изображение квадратное ({{ width }}x{{ height }}px). Квадратные Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð½Ðµ разрешены. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Изображение в альбомной ориентации ({{ width }}x{{ height }}px). Ð˜Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð² альбомной ориентации не разрешены. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Изображение в портретной ориентации ({{ width }}x{{ height }}px). Ð˜Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð² портретной ориентации не разрешены. + + + An empty file is not allowed. + ПуÑтые файлы не разрешены. + + + The host could not be resolved. + Ð˜Ð¼Ñ Ñ…Ð¾Ñта не может быть разрешено. + + + This value does not match the expected {{ charset }} charset. + Значение не Ñовпадает Ñ Ð¾Ð¶Ð¸Ð´Ð°ÐµÐ¼Ð¾Ð¹ {{ charset }} кодировкой. + + + This is not a valid Business Identifier Code (BIC). + Значение не ÑоответÑтвует формату BIC. + + + Error + Ошибка + + + This is not a valid UUID. + Значение не ÑоответÑтвует формату UUID. + + + This value should be a multiple of {{ compared_value }}. + Значение должно быть кратно {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Данный BIC не ÑвÑзан Ñ IBAN {{ iban }}. + + + This value should be valid JSON. + Значение должно быть корректным JSON. + + + This collection should contain only unique elements. + Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать только уникальные Ñлементы. + + + This value should be positive. + Значение должно быть положительным. + + + This value should be either positive or zero. + Значение должно быть положительным или равным нулю. + + + This value should be negative. + Значение должно быть отрицательным. + + + This value should be either negative or zero. + Значение должно быть отрицательным или равным нулю. + + + This value is not a valid timezone. + Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ чаÑовым поÑÑом. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Данный пароль был Ñкомпрометирован в результате утечки данных и не должен быть иÑпользован. ПожалуйÑта, иÑпользуйте другой пароль. + + + This value should be between {{ min }} and {{ max }}. + Значение должно быть между {{ min }} и {{ max }}. + + + This value is not a valid hostname. + Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ именем хоÑта. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + КоличеÑтво Ñлементов в Ñтой коллекции должно быть кратным {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Значение должно удовлетворÑÑ‚ÑŒ как минимум одному из Ñледующих ограничений: + + + Each element of this collection should satisfy its own set of constraints. + Каждый Ñлемент Ñтой коллекции должен удовлетворÑÑ‚ÑŒ Ñвоему ÑобÑтвенному набору ограничений. + + + This value is not a valid International Securities Identification Number (ISIN). + Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ международным идентификационным номером ценных бумаг (ISIN). + + + This value should be a valid expression. + Это значение должно быть корректным выражением. + + + This value is not a valid CSS color. + Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ CSS цветом. + + + This value is not a valid CIDR notation. + Значение не ÑоответÑтвует нотации CIDR. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Значение маÑки подÑети должно быть от {{ min }} до {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf new file mode 100644 index 00000000000..55a811134da --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Táto hodnota by mala byÅ¥ nastavená na false. + + + This value should be true. + Táto hodnota by mala byÅ¥ nastavená na true. + + + This value should be of type {{ type }}. + Táto hodnota by mala byÅ¥ typu {{ type }}. + + + This value should be blank. + Táto hodnota by mala byÅ¥ prázdna. + + + The value you selected is not a valid choice. + Táto hodnota by mala byÅ¥ jednou z poskytnutých možností. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Mali by ste vybraÅ¥ minimálne {{ limit }} možnosÅ¥.|Mali by ste vybraÅ¥ minimálne {{ limit }} možnosti.|Mali by ste vybraÅ¥ minimálne {{ limit }} možností. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Mali by ste vybraÅ¥ najviac {{ limit }} možnosÅ¥.|Mali by ste vybraÅ¥ najviac {{ limit }} možnosti.|Mali by ste vybraÅ¥ najviac {{ limit }} možností. + + + One or more of the given values is invalid. + Niektoré z uvedených hodnôt sú neplatné. + + + This field was not expected. + Toto pole sa neoÄakáva. + + + This field is missing. + Toto pole chýba. + + + This value is not a valid date. + Tato hodnota nemá platný formát dátumu. + + + This value is not a valid datetime. + Táto hodnota nemá platný formát dátumu a Äasu. + + + This value is not a valid email address. + Táto hodnota nie je platná emailová adresa. + + + The file could not be found. + Súbor sa nenaÅ¡iel. + + + The file is not readable. + Súbor nie je Äitateľný. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Súbor je príliÅ¡ veľký ({{ size }} {{ suffix }}). Maximálna povolená veľkosÅ¥ je {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Súbor typu ({{ type }}) nie je podporovaný. Podporované typy sú {{ types }}. + + + This value should be {{ limit }} or less. + Táto hodnota by mala byÅ¥ {{ limit }} alebo menej. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovaÅ¥ najviac {{ limit }} znak.|Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovaÅ¥ najviac {{ limit }} znaky.|Táto hodnota obsahuje viac znakov ako je povolené. Mala by obsahovaÅ¥ najviac {{ limit }} znakov. + + + This value should be {{ limit }} or more. + Táto hodnota by mala byÅ¥ viac ako {{ limit }}. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Táto hodnota je príliÅ¡ krátka. Musí obsahovaÅ¥ minimálne {{ limit }} znak.|Táto hodnota je príliÅ¡ krátka. Musí obsahovaÅ¥ minimálne {{ limit }} znaky.|Táto hodnota je príliÅ¡ krátka. Minimálny poÄet znakov je {{ limit }}. + + + This value should not be blank. + Táto hodnota by mala byÅ¥ vyplnená. + + + This value should not be null. + Táto hodnota by nemala byÅ¥ null. + + + This value should be null. + Táto hodnota by mala byÅ¥ null. + + + This value is not valid. + Táto hodnota nie je platná. + + + This value is not a valid time. + Tato hodnota nemá správny formát Äasu. + + + This value is not a valid URL. + Táto hodnota nie je platnou URL adresou. + + + The two values should be equal. + Tieto dve hodnoty by mali byÅ¥ rovnaké. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Súbor je príliÅ¡ veľký. Maximálna povolená veľkosÅ¥ je {{ limit }} {{ suffix }}. + + + The file is too large. + Súbor je príliÅ¡ veľký. + + + The file could not be uploaded. + Súbor sa nepodarilo nahraÅ¥. + + + This value should be a valid number. + Táto hodnota by mala byÅ¥ Äíslo. + + + This file is not a valid image. + Tento súbor nie je obrázok. + + + This is not a valid IP address. + Toto nie je platná IP adresa. + + + This value is not a valid language. + Tento jazyk neexistuje. + + + This value is not a valid locale. + Táto lokalizácia neexistuje. + + + This value is not a valid country. + Táto krajina neexistuje. + + + This value is already used. + Táto hodnota sa už používa. + + + The size of the image could not be detected. + Nepodarilo sa zistiÅ¥ rozmery obrázku. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Obrázok je príliÅ¡ Å¡iroký ({{ width }}px). Maximálna povolená šírka obrázku je {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Obrázok je príliÅ¡ úzky ({{ width }}px). Minimálna šírka obrázku by mala byÅ¥ {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + >Obrázok je príliÅ¡ vysoký ({{ height }}px). Maximálna povolená výška obrázku je {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Obrázok je príliÅ¡ nízky ({{ height }}px). Minimálna výška obrázku by mala byÅ¥ {{ min_height }}px. + + + This value should be the user's current password. + Táto hodnota by mala byÅ¥ aktuálne heslo používateľa. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Táto hodnota by mala maÅ¥ presne {{ limit }} znak.|Táto hodnota by mala maÅ¥ presne {{ limit }} znaky.|Táto hodnota by mala maÅ¥ presne {{ limit }} znakov. + + + The file was only partially uploaded. + Bola nahraná len ÄasÅ¥ súboru. + + + No file was uploaded. + Žiadny súbor nebol nahraný. + + + No temporary folder was configured in php.ini. + V php.ini nie je nastavená cesta k addressáru pre doÄasné súbory. + + + Cannot write temporary file to disk. + DoÄasný súbor sa nepodarilo zapísaÅ¥ na disk. + + + A PHP extension caused the upload to fail. + Rozšírenie PHP zabránilo nahraniu súboru. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Táto kolekcia by mala obsahovaÅ¥ aspoň {{ limit }} prvok alebo viac.|Táto kolekcia by mala obsahovaÅ¥ aspoň {{ limit }} prvky alebo viac.|Táto kolekcia by mala obsahovaÅ¥ aspoň {{ limit }} prvkov alebo viac. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Táto kolekcia by mala maximálne {{ limit }} prvok.|Táto kolekcia by mala obsahovaÅ¥ maximálne {{ limit }} prvky.|Táto kolekcia by mala obsahovaÅ¥ maximálne {{ limit }} prvkov. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Táto kolekcia by mala obsahovaÅ¥ presne {{ limit }} prvok.|Táto kolekcia by mala obsahovaÅ¥ presne {{ limit }} prvky.|Táto kolekcia by mala obsahovaÅ¥ presne {{ limit }} prvkov. + + + Invalid card number. + Neplatné Äíslo karty. + + + Unsupported card type or invalid card number. + Nepodporovaný typ karty alebo neplatné Äíslo karty. + + + This is not a valid International Bank Account Number (IBAN). + Toto je neplatný IBAN. + + + This value is not a valid ISBN-10. + Táto hodnota je neplatné ISBN-10. + + + This value is not a valid ISBN-13. + Táto hodnota je neplatné ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Táto hodnota nie je platné ISBN-10 ani ISBN-13. + + + This value is not a valid ISSN. + Táto hodnota nie je platné ISSN. + + + This value is not a valid currency. + Táto hodnota nie je platná mena. + + + This value should be equal to {{ compared_value }}. + Táto hodnota by mala byÅ¥ rovná {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Táto hodnota by mala byÅ¥ väÄÅ¡ia ako {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Táto hodnota by mala byÅ¥ väÄÅ¡ia alebo rovná {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Táto hodnota by mala byÅ¥ typu {{ compared_value_type }} a zároveň by mala byÅ¥ rovná {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Táto hodnota by mala byÅ¥ menÅ¡ia ako {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Táto hodnota by mala byÅ¥ menÅ¡ia alebo rovná {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Táto hodnota by nemala byÅ¥ rovná {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Táto hodnota by nemala byÅ¥ typu {{ compared_value_type }} a zároveň by nemala byÅ¥ rovná {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Pomer strán obrázku je príliÅ¡ veľký ({{ ratio }}). Maximálny povolený pomer strán obrázku je {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Pomer strán obrázku je príliÅ¡ malý ({{ ratio }}). Minimálny povolený pomer strán obrázku je {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Strany obrázku sú Å¡tvorcové ({{ width }}x{{ height }}px). Å tvorcové obrázky nie sú povolené. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Obrázok je orientovaný na šírku ({{ width }}x{{ height }}px). Obrázky orientované na šírku nie sú povolené. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Obrázok je orientovaný na výšku ({{ width }}x{{ height }}px). Obrázky orientované na výšku nie sú povolené. + + + An empty file is not allowed. + Súbor nesmie byÅ¥ prázdny. + + + The host could not be resolved. + Hostiteľa nebolo možné rozpoznaÅ¥. + + + This value does not match the expected {{ charset }} charset. + Táto hodnota nezodpovedá oÄakávanej znakovej sade {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Táto hodnota nie je platný identifikaÄný kód podniku (BIC). + + + Error + Chyba + + + This is not a valid UUID. + Táto hodnota nie je platný UUID. + + + This value should be a multiple of {{ compared_value }}. + Táto hodnota by mala byÅ¥ násobkom {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Tento identifikaÄný kód podniku (BIC) nie je spojený s IBAN {{ iban }}. + + + This value should be valid JSON. + Táto hodnota by mala byÅ¥ platný JSON. + + + This collection should contain only unique elements. + Táto kolekcia by mala obsahovaÅ¥ len unikátne prkvy. + + + This value should be positive. + Táto hodnota by mala byÅ¥ kladná. + + + This value should be either positive or zero. + Táto hodnota by mala byÅ¥ kladná alebo nulová. + + + This value should be negative. + Táto hodnota by mala byÅ¥ záporná. + + + This value should be either negative or zero. + Táto hodnota by mala byÅ¥ záporná alebo nulová. + + + This value is not a valid timezone. + Táto hodnota nie je platné Äasové pásmo. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Toto heslo uniklo pri naruÅ¡ení ochrany dát, nie je možné ho použiÅ¥. Prosím, použite iné heslo. + + + This value should be between {{ min }} and {{ max }}. + Táto hodnota by mala byÅ¥ medzi {{ min }} a {{ max }}. + + + This value is not a valid hostname. + Táto hodnota nie je platný hostname. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + PoÄet prvkov v tejto kolekcii musí byÅ¥ násobok {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Táto hodnota musí spĺňaÅ¥ aspoň jedno z nasledujúcich obmedzení: + + + Each element of this collection should satisfy its own set of constraints. + Každý prvok v tejto kolekcii musí spĺňaÅ¥ svoje vlastné obmedzenia. + + + This value is not a valid International Securities Identification Number (ISIN). + Táto hodnota nie je platné medzinárodné oznaÄenie cenného papiera (ISIN). + + + This value should be a valid expression. + Táto hodnota by mala byÅ¥ platným výrazom. + + + This value is not a valid CSS color. + Táto hodnota nie je platná CSS farba. + + + This value is not a valid CIDR notation. + Táto hodnota nie je platnou notáciou CIDR. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Hodnota masky siete by mala byÅ¥ medzi {{ min }} a {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf new file mode 100644 index 00000000000..b956911e5a0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Vrednost bi morala biti nepravilna (false). + + + This value should be true. + Vrednost bi morala biti pravilna (true). + + + This value should be of type {{ type }}. + Vrednost mora biti naslednjega tipa {{ type }}. + + + This value should be blank. + Vrednost mora biti prazna. + + + The value you selected is not a valid choice. + Vrednost, ki ste jo izbrali, ni veljavna možnost. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Izbrati morate vsaj {{ limit }} možnost.|Izbrati morate vsaj {{ limit }} možnosti.|Izbrati morate vsaj {{ limit }} možnosti.|Izbrati morate vsaj {{ limit }} možnosti. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Izberete lahko najveÄ {{ limit }} možnost.|Izberete lahko najveÄ {{ limit }} možnosti.|Izberete lahko najveÄ {{ limit }} možnosti.|Izberete lahko najveÄ {{ limit }} možnosti. + + + One or more of the given values is invalid. + Ena ali veÄ podanih vrednosti ni veljavnih. + + + This field was not expected. + To polje ni bilo priÄakovati. + + + This field is missing. + To polje manjka. + + + This value is not a valid date. + Ta vrednost ni veljaven datum. + + + This value is not a valid datetime. + Ta vrednost ni veljaven datum in Äas. + + + This value is not a valid email address. + Ta vrednost ni veljaven e-poÅ¡tni naslov. + + + The file could not be found. + Datoteke ni mogoÄe najti. + + + The file is not readable. + Datoteke ni mogoÄe prebrati. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Datoteka je prevelika ({{ size }} {{ suffix }}). NajveÄja dovoljena velikost je {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mime tip datoteke je neveljaven ({{ type }}). Dovoljeni mime tipi so {{ types }}. + + + This value should be {{ limit }} or less. + Ta vrednost bi morala biti {{ limit }} ali manj. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ta vrednost je predolga. Morala bi imeti {{ limit }} znak ali manj.|Ta vrednost je predolga. Morala bi imeti {{ limit }} znaka ali manj.|Ta vrednost je predolga. Morala bi imeti {{ limit }} znake ali manj.|Ta vrednost je predolga. Morala bi imeti {{ limit }} znakov ali manj. + + + This value should be {{ limit }} or more. + Ta vrednost bi morala biti {{ limit }} ali veÄ. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ta vrednost je prekratka. Morala bi imeti {{ limit }} znak ali veÄ.|Ta vrednost je prekratka. Morala bi imeti {{ limit }} znaka ali veÄ.|Ta vrednost je prekratka. Morala bi imeti {{ limit }} znake ali veÄ.|Ta vrednost je prekratka. Morala bi imeti {{ limit }} znakov ali veÄ. + + + This value should not be blank. + Ta vrednost ne bi smela biti prazna. + + + This value should not be null. + Ta vrednost ne bi smela biti nedefinirana (null). + + + This value should be null. + Ta vrednost bi morala biti nedefinirana (null). + + + This value is not valid. + Ta vrednost ni veljavna. + + + This value is not a valid time. + Ta vrednost ni veljaven Äas. + + + This value is not a valid URL. + Ta vrednost ni veljaven URL. + + + The two values should be equal. + Ti dve vrednosti bi morali biti enaki. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Datoteka je prevelika. NajveÄja dovoljena velikost je {{ limit }} {{ suffix }}. + + + The file is too large. + Datoteka je prevelika. + + + The file could not be uploaded. + Datoteke ni bilo mogoÄe naložiti. + + + This value should be a valid number. + Ta vrednost bi morala biti veljavna Å¡tevilka. + + + This file is not a valid image. + Ta datoteka ni veljavna slika. + + + This is not a valid IP address. + To ni veljaven IP naslov. + + + This value is not a valid language. + Ta vrednost ni veljaven jezik. + + + This value is not a valid locale. + Ta vrednost ni veljavna lokalnost. + + + This value is not a valid country. + Ta vrednost ni veljavna država. + + + This value is already used. + Ta vrednost je že uporabljena. + + + The size of the image could not be detected. + Velikosti slike ni bilo mogoÄe zaznati. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Å irina slike je preÅ¡iroka ({{ width }}px). NajveÄja dovoljena Å¡irina je {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Å irina slike je premajhna ({{ width }}px). NajmanjÅ¡a predvidena Å¡irina je {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ViÅ¡ina slike je prevelika ({{ height }}px). NajveÄja dovoljena viÅ¡ina je {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ViÅ¡ina slike je premajhna ({{ height }}px). NajmanjÅ¡a predvidena viÅ¡ina je {{ min_height }}px. + + + This value should be the user's current password. + Ta vrednost bi morala biti trenutno uporabnikovo geslo. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ta vrednost bi morala imeti toÄno {{ limit }} znak.|Ta vrednost bi morala imeti toÄno {{ limit }} znaka.|Ta vrednost bi morala imeti toÄno {{ limit }} znake.|Ta vrednost bi morala imeti toÄno {{ limit }} znakov. + + + The file was only partially uploaded. + Datoteka je bila le delno naložena. + + + No file was uploaded. + Nobena datoteka ni bila naložena. + + + No temporary folder was configured in php.ini. + ZaÄasna mapa ni nastavljena v php.ini. + + + Cannot write temporary file to disk. + ZaÄasne datoteke ni bilo mogoÄe zapisati na disk. + + + A PHP extension caused the upload to fail. + PHP razÅ¡iritev je vzrok, da nalaganje ni uspelo. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ta zbirka bi morala vsebovati {{ limit }} element ali veÄ.|Ta zbirka bi morala vsebovati {{ limit }} elementa ali veÄ.|Ta zbirka bi morala vsebovati {{ limit }} elemente ali veÄ.|Ta zbirka bi morala vsebovati {{ limit }} elementov ali veÄ. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ta zbirka bi morala vsebovati {{ limit }} element ali manj.|Ta zbirka bi morala vsebovati {{ limit }} elementa ali manj.|Ta zbirka bi morala vsebovati {{ limit }} elemente ali manj.|Ta zbirka bi morala vsebovati {{ limit }} elementov ali manj. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ta zbirka bi morala vsebovati toÄno {{ limit }} element.|Ta zbirka bi morala vsebovati toÄno {{ limit }} elementa.|Ta zbirka bi morala vsebovati toÄno {{ limit }} elemente.|Ta zbirka bi morala vsebovati toÄno {{ limit }} elementov. + + + Invalid card number. + Neveljavna Å¡tevilka kartice. + + + Unsupported card type or invalid card number. + Nepodprti tip kartice ali neveljavna Å¡tevilka kartice. + + + This is not a valid International Bank Account Number (IBAN). + To ni veljavna mednarodna Å¡tevilka banÄnega raÄuna (IBAN). + + + This value is not a valid ISBN-10. + Neveljavna vrednost po ISBN-10. + + + This value is not a valid ISBN-13. + Neveljavna vrednost po ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Neveljavna vrednost po ISBN-10 ali po ISBN-13. + + + This value is not a valid ISSN. + Neveljavna vrednost ISSN. + + + This value is not a valid currency. + Ta vrednost ni veljavna valuta. + + + This value should be equal to {{ compared_value }}. + Ta vrednost bi morala biti enaka {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ta vrednost bi morala biti veÄja od {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ta vrednost bi morala biti veÄja ali enaka {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ta vrednost bi morala biti identiÄna {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ta vrednost bi morala biti manjÅ¡a od {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ta vrednost bi morala biti manjÅ¡a ali enaka {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ta vrednost ne bi smela biti enaka {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ta vrednost ne bi smela biti identiÄna {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Razmerje slike je preveliko ({{ ratio }}). NajveÄje dovoljeno razmerje je {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Razmerje slike je premajhno ({{ ratio }}). NajmanjÅ¡e priÄakovano razmerje je {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Slika je kvadrat ({{ width }}x{{ height }}px). Kvadratne slike niso dovoljene. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Slika je ležeÄe usmerjena ({{ width }}x{{ height }}px). LežeÄe usmerjene slike niso dovoljene. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Slika je pokonÄno usmerjena ({{ width }}x{{ height }}px). PokonÄno usmerjene slike niso dovoljene. + + + An empty file is not allowed. + Prazna datoteka ni dovoljena. + + + The host could not be resolved. + Gostitelja ni bilo mogoÄe prepoznati. + + + This value does not match the expected {{ charset }} charset. + Ta vrednost se ne ujema s priÄakovanim naborom znakov {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + To ni veljavna identifikacijska koda podjetja (BIC). + + + Error + Napaka + + + This is not a valid UUID. + To ni veljaven UUID. + + + This value should be a multiple of {{ compared_value }}. + Ta vrednost bi morala biti veÄkratnik od {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ta poslovna identifikacijska koda (BIC) ni povezana z IBAN {{ iban }}. + + + This value should be valid JSON. + Ta vrednost bi morala biti veljaven JSON. + + + This collection should contain only unique elements. + Ta zbirka bi morala vsebovati samo edinstvene elemente. + + + This value should be positive. + Ta vrednost bi morala biti pozitivna. + + + This value should be either positive or zero. + Ta vrednost bi morala biti pozitivna ali enaka niÄ. + + + This value should be negative. + Ta vrednost bi morala biti negativna. + + + This value should be either negative or zero. + Ta vrednost bi morala biti negativna ali enaka niÄ. + + + This value is not a valid timezone. + Ta vrednost ni veljaven Äasovni pas. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + To geslo je uÅ¡lo pri krÅ¡itvi varnosti podatkov in ga ne smete uporabljati. Prosimo, uporabite drugo geslo. + + + This value should be between {{ min }} and {{ max }}. + Ta vrednost bi morala biti med {{ min }} in {{ max }}. + + + This value is not a valid hostname. + Ta vrednost ni veljavno ime gostitelja. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Å tevilo elementov v tej zbirki bi moralo biti mnogokratnik {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ta vrednost bi morala zadostiti vsaj eni izmed sledeÄih omejitev: + + + Each element of this collection should satisfy its own set of constraints. + Vsak element te zbirke bi moral zadostiti svojemu lastnemu naboru omejitev. + + + This value is not a valid International Securities Identification Number (ISIN). + Ta vrednost ni veljavna mednarodna identifikacijska koda vrednostnih papirjev (ISIN). + + + This value should be a valid expression. + Ta vrednost bi morala biti veljaven izraz. + + + This value is not a valid CSS color. + Ta vrednost ni veljavna barva CSS. + + + This value is not a valid CIDR notation. + Ta vrednost ni veljaven zapis CIDR. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Vrednost omrežne maske mora biti med {{ min }} in {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf new file mode 100644 index 00000000000..6c0acb9fdf4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf @@ -0,0 +1,391 @@ + + + + + + This value should be false. + Kjo vlerë duhet të jetë e pavërtetë (false). + + + This value should be true. + Kjo vlerë duhet të jetë e vërtetë (true). + + + This value should be of type {{ type }}. + Kjo vlerë duhet të jetë e llojit {{ type }}. + + + This value should be blank. + Kjo vlerë duhet të jetë e zbrazët. + + + The value you selected is not a valid choice. + Vlera që keni zgjedhur nuk është alternativë e vlefshme. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Duhet të zgjedhni së paku {{ limit }} alternativë.|Duhet të zgjedhni së paku {{ limit }} alternativa. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Duhet të zgjedhni më së shumti {{ limit }} alternativë.|Duhet të zgjedhni më së shumti {{ limit }} alternativa. + + + One or more of the given values is invalid. + Një apo më shumë nga vlerat e dhëna janë të pavlefshme. + + + This field was not expected. + Kjo fushë nuk pritej. + + + This field is missing. + Kjo fushë mungon. + + + This value is not a valid date. + Kjo vlerë nuk është datë e vlefshme. + + + This value is not a valid datetime. + Kjo vlerë nuk është datë-kohë e vlefshme. + + + This value is not a valid email address. + Kjo vlerë nuk është adresë email-i e vlefshme. + + + The file could not be found. + File nuk mund të gjindej. + + + The file is not readable. + File nuk është i lexueshëm. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + File është shumë i madh ({{ size }} {{ suffix }}). Madhësia maksimale e lejuar është {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Lloji mime i file-it është i pavlefshëm ({{ type }}). Llojet mime të lejuara janë {{ types }}. + + + This value should be {{ limit }} or less. + Kjo vlerë duhet të jetë {{ limit }} ose më pak. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Kjo vlerë është shumë e gjatë. Duhet të përmbaj {{ limit }} karakter ose më pak.|Kjo vlerë është shumë e gjatë. Duhet të përmbaj {{ limit }} karaktere ose më pak. + + + This value should be {{ limit }} or more. + Kjo vlerë duhet të jetë {{ limit }} ose më shumë. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Kjo vlerë është shumë e shkurtër. Duhet të përmbaj {{ limit }} karakter ose më shumë.|Kjo vlerë është shumë e shkurtër. Duhet të përmbaj {{ limit }} karaktere ose më shumë. + + + This value should not be blank. + Kjo vlerë nuk duhet të jetë e zbrazët. + + + This value should not be null. + Kjo vlerë nuk duhet të jetë null. + + + This value should be null. + Kjo vlerë duhet të jetë null. + + + This value is not valid. + Kjo vlerë nuk është e vlefshme. + + + This value is not a valid time. + Kjo vlerë nuk është kohë e vlefshme. + + + This value is not a valid URL. + Kjo vlerë nuk është URL e vlefshme. + + + The two values should be equal. + Këto dy vlera duhet të jenë të barabarta. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Ky file është shumë i madh. Madhësia maksimale e lejuar është {{ limit }} {{ suffix }}. + + + The file is too large. + Ky file është shumë i madh. + + + The file could not be uploaded. + Ky file nuk mund të ngarkohet. + + + This value should be a valid number. + Kjo vlerë duhet të jetë numër i vlefshëm. + + + This file is not a valid image. + Ky file nuk është imazh i vlefshëm. + + + This is not a valid IP address. + Kjo adresë IP nuk është e vlefshme. + + + This value is not a valid language. + Kjo vlerë nuk është gjuhë e vlefshme. + + + This value is not a valid locale. + Kjo vlerë nuk është nje locale i vlefshëm. + + + This value is not a valid country. + Kjo vlerë nuk është shtet i vlefshëm. + + + This value is already used. + Kjo vlerë është tashmë në përdorim. + + + The size of the image could not be detected. + Madhësia e imazhit nuk mund të zbulohet. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Gjerësia e imazhit është shumë e madhe ({{ width }}px). Gjerësia maksimale e lejuar është {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Gjerësia e imazhit është shumë e vogël ({{ width }}px). Gjerësia minimale e pritur është {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Gjatësia e imazhit është shumë e madhe ({{ height }}px). Gjatësia maksimale e lejuar është {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Gjatësia e imazhit është shumë e vogël ({{ height }}px). Gjatësia minimale e pritur është {{ min_height }}px. + + + This value should be the user's current password. + Kjo vlerë duhet të jetë fjalëkalimi aktual i përdoruesit. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Kjo vlerë duhet të ketë saktësisht {{ limit }} karakter.|Kjo vlerë duhet të ketë saktësisht {{ limit }} karaktere. + + + The file was only partially uploaded. + Ky file është ngarkuar pjesërisht. + + + No file was uploaded. + Nuk është ngarkuar ndonjë file. + + + No temporary folder was configured in php.ini. + Asnjë folder i përkohshëm nuk është konfiguruar në php.ini. + + + Cannot write temporary file to disk. + Nuk mund të shkruhet file i përkohshëm në disk. + + + A PHP extension caused the upload to fail. + Një ekstension i PHP-së shkaktoi dështimin e ngarkimit. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ky koleksion duhet të përmbajë {{ limit }} element ose më shumë.|Ky koleksion duhet të përmbajë {{ limit }} elemente ose më shumë. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ky koleksion duhet të përmbajë {{ limit }} element ose më pak.|Ky koleksion duhet të përmbajë {{ limit }} elemente ose më pak. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ky koleksion duhet të përmbajë saktësisht {{ limit }} element.|Ky koleksion duhet të përmbajë saktësisht {{ limit }} elemente. + + + Invalid card number. + Numër karte i pavlefshëm. + + + Unsupported card type or invalid card number. + Lloj karte i papranuar ose numër karte i pavlefshëm. + + + This is not a valid International Bank Account Number (IBAN). + Ky nuk është një numër i vlefshëm ndërkombëtar i llogarisë bankare (IBAN). + + + This value is not a valid ISBN-10. + Kjo vlerë nuk është një ISBN-10 e vlefshme. + + + This value is not a valid ISBN-13. + Kjo vlerë nuk është një ISBN-13 e vlefshme. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Kjo vlerë nuk është as ISBN-10 e vlefshme as ISBN-13 e vlefshme. + + + This value is not a valid ISSN. + Kjo vlerë nuk është një ISSN e vlefshme. + + + This value is not a valid currency. + Kjo vlerë nuk është një monedhë e vlefshme. + + + This value should be equal to {{ compared_value }}. + Kjo vlerë duhet të jetë e barabartë me {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Kjo vlerë duhet të jetë më e madhe se {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Kjo vlerë duhet të jetë më e madhe ose e barabartë me {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Kjo vlerë duhet të jetë identike me {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Kjo vlerë duhet të jetë më vogël se {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Kjo vlerë duhet të jetë më e vogël ose e barabartë me {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Kjo vlerë nuk duhet të jetë e barabartë me {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Kjo vlerë nuk duhet të jetë identike me {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Raporti i imazhit është shumë i madh ({{ ratio }}). Raporti maksimal i lejuar është {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Raporti i imazhit është shumë i vogël ({{ ratio }}). Raporti minimal pritet të jetë {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Imazhi është katror ({{ width }}x{{ height }}px). Imazhet katrore nuk janë të lejuara. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Imazhi është i orientuar horizontalisht ({{ width }}x{{ height }}px). Imazhet e orientuara horizontalisht nuk lejohen. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Imazhi është i orientuar vertikalisht ({{ width }}x{{ height }}px). Imazhet orientuara vertikalisht nuk lejohen. + + + An empty file is not allowed. + Një file i zbrazët nuk lejohet. + + + The host could not be resolved. + Host-i nuk mund te zbulohej. + + + This value does not match the expected {{ charset }} charset. + Kjo vlerë nuk përputhet me kodifikimin e karaktereve {{ charset }} që pritej. + + + This is not a valid Business Identifier Code (BIC). + Ky nuk është një Kod Identifikues i Biznesit (BIC) i vleflshem. + + + Error + Gabim + + + This is not a valid UUID. + Ky nuk është një UUID i vlefshëm. + + + This value should be a multiple of {{ compared_value }}. + Kjo vlerë duhet të jetë një shumëfish i {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ky Kod Identifikues i Biznesit (BIC) nuk është i lidhur me IBAN {{ iban }}. + + + This value should be valid JSON. + Kjo vlerë duhet të jetë JSON i vlefshëm. + + + This collection should contain only unique elements. + Ky koleksion duhet të përmbajë vetëm elementë unikë. + + + This value should be positive. + Kjo vlerë duhet të jetë pozitive. + + + This value should be either positive or zero. + Kjo vlerë duhet të jetë pozitive ose zero. + + + This value should be negative. + Kjo vlerë duhet të jetë negative. + + + This value should be either negative or zero. + Kjo vlerë duhet të jetë negative ose zero. + + + This value is not a valid timezone. + Kjo vlerë nuk është një zonë e vlefshme kohore. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ky fjalëkalim është zbuluar në një shkelje të të dhënave, nuk duhet të përdoret. Ju lutemi përdorni një fjalëkalim tjetër. + + + This value should be between {{ min }} and {{ max }}. + Kjo vlerë duhet të jetë ndërmjet {{ min }} dhe {{ max }}. + + + This value is not a valid hostname. + Kjo vlerë nuk është një emër i vlefshëm hosti. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Numri i elementeve në këtë koleksion duhet të jetë një shumëfish i {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Kjo vlerë duhet të plotësojë të paktën njërën nga kufizimet e mëposhtme: + + + Each element of this collection should satisfy its own set of constraints. + Secili element i këtij koleksioni duhet të përmbushë kufizimet e veta. + + + This value is not a valid International Securities Identification Number (ISIN). + Kjo vlerë nuk është një numër i vlefshëm identifikues ndërkombëtar i sigurisë (ISIN). + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf new file mode 100644 index 00000000000..03ef7130303 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + ВредноÑÑ‚ треба да буде нетачна. + + + This value should be true. + ВредноÑÑ‚ треба да буде тачна. + + + This value should be of type {{ type }}. + ВредноÑÑ‚ треба да буде типа {{ type }}. + + + This value should be blank. + ВредноÑÑ‚ треба да буде празна. + + + The value you selected is not a valid choice. + ВредноÑÑ‚ треба да буде једна од понуђених. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Изаберите бар {{ limit }} могућноÑÑ‚.|Изаберите бар {{ limit }} могућноÑти.|Изаберите бар {{ limit }} могућноÑти. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Изаберите највише {{ limit }} могућноÑÑ‚.|Изаберите највише {{ limit }} могућноÑти.|Изаберите највише {{ limit }} могућноÑти. + + + One or more of the given values is invalid. + Једна или више вредноÑти је невалидна. + + + This field was not expected. + Ово поље није било очекивано. + + + This field is missing. + Ово поље недоÑтаје. + + + This value is not a valid date. + ВредноÑÑ‚ није валидан датум. + + + This value is not a valid datetime. + ВредноÑÑ‚ није валидан датум-време. + + + This value is not a valid email address. + ВредноÑÑ‚ није валидна адреÑа електронÑке поште. + + + The file could not be found. + Датотека не може бити пронађена. + + + The file is not readable. + Датотека није читљива. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Датотека је превелика ({{ size }} {{ suffix }}). Ðајвећа дозвољена величина је {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Миме тип датотеке није валидан ({{ type }}). Дозвољени миме типови Ñу {{ types }}. + + + This value should be {{ limit }} or less. + ВредноÑÑ‚ треба да буде {{ limit }} или мање. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + ВредноÑÑ‚ је предугачка. Треба да има {{ limit }} карактер или мање.|ВредноÑÑ‚ је предугачка. Треба да има {{ limit }} карактера или мање.|ВредноÑÑ‚ је предугачка. Треба да има {{ limit }} карактера или мање. + + + This value should be {{ limit }} or more. + ВредноÑÑ‚ треба да буде {{ limit }} или више. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + ВредноÑÑ‚ је прекратка. Треба да има {{ limit }} карактер или више.|ВредноÑÑ‚ је прекратка. Треба да има {{ limit }} карактера или више.|ВредноÑÑ‚ је прекратка. Треба да има {{ limit }} карактера или више. + + + This value should not be blank. + ВредноÑÑ‚ не треба да буде празна. + + + This value should not be null. + ВредноÑÑ‚ не треба да буде null. + + + This value should be null. + ВредноÑÑ‚ треба да буде null. + + + This value is not valid. + ВредноÑÑ‚ није валидна. + + + This value is not a valid time. + ВредноÑÑ‚ није валидно време. + + + This value is not a valid URL. + ВредноÑÑ‚ није валидан URL. + + + The two values should be equal. + Обе вредноÑти треба да буду једнаке. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Датотека је превелика. Ðајвећа дозвољена величина је {{ limit }} {{ suffix }}. + + + The file is too large. + Датотека је превелика. + + + The file could not be uploaded. + Датотека не може бити отпремљена. + + + This value should be a valid number. + ВредноÑÑ‚ треба да буде валидан број. + + + This file is not a valid image. + Ова датотека није валидна Ñлика. + + + This is not a valid IP address. + Ово није валидна ИП адреÑа. + + + This value is not a valid language. + ВредноÑÑ‚ није валидан језик. + + + This value is not a valid locale. + ВредноÑÑ‚ није валидан локал. + + + This value is not a valid country. + ВредноÑÑ‚ није валидна земља. + + + This value is already used. + ВредноÑÑ‚ је већ иÑкоришћена. + + + The size of the image could not be detected. + Величина Ñлике не може бити одређена. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширина Ñлике је превелика ({{ width }}px). Ðајећа дозвољена ширина је {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширина Ñлике је премала ({{ width }}px). Ðајмања дозвољена ширина је {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ВиÑина Ñлике је превелика ({{ height }}px). Ðајећа дозвољена виÑина је {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ВиÑина Ñлике је премала ({{ height }}px). Ðајмања дозвољена виÑина је {{ min_height }}px. + + + This value should be the user's current password. + ВредноÑÑ‚ треба да буде тренутна кориÑничка лозинка. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + ВредноÑÑ‚ треба да има тачно {{ limit }} карактер.|ВредноÑÑ‚ треба да има тачно {{ limit }} карактера.|ВредноÑÑ‚ треба да има тачно {{ limit }} карактера. + + + The file was only partially uploaded. + Датотека је Ñамо парцијално отпремљена. + + + No file was uploaded. + Датотека није отпремљена. + + + No temporary folder was configured in php.ini. + Привремени директоријум није конфигуриÑан у php.ini. + + + Cannot write temporary file to disk. + Ðемогуће пиÑање привремене датотеке на диÑк. + + + A PHP extension caused the upload to fail. + PHP екÑтензија је проузроковала неуÑпех отпремања датотеке. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ова колекција треба да Ñадржи {{ limit }} или више елемената.|Ова колекција треба да Ñадржи {{ limit }} или више елемената.|Ова колекција треба да Ñадржи {{ limit }} или више елемената. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ова колекција треба да Ñадржи {{ limit }} или мање елемената.|Ова колекција треба да Ñадржи {{ limit }} или мање елемената.|Ова колекција треба да Ñадржи {{ limit }} или мање елемената. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ова колекција треба да Ñадржи тачно {{ limit }} елемент.|Ова колекција треба да Ñадржи тачно {{ limit }} елемента.|Ова колекција треба да Ñадржи тачно {{ limit }} елемената. + + + Invalid card number. + Ðевалидан број картице. + + + Unsupported card type or invalid card number. + Ðевалидан број картице или тип картице није подржан. + + + This is not a valid International Bank Account Number (IBAN). + Ово није валидан међународни број банковног рачуна (IBAN). + + + This value is not a valid ISBN-10. + Ово није валидан ISBN-10. + + + This value is not a valid ISBN-13. + Ово није валидан ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ово није валидан ISBN-10 или ISBN-13. + + + This value is not a valid ISSN. + Ово није валидан ISSN. + + + This value is not a valid currency. + Ово није валидна валута. + + + This value should be equal to {{ compared_value }}. + Ова вредноÑÑ‚ треба да буде {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ова вредноÑÑ‚ треба да буде већа од {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ова вредноÑÑ‚ треба да буде већа или једнака {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ова вредноÑÑ‚ треба да буде идентична Ñа {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ова вредноÑÑ‚ треба да буде мања од {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ова вредноÑÑ‚ треба да буде мања или једнака {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ова вредноÑÑ‚ не треба да буде једнака {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ова вредноÑÑ‚ не треба да буде идентична Ñа {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Размера ове Ñлике је превелика ({{ ratio }}). МакÑимална дозвољена размера је {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Размера ове Ñлике је премала ({{ ratio }}). Минимална очекивана размера је {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Слика је квадратна ({{ width }}x{{ height }}px). Квадратне Ñлике ниÑу дозвољене. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Слика је оријентације пејзажа ({{ width }}x{{ height }}px). Пејзажна оријентација Ñлика није дозвољена. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Слика је оријантације портрета ({{ width }}x{{ height }}px). Портретна оријентација Ñлика није дозвољена. + + + An empty file is not allowed. + Празна датотека није дозвољена. + + + The host could not be resolved. + Име хоÑта не може бити разрешено. + + + This value does not match the expected {{ charset }} charset. + ВредноÑÑ‚ Ñе не поклапа Ñа очекиваним {{ charset }} Ñетом карактера. + + + This is not a valid Business Identifier Code (BIC). + Ово није валидан међународни идентификацијÑки код банке (BIC). + + + Error + Грешка + + + This is not a valid UUID. + Ово није валидан универзални уникатни идентификатор (UUID). + + + This value should be a multiple of {{ compared_value }}. + Ова вредноÑÑ‚ би требало да буде дељива Ñа {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + BIC код није повезан Ñа IBAN {{ iban }}. + + + This value should be valid JSON. + Ова вредноÑÑ‚ би требало да буде валидан JSON. + + + This collection should contain only unique elements. + Ова колекција би требала да Ñадржи Ñамо јединÑтвене елементе. + + + This value should be positive. + Ова вредноÑÑ‚ би требала бити позитивна. + + + This value should be either positive or zero. + Ова вредноÑÑ‚ би требала бити позитивна или нула. + + + This value should be negative. + Ова вредноÑÑ‚ би требала бити негативна. + + + This value should be either negative or zero. + Ова вредноÑÑ‚ би требала бити позитивна или нула. + + + This value is not a valid timezone. + Ова вредноÑÑ‚ није валидна временÑка зона. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ова лозинка је компромитована приликом претходних напада, немојте је кориÑтити. КориÑтите другу лозинку. + + + This value should be between {{ min }} and {{ max }}. + Ова вредноÑÑ‚ треба да буде између {{ min }} и {{ max }}. + + + This value is not a valid hostname. + Ова вредноÑÑ‚ није иÑправно име хоÑта. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Број елемената у овој колекцији би требало да буде дељив Ñа {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ова вредноÑÑ‚ би требало да задовољава најмање једно од наредних ограничења: + + + Each element of this collection should satisfy its own set of constraints. + Сваки елемент ове колекције би требало да задовољи ÑопÑтвени Ñкуп ограничења. + + + This value is not a valid International Securities Identification Number (ISIN). + Ова вредноÑÑ‚ није иÑправна међународна идентификациона ознака хартија од вредноÑти (ISIN). + + + This value should be a valid expression. + Ова вредноÑÑ‚ треба да буде валидан израз. + + + This value is not a valid CSS color. + Ова вредноÑÑ‚ није иÑправна CSS боја. + + + This value is not a valid CIDR notation. + Ова вредноÑÑ‚ није иÑправна CIDR нотација. + + + The value of the netmask should be between {{ min }} and {{ max }}. + ВредноÑÑ‚ мрежне маÑке треба бити између {{ min }} и {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf new file mode 100644 index 00000000000..86453ada231 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Vrednost bi trebalo da bude netaÄna. + + + This value should be true. + Vrednost bi trebalo da bude taÄna. + + + This value should be of type {{ type }}. + Vrednost bi trebalo da bude tipa {{ type }}. + + + This value should be blank. + Vrednost bi trebalo da bude prazna. + + + The value you selected is not a valid choice. + Odabrana vrednost nije validan izbor. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Morate odabrati bar {{ limit }} mogućnost.|Morate odabrati bar {{ limit }} mogućnosti.|Morate odabrati bar {{ limit }} mogućnosti. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Morate odabrati najviÅ¡e {{ limit }} mogućnost.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti. + + + One or more of the given values is invalid. + Jedna ili viÅ¡e vrednosti nisu validne. + + + This field was not expected. + Ovo polje nije bilo oÄekivano. + + + This field is missing. + Ovo polje nedostaje. + + + This value is not a valid date. + Vrednost nije validan datum. + + + This value is not a valid datetime. + Vrednost nije validno vreme. + + + This value is not a valid email address. + Vrednost nije validna adresa elektronske poÅ¡te. + + + The file could not be found. + Datoteka ne može biti pronaÄ‘ena. + + + The file is not readable. + Datoteka nije Äitljiva. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Datoteka je prevelika ({{ size }} {{ suffix }}). Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + MIME tip datoteke nije validan ({{ type }}). Dozvoljeni MIME tipovi su {{ types }}. + + + This value should be {{ limit }} or less. + Vrednost bi trebalo da bude {{ limit }} ili manje. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Vrednost je predugaÄka. Trebalo bi da ima {{ limit }} karakter ili manje.|Vrednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje.|Vrednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje. + + + This value should be {{ limit }} or more. + Vrednost bi trebalo da bude {{ limit }} ili viÅ¡e. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Vrednost je prekratka. Trebalo bi da ima {{ limit }} karakter ili viÅ¡e.|Vrednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e.|Vrednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e. + + + This value should not be blank. + Vrednost ne bi trebalo da bude prazna. + + + This value should not be null. + Vrednost ne bi trebalo da bude prazna. + + + This value should be null. + Vrednost bi trebalo da bude prazna. + + + This value is not valid. + Vrednost nije validna. + + + This value is not a valid time. + Vrednost nije validno vreme. + + + This value is not a valid URL. + Vrednost nije validan URL. + + + The two values should be equal. + Obe vrednosti bi trebalo da budu jednake. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Datoteka je prevelika. Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. + + + The file is too large. + Datoteka je prevelika. + + + The file could not be uploaded. + Datoteka ne može biti otpremljena. + + + This value should be a valid number. + Vrednost bi trebalo da bude validan broj. + + + This file is not a valid image. + Ova datoteka nije validna slika. + + + This is not a valid IP address. + Ovo nije validna IP adresa. + + + This value is not a valid language. + Vrednost nije validan jezik. + + + This value is not a valid locale. + Vrednost nije validna meÄ‘unarodna oznaka jezika. + + + This value is not a valid country. + Vrednost nije validna država. + + + This value is already used. + Vrednost je već iskorišćena. + + + The size of the image could not be detected. + VeliÄina slike ne može biti odreÄ‘ena. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Å irina slike je prevelika ({{ width }} piksela). Najveća dozvoljena Å¡irina je {{ max_width }} piksela. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Å irina slike je premala ({{ width }} piksela). Najmanja dozvoljena Å¡irina je {{ min_width }} piksela. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Visina slike je prevelika ({{ height }} piksela). Najveća dozvoljena visina je {{ max_height }} piksela. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Visina slike je premala ({{ height }} piksela). Najmanja dozvoljena visina je {{ min_height }} piksela. + + + This value should be the user's current password. + Vrednost bi trebalo da bude trenutna korisniÄka lozinka. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Vrednost bi trebalo da ima taÄno {{ limit }} karakter.|Vrednost bi trebalo da ima taÄno {{ limit }} karaktera.|Vrednost bi trebalo da ima taÄno {{ limit }} karaktera. + + + The file was only partially uploaded. + Datoteka je samo parcijalno otpremljena. + + + No file was uploaded. + Datoteka nije otpremljena. + + + No temporary folder was configured in php.ini. + Privremeni direktorijum nije konfigurisan u php.ini. + + + Cannot write temporary file to disk. + Nemoguće pisanje privremene datoteke na disk. + + + A PHP extension caused the upload to fail. + PHP ekstenzija je prouzrokovala neuspeh otpremanja datoteke. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} element.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elementa.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elemenata. + + + Invalid card number. + Broj kartice nije validan. + + + Unsupported card type or invalid card number. + Tip kartice nije podržan ili broj kartice nije validan. + + + This is not a valid International Bank Account Number (IBAN). + Ovo nije validan meÄ‘unarodni broj bankovnog raÄuna (IBAN). + + + This value is not a valid ISBN-10. + Ovo nije validan ISBN-10. + + + This value is not a valid ISBN-13. + Ovo nije validan ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ovo nije validan ISBN-10 ili ISBN-13. + + + This value is not a valid ISSN. + Ovo nije validan ISSN. + + + This value is not a valid currency. + Ovo nije validna valuta. + + + This value should be equal to {{ compared_value }}. + Ova vrednost bi trebalo da bude jednaka {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ova vrednost bi trebalo da bude veća od {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ova vrednost bi trebalo da bude veća ili jednaka {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ova vrednost bi trebalo da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ova vrednost bi trebalo da bude manja od {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ova vrednost bi trebalo da bude manja ili jednaka {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ova vrednost ne bi trebalo da bude jednaka {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ova vrednost ne bi trebalo da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Razmera ove slike je prevelika ({{ ratio }}). Maksimalna dozvoljena razmera je {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Razmera ove slike je premala ({{ ratio }}). Minimalna oÄekivana razmera je {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Slika je kvadratna ({{ width }}x{{ height }} piksela). Kvadratne slike nisu dozvoljene. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Slika je pejzažno orijentisana ({{ width }}x{{ height }} piksela). Pejzažna orijentisane slike nisu dozvoljene. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Slika je portretno orijentisana ({{ width }}x{{ height }} piksela). Portretno orijentisane slike nisu dozvoljene. + + + An empty file is not allowed. + Prazna datoteka nije dozvoljena. + + + The host could not be resolved. + Ime hosta ne može biti razreÅ¡eno. + + + This value does not match the expected {{ charset }} charset. + Vrednost se ne poklapa sa oÄekivanim {{ charset }} setom karaktera. + + + This is not a valid Business Identifier Code (BIC). + Ovo nije validan BIC. + + + Error + GreÅ¡ka + + + This is not a valid UUID. + Ovo nije validan univerzalni unikatni identifikator (UUID). + + + This value should be a multiple of {{ compared_value }}. + Ova vrednost bi trebalo da bude deljiva sa {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + BIC kod nije povezan sa IBAN {{ iban }}. + + + This value should be valid JSON. + Ova vrednost bi trebalo da bude validan JSON. + + + This collection should contain only unique elements. + Ova kolekcija bi trebala da sadrži samo jedinstvene elemente. + + + This value should be positive. + Ova vrednost bi trebala biti pozitivna. + + + This value should be either positive or zero. + Ova vrednost bi trebala biti pozitivna ili nula. + + + This value should be negative. + Ova vrednost bi trebala biti negativna. + + + This value should be either negative or zero. + Ova vrednost bi trebala biti negativna ili nula. + + + This value is not a valid timezone. + Ova vrednost nije validna vremenska zona. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ova lozinka je kompromitovana prilikom prethodnih napada, nemojte je koristiti. Koristite drugu lozinku. + + + This value should be between {{ min }} and {{ max }}. + Ova vrednost treba da bude izmeÄ‘u {{ min }} i {{ max }}. + + + This value is not a valid hostname. + Ova vrednost nije ispravno ime poslužitelja (hostname). + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Broj elemenata u ovoj kolekciji bi trebalo da bude deljiv sa {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ova vrednost bi trebalo da zadovoljava namjanje jedno od narednih ograniÄenja: + + + Each element of this collection should satisfy its own set of constraints. + Svaki element ove kolekcije bi trebalo da zadovolji sopstveni skup ograniÄenja. + + + This value is not a valid International Securities Identification Number (ISIN). + Ova vrednost nije ispravna meÄ‘unarodna identifikaciona oznaka hartija od vrednosti (ISIN). + + + This value should be a valid expression. + Ova vrednost treba da bude validan izraz. + + + This value is not a valid CSS color. + Ova vrednost nije ispravna CSS boja. + + + This value is not a valid CIDR notation. + Ova vrednost nije ispravna CIDR notacija. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Vrednost mrežne maske treba biti izmeÄ‘u {{ min }} i {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf new file mode 100644 index 00000000000..fca7bdc0764 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Värdet ska vara falskt. + + + This value should be true. + Värdet ska vara sant. + + + This value should be of type {{ type }}. + Värdet ska vara av typen {{ type }}. + + + This value should be blank. + Värdet ska vara tomt. + + + The value you selected is not a valid choice. + Värdet ska vara ett av de givna valen. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Du mÃ¥ste välja minst {{ limit }} val.|Du mÃ¥ste välja minst {{ limit }} val. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Du kan som mest välja {{ limit }} val.|Du kan som mest välja {{ limit }} val. + + + One or more of the given values is invalid. + Ett eller fler av de angivna värdena är ogiltigt. + + + This field was not expected. + Det här fältet förväntades inte. + + + This field is missing. + Det här fältet saknas. + + + This value is not a valid date. + Värdet är inte ett giltigt datum. + + + This value is not a valid datetime. + Värdet är inte ett giltigt datum med tid. + + + This value is not a valid email address. + Värdet är inte en giltig e-postadress. + + + The file could not be found. + Filen kunde inte hittas. + + + The file is not readable. + Filen är inte läsbar. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Filen är för stor ({{ size }} {{ suffix }}). Största tillÃ¥tna storlek är {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Filens MIME-typ ({{ type }}) är ogiltig. De tillÃ¥tna typerna är {{ types }}. + + + This value should be {{ limit }} or less. + Värdet ska vara {{ limit }} eller mindre. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Värdet är för lÃ¥ngt. Det ska ha {{ limit }} tecken eller färre.|Värdet är för lÃ¥ngt. Det ska ha {{ limit }} tecken eller färre. + + + This value should be {{ limit }} or more. + Värdet ska vara {{ limit }} eller mer. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Värdet är för kort. Det ska ha {{ limit }} tecken eller mer.|Värdet är för kort. Det ska ha {{ limit }} tecken eller mer. + + + This value should not be blank. + Värdet kan inte vara tomt. + + + This value should not be null. + Värdet kan inte vara null. + + + This value should be null. + Värdet ska vara null. + + + This value is not valid. + Värdet är inte giltigt. + + + This value is not a valid time. + Värdet är inte en giltig tid. + + + This value is not a valid URL. + Värdet är inte en giltig URL. + + + The two values should be equal. + De tvÃ¥ värdena mÃ¥ste vara lika. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Filen är för stor. TillÃ¥ten maximal storlek är {{ limit }} {{ suffix }}. + + + The file is too large. + Filen är för stor. + + + The file could not be uploaded. + Filen kunde inte laddas upp. + + + This value should be a valid number. + Värdet ska vara ett giltigt nummer. + + + This file is not a valid image. + Filen är ingen giltig bild. + + + This is not a valid IP address. + Det här är inte en giltig IP-adress. + + + This value is not a valid language. + Värdet är inte ett giltigt sprÃ¥k. + + + This value is not a valid locale. + Värdet är inte en giltig plats. + + + This value is not a valid country. + Värdet är inte ett giltigt land. + + + This value is already used. + Värdet används redan. + + + The size of the image could not be detected. + Det gick inte att fastställa storleken pÃ¥ bilden. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Bildens bredd är för stor ({{ width }}px). TillÃ¥ten maximal bredd är {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Bildens bredd är för liten ({{ width }}px). Minsta förväntade bredd är {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Bildens höjd är för stor ({{ height }}px). TillÃ¥ten maximal bredd är {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Bildens höjd är för liten ({{ height }}px). Minsta förväntade höjd är {{ min_height }}px. + + + This value should be the user's current password. + Värdet ska vara användarens nuvarande lösenord. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Värdet ska ha exakt {{ limit }} tecken.|Värdet ska ha exakt {{ limit }} tecken. + + + The file was only partially uploaded. + Filen laddades bara upp delvis. + + + No file was uploaded. + Ingen fil laddades upp. + + + No temporary folder was configured in php.ini. + Det finns ingen temporär mapp konfigurerad i php.ini. + + + Cannot write temporary file to disk. + Kan inte skriva temporär fil till disken. + + + A PHP extension caused the upload to fail. + En PHP extension gjorde att uppladdningen misslyckades. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Den här samlingen ska innehÃ¥lla {{ limit }} element eller mer.|Den här samlingen ska innehÃ¥lla {{ limit }} element eller mer. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Den här samlingen ska innehÃ¥lla {{ limit }} element eller mindre.|Den här samlingen ska innehÃ¥lla {{ limit }} element eller mindre. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Den här samlingen ska innehÃ¥lla exakt {{ limit }} element.|Den här samlingen ska innehÃ¥lla exakt {{ limit }} element. + + + Invalid card number. + Ogiltigt kortnummer. + + + Unsupported card type or invalid card number. + Okänd korttyp eller ogiltigt kortnummer. + + + This is not a valid International Bank Account Number (IBAN). + Det här är inte en giltig International Bank Account Number (IBANK). + + + This value is not a valid ISBN-10. + Värdet är inte en giltig ISBN-10. + + + This value is not a valid ISBN-13. + Värdet är inte en giltig ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Värdet är varken en giltig ISBN-10 eller en giltig ISBN-13. + + + This value is not a valid ISSN. + Värdet är inte en giltig ISSN. + + + This value is not a valid currency. + Värdet är inte en giltig valuta. + + + This value should be equal to {{ compared_value }}. + Värdet ska vara detsamma som {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Värdet ska vara större än {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Värdet ska bara större än eller detsamma som {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Värdet ska vara identiskt till {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Värdet ska vara mindre än {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Värdet ska vara mindre än eller detsamma som {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Värdet ska inte vara detsamma som {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Värdet ska inte vara identiskt med {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + FörhÃ¥llandet mellan bildens bredd och höjd är för stort ({{ ratio }}). Högsta tillÃ¥tna förhÃ¥llande är {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + FörhÃ¥llandet mellan bildens bredd och höjd är för litet ({{ ratio }}). Minsta tillÃ¥tna förhÃ¥llande är {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Bilden är kvadratisk ({{ width }}x{{ height }}px). Kvadratiska bilder tillÃ¥ts inte. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Bilden är landskapsorienterad ({{ width }}x{{ height }}px). Landskapsorienterade bilder tillÃ¥ts inte. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Bilden är porträttsorienterad ({{ width }}x{{ height }}px). Porträttsorienterade bilder tillÃ¥ts inte. + + + An empty file is not allowed. + En tom fil är inte tillÃ¥ten. + + + The host could not be resolved. + Värddatorn kunde inte hittas. + + + This value does not match the expected {{ charset }} charset. + Detta värde har inte den förväntade teckenkodningen {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Detta är inte en giltig BIC-kod. + + + Error + Fel + + + This is not a valid UUID. + Detta är inte ett giltigt UUID. + + + This value should be a multiple of {{ compared_value }}. + Detta värde ska vara en multipel av {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Denna BIC-koden är inte associerad med IBAN {{ iban }}. + + + This value should be valid JSON. + Detta värde ska vara giltig JSON. + + + This collection should contain only unique elements. + Denna samling bör endast innehÃ¥lla unika element. + + + This value should be positive. + Detta värde bör vara positivt. + + + This value should be either positive or zero. + Detta värde bör vara antingen positivt eller noll. + + + This value should be negative. + Detta värde bör vara negativt. + + + This value should be either negative or zero. + Detta värde bör vara antingen negativt eller noll. + + + This value is not a valid timezone. + Detta värde är inte en giltig tidszon. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Det här lösenordet har läckt ut vid ett dataintrÃ¥ng, det fÃ¥r inte användas. Använd ett annat lösenord. + + + This value should be between {{ min }} and {{ max }}. + Detta värde bör ligga mellan {{ min }} och {{ max }}. + + + This value is not a valid hostname. + Värdet är inte ett giltigt servernamn. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Antalet element i samlingen ska vara en multipel av {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Det här värdet skall uppfylla minst ett av följande krav: + + + Each element of this collection should satisfy its own set of constraints. + Varje element i samlingen skall uppfylla sin egen uppsättning av krav. + + + This value is not a valid International Securities Identification Number (ISIN). + Det här värdet är inte ett giltigt "International Securities Identification Number" (ISIN). + + + This value should be a valid expression. + Det här värdet bör vara ett giltigt uttryck. + + + This value is not a valid CSS color. + Det här värdet är inte en giltig CSS-färg. + + + This value is not a valid CIDR notation. + Det här värdet är inte en giltig CIDR-notation. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Värdet pÃ¥ nätmasken bör vara mellan {{ min }} och {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf new file mode 100644 index 00000000000..26affc5a6f3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + ค่านี้ควรเป็น false + + + This value should be true. + ค่านี้ควรเป็น true + + + This value should be of type {{ type }}. + ค่านี้ควรเป็น {{ type }} + + + This value should be blank. + ควรเป็นค่าว่าง + + + The value you selected is not a valid choice. + คุณเลือà¸à¸„่าที่ไม่ตรงà¸à¸±à¸šà¸•à¸±à¸§à¹€à¸¥à¸·à¸­à¸ + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + คุณต้องเลือà¸à¸­à¸¢à¹ˆà¸²à¸‡à¸™à¹‰à¸­à¸¢ {{ limit }} ตัวเลือภ+ + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + คุณเลือà¸à¹„ด้มาà¸à¸—ี่สุด {{ limit }} ตัวเลือภ+ + + One or more of the given values is invalid. + มีบางค่าที่ส่งมาไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This field was not expected. + ไม่ควรมีฟิลด์นี้ + + + This field is missing. + ฟิลด์นี้หายไป + + + This value is not a valid date. + ค่าของวันที่ไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid datetime. + ค่าของวันที่à¹à¸¥à¸°à¹€à¸§à¸¥à¸²à¹„ม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid email address. + ค่าของอีเมล์ไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + The file could not be found. + ไม่พบไฟล์ + + + The file is not readable. + ไฟล์ไม่อยู่ในสถานะที่สามารถอ่านได้ + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + ไฟล์ใหà¸à¹ˆà¹€à¸à¸´à¸™ ({{ size }} {{ suffix }}) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¹ƒà¸«à¸à¹ˆà¸—ี่สุดได้ไม่เà¸à¸´à¸™ {{ limit }} {{ suffix }} + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Mime type ของไฟล์ไม่ถูà¸à¸•à¹‰à¸­à¸‡ ({{ type }}) Mime types ที่อนุà¸à¸²à¸•à¸„ือ {{ types }} + + + This value should be {{ limit }} or less. + ค่านี้ควรจะเป็น {{ limit }} หรือน้อยà¸à¸§à¹ˆà¸²à¸™à¸±à¹‰à¸™ + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + ค่านี้ยาวเà¸à¸´à¸™à¹„ป ควรจะมีà¹à¸„่ {{ limit }} ตัวอัà¸à¸©à¸£à¸«à¸£à¸·à¸­à¸™à¹‰à¸­à¸¢à¸à¸§à¹ˆà¸²à¸™à¸±à¹‰à¸™ + + + This value should be {{ limit }} or more. + ค่านี้ควรจะมี {{ limit }} หรือมาà¸à¸à¸§à¹ˆà¸²à¸™à¸±à¹‰à¸™ + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + ค่านี้สั้นเà¸à¸´à¸™à¹„ป ควรจะมี {{ limit }} ตัวอัà¸à¸©à¸£à¸«à¸£à¸·à¸­à¸¡à¸²à¸à¸à¸§à¹ˆà¸²à¸™à¸±à¹‰à¸™ + + + This value should not be blank. + ค่านี้ไม่ควรเป็นค่าว่าง + + + This value should not be null. + ค่านี้ไม่ควรเป็นค่า null + + + This value should be null. + ค่านี้ควรเป็นค่า null + + + This value is not valid. + ค่านี้ไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid time. + ค่าของเวลาไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid URL. + ค่าของ URL ไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + The two values should be equal. + ค่าทั้งสองค่าควรจะเหมือนà¸à¸±à¸™ + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + ขนาดไฟล์ใหà¸à¹ˆà¹€à¸à¸´à¸™à¹„ป อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¹„ฟล์ขนาดใหà¸à¹ˆà¹„ด้ไม่เà¸à¸´à¸™ {{ limit }} {{ suffix }} + + + The file is too large. + ขนาดไฟล์ใหà¸à¹ˆà¹€à¸à¸´à¸™à¹„ป + + + The file could not be uploaded. + ไม่สามารถอัปโหลดไฟล์ได้ + + + This value should be a valid number. + ค่าของตัวเลขไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This file is not a valid image. + ไฟล์นี้ไม่ใช่ไฟล์รูปภาพ + + + This is not a valid IP address. + ค่าของ IP ไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid language. + ค่าของภาษาไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid locale. + ค่าของภูมิภาค (Locale) ไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid country. + ค่าของประเทศไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is already used. + ค่านี้ถูà¸à¹ƒà¸Šà¹‰à¸‡à¸²à¸™à¹„ปà¹à¸¥à¹‰à¸§ + + + The size of the image could not be detected. + ไม่สามารถตรวจสอบขนาดไฟล์ของภาพได้ + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + ความà¸à¸§à¹‰à¸²à¸‡à¸‚องภาพเà¸à¸´à¸™à¸‚นาด ({{ width }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸à¸§à¹‰à¸²à¸‡à¹„ด้มาà¸à¸—ี่สุด {{ max_width }}px + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + ความà¸à¸§à¹‰à¸²à¸‡à¸‚องภาพต่ำเà¸à¸´à¸™à¹„ป ({{ width }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸„วามà¸à¸§à¹‰à¸²à¸‡à¹„ม่ต่ำà¸à¸§à¹ˆà¸² {{ min_width }}px + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ความสูงของภาพเà¸à¸´à¸™à¸‚นาด ({{ height }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸ªà¸¹à¸‡à¹„ด้มาà¸à¸—ี่สุด {{ max_height }}px + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ความสูงของภาพเล็à¸à¹€à¸à¸´à¸™à¹„ป ({{ height }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸„วามสูงไม่ควรต่ำà¸à¸§à¹ˆà¸² {{ min_height }}px + + + This value should be the user's current password. + ค่านี้ควรจะเป็นรหัสผ่านปัจจุบันของผู้ใช้ + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + ค่านี้ควรจะมีความยาว {{ limit }} ตัวอัà¸à¸©à¸£ + + + The file was only partially uploaded. + อัปโหลดไฟล์ได้เพียงบางส่วนเท่านั้น + + + No file was uploaded. + ไม่มีไฟล์ใดถูà¸à¸­à¸±à¸›à¹‚หลด + + + No temporary folder was configured in php.ini. + ไม่พบà¸à¸²à¸£à¸•à¸±à¹‰à¸‡à¸„่าโฟลเดอร์ชั่วคราว (temporary folder) ใน php.ini + + + Cannot write temporary file to disk. + ไม่สามารถเขียนไฟล์ชั่วคราว (temporary file) ลงดิสà¸à¹Œà¹„ด้ + + + A PHP extension caused the upload to fail. + PHP extension ทำให้à¸à¸²à¸£à¸­à¸±à¸›à¹‚หลดมีปัà¸à¸«à¸² + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรจะประà¸à¸­à¸šà¹„ปด้วยอย่างน้อย {{ limit }} สมาชิภ+ + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¹„ม่ควรมีสมาชิà¸à¹€à¸à¸´à¸™ {{ limit }} + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรจะมี {{ limit }} สมาชิà¸à¹€à¸—่านั้น + + + Invalid card number. + หมายเลขบัตรไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + Unsupported card type or invalid card number. + ไม่รู้จัà¸à¸›à¸£à¸°à¹€à¸ à¸—ของบัตร หรือหมายเลขบัตรไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This is not a valid International Bank Account Number (IBAN). + ค่านี้ไม่ใช่ International Bank Account Number (IBAN) ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid ISBN-10. + ค่านี้ไม่ใช่ ISBN-10 ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid ISBN-13. + ค่านี้ไม่ใช่ ISBN-13 ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + ค่านี้ไม่ใช่ ISBN-10 หรือ ISBN-13 ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid ISSN. + ค่านี้ไม่ใช่ ISSN ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid currency. + ค่านี้ไม่ใช่สà¸à¸¸à¸¥à¹€à¸‡à¸´à¸™à¸—ี่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value should be equal to {{ compared_value }}. + ค่านี้ควรตรงà¸à¸±à¸š {{ compared_value }} + + + This value should be greater than {{ compared_value }}. + ค่านี้ควรจะมาà¸à¸à¸§à¹ˆà¸² {{ compared_value }} + + + This value should be greater than or equal to {{ compared_value }}. + ค่านี้ควรจะมาà¸à¸à¸§à¹ˆà¸²à¸«à¸£à¸·à¸­à¸•à¸£à¸‡à¸à¸±à¸š {{ compared_value }} + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + ค่านี้ควรจะเหมือนà¸à¸±à¸™à¸à¸±à¸š {{ compared_value_type }} {{ compared_value }} + + + This value should be less than {{ compared_value }}. + ค่านี้ควรจะน้อยà¸à¸§à¹ˆà¸² {{ compared_value }} + + + This value should be less than or equal to {{ compared_value }}. + ค่านี้ควรจะน้อยà¸à¸§à¹ˆà¸²à¸«à¸£à¸·à¸­à¹€à¸—่าà¸à¸±à¸š {{ compared_value }} + + + This value should not be equal to {{ compared_value }}. + ค่านี้ไม่ควรเท่าà¸à¸±à¸™à¸à¸±à¸š {{ compared_value }} + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + ค่านี้ไม่ควรเหมือนà¸à¸±à¸™à¸à¸±à¸š {{ compared_value_type }} {{ compared_value }} + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + สัดส่วนของภาพใหà¸à¹ˆà¹€à¸à¸´à¸™ ({{ ratio }}) สัดส่วนใหà¸à¹ˆà¸—ี่สุดที่ใช้ได้คือ {{ max_ratio }} + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + สัดส่วนของภาพเล็à¸à¹€à¸à¸´à¸™ ({{ ratio }}) สัดส่วนเล็à¸à¸—ี่สุดที่ใช้ได้คือ {{ min_ratio }} + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + รูปภาพเป็นจุตรัส ({{ width }}x{{ height }}px) ไม่อนุà¸à¸²à¸•à¸ à¸²à¸žà¸—ี่เป็นสี่เหลี่ยมจตุรัส + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + ภาพนี้เป็นà¹à¸™à¸§à¸™à¸­à¸™ ({{ width }}x{{ height }}px) ไม่อนุà¸à¸²à¸•à¸ à¸²à¸žà¸—ี่เป็นà¹à¸™à¸§à¸™à¸­à¸™ + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + ภาพนี้เป็นà¹à¸™à¸§à¸•à¸±à¹‰à¸‡ ({{ width }}x{{ height }}px) ไม่อนุà¸à¸²à¸•à¸ à¸²à¸žà¸—ี่เป็นà¹à¸™à¸§à¸•à¸±à¹‰à¸‡ + + + An empty file is not allowed. + ไม่อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¹ƒà¸Šà¹‰à¹„ฟล์ว่าง + + + The host could not be resolved. + ไม่สามารถà¹à¸à¹‰à¹„ขชื่อโฮสต์ + + + This value does not match the expected {{ charset }} charset. + ค่านี้ไม่ตรงà¸à¸±à¸šà¸à¸²à¸£à¹€à¸‚้ารหัส {{ charset }} + + + This is not a valid Business Identifier Code (BIC). + นี่ไม่ถูà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡à¸£à¸«à¸±à¸ªà¸ªà¸³à¸«à¸£à¸±à¸šà¸£à¸°à¸šà¸¸à¸˜à¸¸à¸£à¸à¸´à¸ˆà¸™à¸µà¹‰ (BIC) + + + Error + เà¸à¸´à¸”ข้อผิดพลาด + + + This is not a valid UUID. + นี่ไม่ใช่ UUID ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value should be a multiple of {{ compared_value }}. + ค่านี้ควรเป็น {{ compared_value }} หลายตัว + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + รหัสสำหรับระบุธุรà¸à¸´à¸ˆà¸™à¸µà¹‰ (BIC) ไม่เà¸à¸µà¹ˆà¸¢à¸§à¸‚้องà¸à¸±à¸š IBAN {{ iban }} + + + This value should be valid JSON. + ค่านี้ควรอยู่ในรูปà¹à¸šà¸š JSON ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This collection should contain only unique elements. + คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรมีเฉพาะสมาชิà¸à¸—ี่ไม่ซ้ำà¸à¸±à¸™à¹€à¸—่านั้น + + + This value should be positive. + ค่านี้ควรเป็นค่าบวภ+ + + This value should be either positive or zero. + ค่านี้ควรเป็นค่าบวà¸à¸«à¸£à¸·à¸­à¸„่าศูนย์ + + + This value should be negative. + ค่านี้ควรเป็นค่าลบ + + + This value should be either negative or zero. + ค่านี้ควรเป็นค่าลบหรือค่าศูนย์ + + + This value is not a valid timezone. + ค่าเขตเวลาไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This password has been leaked in a data breach, it must not be used. Please use another password. + รหัสผ่านนี้ได้เคยรั่วไหลออà¸à¹„ปโดยถูà¸à¸à¸²à¸£à¸¥à¸°à¹€à¸¡à¸´à¸”ข้อมูล ซึ่งไม่ควรนำà¸à¸¥à¸±à¸šà¸¡à¸²à¹ƒà¸Šà¹‰ à¸à¸£à¸¸à¸“าใช้รหัสผ่านอื่น + + + This value should be between {{ min }} and {{ max }}. + ค่านี้ควรอยู่ระหว่าง {{ min }} ถึง {{ max }} + + + This value is not a valid hostname. + ค่าโฮสต์เนมไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + จำนวนของสมาชิà¸à¹ƒà¸™à¸„อเล็à¸à¸Šà¸±à¹ˆà¸™à¸„วรเป็นพหุคูณของ {{ compared_value }} + + + This value should satisfy at least one of the following constraints: + ค่านี้ควรเป็นไปตามข้อจำà¸à¸±à¸”อย่างน้อยหนึ่งข้อจาà¸à¸‚้อจำà¸à¸±à¸”เหล่านี้: + + + Each element of this collection should satisfy its own set of constraints. + สมาชิà¸à¹à¸•à¹ˆà¸¥à¸°à¸•à¸±à¸§à¹ƒà¸™à¸„อเล็à¸à¸Šà¸±à¹ˆà¸™à¸„วรเป็นไปตามข้อจำà¸à¸±à¸”ของคอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸±à¹‰à¸™à¹† + + + This value is not a valid International Securities Identification Number (ISIN). + ค่ารหัสหลัà¸à¸—รัพย์สาà¸à¸¥ (ISIN) ไม่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value should be a valid expression. + ค่านี้ควรเป็นนิพจน์ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid CSS color. + ค่านี้ไม่ใช่สี CSS ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + This value is not a valid CIDR notation. + ค่านี้ไม่ใช่รูปà¹à¸šà¸š CIDR ที่ถูà¸à¸•à¹‰à¸­à¸‡ + + + The value of the netmask should be between {{ min }} and {{ max }}. + ค่าของ netmask ควรมีค่าระหว่าง {{ min }} ถึง {{ max }} + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf new file mode 100644 index 00000000000..74d5ed5cfca --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf @@ -0,0 +1,399 @@ + + + + + + This value should be false. + Ang halaga nito ay dapat na huwad. + + + This value should be true. + Ang halaga nito ay dapat totoo. + + + This value should be of type {{ type }}. + Ang halaga nito ay dapat sa uri {{ type }}. + + + This value should be blank. + Ang halaga nito ay dapat walang laman. + + + The value you selected is not a valid choice. + Ang halaga ng iyong pinili ay hindi balidong pagpili. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Kailangan mong pumili ng pinakamababang {{ limit }} ng pagpilian.|Kailangan mong pumili ng pinakamababang {{ limit }} ng mga pagpipilian. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Kailangan mong pumili ng pinakamataas {{ limit }} ng pagpipilian.|Kailangan mong pumili ng pinakamataas {{ limit }} ng mga pagpipilian. + + + One or more of the given values is invalid. + Isa o higit pang mga halaga na binigay ay hindi balido. + + + This field was not expected. + Ang larangang ito ay hindi inaasahan. + + + This field is missing. + Ang patlang na ito ay nawawala. + + + This value is not a valid date. + Ang halagang ito ay hindi balidong petsa. + + + This value is not a valid datetime. + Ang halagang ito ay hindi wastong petsa/oras. + + + This value is not a valid email address. + Ang halagang ito ay hindi balidong address ng email. + + + The file could not be found. + Ang file na ito ay hindi makita. + + + The file is not readable. + Ang file na ito ay hindi mabasa. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Ang file na ito ay masyadong malaki ({{ size }} {{ suffix }}). Ang pinakamalaking sukat {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Ang uri ng file ng mime ay hindi balido ({{ type }}). Ang mga pinapayagang uri ng mime ay ang {{ types }}. + + + This value should be {{ limit }} or less. + Ang halaga nito ay dapat na {{ limit }} or maliit pa. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ang halaga nito ay masyadong mahaba. Ito ay dapat na {{ limit }} karakter o maliit pa.|Ang halaga nito ay masyadong mahaba. Ito ay dapat na {{ limit }} mga karakter o maliit pa. + + + This value should be {{ limit }} or more. + Ang halaga nito ay dapat na {{ limit }} o mas marami pa. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ang halaga nito ay masyadong maliit. Ito ay dapat na {{ limit }} karakter o marami pa.|Ang halaga nito ay masyadong maliit. Ito ay dapat na {{ limit }} mga karakter o marami pa. + + + This value should not be blank. + Ang halaga na ito ay dapat na may laman. + + + This value should not be null. + Meron dapt itong halaga. + + + This value should be null. + Wala dapat itong halaga. + + + This value is not valid. + Hindi balido ang halagang ito. + + + This value is not a valid time. + Ang halagang ito ay hindi wastong oras. + + + This value is not a valid URL. + Hindi ito isang balidong URL. + + + The two values should be equal. + Ang dalwang halaga ay dapat magkapareha. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Ang file ay masyadong malaki. Ang pinapayagan halaga lamang ay {{ limit}} {{ suffix }}. + + + The file is too large. + Ang file na ito ay masyadong malaki. + + + The file could not be uploaded. + Ang file na ito ay hindi ma-upload. + + + This value should be a valid number. + Ang halaga nito ay dapat na wastong numero. + + + This file is not a valid image. + Ang file na ito ay hindi wastong imahe. + + + This is not a valid IP address. + Ito ay hindi wastong IP address. + + + This value is not a valid language. + Ang halaga na ito ay hindi balidong wika. + + + This value is not a valid locale. + Ito ay isang hindi wastong locale na halaga. + + + This value is not a valid country. + ng halaga na ito ay hindi wastong bansa. + + + This value is already used. + Ang halaga na ito ay ginamit na. + + + The size of the image could not be detected. + Ang sukat ng imahe ay hindi madetect. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ang lapad ng imahe ay masyadong malaki ({{ width }}px). Ang pinapayagang lapay ay {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ang lapad ng imahe ay masyadong maliit ({{ width }}px). Ang pinakamaliit na pinapayagang lapad ay {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Ang haba ng imahe ay masyadong mataas ({{ height }}px). Ang pinakmataas na haba ay {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Ang haba ng imahe ay masyadong maliit ({{ height }}px). Ang inaasahang haba ay {{ min_height }}px. + + + This value should be the user's current password. + Ang halagang ito ay dapat na password ng kasalukuyang gumagamit. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ang halagang ito ay dapat na eksakto sa {{ limit}} karakter.|Ang halagang ito ay dapat na eksakto sa {{ limit }} mga karakter. + + + The file was only partially uploaded. + Ang file na ito ay kahalating na upload lamang. + + + No file was uploaded. + Walang na upload na file. + + + No temporary folder was configured in php.ini. + Walang temporaryong folder ang naayos sa php.ini. + + + Cannot write temporary file to disk. + Temporaryong hindi makasulat ng file sa disk. + + + A PHP extension caused the upload to fail. + Ang dahilan ng pagkabigo ng pagupload ng files ay isang extension ng PHP. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ang koleksyon na ito ay dapat magkaroon ng {{ limit }} elemento o marami pa.|Ang koleksyon na ito ay dapat magkaroon ng {{ limit }} mga elemento o marami pa. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ang koleksyon na ito ay dapat magkaroon ng {{ limit }} elemento o maliit pa.|Ang koleksyon na ito ay dapat magkaroon ng {{ limit }} mga elemento o maliit pa. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ang koleksyong ito ay magkaroon ng eksaktong {{ limit }} elemento.|Ang koleksyong ito ay magkaroon ng eksaktong {{ limit }} mga elemento. + + + Invalid card number. + Hindi wastong numero ng kard. + + + Unsupported card type or invalid card number. + Hindi supportadong uri ng kard o hindi wastong numero ng kard. + + + This is not a valid International Bank Account Number (IBAN). + Ito ay hindi isang balidong International Bank Account Number (IBAN). + + + This value is not a valid ISBN-10. + Ang halagang ito ay hindi balidong SBN-10. + + + This value is not a valid ISBN-13. + Ang halagang ito ay hindi balidong ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ang halagang ito ay pwdeng isang balidong ISBN-10 o isang balidong ISBN-13. + + + This value is not a valid ISSN. + Ang halangang ito ay hindi isang balidong ISSN. + + + This value is not a valid currency. + Ang halagang ito ay hindi balidong pera. + + + This value should be equal to {{ compared_value }}. + Ito ay hindi dapat magkapareho sa {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ang halagang ito ay dapat tataas sa {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ang halagang ito ay dapat mas mataas o magkapareha sa {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ang halagang ito ay dapat kapareha ng {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ang halagang ito ay dapat mas maliit sa {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ang halagang ito ay dapat mas maliit o magkapareha sa {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ang halagang ito ay hindi dapat magkapareha sa {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ang halagang ito ay hindi dapat magkapareha sa {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Ang ratio ng imahe ay masyadong malaki ({{ ratio }}). Ang pinakamalaking ratio ay {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Ang ratio ng imahe ay masyadong maliit ({{ ratio }}). Ang pinakamaliit na ratio ay {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Ang imahe ay kwadrado ({{ width }}x{{ height }}px). Ang mga kwadradong imahe ay hindi pwede. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Ang orientasyon ng imahe ay nakalandscape ({{ width }}x{{ height }}px). Ang mga imaheng nakalandscape ang orientasyon ay hindi pwede. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Ang orientasyon ng imahe ay nakaportrait ({{ width }}x{{ height }}px). Ang mga imaheng nakaportrait ang orientasyon ay hindi pwede. + + + An empty file is not allowed. + Ang file na walang laman ay hindi pwede. + + + The host could not be resolved. + Hindi maresolba ang host. + + + This value does not match the expected {{ charset }} charset. + Ang halaga ay hindi kapareha sa inaasahang {{ charset }} set ng karater. + + + This is not a valid Business Identifier Code (BIC). + Ito ay hindi isang balidong Business Identifier Code (BIC). + + + Error + Error + + + This is not a valid UUID. + Ito ay hindi wastong UUID. + + + This value should be a multiple of {{ compared_value }}. + Ang halagang ito ay dapat multiple ng {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ang Business Identifier Code (BIC) na ito ay walang kaugnayan sa IBAN {{ iban }}. + + + This value should be valid JSON. + Ang halagang ito ay dapat naka wastong JSON. + + + This collection should contain only unique elements. + Ang mga elemento ng koleksyong ito ay dapat magkakaiba. + + + This value should be positive. + Ang halagang ito ay dapat positibo. + + + This value should be either positive or zero. + Ang halagang ito ay dapat positibo o zero. + + + This value should be negative. + Ang halagang ito ay dapat negatibo. + + + This value should be either negative or zero. + Ang halagang ito ay dapat negatibo o zero. + + + This value is not a valid timezone. + Ang halagang ito ay hindi wastong timezone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Naikalat ang password na ito sa isang data breach at hindi na dapat gamitin. Mangyaring gumamit ng ibang pang password. + + + This value should be between {{ min }} and {{ max }}. + Ang halagang ito ay dapat nasa pagitan ng {{ min }} at {{ max }}. + + + This value is not a valid hostname. + Ang halagang ito ay hindi wastong hostname. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Ang bilang ng mga elemento sa koleksyon na ito ay dapat multiple ng {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ang halagang ito ay dapat masunod ang kahit na isang sumusunod na batayan. + + + Each element of this collection should satisfy its own set of constraints. + Ang bawat elemento sa koleksyon na ito ay dapat masunod ang nararapat na batayan. + + + This value is not a valid International Securities Identification Number (ISIN). + Ang halagang ito ay hindi wastong International Securities Identification Number (ISIN). + + + This value should be a valid expression. + Ang halagang ito ay dapat wastong ekspresyon. + + + This value is not a valid CSS color. + Ang halagang ito ay hindi wastong kulay ng CSS. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf new file mode 100644 index 00000000000..715137d5890 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Bu deÄŸer olumsuz olmalıdır. + + + This value should be true. + Bu deÄŸer olumlu olmalıdır. + + + This value should be of type {{ type }}. + Bu deÄŸerin tipi {{ type }} olmalıdır. + + + This value should be blank. + Bu deÄŸer boÅŸ olmalıdır. + + + The value you selected is not a valid choice. + SeçtiÄŸiniz deÄŸer geçerli bir seçenek deÄŸil. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + En az {{ limit }} seçenek belirtmelisiniz. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + En çok {{ limit }} seçenek belirtmelisiniz. + + + One or more of the given values is invalid. + Verilen deÄŸerlerden bir veya daha fazlası geçersiz. + + + This field was not expected. + Bu alan beklenen olmadı. + + + This field is missing. + Bu alan, eksik + + + This value is not a valid date. + Bu deÄŸer doÄŸru bir tarih biçimi deÄŸildir. + + + This value is not a valid datetime. + Bu deÄŸer doÄŸru bir tarihsaat biçimi deÄŸildir. + + + This value is not a valid email address. + Bu deÄŸer doÄŸru bir e-mail adresi deÄŸildir. + + + The file could not be found. + Dosya bulunamadı. + + + The file is not readable. + Dosya okunabilir deÄŸil. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Dosya çok büyük ({{ size }} {{ suffix }}). Ä°zin verilen en büyük dosya boyutu {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Dosyanın mime tipi geçersiz ({{ type }}). Ä°zin verilen mime tipleri {{ types }}. + + + This value should be {{ limit }} or less. + Bu deÄŸer {{ limit }} ve altında olmalıdır. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Bu deÄŸer çok uzun. {{ limit }} karakter veya daha az olmalıdır. + + + This value should be {{ limit }} or more. + Bu deÄŸer {{ limit }} veya daha fazla olmalıdır. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Bu deÄŸer çok kısa. {{ limit }} karakter veya daha fazla olmalıdır. + + + This value should not be blank. + Bu deÄŸer boÅŸ bırakılmamalıdır. + + + This value should not be null. + Bu deÄŸer boÅŸ bırakılmamalıdır. + + + This value should be null. + Bu deÄŸer boÅŸ bırakılmalıdır. + + + This value is not valid. + Bu deÄŸer geçerli deÄŸil. + + + This value is not a valid time. + Bu deÄŸer doÄŸru bir saat deÄŸil. + + + This value is not a valid URL. + Bu deÄŸer doÄŸru bir URL deÄŸil. + + + The two values should be equal. + Ä°ki deÄŸer eÅŸit olmalıdır. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Dosya çok büyük. Ä°zin verilen en büyük dosya boyutu {{ limit }} {{ suffix }}. + + + The file is too large. + Dosya çok büyük. + + + The file could not be uploaded. + Dosya yüklenemiyor. + + + This value should be a valid number. + Bu deÄŸer geçerli bir rakam olmalıdır. + + + This file is not a valid image. + Bu dosya geçerli bir resim deÄŸildir. + + + This is not a valid IP address. + Bu geçerli bir IP adresi deÄŸildir. + + + This value is not a valid language. + Bu deÄŸer geçerli bir lisan deÄŸil. + + + This value is not a valid locale. + Bu deÄŸer geçerli bir yer deÄŸildir. + + + This value is not a valid country. + Bu deÄŸer geçerli bir ülke deÄŸildir. + + + This value is already used. + Bu deÄŸer ÅŸu anda kullanımda. + + + The size of the image could not be detected. + Resmin boyutu saptanamıyor. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Resmin geniÅŸliÄŸi çok büyük ({{ width }}px). Ä°zin verilen en büyük geniÅŸlik {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Resmin geniÅŸliÄŸi çok küçük ({{ width }}px). En az {{ min_width }}px olmalıdır. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Resmin yüksekliÄŸi çok büyük ({{ height }}px). Ä°zin verilen en büyük yükseklik {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Resmin yüksekliÄŸi çok küçük ({{ height }}px). En az {{ min_height }}px olmalıdır. + + + This value should be the user's current password. + Bu deÄŸer kullanıcının ÅŸu anki ÅŸifresi olmalıdır. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Bu deÄŸer tam olarak {{ limit }} karakter olmaldır. + + + The file was only partially uploaded. + Dosya sadece kısmen yüklendi. + + + No file was uploaded. + Hiçbir dosya yüklenmedi. + + + No temporary folder was configured in php.ini. + php.ini içerisinde geçici dizin tanımlanmadı. + + + Cannot write temporary file to disk. + Geçici dosya diske yazılamıyor. + + + A PHP extension caused the upload to fail. + Bir PHP eklentisi dosyanın yüklemesini baÅŸarısız kıldı. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Bu derlem {{ limit }} veya daha çok eleman içermelidir. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Bu derlem {{ limit }} veya daha az eleman içermelidir. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Bu derlem {{ limit }} eleman içermelidir. + + + Invalid card number. + Geçersiz kart numarası. + + + Unsupported card type or invalid card number. + Desteklenmeyen kart tipi veya geçersiz kart numarası. + + + This is not a valid International Bank Account Number (IBAN). + Bu geçerli bir Uluslararası Banka Hesap Numarası (IBAN) deÄŸildir. + + + This value is not a valid ISBN-10. + Bu deÄŸer geçerli bir ISBN-10 deÄŸildir. + + + This value is not a valid ISBN-13. + Bu deÄŸer geçerli bir ISBN-13 deÄŸildir. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Bu deÄŸer geçerli bir ISBN-10 veya ISBN-13 deÄŸildir. + + + This value is not a valid ISSN. + Bu deÄŸer geçerli bir ISSN deÄŸildir. + + + This value is not a valid currency. + Bu deÄŸer geçerli bir para birimi deÄŸil. + + + This value should be equal to {{ compared_value }}. + Bu deÄŸer {{ compared_value }} ile eÅŸit olmalıdır. + + + This value should be greater than {{ compared_value }}. + Bu deÄŸer {{ compared_value }} deÄŸerinden büyük olmalıdır. + + + This value should be greater than or equal to {{ compared_value }}. + Bu deÄŸer {{ compared_value }} ile eÅŸit veya büyük olmalıdır. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Bu deÄŸer {{ compared_value_type }} {{ compared_value }} ile aynı olmalıdır. + + + This value should be less than {{ compared_value }}. + Bu deÄŸer {{ compared_value }} deÄŸerinden düşük olmalıdır. + + + This value should be less than or equal to {{ compared_value }}. + .Bu deÄŸer {{ compared_value }} ile eÅŸit veya düşük olmalıdır. + + + This value should not be equal to {{ compared_value }}. + Bu deÄŸer {{ compared_value }} ile eÅŸit olmamalıdır. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Bu deÄŸer {{ compared_value_type }} {{ compared_value }} ile aynı olmamalıdır. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Resim oranı çok büyük ({{ ratio }}). Ä°zin verilen maksimum oran: {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Resim oranı çok ufak ({{ ratio }}). Beklenen minimum oran {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Resim karesi ({{ width }}x{{ height }}px). Kare resimlerine izin verilmiyor. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Resim manzara odaklı ({{ width }}x{{ height }}px). Manzara odaklı resimlere izin verilmiyor. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Resim portre odaklı ({{ width }}x{{ height }}px). Portre odaklı resimlere izin verilmiyor. + + + An empty file is not allowed. + BoÅŸ bir dosyaya izin verilmiyor. + + + The host could not be resolved. + Sunucu çözülemedi. + + + This value does not match the expected {{ charset }} charset. + Bu deÄŸer beklenen {{ charset }} karakter kümesiyle eÅŸleÅŸmiyor. + + + This is not a valid Business Identifier Code (BIC). + Bu geçerli bir Ä°ÅŸletme Tanımlayıcı Kodu (BIC) deÄŸildir. + + + Error + Hata + + + This is not a valid UUID. + Bu geçerli bir UUID deÄŸildir. + + + This value should be a multiple of {{ compared_value }}. + Bu deÄŸer {{ compare_value }} deÄŸerinin katlarından biri olmalıdır. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Bu Ä°ÅŸletme Tanımlayıcı Kodu (BIC), IBAN {{ iban }} ile iliÅŸkili deÄŸildir. + + + This value should be valid JSON. + Bu deÄŸer için geçerli olmalıdır JSON. + + + This collection should contain only unique elements. + Bu grup yalnızca benzersiz öğeler içermelidir. + + + This value should be positive. + Bu deÄŸer pozitif olmalı. + + + This value should be either positive or zero. + Bu deÄŸer pozitif veya sıfır olmalıdır. + + + This value should be negative. + Bu deÄŸer negatif olmalıdır. + + + This value should be either negative or zero. + Bu deÄŸer, negatif veya sıfır olmalıdır. + + + This value is not a valid timezone. + Bu deÄŸer, geçerli bir saat dilimi deÄŸil. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Bu parola, bir veri ihlali nedeniyle sızdırılmıştır ve kullanılmamalıdır. Lütfen baÅŸka bir ÅŸifre kullanın. + + + This value should be between {{ min }} and {{ max }}. + Bu deÄŸer arasında olmalıdır {{ min }} ve {{ max }}. + + + This value is not a valid hostname. + Bu deÄŸer, geçerli bir ana bilgisayar adı deÄŸil. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Bu gruptaki öğe sayısı birden fazla olmalıdır {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Bu deÄŸer aÅŸağıdaki kısıtlamalardan birini karşılamalıdır: + + + Each element of this collection should satisfy its own set of constraints. + Bu gruptaki her öğe kendi kısıtlamalarını karşılamalıdır. + + + This value is not a valid International Securities Identification Number (ISIN). + Bu deÄŸer geçerli bir Uluslararası Menkul Kıymetler Kimlik Numarası deÄŸil (ISIN). + + + This value should be a valid expression. + Bu deÄŸer geçerli bir ifade olmalıdır. + + + This value is not a valid CSS color. + Bu deÄŸer geçerli bir CSS rengi deÄŸil. + + + This value is not a valid CIDR notation. + Bu deÄŸer geçerli bir CIDR yazımı deÄŸil. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Netmask'in deÄŸeri {{ min }} ve {{ max }} arasında olmaldır. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf new file mode 100644 index 00000000000..c11f851fb02 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути ÐÑ–. + + + This value should be true. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути Так. + + + This value should be of type {{ type }}. + Тип Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½ÐµÐ½ бути {{ type }}. + + + This value should be blank. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути пуÑтим. + + + The value you selected is not a valid choice. + Обране вами Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½ÐµÐ´Ð¾Ð¿ÑƒÑтиме. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Ви повинні обрати хоча б {{ limit }} варіант.|Ви повинні обрати хоча б {{ limit }} варіанти.|Ви повинні обрати хоча б {{ limit }} варіантів. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Ви повинні обрати не більше ніж {{ limit }} варіантів. + + + One or more of the given values is invalid. + Одне або кілька заданих значень Ñ” недопуÑтимі. + + + This field was not expected. + Це поле не очікуєтьÑÑ. + + + This field is missing. + Це поле не виÑтачає. + + + This value is not a valid date. + Дане Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” вірною датою. + + + This value is not a valid datetime. + Дане Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð´Ð°Ñ‚Ð¸ та чаÑу недопуÑтиме. + + + This value is not a valid email address. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð°Ð´Ñ€ÐµÑи Ñлектронної пошти недопуÑтиме. + + + The file could not be found. + Файл не знайдено. + + + The file is not readable. + Файл не читаєтьÑÑ. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Файл занадто великий ({{ size }} {{ suffix }}). Дозволений макÑимальний розмір {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + MIME-тип файлу недопуÑтимий ({{ type }}). ДопуÑтимі MIME-типи файлів {{ types }}. + + + This value should be {{ limit }} or less. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути {{ limit }} або менше. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ довге. Повинно бути рівне {{ limit }} Ñимволу або менше.|Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ довге. Повинно бути рівне {{ limit }} Ñимволам або менше.|Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ довге. Повинно бути рівне {{ limit }} Ñимволам або менше. + + + This value should be {{ limit }} or more. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути {{ limit }} або більше. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ коротке. Повинно бути рівне {{ limit }} Ñимволу або більше.|Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ коротке. Повинно бути рівне {{ limit }} Ñимволам або більше.|Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ коротке. Повинно бути рівне {{ limit }} Ñимволам або більше. + + + This value should not be blank. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ повинно бути пуÑтим. + + + This value should not be null. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ повинно бути null. + + + This value should be null. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути null. + + + This value is not valid. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½ÐµÐ´Ð¾Ð¿ÑƒÑтиме. + + + This value is not a valid time. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ‡Ð°Ñу недопуÑтиме. + + + This value is not a valid URL. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ URL недопуÑтиме. + + + The two values should be equal. + Обидва Ð·Ð°Ð½Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ñ– бути одинаковими. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Файл занадто великий. МакÑимальний допуÑтимий розмір {{ limit }} {{ suffix }}. + + + The file is too large. + Файл занадто великий. + + + The file could not be uploaded. + Файл не можливо завантажити. + + + This value should be a valid number. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути допуÑтимим чиÑлом. + + + This file is not a valid image. + Цей файл не Ñ” допуÑтимим форматом зображеннÑ. + + + This is not a valid IP address. + Це некоректна IP адреÑа. + + + This value is not a valid language. + Це некоректна мова. + + + This value is not a valid locale. + Це некоректна локалізаціÑ. + + + This value is not a valid country. + Це некоректна країна. + + + This value is already used. + Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ð¶Ðµ викориÑтовуєтьÑÑ. + + + The size of the image could not be detected. + Ðе вдалоÑÑ Ð²Ð¸Ð·Ð½Ð°Ñ‡Ð¸Ñ‚Ð¸ розмір зображеннÑ. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Ширина Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ велика ({{ width }}px). МакÑимально допуÑтима ширина {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Ширина Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ мала ({{ width }}px). Мінімально допуÑтима ширина {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + ВиÑота Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ велика ({{ height }}px). МакÑимально допуÑтима виÑота {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + ВиÑота Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ мала ({{ height }}px). Мінімально допуÑтима виÑота {{ min_height }}px. + + + This value should be the user's current password. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути поточним паролем кориÑтувача. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð¸Ð½Ð¾ бути рівним {{ limit }} Ñимволу.|Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð¸Ð½Ð¾ бути рівним {{ limit }} Ñимволам.|Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð¸Ð½Ð¾ бути рівним {{ limit }} Ñимволам. + + + The file was only partially uploaded. + Файл був завантажений лише чаÑтково. + + + No file was uploaded. + Файл не був завантажений. + + + No temporary folder was configured in php.ini. + Ðе налаштована тимчаÑова Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ñ–Ñ Ð² php.ini. + + + Cannot write temporary file to disk. + Ðеможливо запиÑати тимчаÑовий файл на диÑк. + + + A PHP extension caused the upload to fail. + Ð Ð¾Ð·ÑˆÐ¸Ñ€ÐµÐ½Ð½Ñ PHP викликало помилку при завантаженні. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити {{ limit }} елемент чи більше.|Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити {{ limit }} елемента чи більше.|Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити {{ limit }} елементів чи більше. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити {{ limit }} елемент чи менше.|Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити {{ limit }} елемента чи менше.|Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити {{ limit }} елементов чи менше. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити рівно {{ limit }} елемент.|Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити рівно {{ limit }} елемента.|Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° міÑтити рівно {{ limit }} елементів. + + + Invalid card number. + Ðевірний номер карти. + + + Unsupported card type or invalid card number. + Ðепідтримуваний тип карти або невірний номер карти. + + + This is not a valid International Bank Account Number (IBAN). + Це не дійÑний міжнародний номер банківÑького рахунку (IBAN). + + + This value is not a valid ISBN-10. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ у форматі ISBN-10. + + + This value is not a valid ISBN-13. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ у форматі ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ відповідає форматам ISBN-10 та ISBN-13. + + + This value is not a valid ISSN. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” невірний формат ISSN. + + + This value is not a valid currency. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” невірний формат валюти. + + + This value should be equal to {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ дорівнювати {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути більше ніж {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути більше або дорівнювати {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути ідентичним {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути менше ніж {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ бути менше або дорівнювати {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ повинно дорівнювати {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ повинно бути ідентичним {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Ð¡Ð¿Ñ–Ð²Ð²Ñ–Ð´Ð½Ð¾ÑˆÐµÐ½Ð½Ñ Ñторін Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ велике ({{ ratio }}). МакÑимальне ÑÐ¿Ñ–Ð²Ð²Ñ–Ð´Ð½Ð¾ÑˆÐµÐ½Ð½Ñ Ñторін {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Ð¡Ð¿Ñ–Ð²Ð²Ñ–Ð´Ð½Ð¾ÑˆÐµÐ½Ð½Ñ Ñторін Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð·Ð°Ð½Ð°Ð´Ñ‚Ð¾ мало ({{ ratio }}). Мінімальне ÑÐ¿Ñ–Ð²Ð²Ñ–Ð´Ð½Ð¾ÑˆÐµÐ½Ð½Ñ Ñторін {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Ð—Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ðµ ({{ width }}x{{ height }}px). Квадратні Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð½Ðµ дозволені. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Ð—Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð°Ð»ÑŒÐ±Ð¾Ð¼Ð½Ð¾Ñ— орієнтації ({{ width }}x{{ height }}px). Ð—Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð°Ð»ÑŒÐ±Ð¾Ð¼Ð½Ð¾Ñ— орієнтації не дозволені. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Ð—Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð² портретній орієнтації ({{ width }}x{{ height }}px). Ð—Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð½Ñ Ð² портретної орієнтації не дозволені. + + + An empty file is not allowed. + Порожні файли не дозволені. + + + The host could not be resolved. + Ім'Ñ Ñ…Ð¾Ñта не знайдено. + + + This value does not match the expected {{ charset }} charset. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ збігаєтьÑÑ Ð· очікуваним {{ charset }} кодуваннÑм. + + + This is not a valid Business Identifier Code (BIC). + Це не дійÑний банківÑький код (BIC). + + + Error + Помилка + + + This is not a valid UUID. + Це не валідне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ UUID. + + + This value should be a multiple of {{ compared_value }}. + Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ðµ бути кратним {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + БанківÑький код (BIC) не пов’Ñзаний із міжнародним номером банківÑького рахунку (IBAN) {{ iban }}. + + + This value should be valid JSON. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути корректним JSON. + + + This collection should contain only unique elements. + Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° мати тільки унікальни значеннÑ. + + + This value should be positive. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути позитивним. + + + This value should be either positive or zero. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути позитивним або дорівнювати нулю. + + + This value should be negative. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути негативним. + + + This value should be either negative or zero. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути негативним або дорівнювати нулю. + + + This value is not a valid timezone. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним чаÑовим поÑÑом. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Цей пароль був Ñкомпрометований в результаті витоку даних та не повинен викориÑтовуватиÑÑ. Будь лаÑка, викориÑтовуйте інший пароль. + + + This value should be between {{ min }} and {{ max }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути між {{ min }} та {{ max }}. + + + This value is not a valid hostname. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним іменем хоÑта. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + КількіÑÑ‚ÑŒ елементів у цій колекції повинна бути кратною {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ задовольнÑти хоча б одному з наÑтупних обмежень: + + + Each element of this collection should satisfy its own set of constraints. + Кожен елемент цієї колекції повинен задовольнÑти влаÑному набору обмежень. + + + This value is not a valid International Securities Identification Number (ISIN). + Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним міжнародним ідентифікаційним номером цінних паперів (ISIN). + + + This value should be a valid expression. + Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути дійÑним виразом. + + + This value is not a valid CSS color. + Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним CSS кольором. + + + This value is not a valid CIDR notation. + Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑною CIDR нотаціею. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð² мережевій маÑці має бути між {{ min }} та {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf new file mode 100644 index 00000000000..d1ecaf1b70a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Qiymat noto'g'ri bo'lishi kerak. + + + This value should be true. + Qiymat to'g'ri bo'lishi kerak. + + + This value should be of type {{ type }}. + Qiymat turi {{ type }} bo'lishi kerak. + + + This value should be blank. + Qiymat bo'sh bo'lishi kerak. + + + The value you selected is not a valid choice. + Tanlangan qiymat to'g'ri emas. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Siz hech bo'lmaganda {{ limit }} ta qiymat tanlashingiz kerak.|Siz kamida {{ limit }} ta qiymat tanlashingiz kerak. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Siz {{ limit }} ta qiymatni tanlashingiz kerak.|Siz {{ limit }} dan ortiq qiymat tanlashingiz kerak. + + + One or more of the given values is invalid. + Belgilangan qiymatlarning bir yoki bir nechtasi noto'g'ri. + + + This field was not expected. + Ushbu maydon kutilmagan edi. + + + This field is missing. + Bu maydon majvud emas. + + + This value is not a valid date. + Ushbu sana noto'g'ri. + + + This value is not a valid datetime. + Sana va vaqt qiymati noto'g'ri. + + + This value is not a valid email address. + Elektron pochta manzili noto'g'ri. + + + The file could not be found. + Fayl topilmadi. + + + The file is not readable. + Faylni o'qib bo'lmadi. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Fayl hajmi katta ({{ size }} {{ suffix }}). Maksimal ruxsat etilgan hajim {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Faylning MIME turi noto'g'ri ({{ type }}). Ruxsat etilgan MIME turlar {{ types }}. + + + This value should be {{ limit }} or less. + Qiymat {{ limit }} ga teng yoki kam bo'lishi kerak. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Qiymat juda uzun. {{ limit }} ga teng yoki kam bo'lishi kerak.|Qiymat juda uzun. {{ limit }} yoki undan kam belgidan iborat bo'lishi kerak. + + + This value should be {{ limit }} or more. + Qiymat {{ limit }} yoki undan ortiq bo'lishi kerak. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Qiymat juda qisqa. {{ limit }} ta yoki undan ortiq belgidan iborat bo'lishi kerak.|Qiymat juda qisqa. {{ limit }} yoki undan ko'p belgidan iborat bo'lishi kerak + + + This value should not be blank. + Qiymatni bo'sh kirtish mumkin emas. + + + This value should not be null. + Qiymat null bo'lmasligi kerak. + + + This value should be null. + Qiymat null bo'lishi kerak. + + + This value is not valid. + Qiymat noto'g'ri. + + + This value is not a valid time. + Vaqt noto'g'ri. + + + This value is not a valid URL. + URL noto'g'ri + + + The two values should be equal. + Ikkala qiymat ham bir xil bo'lishi kerak. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Fayl hajmi katta. Maksimal ruxsat berilgan hajim {{ limit }} {{ suffix }}. + + + The file is too large. + Fayl hajmi katta. + + + The file could not be uploaded. + Faylni yuklab bo'lmadi. + + + This value should be a valid number. + Qiymat raqam bo'lishi kerak. + + + This file is not a valid image. + Fayl yaroqli rasm formati emas. + + + This is not a valid IP address. + Ip manzil noto'g'ri. + + + This value is not a valid language. + Noto'g'ri til. + + + This value is not a valid locale. + Ushbu qiymat mahalliy qiymat emas. + + + This value is not a valid country. + Mamlakat qiymati noto'g'ri. + + + This value is already used. + Ushbu qiymat allaqachon ishlatilgan. + + + The size of the image could not be detected. + Rasm o'lchamini aniqlab bo'lmadi. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Rasm kengligi juda katta ({{ width }}px). Maksimal ruxsat etilgan kenglik {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Rasm kengligi juda kichkina ({{ width }}px). Minimal ruxsat etilgan kenglik {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Rasm bo'yi juda katta ({{ height }}px). Maksimal ruxsat etilgan balandlik {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Rasm bo'yi juda kichkina ({{ height }}px). Minimal ruxsat etilgan balandlik {{ min_height }}px. + + + This value should be the user's current password. + Qiymat joriy foydalanuvchi paroli bo'lishi kerak. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Qiymat {{ limit }} ta belgidan iborat bo'lishi kerak.|Qiymat {{ limit }} belgidan iborat bo'lishi kerak. + + + The file was only partially uploaded. + Fayl faqat qisman yuklangan. + + + No file was uploaded. + Fayl yuklanmagan. + + + No temporary folder was configured in php.ini. + php.ini da vaqtinchalik katalog sozlanmagan. + + + Cannot write temporary file to disk. + Diskka vaqtinchalik faylni yozib bo'lmadi. + + + A PHP extension caused the upload to fail. + PHP kengaytmasi yuklash paytida xatolik yuz berdi. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Ushbu to'plam {{ limit }} ta yoki undan ko'p narsalarni o'z ichiga olishi kerak.|Ushbu to'plam {{ limit }} yoki undan ortiq narsalarni o'z ichiga olishi kerak. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Ushbu to'plam {{ limit }} ta yoki undan kam narsalarni o'z ichiga olishi kerak.|Ushbu to'plamda {{ limit }} yoki undan kam element bo'lishi kerak. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Ushbu to'plam to'liq {{ limit }} narsani o'z ichiga olishi kerak.|Ushbu to'plamda to'liq {{ limit }} ta ma'lumotlar bo'lishi kerak. + + + Invalid card number. + Kata raqami noto'g'ri. + + + Unsupported card type or invalid card number. + Qo'llab-quvvatlanmaydigan karta turi yoki yaroqsiz karta raqami. + + + This is not a valid International Bank Account Number (IBAN). + Qiymat haqiqiy xalqaro hisob raqamining raqami (IBAN) emas. + + + This value is not a valid ISBN-10. + Qiymat to'g'ri ISBN-10 formatida emas. + + + This value is not a valid ISBN-13. + Qiymat to'g'ri ISBN-13 formatida emas. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Qiymat ISBN-10 va ISBN-13 formatlariga mos kelmaydi. + + + This value is not a valid ISSN. + Qiymat ISSN formatiga mos kelmaydi. + + + This value is not a valid currency. + Noto'g'ri valyuta formati. + + + This value should be equal to {{ compared_value }}. + Qiymat {{ compared_value }} ga teng bo'lishi shart. + + + This value should be greater than {{ compared_value }}. + Qiymat {{ compared_value }} dan katta bo'lishi shart. + + + This value should be greater than or equal to {{ compared_value }}. + Qiymat {{ compared_value }} dan katta yoki teng bo'lishi shart. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Значение должно быть идентичным {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Qiymat bir xil bo'lishi kerak {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Qiymat {{ compared_value }} dan kichik yoki teng bo'lishi shart. + + + This value should not be equal to {{ compared_value }}. + Qiymat {{ compared_value }} ga teng bo'lmasligi kerak. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Qiymat bir xil bo'lishi kerak emas {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Rasmning tomonlari nisbati juda katta ({{ ratio }}). Maksimal tomonlar nisbati {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Rasmning format nisbati juda kichik ({{ ratio }}). Minimal tomonlar nisbati {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Rasm kvadrat shaklida ({{ width }}x{{ height }}px). Kvadrat shaklida tasvirlarga ruxsat berilmaydi. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Landshaft tasvir ({{ width }}x{{ height }}px). Landshaft rasmlarga ruxsat berilmaydi. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Portret rasm ({{ width }}x{{ height }}px). Portretlarga ruxsat berilmaydi. + + + An empty file is not allowed. + Bo'sh fayllarga ruxsat berilmagan. + + + The host could not be resolved. + Xost nomini nomiga ruxsat berilmagan. + + + This value does not match the expected {{ charset }} charset. + Qiymat kutilgan {{ charset }} kodlashiga mos kelmaydi. + + + This is not a valid Business Identifier Code (BIC). + Qiymat BIC formatida emas. + + + Error + Xatolik + + + This is not a valid UUID. + Qiymat UUID formatida emas. + + + This value should be a multiple of {{ compared_value }}. + Qiymat {{ compared_value }} ning ko'paytmasi bo'lishi kerak. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ushbu BIC IBAN {{ iban }} bilan bog'liq emas.. + + + This value should be valid JSON. + Qiymat to'g'ri JSON bo'lishi kerak. + + + This collection should contain only unique elements. + Ushbu kolleksiyada takroriy elementlar bo'lmasligi kerak. + + + This value should be positive. + Qiymat musbat bo'lishi kerak. + + + This value should be either positive or zero. + Qiymat musbat yoki 0 ga teng bo'lishi kerak. + + + This value should be negative. + Qiymat manfiy bo'lishi kerak. + + + This value should be either negative or zero. + Qiymat manfiy yoki 0 ga teng bo'lishi kerak. + + + This value is not a valid timezone. + Qiymat to'g'ri vaqt zonasi emas. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ushbu parol ma'lumotlarning tarqalishi tufayli buzilgan va uni ishlatmaslik kerak. Boshqa paroldan foydalaning. + + + This value should be between {{ min }} and {{ max }}. + Qiymat {{ min }} va {{ max }} oralig'ida bo'lishi shart. + + + This value is not a valid hostname. + Qiymat to'g'ri xost nomi emas. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Ushbu to'plamdagi narsalar soni {{ compared_value }} dan ko'p bo'lishi kerak. + + + This value should satisfy at least one of the following constraints: + Qiymat quyidagi cheklovlardan kamida bittasiga javob berishi kerak: + + + Each element of this collection should satisfy its own set of constraints. + Ushbu to'plamdagi har bir narsa o'ziga xos cheklovlarni qondirishi kerak. + + + This value is not a valid International Securities Identification Number (ISIN). + Qiymat Qimmatli qog'ozlarning xalqaro identifikatsiya raqami (ISIN) ga mos emas. + + + This value should be a valid expression. + Ushbu qiymat to'g'ri ifoda bo'lishi kerak. + + + This value is not a valid CSS color. + Bu qiymat haqiqiy CSS rangi emas. + + + This value is not a valid CIDR notation. + Qiymat CIDR belgisiga mos kelmaydi. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Tarmoq niqobining qiymati {{ min }} va {{ max }} oralig'ida bo'lishi kerak. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf new file mode 100644 index 00000000000..00201792253 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + Giá trị này phải là sai. + + + This value should be true. + Giá trị này phải là đúng. + + + This value should be of type {{ type }}. + Giá trị này phải là kiểu {{ type }}. + + + This value should be blank. + Giá trị này phải rá»—ng. + + + The value you selected is not a valid choice. + Giá trị bạn vừa chá»n không hợp lệ. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Bạn phải chá»n ít nhất {{ limit }} lá»±a chá»n.|Bạn phải chá»n ít nhất {{ limit }} lá»±a chá»n. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Bạn phải chá»n nhiá»u nhất {{ limit }} lá»±a chá»n.|Bạn phải chá»n nhiá»u nhất {{ limit }} lá»±a chá»n. + + + One or more of the given values is invalid. + Má»™t hoặc nhiá»u giá trị được chá»n không hợp lệ. + + + This field was not expected. + LÄ©nh vá»±c này không được dá»± kiến. + + + This field is missing. + LÄ©nh vá»±c này bị thiếu. + + + This value is not a valid date. + Giá trị không phải là ngày hợp lệ. + + + This value is not a valid datetime. + Giá trị không phải là ngày tháng hợp lệ. + + + This value is not a valid email address. + Giá trị này không phải là email hợp lệ. + + + The file could not be found. + Tập tin không tìm thấy. + + + The file is not readable. + Tập tin không thể Ä‘á»c được. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Tập tin quá lá»›n ({{ size }} {{ suffix }}). Kích thÆ°á»›c tối Ä‘a cho phép {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Kiểu mime của tập tin không hợp lệ ({{ type }}). Kiểu hợp lệ là {{ types }}. + + + This value should be {{ limit }} or less. + Giá trị phải bằng hoặc nhá» hÆ¡n {{ limit }}. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Giá trị quá dài. Phải bằng hoặc ít hÆ¡n {{ limit }} kí tá»±.|Giá trị quá dài. Phải bằng hoặc ít hÆ¡n {{ limit }} kí tá»±. + + + This value should be {{ limit }} or more. + Giá trị phải lá»›n hÆ¡n hoặc bằng {{ limit }}. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Giá trị quá ngắn. Phải hÆ¡n hoặc bằng {{ limit }} kí tá»±.|Giá trị quá ngắn. Phải hÆ¡n hoặc bằng {{ limit }} kí tá»±. + + + This value should not be blank. + Giá trị không được phép để trống. + + + This value should not be null. + Giá trị không được phép rá»—ng. + + + This value should be null. + Giá trị phải rá»—ng. + + + This value is not valid. + Giá trị không hợp lệ. + + + This value is not a valid time. + Giá trị không phải là thá»i gian hợp lệ. + + + This value is not a valid URL. + Giá trị không phải là địa chỉ URL hợp lệ. + + + The two values should be equal. + Hai giá trị phải bằng nhau. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Tập tin quá lá»›n. Kích thÆ°á»›c tối Ä‘a cho phép là {{ limit }} {{ suffix }}. + + + The file is too large. + Tập tin quá lá»›n. + + + The file could not be uploaded. + Tập tin không thể tải lên. + + + This value should be a valid number. + Giá trị phải là con số. + + + This file is not a valid image. + Tập tin không phải là hình ảnh hợp lệ. + + + This is not a valid IP address. + Äịa chỉ IP không hợp lệ. + + + This value is not a valid language. + Giá trị không phải là ngôn ngữ hợp lệ. + + + This value is not a valid locale. + Giá trị không phải là má»™t bản địa địa phÆ°Æ¡ng hợp lệ. + + + This value is not a valid country. + Giá trị không phải là quốc gia hợp lệ. + + + This value is already used. + Giá trị đã được sá»­ dụng. + + + The size of the image could not be detected. + Kích thÆ°á»›c của hình ảnh không thể xác định. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + Chiá»u rá»™ng của hình quá lá»›n ({{ width }}px). Chiá»u rá»™ng tối Ä‘a phải là {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + Chiá»u rá»™ng của hình quá thấp ({{ width }}px). Chiá»u rá»™ng tối thiểu phải là {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + Chiá»u cao của hình quá cao ({{ height }}px). Chiá»u cao tối Ä‘a phải là {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + Chiá»u cao của hình quá thấp ({{ height }}px). Chiá»u cao tối thiểu phải là {{ min_height }}px. + + + This value should be the user's current password. + Giá trị này phải là mật khẩu hiện tại của ngÆ°á»i dùng. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Giá trị này phải có chính xác {{ limit }} kí tá»±.|Giá trị này phải có chính xác {{ limit }} kí tá»±. + + + The file was only partially uploaded. + Tập tin chỉ được tải lên má»™t phần. + + + No file was uploaded. + Tập tin không được tải lên. + + + No temporary folder was configured in php.ini. + ThÆ° mục tạm không được định nghÄ©a trong php.ini. + + + Cannot write temporary file to disk. + Không thể ghi tập tin tạm ra Ä‘Ä©a. + + + A PHP extension caused the upload to fail. + Má»™t PHP extension đã phá há»ng quá trình tải lên của tập tin. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Danh sách phải chứa {{ limit }} thành phần hoặc nhiá»u hÆ¡n.|Danh sách phải chứa {{ limit }} thành phần hoặc nhiá»u hÆ¡n. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Danh sách phải chứa {{ limit }} thành phần hoặc ít hÆ¡n.|Danh sách phải chứa {{ limit }} thành phần hoặc ít hÆ¡n. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Danh sách phải chứa chính xác {{ limit }} thành phần.|Danh sách phải chứa chính xác {{ limit }} thành phần. + + + Invalid card number. + Số thẻ không hợp lệ. + + + Unsupported card type or invalid card number. + Thẻ không được há»— trợ hoặc số thẻ không hợp lệ. + + + This is not a valid International Bank Account Number (IBAN). + Giá trị không phải là International Bank Account Number (IBAN) hợp lệ. + + + This value is not a valid ISBN-10. + Giá trị không phải là ISBN-10 hợp lệ. + + + This value is not a valid ISBN-13. + Giá trị không phải là ISBN-13 hợp lệ. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Giá trị không phải là ISBN-10 hoặc ISBN-13 hợp lệ. + + + This value is not a valid ISSN. + Giá trị không phải là ISSN hợp lệ. + + + This value is not a valid currency. + Giá trị không phải là Ä‘Æ¡n vị tiá»n tệ hợp lệ. + + + This value should be equal to {{ compared_value }}. + Giá trị phải bằng {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Giá trị phải lá»›n hÆ¡n {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Giá trị phải lá»›n hÆ¡n hoặc bằng {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Giá trị phải giống {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Giá trị phải bé hÆ¡n {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Giá trị phải nhá» hÆ¡n hoặc bằng {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Giá trị không được phép bằng {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Giá trị không được phép giống nhÆ° {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Tá»· lệ bức ảnh quá lá»›n ({{ ratio }}). Tá»· lệ tối Ä‘a cho phép là {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Tá»· lệ bức ảnh quá nhá» ({{ ratio }}). Tá»· lệ tối thiểu mong muốn là {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Bức ảnh là hình vuông ({{ width }}x{{ height }}px). Ảnh hình vuông không được phép. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Bức ảnh theo chiá»u ngang ({{ width }}x{{ height }}px). Ảnh chiá»u ngang không được phép. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Bức ảnh theo chiá»u dá»c ({{ width }}x{{ height }}px). Ảnh chiá»u dá»c không được phép. + + + An empty file is not allowed. + Má»™t file rá»—ng không được phép. + + + The host could not be resolved. + Máy chủ không thể được tìm thấy. + + + This value does not match the expected {{ charset }} charset. + Giá trị này không đúng định dạng bá»™ ký tá»± mong muốn {{ charset }}. + + + This is not a valid Business Identifier Code (BIC). + Giá trị này không đúng định dạng mã định danh doanh nghiệp (BIC). + + + Error + Lá»—i + + + This is not a valid UUID. + Giá trị này không đúng định dạng UUID. + + + This value should be a multiple of {{ compared_value }}. + Giá trị này nên là bá»™i số của {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Mã định danh doanh nghiệp (BIC) này không liên kết vá»›i IBAN {{ iban }}. + + + This value should be valid JSON. + Giá trị này nên đúng định dạng JSON. + + + This collection should contain only unique elements. + Danh sách này chỉ nên chứa các phần tá»­ khác nhau. + + + This value should be positive. + Giá trị này có thể thá»±c hiện được. + + + This value should be either positive or zero. + Giá trị này có thể thá»±c hiện được hoặc bằng không. + + + This value should be negative. + Giá trị này nên bị từ chối. + + + This value should be either negative or zero. + Giá trị này nên bị từ chối hoặc bằng không. + + + This value is not a valid timezone. + Giá trị này không phải là múi giá» hợp lệ. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Mật khẩu này đã bị rò rỉ dữ liệu, không được sá»­ dụng nữa. Xin vui lòng sá»­ dụng mật khẩu khác. + + + This value should be between {{ min }} and {{ max }}. + Giá trị này nên thuá»™c giữa {{ min }} và {{ max }}. + + + This value is not a valid hostname. + Giá trị này không phải là tên máy chủ hợp lệ. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Số lượng các phần tá»­ trong bá»™ sÆ°u tập này nên là bá»™i số của {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Giá trị này nên thá»a mãn ít nhất má»™t trong những ràng buá»™c sau: + + + Each element of this collection should satisfy its own set of constraints. + Má»—i phần tá»­ trong bá»™ sÆ°u tập này nên thá»a mãn những ràng buá»™c của nó. + + + This value is not a valid International Securities Identification Number (ISIN). + Giá trị này không phải là mã số chứng khoán quốc tế (ISIN) hÆ¡Ì£p lệ. + + + This value should be a valid expression. + Giá trị này phải là má»™t biểu thức hợp lệ. + + + This value is not a valid CSS color. + Giá trị này không phải là màu CSS hợp lệ. + + + This value is not a valid CIDR notation. + Giá trị này không phải là ký hiệu CIDR hợp lệ. + + + The value of the netmask should be between {{ min }} and {{ max }}. + Giá trị của mặt nạ mạng phải nằm trong khoảng từ {{ min }} đến {{ max }}. + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf new file mode 100644 index 00000000000..a7d49ba98d3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + 该å˜é‡çš„值应为 false 。 + + + This value should be true. + 该å˜é‡çš„值应为 true 。 + + + This value should be of type {{ type }}. + 该å˜é‡çš„类型应为 {{ type }} 。 + + + This value should be blank. + 该å˜é‡å€¼åº”为空。 + + + The value you selected is not a valid choice. + 选定å˜é‡çš„值ä¸æ˜¯æœ‰æ•ˆçš„选项。 + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + 您至少è¦é€‰æ‹© {{ limit }} 个选项。 + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + 您最多能选择 {{ limit }} 个选项。 + + + One or more of the given values is invalid. + 一个或者多个给定的值无效。 + + + This field was not expected. + 此字段是多余的。 + + + This field is missing. + 此字段缺失。 + + + This value is not a valid date. + 该值ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„日期(date)。 + + + This value is not a valid datetime. + 该值ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„日期时间(datetime)。 + + + This value is not a valid email address. + 该值ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„邮件地å€ã€‚ + + + The file could not be found. + 文件未找到。 + + + The file is not readable. + 文件ä¸å¯è¯»ã€‚ + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + 文件太大 ({{ size }} {{ suffix }})。文件大å°ä¸å¯ä»¥è¶…过 {{ limit }} {{ suffix }} 。 + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + 无效的文件类型 ({{ type }}) 。å…许的文件类型有 {{ types }} 。 + + + This value should be {{ limit }} or less. + 这个å˜é‡çš„值应该å°äºŽæˆ–等于 {{ limit }}。 + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + 字符串太长,长度ä¸å¯è¶…过 {{ limit }} 个字符。 + + + This value should be {{ limit }} or more. + 该å˜é‡çš„值应该大于或等于 {{ limit }}。 + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + 字符串太短,长度ä¸å¯å°‘于 {{ limit }} 个字符。 + + + This value should not be blank. + 该å˜é‡ä¸åº”为空。 + + + This value should not be null. + 该å˜é‡ä¸åº”为 null 。 + + + This value should be null. + 该å˜é‡åº”为空 null 。 + + + This value is not valid. + 该å˜é‡å€¼æ— æ•ˆ 。 + + + This value is not a valid time. + 该值ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„时间。 + + + This value is not a valid URL. + 该值ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„ URL 。 + + + The two values should be equal. + 这两个å˜é‡çš„值应该相等。 + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + 文件太大,文件大å°ä¸å¯ä»¥è¶…过 {{ limit }} {{ suffix }}。 + + + The file is too large. + 文件太大。 + + + The file could not be uploaded. + 无法上传此文件。 + + + This value should be a valid number. + 该值应该为有效的数字。 + + + This file is not a valid image. + 该文件ä¸æ˜¯æœ‰æ•ˆçš„图片。 + + + This is not a valid IP address. + 该值ä¸æ˜¯æœ‰æ•ˆçš„IP地å€ã€‚ + + + This value is not a valid language. + 该值ä¸æ˜¯æœ‰æ•ˆçš„语言å。 + + + This value is not a valid locale. + 该值ä¸æ˜¯æœ‰æ•ˆçš„区域值(locale)。 + + + This value is not a valid country. + 该值ä¸æ˜¯æœ‰æ•ˆçš„国家å。 + + + This value is already used. + 该值已ç»è¢«ä½¿ç”¨ã€‚ + + + The size of the image could not be detected. + ä¸èƒ½è§£æžå›¾ç‰‡å¤§å°ã€‚ + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + 图片太宽 ({{ width }}px),最大宽度为 {{ max_width }}px 。 + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + 图片宽度ä¸å¤Ÿ ({{ width }}px),最å°å®½åº¦ä¸º {{ min_width }}px 。 + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + 图片太高 ({{ height }}px),最大高度为 {{ max_height }}px 。 + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + 图片高度ä¸å¤Ÿ ({{ height }}px),最å°é«˜åº¦ä¸º {{ min_height }}px 。 + + + This value should be the user's current password. + 该å˜é‡çš„值应为用户当å‰çš„密ç ã€‚ + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + 该å˜é‡åº”为 {{ limit }} 个字符。 + + + The file was only partially uploaded. + 该文件的上传ä¸å®Œæ•´ã€‚ + + + No file was uploaded. + 没有上传任何文件。 + + + No temporary folder was configured in php.ini. + php.ini 里没有é…置临时文件目录。 + + + Cannot write temporary file to disk. + 临时文件写入ç£ç›˜å¤±è´¥ã€‚ + + + A PHP extension caused the upload to fail. + æŸä¸ª PHP 扩展造æˆä¸Šä¼ å¤±è´¥ã€‚ + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + 该集åˆæœ€å°‘åº”åŒ…å« {{ limit }} 个元素。 + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + 该集åˆæœ€å¤šåŒ…å« {{ limit }} 个元素。 + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + 该集åˆåº”åŒ…å« {{ limit }} 个元素 element 。 + + + Invalid card number. + 无效的信用å¡å·ã€‚ + + + Unsupported card type or invalid card number. + ä¸æ”¯æŒçš„信用å¡ç±»åž‹æˆ–无效的信用å¡å·ã€‚ + + + This is not a valid International Bank Account Number (IBAN). + 该值ä¸æ˜¯æœ‰æ•ˆçš„国际银行å¸å·ï¼ˆIBAN)。 + + + This value is not a valid ISBN-10. + 该值ä¸æ˜¯æœ‰æ•ˆçš„10ä½å›½é™…标准书å·ï¼ˆISBN-10)。 + + + This value is not a valid ISBN-13. + 该值ä¸æ˜¯æœ‰æ•ˆçš„13ä½å›½é™…标准书å·ï¼ˆISBN-13)。 + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + 该值ä¸æ˜¯æœ‰æ•ˆçš„国际标准书å·ï¼ˆISBN-10 或 ISBN-13)。 + + + This value is not a valid ISSN. + 该值ä¸æ˜¯æœ‰æ•ˆçš„国际标准期刊å·ï¼ˆISSN)。 + + + This value is not a valid currency. + 该值ä¸æ˜¯æœ‰æ•ˆçš„è´§å¸å(currency)。 + + + This value should be equal to {{ compared_value }}. + 该值应等于 {{ compared_value }} 。 + + + This value should be greater than {{ compared_value }}. + 该值应大于 {{ compared_value }} 。 + + + This value should be greater than or equal to {{ compared_value }}. + 该值应大于或等于 {{ compared_value }} 。 + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + 该值应与 {{ compared_value_type }} {{ compared_value }} 相åŒã€‚ + + + This value should be less than {{ compared_value }}. + 该值应å°äºŽ {{ compared_value }} 。 + + + This value should be less than or equal to {{ compared_value }}. + 该值应å°äºŽæˆ–等于 {{ compared_value }} 。 + + + This value should not be equal to {{ compared_value }}. + 该值ä¸åº”先等于 {{ compared_value }} 。 + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + 该值ä¸åº”与 {{ compared_value_type }} {{ compared_value }} 相åŒã€‚ + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + 图片宽高比太大 ({{ ratio }})。å…许的最大宽高比为 {{ max_ratio }}。 + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + å›¾ç‰‡å®½é«˜æ¯”å¤ªå° ({{ ratio }})。å…许的最大宽高比为 {{ min_ratio }}。 + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + 图片是方形的 ({{ width }}x{{ height }}px)。ä¸å…许使用方形的图片。 + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + 图片是横å‘çš„ ({{ width }}x{{ height }}px)。ä¸å…许使用横å‘的图片。 + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + 图片是纵å‘çš„ ({{ width }}x{{ height }}px)。ä¸å…许使用纵å‘的图片。 + + + An empty file is not allowed. + ä¸å…许使用空文件。 + + + The host could not be resolved. + 主机å无法解æžã€‚ + + + This value does not match the expected {{ charset }} charset. + 该值ä¸ç¬¦åˆ {{ charset }} ç¼–ç ã€‚ + + + This is not a valid Business Identifier Code (BIC). + è¿™ä¸æ˜¯æœ‰æ•ˆçš„业务标识符代ç ï¼ˆBIC)。 + + + Error + 错误 + + + This is not a valid UUID. + è¿™ä¸æ˜¯æœ‰æ•ˆçš„UUID。 + + + This value should be a multiple of {{ compared_value }}. + 此值应为 {{ compared_value }} çš„å€æ•°ã€‚ + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + 此业务标识符代ç ï¼ˆBIC)与IBAN {{ iban }} 无关。 + + + This value should be valid JSON. + 该值应该是有效的JSON。 + + + This collection should contain only unique elements. + 该集åˆåº”仅包å«ç‹¬ä¸€æ— äºŒçš„元素。 + + + This value should be positive. + 数值应为正数。 + + + This value should be either positive or zero. + 数值应是正数,或为零。 + + + This value should be negative. + 数值应为负数。 + + + This value should be either negative or zero. + 数值应是负数,或为零。 + + + This value is not a valid timezone. + 无效时区。 + + + This password has been leaked in a data breach, it must not be used. Please use another password. + 此密ç å·²è¢«æ³„露,切勿使用。请更æ¢å¯†ç ã€‚ + + + This value should be between {{ min }} and {{ max }}. + 该数值应在 {{ min }} å’Œ {{ max }} 之间。 + + + This value is not a valid hostname. + 该值ä¸æ˜¯æœ‰æ•ˆçš„主机å称。 + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + 该集åˆå†…的元素数é‡å¾—是 {{ compared_value }} çš„å€æ•°ã€‚ + + + This value should satisfy at least one of the following constraints: + 该值需符åˆä»¥ä¸‹å…¶ä¸­ä¸€ä¸ªçº¦æŸï¼š + + + Each element of this collection should satisfy its own set of constraints. + 该集åˆå†…çš„æ¯ä¸ªå…ƒç´ éœ€ç¬¦åˆå…ƒç´ æœ¬èº«è§„定的约æŸã€‚ + + + This value is not a valid International Securities Identification Number (ISIN). + 该值ä¸æ˜¯æœ‰æ•ˆçš„国际è¯åˆ¸è¯†åˆ«ç  (ISIN)。 + + + This value should be a valid expression. + 该值需为一个有效的表达å¼ã€‚ + + + This value is not a valid CSS color. + 该值ä¸æ˜¯æœ‰æ•ˆçš„CSS颜色。 + + + This value is not a valid CIDR notation. + 该值ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„CIDR表示。 + + + The value of the netmask should be between {{ min }} and {{ max }}. + 网络掩ç çš„值应当在 {{ min }} å’Œ {{ max }} 之间。 + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf new file mode 100644 index 00000000000..b1f7fb4a715 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf @@ -0,0 +1,407 @@ + + + + + + This value should be false. + 該變數的值應為 false 。 + + + This value should be true. + 該變數的值應為 true 。 + + + This value should be of type {{ type }}. + 該變數的類型應為 {{ type }} 。 + + + This value should be blank. + 該變數應為空。 + + + The value you selected is not a valid choice. + é¸å®šè®Šæ•¸çš„值ä¸æ˜¯æœ‰æ•ˆçš„é¸é …。 + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + 您至少è¦é¸æ“‡ {{ limit }} 個é¸é …。 + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + 您最多能é¸æ“‡ {{ limit }} 個é¸é …。 + + + One or more of the given values is invalid. + 一個或者多個給定的值無效。 + + + This field was not expected. + 此字段是沒有é æ–™åˆ°ã€‚ + + + This field is missing. + 此字段缺失。 + + + This value is not a valid date. + 該值ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„日期(date)。 + + + This value is not a valid datetime. + 該值ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„日期時間(datetime)。 + + + This value is not a valid email address. + 該值ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„郵件地å€ã€‚ + + + The file could not be found. + 找ä¸åˆ°æª”案。 + + + The file is not readable. + 無法讀å–檔案。 + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + 檔案太大 ({{ size }} {{ suffix }})。檔案大å°ä¸å¯ä»¥è¶…éŽ {{ limit }} {{ suffix }} 。 + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + 無效的檔案類型 ({{ type }}) 。å…許的檔案類型有 {{ types }} 。 + + + This value should be {{ limit }} or less. + 這個變數的值應該å°æ–¼æˆ–等於 {{ limit }}。 + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + 字串太長,長度ä¸å¯è¶…éŽ {{ limit }} 個字元。 + + + This value should be {{ limit }} or more. + 該變數的值應該大於或等於 {{ limit }}。 + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + 字串太短,長度ä¸å¯å°‘æ–¼ {{ limit }} 個字元。 + + + This value should not be blank. + 該變數ä¸æ‡‰ç‚ºç©ºç™½ã€‚ + + + This value should not be null. + 該值ä¸æ‡‰ç‚º null 。 + + + This value should be null. + 該值應為 null 。 + + + This value is not valid. + 無效的數值 。 + + + This value is not a valid time. + 該值ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„時間。 + + + This value is not a valid URL. + 該值ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„ URL 。 + + + The two values should be equal. + 這兩個變數的值應該相等。 + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + 檔案太大,檔案大å°ä¸å¯ä»¥è¶…éŽ {{ limit }} {{ suffix }}。 + + + The file is too large. + 檔案太大。 + + + The file could not be uploaded. + 無法上傳此檔案。 + + + This value should be a valid number. + 該值應該為有效的數字。 + + + This file is not a valid image. + 該檔案ä¸æ˜¯æœ‰æ•ˆçš„圖片。 + + + This is not a valid IP address. + 該值ä¸æ˜¯æœ‰æ•ˆçš„IP地å€ã€‚ + + + This value is not a valid language. + 該值ä¸æ˜¯æœ‰æ•ˆçš„語言å。 + + + This value is not a valid locale. + 該值ä¸æ˜¯æœ‰æ•ˆçš„å€åŸŸå€¼ï¼ˆlocale)。 + + + This value is not a valid country. + 該值ä¸æ˜¯æœ‰æ•ˆçš„國家å。 + + + This value is already used. + 該值已經被使用。 + + + The size of the image could not be detected. + ä¸èƒ½è§£æžåœ–片大å°ã€‚ + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + 圖片太寬 ({{ width }}px),最大寬度為 {{ max_width }}px 。 + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + 圖片寬度ä¸å¤  ({{ width }}px),最å°å¯¬åº¦ç‚º {{ min_width }}px 。 + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + 圖片太高 ({{ height }}px),最大高度為 {{ max_height }}px 。 + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + 圖片高度ä¸å¤  ({{ height }}px),最å°é«˜åº¦ç‚º {{ min_height }}px 。 + + + This value should be the user's current password. + 該變數的值應為用戶目å‰çš„密碼。 + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + 該變數應為 {{ limit }} 個字元。 + + + The file was only partially uploaded. + 該檔案的上傳ä¸å®Œæ•´ã€‚ + + + No file was uploaded. + 沒有上傳任何檔案。 + + + No temporary folder was configured in php.ini. + php.ini 裡沒有é…置臨時目錄。 + + + Cannot write temporary file to disk. + 暫存檔寫入ç£ç¢Ÿå¤±æ•—。 + + + A PHP extension caused the upload to fail. + æŸå€‹ PHP 擴展造æˆä¸Šå‚³å¤±æ•—。 + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + 該集åˆæœ€å°‘æ‡‰åŒ…å« {{ limit }} 個元素。 + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + 該集åˆæœ€å¤šåŒ…å« {{ limit }} 個元素。 + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + 該集åˆæ‡‰åŒ…å« {{ limit }} 個元素 element 。 + + + Invalid card number. + 無效的信用å¡è™Ÿã€‚ + + + Unsupported card type or invalid card number. + ä¸æ”¯æ´çš„信用å¡é¡žåž‹æˆ–無效的信用å¡è™Ÿã€‚ + + + This is not a valid International Bank Account Number (IBAN). + 該值ä¸æ˜¯æœ‰æ•ˆçš„國際銀行帳號(IBAN)。 + + + This value is not a valid ISBN-10. + 該值ä¸æ˜¯æœ‰æ•ˆçš„10ä½åœ‹éš›æ¨™æº–書號(ISBN-10)。 + + + This value is not a valid ISBN-13. + 該值ä¸æ˜¯æœ‰æ•ˆçš„13ä½åœ‹éš›æ¨™æº–書號(ISBN-13)。 + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + 該值ä¸æ˜¯æœ‰æ•ˆçš„國際標準書號(ISBN-10 或 ISBN-13)。 + + + This value is not a valid ISSN. + 該值ä¸æ˜¯æœ‰æ•ˆçš„國際標準期刊號(ISSN)。 + + + This value is not a valid currency. + 該值ä¸æ˜¯æœ‰æ•ˆçš„貨幣å(currency)。 + + + This value should be equal to {{ compared_value }}. + 該值應等於 {{ compared_value }} 。 + + + This value should be greater than {{ compared_value }}. + 該值應大於 {{ compared_value }} 。 + + + This value should be greater than or equal to {{ compared_value }}. + 該值應大於或等於 {{ compared_value }} 。 + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + 該值應與 {{ compared_value_type }} {{ compared_value }} 相åŒã€‚ + + + This value should be less than {{ compared_value }}. + 該值應å°æ–¼ {{ compared_value }} 。 + + + This value should be less than or equal to {{ compared_value }}. + 該值應å°æ–¼æˆ–等於 {{ compared_value }} 。 + + + This value should not be equal to {{ compared_value }}. + 該值應ä¸ç­‰æ–¼ {{ compared_value }} 。 + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + 該值ä¸æ‡‰èˆ‡ {{ compared_value_type }} {{ compared_value }} 相åŒã€‚ + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + 圖åƒæ ¼å¼éŽå¤§ ({{ ratio }})。 最大å…許尺寸 {{ max_ratio }}。 + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + 圖åƒæ ¼å¼éŽå° ({{ ratio }})。最å°å°ºå¯¸ {{ min_ratio }}。 + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + æ–¹å½¢åœ–åƒ ({{ width }}x{{ height }}px)。ä¸æŽ¥å—方形圖åƒã€‚ + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + ç´€å¿µå†Šå¸ƒå±€åœ–åƒ ({{ width }}x{{ height }}px)。 ä¸æŽ¥å—紀念冊布局圖åƒã€‚ + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + 書ç±å¸ƒå±€åœ–åƒ ({{ width }}x{{ height }}px)。ä¸æŽ¥å—圖åƒæ›¸ç±å¸ƒå±€ã€‚ + + + An empty file is not allowed. + ä¸æŽ¥å—空白文件。 + + + The host could not be resolved. + 未找到æœå‹™å™¨ã€‚ + + + This value does not match the expected {{ charset }} charset. + 該數值ä¸ç¬¦åˆé æœŸ {{ charset }} 符號編碼。 + + + This is not a valid Business Identifier Code (BIC). + 無效ä¼æ¥­è­˜åˆ¥ç¢¼ (BIC)。 + + + Error. + 錯誤。 + + + This is not a valid UUID. + 無效的通用唯壹標識符 (UUID)。 + + + This value should be a multiple of {{ compared_value }}. + 該值必須是å€æ•¸ {{ compared_value }}。 + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + 該ä¼æ¥­è­˜åˆ¥ç¢¼ (BIC) 與銀行賬戶國際編號ä¸å£¹è‡´ (IBAN) {{ iban }}。 + + + This value should be valid JSON. + 該數值必須åºåˆ—化為JSONæ ¼å¼ã€‚ + + + This collection should contain only unique elements. + 該集åˆæ‡‰åƒ…包å«å”¯å£¹å…ƒç´ ã€‚ + + + This value should be positive. + 數值應為正數。 + + + This value should be either positive or zero. + 數值應是正數,或為零。 + + + This value should be negative. + 數值應為負數。 + + + This value should be either negative or zero. + 數值應是負數,或為零。 + + + This value is not a valid timezone. + 無效時å€ã€‚ + + + This password has been leaked in a data breach, it must not be used. Please use another password. + 此密碼已被泄露,切勿使用。請更æ›å¯†ç¢¼ã€‚ + + + This value should be between {{ min }} and {{ max }}. + 該數值應在 {{ min }} å’Œ {{ max }} 之間。 + + + This value is not a valid hostname. + 該數值ä¸æ˜¯æœ‰æ•ˆçš„主機å稱。 + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + 該集åˆå…§çš„元素數é‡å¾—是 {{ compared_value }} çš„å€æ•¸ã€‚ + + + This value should satisfy at least one of the following constraints: + 該數值需符åˆä»¥ä¸‹å…¶ä¸­ä¸€å€‹ç´„æŸï¼š + + + Each element of this collection should satisfy its own set of constraints. + 該集åˆå…§çš„æ¯å€‹å…ƒç´ éœ€ç¬¦åˆå…ƒç´ æœ¬èº«è¦å®šçš„ç´„æŸã€‚ + + + This value is not a valid International Securities Identification Number (ISIN). + 該數值ä¸æ˜¯æœ‰æ•ˆçš„國際證券識別碼 (ISIN)。 + + + This value should be a valid expression. + 該值需為一個有效的表é”å¼ã€‚ + + + This value is not a valid CSS color. + 該值ä¸æ˜¯æœ‰æ•ˆçš„CSSé¡è‰²ã€‚ + + + This value is not a valid CIDR notation. + 該值ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„CIDR表示。 + + + The value of the netmask should be between {{ min }} and {{ max }}. + 網絡掩碼的值應當在 {{ min }} å’Œ {{ max }} 之間。 + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php b/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php new file mode 100644 index 00000000000..bee4639b26b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php @@ -0,0 +1,584 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Test; + +use PHPUnit\Framework\Assert; +use PHPUnit\Framework\Constraint\IsIdentical; +use PHPUnit\Framework\Constraint\IsInstanceOf; +use PHPUnit\Framework\Constraint\IsNull; +use PHPUnit\Framework\Constraint\LogicalOr; +use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\ConstraintValidatorInterface; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Validator\ConstraintViolationInterface; +use Symfony\Component\Validator\ConstraintViolationList; +use Symfony\Component\Validator\ConstraintViolationListInterface; +use Symfony\Component\Validator\Context\ExecutionContext; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\PropertyMetadata; +use Symfony\Component\Validator\Validator\ContextualValidatorInterface; +use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * A test case to ease testing Constraint Validators. + * + * @author Bernhard Schussek + */ +abstract class ConstraintValidatorTestCase extends TestCase +{ + /** + * @var ExecutionContextInterface + */ + protected $context; + + /** + * @var ConstraintValidatorInterface + */ + protected $validator; + + protected $group; + protected $metadata; + protected $object; + protected $value; + protected $root; + protected $propertyPath; + protected $constraint; + protected $defaultTimezone; + private $defaultLocale; + private $expectedViolations; + private $call; + + protected function setUp(): void + { + $this->group = 'MyGroup'; + $this->metadata = null; + $this->object = null; + $this->value = 'InvalidValue'; + $this->root = 'root'; + $this->propertyPath = 'property.path'; + + // Initialize the context with some constraint so that we can + // successfully build a violation. + $this->constraint = new NotNull(); + + $this->context = $this->createContext(); + $this->validator = $this->createValidator(); + $this->validator->initialize($this->context); + + $this->defaultLocale = \Locale::getDefault(); + \Locale::setDefault('en'); + + $this->expectedViolations = []; + $this->call = 0; + + $this->setDefaultTimezone('UTC'); + } + + protected function tearDown(): void + { + $this->restoreDefaultTimezone(); + + \Locale::setDefault($this->defaultLocale); + } + + protected function setDefaultTimezone(?string $defaultTimezone) + { + // Make sure this method cannot be called twice before calling + // also restoreDefaultTimezone() + if (null === $this->defaultTimezone) { + $this->defaultTimezone = date_default_timezone_get(); + date_default_timezone_set($defaultTimezone); + } + } + + protected function restoreDefaultTimezone() + { + if (null !== $this->defaultTimezone) { + date_default_timezone_set($this->defaultTimezone); + $this->defaultTimezone = null; + } + } + + protected function createContext() + { + $translator = $this->createMock(TranslatorInterface::class); + $translator->expects($this->any())->method('trans')->willReturnArgument(0); + $validator = $this->createMock(ValidatorInterface::class); + $validator->expects($this->any()) + ->method('validate') + ->willReturnCallback(function () { + return $this->expectedViolations[$this->call++] ?? new ConstraintViolationList(); + }); + + $context = new ExecutionContext($validator, $this->root, $translator); + $context->setGroup($this->group); + $context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + $context->setConstraint($this->constraint); + + $contextualValidator = $this->getMockBuilder(AssertingContextualValidator::class) + ->setConstructorArgs([$context]) + ->setMethods([ + 'atPath', + 'validate', + 'validateProperty', + 'validatePropertyValue', + 'getViolations', + ]) + ->getMock(); + $contextualValidator->expects($this->any()) + ->method('atPath') + ->willReturnCallback(function ($path) use ($contextualValidator) { + return $contextualValidator->doAtPath($path); + }); + $contextualValidator->expects($this->any()) + ->method('validate') + ->willReturnCallback(function ($value, $constraints = null, $groups = null) use ($contextualValidator) { + return $contextualValidator->doValidate($value, $constraints, $groups); + }); + $contextualValidator->expects($this->any()) + ->method('validateProperty') + ->willReturnCallback(function ($object, $propertyName, $groups = null) use ($contextualValidator) { + return $contextualValidator->validateProperty($object, $propertyName, $groups); + }); + $contextualValidator->expects($this->any()) + ->method('validatePropertyValue') + ->willReturnCallback(function ($objectOrClass, $propertyName, $value, $groups = null) use ($contextualValidator) { + return $contextualValidator->doValidatePropertyValue($objectOrClass, $propertyName, $value, $groups); + }); + $contextualValidator->expects($this->any()) + ->method('getViolations') + ->willReturnCallback(function () use ($contextualValidator) { + return $contextualValidator->doGetViolations(); + }); + $validator->expects($this->any()) + ->method('inContext') + ->with($context) + ->willReturn($contextualValidator); + + return $context; + } + + protected function setGroup(?string $group) + { + $this->group = $group; + $this->context->setGroup($group); + } + + protected function setObject($object) + { + $this->object = $object; + $this->metadata = \is_object($object) + ? new ClassMetadata(\get_class($object)) + : null; + + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function setProperty($object, $property) + { + $this->object = $object; + $this->metadata = \is_object($object) + ? new PropertyMetadata(\get_class($object), $property) + : null; + + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function setValue($value) + { + $this->value = $value; + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function setRoot($root) + { + $this->root = $root; + $this->context = $this->createContext(); + $this->validator->initialize($this->context); + } + + protected function setPropertyPath(string $propertyPath) + { + $this->propertyPath = $propertyPath; + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function expectNoValidate() + { + $validator = $this->context->getValidator()->inContext($this->context); + $validator->expectNoValidate(); + } + + protected function expectValidateAt(int $i, string $propertyPath, $value, $group) + { + $validator = $this->context->getValidator()->inContext($this->context); + $validator->expectValidation($i, $propertyPath, $value, $group, function ($passedConstraints) { + $expectedConstraints = new LogicalOr(); + $expectedConstraints->setConstraints([new IsNull(), new IsIdentical([]), new IsInstanceOf(Valid::class)]); + + Assert::assertThat($passedConstraints, $expectedConstraints); + }); + } + + protected function expectValidateValue(int $i, $value, array $constraints = [], $group = null) + { + $contextualValidator = $this->context->getValidator()->inContext($this->context); + $contextualValidator->expectValidation($i, null, $value, $group, function ($passedConstraints) use ($constraints) { + if (\is_array($constraints) && !\is_array($passedConstraints)) { + $passedConstraints = [$passedConstraints]; + } + + Assert::assertEquals($constraints, $passedConstraints); + }); + } + + protected function expectFailingValueValidation(int $i, $value, array $constraints, $group, ConstraintViolationInterface $violation) + { + $contextualValidator = $this->context->getValidator()->inContext($this->context); + $contextualValidator->expectValidation($i, null, $value, $group, function ($passedConstraints) use ($constraints) { + if (\is_array($constraints) && !\is_array($passedConstraints)) { + $passedConstraints = [$passedConstraints]; + } + + Assert::assertEquals($constraints, $passedConstraints); + }, $violation); + } + + protected function expectValidateValueAt(int $i, string $propertyPath, $value, $constraints, $group = null) + { + $contextualValidator = $this->context->getValidator()->inContext($this->context); + $contextualValidator->expectValidation($i, $propertyPath, $value, $group, function ($passedConstraints) use ($constraints) { + Assert::assertEquals($constraints, $passedConstraints); + }); + } + + protected function expectViolationsAt($i, $value, Constraint $constraint) + { + $context = $this->createContext(); + + $validatorClassname = $constraint->validatedBy(); + + $validator = new $validatorClassname(); + $validator->initialize($context); + $validator->validate($value, $constraint); + + $this->expectedViolations[] = $context->getViolations(); + + return $context->getViolations(); + } + + protected function assertNoViolation() + { + $this->assertSame(0, $violationsCount = \count($this->context->getViolations()), sprintf('0 violation expected. Got %u.', $violationsCount)); + } + + /** + * @return ConstraintViolationAssertion + */ + protected function buildViolation($message) + { + return new ConstraintViolationAssertion($this->context, $message, $this->constraint); + } + + abstract protected function createValidator(); +} + +final class ConstraintViolationAssertion +{ + /** + * @var ExecutionContextInterface + */ + private $context; + + /** + * @var ConstraintViolationAssertion[] + */ + private $assertions; + + private $message; + private $parameters = []; + private $invalidValue = 'InvalidValue'; + private $propertyPath = 'property.path'; + private $plural; + private $code; + private $constraint; + private $cause; + + /** + * @internal + */ + public function __construct(ExecutionContextInterface $context, string $message, Constraint $constraint = null, array $assertions = []) + { + $this->context = $context; + $this->message = $message; + $this->constraint = $constraint; + $this->assertions = $assertions; + } + + /** + * @return $this + */ + public function atPath(string $path) + { + $this->propertyPath = $path; + + return $this; + } + + /** + * @return $this + */ + public function setParameter(string $key, string $value) + { + $this->parameters[$key] = $value; + + return $this; + } + + /** + * @return $this + */ + public function setParameters(array $parameters) + { + $this->parameters = $parameters; + + return $this; + } + + /** + * @return $this + */ + public function setTranslationDomain($translationDomain) + { + // no-op for BC + + return $this; + } + + /** + * @return $this + */ + public function setInvalidValue($invalidValue) + { + $this->invalidValue = $invalidValue; + + return $this; + } + + /** + * @return $this + */ + public function setPlural(int $number) + { + $this->plural = $number; + + return $this; + } + + /** + * @return $this + */ + public function setCode(string $code) + { + $this->code = $code; + + return $this; + } + + /** + * @return $this + */ + public function setCause($cause) + { + $this->cause = $cause; + + return $this; + } + + public function buildNextViolation(string $message): self + { + $assertions = $this->assertions; + $assertions[] = $this; + + return new self($this->context, $message, $this->constraint, $assertions); + } + + public function assertRaised() + { + $expected = []; + foreach ($this->assertions as $assertion) { + $expected[] = $assertion->getViolation(); + } + $expected[] = $this->getViolation(); + + $violations = iterator_to_array($this->context->getViolations()); + + Assert::assertSame($expectedCount = \count($expected), $violationsCount = \count($violations), sprintf('%u violation(s) expected. Got %u.', $expectedCount, $violationsCount)); + + reset($violations); + + foreach ($expected as $violation) { + Assert::assertEquals($violation, current($violations)); + next($violations); + } + } + + private function getViolation(): ConstraintViolation + { + return new ConstraintViolation( + $this->message, + $this->message, + $this->parameters, + $this->context->getRoot(), + $this->propertyPath, + $this->invalidValue, + $this->plural, + $this->code, + $this->constraint, + $this->cause + ); + } +} + +/** + * @internal + */ +class AssertingContextualValidator implements ContextualValidatorInterface +{ + private $context; + private $expectNoValidate = false; + private $atPathCalls = -1; + private $expectedAtPath = []; + private $validateCalls = -1; + private $expectedValidate = []; + + public function __construct(ExecutionContextInterface $context) + { + $this->context = $context; + } + + public function __destruct() + { + if ($this->expectedAtPath) { + throw new ExpectationFailedException('Some expected validation calls for paths were not done.'); + } + + if ($this->expectedValidate) { + throw new ExpectationFailedException('Some expected validation calls for values were not done.'); + } + } + + public function atPath(string $path) + { + } + + /** + * @return $this + */ + public function doAtPath(string $path) + { + Assert::assertFalse($this->expectNoValidate, 'No validation calls have been expected.'); + + if (!isset($this->expectedAtPath[++$this->atPathCalls])) { + throw new ExpectationFailedException(sprintf('Validation for property path "%s" was not expected.', $path)); + } + + $expectedPath = $this->expectedAtPath[$this->atPathCalls]; + unset($this->expectedAtPath[$this->atPathCalls]); + + Assert::assertSame($expectedPath, $path); + + return $this; + } + + public function validate($value, $constraints = null, $groups = null) + { + } + + /** + * @return $this + */ + public function doValidate($value, $constraints = null, $groups = null) + { + Assert::assertFalse($this->expectNoValidate, 'No validation calls have been expected.'); + + if (!isset($this->expectedValidate[++$this->validateCalls])) { + return $this; + } + + [$expectedValue, $expectedGroup, $expectedConstraints, $violation] = $this->expectedValidate[$this->validateCalls]; + unset($this->expectedValidate[$this->validateCalls]); + + Assert::assertSame($expectedValue, $value); + $expectedConstraints($constraints); + Assert::assertSame($expectedGroup, $groups); + + if (null !== $violation) { + $this->context->addViolation($violation->getMessage(), $violation->getParameters()); + } + + return $this; + } + + public function validateProperty(object $object, string $propertyName, $groups = null) + { + } + + /** + * @return $this + */ + public function doValidateProperty(object $object, string $propertyName, $groups = null) + { + return $this; + } + + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) + { + } + + /** + * @return $this + */ + public function doValidatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) + { + return $this; + } + + public function getViolations(): ConstraintViolationListInterface + { + } + + public function doGetViolations() + { + return $this->context->getViolations(); + } + + public function expectNoValidate() + { + $this->expectNoValidate = true; + } + + public function expectValidation(string $call, ?string $propertyPath, $value, $group, callable $constraints, ConstraintViolationInterface $violation = null) + { + if (null !== $propertyPath) { + $this->expectedAtPath[$call] = $propertyPath; + } + + $this->expectedValidate[$call] = [$value, $group, $constraints, $violation]; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php b/upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php new file mode 100644 index 00000000000..973b6f2cb87 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Util; + +/** + * Contains utility methods for dealing with property paths. + * + * For more extensive functionality, use Symfony's PropertyAccess component. + * + * @author Bernhard Schussek + */ +class PropertyPath +{ + /** + * Appends a path to a given property path. + * + * If the base path is empty, the appended path will be returned unchanged. + * If the base path is not empty, and the appended path starts with a + * squared opening bracket ("["), the concatenation of the two paths is + * returned. Otherwise, the concatenation of the two paths is returned, + * separated by a dot ("."). + * + * @return string + */ + public static function append(string $basePath, string $subPath) + { + if ('' !== $subPath) { + if ('[' === $subPath[0]) { + return $basePath.$subPath; + } + + return '' !== $basePath ? $basePath.'.'.$subPath : $subPath; + } + + return $basePath; + } + + /** + * Not instantiable. + */ + private function __construct() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Validation.php b/upload/system/storage/vendor/symfony/validator/Validation.php new file mode 100644 index 00000000000..4d08072779d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validation.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Symfony\Component\Validator\Exception\ValidationFailedException; +use Symfony\Component\Validator\Validator\ValidatorInterface; + +/** + * Entry point for the Validator component. + * + * @author Bernhard Schussek + */ +final class Validation +{ + /** + * Creates a callable chain of constraints. + * + * @param Constraint|ValidatorInterface|null $constraintOrValidator + * + * @return callable($value) + */ + public static function createCallable($constraintOrValidator = null, Constraint ...$constraints): callable + { + $validator = self::createIsValidCallable($constraintOrValidator, ...$constraints); + + return static function ($value) use ($validator) { + if (!$validator($value, $violations)) { + throw new ValidationFailedException($value, $violations); + } + + return $value; + }; + } + + /** + * Creates a callable that returns true/false instead of throwing validation exceptions. + * + * @param Constraint|ValidatorInterface|null $constraintOrValidator + * + * @return callable($value, &$violations = null): bool + */ + public static function createIsValidCallable($constraintOrValidator = null, Constraint ...$constraints): callable + { + $validator = $constraintOrValidator; + + if ($constraintOrValidator instanceof Constraint) { + $constraints = \func_get_args(); + $validator = null; + } elseif (null !== $constraintOrValidator && !$constraintOrValidator instanceof ValidatorInterface) { + throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a "%s" or a "%s" object, "%s" given.', __METHOD__, Constraint::class, ValidatorInterface::class, get_debug_type($constraintOrValidator))); + } + + $validator = $validator ?? self::createValidator(); + + return static function ($value, &$violations = null) use ($constraints, $validator) { + $violations = $validator->validate($value, $constraints); + + return 0 === $violations->count(); + }; + } + + /** + * Creates a new validator. + * + * If you want to configure the validator, use + * {@link createValidatorBuilder()} instead. + */ + public static function createValidator(): ValidatorInterface + { + return self::createValidatorBuilder()->getValidator(); + } + + /** + * Creates a configurable builder for validator objects. + */ + public static function createValidatorBuilder(): ValidatorBuilder + { + return new ValidatorBuilder(); + } + + /** + * This class cannot be instantiated. + */ + private function __construct() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php b/upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php new file mode 100644 index 00000000000..1063a532987 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Validator; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\ConstraintViolationListInterface; + +/** + * A validator in a specific execution context. + * + * @author Bernhard Schussek + */ +interface ContextualValidatorInterface +{ + /** + * Appends the given path to the property path of the context. + * + * If called multiple times, the path will always be reset to the context's + * original path with the given path appended to it. + * + * @return $this + */ + public function atPath(string $path); + + /** + * Validates a value against a constraint or a list of constraints. + * + * If no constraint is passed, the constraint + * {@link \Symfony\Component\Validator\Constraints\Valid} is assumed. + * + * @param mixed $value The value to validate + * @param Constraint|Constraint[]|null $constraints The constraint(s) to validate against + * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * + * @return $this + */ + public function validate($value, $constraints = null, $groups = null); + + /** + * Validates a property of an object against the constraints specified + * for this property. + * + * @param string $propertyName The name of the validated property + * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * + * @return $this + */ + public function validateProperty(object $object, string $propertyName, $groups = null); + + /** + * Validates a value against the constraints specified for an object's + * property. + * + * @param object|string $objectOrClass The object or its class name + * @param string $propertyName The name of the property + * @param mixed $value The value to validate against the property's constraints + * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * + * @return $this + */ + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null); + + /** + * Returns the violations that have been generated so far in the context + * of the validator. + * + * @return ConstraintViolationListInterface + */ + public function getViolations(); +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php b/upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php new file mode 100644 index 00000000000..a70eeed152c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Validator; + +/** + * A wrapper for a callable initializing a property from a getter. + * + * @internal + */ +class LazyProperty +{ + private $propertyValueCallback; + + public function __construct(\Closure $propertyValueCallback) + { + $this->propertyValueCallback = $propertyValueCallback; + } + + public function getPropertyValue() + { + return ($this->propertyValueCallback)(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php new file mode 100644 index 00000000000..73801717bc9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php @@ -0,0 +1,782 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Validator; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Composite; +use Symfony\Component\Validator\Constraints\Existence; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\ConstraintValidatorFactoryInterface; +use Symfony\Component\Validator\Context\ExecutionContext; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Exception\NoSuchMetadataException; +use Symfony\Component\Validator\Exception\RuntimeException; +use Symfony\Component\Validator\Exception\UnexpectedValueException; +use Symfony\Component\Validator\Exception\UnsupportedMetadataException; +use Symfony\Component\Validator\Exception\ValidatorException; +use Symfony\Component\Validator\Mapping\CascadingStrategy; +use Symfony\Component\Validator\Mapping\ClassMetadataInterface; +use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; +use Symfony\Component\Validator\Mapping\GenericMetadata; +use Symfony\Component\Validator\Mapping\GetterMetadata; +use Symfony\Component\Validator\Mapping\MetadataInterface; +use Symfony\Component\Validator\Mapping\PropertyMetadataInterface; +use Symfony\Component\Validator\Mapping\TraversalStrategy; +use Symfony\Component\Validator\ObjectInitializerInterface; +use Symfony\Component\Validator\Util\PropertyPath; + +/** + * Recursive implementation of {@link ContextualValidatorInterface}. + * + * @author Bernhard Schussek + */ +class RecursiveContextualValidator implements ContextualValidatorInterface +{ + private $context; + private $defaultPropertyPath; + private $defaultGroups; + private $metadataFactory; + private $validatorFactory; + private $objectInitializers; + + /** + * Creates a validator for the given context. + * + * @param ObjectInitializerInterface[] $objectInitializers The object initializers + */ + public function __construct(ExecutionContextInterface $context, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = []) + { + $this->context = $context; + $this->defaultPropertyPath = $context->getPropertyPath(); + $this->defaultGroups = [$context->getGroup() ?: Constraint::DEFAULT_GROUP]; + $this->metadataFactory = $metadataFactory; + $this->validatorFactory = $validatorFactory; + $this->objectInitializers = $objectInitializers; + } + + /** + * {@inheritdoc} + */ + public function atPath(string $path) + { + $this->defaultPropertyPath = $this->context->getPropertyPath($path); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function validate($value, $constraints = null, $groups = null) + { + $groups = $groups ? $this->normalizeGroups($groups) : $this->defaultGroups; + + $previousValue = $this->context->getValue(); + $previousObject = $this->context->getObject(); + $previousMetadata = $this->context->getMetadata(); + $previousPath = $this->context->getPropertyPath(); + $previousGroup = $this->context->getGroup(); + $previousConstraint = null; + + if ($this->context instanceof ExecutionContext || method_exists($this->context, 'getConstraint')) { + $previousConstraint = $this->context->getConstraint(); + } + + // If explicit constraints are passed, validate the value against + // those constraints + if (null !== $constraints) { + // You can pass a single constraint or an array of constraints + // Make sure to deal with an array in the rest of the code + if (!\is_array($constraints)) { + $constraints = [$constraints]; + } + + $metadata = new GenericMetadata(); + $metadata->addConstraints($constraints); + + $this->validateGenericNode( + $value, + $previousObject, + \is_object($value) ? $this->generateCacheKey($value) : null, + $metadata, + $this->defaultPropertyPath, + $groups, + null, + TraversalStrategy::IMPLICIT, + $this->context + ); + + $this->context->setNode($previousValue, $previousObject, $previousMetadata, $previousPath); + $this->context->setGroup($previousGroup); + + if (null !== $previousConstraint) { + $this->context->setConstraint($previousConstraint); + } + + return $this; + } + + // If an object is passed without explicit constraints, validate that + // object against the constraints defined for the object's class + if (\is_object($value)) { + $this->validateObject( + $value, + $this->defaultPropertyPath, + $groups, + TraversalStrategy::IMPLICIT, + $this->context + ); + + $this->context->setNode($previousValue, $previousObject, $previousMetadata, $previousPath); + $this->context->setGroup($previousGroup); + + return $this; + } + + // If an array is passed without explicit constraints, validate each + // object in the array + if (\is_array($value)) { + $this->validateEachObjectIn( + $value, + $this->defaultPropertyPath, + $groups, + $this->context + ); + + $this->context->setNode($previousValue, $previousObject, $previousMetadata, $previousPath); + $this->context->setGroup($previousGroup); + + return $this; + } + + throw new RuntimeException(sprintf('Cannot validate values of type "%s" automatically. Please provide a constraint.', get_debug_type($value))); + } + + /** + * {@inheritdoc} + */ + public function validateProperty(object $object, string $propertyName, $groups = null) + { + $classMetadata = $this->metadataFactory->getMetadataFor($object); + + if (!$classMetadata instanceof ClassMetadataInterface) { + throw new ValidatorException(sprintf('The metadata factory should return instances of "\Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', get_debug_type($classMetadata))); + } + + $propertyMetadatas = $classMetadata->getPropertyMetadata($propertyName); + $groups = $groups ? $this->normalizeGroups($groups) : $this->defaultGroups; + $cacheKey = $this->generateCacheKey($object); + $propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName); + + $previousValue = $this->context->getValue(); + $previousObject = $this->context->getObject(); + $previousMetadata = $this->context->getMetadata(); + $previousPath = $this->context->getPropertyPath(); + $previousGroup = $this->context->getGroup(); + + foreach ($propertyMetadatas as $propertyMetadata) { + $propertyValue = $propertyMetadata->getPropertyValue($object); + + $this->validateGenericNode( + $propertyValue, + $object, + $cacheKey.':'.\get_class($object).':'.$propertyName, + $propertyMetadata, + $propertyPath, + $groups, + null, + TraversalStrategy::IMPLICIT, + $this->context + ); + } + + $this->context->setNode($previousValue, $previousObject, $previousMetadata, $previousPath); + $this->context->setGroup($previousGroup); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) + { + $classMetadata = $this->metadataFactory->getMetadataFor($objectOrClass); + + if (!$classMetadata instanceof ClassMetadataInterface) { + throw new ValidatorException(sprintf('The metadata factory should return instances of "\Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', get_debug_type($classMetadata))); + } + + $propertyMetadatas = $classMetadata->getPropertyMetadata($propertyName); + $groups = $groups ? $this->normalizeGroups($groups) : $this->defaultGroups; + + if (\is_object($objectOrClass)) { + $object = $objectOrClass; + $class = \get_class($object); + $cacheKey = $this->generateCacheKey($objectOrClass); + $propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName); + } else { + // $objectOrClass contains a class name + $object = null; + $class = $objectOrClass; + $cacheKey = null; + $propertyPath = $this->defaultPropertyPath; + } + + $previousValue = $this->context->getValue(); + $previousObject = $this->context->getObject(); + $previousMetadata = $this->context->getMetadata(); + $previousPath = $this->context->getPropertyPath(); + $previousGroup = $this->context->getGroup(); + + foreach ($propertyMetadatas as $propertyMetadata) { + $this->validateGenericNode( + $value, + $object, + $cacheKey.':'.$class.':'.$propertyName, + $propertyMetadata, + $propertyPath, + $groups, + null, + TraversalStrategy::IMPLICIT, + $this->context + ); + } + + $this->context->setNode($previousValue, $previousObject, $previousMetadata, $previousPath); + $this->context->setGroup($previousGroup); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getViolations() + { + return $this->context->getViolations(); + } + + /** + * Normalizes the given group or list of groups to an array. + * + * @param string|GroupSequence|array $groups The groups to normalize + * + * @return array + */ + protected function normalizeGroups($groups) + { + if (\is_array($groups)) { + return $groups; + } + + return [$groups]; + } + + /** + * Validates an object against the constraints defined for its class. + * + * If no metadata is available for the class, but the class is an instance + * of {@link \Traversable} and the selected traversal strategy allows + * traversal, the object will be iterated and each nested object will be + * validated instead. + * + * @throws NoSuchMetadataException If the object has no associated metadata + * and does not implement {@link \Traversable} + * or if traversal is disabled via the + * $traversalStrategy argument + * @throws UnsupportedMetadataException If the metadata returned by the + * metadata factory does not implement + * {@link ClassMetadataInterface} + */ + private function validateObject(object $object, string $propertyPath, array $groups, int $traversalStrategy, ExecutionContextInterface $context) + { + try { + $classMetadata = $this->metadataFactory->getMetadataFor($object); + + if (!$classMetadata instanceof ClassMetadataInterface) { + throw new UnsupportedMetadataException(sprintf('The metadata factory should return instances of "Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', get_debug_type($classMetadata))); + } + + $this->validateClassNode( + $object, + $this->generateCacheKey($object), + $classMetadata, + $propertyPath, + $groups, + null, + $traversalStrategy, + $context + ); + } catch (NoSuchMetadataException $e) { + // Rethrow if not Traversable + if (!$object instanceof \Traversable) { + throw $e; + } + + // Rethrow unless IMPLICIT or TRAVERSE + if (!($traversalStrategy & (TraversalStrategy::IMPLICIT | TraversalStrategy::TRAVERSE))) { + throw $e; + } + + $this->validateEachObjectIn( + $object, + $propertyPath, + $groups, + $context + ); + } + } + + /** + * Validates each object in a collection against the constraints defined + * for their classes. + * + * Nested arrays are also iterated. + */ + private function validateEachObjectIn(iterable $collection, string $propertyPath, array $groups, ExecutionContextInterface $context) + { + foreach ($collection as $key => $value) { + if (\is_array($value)) { + // Also traverse nested arrays + $this->validateEachObjectIn( + $value, + $propertyPath.'['.$key.']', + $groups, + $context + ); + + continue; + } + + // Scalar and null values in the collection are ignored + if (\is_object($value)) { + $this->validateObject( + $value, + $propertyPath.'['.$key.']', + $groups, + TraversalStrategy::IMPLICIT, + $context + ); + } + } + } + + /** + * Validates a class node. + * + * A class node is a combination of an object with a {@link ClassMetadataInterface} + * instance. Each class node (conceptionally) has zero or more succeeding + * property nodes: + * + * (Article:class node) + * \ + * ($title:property node) + * + * This method validates the passed objects against all constraints defined + * at class level. It furthermore triggers the validation of each of the + * class' properties against the constraints for that property. + * + * If the selected traversal strategy allows traversal, the object is + * iterated and each nested object is validated against its own constraints. + * The object is not traversed if traversal is disabled in the class + * metadata. + * + * If the passed groups contain the group "Default", the validator will + * check whether the "Default" group has been replaced by a group sequence + * in the class metadata. If this is the case, the group sequence is + * validated instead. + * + * @throws UnsupportedMetadataException If a property metadata does not + * implement {@link PropertyMetadataInterface} + * @throws ConstraintDefinitionException If traversal was enabled but the + * object does not implement + * {@link \Traversable} + * + * @see TraversalStrategy + */ + private function validateClassNode(object $object, ?string $cacheKey, ClassMetadataInterface $metadata, string $propertyPath, array $groups, ?array $cascadedGroups, int $traversalStrategy, ExecutionContextInterface $context) + { + $context->setNode($object, $object, $metadata, $propertyPath); + + if (!$context->isObjectInitialized($cacheKey)) { + foreach ($this->objectInitializers as $initializer) { + $initializer->initialize($object); + } + + $context->markObjectAsInitialized($cacheKey); + } + + foreach ($groups as $key => $group) { + // If the "Default" group is replaced by a group sequence, remember + // to cascade the "Default" group when traversing the group + // sequence + $defaultOverridden = false; + + // Use the object hash for group sequences + $groupHash = \is_object($group) ? $this->generateCacheKey($group, true) : $group; + + if ($context->isGroupValidated($cacheKey, $groupHash)) { + // Skip this group when validating the properties and when + // traversing the object + unset($groups[$key]); + + continue; + } + + $context->markGroupAsValidated($cacheKey, $groupHash); + + // Replace the "Default" group by the group sequence defined + // for the class, if applicable. + // This is done after checking the cache, so that + // spl_object_hash() isn't called for this sequence and + // "Default" is used instead in the cache. This is useful + // if the getters below return different group sequences in + // every call. + if (Constraint::DEFAULT_GROUP === $group) { + if ($metadata->hasGroupSequence()) { + // The group sequence is statically defined for the class + $group = $metadata->getGroupSequence(); + $defaultOverridden = true; + } elseif ($metadata->isGroupSequenceProvider()) { + // The group sequence is dynamically obtained from the validated + // object + /* @var \Symfony\Component\Validator\GroupSequenceProviderInterface $object */ + $group = $object->getGroupSequence(); + $defaultOverridden = true; + + if (!$group instanceof GroupSequence) { + $group = new GroupSequence($group); + } + } + } + + // If the groups (=[,G3,G4]) contain a group sequence + // (=), then call validateClassNode() with each entry of the + // group sequence and abort if necessary (G1, G2) + if ($group instanceof GroupSequence) { + $this->stepThroughGroupSequence( + $object, + $object, + $cacheKey, + $metadata, + $propertyPath, + $traversalStrategy, + $group, + $defaultOverridden ? Constraint::DEFAULT_GROUP : null, + $context + ); + + // Skip the group sequence when validating properties, because + // stepThroughGroupSequence() already validates the properties + unset($groups[$key]); + + continue; + } + + $this->validateInGroup($object, $cacheKey, $metadata, $group, $context); + } + + // If no more groups should be validated for the property nodes, + // we can safely quit + if (0 === \count($groups)) { + return; + } + + // Validate all properties against their constraints + foreach ($metadata->getConstrainedProperties() as $propertyName) { + // If constraints are defined both on the getter of a property as + // well as on the property itself, then getPropertyMetadata() + // returns two metadata objects, not just one + foreach ($metadata->getPropertyMetadata($propertyName) as $propertyMetadata) { + if (!$propertyMetadata instanceof PropertyMetadataInterface) { + throw new UnsupportedMetadataException(sprintf('The property metadata instances should implement "Symfony\Component\Validator\Mapping\PropertyMetadataInterface", got: "%s".', get_debug_type($propertyMetadata))); + } + + if ($propertyMetadata instanceof GetterMetadata) { + $propertyValue = new LazyProperty(static function () use ($propertyMetadata, $object) { + return $propertyMetadata->getPropertyValue($object); + }); + } else { + $propertyValue = $propertyMetadata->getPropertyValue($object); + } + + $this->validateGenericNode( + $propertyValue, + $object, + $cacheKey.':'.\get_class($object).':'.$propertyName, + $propertyMetadata, + PropertyPath::append($propertyPath, $propertyName), + $groups, + $cascadedGroups, + TraversalStrategy::IMPLICIT, + $context + ); + } + } + + // If no specific traversal strategy was requested when this method + // was called, use the traversal strategy of the class' metadata + if ($traversalStrategy & TraversalStrategy::IMPLICIT) { + $traversalStrategy = $metadata->getTraversalStrategy(); + } + + // Traverse only if IMPLICIT or TRAVERSE + if (!($traversalStrategy & (TraversalStrategy::IMPLICIT | TraversalStrategy::TRAVERSE))) { + return; + } + + // If IMPLICIT, stop unless we deal with a Traversable + if ($traversalStrategy & TraversalStrategy::IMPLICIT && !$object instanceof \Traversable) { + return; + } + + // If TRAVERSE, fail if we have no Traversable + if (!$object instanceof \Traversable) { + throw new ConstraintDefinitionException(sprintf('Traversal was enabled for "%s", but this class does not implement "\Traversable".', get_debug_type($object))); + } + + $this->validateEachObjectIn( + $object, + $propertyPath, + $groups, + $context + ); + } + + /** + * Validates a node that is not a class node. + * + * Currently, two such node types exist: + * + * - property nodes, which consist of the value of an object's + * property together with a {@link PropertyMetadataInterface} instance + * - generic nodes, which consist of a value and some arbitrary + * constraints defined in a {@link MetadataInterface} container + * + * In both cases, the value is validated against all constraints defined + * in the passed metadata object. Then, if the value is an instance of + * {@link \Traversable} and the selected traversal strategy permits it, + * the value is traversed and each nested object validated against its own + * constraints. If the value is an array, it is traversed regardless of + * the given strategy. + * + * @see TraversalStrategy + */ + private function validateGenericNode($value, ?object $object, ?string $cacheKey, ?MetadataInterface $metadata, string $propertyPath, array $groups, ?array $cascadedGroups, int $traversalStrategy, ExecutionContextInterface $context) + { + $context->setNode($value, $object, $metadata, $propertyPath); + + foreach ($groups as $key => $group) { + if ($group instanceof GroupSequence) { + $this->stepThroughGroupSequence( + $value, + $object, + $cacheKey, + $metadata, + $propertyPath, + $traversalStrategy, + $group, + null, + $context + ); + + // Skip the group sequence when cascading, as the cascading + // logic is already done in stepThroughGroupSequence() + unset($groups[$key]); + + continue; + } + + $this->validateInGroup($value, $cacheKey, $metadata, $group, $context); + } + + if (0 === \count($groups)) { + return; + } + + if (null === $value) { + return; + } + + $cascadingStrategy = $metadata->getCascadingStrategy(); + + // Quit unless we cascade + if (!($cascadingStrategy & CascadingStrategy::CASCADE)) { + return; + } + + // If no specific traversal strategy was requested when this method + // was called, use the traversal strategy of the node's metadata + if ($traversalStrategy & TraversalStrategy::IMPLICIT) { + $traversalStrategy = $metadata->getTraversalStrategy(); + } + + // The $cascadedGroups property is set, if the "Default" group is + // overridden by a group sequence + // See validateClassNode() + $cascadedGroups = null !== $cascadedGroups && \count($cascadedGroups) > 0 ? $cascadedGroups : $groups; + + if ($value instanceof LazyProperty) { + $value = $value->getPropertyValue(); + + if (null === $value) { + return; + } + } + + if (\is_array($value)) { + // Arrays are always traversed, independent of the specified + // traversal strategy + $this->validateEachObjectIn( + $value, + $propertyPath, + $cascadedGroups, + $context + ); + + return; + } + + if (!\is_object($value)) { + throw new NoSuchMetadataException(sprintf('Cannot create metadata for non-objects. Got: "%s".', \gettype($value))); + } + + $this->validateObject( + $value, + $propertyPath, + $cascadedGroups, + $traversalStrategy, + $context + ); + + // Currently, the traversal strategy can only be TRAVERSE for a + // generic node if the cascading strategy is CASCADE. Thus, traversable + // objects will always be handled within validateObject() and there's + // nothing more to do here. + + // see GenericMetadata::addConstraint() + } + + /** + * Sequentially validates a node's value in each group of a group sequence. + * + * If any of the constraints generates a violation, subsequent groups in the + * group sequence are skipped. + */ + private function stepThroughGroupSequence($value, ?object $object, ?string $cacheKey, ?MetadataInterface $metadata, string $propertyPath, int $traversalStrategy, GroupSequence $groupSequence, ?string $cascadedGroup, ExecutionContextInterface $context) + { + $violationCount = \count($context->getViolations()); + $cascadedGroups = $cascadedGroup ? [$cascadedGroup] : null; + + foreach ($groupSequence->groups as $groupInSequence) { + $groups = (array) $groupInSequence; + + if ($metadata instanceof ClassMetadataInterface) { + $this->validateClassNode( + $value, + $cacheKey, + $metadata, + $propertyPath, + $groups, + $cascadedGroups, + $traversalStrategy, + $context + ); + } else { + $this->validateGenericNode( + $value, + $object, + $cacheKey, + $metadata, + $propertyPath, + $groups, + $cascadedGroups, + $traversalStrategy, + $context + ); + } + + // Abort sequence validation if a violation was generated + if (\count($context->getViolations()) > $violationCount) { + break; + } + } + } + + /** + * Validates a node's value against all constraints in the given group. + * + * @param mixed $value The validated value + */ + private function validateInGroup($value, ?string $cacheKey, MetadataInterface $metadata, string $group, ExecutionContextInterface $context) + { + $context->setGroup($group); + + foreach ($metadata->findConstraints($group) as $constraint) { + if ($constraint instanceof Existence) { + continue; + } + + // Prevent duplicate validation of constraints, in the case + // that constraints belong to multiple validated groups + if (null !== $cacheKey) { + $constraintHash = $this->generateCacheKey($constraint, true); + // instanceof Valid: In case of using a Valid constraint with many groups + // it makes a reference object get validated by each group + if ($constraint instanceof Composite || $constraint instanceof Valid) { + $constraintHash .= $group; + } + + if ($context->isConstraintValidated($cacheKey, $constraintHash)) { + continue; + } + + $context->markConstraintAsValidated($cacheKey, $constraintHash); + } + + $context->setConstraint($constraint); + + $validator = $this->validatorFactory->getInstance($constraint); + $validator->initialize($context); + + if ($value instanceof LazyProperty) { + $value = $value->getPropertyValue(); + } + + try { + $validator->validate($value, $constraint); + } catch (UnexpectedValueException $e) { + $context->buildViolation('This value should be of type {{ type }}.') + ->setParameter('{{ type }}', $e->getExpectedType()) + ->addViolation(); + } + } + } + + private function generateCacheKey(object $object, bool $dependsOnPropertyPath = false): string + { + if ($this->context instanceof ExecutionContext) { + $cacheKey = $this->context->generateCacheKey($object); + } else { + $cacheKey = spl_object_hash($object); + } + + if ($dependsOnPropertyPath) { + $cacheKey .= $this->context->getPropertyPath(); + } + + return $cacheKey; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php new file mode 100644 index 00000000000..d57c90847b8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Validator; + +use Symfony\Component\Validator\ConstraintValidatorFactoryInterface; +use Symfony\Component\Validator\Context\ExecutionContextFactoryInterface; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; +use Symfony\Component\Validator\ObjectInitializerInterface; + +/** + * Recursive implementation of {@link ValidatorInterface}. + * + * @author Bernhard Schussek + */ +class RecursiveValidator implements ValidatorInterface +{ + protected $contextFactory; + protected $metadataFactory; + protected $validatorFactory; + protected $objectInitializers; + + /** + * Creates a new validator. + * + * @param ObjectInitializerInterface[] $objectInitializers The object initializers + */ + public function __construct(ExecutionContextFactoryInterface $contextFactory, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = []) + { + $this->contextFactory = $contextFactory; + $this->metadataFactory = $metadataFactory; + $this->validatorFactory = $validatorFactory; + $this->objectInitializers = $objectInitializers; + } + + /** + * {@inheritdoc} + */ + public function startContext($root = null) + { + return new RecursiveContextualValidator( + $this->contextFactory->createContext($this, $root), + $this->metadataFactory, + $this->validatorFactory, + $this->objectInitializers + ); + } + + /** + * {@inheritdoc} + */ + public function inContext(ExecutionContextInterface $context) + { + return new RecursiveContextualValidator( + $context, + $this->metadataFactory, + $this->validatorFactory, + $this->objectInitializers + ); + } + + /** + * {@inheritdoc} + */ + public function getMetadataFor($object) + { + return $this->metadataFactory->getMetadataFor($object); + } + + /** + * {@inheritdoc} + */ + public function hasMetadataFor($object) + { + return $this->metadataFactory->hasMetadataFor($object); + } + + /** + * {@inheritdoc} + */ + public function validate($value, $constraints = null, $groups = null) + { + return $this->startContext($value) + ->validate($value, $constraints, $groups) + ->getViolations(); + } + + /** + * {@inheritdoc} + */ + public function validateProperty(object $object, string $propertyName, $groups = null) + { + return $this->startContext($object) + ->validateProperty($object, $propertyName, $groups) + ->getViolations(); + } + + /** + * {@inheritdoc} + */ + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) + { + // If a class name is passed, take $value as root + return $this->startContext(\is_object($objectOrClass) ? $objectOrClass : $value) + ->validatePropertyValue($objectOrClass, $propertyName, $value, $groups) + ->getViolations(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php b/upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php new file mode 100644 index 00000000000..8c1d966f2b4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php @@ -0,0 +1,136 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Validator; + +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Contracts\Service\ResetInterface; + +/** + * Collects some data about validator calls. + * + * @author Maxime Steinhausser + */ +class TraceableValidator implements ValidatorInterface, ResetInterface +{ + private $validator; + private $collectedData = []; + + public function __construct(ValidatorInterface $validator) + { + $this->validator = $validator; + } + + /** + * @return array + */ + public function getCollectedData() + { + return $this->collectedData; + } + + public function reset() + { + $this->collectedData = []; + } + + /** + * {@inheritdoc} + */ + public function getMetadataFor($value) + { + return $this->validator->getMetadataFor($value); + } + + /** + * {@inheritdoc} + */ + public function hasMetadataFor($value) + { + return $this->validator->hasMetadataFor($value); + } + + /** + * {@inheritdoc} + */ + public function validate($value, $constraints = null, $groups = null) + { + $violations = $this->validator->validate($value, $constraints, $groups); + + $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 7); + + $file = $trace[0]['file']; + $line = $trace[0]['line']; + + for ($i = 1; $i < 7; ++$i) { + if (isset($trace[$i]['class'], $trace[$i]['function']) + && 'validate' === $trace[$i]['function'] + && is_a($trace[$i]['class'], ValidatorInterface::class, true) + ) { + $file = $trace[$i]['file']; + $line = $trace[$i]['line']; + + while (++$i < 7) { + if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && !str_starts_with($trace[$i]['function'], 'call_user_func')) { + $file = $trace[$i]['file']; + $line = $trace[$i]['line']; + + break; + } + } + break; + } + } + + $name = str_replace('\\', '/', $file); + $name = substr($name, strrpos($name, '/') + 1); + + $this->collectedData[] = [ + 'caller' => compact('name', 'file', 'line'), + 'context' => compact('value', 'constraints', 'groups'), + 'violations' => iterator_to_array($violations), + ]; + + return $violations; + } + + /** + * {@inheritdoc} + */ + public function validateProperty(object $object, string $propertyName, $groups = null) + { + return $this->validator->validateProperty($object, $propertyName, $groups); + } + + /** + * {@inheritdoc} + */ + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) + { + return $this->validator->validatePropertyValue($objectOrClass, $propertyName, $value, $groups); + } + + /** + * {@inheritdoc} + */ + public function startContext() + { + return $this->validator->startContext(); + } + + /** + * {@inheritdoc} + */ + public function inContext(ExecutionContextInterface $context) + { + return $this->validator->inContext($context); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php b/upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php new file mode 100644 index 00000000000..e6aa7d7f7bc --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Validator; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\ConstraintViolationListInterface; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; + +/** + * Validates PHP values against constraints. + * + * @author Bernhard Schussek + */ +interface ValidatorInterface extends MetadataFactoryInterface +{ + /** + * Validates a value against a constraint or a list of constraints. + * + * If no constraint is passed, the constraint + * {@link \Symfony\Component\Validator\Constraints\Valid} is assumed. + * + * @param mixed $value The value to validate + * @param Constraint|Constraint[] $constraints The constraint(s) to validate against + * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * + * @return ConstraintViolationListInterface A list of constraint violations + * If the list is empty, validation + * succeeded + */ + public function validate($value, $constraints = null, $groups = null); + + /** + * Validates a property of an object against the constraints specified + * for this property. + * + * @param string $propertyName The name of the validated property + * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * + * @return ConstraintViolationListInterface A list of constraint violations + * If the list is empty, validation + * succeeded + */ + public function validateProperty(object $object, string $propertyName, $groups = null); + + /** + * Validates a value against the constraints specified for an object's + * property. + * + * @param object|string $objectOrClass The object or its class name + * @param string $propertyName The name of the property + * @param mixed $value The value to validate against the property's constraints + * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * + * @return ConstraintViolationListInterface A list of constraint violations + * If the list is empty, validation + * succeeded + */ + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null); + + /** + * Starts a new validation context and returns a validator for that context. + * + * The returned validator collects all violations generated within its + * context. You can access these violations with the + * {@link ContextualValidatorInterface::getViolations()} method. + * + * @return ContextualValidatorInterface + */ + public function startContext(); + + /** + * Returns a validator in the given execution context. + * + * The returned validator adds all generated violations to the given + * context. + * + * @return ContextualValidatorInterface + */ + public function inContext(ExecutionContextInterface $context); +} diff --git a/upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php b/upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php new file mode 100644 index 00000000000..8df048bd670 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php @@ -0,0 +1,444 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Doctrine\Common\Annotations\AnnotationReader; +use Doctrine\Common\Annotations\CachedReader; +use Doctrine\Common\Annotations\PsrCachedReader; +use Doctrine\Common\Annotations\Reader; +use Doctrine\Common\Cache\ArrayCache; +use Psr\Cache\CacheItemPoolInterface; +use Symfony\Component\Cache\Adapter\ArrayAdapter; +use Symfony\Component\Validator\Context\ExecutionContextFactory; +use Symfony\Component\Validator\Exception\LogicException; +use Symfony\Component\Validator\Exception\ValidatorException; +use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; +use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; +use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader; +use Symfony\Component\Validator\Mapping\Loader\LoaderChain; +use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; +use Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader; +use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader; +use Symfony\Component\Validator\Mapping\Loader\YamlFileLoader; +use Symfony\Component\Validator\Validator\RecursiveValidator; +use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Contracts\Translation\LocaleAwareInterface; +use Symfony\Contracts\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorTrait; + +// Help opcache.preload discover always-needed symbols +class_exists(TranslatorInterface::class); +class_exists(LocaleAwareInterface::class); +class_exists(TranslatorTrait::class); + +/** + * @author Bernhard Schussek + */ +class ValidatorBuilder +{ + private $initializers = []; + private $loaders = []; + private $xmlMappings = []; + private $yamlMappings = []; + private $methodMappings = []; + + /** + * @var Reader|null + */ + private $annotationReader; + private $enableAnnotationMapping = false; + + /** + * @var MetadataFactoryInterface|null + */ + private $metadataFactory; + + /** + * @var ConstraintValidatorFactoryInterface|null + */ + private $validatorFactory; + + /** + * @var CacheItemPoolInterface|null + */ + private $mappingCache; + + /** + * @var TranslatorInterface|null + */ + private $translator; + + /** + * @var string|null + */ + private $translationDomain; + + /** + * Adds an object initializer to the validator. + * + * @return $this + */ + public function addObjectInitializer(ObjectInitializerInterface $initializer) + { + $this->initializers[] = $initializer; + + return $this; + } + + /** + * Adds a list of object initializers to the validator. + * + * @param ObjectInitializerInterface[] $initializers + * + * @return $this + */ + public function addObjectInitializers(array $initializers) + { + $this->initializers = array_merge($this->initializers, $initializers); + + return $this; + } + + /** + * Adds an XML constraint mapping file to the validator. + * + * @return $this + */ + public function addXmlMapping(string $path) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $this->xmlMappings[] = $path; + + return $this; + } + + /** + * Adds a list of XML constraint mapping files to the validator. + * + * @param string[] $paths The paths to the mapping files + * + * @return $this + */ + public function addXmlMappings(array $paths) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $this->xmlMappings = array_merge($this->xmlMappings, $paths); + + return $this; + } + + /** + * Adds a YAML constraint mapping file to the validator. + * + * @param string $path The path to the mapping file + * + * @return $this + */ + public function addYamlMapping(string $path) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $this->yamlMappings[] = $path; + + return $this; + } + + /** + * Adds a list of YAML constraint mappings file to the validator. + * + * @param string[] $paths The paths to the mapping files + * + * @return $this + */ + public function addYamlMappings(array $paths) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $this->yamlMappings = array_merge($this->yamlMappings, $paths); + + return $this; + } + + /** + * Enables constraint mapping using the given static method. + * + * @return $this + */ + public function addMethodMapping(string $methodName) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $this->methodMappings[] = $methodName; + + return $this; + } + + /** + * Enables constraint mapping using the given static methods. + * + * @param string[] $methodNames The names of the methods + * + * @return $this + */ + public function addMethodMappings(array $methodNames) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $this->methodMappings = array_merge($this->methodMappings, $methodNames); + + return $this; + } + + /** + * Enables annotation based constraint mapping. + * + * @param bool $skipDoctrineAnnotations + * + * @return $this + */ + public function enableAnnotationMapping(/* bool $skipDoctrineAnnotations = true */) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot enable annotation mapping after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $skipDoctrineAnnotations = 1 > \func_num_args() ? false : func_get_arg(0); + if (false === $skipDoctrineAnnotations || null === $skipDoctrineAnnotations) { + trigger_deprecation('symfony/validator', '5.2', 'Not passing true as first argument to "%s" is deprecated. Pass true and call "addDefaultDoctrineAnnotationReader()" if you want to enable annotation mapping with Doctrine Annotations.', __METHOD__); + $this->addDefaultDoctrineAnnotationReader(); + } elseif ($skipDoctrineAnnotations instanceof Reader) { + trigger_deprecation('symfony/validator', '5.2', 'Passing an instance of "%s" as first argument to "%s" is deprecated. Pass true instead and call setDoctrineAnnotationReader() if you want to enable annotation mapping with Doctrine Annotations.', get_debug_type($skipDoctrineAnnotations), __METHOD__); + $this->setDoctrineAnnotationReader($skipDoctrineAnnotations); + } elseif (true !== $skipDoctrineAnnotations) { + throw new \TypeError(sprintf('"%s": Argument 1 is expected to be a boolean, "%s" given.', __METHOD__, get_debug_type($skipDoctrineAnnotations))); + } + + $this->enableAnnotationMapping = true; + + return $this; + } + + /** + * Disables annotation based constraint mapping. + * + * @return $this + */ + public function disableAnnotationMapping() + { + $this->enableAnnotationMapping = false; + $this->annotationReader = null; + + return $this; + } + + /** + * @return $this + */ + public function setDoctrineAnnotationReader(?Reader $reader): self + { + $this->annotationReader = $reader; + + return $this; + } + + /** + * @return $this + */ + public function addDefaultDoctrineAnnotationReader(): self + { + $this->annotationReader = $this->createAnnotationReader(); + + return $this; + } + + /** + * Sets the class metadata factory used by the validator. + * + * @return $this + */ + public function setMetadataFactory(MetadataFactoryInterface $metadataFactory) + { + if (\count($this->xmlMappings) > 0 || \count($this->yamlMappings) > 0 || \count($this->methodMappings) > 0 || $this->enableAnnotationMapping) { + throw new ValidatorException('You cannot set a custom metadata factory after adding custom mappings. You should do either of both.'); + } + + $this->metadataFactory = $metadataFactory; + + return $this; + } + + /** + * Sets the cache for caching class metadata. + * + * @return $this + */ + public function setMappingCache(CacheItemPoolInterface $cache) + { + if (null !== $this->metadataFactory) { + throw new ValidatorException('You cannot set a custom mapping cache after setting a custom metadata factory. Configure your metadata factory instead.'); + } + + $this->mappingCache = $cache; + + return $this; + } + + /** + * Sets the constraint validator factory used by the validator. + * + * @return $this + */ + public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory) + { + $this->validatorFactory = $validatorFactory; + + return $this; + } + + /** + * Sets the translator used for translating violation messages. + * + * @return $this + */ + public function setTranslator(TranslatorInterface $translator) + { + $this->translator = $translator; + + return $this; + } + + /** + * Sets the default translation domain of violation messages. + * + * The same message can have different translations in different domains. + * Pass the domain that is used for violation messages by default to this + * method. + * + * @return $this + */ + public function setTranslationDomain(?string $translationDomain) + { + $this->translationDomain = $translationDomain; + + return $this; + } + + /** + * @return $this + */ + public function addLoader(LoaderInterface $loader) + { + $this->loaders[] = $loader; + + return $this; + } + + /** + * @return LoaderInterface[] + */ + public function getLoaders() + { + $loaders = []; + + foreach ($this->xmlMappings as $xmlMapping) { + $loaders[] = new XmlFileLoader($xmlMapping); + } + + foreach ($this->yamlMappings as $yamlMappings) { + $loaders[] = new YamlFileLoader($yamlMappings); + } + + foreach ($this->methodMappings as $methodName) { + $loaders[] = new StaticMethodLoader($methodName); + } + + if ($this->enableAnnotationMapping) { + $loaders[] = new AnnotationLoader($this->annotationReader); + } + + return array_merge($loaders, $this->loaders); + } + + /** + * Builds and returns a new validator object. + * + * @return ValidatorInterface + */ + public function getValidator() + { + $metadataFactory = $this->metadataFactory; + + if (!$metadataFactory) { + $loaders = $this->getLoaders(); + $loader = null; + + if (\count($loaders) > 1) { + $loader = new LoaderChain($loaders); + } elseif (1 === \count($loaders)) { + $loader = $loaders[0]; + } + + $metadataFactory = new LazyLoadingMetadataFactory($loader, $this->mappingCache); + } + + $validatorFactory = $this->validatorFactory ?? new ConstraintValidatorFactory(); + $translator = $this->translator; + + if (null === $translator) { + $translator = new class() implements TranslatorInterface, LocaleAwareInterface { + use TranslatorTrait; + }; + // Force the locale to be 'en' when no translator is provided rather than relying on the Intl default locale + // This avoids depending on Intl or the stub implementation being available. It also ensures that Symfony + // validation messages are pluralized properly even when the default locale gets changed because they are in + // English. + $translator->setLocale('en'); + } + + $contextFactory = new ExecutionContextFactory($translator, $this->translationDomain); + + return new RecursiveValidator($contextFactory, $metadataFactory, $validatorFactory, $this->initializers); + } + + private function createAnnotationReader(): Reader + { + if (!class_exists(AnnotationReader::class)) { + throw new LogicException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and symfony/cache to be installed.'); + } + + if (class_exists(ArrayAdapter::class)) { + return new PsrCachedReader(new AnnotationReader(), new ArrayAdapter()); + } + + if (class_exists(CachedReader::class) && class_exists(ArrayCache::class)) { + trigger_deprecation('symfony/validator', '5.4', 'Enabling annotation based constraint mapping without having symfony/cache installed is deprecated.'); + + return new CachedReader(new AnnotationReader(), new ArrayCache()); + } + + throw new LogicException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and symfony/cache to be installed.'); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php new file mode 100644 index 00000000000..9e198c6da85 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php @@ -0,0 +1,174 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Violation; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Validator\ConstraintViolationList; +use Symfony\Component\Validator\Util\PropertyPath; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * Default implementation of {@link ConstraintViolationBuilderInterface}. + * + * @author Bernhard Schussek + * + * @internal since version 2.5. Code against ConstraintViolationBuilderInterface instead. + */ +class ConstraintViolationBuilder implements ConstraintViolationBuilderInterface +{ + private $violations; + private $message; + private $parameters; + private $root; + private $invalidValue; + private $propertyPath; + private $translator; + private $translationDomain; + private $plural; + private $constraint; + private $code; + + /** + * @var mixed + */ + private $cause; + + /** + * @param string $message The error message as a string or a stringable object + */ + public function __construct(ConstraintViolationList $violations, ?Constraint $constraint, $message, array $parameters, $root, $propertyPath, $invalidValue, TranslatorInterface $translator, $translationDomain = null) + { + $this->violations = $violations; + $this->message = $message; + $this->parameters = $parameters; + $this->root = $root; + $this->propertyPath = $propertyPath; + $this->invalidValue = $invalidValue; + $this->translator = $translator; + $this->translationDomain = $translationDomain; + $this->constraint = $constraint; + } + + /** + * {@inheritdoc} + */ + public function atPath(string $path) + { + $this->propertyPath = PropertyPath::append($this->propertyPath, $path); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setParameter(string $key, string $value) + { + $this->parameters[$key] = $value; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setParameters(array $parameters) + { + $this->parameters = $parameters; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setTranslationDomain(string $translationDomain) + { + $this->translationDomain = $translationDomain; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setInvalidValue($invalidValue) + { + $this->invalidValue = $invalidValue; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setPlural(int $number) + { + $this->plural = $number; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setCode(?string $code) + { + $this->code = $code; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setCause($cause) + { + $this->cause = $cause; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addViolation() + { + if (null === $this->plural) { + $translatedMessage = $this->translator->trans( + $this->message, + $this->parameters, + $this->translationDomain + ); + } else { + $translatedMessage = $this->translator->trans( + $this->message, + ['%count%' => $this->plural] + $this->parameters, + $this->translationDomain + ); + } + + $this->violations->add(new ConstraintViolation( + $translatedMessage, + $this->message, + $this->parameters, + $this->root, + $this->propertyPath, + $this->invalidValue, + $this->plural, + $this->code, + $this->constraint, + $this->cause + )); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php new file mode 100644 index 00000000000..9ac1b8b4c47 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php @@ -0,0 +1,114 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Violation; + +/** + * Builds {@link \Symfony\Component\Validator\ConstraintViolationInterface} + * objects. + * + * Use the various methods on this interface to configure the built violation. + * Finally, call {@link addViolation()} to add the violation to the current + * execution context. + * + * @author Bernhard Schussek + */ +interface ConstraintViolationBuilderInterface +{ + /** + * Stores the property path at which the violation should be generated. + * + * The passed path will be appended to the current property path of the + * execution context. + * + * @param string $path The property path + * + * @return $this + */ + public function atPath(string $path); + + /** + * Sets a parameter to be inserted into the violation message. + * + * @param string $key The name of the parameter + * @param string $value The value to be inserted in the parameter's place + * + * @return $this + */ + public function setParameter(string $key, string $value); + + /** + * Sets all parameters to be inserted into the violation message. + * + * @param array $parameters An array with the parameter names as keys and + * the values to be inserted in their place as + * values + * + * @return $this + */ + public function setParameters(array $parameters); + + /** + * Sets the translation domain which should be used for translating the + * violation message. + * + * @param string $translationDomain The translation domain + * + * @return $this + * + * @see \Symfony\Contracts\Translation\TranslatorInterface + */ + public function setTranslationDomain(string $translationDomain); + + /** + * Sets the invalid value that caused this violation. + * + * @param mixed $invalidValue The invalid value + * + * @return $this + */ + public function setInvalidValue($invalidValue); + + /** + * Sets the number which determines how the plural form of the violation + * message is chosen when it is translated. + * + * @param int $number The number for determining the plural form + * + * @return $this + * + * @see \Symfony\Contracts\Translation\TranslatorInterface::trans() + */ + public function setPlural(int $number); + + /** + * Sets the violation code. + * + * @param string|null $code The violation code + * + * @return $this + */ + public function setCode(?string $code); + + /** + * Sets the cause of the violation. + * + * @param mixed $cause The cause of the violation + * + * @return $this + */ + public function setCause($cause); + + /** + * Adds the violation to the current execution context. + */ + public function addViolation(); +} diff --git a/upload/system/storage/vendor/symfony/validator/composer.json b/upload/system/storage/vendor/symfony/validator/composer.json new file mode 100644 index 00000000000..0ce4d0d2a43 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/composer.json @@ -0,0 +1,80 @@ +{ + "name": "symfony/validator", + "type": "library", + "description": "Provides tools to validate values", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", + "symfony/translation-contracts": "^1.1|^2|^3" + }, + "require-dev": { + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^5.1|^6.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.0|^6.0", + "symfony/property-info": "^5.3|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", + "doctrine/annotations": "^1.13", + "doctrine/cache": "^1.11|^2.0", + "egulias/email-validator": "^2.1.10|^3" + }, + "conflict": { + "doctrine/annotations": "<1.13", + "doctrine/cache": "<1.11", + "doctrine/lexer": "<1.1", + "phpunit/phpunit": "<5.4.3", + "symfony/dependency-injection": "<4.4", + "symfony/expression-language": "<5.1", + "symfony/http-kernel": "<4.4", + "symfony/intl": "<4.4", + "symfony/property-info": "<5.3", + "symfony/translation": "<4.4", + "symfony/yaml": "<4.4" + }, + "suggest": { + "psr/cache-implementation": "For using the mapping cache.", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/translation": "For translating validation errors.", + "symfony/yaml": "", + "symfony/config": "", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/property-info": "To automatically add NotNull and Type constraints", + "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\Validator\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev" +} From 8436043abacccaba7e7d396b77ef7ea2aa6dc87f Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:57:38 +0000 Subject: [PATCH 22/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/symfony/polyfill-mbstring | 1 - 1 file changed, 1 deletion(-) delete mode 160000 upload/system/storage/vendor/symfony/polyfill-mbstring diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring b/upload/system/storage/vendor/symfony/polyfill-mbstring deleted file mode 160000 index c79c051f5b3..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c79c051f5b3a46be09205c73b80b346e4153e494 From f0048fb5b4f5b2f58d068e9768b92ab8d9c2638e Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 14:57:51 +0000 Subject: [PATCH 23/39] Support for PHP 8.0 and 8.1 --- .../vendor/symfony/polyfill-mbstring/LICENSE | 19 + .../symfony/polyfill-mbstring/Mbstring.php | 873 ++++++++++ .../symfony/polyfill-mbstring/README.md | 13 + .../Resources/unidata/lowerCase.php | 1397 ++++++++++++++++ .../Resources/unidata/titleCaseRegexp.php | 5 + .../Resources/unidata/upperCase.php | 1489 +++++++++++++++++ .../symfony/polyfill-mbstring/bootstrap.php | 147 ++ .../symfony/polyfill-mbstring/bootstrap80.php | 143 ++ .../symfony/polyfill-mbstring/composer.json | 41 + 9 files changed, 4127 insertions(+) create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/README.md create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php create mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE b/upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE new file mode 100644 index 00000000000..4cd8bdd3007 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2019 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php new file mode 100644 index 00000000000..b65c54a6b56 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -0,0 +1,873 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Mbstring; + +/** + * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. + * + * Implemented: + * - mb_chr - Returns a specific character from its Unicode code point + * - mb_convert_encoding - Convert character encoding + * - mb_convert_variables - Convert character code in variable(s) + * - mb_decode_mimeheader - Decode string in MIME header field + * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference + * - mb_convert_case - Perform case folding on a string + * - mb_detect_encoding - Detect character encoding + * - mb_get_info - Get internal settings of mbstring + * - mb_http_input - Detect HTTP input character encoding + * - mb_http_output - Set/Get HTTP output character encoding + * - mb_internal_encoding - Set/Get internal character encoding + * - mb_list_encodings - Returns an array of all supported encodings + * - mb_ord - Returns the Unicode code point of a character + * - mb_output_handler - Callback function converts character encoding in output buffer + * - mb_scrub - Replaces ill-formed byte sequences with substitute characters + * - mb_strlen - Get string length + * - mb_strpos - Find position of first occurrence of string in a string + * - mb_strrpos - Find position of last occurrence of a string in a string + * - mb_str_split - Convert a string to an array + * - mb_strtolower - Make a string lowercase + * - mb_strtoupper - Make a string uppercase + * - mb_substitute_character - Set/Get substitution character + * - mb_substr - Get part of string + * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive + * - mb_stristr - Finds first occurrence of a string within another, case insensitive + * - mb_strrchr - Finds the last occurrence of a character in a string within another + * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive + * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive + * - mb_strstr - Finds first occurrence of a string within another + * - mb_strwidth - Return width of string + * - mb_substr_count - Count the number of substring occurrences + * + * Not implemented: + * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) + * - mb_ereg_* - Regular expression with multibyte support + * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable + * - mb_preferred_mime_name - Get MIME charset string + * - mb_regex_encoding - Returns current encoding for multibyte regex as string + * - mb_regex_set_options - Set/Get the default options for mbregex functions + * - mb_send_mail - Send encoded mail + * - mb_split - Split multibyte string using regular expression + * - mb_strcut - Get part of string + * - mb_strimwidth - Get truncated string with specified width + * + * @author Nicolas Grekas + * + * @internal + */ +final class Mbstring +{ + public const MB_CASE_FOLD = \PHP_INT_MAX; + + private const 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", 'ι'], + ]; + + private static $encodingList = ['ASCII', 'UTF-8']; + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) + { + if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { + $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); + } else { + $fromEncoding = self::getEncoding($fromEncoding); + } + + $toEncoding = self::getEncoding($toEncoding); + + if ('BASE64' === $fromEncoding) { + $s = base64_decode($s); + $fromEncoding = $toEncoding; + } + + if ('BASE64' === $toEncoding) { + return base64_encode($s); + } + + if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { + if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { + $fromEncoding = 'Windows-1252'; + } + if ('UTF-8' !== $fromEncoding) { + $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s); + } + + return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); + } + + if ('HTML-ENTITIES' === $fromEncoding) { + $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); + $fromEncoding = 'UTF-8'; + } + + return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + } + + public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) + { + $ok = true; + array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { + if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = false; + } + }); + + return $ok ? $fromEncoding : false; + } + + public static function mb_decode_mimeheader($s) + { + return \iconv_mime_decode($s, 2, self::$internalEncoding); + } + + public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) + { + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); + } + + public static function mb_decode_numericentity($s, $convmap, $encoding = null) + { + 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; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + 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). + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $cnt = floor(\count($convmap) / 4) * 4; + + for ($i = 0; $i < $cnt; $i += 4) { + // collector_decode_htmlnumericentity ignores $convmap[$i + 3] + $convmap[$i] += $convmap[$i + 2]; + $convmap[$i + 1] += $convmap[$i + 2]; + } + + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + for ($i = 0; $i < $cnt; $i += 4) { + if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { + return self::mb_chr($c - $convmap[$i + 2]); + } + } + + return $m[0]; + }, $s); + + if (null === $encoding) { + return $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'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + 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)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $cnt = floor(\count($convmap) / 4) * 4; + $i = 0; + $len = \strlen($s); + $result = ''; + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + $c = self::mb_ord($uchr); + + for ($j = 0; $j < $cnt; $j += 4) { + if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { + $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + continue 2; + } + } + $result .= $uchr; + } + + if (null === $encoding) { + return $result; + } + + return \iconv('UTF-8', $encoding.'//IGNORE', $result); + } + + public static function mb_convert_case($s, $mode, $encoding = null) + { + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + } + + if (\MB_CASE_TITLE == $mode) { + static $titleRegexp = null; + if (null === $titleRegexp) { + $titleRegexp = self::getData('titleCaseRegexp'); + } + $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); + } else { + if (\MB_CASE_UPPER == $mode) { + static $upper = null; + if (null === $upper) { + $upper = self::getData('upperCase'); + } + $map = $upper; + } else { + if (self::MB_CASE_FOLD === $mode) { + $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + } + + static $lower = null; + if (null === $lower) { + $lower = self::getData('lowerCase'); + } + $map = $lower; + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if (isset($map[$uchr])) { + $uchr = $map[$uchr]; + $nlen = \strlen($uchr); + + if ($nlen == $ulen) { + $nlen = $i; + do { + $s[--$nlen] = $uchr[--$ulen]; + } while ($ulen); + } else { + $s = substr_replace($s, $uchr, $i - $ulen, $ulen); + $len += $nlen - $ulen; + $i += $nlen - $ulen; + } + } + } + } + + if (null === $encoding) { + return $s; + } + + return \iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_internal_encoding($encoding = null) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + $normalizedEncoding = self::getEncoding($encoding); + + if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + self::$internalEncoding = $normalizedEncoding; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + public static function mb_language($lang = null) + { + if (null === $lang) { + return self::$language; + } + + switch ($normalizedLang = strtolower($lang)) { + case 'uni': + case 'neutral': + self::$language = $normalizedLang; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); + } + + public static function mb_list_encodings() + { + return ['UTF-8']; + } + + public static function mb_encoding_aliases($encoding) + { + switch (strtoupper($encoding)) { + case 'UTF8': + case 'UTF-8': + return ['utf8']; + } + + return false; + } + + public static function mb_check_encoding($var = null, $encoding = null) + { + if (null === $encoding) { + if (null === $var) { + return false; + } + $encoding = self::$internalEncoding; + } + + return self::mb_detect_encoding($var, [$encoding]) || false !== @\iconv($encoding, $encoding, $var); + } + + public static function mb_detect_encoding($str, $encodingList = null, $strict = false) + { + if (null === $encodingList) { + $encodingList = self::$encodingList; + } else { + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + } + + foreach ($encodingList as $enc) { + switch ($enc) { + case 'ASCII': + if (!preg_match('/[\x80-\xFF]/', $str)) { + return $enc; + } + break; + + case 'UTF8': + case 'UTF-8': + if (preg_match('//u', $str)) { + return 'UTF-8'; + } + break; + + default: + if (0 === strncmp($enc, 'ISO-8859-', 9)) { + return $enc; + } + } + } + + return false; + } + + public static function mb_detect_order($encodingList = null) + { + if (null === $encodingList) { + return self::$encodingList; + } + + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + + foreach ($encodingList as $enc) { + switch ($enc) { + default: + if (strncmp($enc, 'ISO-8859-', 9)) { + return false; + } + // no break + case 'ASCII': + case 'UTF8': + case 'UTF-8': + } + } + + self::$encodingList = $encodingList; + + return true; + } + + public static function mb_strlen($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return \strlen($s); + } + + return @\iconv_strlen($s, $encoding); + } + + public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strpos($haystack, $needle, $offset); + } + + $needle = (string) $needle; + if ('' === $needle) { + if (80000 > \PHP_VERSION_ID) { + trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); + + return false; + } + + return 0; + } + + return \iconv_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrpos($haystack, $needle, $offset); + } + + if ($offset != (int) $offset) { + $offset = 0; + } elseif ($offset = (int) $offset) { + if ($offset < 0) { + if (0 > $offset += self::mb_strlen($needle)) { + $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + } + $offset = 0; + } else { + $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); + } + } + + $pos = '' !== $needle || 80000 > \PHP_VERSION_ID + ? \iconv_strrpos($haystack, $needle, $encoding) + : self::mb_strlen($haystack, $encoding); + + return false !== $pos ? $offset + $pos : false; + } + + 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'))) { + trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); + + return 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; + } + + throw new \ValueError('Argument #2 ($length) must be greater than 0'); + } + + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + if ('UTF-8' === $encoding = self::getEncoding($encoding)) { + $rx = '/('; + while (65535 < $split_length) { + $rx .= '.{65535}'; + $split_length -= 65535; + } + $rx .= '.{'.$split_length.'})/us'; + + return preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); + } + + $result = []; + $length = mb_strlen($string, $encoding); + + for ($i = 0; $i < $length; $i += $split_length) { + $result[] = mb_substr($string, $i, $split_length, $encoding); + } + + return $result; + } + + public static function mb_strtolower($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); + } + + public static function mb_strtoupper($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); + } + + public static function mb_substitute_character($c = null) + { + if (null === $c) { + return 'none'; + } + if (0 === strcasecmp($c, 'none')) { + return true; + } + if (80000 > \PHP_VERSION_ID) { + return false; + } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } + + throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); + } + + public static function mb_substr($s, $start, $length = null, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return (string) substr($s, $start, null === $length ? 2147483647 : $length); + } + + if ($start < 0) { + $start = \iconv_strlen($s, $encoding) + $start; + if ($start < 0) { + $start = 0; + } + } + + if (null === $length) { + $length = 2147483647; + } elseif ($length < 0) { + $length = \iconv_strlen($s, $encoding) + $length - $start; + if ($length < 0) { + return ''; + } + } + + 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); + + return self::mb_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) + { + $pos = self::mb_stripos($haystack, $needle, 0, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = \iconv_strrpos($haystack, $needle, $encoding); + } + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) + { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = self::mb_strripos($haystack, $needle, $encoding); + + return self::getSubpart($pos, $part, $haystack, $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); + + return self::mb_strrpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) + { + $pos = strpos($haystack, $needle); + if (false === $pos) { + return false; + } + if ($part) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + public static function mb_get_info($type = 'all') + { + $info = [ + 'internal_encoding' => self::$internalEncoding, + 'http_output' => 'pass', + 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', + 'func_overload' => 0, + 'func_overload_list' => 'no overload', + 'mail_charset' => 'UTF-8', + 'mail_header_encoding' => 'BASE64', + 'mail_body_encoding' => 'BASE64', + 'illegal_chars' => 0, + 'encoding_translation' => 'Off', + 'language' => self::$language, + 'detect_order' => self::$encodingList, + 'substitute_character' => 'none', + 'strict_detection' => 'Off', + ]; + + if ('all' === $type) { + return $info; + } + if (isset($info[$type])) { + return $info[$type]; + } + + return false; + } + + public static function mb_http_input($type = '') + { + return false; + } + + public static function mb_http_output($encoding = null) + { + return null !== $encoding ? 'pass' === $encoding : 'pass'; + } + + public static function mb_strwidth($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + + if ('UTF-8' !== $encoding) { + $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'); + } + + public static function mb_substr_count($haystack, $needle, $encoding = null) + { + return substr_count($haystack, $needle); + } + + public static function mb_output_handler($contents, $status) + { + return $contents; + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } + + private static function getSubpart($pos, $part, $haystack, $encoding) + { + if (false === $pos) { + return false; + } + if ($part) { + return self::mb_substr($haystack, 0, $pos, $encoding); + } + + return self::mb_substr($haystack, $pos, null, $encoding); + } + + private static function html_encoding_callback(array $m) + { + $i = 1; + $entities = ''; + $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); + + while (isset($m[$i])) { + if (0x80 > $m[$i]) { + $entities .= \chr($m[$i++]); + continue; + } + if (0xF0 <= $m[$i]) { + $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } elseif (0xE0 <= $m[$i]) { + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } else { + $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; + } + + $entities .= '&#'.$c.';'; + } + + return $entities; + } + + private static function title_case(array $s) + { + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } + + private static function getEncoding($encoding) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + if ('UTF-8' === $encoding) { + return 'UTF-8'; + } + + $encoding = strtoupper($encoding); + + if ('8BIT' === $encoding || 'BINARY' === $encoding) { + return 'CP850'; + } + + if ('UTF8' === $encoding) { + return 'UTF-8'; + } + + return $encoding; + } +} diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/README.md b/upload/system/storage/vendor/symfony/polyfill-mbstring/README.md new file mode 100644 index 00000000000..4efb599d81f --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/README.md @@ -0,0 +1,13 @@ +Symfony Polyfill / Mbstring +=========================== + +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). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php new file mode 100644 index 00000000000..fac60b081a1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -0,0 +1,1397 @@ + 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + 'À' => 'à', + 'Ã' => 'á', + 'Â' => 'â', + 'Ã' => 'ã', + 'Ä' => 'ä', + 'Ã…' => 'Ã¥', + 'Æ' => 'æ', + 'Ç' => 'ç', + 'È' => 'è', + 'É' => 'é', + 'Ê' => 'ê', + 'Ë' => 'ë', + 'ÃŒ' => 'ì', + 'Ã' => 'í', + 'ÃŽ' => 'î', + 'Ã' => 'ï', + 'Ã' => 'ð', + 'Ñ' => 'ñ', + 'Ã’' => 'ò', + 'Ó' => 'ó', + 'Ô' => 'ô', + 'Õ' => 'õ', + 'Ö' => 'ö', + 'Ø' => 'ø', + 'Ù' => 'ù', + 'Ú' => 'ú', + 'Û' => 'û', + 'Ãœ' => 'ü', + 'Ã' => 'ý', + 'Þ' => 'þ', + 'Ä€' => 'Ä', + 'Ä‚' => 'ă', + 'Ä„' => 'Ä…', + 'Ć' => 'ć', + 'Ĉ' => 'ĉ', + 'ÄŠ' => 'Ä‹', + 'ÄŒ' => 'Ä', + 'ÄŽ' => 'Ä', + 'Ä' => 'Ä‘', + 'Ä’' => 'Ä“', + 'Ä”' => 'Ä•', + 'Ä–' => 'Ä—', + 'Ę' => 'Ä™', + 'Äš' => 'Ä›', + 'Äœ' => 'Ä', + 'Äž' => 'ÄŸ', + 'Ä ' => 'Ä¡', + 'Ä¢' => 'Ä£', + 'Ĥ' => 'Ä¥', + 'Ħ' => 'ħ', + 'Ĩ' => 'Ä©', + 'Ī' => 'Ä«', + 'Ĭ' => 'Ä­', + 'Ä®' => 'į', + 'Ä°' => 'i̇', + 'IJ' => 'ij', + 'Ä´' => 'ĵ', + 'Ķ' => 'Ä·', + 'Ĺ' => 'ĺ', + 'Ä»' => 'ļ', + 'Ľ' => 'ľ', + 'Ä¿' => 'Å€', + 'Å' => 'Å‚', + 'Ń' => 'Å„', + 'Å…' => 'ņ', + 'Ň' => 'ň', + 'ÅŠ' => 'Å‹', + 'ÅŒ' => 'Å', + 'ÅŽ' => 'Å', + 'Å' => 'Å‘', + 'Å’' => 'Å“', + 'Å”' => 'Å•', + 'Å–' => 'Å—', + 'Ř' => 'Å™', + 'Åš' => 'Å›', + 'Åœ' => 'Å', + 'Åž' => 'ÅŸ', + 'Å ' => 'Å¡', + 'Å¢' => 'Å£', + 'Ť' => 'Å¥', + 'Ŧ' => 'ŧ', + 'Ũ' => 'Å©', + 'Ū' => 'Å«', + 'Ŭ' => 'Å­', + 'Å®' => 'ů', + 'Å°' => 'ű', + 'Ų' => 'ų', + 'Å´' => 'ŵ', + 'Ŷ' => 'Å·', + 'Ÿ' => 'ÿ', + 'Ź' => 'ź', + 'Å»' => 'ż', + 'Ž' => 'ž', + 'Æ' => 'É“', + 'Æ‚' => 'ƃ', + 'Æ„' => 'Æ…', + 'Ɔ' => 'É”', + 'Ƈ' => 'ƈ', + 'Ɖ' => 'É–', + 'ÆŠ' => 'É—', + 'Æ‹' => 'ÆŒ', + 'ÆŽ' => 'Ç', + 'Æ' => 'É™', + 'Æ' => 'É›', + 'Æ‘' => 'Æ’', + 'Æ“' => 'É ', + 'Æ”' => 'É£', + 'Æ–' => 'É©', + 'Æ—' => 'ɨ', + 'Ƙ' => 'Æ™', + 'Æœ' => 'ɯ', + 'Æ' => 'ɲ', + 'ÆŸ' => 'ɵ', + 'Æ ' => 'Æ¡', + 'Æ¢' => 'Æ£', + 'Ƥ' => 'Æ¥', + 'Ʀ' => 'Ê€', + 'Ƨ' => 'ƨ', + 'Æ©' => 'ʃ', + 'Ƭ' => 'Æ­', + 'Æ®' => 'ʈ', + 'Ư' => 'Æ°', + 'Ʊ' => 'ÊŠ', + 'Ʋ' => 'Ê‹', + 'Ƴ' => 'Æ´', + 'Ƶ' => 'ƶ', + 'Æ·' => 'Ê’', + 'Ƹ' => 'ƹ', + 'Ƽ' => 'ƽ', + 'Ç„' => 'dž', + 'Ç…' => 'dž', + 'LJ' => 'lj', + 'Lj' => 'lj', + 'ÇŠ' => 'ÇŒ', + 'Ç‹' => 'ÇŒ', + 'Ç' => 'ÇŽ', + 'Ç' => 'Ç', + 'Ç‘' => 'Ç’', + 'Ç“' => 'Ç”', + 'Ç•' => 'Ç–', + 'Ç—' => 'ǘ', + 'Ç™' => 'Çš', + 'Ç›' => 'Çœ', + 'Çž' => 'ÇŸ', + 'Ç ' => 'Ç¡', + 'Ç¢' => 'Ç£', + 'Ǥ' => 'Ç¥', + 'Ǧ' => 'ǧ', + 'Ǩ' => 'Ç©', + 'Ǫ' => 'Ç«', + 'Ǭ' => 'Ç­', + 'Ç®' => 'ǯ', + 'DZ' => 'dz', + 'Dz' => 'dz', + 'Ç´' => 'ǵ', + 'Ƕ' => 'Æ•', + 'Ç·' => 'Æ¿', + 'Ǹ' => 'ǹ', + 'Ǻ' => 'Ç»', + 'Ǽ' => 'ǽ', + 'Ǿ' => 'Ç¿', + 'È€' => 'È', + 'È‚' => 'ȃ', + 'È„' => 'È…', + 'Ȇ' => 'ȇ', + 'Ȉ' => 'ȉ', + 'ÈŠ' => 'È‹', + 'ÈŒ' => 'È', + 'ÈŽ' => 'È', + 'È' => 'È‘', + 'È’' => 'È“', + 'È”' => 'È•', + 'È–' => 'È—', + 'Ș' => 'È™', + 'Èš' => 'È›', + 'Èœ' => 'È', + 'Èž' => 'ÈŸ', + 'È ' => 'Æž', + 'È¢' => 'È£', + 'Ȥ' => 'È¥', + 'Ȧ' => 'ȧ', + 'Ȩ' => 'È©', + 'Ȫ' => 'È«', + 'Ȭ' => 'È­', + 'È®' => 'ȯ', + 'È°' => 'ȱ', + 'Ȳ' => 'ȳ', + 'Ⱥ' => 'â±¥', + 'È»' => 'ȼ', + 'Ƚ' => 'Æš', + 'Ⱦ' => 'ⱦ', + 'É' => 'É‚', + 'Ƀ' => 'Æ€', + 'É„' => 'ʉ', + 'É…' => 'ÊŒ', + 'Ɇ' => 'ɇ', + 'Ɉ' => 'ɉ', + 'ÉŠ' => 'É‹', + 'ÉŒ' => 'É', + 'ÉŽ' => 'É', + 'Í°' => 'ͱ', + 'Ͳ' => 'ͳ', + 'Ͷ' => 'Í·', + 'Í¿' => 'ϳ', + 'Ά' => 'ά', + 'Έ' => 'έ', + 'Ή' => 'ή', + 'Ί' => 'ί', + 'ÎŒ' => 'ÏŒ', + 'ÎŽ' => 'Ï', + 'Î' => 'ÏŽ', + 'Α' => 'α', + 'Î’' => 'β', + 'Γ' => 'γ', + 'Δ' => 'δ', + 'Ε' => 'ε', + 'Ζ' => 'ζ', + 'Η' => 'η', + 'Θ' => 'θ', + 'Ι' => 'ι', + 'Κ' => 'κ', + 'Λ' => 'λ', + 'Îœ' => 'μ', + 'Î' => 'ν', + 'Ξ' => 'ξ', + 'Ο' => 'ο', + 'Π' => 'Ï€', + 'Ρ' => 'Ï', + 'Σ' => 'σ', + 'Τ' => 'Ï„', + 'Î¥' => 'Ï…', + 'Φ' => 'φ', + 'Χ' => 'χ', + 'Ψ' => 'ψ', + 'Ω' => 'ω', + 'Ϊ' => 'ÏŠ', + 'Ϋ' => 'Ï‹', + 'Ï' => 'Ï—', + 'Ϙ' => 'Ï™', + 'Ïš' => 'Ï›', + 'Ïœ' => 'Ï', + 'Ïž' => 'ÏŸ', + 'Ï ' => 'Ï¡', + 'Ï¢' => 'Ï£', + 'Ϥ' => 'Ï¥', + 'Ϧ' => 'ϧ', + 'Ϩ' => 'Ï©', + 'Ϫ' => 'Ï«', + 'Ϭ' => 'Ï­', + 'Ï®' => 'ϯ', + 'Ï´' => 'θ', + 'Ï·' => 'ϸ', + 'Ϲ' => 'ϲ', + 'Ϻ' => 'Ï»', + 'Ͻ' => 'Í»', + 'Ͼ' => 'ͼ', + 'Ï¿' => 'ͽ', + 'Ѐ' => 'Ñ', + 'Ð' => 'Ñ‘', + 'Ђ' => 'Ñ’', + 'Ѓ' => 'Ñ“', + 'Є' => 'Ñ”', + 'Ð…' => 'Ñ•', + 'І' => 'Ñ–', + 'Ї' => 'Ñ—', + 'Ј' => 'ј', + 'Љ' => 'Ñ™', + 'Њ' => 'Ñš', + 'Ћ' => 'Ñ›', + 'ÐŒ' => 'Ñœ', + 'Ð' => 'Ñ', + 'ÐŽ' => 'Ñž', + 'Ð' => 'ÑŸ', + 'Ð' => 'а', + 'Б' => 'б', + 'Ð’' => 'в', + 'Г' => 'г', + 'Д' => 'д', + 'Е' => 'е', + 'Ж' => 'ж', + 'З' => 'з', + 'И' => 'и', + 'Й' => 'й', + 'К' => 'к', + 'Л' => 'л', + 'Ðœ' => 'м', + 'Ð' => 'н', + 'О' => 'о', + 'П' => 'п', + 'Р' => 'Ñ€', + 'С' => 'Ñ', + 'Т' => 'Ñ‚', + 'У' => 'у', + 'Ф' => 'Ñ„', + 'Ð¥' => 'Ñ…', + 'Ц' => 'ц', + 'Ч' => 'ч', + 'Ш' => 'ш', + 'Щ' => 'щ', + 'Ъ' => 'ÑŠ', + 'Ы' => 'Ñ‹', + 'Ь' => 'ÑŒ', + 'Э' => 'Ñ', + 'Ю' => 'ÑŽ', + 'Я' => 'Ñ', + 'Ñ ' => 'Ñ¡', + 'Ñ¢' => 'Ñ£', + 'Ѥ' => 'Ñ¥', + 'Ѧ' => 'ѧ', + 'Ѩ' => 'Ñ©', + 'Ѫ' => 'Ñ«', + 'Ѭ' => 'Ñ­', + 'Ñ®' => 'ѯ', + 'Ñ°' => 'ѱ', + 'Ѳ' => 'ѳ', + 'Ñ´' => 'ѵ', + 'Ѷ' => 'Ñ·', + 'Ѹ' => 'ѹ', + 'Ѻ' => 'Ñ»', + 'Ѽ' => 'ѽ', + 'Ѿ' => 'Ñ¿', + 'Ò€' => 'Ò', + 'ÒŠ' => 'Ò‹', + 'ÒŒ' => 'Ò', + 'ÒŽ' => 'Ò', + 'Ò' => 'Ò‘', + 'Ò’' => 'Ò“', + 'Ò”' => 'Ò•', + 'Ò–' => 'Ò—', + 'Ò˜' => 'Ò™', + 'Òš' => 'Ò›', + 'Òœ' => 'Ò', + 'Òž' => 'ÒŸ', + 'Ò ' => 'Ò¡', + 'Ò¢' => 'Ò£', + 'Ò¤' => 'Ò¥', + 'Ò¦' => 'Ò§', + 'Ò¨' => 'Ò©', + 'Òª' => 'Ò«', + 'Ò¬' => 'Ò­', + 'Ò®' => 'Ò¯', + 'Ò°' => 'Ò±', + 'Ò²' => 'Ò³', + 'Ò´' => 'Òµ', + 'Ò¶' => 'Ò·', + 'Ò¸' => 'Ò¹', + 'Òº' => 'Ò»', + 'Ò¼' => 'Ò½', + 'Ò¾' => 'Ò¿', + 'Ó€' => 'Ó', + 'Ó' => 'Ó‚', + 'Óƒ' => 'Ó„', + 'Ó…' => 'Ó†', + 'Ó‡' => 'Óˆ', + 'Ó‰' => 'ÓŠ', + 'Ó‹' => 'ÓŒ', + 'Ó' => 'ÓŽ', + 'Ó' => 'Ó‘', + 'Ó’' => 'Ó“', + 'Ó”' => 'Ó•', + 'Ó–' => 'Ó—', + 'Ó˜' => 'Ó™', + 'Óš' => 'Ó›', + 'Óœ' => 'Ó', + 'Óž' => 'ÓŸ', + 'Ó ' => 'Ó¡', + 'Ó¢' => 'Ó£', + 'Ó¤' => 'Ó¥', + 'Ó¦' => 'Ó§', + 'Ó¨' => 'Ó©', + 'Óª' => 'Ó«', + 'Ó¬' => 'Ó­', + 'Ó®' => 'Ó¯', + 'Ó°' => 'Ó±', + 'Ó²' => 'Ó³', + 'Ó´' => 'Óµ', + 'Ó¶' => 'Ó·', + 'Ó¸' => 'Ó¹', + 'Óº' => 'Ó»', + 'Ó¼' => 'Ó½', + 'Ó¾' => 'Ó¿', + 'Ô€' => 'Ô', + 'Ô‚' => 'Ôƒ', + 'Ô„' => 'Ô…', + 'Ô†' => 'Ô‡', + 'Ôˆ' => 'Ô‰', + 'ÔŠ' => 'Ô‹', + 'ÔŒ' => 'Ô', + 'ÔŽ' => 'Ô', + 'Ô' => 'Ô‘', + 'Ô’' => 'Ô“', + 'Ô”' => 'Ô•', + 'Ô–' => 'Ô—', + 'Ô˜' => 'Ô™', + 'Ôš' => 'Ô›', + 'Ôœ' => 'Ô', + 'Ôž' => 'ÔŸ', + 'Ô ' => 'Ô¡', + 'Ô¢' => 'Ô£', + 'Ô¤' => 'Ô¥', + 'Ô¦' => 'Ô§', + 'Ô¨' => 'Ô©', + 'Ôª' => 'Ô«', + 'Ô¬' => 'Ô­', + 'Ô®' => 'Ô¯', + 'Ô±' => 'Õ¡', + 'Ô²' => 'Õ¢', + 'Ô³' => 'Õ£', + 'Ô´' => 'Õ¤', + 'Ôµ' => 'Õ¥', + 'Ô¶' => 'Õ¦', + 'Ô·' => 'Õ§', + 'Ô¸' => 'Õ¨', + 'Ô¹' => 'Õ©', + 'Ôº' => 'Õª', + 'Ô»' => 'Õ«', + 'Ô¼' => 'Õ¬', + 'Ô½' => 'Õ­', + 'Ô¾' => 'Õ®', + 'Ô¿' => 'Õ¯', + 'Õ€' => 'Õ°', + 'Õ' => 'Õ±', + 'Õ‚' => 'Õ²', + 'Õƒ' => 'Õ³', + 'Õ„' => 'Õ´', + 'Õ…' => 'Õµ', + 'Õ†' => 'Õ¶', + 'Õ‡' => 'Õ·', + 'Õˆ' => 'Õ¸', + 'Õ‰' => 'Õ¹', + 'ÕŠ' => 'Õº', + 'Õ‹' => 'Õ»', + 'ÕŒ' => 'Õ¼', + 'Õ' => 'Õ½', + 'ÕŽ' => 'Õ¾', + 'Õ' => 'Õ¿', + 'Õ' => 'Ö€', + 'Õ‘' => 'Ö', + 'Õ’' => 'Ö‚', + 'Õ“' => 'Öƒ', + 'Õ”' => 'Ö„', + 'Õ•' => 'Ö…', + 'Õ–' => 'Ö†', + 'á‚ ' => 'â´€', + 'á‚¡' => 'â´', + 'á‚¢' => 'â´‚', + 'á‚£' => 'â´ƒ', + 'Ⴄ' => 'â´„', + 'á‚¥' => 'â´…', + 'Ⴆ' => 'â´†', + 'Ⴇ' => 'â´‡', + 'Ⴈ' => 'â´ˆ', + 'á‚©' => 'â´‰', + 'Ⴊ' => 'â´Š', + 'á‚«' => 'â´‹', + 'Ⴌ' => 'â´Œ', + 'á‚­' => 'â´', + 'á‚®' => 'â´Ž', + 'Ⴏ' => 'â´', + 'á‚°' => 'â´', + 'Ⴑ' => 'â´‘', + 'Ⴒ' => 'â´’', + 'Ⴓ' => 'â´“', + 'á‚´' => 'â´”', + 'Ⴕ' => 'â´•', + 'Ⴖ' => 'â´–', + 'á‚·' => 'â´—', + 'Ⴘ' => 'â´˜', + 'Ⴙ' => 'â´™', + 'Ⴚ' => 'â´š', + 'á‚»' => 'â´›', + 'Ⴜ' => 'â´œ', + 'Ⴝ' => 'â´', + 'Ⴞ' => 'â´ž', + 'á‚¿' => 'â´Ÿ', + 'Ⴠ' => 'â´ ', + 'áƒ' => 'â´¡', + 'Ⴢ' => 'â´¢', + 'Ⴣ' => 'â´£', + 'Ⴤ' => 'â´¤', + 'Ⴥ' => 'â´¥', + 'Ⴧ' => 'â´§', + 'áƒ' => 'â´­', + 'Ꭰ' => 'ê­°', + 'Ꭱ' => 'ê­±', + 'Ꭲ' => 'ê­²', + 'Ꭳ' => 'ê­³', + 'Ꭴ' => 'ê­´', + 'Ꭵ' => 'ê­µ', + 'Ꭶ' => 'ê­¶', + 'Ꭷ' => 'ê­·', + 'Ꭸ' => 'ê­¸', + 'Ꭹ' => 'ê­¹', + 'Ꭺ' => 'ê­º', + 'Ꭻ' => 'ê­»', + 'Ꭼ' => 'ê­¼', + 'Ꭽ' => 'ê­½', + 'Ꭾ' => 'ê­¾', + 'Ꭿ' => 'ê­¿', + 'Ꮀ' => 'ꮀ', + 'Ꮁ' => 'ê®', + 'Ꮂ' => 'ꮂ', + 'Ꮃ' => 'ꮃ', + 'Ꮄ' => 'ꮄ', + 'Ꮅ' => 'ê®…', + 'Ꮆ' => 'ꮆ', + 'Ꮇ' => 'ꮇ', + 'Ꮈ' => 'ꮈ', + 'Ꮉ' => 'ꮉ', + 'Ꮊ' => 'ꮊ', + 'Ꮋ' => 'ꮋ', + 'Ꮌ' => 'ꮌ', + 'Ꮍ' => 'ê®', + 'Ꮎ' => 'ꮎ', + 'Ꮏ' => 'ê®', + 'á€' => 'ê®', + 'á' => 'ꮑ', + 'á‚' => 'ê®’', + 'áƒ' => 'ꮓ', + 'á„' => 'ê®”', + 'á…' => 'ꮕ', + 'á†' => 'ê®–', + 'á‡' => 'ê®—', + 'áˆ' => 'ꮘ', + 'á‰' => 'ê®™', + 'áŠ' => 'ꮚ', + 'á‹' => 'ê®›', + 'áŒ' => 'ꮜ', + 'á' => 'ê®', + 'áŽ' => 'ꮞ', + 'á' => 'ꮟ', + 'á' => 'ê® ', + 'á‘' => 'ꮡ', + 'á’' => 'ꮢ', + 'á“' => 'ꮣ', + 'á”' => 'ꮤ', + 'á•' => 'ꮥ', + 'á–' => 'ꮦ', + 'á—' => 'ꮧ', + 'á˜' => 'ꮨ', + 'á™' => 'ꮩ', + 'áš' => 'ꮪ', + 'á›' => 'ꮫ', + 'áœ' => 'ꮬ', + 'á' => 'ê®­', + 'áž' => 'ê®®', + 'áŸ' => 'ꮯ', + 'á ' => 'ê®°', + 'á¡' => 'ê®±', + 'á¢' => 'ꮲ', + 'á£' => 'ꮳ', + 'á¤' => 'ê®´', + 'á¥' => 'ꮵ', + 'á¦' => 'ꮶ', + 'á§' => 'ê®·', + 'á¨' => 'ꮸ', + 'á©' => 'ꮹ', + 'áª' => 'ꮺ', + 'á«' => 'ê®»', + 'á¬' => 'ꮼ', + 'á­' => 'ꮽ', + 'á®' => 'ꮾ', + 'á¯' => 'ꮿ', + 'á°' => 'á¸', + 'á±' => 'á¹', + 'á²' => 'áº', + 'á³' => 'á»', + 'á´' => 'á¼', + 'áµ' => 'á½', + 'á²' => 'áƒ', + 'Ბ' => 'ბ', + 'á²’' => 'გ', + 'Დ' => 'დ', + 'á²”' => 'ე', + 'Ვ' => 'ვ', + 'á²–' => 'ზ', + 'á²—' => 'თ', + 'Ი' => 'ი', + 'á²™' => 'კ', + 'Ლ' => 'ლ', + 'á²›' => 'მ', + 'Ნ' => 'ნ', + 'á²' => 'áƒ', + 'Პ' => 'პ', + 'Ჟ' => 'ჟ', + 'á² ' => 'რ', + 'Ს' => 'ს', + 'á²¢' => 'ტ', + 'á²£' => 'უ', + 'Ფ' => 'ფ', + 'á²¥' => 'ქ', + 'Ღ' => 'ღ', + 'Ყ' => 'ყ', + 'Შ' => 'შ', + 'Ჩ' => 'ჩ', + 'Ც' => 'ც', + 'Ძ' => 'ძ', + 'Წ' => 'წ', + 'á²­' => 'ჭ', + 'á²®' => 'ხ', + 'Ჯ' => 'ჯ', + 'á²°' => 'ჰ', + 'á²±' => 'ჱ', + 'á²²' => 'ჲ', + 'á²³' => 'ჳ', + 'á²´' => 'ჴ', + 'á²µ' => 'ჵ', + 'Ჶ' => 'ჶ', + 'á²·' => 'ჷ', + 'Ჸ' => 'ჸ', + 'á²¹' => 'ჹ', + 'Ჺ' => 'ჺ', + 'á²½' => 'ჽ', + 'á²¾' => 'ჾ', + 'Ჿ' => 'ჿ', + 'Ḁ' => 'á¸', + 'Ḃ' => 'ḃ', + 'Ḅ' => 'ḅ', + 'Ḇ' => 'ḇ', + 'Ḉ' => 'ḉ', + 'Ḋ' => 'ḋ', + 'Ḍ' => 'á¸', + 'Ḏ' => 'á¸', + 'á¸' => 'ḑ', + 'Ḓ' => 'ḓ', + 'Ḕ' => 'ḕ', + 'Ḗ' => 'ḗ', + 'Ḙ' => 'ḙ', + 'Ḛ' => 'ḛ', + 'Ḝ' => 'á¸', + 'Ḟ' => 'ḟ', + 'Ḡ' => 'ḡ', + 'Ḣ' => 'ḣ', + 'Ḥ' => 'ḥ', + 'Ḧ' => 'ḧ', + 'Ḩ' => 'ḩ', + 'Ḫ' => 'ḫ', + 'Ḭ' => 'ḭ', + 'Ḯ' => 'ḯ', + 'Ḱ' => 'ḱ', + 'Ḳ' => 'ḳ', + 'Ḵ' => 'ḵ', + 'Ḷ' => 'ḷ', + 'Ḹ' => 'ḹ', + 'Ḻ' => 'ḻ', + 'Ḽ' => 'ḽ', + 'Ḿ' => 'ḿ', + 'á¹€' => 'á¹', + 'Ṃ' => 'ṃ', + 'Ṅ' => 'á¹…', + 'Ṇ' => 'ṇ', + 'Ṉ' => 'ṉ', + 'Ṋ' => 'ṋ', + 'Ṍ' => 'á¹', + 'Ṏ' => 'á¹', + 'á¹' => 'ṑ', + 'á¹’' => 'ṓ', + 'á¹”' => 'ṕ', + 'á¹–' => 'á¹—', + 'Ṙ' => 'á¹™', + 'Ṛ' => 'á¹›', + 'Ṝ' => 'á¹', + 'Ṟ' => 'ṟ', + 'á¹ ' => 'ṡ', + 'á¹¢' => 'á¹£', + 'Ṥ' => 'á¹¥', + 'Ṧ' => 'ṧ', + 'Ṩ' => 'ṩ', + 'Ṫ' => 'ṫ', + 'Ṭ' => 'á¹­', + 'á¹®' => 'ṯ', + 'á¹°' => 'á¹±', + 'á¹²' => 'á¹³', + 'á¹´' => 'á¹µ', + 'Ṷ' => 'á¹·', + 'Ṹ' => 'á¹¹', + 'Ṻ' => 'á¹»', + 'á¹¼' => 'á¹½', + 'á¹¾' => 'ṿ', + 'Ẁ' => 'áº', + 'Ẃ' => 'ẃ', + 'Ẅ' => 'ẅ', + 'Ẇ' => 'ẇ', + 'Ẉ' => 'ẉ', + 'Ẋ' => 'ẋ', + 'Ẍ' => 'áº', + 'Ẏ' => 'áº', + 'áº' => 'ẑ', + 'Ẓ' => 'ẓ', + 'Ẕ' => 'ẕ', + 'ẞ' => 'ß', + 'Ạ' => 'ạ', + 'Ả' => 'ả', + 'Ấ' => 'ấ', + 'Ầ' => 'ầ', + 'Ẩ' => 'ẩ', + 'Ẫ' => 'ẫ', + 'Ậ' => 'ậ', + 'Ắ' => 'ắ', + 'Ằ' => 'ằ', + 'Ẳ' => 'ẳ', + 'Ẵ' => 'ẵ', + 'Ặ' => 'ặ', + 'Ẹ' => 'ẹ', + 'Ẻ' => 'ẻ', + 'Ẽ' => 'ẽ', + 'Ế' => 'ế', + 'Ề' => 'á»', + 'Ể' => 'ể', + 'Ễ' => 'á»…', + 'Ệ' => 'ệ', + 'Ỉ' => 'ỉ', + 'Ị' => 'ị', + 'Ọ' => 'á»', + 'Ỏ' => 'á»', + 'á»' => 'ố', + 'á»’' => 'ồ', + 'á»”' => 'ổ', + 'á»–' => 'á»—', + 'Ộ' => 'á»™', + 'Ớ' => 'á»›', + 'Ờ' => 'á»', + 'Ở' => 'ở', + 'á» ' => 'ỡ', + 'Ợ' => 'ợ', + 'Ụ' => 'ụ', + 'Ủ' => 'ủ', + 'Ứ' => 'ứ', + 'Ừ' => 'ừ', + 'Ử' => 'á»­', + 'á»®' => 'ữ', + 'á»°' => 'á»±', + 'Ỳ' => 'ỳ', + 'á»´' => 'ỵ', + 'Ỷ' => 'á»·', + 'Ỹ' => 'ỹ', + 'Ỻ' => 'á»»', + 'Ỽ' => 'ỽ', + 'Ỿ' => 'ỿ', + 'Ἀ' => 'á¼€', + 'Ἁ' => 'á¼', + 'Ἂ' => 'ἂ', + 'Ἃ' => 'ἃ', + 'Ἄ' => 'ἄ', + 'á¼' => 'á¼…', + 'Ἆ' => 'ἆ', + 'á¼' => 'ἇ', + 'Ἐ' => 'á¼', + 'á¼™' => 'ἑ', + 'Ἒ' => 'á¼’', + 'á¼›' => 'ἓ', + 'Ἔ' => 'á¼”', + 'á¼' => 'ἕ', + 'Ἠ' => 'á¼ ', + 'Ἡ' => 'ἡ', + 'Ἢ' => 'á¼¢', + 'Ἣ' => 'á¼£', + 'Ἤ' => 'ἤ', + 'á¼­' => 'á¼¥', + 'á¼®' => 'ἦ', + 'Ἧ' => 'ἧ', + 'Ἰ' => 'á¼°', + 'á¼¹' => 'á¼±', + 'Ἲ' => 'á¼²', + 'á¼»' => 'á¼³', + 'á¼¼' => 'á¼´', + 'á¼½' => 'á¼µ', + 'á¼¾' => 'ἶ', + 'Ἷ' => 'á¼·', + 'Ὀ' => 'á½€', + 'Ὁ' => 'á½', + 'Ὂ' => 'ὂ', + 'Ὃ' => 'ὃ', + 'Ὄ' => 'ὄ', + 'á½' => 'á½…', + 'á½™' => 'ὑ', + 'á½›' => 'ὓ', + 'á½' => 'ὕ', + 'Ὗ' => 'á½—', + 'Ὠ' => 'á½ ', + 'Ὡ' => 'ὡ', + 'Ὢ' => 'á½¢', + 'Ὣ' => 'á½£', + 'Ὤ' => 'ὤ', + 'á½­' => 'á½¥', + 'á½®' => 'ὦ', + 'Ὧ' => 'ὧ', + 'ᾈ' => 'á¾€', + 'ᾉ' => 'á¾', + 'ᾊ' => 'ᾂ', + 'ᾋ' => 'ᾃ', + 'ᾌ' => 'ᾄ', + 'á¾' => 'á¾…', + 'ᾎ' => 'ᾆ', + 'á¾' => 'ᾇ', + 'ᾘ' => 'á¾', + 'á¾™' => 'ᾑ', + 'ᾚ' => 'á¾’', + 'á¾›' => 'ᾓ', + 'ᾜ' => 'á¾”', + 'á¾' => 'ᾕ', + 'ᾞ' => 'á¾–', + 'ᾟ' => 'á¾—', + 'ᾨ' => 'á¾ ', + 'ᾩ' => 'ᾡ', + 'ᾪ' => 'á¾¢', + 'ᾫ' => 'á¾£', + 'ᾬ' => 'ᾤ', + 'á¾­' => 'á¾¥', + 'á¾®' => 'ᾦ', + 'ᾯ' => 'ᾧ', + 'Ᾰ' => 'á¾°', + 'á¾¹' => 'á¾±', + 'Ὰ' => 'á½°', + 'á¾»' => 'á½±', + 'á¾¼' => 'á¾³', + 'Ὲ' => 'á½²', + 'Έ' => 'á½³', + 'á¿Š' => 'á½´', + 'á¿‹' => 'á½µ', + 'á¿Œ' => 'ῃ', + 'Ῐ' => 'á¿', + 'á¿™' => 'á¿‘', + 'á¿š' => 'ὶ', + 'á¿›' => 'á½·', + 'Ῠ' => 'á¿ ', + 'á¿©' => 'á¿¡', + 'Ὺ' => 'ὺ', + 'á¿«' => 'á½»', + 'Ῥ' => 'á¿¥', + 'Ὸ' => 'ὸ', + 'Ό' => 'á½¹', + 'Ὼ' => 'á½¼', + 'á¿»' => 'á½½', + 'ῼ' => 'ῳ', + 'Ω' => 'ω', + 'K' => 'k', + 'â„«' => 'Ã¥', + 'Ⅎ' => 'â…Ž', + 'â… ' => 'â…°', + 'â…¡' => 'â…±', + 'â…¢' => 'â…²', + 'â…£' => 'â…³', + 'â…¤' => 'â…´', + 'â…¥' => 'â…µ', + 'â…¦' => 'â…¶', + 'â…§' => 'â…·', + 'â…¨' => 'â…¸', + 'â…©' => 'â…¹', + 'â…ª' => 'â…º', + 'â…«' => 'â…»', + 'â…¬' => 'â…¼', + 'â…­' => 'â…½', + 'â…®' => 'â…¾', + 'â…¯' => 'â…¿', + 'Ↄ' => 'ↄ', + 'â’¶' => 'â“', + 'â’·' => 'â“‘', + 'â’¸' => 'â“’', + 'â’¹' => 'â““', + 'â’º' => 'â“”', + 'â’»' => 'â“•', + 'â’¼' => 'â“–', + 'â’½' => 'â“—', + 'â’¾' => 'ⓘ', + 'â’¿' => 'â“™', + 'â“€' => 'â“š', + 'â“' => 'â“›', + 'â“‚' => 'â“œ', + 'Ⓝ' => 'â“', + 'â“„' => 'â“ž', + 'â“…' => 'â“Ÿ', + 'Ⓠ' => 'â“ ', + 'Ⓡ' => 'â“¡', + 'Ⓢ' => 'â“¢', + 'Ⓣ' => 'â“£', + 'â“Š' => 'ⓤ', + 'â“‹' => 'â“¥', + 'â“Œ' => 'ⓦ', + 'â“' => 'ⓧ', + 'â“Ž' => 'ⓨ', + 'â“' => 'â“©', + 'â°€' => 'â°°', + 'â°' => 'â°±', + 'â°‚' => 'â°²', + 'â°ƒ' => 'â°³', + 'â°„' => 'â°´', + 'â°…' => 'â°µ', + 'â°†' => 'â°¶', + 'â°‡' => 'â°·', + 'â°ˆ' => 'â°¸', + 'â°‰' => 'â°¹', + 'â°Š' => 'â°º', + 'â°‹' => 'â°»', + 'â°Œ' => 'â°¼', + 'â°' => 'â°½', + 'â°Ž' => 'â°¾', + 'â°' => 'â°¿', + 'â°' => 'â±€', + 'â°‘' => 'â±', + 'â°’' => 'ⱂ', + 'â°“' => 'ⱃ', + 'â°”' => 'ⱄ', + 'â°•' => 'â±…', + 'â°–' => 'ⱆ', + 'â°—' => 'ⱇ', + 'â°˜' => 'ⱈ', + 'â°™' => 'ⱉ', + 'â°š' => 'ⱊ', + 'â°›' => 'ⱋ', + 'â°œ' => 'ⱌ', + 'â°' => 'â±', + 'â°ž' => 'ⱎ', + 'â°Ÿ' => 'â±', + 'â° ' => 'â±', + 'â°¡' => 'ⱑ', + 'â°¢' => 'â±’', + 'â°£' => 'ⱓ', + 'â°¤' => 'â±”', + 'â°¥' => 'ⱕ', + 'â°¦' => 'â±–', + 'â°§' => 'â±—', + 'â°¨' => 'ⱘ', + 'â°©' => 'â±™', + 'â°ª' => 'ⱚ', + 'â°«' => 'â±›', + 'â°¬' => 'ⱜ', + 'â°­' => 'â±', + 'â°®' => 'ⱞ', + 'â± ' => 'ⱡ', + 'â±¢' => 'É«', + 'â±£' => 'áµ½', + 'Ɽ' => 'ɽ', + 'Ⱨ' => 'ⱨ', + 'Ⱪ' => 'ⱪ', + 'Ⱬ' => 'ⱬ', + 'â±­' => 'É‘', + 'â±®' => 'ɱ', + 'Ɐ' => 'É', + 'â±°' => 'É’', + 'â±²' => 'â±³', + 'â±µ' => 'ⱶ', + 'â±¾' => 'È¿', + 'Ɀ' => 'É€', + 'â²€' => 'â²', + 'Ⲃ' => 'ⲃ', + 'Ⲅ' => 'â²…', + 'Ⲇ' => 'ⲇ', + 'Ⲉ' => 'ⲉ', + 'Ⲋ' => 'ⲋ', + 'Ⲍ' => 'â²', + 'Ⲏ' => 'â²', + 'â²' => 'ⲑ', + 'â²’' => 'ⲓ', + 'â²”' => 'ⲕ', + 'â²–' => 'â²—', + 'Ⲙ' => 'â²™', + 'Ⲛ' => 'â²›', + 'Ⲝ' => 'â²', + 'Ⲟ' => 'ⲟ', + 'â² ' => 'ⲡ', + 'â²¢' => 'â²£', + 'Ⲥ' => 'â²¥', + 'Ⲧ' => 'ⲧ', + 'Ⲩ' => 'ⲩ', + 'Ⲫ' => 'ⲫ', + 'Ⲭ' => 'â²­', + 'â²®' => 'ⲯ', + 'â²°' => 'â²±', + 'â²²' => 'â²³', + 'â²´' => 'â²µ', + 'Ⲷ' => 'â²·', + 'Ⲹ' => 'â²¹', + 'Ⲻ' => 'â²»', + 'â²¼' => 'â²½', + 'â²¾' => 'ⲿ', + 'â³€' => 'â³', + 'Ⳃ' => 'ⳃ', + 'Ⳅ' => 'â³…', + 'Ⳇ' => 'ⳇ', + 'Ⳉ' => 'ⳉ', + 'Ⳋ' => 'ⳋ', + 'Ⳍ' => 'â³', + 'Ⳏ' => 'â³', + 'â³' => 'ⳑ', + 'â³’' => 'ⳓ', + 'â³”' => 'ⳕ', + 'â³–' => 'â³—', + 'Ⳙ' => 'â³™', + 'Ⳛ' => 'â³›', + 'Ⳝ' => 'â³', + 'Ⳟ' => 'ⳟ', + 'â³ ' => 'ⳡ', + 'â³¢' => 'â³£', + 'Ⳬ' => 'ⳬ', + 'â³­' => 'â³®', + 'â³²' => 'â³³', + 'Ꙁ' => 'ê™', + 'Ꙃ' => 'ꙃ', + 'Ꙅ' => 'ê™…', + 'Ꙇ' => 'ꙇ', + 'Ꙉ' => 'ꙉ', + 'Ꙋ' => 'ꙋ', + 'Ꙍ' => 'ê™', + 'Ꙏ' => 'ê™', + 'ê™' => 'ꙑ', + 'ê™’' => 'ꙓ', + 'ê™”' => 'ꙕ', + 'ê™–' => 'ê™—', + 'Ꙙ' => 'ê™™', + 'Ꙛ' => 'ê™›', + 'Ꙝ' => 'ê™', + 'Ꙟ' => 'ꙟ', + 'ê™ ' => 'ꙡ', + 'Ꙣ' => 'ꙣ', + 'Ꙥ' => 'ꙥ', + 'Ꙧ' => 'ꙧ', + 'Ꙩ' => 'ꙩ', + 'Ꙫ' => 'ꙫ', + 'Ꙭ' => 'ê™­', + 'Ꚁ' => 'êš', + 'êš‚' => 'ꚃ', + 'êš„' => 'êš…', + 'Ꚇ' => 'ꚇ', + 'Ꚉ' => 'ꚉ', + 'Ꚋ' => 'êš‹', + 'Ꚍ' => 'êš', + 'Ꚏ' => 'êš', + 'êš' => 'êš‘', + 'êš’' => 'êš“', + 'êš”' => 'êš•', + 'êš–' => 'êš—', + 'Ꚙ' => 'êš™', + 'êšš' => 'êš›', + 'Ꜣ' => 'ꜣ', + 'Ꜥ' => 'ꜥ', + 'Ꜧ' => 'ꜧ', + 'Ꜩ' => 'ꜩ', + 'Ꜫ' => 'ꜫ', + 'Ꜭ' => 'ꜭ', + 'Ꜯ' => 'ꜯ', + 'Ꜳ' => 'ꜳ', + 'Ꜵ' => 'ꜵ', + 'Ꜷ' => 'ꜷ', + 'Ꜹ' => 'ꜹ', + 'Ꜻ' => 'ꜻ', + 'Ꜽ' => 'ꜽ', + 'Ꜿ' => 'ꜿ', + 'ê€' => 'ê', + 'ê‚' => 'êƒ', + 'ê„' => 'ê…', + 'ê†' => 'ê‡', + 'êˆ' => 'ê‰', + 'êŠ' => 'ê‹', + 'êŒ' => 'ê', + 'êŽ' => 'ê', + 'ê' => 'ê‘', + 'ê’' => 'ê“', + 'ê”' => 'ê•', + 'ê–' => 'ê—', + 'ê˜' => 'ê™', + 'êš' => 'ê›', + 'êœ' => 'ê', + 'êž' => 'êŸ', + 'ê ' => 'ê¡', + 'ê¢' => 'ê£', + 'ê¤' => 'ê¥', + 'ê¦' => 'ê§', + 'ê¨' => 'ê©', + 'êª' => 'ê«', + 'ê¬' => 'ê­', + 'ê®' => 'ê¯', + 'ê¹' => 'êº', + 'ê»' => 'ê¼', + 'ê½' => 'áµ¹', + 'ê¾' => 'ê¿', + 'Ꞁ' => 'êž', + 'êž‚' => 'ꞃ', + 'êž„' => 'êž…', + 'Ꞇ' => 'ꞇ', + 'êž‹' => 'ꞌ', + 'êž' => 'É¥', + 'êž' => 'êž‘', + 'êž’' => 'êž“', + 'êž–' => 'êž—', + 'Ꞙ' => 'êž™', + 'êžš' => 'êž›', + 'êžœ' => 'êž', + 'êžž' => 'ꞟ', + 'êž ' => 'êž¡', + 'Ꞣ' => 'ꞣ', + 'Ꞥ' => 'ꞥ', + 'Ꞧ' => 'ꞧ', + 'Ꞩ' => 'êž©', + 'Ɦ' => 'ɦ', + 'êž«' => 'Éœ', + 'Ɡ' => 'É¡', + 'êž­' => 'ɬ', + 'êž®' => 'ɪ', + 'êž°' => 'Êž', + 'êž±' => 'ʇ', + 'êž²' => 'Ê', + 'êž³' => 'ê­“', + 'êž´' => 'êžµ', + 'Ꞷ' => 'êž·', + 'Ꞹ' => 'êž¹', + 'Ꞻ' => 'êž»', + 'êž¼' => 'êž½', + 'êž¾' => 'êž¿', + 'Ꟃ' => 'ꟃ', + 'Ꞔ' => 'êž”', + 'Ʂ' => 'Ê‚', + 'Ᶎ' => 'ᶎ', + 'Ꟈ' => 'ꟈ', + 'Ꟊ' => 'ꟊ', + 'Ꟶ' => 'ꟶ', + 'A' => 'ï½', + 'ï¼¢' => 'b', + 'ï¼£' => 'c', + 'D' => 'd', + 'ï¼¥' => 'ï½…', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'ï¼­' => 'ï½', + 'ï¼®' => 'n', + 'O' => 'ï½', + 'ï¼°' => 'ï½', + 'ï¼±' => 'q', + 'ï¼²' => 'ï½’', + 'ï¼³' => 's', + 'ï¼´' => 'ï½”', + 'ï¼µ' => 'u', + 'V' => 'ï½–', + 'ï¼·' => 'ï½—', + 'X' => 'x', + 'ï¼¹' => 'ï½™', + 'Z' => 'z', + 'ð€' => 'ð¨', + 'ð' => 'ð©', + 'ð‚' => 'ðª', + 'ðƒ' => 'ð«', + 'ð„' => 'ð¬', + 'ð…' => 'ð­', + 'ð†' => 'ð®', + 'ð‡' => 'ð¯', + 'ðˆ' => 'ð°', + 'ð‰' => 'ð±', + 'ðŠ' => 'ð²', + 'ð‹' => 'ð³', + 'ðŒ' => 'ð´', + 'ð' => 'ðµ', + 'ðŽ' => 'ð¶', + 'ð' => 'ð·', + 'ð' => 'ð¸', + 'ð‘' => 'ð¹', + 'ð’' => 'ðº', + 'ð“' => 'ð»', + 'ð”' => 'ð¼', + 'ð•' => 'ð½', + 'ð–' => 'ð¾', + 'ð—' => 'ð¿', + 'ð˜' => 'ð‘€', + 'ð™' => 'ð‘', + 'ðš' => 'ð‘‚', + 'ð›' => 'ð‘ƒ', + 'ðœ' => 'ð‘„', + 'ð' => 'ð‘…', + 'ðž' => 'ð‘†', + 'ðŸ' => 'ð‘‡', + 'ð ' => 'ð‘ˆ', + 'ð¡' => 'ð‘‰', + 'ð¢' => 'ð‘Š', + 'ð£' => 'ð‘‹', + 'ð¤' => 'ð‘Œ', + 'ð¥' => 'ð‘', + 'ð¦' => 'ð‘Ž', + 'ð§' => 'ð‘', + 'ð’°' => 'ð“˜', + 'ð’±' => 'ð“™', + 'ð’²' => 'ð“š', + 'ð’³' => 'ð“›', + 'ð’´' => 'ð“œ', + 'ð’µ' => 'ð“', + 'ð’¶' => 'ð“ž', + 'ð’·' => 'ð“Ÿ', + 'ð’¸' => 'ð“ ', + 'ð’¹' => 'ð“¡', + 'ð’º' => 'ð“¢', + 'ð’»' => 'ð“£', + 'ð’¼' => 'ð“¤', + 'ð’½' => 'ð“¥', + 'ð’¾' => 'ð“¦', + 'ð’¿' => 'ð“§', + 'ð“€' => 'ð“¨', + 'ð“' => 'ð“©', + 'ð“‚' => 'ð“ª', + 'ð“ƒ' => 'ð“«', + 'ð“„' => 'ð“¬', + 'ð“…' => 'ð“­', + 'ð“†' => 'ð“®', + 'ð“‡' => 'ð“¯', + 'ð“ˆ' => 'ð“°', + 'ð“‰' => 'ð“±', + 'ð“Š' => 'ð“²', + 'ð“‹' => 'ð“³', + 'ð“Œ' => 'ð“´', + 'ð“' => 'ð“µ', + 'ð“Ž' => 'ð“¶', + 'ð“' => 'ð“·', + 'ð“' => 'ð“¸', + 'ð“‘' => 'ð“¹', + 'ð“’' => 'ð“º', + 'ð““' => 'ð“»', + 'ð²€' => 'ð³€', + 'ð²' => 'ð³', + 'ð²‚' => 'ð³‚', + 'ð²ƒ' => 'ð³ƒ', + 'ð²„' => 'ð³„', + 'ð²…' => 'ð³…', + 'ð²†' => 'ð³†', + 'ð²‡' => 'ð³‡', + 'ð²ˆ' => 'ð³ˆ', + 'ð²‰' => 'ð³‰', + 'ð²Š' => 'ð³Š', + 'ð²‹' => 'ð³‹', + 'ð²Œ' => 'ð³Œ', + 'ð²' => 'ð³', + 'ð²Ž' => 'ð³Ž', + 'ð²' => 'ð³', + 'ð²' => 'ð³', + 'ð²‘' => 'ð³‘', + 'ð²’' => 'ð³’', + 'ð²“' => 'ð³“', + 'ð²”' => 'ð³”', + 'ð²•' => 'ð³•', + 'ð²–' => 'ð³–', + 'ð²—' => 'ð³—', + 'ð²˜' => 'ð³˜', + 'ð²™' => 'ð³™', + 'ð²š' => 'ð³š', + 'ð²›' => 'ð³›', + 'ð²œ' => 'ð³œ', + 'ð²' => 'ð³', + 'ð²ž' => 'ð³ž', + 'ð²Ÿ' => 'ð³Ÿ', + 'ð² ' => 'ð³ ', + 'ð²¡' => 'ð³¡', + 'ð²¢' => 'ð³¢', + 'ð²£' => 'ð³£', + 'ð²¤' => 'ð³¤', + 'ð²¥' => 'ð³¥', + 'ð²¦' => 'ð³¦', + 'ð²§' => 'ð³§', + 'ð²¨' => 'ð³¨', + 'ð²©' => 'ð³©', + 'ð²ª' => 'ð³ª', + 'ð²«' => 'ð³«', + 'ð²¬' => 'ð³¬', + 'ð²­' => 'ð³­', + 'ð²®' => 'ð³®', + 'ð²¯' => 'ð³¯', + 'ð²°' => 'ð³°', + 'ð²±' => 'ð³±', + 'ð²²' => 'ð³²', + 'ð‘¢ ' => 'ð‘£€', + '𑢡' => 'ð‘£', + 'ð‘¢¢' => '𑣂', + 'ð‘¢£' => '𑣃', + '𑢤' => '𑣄', + 'ð‘¢¥' => 'ð‘£…', + '𑢦' => '𑣆', + '𑢧' => '𑣇', + '𑢨' => '𑣈', + '𑢩' => '𑣉', + '𑢪' => '𑣊', + '𑢫' => '𑣋', + '𑢬' => '𑣌', + 'ð‘¢­' => 'ð‘£', + 'ð‘¢®' => '𑣎', + '𑢯' => 'ð‘£', + 'ð‘¢°' => 'ð‘£', + 'ð‘¢±' => '𑣑', + 'ð‘¢²' => 'ð‘£’', + 'ð‘¢³' => '𑣓', + 'ð‘¢´' => 'ð‘£”', + 'ð‘¢µ' => '𑣕', + '𑢶' => 'ð‘£–', + 'ð‘¢·' => 'ð‘£—', + '𑢸' => '𑣘', + 'ð‘¢¹' => 'ð‘£™', + '𑢺' => '𑣚', + 'ð‘¢»' => 'ð‘£›', + 'ð‘¢¼' => '𑣜', + 'ð‘¢½' => 'ð‘£', + 'ð‘¢¾' => '𑣞', + '𑢿' => '𑣟', + 'ð–¹€' => 'ð–¹ ', + 'ð–¹' => '𖹡', + '𖹂' => 'ð–¹¢', + '𖹃' => 'ð–¹£', + '𖹄' => '𖹤', + 'ð–¹…' => 'ð–¹¥', + '𖹆' => '𖹦', + '𖹇' => '𖹧', + '𖹈' => '𖹨', + '𖹉' => '𖹩', + '𖹊' => '𖹪', + '𖹋' => '𖹫', + '𖹌' => '𖹬', + 'ð–¹' => 'ð–¹­', + '𖹎' => 'ð–¹®', + 'ð–¹' => '𖹯', + 'ð–¹' => 'ð–¹°', + '𖹑' => 'ð–¹±', + 'ð–¹’' => 'ð–¹²', + '𖹓' => 'ð–¹³', + 'ð–¹”' => 'ð–¹´', + '𖹕' => 'ð–¹µ', + 'ð–¹–' => '𖹶', + 'ð–¹—' => 'ð–¹·', + '𖹘' => '𖹸', + 'ð–¹™' => 'ð–¹¹', + '𖹚' => '𖹺', + 'ð–¹›' => 'ð–¹»', + '𖹜' => 'ð–¹¼', + 'ð–¹' => 'ð–¹½', + '𖹞' => 'ð–¹¾', + '𖹟' => '𖹿', + '𞤀' => '𞤢', + 'ðž¤' => '𞤣', + '𞤂' => '𞤤', + '𞤃' => '𞤥', + '𞤄' => '𞤦', + '𞤅' => '𞤧', + '𞤆' => '𞤨', + '𞤇' => '𞤩', + '𞤈' => '𞤪', + '𞤉' => '𞤫', + '𞤊' => '𞤬', + '𞤋' => '𞤭', + '𞤌' => '𞤮', + 'ðž¤' => '𞤯', + '𞤎' => '𞤰', + 'ðž¤' => '𞤱', + 'ðž¤' => '𞤲', + '𞤑' => '𞤳', + '𞤒' => '𞤴', + '𞤓' => '𞤵', + '𞤔' => '𞤶', + '𞤕' => '𞤷', + '𞤖' => '𞤸', + '𞤗' => '𞤹', + '𞤘' => '𞤺', + '𞤙' => '𞤻', + '𞤚' => '𞤼', + '𞤛' => '𞤽', + '𞤜' => '𞤾', + 'ðž¤' => '𞤿', + '𞤞' => '𞥀', + '𞤟' => 'ðž¥', + '𞤠' => '𞥂', + '𞤡' => '𞥃', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php new file mode 100644 index 00000000000..2a8f6e73b99 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php @@ -0,0 +1,5 @@ + 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + 'µ' => 'Îœ', + 'à' => 'À', + 'á' => 'Ã', + 'â' => 'Â', + 'ã' => 'Ã', + 'ä' => 'Ä', + 'Ã¥' => 'Ã…', + 'æ' => 'Æ', + 'ç' => 'Ç', + 'è' => 'È', + 'é' => 'É', + 'ê' => 'Ê', + 'ë' => 'Ë', + 'ì' => 'ÃŒ', + 'í' => 'Ã', + 'î' => 'ÃŽ', + 'ï' => 'Ã', + 'ð' => 'Ã', + 'ñ' => 'Ñ', + 'ò' => 'Ã’', + 'ó' => 'Ó', + 'ô' => 'Ô', + 'õ' => 'Õ', + 'ö' => 'Ö', + 'ø' => 'Ø', + 'ù' => 'Ù', + 'ú' => 'Ú', + 'û' => 'Û', + 'ü' => 'Ãœ', + 'ý' => 'Ã', + 'þ' => 'Þ', + 'ÿ' => 'Ÿ', + 'Ä' => 'Ä€', + 'ă' => 'Ä‚', + 'Ä…' => 'Ä„', + 'ć' => 'Ć', + 'ĉ' => 'Ĉ', + 'Ä‹' => 'ÄŠ', + 'Ä' => 'ÄŒ', + 'Ä' => 'ÄŽ', + 'Ä‘' => 'Ä', + 'Ä“' => 'Ä’', + 'Ä•' => 'Ä”', + 'Ä—' => 'Ä–', + 'Ä™' => 'Ę', + 'Ä›' => 'Äš', + 'Ä' => 'Äœ', + 'ÄŸ' => 'Äž', + 'Ä¡' => 'Ä ', + 'Ä£' => 'Ä¢', + 'Ä¥' => 'Ĥ', + 'ħ' => 'Ħ', + 'Ä©' => 'Ĩ', + 'Ä«' => 'Ī', + 'Ä­' => 'Ĭ', + 'į' => 'Ä®', + 'ı' => 'I', + 'ij' => 'IJ', + 'ĵ' => 'Ä´', + 'Ä·' => 'Ķ', + 'ĺ' => 'Ĺ', + 'ļ' => 'Ä»', + 'ľ' => 'Ľ', + 'Å€' => 'Ä¿', + 'Å‚' => 'Å', + 'Å„' => 'Ń', + 'ņ' => 'Å…', + 'ň' => 'Ň', + 'Å‹' => 'ÅŠ', + 'Å' => 'ÅŒ', + 'Å' => 'ÅŽ', + 'Å‘' => 'Å', + 'Å“' => 'Å’', + 'Å•' => 'Å”', + 'Å—' => 'Å–', + 'Å™' => 'Ř', + 'Å›' => 'Åš', + 'Å' => 'Åœ', + 'ÅŸ' => 'Åž', + 'Å¡' => 'Å ', + 'Å£' => 'Å¢', + 'Å¥' => 'Ť', + 'ŧ' => 'Ŧ', + 'Å©' => 'Ũ', + 'Å«' => 'Ū', + 'Å­' => 'Ŭ', + 'ů' => 'Å®', + 'ű' => 'Å°', + 'ų' => 'Ų', + 'ŵ' => 'Å´', + 'Å·' => 'Ŷ', + 'ź' => 'Ź', + 'ż' => 'Å»', + 'ž' => 'Ž', + 'Å¿' => 'S', + 'Æ€' => 'Ƀ', + 'ƃ' => 'Æ‚', + 'Æ…' => 'Æ„', + 'ƈ' => 'Ƈ', + 'ÆŒ' => 'Æ‹', + 'Æ’' => 'Æ‘', + 'Æ•' => 'Ƕ', + 'Æ™' => 'Ƙ', + 'Æš' => 'Ƚ', + 'Æž' => 'È ', + 'Æ¡' => 'Æ ', + 'Æ£' => 'Æ¢', + 'Æ¥' => 'Ƥ', + 'ƨ' => 'Ƨ', + 'Æ­' => 'Ƭ', + 'Æ°' => 'Ư', + 'Æ´' => 'Ƴ', + 'ƶ' => 'Ƶ', + 'ƹ' => 'Ƹ', + 'ƽ' => 'Ƽ', + 'Æ¿' => 'Ç·', + 'Ç…' => 'Ç„', + 'dž' => 'Ç„', + 'Lj' => 'LJ', + 'lj' => 'LJ', + 'Ç‹' => 'ÇŠ', + 'ÇŒ' => 'ÇŠ', + 'ÇŽ' => 'Ç', + 'Ç' => 'Ç', + 'Ç’' => 'Ç‘', + 'Ç”' => 'Ç“', + 'Ç–' => 'Ç•', + 'ǘ' => 'Ç—', + 'Çš' => 'Ç™', + 'Çœ' => 'Ç›', + 'Ç' => 'ÆŽ', + 'ÇŸ' => 'Çž', + 'Ç¡' => 'Ç ', + 'Ç£' => 'Ç¢', + 'Ç¥' => 'Ǥ', + 'ǧ' => 'Ǧ', + 'Ç©' => 'Ǩ', + 'Ç«' => 'Ǫ', + 'Ç­' => 'Ǭ', + 'ǯ' => 'Ç®', + 'Dz' => 'DZ', + 'dz' => 'DZ', + 'ǵ' => 'Ç´', + 'ǹ' => 'Ǹ', + 'Ç»' => 'Ǻ', + 'ǽ' => 'Ǽ', + 'Ç¿' => 'Ǿ', + 'È' => 'È€', + 'ȃ' => 'È‚', + 'È…' => 'È„', + 'ȇ' => 'Ȇ', + 'ȉ' => 'Ȉ', + 'È‹' => 'ÈŠ', + 'È' => 'ÈŒ', + 'È' => 'ÈŽ', + 'È‘' => 'È', + 'È“' => 'È’', + 'È•' => 'È”', + 'È—' => 'È–', + 'È™' => 'Ș', + 'È›' => 'Èš', + 'È' => 'Èœ', + 'ÈŸ' => 'Èž', + 'È£' => 'È¢', + 'È¥' => 'Ȥ', + 'ȧ' => 'Ȧ', + 'È©' => 'Ȩ', + 'È«' => 'Ȫ', + 'È­' => 'Ȭ', + 'ȯ' => 'È®', + 'ȱ' => 'È°', + 'ȳ' => 'Ȳ', + 'ȼ' => 'È»', + 'È¿' => 'â±¾', + 'É€' => 'Ɀ', + 'É‚' => 'É', + 'ɇ' => 'Ɇ', + 'ɉ' => 'Ɉ', + 'É‹' => 'ÉŠ', + 'É' => 'ÉŒ', + 'É' => 'ÉŽ', + 'É' => 'Ɐ', + 'É‘' => 'â±­', + 'É’' => 'â±°', + 'É“' => 'Æ', + 'É”' => 'Ɔ', + 'É–' => 'Ɖ', + 'É—' => 'ÆŠ', + 'É™' => 'Æ', + 'É›' => 'Æ', + 'Éœ' => 'êž«', + 'É ' => 'Æ“', + 'É¡' => 'Ɡ', + 'É£' => 'Æ”', + 'É¥' => 'êž', + 'ɦ' => 'Ɦ', + 'ɨ' => 'Æ—', + 'É©' => 'Æ–', + 'ɪ' => 'êž®', + 'É«' => 'â±¢', + 'ɬ' => 'êž­', + 'ɯ' => 'Æœ', + 'ɱ' => 'â±®', + 'ɲ' => 'Æ', + 'ɵ' => 'ÆŸ', + 'ɽ' => 'Ɽ', + 'Ê€' => 'Ʀ', + 'Ê‚' => 'Ʂ', + 'ʃ' => 'Æ©', + 'ʇ' => 'êž±', + 'ʈ' => 'Æ®', + 'ʉ' => 'É„', + 'ÊŠ' => 'Ʊ', + 'Ê‹' => 'Ʋ', + 'ÊŒ' => 'É…', + 'Ê’' => 'Æ·', + 'Ê' => 'êž²', + 'Êž' => 'êž°', + 'Í…' => 'Ι', + 'ͱ' => 'Í°', + 'ͳ' => 'Ͳ', + 'Í·' => 'Ͷ', + 'Í»' => 'Ͻ', + 'ͼ' => 'Ͼ', + 'ͽ' => 'Ï¿', + 'ά' => 'Ά', + 'έ' => 'Έ', + 'ή' => 'Ή', + 'ί' => 'Ί', + 'α' => 'Α', + 'β' => 'Î’', + 'γ' => 'Γ', + 'δ' => 'Δ', + 'ε' => 'Ε', + 'ζ' => 'Ζ', + 'η' => 'Η', + 'θ' => 'Θ', + 'ι' => 'Ι', + 'κ' => 'Κ', + 'λ' => 'Λ', + 'μ' => 'Îœ', + 'ν' => 'Î', + 'ξ' => 'Ξ', + 'ο' => 'Ο', + 'Ï€' => 'Π', + 'Ï' => 'Ρ', + 'Ï‚' => 'Σ', + 'σ' => 'Σ', + 'Ï„' => 'Τ', + 'Ï…' => 'Î¥', + 'φ' => 'Φ', + 'χ' => 'Χ', + 'ψ' => 'Ψ', + 'ω' => 'Ω', + 'ÏŠ' => 'Ϊ', + 'Ï‹' => 'Ϋ', + 'ÏŒ' => 'ÎŒ', + 'Ï' => 'ÎŽ', + 'ÏŽ' => 'Î', + 'Ï' => 'Î’', + 'Ï‘' => 'Θ', + 'Ï•' => 'Φ', + 'Ï–' => 'Π', + 'Ï—' => 'Ï', + 'Ï™' => 'Ϙ', + 'Ï›' => 'Ïš', + 'Ï' => 'Ïœ', + 'ÏŸ' => 'Ïž', + 'Ï¡' => 'Ï ', + 'Ï£' => 'Ï¢', + 'Ï¥' => 'Ϥ', + 'ϧ' => 'Ϧ', + 'Ï©' => 'Ϩ', + 'Ï«' => 'Ϫ', + 'Ï­' => 'Ϭ', + 'ϯ' => 'Ï®', + 'Ï°' => 'Κ', + 'ϱ' => 'Ρ', + 'ϲ' => 'Ϲ', + 'ϳ' => 'Í¿', + 'ϵ' => 'Ε', + 'ϸ' => 'Ï·', + 'Ï»' => 'Ϻ', + 'а' => 'Ð', + 'б' => 'Б', + 'в' => 'Ð’', + 'г' => 'Г', + 'д' => 'Д', + 'е' => 'Е', + 'ж' => 'Ж', + 'з' => 'З', + 'и' => 'И', + 'й' => 'Й', + 'к' => 'К', + 'л' => 'Л', + 'м' => 'Ðœ', + 'н' => 'Ð', + 'о' => 'О', + 'п' => 'П', + 'Ñ€' => 'Р', + 'Ñ' => 'С', + 'Ñ‚' => 'Т', + 'у' => 'У', + 'Ñ„' => 'Ф', + 'Ñ…' => 'Ð¥', + 'ц' => 'Ц', + 'ч' => 'Ч', + 'ш' => 'Ш', + 'щ' => 'Щ', + 'ÑŠ' => 'Ъ', + 'Ñ‹' => 'Ы', + 'ÑŒ' => 'Ь', + 'Ñ' => 'Э', + 'ÑŽ' => 'Ю', + 'Ñ' => 'Я', + 'Ñ' => 'Ѐ', + 'Ñ‘' => 'Ð', + 'Ñ’' => 'Ђ', + 'Ñ“' => 'Ѓ', + 'Ñ”' => 'Є', + 'Ñ•' => 'Ð…', + 'Ñ–' => 'І', + 'Ñ—' => 'Ї', + 'ј' => 'Ј', + 'Ñ™' => 'Љ', + 'Ñš' => 'Њ', + 'Ñ›' => 'Ћ', + 'Ñœ' => 'ÐŒ', + 'Ñ' => 'Ð', + 'Ñž' => 'ÐŽ', + 'ÑŸ' => 'Ð', + 'Ñ¡' => 'Ñ ', + 'Ñ£' => 'Ñ¢', + 'Ñ¥' => 'Ѥ', + 'ѧ' => 'Ѧ', + 'Ñ©' => 'Ѩ', + 'Ñ«' => 'Ѫ', + 'Ñ­' => 'Ѭ', + 'ѯ' => 'Ñ®', + 'ѱ' => 'Ñ°', + 'ѳ' => 'Ѳ', + 'ѵ' => 'Ñ´', + 'Ñ·' => 'Ѷ', + 'ѹ' => 'Ѹ', + 'Ñ»' => 'Ѻ', + 'ѽ' => 'Ѽ', + 'Ñ¿' => 'Ѿ', + 'Ò' => 'Ò€', + 'Ò‹' => 'ÒŠ', + 'Ò' => 'ÒŒ', + 'Ò' => 'ÒŽ', + 'Ò‘' => 'Ò', + 'Ò“' => 'Ò’', + 'Ò•' => 'Ò”', + 'Ò—' => 'Ò–', + 'Ò™' => 'Ò˜', + 'Ò›' => 'Òš', + 'Ò' => 'Òœ', + 'ÒŸ' => 'Òž', + 'Ò¡' => 'Ò ', + 'Ò£' => 'Ò¢', + 'Ò¥' => 'Ò¤', + 'Ò§' => 'Ò¦', + 'Ò©' => 'Ò¨', + 'Ò«' => 'Òª', + 'Ò­' => 'Ò¬', + 'Ò¯' => 'Ò®', + 'Ò±' => 'Ò°', + 'Ò³' => 'Ò²', + 'Òµ' => 'Ò´', + 'Ò·' => 'Ò¶', + 'Ò¹' => 'Ò¸', + 'Ò»' => 'Òº', + 'Ò½' => 'Ò¼', + 'Ò¿' => 'Ò¾', + 'Ó‚' => 'Ó', + 'Ó„' => 'Óƒ', + 'Ó†' => 'Ó…', + 'Óˆ' => 'Ó‡', + 'ÓŠ' => 'Ó‰', + 'ÓŒ' => 'Ó‹', + 'ÓŽ' => 'Ó', + 'Ó' => 'Ó€', + 'Ó‘' => 'Ó', + 'Ó“' => 'Ó’', + 'Ó•' => 'Ó”', + 'Ó—' => 'Ó–', + 'Ó™' => 'Ó˜', + 'Ó›' => 'Óš', + 'Ó' => 'Óœ', + 'ÓŸ' => 'Óž', + 'Ó¡' => 'Ó ', + 'Ó£' => 'Ó¢', + 'Ó¥' => 'Ó¤', + 'Ó§' => 'Ó¦', + 'Ó©' => 'Ó¨', + 'Ó«' => 'Óª', + 'Ó­' => 'Ó¬', + 'Ó¯' => 'Ó®', + 'Ó±' => 'Ó°', + 'Ó³' => 'Ó²', + 'Óµ' => 'Ó´', + 'Ó·' => 'Ó¶', + 'Ó¹' => 'Ó¸', + 'Ó»' => 'Óº', + 'Ó½' => 'Ó¼', + 'Ó¿' => 'Ó¾', + 'Ô' => 'Ô€', + 'Ôƒ' => 'Ô‚', + 'Ô…' => 'Ô„', + 'Ô‡' => 'Ô†', + 'Ô‰' => 'Ôˆ', + 'Ô‹' => 'ÔŠ', + 'Ô' => 'ÔŒ', + 'Ô' => 'ÔŽ', + 'Ô‘' => 'Ô', + 'Ô“' => 'Ô’', + 'Ô•' => 'Ô”', + 'Ô—' => 'Ô–', + 'Ô™' => 'Ô˜', + 'Ô›' => 'Ôš', + 'Ô' => 'Ôœ', + 'ÔŸ' => 'Ôž', + 'Ô¡' => 'Ô ', + 'Ô£' => 'Ô¢', + 'Ô¥' => 'Ô¤', + 'Ô§' => 'Ô¦', + 'Ô©' => 'Ô¨', + 'Ô«' => 'Ôª', + 'Ô­' => 'Ô¬', + 'Ô¯' => 'Ô®', + 'Õ¡' => 'Ô±', + 'Õ¢' => 'Ô²', + 'Õ£' => 'Ô³', + 'Õ¤' => 'Ô´', + 'Õ¥' => 'Ôµ', + 'Õ¦' => 'Ô¶', + 'Õ§' => 'Ô·', + 'Õ¨' => 'Ô¸', + 'Õ©' => 'Ô¹', + 'Õª' => 'Ôº', + 'Õ«' => 'Ô»', + 'Õ¬' => 'Ô¼', + 'Õ­' => 'Ô½', + 'Õ®' => 'Ô¾', + 'Õ¯' => 'Ô¿', + 'Õ°' => 'Õ€', + 'Õ±' => 'Õ', + 'Õ²' => 'Õ‚', + 'Õ³' => 'Õƒ', + 'Õ´' => 'Õ„', + 'Õµ' => 'Õ…', + 'Õ¶' => 'Õ†', + 'Õ·' => 'Õ‡', + 'Õ¸' => 'Õˆ', + 'Õ¹' => 'Õ‰', + 'Õº' => 'ÕŠ', + 'Õ»' => 'Õ‹', + 'Õ¼' => 'ÕŒ', + 'Õ½' => 'Õ', + 'Õ¾' => 'ÕŽ', + 'Õ¿' => 'Õ', + 'Ö€' => 'Õ', + 'Ö' => 'Õ‘', + 'Ö‚' => 'Õ’', + 'Öƒ' => 'Õ“', + 'Ö„' => 'Õ”', + 'Ö…' => 'Õ•', + 'Ö†' => 'Õ–', + 'áƒ' => 'á²', + 'ბ' => 'Ბ', + 'გ' => 'á²’', + 'დ' => 'Დ', + 'ე' => 'á²”', + 'ვ' => 'Ვ', + 'ზ' => 'á²–', + 'თ' => 'á²—', + 'ი' => 'Ი', + 'კ' => 'á²™', + 'ლ' => 'Ლ', + 'მ' => 'á²›', + 'ნ' => 'Ნ', + 'áƒ' => 'á²', + 'პ' => 'Პ', + 'ჟ' => 'Ჟ', + 'რ' => 'á² ', + 'ს' => 'Ს', + 'ტ' => 'á²¢', + 'უ' => 'á²£', + 'ფ' => 'Ფ', + 'ქ' => 'á²¥', + 'ღ' => 'Ღ', + 'ყ' => 'Ყ', + 'შ' => 'Შ', + 'ჩ' => 'Ჩ', + 'ც' => 'Ც', + 'ძ' => 'Ძ', + 'წ' => 'Წ', + 'ჭ' => 'á²­', + 'ხ' => 'á²®', + 'ჯ' => 'Ჯ', + 'ჰ' => 'á²°', + 'ჱ' => 'á²±', + 'ჲ' => 'á²²', + 'ჳ' => 'á²³', + 'ჴ' => 'á²´', + 'ჵ' => 'á²µ', + 'ჶ' => 'Ჶ', + 'ჷ' => 'á²·', + 'ჸ' => 'Ჸ', + 'ჹ' => 'á²¹', + 'ჺ' => 'Ჺ', + 'ჽ' => 'á²½', + 'ჾ' => 'á²¾', + 'ჿ' => 'Ჿ', + 'á¸' => 'á°', + 'á¹' => 'á±', + 'áº' => 'á²', + 'á»' => 'á³', + 'á¼' => 'á´', + 'á½' => 'áµ', + 'á²€' => 'Ð’', + 'á²' => 'Д', + 'ᲂ' => 'О', + 'ᲃ' => 'С', + 'ᲄ' => 'Т', + 'á²…' => 'Т', + 'ᲆ' => 'Ъ', + 'ᲇ' => 'Ñ¢', + 'ᲈ' => 'Ꙋ', + 'áµ¹' => 'ê½', + 'áµ½' => 'â±£', + 'ᶎ' => 'Ᶎ', + 'á¸' => 'Ḁ', + 'ḃ' => 'Ḃ', + 'ḅ' => 'Ḅ', + 'ḇ' => 'Ḇ', + 'ḉ' => 'Ḉ', + 'ḋ' => 'Ḋ', + 'á¸' => 'Ḍ', + 'á¸' => 'Ḏ', + 'ḑ' => 'á¸', + 'ḓ' => 'Ḓ', + 'ḕ' => 'Ḕ', + 'ḗ' => 'Ḗ', + 'ḙ' => 'Ḙ', + 'ḛ' => 'Ḛ', + 'á¸' => 'Ḝ', + 'ḟ' => 'Ḟ', + 'ḡ' => 'Ḡ', + 'ḣ' => 'Ḣ', + 'ḥ' => 'Ḥ', + 'ḧ' => 'Ḧ', + 'ḩ' => 'Ḩ', + 'ḫ' => 'Ḫ', + 'ḭ' => 'Ḭ', + 'ḯ' => 'Ḯ', + 'ḱ' => 'Ḱ', + 'ḳ' => 'Ḳ', + 'ḵ' => 'Ḵ', + 'ḷ' => 'Ḷ', + 'ḹ' => 'Ḹ', + 'ḻ' => 'Ḻ', + 'ḽ' => 'Ḽ', + 'ḿ' => 'Ḿ', + 'á¹' => 'á¹€', + 'ṃ' => 'Ṃ', + 'á¹…' => 'Ṅ', + 'ṇ' => 'Ṇ', + 'ṉ' => 'Ṉ', + 'ṋ' => 'Ṋ', + 'á¹' => 'Ṍ', + 'á¹' => 'Ṏ', + 'ṑ' => 'á¹', + 'ṓ' => 'á¹’', + 'ṕ' => 'á¹”', + 'á¹—' => 'á¹–', + 'á¹™' => 'Ṙ', + 'á¹›' => 'Ṛ', + 'á¹' => 'Ṝ', + 'ṟ' => 'Ṟ', + 'ṡ' => 'á¹ ', + 'á¹£' => 'á¹¢', + 'á¹¥' => 'Ṥ', + 'ṧ' => 'Ṧ', + 'ṩ' => 'Ṩ', + 'ṫ' => 'Ṫ', + 'á¹­' => 'Ṭ', + 'ṯ' => 'á¹®', + 'á¹±' => 'á¹°', + 'á¹³' => 'á¹²', + 'á¹µ' => 'á¹´', + 'á¹·' => 'Ṷ', + 'á¹¹' => 'Ṹ', + 'á¹»' => 'Ṻ', + 'á¹½' => 'á¹¼', + 'ṿ' => 'á¹¾', + 'áº' => 'Ẁ', + 'ẃ' => 'Ẃ', + 'ẅ' => 'Ẅ', + 'ẇ' => 'Ẇ', + 'ẉ' => 'Ẉ', + 'ẋ' => 'Ẋ', + 'áº' => 'Ẍ', + 'áº' => 'Ẏ', + 'ẑ' => 'áº', + 'ẓ' => 'Ẓ', + 'ẕ' => 'Ẕ', + 'ẛ' => 'á¹ ', + 'ạ' => 'Ạ', + 'ả' => 'Ả', + 'ấ' => 'Ấ', + 'ầ' => 'Ầ', + 'ẩ' => 'Ẩ', + 'ẫ' => 'Ẫ', + 'ậ' => 'Ậ', + 'ắ' => 'Ắ', + 'ằ' => 'Ằ', + 'ẳ' => 'Ẳ', + 'ẵ' => 'Ẵ', + 'ặ' => 'Ặ', + 'ẹ' => 'Ẹ', + 'ẻ' => 'Ẻ', + 'ẽ' => 'Ẽ', + 'ế' => 'Ế', + 'á»' => 'Ề', + 'ể' => 'Ể', + 'á»…' => 'Ễ', + 'ệ' => 'Ệ', + 'ỉ' => 'Ỉ', + 'ị' => 'Ị', + 'á»' => 'Ọ', + 'á»' => 'Ỏ', + 'ố' => 'á»', + 'ồ' => 'á»’', + 'ổ' => 'á»”', + 'á»—' => 'á»–', + 'á»™' => 'Ộ', + 'á»›' => 'Ớ', + 'á»' => 'Ờ', + 'ở' => 'Ở', + 'ỡ' => 'á» ', + 'ợ' => 'Ợ', + 'ụ' => 'Ụ', + 'ủ' => 'Ủ', + 'ứ' => 'Ứ', + 'ừ' => 'Ừ', + 'á»­' => 'Ử', + 'ữ' => 'á»®', + 'á»±' => 'á»°', + 'ỳ' => 'Ỳ', + 'ỵ' => 'á»´', + 'á»·' => 'Ỷ', + 'ỹ' => 'Ỹ', + 'á»»' => 'Ỻ', + 'ỽ' => 'Ỽ', + 'ỿ' => 'Ỿ', + 'á¼€' => 'Ἀ', + 'á¼' => 'Ἁ', + 'ἂ' => 'Ἂ', + 'ἃ' => 'Ἃ', + 'ἄ' => 'Ἄ', + 'á¼…' => 'á¼', + 'ἆ' => 'Ἆ', + 'ἇ' => 'á¼', + 'á¼' => 'Ἐ', + 'ἑ' => 'á¼™', + 'á¼’' => 'Ἒ', + 'ἓ' => 'á¼›', + 'á¼”' => 'Ἔ', + 'ἕ' => 'á¼', + 'á¼ ' => 'Ἠ', + 'ἡ' => 'Ἡ', + 'á¼¢' => 'Ἢ', + 'á¼£' => 'Ἣ', + 'ἤ' => 'Ἤ', + 'á¼¥' => 'á¼­', + 'ἦ' => 'á¼®', + 'ἧ' => 'Ἧ', + 'á¼°' => 'Ἰ', + 'á¼±' => 'á¼¹', + 'á¼²' => 'Ἲ', + 'á¼³' => 'á¼»', + 'á¼´' => 'á¼¼', + 'á¼µ' => 'á¼½', + 'ἶ' => 'á¼¾', + 'á¼·' => 'Ἷ', + 'á½€' => 'Ὀ', + 'á½' => 'Ὁ', + 'ὂ' => 'Ὂ', + 'ὃ' => 'Ὃ', + 'ὄ' => 'Ὄ', + 'á½…' => 'á½', + 'ὑ' => 'á½™', + 'ὓ' => 'á½›', + 'ὕ' => 'á½', + 'á½—' => 'Ὗ', + 'á½ ' => 'Ὠ', + 'ὡ' => 'Ὡ', + 'á½¢' => 'Ὢ', + 'á½£' => 'Ὣ', + 'ὤ' => 'Ὤ', + 'á½¥' => 'á½­', + 'ὦ' => 'á½®', + 'ὧ' => 'Ὧ', + 'á½°' => 'Ὰ', + 'á½±' => 'á¾»', + 'á½²' => 'Ὲ', + 'á½³' => 'Έ', + 'á½´' => 'á¿Š', + 'á½µ' => 'á¿‹', + 'ὶ' => 'á¿š', + 'á½·' => 'á¿›', + 'ὸ' => 'Ὸ', + 'á½¹' => 'Ό', + 'ὺ' => 'Ὺ', + 'á½»' => 'á¿«', + 'á½¼' => 'Ὼ', + 'á½½' => 'á¿»', + 'á¾€' => 'ἈΙ', + 'á¾' => 'ἉΙ', + 'ᾂ' => 'ἊΙ', + 'ᾃ' => 'ἋΙ', + 'ᾄ' => 'ἌΙ', + 'á¾…' => 'á¼Î™', + 'ᾆ' => 'ἎΙ', + 'ᾇ' => 'á¼Î™', + 'á¾' => 'ἨΙ', + 'ᾑ' => 'ἩΙ', + 'á¾’' => 'ἪΙ', + 'ᾓ' => 'ἫΙ', + 'á¾”' => 'ἬΙ', + 'ᾕ' => 'ἭΙ', + 'á¾–' => 'ἮΙ', + 'á¾—' => 'ἯΙ', + 'á¾ ' => 'ὨΙ', + 'ᾡ' => 'ὩΙ', + 'á¾¢' => 'ὪΙ', + 'á¾£' => 'ὫΙ', + 'ᾤ' => 'ὬΙ', + 'á¾¥' => 'ὭΙ', + 'ᾦ' => 'ὮΙ', + 'ᾧ' => 'ὯΙ', + 'á¾°' => 'Ᾰ', + 'á¾±' => 'á¾¹', + 'á¾³' => 'ΑΙ', + 'á¾¾' => 'Ι', + 'ῃ' => 'ΗΙ', + 'á¿' => 'Ῐ', + 'á¿‘' => 'á¿™', + 'á¿ ' => 'Ῠ', + 'á¿¡' => 'á¿©', + 'á¿¥' => 'Ῥ', + 'ῳ' => 'ΩΙ', + 'â…Ž' => 'Ⅎ', + 'â…°' => 'â… ', + 'â…±' => 'â…¡', + 'â…²' => 'â…¢', + 'â…³' => 'â…£', + 'â…´' => 'â…¤', + 'â…µ' => 'â…¥', + 'â…¶' => 'â…¦', + 'â…·' => 'â…§', + 'â…¸' => 'â…¨', + 'â…¹' => 'â…©', + 'â…º' => 'â…ª', + 'â…»' => 'â…«', + 'â…¼' => 'â…¬', + 'â…½' => 'â…­', + 'â…¾' => 'â…®', + 'â…¿' => 'â…¯', + 'ↄ' => 'Ↄ', + 'â“' => 'â’¶', + 'â“‘' => 'â’·', + 'â“’' => 'â’¸', + 'â““' => 'â’¹', + 'â“”' => 'â’º', + 'â“•' => 'â’»', + 'â“–' => 'â’¼', + 'â“—' => 'â’½', + 'ⓘ' => 'â’¾', + 'â“™' => 'â’¿', + 'â“š' => 'â“€', + 'â“›' => 'â“', + 'â“œ' => 'â“‚', + 'â“' => 'Ⓝ', + 'â“ž' => 'â“„', + 'â“Ÿ' => 'â“…', + 'â“ ' => 'Ⓠ', + 'â“¡' => 'Ⓡ', + 'â“¢' => 'Ⓢ', + 'â“£' => 'Ⓣ', + 'ⓤ' => 'â“Š', + 'â“¥' => 'â“‹', + 'ⓦ' => 'â“Œ', + 'ⓧ' => 'â“', + 'ⓨ' => 'â“Ž', + 'â“©' => 'â“', + 'â°°' => 'â°€', + 'â°±' => 'â°', + 'â°²' => 'â°‚', + 'â°³' => 'â°ƒ', + 'â°´' => 'â°„', + 'â°µ' => 'â°…', + 'â°¶' => 'â°†', + 'â°·' => 'â°‡', + 'â°¸' => 'â°ˆ', + 'â°¹' => 'â°‰', + 'â°º' => 'â°Š', + 'â°»' => 'â°‹', + 'â°¼' => 'â°Œ', + 'â°½' => 'â°', + 'â°¾' => 'â°Ž', + 'â°¿' => 'â°', + 'â±€' => 'â°', + 'â±' => 'â°‘', + 'ⱂ' => 'â°’', + 'ⱃ' => 'â°“', + 'ⱄ' => 'â°”', + 'â±…' => 'â°•', + 'ⱆ' => 'â°–', + 'ⱇ' => 'â°—', + 'ⱈ' => 'â°˜', + 'ⱉ' => 'â°™', + 'ⱊ' => 'â°š', + 'ⱋ' => 'â°›', + 'ⱌ' => 'â°œ', + 'â±' => 'â°', + 'ⱎ' => 'â°ž', + 'â±' => 'â°Ÿ', + 'â±' => 'â° ', + 'ⱑ' => 'â°¡', + 'â±’' => 'â°¢', + 'ⱓ' => 'â°£', + 'â±”' => 'â°¤', + 'ⱕ' => 'â°¥', + 'â±–' => 'â°¦', + 'â±—' => 'â°§', + 'ⱘ' => 'â°¨', + 'â±™' => 'â°©', + 'ⱚ' => 'â°ª', + 'â±›' => 'â°«', + 'ⱜ' => 'â°¬', + 'â±' => 'â°­', + 'ⱞ' => 'â°®', + 'ⱡ' => 'â± ', + 'â±¥' => 'Ⱥ', + 'ⱦ' => 'Ⱦ', + 'ⱨ' => 'Ⱨ', + 'ⱪ' => 'Ⱪ', + 'ⱬ' => 'Ⱬ', + 'â±³' => 'â±²', + 'ⱶ' => 'â±µ', + 'â²' => 'â²€', + 'ⲃ' => 'Ⲃ', + 'â²…' => 'Ⲅ', + 'ⲇ' => 'Ⲇ', + 'ⲉ' => 'Ⲉ', + 'ⲋ' => 'Ⲋ', + 'â²' => 'Ⲍ', + 'â²' => 'Ⲏ', + 'ⲑ' => 'â²', + 'ⲓ' => 'â²’', + 'ⲕ' => 'â²”', + 'â²—' => 'â²–', + 'â²™' => 'Ⲙ', + 'â²›' => 'Ⲛ', + 'â²' => 'Ⲝ', + 'ⲟ' => 'Ⲟ', + 'ⲡ' => 'â² ', + 'â²£' => 'â²¢', + 'â²¥' => 'Ⲥ', + 'ⲧ' => 'Ⲧ', + 'ⲩ' => 'Ⲩ', + 'ⲫ' => 'Ⲫ', + 'â²­' => 'Ⲭ', + 'ⲯ' => 'â²®', + 'â²±' => 'â²°', + 'â²³' => 'â²²', + 'â²µ' => 'â²´', + 'â²·' => 'Ⲷ', + 'â²¹' => 'Ⲹ', + 'â²»' => 'Ⲻ', + 'â²½' => 'â²¼', + 'ⲿ' => 'â²¾', + 'â³' => 'â³€', + 'ⳃ' => 'Ⳃ', + 'â³…' => 'Ⳅ', + 'ⳇ' => 'Ⳇ', + 'ⳉ' => 'Ⳉ', + 'ⳋ' => 'Ⳋ', + 'â³' => 'Ⳍ', + 'â³' => 'Ⳏ', + 'ⳑ' => 'â³', + 'ⳓ' => 'â³’', + 'ⳕ' => 'â³”', + 'â³—' => 'â³–', + 'â³™' => 'Ⳙ', + 'â³›' => 'Ⳛ', + 'â³' => 'Ⳝ', + 'ⳟ' => 'Ⳟ', + 'ⳡ' => 'â³ ', + 'â³£' => 'â³¢', + 'ⳬ' => 'Ⳬ', + 'â³®' => 'â³­', + 'â³³' => 'â³²', + 'â´€' => 'á‚ ', + 'â´' => 'á‚¡', + 'â´‚' => 'á‚¢', + 'â´ƒ' => 'á‚£', + 'â´„' => 'Ⴄ', + 'â´…' => 'á‚¥', + 'â´†' => 'Ⴆ', + 'â´‡' => 'Ⴇ', + 'â´ˆ' => 'Ⴈ', + 'â´‰' => 'á‚©', + 'â´Š' => 'Ⴊ', + 'â´‹' => 'á‚«', + 'â´Œ' => 'Ⴌ', + 'â´' => 'á‚­', + 'â´Ž' => 'á‚®', + 'â´' => 'Ⴏ', + 'â´' => 'á‚°', + 'â´‘' => 'Ⴑ', + 'â´’' => 'Ⴒ', + 'â´“' => 'Ⴓ', + 'â´”' => 'á‚´', + 'â´•' => 'Ⴕ', + 'â´–' => 'Ⴖ', + 'â´—' => 'á‚·', + 'â´˜' => 'Ⴘ', + 'â´™' => 'Ⴙ', + 'â´š' => 'Ⴚ', + 'â´›' => 'á‚»', + 'â´œ' => 'Ⴜ', + 'â´' => 'Ⴝ', + 'â´ž' => 'Ⴞ', + 'â´Ÿ' => 'á‚¿', + 'â´ ' => 'Ⴠ', + 'â´¡' => 'áƒ', + 'â´¢' => 'Ⴢ', + 'â´£' => 'Ⴣ', + 'â´¤' => 'Ⴤ', + 'â´¥' => 'Ⴥ', + 'â´§' => 'Ⴧ', + 'â´­' => 'áƒ', + 'ê™' => 'Ꙁ', + 'ꙃ' => 'Ꙃ', + 'ê™…' => 'Ꙅ', + 'ꙇ' => 'Ꙇ', + 'ꙉ' => 'Ꙉ', + 'ꙋ' => 'Ꙋ', + 'ê™' => 'Ꙍ', + 'ê™' => 'Ꙏ', + 'ꙑ' => 'ê™', + 'ꙓ' => 'ê™’', + 'ꙕ' => 'ê™”', + 'ê™—' => 'ê™–', + 'ê™™' => 'Ꙙ', + 'ê™›' => 'Ꙛ', + 'ê™' => 'Ꙝ', + 'ꙟ' => 'Ꙟ', + 'ꙡ' => 'ê™ ', + 'ꙣ' => 'Ꙣ', + 'ꙥ' => 'Ꙥ', + 'ꙧ' => 'Ꙧ', + 'ꙩ' => 'Ꙩ', + 'ꙫ' => 'Ꙫ', + 'ê™­' => 'Ꙭ', + 'êš' => 'Ꚁ', + 'ꚃ' => 'êš‚', + 'êš…' => 'êš„', + 'ꚇ' => 'Ꚇ', + 'ꚉ' => 'Ꚉ', + 'êš‹' => 'Ꚋ', + 'êš' => 'Ꚍ', + 'êš' => 'Ꚏ', + 'êš‘' => 'êš', + 'êš“' => 'êš’', + 'êš•' => 'êš”', + 'êš—' => 'êš–', + 'êš™' => 'Ꚙ', + 'êš›' => 'êšš', + 'ꜣ' => 'Ꜣ', + 'ꜥ' => 'Ꜥ', + 'ꜧ' => 'Ꜧ', + 'ꜩ' => 'Ꜩ', + 'ꜫ' => 'Ꜫ', + 'ꜭ' => 'Ꜭ', + 'ꜯ' => 'Ꜯ', + 'ꜳ' => 'Ꜳ', + 'ꜵ' => 'Ꜵ', + 'ꜷ' => 'Ꜷ', + 'ꜹ' => 'Ꜹ', + 'ꜻ' => 'Ꜻ', + 'ꜽ' => 'Ꜽ', + 'ꜿ' => 'Ꜿ', + 'ê' => 'ê€', + 'êƒ' => 'ê‚', + 'ê…' => 'ê„', + 'ê‡' => 'ê†', + 'ê‰' => 'êˆ', + 'ê‹' => 'êŠ', + 'ê' => 'êŒ', + 'ê' => 'êŽ', + 'ê‘' => 'ê', + 'ê“' => 'ê’', + 'ê•' => 'ê”', + 'ê—' => 'ê–', + 'ê™' => 'ê˜', + 'ê›' => 'êš', + 'ê' => 'êœ', + 'êŸ' => 'êž', + 'ê¡' => 'ê ', + 'ê£' => 'ê¢', + 'ê¥' => 'ê¤', + 'ê§' => 'ê¦', + 'ê©' => 'ê¨', + 'ê«' => 'êª', + 'ê­' => 'ê¬', + 'ê¯' => 'ê®', + 'êº' => 'ê¹', + 'ê¼' => 'ê»', + 'ê¿' => 'ê¾', + 'êž' => 'Ꞁ', + 'ꞃ' => 'êž‚', + 'êž…' => 'êž„', + 'ꞇ' => 'Ꞇ', + 'ꞌ' => 'êž‹', + 'êž‘' => 'êž', + 'êž“' => 'êž’', + 'êž”' => 'Ꞔ', + 'êž—' => 'êž–', + 'êž™' => 'Ꞙ', + 'êž›' => 'êžš', + 'êž' => 'êžœ', + 'ꞟ' => 'êžž', + 'êž¡' => 'êž ', + 'ꞣ' => 'Ꞣ', + 'ꞥ' => 'Ꞥ', + 'ꞧ' => 'Ꞧ', + 'êž©' => 'Ꞩ', + 'êžµ' => 'êž´', + 'êž·' => 'Ꞷ', + 'êž¹' => 'Ꞹ', + 'êž»' => 'Ꞻ', + 'êž½' => 'êž¼', + 'êž¿' => 'êž¾', + 'ꟃ' => 'Ꟃ', + 'ꟈ' => 'Ꟈ', + 'ꟊ' => 'Ꟊ', + 'ꟶ' => 'Ꟶ', + 'ê­“' => 'êž³', + 'ê­°' => 'Ꭰ', + 'ê­±' => 'Ꭱ', + 'ê­²' => 'Ꭲ', + 'ê­³' => 'Ꭳ', + 'ê­´' => 'Ꭴ', + 'ê­µ' => 'Ꭵ', + 'ê­¶' => 'Ꭶ', + 'ê­·' => 'Ꭷ', + 'ê­¸' => 'Ꭸ', + 'ê­¹' => 'Ꭹ', + 'ê­º' => 'Ꭺ', + 'ê­»' => 'Ꭻ', + 'ê­¼' => 'Ꭼ', + 'ê­½' => 'Ꭽ', + 'ê­¾' => 'Ꭾ', + 'ê­¿' => 'Ꭿ', + 'ꮀ' => 'Ꮀ', + 'ê®' => 'Ꮁ', + 'ꮂ' => 'Ꮂ', + 'ꮃ' => 'Ꮃ', + 'ꮄ' => 'Ꮄ', + 'ê®…' => 'Ꮅ', + 'ꮆ' => 'Ꮆ', + 'ꮇ' => 'Ꮇ', + 'ꮈ' => 'Ꮈ', + 'ꮉ' => 'Ꮉ', + 'ꮊ' => 'Ꮊ', + 'ꮋ' => 'Ꮋ', + 'ꮌ' => 'Ꮌ', + 'ê®' => 'Ꮍ', + 'ꮎ' => 'Ꮎ', + 'ê®' => 'Ꮏ', + 'ê®' => 'á€', + 'ꮑ' => 'á', + 'ê®’' => 'á‚', + 'ꮓ' => 'áƒ', + 'ê®”' => 'á„', + 'ꮕ' => 'á…', + 'ê®–' => 'á†', + 'ê®—' => 'á‡', + 'ꮘ' => 'áˆ', + 'ê®™' => 'á‰', + 'ꮚ' => 'áŠ', + 'ê®›' => 'á‹', + 'ꮜ' => 'áŒ', + 'ê®' => 'á', + 'ꮞ' => 'áŽ', + 'ꮟ' => 'á', + 'ê® ' => 'á', + 'ꮡ' => 'á‘', + 'ꮢ' => 'á’', + 'ꮣ' => 'á“', + 'ꮤ' => 'á”', + 'ꮥ' => 'á•', + 'ꮦ' => 'á–', + 'ꮧ' => 'á—', + 'ꮨ' => 'á˜', + 'ꮩ' => 'á™', + 'ꮪ' => 'áš', + 'ꮫ' => 'á›', + 'ꮬ' => 'áœ', + 'ê®­' => 'á', + 'ê®®' => 'áž', + 'ꮯ' => 'áŸ', + 'ê®°' => 'á ', + 'ê®±' => 'á¡', + 'ꮲ' => 'á¢', + 'ꮳ' => 'á£', + 'ê®´' => 'á¤', + 'ꮵ' => 'á¥', + 'ꮶ' => 'á¦', + 'ê®·' => 'á§', + 'ꮸ' => 'á¨', + 'ꮹ' => 'á©', + 'ꮺ' => 'áª', + 'ê®»' => 'á«', + 'ꮼ' => 'á¬', + 'ꮽ' => 'á­', + 'ꮾ' => 'á®', + 'ꮿ' => 'á¯', + 'ï½' => 'A', + 'b' => 'ï¼¢', + 'c' => 'ï¼£', + 'd' => 'D', + 'ï½…' => 'ï¼¥', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'ï½' => 'ï¼­', + 'n' => 'ï¼®', + 'ï½' => 'O', + 'ï½' => 'ï¼°', + 'q' => 'ï¼±', + 'ï½’' => 'ï¼²', + 's' => 'ï¼³', + 'ï½”' => 'ï¼´', + 'u' => 'ï¼µ', + 'ï½–' => 'V', + 'ï½—' => 'ï¼·', + 'x' => 'X', + 'ï½™' => 'ï¼¹', + 'z' => 'Z', + 'ð¨' => 'ð€', + 'ð©' => 'ð', + 'ðª' => 'ð‚', + 'ð«' => 'ðƒ', + 'ð¬' => 'ð„', + 'ð­' => 'ð…', + 'ð®' => 'ð†', + 'ð¯' => 'ð‡', + 'ð°' => 'ðˆ', + 'ð±' => 'ð‰', + 'ð²' => 'ðŠ', + 'ð³' => 'ð‹', + 'ð´' => 'ðŒ', + 'ðµ' => 'ð', + 'ð¶' => 'ðŽ', + 'ð·' => 'ð', + 'ð¸' => 'ð', + 'ð¹' => 'ð‘', + 'ðº' => 'ð’', + 'ð»' => 'ð“', + 'ð¼' => 'ð”', + 'ð½' => 'ð•', + 'ð¾' => 'ð–', + 'ð¿' => 'ð—', + 'ð‘€' => 'ð˜', + 'ð‘' => 'ð™', + 'ð‘‚' => 'ðš', + 'ð‘ƒ' => 'ð›', + 'ð‘„' => 'ðœ', + 'ð‘…' => 'ð', + 'ð‘†' => 'ðž', + 'ð‘‡' => 'ðŸ', + 'ð‘ˆ' => 'ð ', + 'ð‘‰' => 'ð¡', + 'ð‘Š' => 'ð¢', + 'ð‘‹' => 'ð£', + 'ð‘Œ' => 'ð¤', + 'ð‘' => 'ð¥', + 'ð‘Ž' => 'ð¦', + 'ð‘' => 'ð§', + 'ð“˜' => 'ð’°', + 'ð“™' => 'ð’±', + 'ð“š' => 'ð’²', + 'ð“›' => 'ð’³', + 'ð“œ' => 'ð’´', + 'ð“' => 'ð’µ', + 'ð“ž' => 'ð’¶', + 'ð“Ÿ' => 'ð’·', + 'ð“ ' => 'ð’¸', + 'ð“¡' => 'ð’¹', + 'ð“¢' => 'ð’º', + 'ð“£' => 'ð’»', + 'ð“¤' => 'ð’¼', + 'ð“¥' => 'ð’½', + 'ð“¦' => 'ð’¾', + 'ð“§' => 'ð’¿', + 'ð“¨' => 'ð“€', + 'ð“©' => 'ð“', + 'ð“ª' => 'ð“‚', + 'ð“«' => 'ð“ƒ', + 'ð“¬' => 'ð“„', + 'ð“­' => 'ð“…', + 'ð“®' => 'ð“†', + 'ð“¯' => 'ð“‡', + 'ð“°' => 'ð“ˆ', + 'ð“±' => 'ð“‰', + 'ð“²' => 'ð“Š', + 'ð“³' => 'ð“‹', + 'ð“´' => 'ð“Œ', + 'ð“µ' => 'ð“', + 'ð“¶' => 'ð“Ž', + 'ð“·' => 'ð“', + 'ð“¸' => 'ð“', + 'ð“¹' => 'ð“‘', + 'ð“º' => 'ð“’', + 'ð“»' => 'ð““', + 'ð³€' => 'ð²€', + 'ð³' => 'ð²', + 'ð³‚' => 'ð²‚', + 'ð³ƒ' => 'ð²ƒ', + 'ð³„' => 'ð²„', + 'ð³…' => 'ð²…', + 'ð³†' => 'ð²†', + 'ð³‡' => 'ð²‡', + 'ð³ˆ' => 'ð²ˆ', + 'ð³‰' => 'ð²‰', + 'ð³Š' => 'ð²Š', + 'ð³‹' => 'ð²‹', + 'ð³Œ' => 'ð²Œ', + 'ð³' => 'ð²', + 'ð³Ž' => 'ð²Ž', + 'ð³' => 'ð²', + 'ð³' => 'ð²', + 'ð³‘' => 'ð²‘', + 'ð³’' => 'ð²’', + 'ð³“' => 'ð²“', + 'ð³”' => 'ð²”', + 'ð³•' => 'ð²•', + 'ð³–' => 'ð²–', + 'ð³—' => 'ð²—', + 'ð³˜' => 'ð²˜', + 'ð³™' => 'ð²™', + 'ð³š' => 'ð²š', + 'ð³›' => 'ð²›', + 'ð³œ' => 'ð²œ', + 'ð³' => 'ð²', + 'ð³ž' => 'ð²ž', + 'ð³Ÿ' => 'ð²Ÿ', + 'ð³ ' => 'ð² ', + 'ð³¡' => 'ð²¡', + 'ð³¢' => 'ð²¢', + 'ð³£' => 'ð²£', + 'ð³¤' => 'ð²¤', + 'ð³¥' => 'ð²¥', + 'ð³¦' => 'ð²¦', + 'ð³§' => 'ð²§', + 'ð³¨' => 'ð²¨', + 'ð³©' => 'ð²©', + 'ð³ª' => 'ð²ª', + 'ð³«' => 'ð²«', + 'ð³¬' => 'ð²¬', + 'ð³­' => 'ð²­', + 'ð³®' => 'ð²®', + 'ð³¯' => 'ð²¯', + 'ð³°' => 'ð²°', + 'ð³±' => 'ð²±', + 'ð³²' => 'ð²²', + 'ð‘£€' => 'ð‘¢ ', + 'ð‘£' => '𑢡', + '𑣂' => 'ð‘¢¢', + '𑣃' => 'ð‘¢£', + '𑣄' => '𑢤', + 'ð‘£…' => 'ð‘¢¥', + '𑣆' => '𑢦', + '𑣇' => '𑢧', + '𑣈' => '𑢨', + '𑣉' => '𑢩', + '𑣊' => '𑢪', + '𑣋' => '𑢫', + '𑣌' => '𑢬', + 'ð‘£' => 'ð‘¢­', + '𑣎' => 'ð‘¢®', + 'ð‘£' => '𑢯', + 'ð‘£' => 'ð‘¢°', + '𑣑' => 'ð‘¢±', + 'ð‘£’' => 'ð‘¢²', + '𑣓' => 'ð‘¢³', + 'ð‘£”' => 'ð‘¢´', + '𑣕' => 'ð‘¢µ', + 'ð‘£–' => '𑢶', + 'ð‘£—' => 'ð‘¢·', + '𑣘' => '𑢸', + 'ð‘£™' => 'ð‘¢¹', + '𑣚' => '𑢺', + 'ð‘£›' => 'ð‘¢»', + '𑣜' => 'ð‘¢¼', + 'ð‘£' => 'ð‘¢½', + '𑣞' => 'ð‘¢¾', + '𑣟' => '𑢿', + 'ð–¹ ' => 'ð–¹€', + '𖹡' => 'ð–¹', + 'ð–¹¢' => '𖹂', + 'ð–¹£' => '𖹃', + '𖹤' => '𖹄', + 'ð–¹¥' => 'ð–¹…', + '𖹦' => '𖹆', + '𖹧' => '𖹇', + '𖹨' => '𖹈', + '𖹩' => '𖹉', + '𖹪' => '𖹊', + '𖹫' => '𖹋', + '𖹬' => '𖹌', + 'ð–¹­' => 'ð–¹', + 'ð–¹®' => '𖹎', + '𖹯' => 'ð–¹', + 'ð–¹°' => 'ð–¹', + 'ð–¹±' => '𖹑', + 'ð–¹²' => 'ð–¹’', + 'ð–¹³' => '𖹓', + 'ð–¹´' => 'ð–¹”', + 'ð–¹µ' => '𖹕', + '𖹶' => 'ð–¹–', + 'ð–¹·' => 'ð–¹—', + '𖹸' => '𖹘', + 'ð–¹¹' => 'ð–¹™', + '𖹺' => '𖹚', + 'ð–¹»' => 'ð–¹›', + 'ð–¹¼' => '𖹜', + 'ð–¹½' => 'ð–¹', + 'ð–¹¾' => '𖹞', + '𖹿' => '𖹟', + '𞤢' => '𞤀', + '𞤣' => 'ðž¤', + '𞤤' => '𞤂', + '𞤥' => '𞤃', + '𞤦' => '𞤄', + '𞤧' => '𞤅', + '𞤨' => '𞤆', + '𞤩' => '𞤇', + '𞤪' => '𞤈', + '𞤫' => '𞤉', + '𞤬' => '𞤊', + '𞤭' => '𞤋', + '𞤮' => '𞤌', + '𞤯' => 'ðž¤', + '𞤰' => '𞤎', + '𞤱' => 'ðž¤', + '𞤲' => 'ðž¤', + '𞤳' => '𞤑', + '𞤴' => '𞤒', + '𞤵' => '𞤓', + '𞤶' => '𞤔', + '𞤷' => '𞤕', + '𞤸' => '𞤖', + '𞤹' => '𞤗', + '𞤺' => '𞤘', + '𞤻' => '𞤙', + '𞤼' => '𞤚', + '𞤽' => '𞤛', + '𞤾' => '𞤜', + '𞤿' => 'ðž¤', + '𞥀' => '𞤞', + 'ðž¥' => '𞤟', + '𞥂' => '𞤠', + '𞥃' => '𞤡', + 'ß' => 'SS', + 'ff' => 'FF', + 'ï¬' => 'FI', + 'fl' => 'FL', + 'ffi' => 'FFI', + 'ffl' => 'FFL', + 'ſt' => 'ST', + 'st' => 'ST', + 'Ö‡' => 'ÔµÕ’', + 'ﬓ' => 'Õ„Õ†', + 'ﬔ' => 'Õ„Ôµ', + 'ﬕ' => 'Õ„Ô»', + 'ﬖ' => 'ÕŽÕ†', + 'ﬗ' => 'Õ„Ô½', + 'ʼn' => 'ʼN', + 'Î' => 'ΪÌ', + 'ΰ' => 'ΫÌ', + 'Ç°' => 'JÌŒ', + 'ẖ' => 'H̱', + 'ẗ' => 'T̈', + 'ẘ' => 'WÌŠ', + 'ẙ' => 'YÌŠ', + 'ẚ' => 'Aʾ', + 'á½' => 'Υ̓', + 'á½’' => 'Υ̓̀', + 'á½”' => 'Υ̓Ì', + 'á½–' => 'Υ̓͂', + 'ᾶ' => 'Α͂', + 'ῆ' => 'Η͂', + 'á¿’' => 'Ϊ̀', + 'á¿“' => 'ΪÌ', + 'á¿–' => 'Ι͂', + 'á¿—' => 'Ϊ͂', + 'á¿¢' => 'Ϋ̀', + 'á¿£' => 'ΫÌ', + 'ῤ' => 'Ρ̓', + 'ῦ' => 'Υ͂', + 'ῧ' => 'Ϋ͂', + 'ῶ' => 'Ω͂', + 'ᾈ' => 'ἈΙ', + 'ᾉ' => 'ἉΙ', + 'ᾊ' => 'ἊΙ', + 'ᾋ' => 'ἋΙ', + 'ᾌ' => 'ἌΙ', + 'á¾' => 'á¼Î™', + 'ᾎ' => 'ἎΙ', + 'á¾' => 'á¼Î™', + 'ᾘ' => 'ἨΙ', + 'á¾™' => 'ἩΙ', + 'ᾚ' => 'ἪΙ', + 'á¾›' => 'ἫΙ', + 'ᾜ' => 'ἬΙ', + 'á¾' => 'ἭΙ', + 'ᾞ' => 'ἮΙ', + 'ᾟ' => 'ἯΙ', + 'ᾨ' => 'ὨΙ', + 'ᾩ' => 'ὩΙ', + 'ᾪ' => 'ὪΙ', + 'ᾫ' => 'ὫΙ', + 'ᾬ' => 'ὬΙ', + 'á¾­' => 'ὭΙ', + 'á¾®' => 'ὮΙ', + 'ᾯ' => 'ὯΙ', + 'á¾¼' => 'ΑΙ', + 'á¿Œ' => 'ΗΙ', + 'ῼ' => 'ΩΙ', + 'á¾²' => 'ᾺΙ', + 'á¾´' => 'ΆΙ', + 'á¿‚' => 'ῊΙ', + 'á¿„' => 'ΉΙ', + 'ῲ' => 'ῺΙ', + 'á¿´' => 'ÎΙ', + 'á¾·' => 'Α͂Ι', + 'ῇ' => 'Η͂Ι', + 'á¿·' => 'Ω͂Ι', +); diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php new file mode 100644 index 00000000000..1fedd1f7c84 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -0,0 +1,147 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language($language = null) { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php new file mode 100644 index 00000000000..82f5ac4d0f1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + 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 (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json b/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json new file mode 100644 index 00000000000..1fa21ca16cf --- /dev/null +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json @@ -0,0 +1,41 @@ +{ + "name": "symfony/polyfill-mbstring", + "type": "library", + "description": "Symfony polyfill for the Mbstring extension", + "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, + "files": [ "bootstrap.php" ] + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} From 3c4dd233b5c1e3a1ecc840d2d7da5d6af50c0c22 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 15:00:33 +0000 Subject: [PATCH 24/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/zoujingli/wechat-php-sdk | 1 - 1 file changed, 1 deletion(-) delete mode 160000 upload/system/storage/vendor/zoujingli/wechat-php-sdk diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk b/upload/system/storage/vendor/zoujingli/wechat-php-sdk deleted file mode 160000 index afb0dfd1a0f..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit afb0dfd1a0fd71cfe58b6811d559b6b0fc8f9de0 From e6d48c2fd46b357038f5b344af464e85fa50fe4c Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 15:03:30 +0000 Subject: [PATCH 25/39] Support for PHP 8.0 and 8.1 --- .../zoujingli/wechat-php-sdk/.gitignore | 1 + .../zoujingli/wechat-php-sdk/MIT-LICENSE.txt | 21 + .../vendor/zoujingli/wechat-php-sdk/README.md | 91 ++ .../wechat-php-sdk/Wechat/Lib/Cache.php | 146 ++++ .../wechat-php-sdk/Wechat/Lib/Common.php | 234 +++++ .../wechat-php-sdk/Wechat/Lib/Prpcrypt.php | 196 +++++ .../wechat-php-sdk/Wechat/Lib/Tools.php | 308 +++++++ .../wechat-php-sdk/Wechat/Loader.php | 129 +++ .../wechat-php-sdk/Wechat/WechatCard.php | 819 ++++++++++++++++++ .../wechat-php-sdk/Wechat/WechatCustom.php | 385 ++++++++ .../wechat-php-sdk/Wechat/WechatDevice.php | 467 ++++++++++ .../wechat-php-sdk/Wechat/WechatExtends.php | 209 +++++ .../wechat-php-sdk/Wechat/WechatHardware.php | 160 ++++ .../wechat-php-sdk/Wechat/WechatMedia.php | 430 +++++++++ .../wechat-php-sdk/Wechat/WechatMenu.php | 183 ++++ .../wechat-php-sdk/Wechat/WechatMessage.php | 352 ++++++++ .../wechat-php-sdk/Wechat/WechatOauth.php | 138 +++ .../wechat-php-sdk/Wechat/WechatPay.php | 620 +++++++++++++ .../wechat-php-sdk/Wechat/WechatPoi.php | 193 +++++ .../wechat-php-sdk/Wechat/WechatReceive.php | 771 +++++++++++++++++ .../wechat-php-sdk/Wechat/WechatScript.php | 138 +++ .../wechat-php-sdk/Wechat/WechatService.php | 408 +++++++++ .../wechat-php-sdk/Wechat/WechatUser.php | 612 +++++++++++++ .../zoujingli/wechat-php-sdk/composer.json | 21 + .../zoujingli/wechat-php-sdk/include.php | 17 + .../vendor/zoujingli/wechat-php-sdk/test.php | 68 ++ 26 files changed, 7117 insertions(+) create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/test.php diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore new file mode 100644 index 00000000000..485dee64bcf --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt new file mode 100644 index 00000000000..0624076f028 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2014-2017 Anyon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md new file mode 100644 index 00000000000..e1b42e9194d --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md @@ -0,0 +1,91 @@ +[![Latest Stable Version](https://poser.pugx.org/zoujingli/wechat-php-sdk/v/stable)](https://packagist.org/packages/zoujingli/wechat-php-sdk) +[![Total Downloads](https://poser.pugx.org/zoujingli/wechat-php-sdk/downloads)](https://packagist.org/packages/zoujingli/wechat-php-sdk) +[![Latest Unstable Version](https://poser.pugx.org/zoujingli/wechat-php-sdk/v/unstable)](https://packagist.org/packages/zoujingli/wechat-php-sdk) +[![License](https://poser.pugx.org/zoujingli/wechat-php-sdk/license)](https://packagist.org/packages/zoujingli/wechat-php-sdk) + +æ­¤`SDK`è¿è¡Œæœ€åº•è¦æ±‚`PHP`版本`5.3`, 建议在`PHP7`上è¿è¡Œä»¥èŽ·å–最佳性能。 + +微信的部分接å£éœ€è¦ç¼“存数æ®åœ¨æœ¬åœ°ï¼Œå› æ­¤å¯¹ç›®å½•éœ€è¦æœ‰å†™æƒé™ã€‚ + +我们鼓励大家使用`composer`æ¥ç®¡ç†æ‚¨çš„第三方库,方便åŽæœŸæ›´æ–°æ“作(尤其是接å£ç±»ï¼‰ã€‚ + +近期`access_token`ç»å¸¸æ— æ•…失效,`SDK`已加入失败状æ€æ£€æµ‹ï¼Œè‡ªåŠ¨é‡æ–°èŽ·å–`access_token`并返回结果. + +æ­¤`SDK`已历ç»æ•°ä¸ªçº¿ä¸Šé¡¹ç›®éªŒè¯ä¸Žè€ƒéªŒï¼Œå¯é æ€§ä¸Žç¨³å®šæ€§æžé«˜ï¼Œæ¬¢è¿Ž`fork`或`star`此项目。 + +## 新微信开å‘工具推è +* 微信æœåŠ¡å·ã€å¾®ä¿¡å°ç¨‹åºã€å¾®ä¿¡æ”¯ä»˜ã€æ”¯ä»˜å®æ”¯ä»˜ +* Gitee 仓库 WeChatDevloper: https://gitee.com/zoujingli/WeChatDeveloper +* Github 仓库 WeChatDeveloper:https://github.com/zoujingli/WeChatDeveloper + +**微信SDKå¼€å‘帮助åŠäº¤æµ** +-- +* **在åšå¾®ä¿¡å¼€å‘å‰ï¼Œå¿…需先阅读微信官方文档,此SDK也是基于之上进行的å°è£…。** + +* **文档链接地å€**:http://www.kancloud.cn/zoujingli/wechat-php-sdk + +* **Think.Admin**:https://github.com/zoujingli/Think.Admin + +* **å¼€å‘交æµQQ群:513350915(新)** + +**若对您有帮助,å¯ä»¥èµžåŠ©å¹¶æ”¯æŒä¸‹ä½œè€…哦,谢谢ï¼** +-- +![](http://static.thinkadmin.top/pay.png) + + +**官方接å£æ–‡æ¡£é“¾æŽ¥** +-- +* 使用å‰éœ€å…ˆæ‰“开微信å¸å·çš„å¼€å‘模å¼ï¼Œè¯¦ç»†æ­¥éª¤è¯·æŸ¥çœ‹å¾®ä¿¡å…¬ä¼—å¹³å°æŽ¥å£ä½¿ç”¨è¯´æ˜Žï¼š +* 微信公众平å°ï¼š http://mp.weixin.qq.com/wiki/ +* 微信ä¼ä¸šå¹³å°ï¼š http://qydev.weixin.qq.com/wiki/ +* 微信开放平å°ï¼šhttps://open.weixin.qq.com/ +* 微信支付接入文档:https://mp.weixin.qq.com/cgi-bin/readtemplate?t=business/course2_tmpl&lang=zh_CN +* 微信商户平å°ï¼šhttps://pay.weixin.qq.com + +**微信`SDK`项目æºæ–‡ä»¶æ‰˜ç®¡** +-- +* SDK 为开æºé¡¹ç›®ï¼Œä½ å¯ä»¥æŠŠå®ƒç”¨äºŽä»»ä½•åœ°å€ï¼Œå¹¶ä¸å—任何约æŸï¼Œæ¬¢è¿Ž`fork`项目。 +* 通过 [Github](https://github.com/zoujingli/wechat-php-sdk) 下载 SDK æºä»£ç  +* 通过 [OSChina](http://git.oschina.net/zoujingli/wechat-php-sdk) 下载 SDK æºä»£ç  +* 通过 [Composer](https://getcomposer.org) 包管ç†å·¥å…·ä¸‹è½½ SDK æºä»£ç  + +**微信`SDK`å°è£…对接åŠåŠŸèƒ½** +-- +* æŽ¥å…¥éªŒè¯ ï¼ˆåˆçº§æƒé™ï¼‰ +* 自动回å¤ï¼ˆæ–‡æœ¬ã€å›¾ç‰‡ã€è¯­éŸ³ã€è§†é¢‘ã€éŸ³ä¹ã€å›¾æ–‡ï¼‰ (åˆçº§æƒé™ï¼‰ +* èœå•æ“作(查询ã€åˆ›å»ºã€åˆ é™¤ï¼‰ (èœå•æƒé™ï¼‰ +* 客æœæ¶ˆæ¯ï¼ˆæ–‡æœ¬ã€å›¾ç‰‡ã€è¯­éŸ³ã€è§†é¢‘ã€éŸ³ä¹ã€å›¾æ–‡ï¼‰ (认è¯æƒé™ï¼‰ +* 二维ç ï¼ˆåˆ›å»ºä¸´æ—¶ã€æ°¸ä¹…二维ç ï¼ŒèŽ·å–二维ç URL) (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* é•¿é“¾æŽ¥è½¬çŸ­é“¾æŽ¥æŽ¥å£ ï¼ˆæœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* 标签æ“作(查询ã€åˆ›å»ºã€ä¿®æ”¹ã€ç§»åŠ¨ç”¨æˆ·åˆ°æ ‡ç­¾ï¼‰ (认è¯æƒé™ï¼‰ +* 网页授æƒï¼ˆåŸºæœ¬æŽˆæƒï¼Œç”¨æˆ·ä¿¡æ¯æŽˆæƒï¼‰ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* 用户信æ¯ï¼ˆæŸ¥è¯¢ç”¨æˆ·åŸºæœ¬ä¿¡æ¯ã€èŽ·å–关注者列表) (认è¯æƒé™ï¼‰ +* 多客æœåŠŸèƒ½ï¼ˆå®¢æœç®¡ç†ã€èŽ·å–客æœè®°å½•ã€å®¢æœä¼šè¯ç®¡ç†ï¼‰ (认è¯æƒé™ï¼‰ +* 媒体文件(上传ã€èŽ·å–) (认è¯æƒé™ï¼‰ +* é«˜çº§ç¾¤å‘ ï¼ˆè®¤è¯æƒé™ï¼‰ +* 模æ¿æ¶ˆæ¯ï¼ˆè®¾ç½®æ‰€å±žè¡Œä¸šã€æ·»åŠ æ¨¡æ¿ã€å‘é€æ¨¡æ¿æ¶ˆæ¯ï¼‰ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* å¡åˆ¸ç®¡ç†ï¼ˆåˆ›å»ºã€ä¿®æ”¹ã€åˆ é™¤ã€å‘放ã€é—¨åº—管ç†ç­‰ï¼‰ (认è¯æƒé™ï¼‰ +* 语义ç†è§£ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* 获å–微信æœåŠ¡å™¨IP列表 (åˆçº§æƒé™ï¼‰ +* 微信JSAPI授æƒ(获å–ticketã€èŽ·å–ç­¾å) (åˆçº§æƒé™ï¼‰ +* æ•°æ®ç»Ÿè®¡(用户ã€å›¾æ–‡ã€æ¶ˆæ¯ã€æŽ¥å£åˆ†æžæ•°æ®) (认è¯æƒé™ï¼‰ +* 微信支付(网页支付ã€æ‰«ç æ”¯ä»˜ã€äº¤æ˜“退款ã€ç»™ç²‰ä¸æ‰“款)(认è¯æœåŠ¡å·å¹¶å¼€é€šæ”¯ä»˜åŠŸèƒ½ï¼‰ + +**接å£æƒé™å¤‡æ³¨ï¼š** +-- +* åˆçº§æƒé™ï¼šåŸºæœ¬æƒé™ï¼Œä»»ä½•æ­£å¸¸çš„公众å·éƒ½æœ‰æ­¤æƒé™ +* èœå•æƒé™ï¼šæ­£å¸¸çš„æœåŠ¡å·ã€è®¤è¯åŽçš„订阅å·æ‹¥æœ‰æ­¤æƒé™ +* 认è¯æƒé™ï¼šåˆ†ä¸ºè®¢é˜…å·ã€æœåŠ¡å·è®¤è¯ï¼Œå¦‚å‰ç¼€æœåŠ¡å·åˆ™ä»…认è¯çš„æœåŠ¡å·æœ‰æ­¤æƒé™ +* 支付æƒé™ï¼šä»…认è¯åŽçš„æœåŠ¡å·å¯ä»¥ç”³è¯·æ­¤æƒé™ + +**微信开放第三方平å°** --- (案例åŠæ–‡æ¡£æ•´ç†ä¸­ï¼‰ +-- +* 公众å·æŽˆæƒæœåŠ¡ +* 公众å·æŽ¨é€æ¶ˆæ¯ä»£å¤„ç† +* 公众å·åŸºç¡€ä¸šåŠ¡ä»£å¤„ç† +* 公众å·æ”¯ä»˜ä»£å‘èµ· + +**微信`SDK`版æƒå£°æ˜Ž** +-- +* æ­¤SDK基于`MIT`åè®®å‘布,任何人å¯ä»¥ç”¨åœ¨ä»»ä½•åœ°æ–¹ï¼Œä¸å—çº¦æŸ +* æ­¤SDK部分代ç æ¥è‡ªäº’è”网,若有异议,å¯ä»¥è”系作者进行删除 diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php new file mode 100644 index 00000000000..ee10b87e808 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php @@ -0,0 +1,146 @@ + + * @date 2016-08-20 17:50 + */ +class Cache +{ + + /** + * 缓存ä½ç½® + * @var string + */ + static public $cachepath; + + /** + * 设置缓存 + * @param string $name + * @param string $value + * @param int $expired + * @return mixed + */ + static public function set($name, $value, $expired = 0) + { + if (isset(Loader::$callback['CacheSet'])) { + return call_user_func_array(Loader::$callback['CacheSet'], func_get_args()); + } + $data = serialize(array('value' => $value, 'expired' => $expired > 0 ? time() + $expired : 0)); + return self::check() && file_put_contents(self::$cachepath . $name, $data); + } + + /** + * 读å–缓存 + * @param string $name + * @return mixed + */ + static public function get($name) + { + if (isset(Loader::$callback['CacheGet'])) { + return call_user_func_array(Loader::$callback['CacheGet'], func_get_args()); + } + if (self::check() && ($file = self::$cachepath . $name) && file_exists($file) && ($data = file_get_contents($file)) && !empty($data)) { + $data = unserialize($data); + if (isset($data['expired']) && ($data['expired'] > time() || $data['expired'] === 0)) { + return isset($data['value']) ? $data['value'] : null; + } + } + return null; + } + + /** + * 删除缓存 + * @param string $name + * @return mixed + */ + static public function del($name) + { + if (isset(Loader::$callback['CacheDel'])) { + return call_user_func_array(Loader::$callback['CacheDel'], func_get_args()); + } + return self::check() && @unlink(self::$cachepath . $name); + } + + /** + * 输出内容到日志 + * @param string $line + * @param string $filename + * @return mixed + */ + static public function put($line, $filename = '') + { + if (isset(Loader::$callback['CachePut'])) { + return call_user_func_array(Loader::$callback['CachePut'], func_get_args()); + } + empty($filename) && $filename = date('Ymd') . '.log'; + return self::check() && file_put_contents(self::$cachepath . $filename, '[' . date('Y/m/d H:i:s') . "] {$line}\n", FILE_APPEND); + } + + /** + * 检查缓存目录 + * @return bool + */ + static protected function check() + { + empty(self::$cachepath) && self::$cachepath = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR; + self::$cachepath = rtrim(self::$cachepath, '/\\') . DIRECTORY_SEPARATOR; + if (!is_dir(self::$cachepath) && !mkdir(self::$cachepath, 0755, true)) { + return false; + } + return true; + } + + /** + * 文件缓存,æˆåŠŸè¿”回文件路径 + * @param string $content 文件内容 + * @param string $filename 文件å称 + * @return bool|string + */ + static public function file($content, $filename = '') + { + if (isset(Loader::$callback['CacheFile'])) { + return call_user_func_array(Loader::$callback['CacheFile'], func_get_args()); + } + empty($filename) && $filename = md5($content) . '.' . self::getFileExt($content); + if (self::check() && file_put_contents(self::$cachepath . $filename, $content)) { + return self::$cachepath . $filename; + } + return false; + } + + /** + * æ ¹æ®æ–‡ä»¶æµè¯»å–文件åŽç¼€ + * @param string $content + * @return string + */ + static public function getFileExt($content) + { + $types = array( + 255216 => 'jpg', 7173 => 'gif', 6677 => 'bmp', 13780 => 'png', + 7368 => 'mp3', 4838 => 'wma', 7784 => 'mid', 6063 => 'xml', + ); + $typeInfo = @unpack("C2chars", substr($content, 0, 2)); + $typeCode = intval($typeInfo['chars1'] . $typeInfo['chars2']); + return isset($types[$typeCode]) ? $types[$typeCode] : 'mp4'; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php new file mode 100644 index 00000000000..11df686bdb7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php @@ -0,0 +1,234 @@ + + * @date 2016/05/28 11:55 + */ +class Common +{ + + /** API接å£URL需è¦ä½¿ç”¨æ­¤å‰ç¼€ */ + const API_BASE_URL_PREFIX = 'https://api.weixin.qq.com'; + const API_URL_PREFIX = 'https://api.weixin.qq.com/cgi-bin'; + const GET_TICKET_URL = '/ticket/getticket?'; + const AUTH_URL = '/token?grant_type=client_credential&'; + public $token; + public $encodingAesKey; + public $encrypt_type; + public $appid; + public $appsecret; + public $access_token; + public $postxml; + public $_msg; + public $errCode = 0; + public $errMsg = ""; + public $config = array(); + private $_retry = false; + + /** + * 构造方法 + * @param array $options + */ + public function __construct($options = array()) + { + $config = Loader::config($options); + $this->token = isset($config['token']) ? $config['token'] : ''; + $this->appid = isset($config['appid']) ? $config['appid'] : ''; + $this->appsecret = isset($config['appsecret']) ? $config['appsecret'] : ''; + $this->encodingAesKey = isset($config['encodingaeskey']) ? $config['encodingaeskey'] : ''; + $this->config = $config; + } + + /** + * 当å‰å½“å‰é”™è¯¯ä»£ç  + * @return int + */ + public function getErrorCode() + { + return $this->errCode; + } + + /** + * 获å–当å‰é”™è¯¯å†…容 + * @return string + */ + public function getError() + { + return $this->errMsg; + } + + /** + * 获å–当å‰æ“作公众å·APPID + * @return string + */ + public function getAppid() + { + return $this->appid; + } + + /** + * 获å–SDKé…ç½®å‚æ•° + * @return array + */ + public function getConfig() + { + return $this->config; + } + + + /** + * 接å£éªŒè¯ + * @return bool + */ + public function valid() + { + $encryptStr = ""; + if ($_SERVER['REQUEST_METHOD'] == "POST") { + $postStr = file_get_contents("php://input"); + $disableEntities = libxml_disable_entity_loader(true); + $array = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); + $this->encrypt_type = isset($_GET["encrypt_type"]) ? $_GET["encrypt_type"] : ''; + if ($this->encrypt_type == 'aes') { + $encryptStr = $array['Encrypt']; + !class_exists('Prpcrypt', false) && require __DIR__ . '/Prpcrypt.php'; + $pc = new Prpcrypt($this->encodingAesKey); + $array = $pc->decrypt($encryptStr, $this->appid); + if (!isset($array[0]) || intval($array[0]) > 0) { + $this->errCode = $array[0]; + $this->errMsg = $array[1]; + Tools::log("Interface Authentication Failed. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + $this->postxml = $array[1]; + empty($this->appid) && $this->appid = $array[2]; + } else { + $this->postxml = $postStr; + } + } elseif (isset($_GET["echostr"])) { + if ($this->checkSignature()) { + @ob_clean(); + exit($_GET["echostr"]); + } + return false; + } + if (!$this->checkSignature($encryptStr)) { + $this->errMsg = 'Interface authentication failed, please use the correct method to call.'; + return false; + } + return true; + } + + /** + * 验è¯æ¥è‡ªå¾®ä¿¡æœåŠ¡å™¨ + * @param string $str + * @return bool + */ + private function checkSignature($str = '') + { + $signature = isset($_GET["msg_signature"]) ? $_GET["msg_signature"] : (isset($_GET["signature"]) ? $_GET["signature"] : ''); + $timestamp = isset($_GET["timestamp"]) ? $_GET["timestamp"] : ''; + $nonce = isset($_GET["nonce"]) ? $_GET["nonce"] : ''; + $tmpArr = array($this->token, $timestamp, $nonce, $str); + sort($tmpArr, SORT_STRING); + if (sha1(implode($tmpArr)) == $signature) { + return true; + } + return false; + } + + /** + * 获å–公众å·è®¿é—® access_token + * @param string $appid 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º + * @param string $appsecret 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º + * @param string $token 手动指定access_token,éžå¿…è¦æƒ…况ä¸å»ºè®®ç”¨ + * @return bool|string + */ + public function getAccessToken($appid = '', $appsecret = '', $token = '') + { + if (!$appid || !$appsecret) { + list($appid, $appsecret) = array($this->appid, $this->appsecret); + } + if ($token) { + return $this->access_token = $token; + } + $cache = 'wechat_access_token_' . $appid; + if (($access_token = Tools::getCache($cache)) && !empty($access_token)) { + return $this->access_token = $access_token; + } + # 检测事件注册 + if (isset(Loader::$callback[__FUNCTION__])) { + return $this->access_token = call_user_func_array(Loader::$callback[__FUNCTION__], array(&$this, &$cache)); + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::AUTH_URL . 'appid=' . $appid . '&secret=' . $appsecret); + if ($result) { + $json = json_decode($result, true); + if (!$json || isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + Tools::log("Get New AccessToken Error. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + $this->access_token = $json['access_token']; + Tools::log("Get New AccessToken Success.", "MSG - {$this->appid}"); + Tools::setCache($cache, $this->access_token, 5000); + return $this->access_token; + } + return false; + } + + /** + * 接å£å¤±è´¥é‡è¯• + * @param string $method SDK方法å称 + * @param array $arguments SDK方法å‚æ•° + * @return bool|mixed + */ + protected function checkRetry($method, $arguments = array()) + { + Tools::log("Run {$method} Faild. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); + if (!$this->_retry && in_array($this->errCode, array('40014', '40001', '41001', '42001'))) { + ($this->_retry = true) && $this->resetAuth(); + $this->errCode = 40001; + $this->errMsg = 'no access'; + Tools::log("Retry Run {$method} ...", "MSG - {$this->appid}"); + return call_user_func_array(array($this, $method), $arguments); + } + return false; + } + + /** + * 删除验è¯æ•°æ® + * @param string $appid 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º + * @return bool + */ + public function resetAuth($appid = '') + { + $authname = 'wechat_access_token_' . (empty($appid) ? $this->appid : $appid); + Tools::log("Reset Auth And Remove Old AccessToken.", "MSG - {$this->appid}"); + $this->access_token = ''; + Tools::removeCache($authname); + return true; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php new file mode 100644 index 00000000000..5830ea43a83 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php @@ -0,0 +1,196 @@ + PKCS7Encoder::$block_size) { + $pad = 0; + } + return substr($text, 0, (strlen($text) - $pad)); + } + +} + +/** + * 接收和推é€ç»™å…¬ä¼—å¹³å°æ¶ˆæ¯çš„加解密 + * @category WechatSDK + * @subpackage library + * @date 2016/06/28 11:59 + */ +class Prpcrypt +{ + + public $key; + + function __construct($k) + { + $this->key = base64_decode($k . "="); + } + + /** + * 对明文进行加密 + * @param string $text 需è¦åŠ å¯†çš„明文 + * @param string $appid 公众å·APPID + * @return array + */ + public function encrypt($text, $appid) + { + try { + //获得16ä½éšæœºå­—ç¬¦ä¸²ï¼Œå¡«å……åˆ°æ˜Žæ–‡ä¹‹å‰ + $random = $this->getRandomStr();//"aaaabbbbccccdddd"; + $text = $random . pack("N", strlen($text)) . $text . $appid; + $iv = substr($this->key, 0, 16); + $pkc_encoder = new PKCS7Encoder; + $text = $pkc_encoder->encode($text); + $encrypted = openssl_encrypt($text, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); + return array(ErrorCode::$OK, $encrypted); + } catch (Exception $e) { + return array(ErrorCode::$EncryptAESError, null); + } + } + + /** + * 对密文进行解密 + * @param string $encrypted 需è¦è§£å¯†çš„密文 + * @param string $appid 公众å·APPID + * @return array + */ + public function decrypt($encrypted, $appid) + { + try { + $iv = substr($this->key, 0, 16); + $decrypted = openssl_decrypt($encrypted, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); + } catch (Exception $e) { + return array(ErrorCode::$DecryptAESError, null); + } + try { + $pkc_encoder = new PKCS7Encoder; + $result = $pkc_encoder->decode($decrypted); + if (strlen($result) < 16) { + return array(ErrorCode::$DecryptAESError, null); + } + $content = substr($result, 16, strlen($result)); + $len_list = unpack("N", substr($content, 0, 4)); + $xml_len = $len_list[1]; + $xml_content = substr($content, 4, $xml_len); + $from_appid = substr($content, $xml_len + 4); + return array(0, $xml_content, $from_appid); + } catch (Exception $e) { + return array(ErrorCode::$IllegalBuffer, null); + } + + } + + /** + * éšæœºç”Ÿæˆ16ä½å­—符串 + * @return string 生æˆçš„字符串 + */ + function getRandomStr() + { + $str = ""; + $str_pol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; + $max = strlen($str_pol) - 1; + for ($i = 0; $i < 16; $i++) { + $str .= $str_pol[mt_rand(0, $max)]; + } + return $str; + } + +} + +/** + * 仅用作类内部使用 + * ä¸ç”¨äºŽå®˜æ–¹API接å£çš„errCodeç  + * Class ErrorCode + */ +class ErrorCode +{ + + public static $OK = 0; + public static $ValidateSignatureError = 40001; + public static $ParseXmlError = 40002; + public static $ComputeSignatureError = 40003; + public static $IllegalAesKey = 40004; + public static $ValidateAppidError = 40005; + public static $EncryptAESError = 40006; + public static $DecryptAESError = 40007; + public static $IllegalBuffer = 40008; + public static $EncodeBase64Error = 40009; + public static $DecodeBase64Error = 40010; + public static $GenReturnXmlError = 40011; + public static $errCode = array( + '0' => '处ç†æˆåŠŸ', + '40001' => '校验签å失败', + '40002' => '解æžxml失败', + '40003' => '计算签å失败', + '40004' => 'ä¸åˆæ³•çš„AESKey', + '40005' => '校验AppID失败', + '40006' => 'AES加密失败', + '40007' => 'AES解密失败', + '40008' => '公众平å°å‘é€çš„xmlä¸åˆæ³•', + '40009' => 'Base64ç¼–ç å¤±è´¥', + '40010' => 'Base64解ç å¤±è´¥', + '40011' => '公众å¸å·ç”Ÿæˆå›žåŒ…xml失败' + ); + + /** + * 获å–错误消æ¯å†…容 + * @param string $err + * @return bool + */ + public static function getErrText($err) + { + if (isset(self::$errCode[$err])) { + return self::$errCode[$err]; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php new file mode 100644 index 00000000000..6558a8e48da --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php @@ -0,0 +1,308 @@ + + * @date 2016/05/28 11:55 + */ +class Tools +{ + + /** + * 判断字符串是å¦ç»è¿‡ç¼–ç æ–¹æ³• + * @param string $str + * @return bool + */ + static public function isBase64($str) + { + if ($str == base64_encode(base64_decode($str))) { + return true; + } else { + return false; + } + } + + /** + * 产生éšæœºå­—符串 + * @param int $length 指定字符长度 + * @param string $str 字符串å‰ç¼€ + * @return string + */ + static public function createNoncestr($length = 32, $str = "") + { + $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; + for ($i = 0; $i < $length; $i++) { + $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); + } + return $str; + } + + /** + * æ•°æ®ç”Ÿæˆç­¾å + * @param array $data ç­¾å数组 + * @param string $method ç­¾å方法 + * @return bool|string ç­¾å值 + */ + static public function getSignature($data, $method = "sha1") + { + if (!function_exists($method)) { + return false; + } + ksort($data); + $params = array(); + foreach ($data as $key => $value) { + $params[] = "{$key}={$value}"; + } + return $method(join('&', $params)); + } + + /** + * 生æˆæ”¯ä»˜ç­¾å + * @param array $option + * @param string $partnerKey + * @return string + */ + static public function getPaySign($option, $partnerKey) + { + ksort($option); + $buff = ''; + foreach ($option as $k => $v) { + $buff .= "{$k}={$v}&"; + } + return strtoupper(md5("{$buff}key={$partnerKey}")); + } + + /** + * XMLç¼–ç  + * @param mixed $data æ•°æ® + * @param string $root 根节点å + * @param string $item 数字索引的å­èŠ‚点å + * @param string $id 数字索引å­èŠ‚点key转æ¢çš„属性å + * @return string + */ + static public function arr2xml($data, $root = 'xml', $item = 'item', $id = 'id') + { + return "<{$root}>" . self::_data_to_xml($data, $item, $id) . ""; + } + + /** + * XMLå†…å®¹ç”Ÿæˆ + * @param array $data æ•°æ® + * @param string $item å­èŠ‚点 + * @param string $id 节点ID + * @param string $content 节点内容 + * @return string + */ + static private function _data_to_xml($data, $item = 'item', $id = 'id', $content = '') + { + foreach ($data as $key => $val) { + is_numeric($key) && $key = "{$item} {$id}=\"{$key}\""; + $content .= "<{$key}>"; + if (is_array($val) || is_object($val)) { + $content .= self::_data_to_xml($val); + } elseif (is_numeric($val)) { + $content .= $val; + } else { + $content .= ''; + } + list($_key, ) = explode(' ', $key . ' '); + $content .= ""; + } + return $content; + } + + /** + * å°†xml转为array + * @param string $xml + * @return array + */ + static public function xml2arr($xml) + { + $disableEntities = libxml_disable_entity_loader(true); + $result = json_decode(Tools::json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); + libxml_disable_entity_loader($disableEntities); + return $result; + } + + /** + * 生æˆå®‰å…¨JSONæ•°æ® + * @param array $array + * @return string + */ + static public function json_encode($array) + { + return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', function ($matches) { + return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE"); + }, json_encode($array)); + } + + /** + * 以getæ–¹å¼æ交请求 + * @param $url + * @return bool|mixed + */ + static public function httpGet($url) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_SSLVERSION, 1); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_TIMEOUT, 30); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); + return (intval($status["http_code"]) === 200) ? $content : false; + } + + /** + * 以postæ–¹å¼æ交请求 + * @param string $url + * @param array|string $data + * @return bool|mixed + */ + static public function httpPost($url, $data) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HEADER, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildPost($data)); + list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); + return (intval($status["http_code"]) === 200) ? $content : false; + } + + /** + * 使用è¯ä¹¦ï¼Œä»¥postæ–¹å¼æ交xml到对应的接å£url + * @param string $url POSTæ交的内容 + * @param array $data è¯·æ±‚çš„åœ°å€ + * @param string $ssl_cer è¯ä¹¦Cer路径 | è¯ä¹¦å†…容 + * @param string $ssl_key è¯ä¹¦Key路径 | è¯ä¹¦å†…容 + * @param int $second 设置请求超时时间 + * @return bool|mixed + */ + static public function httpsPost($url, $data, $ssl_cer = null, $ssl_key = null, $second = 30) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_TIMEOUT, $second); + curl_setopt($curl, CURLOPT_HEADER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + if (!is_null($ssl_cer) && file_exists($ssl_cer) && is_file($ssl_cer)) { + curl_setopt($curl, CURLOPT_SSLCERTTYPE, 'PEM'); + curl_setopt($curl, CURLOPT_SSLCERT, $ssl_cer); + } + if (!is_null($ssl_key) && file_exists($ssl_key) && is_file($ssl_key)) { + curl_setopt($curl, CURLOPT_SSLKEYTYPE, 'PEM'); + curl_setopt($curl, CURLOPT_SSLKEY, $ssl_key); + } + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildPost($data)); + list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); + return (intval($status["http_code"]) === 200) ? $content : false; + } + + /** + * POSTæ•°æ®è¿‡æ»¤å¤„ç† + * @param array $data + * @return array + */ + static private function _buildPost(&$data) + { + if (is_array($data)) { + foreach ($data as &$value) { + if (is_string($value) && $value[0] === '@' && class_exists('CURLFile', false)) { + $filename = realpath(trim($value, '@')); + file_exists($filename) && $value = new CURLFile($filename); + } + } + } + return $data; + } + + /** + * 读å–微信客户端IP + * @return null|string + */ + static public function getAddress() + { + foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP', 'REMOTE_ADDR') as $header) { + if (!isset($_SERVER[$header]) || ($spoof = $_SERVER[$header]) === null) { + continue; + } + sscanf($spoof, '%[^,]', $spoof); + if (!filter_var($spoof, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { + $spoof = null; + } else { + return $spoof; + } + } + return '0.0.0.0'; + } + + /** + * 设置缓存,按需é‡è½½ + * @param string $cachename + * @param mixed $value + * @param int $expired + * @return bool + */ + static public function setCache($cachename, $value, $expired = 0) + { + return Cache::set($cachename, $value, $expired); + } + + /** + * 获å–缓存,按需é‡è½½ + * @param string $cachename + * @return mixed + */ + static public function getCache($cachename) + { + return Cache::get($cachename); + } + + /** + * 清除缓存,按需é‡è½½ + * @param string $cachename + * @return bool + */ + static public function removeCache($cachename) + { + return Cache::del($cachename); + } + + /** + * SDK日志处ç†æ–¹æ³• + * @param string $msg 日志行内容 + * @param string $type 日志级别 + */ + static public function log($msg, $type = 'MSG') + { + Cache::put($type . ' - ' . $msg); + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php new file mode 100644 index 00000000000..eb2f36f92aa --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php @@ -0,0 +1,129 @@ + + * @date 2016/10/26 10:21 + */ +spl_autoload_register(function ($class) { + if (0 === stripos($class, 'Wechat\\')) { + $filename = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; + if (file_exists($filename)) require $filename; + } +}); + +/** + * 微信SDK加载器 + * @author Anyon + * @date 2016-08-21 11:06 + */ +class Loader +{ + + /** + * 事件注册函数 + * @var array + */ + static public $callback = array(); + + /** + * é…ç½®å‚æ•° + * @var array + */ + static protected $config = array(); + + /** + * 对象缓存 + * @var array + */ + static protected $cache = array(); + + /** + * 动æ€æ³¨å†ŒSDK事件处ç†å‡½æ•° + * @param string $event 事件å称(getAccessToken|getJsTicket) + * @param string $method 处ç†æ–¹æ³•ï¼ˆå¯ä»¥æ˜¯æ™®é€šæ–¹æ³•æˆ–者类中的方法) + * @param string|null $class 处ç†å¯¹è±¡ï¼ˆå¯ä»¥ç›´æŽ¥ä½¿ç”¨çš„类实例) + */ + static public function register($event, $method, $class = null) + { + if (!empty($class) && class_exists($class, false) && method_exists($class, $method)) { + self::$callback[$event] = array($class, $method); + } else { + self::$callback[$event] = $method; + } + } + + /** + * 获å–微信SDK接å£å¯¹è±¡(别å函数) + * @param string $type 接å£ç±»åž‹(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi) + * @param array $config SDKé…ç½®(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img) + * @return WechatCard|WechatCustom|WechatDevice|WechatExtends|WechatMedia|WechatMenu|WechatOauth|WechatPay|WechatPoi|WechatReceive|WechatScript|WechatService|WechatUser + */ + static public function get_instance($type, $config = array()) + { + return self::get($type, $config); + } + + /** + * 获å–微信SDK接å£å¯¹è±¡ + * @param string $type 接å£ç±»åž‹(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi) + * @param array $config SDKé…ç½®(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img) + * @return WechatCard|WechatCustom|WechatDevice|WechatExtends|WechatMedia|WechatMenu|WechatOauth|WechatPay|WechatPoi|WechatReceive|WechatScript|WechatService|WechatUser + */ + static public function get($type, $config = array()) + { + $index = md5(strtolower($type) . md5(json_encode(self::$config))); + if (!isset(self::$cache[$index])) { + $basicName = 'Wechat' . ucfirst(strtolower($type)); + $className = "\\Wechat\\{$basicName}"; + // 注册类的无命å空间别å,兼容未带命å空间的è€ç‰ˆæœ¬SDK + !class_exists($basicName, false) && class_alias($className, $basicName); + self::$cache[$index] = new $className(self::config($config)); + } + return self::$cache[$index]; + } + + /** + * 设置é…ç½®å‚æ•° + * @param array $config + * @return array + */ + static public function config($config = array()) + { + !empty($config) && self::$config = array_merge(self::$config, $config); + if (!empty(self::$config['cachepath'])) { + Cache::$cachepath = self::$config['cachepath']; + } + if (empty(self::$config['component_verify_ticket'])) { + self::$config['component_verify_ticket'] = Cache::get('component_verify_ticket'); + } + if (empty(self::$config['token']) && !empty(self::$config['component_token'])) { + self::$config['token'] = self::$config['component_token']; + } + if (empty(self::$config['appsecret']) && !empty(self::$config['component_appsecret'])) { + self::$config['appsecret'] = self::$config['component_appsecret']; + } + if (empty(self::$config['encodingaeskey']) && !empty(self::$config['component_encodingaeskey'])) { + self::$config['encodingaeskey'] = self::$config['component_encodingaeskey']; + } + return self::$config; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php new file mode 100644 index 00000000000..b6dd3855854 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php @@ -0,0 +1,819 @@ +access_token && !$this->getAccessToken()) { + return false; + } + $appid = empty($appid) ? $this->appid : $appid; + if ($jsapi_ticket) { + return $jsapi_ticket; + } + $authname = 'wechat_jsapi_ticket_wxcard_' . $appid; + if (($jsapi_ticket = Tools::getCache($authname))) { + return $jsapi_ticket; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::GET_TICKET_URL . "access_token={$this->access_token}&type=wx_card"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + $expire = $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600; + Tools::setCache($authname, $json['ticket'], $expire); + return $json['ticket']; + } + return false; + } + + /** + * 生æˆé€‰æ‹©å¡å·JSç­¾å包 + * @param string $cardid å¡åˆ¸Id + * @param string $cardtype å¡åˆ¸ç±»åž‹ + * @param string $shopid 门店Id + * @return array + */ + public function createChooseCardJsPackage($cardid = null, $cardtype = null, $shopid = null) + { + $data = array(); + $data['api_ticket'] = $this->getJsCardTicket(); + $data['app_id'] = $this->appid; + $data['timestamp'] = time(); + $data['nonceStr'] = Tools::createNoncestr(); + !empty($cardid) && $data['cardId'] = $cardid; + !empty($cardtype) && $data['cardType'] = $cardtype; + !empty($shopid) && $data['shopId'] = $shopid; + $data['cardSign'] = $this->getTicketSignature($data); + $data['signType'] = 'SHA1'; + unset($data['api_ticket'], $data['app_id']); + return $data; + } + + /** + * 生æˆæ·»åŠ å¡å·JSç­¾å包 + * @param string|null $cardid å¡å·ID + * @param array $data 其它é™å®šå‚æ•° + * @return array + */ + public function createAddCardJsPackage($cardid = null, $data = array()) + { + $cardList = array(); + if (is_array($cardid)) { + foreach ($cardid as $id) { + $cardList[] = array('cardId' => $id, 'cardExt' => json_encode($this->_cardSign($id, $data))); + } + } else { + $cardList[] = array('cardId' => $cardid, 'cardExt' => json_encode($this->_cardSign($cardid, $data))); + } + return array('cardList' => $cardList); + } + + /** + * å¡åˆ¸æ•°æ®ç­¾å + * @param null|string $cardid + * @param array $attr + * @return array + */ + private function _cardSign($cardid = null, $attr = array()) + { + unset($attr['outer_id']); + $attr['cardId'] = $cardid; + $attr['timestamp'] = time(); + $attr['api_ticket'] = $this->getJsCardTicket(); + $attr['nonce_str'] = Tools::createNoncestr(); + $attr['signature'] = $this->getTicketSignature($attr); + unset($attr['api_ticket']); + return $attr; + } + + /** + * 获å–微信å¡åˆ¸ç­¾å + * @param array $arrdata ç­¾å数组 + * @param string $method ç­¾å方法 + * @return bool|string ç­¾å值 + */ + public function getTicketSignature($arrdata, $method = "sha1") + { + if (!function_exists($method)) { + return false; + } + $newArray = array(); + foreach ($arrdata as $value) { + array_push($newArray, (string)$value); + } + sort($newArray, SORT_STRING); + return $method(implode($newArray)); + } + + /** + * 创建å¡åˆ¸ + * @param array $data å¡åˆ¸æ•°æ® + * @return bool|array 返回数组中card_id为å¡åˆ¸ID + */ + public function createCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更改å¡åˆ¸ä¿¡æ¯ + * 调用该接å£æ›´æ–°ä¿¡æ¯åŽä¼šé‡æ–°é€å®¡ï¼Œå¡åˆ¸çŠ¶æ€å˜æ›´ä¸ºå¾…审核。已被用户领å–çš„å¡åˆ¸ä¼šå®žæ—¶æ›´æ–°ç¥¨é¢ä¿¡æ¯ã€‚ + * @param string $data + * @return bool + */ + public function updateCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 删除å¡åˆ¸ + * å…许商户删除任æ„一类å¡åˆ¸ã€‚删除å¡åˆ¸åŽï¼Œè¯¥å¡åˆ¸å¯¹åº”已生æˆçš„领å–用二维ç ã€æ·»åŠ åˆ°å¡åŒ… JS API å‡ä¼šå¤±æ•ˆã€‚ + * 注æ„:删除å¡åˆ¸ä¸èƒ½åˆ é™¤å·²è¢«ç”¨æˆ·é¢†å–,ä¿å­˜åœ¨å¾®ä¿¡å®¢æˆ·ç«¯ä¸­çš„å¡åˆ¸ï¼Œå·²é¢†å–çš„å¡åˆ¸ä¾æ—§æœ‰æ•ˆã€‚ + * @param string $card_id å¡åˆ¸ID + * @return bool + */ + public function delCard($card_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 获å–粉ä¸ä¸‹æ‰€æœ‰å¡å·åˆ—表 + * @param $openid 粉ä¸openid + * @param string $card_id å¡å·ID(å¯ä¸ç»™ï¼‰ + * @return bool|array + */ + public function getCardList($openid, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_USER_GET_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–图文消æ¯ç¾¤å‘å¡åˆ¸HTML + * @param string $card_id å¡å·ID + * @return bool|array + */ + public function getCardMpHtml($card_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_SEND_HTML . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * å¡å·code核查 + * @param string $card_id å¡å·ID + * @param array $code_list å¡å·code列表(一维数组) + * @return bool|array + */ + public function checkCardCodeList($card_id, $code_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id, 'code' => $code_list); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CHECKCODE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询å¡åˆ¸è¯¦æƒ… + * @param string $card_id å¡å·ID + * @return bool|array + */ + public function getCardInfo($card_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_GET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–颜色列表 + * 获得å¡åˆ¸çš„最新颜色列表,用于创建å¡åˆ¸ + * @return bool|array + */ + public function getCardColors() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CARD_GETCOLORS . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 生æˆå¡åˆ¸äºŒç»´ç  + * æˆåŠŸåˆ™ç›´æŽ¥è¿”回ticket值,å¯ä»¥ç”¨ getQRUrl($ticket) æ¢å–二维ç url + * @param string $card_id å¡åˆ¸ID å¿…é¡» + * @param string $code 指定å¡åˆ¸ code ç ï¼Œåªèƒ½è¢«é¢†ä¸€æ¬¡ã€‚use_custom_code 字段为 true çš„å¡åˆ¸å¿…须填写,éžè‡ªå®šä¹‰ code ä¸å¿…填写。 + * @param string $openid 指定领å–者的 openid,åªæœ‰è¯¥ç”¨æˆ·èƒ½é¢†å–。bind_openid 字段为 true çš„å¡åˆ¸å¿…须填写,éžè‡ªå®šä¹‰ openid ä¸å¿…填写。 + * @param int $expire_seconds 指定二维ç çš„有效时间,范围是 60 ~ 1800 秒。ä¸å¡«é»˜è®¤ä¸ºæ°¸ä¹…有效。 + * @param bool $is_unique_code 指定下å‘二维ç ï¼Œç”Ÿæˆçš„二维ç éšæœºåˆ†é…一个 code,领å–åŽä¸å¯å†æ¬¡æ‰«æ。填写 true 或 false。默认 false。 + * @param string $balance 红包余é¢ï¼Œä»¥åˆ†ä¸ºå•ä½ã€‚红包类型必填(LUCKY_MONEY),其他å¡åˆ¸ç±»åž‹ä¸å¡«ã€‚ + * @return bool|string + */ + public function createCardQrcode($card_id, $code = '', $openid = '', $expire_seconds = 0, $is_unique_code = false, $balance = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $card = array('card_id' => $card_id); + !empty($code) && $card['code'] = $code; + !empty($openid) && $card['openid'] = $openid; + !empty($is_unique_code) && $card['is_unique_code'] = $is_unique_code; + !empty($balance) && $card['balance'] = $balance; + $data = array('action_name' => "QR_CARD"); + !empty($expire_seconds) && $data['expire_seconds'] = $expire_seconds; + $data['action_info'] = array('card' => $card); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_QRCODE_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 消耗 code + * 自定义 code(use_custom_code 为 true)的优惠券,在 code 被核销时,必须调用此接å£ã€‚ + * @param string $code è¦æ¶ˆè€—çš„åºåˆ—å· + * @param string $card_id è¦æ¶ˆè€—åºåˆ—å·æ‰€è¿°çš„ card_id,创建å¡åˆ¸æ—¶use_custom_code 填写 true 时必填。 + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "card":{"card_id":"pFS7Fjg8kV1IdDz01r4SQwMkuCKc"}, + * "openid":"oFS7Fjl0WsZ9AMZqrI80nbIq8xrA" + * } + */ + public function consumeCardCode($code, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_CONSUME . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * code è§£ç  + * @param string $encrypt_code 通过 choose_card_info 获å–的加密字符串 + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "code":"751234212312" + * } + */ + public function decryptCardCode($encrypt_code) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('encrypt_code' => $encrypt_code,); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_DECRYPT . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询 code 的有效性(éžè‡ªå®šä¹‰ code) + * @param string $code + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "openid":"oFS7Fjl0WsZ9AMZqrI80nbIq8xrA", //用户 openid + * "card":{ + * "card_id":"pFS7Fjg8kV1IdDz01r4SQwMkuCKc", + * "begin_time": 1404205036, //起始使用时间 + * "end_time": 1404205036, //结æŸæ—¶é—´ + * } + * } + */ + public function checkCardCode($code) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_GET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡æŸ¥è¯¢å¡åˆ—表 + * @param int $offset 开始拉å–çš„å移,默认为0从头开始 + * @param int $count 需è¦æŸ¥è¯¢çš„å¡ç‰‡çš„æ•°é‡ï¼ˆæ•°é‡æœ€å¤§50,默认50) + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "card_id_list":["ph_gmt7cUVrlRk8swPwx7aDyF-pg"], //å¡ id 列表 + * "total_num":1 //该商户å下 card_id 总数 + * } + */ + public function getCardIdList($offset = 0, $count = 50) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $count > 50 && $count = 50; + $data = array('offset' => $offset, 'count' => $count); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_BATCHGET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更改 code + * 为确ä¿è½¬èµ åŽçš„安全性,微信å…许自定义code的商户对已下å‘çš„code进行更改。 + * 注:为é¿å…用户疑惑,建议仅在å‘生转赠行为åŽï¼ˆå‘生转赠åŽï¼Œå¾®ä¿¡ä¼šé€šè¿‡äº‹ä»¶æŽ¨é€çš„æ–¹å¼å‘ŠçŸ¥å•†æˆ·è¢«è½¬èµ çš„å¡åˆ¸code)对用户的code进行更改。 + * @param string $code å¡åˆ¸çš„ code ç¼–ç  + * @param string $card_id å¡åˆ¸ ID + * @param string $new_code æ–°çš„å¡åˆ¸ code ç¼–ç  + * @return bool + */ + public function updateCardCode($code, $card_id, $new_code) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code, 'card_id' => $card_id, 'new_code' => $new_code); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 设置å¡åˆ¸å¤±æ•ˆ + * 设置å¡åˆ¸å¤±æ•ˆçš„æ“作ä¸å¯é€† + * @param string $code 需è¦è®¾ç½®ä¸ºå¤±æ•ˆçš„ code + * @param string $card_id 自定义 code çš„å¡åˆ¸å¿…填。éžè‡ªå®šä¹‰ code çš„å¡åˆ¸ä¸å¡«ã€‚ + * @return bool + */ + public function unavailableCardCode($code, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_UNAVAILABLE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 库存修改 + * @param string $data + * @return bool + */ + public function modifyCardStock($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MODIFY_STOCK . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 更新门票 + * @param string $data + * @return bool + */ + public function updateMeetingCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEETINGCARD_UPDATEUSER . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 激活/ç»‘å®šä¼šå‘˜å¡ + * @param string $data 具体结构请å‚看å¡åˆ¸å¼€å‘文档(6.1.1 激活/绑定会员å¡)章节 + * @return bool + */ + public function activateMemberCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_ACTIVATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 会员å¡äº¤æ˜“ + * 会员å¡äº¤æ˜“åŽæ¯æ¬¡ç§¯åˆ†åŠä½™é¢å˜æ›´éœ€é€šè¿‡æŽ¥å£é€šçŸ¥å¾®ä¿¡ï¼Œä¾¿äºŽåŽç»­æ¶ˆæ¯é€šçŸ¥åŠå…¶ä»–扩展功能。 + * @param string $data 具体结构请å‚看å¡åˆ¸å¼€å‘文档(6.1.2 会员å¡äº¤æ˜“)章节 + * @return bool|array + */ + public function updateMemberCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_UPDATEUSER . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 设置å¡åˆ¸æµ‹è¯•ç™½åå• + * @param array $openid 测试的 openid 列表 + * @param array $user 测试的微信å·åˆ—表 + * @return bool + */ + public function setCardTestWhiteList($openid = array(), $user = array()) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array(); + count($openid) > 0 && $data['openid'] = $openid; + count($user) > 0 && $data['username'] = $user; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_TESTWHILELIST_SET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * æ›´æ–°çº¢åŒ…é‡‘é¢ + * @param string $code 红包的åºåˆ—å· + * @param int $balance çº¢åŒ…ä½™é¢ + * @param string $card_id 自定义 code çš„å¡åˆ¸å¿…填。éžè‡ªå®šä¹‰ code å¯ä¸å¡«ã€‚ + * @return bool|array + */ + public function updateLuckyMoney($code, $balance, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code, 'balance' => $balance); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_LUCKYMONEY_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * è®¾ç½®è‡ªåŠ©æ ¸é”€æŽ¥å£ + * @param string $card_id å¡åˆ¸ID + * @param bool $is_openid 是å¦å¼€å¯è‡ªåŠ©æ ¸é”€åŠŸèƒ½ï¼Œå¡«true/false,默认为false + * @param bool $need_verify_cod 用户核销时是å¦éœ€è¦è¾“入验è¯ç ï¼Œå¡«true/false,默认为false + * @param bool $need_remark_amount 用户核销时是å¦éœ€è¦å¤‡æ³¨æ ¸é”€é‡‘é¢ï¼Œå¡«true/false,默认为false + * @return bool|array + */ + public function setSelfconsumecell($card_id, $is_openid = false, $need_verify_cod = false, $need_remark_amount = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array( + 'card_id' => $card_id, + 'is_open' => $is_openid, + 'need_verify_cod' => $need_verify_cod, + 'need_remark_amount' => $need_remark_amount, + ); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_SET_SELFCONSUMECELL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 设置买å•æŽ¥å£ + * @param string $card_id + * @param bool $is_openid + * @return bool|mixed + */ + public function setPaycell($card_id, $is_openid = true) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id, 'is_open' => $is_openid,); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_PAYCELL_SET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 设置开å¡å­—段信æ¯æŽ¥å£ + * @param array $data + * @return bool|array + */ + public function setMembercardActivateuserform($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_ACTIVATEUSERFORM_SET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php new file mode 100644 index 00000000000..76e6ded5b49 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php @@ -0,0 +1,385 @@ +access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_RECORD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–多客æœå®¢æœåŸºæœ¬ä¿¡æ¯ + * + * @return bool|array + */ + public function getCustomServiceKFlist() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_KFLIST . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–多客æœåœ¨çº¿å®¢æœæŽ¥å¾…ä¿¡æ¯ + * + * @return bool|array + */ + public function getCustomServiceOnlineKFlist() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_ONLINEKFLIST . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 创建指定多客æœä¼šè¯ + * @tutorial 当用户已被其他客æœæŽ¥å¾…或指定客æœä¸åœ¨çº¿åˆ™ä¼šå¤±è´¥ + * @param string $openid //用户openid + * @param string $kf_account //客æœè´¦å· + * @param string $text //附加信æ¯ï¼Œæ–‡æœ¬ä¼šå±•ç¤ºåœ¨å®¢æœäººå‘˜çš„多客æœå®¢æˆ·ç«¯ï¼Œå¯ä¸ºç©º + * @return bool|array + */ + public function createKFSession($openid, $kf_account, $text = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("openid" => $openid, "kf_account" => $kf_account); + $text !== '' && $data["text"] = $text; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 关闭指定多客æœä¼šè¯ + * @tutorial 当用户被其他客æœæŽ¥å¾…时则会失败 + * @param string $openid //用户openid + * @param string $kf_account //客æœè´¦å· + * @param string $text //附加信æ¯ï¼Œæ–‡æœ¬ä¼šå±•ç¤ºåœ¨å®¢æœäººå‘˜çš„多客æœå®¢æˆ·ç«¯ï¼Œå¯ä¸ºç©º + * @return bool | array //æˆåŠŸè¿”回json数组 + * { + * "errcode": 0, + * "errmsg": "ok", + * } + */ + public function closeKFSession($openid, $kf_account, $text = '') + { + $data = array("openid" => $openid, "kf_account" => $kf_account); + if ($text) { + $data["text"] = $text; + } + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_CLOSE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–用户会è¯çŠ¶æ€ + * @param string $openid //用户openid + * @return bool | array //æˆåŠŸè¿”回json数组 + * { + * "errcode" : 0, + * "errmsg" : "ok", + * "kf_account" : "test1@test", //æ­£åœ¨æŽ¥å¾…çš„å®¢æœ + * "createtime": 123456789, //会è¯æŽ¥å…¥æ—¶é—´ + * } + */ + public function getKFSession($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET . "access_token={$this->access_token}" . '&openid=' . $openid); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–èŠå¤©è®°å½• + * @param array $data æ•°æ®ç»“æž„ {"starttime" : 987654321,"endtime" : 987654321,"msgid" : 1,"number" : 10000} + * @return bool|array + */ + public function getCustomMsgList($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SERVICE_GET_MSG_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–指定客æœçš„会è¯åˆ—表 + * @param string $kf_account //用户openid + * @return bool | array //æˆåŠŸè¿”回json数组 + * array( + * 'sessionlist' => array ( + * array ( + * 'openid'=>'OPENID', //客户 openid + * 'createtime'=>123456789, //会è¯åˆ›å»ºæ—¶é—´ï¼ŒUNIX 时间戳 + * ), + * array ( + * 'openid'=>'OPENID', //客户 openid + * 'createtime'=>123456789, //会è¯åˆ›å»ºæ—¶é—´ï¼ŒUNIX 时间戳 + * ), + * ) + * ) + */ + public function getKFSessionlist($kf_account) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET_LIST . "access_token={$this->access_token}" . '&kf_account=' . $kf_account); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–未接入会è¯åˆ—表 + * @return bool|array + */ + public function getKFSessionWait() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET_WAIT . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 添加客æœè´¦å· + * + * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) + * @param string $nickname 客æœæ˜µç§°ï¼Œæœ€é•¿6个汉字或12个英文字符 + * @param string $password 客æœè´¦å·æ˜Žæ–‡ç™»å½•å¯†ç ï¼Œä¼šè‡ªåŠ¨åŠ å¯† + * @return bool|array + */ + public function addKFAccount($account, $nickname, $password) + { + $data = array("kf_account" => $account, "nickname" => $nickname, "password" => md5($password)); + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 修改客æœè´¦å·ä¿¡æ¯ + * + * @param string $account //完整客æœè´¦å·ï¼Œæ ¼å¼ä¸ºï¼šè´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符,必须是英文或者数字字符 + * @param string $nickname //客æœæ˜µç§°ï¼Œæœ€é•¿6个汉字或12个英文字符 + * @param string $password //客æœè´¦å·æ˜Žæ–‡ç™»å½•å¯†ç ï¼Œä¼šè‡ªåŠ¨åŠ å¯† + * @return bool|array + * æˆåŠŸè¿”回结果 + * { + * "errcode": 0, + * "errmsg": "ok", + * } + */ + public function updateKFAccount($account, $nickname, $password) + { + $data = array("kf_account" => $account, "nickname" => $nickname, "password" => md5($password)); + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除客æœè´¦å· + * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) + * @return bool|array + */ + public function deleteKFAccount($account) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_DEL_URL . "access_token={$this->access_token}" . '&kf_account=' . $account); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传客æœå¤´åƒ + * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) + * @param string $imgfile 头åƒæ–‡ä»¶å®Œæ•´è·¯å¾„,如:'D:\user.jpg'。头åƒæ–‡ä»¶å¿…é¡»JPGæ ¼å¼ï¼Œåƒç´ å»ºè®®640*640 + * @return bool|array + */ + public function setKFHeadImg($account, $imgfile) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_UPLOAD_HEADIMG_URL . "access_token={$this->access_token}&kf_account={$account}", array('media' => '@' . $imgfile)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php new file mode 100644 index 00000000000..932321ac2b6 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php @@ -0,0 +1,467 @@ + + * @date 2016-08-22 10:35 + */ +class WechatDevice extends Common +{ + + const SHAKEAROUND_DEVICE_APPLYID = '/shakearound/device/applyid?'; //申请设备ID + const SHAKEAROUND_DEVICE_APPLYSTATUS = '/shakearound/device/applystatus?'; //查询设备IDç”³è¯·å®¡æ ¸çŠ¶æ€ + const SHAKEAROUND_DEVICE_UPDATE = '/shakearound/device/update?'; //ç¼–è¾‘è®¾å¤‡ä¿¡æ¯ + const SHAKEAROUND_DEVICE_SEARCH = '/shakearound/device/search?'; //查询设备列表 + const SHAKEAROUND_DEVICE_BINDLOCATION = '/shakearound/device/bindlocation?'; //é…置设备与门店ID的关系 + const SHAKEAROUND_DEVICE_BINDPAGE = '/shakearound/device/bindpage?'; //é…置设备与页é¢çš„绑定关系 + const SHAKEAROUND_MATERIAL_ADD = '/shakearound/material/add?'; //上传摇一摇图片素æ + const SHAKEAROUND_PAGE_ADD = '/shakearound/page/add?'; //å¢žåŠ é¡µé¢ + const SHAKEAROUND_PAGE_UPDATE = '/shakearound/page/update?'; //ç¼–è¾‘é¡µé¢ + const SHAKEAROUND_PAGE_SEARCH = '/shakearound/page/search?'; //查询页é¢åˆ—表 + const SHAKEAROUND_PAGE_DELETE = '/shakearound/page/delete?'; //åˆ é™¤é¡µé¢ + const SHAKEAROUND_USER_GETSHAKEINFO = '/shakearound/user/getshakeinfo?'; //获å–摇周边的设备åŠç”¨æˆ·ä¿¡æ¯ + const SHAKEAROUND_STATISTICS_DEVICE = '/shakearound/statistics/device?'; //以设备为维度的数æ®ç»Ÿè®¡æŽ¥å£ + const SHAKEAROUND_STATISTICS_PAGE = '/shakearound/statistics/page?'; //以页é¢ä¸ºç»´åº¦çš„æ•°æ®ç»Ÿè®¡æŽ¥å£ + + + /** + * 申请设备ID + * @param array $data + * @return bool|array + */ + public function applyShakeAroundDevice($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_APPLYID . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询设备IDç”³è¯·å®¡æ ¸çŠ¶æ€ + * @param int $apply_id + * @return bool|array + */ + public function applyStatusShakeAroundDevice($apply_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("apply_id" => $apply_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_APPLYSTATUS . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * ç¼–è¾‘è®¾å¤‡ä¿¡æ¯ + * @param array $data + * @return bool + */ + public function updateShakeAroundDevice($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + + /** + * 查询设备列表 + * @param $data + * @return bool|array + */ + public function searchShakeAroundDevice($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_SEARCH . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * é…置设备与门店的关è”关系 + * @param string $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,则å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼Œè‹¥äºŒè€…都填,则以设备编å·ä¸ºä¼˜å…ˆ + * @param int $poi_id å¾…å…³è”的门店ID + * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæ•´ï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–å·ï¼Œåˆ™å¯ä¸å¡«æ­¤ä¿¡æ¯ + * @param int $major + * @param int $minor + * @return bool|array + */ + public function bindLocationShakeAroundDevice($device_id, $poi_id, $uuid = '', $major = 0, $minor = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!$device_id) { + if (!$uuid || !$major || !$minor) { + return false; + } + $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); + } else { + $device_identifier = array('device_id' => $device_id); + } + $data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * é…置设备与其他公众账å·é—¨åº—çš„å…³è”关系 + * @param type $device_identifier è®¾å¤‡ä¿¡æ¯ + * @param type $poi_id å¾…å…³è”的门店ID + * @param type $poi_appid 目标微信appid + * @return boolean + */ + public function bindLocationOtherShakeAroundDevice($device_identifier, $poi_id, $poi_appid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id, "type" => 2, "poi_appid" => $poi_appid); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * é…置设备与页é¢çš„å…³è”关系 + * @param string $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,则å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼Œè‹¥äºŒè€…都填,则以设备编å·ä¸ºä¼˜å…ˆ + * @param array $page_ids å¾…å…³è”的页é¢åˆ—表 + * @param int $bind å…³è”æ“作标志ä½ï¼Œ 0 为解除关è”关系,1 为建立关è”关系 + * @param int $append 新增æ“作标志ä½ï¼Œ 0 为覆盖,1 为新增 + * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæ•´ï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–å·ï¼Œåˆ™å¯ä¸å¡«æ­¤ä¿¡æ¯ + * @param int $major + * @param int $minor + * @return bool|array + */ + public function bindPageShakeAroundDevice($device_id, $page_ids = array(), $bind = 1, $append = 1, $uuid = '', $major = 0, $minor = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!$device_id) { + if (!$uuid || !$major || !$minor) { + return false; + } + $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); + } else { + $device_identifier = array('device_id' => $device_id); + } + $data = array('device_identifier' => $device_identifier, 'page_ids' => $page_ids, 'bind' => $bind, 'append' => $append); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDPAGE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 上传在摇一摇页é¢å±•ç¤ºçš„图片素æ + * @param array $data {"media":'@Path\filename.jpg'} + * @return bool|array + */ + public function uploadShakeAroundMedia($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_MATERIAL_ADD . "access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 增加摇一摇出æ¥çš„页é¢ä¿¡æ¯ + * @param string $title 在摇一摇页é¢å±•ç¤ºçš„主标题,ä¸è¶…过6 个字 + * @param string $description 在摇一摇页é¢å±•ç¤ºçš„副标题,ä¸è¶…过7 个字 + * @param string $icon_url 在摇一摇页é¢å±•ç¤ºçš„图片, æ ¼å¼é™å®šä¸ºï¼šjpg,jpeg,png,gif; 建议120*120 , é™åˆ¶ä¸è¶…过200*200 + * @param string $page_url 跳转链接 + * @param string $comment 页é¢çš„备注信æ¯ï¼Œä¸è¶…过15 个字,å¯ä¸å¡« + * @return bool|array + */ + public function addShakeAroundPage($title, $description, $icon_url, $page_url, $comment = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("title" => $title, "description" => $description, "icon_url" => $icon_url, "page_url" => $page_url, "comment" => $comment); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_ADD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 编辑摇一摇出æ¥çš„页é¢ä¿¡æ¯ + * @param int $page_id + * @param string $title 在摇一摇页é¢å±•ç¤ºçš„主标题,ä¸è¶…过6 个字 + * @param string $description 在摇一摇页é¢å±•ç¤ºçš„副标题,ä¸è¶…过7 个字 + * @param string $icon_url 在摇一摇页é¢å±•ç¤ºçš„图片, æ ¼å¼é™å®šä¸ºï¼šjpg,jpeg,png,gif; 建议120*120 , é™åˆ¶ä¸è¶…过200*200 + * @param string $page_url 跳转链接 + * @param string $comment 页é¢çš„备注信æ¯ï¼Œä¸è¶…过15 个字,å¯ä¸å¡« + * @return bool|array + */ + public function updateShakeAroundPage($page_id, $title, $description, $icon_url, $page_url, $comment = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("page_id" => $page_id, "title" => $title, "description" => $description, "icon_url" => $icon_url, "page_url" => $page_url, "comment" => $comment); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * æŸ¥è¯¢å·²æœ‰çš„é¡µé¢ + * @param array $page_ids + * @param int $begin + * @param int $count + * @return bool|mixed + */ + public function searchShakeAroundPage($page_ids = array(), $begin = 0, $count = 1) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!empty($page_ids)) { + $data = array('page_ids' => $page_ids); + } else { + $data = array('begin' => $begin, 'count' => $count); + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_SEARCH . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * åˆ é™¤å·²æœ‰çš„é¡µé¢ + * @param array $page_ids + * @return bool|array + */ + public function deleteShakeAroundPage($page_ids = array()) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('page_ids' => $page_ids); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 获å–è®¾å¤‡ä¿¡æ¯ + * @param string $ticket 摇周边业务的ticket(å¯åœ¨æ‘‡åˆ°çš„URL中得到,ticket生效时间为30 分钟) + * @return bool|array + */ + public function getShakeInfoShakeAroundUser($ticket) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('ticket' => $ticket); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_USER_GETSHAKEINFO . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 以设备为维度的数æ®ç»Ÿè®¡æŽ¥å£ + * @param int $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,å³å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼ŒäºŒè€…选其一 + * @param int $begin_date 起始日期时间戳,最长时间跨度为30 天 + * @param int $end_date 结æŸæ—¥æœŸæ—¶é—´æˆ³ï¼Œæœ€é•¿æ—¶é—´è·¨åº¦ä¸º30 天 + * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæˆï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–辑,å³å¯ä¸å¡«æ­¤ä¿¡æ¯ï¼ŒäºŒè€…选其一 + * @param int $major + * @param int $minor + * @return bool|array + */ + public function deviceShakeAroundStatistics($device_id, $begin_date, $end_date, $uuid = '', $major = 0, $minor = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!$device_id) { + if (!$uuid || !$major || !$minor) { + return false; + } + $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); + } else { + $device_identifier = array('device_id' => $device_id); + } + $data = array('device_identifier' => $device_identifier, 'begin_date' => $begin_date, 'end_date' => $end_date); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_STATISTICS_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 以页é¢ä¸ºç»´åº¦çš„æ•°æ®ç»Ÿè®¡æŽ¥å£ + * @param int $page_id 指定页é¢çš„ID + * @param int $begin_date 起始日期时间戳,最长时间跨度为30 天 + * @param int $end_date 结æŸæ—¥æœŸæ—¶é—´æˆ³ï¼Œæœ€é•¿æ—¶é—´è·¨åº¦ä¸º30 天 + * @return bool|array + */ + public function pageShakeAroundStatistics($page_id, $begin_date, $end_date) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('page_id' => $page_id, 'begin_date' => $begin_date, 'end_date' => $end_date); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_STATISTICS_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php new file mode 100644 index 00000000000..f03c15b79e0 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php @@ -0,0 +1,209 @@ + + * @date 2016-08-22 10:32 + */ +class WechatExtends extends Common +{ + + const QR_LIMIT_SCENE = 1; + + /** 语义ç†è§£ */ + const SEMANTIC_API_URL = '/semantic/semproxy/search?'; + const QRCODE_IMG_URL = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='; + const QRCODE_CREATE_URL = '/qrcode/create?'; + const SHORT_URL = '/shorturl?'; + const QR_SCENE = 0; + + /** æ•°æ®åˆ†æžæŽ¥å£ */ + static $DATACUBE_URL_ARR = array(//ç”¨æˆ·åˆ†æž + 'user' => array( + 'summary' => '/datacube/getusersummary?', //获å–用户增å‡æ•°æ®ï¼ˆgetusersummary) + 'cumulate' => '/datacube/getusercumulate?', //获å–累计用户数æ®ï¼ˆgetusercumulate) + ), + 'article' => array(//å›¾æ–‡åˆ†æž + 'summary' => '/datacube/getarticlesummary?', //获å–图文群å‘æ¯æ—¥æ•°æ®ï¼ˆgetarticlesummary) + 'total' => '/datacube/getarticletotal?', //获å–图文群å‘总数æ®ï¼ˆgetarticletotal) + 'read' => '/datacube/getuserread?', //获å–图文统计数æ®ï¼ˆgetuserread) + 'readhour' => '/datacube/getuserreadhour?', //获å–图文统计分时数æ®ï¼ˆgetuserreadhour) + 'share' => '/datacube/getusershare?', //获å–图文分享转å‘æ•°æ®ï¼ˆgetusershare) + 'sharehour' => '/datacube/getusersharehour?', //获å–图文分享转å‘分时数æ®ï¼ˆgetusersharehour) + ), + 'upstreammsg' => array(//消æ¯åˆ†æž + 'summary' => '/datacube/getupstreammsg?', //获å–消æ¯å‘é€æ¦‚况数æ®ï¼ˆgetupstreammsg) + 'hour' => '/datacube/getupstreammsghour?', //获å–消æ¯åˆ†é€åˆ†æ—¶æ•°æ®ï¼ˆgetupstreammsghour) + 'week' => '/datacube/getupstreammsgweek?', //获å–消æ¯å‘é€å‘¨æ•°æ®ï¼ˆgetupstreammsgweek) + 'month' => '/datacube/getupstreammsgmonth?', //获å–消æ¯å‘é€æœˆæ•°æ®ï¼ˆgetupstreammsgmonth) + 'dist' => '/datacube/getupstreammsgdist?', //获å–消æ¯å‘é€åˆ†å¸ƒæ•°æ®ï¼ˆgetupstreammsgdist) + 'distweek' => '/datacube/getupstreammsgdistweek?', //获å–消æ¯å‘é€åˆ†å¸ƒå‘¨æ•°æ®ï¼ˆgetupstreammsgdistweek) + 'distmonth' => '/datacube/getupstreammsgdistmonth?', //获å–消æ¯å‘é€åˆ†å¸ƒæœˆæ•°æ®ï¼ˆgetupstreammsgdistmonth) + ), + 'interface' => array(//接å£åˆ†æž + 'summary' => '/datacube/getinterfacesummary?', //获å–接å£åˆ†æžæ•°æ®ï¼ˆgetinterfacesummary) + 'summaryhour' => '/datacube/getinterfacesummaryhour?', //获å–接å£åˆ†æžåˆ†æ—¶æ•°æ®ï¼ˆgetinterfacesummaryhour) + ) + ); + + /** + * 获å–二维ç å›¾ç‰‡ + * @param string $ticket 传入由getQRCode方法生æˆçš„ticketå‚æ•° + * @return string url 返回httpåœ°å€ + */ + public function getQRUrl($ticket) + { + return self::QRCODE_IMG_URL . urlencode($ticket); + } + + /** + * é•¿é“¾æŽ¥è½¬çŸ­é“¾æŽ¥æŽ¥å£ + * @param string $long_url ä¼ å…¥è¦è½¬æ¢çš„é•¿url + * @return bool|string url æˆåŠŸåˆ™è¿”回转æ¢åŽçš„短url + */ + public function getShortUrl($long_url) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('action' => 'long2short', 'long_url' => $long_url); + $result = Tools::httpPost(self::API_URL_PREFIX . self::SHORT_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['short_url']; + } + return false; + } + + /** + * 创建二维ç ticket + * @param int|string $scene_id 自定义追踪id,临时二维ç åªèƒ½ç”¨æ•°å€¼åž‹ + * @param int $type 0:临时二维ç ï¼›1:永久二维ç (此时expireå‚数无效)ï¼›2:永久二维ç (此时expireå‚数无效) + * @param int $expire 临时二维ç æœ‰æ•ˆæœŸï¼Œæœ€å¤§ä¸º2592000秒(30天) + * @return bool|array ('ticket'=>'qrcode字串','expire_seconds'=>2592000,'url'=>'二维ç å›¾ç‰‡è§£æžåŽçš„地å€') + */ + public function getQRCode($scene_id, $type = 0, $expire = 2592000) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $type = ($type && is_string($scene_id)) ? 2 : $type; + $data = array( + 'action_name' => $type ? ($type == 2 ? "QR_LIMIT_STR_SCENE" : "QR_LIMIT_SCENE") : "QR_SCENE", + 'expire_seconds' => $expire, + 'action_info' => array('scene' => ($type == 2 ? array('scene_str' => $scene_id) : array('scene_id' => $scene_id))) + ); + if ($type == 1) { + unset($data['expire_seconds']); + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::QRCODE_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 语义ç†è§£æŽ¥å£ + * @param string $uid 用户唯一id(éžå¼€å‘者id),用户区分公众å·ä¸‹çš„ä¸åŒç”¨æˆ·ï¼ˆå»ºè®®å¡«å…¥ç”¨æˆ·openid) + * @param string $query 输入文本串 + * @param string $category 需è¦ä½¿ç”¨çš„æœåŠ¡ç±»åž‹ï¼Œå¤šä¸ªç”¨â€œï¼Œâ€éš”开,ä¸èƒ½ä¸ºç©º + * @param float $latitude 纬度å标,与ç»åº¦åŒæ—¶ä¼ å…¥ï¼›ä¸ŽåŸŽå¸‚二选一传入 + * @param float $longitude ç»åº¦å标,与纬度åŒæ—¶ä¼ å…¥ï¼›ä¸ŽåŸŽå¸‚二选一传入 + * @param string $city 城市å称,与ç»çº¬åº¦äºŒé€‰ä¸€ä¼ å…¥ + * @param string $region 区域å称,在城市存在的情况下å¯çœç•¥ï¼›ä¸Žç»çº¬åº¦äºŒé€‰ä¸€ä¼ å…¥ + * @return bool|array + */ + public function querySemantic($uid, $query, $category, $latitude = 0.00, $longitude = 0.00, $city = "", $region = "") + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array( + 'query' => $query, + 'category' => $category, + 'appid' => $this->appid, + 'uid' => '' + ); + //地ç†å标或城市å称二选一 + if ($latitude) { + $data['latitude'] = $latitude; + $data['longitude'] = $longitude; + } elseif ($city) { + $data['city'] = $city; + } elseif ($region) { + $data['region'] = $region; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SEMANTIC_API_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–ç»Ÿè®¡æ•°æ® + * @param string $type æ•°æ®åˆ†ç±»(user|article|upstreammsg|interface)分别为(用户分æž|图文分æž|消æ¯åˆ†æž|接å£åˆ†æž) + * @param string $subtype æ•°æ®å­åˆ†ç±»ï¼Œå‚考 DATACUBE_URL_ARR 常é‡å®šä¹‰éƒ¨åˆ† 或者README.md说明文档 + * @param string $begin_date 开始时间 + * @param string $end_date 结æŸæ—¶é—´ + * @return bool|array æˆåŠŸè¿”回查询结果数组,其定义请看官方文档 + */ + public function getDatacube($type, $subtype, $begin_date, $end_date = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!isset(self::$DATACUBE_URL_ARR[$type]) || !isset(self::$DATACUBE_URL_ARR[$type][$subtype])) { + return false; + } + $data = array('begin_date' => $begin_date, 'end_date' => $end_date ? $end_date : $begin_date); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::$DATACUBE_URL_ARR[$type][$subtype] . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return isset($json['list']) ? $json['list'] : $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php new file mode 100644 index 00000000000..c01114b9186 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php @@ -0,0 +1,160 @@ +access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_COMPEL_UNBINDHTTPS . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + public function transmsg($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_TRANSMSG . "access_token={$this->access_token}", Tools::json_encode($data)); + //dump($result); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + public function getQrcode($product_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::DEVICE_GETQRCODE . "access_token={$this->access_token}&product_id=$product_id"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * è®¾å¤‡æŽˆæƒ + * @param $data + * @return bool|mixed + */ + public function deviceAuthorize($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_AUTHORIZE_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–è®¾å¤‡äºŒç»´ç  + * @param $data + * @return bool|mixed + */ + public function getDeviceQrcode($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_CREATE_QRCODE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–è®¾å¤‡çŠ¶æ€ + * @param $device_id + * @return bool|mixed + */ + public function getDeviceStat($device_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::DEVICE_GET_STAT . "access_token={$this->access_token}&device_id=$device_id"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php new file mode 100644 index 00000000000..320817973d7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php @@ -0,0 +1,430 @@ + + * @date 2016/10/26 14:47 + */ +class WechatMedia extends Common +{ + + const MEDIA_UPLOAD_URL = '/media/upload?'; + const MEDIA_UPLOADIMG_URL = '/media/uploadimg?'; + const MEDIA_GET_URL = '/media/get?'; + const MEDIA_VIDEO_UPLOAD = '/media/uploadvideo?'; + const MEDIA_FOREVER_UPLOAD_URL = '/material/add_material?'; + const MEDIA_FOREVER_NEWS_UPLOAD_URL = '/material/add_news?'; + const MEDIA_FOREVER_NEWS_UPDATE_URL = '/material/update_news?'; + const MEDIA_FOREVER_GET_URL = '/material/get_material?'; + const MEDIA_FOREVER_DEL_URL = '/material/del_material?'; + const MEDIA_FOREVER_COUNT_URL = '/material/get_materialcount?'; + const MEDIA_FOREVER_BATCHGET_URL = '/material/batchget_material?'; + const MEDIA_UPLOADNEWS_URL = '/media/uploadnews?'; + + /** + * 上传临时素æ,有效期为3天(认è¯åŽçš„订阅å·å¯ç”¨) + * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 + * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ + * 注æ„:临时素æçš„media_id是å¯å¤ç”¨çš„ï¼ + * @param array $data {"media":'@Path\filename.jpg'} + * @param string $type 类型:图片:image 语音:voice 视频:video 缩略图:thumb + * @return bool|array + */ + public function uploadMedia($data, $type) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); + $data['media'] = "@{$cache_file}"; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); + !empty($cache_file) && @unlink($cache_file); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–临时素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * @param string $media_id 媒体文件id + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @return bool|array + */ + public function getMedia($media_id, $is_video = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MEDIA_GET_URL . "access_token={$this->access_token}" . '&media_id=' . $media_id); + if ($result) { + if (is_string($result)) { + $json = json_decode($result, true); + if (isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + } + return $result; + } + return false; + } + + /** + * 获å–临时素æ(认è¯åŽçš„订阅å·å¯ç”¨) 包å«è¿”回的httpå¤´ä¿¡æ¯ + * @param string $media_id 媒体文件id + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @return bool|array + */ + public function getMediaWithHttpInfo($media_id, $is_video = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $url_prefix = $is_video ? str_replace('https', 'http', self::API_URL_PREFIX) : self::API_URL_PREFIX; + $url = $url_prefix . self::MEDIA_GET_URL . "access_token={$this->access_token}" . '&media_id=' . $media_id; + $oCurl = curl_init(); + if (stripos($url, "https://") !== false) { + curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); + } + curl_setopt($oCurl, CURLOPT_URL, $url); + curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); + $sContent = curl_exec($oCurl); + $aStatus = curl_getinfo($oCurl); + $result = array(); + if (intval($aStatus["http_code"]) !== 200) { + return false; + } + if ($sContent) { + if (is_string($sContent)) { + $json = json_decode($sContent, true); + if (isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + } + $result['content'] = $sContent; + $result['info'] = $aStatus; + return $result; + } + return false; + } + + /** + * 上传图片,本接å£æ‰€ä¸Šä¼ çš„图片ä¸å ç”¨å…¬ä¼—å·çš„ç´ æ库中图片数é‡çš„5000个的é™åˆ¶ã€‚图片仅支æŒjpg/pngæ ¼å¼ï¼Œå¤§å°å¿…须在1MB以下。 (认è¯åŽçš„订阅å·å¯ç”¨) + * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 + * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ + * @param array $data {"media":'@Path\filename.jpg'} + * @return bool|array + */ + public function uploadImg($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); + $data['media'] = "@{$cache_file}"; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOADIMG_URL . "access_token={$this->access_token}", $data); + !empty($cache_file) && @unlink($cache_file); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 新增的永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 + * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 + * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ + * @param array $data {"media":'@Path\filename.jpg'}, 支æŒbase64æ ¼å¼ + * @param string $type 类型:图片:image 语音:voice 视频:video 缩略图:thumb + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @param array $video_info 视频信æ¯æ•°ç»„,éžè§†é¢‘ç´ æä¸éœ€è¦æä¾› array('title'=>'视频标题','introduction'=>'æè¿°') + * @return bool|array + */ + public function uploadForeverMedia($data, $type, $is_video = false, $video_info = array()) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $is_video && ($data['description'] = Tools::json_encode($video_info)); + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); + $data['media'] = "@{$cache_file}"; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); + !empty($cache_file) && @unlink($cache_file); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传永久图文素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 新增的永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 + * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} + * @return bool|array + */ + public function uploadForeverArticles($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_NEWS_UPLOAD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 修改永久图文素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 + * @param string $media_id 图文素æid + * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} + * @param int $index 更新的文章在图文素æçš„ä½ç½®ï¼Œç¬¬ä¸€ç¯‡ä¸º0,仅多图文使用 + * @return bool|array + */ + public function updateForeverArticles($media_id, $data, $index = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + !isset($data['index']) && $data['index'] = $index; + !isset($data['media_id']) && $data['media_id'] = $media_id; + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_NEWS_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 返回图文消æ¯æ•°ç»„或二进制数æ®ï¼Œå¤±è´¥è¿”回false + * @param string $media_id 媒体文件id + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @return bool|array + */ + public function getForeverMedia($media_id, $is_video = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('media_id' => $media_id); + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_GET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + if (is_string($result) && ($json = json_decode($result, true))) { + if (isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return $result; + } + return false; + } + + /** + * 删除永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * @param string $media_id 媒体文件id + * @return bool + */ + public function delForeverMedia($media_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('media_id' => $media_id); + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 获å–永久素æ列表(认è¯åŽçš„订阅å·å¯ç”¨) + * @param string $type ç´ æ的类型,图片(image)ã€è§†é¢‘(video)ã€è¯­éŸ³ (voice)ã€å›¾æ–‡ï¼ˆnews) + * @param int $offset 全部素æçš„å移ä½ç½®ï¼Œ0表示从第一个素æ + * @param int $count 返回素æçš„æ•°é‡ï¼Œå–值在1到20之间 + * @return bool|array + * 返回数组格å¼: + * array( + * 'total_count'=>0, //该类型的素æ的总数 + * 'item_count'=>0, //本次调用获å–çš„ç´ æçš„æ•°é‡ + * 'item'=>array() //ç´ æ列表数组,内容定义请å‚考官方文档 + * ) + */ + public function getForeverList($type, $offset, $count) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('type' => $type, 'offset' => $offset, 'count' => $count); + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_BATCHGET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–永久素æ总数(认è¯åŽçš„订阅å·å¯ç”¨) + * @return bool|array + * 返回数组格å¼: + * array( + * 'voice_count'=>0, //è¯­éŸ³æ€»æ•°é‡ + * 'video_count'=>0, //è§†é¢‘æ€»æ•°é‡ + * 'image_count'=>0, //å›¾ç‰‡æ€»æ•°é‡ + * 'news_count'=>0 //å›¾æ–‡æ€»æ•°é‡ + * ) + */ + public function getForeverCount() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MEDIA_FOREVER_COUNT_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传图文消æ¯ç´ æ,用于群å‘(认è¯åŽçš„订阅å·å¯ç”¨) + * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} + * @return bool|array + */ + public function uploadArticles($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOADNEWS_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传视频素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * @param array $data 消æ¯ç»“æž„ + * { + * "media_id"=>"", //通过上传媒体接å£å¾—到的MediaId + * "title"=>"TITLE", //视频标题 + * "description"=>"Description" //视频æè¿° + * } + * @return bool|array + * { + * "type":"video", + * "media_id":"mediaid", + * "created_at":1398848981 + * } + */ + public function uploadMpVideo($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_VIDEO_UPLOAD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php new file mode 100644 index 00000000000..0e7ab9b185d --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php @@ -0,0 +1,183 @@ + + * @date 2016/06/28 11:52 + */ +class WechatMenu extends Common +{ + + /** 创建自定义èœå• */ + const MENU_ADD_URL = '/menu/create?'; + /* 获å–自定义èœå• */ + const MENU_GET_URL = '/menu/get?'; + /* 删除自定义èœå• */ + const MENU_DEL_URL = '/menu/delete?'; + + /** 添加个性èœå• */ + const COND_MENU_ADD_URL = '/menu/addconditional?'; + /* 删除个性èœå• */ + const COND_MENU_DEL_URL = '/menu/delconditional?'; + /* 测试个性èœå• */ + const COND_MENU_TRY_URL = '/menu/trymatch?'; + + /** + * 创建自定义èœå• + * @param array $data èœå•æ•°ç»„æ•°æ® + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN 文档 + * @return bool + */ + public function createMenu($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MENU_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 获å–所有èœå• + * @return bool|array + */ + public function getMenu() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MENU_GET_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除所有èœå• + * @return bool + */ + public function deleteMenu() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MENU_DEL_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 创建个性èœå• + * @param array $data èœå•æ•°ç»„æ•°æ® + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN 文档 + * @return bool|string + */ + public function createCondMenu($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['menuid']; + } + return false; + } + + /** + * 删除个性èœå• + * @param string $menuid èœå•ID + * @return bool + */ + public function deleteCondMenu($menuid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('menuid' => $menuid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 测试并返回个性化èœå• + * @param string $openid 粉ä¸openid + * @return bool + */ + public function tryCondMenu($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('user_id' => $openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_TRY_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php new file mode 100644 index 00000000000..3b716856442 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php @@ -0,0 +1,352 @@ + + * @date 2016/06/28 11:29 + */ +class WechatMessage extends Common +{ + + /** + * 获å–模æ¿åˆ—表 + * @return bool|array + */ + public function getAllPrivateTemplate() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/get_all_private_template?access_token={$this->access_token}", []); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–è®¾ç½®çš„è¡Œä¸šä¿¡æ¯ + * @return bool|array + */ + public function getTMIndustry() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/get_industry?access_token={$this->access_token}", []); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除模æ¿æ¶ˆæ¯ + * @param string $tpl_id + * @return bool + */ + public function delPrivateTemplate($tpl_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('template_id' => $tpl_id); + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/del_private_template?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 模æ¿æ¶ˆæ¯ 设置所属行业 + * @param string $id1 公众å·æ¨¡æ¿æ¶ˆæ¯æ‰€å±žè¡Œä¸šç¼–å·ï¼Œå‚看官方开å‘文档 è¡Œä¸šä»£ç  + * @param string $id2 åŒ$id1。但如果åªæœ‰ä¸€ä¸ªè¡Œä¸šï¼Œæ­¤å‚æ•°å¯çœç•¥ + * @return bool|mixed + */ + public function setTMIndustry($id1, $id2 = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array(); + !empty($id1) && $data['industry_id1'] = $id1; + !empty($id2) && $data['industry_id2'] = $id2; + $json = Tools::json_encode($data); + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/api_set_industry?access_token={$this->access_token}", $json); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 模æ¿æ¶ˆæ¯ 添加消æ¯æ¨¡æ¿ + * æˆåŠŸè¿”回消æ¯æ¨¡æ¿çš„调用id + * @param string $tpl_id 模æ¿åº“中模æ¿çš„ç¼–å·ï¼Œæœ‰â€œTM**â€å’Œâ€œOPENTMTM**â€ç­‰å½¢å¼ + * @return bool|string + */ + public function addTemplateMessage($tpl_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = Tools::json_encode(array('template_id_short' => $tpl_id)); + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/api_add_template?access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['template_id']; + } + return false; + } + + /** + * å‘é€æ¨¡æ¿æ¶ˆæ¯ + * @param array $data 消æ¯ç»“æž„ + * { + * "touser":"OPENID", + * "template_id":"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY", + * "url":"http://weixin.qq.com/download", + * "topcolor":"#FF0000", + * "data":{ + * "å‚æ•°å1": { + * "value":"å‚æ•°", + * "color":"#173177" //å‚数颜色 + * }, + * "Date":{ + * "value":"06月07æ—¥ 19æ—¶24分", + * "color":"#173177" + * }, + * "CardNumber":{ + * "value":"0426", + * "color":"#173177" + * }, + * "Type":{ + * "value":"消费", + * "color":"#173177" + * } + * } + * } + * @return bool|array + */ + public function sendTemplateMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/template/send?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * æ ¹æ®æ ‡ç­¾è¿›è¡Œç¾¤å‘ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param array $data 消æ¯ç»“æž„ + * 注æ„: 视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ + * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 + * @return bool|array + * { + * "touser"=>array( + * "OPENID1", + * "OPENID2" + * ), + * "msgtype"=>"mpvideo", + * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 + * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") + * // text => array ( "content" => "hello") + * } + */ + public function sendMassMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/send?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * æ ¹æ®æ ‡ç­¾è¿›è¡Œç¾¤å‘ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param array $data 消æ¯ç»“æž„ + * 注æ„:视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ + * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 + * @return bool|array + * { + * "filter"=>array( + * "is_to_all"=>False, //是å¦ç¾¤å‘给所有用户.Trueä¸ç”¨åˆ†ç»„id,False需填写分组id + * "group_id"=>"2" //群å‘的分组id + * ), + * "msgtype"=>"mpvideo", + * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 + * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") + * // text => array ( "content" => "hello") + * } + */ + public function sendGroupMassMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/sendall?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除群å‘å›¾æ–‡æ¶ˆæ¯ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param string $msg_id 消æ¯ID + * @return bool + */ + public function deleteMassMessage($msg_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = Tools::json_encode(array('msg_id' => $msg_id)); + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/delete?access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 预览群å‘æ¶ˆæ¯ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param array $data + * 注æ„: 视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ + * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 + * @消æ¯ç»“æž„ + * { + * "touser"=>"OPENID", + * "msgtype"=>"mpvideo", + * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 + * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") + * // text => array ( "content" => "hello") + * } + * @return bool|array + */ + public function previewMassMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/preview?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询群å‘消æ¯å‘é€çŠ¶æ€ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param string $msg_id 消æ¯ID + * @return bool|array + * { + * "msg_id":201053012, //群å‘消æ¯åŽè¿”回的消æ¯id + * "msg_status":"SEND_SUCCESS", //消æ¯å‘é€åŽçš„状æ€ï¼ŒSENDING表示正在å‘é€ SEND_SUCCESS表示å‘é€æˆåŠŸ + * } + */ + public function queryMassMessage($msg_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = Tools::json_encode(array('msg_id' => $msg_id)); + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/get?access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php new file mode 100644 index 00000000000..8d99fed9aa7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php @@ -0,0 +1,138 @@ +appid}&redirect_uri={$redirect_uri}&response_type=code&scope={$scope}&state={$state}#wechat_redirect"; + } + + /** + * 通过 code èŽ·å– AccessToken å’Œ openid + * @return bool|array + */ + public function getOauthAccessToken() + { + $code = isset($_GET['code']) ? $_GET['code'] : ''; + if (empty($code)) { + Tools::log("getOauthAccessToken Fail, Because there is no access to the code value in get.", "MSG - {$this->appid}"); + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_TOKEN_URL . "appid={$this->appid}&secret={$this->appsecret}&code={$code}&grant_type=authorization_code"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthAccessToken Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + return $json; + } + return false; + } + + /** + * 刷新access token并续期 + * @param string $refresh_token + * @return bool|array + */ + public function getOauthRefreshToken($refresh_token) + { + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_REFRESH_URL . "appid={$this->appid}&grant_type=refresh_token&refresh_token={$refresh_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthRefreshToken Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + return $json; + } + return false; + } + + /** + * 获å–授æƒåŽçš„用户资料 + * @param string $access_token + * @param string $openid + * @return bool|array {openid,nickname,sex,province,city,country,headimgurl,privilege,[unionid]} + * 注æ„:unionid字段 åªæœ‰åœ¨ç”¨æˆ·å°†å…¬ä¼—å·ç»‘定到微信开放平å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 + */ + public function getOauthUserInfo($access_token, $openid) + { + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_USERINFO_URL . "access_token={$access_token}&openid={$openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthUserInfo Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + return $json; + } + return false; + } + + /** + * 检验授æƒå‡­è¯æ˜¯å¦æœ‰æ•ˆ + * @param string $access_token + * @param string $openid + * @return bool 是å¦æœ‰æ•ˆ + */ + public function getOauthAuth($access_token, $openid) + { + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_AUTH_URL . "access_token={$access_token}&openid={$openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthAuth Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } elseif (intval($json['errcode']) === 0) { + return true; + } + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php new file mode 100644 index 00000000000..0ca602d9e8c --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php @@ -0,0 +1,620 @@ + + * @date 2015/05/13 12:12:00 + */ +class WechatPay +{ + + /** 支付接å£åŸºç¡€åœ°å€ */ + const MCH_BASE_URL = 'https://api.mch.weixin.qq.com'; + + /** 公众å·appid */ + public $appid; + + /** 公众å·é…ç½® */ + public $config; + + /** 商户身份ID */ + public $mch_id; + + /** 商户支付密钥Key */ + public $partnerKey; + + /** è¯ä¹¦è·¯å¾„ */ + public $ssl_cer; + public $ssl_key; + + /** 执行错误消æ¯åŠä»£ç  */ + public $errMsg; + public $errCode; + + /** + * WechatPay constructor. + * @param array $options + */ + public function __construct($options = array()) + { + $this->config = Loader::config($options); + $this->appid = isset($this->config['appid']) ? $this->config['appid'] : ''; + $this->mch_id = isset($this->config['mch_id']) ? $this->config['mch_id'] : ''; + $this->partnerKey = isset($this->config['partnerkey']) ? $this->config['partnerkey'] : ''; + $this->ssl_cer = isset($this->config['ssl_cer']) ? $this->config['ssl_cer'] : ''; + $this->ssl_key = isset($this->config['ssl_key']) ? $this->config['ssl_key'] : ''; + } + + /** + * 获å–当å‰é”™è¯¯å†…容 + * @return string + */ + public function getError() + { + return $this->errMsg; + } + + /** + * 当å‰å½“å‰é”™è¯¯ä»£ç  + * @return int + */ + public function getErrorCode() + { + return $this->errCode; + } + + /** + * 获å–当å‰æ“作公众å·APPID + * @return string + */ + public function getAppid() + { + return $this->appid; + } + + /** + * 获å–SDKé…ç½®å‚æ•° + * @return array + */ + public function getConfig() + { + return $this->config; + } + + /** + * 设置标é…的请求å‚数,生æˆç­¾å,生æˆæŽ¥å£å‚æ•°xml + * @param array $data + * @return string + */ + protected function createXml($data) + { + if (!isset($data['wxappid']) && !isset($data['mch_appid']) && !isset($data['appid'])) { + $data['appid'] = $this->appid; + } + if (!isset($data['mchid']) && !isset($data['mch_id'])) { + $data['mch_id'] = $this->mch_id; + } + isset($data['nonce_str']) || $data['nonce_str'] = Tools::createNoncestr(); + $data["sign"] = Tools::getPaySign($data, $this->partnerKey); + return Tools::arr2xml($data); + } + + /** + * POSTæ交XML + * @param array $data + * @param string $url + * @return mixed + */ + public function postXml($data, $url) + { + return Tools::httpPost($url, $this->createXml($data)); + } + + /** + * 使用è¯ä¹¦post请求XML + * @param array $data + * @param string $url + * @return mixed + */ + function postXmlSSL($data, $url) + { + return Tools::httpsPost($url, $this->createXml($data), $this->ssl_cer, $this->ssl_key); + } + + /** + * POSTæ交获å–Array结果 + * @param array $data 需è¦æäº¤çš„æ•°æ® + * @param string $url + * @param string $method + * @return array + */ + public function getArrayResult($data, $url, $method = 'postXml') + { + return Tools::xml2arr($this->$method($data, $url)); + } + + /** + * 解æžè¿”回的结果 + * @param array $result + * @return bool|array + */ + protected function _parseResult($result) + { + if (empty($result)) { + $this->errCode = 'result error'; + $this->errMsg = '解æžè¿”回结果失败'; + return false; + } + if ($result['return_code'] !== 'SUCCESS') { + $this->errCode = $result['return_code']; + $this->errMsg = $result['return_msg']; + return false; + } + if (isset($result['err_code']) && $result['err_code'] !== 'SUCCESS') { + $this->errMsg = $result['err_code_des']; + $this->errCode = $result['err_code']; + return false; + } + return $result; + } + + /** + * 创建刷å¡æ”¯ä»˜å‚数包 + * @param string $auth_code 授æƒCodeå· + * @param string $out_trade_no 商户订å•å· + * @param int $total_fee 支付费用 + * @param string $body 订å•æ ‡è¯† + * @param null $goods_tag 商å“标签 + * @return array|bool + */ + public function createMicroPay($auth_code, $out_trade_no, $total_fee, $body, $goods_tag = null) + { + $data = array( + "appid" => $this->appid, + "mch_id" => $this->mch_id, + "body" => $body, + "out_trade_no" => $out_trade_no, + "total_fee" => $total_fee, + "auth_code" => $auth_code, + "spbill_create_ip" => Tools::getAddress(), + ); + empty($goods_tag) || $data['goods_tag'] = $goods_tag; + $json = Tools::xml2arr($this->postXml($data, self::MCH_BASE_URL . '/pay/micropay')); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * 支付通知验è¯å¤„ç† + * @return bool|array + */ + public function getNotify() + { + $disableEntities = libxml_disable_entity_loader(true); + $notifyInfo = (array)simplexml_load_string(file_get_contents("php://input"), 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); + if (empty($notifyInfo)) { + Tools::log('Payment notification forbidden access.', "ERR - {$this->appid}"); + $this->errCode = '404'; + $this->errMsg = 'Payment notification forbidden access.'; + return false; + } + if (empty($notifyInfo['sign'])) { + Tools::log('Payment notification signature is missing.' . var_export($notifyInfo, true), "ERR - {$this->appid}"); + $this->errCode = '403'; + $this->errMsg = 'Payment notification signature is missing.'; + return false; + } + $data = $notifyInfo; + unset($data['sign']); + if ($notifyInfo['sign'] !== Tools::getPaySign($data, $this->partnerKey)) { + Tools::log('Payment notification signature verification failed.' . var_export($notifyInfo, true), "ERR - {$this->appid}"); + $this->errCode = '403'; + $this->errMsg = 'Payment signature verification failed.'; + return false; + } + Tools::log('Payment notification signature verification success.' . var_export($notifyInfo, true), "MSG - {$this->appid}"); + $this->errCode = '0'; + $this->errMsg = ''; + return $notifyInfo; + } + + + /** + * 支付XMLç»Ÿä¸€å›žå¤ + * @param array $data 需è¦å›žå¤çš„XML内容数组 + * @param bool $isReturn 是å¦è¿”回XML内容,默认ä¸è¿”回 + * @return string + */ + public function replyXml(array $data, $isReturn = false) + { + $xml = Tools::arr2xml($data); + if ($isReturn) { + return $xml; + } + ob_clean(); + exit($xml); + } + + /** + * 获å–预支付ID + * @param string $openid 用户openid,JSAPIå¿…å¡« + * @param string $body 商å“标题 + * @param string $out_trade_no 第三方订å•å· + * @param int $total_fee 订å•æ€»ä»· + * @param string $notify_url 支付æˆåŠŸå›žè°ƒåœ°å€ + * @param string $trade_type 支付类型JSAPI|NATIVE|APP + * @param string $goods_tag 商å“标记,代金券或立å‡ä¼˜æƒ åŠŸèƒ½çš„å‚æ•° + * @param string $fee_type 交易å¸ç§ + * @param null $no_credit 是å¦ç¦æ­¢ä¿¡ç”¨ + * @return bool|string + */ + public function getPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $trade_type = "JSAPI", $goods_tag = null, $fee_type = 'CNY', $no_credit = null) + { + $postdata = array( + "body" => $body, + "out_trade_no" => $out_trade_no, + "fee_type" => $fee_type, + "total_fee" => $total_fee, + "notify_url" => $notify_url, + "trade_type" => $trade_type, + "spbill_create_ip" => Tools::getAddress(), + ); + empty($openid) || $postdata['openid'] = $openid; + empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; + is_null($no_credit) || $postdata['no_credit'] = $no_credit; + $result = $this->getArrayResult($postdata, self::MCH_BASE_URL . '/pay/unifiedorder'); + if (false === $this->_parseResult($result)) { + return false; + } + return in_array($trade_type, array('JSAPI', 'APP')) ? $result['prepay_id'] : ($trade_type === 'MWEB' ? $result['mweb_url'] : $result['code_url']); + } + + /** + * 获å–二维ç é¢„支付ID + * @param string $openid 用户openid,JSAPIå¿…å¡« + * @param string $body 商å“标题 + * @param string $out_trade_no 第三方订å•å· + * @param int $total_fee 订å•æ€»ä»· + * @param string $notify_url 支付æˆåŠŸå›žè°ƒåœ°å€ + * @param string $goods_tag 商å“标记,代金券或立å‡ä¼˜æƒ åŠŸèƒ½çš„å‚æ•° + * @param string $fee_type 交易å¸ç§ + * @return bool|string + */ + public function getQrcPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $goods_tag = null, $fee_type = 'CNY') + { + $postdata = array( + "body" => $body, + "out_trade_no" => $out_trade_no, + "fee_type" => $fee_type, + "total_fee" => $total_fee, + "notify_url" => $notify_url, + "trade_type" => 'NATIVE', + "spbill_create_ip" => Tools::getAddress(), + ); + empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; + empty($openid) || $postdata['openid'] = $openid; + $result = $this->getArrayResult($postdata, self::MCH_BASE_URL . '/pay/unifiedorder'); + if (false === $this->_parseResult($result) || empty($result['prepay_id'])) { + return false; + } + return $result['prepay_id']; + } + + /** + * 获å–æ”¯ä»˜è§„äºŒç»´ç  + * @param string $product_id 商户定义的商å“id 或者订å•å· + * @return string + */ + public function getQrcPayUrl($product_id) + { + $data = array( + 'appid' => $this->appid, + 'mch_id' => $this->mch_id, + 'time_stamp' => (string)time(), + 'nonce_str' => Tools::createNoncestr(), + 'product_id' => (string)$product_id, + ); + $data['sign'] = Tools::getPaySign($data, $this->partnerKey); + return "weixin://wxpay/bizpayurl?" . http_build_query($data); + } + + + /** + * 创建JSAPI支付å‚数包 + * @param string $prepay_id + * @return array + */ + public function createMchPay($prepay_id) + { + $option = array(); + $option["appId"] = $this->appid; + $option["timeStamp"] = (string)time(); + $option["nonceStr"] = Tools::createNoncestr(); + $option["package"] = "prepay_id={$prepay_id}"; + $option["signType"] = "MD5"; + $option["paySign"] = Tools::getPaySign($option, $this->partnerKey); + $option['timestamp'] = $option['timeStamp']; + return $option; + } + + /** + * å…³é—­è®¢å• + * @param string $out_trade_no + * @return bool + */ + public function closeOrder($out_trade_no) + { + $data = array('out_trade_no' => $out_trade_no); + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/closeorder'); + if (false === $this->_parseResult($result)) { + return false; + } + return ($result['return_code'] === 'SUCCESS'); + } + + /** + * 查询订å•è¯¦æƒ… + * @param $out_trade_no + * @return bool|array + */ + public function queryOrder($out_trade_no) + { + $data = array('out_trade_no' => $out_trade_no); + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/orderquery'); + if (false === $this->_parseResult($result)) { + return false; + } + return $result; + } + + /** + * 订å•é€€æ¬¾æŽ¥å£ + * @param string $out_trade_no 商户订å•å· + * @param string $transaction_id 微信订å•å·ï¼Œä¸Ž out_refund_no 二选一(ä¸é€‰æ—¶ä¼ 0或false) + * @param string $out_refund_no 商户退款订å•å·ï¼Œä¸Ž transaction_id 二选一(ä¸é€‰æ—¶ä¼ 0或false) + * @param int $total_fee 商户订å•æ€»é‡‘é¢ + * @param int $refund_fee 退款金é¢ï¼Œä¸å¯å¤§äºŽè®¢å•æ€»é‡‘é¢ + * @param int|null $op_user_id æ“作员ID,默认商户ID + * @param string $refund_account 退款资金æ¥æº + * 仅针对è€èµ„金æµå•†æˆ·ä½¿ç”¨ + * REFUND_SOURCE_UNSETTLED_FUNDS --- 未结算资金退款(默认使用未结算资金退款) + * REFUND_SOURCE_RECHARGE_FUNDS --- å¯ç”¨ä½™é¢é€€æ¬¾ + * @param string $refund_desc 退款原因 + * @param string $refund_fee_type 退款货å¸ç§ç±» + * @return bool + */ + public function refund($out_trade_no, $transaction_id, $out_refund_no, $total_fee, $refund_fee, $op_user_id = null, $refund_account = '', $refund_desc = '', $refund_fee_type = 'CNY') + { + $data = array(); + $data['out_trade_no'] = $out_trade_no; + $data['total_fee'] = $total_fee; + $data['refund_fee'] = $refund_fee; + $data['refund_fee_type'] = $refund_fee_type; + $data['op_user_id'] = empty($op_user_id) ? $this->mch_id : $op_user_id; + !empty($out_refund_no) && $data['out_refund_no'] = $out_refund_no; + !empty($transaction_id) && $data['transaction_id'] = $transaction_id; + !empty($refund_account) && $data['refund_account'] = $refund_account; + !empty($refund_desc) && $data['refund_desc'] = $refund_desc; + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/secapi/pay/refund', 'postXmlSSL'); + if (false === $this->_parseResult($result)) { + return false; + } + return ($result['return_code'] === 'SUCCESS'); + } + + /** + * é€€æ¬¾æŸ¥è¯¢æŽ¥å£ + * @param string $out_trade_no + * @return bool|array + */ + public function refundQuery($out_trade_no) + { + $data = array(); + $data['out_trade_no'] = $out_trade_no; + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/refundquery'); + if (false === $this->_parseResult($result)) { + return false; + } + return $result; + } + + /** + * 获å–å¯¹è´¦å• + * @param string $bill_date è´¦å•æ—¥æœŸï¼Œå¦‚ 20141110 + * @param string $bill_type ALL|SUCCESS|REFUND|REVOKED + * @return bool|array + */ + public function getBill($bill_date, $bill_type = 'ALL') + { + $data = array(); + $data['bill_date'] = $bill_date; + $data['bill_type'] = $bill_type; + $result = $this->postXml($data, self::MCH_BASE_URL . '/pay/downloadbill'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * å‘é€çŽ°é‡‘红包 + * @param string $openid 红包接收者OPENID + * @param int $total_amount çº¢åŒ…æ€»é‡‘é¢ + * @param string $mch_billno 商户订å•å· + * @param string $sendname 商户å称 + * @param string $wishing 红包ç¥ç¦è¯­ + * @param string $act_name 活动å称 + * @param string $remark å¤‡æ³¨ä¿¡æ¯ + * @param null|int $total_num 红包å‘放总人数(大于1为裂å˜çº¢åŒ…) + * @param null|string $scene_id 场景id + * @param string $risk_info æ´»åŠ¨ä¿¡æ¯ + * @param null|string $consume_mch_id 资金授æƒå•†æˆ·å· + * @return array|bool + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_5 + */ + public function sendRedPack($openid, $total_amount, $mch_billno, $sendname, $wishing, $act_name, $remark, $total_num = 1, $scene_id = null, $risk_info = '', $consume_mch_id = null) + { + $data = array(); + $data['mch_billno'] = $mch_billno; // 商户订å•å· mch_id+yyyymmdd+10ä½ä¸€å¤©å†…ä¸èƒ½é‡å¤çš„æ•°å­— + $data['wxappid'] = $this->appid; + $data['send_name'] = $sendname; //商户å称 + $data['re_openid'] = $openid; //红包接收者 + $data['total_amount'] = $total_amount; //çº¢åŒ…æ€»é‡‘é¢ + $data['total_num'] = '1'; //å‘æ”¾äººæ•°æ® + $data['wishing'] = $wishing; //红包ç¥ç¦è¯­ + $data['client_ip'] = Tools::getAddress(); //调用接å£çš„机器Ipåœ°å€ + $data['act_name'] = $act_name; //活动å称 + $data['remark'] = $remark; //å¤‡æ³¨ä¿¡æ¯ + $data['total_num'] = $total_num; + !empty($scene_id) && $data['scene_id'] = $scene_id; + !empty($risk_info) && $data['risk_info'] = $risk_info; + !empty($consume_mch_id) && $data['consume_mch_id'] = $consume_mch_id; + if ($total_num > 1) { + $data['amt_type'] = 'ALL_RAND'; + $api = self::MCH_BASE_URL . '/mmpaymkttransfers/sendgroupredpack'; + } else { + $api = self::MCH_BASE_URL . '/mmpaymkttransfers/sendredpack'; + } + $result = $this->postXmlSSL($data, $api); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + + /** + * 现金红包状æ€æŸ¥è¯¢ + * @param string $billno + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_7&index=6 + */ + public function queryRedPack($billno) + { + $data['mch_billno'] = $billno; + $data['bill_type'] = 'MCHT'; + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/gethbinfo'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * ä¼ä¸šä»˜æ¬¾ + * @param string $openid 红包接收者OPENID + * @param int $amount çº¢åŒ…æ€»é‡‘é¢ + * @param string $billno 商户订å•å· + * @param string $desc å¤‡æ³¨ä¿¡æ¯ + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2 + */ + public function transfers($openid, $amount, $billno, $desc) + { + $data = array(); + $data['mchid'] = $this->mch_id; + $data['mch_appid'] = $this->appid; + $data['partner_trade_no'] = $billno; + $data['openid'] = $openid; + $data['amount'] = $amount; + $data['check_name'] = 'NO_CHECK'; #ä¸éªŒè¯å§“å + $data['spbill_create_ip'] = Tools::getAddress(); //调用接å£çš„机器Ipåœ°å€ + $data['desc'] = $desc; //å¤‡æ³¨ä¿¡æ¯ + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/promotion/transfers'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * ä¼ä¸šä»˜æ¬¾æŸ¥è¯¢ + * @param string $billno + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_3 + */ + public function queryTransfers($billno) + { + $data['appid'] = $this->appid; + $data['mch_id'] = $this->mch_id; + $data['partner_trade_no'] = $billno; + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/gettransferinfo'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * 二维ç é“¾æŽ¥è½¬æˆçŸ­é“¾æŽ¥ + * @param string $url 需è¦å¤„ç†çš„长链接 + * @return bool|string + */ + public function shortUrl($url) + { + $data = array(); + $data['long_url'] = $url; + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/tools/shorturl'); + if (!$result || $result['return_code'] !== 'SUCCESS') { + $this->errCode = $result['return_code']; + $this->errMsg = $result['return_msg']; + return false; + } + if (isset($result['err_code']) && $result['err_code'] !== 'SUCCESS') { + $this->errMsg = $result['err_code_des']; + $this->errCode = $result['err_code']; + return false; + } + return $result['short_url']; + } + + /** + * å‘放代金券 + * @param int $coupon_stock_id 代金券批次id + * @param string $partner_trade_no 商户此次å‘放凭æ®å·ï¼ˆæ ¼å¼ï¼šå•†æˆ·id+日期+æµæ°´å·ï¼‰ï¼Œå•†æˆ·ä¾§éœ€ä¿æŒå”¯ä¸€æ€§ + * @param string $openid Openidä¿¡æ¯ + * @param string $op_user_id æ“作员å¸å·, é»˜è®¤ä¸ºå•†æˆ·å· å¯åœ¨å•†æˆ·å¹³å°é…ç½®æ“作员对应的apiæƒé™ + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_3 + */ + public function sendCoupon($coupon_stock_id, $partner_trade_no, $openid, $op_user_id = null) + { + $data = array(); + $data['appid'] = $this->appid; + $data['coupon_stock_id'] = $coupon_stock_id; + $data['openid_count'] = 1; + $data['partner_trade_no'] = $partner_trade_no; + $data['openid'] = $openid; + $data['op_user_id'] = empty($op_user_id) ? $this->mch_id : $op_user_id; + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/send_coupon'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php new file mode 100644 index 00000000000..7073c90905c --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php @@ -0,0 +1,193 @@ + + * @date 2016/10/26 15:43 + */ +class WechatPoi extends Common +{ + + /** 创建门店 */ + const POI_ADD = '/cgi-bin/poi/addpoi?'; + + /** æŸ¥è¯¢é—¨åº—ä¿¡æ¯ */ + const POI_GET = '/cgi-bin/poi/getpoi?'; + + /** 获å–门店列表 */ + const POI_GET_LIST = '/cgi-bin/poi/getpoilist?'; + + /** ä¿®æ”¹é—¨åº—ä¿¡æ¯ */ + const POI_UPDATE = '/cgi-bin/poi/updatepoi?'; + + /** 删除门店 */ + const POI_DELETE = '/cgi-bin/poi/delpoi?'; + + /** 获å–门店类目表 */ + const POI_CATEGORY = '/cgi-bin/poi/getwxcategory?'; + + /** + * 创建门店 + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param array $data + * @return bool + */ + public function addPoi($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_ADD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除门店 + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param string $poi_id JSONæ•°æ®æ ¼å¼ + * @return bool|array + */ + public function delPoi($poi_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('poi_id' => $poi_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 修改门店æœåŠ¡ä¿¡æ¯ + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param array $data + * @return bool + */ + public function updatePoi($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * æŸ¥è¯¢é—¨åº—ä¿¡æ¯ + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param string $poi_id + * @return bool + */ + public function getPoi($poi_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('poi_id' => $poi_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_GET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询门店列表 + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param int $begin 开始ä½ç½®ï¼Œ0 å³ä¸ºä»Žç¬¬ä¸€æ¡å¼€å§‹æŸ¥è¯¢ + * @param int $limit 返回数æ®æ¡æ•°ï¼Œæœ€å¤§å…许50,默认为20 + * @return bool|array + */ + public function getPoiList($begin = 0, $limit = 50) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $limit > 50 && $limit = 50; + $data = array('begin' => $begin, 'limit' => $limit); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_GET_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–商家门店类目表 + * @return bool|string + */ + public function getCategory() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::POI_CATEGORY . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php new file mode 100644 index 00000000000..87fab46dbbf --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php @@ -0,0 +1,771 @@ + + * @date 2016/06/28 11:29 + */ +class WechatReceive extends WechatMessage +{ + + /** 消æ¯å›žå¤ç±»åž‹ */ + const MSGTYPE_TEXT = 'text'; + const MSGTYPE_LINK = 'link'; + const MSGTYPE_NEWS = 'news'; + const MSGTYPE_IMAGE = 'image'; + const MSGTYPE_VOICE = 'voice'; + const MSGTYPE_EVENT = 'event'; + const MSGTYPE_MUSIC = 'music'; + const MSGTYPE_VIDEO = 'video'; + const MSGTYPE_LOCATION = 'location'; + + /** 文本过滤 */ + protected $_text_filter = true; + + /** 消æ¯å¯¹è±¡ */ + private $_receive; + + /** + * 获å–微信æœåŠ¡å™¨å‘æ¥çš„内容 + * @return $this + */ + public function getRev() + { + if ($this->_receive) { + return $this; + } + $postStr = !empty($this->postxml) ? $this->postxml : file_get_contents("php://input"); + if (!empty($postStr)) { + $disableEntities = libxml_disable_entity_loader(true); + $this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); + } + return $this; + } + + /** + * 获å–微信æœåŠ¡å™¨å‘æ¥çš„ä¿¡æ¯æ•°æ® + * @return array + */ + public function getRevData() + { + return $this->_receive; + } + + /** + * 获å–消æ¯å‘é€è€… + * @return bool|string + */ + public function getRevFrom() + { + if (isset($this->_receive['FromUserName'])) { + return $this->_receive['FromUserName']; + } + return false; + } + + /** + * 获å–消æ¯æŽ¥å—者 + * @return bool|string + */ + public function getRevTo() + { + if (isset($this->_receive['ToUserName'])) { + return $this->_receive['ToUserName']; + } + return false; + } + + /** + * 获å–接收消æ¯çš„类型 + * @return bool|string + */ + public function getRevType() + { + if (isset($this->_receive['MsgType'])) { + return $this->_receive['MsgType']; + } + return false; + } + + /** + * 获å–消æ¯ID + * @return bool|string + */ + public function getRevID() + { + if (isset($this->_receive['MsgId'])) { + return $this->_receive['MsgId']; + } + return false; + } + + /** + * 获å–消æ¯å‘é€æ—¶é—´ + * @return bool|string + */ + public function getRevCtime() + { + if (isset($this->_receive['CreateTime'])) { + return $this->_receive['CreateTime']; + } + return false; + } + + /** + * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - å¡å·å®¡æ ¸æ˜¯å¦é€šè¿‡ + * 当Event为 card_pass_check(审核通过) 或 card_not_pass_check(未通过) + * @return bool|string 返回å¡åˆ¸ID + */ + public function getRevCardPass() + { + if (isset($this->_receive['CardId'])) { + return $this->_receive['CardId']; + } + return false; + } + + /** + * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - 领å–å¡åˆ¸ + * 当Event为 user_get_card(用户领å–å¡åˆ¸) + * @return bool|array + */ + public function getRevCardGet() + { + $array = array(); + if (isset($this->_receive['CardId'])) { + $array['CardId'] = $this->_receive['CardId']; + } + if (isset($this->_receive['IsGiveByFriend'])) { + $array['IsGiveByFriend'] = $this->_receive['IsGiveByFriend']; + } + $array['OldUserCardCode'] = $this->_receive['OldUserCardCode']; + if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) { + $array['UserCardCode'] = $this->_receive['UserCardCode']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - 删除å¡åˆ¸ + * 当Event为 user_del_card (用户删除å¡åˆ¸) + * @return bool|array + */ + public function getRevCardDel() + { + if (isset($this->_receive['CardId'])) { //å¡åˆ¸ ID + $array['CardId'] = $this->_receive['CardId']; + } + if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) { + $array['UserCardCode'] = $this->_receive['UserCardCode']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–接收消æ¯å†…容正文 + * @return bool + */ + public function getRevContent() + { + if (isset($this->_receive['Content'])) { + return $this->_receive['Content']; + } elseif (isset($this->_receive['Recognition'])) { + return $this->_receive['Recognition']; + } + return false; + } + + /** + * 获å–接收消æ¯å›¾ç‰‡ + * @return array|bool + */ + public function getRevPic() + { + if (isset($this->_receive['PicUrl'])) { + return array( + 'mediaid' => $this->_receive['MediaId'], + 'picurl' => (string)$this->_receive['PicUrl'], + ); + } + return false; + } + + /** + * 获å–接收消æ¯é“¾æŽ¥ + * @return bool|array + */ + public function getRevLink() + { + if (isset($this->_receive['Url'])) { + return array( + 'url' => $this->_receive['Url'], + 'title' => $this->_receive['Title'], + 'description' => $this->_receive['Description'], + ); + } + return false; + } + + /** + * 获å–接收地ç†ä½ç½® + * @return bool|array + */ + public function getRevGeo() + { + if (isset($this->_receive['Location_X'])) { + return array( + 'x' => $this->_receive['Location_X'], + 'y' => $this->_receive['Location_Y'], + 'scale' => $this->_receive['Scale'], + 'label' => $this->_receive['Label'], + ); + } + return false; + } + + /** + * 获å–上报地ç†ä½ç½®äº‹ä»¶ + * @return bool|array + */ + public function getRevEventGeo() + { + if (isset($this->_receive['Latitude'])) { + return array( + 'x' => $this->_receive['Latitude'], + 'y' => $this->_receive['Longitude'], + 'precision' => $this->_receive['Precision'], + ); + } + return false; + } + + /** + * 获å–æŽ¥æ”¶äº‹ä»¶æŽ¨é€ + * @return bool|array + */ + public function getRevEvent() + { + if (isset($this->_receive['Event'])) { + $array['event'] = $this->_receive['Event']; + } + if (isset($this->_receive['EventKey'])) { + $array['key'] = $this->_receive['EventKey']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–自定义èœå•çš„扫ç æŽ¨äº‹ä»¶ä¿¡æ¯ + * + * 事件类型为以下两ç§æ—¶åˆ™è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ + * Event 事件类型, scancode_push + * Event 事件类型, scancode_waitmsg + * @return bool|array + */ + public function getRevScanInfo() + { + if (isset($this->_receive['ScanCodeInfo'])) { + if (!is_array($this->_receive['ScanCodeInfo'])) { + $array = (array)$this->_receive['ScanCodeInfo']; + $this->_receive['ScanCodeInfo'] = $array; + } else { + $array = $this->_receive['ScanCodeInfo']; + } + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–自定义èœå•çš„图片å‘é€äº‹ä»¶ä¿¡æ¯ + * + * 事件类型为以下三ç§æ—¶åˆ™è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ + * Event 事件类型,pic_sysphoto 弹出系统æ‹ç…§å‘å›¾çš„äº‹ä»¶æŽ¨é€ + * Event 事件类型,pic_photo_or_album 弹出æ‹ç…§æˆ–者相册å‘å›¾çš„äº‹ä»¶æŽ¨é€ + * Event 事件类型,pic_weixin 弹出微信相册å‘å›¾å™¨çš„äº‹ä»¶æŽ¨é€ + * + * @return bool|array + * array ( + * 'Count' => '2', + * 'PicList' =>array ( + * 'item' =>array ( + * 0 =>array ('PicMd5Sum' => 'aaae42617cf2a14342d96005af53624c'), + * 1 =>array ('PicMd5Sum' => '149bd39e296860a2adc2f1bb81616ff8'), + * ), + * ), + * ) + * + */ + public function getRevSendPicsInfo() + { + if (isset($this->_receive['SendPicsInfo'])) { + if (!is_array($this->_receive['SendPicsInfo'])) { + $array = (array)$this->_receive['SendPicsInfo']; + if (isset($array['PicList'])) { + $array['PicList'] = (array)$array['PicList']; + $item = $array['PicList']['item']; + $array['PicList']['item'] = array(); + foreach ($item as $key => $value) { + $array['PicList']['item'][$key] = (array)$value; + } + } + $this->_receive['SendPicsInfo'] = $array; + } else { + $array = $this->_receive['SendPicsInfo']; + } + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–自定义èœå•çš„地ç†ä½ç½®é€‰æ‹©å™¨äº‹ä»¶æŽ¨é€ + * + * 事件类型为以下时则å¯ä»¥è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ + * Event 事件类型,location_select 弹出地ç†ä½ç½®é€‰æ‹©å™¨çš„äº‹ä»¶æŽ¨é€ + * + * @return bool|array + * array ( + * 'Location_X' => '33.731655000061', + * 'Location_Y' => '113.29955200008047', + * 'Scale' => '16', + * 'Label' => 'æŸæŸå¸‚æŸæŸåŒºæŸæŸè·¯', + * 'Poiname' => '', + * ) + * + */ + public function getRevSendGeoInfo() + { + if (isset($this->_receive['SendLocationInfo'])) { + if (!is_array($this->_receive['SendLocationInfo'])) { + $array = (array)$this->_receive['SendLocationInfo']; + if (empty($array['Poiname'])) { + $array['Poiname'] = ""; + } + if (empty($array['Label'])) { + $array['Label'] = ""; + } + $this->_receive['SendLocationInfo'] = $array; + } else { + $array = $this->_receive['SendLocationInfo']; + } + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–æŽ¥æ”¶è¯­éŸ³æŽ¨é€ + * @return bool|array + */ + public function getRevVoice() + { + if (isset($this->_receive['MediaId'])) { + return array( + 'mediaid' => $this->_receive['MediaId'], + 'format' => $this->_receive['Format'], + ); + } + return false; + } + + /** + * 获å–æŽ¥æ”¶è§†é¢‘æŽ¨é€ + * @return array|bool + */ + public function getRevVideo() + { + if (isset($this->_receive['MediaId'])) { + return array( + 'mediaid' => $this->_receive['MediaId'], + 'thumbmediaid' => $this->_receive['ThumbMediaId'], + ); + } + return false; + } + + /** + * 获å–接收TICKET + * @return bool|string + */ + public function getRevTicket() + { + if (isset($this->_receive['Ticket'])) { + return $this->_receive['Ticket']; + } + return false; + } + + /** + * 获å–二维ç çš„场景值 + * @return bool|string + */ + public function getRevSceneId() + { + if (isset($this->_receive['EventKey'])) { + return str_replace('qrscene_', '', $this->_receive['EventKey']); + } + return false; + } + + /** + * 获å–主动推é€çš„消æ¯ID + * ç»è¿‡éªŒè¯ï¼Œè¿™ä¸ªå’Œæ™®é€šçš„消æ¯MsgIdä¸ä¸€æ · + * 当Event为 MASSSENDJOBFINISH 或 TEMPLATESENDJOBFINISH + * @return bool|string + */ + public function getRevTplMsgID() + { + if (isset($this->_receive['MsgID'])) { + return $this->_receive['MsgID']; + } + return false; + } + + /** + * 获å–模æ¿æ¶ˆæ¯å‘é€çŠ¶æ€ + * @return bool|string + */ + public function getRevStatus() + { + if (isset($this->_receive['Status'])) { + return $this->_receive['Status']; + } + return false; + } + + /** + * 获å–群å‘或模æ¿æ¶ˆæ¯å‘é€ç»“æžœ + * 当Event为 MASSSENDJOBFINISH 或 TEMPLATESENDJOBFINISH,å³é«˜çº§ç¾¤å‘/模æ¿æ¶ˆæ¯ + * @return bool|array + */ + public function getRevResult() + { + if (isset($this->_receive['Status'])) { //å‘é€æ˜¯å¦æˆåŠŸï¼Œå…·ä½“的返回值请å‚考 高级群å‘/模æ¿æ¶ˆæ¯ 的事件推é€è¯´æ˜Ž + $array['Status'] = $this->_receive['Status']; + } + if (isset($this->_receive['MsgID'])) { //å‘é€çš„消æ¯id + $array['MsgID'] = $this->_receive['MsgID']; + } + //以下仅当群å‘消æ¯æ—¶æ‰ä¼šæœ‰çš„事件内容 + if (isset($this->_receive['TotalCount'])) { //分组或openid列表内粉ä¸æ•°é‡ + $array['TotalCount'] = $this->_receive['TotalCount']; + } + if (isset($this->_receive['FilterCount'])) { //过滤(过滤是指特定地区ã€æ€§åˆ«çš„过滤ã€ç”¨æˆ·è®¾ç½®æ‹’收的过滤,用户接收已超4æ¡çš„过滤)åŽï¼Œå‡†å¤‡å‘é€çš„粉ä¸æ•° + $array['FilterCount'] = $this->_receive['FilterCount']; + } + if (isset($this->_receive['SentCount'])) { //å‘é€æˆåŠŸçš„粉ä¸æ•° + $array['SentCount'] = $this->_receive['SentCount']; + } + if (isset($this->_receive['ErrorCount'])) { //å‘é€å¤±è´¥çš„粉ä¸æ•° + $array['ErrorCount'] = $this->_receive['ErrorCount']; + } + if (isset($array) && count($array) > 0) { + return $array; + } + return false; + } + + /** + * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - æŽ¥å…¥ä¼šè¯ + * 当Event为 kfcreatesession å³æŽ¥å…¥ä¼šè¯ + * @return bool|string + */ + public function getRevKFCreate() + { + if (isset($this->_receive['KfAccount'])) { + return $this->_receive['KfAccount']; + } + return false; + } + + /** + * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - å…³é—­ä¼šè¯ + * 当Event为 kfclosesession å³å…³é—­ä¼šè¯ + * @return bool|string + */ + public function getRevKFClose() + { + if (isset($this->_receive['KfAccount'])) { + return $this->_receive['KfAccount']; + } + return false; + } + + /** + * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - è½¬æŽ¥ä¼šè¯ + * 当Event为 kfswitchsession å³è½¬æŽ¥ä¼šè¯ + * @return bool|array + */ + public function getRevKFSwitch() + { + if (isset($this->_receive['FromKfAccount'])) { //åŽŸæŽ¥å…¥å®¢æœ + $array['FromKfAccount'] = $this->_receive['FromKfAccount']; + } + if (isset($this->_receive['ToKfAccount'])) { //è½¬æŽ¥åˆ°å®¢æœ + $array['ToKfAccount'] = $this->_receive['ToKfAccount']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * å‘é€å®¢æœæ¶ˆæ¯ + * @param array $data 消æ¯ç»“æž„{"touser":"OPENID","msgtype":"news","news":{...}} + * @return bool|array + */ + public function sendCustomMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/custom/send?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 转å‘多客æœæ¶ˆæ¯ + * @param string $customer_account + * @return $this + */ + public function transfer_customer_service($customer_account = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'CreateTime' => time(), + 'MsgType' => 'transfer_customer_service', + ); + if ($customer_account) { + $msg['TransInfo'] = array('KfAccount' => $customer_account); + } + $this->Message($msg); + return $this; + } + + /** + * 设置å‘é€æ¶ˆæ¯ + * @param string|array $msg 消æ¯æ•°ç»„ + * @param bool $append 是å¦åœ¨åŽŸæ¶ˆæ¯æ•°ç»„追加 + * @return array + */ + public function Message($msg = '', $append = false) + { + if (is_null($msg)) { + $this->_msg = array(); + } elseif (is_array($msg)) { + if ($append) { + $this->_msg = array_merge($this->_msg, $msg); + } else { + $this->_msg = $msg; + } + return $this->_msg; + } + return $this->_msg; + } + + /** + * è®¾ç½®æ–‡æœ¬æ¶ˆæ¯ + * @param string $text 文本内容 + * @return $this + */ + public function text($text = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_TEXT, + 'Content' => $this->_auto_text_filter($text), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * è®¾ç½®å›¾ç‰‡æ¶ˆæ¯ + * @param string $mediaid 图片媒体ID + * @return $this + */ + public function image($mediaid = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_IMAGE, + 'Image' => array('MediaId' => $mediaid), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * 设置语音回å¤æ¶ˆæ¯ + * @param string $mediaid 语音媒体ID + * @return $this + */ + public function voice($mediaid = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_VOICE, + 'Voice' => array('MediaId' => $mediaid), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * 设置视频回å¤æ¶ˆæ¯ + * @param string $mediaid 视频媒体ID + * @param string $title 视频标题 + * @param string $description 视频æè¿° + * @return $this + */ + public function video($mediaid = '', $title = '', $description = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_VIDEO, + 'Video' => array( + 'MediaId' => $mediaid, + 'Title' => $title, + 'Description' => $description, + ), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * 设置音ä¹å›žå¤æ¶ˆæ¯ + * @param string $title 音ä¹æ ‡é¢˜ + * @param string $desc 音ä¹æè¿° + * @param string $musicurl 音ä¹åœ°å€ + * @param string $hgmusicurl 高清音ä¹åœ°å€ + * @param string $thumbmediaid 音ä¹å›¾ç‰‡ç¼©ç•¥å›¾çš„媒体id(å¯é€‰ï¼‰ + * @return $this + */ + public function music($title, $desc, $musicurl, $hgmusicurl = '', $thumbmediaid = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'CreateTime' => time(), + 'MsgType' => self::MSGTYPE_MUSIC, + 'Music' => array( + 'Title' => $title, + 'Description' => $desc, + 'MusicUrl' => $musicurl, + 'HQMusicUrl' => $hgmusicurl, + ), + ); + if ($thumbmediaid) { + $msg['Music']['ThumbMediaId'] = $thumbmediaid; + } + $this->Message($msg); + return $this; + } + + /** + * 设置回å¤å›¾æ–‡ + * @param array $newsData + * @return $this + */ + public function news($newsData = array()) + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'CreateTime' => time(), + 'MsgType' => self::MSGTYPE_NEWS, + 'ArticleCount' => count($newsData), + 'Articles' => $newsData, + ); + $this->Message($msg); + return $this; + } + + /** + * 回å¤å¾®ä¿¡æœåŠ¡å™¨ + * @param array $msg è¦å‘é€çš„ä¿¡æ¯ï¼ˆé»˜è®¤å–$this->_msg) + * @param bool $return 是å¦è¿”回信æ¯è€Œä¸æŠ›å‡ºåˆ°æµè§ˆå™¨ï¼ˆé»˜è®¤:å¦ï¼‰ + * @return bool|string + */ + public function reply($msg = array(), $return = false) + { + if (empty($msg)) { + if (empty($this->_msg)) { //防止ä¸å…ˆè®¾ç½®å›žå¤å†…容,直接调用reply方法导致异常 + return false; + } + $msg = $this->_msg; + } + $xmldata = Tools::arr2xml($msg); + if ($this->encrypt_type == 'aes') { //如果æ¥æºæ¶ˆæ¯ä¸ºåŠ å¯†æ–¹å¼ + !class_exists('Prpcrypt', false) && require __DIR__ . '/Lib/Prpcrypt.php'; + $pc = new Prpcrypt($this->encodingAesKey); + // 如果是第三方平å°ï¼ŒåŠ å¯†å¾—使用 component_appid + $array = $pc->encrypt($xmldata, empty($this->config['component_appid']) ? $this->appid : $this->config['component_appid']); + $ret = $array[0]; + if ($ret != 0) { + Tools::log('Encrypt Error!', "ERR - {$this->appid}"); + return false; + } + $timestamp = time(); + $nonce = rand(77, 999) * rand(605, 888) * rand(11, 99); + $encrypt = $array[1]; + $tmpArr = array($this->token, $timestamp, $nonce, $encrypt); + sort($tmpArr, SORT_STRING); + $signature = sha1(implode($tmpArr)); + $format = "%s"; + $xmldata = sprintf($format, $encrypt, $signature, $timestamp, $nonce); + } + if ($return) { + return $xmldata; + } + echo $xmldata; + } + + /** + * 过滤文字回å¤\r\næ¢è¡Œç¬¦ + * @param string $text + * @return string + */ + private function _auto_text_filter($text) + { + if (!$this->_text_filter) { + return $text; + } + return str_replace("\r\n", "\n", $text); + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php new file mode 100644 index 00000000000..c069f22f591 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php @@ -0,0 +1,138 @@ + + * @date 2016/06/28 11:24 + */ +class WechatScript extends Common +{ + + /** + * JSAPI授æƒTICKET + * @var string + */ + public $jsapi_ticket; + + /** + * 删除JSAPI授æƒTICKET + * @param string $appid + * @return bool + */ + public function resetJsTicket($appid = '') + { + $this->jsapi_ticket = ''; + $authname = 'wechat_jsapi_ticket_' . empty($appid) ? $this->appid : $appid; + Tools::removeCache($authname); + return true; + } + + /** + * 获å–JSAPI授æƒTICKET + * @param string $appid 用于多个appid时使用,å¯ç©º + * @param string $jsapi_ticket 手动指定jsapi_ticket,éžå¿…è¦æƒ…况ä¸å»ºè®®ç”¨ + * @param string $access_token èŽ·å– jsapi_ticket 指定 access_token + * @return bool|string + */ + public function getJsTicket($appid = '', $jsapi_ticket = '', $access_token = '') + { + if (empty($access_token)) { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $access_token = $this->access_token; + } + if (empty($appid)) { + $appid = $this->appid; + } + # 手动指定token,优先使用 + if ($jsapi_ticket) { + $this->jsapi_ticket = $jsapi_ticket; + return $this->jsapi_ticket; + } + # å°è¯•ä»Žç¼“å­˜ä¸­è¯»å– + $cache = 'wechat_jsapi_ticket_' . $appid; + $jt = Tools::getCache($cache); + if ($jt) { + return $this->jsapi_ticket = $jt; + } + # 检测事件注册 + if (isset(Loader::$callback[__FUNCTION__])) { + return $this->jsapi_ticket = call_user_func_array(Loader::$callback[__FUNCTION__], array(&$this, &$cache)); + } + # 调接å£èŽ·å– + $result = Tools::httpGet(self::API_URL_PREFIX . self::GET_TICKET_URL . "access_token={$access_token}" . '&type=jsapi'); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + $this->jsapi_ticket = $json['ticket']; + Tools::setCache($cache, $this->jsapi_ticket, $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600); + return $this->jsapi_ticket; + } + return false; + } + + /** + * 获å–JsApi使用签å + * @param string $url 网页的URL,自动处ç†#åŠå…¶åŽé¢éƒ¨åˆ† + * @param int $timestamp 当å‰æ—¶é—´æˆ³ (为空则自动生æˆ) + * @param string $noncestr éšæœºä¸² (为空则自动生æˆ) + * @param string $appid 用于多个appid时使用,å¯ç©º + * @param string $access_token èŽ·å– jsapi_ticket 指定 access_token + * @return array|bool 返回签å字串 + */ + public function getJsSign($url, $timestamp = 0, $noncestr = '', $appid = '', $access_token = '') + { + if (!$this->jsapi_ticket && !$this->getJsTicket($appid, '', $access_token) || empty($url)) { + return false; + } + $data = array( + "jsapi_ticket" => $this->jsapi_ticket, + "timestamp" => empty($timestamp) ? time() : $timestamp, + "noncestr" => '' . empty($noncestr) ? Tools::createNoncestr(16) : $noncestr, + "url" => trim($url), + ); + return array( + "url" => $url, + 'debug' => false, + "appId" => empty($appid) ? $this->appid : $appid, + "nonceStr" => $data['noncestr'], + "timestamp" => $data['timestamp'], + "signature" => Tools::getSignature($data, 'sha1'), + 'jsApiList' => array( + 'updateTimelineShareData', 'updateAppMessageShareData', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', + 'hideOptionMenu', 'showOptionMenu', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', + 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'closeWindow', 'scanQRCode', 'chooseWXPay', + 'translateVoice', 'getNetworkType', 'openLocation', 'getLocation', + 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard', + 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'pauseVoice', 'stopVoice', 'onVoicePlayEnd', 'uploadVoice', 'downloadVoice', + 'openWXDeviceLib', 'closeWXDeviceLib', 'getWXDeviceInfos', 'sendDataToWXDevice', 'disconnectWXDevice', 'getWXDeviceTicket', 'connectWXDevice', + 'startScanWXDevice', 'stopScanWXDevice', 'onWXDeviceBindStateChange', 'onScanWXDeviceResult', 'onReceiveDataFromWXDevice', + 'onWXDeviceBluetoothStateChange', 'onWXDeviceStateChange' + ) + ); + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php new file mode 100644 index 00000000000..56aa4c13a57 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php @@ -0,0 +1,408 @@ + + * @date 2016/10/18 00:35:55 + */ +class WechatService +{ + + const URL_PREFIX = 'https://api.weixin.qq.com/cgi-bin/component'; + // 获å–æœåŠ¡access_token + const COMPONENT_TOKEN_URL = '/api_component_token'; + // 获å–(刷新)授æƒå…¬ä¼—å·çš„令牌 + const REFRESH_ACCESS_TOKEN = '/api_authorizer_token'; + // 获å–预授æƒç  + const PREAUTH_CODE_URL = '/api_create_preauthcode'; + // 获å–公众å·çš„授æƒä¿¡æ¯ + const QUERY_AUTH_URL = '/api_query_auth'; + // 获å–授æƒæ–¹çš„è´¦æˆ·ä¿¡æ¯ + const GET_AUTHORIZER_INFO_URL = '/api_get_authorizer_info'; + // 获å–授æƒæ–¹çš„é€‰é¡¹è®¾ç½®ä¿¡æ¯ + const GET_AUTHORIZER_OPTION_URL = '/api_get_authorizer_option'; + // 设置授æƒæ–¹çš„é€‰é¡¹ä¿¡æ¯ + const SET_AUTHORIZER_OPTION_URL = '/api_set_authorizer_option'; + + // 微信åŽå°æŽ¨é€çš„ticket æ¯å分钟更新一次 + public $errCode; + // æœåŠ¡appid + public $errMsg; + // æœåŠ¡appsecret + protected $component_verify_ticket; + // 公众å·æ¶ˆæ¯æ ¡éªŒToken + protected $component_appid; + // 公众å·æ¶ˆæ¯åŠ è§£å¯†Key + protected $component_appsecret; + // æœåŠ¡ä»¤ç‰Œ + protected $component_token; + // 授æƒæ–¹appid + protected $component_encodingaeskey; + // 授æƒæ–¹ä»¤ç‰Œ + protected $component_access_token; + // 刷新令牌 + protected $authorizer_appid; + // JSONæ•°æ® + protected $pre_auth_code; + // é”™è¯¯æ¶ˆæ¯ + protected $data; + + /** + * WechatService constructor. + * @param array $options + */ + public function __construct($options = array()) + { + $options = Loader::config($options); + $this->component_encodingaeskey = !empty($options['component_encodingaeskey']) ? $options['component_encodingaeskey'] : ''; + $this->component_verify_ticket = !empty($options['component_verify_ticket']) ? $options['component_verify_ticket'] : ''; + $this->component_appsecret = !empty($options['component_appsecret']) ? $options['component_appsecret'] : ''; + $this->component_token = !empty($options['component_token']) ? $options['component_token'] : ''; + $this->component_appid = !empty($options['component_appid']) ? $options['component_appid'] : ''; + } + + /** + * 接收公众平å°æŽ¨é€çš„ Ticket + * @return bool|array + */ + public function getComonentTicket() + { + $receive = new WechatReceive(array( + 'appid' => $this->component_appid, + 'appsecret' => $this->component_appsecret, + 'encodingaeskey' => $this->component_encodingaeskey, + 'token' => $this->component_token, + 'cachepath' => Cache::$cachepath + )); + # 会è¯å†…容解密状æ€åˆ¤æ–­ + if (false === $receive->valid()) { + $this->errCode = $receive->errCode; + $this->errMsg = $receive->errMsg; + Tools::log("Get Wechat Push ComponentVerifyTicket Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + $data = $receive->getRev()->getRevData(); + if ($data['InfoType'] === 'component_verify_ticket' && !empty($data['ComponentVerifyTicket'])) { + # 记录推é€æ—¥å¿—到微信SDK + Tools::log("Wechat Push ComponentVerifyTicket Success. "); + Tools::setCache('component_verify_ticket', $data['ComponentVerifyTicket']); + } + return $data; + } + + /** + * 获å–(刷新)授æƒå…¬ä¼—å·çš„令牌 + * @注æ„1. 授æƒå…¬ä¼—å·è®¿é—®access token2å°æ—¶æœ‰æ•ˆ + * @注æ„2. 一定ä¿å­˜å¥½æ–°çš„刷新令牌 + * @param string $authorizer_appid 授æƒæ–¹APPID + * @param string $authorizer_refresh_token 授æƒæ–¹åˆ·æ–°ä»¤ç‰Œ + * @return bool|string + */ + public function refreshAccessToken($authorizer_appid, $authorizer_refresh_token) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $data['authorizer_refresh_token'] = $authorizer_refresh_token; + $url = self::URL_PREFIX . self::REFRESH_ACCESS_TOKEN . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($result = $this->_decode($result)) === false) { + Tools::log("Get getAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $result; + } + + /** + * 获å–或刷新æœåŠ¡ AccessToken + * @return bool|string + */ + public function getComponentAccessToken() + { + $cacheKey = 'wechat_component_access_token'; + $this->component_access_token = Tools::getCache($cacheKey); + if (empty($this->component_access_token)) { + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['component_appsecret'] = $this->component_appsecret; + $data['component_verify_ticket'] = $this->component_verify_ticket; + $url = self::URL_PREFIX . self::COMPONENT_TOKEN_URL; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($this->component_access_token = $this->_decode($result, 'component_access_token')) === false) { + Tools::log("Get getComponentAccessToken Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + Tools::setCache($cacheKey, $this->component_access_token, 7200); + } + return $this->component_access_token; + } + + /** + * 解æžJSONæ•°æ® + * @param string $result + * @param string|null $field + * @return bool|array + */ + private function _decode($result, $field = null) + { + $this->data = json_decode($result, true); + if (!empty($this->data['errcode'])) { + $this->errCode = $this->data['errcode']; + $this->errMsg = $this->data['errmsg']; + return false; + } + if ($this->data && !is_null($field)) { + if (isset($this->data[$field])) { + return $this->data[$field]; + } else { + return false; + } + } + return $this->data; + } + + /** + * 获å–公众å·çš„授æƒä¿¡æ¯ + * + * @param string $authorization_code + * @return bool|array + */ + public function getAuthorizationInfo($authorization_code) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorization_code'] = $authorization_code; + $url = self::URL_PREFIX . self::QUERY_AUTH_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + $authorization_info = $this->_decode($result, 'authorization_info'); + if (empty($authorization_info)) { + Tools::log("Get getAuthorizationInfo Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + $authorization_info['func_info'] = $this->_parseFuncInfo($authorization_info['func_info']); + return $authorization_info; + } + + /** + * 解æžæŽˆæƒä¿¡æ¯ï¼Œè¿”回以逗å·åˆ†å‰²çš„æ•°æ® + * @param array $func_info + * @return string + */ + private function _parseFuncInfo($func_info) + { + $authorization_list = array(); + foreach ($func_info as $func) { + foreach ($func as $f) { + isset($f['id']) && $authorization_list[] = $f['id']; + } + } + return join($authorization_list, ','); + } + + /** + * 获å–授æƒæ–¹çš„è´¦æˆ·ä¿¡æ¯ + * @param string $authorizer_appid + * @return bool + */ + public function getWechatInfo($authorizer_appid) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + $data = array(); + $data['component_access_token'] = $this->component_access_token; + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $url = self::URL_PREFIX . self::GET_AUTHORIZER_INFO_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + $authorizer_info = $this->_decode($result, 'authorizer_info'); + if (empty($authorizer_info)) { + Tools::log("Get WechatInfo Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + $author_data = array_merge($authorizer_info, $this->data['authorization_info']); + $author_data['service_type_info'] = $author_data['service_type_info']['id']; + $author_data['verify_type_info'] = $author_data['verify_type_info']['id']; + $author_data['func_info'] = $this->_parseFuncInfo($author_data['func_info']); + $author_data['business_info'] = json_encode($author_data['business_info']); + return $author_data; + } + + /** + * 获å–授æƒæ–¹çš„é€‰é¡¹è®¾ç½®ä¿¡æ¯ + * @param string $authorizer_appid + * @param string $option_name + * @return bool + */ + public function getAuthorizerOption($authorizer_appid, $option_name) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->authorizer_appid)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $data['option_name'] = $option_name; + $url = self::URL_PREFIX . self::GET_AUTHORIZER_OPTION_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($result = $this->_decode($result)) === false) { + Tools::log("Get getAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $result; + } + + /** + * 设置授æƒæ–¹çš„é€‰é¡¹ä¿¡æ¯ + * @param string $authorizer_appid + * @param string $option_name + * @param string $option_value + * @return bool + */ + public function setAuthorizerOption($authorizer_appid, $option_name, $option_value) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->authorizer_appid)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $data['option_name'] = $option_name; + $data['option_value'] = $option_value; + $url = self::URL_PREFIX . self::SET_AUTHORIZER_OPTION_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($result = $this->_decode($result)) === false) { + Tools::log("Get setAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $result; + } + + /** + * 获å–授æƒå›žè·³åœ°å€ + * @param string $redirect_uri + * @return bool + */ + public function getAuthRedirect($redirect_uri) + { + empty($this->pre_auth_code) && $this->getPreauthCode(); + if (empty($this->pre_auth_code)) { + return false; + } + return "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={$this->component_appid}&pre_auth_code={$this->pre_auth_code}&redirect_uri={$redirect_uri}"; + } + + /** + * 获å–预授æƒç  + * + * @return bool|string + */ + public function getPreauthCode() + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $url = self::URL_PREFIX . self::PREAUTH_CODE_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + $this->pre_auth_code = $this->_decode($result, 'pre_auth_code'); + if (empty($this->pre_auth_code)) { + Tools::log("Get getPreauthCode Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $this->pre_auth_code; + } + + /** + * oauth 授æƒè·³è½¬æŽ¥å£ + * @param string $appid + * @param string $redirect_uri + * @param string $scope snsapi_userinfo|snsapi_base + * @return string + */ + public function getOauthRedirect($appid, $redirect_uri, $scope = 'snsapi_userinfo') + { + return "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$appid}&redirect_uri=" . urlencode($redirect_uri) + . "&response_type=code&scope={$scope}&state={$appid}&component_appid={$this->component_appid}#wechat_redirect"; + } + + /** + * 通过code获å–Access Token + * @param string $appid + * @return bool|array + */ + public function getOauthAccessToken($appid) + { + $code = isset($_GET['code']) ? $_GET['code'] : ''; + if (empty($code)) { + return false; + } + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $url = "https://api.weixin.qq.com/sns/oauth2/component/access_token?appid={$appid}&code={$code}&grant_type=authorization_code&" + . "component_appid={$this->component_appid}&component_access_token={$this->component_access_token}"; + $json = $this->parseJson(Tools::httpGet($url)); + if ($json !== false) { + return $json; + } + return false; + } + + /** + * 解æžJSONæ•°æ® + * @param string $result + * @return bool + */ + private function parseJson($result) + { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return false; + } + return $json; + } + + /** + * 获å–å…³æ³¨è€…è¯¦ç»†ä¿¡æ¯ + * @param string $openid + * @param string $oauthAccessToken + * @return bool|array {subscribe,openid,nickname,sex,city,province,country,language,headimgurl,subscribe_time,[unionid]} + * 注æ„:unionid字段 åªæœ‰åœ¨ç”¨æˆ·å°†å…¬ä¼—å·ç»‘定到公众å·ç¬¬ä¸‰æ–¹å¹³å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 + */ + public function getOauthUserInfo($openid, $oauthAccessToken) + { + $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$oauthAccessToken}&openid={$openid}&lang=zh_CN"; + return $this->parseJson(Tools::httpGet($url)); + } + + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php new file mode 100644 index 00000000000..e8182bc9688 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php @@ -0,0 +1,612 @@ + + * @date 2016/06/28 11:20 + */ +class WechatUser extends Common +{ + + /** 获å–粉ä¸åˆ—表 */ + const USER_GET_URL = '/user/get?'; + /* 获å–粉ä¸ä¿¡æ¯ */ + const USER_INFO_URL = '/user/info?'; + /* 批é‡èŽ·å–粉ä¸ä¿¡æ¯ */ + const USER_BATCH_INFO_URL = '/user/info/batchget?'; + /* 更新粉ä¸æ ‡æ³¨ */ + const USER_UPDATEREMARK_URL = '/user/info/updateremark?'; + + /** 创建标签 */ + const TAGS_CREATE_URL = '/tags/create?'; + /* 获å–标签列表 */ + const TAGS_GET_URL = '/tags/get?'; + /* 更新标签 */ + const TAGS_UPDATE_URL = '/tags/update?'; + /* 删除标签 */ + const TAGS_DELETE_URL = '/tags/delete?'; + /* 获å–标签下的粉ä¸åˆ—表 */ + const TAGS_GET_USER_URL = '/user/tag/get?'; + /* 批é‡ä¸ºç²‰ä¸æ‰“标签 */ + const TAGS_MEMBER_BATCHTAGGING = '/tags/members/batchtagging?'; + /* 批é‡ä¸ºç²‰ä¸å–消标签 */ + const TAGS_MEMBER_BATCHUNTAGGING = '/tags/members/batchuntagging?'; + /* 获å–粉ä¸çš„标签列表 */ + const TAGS_LIST = '/tags/getidlist?'; + + /** 获å–分组列表 */ + const GROUP_GET_URL = '/groups/get?'; + /* 获å–粉ä¸æ‰€åœ¨çš„分组 */ + const USER_GROUP_URL = '/groups/getid?'; + /* 创建分组 */ + const GROUP_CREATE_URL = '/groups/create?'; + /* 更新分组 */ + const GROUP_UPDATE_URL = '/groups/update?'; + /* 删除分组 */ + const GROUP_DELETE_URL = '/groups/delete?'; + /* 修改粉ä¸æ‰€åœ¨åˆ†ç»„ */ + const GROUP_MEMBER_UPDATE_URL = '/groups/members/update?'; + /* 批é‡ä¿®æ”¹ç²‰ä¸æ‰€åœ¨åˆ†ç»„ */ + const GROUP_MEMBER_BATCHUPDATE_URL = '/groups/members/batchupdate?'; + + /** 获å–黑åå•åˆ—表 */ + const BACKLIST_GET_URL = '/tags/members/getblacklist?'; + /* 批é‡æ‹‰é»‘ç²‰ä¸ */ + const BACKLIST_ADD_URL = '/tags/members/batchblacklist?'; + /* 批é‡å–æ¶ˆæ‹‰é»‘ç²‰ä¸ */ + const BACKLIST_DEL_URL = '/tags/members/batchunblacklist?'; + + /** + * 批é‡èŽ·å–关注粉ä¸åˆ—表 + * @param string $next_openid + * @return bool|array + */ + public function getUserList($next_openid = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::USER_GET_URL . "access_token={$this->access_token}&next_openid={$next_openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–å…³æ³¨è€…è¯¦ç»†ä¿¡æ¯ + * @param string $openid + * @return bool|array {subscribe,openid,nickname,sex,city,province,country,language,headimgurl,subscribe_time,[unionid]} + * @注æ„:unionid字段 åªæœ‰åœ¨ç²‰ä¸å°†å…¬ä¼—å·ç»‘定到微信开放平å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 + */ + public function getUserInfo($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::USER_INFO_URL . "access_token={$this->access_token}&openid={$openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡èŽ·å–ç”¨æˆ·åŸºæœ¬ä¿¡æ¯ + * @param array $openids 用户oepnid列表(最多支æŒ100个openid) + * @param string $lang 指定返回语言 + * @return bool|mixed + */ + public function getUserBatchInfo(array $openids, $lang = 'zh_CN') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('user_list' => array()); + foreach (array_unique($openids) as $openid) { + $data['user_list'][] = array('openid' => $openid, 'lang' => $lang); + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_BATCH_INFO_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode']) || !isset($json['user_info_list'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['user_info_list']; + } + return false; + } + + /** + * 设置粉ä¸å¤‡æ³¨å + * @param string $openid + * @param string $remark 备注å + * @return bool|array + */ + public function updateUserRemark($openid, $remark) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid, 'remark' => $remark); + $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_UPDATEREMARK_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸åˆ†ç»„列表 + * @return bool|array + */ + public function getGroup() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::GROUP_GET_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除粉ä¸åˆ†ç»„ + * @param string $id + * @return bool + */ + public function delGroup($id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('group' => array('id' => $id)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_DELETE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸æ‰€åœ¨åˆ†ç»„ + * @param string $openid + * @return bool|int æˆåŠŸåˆ™è¿”回粉ä¸åˆ†ç»„id + */ + public function getUserGroup($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_GROUP_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode']) || !isset($json['groupid'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['groupid']; + } + return false; + } + + /** + * 新增自定分组 + * @param string $name 分组å称 + * @return bool|array + */ + public function createGroup($name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('group' => array('name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更改分组å称 + * @param int $groupid 分组id + * @param string $name 分组å称 + * @return bool|array + */ + public function updateGroup($groupid, $name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('group' => array('id' => $groupid, 'name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 移动粉ä¸åˆ†ç»„ + * @param int $groupid 分组id + * @param string $openid 粉ä¸openid + * @return bool|array + */ + public function updateGroupMembers($groupid, $openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid, 'to_groupid' => $groupid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_MEMBER_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡ç§»åŠ¨ç²‰ä¸åˆ†ç»„ + * @param string $groupid 分组ID + * @param string $openid_list 粉ä¸openid数组(一次ä¸èƒ½è¶…过50个) + * @return bool|array + */ + public function batchUpdateGroupMembers($groupid, $openid_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openid_list, 'to_groupid' => $groupid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_MEMBER_BATCHUPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 新增自定标签 + * @param string $name 标签å称 + * @return bool|array + */ + public function createTags($name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tag' => array('name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更新标签 + * @param string $id 标签id + * @param string $name 标签å称 + * @return bool|array + */ + public function updateTag($id, $name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tag' => array('id' => $id, 'name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸æ ‡ç­¾åˆ—表 + * @return bool|array + */ + public function getTags() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::TAGS_GET_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除粉ä¸æ ‡ç­¾ + * @param string $id + * @return bool + */ + public function delTag($id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tag' => array('id' => $id)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_DELETE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–标签下的粉ä¸åˆ—表 + * @param string $tagid + * @param string $next_openid + * @return bool + */ + public function getTagUsers($tagid, $next_openid = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tagid' => $tagid, 'next_openid' => $next_openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_GET_USER_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡ä¸ºç²‰ä¸æ‰“标签 + * @param string $tagid 标签ID + * @param array $openid_list 粉ä¸openid数组,一次ä¸èƒ½è¶…过50个 + * @return bool|array + */ + public function batchAddUserTag($tagid, $openid_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openid_list, 'tagid' => $tagid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_MEMBER_BATCHTAGGING . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡ä¸ºç²‰ä¸å–消标签 + * @param string $tagid 标签ID + * @param array $openid_list 粉ä¸openid数组,一次ä¸èƒ½è¶…过50个 + * @return bool|array + */ + public function batchDeleteUserTag($tagid, $openid_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openid_list, 'tagid' => $tagid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_MEMBER_BATCHUNTAGGING . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸çš„标签列表 + * @param string $openid 粉ä¸openid + * @return bool|array + */ + public function getUserTags($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode']) || !isset($json['tagid_list'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['tagid_list']; + } + return false; + } + + /** + * 批é‡èŽ·å–黑åå•ç²‰ä¸ + * @param string $begin_openid + * @return bool|array + */ + public function getBacklist($begin_openid = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = empty($begin_openid) ? array() : array('begin_openid' => $begin_openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_GET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡æ‹‰é»‘ç²‰ä¸ + * @param string $openids + * @return bool|array + */ + public function addBacklist($openids) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openids); + $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡å–æ¶ˆæ‹‰é»‘ç²‰ä¸ + * @param string $openids + * @return bool|array + */ + public function delBacklist($openids) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openids); + $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json new file mode 100644 index 00000000000..81791c07296 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json @@ -0,0 +1,21 @@ +{ + "type": "project", + "name": "zoujingli/wechat-php-sdk", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "description": "WeChat development of SDK", + "license": "MIT", + "keywords": [ + "wechat-php-sdk" + ], + "require": { + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php new file mode 100644 index 00000000000..c2aa13f9e8f --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php @@ -0,0 +1,17 @@ + '', + 'appid' => '', + 'appsecret' => '', + 'encodingaeskey' => '', +); + +# 加载对应æ“ä½œæŽ¥å£ +$wechat = &\Wechat\Loader::get('User', $config); +$userlist = $wechat->getUserList(); + +var_dump($userlist); +var_dump($wechat->errMsg); +var_dump($wechat->errCode); + +exit; + +// ç¬¬ä¸‰æ–¹å¹³å° JSSDK ç­¾å包 + +$wechat = Db::name('WechatConfig')->where('authorizer_appid', 'wx60a43dd8161666d4')->find(); +// 第三方授æƒèŽ·å–到的 Access_token +$access_token = $wechat['authorizer_access_token']; +// å‚与授æƒçš„å…¬ä¼—å· APPID +$authorizer_appid = $wechat['authorizer_appid']; +// 当å‰å¾®ä¿¡é¡µé¢URL地å€ï¼ˆå®Œæ•´ï¼‰ +$current_url = url('', '', true, true); +// 实例SDK脚本 +$script = load_wechat('Script', $authorizer_appid); +// 获å–JSç­¾å包 +$result = $script->getJsSign($current_url, 0, '', $authorizer_appid, $access_token); +dump($result); +dump([$script->errMsg, $script->errCode]); + +$json = json_encode($result, JSON_PRETTY_PRINT); +echo ''; +echo " + +"; \ No newline at end of file From 9eafc89e549d514dad6af4089b5e8682f8fa52b4 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 15:06:07 +0000 Subject: [PATCH 26/39] Support for PHP 8.0 and 8.1 --- composer.json | 4 ++-- composer.lock | 2 +- upload/system/storage/vendor/composer/installed.json | 4 ++++ upload/system/storage/vendor/composer/installed.php | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index f733d699e96..ca157c4e5bb 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,11 @@ "require": { "php": ">=5.4.0", "scssphp/scssphp": "1.1.1", - "zoujingli/wechat-php-sdk": ">=1.3.10", "react/promise": "^2.9", "twig/twig": "^3.3", "braintree/braintree_php": "^6.7", "cardinity/cardinity-sdk-php": "^3.0", - "divido/divido-php": "^1.15" + "divido/divido-php": "^1.15", + "zoujingli/wechat-php-sdk": "^1.3" } } diff --git a/composer.lock b/composer.lock index bbef3aa7ee8..adf7ef10412 100644 --- a/composer.lock +++ b/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": "c8e6b0df75305d50d4931f63d0fae38a", + "content-hash": "5f7477d996d7712fa2980dcd28c9d064", "packages": [ { "name": "braintree/braintree_php", diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 2bff6627e67..0a269f77bc2 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1786,6 +1786,10 @@ "keywords": [ "wechat-php-sdk" ], + "support": { + "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", + "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" + }, "install-path": "../zoujingli/wechat-php-sdk" } ], diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index ee9b3608178..1d2baf017fd 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '2dc57c04167832cc898a55f9f81753c89147ed76', + 'reference' => 'e6d48c2fd46b357038f5b344af464e85fa50fe4c', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '2dc57c04167832cc898a55f9f81753c89147ed76', + 'reference' => 'e6d48c2fd46b357038f5b344af464e85fa50fe4c', 'dev_requirement' => false, ), 'psr/http-message' => array( From cbbd0687e3c3f3469c83bab092fefda63129bf80 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 15:09:09 +0000 Subject: [PATCH 27/39] Support for PHP 8.0 and 8.1 --- composer.json | 3 +- composer.lock | 43 +- .../storage/vendor/composer/autoload_psr4.php | 1 - .../vendor/composer/autoload_static.php | 8 - .../storage/vendor/composer/installed.json | 44 - .../storage/vendor/composer/installed.php | 13 +- .../zoujingli/wechat-php-sdk/.gitignore | 1 - .../zoujingli/wechat-php-sdk/MIT-LICENSE.txt | 21 - .../vendor/zoujingli/wechat-php-sdk/README.md | 91 -- .../wechat-php-sdk/Wechat/Lib/Cache.php | 146 ---- .../wechat-php-sdk/Wechat/Lib/Common.php | 234 ----- .../wechat-php-sdk/Wechat/Lib/Prpcrypt.php | 196 ----- .../wechat-php-sdk/Wechat/Lib/Tools.php | 308 ------- .../wechat-php-sdk/Wechat/Loader.php | 129 --- .../wechat-php-sdk/Wechat/WechatCard.php | 819 ------------------ .../wechat-php-sdk/Wechat/WechatCustom.php | 385 -------- .../wechat-php-sdk/Wechat/WechatDevice.php | 467 ---------- .../wechat-php-sdk/Wechat/WechatExtends.php | 209 ----- .../wechat-php-sdk/Wechat/WechatHardware.php | 160 ---- .../wechat-php-sdk/Wechat/WechatMedia.php | 430 --------- .../wechat-php-sdk/Wechat/WechatMenu.php | 183 ---- .../wechat-php-sdk/Wechat/WechatMessage.php | 352 -------- .../wechat-php-sdk/Wechat/WechatOauth.php | 138 --- .../wechat-php-sdk/Wechat/WechatPay.php | 620 ------------- .../wechat-php-sdk/Wechat/WechatPoi.php | 193 ----- .../wechat-php-sdk/Wechat/WechatReceive.php | 771 ----------------- .../wechat-php-sdk/Wechat/WechatScript.php | 138 --- .../wechat-php-sdk/Wechat/WechatService.php | 408 --------- .../wechat-php-sdk/Wechat/WechatUser.php | 612 ------------- .../zoujingli/wechat-php-sdk/composer.json | 21 - .../zoujingli/wechat-php-sdk/include.php | 17 - .../vendor/zoujingli/wechat-php-sdk/test.php | 68 -- 32 files changed, 4 insertions(+), 7225 deletions(-) delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php delete mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/test.php diff --git a/composer.json b/composer.json index ca157c4e5bb..bfbfefc2cdf 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ "twig/twig": "^3.3", "braintree/braintree_php": "^6.7", "cardinity/cardinity-sdk-php": "^3.0", - "divido/divido-php": "^1.15", - "zoujingli/wechat-php-sdk": "^1.3" + "divido/divido-php": "^1.15" } } diff --git a/composer.lock b/composer.lock index adf7ef10412..f54b8517f5d 100644 --- a/composer.lock +++ b/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": "5f7477d996d7712fa2980dcd28c9d064", + "content-hash": "c65da74baf4b5b406a807a2768a641e8", "packages": [ { "name": "braintree/braintree_php", @@ -1688,47 +1688,6 @@ } ], "time": "2022-02-04T06:59:48+00:00" - }, - { - "name": "zoujingli/wechat-php-sdk", - "version": "v1.3.18", - "source": { - "type": "git", - "url": "https://github.com/zoujingli/wechat-php-sdk.git", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-libxml": "*", - "ext-simplexml": "*", - "php": ">=5.3.3" - }, - "type": "project", - "autoload": { - "psr-4": { - "Wechat\\": "./Wechat" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "WeChat development of SDK", - "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", - "keywords": [ - "wechat-php-sdk" - ], - "support": { - "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", - "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" - }, - "time": "2019-10-10T09:42:15+00:00" } ], "packages-dev": [], diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index e8e15603fe5..f5b55984841 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -6,7 +6,6 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - 'Wechat\\' => array($vendorDir . '/zoujingli/wechat-php-sdk/Wechat'), 'Twig\\' => array($vendorDir . '/twig/twig/src'), 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index aaed2282f1f..92c051d570b 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -24,10 +24,6 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ); public static $prefixLengthsPsr4 = array ( - 'W' => - array ( - 'Wechat\\' => 7, - ), 'T' => array ( 'Twig\\' => 5, @@ -72,10 +68,6 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ); public static $prefixDirsPsr4 = array ( - 'Wechat\\' => - array ( - 0 => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat', - ), 'Twig\\' => array ( 0 => __DIR__ . '/..' . '/twig/twig/src', diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 0a269f77bc2..2ec88f60ece 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1747,50 +1747,6 @@ } ], "install-path": "../twig/twig" - }, - { - "name": "zoujingli/wechat-php-sdk", - "version": "v1.3.18", - "version_normalized": "1.3.18.0", - "source": { - "type": "git", - "url": "https://github.com/zoujingli/wechat-php-sdk.git", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-libxml": "*", - "ext-simplexml": "*", - "php": ">=5.3.3" - }, - "time": "2019-10-10T09:42:15+00:00", - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Wechat\\": "./Wechat" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "WeChat development of SDK", - "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", - "keywords": [ - "wechat-php-sdk" - ], - "support": { - "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", - "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" - }, - "install-path": "../zoujingli/wechat-php-sdk" } ], "dev": true, diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 1d2baf017fd..c91d7396e79 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => 'e6d48c2fd46b357038f5b344af464e85fa50fe4c', + 'reference' => '9eafc89e549d514dad6af4089b5e8682f8fa52b4', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => 'e6d48c2fd46b357038f5b344af464e85fa50fe4c', + 'reference' => '9eafc89e549d514dad6af4089b5e8682f8fa52b4', 'dev_requirement' => false, ), 'psr/http-message' => array( @@ -232,14 +232,5 @@ 'reference' => '972d8604a92b7054828b539f2febb0211dd5945c', 'dev_requirement' => false, ), - 'zoujingli/wechat-php-sdk' => array( - 'pretty_version' => 'v1.3.18', - 'version' => '1.3.18.0', - 'type' => 'project', - 'install_path' => __DIR__ . '/../zoujingli/wechat-php-sdk', - 'aliases' => array(), - 'reference' => 'd37d0c1919ede2ee54e65100ac3792e947b1e0ef', - 'dev_requirement' => false, - ), ), ); diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore deleted file mode 100644 index 485dee64bcf..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt deleted file mode 100644 index 0624076f028..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2014-2017 Anyon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md deleted file mode 100644 index e1b42e9194d..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md +++ /dev/null @@ -1,91 +0,0 @@ -[![Latest Stable Version](https://poser.pugx.org/zoujingli/wechat-php-sdk/v/stable)](https://packagist.org/packages/zoujingli/wechat-php-sdk) -[![Total Downloads](https://poser.pugx.org/zoujingli/wechat-php-sdk/downloads)](https://packagist.org/packages/zoujingli/wechat-php-sdk) -[![Latest Unstable Version](https://poser.pugx.org/zoujingli/wechat-php-sdk/v/unstable)](https://packagist.org/packages/zoujingli/wechat-php-sdk) -[![License](https://poser.pugx.org/zoujingli/wechat-php-sdk/license)](https://packagist.org/packages/zoujingli/wechat-php-sdk) - -æ­¤`SDK`è¿è¡Œæœ€åº•è¦æ±‚`PHP`版本`5.3`, 建议在`PHP7`上è¿è¡Œä»¥èŽ·å–最佳性能。 - -微信的部分接å£éœ€è¦ç¼“存数æ®åœ¨æœ¬åœ°ï¼Œå› æ­¤å¯¹ç›®å½•éœ€è¦æœ‰å†™æƒé™ã€‚ - -我们鼓励大家使用`composer`æ¥ç®¡ç†æ‚¨çš„第三方库,方便åŽæœŸæ›´æ–°æ“作(尤其是接å£ç±»ï¼‰ã€‚ - -近期`access_token`ç»å¸¸æ— æ•…失效,`SDK`已加入失败状æ€æ£€æµ‹ï¼Œè‡ªåŠ¨é‡æ–°èŽ·å–`access_token`并返回结果. - -æ­¤`SDK`已历ç»æ•°ä¸ªçº¿ä¸Šé¡¹ç›®éªŒè¯ä¸Žè€ƒéªŒï¼Œå¯é æ€§ä¸Žç¨³å®šæ€§æžé«˜ï¼Œæ¬¢è¿Ž`fork`或`star`此项目。 - -## 新微信开å‘工具推è -* 微信æœåŠ¡å·ã€å¾®ä¿¡å°ç¨‹åºã€å¾®ä¿¡æ”¯ä»˜ã€æ”¯ä»˜å®æ”¯ä»˜ -* Gitee 仓库 WeChatDevloper: https://gitee.com/zoujingli/WeChatDeveloper -* Github 仓库 WeChatDeveloper:https://github.com/zoujingli/WeChatDeveloper - -**微信SDKå¼€å‘帮助åŠäº¤æµ** --- -* **在åšå¾®ä¿¡å¼€å‘å‰ï¼Œå¿…需先阅读微信官方文档,此SDK也是基于之上进行的å°è£…。** - -* **文档链接地å€**:http://www.kancloud.cn/zoujingli/wechat-php-sdk - -* **Think.Admin**:https://github.com/zoujingli/Think.Admin - -* **å¼€å‘交æµQQ群:513350915(新)** - -**若对您有帮助,å¯ä»¥èµžåŠ©å¹¶æ”¯æŒä¸‹ä½œè€…哦,谢谢ï¼** --- -![](http://static.thinkadmin.top/pay.png) - - -**官方接å£æ–‡æ¡£é“¾æŽ¥** --- -* 使用å‰éœ€å…ˆæ‰“开微信å¸å·çš„å¼€å‘模å¼ï¼Œè¯¦ç»†æ­¥éª¤è¯·æŸ¥çœ‹å¾®ä¿¡å…¬ä¼—å¹³å°æŽ¥å£ä½¿ç”¨è¯´æ˜Žï¼š -* 微信公众平å°ï¼š http://mp.weixin.qq.com/wiki/ -* 微信ä¼ä¸šå¹³å°ï¼š http://qydev.weixin.qq.com/wiki/ -* 微信开放平å°ï¼šhttps://open.weixin.qq.com/ -* 微信支付接入文档:https://mp.weixin.qq.com/cgi-bin/readtemplate?t=business/course2_tmpl&lang=zh_CN -* 微信商户平å°ï¼šhttps://pay.weixin.qq.com - -**微信`SDK`项目æºæ–‡ä»¶æ‰˜ç®¡** --- -* SDK 为开æºé¡¹ç›®ï¼Œä½ å¯ä»¥æŠŠå®ƒç”¨äºŽä»»ä½•åœ°å€ï¼Œå¹¶ä¸å—任何约æŸï¼Œæ¬¢è¿Ž`fork`项目。 -* 通过 [Github](https://github.com/zoujingli/wechat-php-sdk) 下载 SDK æºä»£ç  -* 通过 [OSChina](http://git.oschina.net/zoujingli/wechat-php-sdk) 下载 SDK æºä»£ç  -* 通过 [Composer](https://getcomposer.org) 包管ç†å·¥å…·ä¸‹è½½ SDK æºä»£ç  - -**微信`SDK`å°è£…对接åŠåŠŸèƒ½** --- -* æŽ¥å…¥éªŒè¯ ï¼ˆåˆçº§æƒé™ï¼‰ -* 自动回å¤ï¼ˆæ–‡æœ¬ã€å›¾ç‰‡ã€è¯­éŸ³ã€è§†é¢‘ã€éŸ³ä¹ã€å›¾æ–‡ï¼‰ (åˆçº§æƒé™ï¼‰ -* èœå•æ“作(查询ã€åˆ›å»ºã€åˆ é™¤ï¼‰ (èœå•æƒé™ï¼‰ -* 客æœæ¶ˆæ¯ï¼ˆæ–‡æœ¬ã€å›¾ç‰‡ã€è¯­éŸ³ã€è§†é¢‘ã€éŸ³ä¹ã€å›¾æ–‡ï¼‰ (认è¯æƒé™ï¼‰ -* 二维ç ï¼ˆåˆ›å»ºä¸´æ—¶ã€æ°¸ä¹…二维ç ï¼ŒèŽ·å–二维ç URL) (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ -* é•¿é“¾æŽ¥è½¬çŸ­é“¾æŽ¥æŽ¥å£ ï¼ˆæœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ -* 标签æ“作(查询ã€åˆ›å»ºã€ä¿®æ”¹ã€ç§»åŠ¨ç”¨æˆ·åˆ°æ ‡ç­¾ï¼‰ (认è¯æƒé™ï¼‰ -* 网页授æƒï¼ˆåŸºæœ¬æŽˆæƒï¼Œç”¨æˆ·ä¿¡æ¯æŽˆæƒï¼‰ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ -* 用户信æ¯ï¼ˆæŸ¥è¯¢ç”¨æˆ·åŸºæœ¬ä¿¡æ¯ã€èŽ·å–关注者列表) (认è¯æƒé™ï¼‰ -* 多客æœåŠŸèƒ½ï¼ˆå®¢æœç®¡ç†ã€èŽ·å–客æœè®°å½•ã€å®¢æœä¼šè¯ç®¡ç†ï¼‰ (认è¯æƒé™ï¼‰ -* 媒体文件(上传ã€èŽ·å–) (认è¯æƒé™ï¼‰ -* é«˜çº§ç¾¤å‘ ï¼ˆè®¤è¯æƒé™ï¼‰ -* 模æ¿æ¶ˆæ¯ï¼ˆè®¾ç½®æ‰€å±žè¡Œä¸šã€æ·»åŠ æ¨¡æ¿ã€å‘é€æ¨¡æ¿æ¶ˆæ¯ï¼‰ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ -* å¡åˆ¸ç®¡ç†ï¼ˆåˆ›å»ºã€ä¿®æ”¹ã€åˆ é™¤ã€å‘放ã€é—¨åº—管ç†ç­‰ï¼‰ (认è¯æƒé™ï¼‰ -* 语义ç†è§£ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ -* 获å–微信æœåŠ¡å™¨IP列表 (åˆçº§æƒé™ï¼‰ -* 微信JSAPI授æƒ(获å–ticketã€èŽ·å–ç­¾å) (åˆçº§æƒé™ï¼‰ -* æ•°æ®ç»Ÿè®¡(用户ã€å›¾æ–‡ã€æ¶ˆæ¯ã€æŽ¥å£åˆ†æžæ•°æ®) (认è¯æƒé™ï¼‰ -* 微信支付(网页支付ã€æ‰«ç æ”¯ä»˜ã€äº¤æ˜“退款ã€ç»™ç²‰ä¸æ‰“款)(认è¯æœåŠ¡å·å¹¶å¼€é€šæ”¯ä»˜åŠŸèƒ½ï¼‰ - -**接å£æƒé™å¤‡æ³¨ï¼š** --- -* åˆçº§æƒé™ï¼šåŸºæœ¬æƒé™ï¼Œä»»ä½•æ­£å¸¸çš„公众å·éƒ½æœ‰æ­¤æƒé™ -* èœå•æƒé™ï¼šæ­£å¸¸çš„æœåŠ¡å·ã€è®¤è¯åŽçš„订阅å·æ‹¥æœ‰æ­¤æƒé™ -* 认è¯æƒé™ï¼šåˆ†ä¸ºè®¢é˜…å·ã€æœåŠ¡å·è®¤è¯ï¼Œå¦‚å‰ç¼€æœåŠ¡å·åˆ™ä»…认è¯çš„æœåŠ¡å·æœ‰æ­¤æƒé™ -* 支付æƒé™ï¼šä»…认è¯åŽçš„æœåŠ¡å·å¯ä»¥ç”³è¯·æ­¤æƒé™ - -**微信开放第三方平å°** --- (案例åŠæ–‡æ¡£æ•´ç†ä¸­ï¼‰ --- -* 公众å·æŽˆæƒæœåŠ¡ -* 公众å·æŽ¨é€æ¶ˆæ¯ä»£å¤„ç† -* 公众å·åŸºç¡€ä¸šåŠ¡ä»£å¤„ç† -* 公众å·æ”¯ä»˜ä»£å‘èµ· - -**微信`SDK`版æƒå£°æ˜Ž** --- -* æ­¤SDK基于`MIT`åè®®å‘布,任何人å¯ä»¥ç”¨åœ¨ä»»ä½•åœ°æ–¹ï¼Œä¸å—çº¦æŸ -* æ­¤SDK部分代ç æ¥è‡ªäº’è”网,若有异议,å¯ä»¥è”系作者进行删除 diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php deleted file mode 100644 index ee10b87e808..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @date 2016-08-20 17:50 - */ -class Cache -{ - - /** - * 缓存ä½ç½® - * @var string - */ - static public $cachepath; - - /** - * 设置缓存 - * @param string $name - * @param string $value - * @param int $expired - * @return mixed - */ - static public function set($name, $value, $expired = 0) - { - if (isset(Loader::$callback['CacheSet'])) { - return call_user_func_array(Loader::$callback['CacheSet'], func_get_args()); - } - $data = serialize(array('value' => $value, 'expired' => $expired > 0 ? time() + $expired : 0)); - return self::check() && file_put_contents(self::$cachepath . $name, $data); - } - - /** - * 读å–缓存 - * @param string $name - * @return mixed - */ - static public function get($name) - { - if (isset(Loader::$callback['CacheGet'])) { - return call_user_func_array(Loader::$callback['CacheGet'], func_get_args()); - } - if (self::check() && ($file = self::$cachepath . $name) && file_exists($file) && ($data = file_get_contents($file)) && !empty($data)) { - $data = unserialize($data); - if (isset($data['expired']) && ($data['expired'] > time() || $data['expired'] === 0)) { - return isset($data['value']) ? $data['value'] : null; - } - } - return null; - } - - /** - * 删除缓存 - * @param string $name - * @return mixed - */ - static public function del($name) - { - if (isset(Loader::$callback['CacheDel'])) { - return call_user_func_array(Loader::$callback['CacheDel'], func_get_args()); - } - return self::check() && @unlink(self::$cachepath . $name); - } - - /** - * 输出内容到日志 - * @param string $line - * @param string $filename - * @return mixed - */ - static public function put($line, $filename = '') - { - if (isset(Loader::$callback['CachePut'])) { - return call_user_func_array(Loader::$callback['CachePut'], func_get_args()); - } - empty($filename) && $filename = date('Ymd') . '.log'; - return self::check() && file_put_contents(self::$cachepath . $filename, '[' . date('Y/m/d H:i:s') . "] {$line}\n", FILE_APPEND); - } - - /** - * 检查缓存目录 - * @return bool - */ - static protected function check() - { - empty(self::$cachepath) && self::$cachepath = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR; - self::$cachepath = rtrim(self::$cachepath, '/\\') . DIRECTORY_SEPARATOR; - if (!is_dir(self::$cachepath) && !mkdir(self::$cachepath, 0755, true)) { - return false; - } - return true; - } - - /** - * 文件缓存,æˆåŠŸè¿”回文件路径 - * @param string $content 文件内容 - * @param string $filename 文件å称 - * @return bool|string - */ - static public function file($content, $filename = '') - { - if (isset(Loader::$callback['CacheFile'])) { - return call_user_func_array(Loader::$callback['CacheFile'], func_get_args()); - } - empty($filename) && $filename = md5($content) . '.' . self::getFileExt($content); - if (self::check() && file_put_contents(self::$cachepath . $filename, $content)) { - return self::$cachepath . $filename; - } - return false; - } - - /** - * æ ¹æ®æ–‡ä»¶æµè¯»å–文件åŽç¼€ - * @param string $content - * @return string - */ - static public function getFileExt($content) - { - $types = array( - 255216 => 'jpg', 7173 => 'gif', 6677 => 'bmp', 13780 => 'png', - 7368 => 'mp3', 4838 => 'wma', 7784 => 'mid', 6063 => 'xml', - ); - $typeInfo = @unpack("C2chars", substr($content, 0, 2)); - $typeCode = intval($typeInfo['chars1'] . $typeInfo['chars2']); - return isset($types[$typeCode]) ? $types[$typeCode] : 'mp4'; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php deleted file mode 100644 index 11df686bdb7..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php +++ /dev/null @@ -1,234 +0,0 @@ - - * @date 2016/05/28 11:55 - */ -class Common -{ - - /** API接å£URL需è¦ä½¿ç”¨æ­¤å‰ç¼€ */ - const API_BASE_URL_PREFIX = 'https://api.weixin.qq.com'; - const API_URL_PREFIX = 'https://api.weixin.qq.com/cgi-bin'; - const GET_TICKET_URL = '/ticket/getticket?'; - const AUTH_URL = '/token?grant_type=client_credential&'; - public $token; - public $encodingAesKey; - public $encrypt_type; - public $appid; - public $appsecret; - public $access_token; - public $postxml; - public $_msg; - public $errCode = 0; - public $errMsg = ""; - public $config = array(); - private $_retry = false; - - /** - * 构造方法 - * @param array $options - */ - public function __construct($options = array()) - { - $config = Loader::config($options); - $this->token = isset($config['token']) ? $config['token'] : ''; - $this->appid = isset($config['appid']) ? $config['appid'] : ''; - $this->appsecret = isset($config['appsecret']) ? $config['appsecret'] : ''; - $this->encodingAesKey = isset($config['encodingaeskey']) ? $config['encodingaeskey'] : ''; - $this->config = $config; - } - - /** - * 当å‰å½“å‰é”™è¯¯ä»£ç  - * @return int - */ - public function getErrorCode() - { - return $this->errCode; - } - - /** - * 获å–当å‰é”™è¯¯å†…容 - * @return string - */ - public function getError() - { - return $this->errMsg; - } - - /** - * 获å–当å‰æ“作公众å·APPID - * @return string - */ - public function getAppid() - { - return $this->appid; - } - - /** - * 获å–SDKé…ç½®å‚æ•° - * @return array - */ - public function getConfig() - { - return $this->config; - } - - - /** - * 接å£éªŒè¯ - * @return bool - */ - public function valid() - { - $encryptStr = ""; - if ($_SERVER['REQUEST_METHOD'] == "POST") { - $postStr = file_get_contents("php://input"); - $disableEntities = libxml_disable_entity_loader(true); - $array = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); - libxml_disable_entity_loader($disableEntities); - $this->encrypt_type = isset($_GET["encrypt_type"]) ? $_GET["encrypt_type"] : ''; - if ($this->encrypt_type == 'aes') { - $encryptStr = $array['Encrypt']; - !class_exists('Prpcrypt', false) && require __DIR__ . '/Prpcrypt.php'; - $pc = new Prpcrypt($this->encodingAesKey); - $array = $pc->decrypt($encryptStr, $this->appid); - if (!isset($array[0]) || intval($array[0]) > 0) { - $this->errCode = $array[0]; - $this->errMsg = $array[1]; - Tools::log("Interface Authentication Failed. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); - return false; - } - $this->postxml = $array[1]; - empty($this->appid) && $this->appid = $array[2]; - } else { - $this->postxml = $postStr; - } - } elseif (isset($_GET["echostr"])) { - if ($this->checkSignature()) { - @ob_clean(); - exit($_GET["echostr"]); - } - return false; - } - if (!$this->checkSignature($encryptStr)) { - $this->errMsg = 'Interface authentication failed, please use the correct method to call.'; - return false; - } - return true; - } - - /** - * 验è¯æ¥è‡ªå¾®ä¿¡æœåŠ¡å™¨ - * @param string $str - * @return bool - */ - private function checkSignature($str = '') - { - $signature = isset($_GET["msg_signature"]) ? $_GET["msg_signature"] : (isset($_GET["signature"]) ? $_GET["signature"] : ''); - $timestamp = isset($_GET["timestamp"]) ? $_GET["timestamp"] : ''; - $nonce = isset($_GET["nonce"]) ? $_GET["nonce"] : ''; - $tmpArr = array($this->token, $timestamp, $nonce, $str); - sort($tmpArr, SORT_STRING); - if (sha1(implode($tmpArr)) == $signature) { - return true; - } - return false; - } - - /** - * 获å–公众å·è®¿é—® access_token - * @param string $appid 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º - * @param string $appsecret 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º - * @param string $token 手动指定access_token,éžå¿…è¦æƒ…况ä¸å»ºè®®ç”¨ - * @return bool|string - */ - public function getAccessToken($appid = '', $appsecret = '', $token = '') - { - if (!$appid || !$appsecret) { - list($appid, $appsecret) = array($this->appid, $this->appsecret); - } - if ($token) { - return $this->access_token = $token; - } - $cache = 'wechat_access_token_' . $appid; - if (($access_token = Tools::getCache($cache)) && !empty($access_token)) { - return $this->access_token = $access_token; - } - # 检测事件注册 - if (isset(Loader::$callback[__FUNCTION__])) { - return $this->access_token = call_user_func_array(Loader::$callback[__FUNCTION__], array(&$this, &$cache)); - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::AUTH_URL . 'appid=' . $appid . '&secret=' . $appsecret); - if ($result) { - $json = json_decode($result, true); - if (!$json || isset($json['errcode'])) { - $this->errCode = $json['errcode']; - $this->errMsg = $json['errmsg']; - Tools::log("Get New AccessToken Error. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); - return false; - } - $this->access_token = $json['access_token']; - Tools::log("Get New AccessToken Success.", "MSG - {$this->appid}"); - Tools::setCache($cache, $this->access_token, 5000); - return $this->access_token; - } - return false; - } - - /** - * 接å£å¤±è´¥é‡è¯• - * @param string $method SDK方法å称 - * @param array $arguments SDK方法å‚æ•° - * @return bool|mixed - */ - protected function checkRetry($method, $arguments = array()) - { - Tools::log("Run {$method} Faild. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); - if (!$this->_retry && in_array($this->errCode, array('40014', '40001', '41001', '42001'))) { - ($this->_retry = true) && $this->resetAuth(); - $this->errCode = 40001; - $this->errMsg = 'no access'; - Tools::log("Retry Run {$method} ...", "MSG - {$this->appid}"); - return call_user_func_array(array($this, $method), $arguments); - } - return false; - } - - /** - * 删除验è¯æ•°æ® - * @param string $appid 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º - * @return bool - */ - public function resetAuth($appid = '') - { - $authname = 'wechat_access_token_' . (empty($appid) ? $this->appid : $appid); - Tools::log("Reset Auth And Remove Old AccessToken.", "MSG - {$this->appid}"); - $this->access_token = ''; - Tools::removeCache($authname); - return true; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php deleted file mode 100644 index 5830ea43a83..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php +++ /dev/null @@ -1,196 +0,0 @@ - PKCS7Encoder::$block_size) { - $pad = 0; - } - return substr($text, 0, (strlen($text) - $pad)); - } - -} - -/** - * 接收和推é€ç»™å…¬ä¼—å¹³å°æ¶ˆæ¯çš„加解密 - * @category WechatSDK - * @subpackage library - * @date 2016/06/28 11:59 - */ -class Prpcrypt -{ - - public $key; - - function __construct($k) - { - $this->key = base64_decode($k . "="); - } - - /** - * 对明文进行加密 - * @param string $text 需è¦åŠ å¯†çš„明文 - * @param string $appid 公众å·APPID - * @return array - */ - public function encrypt($text, $appid) - { - try { - //获得16ä½éšæœºå­—ç¬¦ä¸²ï¼Œå¡«å……åˆ°æ˜Žæ–‡ä¹‹å‰ - $random = $this->getRandomStr();//"aaaabbbbccccdddd"; - $text = $random . pack("N", strlen($text)) . $text . $appid; - $iv = substr($this->key, 0, 16); - $pkc_encoder = new PKCS7Encoder; - $text = $pkc_encoder->encode($text); - $encrypted = openssl_encrypt($text, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); - return array(ErrorCode::$OK, $encrypted); - } catch (Exception $e) { - return array(ErrorCode::$EncryptAESError, null); - } - } - - /** - * 对密文进行解密 - * @param string $encrypted 需è¦è§£å¯†çš„密文 - * @param string $appid 公众å·APPID - * @return array - */ - public function decrypt($encrypted, $appid) - { - try { - $iv = substr($this->key, 0, 16); - $decrypted = openssl_decrypt($encrypted, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); - } catch (Exception $e) { - return array(ErrorCode::$DecryptAESError, null); - } - try { - $pkc_encoder = new PKCS7Encoder; - $result = $pkc_encoder->decode($decrypted); - if (strlen($result) < 16) { - return array(ErrorCode::$DecryptAESError, null); - } - $content = substr($result, 16, strlen($result)); - $len_list = unpack("N", substr($content, 0, 4)); - $xml_len = $len_list[1]; - $xml_content = substr($content, 4, $xml_len); - $from_appid = substr($content, $xml_len + 4); - return array(0, $xml_content, $from_appid); - } catch (Exception $e) { - return array(ErrorCode::$IllegalBuffer, null); - } - - } - - /** - * éšæœºç”Ÿæˆ16ä½å­—符串 - * @return string 生æˆçš„字符串 - */ - function getRandomStr() - { - $str = ""; - $str_pol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; - $max = strlen($str_pol) - 1; - for ($i = 0; $i < 16; $i++) { - $str .= $str_pol[mt_rand(0, $max)]; - } - return $str; - } - -} - -/** - * 仅用作类内部使用 - * ä¸ç”¨äºŽå®˜æ–¹API接å£çš„errCodeç  - * Class ErrorCode - */ -class ErrorCode -{ - - public static $OK = 0; - public static $ValidateSignatureError = 40001; - public static $ParseXmlError = 40002; - public static $ComputeSignatureError = 40003; - public static $IllegalAesKey = 40004; - public static $ValidateAppidError = 40005; - public static $EncryptAESError = 40006; - public static $DecryptAESError = 40007; - public static $IllegalBuffer = 40008; - public static $EncodeBase64Error = 40009; - public static $DecodeBase64Error = 40010; - public static $GenReturnXmlError = 40011; - public static $errCode = array( - '0' => '处ç†æˆåŠŸ', - '40001' => '校验签å失败', - '40002' => '解æžxml失败', - '40003' => '计算签å失败', - '40004' => 'ä¸åˆæ³•çš„AESKey', - '40005' => '校验AppID失败', - '40006' => 'AES加密失败', - '40007' => 'AES解密失败', - '40008' => '公众平å°å‘é€çš„xmlä¸åˆæ³•', - '40009' => 'Base64ç¼–ç å¤±è´¥', - '40010' => 'Base64解ç å¤±è´¥', - '40011' => '公众å¸å·ç”Ÿæˆå›žåŒ…xml失败' - ); - - /** - * 获å–错误消æ¯å†…容 - * @param string $err - * @return bool - */ - public static function getErrText($err) - { - if (isset(self::$errCode[$err])) { - return self::$errCode[$err]; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php deleted file mode 100644 index 6558a8e48da..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php +++ /dev/null @@ -1,308 +0,0 @@ - - * @date 2016/05/28 11:55 - */ -class Tools -{ - - /** - * 判断字符串是å¦ç»è¿‡ç¼–ç æ–¹æ³• - * @param string $str - * @return bool - */ - static public function isBase64($str) - { - if ($str == base64_encode(base64_decode($str))) { - return true; - } else { - return false; - } - } - - /** - * 产生éšæœºå­—符串 - * @param int $length 指定字符长度 - * @param string $str 字符串å‰ç¼€ - * @return string - */ - static public function createNoncestr($length = 32, $str = "") - { - $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; - for ($i = 0; $i < $length; $i++) { - $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); - } - return $str; - } - - /** - * æ•°æ®ç”Ÿæˆç­¾å - * @param array $data ç­¾å数组 - * @param string $method ç­¾å方法 - * @return bool|string ç­¾å值 - */ - static public function getSignature($data, $method = "sha1") - { - if (!function_exists($method)) { - return false; - } - ksort($data); - $params = array(); - foreach ($data as $key => $value) { - $params[] = "{$key}={$value}"; - } - return $method(join('&', $params)); - } - - /** - * 生æˆæ”¯ä»˜ç­¾å - * @param array $option - * @param string $partnerKey - * @return string - */ - static public function getPaySign($option, $partnerKey) - { - ksort($option); - $buff = ''; - foreach ($option as $k => $v) { - $buff .= "{$k}={$v}&"; - } - return strtoupper(md5("{$buff}key={$partnerKey}")); - } - - /** - * XMLç¼–ç  - * @param mixed $data æ•°æ® - * @param string $root 根节点å - * @param string $item 数字索引的å­èŠ‚点å - * @param string $id 数字索引å­èŠ‚点key转æ¢çš„属性å - * @return string - */ - static public function arr2xml($data, $root = 'xml', $item = 'item', $id = 'id') - { - return "<{$root}>" . self::_data_to_xml($data, $item, $id) . ""; - } - - /** - * XMLå†…å®¹ç”Ÿæˆ - * @param array $data æ•°æ® - * @param string $item å­èŠ‚点 - * @param string $id 节点ID - * @param string $content 节点内容 - * @return string - */ - static private function _data_to_xml($data, $item = 'item', $id = 'id', $content = '') - { - foreach ($data as $key => $val) { - is_numeric($key) && $key = "{$item} {$id}=\"{$key}\""; - $content .= "<{$key}>"; - if (is_array($val) || is_object($val)) { - $content .= self::_data_to_xml($val); - } elseif (is_numeric($val)) { - $content .= $val; - } else { - $content .= ''; - } - list($_key, ) = explode(' ', $key . ' '); - $content .= ""; - } - return $content; - } - - /** - * å°†xml转为array - * @param string $xml - * @return array - */ - static public function xml2arr($xml) - { - $disableEntities = libxml_disable_entity_loader(true); - $result = json_decode(Tools::json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); - libxml_disable_entity_loader($disableEntities); - return $result; - } - - /** - * 生æˆå®‰å…¨JSONæ•°æ® - * @param array $array - * @return string - */ - static public function json_encode($array) - { - return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', function ($matches) { - return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE"); - }, json_encode($array)); - } - - /** - * 以getæ–¹å¼æ交请求 - * @param $url - * @return bool|mixed - */ - static public function httpGet($url) - { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($curl, CURLOPT_SSLVERSION, 1); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_TIMEOUT, 30); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); - return (intval($status["http_code"]) === 200) ? $content : false; - } - - /** - * 以postæ–¹å¼æ交请求 - * @param string $url - * @param array|string $data - * @return bool|mixed - */ - static public function httpPost($url, $data) - { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildPost($data)); - list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); - return (intval($status["http_code"]) === 200) ? $content : false; - } - - /** - * 使用è¯ä¹¦ï¼Œä»¥postæ–¹å¼æ交xml到对应的接å£url - * @param string $url POSTæ交的内容 - * @param array $data è¯·æ±‚çš„åœ°å€ - * @param string $ssl_cer è¯ä¹¦Cer路径 | è¯ä¹¦å†…容 - * @param string $ssl_key è¯ä¹¦Key路径 | è¯ä¹¦å†…容 - * @param int $second 设置请求超时时间 - * @return bool|mixed - */ - static public function httpsPost($url, $data, $ssl_cer = null, $ssl_key = null, $second = 30) - { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_TIMEOUT, $second); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - if (!is_null($ssl_cer) && file_exists($ssl_cer) && is_file($ssl_cer)) { - curl_setopt($curl, CURLOPT_SSLCERTTYPE, 'PEM'); - curl_setopt($curl, CURLOPT_SSLCERT, $ssl_cer); - } - if (!is_null($ssl_key) && file_exists($ssl_key) && is_file($ssl_key)) { - curl_setopt($curl, CURLOPT_SSLKEYTYPE, 'PEM'); - curl_setopt($curl, CURLOPT_SSLKEY, $ssl_key); - } - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildPost($data)); - list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); - return (intval($status["http_code"]) === 200) ? $content : false; - } - - /** - * POSTæ•°æ®è¿‡æ»¤å¤„ç† - * @param array $data - * @return array - */ - static private function _buildPost(&$data) - { - if (is_array($data)) { - foreach ($data as &$value) { - if (is_string($value) && $value[0] === '@' && class_exists('CURLFile', false)) { - $filename = realpath(trim($value, '@')); - file_exists($filename) && $value = new CURLFile($filename); - } - } - } - return $data; - } - - /** - * 读å–微信客户端IP - * @return null|string - */ - static public function getAddress() - { - foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP', 'REMOTE_ADDR') as $header) { - if (!isset($_SERVER[$header]) || ($spoof = $_SERVER[$header]) === null) { - continue; - } - sscanf($spoof, '%[^,]', $spoof); - if (!filter_var($spoof, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - $spoof = null; - } else { - return $spoof; - } - } - return '0.0.0.0'; - } - - /** - * 设置缓存,按需é‡è½½ - * @param string $cachename - * @param mixed $value - * @param int $expired - * @return bool - */ - static public function setCache($cachename, $value, $expired = 0) - { - return Cache::set($cachename, $value, $expired); - } - - /** - * 获å–缓存,按需é‡è½½ - * @param string $cachename - * @return mixed - */ - static public function getCache($cachename) - { - return Cache::get($cachename); - } - - /** - * 清除缓存,按需é‡è½½ - * @param string $cachename - * @return bool - */ - static public function removeCache($cachename) - { - return Cache::del($cachename); - } - - /** - * SDK日志处ç†æ–¹æ³• - * @param string $msg 日志行内容 - * @param string $type 日志级别 - */ - static public function log($msg, $type = 'MSG') - { - Cache::put($type . ' - ' . $msg); - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php deleted file mode 100644 index eb2f36f92aa..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php +++ /dev/null @@ -1,129 +0,0 @@ - - * @date 2016/10/26 10:21 - */ -spl_autoload_register(function ($class) { - if (0 === stripos($class, 'Wechat\\')) { - $filename = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; - if (file_exists($filename)) require $filename; - } -}); - -/** - * 微信SDK加载器 - * @author Anyon - * @date 2016-08-21 11:06 - */ -class Loader -{ - - /** - * 事件注册函数 - * @var array - */ - static public $callback = array(); - - /** - * é…ç½®å‚æ•° - * @var array - */ - static protected $config = array(); - - /** - * 对象缓存 - * @var array - */ - static protected $cache = array(); - - /** - * 动æ€æ³¨å†ŒSDK事件处ç†å‡½æ•° - * @param string $event 事件å称(getAccessToken|getJsTicket) - * @param string $method 处ç†æ–¹æ³•ï¼ˆå¯ä»¥æ˜¯æ™®é€šæ–¹æ³•æˆ–者类中的方法) - * @param string|null $class 处ç†å¯¹è±¡ï¼ˆå¯ä»¥ç›´æŽ¥ä½¿ç”¨çš„类实例) - */ - static public function register($event, $method, $class = null) - { - if (!empty($class) && class_exists($class, false) && method_exists($class, $method)) { - self::$callback[$event] = array($class, $method); - } else { - self::$callback[$event] = $method; - } - } - - /** - * 获å–微信SDK接å£å¯¹è±¡(别å函数) - * @param string $type 接å£ç±»åž‹(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi) - * @param array $config SDKé…ç½®(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img) - * @return WechatCard|WechatCustom|WechatDevice|WechatExtends|WechatMedia|WechatMenu|WechatOauth|WechatPay|WechatPoi|WechatReceive|WechatScript|WechatService|WechatUser - */ - static public function get_instance($type, $config = array()) - { - return self::get($type, $config); - } - - /** - * 获å–微信SDK接å£å¯¹è±¡ - * @param string $type 接å£ç±»åž‹(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi) - * @param array $config SDKé…ç½®(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img) - * @return WechatCard|WechatCustom|WechatDevice|WechatExtends|WechatMedia|WechatMenu|WechatOauth|WechatPay|WechatPoi|WechatReceive|WechatScript|WechatService|WechatUser - */ - static public function get($type, $config = array()) - { - $index = md5(strtolower($type) . md5(json_encode(self::$config))); - if (!isset(self::$cache[$index])) { - $basicName = 'Wechat' . ucfirst(strtolower($type)); - $className = "\\Wechat\\{$basicName}"; - // 注册类的无命å空间别å,兼容未带命å空间的è€ç‰ˆæœ¬SDK - !class_exists($basicName, false) && class_alias($className, $basicName); - self::$cache[$index] = new $className(self::config($config)); - } - return self::$cache[$index]; - } - - /** - * 设置é…ç½®å‚æ•° - * @param array $config - * @return array - */ - static public function config($config = array()) - { - !empty($config) && self::$config = array_merge(self::$config, $config); - if (!empty(self::$config['cachepath'])) { - Cache::$cachepath = self::$config['cachepath']; - } - if (empty(self::$config['component_verify_ticket'])) { - self::$config['component_verify_ticket'] = Cache::get('component_verify_ticket'); - } - if (empty(self::$config['token']) && !empty(self::$config['component_token'])) { - self::$config['token'] = self::$config['component_token']; - } - if (empty(self::$config['appsecret']) && !empty(self::$config['component_appsecret'])) { - self::$config['appsecret'] = self::$config['component_appsecret']; - } - if (empty(self::$config['encodingaeskey']) && !empty(self::$config['component_encodingaeskey'])) { - self::$config['encodingaeskey'] = self::$config['component_encodingaeskey']; - } - return self::$config; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php deleted file mode 100644 index b6dd3855854..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php +++ /dev/null @@ -1,819 +0,0 @@ -access_token && !$this->getAccessToken()) { - return false; - } - $appid = empty($appid) ? $this->appid : $appid; - if ($jsapi_ticket) { - return $jsapi_ticket; - } - $authname = 'wechat_jsapi_ticket_wxcard_' . $appid; - if (($jsapi_ticket = Tools::getCache($authname))) { - return $jsapi_ticket; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::GET_TICKET_URL . "access_token={$this->access_token}&type=wx_card"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - $expire = $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600; - Tools::setCache($authname, $json['ticket'], $expire); - return $json['ticket']; - } - return false; - } - - /** - * 生æˆé€‰æ‹©å¡å·JSç­¾å包 - * @param string $cardid å¡åˆ¸Id - * @param string $cardtype å¡åˆ¸ç±»åž‹ - * @param string $shopid 门店Id - * @return array - */ - public function createChooseCardJsPackage($cardid = null, $cardtype = null, $shopid = null) - { - $data = array(); - $data['api_ticket'] = $this->getJsCardTicket(); - $data['app_id'] = $this->appid; - $data['timestamp'] = time(); - $data['nonceStr'] = Tools::createNoncestr(); - !empty($cardid) && $data['cardId'] = $cardid; - !empty($cardtype) && $data['cardType'] = $cardtype; - !empty($shopid) && $data['shopId'] = $shopid; - $data['cardSign'] = $this->getTicketSignature($data); - $data['signType'] = 'SHA1'; - unset($data['api_ticket'], $data['app_id']); - return $data; - } - - /** - * 生æˆæ·»åŠ å¡å·JSç­¾å包 - * @param string|null $cardid å¡å·ID - * @param array $data 其它é™å®šå‚æ•° - * @return array - */ - public function createAddCardJsPackage($cardid = null, $data = array()) - { - $cardList = array(); - if (is_array($cardid)) { - foreach ($cardid as $id) { - $cardList[] = array('cardId' => $id, 'cardExt' => json_encode($this->_cardSign($id, $data))); - } - } else { - $cardList[] = array('cardId' => $cardid, 'cardExt' => json_encode($this->_cardSign($cardid, $data))); - } - return array('cardList' => $cardList); - } - - /** - * å¡åˆ¸æ•°æ®ç­¾å - * @param null|string $cardid - * @param array $attr - * @return array - */ - private function _cardSign($cardid = null, $attr = array()) - { - unset($attr['outer_id']); - $attr['cardId'] = $cardid; - $attr['timestamp'] = time(); - $attr['api_ticket'] = $this->getJsCardTicket(); - $attr['nonce_str'] = Tools::createNoncestr(); - $attr['signature'] = $this->getTicketSignature($attr); - unset($attr['api_ticket']); - return $attr; - } - - /** - * 获å–微信å¡åˆ¸ç­¾å - * @param array $arrdata ç­¾å数组 - * @param string $method ç­¾å方法 - * @return bool|string ç­¾å值 - */ - public function getTicketSignature($arrdata, $method = "sha1") - { - if (!function_exists($method)) { - return false; - } - $newArray = array(); - foreach ($arrdata as $value) { - array_push($newArray, (string)$value); - } - sort($newArray, SORT_STRING); - return $method(implode($newArray)); - } - - /** - * 创建å¡åˆ¸ - * @param array $data å¡åˆ¸æ•°æ® - * @return bool|array 返回数组中card_id为å¡åˆ¸ID - */ - public function createCard($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 更改å¡åˆ¸ä¿¡æ¯ - * 调用该接å£æ›´æ–°ä¿¡æ¯åŽä¼šé‡æ–°é€å®¡ï¼Œå¡åˆ¸çŠ¶æ€å˜æ›´ä¸ºå¾…审核。已被用户领å–çš„å¡åˆ¸ä¼šå®žæ—¶æ›´æ–°ç¥¨é¢ä¿¡æ¯ã€‚ - * @param string $data - * @return bool - */ - public function updateCard($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 删除å¡åˆ¸ - * å…许商户删除任æ„一类å¡åˆ¸ã€‚删除å¡åˆ¸åŽï¼Œè¯¥å¡åˆ¸å¯¹åº”已生æˆçš„领å–用二维ç ã€æ·»åŠ åˆ°å¡åŒ… JS API å‡ä¼šå¤±æ•ˆã€‚ - * 注æ„:删除å¡åˆ¸ä¸èƒ½åˆ é™¤å·²è¢«ç”¨æˆ·é¢†å–,ä¿å­˜åœ¨å¾®ä¿¡å®¢æˆ·ç«¯ä¸­çš„å¡åˆ¸ï¼Œå·²é¢†å–çš„å¡åˆ¸ä¾æ—§æœ‰æ•ˆã€‚ - * @param string $card_id å¡åˆ¸ID - * @return bool - */ - public function delCard($card_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('card_id' => $card_id); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 获å–粉ä¸ä¸‹æ‰€æœ‰å¡å·åˆ—表 - * @param $openid 粉ä¸openid - * @param string $card_id å¡å·ID(å¯ä¸ç»™ï¼‰ - * @return bool|array - */ - public function getCardList($openid, $card_id = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid' => $openid); - !empty($card_id) && $data['card_id'] = $card_id; - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_USER_GET_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–图文消æ¯ç¾¤å‘å¡åˆ¸HTML - * @param string $card_id å¡å·ID - * @return bool|array - */ - public function getCardMpHtml($card_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('card_id' => $card_id); - !empty($card_id) && $data['card_id'] = $card_id; - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_SEND_HTML . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * å¡å·code核查 - * @param string $card_id å¡å·ID - * @param array $code_list å¡å·code列表(一维数组) - * @return bool|array - */ - public function checkCardCodeList($card_id, $code_list) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('card_id' => $card_id, 'code' => $code_list); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CHECKCODE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 查询å¡åˆ¸è¯¦æƒ… - * @param string $card_id å¡å·ID - * @return bool|array - */ - public function getCardInfo($card_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('card_id' => $card_id); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_GET . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–颜色列表 - * 获得å¡åˆ¸çš„最新颜色列表,用于创建å¡åˆ¸ - * @return bool|array - */ - public function getCardColors() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CARD_GETCOLORS . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 生æˆå¡åˆ¸äºŒç»´ç  - * æˆåŠŸåˆ™ç›´æŽ¥è¿”回ticket值,å¯ä»¥ç”¨ getQRUrl($ticket) æ¢å–二维ç url - * @param string $card_id å¡åˆ¸ID å¿…é¡» - * @param string $code 指定å¡åˆ¸ code ç ï¼Œåªèƒ½è¢«é¢†ä¸€æ¬¡ã€‚use_custom_code 字段为 true çš„å¡åˆ¸å¿…须填写,éžè‡ªå®šä¹‰ code ä¸å¿…填写。 - * @param string $openid 指定领å–者的 openid,åªæœ‰è¯¥ç”¨æˆ·èƒ½é¢†å–。bind_openid 字段为 true çš„å¡åˆ¸å¿…须填写,éžè‡ªå®šä¹‰ openid ä¸å¿…填写。 - * @param int $expire_seconds 指定二维ç çš„有效时间,范围是 60 ~ 1800 秒。ä¸å¡«é»˜è®¤ä¸ºæ°¸ä¹…有效。 - * @param bool $is_unique_code 指定下å‘二维ç ï¼Œç”Ÿæˆçš„二维ç éšæœºåˆ†é…一个 code,领å–åŽä¸å¯å†æ¬¡æ‰«æ。填写 true 或 false。默认 false。 - * @param string $balance 红包余é¢ï¼Œä»¥åˆ†ä¸ºå•ä½ã€‚红包类型必填(LUCKY_MONEY),其他å¡åˆ¸ç±»åž‹ä¸å¡«ã€‚ - * @return bool|string - */ - public function createCardQrcode($card_id, $code = '', $openid = '', $expire_seconds = 0, $is_unique_code = false, $balance = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $card = array('card_id' => $card_id); - !empty($code) && $card['code'] = $code; - !empty($openid) && $card['openid'] = $openid; - !empty($is_unique_code) && $card['is_unique_code'] = $is_unique_code; - !empty($balance) && $card['balance'] = $balance; - $data = array('action_name' => "QR_CARD"); - !empty($expire_seconds) && $data['expire_seconds'] = $expire_seconds; - $data['action_info'] = array('card' => $card); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_QRCODE_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 消耗 code - * 自定义 code(use_custom_code 为 true)的优惠券,在 code 被核销时,必须调用此接å£ã€‚ - * @param string $code è¦æ¶ˆè€—çš„åºåˆ—å· - * @param string $card_id è¦æ¶ˆè€—åºåˆ—å·æ‰€è¿°çš„ card_id,创建å¡åˆ¸æ—¶use_custom_code 填写 true 时必填。 - * @return bool|array - * { - * "errcode":0, - * "errmsg":"ok", - * "card":{"card_id":"pFS7Fjg8kV1IdDz01r4SQwMkuCKc"}, - * "openid":"oFS7Fjl0WsZ9AMZqrI80nbIq8xrA" - * } - */ - public function consumeCardCode($code, $card_id = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('code' => $code); - !empty($card_id) && $data['card_id'] = $card_id; - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_CONSUME . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * code è§£ç  - * @param string $encrypt_code 通过 choose_card_info 获å–的加密字符串 - * @return bool|array - * { - * "errcode":0, - * "errmsg":"ok", - * "code":"751234212312" - * } - */ - public function decryptCardCode($encrypt_code) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('encrypt_code' => $encrypt_code,); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_DECRYPT . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 查询 code 的有效性(éžè‡ªå®šä¹‰ code) - * @param string $code - * @return bool|array - * { - * "errcode":0, - * "errmsg":"ok", - * "openid":"oFS7Fjl0WsZ9AMZqrI80nbIq8xrA", //用户 openid - * "card":{ - * "card_id":"pFS7Fjg8kV1IdDz01r4SQwMkuCKc", - * "begin_time": 1404205036, //起始使用时间 - * "end_time": 1404205036, //结æŸæ—¶é—´ - * } - * } - */ - public function checkCardCode($code) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('code' => $code); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_GET . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 批é‡æŸ¥è¯¢å¡åˆ—表 - * @param int $offset 开始拉å–çš„å移,默认为0从头开始 - * @param int $count 需è¦æŸ¥è¯¢çš„å¡ç‰‡çš„æ•°é‡ï¼ˆæ•°é‡æœ€å¤§50,默认50) - * @return bool|array - * { - * "errcode":0, - * "errmsg":"ok", - * "card_id_list":["ph_gmt7cUVrlRk8swPwx7aDyF-pg"], //å¡ id 列表 - * "total_num":1 //该商户å下 card_id 总数 - * } - */ - public function getCardIdList($offset = 0, $count = 50) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $count > 50 && $count = 50; - $data = array('offset' => $offset, 'count' => $count); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_BATCHGET . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 更改 code - * 为确ä¿è½¬èµ åŽçš„安全性,微信å…许自定义code的商户对已下å‘çš„code进行更改。 - * 注:为é¿å…用户疑惑,建议仅在å‘生转赠行为åŽï¼ˆå‘生转赠åŽï¼Œå¾®ä¿¡ä¼šé€šè¿‡äº‹ä»¶æŽ¨é€çš„æ–¹å¼å‘ŠçŸ¥å•†æˆ·è¢«è½¬èµ çš„å¡åˆ¸code)对用户的code进行更改。 - * @param string $code å¡åˆ¸çš„ code ç¼–ç  - * @param string $card_id å¡åˆ¸ ID - * @param string $new_code æ–°çš„å¡åˆ¸ code ç¼–ç  - * @return bool - */ - public function updateCardCode($code, $card_id, $new_code) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('code' => $code, 'card_id' => $card_id, 'new_code' => $new_code); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 设置å¡åˆ¸å¤±æ•ˆ - * 设置å¡åˆ¸å¤±æ•ˆçš„æ“作ä¸å¯é€† - * @param string $code 需è¦è®¾ç½®ä¸ºå¤±æ•ˆçš„ code - * @param string $card_id 自定义 code çš„å¡åˆ¸å¿…填。éžè‡ªå®šä¹‰ code çš„å¡åˆ¸ä¸å¡«ã€‚ - * @return bool - */ - public function unavailableCardCode($code, $card_id = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('code' => $code); - !empty($card_id) && $data['card_id'] = $card_id; - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_UNAVAILABLE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 库存修改 - * @param string $data - * @return bool - */ - public function modifyCardStock($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MODIFY_STOCK . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 更新门票 - * @param string $data - * @return bool - */ - public function updateMeetingCard($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEETINGCARD_UPDATEUSER . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 激活/ç»‘å®šä¼šå‘˜å¡ - * @param string $data 具体结构请å‚看å¡åˆ¸å¼€å‘文档(6.1.1 激活/绑定会员å¡)章节 - * @return bool - */ - public function activateMemberCard($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_ACTIVATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 会员å¡äº¤æ˜“ - * 会员å¡äº¤æ˜“åŽæ¯æ¬¡ç§¯åˆ†åŠä½™é¢å˜æ›´éœ€é€šè¿‡æŽ¥å£é€šçŸ¥å¾®ä¿¡ï¼Œä¾¿äºŽåŽç»­æ¶ˆæ¯é€šçŸ¥åŠå…¶ä»–扩展功能。 - * @param string $data 具体结构请å‚看å¡åˆ¸å¼€å‘文档(6.1.2 会员å¡äº¤æ˜“)章节 - * @return bool|array - */ - public function updateMemberCard($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_UPDATEUSER . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 设置å¡åˆ¸æµ‹è¯•ç™½åå• - * @param array $openid 测试的 openid 列表 - * @param array $user 测试的微信å·åˆ—表 - * @return bool - */ - public function setCardTestWhiteList($openid = array(), $user = array()) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array(); - count($openid) > 0 && $data['openid'] = $openid; - count($user) > 0 && $data['username'] = $user; - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_TESTWHILELIST_SET . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * æ›´æ–°çº¢åŒ…é‡‘é¢ - * @param string $code 红包的åºåˆ—å· - * @param int $balance çº¢åŒ…ä½™é¢ - * @param string $card_id 自定义 code çš„å¡åˆ¸å¿…填。éžè‡ªå®šä¹‰ code å¯ä¸å¡«ã€‚ - * @return bool|array - */ - public function updateLuckyMoney($code, $balance, $card_id = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('code' => $code, 'balance' => $balance); - !empty($card_id) && $data['card_id'] = $card_id; - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_LUCKYMONEY_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * è®¾ç½®è‡ªåŠ©æ ¸é”€æŽ¥å£ - * @param string $card_id å¡åˆ¸ID - * @param bool $is_openid 是å¦å¼€å¯è‡ªåŠ©æ ¸é”€åŠŸèƒ½ï¼Œå¡«true/false,默认为false - * @param bool $need_verify_cod 用户核销时是å¦éœ€è¦è¾“入验è¯ç ï¼Œå¡«true/false,默认为false - * @param bool $need_remark_amount 用户核销时是å¦éœ€è¦å¤‡æ³¨æ ¸é”€é‡‘é¢ï¼Œå¡«true/false,默认为false - * @return bool|array - */ - public function setSelfconsumecell($card_id, $is_openid = false, $need_verify_cod = false, $need_remark_amount = false) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array( - 'card_id' => $card_id, - 'is_open' => $is_openid, - 'need_verify_cod' => $need_verify_cod, - 'need_remark_amount' => $need_remark_amount, - ); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_SET_SELFCONSUMECELL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 设置买å•æŽ¥å£ - * @param string $card_id - * @param bool $is_openid - * @return bool|mixed - */ - public function setPaycell($card_id, $is_openid = true) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('card_id' => $card_id, 'is_open' => $is_openid,); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_PAYCELL_SET . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 设置开å¡å­—段信æ¯æŽ¥å£ - * @param array $data - * @return bool|array - */ - public function setMembercardActivateuserform($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_ACTIVATEUSERFORM_SET . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php deleted file mode 100644 index 76e6ded5b49..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php +++ /dev/null @@ -1,385 +0,0 @@ -access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_RECORD . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–多客æœå®¢æœåŸºæœ¬ä¿¡æ¯ - * - * @return bool|array - */ - public function getCustomServiceKFlist() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_KFLIST . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–多客æœåœ¨çº¿å®¢æœæŽ¥å¾…ä¿¡æ¯ - * - * @return bool|array - */ - public function getCustomServiceOnlineKFlist() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_ONLINEKFLIST . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 创建指定多客æœä¼šè¯ - * @tutorial 当用户已被其他客æœæŽ¥å¾…或指定客æœä¸åœ¨çº¿åˆ™ä¼šå¤±è´¥ - * @param string $openid //用户openid - * @param string $kf_account //客æœè´¦å· - * @param string $text //附加信æ¯ï¼Œæ–‡æœ¬ä¼šå±•ç¤ºåœ¨å®¢æœäººå‘˜çš„多客æœå®¢æˆ·ç«¯ï¼Œå¯ä¸ºç©º - * @return bool|array - */ - public function createKFSession($openid, $kf_account, $text = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array("openid" => $openid, "kf_account" => $kf_account); - $text !== '' && $data["text"] = $text; - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 关闭指定多客æœä¼šè¯ - * @tutorial 当用户被其他客æœæŽ¥å¾…时则会失败 - * @param string $openid //用户openid - * @param string $kf_account //客æœè´¦å· - * @param string $text //附加信æ¯ï¼Œæ–‡æœ¬ä¼šå±•ç¤ºåœ¨å®¢æœäººå‘˜çš„多客æœå®¢æˆ·ç«¯ï¼Œå¯ä¸ºç©º - * @return bool | array //æˆåŠŸè¿”回json数组 - * { - * "errcode": 0, - * "errmsg": "ok", - * } - */ - public function closeKFSession($openid, $kf_account, $text = '') - { - $data = array("openid" => $openid, "kf_account" => $kf_account); - if ($text) { - $data["text"] = $text; - } - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_CLOSE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–用户会è¯çŠ¶æ€ - * @param string $openid //用户openid - * @return bool | array //æˆåŠŸè¿”回json数组 - * { - * "errcode" : 0, - * "errmsg" : "ok", - * "kf_account" : "test1@test", //æ­£åœ¨æŽ¥å¾…çš„å®¢æœ - * "createtime": 123456789, //会è¯æŽ¥å…¥æ—¶é—´ - * } - */ - public function getKFSession($openid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET . "access_token={$this->access_token}" . '&openid=' . $openid); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–èŠå¤©è®°å½• - * @param array $data æ•°æ®ç»“æž„ {"starttime" : 987654321,"endtime" : 987654321,"msgid" : 1,"number" : 10000} - * @return bool|array - */ - public function getCustomMsgList($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SERVICE_GET_MSG_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–指定客æœçš„会è¯åˆ—表 - * @param string $kf_account //用户openid - * @return bool | array //æˆåŠŸè¿”回json数组 - * array( - * 'sessionlist' => array ( - * array ( - * 'openid'=>'OPENID', //客户 openid - * 'createtime'=>123456789, //会è¯åˆ›å»ºæ—¶é—´ï¼ŒUNIX 时间戳 - * ), - * array ( - * 'openid'=>'OPENID', //客户 openid - * 'createtime'=>123456789, //会è¯åˆ›å»ºæ—¶é—´ï¼ŒUNIX 时间戳 - * ), - * ) - * ) - */ - public function getKFSessionlist($kf_account) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET_LIST . "access_token={$this->access_token}" . '&kf_account=' . $kf_account); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–未接入会è¯åˆ—表 - * @return bool|array - */ - public function getKFSessionWait() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET_WAIT . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 添加客æœè´¦å· - * - * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) - * @param string $nickname 客æœæ˜µç§°ï¼Œæœ€é•¿6个汉字或12个英文字符 - * @param string $password 客æœè´¦å·æ˜Žæ–‡ç™»å½•å¯†ç ï¼Œä¼šè‡ªåŠ¨åŠ å¯† - * @return bool|array - */ - public function addKFAccount($account, $nickname, $password) - { - $data = array("kf_account" => $account, "nickname" => $nickname, "password" => md5($password)); - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 修改客æœè´¦å·ä¿¡æ¯ - * - * @param string $account //完整客æœè´¦å·ï¼Œæ ¼å¼ä¸ºï¼šè´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符,必须是英文或者数字字符 - * @param string $nickname //客æœæ˜µç§°ï¼Œæœ€é•¿6个汉字或12个英文字符 - * @param string $password //客æœè´¦å·æ˜Žæ–‡ç™»å½•å¯†ç ï¼Œä¼šè‡ªåŠ¨åŠ å¯† - * @return bool|array - * æˆåŠŸè¿”回结果 - * { - * "errcode": 0, - * "errmsg": "ok", - * } - */ - public function updateKFAccount($account, $nickname, $password) - { - $data = array("kf_account" => $account, "nickname" => $nickname, "password" => md5($password)); - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 删除客æœè´¦å· - * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) - * @return bool|array - */ - public function deleteKFAccount($account) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_DEL_URL . "access_token={$this->access_token}" . '&kf_account=' . $account); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 上传客æœå¤´åƒ - * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) - * @param string $imgfile 头åƒæ–‡ä»¶å®Œæ•´è·¯å¾„,如:'D:\user.jpg'。头åƒæ–‡ä»¶å¿…é¡»JPGæ ¼å¼ï¼Œåƒç´ å»ºè®®640*640 - * @return bool|array - */ - public function setKFHeadImg($account, $imgfile) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_UPLOAD_HEADIMG_URL . "access_token={$this->access_token}&kf_account={$account}", array('media' => '@' . $imgfile)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php deleted file mode 100644 index 932321ac2b6..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php +++ /dev/null @@ -1,467 +0,0 @@ - - * @date 2016-08-22 10:35 - */ -class WechatDevice extends Common -{ - - const SHAKEAROUND_DEVICE_APPLYID = '/shakearound/device/applyid?'; //申请设备ID - const SHAKEAROUND_DEVICE_APPLYSTATUS = '/shakearound/device/applystatus?'; //查询设备IDç”³è¯·å®¡æ ¸çŠ¶æ€ - const SHAKEAROUND_DEVICE_UPDATE = '/shakearound/device/update?'; //ç¼–è¾‘è®¾å¤‡ä¿¡æ¯ - const SHAKEAROUND_DEVICE_SEARCH = '/shakearound/device/search?'; //查询设备列表 - const SHAKEAROUND_DEVICE_BINDLOCATION = '/shakearound/device/bindlocation?'; //é…置设备与门店ID的关系 - const SHAKEAROUND_DEVICE_BINDPAGE = '/shakearound/device/bindpage?'; //é…置设备与页é¢çš„绑定关系 - const SHAKEAROUND_MATERIAL_ADD = '/shakearound/material/add?'; //上传摇一摇图片素æ - const SHAKEAROUND_PAGE_ADD = '/shakearound/page/add?'; //å¢žåŠ é¡µé¢ - const SHAKEAROUND_PAGE_UPDATE = '/shakearound/page/update?'; //ç¼–è¾‘é¡µé¢ - const SHAKEAROUND_PAGE_SEARCH = '/shakearound/page/search?'; //查询页é¢åˆ—表 - const SHAKEAROUND_PAGE_DELETE = '/shakearound/page/delete?'; //åˆ é™¤é¡µé¢ - const SHAKEAROUND_USER_GETSHAKEINFO = '/shakearound/user/getshakeinfo?'; //获å–摇周边的设备åŠç”¨æˆ·ä¿¡æ¯ - const SHAKEAROUND_STATISTICS_DEVICE = '/shakearound/statistics/device?'; //以设备为维度的数æ®ç»Ÿè®¡æŽ¥å£ - const SHAKEAROUND_STATISTICS_PAGE = '/shakearound/statistics/page?'; //以页é¢ä¸ºç»´åº¦çš„æ•°æ®ç»Ÿè®¡æŽ¥å£ - - - /** - * 申请设备ID - * @param array $data - * @return bool|array - */ - public function applyShakeAroundDevice($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_APPLYID . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 查询设备IDç”³è¯·å®¡æ ¸çŠ¶æ€ - * @param int $apply_id - * @return bool|array - */ - public function applyStatusShakeAroundDevice($apply_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array("apply_id" => $apply_id); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_APPLYSTATUS . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * ç¼–è¾‘è®¾å¤‡ä¿¡æ¯ - * @param array $data - * @return bool - */ - public function updateShakeAroundDevice($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - - /** - * 查询设备列表 - * @param $data - * @return bool|array - */ - public function searchShakeAroundDevice($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_SEARCH . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * é…置设备与门店的关è”关系 - * @param string $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,则å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼Œè‹¥äºŒè€…都填,则以设备编å·ä¸ºä¼˜å…ˆ - * @param int $poi_id å¾…å…³è”的门店ID - * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæ•´ï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–å·ï¼Œåˆ™å¯ä¸å¡«æ­¤ä¿¡æ¯ - * @param int $major - * @param int $minor - * @return bool|array - */ - public function bindLocationShakeAroundDevice($device_id, $poi_id, $uuid = '', $major = 0, $minor = 0) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - if (!$device_id) { - if (!$uuid || !$major || !$minor) { - return false; - } - $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); - } else { - $device_identifier = array('device_id' => $device_id); - } - $data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * é…置设备与其他公众账å·é—¨åº—çš„å…³è”关系 - * @param type $device_identifier è®¾å¤‡ä¿¡æ¯ - * @param type $poi_id å¾…å…³è”的门店ID - * @param type $poi_appid 目标微信appid - * @return boolean - */ - public function bindLocationOtherShakeAroundDevice($device_identifier, $poi_id, $poi_appid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id, "type" => 2, "poi_appid" => $poi_appid); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * é…置设备与页é¢çš„å…³è”关系 - * @param string $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,则å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼Œè‹¥äºŒè€…都填,则以设备编å·ä¸ºä¼˜å…ˆ - * @param array $page_ids å¾…å…³è”的页é¢åˆ—表 - * @param int $bind å…³è”æ“作标志ä½ï¼Œ 0 为解除关è”关系,1 为建立关è”关系 - * @param int $append 新增æ“作标志ä½ï¼Œ 0 为覆盖,1 为新增 - * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæ•´ï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–å·ï¼Œåˆ™å¯ä¸å¡«æ­¤ä¿¡æ¯ - * @param int $major - * @param int $minor - * @return bool|array - */ - public function bindPageShakeAroundDevice($device_id, $page_ids = array(), $bind = 1, $append = 1, $uuid = '', $major = 0, $minor = 0) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - if (!$device_id) { - if (!$uuid || !$major || !$minor) { - return false; - } - $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); - } else { - $device_identifier = array('device_id' => $device_id); - } - $data = array('device_identifier' => $device_identifier, 'page_ids' => $page_ids, 'bind' => $bind, 'append' => $append); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDPAGE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * 上传在摇一摇页é¢å±•ç¤ºçš„图片素æ - * @param array $data {"media":'@Path\filename.jpg'} - * @return bool|array - */ - public function uploadShakeAroundMedia($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_MATERIAL_ADD . "access_token={$this->access_token}", $data); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * 增加摇一摇出æ¥çš„页é¢ä¿¡æ¯ - * @param string $title 在摇一摇页é¢å±•ç¤ºçš„主标题,ä¸è¶…过6 个字 - * @param string $description 在摇一摇页é¢å±•ç¤ºçš„副标题,ä¸è¶…过7 个字 - * @param string $icon_url 在摇一摇页é¢å±•ç¤ºçš„图片, æ ¼å¼é™å®šä¸ºï¼šjpg,jpeg,png,gif; 建议120*120 , é™åˆ¶ä¸è¶…过200*200 - * @param string $page_url 跳转链接 - * @param string $comment 页é¢çš„备注信æ¯ï¼Œä¸è¶…过15 个字,å¯ä¸å¡« - * @return bool|array - */ - public function addShakeAroundPage($title, $description, $icon_url, $page_url, $comment = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array("title" => $title, "description" => $description, "icon_url" => $icon_url, "page_url" => $page_url, "comment" => $comment); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_ADD . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * 编辑摇一摇出æ¥çš„页é¢ä¿¡æ¯ - * @param int $page_id - * @param string $title 在摇一摇页é¢å±•ç¤ºçš„主标题,ä¸è¶…过6 个字 - * @param string $description 在摇一摇页é¢å±•ç¤ºçš„副标题,ä¸è¶…过7 个字 - * @param string $icon_url 在摇一摇页é¢å±•ç¤ºçš„图片, æ ¼å¼é™å®šä¸ºï¼šjpg,jpeg,png,gif; 建议120*120 , é™åˆ¶ä¸è¶…过200*200 - * @param string $page_url 跳转链接 - * @param string $comment 页é¢çš„备注信æ¯ï¼Œä¸è¶…过15 个字,å¯ä¸å¡« - * @return bool|array - */ - public function updateShakeAroundPage($page_id, $title, $description, $icon_url, $page_url, $comment = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array("page_id" => $page_id, "title" => $title, "description" => $description, "icon_url" => $icon_url, "page_url" => $page_url, "comment" => $comment); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * æŸ¥è¯¢å·²æœ‰çš„é¡µé¢ - * @param array $page_ids - * @param int $begin - * @param int $count - * @return bool|mixed - */ - public function searchShakeAroundPage($page_ids = array(), $begin = 0, $count = 1) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - if (!empty($page_ids)) { - $data = array('page_ids' => $page_ids); - } else { - $data = array('begin' => $begin, 'count' => $count); - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_SEARCH . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * åˆ é™¤å·²æœ‰çš„é¡µé¢ - * @param array $page_ids - * @return bool|array - */ - public function deleteShakeAroundPage($page_ids = array()) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('page_ids' => $page_ids); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * 获å–è®¾å¤‡ä¿¡æ¯ - * @param string $ticket 摇周边业务的ticket(å¯åœ¨æ‘‡åˆ°çš„URL中得到,ticket生效时间为30 分钟) - * @return bool|array - */ - public function getShakeInfoShakeAroundUser($ticket) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('ticket' => $ticket); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_USER_GETSHAKEINFO . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * 以设备为维度的数æ®ç»Ÿè®¡æŽ¥å£ - * @param int $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,å³å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼ŒäºŒè€…选其一 - * @param int $begin_date 起始日期时间戳,最长时间跨度为30 天 - * @param int $end_date 结æŸæ—¥æœŸæ—¶é—´æˆ³ï¼Œæœ€é•¿æ—¶é—´è·¨åº¦ä¸º30 天 - * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæˆï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–辑,å³å¯ä¸å¡«æ­¤ä¿¡æ¯ï¼ŒäºŒè€…选其一 - * @param int $major - * @param int $minor - * @return bool|array - */ - public function deviceShakeAroundStatistics($device_id, $begin_date, $end_date, $uuid = '', $major = 0, $minor = 0) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - if (!$device_id) { - if (!$uuid || !$major || !$minor) { - return false; - } - $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); - } else { - $device_identifier = array('device_id' => $device_id); - } - $data = array('device_identifier' => $device_identifier, 'begin_date' => $begin_date, 'end_date' => $end_date); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_STATISTICS_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - /** - * 以页é¢ä¸ºç»´åº¦çš„æ•°æ®ç»Ÿè®¡æŽ¥å£ - * @param int $page_id 指定页é¢çš„ID - * @param int $begin_date 起始日期时间戳,最长时间跨度为30 天 - * @param int $end_date 结æŸæ—¥æœŸæ—¶é—´æˆ³ï¼Œæœ€é•¿æ—¶é—´è·¨åº¦ä¸º30 天 - * @return bool|array - */ - public function pageShakeAroundStatistics($page_id, $begin_date, $end_date) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('page_id' => $page_id, 'begin_date' => $begin_date, 'end_date' => $end_date); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_STATISTICS_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php deleted file mode 100644 index f03c15b79e0..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php +++ /dev/null @@ -1,209 +0,0 @@ - - * @date 2016-08-22 10:32 - */ -class WechatExtends extends Common -{ - - const QR_LIMIT_SCENE = 1; - - /** 语义ç†è§£ */ - const SEMANTIC_API_URL = '/semantic/semproxy/search?'; - const QRCODE_IMG_URL = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='; - const QRCODE_CREATE_URL = '/qrcode/create?'; - const SHORT_URL = '/shorturl?'; - const QR_SCENE = 0; - - /** æ•°æ®åˆ†æžæŽ¥å£ */ - static $DATACUBE_URL_ARR = array(//ç”¨æˆ·åˆ†æž - 'user' => array( - 'summary' => '/datacube/getusersummary?', //获å–用户增å‡æ•°æ®ï¼ˆgetusersummary) - 'cumulate' => '/datacube/getusercumulate?', //获å–累计用户数æ®ï¼ˆgetusercumulate) - ), - 'article' => array(//å›¾æ–‡åˆ†æž - 'summary' => '/datacube/getarticlesummary?', //获å–图文群å‘æ¯æ—¥æ•°æ®ï¼ˆgetarticlesummary) - 'total' => '/datacube/getarticletotal?', //获å–图文群å‘总数æ®ï¼ˆgetarticletotal) - 'read' => '/datacube/getuserread?', //获å–图文统计数æ®ï¼ˆgetuserread) - 'readhour' => '/datacube/getuserreadhour?', //获å–图文统计分时数æ®ï¼ˆgetuserreadhour) - 'share' => '/datacube/getusershare?', //获å–图文分享转å‘æ•°æ®ï¼ˆgetusershare) - 'sharehour' => '/datacube/getusersharehour?', //获å–图文分享转å‘分时数æ®ï¼ˆgetusersharehour) - ), - 'upstreammsg' => array(//消æ¯åˆ†æž - 'summary' => '/datacube/getupstreammsg?', //获å–消æ¯å‘é€æ¦‚况数æ®ï¼ˆgetupstreammsg) - 'hour' => '/datacube/getupstreammsghour?', //获å–消æ¯åˆ†é€åˆ†æ—¶æ•°æ®ï¼ˆgetupstreammsghour) - 'week' => '/datacube/getupstreammsgweek?', //获å–消æ¯å‘é€å‘¨æ•°æ®ï¼ˆgetupstreammsgweek) - 'month' => '/datacube/getupstreammsgmonth?', //获å–消æ¯å‘é€æœˆæ•°æ®ï¼ˆgetupstreammsgmonth) - 'dist' => '/datacube/getupstreammsgdist?', //获å–消æ¯å‘é€åˆ†å¸ƒæ•°æ®ï¼ˆgetupstreammsgdist) - 'distweek' => '/datacube/getupstreammsgdistweek?', //获å–消æ¯å‘é€åˆ†å¸ƒå‘¨æ•°æ®ï¼ˆgetupstreammsgdistweek) - 'distmonth' => '/datacube/getupstreammsgdistmonth?', //获å–消æ¯å‘é€åˆ†å¸ƒæœˆæ•°æ®ï¼ˆgetupstreammsgdistmonth) - ), - 'interface' => array(//接å£åˆ†æž - 'summary' => '/datacube/getinterfacesummary?', //获å–接å£åˆ†æžæ•°æ®ï¼ˆgetinterfacesummary) - 'summaryhour' => '/datacube/getinterfacesummaryhour?', //获å–接å£åˆ†æžåˆ†æ—¶æ•°æ®ï¼ˆgetinterfacesummaryhour) - ) - ); - - /** - * 获å–二维ç å›¾ç‰‡ - * @param string $ticket 传入由getQRCode方法生æˆçš„ticketå‚æ•° - * @return string url 返回httpåœ°å€ - */ - public function getQRUrl($ticket) - { - return self::QRCODE_IMG_URL . urlencode($ticket); - } - - /** - * é•¿é“¾æŽ¥è½¬çŸ­é“¾æŽ¥æŽ¥å£ - * @param string $long_url ä¼ å…¥è¦è½¬æ¢çš„é•¿url - * @return bool|string url æˆåŠŸåˆ™è¿”回转æ¢åŽçš„短url - */ - public function getShortUrl($long_url) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('action' => 'long2short', 'long_url' => $long_url); - $result = Tools::httpPost(self::API_URL_PREFIX . self::SHORT_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json['short_url']; - } - return false; - } - - /** - * 创建二维ç ticket - * @param int|string $scene_id 自定义追踪id,临时二维ç åªèƒ½ç”¨æ•°å€¼åž‹ - * @param int $type 0:临时二维ç ï¼›1:永久二维ç (此时expireå‚数无效)ï¼›2:永久二维ç (此时expireå‚数无效) - * @param int $expire 临时二维ç æœ‰æ•ˆæœŸï¼Œæœ€å¤§ä¸º2592000秒(30天) - * @return bool|array ('ticket'=>'qrcode字串','expire_seconds'=>2592000,'url'=>'二维ç å›¾ç‰‡è§£æžåŽçš„地å€') - */ - public function getQRCode($scene_id, $type = 0, $expire = 2592000) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $type = ($type && is_string($scene_id)) ? 2 : $type; - $data = array( - 'action_name' => $type ? ($type == 2 ? "QR_LIMIT_STR_SCENE" : "QR_LIMIT_SCENE") : "QR_SCENE", - 'expire_seconds' => $expire, - 'action_info' => array('scene' => ($type == 2 ? array('scene_str' => $scene_id) : array('scene_id' => $scene_id))) - ); - if ($type == 1) { - unset($data['expire_seconds']); - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::QRCODE_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 语义ç†è§£æŽ¥å£ - * @param string $uid 用户唯一id(éžå¼€å‘者id),用户区分公众å·ä¸‹çš„ä¸åŒç”¨æˆ·ï¼ˆå»ºè®®å¡«å…¥ç”¨æˆ·openid) - * @param string $query 输入文本串 - * @param string $category 需è¦ä½¿ç”¨çš„æœåŠ¡ç±»åž‹ï¼Œå¤šä¸ªç”¨â€œï¼Œâ€éš”开,ä¸èƒ½ä¸ºç©º - * @param float $latitude 纬度å标,与ç»åº¦åŒæ—¶ä¼ å…¥ï¼›ä¸ŽåŸŽå¸‚二选一传入 - * @param float $longitude ç»åº¦å标,与纬度åŒæ—¶ä¼ å…¥ï¼›ä¸ŽåŸŽå¸‚二选一传入 - * @param string $city 城市å称,与ç»çº¬åº¦äºŒé€‰ä¸€ä¼ å…¥ - * @param string $region 区域å称,在城市存在的情况下å¯çœç•¥ï¼›ä¸Žç»çº¬åº¦äºŒé€‰ä¸€ä¼ å…¥ - * @return bool|array - */ - public function querySemantic($uid, $query, $category, $latitude = 0.00, $longitude = 0.00, $city = "", $region = "") - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array( - 'query' => $query, - 'category' => $category, - 'appid' => $this->appid, - 'uid' => '' - ); - //地ç†å标或城市å称二选一 - if ($latitude) { - $data['latitude'] = $latitude; - $data['longitude'] = $longitude; - } elseif ($city) { - $data['city'] = $city; - } elseif ($region) { - $data['region'] = $region; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SEMANTIC_API_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–ç»Ÿè®¡æ•°æ® - * @param string $type æ•°æ®åˆ†ç±»(user|article|upstreammsg|interface)分别为(用户分æž|图文分æž|消æ¯åˆ†æž|接å£åˆ†æž) - * @param string $subtype æ•°æ®å­åˆ†ç±»ï¼Œå‚考 DATACUBE_URL_ARR 常é‡å®šä¹‰éƒ¨åˆ† 或者README.md说明文档 - * @param string $begin_date 开始时间 - * @param string $end_date 结æŸæ—¶é—´ - * @return bool|array æˆåŠŸè¿”回查询结果数组,其定义请看官方文档 - */ - public function getDatacube($type, $subtype, $begin_date, $end_date = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - if (!isset(self::$DATACUBE_URL_ARR[$type]) || !isset(self::$DATACUBE_URL_ARR[$type][$subtype])) { - return false; - } - $data = array('begin_date' => $begin_date, 'end_date' => $end_date ? $end_date : $begin_date); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::$DATACUBE_URL_ARR[$type][$subtype] . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return isset($json['list']) ? $json['list'] : $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php deleted file mode 100644 index c01114b9186..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php +++ /dev/null @@ -1,160 +0,0 @@ -access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_COMPEL_UNBINDHTTPS . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - - public function transmsg($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_TRANSMSG . "access_token={$this->access_token}", Tools::json_encode($data)); - //dump($result); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - public function getQrcode($product_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::DEVICE_GETQRCODE . "access_token={$this->access_token}&product_id=$product_id"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * è®¾å¤‡æŽˆæƒ - * @param $data - * @return bool|mixed - */ - public function deviceAuthorize($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_AUTHORIZE_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–è®¾å¤‡äºŒç»´ç  - * @param $data - * @return bool|mixed - */ - public function getDeviceQrcode($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_CREATE_QRCODE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–è®¾å¤‡çŠ¶æ€ - * @param $device_id - * @return bool|mixed - */ - public function getDeviceStat($device_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::DEVICE_GET_STAT . "access_token={$this->access_token}&device_id=$device_id"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php deleted file mode 100644 index 320817973d7..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php +++ /dev/null @@ -1,430 +0,0 @@ - - * @date 2016/10/26 14:47 - */ -class WechatMedia extends Common -{ - - const MEDIA_UPLOAD_URL = '/media/upload?'; - const MEDIA_UPLOADIMG_URL = '/media/uploadimg?'; - const MEDIA_GET_URL = '/media/get?'; - const MEDIA_VIDEO_UPLOAD = '/media/uploadvideo?'; - const MEDIA_FOREVER_UPLOAD_URL = '/material/add_material?'; - const MEDIA_FOREVER_NEWS_UPLOAD_URL = '/material/add_news?'; - const MEDIA_FOREVER_NEWS_UPDATE_URL = '/material/update_news?'; - const MEDIA_FOREVER_GET_URL = '/material/get_material?'; - const MEDIA_FOREVER_DEL_URL = '/material/del_material?'; - const MEDIA_FOREVER_COUNT_URL = '/material/get_materialcount?'; - const MEDIA_FOREVER_BATCHGET_URL = '/material/batchget_material?'; - const MEDIA_UPLOADNEWS_URL = '/media/uploadnews?'; - - /** - * 上传临时素æ,有效期为3天(认è¯åŽçš„订阅å·å¯ç”¨) - * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 - * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ - * 注æ„:临时素æçš„media_id是å¯å¤ç”¨çš„ï¼ - * @param array $data {"media":'@Path\filename.jpg'} - * @param string $type 类型:图片:image 语音:voice 视频:video 缩略图:thumb - * @return bool|array - */ - public function uploadMedia($data, $type) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - if (Tools::isBase64($data['media'])) { - $cache_file = Cache::file(base64_decode($data['media'])); - $data['media'] = "@{$cache_file}"; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); - !empty($cache_file) && @unlink($cache_file); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–临时素æ(认è¯åŽçš„订阅å·å¯ç”¨) - * @param string $media_id 媒体文件id - * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ - * @return bool|array - */ - public function getMedia($media_id, $is_video = false) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::MEDIA_GET_URL . "access_token={$this->access_token}" . '&media_id=' . $media_id); - if ($result) { - if (is_string($result)) { - $json = json_decode($result, true); - if (isset($json['errcode'])) { - $this->errCode = $json['errcode']; - $this->errMsg = $json['errmsg']; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - } - return $result; - } - return false; - } - - /** - * 获å–临时素æ(认è¯åŽçš„订阅å·å¯ç”¨) 包å«è¿”回的httpå¤´ä¿¡æ¯ - * @param string $media_id 媒体文件id - * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ - * @return bool|array - */ - public function getMediaWithHttpInfo($media_id, $is_video = false) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $url_prefix = $is_video ? str_replace('https', 'http', self::API_URL_PREFIX) : self::API_URL_PREFIX; - $url = $url_prefix . self::MEDIA_GET_URL . "access_token={$this->access_token}" . '&media_id=' . $media_id; - $oCurl = curl_init(); - if (stripos($url, "https://") !== false) { - curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); - } - curl_setopt($oCurl, CURLOPT_URL, $url); - curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); - $sContent = curl_exec($oCurl); - $aStatus = curl_getinfo($oCurl); - $result = array(); - if (intval($aStatus["http_code"]) !== 200) { - return false; - } - if ($sContent) { - if (is_string($sContent)) { - $json = json_decode($sContent, true); - if (isset($json['errcode'])) { - $this->errCode = $json['errcode']; - $this->errMsg = $json['errmsg']; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - } - $result['content'] = $sContent; - $result['info'] = $aStatus; - return $result; - } - return false; - } - - /** - * 上传图片,本接å£æ‰€ä¸Šä¼ çš„图片ä¸å ç”¨å…¬ä¼—å·çš„ç´ æ库中图片数é‡çš„5000个的é™åˆ¶ã€‚图片仅支æŒjpg/pngæ ¼å¼ï¼Œå¤§å°å¿…须在1MB以下。 (认è¯åŽçš„订阅å·å¯ç”¨) - * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 - * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ - * @param array $data {"media":'@Path\filename.jpg'} - * @return bool|array - */ - public function uploadImg($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - if (Tools::isBase64($data['media'])) { - $cache_file = Cache::file(base64_decode($data['media'])); - $data['media'] = "@{$cache_file}"; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOADIMG_URL . "access_token={$this->access_token}", $data); - !empty($cache_file) && @unlink($cache_file); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 上传永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) - * 新增的永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 - * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 - * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ - * @param array $data {"media":'@Path\filename.jpg'}, 支æŒbase64æ ¼å¼ - * @param string $type 类型:图片:image 语音:voice 视频:video 缩略图:thumb - * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ - * @param array $video_info 视频信æ¯æ•°ç»„,éžè§†é¢‘ç´ æä¸éœ€è¦æä¾› array('title'=>'视频标题','introduction'=>'æè¿°') - * @return bool|array - */ - public function uploadForeverMedia($data, $type, $is_video = false, $video_info = array()) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $is_video && ($data['description'] = Tools::json_encode($video_info)); - if (Tools::isBase64($data['media'])) { - $cache_file = Cache::file(base64_decode($data['media'])); - $data['media'] = "@{$cache_file}"; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); - !empty($cache_file) && @unlink($cache_file); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 上传永久图文素æ(认è¯åŽçš„订阅å·å¯ç”¨) - * 新增的永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 - * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} - * @return bool|array - */ - public function uploadForeverArticles($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_NEWS_UPLOAD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 修改永久图文素æ(认è¯åŽçš„订阅å·å¯ç”¨) - * 永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 - * @param string $media_id 图文素æid - * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} - * @param int $index 更新的文章在图文素æçš„ä½ç½®ï¼Œç¬¬ä¸€ç¯‡ä¸º0,仅多图文使用 - * @return bool|array - */ - public function updateForeverArticles($media_id, $data, $index = 0) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - !isset($data['index']) && $data['index'] = $index; - !isset($data['media_id']) && $data['media_id'] = $media_id; - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_NEWS_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) - * 返回图文消æ¯æ•°ç»„或二进制数æ®ï¼Œå¤±è´¥è¿”回false - * @param string $media_id 媒体文件id - * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ - * @return bool|array - */ - public function getForeverMedia($media_id, $is_video = false) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('media_id' => $media_id); - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_GET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - if (is_string($result) && ($json = json_decode($result, true))) { - if (isset($json['errcode'])) { - $this->errCode = $json['errcode']; - $this->errMsg = $json['errmsg']; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return $result; - } - return false; - } - - /** - * 删除永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) - * @param string $media_id 媒体文件id - * @return bool - */ - public function delForeverMedia($media_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('media_id' => $media_id); - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 获å–永久素æ列表(认è¯åŽçš„订阅å·å¯ç”¨) - * @param string $type ç´ æ的类型,图片(image)ã€è§†é¢‘(video)ã€è¯­éŸ³ (voice)ã€å›¾æ–‡ï¼ˆnews) - * @param int $offset 全部素æçš„å移ä½ç½®ï¼Œ0表示从第一个素æ - * @param int $count 返回素æçš„æ•°é‡ï¼Œå–值在1到20之间 - * @return bool|array - * 返回数组格å¼: - * array( - * 'total_count'=>0, //该类型的素æ的总数 - * 'item_count'=>0, //本次调用获å–çš„ç´ æçš„æ•°é‡ - * 'item'=>array() //ç´ æ列表数组,内容定义请å‚考官方文档 - * ) - */ - public function getForeverList($type, $offset, $count) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('type' => $type, 'offset' => $offset, 'count' => $count); - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_BATCHGET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–永久素æ总数(认è¯åŽçš„订阅å·å¯ç”¨) - * @return bool|array - * 返回数组格å¼: - * array( - * 'voice_count'=>0, //è¯­éŸ³æ€»æ•°é‡ - * 'video_count'=>0, //è§†é¢‘æ€»æ•°é‡ - * 'image_count'=>0, //å›¾ç‰‡æ€»æ•°é‡ - * 'news_count'=>0 //å›¾æ–‡æ€»æ•°é‡ - * ) - */ - public function getForeverCount() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::MEDIA_FOREVER_COUNT_URL . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 上传图文消æ¯ç´ æ,用于群å‘(认è¯åŽçš„订阅å·å¯ç”¨) - * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} - * @return bool|array - */ - public function uploadArticles($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOADNEWS_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 上传视频素æ(认è¯åŽçš„订阅å·å¯ç”¨) - * @param array $data 消æ¯ç»“æž„ - * { - * "media_id"=>"", //通过上传媒体接å£å¾—到的MediaId - * "title"=>"TITLE", //视频标题 - * "description"=>"Description" //视频æè¿° - * } - * @return bool|array - * { - * "type":"video", - * "media_id":"mediaid", - * "created_at":1398848981 - * } - */ - public function uploadMpVideo($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_VIDEO_UPLOAD . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php deleted file mode 100644 index 0e7ab9b185d..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php +++ /dev/null @@ -1,183 +0,0 @@ - - * @date 2016/06/28 11:52 - */ -class WechatMenu extends Common -{ - - /** 创建自定义èœå• */ - const MENU_ADD_URL = '/menu/create?'; - /* 获å–自定义èœå• */ - const MENU_GET_URL = '/menu/get?'; - /* 删除自定义èœå• */ - const MENU_DEL_URL = '/menu/delete?'; - - /** 添加个性èœå• */ - const COND_MENU_ADD_URL = '/menu/addconditional?'; - /* 删除个性èœå• */ - const COND_MENU_DEL_URL = '/menu/delconditional?'; - /* 测试个性èœå• */ - const COND_MENU_TRY_URL = '/menu/trymatch?'; - - /** - * 创建自定义èœå• - * @param array $data èœå•æ•°ç»„æ•°æ® - * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN 文档 - * @return bool - */ - public function createMenu($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::MENU_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 获å–所有èœå• - * @return bool|array - */ - public function getMenu() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::MENU_GET_URL . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 删除所有èœå• - * @return bool - */ - public function deleteMenu() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::MENU_DEL_URL . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 创建个性èœå• - * @param array $data èœå•æ•°ç»„æ•°æ® - * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN 文档 - * @return bool|string - */ - public function createCondMenu($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json['menuid']; - } - return false; - } - - /** - * 删除个性èœå• - * @param string $menuid èœå•ID - * @return bool - */ - public function deleteCondMenu($menuid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('menuid' => $menuid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 测试并返回个性化èœå• - * @param string $openid 粉ä¸openid - * @return bool - */ - public function tryCondMenu($openid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('user_id' => $openid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_TRY_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php deleted file mode 100644 index 3b716856442..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php +++ /dev/null @@ -1,352 +0,0 @@ - - * @date 2016/06/28 11:29 - */ -class WechatMessage extends Common -{ - - /** - * 获å–模æ¿åˆ—表 - * @return bool|array - */ - public function getAllPrivateTemplate() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . "/template/get_all_private_template?access_token={$this->access_token}", []); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–è®¾ç½®çš„è¡Œä¸šä¿¡æ¯ - * @return bool|array - */ - public function getTMIndustry() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . "/template/get_industry?access_token={$this->access_token}", []); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 删除模æ¿æ¶ˆæ¯ - * @param string $tpl_id - * @return bool - */ - public function delPrivateTemplate($tpl_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('template_id' => $tpl_id); - $result = Tools::httpPost(self::API_URL_PREFIX . "/template/del_private_template?access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 模æ¿æ¶ˆæ¯ 设置所属行业 - * @param string $id1 公众å·æ¨¡æ¿æ¶ˆæ¯æ‰€å±žè¡Œä¸šç¼–å·ï¼Œå‚看官方开å‘文档 è¡Œä¸šä»£ç  - * @param string $id2 åŒ$id1。但如果åªæœ‰ä¸€ä¸ªè¡Œä¸šï¼Œæ­¤å‚æ•°å¯çœç•¥ - * @return bool|mixed - */ - public function setTMIndustry($id1, $id2 = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array(); - !empty($id1) && $data['industry_id1'] = $id1; - !empty($id2) && $data['industry_id2'] = $id2; - $json = Tools::json_encode($data); - $result = Tools::httpPost(self::API_URL_PREFIX . "/template/api_set_industry?access_token={$this->access_token}", $json); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 模æ¿æ¶ˆæ¯ 添加消æ¯æ¨¡æ¿ - * æˆåŠŸè¿”回消æ¯æ¨¡æ¿çš„调用id - * @param string $tpl_id 模æ¿åº“中模æ¿çš„ç¼–å·ï¼Œæœ‰â€œTM**â€å’Œâ€œOPENTMTM**â€ç­‰å½¢å¼ - * @return bool|string - */ - public function addTemplateMessage($tpl_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = Tools::json_encode(array('template_id_short' => $tpl_id)); - $result = Tools::httpPost(self::API_URL_PREFIX . "/template/api_add_template?access_token={$this->access_token}", $data); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json['template_id']; - } - return false; - } - - /** - * å‘é€æ¨¡æ¿æ¶ˆæ¯ - * @param array $data 消æ¯ç»“æž„ - * { - * "touser":"OPENID", - * "template_id":"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY", - * "url":"http://weixin.qq.com/download", - * "topcolor":"#FF0000", - * "data":{ - * "å‚æ•°å1": { - * "value":"å‚æ•°", - * "color":"#173177" //å‚数颜色 - * }, - * "Date":{ - * "value":"06月07æ—¥ 19æ—¶24分", - * "color":"#173177" - * }, - * "CardNumber":{ - * "value":"0426", - * "color":"#173177" - * }, - * "Type":{ - * "value":"消费", - * "color":"#173177" - * } - * } - * } - * @return bool|array - */ - public function sendTemplateMessage($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . "/message/template/send?access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * æ ¹æ®æ ‡ç­¾è¿›è¡Œç¾¤å‘ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) - * @param array $data 消æ¯ç»“æž„ - * 注æ„: 视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ - * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 - * @return bool|array - * { - * "touser"=>array( - * "OPENID1", - * "OPENID2" - * ), - * "msgtype"=>"mpvideo", - * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 - * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") - * // text => array ( "content" => "hello") - * } - */ - public function sendMassMessage($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/send?access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * æ ¹æ®æ ‡ç­¾è¿›è¡Œç¾¤å‘ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) - * @param array $data 消æ¯ç»“æž„ - * 注æ„:视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ - * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 - * @return bool|array - * { - * "filter"=>array( - * "is_to_all"=>False, //是å¦ç¾¤å‘给所有用户.Trueä¸ç”¨åˆ†ç»„id,False需填写分组id - * "group_id"=>"2" //群å‘的分组id - * ), - * "msgtype"=>"mpvideo", - * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 - * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") - * // text => array ( "content" => "hello") - * } - */ - public function sendGroupMassMessage($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/sendall?access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 删除群å‘å›¾æ–‡æ¶ˆæ¯ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) - * @param string $msg_id 消æ¯ID - * @return bool - */ - public function deleteMassMessage($msg_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = Tools::json_encode(array('msg_id' => $msg_id)); - $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/delete?access_token={$this->access_token}", $data); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * 预览群å‘æ¶ˆæ¯ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) - * @param array $data - * 注æ„: 视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ - * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 - * @消æ¯ç»“æž„ - * { - * "touser"=>"OPENID", - * "msgtype"=>"mpvideo", - * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 - * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") - * // text => array ( "content" => "hello") - * } - * @return bool|array - */ - public function previewMassMessage($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/preview?access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 查询群å‘消æ¯å‘é€çŠ¶æ€ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) - * @param string $msg_id 消æ¯ID - * @return bool|array - * { - * "msg_id":201053012, //群å‘消æ¯åŽè¿”回的消æ¯id - * "msg_status":"SEND_SUCCESS", //消æ¯å‘é€åŽçš„状æ€ï¼ŒSENDING表示正在å‘é€ SEND_SUCCESS表示å‘é€æˆåŠŸ - * } - */ - public function queryMassMessage($msg_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = Tools::json_encode(array('msg_id' => $msg_id)); - $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/get?access_token={$this->access_token}", $data); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php deleted file mode 100644 index 8d99fed9aa7..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php +++ /dev/null @@ -1,138 +0,0 @@ -appid}&redirect_uri={$redirect_uri}&response_type=code&scope={$scope}&state={$state}#wechat_redirect"; - } - - /** - * 通过 code èŽ·å– AccessToken å’Œ openid - * @return bool|array - */ - public function getOauthAccessToken() - { - $code = isset($_GET['code']) ? $_GET['code'] : ''; - if (empty($code)) { - Tools::log("getOauthAccessToken Fail, Because there is no access to the code value in get.", "MSG - {$this->appid}"); - return false; - } - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_TOKEN_URL . "appid={$this->appid}&secret={$this->appsecret}&code={$code}&grant_type=authorization_code"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - Tools::log("WechatOauth::getOauthAccessToken Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); - return false; - } - return $json; - } - return false; - } - - /** - * 刷新access token并续期 - * @param string $refresh_token - * @return bool|array - */ - public function getOauthRefreshToken($refresh_token) - { - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_REFRESH_URL . "appid={$this->appid}&grant_type=refresh_token&refresh_token={$refresh_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - Tools::log("WechatOauth::getOauthRefreshToken Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); - return false; - } - return $json; - } - return false; - } - - /** - * 获å–授æƒåŽçš„用户资料 - * @param string $access_token - * @param string $openid - * @return bool|array {openid,nickname,sex,province,city,country,headimgurl,privilege,[unionid]} - * 注æ„:unionid字段 åªæœ‰åœ¨ç”¨æˆ·å°†å…¬ä¼—å·ç»‘定到微信开放平å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 - */ - public function getOauthUserInfo($access_token, $openid) - { - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_USERINFO_URL . "access_token={$access_token}&openid={$openid}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - Tools::log("WechatOauth::getOauthUserInfo Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); - return false; - } - return $json; - } - return false; - } - - /** - * 检验授æƒå‡­è¯æ˜¯å¦æœ‰æ•ˆ - * @param string $access_token - * @param string $openid - * @return bool 是å¦æœ‰æ•ˆ - */ - public function getOauthAuth($access_token, $openid) - { - $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_AUTH_URL . "access_token={$access_token}&openid={$openid}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - Tools::log("WechatOauth::getOauthAuth Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); - return false; - } elseif (intval($json['errcode']) === 0) { - return true; - } - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php deleted file mode 100644 index 0ca602d9e8c..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php +++ /dev/null @@ -1,620 +0,0 @@ - - * @date 2015/05/13 12:12:00 - */ -class WechatPay -{ - - /** 支付接å£åŸºç¡€åœ°å€ */ - const MCH_BASE_URL = 'https://api.mch.weixin.qq.com'; - - /** 公众å·appid */ - public $appid; - - /** 公众å·é…ç½® */ - public $config; - - /** 商户身份ID */ - public $mch_id; - - /** 商户支付密钥Key */ - public $partnerKey; - - /** è¯ä¹¦è·¯å¾„ */ - public $ssl_cer; - public $ssl_key; - - /** 执行错误消æ¯åŠä»£ç  */ - public $errMsg; - public $errCode; - - /** - * WechatPay constructor. - * @param array $options - */ - public function __construct($options = array()) - { - $this->config = Loader::config($options); - $this->appid = isset($this->config['appid']) ? $this->config['appid'] : ''; - $this->mch_id = isset($this->config['mch_id']) ? $this->config['mch_id'] : ''; - $this->partnerKey = isset($this->config['partnerkey']) ? $this->config['partnerkey'] : ''; - $this->ssl_cer = isset($this->config['ssl_cer']) ? $this->config['ssl_cer'] : ''; - $this->ssl_key = isset($this->config['ssl_key']) ? $this->config['ssl_key'] : ''; - } - - /** - * 获å–当å‰é”™è¯¯å†…容 - * @return string - */ - public function getError() - { - return $this->errMsg; - } - - /** - * 当å‰å½“å‰é”™è¯¯ä»£ç  - * @return int - */ - public function getErrorCode() - { - return $this->errCode; - } - - /** - * 获å–当å‰æ“作公众å·APPID - * @return string - */ - public function getAppid() - { - return $this->appid; - } - - /** - * 获å–SDKé…ç½®å‚æ•° - * @return array - */ - public function getConfig() - { - return $this->config; - } - - /** - * 设置标é…的请求å‚数,生æˆç­¾å,生æˆæŽ¥å£å‚æ•°xml - * @param array $data - * @return string - */ - protected function createXml($data) - { - if (!isset($data['wxappid']) && !isset($data['mch_appid']) && !isset($data['appid'])) { - $data['appid'] = $this->appid; - } - if (!isset($data['mchid']) && !isset($data['mch_id'])) { - $data['mch_id'] = $this->mch_id; - } - isset($data['nonce_str']) || $data['nonce_str'] = Tools::createNoncestr(); - $data["sign"] = Tools::getPaySign($data, $this->partnerKey); - return Tools::arr2xml($data); - } - - /** - * POSTæ交XML - * @param array $data - * @param string $url - * @return mixed - */ - public function postXml($data, $url) - { - return Tools::httpPost($url, $this->createXml($data)); - } - - /** - * 使用è¯ä¹¦post请求XML - * @param array $data - * @param string $url - * @return mixed - */ - function postXmlSSL($data, $url) - { - return Tools::httpsPost($url, $this->createXml($data), $this->ssl_cer, $this->ssl_key); - } - - /** - * POSTæ交获å–Array结果 - * @param array $data 需è¦æäº¤çš„æ•°æ® - * @param string $url - * @param string $method - * @return array - */ - public function getArrayResult($data, $url, $method = 'postXml') - { - return Tools::xml2arr($this->$method($data, $url)); - } - - /** - * 解æžè¿”回的结果 - * @param array $result - * @return bool|array - */ - protected function _parseResult($result) - { - if (empty($result)) { - $this->errCode = 'result error'; - $this->errMsg = '解æžè¿”回结果失败'; - return false; - } - if ($result['return_code'] !== 'SUCCESS') { - $this->errCode = $result['return_code']; - $this->errMsg = $result['return_msg']; - return false; - } - if (isset($result['err_code']) && $result['err_code'] !== 'SUCCESS') { - $this->errMsg = $result['err_code_des']; - $this->errCode = $result['err_code']; - return false; - } - return $result; - } - - /** - * 创建刷å¡æ”¯ä»˜å‚数包 - * @param string $auth_code 授æƒCodeå· - * @param string $out_trade_no 商户订å•å· - * @param int $total_fee 支付费用 - * @param string $body 订å•æ ‡è¯† - * @param null $goods_tag 商å“标签 - * @return array|bool - */ - public function createMicroPay($auth_code, $out_trade_no, $total_fee, $body, $goods_tag = null) - { - $data = array( - "appid" => $this->appid, - "mch_id" => $this->mch_id, - "body" => $body, - "out_trade_no" => $out_trade_no, - "total_fee" => $total_fee, - "auth_code" => $auth_code, - "spbill_create_ip" => Tools::getAddress(), - ); - empty($goods_tag) || $data['goods_tag'] = $goods_tag; - $json = Tools::xml2arr($this->postXml($data, self::MCH_BASE_URL . '/pay/micropay')); - if (!empty($json) && false === $this->_parseResult($json)) { - return false; - } - return $json; - } - - /** - * 支付通知验è¯å¤„ç† - * @return bool|array - */ - public function getNotify() - { - $disableEntities = libxml_disable_entity_loader(true); - $notifyInfo = (array)simplexml_load_string(file_get_contents("php://input"), 'SimpleXMLElement', LIBXML_NOCDATA); - libxml_disable_entity_loader($disableEntities); - if (empty($notifyInfo)) { - Tools::log('Payment notification forbidden access.', "ERR - {$this->appid}"); - $this->errCode = '404'; - $this->errMsg = 'Payment notification forbidden access.'; - return false; - } - if (empty($notifyInfo['sign'])) { - Tools::log('Payment notification signature is missing.' . var_export($notifyInfo, true), "ERR - {$this->appid}"); - $this->errCode = '403'; - $this->errMsg = 'Payment notification signature is missing.'; - return false; - } - $data = $notifyInfo; - unset($data['sign']); - if ($notifyInfo['sign'] !== Tools::getPaySign($data, $this->partnerKey)) { - Tools::log('Payment notification signature verification failed.' . var_export($notifyInfo, true), "ERR - {$this->appid}"); - $this->errCode = '403'; - $this->errMsg = 'Payment signature verification failed.'; - return false; - } - Tools::log('Payment notification signature verification success.' . var_export($notifyInfo, true), "MSG - {$this->appid}"); - $this->errCode = '0'; - $this->errMsg = ''; - return $notifyInfo; - } - - - /** - * 支付XMLç»Ÿä¸€å›žå¤ - * @param array $data 需è¦å›žå¤çš„XML内容数组 - * @param bool $isReturn 是å¦è¿”回XML内容,默认ä¸è¿”回 - * @return string - */ - public function replyXml(array $data, $isReturn = false) - { - $xml = Tools::arr2xml($data); - if ($isReturn) { - return $xml; - } - ob_clean(); - exit($xml); - } - - /** - * 获å–预支付ID - * @param string $openid 用户openid,JSAPIå¿…å¡« - * @param string $body 商å“标题 - * @param string $out_trade_no 第三方订å•å· - * @param int $total_fee 订å•æ€»ä»· - * @param string $notify_url 支付æˆåŠŸå›žè°ƒåœ°å€ - * @param string $trade_type 支付类型JSAPI|NATIVE|APP - * @param string $goods_tag 商å“标记,代金券或立å‡ä¼˜æƒ åŠŸèƒ½çš„å‚æ•° - * @param string $fee_type 交易å¸ç§ - * @param null $no_credit 是å¦ç¦æ­¢ä¿¡ç”¨ - * @return bool|string - */ - public function getPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $trade_type = "JSAPI", $goods_tag = null, $fee_type = 'CNY', $no_credit = null) - { - $postdata = array( - "body" => $body, - "out_trade_no" => $out_trade_no, - "fee_type" => $fee_type, - "total_fee" => $total_fee, - "notify_url" => $notify_url, - "trade_type" => $trade_type, - "spbill_create_ip" => Tools::getAddress(), - ); - empty($openid) || $postdata['openid'] = $openid; - empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; - is_null($no_credit) || $postdata['no_credit'] = $no_credit; - $result = $this->getArrayResult($postdata, self::MCH_BASE_URL . '/pay/unifiedorder'); - if (false === $this->_parseResult($result)) { - return false; - } - return in_array($trade_type, array('JSAPI', 'APP')) ? $result['prepay_id'] : ($trade_type === 'MWEB' ? $result['mweb_url'] : $result['code_url']); - } - - /** - * 获å–二维ç é¢„支付ID - * @param string $openid 用户openid,JSAPIå¿…å¡« - * @param string $body 商å“标题 - * @param string $out_trade_no 第三方订å•å· - * @param int $total_fee 订å•æ€»ä»· - * @param string $notify_url 支付æˆåŠŸå›žè°ƒåœ°å€ - * @param string $goods_tag 商å“标记,代金券或立å‡ä¼˜æƒ åŠŸèƒ½çš„å‚æ•° - * @param string $fee_type 交易å¸ç§ - * @return bool|string - */ - public function getQrcPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $goods_tag = null, $fee_type = 'CNY') - { - $postdata = array( - "body" => $body, - "out_trade_no" => $out_trade_no, - "fee_type" => $fee_type, - "total_fee" => $total_fee, - "notify_url" => $notify_url, - "trade_type" => 'NATIVE', - "spbill_create_ip" => Tools::getAddress(), - ); - empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; - empty($openid) || $postdata['openid'] = $openid; - $result = $this->getArrayResult($postdata, self::MCH_BASE_URL . '/pay/unifiedorder'); - if (false === $this->_parseResult($result) || empty($result['prepay_id'])) { - return false; - } - return $result['prepay_id']; - } - - /** - * 获å–æ”¯ä»˜è§„äºŒç»´ç  - * @param string $product_id 商户定义的商å“id 或者订å•å· - * @return string - */ - public function getQrcPayUrl($product_id) - { - $data = array( - 'appid' => $this->appid, - 'mch_id' => $this->mch_id, - 'time_stamp' => (string)time(), - 'nonce_str' => Tools::createNoncestr(), - 'product_id' => (string)$product_id, - ); - $data['sign'] = Tools::getPaySign($data, $this->partnerKey); - return "weixin://wxpay/bizpayurl?" . http_build_query($data); - } - - - /** - * 创建JSAPI支付å‚数包 - * @param string $prepay_id - * @return array - */ - public function createMchPay($prepay_id) - { - $option = array(); - $option["appId"] = $this->appid; - $option["timeStamp"] = (string)time(); - $option["nonceStr"] = Tools::createNoncestr(); - $option["package"] = "prepay_id={$prepay_id}"; - $option["signType"] = "MD5"; - $option["paySign"] = Tools::getPaySign($option, $this->partnerKey); - $option['timestamp'] = $option['timeStamp']; - return $option; - } - - /** - * å…³é—­è®¢å• - * @param string $out_trade_no - * @return bool - */ - public function closeOrder($out_trade_no) - { - $data = array('out_trade_no' => $out_trade_no); - $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/closeorder'); - if (false === $this->_parseResult($result)) { - return false; - } - return ($result['return_code'] === 'SUCCESS'); - } - - /** - * 查询订å•è¯¦æƒ… - * @param $out_trade_no - * @return bool|array - */ - public function queryOrder($out_trade_no) - { - $data = array('out_trade_no' => $out_trade_no); - $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/orderquery'); - if (false === $this->_parseResult($result)) { - return false; - } - return $result; - } - - /** - * 订å•é€€æ¬¾æŽ¥å£ - * @param string $out_trade_no 商户订å•å· - * @param string $transaction_id 微信订å•å·ï¼Œä¸Ž out_refund_no 二选一(ä¸é€‰æ—¶ä¼ 0或false) - * @param string $out_refund_no 商户退款订å•å·ï¼Œä¸Ž transaction_id 二选一(ä¸é€‰æ—¶ä¼ 0或false) - * @param int $total_fee 商户订å•æ€»é‡‘é¢ - * @param int $refund_fee 退款金é¢ï¼Œä¸å¯å¤§äºŽè®¢å•æ€»é‡‘é¢ - * @param int|null $op_user_id æ“作员ID,默认商户ID - * @param string $refund_account 退款资金æ¥æº - * 仅针对è€èµ„金æµå•†æˆ·ä½¿ç”¨ - * REFUND_SOURCE_UNSETTLED_FUNDS --- 未结算资金退款(默认使用未结算资金退款) - * REFUND_SOURCE_RECHARGE_FUNDS --- å¯ç”¨ä½™é¢é€€æ¬¾ - * @param string $refund_desc 退款原因 - * @param string $refund_fee_type 退款货å¸ç§ç±» - * @return bool - */ - public function refund($out_trade_no, $transaction_id, $out_refund_no, $total_fee, $refund_fee, $op_user_id = null, $refund_account = '', $refund_desc = '', $refund_fee_type = 'CNY') - { - $data = array(); - $data['out_trade_no'] = $out_trade_no; - $data['total_fee'] = $total_fee; - $data['refund_fee'] = $refund_fee; - $data['refund_fee_type'] = $refund_fee_type; - $data['op_user_id'] = empty($op_user_id) ? $this->mch_id : $op_user_id; - !empty($out_refund_no) && $data['out_refund_no'] = $out_refund_no; - !empty($transaction_id) && $data['transaction_id'] = $transaction_id; - !empty($refund_account) && $data['refund_account'] = $refund_account; - !empty($refund_desc) && $data['refund_desc'] = $refund_desc; - $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/secapi/pay/refund', 'postXmlSSL'); - if (false === $this->_parseResult($result)) { - return false; - } - return ($result['return_code'] === 'SUCCESS'); - } - - /** - * é€€æ¬¾æŸ¥è¯¢æŽ¥å£ - * @param string $out_trade_no - * @return bool|array - */ - public function refundQuery($out_trade_no) - { - $data = array(); - $data['out_trade_no'] = $out_trade_no; - $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/refundquery'); - if (false === $this->_parseResult($result)) { - return false; - } - return $result; - } - - /** - * 获å–å¯¹è´¦å• - * @param string $bill_date è´¦å•æ—¥æœŸï¼Œå¦‚ 20141110 - * @param string $bill_type ALL|SUCCESS|REFUND|REVOKED - * @return bool|array - */ - public function getBill($bill_date, $bill_type = 'ALL') - { - $data = array(); - $data['bill_date'] = $bill_date; - $data['bill_type'] = $bill_type; - $result = $this->postXml($data, self::MCH_BASE_URL . '/pay/downloadbill'); - $json = Tools::xml2arr($result); - if (!empty($json) && false === $this->_parseResult($json)) { - return false; - } - return $json; - } - - /** - * å‘é€çŽ°é‡‘红包 - * @param string $openid 红包接收者OPENID - * @param int $total_amount çº¢åŒ…æ€»é‡‘é¢ - * @param string $mch_billno 商户订å•å· - * @param string $sendname 商户å称 - * @param string $wishing 红包ç¥ç¦è¯­ - * @param string $act_name 活动å称 - * @param string $remark å¤‡æ³¨ä¿¡æ¯ - * @param null|int $total_num 红包å‘放总人数(大于1为裂å˜çº¢åŒ…) - * @param null|string $scene_id 场景id - * @param string $risk_info æ´»åŠ¨ä¿¡æ¯ - * @param null|string $consume_mch_id 资金授æƒå•†æˆ·å· - * @return array|bool - * @link https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_5 - */ - public function sendRedPack($openid, $total_amount, $mch_billno, $sendname, $wishing, $act_name, $remark, $total_num = 1, $scene_id = null, $risk_info = '', $consume_mch_id = null) - { - $data = array(); - $data['mch_billno'] = $mch_billno; // 商户订å•å· mch_id+yyyymmdd+10ä½ä¸€å¤©å†…ä¸èƒ½é‡å¤çš„æ•°å­— - $data['wxappid'] = $this->appid; - $data['send_name'] = $sendname; //商户å称 - $data['re_openid'] = $openid; //红包接收者 - $data['total_amount'] = $total_amount; //çº¢åŒ…æ€»é‡‘é¢ - $data['total_num'] = '1'; //å‘æ”¾äººæ•°æ® - $data['wishing'] = $wishing; //红包ç¥ç¦è¯­ - $data['client_ip'] = Tools::getAddress(); //调用接å£çš„机器Ipåœ°å€ - $data['act_name'] = $act_name; //活动å称 - $data['remark'] = $remark; //å¤‡æ³¨ä¿¡æ¯ - $data['total_num'] = $total_num; - !empty($scene_id) && $data['scene_id'] = $scene_id; - !empty($risk_info) && $data['risk_info'] = $risk_info; - !empty($consume_mch_id) && $data['consume_mch_id'] = $consume_mch_id; - if ($total_num > 1) { - $data['amt_type'] = 'ALL_RAND'; - $api = self::MCH_BASE_URL . '/mmpaymkttransfers/sendgroupredpack'; - } else { - $api = self::MCH_BASE_URL . '/mmpaymkttransfers/sendredpack'; - } - $result = $this->postXmlSSL($data, $api); - $json = Tools::xml2arr($result); - if (!empty($json) && false === $this->_parseResult($json)) { - return false; - } - return $json; - } - - - /** - * 现金红包状æ€æŸ¥è¯¢ - * @param string $billno - * @return bool|array - * @link https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_7&index=6 - */ - public function queryRedPack($billno) - { - $data['mch_billno'] = $billno; - $data['bill_type'] = 'MCHT'; - $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/gethbinfo'); - $json = Tools::xml2arr($result); - if (!empty($json) && false === $this->_parseResult($json)) { - return false; - } - return $json; - } - - /** - * ä¼ä¸šä»˜æ¬¾ - * @param string $openid 红包接收者OPENID - * @param int $amount çº¢åŒ…æ€»é‡‘é¢ - * @param string $billno 商户订å•å· - * @param string $desc å¤‡æ³¨ä¿¡æ¯ - * @return bool|array - * @link https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2 - */ - public function transfers($openid, $amount, $billno, $desc) - { - $data = array(); - $data['mchid'] = $this->mch_id; - $data['mch_appid'] = $this->appid; - $data['partner_trade_no'] = $billno; - $data['openid'] = $openid; - $data['amount'] = $amount; - $data['check_name'] = 'NO_CHECK'; #ä¸éªŒè¯å§“å - $data['spbill_create_ip'] = Tools::getAddress(); //调用接å£çš„机器Ipåœ°å€ - $data['desc'] = $desc; //å¤‡æ³¨ä¿¡æ¯ - $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/promotion/transfers'); - $json = Tools::xml2arr($result); - if (!empty($json) && false === $this->_parseResult($json)) { - return false; - } - return $json; - } - - /** - * ä¼ä¸šä»˜æ¬¾æŸ¥è¯¢ - * @param string $billno - * @return bool|array - * @link https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_3 - */ - public function queryTransfers($billno) - { - $data['appid'] = $this->appid; - $data['mch_id'] = $this->mch_id; - $data['partner_trade_no'] = $billno; - $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/gettransferinfo'); - $json = Tools::xml2arr($result); - if (!empty($json) && false === $this->_parseResult($json)) { - return false; - } - return $json; - } - - /** - * 二维ç é“¾æŽ¥è½¬æˆçŸ­é“¾æŽ¥ - * @param string $url 需è¦å¤„ç†çš„长链接 - * @return bool|string - */ - public function shortUrl($url) - { - $data = array(); - $data['long_url'] = $url; - $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/tools/shorturl'); - if (!$result || $result['return_code'] !== 'SUCCESS') { - $this->errCode = $result['return_code']; - $this->errMsg = $result['return_msg']; - return false; - } - if (isset($result['err_code']) && $result['err_code'] !== 'SUCCESS') { - $this->errMsg = $result['err_code_des']; - $this->errCode = $result['err_code']; - return false; - } - return $result['short_url']; - } - - /** - * å‘放代金券 - * @param int $coupon_stock_id 代金券批次id - * @param string $partner_trade_no 商户此次å‘放凭æ®å·ï¼ˆæ ¼å¼ï¼šå•†æˆ·id+日期+æµæ°´å·ï¼‰ï¼Œå•†æˆ·ä¾§éœ€ä¿æŒå”¯ä¸€æ€§ - * @param string $openid Openidä¿¡æ¯ - * @param string $op_user_id æ“作员å¸å·, é»˜è®¤ä¸ºå•†æˆ·å· å¯åœ¨å•†æˆ·å¹³å°é…ç½®æ“作员对应的apiæƒé™ - * @return bool|array - * @link https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_3 - */ - public function sendCoupon($coupon_stock_id, $partner_trade_no, $openid, $op_user_id = null) - { - $data = array(); - $data['appid'] = $this->appid; - $data['coupon_stock_id'] = $coupon_stock_id; - $data['openid_count'] = 1; - $data['partner_trade_no'] = $partner_trade_no; - $data['openid'] = $openid; - $data['op_user_id'] = empty($op_user_id) ? $this->mch_id : $op_user_id; - $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/send_coupon'); - $json = Tools::xml2arr($result); - if (!empty($json) && false === $this->_parseResult($json)) { - return false; - } - return $json; - } -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php deleted file mode 100644 index 7073c90905c..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php +++ /dev/null @@ -1,193 +0,0 @@ - - * @date 2016/10/26 15:43 - */ -class WechatPoi extends Common -{ - - /** 创建门店 */ - const POI_ADD = '/cgi-bin/poi/addpoi?'; - - /** æŸ¥è¯¢é—¨åº—ä¿¡æ¯ */ - const POI_GET = '/cgi-bin/poi/getpoi?'; - - /** 获å–门店列表 */ - const POI_GET_LIST = '/cgi-bin/poi/getpoilist?'; - - /** ä¿®æ”¹é—¨åº—ä¿¡æ¯ */ - const POI_UPDATE = '/cgi-bin/poi/updatepoi?'; - - /** 删除门店 */ - const POI_DELETE = '/cgi-bin/poi/delpoi?'; - - /** 获å–门店类目表 */ - const POI_CATEGORY = '/cgi-bin/poi/getwxcategory?'; - - /** - * 创建门店 - * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN - * @param array $data - * @return bool - */ - public function addPoi($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_ADD . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 删除门店 - * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN - * @param string $poi_id JSONæ•°æ®æ ¼å¼ - * @return bool|array - */ - public function delPoi($poi_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('poi_id' => $poi_id); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 修改门店æœåŠ¡ä¿¡æ¯ - * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN - * @param array $data - * @return bool - */ - public function updatePoi($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return true; - } - return false; - } - - /** - * æŸ¥è¯¢é—¨åº—ä¿¡æ¯ - * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN - * @param string $poi_id - * @return bool - */ - public function getPoi($poi_id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('poi_id' => $poi_id); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_GET . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 查询门店列表 - * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN - * @param int $begin 开始ä½ç½®ï¼Œ0 å³ä¸ºä»Žç¬¬ä¸€æ¡å¼€å§‹æŸ¥è¯¢ - * @param int $limit 返回数æ®æ¡æ•°ï¼Œæœ€å¤§å…许50,默认为20 - * @return bool|array - */ - public function getPoiList($begin = 0, $limit = 50) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $limit > 50 && $limit = 50; - $data = array('begin' => $begin, 'limit' => $limit); - $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_GET_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–商家门店类目表 - * @return bool|string - */ - public function getCategory() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::POI_CATEGORY . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php deleted file mode 100644 index 87fab46dbbf..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php +++ /dev/null @@ -1,771 +0,0 @@ - - * @date 2016/06/28 11:29 - */ -class WechatReceive extends WechatMessage -{ - - /** 消æ¯å›žå¤ç±»åž‹ */ - const MSGTYPE_TEXT = 'text'; - const MSGTYPE_LINK = 'link'; - const MSGTYPE_NEWS = 'news'; - const MSGTYPE_IMAGE = 'image'; - const MSGTYPE_VOICE = 'voice'; - const MSGTYPE_EVENT = 'event'; - const MSGTYPE_MUSIC = 'music'; - const MSGTYPE_VIDEO = 'video'; - const MSGTYPE_LOCATION = 'location'; - - /** 文本过滤 */ - protected $_text_filter = true; - - /** 消æ¯å¯¹è±¡ */ - private $_receive; - - /** - * 获å–微信æœåŠ¡å™¨å‘æ¥çš„内容 - * @return $this - */ - public function getRev() - { - if ($this->_receive) { - return $this; - } - $postStr = !empty($this->postxml) ? $this->postxml : file_get_contents("php://input"); - if (!empty($postStr)) { - $disableEntities = libxml_disable_entity_loader(true); - $this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); - libxml_disable_entity_loader($disableEntities); - } - return $this; - } - - /** - * 获å–微信æœåŠ¡å™¨å‘æ¥çš„ä¿¡æ¯æ•°æ® - * @return array - */ - public function getRevData() - { - return $this->_receive; - } - - /** - * 获å–消æ¯å‘é€è€… - * @return bool|string - */ - public function getRevFrom() - { - if (isset($this->_receive['FromUserName'])) { - return $this->_receive['FromUserName']; - } - return false; - } - - /** - * 获å–消æ¯æŽ¥å—者 - * @return bool|string - */ - public function getRevTo() - { - if (isset($this->_receive['ToUserName'])) { - return $this->_receive['ToUserName']; - } - return false; - } - - /** - * 获å–接收消æ¯çš„类型 - * @return bool|string - */ - public function getRevType() - { - if (isset($this->_receive['MsgType'])) { - return $this->_receive['MsgType']; - } - return false; - } - - /** - * 获å–消æ¯ID - * @return bool|string - */ - public function getRevID() - { - if (isset($this->_receive['MsgId'])) { - return $this->_receive['MsgId']; - } - return false; - } - - /** - * 获å–消æ¯å‘é€æ—¶é—´ - * @return bool|string - */ - public function getRevCtime() - { - if (isset($this->_receive['CreateTime'])) { - return $this->_receive['CreateTime']; - } - return false; - } - - /** - * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - å¡å·å®¡æ ¸æ˜¯å¦é€šè¿‡ - * 当Event为 card_pass_check(审核通过) 或 card_not_pass_check(未通过) - * @return bool|string 返回å¡åˆ¸ID - */ - public function getRevCardPass() - { - if (isset($this->_receive['CardId'])) { - return $this->_receive['CardId']; - } - return false; - } - - /** - * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - 领å–å¡åˆ¸ - * 当Event为 user_get_card(用户领å–å¡åˆ¸) - * @return bool|array - */ - public function getRevCardGet() - { - $array = array(); - if (isset($this->_receive['CardId'])) { - $array['CardId'] = $this->_receive['CardId']; - } - if (isset($this->_receive['IsGiveByFriend'])) { - $array['IsGiveByFriend'] = $this->_receive['IsGiveByFriend']; - } - $array['OldUserCardCode'] = $this->_receive['OldUserCardCode']; - if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) { - $array['UserCardCode'] = $this->_receive['UserCardCode']; - } - return (isset($array) && count($array) > 0) ? $array : false; - } - - /** - * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - 删除å¡åˆ¸ - * 当Event为 user_del_card (用户删除å¡åˆ¸) - * @return bool|array - */ - public function getRevCardDel() - { - if (isset($this->_receive['CardId'])) { //å¡åˆ¸ ID - $array['CardId'] = $this->_receive['CardId']; - } - if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) { - $array['UserCardCode'] = $this->_receive['UserCardCode']; - } - return (isset($array) && count($array) > 0) ? $array : false; - } - - /** - * 获å–接收消æ¯å†…容正文 - * @return bool - */ - public function getRevContent() - { - if (isset($this->_receive['Content'])) { - return $this->_receive['Content']; - } elseif (isset($this->_receive['Recognition'])) { - return $this->_receive['Recognition']; - } - return false; - } - - /** - * 获å–接收消æ¯å›¾ç‰‡ - * @return array|bool - */ - public function getRevPic() - { - if (isset($this->_receive['PicUrl'])) { - return array( - 'mediaid' => $this->_receive['MediaId'], - 'picurl' => (string)$this->_receive['PicUrl'], - ); - } - return false; - } - - /** - * 获å–接收消æ¯é“¾æŽ¥ - * @return bool|array - */ - public function getRevLink() - { - if (isset($this->_receive['Url'])) { - return array( - 'url' => $this->_receive['Url'], - 'title' => $this->_receive['Title'], - 'description' => $this->_receive['Description'], - ); - } - return false; - } - - /** - * 获å–接收地ç†ä½ç½® - * @return bool|array - */ - public function getRevGeo() - { - if (isset($this->_receive['Location_X'])) { - return array( - 'x' => $this->_receive['Location_X'], - 'y' => $this->_receive['Location_Y'], - 'scale' => $this->_receive['Scale'], - 'label' => $this->_receive['Label'], - ); - } - return false; - } - - /** - * 获å–上报地ç†ä½ç½®äº‹ä»¶ - * @return bool|array - */ - public function getRevEventGeo() - { - if (isset($this->_receive['Latitude'])) { - return array( - 'x' => $this->_receive['Latitude'], - 'y' => $this->_receive['Longitude'], - 'precision' => $this->_receive['Precision'], - ); - } - return false; - } - - /** - * 获å–æŽ¥æ”¶äº‹ä»¶æŽ¨é€ - * @return bool|array - */ - public function getRevEvent() - { - if (isset($this->_receive['Event'])) { - $array['event'] = $this->_receive['Event']; - } - if (isset($this->_receive['EventKey'])) { - $array['key'] = $this->_receive['EventKey']; - } - return (isset($array) && count($array) > 0) ? $array : false; - } - - /** - * 获å–自定义èœå•çš„扫ç æŽ¨äº‹ä»¶ä¿¡æ¯ - * - * 事件类型为以下两ç§æ—¶åˆ™è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ - * Event 事件类型, scancode_push - * Event 事件类型, scancode_waitmsg - * @return bool|array - */ - public function getRevScanInfo() - { - if (isset($this->_receive['ScanCodeInfo'])) { - if (!is_array($this->_receive['ScanCodeInfo'])) { - $array = (array)$this->_receive['ScanCodeInfo']; - $this->_receive['ScanCodeInfo'] = $array; - } else { - $array = $this->_receive['ScanCodeInfo']; - } - } - return (isset($array) && count($array) > 0) ? $array : false; - } - - /** - * 获å–自定义èœå•çš„图片å‘é€äº‹ä»¶ä¿¡æ¯ - * - * 事件类型为以下三ç§æ—¶åˆ™è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ - * Event 事件类型,pic_sysphoto 弹出系统æ‹ç…§å‘å›¾çš„äº‹ä»¶æŽ¨é€ - * Event 事件类型,pic_photo_or_album 弹出æ‹ç…§æˆ–者相册å‘å›¾çš„äº‹ä»¶æŽ¨é€ - * Event 事件类型,pic_weixin 弹出微信相册å‘å›¾å™¨çš„äº‹ä»¶æŽ¨é€ - * - * @return bool|array - * array ( - * 'Count' => '2', - * 'PicList' =>array ( - * 'item' =>array ( - * 0 =>array ('PicMd5Sum' => 'aaae42617cf2a14342d96005af53624c'), - * 1 =>array ('PicMd5Sum' => '149bd39e296860a2adc2f1bb81616ff8'), - * ), - * ), - * ) - * - */ - public function getRevSendPicsInfo() - { - if (isset($this->_receive['SendPicsInfo'])) { - if (!is_array($this->_receive['SendPicsInfo'])) { - $array = (array)$this->_receive['SendPicsInfo']; - if (isset($array['PicList'])) { - $array['PicList'] = (array)$array['PicList']; - $item = $array['PicList']['item']; - $array['PicList']['item'] = array(); - foreach ($item as $key => $value) { - $array['PicList']['item'][$key] = (array)$value; - } - } - $this->_receive['SendPicsInfo'] = $array; - } else { - $array = $this->_receive['SendPicsInfo']; - } - } - return (isset($array) && count($array) > 0) ? $array : false; - } - - /** - * 获å–自定义èœå•çš„地ç†ä½ç½®é€‰æ‹©å™¨äº‹ä»¶æŽ¨é€ - * - * 事件类型为以下时则å¯ä»¥è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ - * Event 事件类型,location_select 弹出地ç†ä½ç½®é€‰æ‹©å™¨çš„äº‹ä»¶æŽ¨é€ - * - * @return bool|array - * array ( - * 'Location_X' => '33.731655000061', - * 'Location_Y' => '113.29955200008047', - * 'Scale' => '16', - * 'Label' => 'æŸæŸå¸‚æŸæŸåŒºæŸæŸè·¯', - * 'Poiname' => '', - * ) - * - */ - public function getRevSendGeoInfo() - { - if (isset($this->_receive['SendLocationInfo'])) { - if (!is_array($this->_receive['SendLocationInfo'])) { - $array = (array)$this->_receive['SendLocationInfo']; - if (empty($array['Poiname'])) { - $array['Poiname'] = ""; - } - if (empty($array['Label'])) { - $array['Label'] = ""; - } - $this->_receive['SendLocationInfo'] = $array; - } else { - $array = $this->_receive['SendLocationInfo']; - } - } - return (isset($array) && count($array) > 0) ? $array : false; - } - - /** - * 获å–æŽ¥æ”¶è¯­éŸ³æŽ¨é€ - * @return bool|array - */ - public function getRevVoice() - { - if (isset($this->_receive['MediaId'])) { - return array( - 'mediaid' => $this->_receive['MediaId'], - 'format' => $this->_receive['Format'], - ); - } - return false; - } - - /** - * 获å–æŽ¥æ”¶è§†é¢‘æŽ¨é€ - * @return array|bool - */ - public function getRevVideo() - { - if (isset($this->_receive['MediaId'])) { - return array( - 'mediaid' => $this->_receive['MediaId'], - 'thumbmediaid' => $this->_receive['ThumbMediaId'], - ); - } - return false; - } - - /** - * 获å–接收TICKET - * @return bool|string - */ - public function getRevTicket() - { - if (isset($this->_receive['Ticket'])) { - return $this->_receive['Ticket']; - } - return false; - } - - /** - * 获å–二维ç çš„场景值 - * @return bool|string - */ - public function getRevSceneId() - { - if (isset($this->_receive['EventKey'])) { - return str_replace('qrscene_', '', $this->_receive['EventKey']); - } - return false; - } - - /** - * 获å–主动推é€çš„消æ¯ID - * ç»è¿‡éªŒè¯ï¼Œè¿™ä¸ªå’Œæ™®é€šçš„消æ¯MsgIdä¸ä¸€æ · - * 当Event为 MASSSENDJOBFINISH 或 TEMPLATESENDJOBFINISH - * @return bool|string - */ - public function getRevTplMsgID() - { - if (isset($this->_receive['MsgID'])) { - return $this->_receive['MsgID']; - } - return false; - } - - /** - * 获å–模æ¿æ¶ˆæ¯å‘é€çŠ¶æ€ - * @return bool|string - */ - public function getRevStatus() - { - if (isset($this->_receive['Status'])) { - return $this->_receive['Status']; - } - return false; - } - - /** - * 获å–群å‘或模æ¿æ¶ˆæ¯å‘é€ç»“æžœ - * 当Event为 MASSSENDJOBFINISH 或 TEMPLATESENDJOBFINISH,å³é«˜çº§ç¾¤å‘/模æ¿æ¶ˆæ¯ - * @return bool|array - */ - public function getRevResult() - { - if (isset($this->_receive['Status'])) { //å‘é€æ˜¯å¦æˆåŠŸï¼Œå…·ä½“的返回值请å‚考 高级群å‘/模æ¿æ¶ˆæ¯ 的事件推é€è¯´æ˜Ž - $array['Status'] = $this->_receive['Status']; - } - if (isset($this->_receive['MsgID'])) { //å‘é€çš„消æ¯id - $array['MsgID'] = $this->_receive['MsgID']; - } - //以下仅当群å‘消æ¯æ—¶æ‰ä¼šæœ‰çš„事件内容 - if (isset($this->_receive['TotalCount'])) { //分组或openid列表内粉ä¸æ•°é‡ - $array['TotalCount'] = $this->_receive['TotalCount']; - } - if (isset($this->_receive['FilterCount'])) { //过滤(过滤是指特定地区ã€æ€§åˆ«çš„过滤ã€ç”¨æˆ·è®¾ç½®æ‹’收的过滤,用户接收已超4æ¡çš„过滤)åŽï¼Œå‡†å¤‡å‘é€çš„粉ä¸æ•° - $array['FilterCount'] = $this->_receive['FilterCount']; - } - if (isset($this->_receive['SentCount'])) { //å‘é€æˆåŠŸçš„粉ä¸æ•° - $array['SentCount'] = $this->_receive['SentCount']; - } - if (isset($this->_receive['ErrorCount'])) { //å‘é€å¤±è´¥çš„粉ä¸æ•° - $array['ErrorCount'] = $this->_receive['ErrorCount']; - } - if (isset($array) && count($array) > 0) { - return $array; - } - return false; - } - - /** - * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - æŽ¥å…¥ä¼šè¯ - * 当Event为 kfcreatesession å³æŽ¥å…¥ä¼šè¯ - * @return bool|string - */ - public function getRevKFCreate() - { - if (isset($this->_receive['KfAccount'])) { - return $this->_receive['KfAccount']; - } - return false; - } - - /** - * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - å…³é—­ä¼šè¯ - * 当Event为 kfclosesession å³å…³é—­ä¼šè¯ - * @return bool|string - */ - public function getRevKFClose() - { - if (isset($this->_receive['KfAccount'])) { - return $this->_receive['KfAccount']; - } - return false; - } - - /** - * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - è½¬æŽ¥ä¼šè¯ - * 当Event为 kfswitchsession å³è½¬æŽ¥ä¼šè¯ - * @return bool|array - */ - public function getRevKFSwitch() - { - if (isset($this->_receive['FromKfAccount'])) { //åŽŸæŽ¥å…¥å®¢æœ - $array['FromKfAccount'] = $this->_receive['FromKfAccount']; - } - if (isset($this->_receive['ToKfAccount'])) { //è½¬æŽ¥åˆ°å®¢æœ - $array['ToKfAccount'] = $this->_receive['ToKfAccount']; - } - return (isset($array) && count($array) > 0) ? $array : false; - } - - /** - * å‘é€å®¢æœæ¶ˆæ¯ - * @param array $data 消æ¯ç»“æž„{"touser":"OPENID","msgtype":"news","news":{...}} - * @return bool|array - */ - public function sendCustomMessage($data) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpPost(self::API_URL_PREFIX . "/message/custom/send?access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 转å‘多客æœæ¶ˆæ¯ - * @param string $customer_account - * @return $this - */ - public function transfer_customer_service($customer_account = '') - { - $msg = array( - 'ToUserName' => $this->getRevFrom(), - 'FromUserName' => $this->getRevTo(), - 'CreateTime' => time(), - 'MsgType' => 'transfer_customer_service', - ); - if ($customer_account) { - $msg['TransInfo'] = array('KfAccount' => $customer_account); - } - $this->Message($msg); - return $this; - } - - /** - * 设置å‘é€æ¶ˆæ¯ - * @param string|array $msg 消æ¯æ•°ç»„ - * @param bool $append 是å¦åœ¨åŽŸæ¶ˆæ¯æ•°ç»„追加 - * @return array - */ - public function Message($msg = '', $append = false) - { - if (is_null($msg)) { - $this->_msg = array(); - } elseif (is_array($msg)) { - if ($append) { - $this->_msg = array_merge($this->_msg, $msg); - } else { - $this->_msg = $msg; - } - return $this->_msg; - } - return $this->_msg; - } - - /** - * è®¾ç½®æ–‡æœ¬æ¶ˆæ¯ - * @param string $text 文本内容 - * @return $this - */ - public function text($text = '') - { - $msg = array( - 'ToUserName' => $this->getRevFrom(), - 'FromUserName' => $this->getRevTo(), - 'MsgType' => self::MSGTYPE_TEXT, - 'Content' => $this->_auto_text_filter($text), - 'CreateTime' => time(), - ); - $this->Message($msg); - return $this; - } - - /** - * è®¾ç½®å›¾ç‰‡æ¶ˆæ¯ - * @param string $mediaid 图片媒体ID - * @return $this - */ - public function image($mediaid = '') - { - $msg = array( - 'ToUserName' => $this->getRevFrom(), - 'FromUserName' => $this->getRevTo(), - 'MsgType' => self::MSGTYPE_IMAGE, - 'Image' => array('MediaId' => $mediaid), - 'CreateTime' => time(), - ); - $this->Message($msg); - return $this; - } - - /** - * 设置语音回å¤æ¶ˆæ¯ - * @param string $mediaid 语音媒体ID - * @return $this - */ - public function voice($mediaid = '') - { - $msg = array( - 'ToUserName' => $this->getRevFrom(), - 'FromUserName' => $this->getRevTo(), - 'MsgType' => self::MSGTYPE_VOICE, - 'Voice' => array('MediaId' => $mediaid), - 'CreateTime' => time(), - ); - $this->Message($msg); - return $this; - } - - /** - * 设置视频回å¤æ¶ˆæ¯ - * @param string $mediaid 视频媒体ID - * @param string $title 视频标题 - * @param string $description 视频æè¿° - * @return $this - */ - public function video($mediaid = '', $title = '', $description = '') - { - $msg = array( - 'ToUserName' => $this->getRevFrom(), - 'FromUserName' => $this->getRevTo(), - 'MsgType' => self::MSGTYPE_VIDEO, - 'Video' => array( - 'MediaId' => $mediaid, - 'Title' => $title, - 'Description' => $description, - ), - 'CreateTime' => time(), - ); - $this->Message($msg); - return $this; - } - - /** - * 设置音ä¹å›žå¤æ¶ˆæ¯ - * @param string $title 音ä¹æ ‡é¢˜ - * @param string $desc 音ä¹æè¿° - * @param string $musicurl 音ä¹åœ°å€ - * @param string $hgmusicurl 高清音ä¹åœ°å€ - * @param string $thumbmediaid 音ä¹å›¾ç‰‡ç¼©ç•¥å›¾çš„媒体id(å¯é€‰ï¼‰ - * @return $this - */ - public function music($title, $desc, $musicurl, $hgmusicurl = '', $thumbmediaid = '') - { - $msg = array( - 'ToUserName' => $this->getRevFrom(), - 'FromUserName' => $this->getRevTo(), - 'CreateTime' => time(), - 'MsgType' => self::MSGTYPE_MUSIC, - 'Music' => array( - 'Title' => $title, - 'Description' => $desc, - 'MusicUrl' => $musicurl, - 'HQMusicUrl' => $hgmusicurl, - ), - ); - if ($thumbmediaid) { - $msg['Music']['ThumbMediaId'] = $thumbmediaid; - } - $this->Message($msg); - return $this; - } - - /** - * 设置回å¤å›¾æ–‡ - * @param array $newsData - * @return $this - */ - public function news($newsData = array()) - { - $msg = array( - 'ToUserName' => $this->getRevFrom(), - 'FromUserName' => $this->getRevTo(), - 'CreateTime' => time(), - 'MsgType' => self::MSGTYPE_NEWS, - 'ArticleCount' => count($newsData), - 'Articles' => $newsData, - ); - $this->Message($msg); - return $this; - } - - /** - * 回å¤å¾®ä¿¡æœåŠ¡å™¨ - * @param array $msg è¦å‘é€çš„ä¿¡æ¯ï¼ˆé»˜è®¤å–$this->_msg) - * @param bool $return 是å¦è¿”回信æ¯è€Œä¸æŠ›å‡ºåˆ°æµè§ˆå™¨ï¼ˆé»˜è®¤:å¦ï¼‰ - * @return bool|string - */ - public function reply($msg = array(), $return = false) - { - if (empty($msg)) { - if (empty($this->_msg)) { //防止ä¸å…ˆè®¾ç½®å›žå¤å†…容,直接调用reply方法导致异常 - return false; - } - $msg = $this->_msg; - } - $xmldata = Tools::arr2xml($msg); - if ($this->encrypt_type == 'aes') { //如果æ¥æºæ¶ˆæ¯ä¸ºåŠ å¯†æ–¹å¼ - !class_exists('Prpcrypt', false) && require __DIR__ . '/Lib/Prpcrypt.php'; - $pc = new Prpcrypt($this->encodingAesKey); - // 如果是第三方平å°ï¼ŒåŠ å¯†å¾—使用 component_appid - $array = $pc->encrypt($xmldata, empty($this->config['component_appid']) ? $this->appid : $this->config['component_appid']); - $ret = $array[0]; - if ($ret != 0) { - Tools::log('Encrypt Error!', "ERR - {$this->appid}"); - return false; - } - $timestamp = time(); - $nonce = rand(77, 999) * rand(605, 888) * rand(11, 99); - $encrypt = $array[1]; - $tmpArr = array($this->token, $timestamp, $nonce, $encrypt); - sort($tmpArr, SORT_STRING); - $signature = sha1(implode($tmpArr)); - $format = "%s"; - $xmldata = sprintf($format, $encrypt, $signature, $timestamp, $nonce); - } - if ($return) { - return $xmldata; - } - echo $xmldata; - } - - /** - * 过滤文字回å¤\r\næ¢è¡Œç¬¦ - * @param string $text - * @return string - */ - private function _auto_text_filter($text) - { - if (!$this->_text_filter) { - return $text; - } - return str_replace("\r\n", "\n", $text); - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php deleted file mode 100644 index c069f22f591..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php +++ /dev/null @@ -1,138 +0,0 @@ - - * @date 2016/06/28 11:24 - */ -class WechatScript extends Common -{ - - /** - * JSAPI授æƒTICKET - * @var string - */ - public $jsapi_ticket; - - /** - * 删除JSAPI授æƒTICKET - * @param string $appid - * @return bool - */ - public function resetJsTicket($appid = '') - { - $this->jsapi_ticket = ''; - $authname = 'wechat_jsapi_ticket_' . empty($appid) ? $this->appid : $appid; - Tools::removeCache($authname); - return true; - } - - /** - * 获å–JSAPI授æƒTICKET - * @param string $appid 用于多个appid时使用,å¯ç©º - * @param string $jsapi_ticket 手动指定jsapi_ticket,éžå¿…è¦æƒ…况ä¸å»ºè®®ç”¨ - * @param string $access_token èŽ·å– jsapi_ticket 指定 access_token - * @return bool|string - */ - public function getJsTicket($appid = '', $jsapi_ticket = '', $access_token = '') - { - if (empty($access_token)) { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $access_token = $this->access_token; - } - if (empty($appid)) { - $appid = $this->appid; - } - # 手动指定token,优先使用 - if ($jsapi_ticket) { - $this->jsapi_ticket = $jsapi_ticket; - return $this->jsapi_ticket; - } - # å°è¯•ä»Žç¼“å­˜ä¸­è¯»å– - $cache = 'wechat_jsapi_ticket_' . $appid; - $jt = Tools::getCache($cache); - if ($jt) { - return $this->jsapi_ticket = $jt; - } - # 检测事件注册 - if (isset(Loader::$callback[__FUNCTION__])) { - return $this->jsapi_ticket = call_user_func_array(Loader::$callback[__FUNCTION__], array(&$this, &$cache)); - } - # 调接å£èŽ·å– - $result = Tools::httpGet(self::API_URL_PREFIX . self::GET_TICKET_URL . "access_token={$access_token}" . '&type=jsapi'); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - $this->jsapi_ticket = $json['ticket']; - Tools::setCache($cache, $this->jsapi_ticket, $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600); - return $this->jsapi_ticket; - } - return false; - } - - /** - * 获å–JsApi使用签å - * @param string $url 网页的URL,自动处ç†#åŠå…¶åŽé¢éƒ¨åˆ† - * @param int $timestamp 当å‰æ—¶é—´æˆ³ (为空则自动生æˆ) - * @param string $noncestr éšæœºä¸² (为空则自动生æˆ) - * @param string $appid 用于多个appid时使用,å¯ç©º - * @param string $access_token èŽ·å– jsapi_ticket 指定 access_token - * @return array|bool 返回签å字串 - */ - public function getJsSign($url, $timestamp = 0, $noncestr = '', $appid = '', $access_token = '') - { - if (!$this->jsapi_ticket && !$this->getJsTicket($appid, '', $access_token) || empty($url)) { - return false; - } - $data = array( - "jsapi_ticket" => $this->jsapi_ticket, - "timestamp" => empty($timestamp) ? time() : $timestamp, - "noncestr" => '' . empty($noncestr) ? Tools::createNoncestr(16) : $noncestr, - "url" => trim($url), - ); - return array( - "url" => $url, - 'debug' => false, - "appId" => empty($appid) ? $this->appid : $appid, - "nonceStr" => $data['noncestr'], - "timestamp" => $data['timestamp'], - "signature" => Tools::getSignature($data, 'sha1'), - 'jsApiList' => array( - 'updateTimelineShareData', 'updateAppMessageShareData', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', - 'hideOptionMenu', 'showOptionMenu', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', - 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'closeWindow', 'scanQRCode', 'chooseWXPay', - 'translateVoice', 'getNetworkType', 'openLocation', 'getLocation', - 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard', - 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'pauseVoice', 'stopVoice', 'onVoicePlayEnd', 'uploadVoice', 'downloadVoice', - 'openWXDeviceLib', 'closeWXDeviceLib', 'getWXDeviceInfos', 'sendDataToWXDevice', 'disconnectWXDevice', 'getWXDeviceTicket', 'connectWXDevice', - 'startScanWXDevice', 'stopScanWXDevice', 'onWXDeviceBindStateChange', 'onScanWXDeviceResult', 'onReceiveDataFromWXDevice', - 'onWXDeviceBluetoothStateChange', 'onWXDeviceStateChange' - ) - ); - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php deleted file mode 100644 index 56aa4c13a57..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php +++ /dev/null @@ -1,408 +0,0 @@ - - * @date 2016/10/18 00:35:55 - */ -class WechatService -{ - - const URL_PREFIX = 'https://api.weixin.qq.com/cgi-bin/component'; - // 获å–æœåŠ¡access_token - const COMPONENT_TOKEN_URL = '/api_component_token'; - // 获å–(刷新)授æƒå…¬ä¼—å·çš„令牌 - const REFRESH_ACCESS_TOKEN = '/api_authorizer_token'; - // 获å–预授æƒç  - const PREAUTH_CODE_URL = '/api_create_preauthcode'; - // 获å–公众å·çš„授æƒä¿¡æ¯ - const QUERY_AUTH_URL = '/api_query_auth'; - // 获å–授æƒæ–¹çš„è´¦æˆ·ä¿¡æ¯ - const GET_AUTHORIZER_INFO_URL = '/api_get_authorizer_info'; - // 获å–授æƒæ–¹çš„é€‰é¡¹è®¾ç½®ä¿¡æ¯ - const GET_AUTHORIZER_OPTION_URL = '/api_get_authorizer_option'; - // 设置授æƒæ–¹çš„é€‰é¡¹ä¿¡æ¯ - const SET_AUTHORIZER_OPTION_URL = '/api_set_authorizer_option'; - - // 微信åŽå°æŽ¨é€çš„ticket æ¯å分钟更新一次 - public $errCode; - // æœåŠ¡appid - public $errMsg; - // æœåŠ¡appsecret - protected $component_verify_ticket; - // 公众å·æ¶ˆæ¯æ ¡éªŒToken - protected $component_appid; - // 公众å·æ¶ˆæ¯åŠ è§£å¯†Key - protected $component_appsecret; - // æœåŠ¡ä»¤ç‰Œ - protected $component_token; - // 授æƒæ–¹appid - protected $component_encodingaeskey; - // 授æƒæ–¹ä»¤ç‰Œ - protected $component_access_token; - // 刷新令牌 - protected $authorizer_appid; - // JSONæ•°æ® - protected $pre_auth_code; - // é”™è¯¯æ¶ˆæ¯ - protected $data; - - /** - * WechatService constructor. - * @param array $options - */ - public function __construct($options = array()) - { - $options = Loader::config($options); - $this->component_encodingaeskey = !empty($options['component_encodingaeskey']) ? $options['component_encodingaeskey'] : ''; - $this->component_verify_ticket = !empty($options['component_verify_ticket']) ? $options['component_verify_ticket'] : ''; - $this->component_appsecret = !empty($options['component_appsecret']) ? $options['component_appsecret'] : ''; - $this->component_token = !empty($options['component_token']) ? $options['component_token'] : ''; - $this->component_appid = !empty($options['component_appid']) ? $options['component_appid'] : ''; - } - - /** - * 接收公众平å°æŽ¨é€çš„ Ticket - * @return bool|array - */ - public function getComonentTicket() - { - $receive = new WechatReceive(array( - 'appid' => $this->component_appid, - 'appsecret' => $this->component_appsecret, - 'encodingaeskey' => $this->component_encodingaeskey, - 'token' => $this->component_token, - 'cachepath' => Cache::$cachepath - )); - # 会è¯å†…容解密状æ€åˆ¤æ–­ - if (false === $receive->valid()) { - $this->errCode = $receive->errCode; - $this->errMsg = $receive->errMsg; - Tools::log("Get Wechat Push ComponentVerifyTicket Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - return false; - } - $data = $receive->getRev()->getRevData(); - if ($data['InfoType'] === 'component_verify_ticket' && !empty($data['ComponentVerifyTicket'])) { - # 记录推é€æ—¥å¿—到微信SDK - Tools::log("Wechat Push ComponentVerifyTicket Success. "); - Tools::setCache('component_verify_ticket', $data['ComponentVerifyTicket']); - } - return $data; - } - - /** - * 获å–(刷新)授æƒå…¬ä¼—å·çš„令牌 - * @注æ„1. 授æƒå…¬ä¼—å·è®¿é—®access token2å°æ—¶æœ‰æ•ˆ - * @注æ„2. 一定ä¿å­˜å¥½æ–°çš„刷新令牌 - * @param string $authorizer_appid 授æƒæ–¹APPID - * @param string $authorizer_refresh_token 授æƒæ–¹åˆ·æ–°ä»¤ç‰Œ - * @return bool|string - */ - public function refreshAccessToken($authorizer_appid, $authorizer_refresh_token) - { - empty($this->component_access_token) && $this->getComponentAccessToken(); - if (empty($this->component_access_token)) { - return false; - } - $data = array(); - $data['component_appid'] = $this->component_appid; - $data['authorizer_appid'] = $authorizer_appid; - $data['authorizer_refresh_token'] = $authorizer_refresh_token; - $url = self::URL_PREFIX . self::REFRESH_ACCESS_TOKEN . "?component_access_token={$this->component_access_token}"; - $result = Tools::httpPost($url, Tools::json_encode($data)); - if (($result = $this->_decode($result)) === false) { - Tools::log("Get getAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - } - return $result; - } - - /** - * 获å–或刷新æœåŠ¡ AccessToken - * @return bool|string - */ - public function getComponentAccessToken() - { - $cacheKey = 'wechat_component_access_token'; - $this->component_access_token = Tools::getCache($cacheKey); - if (empty($this->component_access_token)) { - $data = array(); - $data['component_appid'] = $this->component_appid; - $data['component_appsecret'] = $this->component_appsecret; - $data['component_verify_ticket'] = $this->component_verify_ticket; - $url = self::URL_PREFIX . self::COMPONENT_TOKEN_URL; - $result = Tools::httpPost($url, Tools::json_encode($data)); - if (($this->component_access_token = $this->_decode($result, 'component_access_token')) === false) { - Tools::log("Get getComponentAccessToken Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - return false; - } - Tools::setCache($cacheKey, $this->component_access_token, 7200); - } - return $this->component_access_token; - } - - /** - * 解æžJSONæ•°æ® - * @param string $result - * @param string|null $field - * @return bool|array - */ - private function _decode($result, $field = null) - { - $this->data = json_decode($result, true); - if (!empty($this->data['errcode'])) { - $this->errCode = $this->data['errcode']; - $this->errMsg = $this->data['errmsg']; - return false; - } - if ($this->data && !is_null($field)) { - if (isset($this->data[$field])) { - return $this->data[$field]; - } else { - return false; - } - } - return $this->data; - } - - /** - * 获å–公众å·çš„授æƒä¿¡æ¯ - * - * @param string $authorization_code - * @return bool|array - */ - public function getAuthorizationInfo($authorization_code) - { - empty($this->component_access_token) && $this->getComponentAccessToken(); - if (empty($this->component_access_token)) { - return false; - } - $data = array(); - $data['component_appid'] = $this->component_appid; - $data['authorization_code'] = $authorization_code; - $url = self::URL_PREFIX . self::QUERY_AUTH_URL . "?component_access_token={$this->component_access_token}"; - $result = Tools::httpPost($url, Tools::json_encode($data)); - $authorization_info = $this->_decode($result, 'authorization_info'); - if (empty($authorization_info)) { - Tools::log("Get getAuthorizationInfo Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - return false; - } - $authorization_info['func_info'] = $this->_parseFuncInfo($authorization_info['func_info']); - return $authorization_info; - } - - /** - * 解æžæŽˆæƒä¿¡æ¯ï¼Œè¿”回以逗å·åˆ†å‰²çš„æ•°æ® - * @param array $func_info - * @return string - */ - private function _parseFuncInfo($func_info) - { - $authorization_list = array(); - foreach ($func_info as $func) { - foreach ($func as $f) { - isset($f['id']) && $authorization_list[] = $f['id']; - } - } - return join($authorization_list, ','); - } - - /** - * 获å–授æƒæ–¹çš„è´¦æˆ·ä¿¡æ¯ - * @param string $authorizer_appid - * @return bool - */ - public function getWechatInfo($authorizer_appid) - { - empty($this->component_access_token) && $this->getComponentAccessToken(); - $data = array(); - $data['component_access_token'] = $this->component_access_token; - $data['component_appid'] = $this->component_appid; - $data['authorizer_appid'] = $authorizer_appid; - $url = self::URL_PREFIX . self::GET_AUTHORIZER_INFO_URL . "?component_access_token={$this->component_access_token}"; - $result = Tools::httpPost($url, Tools::json_encode($data)); - $authorizer_info = $this->_decode($result, 'authorizer_info'); - if (empty($authorizer_info)) { - Tools::log("Get WechatInfo Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - return false; - } - $author_data = array_merge($authorizer_info, $this->data['authorization_info']); - $author_data['service_type_info'] = $author_data['service_type_info']['id']; - $author_data['verify_type_info'] = $author_data['verify_type_info']['id']; - $author_data['func_info'] = $this->_parseFuncInfo($author_data['func_info']); - $author_data['business_info'] = json_encode($author_data['business_info']); - return $author_data; - } - - /** - * 获å–授æƒæ–¹çš„é€‰é¡¹è®¾ç½®ä¿¡æ¯ - * @param string $authorizer_appid - * @param string $option_name - * @return bool - */ - public function getAuthorizerOption($authorizer_appid, $option_name) - { - empty($this->component_access_token) && $this->getComponentAccessToken(); - if (empty($this->authorizer_appid)) { - return false; - } - $data = array(); - $data['component_appid'] = $this->component_appid; - $data['authorizer_appid'] = $authorizer_appid; - $data['option_name'] = $option_name; - $url = self::URL_PREFIX . self::GET_AUTHORIZER_OPTION_URL . "?component_access_token={$this->component_access_token}"; - $result = Tools::httpPost($url, Tools::json_encode($data)); - if (($result = $this->_decode($result)) === false) { - Tools::log("Get getAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - } - return $result; - } - - /** - * 设置授æƒæ–¹çš„é€‰é¡¹ä¿¡æ¯ - * @param string $authorizer_appid - * @param string $option_name - * @param string $option_value - * @return bool - */ - public function setAuthorizerOption($authorizer_appid, $option_name, $option_value) - { - empty($this->component_access_token) && $this->getComponentAccessToken(); - if (empty($this->authorizer_appid)) { - return false; - } - $data = array(); - $data['component_appid'] = $this->component_appid; - $data['authorizer_appid'] = $authorizer_appid; - $data['option_name'] = $option_name; - $data['option_value'] = $option_value; - $url = self::URL_PREFIX . self::SET_AUTHORIZER_OPTION_URL . "?component_access_token={$this->component_access_token}"; - $result = Tools::httpPost($url, Tools::json_encode($data)); - if (($result = $this->_decode($result)) === false) { - Tools::log("Get setAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - } - return $result; - } - - /** - * 获å–授æƒå›žè·³åœ°å€ - * @param string $redirect_uri - * @return bool - */ - public function getAuthRedirect($redirect_uri) - { - empty($this->pre_auth_code) && $this->getPreauthCode(); - if (empty($this->pre_auth_code)) { - return false; - } - return "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={$this->component_appid}&pre_auth_code={$this->pre_auth_code}&redirect_uri={$redirect_uri}"; - } - - /** - * 获å–预授æƒç  - * - * @return bool|string - */ - public function getPreauthCode() - { - empty($this->component_access_token) && $this->getComponentAccessToken(); - if (empty($this->component_access_token)) { - return false; - } - $data = array(); - $data['component_appid'] = $this->component_appid; - $url = self::URL_PREFIX . self::PREAUTH_CODE_URL . "?component_access_token={$this->component_access_token}"; - $result = Tools::httpPost($url, Tools::json_encode($data)); - $this->pre_auth_code = $this->_decode($result, 'pre_auth_code'); - if (empty($this->pre_auth_code)) { - Tools::log("Get getPreauthCode Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); - } - return $this->pre_auth_code; - } - - /** - * oauth 授æƒè·³è½¬æŽ¥å£ - * @param string $appid - * @param string $redirect_uri - * @param string $scope snsapi_userinfo|snsapi_base - * @return string - */ - public function getOauthRedirect($appid, $redirect_uri, $scope = 'snsapi_userinfo') - { - return "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$appid}&redirect_uri=" . urlencode($redirect_uri) - . "&response_type=code&scope={$scope}&state={$appid}&component_appid={$this->component_appid}#wechat_redirect"; - } - - /** - * 通过code获å–Access Token - * @param string $appid - * @return bool|array - */ - public function getOauthAccessToken($appid) - { - $code = isset($_GET['code']) ? $_GET['code'] : ''; - if (empty($code)) { - return false; - } - empty($this->component_access_token) && $this->getComponentAccessToken(); - if (empty($this->component_access_token)) { - return false; - } - $url = "https://api.weixin.qq.com/sns/oauth2/component/access_token?appid={$appid}&code={$code}&grant_type=authorization_code&" - . "component_appid={$this->component_appid}&component_access_token={$this->component_access_token}"; - $json = $this->parseJson(Tools::httpGet($url)); - if ($json !== false) { - return $json; - } - return false; - } - - /** - * 解æžJSONæ•°æ® - * @param string $result - * @return bool - */ - private function parseJson($result) - { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return false; - } - return $json; - } - - /** - * 获å–å…³æ³¨è€…è¯¦ç»†ä¿¡æ¯ - * @param string $openid - * @param string $oauthAccessToken - * @return bool|array {subscribe,openid,nickname,sex,city,province,country,language,headimgurl,subscribe_time,[unionid]} - * 注æ„:unionid字段 åªæœ‰åœ¨ç”¨æˆ·å°†å…¬ä¼—å·ç»‘定到公众å·ç¬¬ä¸‰æ–¹å¹³å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 - */ - public function getOauthUserInfo($openid, $oauthAccessToken) - { - $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$oauthAccessToken}&openid={$openid}&lang=zh_CN"; - return $this->parseJson(Tools::httpGet($url)); - } - - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php deleted file mode 100644 index e8182bc9688..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php +++ /dev/null @@ -1,612 +0,0 @@ - - * @date 2016/06/28 11:20 - */ -class WechatUser extends Common -{ - - /** 获å–粉ä¸åˆ—表 */ - const USER_GET_URL = '/user/get?'; - /* 获å–粉ä¸ä¿¡æ¯ */ - const USER_INFO_URL = '/user/info?'; - /* 批é‡èŽ·å–粉ä¸ä¿¡æ¯ */ - const USER_BATCH_INFO_URL = '/user/info/batchget?'; - /* 更新粉ä¸æ ‡æ³¨ */ - const USER_UPDATEREMARK_URL = '/user/info/updateremark?'; - - /** 创建标签 */ - const TAGS_CREATE_URL = '/tags/create?'; - /* 获å–标签列表 */ - const TAGS_GET_URL = '/tags/get?'; - /* 更新标签 */ - const TAGS_UPDATE_URL = '/tags/update?'; - /* 删除标签 */ - const TAGS_DELETE_URL = '/tags/delete?'; - /* 获å–标签下的粉ä¸åˆ—表 */ - const TAGS_GET_USER_URL = '/user/tag/get?'; - /* 批é‡ä¸ºç²‰ä¸æ‰“标签 */ - const TAGS_MEMBER_BATCHTAGGING = '/tags/members/batchtagging?'; - /* 批é‡ä¸ºç²‰ä¸å–消标签 */ - const TAGS_MEMBER_BATCHUNTAGGING = '/tags/members/batchuntagging?'; - /* 获å–粉ä¸çš„标签列表 */ - const TAGS_LIST = '/tags/getidlist?'; - - /** 获å–分组列表 */ - const GROUP_GET_URL = '/groups/get?'; - /* 获å–粉ä¸æ‰€åœ¨çš„分组 */ - const USER_GROUP_URL = '/groups/getid?'; - /* 创建分组 */ - const GROUP_CREATE_URL = '/groups/create?'; - /* 更新分组 */ - const GROUP_UPDATE_URL = '/groups/update?'; - /* 删除分组 */ - const GROUP_DELETE_URL = '/groups/delete?'; - /* 修改粉ä¸æ‰€åœ¨åˆ†ç»„ */ - const GROUP_MEMBER_UPDATE_URL = '/groups/members/update?'; - /* 批é‡ä¿®æ”¹ç²‰ä¸æ‰€åœ¨åˆ†ç»„ */ - const GROUP_MEMBER_BATCHUPDATE_URL = '/groups/members/batchupdate?'; - - /** 获å–黑åå•åˆ—表 */ - const BACKLIST_GET_URL = '/tags/members/getblacklist?'; - /* 批é‡æ‹‰é»‘ç²‰ä¸ */ - const BACKLIST_ADD_URL = '/tags/members/batchblacklist?'; - /* 批é‡å–æ¶ˆæ‹‰é»‘ç²‰ä¸ */ - const BACKLIST_DEL_URL = '/tags/members/batchunblacklist?'; - - /** - * 批é‡èŽ·å–关注粉ä¸åˆ—表 - * @param string $next_openid - * @return bool|array - */ - public function getUserList($next_openid = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::USER_GET_URL . "access_token={$this->access_token}&next_openid={$next_openid}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–å…³æ³¨è€…è¯¦ç»†ä¿¡æ¯ - * @param string $openid - * @return bool|array {subscribe,openid,nickname,sex,city,province,country,language,headimgurl,subscribe_time,[unionid]} - * @注æ„:unionid字段 åªæœ‰åœ¨ç²‰ä¸å°†å…¬ä¼—å·ç»‘定到微信开放平å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 - */ - public function getUserInfo($openid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::USER_INFO_URL . "access_token={$this->access_token}&openid={$openid}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 批é‡èŽ·å–ç”¨æˆ·åŸºæœ¬ä¿¡æ¯ - * @param array $openids 用户oepnid列表(最多支æŒ100个openid) - * @param string $lang 指定返回语言 - * @return bool|mixed - */ - public function getUserBatchInfo(array $openids, $lang = 'zh_CN') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('user_list' => array()); - foreach (array_unique($openids) as $openid) { - $data['user_list'][] = array('openid' => $openid, 'lang' => $lang); - } - $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_BATCH_INFO_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode']) || !isset($json['user_info_list'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json['user_info_list']; - } - return false; - } - - /** - * 设置粉ä¸å¤‡æ³¨å - * @param string $openid - * @param string $remark 备注å - * @return bool|array - */ - public function updateUserRemark($openid, $remark) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid' => $openid, 'remark' => $remark); - $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_UPDATEREMARK_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–粉ä¸åˆ†ç»„列表 - * @return bool|array - */ - public function getGroup() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::GROUP_GET_URL . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 删除粉ä¸åˆ†ç»„ - * @param string $id - * @return bool - */ - public function delGroup($id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('group' => array('id' => $id)); - $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_DELETE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–粉ä¸æ‰€åœ¨åˆ†ç»„ - * @param string $openid - * @return bool|int æˆåŠŸåˆ™è¿”回粉ä¸åˆ†ç»„id - */ - public function getUserGroup($openid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid' => $openid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_GROUP_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode']) || !isset($json['groupid'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json['groupid']; - } - return false; - } - - /** - * 新增自定分组 - * @param string $name 分组å称 - * @return bool|array - */ - public function createGroup($name) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('group' => array('name' => $name)); - $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 更改分组å称 - * @param int $groupid 分组id - * @param string $name 分组å称 - * @return bool|array - */ - public function updateGroup($groupid, $name) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('group' => array('id' => $groupid, 'name' => $name)); - $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 移动粉ä¸åˆ†ç»„ - * @param int $groupid 分组id - * @param string $openid 粉ä¸openid - * @return bool|array - */ - public function updateGroupMembers($groupid, $openid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid' => $openid, 'to_groupid' => $groupid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_MEMBER_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 批é‡ç§»åŠ¨ç²‰ä¸åˆ†ç»„ - * @param string $groupid 分组ID - * @param string $openid_list 粉ä¸openid数组(一次ä¸èƒ½è¶…过50个) - * @return bool|array - */ - public function batchUpdateGroupMembers($groupid, $openid_list) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid_list' => $openid_list, 'to_groupid' => $groupid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_MEMBER_BATCHUPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 新增自定标签 - * @param string $name 标签å称 - * @return bool|array - */ - public function createTags($name) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('tag' => array('name' => $name)); - $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 更新标签 - * @param string $id 标签id - * @param string $name 标签å称 - * @return bool|array - */ - public function updateTag($id, $name) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('tag' => array('id' => $id, 'name' => $name)); - $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–粉ä¸æ ‡ç­¾åˆ—表 - * @return bool|array - */ - public function getTags() - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $result = Tools::httpGet(self::API_URL_PREFIX . self::TAGS_GET_URL . "access_token={$this->access_token}"); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 删除粉ä¸æ ‡ç­¾ - * @param string $id - * @return bool - */ - public function delTag($id) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('tag' => array('id' => $id)); - $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_DELETE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–标签下的粉ä¸åˆ—表 - * @param string $tagid - * @param string $next_openid - * @return bool - */ - public function getTagUsers($tagid, $next_openid = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('tagid' => $tagid, 'next_openid' => $next_openid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_GET_USER_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 批é‡ä¸ºç²‰ä¸æ‰“标签 - * @param string $tagid 标签ID - * @param array $openid_list 粉ä¸openid数组,一次ä¸èƒ½è¶…过50个 - * @return bool|array - */ - public function batchAddUserTag($tagid, $openid_list) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid_list' => $openid_list, 'tagid' => $tagid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_MEMBER_BATCHTAGGING . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 批é‡ä¸ºç²‰ä¸å–消标签 - * @param string $tagid 标签ID - * @param array $openid_list 粉ä¸openid数组,一次ä¸èƒ½è¶…过50个 - * @return bool|array - */ - public function batchDeleteUserTag($tagid, $openid_list) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid_list' => $openid_list, 'tagid' => $tagid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_MEMBER_BATCHUNTAGGING . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 获å–粉ä¸çš„标签列表 - * @param string $openid 粉ä¸openid - * @return bool|array - */ - public function getUserTags($openid) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid' => $openid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode']) || !isset($json['tagid_list'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json['tagid_list']; - } - return false; - } - - /** - * 批é‡èŽ·å–黑åå•ç²‰ä¸ - * @param string $begin_openid - * @return bool|array - */ - public function getBacklist($begin_openid = '') - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = empty($begin_openid) ? array() : array('begin_openid' => $begin_openid); - $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_GET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 批é‡æ‹‰é»‘ç²‰ä¸ - * @param string $openids - * @return bool|array - */ - public function addBacklist($openids) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid_list' => $openids); - $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - - /** - * 批é‡å–æ¶ˆæ‹‰é»‘ç²‰ä¸ - * @param string $openids - * @return bool|array - */ - public function delBacklist($openids) - { - if (!$this->access_token && !$this->getAccessToken()) { - return false; - } - $data = array('openid_list' => $openids); - $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); - if ($result) { - $json = json_decode($result, true); - if (empty($json) || !empty($json['errcode'])) { - $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; - $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; - return $this->checkRetry(__FUNCTION__, func_get_args()); - } - return $json; - } - return false; - } - -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json deleted file mode 100644 index 81791c07296..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "project", - "name": "zoujingli/wechat-php-sdk", - "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", - "description": "WeChat development of SDK", - "license": "MIT", - "keywords": [ - "wechat-php-sdk" - ], - "require": { - "ext-json": "*", - "ext-libxml": "*", - "ext-simplexml": "*", - "php": ">=5.3.3" - }, - "autoload": { - "psr-4": { - "Wechat\\": "./Wechat" - } - } -} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php deleted file mode 100644 index c2aa13f9e8f..00000000000 --- a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php +++ /dev/null @@ -1,17 +0,0 @@ - '', - 'appid' => '', - 'appsecret' => '', - 'encodingaeskey' => '', -); - -# 加载对应æ“ä½œæŽ¥å£ -$wechat = &\Wechat\Loader::get('User', $config); -$userlist = $wechat->getUserList(); - -var_dump($userlist); -var_dump($wechat->errMsg); -var_dump($wechat->errCode); - -exit; - -// ç¬¬ä¸‰æ–¹å¹³å° JSSDK ç­¾å包 - -$wechat = Db::name('WechatConfig')->where('authorizer_appid', 'wx60a43dd8161666d4')->find(); -// 第三方授æƒèŽ·å–到的 Access_token -$access_token = $wechat['authorizer_access_token']; -// å‚与授æƒçš„å…¬ä¼—å· APPID -$authorizer_appid = $wechat['authorizer_appid']; -// 当å‰å¾®ä¿¡é¡µé¢URL地å€ï¼ˆå®Œæ•´ï¼‰ -$current_url = url('', '', true, true); -// 实例SDK脚本 -$script = load_wechat('Script', $authorizer_appid); -// 获å–JSç­¾å包 -$result = $script->getJsSign($current_url, 0, '', $authorizer_appid, $access_token); -dump($result); -dump([$script->errMsg, $script->errCode]); - -$json = json_encode($result, JSON_PRETTY_PRINT); -echo ''; -echo " - -"; \ No newline at end of file From 5752a07a9627148655e9d80e4d5477ddce212916 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 15:10:48 +0000 Subject: [PATCH 28/39] Support for PHP 8.0 and 8.1 --- .../zoujingli/wechat-php-sdk/.gitignore | 1 + .../zoujingli/wechat-php-sdk/MIT-LICENSE.txt | 21 + .../vendor/zoujingli/wechat-php-sdk/README.md | 91 ++ .../wechat-php-sdk/Wechat/Lib/Cache.php | 146 ++++ .../wechat-php-sdk/Wechat/Lib/Common.php | 234 +++++ .../wechat-php-sdk/Wechat/Lib/Prpcrypt.php | 196 +++++ .../wechat-php-sdk/Wechat/Lib/Tools.php | 308 +++++++ .../wechat-php-sdk/Wechat/Loader.php | 129 +++ .../wechat-php-sdk/Wechat/WechatCard.php | 819 ++++++++++++++++++ .../wechat-php-sdk/Wechat/WechatCustom.php | 385 ++++++++ .../wechat-php-sdk/Wechat/WechatDevice.php | 467 ++++++++++ .../wechat-php-sdk/Wechat/WechatExtends.php | 209 +++++ .../wechat-php-sdk/Wechat/WechatHardware.php | 160 ++++ .../wechat-php-sdk/Wechat/WechatMedia.php | 430 +++++++++ .../wechat-php-sdk/Wechat/WechatMenu.php | 183 ++++ .../wechat-php-sdk/Wechat/WechatMessage.php | 352 ++++++++ .../wechat-php-sdk/Wechat/WechatOauth.php | 138 +++ .../wechat-php-sdk/Wechat/WechatPay.php | 620 +++++++++++++ .../wechat-php-sdk/Wechat/WechatPoi.php | 193 +++++ .../wechat-php-sdk/Wechat/WechatReceive.php | 771 +++++++++++++++++ .../wechat-php-sdk/Wechat/WechatScript.php | 138 +++ .../wechat-php-sdk/Wechat/WechatService.php | 408 +++++++++ .../wechat-php-sdk/Wechat/WechatUser.php | 612 +++++++++++++ .../zoujingli/wechat-php-sdk/composer.json | 21 + .../zoujingli/wechat-php-sdk/include.php | 17 + .../vendor/zoujingli/wechat-php-sdk/test.php | 68 ++ 26 files changed, 7117 insertions(+) create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php create mode 100644 upload/system/storage/vendor/zoujingli/wechat-php-sdk/test.php diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore new file mode 100644 index 00000000000..485dee64bcf --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt new file mode 100644 index 00000000000..0624076f028 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/MIT-LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2014-2017 Anyon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md new file mode 100644 index 00000000000..e1b42e9194d --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/README.md @@ -0,0 +1,91 @@ +[![Latest Stable Version](https://poser.pugx.org/zoujingli/wechat-php-sdk/v/stable)](https://packagist.org/packages/zoujingli/wechat-php-sdk) +[![Total Downloads](https://poser.pugx.org/zoujingli/wechat-php-sdk/downloads)](https://packagist.org/packages/zoujingli/wechat-php-sdk) +[![Latest Unstable Version](https://poser.pugx.org/zoujingli/wechat-php-sdk/v/unstable)](https://packagist.org/packages/zoujingli/wechat-php-sdk) +[![License](https://poser.pugx.org/zoujingli/wechat-php-sdk/license)](https://packagist.org/packages/zoujingli/wechat-php-sdk) + +æ­¤`SDK`è¿è¡Œæœ€åº•è¦æ±‚`PHP`版本`5.3`, 建议在`PHP7`上è¿è¡Œä»¥èŽ·å–最佳性能。 + +微信的部分接å£éœ€è¦ç¼“存数æ®åœ¨æœ¬åœ°ï¼Œå› æ­¤å¯¹ç›®å½•éœ€è¦æœ‰å†™æƒé™ã€‚ + +我们鼓励大家使用`composer`æ¥ç®¡ç†æ‚¨çš„第三方库,方便åŽæœŸæ›´æ–°æ“作(尤其是接å£ç±»ï¼‰ã€‚ + +近期`access_token`ç»å¸¸æ— æ•…失效,`SDK`已加入失败状æ€æ£€æµ‹ï¼Œè‡ªåŠ¨é‡æ–°èŽ·å–`access_token`并返回结果. + +æ­¤`SDK`已历ç»æ•°ä¸ªçº¿ä¸Šé¡¹ç›®éªŒè¯ä¸Žè€ƒéªŒï¼Œå¯é æ€§ä¸Žç¨³å®šæ€§æžé«˜ï¼Œæ¬¢è¿Ž`fork`或`star`此项目。 + +## 新微信开å‘工具推è +* 微信æœåŠ¡å·ã€å¾®ä¿¡å°ç¨‹åºã€å¾®ä¿¡æ”¯ä»˜ã€æ”¯ä»˜å®æ”¯ä»˜ +* Gitee 仓库 WeChatDevloper: https://gitee.com/zoujingli/WeChatDeveloper +* Github 仓库 WeChatDeveloper:https://github.com/zoujingli/WeChatDeveloper + +**微信SDKå¼€å‘帮助åŠäº¤æµ** +-- +* **在åšå¾®ä¿¡å¼€å‘å‰ï¼Œå¿…需先阅读微信官方文档,此SDK也是基于之上进行的å°è£…。** + +* **文档链接地å€**:http://www.kancloud.cn/zoujingli/wechat-php-sdk + +* **Think.Admin**:https://github.com/zoujingli/Think.Admin + +* **å¼€å‘交æµQQ群:513350915(新)** + +**若对您有帮助,å¯ä»¥èµžåŠ©å¹¶æ”¯æŒä¸‹ä½œè€…哦,谢谢ï¼** +-- +![](http://static.thinkadmin.top/pay.png) + + +**官方接å£æ–‡æ¡£é“¾æŽ¥** +-- +* 使用å‰éœ€å…ˆæ‰“开微信å¸å·çš„å¼€å‘模å¼ï¼Œè¯¦ç»†æ­¥éª¤è¯·æŸ¥çœ‹å¾®ä¿¡å…¬ä¼—å¹³å°æŽ¥å£ä½¿ç”¨è¯´æ˜Žï¼š +* 微信公众平å°ï¼š http://mp.weixin.qq.com/wiki/ +* 微信ä¼ä¸šå¹³å°ï¼š http://qydev.weixin.qq.com/wiki/ +* 微信开放平å°ï¼šhttps://open.weixin.qq.com/ +* 微信支付接入文档:https://mp.weixin.qq.com/cgi-bin/readtemplate?t=business/course2_tmpl&lang=zh_CN +* 微信商户平å°ï¼šhttps://pay.weixin.qq.com + +**微信`SDK`项目æºæ–‡ä»¶æ‰˜ç®¡** +-- +* SDK 为开æºé¡¹ç›®ï¼Œä½ å¯ä»¥æŠŠå®ƒç”¨äºŽä»»ä½•åœ°å€ï¼Œå¹¶ä¸å—任何约æŸï¼Œæ¬¢è¿Ž`fork`项目。 +* 通过 [Github](https://github.com/zoujingli/wechat-php-sdk) 下载 SDK æºä»£ç  +* 通过 [OSChina](http://git.oschina.net/zoujingli/wechat-php-sdk) 下载 SDK æºä»£ç  +* 通过 [Composer](https://getcomposer.org) 包管ç†å·¥å…·ä¸‹è½½ SDK æºä»£ç  + +**微信`SDK`å°è£…对接åŠåŠŸèƒ½** +-- +* æŽ¥å…¥éªŒè¯ ï¼ˆåˆçº§æƒé™ï¼‰ +* 自动回å¤ï¼ˆæ–‡æœ¬ã€å›¾ç‰‡ã€è¯­éŸ³ã€è§†é¢‘ã€éŸ³ä¹ã€å›¾æ–‡ï¼‰ (åˆçº§æƒé™ï¼‰ +* èœå•æ“作(查询ã€åˆ›å»ºã€åˆ é™¤ï¼‰ (èœå•æƒé™ï¼‰ +* 客æœæ¶ˆæ¯ï¼ˆæ–‡æœ¬ã€å›¾ç‰‡ã€è¯­éŸ³ã€è§†é¢‘ã€éŸ³ä¹ã€å›¾æ–‡ï¼‰ (认è¯æƒé™ï¼‰ +* 二维ç ï¼ˆåˆ›å»ºä¸´æ—¶ã€æ°¸ä¹…二维ç ï¼ŒèŽ·å–二维ç URL) (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* é•¿é“¾æŽ¥è½¬çŸ­é“¾æŽ¥æŽ¥å£ ï¼ˆæœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* 标签æ“作(查询ã€åˆ›å»ºã€ä¿®æ”¹ã€ç§»åŠ¨ç”¨æˆ·åˆ°æ ‡ç­¾ï¼‰ (认è¯æƒé™ï¼‰ +* 网页授æƒï¼ˆåŸºæœ¬æŽˆæƒï¼Œç”¨æˆ·ä¿¡æ¯æŽˆæƒï¼‰ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* 用户信æ¯ï¼ˆæŸ¥è¯¢ç”¨æˆ·åŸºæœ¬ä¿¡æ¯ã€èŽ·å–关注者列表) (认è¯æƒé™ï¼‰ +* 多客æœåŠŸèƒ½ï¼ˆå®¢æœç®¡ç†ã€èŽ·å–客æœè®°å½•ã€å®¢æœä¼šè¯ç®¡ç†ï¼‰ (认è¯æƒé™ï¼‰ +* 媒体文件(上传ã€èŽ·å–) (认è¯æƒé™ï¼‰ +* é«˜çº§ç¾¤å‘ ï¼ˆè®¤è¯æƒé™ï¼‰ +* 模æ¿æ¶ˆæ¯ï¼ˆè®¾ç½®æ‰€å±žè¡Œä¸šã€æ·»åŠ æ¨¡æ¿ã€å‘é€æ¨¡æ¿æ¶ˆæ¯ï¼‰ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* å¡åˆ¸ç®¡ç†ï¼ˆåˆ›å»ºã€ä¿®æ”¹ã€åˆ é™¤ã€å‘放ã€é—¨åº—管ç†ç­‰ï¼‰ (认è¯æƒé™ï¼‰ +* 语义ç†è§£ (æœåŠ¡å·ã€è®¤è¯æƒé™ï¼‰ +* 获å–微信æœåŠ¡å™¨IP列表 (åˆçº§æƒé™ï¼‰ +* 微信JSAPI授æƒ(获å–ticketã€èŽ·å–ç­¾å) (åˆçº§æƒé™ï¼‰ +* æ•°æ®ç»Ÿè®¡(用户ã€å›¾æ–‡ã€æ¶ˆæ¯ã€æŽ¥å£åˆ†æžæ•°æ®) (认è¯æƒé™ï¼‰ +* 微信支付(网页支付ã€æ‰«ç æ”¯ä»˜ã€äº¤æ˜“退款ã€ç»™ç²‰ä¸æ‰“款)(认è¯æœåŠ¡å·å¹¶å¼€é€šæ”¯ä»˜åŠŸèƒ½ï¼‰ + +**接å£æƒé™å¤‡æ³¨ï¼š** +-- +* åˆçº§æƒé™ï¼šåŸºæœ¬æƒé™ï¼Œä»»ä½•æ­£å¸¸çš„公众å·éƒ½æœ‰æ­¤æƒé™ +* èœå•æƒé™ï¼šæ­£å¸¸çš„æœåŠ¡å·ã€è®¤è¯åŽçš„订阅å·æ‹¥æœ‰æ­¤æƒé™ +* 认è¯æƒé™ï¼šåˆ†ä¸ºè®¢é˜…å·ã€æœåŠ¡å·è®¤è¯ï¼Œå¦‚å‰ç¼€æœåŠ¡å·åˆ™ä»…认è¯çš„æœåŠ¡å·æœ‰æ­¤æƒé™ +* 支付æƒé™ï¼šä»…认è¯åŽçš„æœåŠ¡å·å¯ä»¥ç”³è¯·æ­¤æƒé™ + +**微信开放第三方平å°** --- (案例åŠæ–‡æ¡£æ•´ç†ä¸­ï¼‰ +-- +* 公众å·æŽˆæƒæœåŠ¡ +* 公众å·æŽ¨é€æ¶ˆæ¯ä»£å¤„ç† +* 公众å·åŸºç¡€ä¸šåŠ¡ä»£å¤„ç† +* 公众å·æ”¯ä»˜ä»£å‘èµ· + +**微信`SDK`版æƒå£°æ˜Ž** +-- +* æ­¤SDK基于`MIT`åè®®å‘布,任何人å¯ä»¥ç”¨åœ¨ä»»ä½•åœ°æ–¹ï¼Œä¸å—çº¦æŸ +* æ­¤SDK部分代ç æ¥è‡ªäº’è”网,若有异议,å¯ä»¥è”系作者进行删除 diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php new file mode 100644 index 00000000000..ee10b87e808 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php @@ -0,0 +1,146 @@ + + * @date 2016-08-20 17:50 + */ +class Cache +{ + + /** + * 缓存ä½ç½® + * @var string + */ + static public $cachepath; + + /** + * 设置缓存 + * @param string $name + * @param string $value + * @param int $expired + * @return mixed + */ + static public function set($name, $value, $expired = 0) + { + if (isset(Loader::$callback['CacheSet'])) { + return call_user_func_array(Loader::$callback['CacheSet'], func_get_args()); + } + $data = serialize(array('value' => $value, 'expired' => $expired > 0 ? time() + $expired : 0)); + return self::check() && file_put_contents(self::$cachepath . $name, $data); + } + + /** + * 读å–缓存 + * @param string $name + * @return mixed + */ + static public function get($name) + { + if (isset(Loader::$callback['CacheGet'])) { + return call_user_func_array(Loader::$callback['CacheGet'], func_get_args()); + } + if (self::check() && ($file = self::$cachepath . $name) && file_exists($file) && ($data = file_get_contents($file)) && !empty($data)) { + $data = unserialize($data); + if (isset($data['expired']) && ($data['expired'] > time() || $data['expired'] === 0)) { + return isset($data['value']) ? $data['value'] : null; + } + } + return null; + } + + /** + * 删除缓存 + * @param string $name + * @return mixed + */ + static public function del($name) + { + if (isset(Loader::$callback['CacheDel'])) { + return call_user_func_array(Loader::$callback['CacheDel'], func_get_args()); + } + return self::check() && @unlink(self::$cachepath . $name); + } + + /** + * 输出内容到日志 + * @param string $line + * @param string $filename + * @return mixed + */ + static public function put($line, $filename = '') + { + if (isset(Loader::$callback['CachePut'])) { + return call_user_func_array(Loader::$callback['CachePut'], func_get_args()); + } + empty($filename) && $filename = date('Ymd') . '.log'; + return self::check() && file_put_contents(self::$cachepath . $filename, '[' . date('Y/m/d H:i:s') . "] {$line}\n", FILE_APPEND); + } + + /** + * 检查缓存目录 + * @return bool + */ + static protected function check() + { + empty(self::$cachepath) && self::$cachepath = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR; + self::$cachepath = rtrim(self::$cachepath, '/\\') . DIRECTORY_SEPARATOR; + if (!is_dir(self::$cachepath) && !mkdir(self::$cachepath, 0755, true)) { + return false; + } + return true; + } + + /** + * 文件缓存,æˆåŠŸè¿”回文件路径 + * @param string $content 文件内容 + * @param string $filename 文件å称 + * @return bool|string + */ + static public function file($content, $filename = '') + { + if (isset(Loader::$callback['CacheFile'])) { + return call_user_func_array(Loader::$callback['CacheFile'], func_get_args()); + } + empty($filename) && $filename = md5($content) . '.' . self::getFileExt($content); + if (self::check() && file_put_contents(self::$cachepath . $filename, $content)) { + return self::$cachepath . $filename; + } + return false; + } + + /** + * æ ¹æ®æ–‡ä»¶æµè¯»å–文件åŽç¼€ + * @param string $content + * @return string + */ + static public function getFileExt($content) + { + $types = array( + 255216 => 'jpg', 7173 => 'gif', 6677 => 'bmp', 13780 => 'png', + 7368 => 'mp3', 4838 => 'wma', 7784 => 'mid', 6063 => 'xml', + ); + $typeInfo = @unpack("C2chars", substr($content, 0, 2)); + $typeCode = intval($typeInfo['chars1'] . $typeInfo['chars2']); + return isset($types[$typeCode]) ? $types[$typeCode] : 'mp4'; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php new file mode 100644 index 00000000000..11df686bdb7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php @@ -0,0 +1,234 @@ + + * @date 2016/05/28 11:55 + */ +class Common +{ + + /** API接å£URL需è¦ä½¿ç”¨æ­¤å‰ç¼€ */ + const API_BASE_URL_PREFIX = 'https://api.weixin.qq.com'; + const API_URL_PREFIX = 'https://api.weixin.qq.com/cgi-bin'; + const GET_TICKET_URL = '/ticket/getticket?'; + const AUTH_URL = '/token?grant_type=client_credential&'; + public $token; + public $encodingAesKey; + public $encrypt_type; + public $appid; + public $appsecret; + public $access_token; + public $postxml; + public $_msg; + public $errCode = 0; + public $errMsg = ""; + public $config = array(); + private $_retry = false; + + /** + * 构造方法 + * @param array $options + */ + public function __construct($options = array()) + { + $config = Loader::config($options); + $this->token = isset($config['token']) ? $config['token'] : ''; + $this->appid = isset($config['appid']) ? $config['appid'] : ''; + $this->appsecret = isset($config['appsecret']) ? $config['appsecret'] : ''; + $this->encodingAesKey = isset($config['encodingaeskey']) ? $config['encodingaeskey'] : ''; + $this->config = $config; + } + + /** + * 当å‰å½“å‰é”™è¯¯ä»£ç  + * @return int + */ + public function getErrorCode() + { + return $this->errCode; + } + + /** + * 获å–当å‰é”™è¯¯å†…容 + * @return string + */ + public function getError() + { + return $this->errMsg; + } + + /** + * 获å–当å‰æ“作公众å·APPID + * @return string + */ + public function getAppid() + { + return $this->appid; + } + + /** + * 获å–SDKé…ç½®å‚æ•° + * @return array + */ + public function getConfig() + { + return $this->config; + } + + + /** + * 接å£éªŒè¯ + * @return bool + */ + public function valid() + { + $encryptStr = ""; + if ($_SERVER['REQUEST_METHOD'] == "POST") { + $postStr = file_get_contents("php://input"); + $disableEntities = libxml_disable_entity_loader(true); + $array = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); + $this->encrypt_type = isset($_GET["encrypt_type"]) ? $_GET["encrypt_type"] : ''; + if ($this->encrypt_type == 'aes') { + $encryptStr = $array['Encrypt']; + !class_exists('Prpcrypt', false) && require __DIR__ . '/Prpcrypt.php'; + $pc = new Prpcrypt($this->encodingAesKey); + $array = $pc->decrypt($encryptStr, $this->appid); + if (!isset($array[0]) || intval($array[0]) > 0) { + $this->errCode = $array[0]; + $this->errMsg = $array[1]; + Tools::log("Interface Authentication Failed. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + $this->postxml = $array[1]; + empty($this->appid) && $this->appid = $array[2]; + } else { + $this->postxml = $postStr; + } + } elseif (isset($_GET["echostr"])) { + if ($this->checkSignature()) { + @ob_clean(); + exit($_GET["echostr"]); + } + return false; + } + if (!$this->checkSignature($encryptStr)) { + $this->errMsg = 'Interface authentication failed, please use the correct method to call.'; + return false; + } + return true; + } + + /** + * 验è¯æ¥è‡ªå¾®ä¿¡æœåŠ¡å™¨ + * @param string $str + * @return bool + */ + private function checkSignature($str = '') + { + $signature = isset($_GET["msg_signature"]) ? $_GET["msg_signature"] : (isset($_GET["signature"]) ? $_GET["signature"] : ''); + $timestamp = isset($_GET["timestamp"]) ? $_GET["timestamp"] : ''; + $nonce = isset($_GET["nonce"]) ? $_GET["nonce"] : ''; + $tmpArr = array($this->token, $timestamp, $nonce, $str); + sort($tmpArr, SORT_STRING); + if (sha1(implode($tmpArr)) == $signature) { + return true; + } + return false; + } + + /** + * 获å–公众å·è®¿é—® access_token + * @param string $appid 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º + * @param string $appsecret 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º + * @param string $token 手动指定access_token,éžå¿…è¦æƒ…况ä¸å»ºè®®ç”¨ + * @return bool|string + */ + public function getAccessToken($appid = '', $appsecret = '', $token = '') + { + if (!$appid || !$appsecret) { + list($appid, $appsecret) = array($this->appid, $this->appsecret); + } + if ($token) { + return $this->access_token = $token; + } + $cache = 'wechat_access_token_' . $appid; + if (($access_token = Tools::getCache($cache)) && !empty($access_token)) { + return $this->access_token = $access_token; + } + # 检测事件注册 + if (isset(Loader::$callback[__FUNCTION__])) { + return $this->access_token = call_user_func_array(Loader::$callback[__FUNCTION__], array(&$this, &$cache)); + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::AUTH_URL . 'appid=' . $appid . '&secret=' . $appsecret); + if ($result) { + $json = json_decode($result, true); + if (!$json || isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + Tools::log("Get New AccessToken Error. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + $this->access_token = $json['access_token']; + Tools::log("Get New AccessToken Success.", "MSG - {$this->appid}"); + Tools::setCache($cache, $this->access_token, 5000); + return $this->access_token; + } + return false; + } + + /** + * 接å£å¤±è´¥é‡è¯• + * @param string $method SDK方法å称 + * @param array $arguments SDK方法å‚æ•° + * @return bool|mixed + */ + protected function checkRetry($method, $arguments = array()) + { + Tools::log("Run {$method} Faild. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}"); + if (!$this->_retry && in_array($this->errCode, array('40014', '40001', '41001', '42001'))) { + ($this->_retry = true) && $this->resetAuth(); + $this->errCode = 40001; + $this->errMsg = 'no access'; + Tools::log("Retry Run {$method} ...", "MSG - {$this->appid}"); + return call_user_func_array(array($this, $method), $arguments); + } + return false; + } + + /** + * 删除验è¯æ•°æ® + * @param string $appid 如在类åˆå§‹åŒ–时已æ供,则å¯ä¸ºç©º + * @return bool + */ + public function resetAuth($appid = '') + { + $authname = 'wechat_access_token_' . (empty($appid) ? $this->appid : $appid); + Tools::log("Reset Auth And Remove Old AccessToken.", "MSG - {$this->appid}"); + $this->access_token = ''; + Tools::removeCache($authname); + return true; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php new file mode 100644 index 00000000000..5830ea43a83 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Prpcrypt.php @@ -0,0 +1,196 @@ + PKCS7Encoder::$block_size) { + $pad = 0; + } + return substr($text, 0, (strlen($text) - $pad)); + } + +} + +/** + * 接收和推é€ç»™å…¬ä¼—å¹³å°æ¶ˆæ¯çš„加解密 + * @category WechatSDK + * @subpackage library + * @date 2016/06/28 11:59 + */ +class Prpcrypt +{ + + public $key; + + function __construct($k) + { + $this->key = base64_decode($k . "="); + } + + /** + * 对明文进行加密 + * @param string $text 需è¦åŠ å¯†çš„明文 + * @param string $appid 公众å·APPID + * @return array + */ + public function encrypt($text, $appid) + { + try { + //获得16ä½éšæœºå­—ç¬¦ä¸²ï¼Œå¡«å……åˆ°æ˜Žæ–‡ä¹‹å‰ + $random = $this->getRandomStr();//"aaaabbbbccccdddd"; + $text = $random . pack("N", strlen($text)) . $text . $appid; + $iv = substr($this->key, 0, 16); + $pkc_encoder = new PKCS7Encoder; + $text = $pkc_encoder->encode($text); + $encrypted = openssl_encrypt($text, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); + return array(ErrorCode::$OK, $encrypted); + } catch (Exception $e) { + return array(ErrorCode::$EncryptAESError, null); + } + } + + /** + * 对密文进行解密 + * @param string $encrypted 需è¦è§£å¯†çš„密文 + * @param string $appid 公众å·APPID + * @return array + */ + public function decrypt($encrypted, $appid) + { + try { + $iv = substr($this->key, 0, 16); + $decrypted = openssl_decrypt($encrypted, 'AES-256-CBC', substr($this->key, 0, 32), OPENSSL_ZERO_PADDING, $iv); + } catch (Exception $e) { + return array(ErrorCode::$DecryptAESError, null); + } + try { + $pkc_encoder = new PKCS7Encoder; + $result = $pkc_encoder->decode($decrypted); + if (strlen($result) < 16) { + return array(ErrorCode::$DecryptAESError, null); + } + $content = substr($result, 16, strlen($result)); + $len_list = unpack("N", substr($content, 0, 4)); + $xml_len = $len_list[1]; + $xml_content = substr($content, 4, $xml_len); + $from_appid = substr($content, $xml_len + 4); + return array(0, $xml_content, $from_appid); + } catch (Exception $e) { + return array(ErrorCode::$IllegalBuffer, null); + } + + } + + /** + * éšæœºç”Ÿæˆ16ä½å­—符串 + * @return string 生æˆçš„字符串 + */ + function getRandomStr() + { + $str = ""; + $str_pol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"; + $max = strlen($str_pol) - 1; + for ($i = 0; $i < 16; $i++) { + $str .= $str_pol[mt_rand(0, $max)]; + } + return $str; + } + +} + +/** + * 仅用作类内部使用 + * ä¸ç”¨äºŽå®˜æ–¹API接å£çš„errCodeç  + * Class ErrorCode + */ +class ErrorCode +{ + + public static $OK = 0; + public static $ValidateSignatureError = 40001; + public static $ParseXmlError = 40002; + public static $ComputeSignatureError = 40003; + public static $IllegalAesKey = 40004; + public static $ValidateAppidError = 40005; + public static $EncryptAESError = 40006; + public static $DecryptAESError = 40007; + public static $IllegalBuffer = 40008; + public static $EncodeBase64Error = 40009; + public static $DecodeBase64Error = 40010; + public static $GenReturnXmlError = 40011; + public static $errCode = array( + '0' => '处ç†æˆåŠŸ', + '40001' => '校验签å失败', + '40002' => '解æžxml失败', + '40003' => '计算签å失败', + '40004' => 'ä¸åˆæ³•çš„AESKey', + '40005' => '校验AppID失败', + '40006' => 'AES加密失败', + '40007' => 'AES解密失败', + '40008' => '公众平å°å‘é€çš„xmlä¸åˆæ³•', + '40009' => 'Base64ç¼–ç å¤±è´¥', + '40010' => 'Base64解ç å¤±è´¥', + '40011' => '公众å¸å·ç”Ÿæˆå›žåŒ…xml失败' + ); + + /** + * 获å–错误消æ¯å†…容 + * @param string $err + * @return bool + */ + public static function getErrText($err) + { + if (isset(self::$errCode[$err])) { + return self::$errCode[$err]; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php new file mode 100644 index 00000000000..6558a8e48da --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php @@ -0,0 +1,308 @@ + + * @date 2016/05/28 11:55 + */ +class Tools +{ + + /** + * 判断字符串是å¦ç»è¿‡ç¼–ç æ–¹æ³• + * @param string $str + * @return bool + */ + static public function isBase64($str) + { + if ($str == base64_encode(base64_decode($str))) { + return true; + } else { + return false; + } + } + + /** + * 产生éšæœºå­—符串 + * @param int $length 指定字符长度 + * @param string $str 字符串å‰ç¼€ + * @return string + */ + static public function createNoncestr($length = 32, $str = "") + { + $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; + for ($i = 0; $i < $length; $i++) { + $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); + } + return $str; + } + + /** + * æ•°æ®ç”Ÿæˆç­¾å + * @param array $data ç­¾å数组 + * @param string $method ç­¾å方法 + * @return bool|string ç­¾å值 + */ + static public function getSignature($data, $method = "sha1") + { + if (!function_exists($method)) { + return false; + } + ksort($data); + $params = array(); + foreach ($data as $key => $value) { + $params[] = "{$key}={$value}"; + } + return $method(join('&', $params)); + } + + /** + * 生æˆæ”¯ä»˜ç­¾å + * @param array $option + * @param string $partnerKey + * @return string + */ + static public function getPaySign($option, $partnerKey) + { + ksort($option); + $buff = ''; + foreach ($option as $k => $v) { + $buff .= "{$k}={$v}&"; + } + return strtoupper(md5("{$buff}key={$partnerKey}")); + } + + /** + * XMLç¼–ç  + * @param mixed $data æ•°æ® + * @param string $root 根节点å + * @param string $item 数字索引的å­èŠ‚点å + * @param string $id 数字索引å­èŠ‚点key转æ¢çš„属性å + * @return string + */ + static public function arr2xml($data, $root = 'xml', $item = 'item', $id = 'id') + { + return "<{$root}>" . self::_data_to_xml($data, $item, $id) . ""; + } + + /** + * XMLå†…å®¹ç”Ÿæˆ + * @param array $data æ•°æ® + * @param string $item å­èŠ‚点 + * @param string $id 节点ID + * @param string $content 节点内容 + * @return string + */ + static private function _data_to_xml($data, $item = 'item', $id = 'id', $content = '') + { + foreach ($data as $key => $val) { + is_numeric($key) && $key = "{$item} {$id}=\"{$key}\""; + $content .= "<{$key}>"; + if (is_array($val) || is_object($val)) { + $content .= self::_data_to_xml($val); + } elseif (is_numeric($val)) { + $content .= $val; + } else { + $content .= ''; + } + list($_key, ) = explode(' ', $key . ' '); + $content .= ""; + } + return $content; + } + + /** + * å°†xml转为array + * @param string $xml + * @return array + */ + static public function xml2arr($xml) + { + $disableEntities = libxml_disable_entity_loader(true); + $result = json_decode(Tools::json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); + libxml_disable_entity_loader($disableEntities); + return $result; + } + + /** + * 生æˆå®‰å…¨JSONæ•°æ® + * @param array $array + * @return string + */ + static public function json_encode($array) + { + return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', function ($matches) { + return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE"); + }, json_encode($array)); + } + + /** + * 以getæ–¹å¼æ交请求 + * @param $url + * @return bool|mixed + */ + static public function httpGet($url) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_SSLVERSION, 1); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_TIMEOUT, 30); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); + return (intval($status["http_code"]) === 200) ? $content : false; + } + + /** + * 以postæ–¹å¼æ交请求 + * @param string $url + * @param array|string $data + * @return bool|mixed + */ + static public function httpPost($url, $data) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HEADER, false); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildPost($data)); + list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); + return (intval($status["http_code"]) === 200) ? $content : false; + } + + /** + * 使用è¯ä¹¦ï¼Œä»¥postæ–¹å¼æ交xml到对应的接å£url + * @param string $url POSTæ交的内容 + * @param array $data è¯·æ±‚çš„åœ°å€ + * @param string $ssl_cer è¯ä¹¦Cer路径 | è¯ä¹¦å†…容 + * @param string $ssl_key è¯ä¹¦Key路径 | è¯ä¹¦å†…容 + * @param int $second 设置请求超时时间 + * @return bool|mixed + */ + static public function httpsPost($url, $data, $ssl_cer = null, $ssl_key = null, $second = 30) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_TIMEOUT, $second); + curl_setopt($curl, CURLOPT_HEADER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + if (!is_null($ssl_cer) && file_exists($ssl_cer) && is_file($ssl_cer)) { + curl_setopt($curl, CURLOPT_SSLCERTTYPE, 'PEM'); + curl_setopt($curl, CURLOPT_SSLCERT, $ssl_cer); + } + if (!is_null($ssl_key) && file_exists($ssl_key) && is_file($ssl_key)) { + curl_setopt($curl, CURLOPT_SSLKEYTYPE, 'PEM'); + curl_setopt($curl, CURLOPT_SSLKEY, $ssl_key); + } + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, self::_buildPost($data)); + list($content, $status) = array(curl_exec($curl), curl_getinfo($curl), curl_close($curl)); + return (intval($status["http_code"]) === 200) ? $content : false; + } + + /** + * POSTæ•°æ®è¿‡æ»¤å¤„ç† + * @param array $data + * @return array + */ + static private function _buildPost(&$data) + { + if (is_array($data)) { + foreach ($data as &$value) { + if (is_string($value) && $value[0] === '@' && class_exists('CURLFile', false)) { + $filename = realpath(trim($value, '@')); + file_exists($filename) && $value = new CURLFile($filename); + } + } + } + return $data; + } + + /** + * 读å–微信客户端IP + * @return null|string + */ + static public function getAddress() + { + foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP', 'REMOTE_ADDR') as $header) { + if (!isset($_SERVER[$header]) || ($spoof = $_SERVER[$header]) === null) { + continue; + } + sscanf($spoof, '%[^,]', $spoof); + if (!filter_var($spoof, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { + $spoof = null; + } else { + return $spoof; + } + } + return '0.0.0.0'; + } + + /** + * 设置缓存,按需é‡è½½ + * @param string $cachename + * @param mixed $value + * @param int $expired + * @return bool + */ + static public function setCache($cachename, $value, $expired = 0) + { + return Cache::set($cachename, $value, $expired); + } + + /** + * 获å–缓存,按需é‡è½½ + * @param string $cachename + * @return mixed + */ + static public function getCache($cachename) + { + return Cache::get($cachename); + } + + /** + * 清除缓存,按需é‡è½½ + * @param string $cachename + * @return bool + */ + static public function removeCache($cachename) + { + return Cache::del($cachename); + } + + /** + * SDK日志处ç†æ–¹æ³• + * @param string $msg 日志行内容 + * @param string $type 日志级别 + */ + static public function log($msg, $type = 'MSG') + { + Cache::put($type . ' - ' . $msg); + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php new file mode 100644 index 00000000000..eb2f36f92aa --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/Loader.php @@ -0,0 +1,129 @@ + + * @date 2016/10/26 10:21 + */ +spl_autoload_register(function ($class) { + if (0 === stripos($class, 'Wechat\\')) { + $filename = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; + if (file_exists($filename)) require $filename; + } +}); + +/** + * 微信SDK加载器 + * @author Anyon + * @date 2016-08-21 11:06 + */ +class Loader +{ + + /** + * 事件注册函数 + * @var array + */ + static public $callback = array(); + + /** + * é…ç½®å‚æ•° + * @var array + */ + static protected $config = array(); + + /** + * 对象缓存 + * @var array + */ + static protected $cache = array(); + + /** + * 动æ€æ³¨å†ŒSDK事件处ç†å‡½æ•° + * @param string $event 事件å称(getAccessToken|getJsTicket) + * @param string $method 处ç†æ–¹æ³•ï¼ˆå¯ä»¥æ˜¯æ™®é€šæ–¹æ³•æˆ–者类中的方法) + * @param string|null $class 处ç†å¯¹è±¡ï¼ˆå¯ä»¥ç›´æŽ¥ä½¿ç”¨çš„类实例) + */ + static public function register($event, $method, $class = null) + { + if (!empty($class) && class_exists($class, false) && method_exists($class, $method)) { + self::$callback[$event] = array($class, $method); + } else { + self::$callback[$event] = $method; + } + } + + /** + * 获å–微信SDK接å£å¯¹è±¡(别å函数) + * @param string $type 接å£ç±»åž‹(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi) + * @param array $config SDKé…ç½®(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img) + * @return WechatCard|WechatCustom|WechatDevice|WechatExtends|WechatMedia|WechatMenu|WechatOauth|WechatPay|WechatPoi|WechatReceive|WechatScript|WechatService|WechatUser + */ + static public function get_instance($type, $config = array()) + { + return self::get($type, $config); + } + + /** + * 获å–微信SDK接å£å¯¹è±¡ + * @param string $type 接å£ç±»åž‹(Card|Custom|Device|Extends|Media|Menu|Oauth|Pay|Receive|Script|User|Poi) + * @param array $config SDKé…ç½®(token,appid,appsecret,encodingaeskey,mch_id,partnerkey,ssl_cer,ssl_key,qrc_img) + * @return WechatCard|WechatCustom|WechatDevice|WechatExtends|WechatMedia|WechatMenu|WechatOauth|WechatPay|WechatPoi|WechatReceive|WechatScript|WechatService|WechatUser + */ + static public function get($type, $config = array()) + { + $index = md5(strtolower($type) . md5(json_encode(self::$config))); + if (!isset(self::$cache[$index])) { + $basicName = 'Wechat' . ucfirst(strtolower($type)); + $className = "\\Wechat\\{$basicName}"; + // 注册类的无命å空间别å,兼容未带命å空间的è€ç‰ˆæœ¬SDK + !class_exists($basicName, false) && class_alias($className, $basicName); + self::$cache[$index] = new $className(self::config($config)); + } + return self::$cache[$index]; + } + + /** + * 设置é…ç½®å‚æ•° + * @param array $config + * @return array + */ + static public function config($config = array()) + { + !empty($config) && self::$config = array_merge(self::$config, $config); + if (!empty(self::$config['cachepath'])) { + Cache::$cachepath = self::$config['cachepath']; + } + if (empty(self::$config['component_verify_ticket'])) { + self::$config['component_verify_ticket'] = Cache::get('component_verify_ticket'); + } + if (empty(self::$config['token']) && !empty(self::$config['component_token'])) { + self::$config['token'] = self::$config['component_token']; + } + if (empty(self::$config['appsecret']) && !empty(self::$config['component_appsecret'])) { + self::$config['appsecret'] = self::$config['component_appsecret']; + } + if (empty(self::$config['encodingaeskey']) && !empty(self::$config['component_encodingaeskey'])) { + self::$config['encodingaeskey'] = self::$config['component_encodingaeskey']; + } + return self::$config; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php new file mode 100644 index 00000000000..b6dd3855854 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCard.php @@ -0,0 +1,819 @@ +access_token && !$this->getAccessToken()) { + return false; + } + $appid = empty($appid) ? $this->appid : $appid; + if ($jsapi_ticket) { + return $jsapi_ticket; + } + $authname = 'wechat_jsapi_ticket_wxcard_' . $appid; + if (($jsapi_ticket = Tools::getCache($authname))) { + return $jsapi_ticket; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::GET_TICKET_URL . "access_token={$this->access_token}&type=wx_card"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + $expire = $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600; + Tools::setCache($authname, $json['ticket'], $expire); + return $json['ticket']; + } + return false; + } + + /** + * 生æˆé€‰æ‹©å¡å·JSç­¾å包 + * @param string $cardid å¡åˆ¸Id + * @param string $cardtype å¡åˆ¸ç±»åž‹ + * @param string $shopid 门店Id + * @return array + */ + public function createChooseCardJsPackage($cardid = null, $cardtype = null, $shopid = null) + { + $data = array(); + $data['api_ticket'] = $this->getJsCardTicket(); + $data['app_id'] = $this->appid; + $data['timestamp'] = time(); + $data['nonceStr'] = Tools::createNoncestr(); + !empty($cardid) && $data['cardId'] = $cardid; + !empty($cardtype) && $data['cardType'] = $cardtype; + !empty($shopid) && $data['shopId'] = $shopid; + $data['cardSign'] = $this->getTicketSignature($data); + $data['signType'] = 'SHA1'; + unset($data['api_ticket'], $data['app_id']); + return $data; + } + + /** + * 生æˆæ·»åŠ å¡å·JSç­¾å包 + * @param string|null $cardid å¡å·ID + * @param array $data 其它é™å®šå‚æ•° + * @return array + */ + public function createAddCardJsPackage($cardid = null, $data = array()) + { + $cardList = array(); + if (is_array($cardid)) { + foreach ($cardid as $id) { + $cardList[] = array('cardId' => $id, 'cardExt' => json_encode($this->_cardSign($id, $data))); + } + } else { + $cardList[] = array('cardId' => $cardid, 'cardExt' => json_encode($this->_cardSign($cardid, $data))); + } + return array('cardList' => $cardList); + } + + /** + * å¡åˆ¸æ•°æ®ç­¾å + * @param null|string $cardid + * @param array $attr + * @return array + */ + private function _cardSign($cardid = null, $attr = array()) + { + unset($attr['outer_id']); + $attr['cardId'] = $cardid; + $attr['timestamp'] = time(); + $attr['api_ticket'] = $this->getJsCardTicket(); + $attr['nonce_str'] = Tools::createNoncestr(); + $attr['signature'] = $this->getTicketSignature($attr); + unset($attr['api_ticket']); + return $attr; + } + + /** + * 获å–微信å¡åˆ¸ç­¾å + * @param array $arrdata ç­¾å数组 + * @param string $method ç­¾å方法 + * @return bool|string ç­¾å值 + */ + public function getTicketSignature($arrdata, $method = "sha1") + { + if (!function_exists($method)) { + return false; + } + $newArray = array(); + foreach ($arrdata as $value) { + array_push($newArray, (string)$value); + } + sort($newArray, SORT_STRING); + return $method(implode($newArray)); + } + + /** + * 创建å¡åˆ¸ + * @param array $data å¡åˆ¸æ•°æ® + * @return bool|array 返回数组中card_id为å¡åˆ¸ID + */ + public function createCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更改å¡åˆ¸ä¿¡æ¯ + * 调用该接å£æ›´æ–°ä¿¡æ¯åŽä¼šé‡æ–°é€å®¡ï¼Œå¡åˆ¸çŠ¶æ€å˜æ›´ä¸ºå¾…审核。已被用户领å–çš„å¡åˆ¸ä¼šå®žæ—¶æ›´æ–°ç¥¨é¢ä¿¡æ¯ã€‚ + * @param string $data + * @return bool + */ + public function updateCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 删除å¡åˆ¸ + * å…许商户删除任æ„一类å¡åˆ¸ã€‚删除å¡åˆ¸åŽï¼Œè¯¥å¡åˆ¸å¯¹åº”已生æˆçš„领å–用二维ç ã€æ·»åŠ åˆ°å¡åŒ… JS API å‡ä¼šå¤±æ•ˆã€‚ + * 注æ„:删除å¡åˆ¸ä¸èƒ½åˆ é™¤å·²è¢«ç”¨æˆ·é¢†å–,ä¿å­˜åœ¨å¾®ä¿¡å®¢æˆ·ç«¯ä¸­çš„å¡åˆ¸ï¼Œå·²é¢†å–çš„å¡åˆ¸ä¾æ—§æœ‰æ•ˆã€‚ + * @param string $card_id å¡åˆ¸ID + * @return bool + */ + public function delCard($card_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 获å–粉ä¸ä¸‹æ‰€æœ‰å¡å·åˆ—表 + * @param $openid 粉ä¸openid + * @param string $card_id å¡å·ID(å¯ä¸ç»™ï¼‰ + * @return bool|array + */ + public function getCardList($openid, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_USER_GET_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–图文消æ¯ç¾¤å‘å¡åˆ¸HTML + * @param string $card_id å¡å·ID + * @return bool|array + */ + public function getCardMpHtml($card_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_SEND_HTML . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * å¡å·code核查 + * @param string $card_id å¡å·ID + * @param array $code_list å¡å·code列表(一维数组) + * @return bool|array + */ + public function checkCardCodeList($card_id, $code_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id, 'code' => $code_list); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CHECKCODE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询å¡åˆ¸è¯¦æƒ… + * @param string $card_id å¡å·ID + * @return bool|array + */ + public function getCardInfo($card_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_GET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–颜色列表 + * 获得å¡åˆ¸çš„最新颜色列表,用于创建å¡åˆ¸ + * @return bool|array + */ + public function getCardColors() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CARD_GETCOLORS . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 生æˆå¡åˆ¸äºŒç»´ç  + * æˆåŠŸåˆ™ç›´æŽ¥è¿”回ticket值,å¯ä»¥ç”¨ getQRUrl($ticket) æ¢å–二维ç url + * @param string $card_id å¡åˆ¸ID å¿…é¡» + * @param string $code 指定å¡åˆ¸ code ç ï¼Œåªèƒ½è¢«é¢†ä¸€æ¬¡ã€‚use_custom_code 字段为 true çš„å¡åˆ¸å¿…须填写,éžè‡ªå®šä¹‰ code ä¸å¿…填写。 + * @param string $openid 指定领å–者的 openid,åªæœ‰è¯¥ç”¨æˆ·èƒ½é¢†å–。bind_openid 字段为 true çš„å¡åˆ¸å¿…须填写,éžè‡ªå®šä¹‰ openid ä¸å¿…填写。 + * @param int $expire_seconds 指定二维ç çš„有效时间,范围是 60 ~ 1800 秒。ä¸å¡«é»˜è®¤ä¸ºæ°¸ä¹…有效。 + * @param bool $is_unique_code 指定下å‘二维ç ï¼Œç”Ÿæˆçš„二维ç éšæœºåˆ†é…一个 code,领å–åŽä¸å¯å†æ¬¡æ‰«æ。填写 true 或 false。默认 false。 + * @param string $balance 红包余é¢ï¼Œä»¥åˆ†ä¸ºå•ä½ã€‚红包类型必填(LUCKY_MONEY),其他å¡åˆ¸ç±»åž‹ä¸å¡«ã€‚ + * @return bool|string + */ + public function createCardQrcode($card_id, $code = '', $openid = '', $expire_seconds = 0, $is_unique_code = false, $balance = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $card = array('card_id' => $card_id); + !empty($code) && $card['code'] = $code; + !empty($openid) && $card['openid'] = $openid; + !empty($is_unique_code) && $card['is_unique_code'] = $is_unique_code; + !empty($balance) && $card['balance'] = $balance; + $data = array('action_name' => "QR_CARD"); + !empty($expire_seconds) && $data['expire_seconds'] = $expire_seconds; + $data['action_info'] = array('card' => $card); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_QRCODE_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 消耗 code + * 自定义 code(use_custom_code 为 true)的优惠券,在 code 被核销时,必须调用此接å£ã€‚ + * @param string $code è¦æ¶ˆè€—çš„åºåˆ—å· + * @param string $card_id è¦æ¶ˆè€—åºåˆ—å·æ‰€è¿°çš„ card_id,创建å¡åˆ¸æ—¶use_custom_code 填写 true 时必填。 + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "card":{"card_id":"pFS7Fjg8kV1IdDz01r4SQwMkuCKc"}, + * "openid":"oFS7Fjl0WsZ9AMZqrI80nbIq8xrA" + * } + */ + public function consumeCardCode($code, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_CONSUME . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * code è§£ç  + * @param string $encrypt_code 通过 choose_card_info 获å–的加密字符串 + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "code":"751234212312" + * } + */ + public function decryptCardCode($encrypt_code) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('encrypt_code' => $encrypt_code,); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_DECRYPT . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询 code 的有效性(éžè‡ªå®šä¹‰ code) + * @param string $code + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "openid":"oFS7Fjl0WsZ9AMZqrI80nbIq8xrA", //用户 openid + * "card":{ + * "card_id":"pFS7Fjg8kV1IdDz01r4SQwMkuCKc", + * "begin_time": 1404205036, //起始使用时间 + * "end_time": 1404205036, //结æŸæ—¶é—´ + * } + * } + */ + public function checkCardCode($code) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_GET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡æŸ¥è¯¢å¡åˆ—表 + * @param int $offset 开始拉å–çš„å移,默认为0从头开始 + * @param int $count 需è¦æŸ¥è¯¢çš„å¡ç‰‡çš„æ•°é‡ï¼ˆæ•°é‡æœ€å¤§50,默认50) + * @return bool|array + * { + * "errcode":0, + * "errmsg":"ok", + * "card_id_list":["ph_gmt7cUVrlRk8swPwx7aDyF-pg"], //å¡ id 列表 + * "total_num":1 //该商户å下 card_id 总数 + * } + */ + public function getCardIdList($offset = 0, $count = 50) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $count > 50 && $count = 50; + $data = array('offset' => $offset, 'count' => $count); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_BATCHGET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更改 code + * 为确ä¿è½¬èµ åŽçš„安全性,微信å…许自定义code的商户对已下å‘çš„code进行更改。 + * 注:为é¿å…用户疑惑,建议仅在å‘生转赠行为åŽï¼ˆå‘生转赠åŽï¼Œå¾®ä¿¡ä¼šé€šè¿‡äº‹ä»¶æŽ¨é€çš„æ–¹å¼å‘ŠçŸ¥å•†æˆ·è¢«è½¬èµ çš„å¡åˆ¸code)对用户的code进行更改。 + * @param string $code å¡åˆ¸çš„ code ç¼–ç  + * @param string $card_id å¡åˆ¸ ID + * @param string $new_code æ–°çš„å¡åˆ¸ code ç¼–ç  + * @return bool + */ + public function updateCardCode($code, $card_id, $new_code) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code, 'card_id' => $card_id, 'new_code' => $new_code); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 设置å¡åˆ¸å¤±æ•ˆ + * 设置å¡åˆ¸å¤±æ•ˆçš„æ“作ä¸å¯é€† + * @param string $code 需è¦è®¾ç½®ä¸ºå¤±æ•ˆçš„ code + * @param string $card_id 自定义 code çš„å¡åˆ¸å¿…填。éžè‡ªå®šä¹‰ code çš„å¡åˆ¸ä¸å¡«ã€‚ + * @return bool + */ + public function unavailableCardCode($code, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_CODE_UNAVAILABLE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 库存修改 + * @param string $data + * @return bool + */ + public function modifyCardStock($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MODIFY_STOCK . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 更新门票 + * @param string $data + * @return bool + */ + public function updateMeetingCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEETINGCARD_UPDATEUSER . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 激活/ç»‘å®šä¼šå‘˜å¡ + * @param string $data 具体结构请å‚看å¡åˆ¸å¼€å‘文档(6.1.1 激活/绑定会员å¡)章节 + * @return bool + */ + public function activateMemberCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_ACTIVATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 会员å¡äº¤æ˜“ + * 会员å¡äº¤æ˜“åŽæ¯æ¬¡ç§¯åˆ†åŠä½™é¢å˜æ›´éœ€é€šè¿‡æŽ¥å£é€šçŸ¥å¾®ä¿¡ï¼Œä¾¿äºŽåŽç»­æ¶ˆæ¯é€šçŸ¥åŠå…¶ä»–扩展功能。 + * @param string $data 具体结构请å‚看å¡åˆ¸å¼€å‘文档(6.1.2 会员å¡äº¤æ˜“)章节 + * @return bool|array + */ + public function updateMemberCard($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_UPDATEUSER . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 设置å¡åˆ¸æµ‹è¯•ç™½åå• + * @param array $openid 测试的 openid 列表 + * @param array $user 测试的微信å·åˆ—表 + * @return bool + */ + public function setCardTestWhiteList($openid = array(), $user = array()) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array(); + count($openid) > 0 && $data['openid'] = $openid; + count($user) > 0 && $data['username'] = $user; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_TESTWHILELIST_SET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * æ›´æ–°çº¢åŒ…é‡‘é¢ + * @param string $code 红包的åºåˆ—å· + * @param int $balance çº¢åŒ…ä½™é¢ + * @param string $card_id 自定义 code çš„å¡åˆ¸å¿…填。éžè‡ªå®šä¹‰ code å¯ä¸å¡«ã€‚ + * @return bool|array + */ + public function updateLuckyMoney($code, $balance, $card_id = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('code' => $code, 'balance' => $balance); + !empty($card_id) && $data['card_id'] = $card_id; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_LUCKYMONEY_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * è®¾ç½®è‡ªåŠ©æ ¸é”€æŽ¥å£ + * @param string $card_id å¡åˆ¸ID + * @param bool $is_openid 是å¦å¼€å¯è‡ªåŠ©æ ¸é”€åŠŸèƒ½ï¼Œå¡«true/false,默认为false + * @param bool $need_verify_cod 用户核销时是å¦éœ€è¦è¾“入验è¯ç ï¼Œå¡«true/false,默认为false + * @param bool $need_remark_amount 用户核销时是å¦éœ€è¦å¤‡æ³¨æ ¸é”€é‡‘é¢ï¼Œå¡«true/false,默认为false + * @return bool|array + */ + public function setSelfconsumecell($card_id, $is_openid = false, $need_verify_cod = false, $need_remark_amount = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array( + 'card_id' => $card_id, + 'is_open' => $is_openid, + 'need_verify_cod' => $need_verify_cod, + 'need_remark_amount' => $need_remark_amount, + ); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_SET_SELFCONSUMECELL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 设置买å•æŽ¥å£ + * @param string $card_id + * @param bool $is_openid + * @return bool|mixed + */ + public function setPaycell($card_id, $is_openid = true) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('card_id' => $card_id, 'is_open' => $is_openid,); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_PAYCELL_SET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 设置开å¡å­—段信æ¯æŽ¥å£ + * @param array $data + * @return bool|array + */ + public function setMembercardActivateuserform($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CARD_MEMBERCARD_ACTIVATEUSERFORM_SET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php new file mode 100644 index 00000000000..76e6ded5b49 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php @@ -0,0 +1,385 @@ +access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_RECORD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–多客æœå®¢æœåŸºæœ¬ä¿¡æ¯ + * + * @return bool|array + */ + public function getCustomServiceKFlist() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_KFLIST . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–多客æœåœ¨çº¿å®¢æœæŽ¥å¾…ä¿¡æ¯ + * + * @return bool|array + */ + public function getCustomServiceOnlineKFlist() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::CUSTOM_SERVICE_GET_ONLINEKFLIST . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 创建指定多客æœä¼šè¯ + * @tutorial 当用户已被其他客æœæŽ¥å¾…或指定客æœä¸åœ¨çº¿åˆ™ä¼šå¤±è´¥ + * @param string $openid //用户openid + * @param string $kf_account //客æœè´¦å· + * @param string $text //附加信æ¯ï¼Œæ–‡æœ¬ä¼šå±•ç¤ºåœ¨å®¢æœäººå‘˜çš„多客æœå®¢æˆ·ç«¯ï¼Œå¯ä¸ºç©º + * @return bool|array + */ + public function createKFSession($openid, $kf_account, $text = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("openid" => $openid, "kf_account" => $kf_account); + $text !== '' && $data["text"] = $text; + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_CREATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 关闭指定多客æœä¼šè¯ + * @tutorial 当用户被其他客æœæŽ¥å¾…时则会失败 + * @param string $openid //用户openid + * @param string $kf_account //客æœè´¦å· + * @param string $text //附加信æ¯ï¼Œæ–‡æœ¬ä¼šå±•ç¤ºåœ¨å®¢æœäººå‘˜çš„多客æœå®¢æˆ·ç«¯ï¼Œå¯ä¸ºç©º + * @return bool | array //æˆåŠŸè¿”回json数组 + * { + * "errcode": 0, + * "errmsg": "ok", + * } + */ + public function closeKFSession($openid, $kf_account, $text = '') + { + $data = array("openid" => $openid, "kf_account" => $kf_account); + if ($text) { + $data["text"] = $text; + } + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_CLOSE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–用户会è¯çŠ¶æ€ + * @param string $openid //用户openid + * @return bool | array //æˆåŠŸè¿”回json数组 + * { + * "errcode" : 0, + * "errmsg" : "ok", + * "kf_account" : "test1@test", //æ­£åœ¨æŽ¥å¾…çš„å®¢æœ + * "createtime": 123456789, //会è¯æŽ¥å…¥æ—¶é—´ + * } + */ + public function getKFSession($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET . "access_token={$this->access_token}" . '&openid=' . $openid); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–èŠå¤©è®°å½• + * @param array $data æ•°æ®ç»“æž„ {"starttime" : 987654321,"endtime" : 987654321,"msgid" : 1,"number" : 10000} + * @return bool|array + */ + public function getCustomMsgList($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SERVICE_GET_MSG_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–指定客æœçš„会è¯åˆ—表 + * @param string $kf_account //用户openid + * @return bool | array //æˆåŠŸè¿”回json数组 + * array( + * 'sessionlist' => array ( + * array ( + * 'openid'=>'OPENID', //客户 openid + * 'createtime'=>123456789, //会è¯åˆ›å»ºæ—¶é—´ï¼ŒUNIX 时间戳 + * ), + * array ( + * 'openid'=>'OPENID', //客户 openid + * 'createtime'=>123456789, //会è¯åˆ›å»ºæ—¶é—´ï¼ŒUNIX 时间戳 + * ), + * ) + * ) + */ + public function getKFSessionlist($kf_account) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET_LIST . "access_token={$this->access_token}" . '&kf_account=' . $kf_account); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–未接入会è¯åˆ—表 + * @return bool|array + */ + public function getKFSessionWait() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET_WAIT . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 添加客æœè´¦å· + * + * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) + * @param string $nickname 客æœæ˜µç§°ï¼Œæœ€é•¿6个汉字或12个英文字符 + * @param string $password 客æœè´¦å·æ˜Žæ–‡ç™»å½•å¯†ç ï¼Œä¼šè‡ªåŠ¨åŠ å¯† + * @return bool|array + */ + public function addKFAccount($account, $nickname, $password) + { + $data = array("kf_account" => $account, "nickname" => $nickname, "password" => md5($password)); + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 修改客æœè´¦å·ä¿¡æ¯ + * + * @param string $account //完整客æœè´¦å·ï¼Œæ ¼å¼ä¸ºï¼šè´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符,必须是英文或者数字字符 + * @param string $nickname //客æœæ˜µç§°ï¼Œæœ€é•¿6个汉字或12个英文字符 + * @param string $password //客æœè´¦å·æ˜Žæ–‡ç™»å½•å¯†ç ï¼Œä¼šè‡ªåŠ¨åŠ å¯† + * @return bool|array + * æˆåŠŸè¿”回结果 + * { + * "errcode": 0, + * "errmsg": "ok", + * } + */ + public function updateKFAccount($account, $nickname, $password) + { + $data = array("kf_account" => $account, "nickname" => $nickname, "password" => md5($password)); + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除客æœè´¦å· + * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) + * @return bool|array + */ + public function deleteKFAccount($account) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_DEL_URL . "access_token={$this->access_token}" . '&kf_account=' . $account); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传客æœå¤´åƒ + * @param string $account 完整客æœè´¦å·(è´¦å·å‰ç¼€@公众å·å¾®ä¿¡å·ï¼Œè´¦å·å‰ç¼€æœ€å¤š10个字符) + * @param string $imgfile 头åƒæ–‡ä»¶å®Œæ•´è·¯å¾„,如:'D:\user.jpg'。头åƒæ–‡ä»¶å¿…é¡»JPGæ ¼å¼ï¼Œåƒç´ å»ºè®®640*640 + * @return bool|array + */ + public function setKFHeadImg($account, $imgfile) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CS_KF_ACCOUNT_UPLOAD_HEADIMG_URL . "access_token={$this->access_token}&kf_account={$account}", array('media' => '@' . $imgfile)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php new file mode 100644 index 00000000000..932321ac2b6 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php @@ -0,0 +1,467 @@ + + * @date 2016-08-22 10:35 + */ +class WechatDevice extends Common +{ + + const SHAKEAROUND_DEVICE_APPLYID = '/shakearound/device/applyid?'; //申请设备ID + const SHAKEAROUND_DEVICE_APPLYSTATUS = '/shakearound/device/applystatus?'; //查询设备IDç”³è¯·å®¡æ ¸çŠ¶æ€ + const SHAKEAROUND_DEVICE_UPDATE = '/shakearound/device/update?'; //ç¼–è¾‘è®¾å¤‡ä¿¡æ¯ + const SHAKEAROUND_DEVICE_SEARCH = '/shakearound/device/search?'; //查询设备列表 + const SHAKEAROUND_DEVICE_BINDLOCATION = '/shakearound/device/bindlocation?'; //é…置设备与门店ID的关系 + const SHAKEAROUND_DEVICE_BINDPAGE = '/shakearound/device/bindpage?'; //é…置设备与页é¢çš„绑定关系 + const SHAKEAROUND_MATERIAL_ADD = '/shakearound/material/add?'; //上传摇一摇图片素æ + const SHAKEAROUND_PAGE_ADD = '/shakearound/page/add?'; //å¢žåŠ é¡µé¢ + const SHAKEAROUND_PAGE_UPDATE = '/shakearound/page/update?'; //ç¼–è¾‘é¡µé¢ + const SHAKEAROUND_PAGE_SEARCH = '/shakearound/page/search?'; //查询页é¢åˆ—表 + const SHAKEAROUND_PAGE_DELETE = '/shakearound/page/delete?'; //åˆ é™¤é¡µé¢ + const SHAKEAROUND_USER_GETSHAKEINFO = '/shakearound/user/getshakeinfo?'; //获å–摇周边的设备åŠç”¨æˆ·ä¿¡æ¯ + const SHAKEAROUND_STATISTICS_DEVICE = '/shakearound/statistics/device?'; //以设备为维度的数æ®ç»Ÿè®¡æŽ¥å£ + const SHAKEAROUND_STATISTICS_PAGE = '/shakearound/statistics/page?'; //以页é¢ä¸ºç»´åº¦çš„æ•°æ®ç»Ÿè®¡æŽ¥å£ + + + /** + * 申请设备ID + * @param array $data + * @return bool|array + */ + public function applyShakeAroundDevice($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_APPLYID . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询设备IDç”³è¯·å®¡æ ¸çŠ¶æ€ + * @param int $apply_id + * @return bool|array + */ + public function applyStatusShakeAroundDevice($apply_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("apply_id" => $apply_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_APPLYSTATUS . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * ç¼–è¾‘è®¾å¤‡ä¿¡æ¯ + * @param array $data + * @return bool + */ + public function updateShakeAroundDevice($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + + /** + * 查询设备列表 + * @param $data + * @return bool|array + */ + public function searchShakeAroundDevice($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_SEARCH . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * é…置设备与门店的关è”关系 + * @param string $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,则å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼Œè‹¥äºŒè€…都填,则以设备编å·ä¸ºä¼˜å…ˆ + * @param int $poi_id å¾…å…³è”的门店ID + * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæ•´ï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–å·ï¼Œåˆ™å¯ä¸å¡«æ­¤ä¿¡æ¯ + * @param int $major + * @param int $minor + * @return bool|array + */ + public function bindLocationShakeAroundDevice($device_id, $poi_id, $uuid = '', $major = 0, $minor = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!$device_id) { + if (!$uuid || !$major || !$minor) { + return false; + } + $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); + } else { + $device_identifier = array('device_id' => $device_id); + } + $data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * é…置设备与其他公众账å·é—¨åº—çš„å…³è”关系 + * @param type $device_identifier è®¾å¤‡ä¿¡æ¯ + * @param type $poi_id å¾…å…³è”的门店ID + * @param type $poi_appid 目标微信appid + * @return boolean + */ + public function bindLocationOtherShakeAroundDevice($device_identifier, $poi_id, $poi_appid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id, "type" => 2, "poi_appid" => $poi_appid); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * é…置设备与页é¢çš„å…³è”关系 + * @param string $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,则å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼Œè‹¥äºŒè€…都填,则以设备编å·ä¸ºä¼˜å…ˆ + * @param array $page_ids å¾…å…³è”的页é¢åˆ—表 + * @param int $bind å…³è”æ“作标志ä½ï¼Œ 0 为解除关è”关系,1 为建立关è”关系 + * @param int $append 新增æ“作标志ä½ï¼Œ 0 为覆盖,1 为新增 + * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæ•´ï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–å·ï¼Œåˆ™å¯ä¸å¡«æ­¤ä¿¡æ¯ + * @param int $major + * @param int $minor + * @return bool|array + */ + public function bindPageShakeAroundDevice($device_id, $page_ids = array(), $bind = 1, $append = 1, $uuid = '', $major = 0, $minor = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!$device_id) { + if (!$uuid || !$major || !$minor) { + return false; + } + $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); + } else { + $device_identifier = array('device_id' => $device_id); + } + $data = array('device_identifier' => $device_identifier, 'page_ids' => $page_ids, 'bind' => $bind, 'append' => $append); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDPAGE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 上传在摇一摇页é¢å±•ç¤ºçš„图片素æ + * @param array $data {"media":'@Path\filename.jpg'} + * @return bool|array + */ + public function uploadShakeAroundMedia($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_MATERIAL_ADD . "access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 增加摇一摇出æ¥çš„页é¢ä¿¡æ¯ + * @param string $title 在摇一摇页é¢å±•ç¤ºçš„主标题,ä¸è¶…过6 个字 + * @param string $description 在摇一摇页é¢å±•ç¤ºçš„副标题,ä¸è¶…过7 个字 + * @param string $icon_url 在摇一摇页é¢å±•ç¤ºçš„图片, æ ¼å¼é™å®šä¸ºï¼šjpg,jpeg,png,gif; 建议120*120 , é™åˆ¶ä¸è¶…过200*200 + * @param string $page_url 跳转链接 + * @param string $comment 页é¢çš„备注信æ¯ï¼Œä¸è¶…过15 个字,å¯ä¸å¡« + * @return bool|array + */ + public function addShakeAroundPage($title, $description, $icon_url, $page_url, $comment = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("title" => $title, "description" => $description, "icon_url" => $icon_url, "page_url" => $page_url, "comment" => $comment); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_ADD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 编辑摇一摇出æ¥çš„页é¢ä¿¡æ¯ + * @param int $page_id + * @param string $title 在摇一摇页é¢å±•ç¤ºçš„主标题,ä¸è¶…过6 个字 + * @param string $description 在摇一摇页é¢å±•ç¤ºçš„副标题,ä¸è¶…过7 个字 + * @param string $icon_url 在摇一摇页é¢å±•ç¤ºçš„图片, æ ¼å¼é™å®šä¸ºï¼šjpg,jpeg,png,gif; 建议120*120 , é™åˆ¶ä¸è¶…过200*200 + * @param string $page_url 跳转链接 + * @param string $comment 页é¢çš„备注信æ¯ï¼Œä¸è¶…过15 个字,å¯ä¸å¡« + * @return bool|array + */ + public function updateShakeAroundPage($page_id, $title, $description, $icon_url, $page_url, $comment = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array("page_id" => $page_id, "title" => $title, "description" => $description, "icon_url" => $icon_url, "page_url" => $page_url, "comment" => $comment); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * æŸ¥è¯¢å·²æœ‰çš„é¡µé¢ + * @param array $page_ids + * @param int $begin + * @param int $count + * @return bool|mixed + */ + public function searchShakeAroundPage($page_ids = array(), $begin = 0, $count = 1) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!empty($page_ids)) { + $data = array('page_ids' => $page_ids); + } else { + $data = array('begin' => $begin, 'count' => $count); + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_SEARCH . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * åˆ é™¤å·²æœ‰çš„é¡µé¢ + * @param array $page_ids + * @return bool|array + */ + public function deleteShakeAroundPage($page_ids = array()) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('page_ids' => $page_ids); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_PAGE_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 获å–è®¾å¤‡ä¿¡æ¯ + * @param string $ticket 摇周边业务的ticket(å¯åœ¨æ‘‡åˆ°çš„URL中得到,ticket生效时间为30 分钟) + * @return bool|array + */ + public function getShakeInfoShakeAroundUser($ticket) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('ticket' => $ticket); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_USER_GETSHAKEINFO . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 以设备为维度的数æ®ç»Ÿè®¡æŽ¥å£ + * @param int $device_id 设备编å·ï¼Œè‹¥å¡«äº†UUIDã€majorã€minor,å³å¯ä¸å¡«è®¾å¤‡ç¼–å·ï¼ŒäºŒè€…选其一 + * @param int $begin_date 起始日期时间戳,最长时间跨度为30 天 + * @param int $end_date 结æŸæ—¥æœŸæ—¶é—´æˆ³ï¼Œæœ€é•¿æ—¶é—´è·¨åº¦ä¸º30 天 + * @param string $uuid UUIDã€majorã€minor,三个信æ¯éœ€å¡«å†™å®Œæˆï¼Œè‹¥å¡«äº†è®¾å¤‡ç¼–辑,å³å¯ä¸å¡«æ­¤ä¿¡æ¯ï¼ŒäºŒè€…选其一 + * @param int $major + * @param int $minor + * @return bool|array + */ + public function deviceShakeAroundStatistics($device_id, $begin_date, $end_date, $uuid = '', $major = 0, $minor = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!$device_id) { + if (!$uuid || !$major || !$minor) { + return false; + } + $device_identifier = array('uuid' => $uuid, 'major' => $major, 'minor' => $minor); + } else { + $device_identifier = array('device_id' => $device_id); + } + $data = array('device_identifier' => $device_identifier, 'begin_date' => $begin_date, 'end_date' => $end_date); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_STATISTICS_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + /** + * 以页é¢ä¸ºç»´åº¦çš„æ•°æ®ç»Ÿè®¡æŽ¥å£ + * @param int $page_id 指定页é¢çš„ID + * @param int $begin_date 起始日期时间戳,最长时间跨度为30 天 + * @param int $end_date 结æŸæ—¥æœŸæ—¶é—´æˆ³ï¼Œæœ€é•¿æ—¶é—´è·¨åº¦ä¸º30 天 + * @return bool|array + */ + public function pageShakeAroundStatistics($page_id, $begin_date, $end_date) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('page_id' => $page_id, 'begin_date' => $begin_date, 'end_date' => $end_date); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_STATISTICS_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php new file mode 100644 index 00000000000..f03c15b79e0 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php @@ -0,0 +1,209 @@ + + * @date 2016-08-22 10:32 + */ +class WechatExtends extends Common +{ + + const QR_LIMIT_SCENE = 1; + + /** 语义ç†è§£ */ + const SEMANTIC_API_URL = '/semantic/semproxy/search?'; + const QRCODE_IMG_URL = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='; + const QRCODE_CREATE_URL = '/qrcode/create?'; + const SHORT_URL = '/shorturl?'; + const QR_SCENE = 0; + + /** æ•°æ®åˆ†æžæŽ¥å£ */ + static $DATACUBE_URL_ARR = array(//ç”¨æˆ·åˆ†æž + 'user' => array( + 'summary' => '/datacube/getusersummary?', //获å–用户增å‡æ•°æ®ï¼ˆgetusersummary) + 'cumulate' => '/datacube/getusercumulate?', //获å–累计用户数æ®ï¼ˆgetusercumulate) + ), + 'article' => array(//å›¾æ–‡åˆ†æž + 'summary' => '/datacube/getarticlesummary?', //获å–图文群å‘æ¯æ—¥æ•°æ®ï¼ˆgetarticlesummary) + 'total' => '/datacube/getarticletotal?', //获å–图文群å‘总数æ®ï¼ˆgetarticletotal) + 'read' => '/datacube/getuserread?', //获å–图文统计数æ®ï¼ˆgetuserread) + 'readhour' => '/datacube/getuserreadhour?', //获å–图文统计分时数æ®ï¼ˆgetuserreadhour) + 'share' => '/datacube/getusershare?', //获å–图文分享转å‘æ•°æ®ï¼ˆgetusershare) + 'sharehour' => '/datacube/getusersharehour?', //获å–图文分享转å‘分时数æ®ï¼ˆgetusersharehour) + ), + 'upstreammsg' => array(//消æ¯åˆ†æž + 'summary' => '/datacube/getupstreammsg?', //获å–消æ¯å‘é€æ¦‚况数æ®ï¼ˆgetupstreammsg) + 'hour' => '/datacube/getupstreammsghour?', //获å–消æ¯åˆ†é€åˆ†æ—¶æ•°æ®ï¼ˆgetupstreammsghour) + 'week' => '/datacube/getupstreammsgweek?', //获å–消æ¯å‘é€å‘¨æ•°æ®ï¼ˆgetupstreammsgweek) + 'month' => '/datacube/getupstreammsgmonth?', //获å–消æ¯å‘é€æœˆæ•°æ®ï¼ˆgetupstreammsgmonth) + 'dist' => '/datacube/getupstreammsgdist?', //获å–消æ¯å‘é€åˆ†å¸ƒæ•°æ®ï¼ˆgetupstreammsgdist) + 'distweek' => '/datacube/getupstreammsgdistweek?', //获å–消æ¯å‘é€åˆ†å¸ƒå‘¨æ•°æ®ï¼ˆgetupstreammsgdistweek) + 'distmonth' => '/datacube/getupstreammsgdistmonth?', //获å–消æ¯å‘é€åˆ†å¸ƒæœˆæ•°æ®ï¼ˆgetupstreammsgdistmonth) + ), + 'interface' => array(//接å£åˆ†æž + 'summary' => '/datacube/getinterfacesummary?', //获å–接å£åˆ†æžæ•°æ®ï¼ˆgetinterfacesummary) + 'summaryhour' => '/datacube/getinterfacesummaryhour?', //获å–接å£åˆ†æžåˆ†æ—¶æ•°æ®ï¼ˆgetinterfacesummaryhour) + ) + ); + + /** + * 获å–二维ç å›¾ç‰‡ + * @param string $ticket 传入由getQRCode方法生æˆçš„ticketå‚æ•° + * @return string url 返回httpåœ°å€ + */ + public function getQRUrl($ticket) + { + return self::QRCODE_IMG_URL . urlencode($ticket); + } + + /** + * é•¿é“¾æŽ¥è½¬çŸ­é“¾æŽ¥æŽ¥å£ + * @param string $long_url ä¼ å…¥è¦è½¬æ¢çš„é•¿url + * @return bool|string url æˆåŠŸåˆ™è¿”回转æ¢åŽçš„短url + */ + public function getShortUrl($long_url) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('action' => 'long2short', 'long_url' => $long_url); + $result = Tools::httpPost(self::API_URL_PREFIX . self::SHORT_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['short_url']; + } + return false; + } + + /** + * 创建二维ç ticket + * @param int|string $scene_id 自定义追踪id,临时二维ç åªèƒ½ç”¨æ•°å€¼åž‹ + * @param int $type 0:临时二维ç ï¼›1:永久二维ç (此时expireå‚数无效)ï¼›2:永久二维ç (此时expireå‚数无效) + * @param int $expire 临时二维ç æœ‰æ•ˆæœŸï¼Œæœ€å¤§ä¸º2592000秒(30天) + * @return bool|array ('ticket'=>'qrcode字串','expire_seconds'=>2592000,'url'=>'二维ç å›¾ç‰‡è§£æžåŽçš„地å€') + */ + public function getQRCode($scene_id, $type = 0, $expire = 2592000) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $type = ($type && is_string($scene_id)) ? 2 : $type; + $data = array( + 'action_name' => $type ? ($type == 2 ? "QR_LIMIT_STR_SCENE" : "QR_LIMIT_SCENE") : "QR_SCENE", + 'expire_seconds' => $expire, + 'action_info' => array('scene' => ($type == 2 ? array('scene_str' => $scene_id) : array('scene_id' => $scene_id))) + ); + if ($type == 1) { + unset($data['expire_seconds']); + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::QRCODE_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 语义ç†è§£æŽ¥å£ + * @param string $uid 用户唯一id(éžå¼€å‘者id),用户区分公众å·ä¸‹çš„ä¸åŒç”¨æˆ·ï¼ˆå»ºè®®å¡«å…¥ç”¨æˆ·openid) + * @param string $query 输入文本串 + * @param string $category 需è¦ä½¿ç”¨çš„æœåŠ¡ç±»åž‹ï¼Œå¤šä¸ªç”¨â€œï¼Œâ€éš”开,ä¸èƒ½ä¸ºç©º + * @param float $latitude 纬度å标,与ç»åº¦åŒæ—¶ä¼ å…¥ï¼›ä¸ŽåŸŽå¸‚二选一传入 + * @param float $longitude ç»åº¦å标,与纬度åŒæ—¶ä¼ å…¥ï¼›ä¸ŽåŸŽå¸‚二选一传入 + * @param string $city 城市å称,与ç»çº¬åº¦äºŒé€‰ä¸€ä¼ å…¥ + * @param string $region 区域å称,在城市存在的情况下å¯çœç•¥ï¼›ä¸Žç»çº¬åº¦äºŒé€‰ä¸€ä¼ å…¥ + * @return bool|array + */ + public function querySemantic($uid, $query, $category, $latitude = 0.00, $longitude = 0.00, $city = "", $region = "") + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array( + 'query' => $query, + 'category' => $category, + 'appid' => $this->appid, + 'uid' => '' + ); + //地ç†å标或城市å称二选一 + if ($latitude) { + $data['latitude'] = $latitude; + $data['longitude'] = $longitude; + } elseif ($city) { + $data['city'] = $city; + } elseif ($region) { + $data['region'] = $region; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SEMANTIC_API_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–ç»Ÿè®¡æ•°æ® + * @param string $type æ•°æ®åˆ†ç±»(user|article|upstreammsg|interface)分别为(用户分æž|图文分æž|消æ¯åˆ†æž|接å£åˆ†æž) + * @param string $subtype æ•°æ®å­åˆ†ç±»ï¼Œå‚考 DATACUBE_URL_ARR 常é‡å®šä¹‰éƒ¨åˆ† 或者README.md说明文档 + * @param string $begin_date 开始时间 + * @param string $end_date 结æŸæ—¶é—´ + * @return bool|array æˆåŠŸè¿”回查询结果数组,其定义请看官方文档 + */ + public function getDatacube($type, $subtype, $begin_date, $end_date = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (!isset(self::$DATACUBE_URL_ARR[$type]) || !isset(self::$DATACUBE_URL_ARR[$type][$subtype])) { + return false; + } + $data = array('begin_date' => $begin_date, 'end_date' => $end_date ? $end_date : $begin_date); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::$DATACUBE_URL_ARR[$type][$subtype] . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return isset($json['list']) ? $json['list'] : $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php new file mode 100644 index 00000000000..c01114b9186 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php @@ -0,0 +1,160 @@ +access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_COMPEL_UNBINDHTTPS . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + + public function transmsg($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_TRANSMSG . "access_token={$this->access_token}", Tools::json_encode($data)); + //dump($result); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + public function getQrcode($product_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::DEVICE_GETQRCODE . "access_token={$this->access_token}&product_id=$product_id"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * è®¾å¤‡æŽˆæƒ + * @param $data + * @return bool|mixed + */ + public function deviceAuthorize($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_AUTHORIZE_DEVICE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–è®¾å¤‡äºŒç»´ç  + * @param $data + * @return bool|mixed + */ + public function getDeviceQrcode($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::DEVICE_CREATE_QRCODE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–è®¾å¤‡çŠ¶æ€ + * @param $device_id + * @return bool|mixed + */ + public function getDeviceStat($device_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::DEVICE_GET_STAT . "access_token={$this->access_token}&device_id=$device_id"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} \ No newline at end of file diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php new file mode 100644 index 00000000000..320817973d7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php @@ -0,0 +1,430 @@ + + * @date 2016/10/26 14:47 + */ +class WechatMedia extends Common +{ + + const MEDIA_UPLOAD_URL = '/media/upload?'; + const MEDIA_UPLOADIMG_URL = '/media/uploadimg?'; + const MEDIA_GET_URL = '/media/get?'; + const MEDIA_VIDEO_UPLOAD = '/media/uploadvideo?'; + const MEDIA_FOREVER_UPLOAD_URL = '/material/add_material?'; + const MEDIA_FOREVER_NEWS_UPLOAD_URL = '/material/add_news?'; + const MEDIA_FOREVER_NEWS_UPDATE_URL = '/material/update_news?'; + const MEDIA_FOREVER_GET_URL = '/material/get_material?'; + const MEDIA_FOREVER_DEL_URL = '/material/del_material?'; + const MEDIA_FOREVER_COUNT_URL = '/material/get_materialcount?'; + const MEDIA_FOREVER_BATCHGET_URL = '/material/batchget_material?'; + const MEDIA_UPLOADNEWS_URL = '/media/uploadnews?'; + + /** + * 上传临时素æ,有效期为3天(认è¯åŽçš„订阅å·å¯ç”¨) + * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 + * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ + * 注æ„:临时素æçš„media_id是å¯å¤ç”¨çš„ï¼ + * @param array $data {"media":'@Path\filename.jpg'} + * @param string $type 类型:图片:image 语音:voice 视频:video 缩略图:thumb + * @return bool|array + */ + public function uploadMedia($data, $type) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); + $data['media'] = "@{$cache_file}"; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); + !empty($cache_file) && @unlink($cache_file); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–临时素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * @param string $media_id 媒体文件id + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @return bool|array + */ + public function getMedia($media_id, $is_video = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MEDIA_GET_URL . "access_token={$this->access_token}" . '&media_id=' . $media_id); + if ($result) { + if (is_string($result)) { + $json = json_decode($result, true); + if (isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + } + return $result; + } + return false; + } + + /** + * 获å–临时素æ(认è¯åŽçš„订阅å·å¯ç”¨) 包å«è¿”回的httpå¤´ä¿¡æ¯ + * @param string $media_id 媒体文件id + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @return bool|array + */ + public function getMediaWithHttpInfo($media_id, $is_video = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $url_prefix = $is_video ? str_replace('https', 'http', self::API_URL_PREFIX) : self::API_URL_PREFIX; + $url = $url_prefix . self::MEDIA_GET_URL . "access_token={$this->access_token}" . '&media_id=' . $media_id; + $oCurl = curl_init(); + if (stripos($url, "https://") !== false) { + curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); + } + curl_setopt($oCurl, CURLOPT_URL, $url); + curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); + $sContent = curl_exec($oCurl); + $aStatus = curl_getinfo($oCurl); + $result = array(); + if (intval($aStatus["http_code"]) !== 200) { + return false; + } + if ($sContent) { + if (is_string($sContent)) { + $json = json_decode($sContent, true); + if (isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + } + $result['content'] = $sContent; + $result['info'] = $aStatus; + return $result; + } + return false; + } + + /** + * 上传图片,本接å£æ‰€ä¸Šä¼ çš„图片ä¸å ç”¨å…¬ä¼—å·çš„ç´ æ库中图片数é‡çš„5000个的é™åˆ¶ã€‚图片仅支æŒjpg/pngæ ¼å¼ï¼Œå¤§å°å¿…须在1MB以下。 (认è¯åŽçš„订阅å·å¯ç”¨) + * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 + * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ + * @param array $data {"media":'@Path\filename.jpg'} + * @return bool|array + */ + public function uploadImg($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); + $data['media'] = "@{$cache_file}"; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOADIMG_URL . "access_token={$this->access_token}", $data); + !empty($cache_file) && @unlink($cache_file); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 新增的永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 + * 注æ„:上传大文件时å¯èƒ½éœ€è¦å…ˆè°ƒç”¨ set_time_limit(0) é¿å…超时 + * 注æ„:数组的键值任æ„,但文件åå‰å¿…须加@,使用å•å¼•å·ä»¥é¿å…本地路径斜æ è¢«è½¬ä¹‰ + * @param array $data {"media":'@Path\filename.jpg'}, 支æŒbase64æ ¼å¼ + * @param string $type 类型:图片:image 语音:voice 视频:video 缩略图:thumb + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @param array $video_info 视频信æ¯æ•°ç»„,éžè§†é¢‘ç´ æä¸éœ€è¦æä¾› array('title'=>'视频标题','introduction'=>'æè¿°') + * @return bool|array + */ + public function uploadForeverMedia($data, $type, $is_video = false, $video_info = array()) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $is_video && ($data['description'] = Tools::json_encode($video_info)); + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); + $data['media'] = "@{$cache_file}"; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); + !empty($cache_file) && @unlink($cache_file); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传永久图文素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 新增的永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 + * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} + * @return bool|array + */ + public function uploadForeverArticles($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_NEWS_UPLOAD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 修改永久图文素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 永久素æ也å¯ä»¥åœ¨å…¬ä¼—å¹³å°å®˜ç½‘ç´ æ管ç†æ¨¡å—中看到 + * @param string $media_id 图文素æid + * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} + * @param int $index 更新的文章在图文素æçš„ä½ç½®ï¼Œç¬¬ä¸€ç¯‡ä¸º0,仅多图文使用 + * @return bool|array + */ + public function updateForeverArticles($media_id, $data, $index = 0) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + !isset($data['index']) && $data['index'] = $index; + !isset($data['media_id']) && $data['media_id'] = $media_id; + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_NEWS_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * 返回图文消æ¯æ•°ç»„或二进制数æ®ï¼Œå¤±è´¥è¿”回false + * @param string $media_id 媒体文件id + * @param bool $is_video 是å¦ä¸ºè§†é¢‘æ–‡ä»¶ï¼Œé»˜è®¤ä¸ºå¦ + * @return bool|array + */ + public function getForeverMedia($media_id, $is_video = false) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('media_id' => $media_id); + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_GET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + if (is_string($result) && ($json = json_decode($result, true))) { + if (isset($json['errcode'])) { + $this->errCode = $json['errcode']; + $this->errMsg = $json['errmsg']; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return $result; + } + return false; + } + + /** + * 删除永久素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * @param string $media_id 媒体文件id + * @return bool + */ + public function delForeverMedia($media_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('media_id' => $media_id); + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 获å–永久素æ列表(认è¯åŽçš„订阅å·å¯ç”¨) + * @param string $type ç´ æ的类型,图片(image)ã€è§†é¢‘(video)ã€è¯­éŸ³ (voice)ã€å›¾æ–‡ï¼ˆnews) + * @param int $offset 全部素æçš„å移ä½ç½®ï¼Œ0表示从第一个素æ + * @param int $count 返回素æçš„æ•°é‡ï¼Œå–值在1到20之间 + * @return bool|array + * 返回数组格å¼: + * array( + * 'total_count'=>0, //该类型的素æ的总数 + * 'item_count'=>0, //本次调用获å–çš„ç´ æçš„æ•°é‡ + * 'item'=>array() //ç´ æ列表数组,内容定义请å‚考官方文档 + * ) + */ + public function getForeverList($type, $offset, $count) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('type' => $type, 'offset' => $offset, 'count' => $count); + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_BATCHGET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–永久素æ总数(认è¯åŽçš„订阅å·å¯ç”¨) + * @return bool|array + * 返回数组格å¼: + * array( + * 'voice_count'=>0, //è¯­éŸ³æ€»æ•°é‡ + * 'video_count'=>0, //è§†é¢‘æ€»æ•°é‡ + * 'image_count'=>0, //å›¾ç‰‡æ€»æ•°é‡ + * 'news_count'=>0 //å›¾æ–‡æ€»æ•°é‡ + * ) + */ + public function getForeverCount() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MEDIA_FOREVER_COUNT_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传图文消æ¯ç´ æ,用于群å‘(认è¯åŽçš„订阅å·å¯ç”¨) + * @param array $data 消æ¯ç»“æž„{"articles":[{...}]} + * @return bool|array + */ + public function uploadArticles($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOADNEWS_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 上传视频素æ(认è¯åŽçš„订阅å·å¯ç”¨) + * @param array $data 消æ¯ç»“æž„ + * { + * "media_id"=>"", //通过上传媒体接å£å¾—到的MediaId + * "title"=>"TITLE", //视频标题 + * "description"=>"Description" //视频æè¿° + * } + * @return bool|array + * { + * "type":"video", + * "media_id":"mediaid", + * "created_at":1398848981 + * } + */ + public function uploadMpVideo($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_VIDEO_UPLOAD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php new file mode 100644 index 00000000000..0e7ab9b185d --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php @@ -0,0 +1,183 @@ + + * @date 2016/06/28 11:52 + */ +class WechatMenu extends Common +{ + + /** 创建自定义èœå• */ + const MENU_ADD_URL = '/menu/create?'; + /* 获å–自定义èœå• */ + const MENU_GET_URL = '/menu/get?'; + /* 删除自定义èœå• */ + const MENU_DEL_URL = '/menu/delete?'; + + /** 添加个性èœå• */ + const COND_MENU_ADD_URL = '/menu/addconditional?'; + /* 删除个性èœå• */ + const COND_MENU_DEL_URL = '/menu/delconditional?'; + /* 测试个性èœå• */ + const COND_MENU_TRY_URL = '/menu/trymatch?'; + + /** + * 创建自定义èœå• + * @param array $data èœå•æ•°ç»„æ•°æ® + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013&token=&lang=zh_CN 文档 + * @return bool + */ + public function createMenu($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::MENU_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 获å–所有èœå• + * @return bool|array + */ + public function getMenu() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MENU_GET_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除所有èœå• + * @return bool + */ + public function deleteMenu() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::MENU_DEL_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 创建个性èœå• + * @param array $data èœå•æ•°ç»„æ•°æ® + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455782296&token=&lang=zh_CN 文档 + * @return bool|string + */ + public function createCondMenu($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['menuid']; + } + return false; + } + + /** + * 删除个性èœå• + * @param string $menuid èœå•ID + * @return bool + */ + public function deleteCondMenu($menuid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('menuid' => $menuid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 测试并返回个性化èœå• + * @param string $openid 粉ä¸openid + * @return bool + */ + public function tryCondMenu($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('user_id' => $openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::COND_MENU_TRY_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php new file mode 100644 index 00000000000..3b716856442 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php @@ -0,0 +1,352 @@ + + * @date 2016/06/28 11:29 + */ +class WechatMessage extends Common +{ + + /** + * 获å–模æ¿åˆ—表 + * @return bool|array + */ + public function getAllPrivateTemplate() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/get_all_private_template?access_token={$this->access_token}", []); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–è®¾ç½®çš„è¡Œä¸šä¿¡æ¯ + * @return bool|array + */ + public function getTMIndustry() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/get_industry?access_token={$this->access_token}", []); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除模æ¿æ¶ˆæ¯ + * @param string $tpl_id + * @return bool + */ + public function delPrivateTemplate($tpl_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('template_id' => $tpl_id); + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/del_private_template?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 模æ¿æ¶ˆæ¯ 设置所属行业 + * @param string $id1 公众å·æ¨¡æ¿æ¶ˆæ¯æ‰€å±žè¡Œä¸šç¼–å·ï¼Œå‚看官方开å‘文档 è¡Œä¸šä»£ç  + * @param string $id2 åŒ$id1。但如果åªæœ‰ä¸€ä¸ªè¡Œä¸šï¼Œæ­¤å‚æ•°å¯çœç•¥ + * @return bool|mixed + */ + public function setTMIndustry($id1, $id2 = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array(); + !empty($id1) && $data['industry_id1'] = $id1; + !empty($id2) && $data['industry_id2'] = $id2; + $json = Tools::json_encode($data); + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/api_set_industry?access_token={$this->access_token}", $json); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 模æ¿æ¶ˆæ¯ 添加消æ¯æ¨¡æ¿ + * æˆåŠŸè¿”回消æ¯æ¨¡æ¿çš„调用id + * @param string $tpl_id 模æ¿åº“中模æ¿çš„ç¼–å·ï¼Œæœ‰â€œTM**â€å’Œâ€œOPENTMTM**â€ç­‰å½¢å¼ + * @return bool|string + */ + public function addTemplateMessage($tpl_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = Tools::json_encode(array('template_id_short' => $tpl_id)); + $result = Tools::httpPost(self::API_URL_PREFIX . "/template/api_add_template?access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['template_id']; + } + return false; + } + + /** + * å‘é€æ¨¡æ¿æ¶ˆæ¯ + * @param array $data 消æ¯ç»“æž„ + * { + * "touser":"OPENID", + * "template_id":"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY", + * "url":"http://weixin.qq.com/download", + * "topcolor":"#FF0000", + * "data":{ + * "å‚æ•°å1": { + * "value":"å‚æ•°", + * "color":"#173177" //å‚数颜色 + * }, + * "Date":{ + * "value":"06月07æ—¥ 19æ—¶24分", + * "color":"#173177" + * }, + * "CardNumber":{ + * "value":"0426", + * "color":"#173177" + * }, + * "Type":{ + * "value":"消费", + * "color":"#173177" + * } + * } + * } + * @return bool|array + */ + public function sendTemplateMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/template/send?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * æ ¹æ®æ ‡ç­¾è¿›è¡Œç¾¤å‘ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param array $data 消æ¯ç»“æž„ + * 注æ„: 视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ + * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 + * @return bool|array + * { + * "touser"=>array( + * "OPENID1", + * "OPENID2" + * ), + * "msgtype"=>"mpvideo", + * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 + * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") + * // text => array ( "content" => "hello") + * } + */ + public function sendMassMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/send?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * æ ¹æ®æ ‡ç­¾è¿›è¡Œç¾¤å‘ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param array $data 消æ¯ç»“æž„ + * 注æ„:视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ + * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 + * @return bool|array + * { + * "filter"=>array( + * "is_to_all"=>False, //是å¦ç¾¤å‘给所有用户.Trueä¸ç”¨åˆ†ç»„id,False需填写分组id + * "group_id"=>"2" //群å‘的分组id + * ), + * "msgtype"=>"mpvideo", + * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 + * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") + * // text => array ( "content" => "hello") + * } + */ + public function sendGroupMassMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/sendall?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除群å‘å›¾æ–‡æ¶ˆæ¯ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param string $msg_id 消æ¯ID + * @return bool + */ + public function deleteMassMessage($msg_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = Tools::json_encode(array('msg_id' => $msg_id)); + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/delete?access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * 预览群å‘æ¶ˆæ¯ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param array $data + * 注æ„: 视频需è¦åœ¨è°ƒç”¨uploadMedia()方法åŽï¼Œå†ä½¿ç”¨ uploadMpVideo() 方法生æˆï¼Œ + * 然åŽèŽ·å¾—çš„ mediaid æ‰èƒ½ç”¨äºŽç¾¤å‘,且消æ¯ç±»åž‹ä¸º mpvideo 类型。 + * @消æ¯ç»“æž„ + * { + * "touser"=>"OPENID", + * "msgtype"=>"mpvideo", + * // 在下é¢5ç§ç±»åž‹ä¸­é€‰æ‹©å¯¹åº”çš„å‚数内容 + * // mpnews | voice | image | mpvideo => array( "media_id"=>"MediaId") + * // text => array ( "content" => "hello") + * } + * @return bool|array + */ + public function previewMassMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/preview?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询群å‘消æ¯å‘é€çŠ¶æ€ ( 订阅å·ä¸ŽæœåŠ¡å·è®¤è¯åŽå‡å¯ç”¨ ) + * @param string $msg_id 消æ¯ID + * @return bool|array + * { + * "msg_id":201053012, //群å‘消æ¯åŽè¿”回的消æ¯id + * "msg_status":"SEND_SUCCESS", //消æ¯å‘é€åŽçš„状æ€ï¼ŒSENDING表示正在å‘é€ SEND_SUCCESS表示å‘é€æˆåŠŸ + * } + */ + public function queryMassMessage($msg_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = Tools::json_encode(array('msg_id' => $msg_id)); + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/mass/get?access_token={$this->access_token}", $data); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php new file mode 100644 index 00000000000..8d99fed9aa7 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php @@ -0,0 +1,138 @@ +appid}&redirect_uri={$redirect_uri}&response_type=code&scope={$scope}&state={$state}#wechat_redirect"; + } + + /** + * 通过 code èŽ·å– AccessToken å’Œ openid + * @return bool|array + */ + public function getOauthAccessToken() + { + $code = isset($_GET['code']) ? $_GET['code'] : ''; + if (empty($code)) { + Tools::log("getOauthAccessToken Fail, Because there is no access to the code value in get.", "MSG - {$this->appid}"); + return false; + } + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_TOKEN_URL . "appid={$this->appid}&secret={$this->appsecret}&code={$code}&grant_type=authorization_code"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthAccessToken Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + return $json; + } + return false; + } + + /** + * 刷新access token并续期 + * @param string $refresh_token + * @return bool|array + */ + public function getOauthRefreshToken($refresh_token) + { + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_REFRESH_URL . "appid={$this->appid}&grant_type=refresh_token&refresh_token={$refresh_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthRefreshToken Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + return $json; + } + return false; + } + + /** + * 获å–授æƒåŽçš„用户资料 + * @param string $access_token + * @param string $openid + * @return bool|array {openid,nickname,sex,province,city,country,headimgurl,privilege,[unionid]} + * 注æ„:unionid字段 åªæœ‰åœ¨ç”¨æˆ·å°†å…¬ä¼—å·ç»‘定到微信开放平å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 + */ + public function getOauthUserInfo($access_token, $openid) + { + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_USERINFO_URL . "access_token={$access_token}&openid={$openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthUserInfo Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } + return $json; + } + return false; + } + + /** + * 检验授æƒå‡­è¯æ˜¯å¦æœ‰æ•ˆ + * @param string $access_token + * @param string $openid + * @return bool 是å¦æœ‰æ•ˆ + */ + public function getOauthAuth($access_token, $openid) + { + $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::OAUTH_AUTH_URL . "access_token={$access_token}&openid={$openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + Tools::log("WechatOauth::getOauthAuth Fail.{$this->errMsg} [{$this->errCode}]", "ERR - {$this->appid}"); + return false; + } elseif (intval($json['errcode']) === 0) { + return true; + } + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php new file mode 100644 index 00000000000..0ca602d9e8c --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php @@ -0,0 +1,620 @@ + + * @date 2015/05/13 12:12:00 + */ +class WechatPay +{ + + /** 支付接å£åŸºç¡€åœ°å€ */ + const MCH_BASE_URL = 'https://api.mch.weixin.qq.com'; + + /** 公众å·appid */ + public $appid; + + /** 公众å·é…ç½® */ + public $config; + + /** 商户身份ID */ + public $mch_id; + + /** 商户支付密钥Key */ + public $partnerKey; + + /** è¯ä¹¦è·¯å¾„ */ + public $ssl_cer; + public $ssl_key; + + /** 执行错误消æ¯åŠä»£ç  */ + public $errMsg; + public $errCode; + + /** + * WechatPay constructor. + * @param array $options + */ + public function __construct($options = array()) + { + $this->config = Loader::config($options); + $this->appid = isset($this->config['appid']) ? $this->config['appid'] : ''; + $this->mch_id = isset($this->config['mch_id']) ? $this->config['mch_id'] : ''; + $this->partnerKey = isset($this->config['partnerkey']) ? $this->config['partnerkey'] : ''; + $this->ssl_cer = isset($this->config['ssl_cer']) ? $this->config['ssl_cer'] : ''; + $this->ssl_key = isset($this->config['ssl_key']) ? $this->config['ssl_key'] : ''; + } + + /** + * 获å–当å‰é”™è¯¯å†…容 + * @return string + */ + public function getError() + { + return $this->errMsg; + } + + /** + * 当å‰å½“å‰é”™è¯¯ä»£ç  + * @return int + */ + public function getErrorCode() + { + return $this->errCode; + } + + /** + * 获å–当å‰æ“作公众å·APPID + * @return string + */ + public function getAppid() + { + return $this->appid; + } + + /** + * 获å–SDKé…ç½®å‚æ•° + * @return array + */ + public function getConfig() + { + return $this->config; + } + + /** + * 设置标é…的请求å‚数,生æˆç­¾å,生æˆæŽ¥å£å‚æ•°xml + * @param array $data + * @return string + */ + protected function createXml($data) + { + if (!isset($data['wxappid']) && !isset($data['mch_appid']) && !isset($data['appid'])) { + $data['appid'] = $this->appid; + } + if (!isset($data['mchid']) && !isset($data['mch_id'])) { + $data['mch_id'] = $this->mch_id; + } + isset($data['nonce_str']) || $data['nonce_str'] = Tools::createNoncestr(); + $data["sign"] = Tools::getPaySign($data, $this->partnerKey); + return Tools::arr2xml($data); + } + + /** + * POSTæ交XML + * @param array $data + * @param string $url + * @return mixed + */ + public function postXml($data, $url) + { + return Tools::httpPost($url, $this->createXml($data)); + } + + /** + * 使用è¯ä¹¦post请求XML + * @param array $data + * @param string $url + * @return mixed + */ + function postXmlSSL($data, $url) + { + return Tools::httpsPost($url, $this->createXml($data), $this->ssl_cer, $this->ssl_key); + } + + /** + * POSTæ交获å–Array结果 + * @param array $data 需è¦æäº¤çš„æ•°æ® + * @param string $url + * @param string $method + * @return array + */ + public function getArrayResult($data, $url, $method = 'postXml') + { + return Tools::xml2arr($this->$method($data, $url)); + } + + /** + * 解æžè¿”回的结果 + * @param array $result + * @return bool|array + */ + protected function _parseResult($result) + { + if (empty($result)) { + $this->errCode = 'result error'; + $this->errMsg = '解æžè¿”回结果失败'; + return false; + } + if ($result['return_code'] !== 'SUCCESS') { + $this->errCode = $result['return_code']; + $this->errMsg = $result['return_msg']; + return false; + } + if (isset($result['err_code']) && $result['err_code'] !== 'SUCCESS') { + $this->errMsg = $result['err_code_des']; + $this->errCode = $result['err_code']; + return false; + } + return $result; + } + + /** + * 创建刷å¡æ”¯ä»˜å‚数包 + * @param string $auth_code 授æƒCodeå· + * @param string $out_trade_no 商户订å•å· + * @param int $total_fee 支付费用 + * @param string $body 订å•æ ‡è¯† + * @param null $goods_tag 商å“标签 + * @return array|bool + */ + public function createMicroPay($auth_code, $out_trade_no, $total_fee, $body, $goods_tag = null) + { + $data = array( + "appid" => $this->appid, + "mch_id" => $this->mch_id, + "body" => $body, + "out_trade_no" => $out_trade_no, + "total_fee" => $total_fee, + "auth_code" => $auth_code, + "spbill_create_ip" => Tools::getAddress(), + ); + empty($goods_tag) || $data['goods_tag'] = $goods_tag; + $json = Tools::xml2arr($this->postXml($data, self::MCH_BASE_URL . '/pay/micropay')); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * 支付通知验è¯å¤„ç† + * @return bool|array + */ + public function getNotify() + { + $disableEntities = libxml_disable_entity_loader(true); + $notifyInfo = (array)simplexml_load_string(file_get_contents("php://input"), 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); + if (empty($notifyInfo)) { + Tools::log('Payment notification forbidden access.', "ERR - {$this->appid}"); + $this->errCode = '404'; + $this->errMsg = 'Payment notification forbidden access.'; + return false; + } + if (empty($notifyInfo['sign'])) { + Tools::log('Payment notification signature is missing.' . var_export($notifyInfo, true), "ERR - {$this->appid}"); + $this->errCode = '403'; + $this->errMsg = 'Payment notification signature is missing.'; + return false; + } + $data = $notifyInfo; + unset($data['sign']); + if ($notifyInfo['sign'] !== Tools::getPaySign($data, $this->partnerKey)) { + Tools::log('Payment notification signature verification failed.' . var_export($notifyInfo, true), "ERR - {$this->appid}"); + $this->errCode = '403'; + $this->errMsg = 'Payment signature verification failed.'; + return false; + } + Tools::log('Payment notification signature verification success.' . var_export($notifyInfo, true), "MSG - {$this->appid}"); + $this->errCode = '0'; + $this->errMsg = ''; + return $notifyInfo; + } + + + /** + * 支付XMLç»Ÿä¸€å›žå¤ + * @param array $data 需è¦å›žå¤çš„XML内容数组 + * @param bool $isReturn 是å¦è¿”回XML内容,默认ä¸è¿”回 + * @return string + */ + public function replyXml(array $data, $isReturn = false) + { + $xml = Tools::arr2xml($data); + if ($isReturn) { + return $xml; + } + ob_clean(); + exit($xml); + } + + /** + * 获å–预支付ID + * @param string $openid 用户openid,JSAPIå¿…å¡« + * @param string $body 商å“标题 + * @param string $out_trade_no 第三方订å•å· + * @param int $total_fee 订å•æ€»ä»· + * @param string $notify_url 支付æˆåŠŸå›žè°ƒåœ°å€ + * @param string $trade_type 支付类型JSAPI|NATIVE|APP + * @param string $goods_tag 商å“标记,代金券或立å‡ä¼˜æƒ åŠŸèƒ½çš„å‚æ•° + * @param string $fee_type 交易å¸ç§ + * @param null $no_credit 是å¦ç¦æ­¢ä¿¡ç”¨ + * @return bool|string + */ + public function getPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $trade_type = "JSAPI", $goods_tag = null, $fee_type = 'CNY', $no_credit = null) + { + $postdata = array( + "body" => $body, + "out_trade_no" => $out_trade_no, + "fee_type" => $fee_type, + "total_fee" => $total_fee, + "notify_url" => $notify_url, + "trade_type" => $trade_type, + "spbill_create_ip" => Tools::getAddress(), + ); + empty($openid) || $postdata['openid'] = $openid; + empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; + is_null($no_credit) || $postdata['no_credit'] = $no_credit; + $result = $this->getArrayResult($postdata, self::MCH_BASE_URL . '/pay/unifiedorder'); + if (false === $this->_parseResult($result)) { + return false; + } + return in_array($trade_type, array('JSAPI', 'APP')) ? $result['prepay_id'] : ($trade_type === 'MWEB' ? $result['mweb_url'] : $result['code_url']); + } + + /** + * 获å–二维ç é¢„支付ID + * @param string $openid 用户openid,JSAPIå¿…å¡« + * @param string $body 商å“标题 + * @param string $out_trade_no 第三方订å•å· + * @param int $total_fee 订å•æ€»ä»· + * @param string $notify_url 支付æˆåŠŸå›žè°ƒåœ°å€ + * @param string $goods_tag 商å“标记,代金券或立å‡ä¼˜æƒ åŠŸèƒ½çš„å‚æ•° + * @param string $fee_type 交易å¸ç§ + * @return bool|string + */ + public function getQrcPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $goods_tag = null, $fee_type = 'CNY') + { + $postdata = array( + "body" => $body, + "out_trade_no" => $out_trade_no, + "fee_type" => $fee_type, + "total_fee" => $total_fee, + "notify_url" => $notify_url, + "trade_type" => 'NATIVE', + "spbill_create_ip" => Tools::getAddress(), + ); + empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; + empty($openid) || $postdata['openid'] = $openid; + $result = $this->getArrayResult($postdata, self::MCH_BASE_URL . '/pay/unifiedorder'); + if (false === $this->_parseResult($result) || empty($result['prepay_id'])) { + return false; + } + return $result['prepay_id']; + } + + /** + * 获å–æ”¯ä»˜è§„äºŒç»´ç  + * @param string $product_id 商户定义的商å“id 或者订å•å· + * @return string + */ + public function getQrcPayUrl($product_id) + { + $data = array( + 'appid' => $this->appid, + 'mch_id' => $this->mch_id, + 'time_stamp' => (string)time(), + 'nonce_str' => Tools::createNoncestr(), + 'product_id' => (string)$product_id, + ); + $data['sign'] = Tools::getPaySign($data, $this->partnerKey); + return "weixin://wxpay/bizpayurl?" . http_build_query($data); + } + + + /** + * 创建JSAPI支付å‚数包 + * @param string $prepay_id + * @return array + */ + public function createMchPay($prepay_id) + { + $option = array(); + $option["appId"] = $this->appid; + $option["timeStamp"] = (string)time(); + $option["nonceStr"] = Tools::createNoncestr(); + $option["package"] = "prepay_id={$prepay_id}"; + $option["signType"] = "MD5"; + $option["paySign"] = Tools::getPaySign($option, $this->partnerKey); + $option['timestamp'] = $option['timeStamp']; + return $option; + } + + /** + * å…³é—­è®¢å• + * @param string $out_trade_no + * @return bool + */ + public function closeOrder($out_trade_no) + { + $data = array('out_trade_no' => $out_trade_no); + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/closeorder'); + if (false === $this->_parseResult($result)) { + return false; + } + return ($result['return_code'] === 'SUCCESS'); + } + + /** + * 查询订å•è¯¦æƒ… + * @param $out_trade_no + * @return bool|array + */ + public function queryOrder($out_trade_no) + { + $data = array('out_trade_no' => $out_trade_no); + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/orderquery'); + if (false === $this->_parseResult($result)) { + return false; + } + return $result; + } + + /** + * 订å•é€€æ¬¾æŽ¥å£ + * @param string $out_trade_no 商户订å•å· + * @param string $transaction_id 微信订å•å·ï¼Œä¸Ž out_refund_no 二选一(ä¸é€‰æ—¶ä¼ 0或false) + * @param string $out_refund_no 商户退款订å•å·ï¼Œä¸Ž transaction_id 二选一(ä¸é€‰æ—¶ä¼ 0或false) + * @param int $total_fee 商户订å•æ€»é‡‘é¢ + * @param int $refund_fee 退款金é¢ï¼Œä¸å¯å¤§äºŽè®¢å•æ€»é‡‘é¢ + * @param int|null $op_user_id æ“作员ID,默认商户ID + * @param string $refund_account 退款资金æ¥æº + * 仅针对è€èµ„金æµå•†æˆ·ä½¿ç”¨ + * REFUND_SOURCE_UNSETTLED_FUNDS --- 未结算资金退款(默认使用未结算资金退款) + * REFUND_SOURCE_RECHARGE_FUNDS --- å¯ç”¨ä½™é¢é€€æ¬¾ + * @param string $refund_desc 退款原因 + * @param string $refund_fee_type 退款货å¸ç§ç±» + * @return bool + */ + public function refund($out_trade_no, $transaction_id, $out_refund_no, $total_fee, $refund_fee, $op_user_id = null, $refund_account = '', $refund_desc = '', $refund_fee_type = 'CNY') + { + $data = array(); + $data['out_trade_no'] = $out_trade_no; + $data['total_fee'] = $total_fee; + $data['refund_fee'] = $refund_fee; + $data['refund_fee_type'] = $refund_fee_type; + $data['op_user_id'] = empty($op_user_id) ? $this->mch_id : $op_user_id; + !empty($out_refund_no) && $data['out_refund_no'] = $out_refund_no; + !empty($transaction_id) && $data['transaction_id'] = $transaction_id; + !empty($refund_account) && $data['refund_account'] = $refund_account; + !empty($refund_desc) && $data['refund_desc'] = $refund_desc; + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/secapi/pay/refund', 'postXmlSSL'); + if (false === $this->_parseResult($result)) { + return false; + } + return ($result['return_code'] === 'SUCCESS'); + } + + /** + * é€€æ¬¾æŸ¥è¯¢æŽ¥å£ + * @param string $out_trade_no + * @return bool|array + */ + public function refundQuery($out_trade_no) + { + $data = array(); + $data['out_trade_no'] = $out_trade_no; + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/pay/refundquery'); + if (false === $this->_parseResult($result)) { + return false; + } + return $result; + } + + /** + * 获å–å¯¹è´¦å• + * @param string $bill_date è´¦å•æ—¥æœŸï¼Œå¦‚ 20141110 + * @param string $bill_type ALL|SUCCESS|REFUND|REVOKED + * @return bool|array + */ + public function getBill($bill_date, $bill_type = 'ALL') + { + $data = array(); + $data['bill_date'] = $bill_date; + $data['bill_type'] = $bill_type; + $result = $this->postXml($data, self::MCH_BASE_URL . '/pay/downloadbill'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * å‘é€çŽ°é‡‘红包 + * @param string $openid 红包接收者OPENID + * @param int $total_amount çº¢åŒ…æ€»é‡‘é¢ + * @param string $mch_billno 商户订å•å· + * @param string $sendname 商户å称 + * @param string $wishing 红包ç¥ç¦è¯­ + * @param string $act_name 活动å称 + * @param string $remark å¤‡æ³¨ä¿¡æ¯ + * @param null|int $total_num 红包å‘放总人数(大于1为裂å˜çº¢åŒ…) + * @param null|string $scene_id 场景id + * @param string $risk_info æ´»åŠ¨ä¿¡æ¯ + * @param null|string $consume_mch_id 资金授æƒå•†æˆ·å· + * @return array|bool + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_5 + */ + public function sendRedPack($openid, $total_amount, $mch_billno, $sendname, $wishing, $act_name, $remark, $total_num = 1, $scene_id = null, $risk_info = '', $consume_mch_id = null) + { + $data = array(); + $data['mch_billno'] = $mch_billno; // 商户订å•å· mch_id+yyyymmdd+10ä½ä¸€å¤©å†…ä¸èƒ½é‡å¤çš„æ•°å­— + $data['wxappid'] = $this->appid; + $data['send_name'] = $sendname; //商户å称 + $data['re_openid'] = $openid; //红包接收者 + $data['total_amount'] = $total_amount; //çº¢åŒ…æ€»é‡‘é¢ + $data['total_num'] = '1'; //å‘æ”¾äººæ•°æ® + $data['wishing'] = $wishing; //红包ç¥ç¦è¯­ + $data['client_ip'] = Tools::getAddress(); //调用接å£çš„机器Ipåœ°å€ + $data['act_name'] = $act_name; //活动å称 + $data['remark'] = $remark; //å¤‡æ³¨ä¿¡æ¯ + $data['total_num'] = $total_num; + !empty($scene_id) && $data['scene_id'] = $scene_id; + !empty($risk_info) && $data['risk_info'] = $risk_info; + !empty($consume_mch_id) && $data['consume_mch_id'] = $consume_mch_id; + if ($total_num > 1) { + $data['amt_type'] = 'ALL_RAND'; + $api = self::MCH_BASE_URL . '/mmpaymkttransfers/sendgroupredpack'; + } else { + $api = self::MCH_BASE_URL . '/mmpaymkttransfers/sendredpack'; + } + $result = $this->postXmlSSL($data, $api); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + + /** + * 现金红包状æ€æŸ¥è¯¢ + * @param string $billno + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_7&index=6 + */ + public function queryRedPack($billno) + { + $data['mch_billno'] = $billno; + $data['bill_type'] = 'MCHT'; + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/gethbinfo'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * ä¼ä¸šä»˜æ¬¾ + * @param string $openid 红包接收者OPENID + * @param int $amount çº¢åŒ…æ€»é‡‘é¢ + * @param string $billno 商户订å•å· + * @param string $desc å¤‡æ³¨ä¿¡æ¯ + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2 + */ + public function transfers($openid, $amount, $billno, $desc) + { + $data = array(); + $data['mchid'] = $this->mch_id; + $data['mch_appid'] = $this->appid; + $data['partner_trade_no'] = $billno; + $data['openid'] = $openid; + $data['amount'] = $amount; + $data['check_name'] = 'NO_CHECK'; #ä¸éªŒè¯å§“å + $data['spbill_create_ip'] = Tools::getAddress(); //调用接å£çš„机器Ipåœ°å€ + $data['desc'] = $desc; //å¤‡æ³¨ä¿¡æ¯ + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/promotion/transfers'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * ä¼ä¸šä»˜æ¬¾æŸ¥è¯¢ + * @param string $billno + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_3 + */ + public function queryTransfers($billno) + { + $data['appid'] = $this->appid; + $data['mch_id'] = $this->mch_id; + $data['partner_trade_no'] = $billno; + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/gettransferinfo'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } + + /** + * 二维ç é“¾æŽ¥è½¬æˆçŸ­é“¾æŽ¥ + * @param string $url 需è¦å¤„ç†çš„长链接 + * @return bool|string + */ + public function shortUrl($url) + { + $data = array(); + $data['long_url'] = $url; + $result = $this->getArrayResult($data, self::MCH_BASE_URL . '/tools/shorturl'); + if (!$result || $result['return_code'] !== 'SUCCESS') { + $this->errCode = $result['return_code']; + $this->errMsg = $result['return_msg']; + return false; + } + if (isset($result['err_code']) && $result['err_code'] !== 'SUCCESS') { + $this->errMsg = $result['err_code_des']; + $this->errCode = $result['err_code']; + return false; + } + return $result['short_url']; + } + + /** + * å‘放代金券 + * @param int $coupon_stock_id 代金券批次id + * @param string $partner_trade_no 商户此次å‘放凭æ®å·ï¼ˆæ ¼å¼ï¼šå•†æˆ·id+日期+æµæ°´å·ï¼‰ï¼Œå•†æˆ·ä¾§éœ€ä¿æŒå”¯ä¸€æ€§ + * @param string $openid Openidä¿¡æ¯ + * @param string $op_user_id æ“作员å¸å·, é»˜è®¤ä¸ºå•†æˆ·å· å¯åœ¨å•†æˆ·å¹³å°é…ç½®æ“作员对应的apiæƒé™ + * @return bool|array + * @link https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_3 + */ + public function sendCoupon($coupon_stock_id, $partner_trade_no, $openid, $op_user_id = null) + { + $data = array(); + $data['appid'] = $this->appid; + $data['coupon_stock_id'] = $coupon_stock_id; + $data['openid_count'] = 1; + $data['partner_trade_no'] = $partner_trade_no; + $data['openid'] = $openid; + $data['op_user_id'] = empty($op_user_id) ? $this->mch_id : $op_user_id; + $result = $this->postXmlSSL($data, self::MCH_BASE_URL . '/mmpaymkttransfers/send_coupon'); + $json = Tools::xml2arr($result); + if (!empty($json) && false === $this->_parseResult($json)) { + return false; + } + return $json; + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php new file mode 100644 index 00000000000..7073c90905c --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php @@ -0,0 +1,193 @@ + + * @date 2016/10/26 15:43 + */ +class WechatPoi extends Common +{ + + /** 创建门店 */ + const POI_ADD = '/cgi-bin/poi/addpoi?'; + + /** æŸ¥è¯¢é—¨åº—ä¿¡æ¯ */ + const POI_GET = '/cgi-bin/poi/getpoi?'; + + /** 获å–门店列表 */ + const POI_GET_LIST = '/cgi-bin/poi/getpoilist?'; + + /** ä¿®æ”¹é—¨åº—ä¿¡æ¯ */ + const POI_UPDATE = '/cgi-bin/poi/updatepoi?'; + + /** 删除门店 */ + const POI_DELETE = '/cgi-bin/poi/delpoi?'; + + /** 获å–门店类目表 */ + const POI_CATEGORY = '/cgi-bin/poi/getwxcategory?'; + + /** + * 创建门店 + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param array $data + * @return bool + */ + public function addPoi($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_ADD . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除门店 + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param string $poi_id JSONæ•°æ®æ ¼å¼ + * @return bool|array + */ + public function delPoi($poi_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('poi_id' => $poi_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_DELETE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 修改门店æœåŠ¡ä¿¡æ¯ + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param array $data + * @return bool + */ + public function updatePoi($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_UPDATE . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return true; + } + return false; + } + + /** + * æŸ¥è¯¢é—¨åº—ä¿¡æ¯ + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param string $poi_id + * @return bool + */ + public function getPoi($poi_id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('poi_id' => $poi_id); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_GET . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 查询门店列表 + * @link https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444378120&token=&lang=zh_CN + * @param int $begin 开始ä½ç½®ï¼Œ0 å³ä¸ºä»Žç¬¬ä¸€æ¡å¼€å§‹æŸ¥è¯¢ + * @param int $limit 返回数æ®æ¡æ•°ï¼Œæœ€å¤§å…许50,默认为20 + * @return bool|array + */ + public function getPoiList($begin = 0, $limit = 50) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $limit > 50 && $limit = 50; + $data = array('begin' => $begin, 'limit' => $limit); + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::POI_GET_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–商家门店类目表 + * @return bool|string + */ + public function getCategory() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::POI_CATEGORY . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php new file mode 100644 index 00000000000..87fab46dbbf --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php @@ -0,0 +1,771 @@ + + * @date 2016/06/28 11:29 + */ +class WechatReceive extends WechatMessage +{ + + /** 消æ¯å›žå¤ç±»åž‹ */ + const MSGTYPE_TEXT = 'text'; + const MSGTYPE_LINK = 'link'; + const MSGTYPE_NEWS = 'news'; + const MSGTYPE_IMAGE = 'image'; + const MSGTYPE_VOICE = 'voice'; + const MSGTYPE_EVENT = 'event'; + const MSGTYPE_MUSIC = 'music'; + const MSGTYPE_VIDEO = 'video'; + const MSGTYPE_LOCATION = 'location'; + + /** 文本过滤 */ + protected $_text_filter = true; + + /** 消æ¯å¯¹è±¡ */ + private $_receive; + + /** + * 获å–微信æœåŠ¡å™¨å‘æ¥çš„内容 + * @return $this + */ + public function getRev() + { + if ($this->_receive) { + return $this; + } + $postStr = !empty($this->postxml) ? $this->postxml : file_get_contents("php://input"); + if (!empty($postStr)) { + $disableEntities = libxml_disable_entity_loader(true); + $this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); + } + return $this; + } + + /** + * 获å–微信æœåŠ¡å™¨å‘æ¥çš„ä¿¡æ¯æ•°æ® + * @return array + */ + public function getRevData() + { + return $this->_receive; + } + + /** + * 获å–消æ¯å‘é€è€… + * @return bool|string + */ + public function getRevFrom() + { + if (isset($this->_receive['FromUserName'])) { + return $this->_receive['FromUserName']; + } + return false; + } + + /** + * 获å–消æ¯æŽ¥å—者 + * @return bool|string + */ + public function getRevTo() + { + if (isset($this->_receive['ToUserName'])) { + return $this->_receive['ToUserName']; + } + return false; + } + + /** + * 获å–接收消æ¯çš„类型 + * @return bool|string + */ + public function getRevType() + { + if (isset($this->_receive['MsgType'])) { + return $this->_receive['MsgType']; + } + return false; + } + + /** + * 获å–消æ¯ID + * @return bool|string + */ + public function getRevID() + { + if (isset($this->_receive['MsgId'])) { + return $this->_receive['MsgId']; + } + return false; + } + + /** + * 获å–消æ¯å‘é€æ—¶é—´ + * @return bool|string + */ + public function getRevCtime() + { + if (isset($this->_receive['CreateTime'])) { + return $this->_receive['CreateTime']; + } + return false; + } + + /** + * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - å¡å·å®¡æ ¸æ˜¯å¦é€šè¿‡ + * 当Event为 card_pass_check(审核通过) 或 card_not_pass_check(未通过) + * @return bool|string 返回å¡åˆ¸ID + */ + public function getRevCardPass() + { + if (isset($this->_receive['CardId'])) { + return $this->_receive['CardId']; + } + return false; + } + + /** + * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - 领å–å¡åˆ¸ + * 当Event为 user_get_card(用户领å–å¡åˆ¸) + * @return bool|array + */ + public function getRevCardGet() + { + $array = array(); + if (isset($this->_receive['CardId'])) { + $array['CardId'] = $this->_receive['CardId']; + } + if (isset($this->_receive['IsGiveByFriend'])) { + $array['IsGiveByFriend'] = $this->_receive['IsGiveByFriend']; + } + $array['OldUserCardCode'] = $this->_receive['OldUserCardCode']; + if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) { + $array['UserCardCode'] = $this->_receive['UserCardCode']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–å¡åˆ¸äº‹ä»¶æŽ¨é€ - 删除å¡åˆ¸ + * 当Event为 user_del_card (用户删除å¡åˆ¸) + * @return bool|array + */ + public function getRevCardDel() + { + if (isset($this->_receive['CardId'])) { //å¡åˆ¸ ID + $array['CardId'] = $this->_receive['CardId']; + } + if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) { + $array['UserCardCode'] = $this->_receive['UserCardCode']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–接收消æ¯å†…容正文 + * @return bool + */ + public function getRevContent() + { + if (isset($this->_receive['Content'])) { + return $this->_receive['Content']; + } elseif (isset($this->_receive['Recognition'])) { + return $this->_receive['Recognition']; + } + return false; + } + + /** + * 获å–接收消æ¯å›¾ç‰‡ + * @return array|bool + */ + public function getRevPic() + { + if (isset($this->_receive['PicUrl'])) { + return array( + 'mediaid' => $this->_receive['MediaId'], + 'picurl' => (string)$this->_receive['PicUrl'], + ); + } + return false; + } + + /** + * 获å–接收消æ¯é“¾æŽ¥ + * @return bool|array + */ + public function getRevLink() + { + if (isset($this->_receive['Url'])) { + return array( + 'url' => $this->_receive['Url'], + 'title' => $this->_receive['Title'], + 'description' => $this->_receive['Description'], + ); + } + return false; + } + + /** + * 获å–接收地ç†ä½ç½® + * @return bool|array + */ + public function getRevGeo() + { + if (isset($this->_receive['Location_X'])) { + return array( + 'x' => $this->_receive['Location_X'], + 'y' => $this->_receive['Location_Y'], + 'scale' => $this->_receive['Scale'], + 'label' => $this->_receive['Label'], + ); + } + return false; + } + + /** + * 获å–上报地ç†ä½ç½®äº‹ä»¶ + * @return bool|array + */ + public function getRevEventGeo() + { + if (isset($this->_receive['Latitude'])) { + return array( + 'x' => $this->_receive['Latitude'], + 'y' => $this->_receive['Longitude'], + 'precision' => $this->_receive['Precision'], + ); + } + return false; + } + + /** + * 获å–æŽ¥æ”¶äº‹ä»¶æŽ¨é€ + * @return bool|array + */ + public function getRevEvent() + { + if (isset($this->_receive['Event'])) { + $array['event'] = $this->_receive['Event']; + } + if (isset($this->_receive['EventKey'])) { + $array['key'] = $this->_receive['EventKey']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–自定义èœå•çš„扫ç æŽ¨äº‹ä»¶ä¿¡æ¯ + * + * 事件类型为以下两ç§æ—¶åˆ™è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ + * Event 事件类型, scancode_push + * Event 事件类型, scancode_waitmsg + * @return bool|array + */ + public function getRevScanInfo() + { + if (isset($this->_receive['ScanCodeInfo'])) { + if (!is_array($this->_receive['ScanCodeInfo'])) { + $array = (array)$this->_receive['ScanCodeInfo']; + $this->_receive['ScanCodeInfo'] = $array; + } else { + $array = $this->_receive['ScanCodeInfo']; + } + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–自定义èœå•çš„图片å‘é€äº‹ä»¶ä¿¡æ¯ + * + * 事件类型为以下三ç§æ—¶åˆ™è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ + * Event 事件类型,pic_sysphoto 弹出系统æ‹ç…§å‘å›¾çš„äº‹ä»¶æŽ¨é€ + * Event 事件类型,pic_photo_or_album 弹出æ‹ç…§æˆ–者相册å‘å›¾çš„äº‹ä»¶æŽ¨é€ + * Event 事件类型,pic_weixin 弹出微信相册å‘å›¾å™¨çš„äº‹ä»¶æŽ¨é€ + * + * @return bool|array + * array ( + * 'Count' => '2', + * 'PicList' =>array ( + * 'item' =>array ( + * 0 =>array ('PicMd5Sum' => 'aaae42617cf2a14342d96005af53624c'), + * 1 =>array ('PicMd5Sum' => '149bd39e296860a2adc2f1bb81616ff8'), + * ), + * ), + * ) + * + */ + public function getRevSendPicsInfo() + { + if (isset($this->_receive['SendPicsInfo'])) { + if (!is_array($this->_receive['SendPicsInfo'])) { + $array = (array)$this->_receive['SendPicsInfo']; + if (isset($array['PicList'])) { + $array['PicList'] = (array)$array['PicList']; + $item = $array['PicList']['item']; + $array['PicList']['item'] = array(); + foreach ($item as $key => $value) { + $array['PicList']['item'][$key] = (array)$value; + } + } + $this->_receive['SendPicsInfo'] = $array; + } else { + $array = $this->_receive['SendPicsInfo']; + } + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–自定义èœå•çš„地ç†ä½ç½®é€‰æ‹©å™¨äº‹ä»¶æŽ¨é€ + * + * 事件类型为以下时则å¯ä»¥è°ƒç”¨æ­¤æ–¹æ³•æœ‰æ•ˆ + * Event 事件类型,location_select 弹出地ç†ä½ç½®é€‰æ‹©å™¨çš„äº‹ä»¶æŽ¨é€ + * + * @return bool|array + * array ( + * 'Location_X' => '33.731655000061', + * 'Location_Y' => '113.29955200008047', + * 'Scale' => '16', + * 'Label' => 'æŸæŸå¸‚æŸæŸåŒºæŸæŸè·¯', + * 'Poiname' => '', + * ) + * + */ + public function getRevSendGeoInfo() + { + if (isset($this->_receive['SendLocationInfo'])) { + if (!is_array($this->_receive['SendLocationInfo'])) { + $array = (array)$this->_receive['SendLocationInfo']; + if (empty($array['Poiname'])) { + $array['Poiname'] = ""; + } + if (empty($array['Label'])) { + $array['Label'] = ""; + } + $this->_receive['SendLocationInfo'] = $array; + } else { + $array = $this->_receive['SendLocationInfo']; + } + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * 获å–æŽ¥æ”¶è¯­éŸ³æŽ¨é€ + * @return bool|array + */ + public function getRevVoice() + { + if (isset($this->_receive['MediaId'])) { + return array( + 'mediaid' => $this->_receive['MediaId'], + 'format' => $this->_receive['Format'], + ); + } + return false; + } + + /** + * 获å–æŽ¥æ”¶è§†é¢‘æŽ¨é€ + * @return array|bool + */ + public function getRevVideo() + { + if (isset($this->_receive['MediaId'])) { + return array( + 'mediaid' => $this->_receive['MediaId'], + 'thumbmediaid' => $this->_receive['ThumbMediaId'], + ); + } + return false; + } + + /** + * 获å–接收TICKET + * @return bool|string + */ + public function getRevTicket() + { + if (isset($this->_receive['Ticket'])) { + return $this->_receive['Ticket']; + } + return false; + } + + /** + * 获å–二维ç çš„场景值 + * @return bool|string + */ + public function getRevSceneId() + { + if (isset($this->_receive['EventKey'])) { + return str_replace('qrscene_', '', $this->_receive['EventKey']); + } + return false; + } + + /** + * 获å–主动推é€çš„消æ¯ID + * ç»è¿‡éªŒè¯ï¼Œè¿™ä¸ªå’Œæ™®é€šçš„消æ¯MsgIdä¸ä¸€æ · + * 当Event为 MASSSENDJOBFINISH 或 TEMPLATESENDJOBFINISH + * @return bool|string + */ + public function getRevTplMsgID() + { + if (isset($this->_receive['MsgID'])) { + return $this->_receive['MsgID']; + } + return false; + } + + /** + * 获å–模æ¿æ¶ˆæ¯å‘é€çŠ¶æ€ + * @return bool|string + */ + public function getRevStatus() + { + if (isset($this->_receive['Status'])) { + return $this->_receive['Status']; + } + return false; + } + + /** + * 获å–群å‘或模æ¿æ¶ˆæ¯å‘é€ç»“æžœ + * 当Event为 MASSSENDJOBFINISH 或 TEMPLATESENDJOBFINISH,å³é«˜çº§ç¾¤å‘/模æ¿æ¶ˆæ¯ + * @return bool|array + */ + public function getRevResult() + { + if (isset($this->_receive['Status'])) { //å‘é€æ˜¯å¦æˆåŠŸï¼Œå…·ä½“的返回值请å‚考 高级群å‘/模æ¿æ¶ˆæ¯ 的事件推é€è¯´æ˜Ž + $array['Status'] = $this->_receive['Status']; + } + if (isset($this->_receive['MsgID'])) { //å‘é€çš„消æ¯id + $array['MsgID'] = $this->_receive['MsgID']; + } + //以下仅当群å‘消æ¯æ—¶æ‰ä¼šæœ‰çš„事件内容 + if (isset($this->_receive['TotalCount'])) { //分组或openid列表内粉ä¸æ•°é‡ + $array['TotalCount'] = $this->_receive['TotalCount']; + } + if (isset($this->_receive['FilterCount'])) { //过滤(过滤是指特定地区ã€æ€§åˆ«çš„过滤ã€ç”¨æˆ·è®¾ç½®æ‹’收的过滤,用户接收已超4æ¡çš„过滤)åŽï¼Œå‡†å¤‡å‘é€çš„粉ä¸æ•° + $array['FilterCount'] = $this->_receive['FilterCount']; + } + if (isset($this->_receive['SentCount'])) { //å‘é€æˆåŠŸçš„粉ä¸æ•° + $array['SentCount'] = $this->_receive['SentCount']; + } + if (isset($this->_receive['ErrorCount'])) { //å‘é€å¤±è´¥çš„粉ä¸æ•° + $array['ErrorCount'] = $this->_receive['ErrorCount']; + } + if (isset($array) && count($array) > 0) { + return $array; + } + return false; + } + + /** + * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - æŽ¥å…¥ä¼šè¯ + * 当Event为 kfcreatesession å³æŽ¥å…¥ä¼šè¯ + * @return bool|string + */ + public function getRevKFCreate() + { + if (isset($this->_receive['KfAccount'])) { + return $this->_receive['KfAccount']; + } + return false; + } + + /** + * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - å…³é—­ä¼šè¯ + * 当Event为 kfclosesession å³å…³é—­ä¼šè¯ + * @return bool|string + */ + public function getRevKFClose() + { + if (isset($this->_receive['KfAccount'])) { + return $this->_receive['KfAccount']; + } + return false; + } + + /** + * 获å–多客æœä¼šè¯çŠ¶æ€æŽ¨é€äº‹ä»¶ - è½¬æŽ¥ä¼šè¯ + * 当Event为 kfswitchsession å³è½¬æŽ¥ä¼šè¯ + * @return bool|array + */ + public function getRevKFSwitch() + { + if (isset($this->_receive['FromKfAccount'])) { //åŽŸæŽ¥å…¥å®¢æœ + $array['FromKfAccount'] = $this->_receive['FromKfAccount']; + } + if (isset($this->_receive['ToKfAccount'])) { //è½¬æŽ¥åˆ°å®¢æœ + $array['ToKfAccount'] = $this->_receive['ToKfAccount']; + } + return (isset($array) && count($array) > 0) ? $array : false; + } + + /** + * å‘é€å®¢æœæ¶ˆæ¯ + * @param array $data 消æ¯ç»“æž„{"touser":"OPENID","msgtype":"news","news":{...}} + * @return bool|array + */ + public function sendCustomMessage($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_URL_PREFIX . "/message/custom/send?access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 转å‘多客æœæ¶ˆæ¯ + * @param string $customer_account + * @return $this + */ + public function transfer_customer_service($customer_account = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'CreateTime' => time(), + 'MsgType' => 'transfer_customer_service', + ); + if ($customer_account) { + $msg['TransInfo'] = array('KfAccount' => $customer_account); + } + $this->Message($msg); + return $this; + } + + /** + * 设置å‘é€æ¶ˆæ¯ + * @param string|array $msg 消æ¯æ•°ç»„ + * @param bool $append 是å¦åœ¨åŽŸæ¶ˆæ¯æ•°ç»„追加 + * @return array + */ + public function Message($msg = '', $append = false) + { + if (is_null($msg)) { + $this->_msg = array(); + } elseif (is_array($msg)) { + if ($append) { + $this->_msg = array_merge($this->_msg, $msg); + } else { + $this->_msg = $msg; + } + return $this->_msg; + } + return $this->_msg; + } + + /** + * è®¾ç½®æ–‡æœ¬æ¶ˆæ¯ + * @param string $text 文本内容 + * @return $this + */ + public function text($text = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_TEXT, + 'Content' => $this->_auto_text_filter($text), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * è®¾ç½®å›¾ç‰‡æ¶ˆæ¯ + * @param string $mediaid 图片媒体ID + * @return $this + */ + public function image($mediaid = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_IMAGE, + 'Image' => array('MediaId' => $mediaid), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * 设置语音回å¤æ¶ˆæ¯ + * @param string $mediaid 语音媒体ID + * @return $this + */ + public function voice($mediaid = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_VOICE, + 'Voice' => array('MediaId' => $mediaid), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * 设置视频回å¤æ¶ˆæ¯ + * @param string $mediaid 视频媒体ID + * @param string $title 视频标题 + * @param string $description 视频æè¿° + * @return $this + */ + public function video($mediaid = '', $title = '', $description = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'MsgType' => self::MSGTYPE_VIDEO, + 'Video' => array( + 'MediaId' => $mediaid, + 'Title' => $title, + 'Description' => $description, + ), + 'CreateTime' => time(), + ); + $this->Message($msg); + return $this; + } + + /** + * 设置音ä¹å›žå¤æ¶ˆæ¯ + * @param string $title 音ä¹æ ‡é¢˜ + * @param string $desc 音ä¹æè¿° + * @param string $musicurl 音ä¹åœ°å€ + * @param string $hgmusicurl 高清音ä¹åœ°å€ + * @param string $thumbmediaid 音ä¹å›¾ç‰‡ç¼©ç•¥å›¾çš„媒体id(å¯é€‰ï¼‰ + * @return $this + */ + public function music($title, $desc, $musicurl, $hgmusicurl = '', $thumbmediaid = '') + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'CreateTime' => time(), + 'MsgType' => self::MSGTYPE_MUSIC, + 'Music' => array( + 'Title' => $title, + 'Description' => $desc, + 'MusicUrl' => $musicurl, + 'HQMusicUrl' => $hgmusicurl, + ), + ); + if ($thumbmediaid) { + $msg['Music']['ThumbMediaId'] = $thumbmediaid; + } + $this->Message($msg); + return $this; + } + + /** + * 设置回å¤å›¾æ–‡ + * @param array $newsData + * @return $this + */ + public function news($newsData = array()) + { + $msg = array( + 'ToUserName' => $this->getRevFrom(), + 'FromUserName' => $this->getRevTo(), + 'CreateTime' => time(), + 'MsgType' => self::MSGTYPE_NEWS, + 'ArticleCount' => count($newsData), + 'Articles' => $newsData, + ); + $this->Message($msg); + return $this; + } + + /** + * 回å¤å¾®ä¿¡æœåŠ¡å™¨ + * @param array $msg è¦å‘é€çš„ä¿¡æ¯ï¼ˆé»˜è®¤å–$this->_msg) + * @param bool $return 是å¦è¿”回信æ¯è€Œä¸æŠ›å‡ºåˆ°æµè§ˆå™¨ï¼ˆé»˜è®¤:å¦ï¼‰ + * @return bool|string + */ + public function reply($msg = array(), $return = false) + { + if (empty($msg)) { + if (empty($this->_msg)) { //防止ä¸å…ˆè®¾ç½®å›žå¤å†…容,直接调用reply方法导致异常 + return false; + } + $msg = $this->_msg; + } + $xmldata = Tools::arr2xml($msg); + if ($this->encrypt_type == 'aes') { //如果æ¥æºæ¶ˆæ¯ä¸ºåŠ å¯†æ–¹å¼ + !class_exists('Prpcrypt', false) && require __DIR__ . '/Lib/Prpcrypt.php'; + $pc = new Prpcrypt($this->encodingAesKey); + // 如果是第三方平å°ï¼ŒåŠ å¯†å¾—使用 component_appid + $array = $pc->encrypt($xmldata, empty($this->config['component_appid']) ? $this->appid : $this->config['component_appid']); + $ret = $array[0]; + if ($ret != 0) { + Tools::log('Encrypt Error!', "ERR - {$this->appid}"); + return false; + } + $timestamp = time(); + $nonce = rand(77, 999) * rand(605, 888) * rand(11, 99); + $encrypt = $array[1]; + $tmpArr = array($this->token, $timestamp, $nonce, $encrypt); + sort($tmpArr, SORT_STRING); + $signature = sha1(implode($tmpArr)); + $format = "%s"; + $xmldata = sprintf($format, $encrypt, $signature, $timestamp, $nonce); + } + if ($return) { + return $xmldata; + } + echo $xmldata; + } + + /** + * 过滤文字回å¤\r\næ¢è¡Œç¬¦ + * @param string $text + * @return string + */ + private function _auto_text_filter($text) + { + if (!$this->_text_filter) { + return $text; + } + return str_replace("\r\n", "\n", $text); + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php new file mode 100644 index 00000000000..c069f22f591 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatScript.php @@ -0,0 +1,138 @@ + + * @date 2016/06/28 11:24 + */ +class WechatScript extends Common +{ + + /** + * JSAPI授æƒTICKET + * @var string + */ + public $jsapi_ticket; + + /** + * 删除JSAPI授æƒTICKET + * @param string $appid + * @return bool + */ + public function resetJsTicket($appid = '') + { + $this->jsapi_ticket = ''; + $authname = 'wechat_jsapi_ticket_' . empty($appid) ? $this->appid : $appid; + Tools::removeCache($authname); + return true; + } + + /** + * 获å–JSAPI授æƒTICKET + * @param string $appid 用于多个appid时使用,å¯ç©º + * @param string $jsapi_ticket 手动指定jsapi_ticket,éžå¿…è¦æƒ…况ä¸å»ºè®®ç”¨ + * @param string $access_token èŽ·å– jsapi_ticket 指定 access_token + * @return bool|string + */ + public function getJsTicket($appid = '', $jsapi_ticket = '', $access_token = '') + { + if (empty($access_token)) { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $access_token = $this->access_token; + } + if (empty($appid)) { + $appid = $this->appid; + } + # 手动指定token,优先使用 + if ($jsapi_ticket) { + $this->jsapi_ticket = $jsapi_ticket; + return $this->jsapi_ticket; + } + # å°è¯•ä»Žç¼“å­˜ä¸­è¯»å– + $cache = 'wechat_jsapi_ticket_' . $appid; + $jt = Tools::getCache($cache); + if ($jt) { + return $this->jsapi_ticket = $jt; + } + # 检测事件注册 + if (isset(Loader::$callback[__FUNCTION__])) { + return $this->jsapi_ticket = call_user_func_array(Loader::$callback[__FUNCTION__], array(&$this, &$cache)); + } + # 调接å£èŽ·å– + $result = Tools::httpGet(self::API_URL_PREFIX . self::GET_TICKET_URL . "access_token={$access_token}" . '&type=jsapi'); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + $this->jsapi_ticket = $json['ticket']; + Tools::setCache($cache, $this->jsapi_ticket, $json['expires_in'] ? intval($json['expires_in']) - 100 : 3600); + return $this->jsapi_ticket; + } + return false; + } + + /** + * 获å–JsApi使用签å + * @param string $url 网页的URL,自动处ç†#åŠå…¶åŽé¢éƒ¨åˆ† + * @param int $timestamp 当å‰æ—¶é—´æˆ³ (为空则自动生æˆ) + * @param string $noncestr éšæœºä¸² (为空则自动生æˆ) + * @param string $appid 用于多个appid时使用,å¯ç©º + * @param string $access_token èŽ·å– jsapi_ticket 指定 access_token + * @return array|bool 返回签å字串 + */ + public function getJsSign($url, $timestamp = 0, $noncestr = '', $appid = '', $access_token = '') + { + if (!$this->jsapi_ticket && !$this->getJsTicket($appid, '', $access_token) || empty($url)) { + return false; + } + $data = array( + "jsapi_ticket" => $this->jsapi_ticket, + "timestamp" => empty($timestamp) ? time() : $timestamp, + "noncestr" => '' . empty($noncestr) ? Tools::createNoncestr(16) : $noncestr, + "url" => trim($url), + ); + return array( + "url" => $url, + 'debug' => false, + "appId" => empty($appid) ? $this->appid : $appid, + "nonceStr" => $data['noncestr'], + "timestamp" => $data['timestamp'], + "signature" => Tools::getSignature($data, 'sha1'), + 'jsApiList' => array( + 'updateTimelineShareData', 'updateAppMessageShareData', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', + 'hideOptionMenu', 'showOptionMenu', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', + 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'closeWindow', 'scanQRCode', 'chooseWXPay', + 'translateVoice', 'getNetworkType', 'openLocation', 'getLocation', + 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard', + 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'pauseVoice', 'stopVoice', 'onVoicePlayEnd', 'uploadVoice', 'downloadVoice', + 'openWXDeviceLib', 'closeWXDeviceLib', 'getWXDeviceInfos', 'sendDataToWXDevice', 'disconnectWXDevice', 'getWXDeviceTicket', 'connectWXDevice', + 'startScanWXDevice', 'stopScanWXDevice', 'onWXDeviceBindStateChange', 'onScanWXDeviceResult', 'onReceiveDataFromWXDevice', + 'onWXDeviceBluetoothStateChange', 'onWXDeviceStateChange' + ) + ); + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php new file mode 100644 index 00000000000..56aa4c13a57 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatService.php @@ -0,0 +1,408 @@ + + * @date 2016/10/18 00:35:55 + */ +class WechatService +{ + + const URL_PREFIX = 'https://api.weixin.qq.com/cgi-bin/component'; + // 获å–æœåŠ¡access_token + const COMPONENT_TOKEN_URL = '/api_component_token'; + // 获å–(刷新)授æƒå…¬ä¼—å·çš„令牌 + const REFRESH_ACCESS_TOKEN = '/api_authorizer_token'; + // 获å–预授æƒç  + const PREAUTH_CODE_URL = '/api_create_preauthcode'; + // 获å–公众å·çš„授æƒä¿¡æ¯ + const QUERY_AUTH_URL = '/api_query_auth'; + // 获å–授æƒæ–¹çš„è´¦æˆ·ä¿¡æ¯ + const GET_AUTHORIZER_INFO_URL = '/api_get_authorizer_info'; + // 获å–授æƒæ–¹çš„é€‰é¡¹è®¾ç½®ä¿¡æ¯ + const GET_AUTHORIZER_OPTION_URL = '/api_get_authorizer_option'; + // 设置授æƒæ–¹çš„é€‰é¡¹ä¿¡æ¯ + const SET_AUTHORIZER_OPTION_URL = '/api_set_authorizer_option'; + + // 微信åŽå°æŽ¨é€çš„ticket æ¯å分钟更新一次 + public $errCode; + // æœåŠ¡appid + public $errMsg; + // æœåŠ¡appsecret + protected $component_verify_ticket; + // 公众å·æ¶ˆæ¯æ ¡éªŒToken + protected $component_appid; + // 公众å·æ¶ˆæ¯åŠ è§£å¯†Key + protected $component_appsecret; + // æœåŠ¡ä»¤ç‰Œ + protected $component_token; + // 授æƒæ–¹appid + protected $component_encodingaeskey; + // 授æƒæ–¹ä»¤ç‰Œ + protected $component_access_token; + // 刷新令牌 + protected $authorizer_appid; + // JSONæ•°æ® + protected $pre_auth_code; + // é”™è¯¯æ¶ˆæ¯ + protected $data; + + /** + * WechatService constructor. + * @param array $options + */ + public function __construct($options = array()) + { + $options = Loader::config($options); + $this->component_encodingaeskey = !empty($options['component_encodingaeskey']) ? $options['component_encodingaeskey'] : ''; + $this->component_verify_ticket = !empty($options['component_verify_ticket']) ? $options['component_verify_ticket'] : ''; + $this->component_appsecret = !empty($options['component_appsecret']) ? $options['component_appsecret'] : ''; + $this->component_token = !empty($options['component_token']) ? $options['component_token'] : ''; + $this->component_appid = !empty($options['component_appid']) ? $options['component_appid'] : ''; + } + + /** + * 接收公众平å°æŽ¨é€çš„ Ticket + * @return bool|array + */ + public function getComonentTicket() + { + $receive = new WechatReceive(array( + 'appid' => $this->component_appid, + 'appsecret' => $this->component_appsecret, + 'encodingaeskey' => $this->component_encodingaeskey, + 'token' => $this->component_token, + 'cachepath' => Cache::$cachepath + )); + # 会è¯å†…容解密状æ€åˆ¤æ–­ + if (false === $receive->valid()) { + $this->errCode = $receive->errCode; + $this->errMsg = $receive->errMsg; + Tools::log("Get Wechat Push ComponentVerifyTicket Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + $data = $receive->getRev()->getRevData(); + if ($data['InfoType'] === 'component_verify_ticket' && !empty($data['ComponentVerifyTicket'])) { + # 记录推é€æ—¥å¿—到微信SDK + Tools::log("Wechat Push ComponentVerifyTicket Success. "); + Tools::setCache('component_verify_ticket', $data['ComponentVerifyTicket']); + } + return $data; + } + + /** + * 获å–(刷新)授æƒå…¬ä¼—å·çš„令牌 + * @注æ„1. 授æƒå…¬ä¼—å·è®¿é—®access token2å°æ—¶æœ‰æ•ˆ + * @注æ„2. 一定ä¿å­˜å¥½æ–°çš„刷新令牌 + * @param string $authorizer_appid 授æƒæ–¹APPID + * @param string $authorizer_refresh_token 授æƒæ–¹åˆ·æ–°ä»¤ç‰Œ + * @return bool|string + */ + public function refreshAccessToken($authorizer_appid, $authorizer_refresh_token) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $data['authorizer_refresh_token'] = $authorizer_refresh_token; + $url = self::URL_PREFIX . self::REFRESH_ACCESS_TOKEN . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($result = $this->_decode($result)) === false) { + Tools::log("Get getAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $result; + } + + /** + * 获å–或刷新æœåŠ¡ AccessToken + * @return bool|string + */ + public function getComponentAccessToken() + { + $cacheKey = 'wechat_component_access_token'; + $this->component_access_token = Tools::getCache($cacheKey); + if (empty($this->component_access_token)) { + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['component_appsecret'] = $this->component_appsecret; + $data['component_verify_ticket'] = $this->component_verify_ticket; + $url = self::URL_PREFIX . self::COMPONENT_TOKEN_URL; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($this->component_access_token = $this->_decode($result, 'component_access_token')) === false) { + Tools::log("Get getComponentAccessToken Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + Tools::setCache($cacheKey, $this->component_access_token, 7200); + } + return $this->component_access_token; + } + + /** + * 解æžJSONæ•°æ® + * @param string $result + * @param string|null $field + * @return bool|array + */ + private function _decode($result, $field = null) + { + $this->data = json_decode($result, true); + if (!empty($this->data['errcode'])) { + $this->errCode = $this->data['errcode']; + $this->errMsg = $this->data['errmsg']; + return false; + } + if ($this->data && !is_null($field)) { + if (isset($this->data[$field])) { + return $this->data[$field]; + } else { + return false; + } + } + return $this->data; + } + + /** + * 获å–公众å·çš„授æƒä¿¡æ¯ + * + * @param string $authorization_code + * @return bool|array + */ + public function getAuthorizationInfo($authorization_code) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorization_code'] = $authorization_code; + $url = self::URL_PREFIX . self::QUERY_AUTH_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + $authorization_info = $this->_decode($result, 'authorization_info'); + if (empty($authorization_info)) { + Tools::log("Get getAuthorizationInfo Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + $authorization_info['func_info'] = $this->_parseFuncInfo($authorization_info['func_info']); + return $authorization_info; + } + + /** + * 解æžæŽˆæƒä¿¡æ¯ï¼Œè¿”回以逗å·åˆ†å‰²çš„æ•°æ® + * @param array $func_info + * @return string + */ + private function _parseFuncInfo($func_info) + { + $authorization_list = array(); + foreach ($func_info as $func) { + foreach ($func as $f) { + isset($f['id']) && $authorization_list[] = $f['id']; + } + } + return join($authorization_list, ','); + } + + /** + * 获å–授æƒæ–¹çš„è´¦æˆ·ä¿¡æ¯ + * @param string $authorizer_appid + * @return bool + */ + public function getWechatInfo($authorizer_appid) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + $data = array(); + $data['component_access_token'] = $this->component_access_token; + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $url = self::URL_PREFIX . self::GET_AUTHORIZER_INFO_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + $authorizer_info = $this->_decode($result, 'authorizer_info'); + if (empty($authorizer_info)) { + Tools::log("Get WechatInfo Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + return false; + } + $author_data = array_merge($authorizer_info, $this->data['authorization_info']); + $author_data['service_type_info'] = $author_data['service_type_info']['id']; + $author_data['verify_type_info'] = $author_data['verify_type_info']['id']; + $author_data['func_info'] = $this->_parseFuncInfo($author_data['func_info']); + $author_data['business_info'] = json_encode($author_data['business_info']); + return $author_data; + } + + /** + * 获å–授æƒæ–¹çš„é€‰é¡¹è®¾ç½®ä¿¡æ¯ + * @param string $authorizer_appid + * @param string $option_name + * @return bool + */ + public function getAuthorizerOption($authorizer_appid, $option_name) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->authorizer_appid)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $data['option_name'] = $option_name; + $url = self::URL_PREFIX . self::GET_AUTHORIZER_OPTION_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($result = $this->_decode($result)) === false) { + Tools::log("Get getAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $result; + } + + /** + * 设置授æƒæ–¹çš„é€‰é¡¹ä¿¡æ¯ + * @param string $authorizer_appid + * @param string $option_name + * @param string $option_value + * @return bool + */ + public function setAuthorizerOption($authorizer_appid, $option_name, $option_value) + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->authorizer_appid)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $data['authorizer_appid'] = $authorizer_appid; + $data['option_name'] = $option_name; + $data['option_value'] = $option_value; + $url = self::URL_PREFIX . self::SET_AUTHORIZER_OPTION_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + if (($result = $this->_decode($result)) === false) { + Tools::log("Get setAuthorizerOption Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $result; + } + + /** + * 获å–授æƒå›žè·³åœ°å€ + * @param string $redirect_uri + * @return bool + */ + public function getAuthRedirect($redirect_uri) + { + empty($this->pre_auth_code) && $this->getPreauthCode(); + if (empty($this->pre_auth_code)) { + return false; + } + return "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={$this->component_appid}&pre_auth_code={$this->pre_auth_code}&redirect_uri={$redirect_uri}"; + } + + /** + * 获å–预授æƒç  + * + * @return bool|string + */ + public function getPreauthCode() + { + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $data = array(); + $data['component_appid'] = $this->component_appid; + $url = self::URL_PREFIX . self::PREAUTH_CODE_URL . "?component_access_token={$this->component_access_token}"; + $result = Tools::httpPost($url, Tools::json_encode($data)); + $this->pre_auth_code = $this->_decode($result, 'pre_auth_code'); + if (empty($this->pre_auth_code)) { + Tools::log("Get getPreauthCode Faild. {$this->errMsg} [$this->errCode]", "ERR - {$this->authorizer_appid}"); + } + return $this->pre_auth_code; + } + + /** + * oauth 授æƒè·³è½¬æŽ¥å£ + * @param string $appid + * @param string $redirect_uri + * @param string $scope snsapi_userinfo|snsapi_base + * @return string + */ + public function getOauthRedirect($appid, $redirect_uri, $scope = 'snsapi_userinfo') + { + return "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$appid}&redirect_uri=" . urlencode($redirect_uri) + . "&response_type=code&scope={$scope}&state={$appid}&component_appid={$this->component_appid}#wechat_redirect"; + } + + /** + * 通过code获å–Access Token + * @param string $appid + * @return bool|array + */ + public function getOauthAccessToken($appid) + { + $code = isset($_GET['code']) ? $_GET['code'] : ''; + if (empty($code)) { + return false; + } + empty($this->component_access_token) && $this->getComponentAccessToken(); + if (empty($this->component_access_token)) { + return false; + } + $url = "https://api.weixin.qq.com/sns/oauth2/component/access_token?appid={$appid}&code={$code}&grant_type=authorization_code&" + . "component_appid={$this->component_appid}&component_access_token={$this->component_access_token}"; + $json = $this->parseJson(Tools::httpGet($url)); + if ($json !== false) { + return $json; + } + return false; + } + + /** + * 解æžJSONæ•°æ® + * @param string $result + * @return bool + */ + private function parseJson($result) + { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return false; + } + return $json; + } + + /** + * 获å–å…³æ³¨è€…è¯¦ç»†ä¿¡æ¯ + * @param string $openid + * @param string $oauthAccessToken + * @return bool|array {subscribe,openid,nickname,sex,city,province,country,language,headimgurl,subscribe_time,[unionid]} + * 注æ„:unionid字段 åªæœ‰åœ¨ç”¨æˆ·å°†å…¬ä¼—å·ç»‘定到公众å·ç¬¬ä¸‰æ–¹å¹³å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 + */ + public function getOauthUserInfo($openid, $oauthAccessToken) + { + $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$oauthAccessToken}&openid={$openid}&lang=zh_CN"; + return $this->parseJson(Tools::httpGet($url)); + } + + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php new file mode 100644 index 00000000000..e8182bc9688 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/Wechat/WechatUser.php @@ -0,0 +1,612 @@ + + * @date 2016/06/28 11:20 + */ +class WechatUser extends Common +{ + + /** 获å–粉ä¸åˆ—表 */ + const USER_GET_URL = '/user/get?'; + /* 获å–粉ä¸ä¿¡æ¯ */ + const USER_INFO_URL = '/user/info?'; + /* 批é‡èŽ·å–粉ä¸ä¿¡æ¯ */ + const USER_BATCH_INFO_URL = '/user/info/batchget?'; + /* 更新粉ä¸æ ‡æ³¨ */ + const USER_UPDATEREMARK_URL = '/user/info/updateremark?'; + + /** 创建标签 */ + const TAGS_CREATE_URL = '/tags/create?'; + /* 获å–标签列表 */ + const TAGS_GET_URL = '/tags/get?'; + /* 更新标签 */ + const TAGS_UPDATE_URL = '/tags/update?'; + /* 删除标签 */ + const TAGS_DELETE_URL = '/tags/delete?'; + /* 获å–标签下的粉ä¸åˆ—表 */ + const TAGS_GET_USER_URL = '/user/tag/get?'; + /* 批é‡ä¸ºç²‰ä¸æ‰“标签 */ + const TAGS_MEMBER_BATCHTAGGING = '/tags/members/batchtagging?'; + /* 批é‡ä¸ºç²‰ä¸å–消标签 */ + const TAGS_MEMBER_BATCHUNTAGGING = '/tags/members/batchuntagging?'; + /* 获å–粉ä¸çš„标签列表 */ + const TAGS_LIST = '/tags/getidlist?'; + + /** 获å–分组列表 */ + const GROUP_GET_URL = '/groups/get?'; + /* 获å–粉ä¸æ‰€åœ¨çš„分组 */ + const USER_GROUP_URL = '/groups/getid?'; + /* 创建分组 */ + const GROUP_CREATE_URL = '/groups/create?'; + /* 更新分组 */ + const GROUP_UPDATE_URL = '/groups/update?'; + /* 删除分组 */ + const GROUP_DELETE_URL = '/groups/delete?'; + /* 修改粉ä¸æ‰€åœ¨åˆ†ç»„ */ + const GROUP_MEMBER_UPDATE_URL = '/groups/members/update?'; + /* 批é‡ä¿®æ”¹ç²‰ä¸æ‰€åœ¨åˆ†ç»„ */ + const GROUP_MEMBER_BATCHUPDATE_URL = '/groups/members/batchupdate?'; + + /** 获å–黑åå•åˆ—表 */ + const BACKLIST_GET_URL = '/tags/members/getblacklist?'; + /* 批é‡æ‹‰é»‘ç²‰ä¸ */ + const BACKLIST_ADD_URL = '/tags/members/batchblacklist?'; + /* 批é‡å–æ¶ˆæ‹‰é»‘ç²‰ä¸ */ + const BACKLIST_DEL_URL = '/tags/members/batchunblacklist?'; + + /** + * 批é‡èŽ·å–关注粉ä¸åˆ—表 + * @param string $next_openid + * @return bool|array + */ + public function getUserList($next_openid = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::USER_GET_URL . "access_token={$this->access_token}&next_openid={$next_openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–å…³æ³¨è€…è¯¦ç»†ä¿¡æ¯ + * @param string $openid + * @return bool|array {subscribe,openid,nickname,sex,city,province,country,language,headimgurl,subscribe_time,[unionid]} + * @注æ„:unionid字段 åªæœ‰åœ¨ç²‰ä¸å°†å…¬ä¼—å·ç»‘定到微信开放平å°è´¦å·åŽï¼Œæ‰ä¼šå‡ºçŽ°ã€‚建议调用å‰ç”¨isset()检测一下 + */ + public function getUserInfo($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::USER_INFO_URL . "access_token={$this->access_token}&openid={$openid}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡èŽ·å–ç”¨æˆ·åŸºæœ¬ä¿¡æ¯ + * @param array $openids 用户oepnid列表(最多支æŒ100个openid) + * @param string $lang 指定返回语言 + * @return bool|mixed + */ + public function getUserBatchInfo(array $openids, $lang = 'zh_CN') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('user_list' => array()); + foreach (array_unique($openids) as $openid) { + $data['user_list'][] = array('openid' => $openid, 'lang' => $lang); + } + $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_BATCH_INFO_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode']) || !isset($json['user_info_list'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['user_info_list']; + } + return false; + } + + /** + * 设置粉ä¸å¤‡æ³¨å + * @param string $openid + * @param string $remark 备注å + * @return bool|array + */ + public function updateUserRemark($openid, $remark) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid, 'remark' => $remark); + $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_UPDATEREMARK_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸åˆ†ç»„列表 + * @return bool|array + */ + public function getGroup() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::GROUP_GET_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除粉ä¸åˆ†ç»„ + * @param string $id + * @return bool + */ + public function delGroup($id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('group' => array('id' => $id)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_DELETE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸æ‰€åœ¨åˆ†ç»„ + * @param string $openid + * @return bool|int æˆåŠŸåˆ™è¿”回粉ä¸åˆ†ç»„id + */ + public function getUserGroup($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::USER_GROUP_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode']) || !isset($json['groupid'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['groupid']; + } + return false; + } + + /** + * 新增自定分组 + * @param string $name 分组å称 + * @return bool|array + */ + public function createGroup($name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('group' => array('name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更改分组å称 + * @param int $groupid 分组id + * @param string $name 分组å称 + * @return bool|array + */ + public function updateGroup($groupid, $name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('group' => array('id' => $groupid, 'name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 移动粉ä¸åˆ†ç»„ + * @param int $groupid 分组id + * @param string $openid 粉ä¸openid + * @return bool|array + */ + public function updateGroupMembers($groupid, $openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid, 'to_groupid' => $groupid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_MEMBER_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡ç§»åŠ¨ç²‰ä¸åˆ†ç»„ + * @param string $groupid 分组ID + * @param string $openid_list 粉ä¸openid数组(一次ä¸èƒ½è¶…过50个) + * @return bool|array + */ + public function batchUpdateGroupMembers($groupid, $openid_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openid_list, 'to_groupid' => $groupid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::GROUP_MEMBER_BATCHUPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 新增自定标签 + * @param string $name 标签å称 + * @return bool|array + */ + public function createTags($name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tag' => array('name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_CREATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 更新标签 + * @param string $id 标签id + * @param string $name 标签å称 + * @return bool|array + */ + public function updateTag($id, $name) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tag' => array('id' => $id, 'name' => $name)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_UPDATE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸æ ‡ç­¾åˆ—表 + * @return bool|array + */ + public function getTags() + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpGet(self::API_URL_PREFIX . self::TAGS_GET_URL . "access_token={$this->access_token}"); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 删除粉ä¸æ ‡ç­¾ + * @param string $id + * @return bool + */ + public function delTag($id) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tag' => array('id' => $id)); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_DELETE_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–标签下的粉ä¸åˆ—表 + * @param string $tagid + * @param string $next_openid + * @return bool + */ + public function getTagUsers($tagid, $next_openid = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('tagid' => $tagid, 'next_openid' => $next_openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_GET_USER_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡ä¸ºç²‰ä¸æ‰“标签 + * @param string $tagid 标签ID + * @param array $openid_list 粉ä¸openid数组,一次ä¸èƒ½è¶…过50个 + * @return bool|array + */ + public function batchAddUserTag($tagid, $openid_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openid_list, 'tagid' => $tagid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_MEMBER_BATCHTAGGING . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡ä¸ºç²‰ä¸å–消标签 + * @param string $tagid 标签ID + * @param array $openid_list 粉ä¸openid数组,一次ä¸èƒ½è¶…过50个 + * @return bool|array + */ + public function batchDeleteUserTag($tagid, $openid_list) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openid_list, 'tagid' => $tagid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_MEMBER_BATCHUNTAGGING . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 获å–粉ä¸çš„标签列表 + * @param string $openid 粉ä¸openid + * @return bool|array + */ + public function getUserTags($openid) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid' => $openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::TAGS_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode']) || !isset($json['tagid_list'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json['tagid_list']; + } + return false; + } + + /** + * 批é‡èŽ·å–黑åå•ç²‰ä¸ + * @param string $begin_openid + * @return bool|array + */ + public function getBacklist($begin_openid = '') + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = empty($begin_openid) ? array() : array('begin_openid' => $begin_openid); + $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_GET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡æ‹‰é»‘ç²‰ä¸ + * @param string $openids + * @return bool|array + */ + public function addBacklist($openids) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openids); + $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_ADD_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + + /** + * 批é‡å–æ¶ˆæ‹‰é»‘ç²‰ä¸ + * @param string $openids + * @return bool|array + */ + public function delBacklist($openids) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $data = array('openid_list' => $openids); + $result = Tools::httpPost(self::API_URL_PREFIX . self::BACKLIST_DEL_URL . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解æžæŽ¥å£è¿”回内容ï¼'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json new file mode 100644 index 00000000000..81791c07296 --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/composer.json @@ -0,0 +1,21 @@ +{ + "type": "project", + "name": "zoujingli/wechat-php-sdk", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "description": "WeChat development of SDK", + "license": "MIT", + "keywords": [ + "wechat-php-sdk" + ], + "require": { + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + } +} diff --git a/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php new file mode 100644 index 00000000000..c2aa13f9e8f --- /dev/null +++ b/upload/system/storage/vendor/zoujingli/wechat-php-sdk/include.php @@ -0,0 +1,17 @@ + '', + 'appid' => '', + 'appsecret' => '', + 'encodingaeskey' => '', +); + +# 加载对应æ“ä½œæŽ¥å£ +$wechat = &\Wechat\Loader::get('User', $config); +$userlist = $wechat->getUserList(); + +var_dump($userlist); +var_dump($wechat->errMsg); +var_dump($wechat->errCode); + +exit; + +// ç¬¬ä¸‰æ–¹å¹³å° JSSDK ç­¾å包 + +$wechat = Db::name('WechatConfig')->where('authorizer_appid', 'wx60a43dd8161666d4')->find(); +// 第三方授æƒèŽ·å–到的 Access_token +$access_token = $wechat['authorizer_access_token']; +// å‚与授æƒçš„å…¬ä¼—å· APPID +$authorizer_appid = $wechat['authorizer_appid']; +// 当å‰å¾®ä¿¡é¡µé¢URL地å€ï¼ˆå®Œæ•´ï¼‰ +$current_url = url('', '', true, true); +// 实例SDK脚本 +$script = load_wechat('Script', $authorizer_appid); +// 获å–JSç­¾å包 +$result = $script->getJsSign($current_url, 0, '', $authorizer_appid, $access_token); +dump($result); +dump([$script->errMsg, $script->errCode]); + +$json = json_encode($result, JSON_PRETTY_PRINT); +echo ''; +echo " + +"; \ No newline at end of file From fa0a664dcc0192810452fc7651d72bfcebe6e554 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 15:14:50 +0000 Subject: [PATCH 29/39] Support for PHP 8.0 and 8.1 --- composer.json | 3 +- composer.lock | 43 +++++++++++++++++- .../storage/vendor/composer/autoload_psr4.php | 1 + .../vendor/composer/autoload_static.php | 8 ++++ .../storage/vendor/composer/installed.json | 44 +++++++++++++++++++ .../storage/vendor/composer/installed.php | 13 +++++- 6 files changed, 108 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index bfbfefc2cdf..ca157c4e5bb 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "twig/twig": "^3.3", "braintree/braintree_php": "^6.7", "cardinity/cardinity-sdk-php": "^3.0", - "divido/divido-php": "^1.15" + "divido/divido-php": "^1.15", + "zoujingli/wechat-php-sdk": "^1.3" } } diff --git a/composer.lock b/composer.lock index f54b8517f5d..adf7ef10412 100644 --- a/composer.lock +++ b/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": "c65da74baf4b5b406a807a2768a641e8", + "content-hash": "5f7477d996d7712fa2980dcd28c9d064", "packages": [ { "name": "braintree/braintree_php", @@ -1688,6 +1688,47 @@ } ], "time": "2022-02-04T06:59:48+00:00" + }, + { + "name": "zoujingli/wechat-php-sdk", + "version": "v1.3.18", + "source": { + "type": "git", + "url": "https://github.com/zoujingli/wechat-php-sdk.git", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "type": "project", + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WeChat development of SDK", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "keywords": [ + "wechat-php-sdk" + ], + "support": { + "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", + "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" + }, + "time": "2019-10-10T09:42:15+00:00" } ], "packages-dev": [], diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index f5b55984841..e8e15603fe5 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -6,6 +6,7 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( + 'Wechat\\' => array($vendorDir . '/zoujingli/wechat-php-sdk/Wechat'), 'Twig\\' => array($vendorDir . '/twig/twig/src'), 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index 92c051d570b..aaed2282f1f 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -24,6 +24,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ); public static $prefixLengthsPsr4 = array ( + 'W' => + array ( + 'Wechat\\' => 7, + ), 'T' => array ( 'Twig\\' => 5, @@ -68,6 +72,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ); public static $prefixDirsPsr4 = array ( + 'Wechat\\' => + array ( + 0 => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat', + ), 'Twig\\' => array ( 0 => __DIR__ . '/..' . '/twig/twig/src', diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 2ec88f60ece..0a269f77bc2 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1747,6 +1747,50 @@ } ], "install-path": "../twig/twig" + }, + { + "name": "zoujingli/wechat-php-sdk", + "version": "v1.3.18", + "version_normalized": "1.3.18.0", + "source": { + "type": "git", + "url": "https://github.com/zoujingli/wechat-php-sdk.git", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "time": "2019-10-10T09:42:15+00:00", + "type": "project", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WeChat development of SDK", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "keywords": [ + "wechat-php-sdk" + ], + "support": { + "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", + "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" + }, + "install-path": "../zoujingli/wechat-php-sdk" } ], "dev": true, diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index c91d7396e79..6356f318105 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '9eafc89e549d514dad6af4089b5e8682f8fa52b4', + 'reference' => '5752a07a9627148655e9d80e4d5477ddce212916', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -79,7 +79,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '9eafc89e549d514dad6af4089b5e8682f8fa52b4', + 'reference' => '5752a07a9627148655e9d80e4d5477ddce212916', 'dev_requirement' => false, ), 'psr/http-message' => array( @@ -232,5 +232,14 @@ 'reference' => '972d8604a92b7054828b539f2febb0211dd5945c', 'dev_requirement' => false, ), + 'zoujingli/wechat-php-sdk' => array( + 'pretty_version' => 'v1.3.18', + 'version' => '1.3.18.0', + 'type' => 'project', + 'install_path' => __DIR__ . '/../zoujingli/wechat-php-sdk', + 'aliases' => array(), + 'reference' => 'd37d0c1919ede2ee54e65100ac3792e947b1e0ef', + 'dev_requirement' => false, + ), ), ); From 875a31f87bce9584a95757f48274d7a8b49454a8 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 16:35:43 +0000 Subject: [PATCH 30/39] Support for PHP 8.0 and 8.1 --- .../vendor/klarna/kco_rest/.gitattributes | 9 + .../vendor/klarna/kco_rest/CHANGELOG.md | 223 ++++++++++ .../storage/vendor/klarna/kco_rest/LICENSE | 201 +++++++++ .../storage/vendor/klarna/kco_rest/README.md | 165 +++++++ .../vendor/klarna/kco_rest/composer.json | 55 +++ .../examples/CheckoutAPI/create_checkout.php | 111 +++++ .../create_checkout_attachment.php | 126 ++++++ .../docs/examples/CheckoutAPI/discounts.php | 103 +++++ .../examples/CheckoutAPI/fetch_checkout.php | 62 +++ .../CheckoutAPI/handling_exceptions.php | 64 +++ .../examples/CheckoutAPI/update_checkout.php | 103 +++++ .../examples/Common/change_user_agent.php | 113 +++++ .../CustomerTokenAPI/Tokens/create_order.php | 106 +++++ .../Tokens/read_token_details.php | 57 +++ .../Tokens/update_token_status.php | 59 +++ .../Sessions/create_new_hpp_session.php | 80 ++++ .../Sessions/disable_session.php | 57 +++ .../Sessions/distribute_link.php | 67 +++ .../Sessions/get_hpp_session_status.php | 57 +++ .../ButtonKeys/create_button_key.php | 111 +++++ .../ButtonKeys/see_button_key_options.php | 57 +++ .../ButtonKeys/update_button_key.php | 81 ++++ .../Orders/approve_order.php | 122 ++++++ .../Orders/decline_order.php | 62 +++ .../Orders/retrieve_order.php | 57 +++ .../Captures/add_shipping_info.php | 72 ++++ .../Captures/trigger_send_out.php | 60 +++ .../Captures/update_customer_details.php | 65 +++ .../Orders/acknowledge_order.php | 60 +++ .../Orders/cancel_order.php | 59 +++ .../Orders/create_capture.php | 87 ++++ .../Orders/extend_authorization_time.php | 57 +++ .../Orders/fetch_all_captures.php | 58 +++ .../Orders/fetch_capture.php | 58 +++ .../OrderManagementAPI/Orders/fetch_order.php | 57 +++ .../release_remaining_authorization.php | 59 +++ .../Orders/update_customer_details.php | 68 +++ .../Orders/update_merchant_references.php | 63 +++ .../Orders/update_order_lines.php | 75 ++++ .../Refunds/fetch_refund.php | 58 +++ .../Refunds/refund_order.php | 76 ++++ .../Orders/cancel_existing_authorization.php | 57 +++ .../PaymentsAPI/Orders/create_order.php | 106 +++++ .../Orders/generate_customer_token.php | 82 ++++ .../Sessions/create_new_credit_session.php | 96 +++++ .../Sessions/read_credit_session.php | 57 +++ .../Sessions/update_credit_session.php | 79 ++++ .../Payouts/get_all_payouts.php | 61 +++ .../SettlementsAPI/Payouts/get_payout.php | 57 +++ .../SettlementsAPI/Payouts/get_summary.php | 61 +++ .../Reports/payout_report_csv.php | 58 +++ .../Reports/payout_report_pdf.php | 58 +++ .../Reports/summary_report_cvs.php | 62 +++ .../Reports/summary_report_pdf.php | 62 +++ .../Transactions/get_transactions.php | 61 +++ .../klarna/kco_rest/docs/http_transport.md | 79 ++++ .../Exceptions/NotApplicableException.php | 27 ++ .../src/Klarna/Rest/Checkout/Order.php | 116 +++++ .../src/Klarna/Rest/CustomerToken/Tokens.php | 116 +++++ .../Rest/HostedPaymentPage/Sessions.php | 145 +++++++ .../Rest/InstantShopping/ButtonKeys.php | 137 ++++++ .../Klarna/Rest/InstantShopping/Orders.php | 128 ++++++ .../MerchantCardService/VCCSettlements.php | 151 +++++++ .../Klarna/Rest/OrderManagement/Capture.php | 152 +++++++ .../src/Klarna/Rest/OrderManagement/Order.php | 407 ++++++++++++++++++ .../Klarna/Rest/OrderManagement/Refund.php | 89 ++++ .../src/Klarna/Rest/Payments/Orders.php | 141 ++++++ .../src/Klarna/Rest/Payments/Sessions.php | 117 +++++ .../kco_rest/src/Klarna/Rest/Resource.php | 332 ++++++++++++++ .../src/Klarna/Rest/Settlements/Payouts.php | 139 ++++++ .../src/Klarna/Rest/Settlements/Reports.php | 156 +++++++ .../Klarna/Rest/Settlements/Transactions.php | 84 ++++ .../src/Klarna/Rest/Transport/ApiResponse.php | 148 +++++++ .../Klarna/Rest/Transport/CURLConnector.php | 303 +++++++++++++ .../src/Klarna/Rest/Transport/Connector.php | 30 ++ .../Rest/Transport/ConnectorInterface.php | 124 ++++++ .../Exception/ConnectorException.php | 144 +++++++ .../Klarna/Rest/Transport/GuzzleConnector.php | 280 ++++++++++++ .../src/Klarna/Rest/Transport/Method.php | 29 ++ .../Rest/Transport/ResponseValidator.php | 207 +++++++++ .../src/Klarna/Rest/Transport/UserAgent.php | 120 ++++++ .../Rest/Transport/UserAgentInterface.php | 117 +++++ .../vendor/klarna/kco_rest/src/autoload.php | 30 ++ 83 files changed, 8345 insertions(+) create mode 100644 upload/system/storage/vendor/klarna/kco_rest/.gitattributes create mode 100644 upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md create mode 100644 upload/system/storage/vendor/klarna/kco_rest/LICENSE create mode 100644 upload/system/storage/vendor/klarna/kco_rest/README.md create mode 100644 upload/system/storage/vendor/klarna/kco_rest/composer.json create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Checkout/Order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ResponseValidator.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/autoload.php diff --git a/upload/system/storage/vendor/klarna/kco_rest/.gitattributes b/upload/system/storage/vendor/klarna/kco_rest/.gitattributes new file mode 100644 index 00000000000..2013edf972a --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/.gitattributes @@ -0,0 +1,9 @@ +.github export-ignore +git_hooks export-ignore +tests export-ignore +.coveralls.yml export-ignore +.editorconfig export-ignore +.gitignore export-ignore +.travis.yml export-ignore +phpmd.xml export-ignore +phpunit.xml.dist export-ignore diff --git a/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md b/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md new file mode 100644 index 00000000000..afca0b76e3c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md @@ -0,0 +1,223 @@ + + +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [4.2.3] - 2020-02-14 + +### Added + +- HTTP Transport: Oceania Base URLs (playground and production) + + +## [4.2.2] - 2019-11-05 + +### Changed + +- Remove "src" folder from a PSR4 autoload definition as fallback directory. + + +## [4.2.1] - 2019-10-15 + +### Added + +- Test against php 7.3 + +### Fixed + +- CURL Transport: Add processing of multiple HTTP headers in response.[Caught exception: Response is missing a Content-Type header #44](https://github.com/klarna/kco_rest_php/issues/44); +- Fix exception namespace and PHPDoc +- Stores the KEY ID field in order to restore the ID after fetching data without the KEY field. [Payments Session ID is reset after fetch() #37](https://github.com/klarna/kco_rest_php/issues/37) + +## [4.2.0] - 2019-06-11 + +This release has a number of **[no-backward-compatibility]** flags. But these incompatible changes related +only to the "under the hood" files. It means, if you operate only with high-level instances, like +`Connector` and `Rest\`/`Checkout/Payments/OrderManagement/etc` resources (you have the code, +like in the example files) - you are safe for upgrade. + +If you have your own implementation of REST API Services, HTTP Transport or Base Resource instance, +you need to check the code before go live. + +### Added + +- Add new HTTP Transport `CURLTransport`. This transport does not require any package dependencies +- Add PHP SDK SPL Autoloader +- Add `ApiResponse` class to unify an HTTP Transport reponse + +### Changed + +- Decouple the HTTP Transport Connector interface. Remove Guzzle hardcoded dependency **[no-backward-compatibility]** +- Decouple `ConnectorException`. Remove Guzzle hardcoded dependency **[partial-backward-compatibility]** + - Change the constructor signature. Replace `RequestException` exception with `int $code` + - `getResponse` method is not longer return Guzzle `ResponseInterface`. + This method marked as deprecated and return `null` +- Rename `Klarna/Rest/Transport/Connector.php` to `Klarna/Rest/Transport/GuzzleConnector.php` to + make the name explicit. **[backward-compatible]** + The `Klarna/Rest/Transport/Connector.php` still exists, but marked as deprecated +- Change the structure and return values for all the methods in `GuzzleConnector` (ex `Connector`) + to follow the new Connector interface. **[no-backward-compatibility]** +- Exception throwing behavior: **[partial-backward-compatibility]** + - `GuzzleConnector` (ex `Connector`) no longer throws Guzzle related `RuntimeException` exceptions. + The Connector throws only `RuntimeException` + - The only two types of exceptions can be thrown by SDK now: + - `RuntimeException` + - `ConnectorException` +- Extend `ResponseValidator` with `expectSuccessfull` and `isSuccessfull` methods. The methods allows + to validate the reponse code and parse the Klarna Error Message if possible + +## [4.1.5] - 2019-05-21 + +### Added + +- Add `.gitattributes` file to remove needless load from composer imports +- Examples: Add "How to set a discount" example. + +### Changed + +- Remove unused phpunit/phpcov package; +- Examples: Checkout API: Add more callback URLs; + +### Fixed + +- Debug mode: Request body and headers were not displayed when getting 400 HTTP response code. +- Examples: Checkout API: Fix typo in the attachments file; + +## [4.1.4] - 2019-03-15 + +### Added + +- Add full support of Instant Shopping API +- Repo now has an Apache 2.0 LICENSE file on its root +- HTTP Transport: Add support of PUT method +- Examples: Add Instant Shopping examples. + +### Fixed + +- HTTP Transport: Stop throwing an exception when an API service return a bad structured Error; + +## [4.1.3] - 2019-01-23 + +### Added + +- HPP API: Add support for disabling an HPP session; +- Customer Token API: Add ability to use Klarna-Idempotency-Key when creating order +- Customer Token API: Add new feature: Update token status; +- Examples: Add example of changing the User-Agent. + +## [4.1.2] - 2018-11-22 + +### Fixed + +- Order management API threw Error Notice when fetching an order with refunds. + +## [4.1.1] - 2018-10-31 + +### Added + +- Add support of Merchant Card Service API + +### Changed + +- HPP: HPP service changed API completely without backward compatibility. Adopt SDK to the new changes. + Mark `getSessionStatus` as `@deprecated`. Replaced by fetch function. + Return data was changed by HPP API service. + **[partial-backward-compatibility]** + +## [4.0.0] - 2018-08-27 (Major release) + +### Added + +- `OrderManagement`: + - Add ability to fetch Captures; + - Add support of Refunds **[partial-backward-compatibility]**; +- Add full support of Customer Token API; +- Add full support of Settlements API; +- Add full support of Payments API; +- Add full support of Hosted Payment Page API; +- Add 'Debug Mode' to be able to debug requests and responses; +- Put SDK References documentation to GH Pages: [https://klarna.github.io/kco_rest_php/](https://klarna.github.io/kco_rest_php/) +- More Examples for all Klarna Services. + +### Changed + +- OrderManagementAPI: Changed `refund` function. Before returned `$this`, now returns - `Refund` object; +- OrderManagementAPI: Order object now has an `array` of `Refund` objects instead of just array of data. + **[backward-compatible]** + +### Fixed + +- Fix: Settlements API [Unexpected Header #15](https://github.com/klarna/kco_rest_php/issues/15); + +## [3.0.1] - 2017-01-16 + +### Fixed + +- smaller fixes + +## [3.0.0] - 2017-12-12 + +### Changed + +- support for guzzle >6.0 + +## [2.2.0] - 2015-12-7 + +### Added + +- **NEW META-13** Allow for 201 response on refund - *Joakim.L* + +## [2.1.0] - 2015-07-29 + +### Changed + +- **NEW MINT-2262** Support Guzzle 5.x versions - *Omer.K, Joakim.L* + +## [2.0.0] - 2015-06-10 + +### Added + +- **NEW MINT-2214** Add base URLs for North America - *Joakim.L* + +### Fixed + +- **NEW MINT-2203** Use order id instead of URL for checkout orders - *Joakim.L* + +## [1.0.1] - 2015-03-30 + +### Added + +- **NEW MINT-2097** Add apigen and custom styling - *Petros.G* + +### Fixed + +- **FIX MINT-2002** Handle errors with an empty payload - *David.K* + +## 1.0.0 - 2014-10-16 + +### Added + +- **NEW MINT-1804** Support checkout v3 and ordermanagement v1 APIs - *Joakim.L* + +[Unreleased]: https://github.com/klarna/kco_rest_php/compare/v4.2.3...HEAD +[4.2.3]: https://github.com/klarna/kco_rest_php/compare/v4.2.2...v4.2.3 +[4.2.2]: https://github.com/klarna/kco_rest_php/compare/v4.2.1...v4.2.2 +[4.2.1]: https://github.com/klarna/kco_rest_php/compare/v4.2.0...v4.2.1 +[4.2.0]: https://github.com/klarna/kco_rest_php/compare/v4.1.5...v4.2.0 +[4.1.5]: https://github.com/klarna/kco_rest_php/compare/v4.1.4...v4.1.5 +[4.1.4]: https://github.com/klarna/kco_rest_php/compare/v4.1.3...v4.1.4 +[4.1.3]: https://github.com/klarna/kco_rest_php/compare/v4.1.2...v4.1.3 +[4.1.2]: https://github.com/klarna/kco_rest_php/compare/v4.1.1...v4.1.2 +[4.1.1]: https://github.com/klarna/kco_rest_php/compare/v4.0.0...v4.1.2 +[4.0.0]: https://github.com/klarna/kco_rest_php/compare/v3.0.1...v4.0.0 +[3.0.1]: https://github.com/klarna/kco_rest_php/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/klarna/kco_rest_php/compare/v2.1.0...v3.0.0 +[2.1.0]: https://github.com/klarna/kco_rest_php/compare/v2.0.0...v2.1.0 +[2.0.0]: https://github.com/klarna/kco_rest_php/compare/v1.0.1...v2.0.0 +[1.0.1]: https://github.com/klarna/kco_rest_php/compare/v1.0.0...v1.0.1 diff --git a/upload/system/storage/vendor/klarna/kco_rest/LICENSE b/upload/system/storage/vendor/klarna/kco_rest/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/upload/system/storage/vendor/klarna/kco_rest/README.md b/upload/system/storage/vendor/klarna/kco_rest/README.md new file mode 100644 index 00000000000..3f956572694 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/README.md @@ -0,0 +1,165 @@ +# Official Klarna REST PHP SDK +[![Packagist Version][packagist-image]](https://packagist.org/packages/klarna/kco_rest) +[![Build Status][travis-image]](https://travis-ci.org/klarna/kco_rest_php) +[![Coverage Status][coveralls-image]](https://coveralls.io/r/klarna/kco_rest_php?branch=v4.x) + +## Shop now. Pay later. + +Shop at your favorite stores today and experience the freedom to pay later with Klarna. + + +## Getting started + +SDK covers all of Klarna API: https://developers.klarna.com/api/ + +### Prerequisites +* PHP 5.5 or above +* [API credentials](#api-credentials) +* [Composer](https://getcomposer.org/) (optional) + + +### API Credentials + +Before getting a production account you can get a playground one. +Register here to be able to test your SDK integration before go live: + +- https://playground.eu.portal.klarna.com/developer-sign-up - for EU countries +- https://playground.us.portal.klarna.com/developer-sign-up - for the US + + +## PHP SDK Installation and Usage + +### Install via Composer + +To install the PHP SDK from the Central Composer repository use composer: + +```shell +composer require klarna/kco_rest +``` + +Highly recommended to use version tag when installing SDK. + +```shell +composer require klarna/kco_rest:1.2.3.4 +``` + +Detailed information about the PHP SDK package and a list of available versions can be found here: +https://packagist.org/packages/klarna/kco_rest + +Include the SDK into your PHP file using the Composer autoloader: + +```php + +``` + +or + +```shell +$ export DEBUG_SDK=1 +$ php +``` + +Another way to enable Debugging Mode is `define` the **DEBUG_SDK** inside your script: + +```php +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + GET : https://api.playground.klarna.com/customer-token/v1/tokens/TOKEN +Headers : {"User-Agent":["Library\/Klarna.kco_rest_php_3.1.0 (Guzzle\/6.3.3; curl\/7.54.0) OS\/Darwin_17.5.0 Language\/PHP_5.6.37"]} + Body : + +DEBUG MODE: Response +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +Headers : {"Content-Type":["application\/json"],"Date":["Wed, 15 Aug 2018 15:55:53 GMT"],"Klarna-Correlation-Id":["ABC-123"],"Server":["openresty"],"Content-Length":["62"],"Connection":["keep-alive"]} + Body : { + "status" : "ACTIVE", + "payment_method_type" : "INVOICE" + } +``` + + +## Questions and feedback +If you have any questions concerning this product or the implementation, +please create an issue: https://github.com/klarna/kco_rest_php/issues/new/choose + +Use an official Klarna Contact us form (https://klarna.com) if you have a question about the integration. + + +## How to contribute +At Klarna, we strive toward achieving the highest possible quality for our +products. Therefore, we require you to follow these guidelines if you wish +to contribute. + +To contribute, the following criteria needs to be fulfilled: + +* Description regarding what has been changed and why +* Pull requests should implement a boxed change +* All code and documentation must follow the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) +* New features and bug fixes must have accompanying unit tests: + * Positive tests + * Negative tests + * Boundary tests (if possible) + * No less than 90% decision coverage +* All tests should pass + + +## License +Klarna Checkout REST PHP SDK is licensed under +[Apache License, Version 2.0](http://www.apache.org/LICENSE-2.0) + +[packagist-image]: https://img.shields.io/packagist/v/klarna/kco_rest.svg?style=flat +[travis-image]: https://img.shields.io/travis/klarna/kco_rest_php/v4.x.svg?style=flat +[coveralls-image]: https://img.shields.io/coveralls/klarna/kco_rest_php/v4.x.svg?style=flat diff --git a/upload/system/storage/vendor/klarna/kco_rest/composer.json b/upload/system/storage/vendor/klarna/kco_rest/composer.json new file mode 100644 index 00000000000..17e62fa1f95 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/composer.json @@ -0,0 +1,55 @@ +{ + "name": "klarna/kco_rest", + "description": "Official Klarna REST PHP SDK", + "homepage": "http://developers.klarna.com", + "license": "Apache-2.0", + "type": "library", + "authors": [ + { + "name": "Klarna AB" + } + ], + "autoload": { + "psr-4": { + "Klarna\\": "src/Klarna/" + } + }, + "autoload-dev": { + "psr-4": { + "Klarna\\Rest\\Tests\\": "tests/" + } + }, + "minimum-stability": "stable", + "require": { + "php": ">=5.5.0", + "guzzlehttp/guzzle": "~6.0" + }, + "require-dev": { + "phpunit/phpunit": ">=4.0.0, <6.0", + "squizlabs/php_codesniffer": "1.5.*", + "phpmd/phpmd": "2.1.*", + "phploc/phploc": "2.0.*", + "sebastian/phpcpd": "2.0.*", + "php-coveralls/php-coveralls": "^2.1", + "apigen/apigen": "4.1.*", + "klarna/apigen-theme": "2.1.0" + }, + "scripts": { + "test": "vendor/bin/phpunit --colors", + "reference": "vendor/bin/apigen generate -s src -d docs/reference --template-config='vendor/klarna/apigen-theme/src/config.neon'", + "checkstyle": "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --extensions=php src/ tests/", + "check": [ + "@test", + "@checkstyle" + ], + "analyze": [ + "mkdir -p build/logs", + "vendor/bin/phploc --log-csv build/logs/phploc.csv src/ tests/", + "mkdir -p build/pdepend", + "vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg src/", + "vendor/bin/phpmd src/,tests/ xml phpmd.xml --reportfile build/logs/pmd.xml || true", + "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --report-file=build/logs/checkstyle.xml --extensions=php src/ tests/", + "vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml src/ tests/ || true" + ] + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php new file mode 100644 index 00000000000..2f796c37027 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php @@ -0,0 +1,111 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://www.example.com/terms.html", + "cancellation_terms" => "https://www.example.com/terms/cancellation.html", + "checkout" => "https://www.example.com/checkout.html", + "confirmation" => "https://www.example.com/confirmation.html", + + // Callbacks + "push" => "https://www.example.com/api/push", + "validation" => "https://www.example.com/api/validation", + "shipping_option_update" => "https://www.example.com/api/shipment", + "address_update" => "https://www.example.com/api/address", + "notification" => "https://www.example.com/api/pending", + "country_change" => "https://www.example.com/api/country" + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + // Store checkout order id + $orderId = $checkout->getId(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php new file mode 100644 index 00000000000..0c991ca9252 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php @@ -0,0 +1,126 @@ + [ + [ + "unique_account_identifier" => "Test Testperson", + "payment_option" => "card", + "number_paid_purchases" => 1, + "total_amount_paid_purchases" => 10000, + "date_of_last_paid_purchase" => (new DateTime())->format(DATE_FORMAT), + "date_of_first_paid_purchase" => (new DateTime())->format(DATE_FORMAT) + ] + ] +]; + +$order = [ + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://www.example.com/terms.html", + "cancellation_terms" => "https://www.example.com/terms/cancellation.html", + "checkout" => "https://www.example.com/checkout.html", + "confirmation" => "https://www.example.com/confirmation.html", + + // Callbacks + "push" => "https://www.example.com/api/push", + "validation" => "https://www.example.com/api/validation", + "shipping_option_update" => "https://www.example.com/api/shipment", + "address_update" => "https://www.example.com/api/address", + "notification" => "https://www.example.com/api/pending", + "country_change" => "https://www.example.com/api/country" + ], + "attachment" => [ + "content_type" => "application/vnd.klarna.internal.emd-v2+json", + "body" => json_encode($emd) + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + // Store checkout order id + $orderId = $checkout->getId(); + + // Get some data if needed + print_r($checkout['attachment']); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php new file mode 100644 index 00000000000..6703a1cc706 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php @@ -0,0 +1,103 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 9000, + "order_tax_amount" => 818, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "19-402-USA", + "name" => "Red T-Shirt", + "quantity" => 1, + "quantity_unit" => "pcs", + "unit_price" => 10000, + "tax_rate" => 1000, + "total_amount" => 10000, + "total_tax_amount" => 909 + ], + + // Add discount as an order line + [ + "type" => "discount", + "reference" => "10-gbp-order-discount", + "name" => "Discount", + "quantity" => 1, + "unit_price" => -1000, + "tax_rate" => 1000, + "total_amount" => -1000, + "total_tax_amount" => -91 + ] + ], + "merchant_urls" => [ + "terms" => "https://www.example.com/terms.html", + "cancellation_terms" => "https://www.example.com/terms/cancellation.html", + "checkout" => "https://www.example.com/checkout.html", + "confirmation" => "https://www.example.com/confirmation.html", + + // Callbacks + "push" => "https://www.example.com/api/push", + "validation" => "https://www.example.com/api/validation", + "shipping_option_update" => "https://www.example.com/api/shipment", + "address_update" => "https://www.example.com/api/address", + "notification" => "https://www.example.com/api/pending", + "country_change" => "https://www.example.com/api/country" + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + echo $checkout['html_snippet']; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php new file mode 100644 index 00000000000..270aca35559 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php @@ -0,0 +1,62 @@ +fetch(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php new file mode 100644 index 00000000000..ef6652330f3 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php @@ -0,0 +1,64 @@ +create([ + 'wrong order data' + ]); +} catch (ConnectorException $e) { + echo 'Message: ' . $e->getMessage() . "\n"; + echo 'Code: ' . $e->getCode() . "\n"; + echo 'ErrorCode: ' . $e->getErrorCode() . "\n"; + echo 'CorrelationID: ' . $e->getCorrelationId() . "\n"; + echo 'ServiceVersion: ' . $e->getServiceVersion() . "\n"; +} catch (Exception $e) { + echo 'Unhandled exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php new file mode 100644 index 00000000000..11e0463805a --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php @@ -0,0 +1,103 @@ + 11000, + "order_tax_amount" => 2200, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ], + [ + "type" => "shipping_fee", + "name" => "Express delivery", + "quantity" => 1, + "unit_price" => 1000, + "tax_rate" => 2500, + "total_amount" => 1000, + "total_tax_amount" => 200 + ] + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector, $orderId); + $checkout->update($updatedOrder); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php new file mode 100644 index 00000000000..26e705493cb --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php @@ -0,0 +1,113 @@ +setField('Platform', 'MyCustomShop', '1.2.3.4.5', ['seoAddon', 'promo']); +$customUserAgent->setField('PHP', 'Version', '5.4'); +$customUserAgent->setField('Hello', 'World'); + +// Headers: "User-Agent": ["Platform/MyCustomShop_1.2.3.4.5 (seoAddon; promo) PHP/Version_5.4 Hello/World"] + +$connector = Klarna\Rest\Transport\GuzzleConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint, + $customUserAgent +); + +$order = [ + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://example.com/toc", + "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", + "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", + "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + // Store checkout order id + $orderId = $checkout->getId(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php new file mode 100644 index 00000000000..5a75a47ef0b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php @@ -0,0 +1,106 @@ + "John", + "family_name" => "Doe", + "email" => "johndoe@example.com", + "title" => "Mr", + "street_address" => "13 New Burlington St", + "street_address2" => "Apt 214", + "postal_code" => "W13 3BG", + "city" => "London", + "region" => "", + "phone" => "01895808221", + "country" => "GB" +]; + +$data = [ + "billing_address" => $address, + "shipping_address" => $address, + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $token = new Klarna\Rest\CustomerToken\Tokens($connector, $customerToken); + $order = $token->createOrder($data); + + print_r($order); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php new file mode 100644 index 00000000000..7010a13b41c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php @@ -0,0 +1,57 @@ +fetch(); + + print_r($token->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php new file mode 100644 index 00000000000..f1419c9a5bd --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php @@ -0,0 +1,59 @@ +updateTokenStatus([ + 'status' => 'CANCELLED' + ]); + + echo 'Token patch request has been accepted and is being processed.'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php new file mode 100644 index 00000000000..7850a0d978a --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php @@ -0,0 +1,80 @@ + [ + "cancel" => "https://example.com/cancel", + "failure" => "https://example.com/fail", + "privacy_policy" => "https://example.com/privacy_policy", + "success" => "https://example.com/success?token={{authorization_token}}", + "terms" => "https://example.com/terms" + ], + "options" => [ + "background_images" => [ + [ + "url" => "https://example.com/bgimage.jpg", + "width" => 1200 + ] + ], + "logo_url" => "https://example.com/logo.jpg", + "page_title" => "Complete your purchase", + "payment_method_category" => "pay_later", + "purchase_type" => "buy" + ], + "payment_session_url" => "https://api.klarna.com/payments/v1/sessions/$sessionId" +]; + +try { + $hpp = new Klarna\Rest\HostedPaymentPage\Sessions($connector); + $sessionData = $hpp->create($session); + + print_r($sessionData); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php new file mode 100644 index 00000000000..111a6d76918 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php @@ -0,0 +1,57 @@ +disable(); + + echo 'The session has been disabled'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php new file mode 100644 index 00000000000..89925f946a3 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php @@ -0,0 +1,67 @@ + [ + "email" => "test@example.com", + "phone" => "07000212345", + "phone_country" => "SE" + ], + "method" => "sms", + "template" => "INSTORE_PURCHASE" + ]; + + $session = new Klarna\Rest\HostedPaymentPage\Sessions($connector, $sessionId); + $session->distributeLink($data); + + echo 'The session link has been distributed'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php new file mode 100644 index 00000000000..9d6f731b7fe --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php @@ -0,0 +1,57 @@ +getSessionStatus(); + + print_r($status); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php new file mode 100644 index 00000000000..76218fa0e42 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php @@ -0,0 +1,111 @@ + 'John Doe', + 'merchant_urls' => [ + 'place_order' => 'https://example.com/place-callback', + 'push' => 'https://example.com/push-callback', + 'confirmation' => 'https://example.com/confirmation-callback', + 'terms' => 'https://example.com/terms-callback', + 'notification' => 'https://example.com/notification-callback', + 'update' => 'https://example.com/update-callback', + ], + 'purchase_currency' => 'EUR', + 'purchase_country' => 'DE', + 'billing_countries' => ["UK", "DE", "SE"], + 'shipping_countries' => ["UK", "DE", "SE"], + 'locale' => 'en-US', + 'order_amount' => 50000, + 'order_tax_amount' => 0, + 'order_lines' => [ + [ + 'name' => 'Red T-Shirt', + 'type' => 'physical', + 'reference' => '19-402-USA', + 'quantity' => 5, + 'quantity_unit' => 'pcs', + 'tax_rate' => 0, + 'total_amount' => 50000, + 'total_discount_amount' => 0, + 'total_tax_amount' => 0, + 'unit_price' => 10000, + 'product_url' => 'https://www.estore.com/products/f2a8d7e34', + 'image_url' => 'https://www.exampleobjects.com/logo.png', + 'product_identifiers' => + [ + 'category_path' => 'Electronics Store > Computers & Tablets > Desktops', + 'global_trade_item_number' => '735858293167', + 'manufacturer_part_number' => 'BOXNUC5CPYH', + 'brand' => 'Intel', + ], + ], + ], + 'shipping_options' => [ + [ + 'id' => 'my-shipping-id', + 'name' => 'Pickup Store', + 'description' => 'My custom description', + 'promo' => 'string', + 'price' => 10, + 'tax_amount' => 0, + 'tax_rate' => 0, + 'preselected' => true, + 'shipping_method' => 'PICKUPSTORE', + ], + ], + ]; + $button = $buttonsApi->create($data); + + echo 'Button has been successfully created' . PHP_EOL; + print_r($button); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php new file mode 100644 index 00000000000..565d2c4b7c9 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php @@ -0,0 +1,57 @@ +retrieve(); + + print_r($button->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php new file mode 100644 index 00000000000..6318c44bd73 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php @@ -0,0 +1,81 @@ + 'New name', + 'merchant_urls' => [ + 'place_order' => 'https://example.com/place-callback', + 'push' => 'https://example.com/push-callback', + 'confirmation' => 'https://example.com/confirmation-callback', + 'terms' => 'https://example.com/terms-callback', + 'notification' => 'https://example.com/notification-callback', + 'update' => 'https://example.com/update-callback', + ], + 'shipping_options' => [ + [ + 'id' => 'my-new-shipping-id', + 'name' => 'Priority delivery', + 'description' => '', + 'price' => 300, + 'tax_amount' => 0, + 'tax_rate' => 0, + 'preselected' => false, + 'shipping_method' => 'PRIME_DELIVERY', + ], + ], + ]; + $button = $buttonsApi->update($data); + + echo 'Button has been successfully updated' . PHP_EOL; + print_r($button); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php new file mode 100644 index 00000000000..494f40609f2 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php @@ -0,0 +1,122 @@ + https://github.com/klarna/kco_rest_php/#api-credentials + * + * Make sure that your credentials belong to the right endpoint. If you have credentials for the US Playground, + * such credentials will not work for the EU Playground and you will get 401 Unauthorized exception. + */ +$merchantId = getenv('USERNAME') ?: 'K123456_abcd12345'; +$sharedSecret = getenv('PASSWORD') ?: 'sharedSecret'; +$authToken = getenv('AUTH_TOKEN') ?: 'authorization_token'; + +/* +EU_BASE_URL = 'https://api.klarna.com' +EU_TEST_BASE_URL = 'https://api.playground.klarna.com' +NA_BASE_URL = 'https://api-na.klarna.com' +NA_TEST_BASE_URL = 'https://api-na.playground.klarna.com' +OC_BASE_URL = 'https://api-oc.klarna.com' +OC_TEST_BASE_URL = 'https://api-oc.playground.klarna.com' +*/ +$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; + +$connector = Klarna\Rest\Transport\GuzzleConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint +); + +$order = [ + "order_id" => "f3392f8b-6116-4073-ab96-e330819e2c07", + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "billing_address" => [ + "given_name" => "Jane", + "family_name"=> "Doe", + "email"=> "jane-doe@example.com", + "title"=> "Ms", + "street_address"=> "Lombard St 10", + "street_address2"=> "Apt 214", + "postal_code"=> "90210", + "city"=> "Beverly Hills", + "region"=> "CA", + "phone"=> "333444555", + "country"=> "US" + ], + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://example.com/toc", + "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", + "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", + "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" + ], + "customer" => [ + "date_of_birth" => "1995-10-20", + "title" => "Mr", + "gender" => "male", + "last_four_ssn" => "0512", + "national_identification_number" => "3108971100", + "type" => "person", + "vat_id" => "string", + "organization_registration_id" => "556737-0431", + "organization_entity_type" => "LIMITED_COMPANY" + ] +]; + +try { + $orderApi = new Klarna\Rest\InstantShopping\Orders($connector, $authToken); + $status = $orderApi->approve($order); + + echo 'The order has been approved' . PHP_EOL; + print_r($status); +} catch (Exception $e) { + echo 'Caught exception => ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php new file mode 100644 index 00000000000..3a1ee128525 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php @@ -0,0 +1,62 @@ + "https://example.com/rejected.html", + "deny_code" => "other", + "deny_message" => "You are not permitted to purchase this product", + ]; + $orderApi->decline($data); + echo 'The order has been declined'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php new file mode 100644 index 00000000000..a9570c577cf --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php @@ -0,0 +1,57 @@ +retrieve(); + + print_r($order->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php new file mode 100644 index 00000000000..5c268b449dc --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php @@ -0,0 +1,72 @@ +fetchCapture($captureId); + $capture->addShippingInfo([ + "shipping_info" => [ + [ + "shipping_company" => "DHL", + "shipping_method" => "Home", + "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", + "tracking_number" => "1234567890", + "return_tracking_number" => "E-55-KL", + "return_shipping_company" => "DHL", + "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" + ] + ] + ]); + + echo 'Shipping info has been appended'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php new file mode 100644 index 00000000000..6052df03c3b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php @@ -0,0 +1,60 @@ +fetchCapture($captureId); + $capture->triggerSendout(); + + echo 'Triggered a new send out of customer payment communication'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php new file mode 100644 index 00000000000..db7151a2352 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php @@ -0,0 +1,65 @@ +fetchCapture($captureId); + $capture->updateCustomerDetails([ + "billing_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ] + ]); + + echo 'Billing address of the customer has been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php new file mode 100644 index 00000000000..9cf3ebbbfaa --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php @@ -0,0 +1,60 @@ +acknowledge(); + + echo 'Order has been acknowledged'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php new file mode 100644 index 00000000000..2a04a1431ea --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php @@ -0,0 +1,59 @@ +cancel(); + + echo 'Order has been cancelled'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php new file mode 100644 index 00000000000..d5721c1569e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php @@ -0,0 +1,87 @@ +createCapture([ + "captured_amount" => 6000, + "description" => "Shipped part of the order", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ] + ], + "shipping_info" => [ + [ + "shipping_company" => "DHL", + "shipping_method" => "Home", + "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", + "tracking_number" => "1234567890", + "return_tracking_number" => "E-55-KL", + "return_shipping_company" => "DHL", + "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" + ] + ] + ]); + + echo 'Capture has been created'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php new file mode 100644 index 00000000000..6e164fa7600 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php @@ -0,0 +1,57 @@ +extendAuthorizationTime(); + + echo 'The expiry time of an order has been extend'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php new file mode 100644 index 00000000000..7ae89e83f83 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php @@ -0,0 +1,58 @@ +fetchCaptures(); + foreach ($captures as $capture) { + print_r($capture->getArrayCopy()); + } +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php new file mode 100644 index 00000000000..50ee23ead75 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php @@ -0,0 +1,58 @@ +fetchCapture($captureId); + + print_r($capture->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php new file mode 100644 index 00000000000..b611ad5a272 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php @@ -0,0 +1,57 @@ +fetch(); + + print_r($order->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php new file mode 100644 index 00000000000..5b1cca93153 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php @@ -0,0 +1,59 @@ +releaseRemainingAuthorization(); + + echo 'Remaining authorised amount has been released'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php new file mode 100644 index 00000000000..87f77cafd42 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php @@ -0,0 +1,68 @@ +updateCustomerDetails([ + "billing_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ], + "shipping_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ] + ]); + + echo 'Customer details have been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php new file mode 100644 index 00000000000..b50574487f1 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php @@ -0,0 +1,63 @@ +updateMerchantReferences([ + "merchant_reference1" => "15632423", + "merchant_reference2" => "special order" + ]); + + echo 'Merchant references have been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php new file mode 100644 index 00000000000..561ac15d817 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php @@ -0,0 +1,75 @@ +updateAuthorization([ + "order_amount" => 6000, + "description" => "Removed bad bananas", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ] + ] + ]); + + echo 'New order amount and order lines have been set'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php new file mode 100644 index 00000000000..e5673834184 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php @@ -0,0 +1,58 @@ +fetchRefund($refundId); + + print_r($capture->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php new file mode 100644 index 00000000000..63e72cb571c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php @@ -0,0 +1,76 @@ +refund([ + "refunded_amount" => 3000, + "description" => "Refunding half the tomatoes", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 5, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 3000, + "total_tax_amount" => 600 + ] + ] + ]); + + $refund->fetch(); + print_r($refund->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php new file mode 100644 index 00000000000..ee0477a1d6d --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php @@ -0,0 +1,57 @@ +cancelAuthorization(); + + echo 'Authorization has been cancelled'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php new file mode 100644 index 00000000000..f742d5976c5 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php @@ -0,0 +1,106 @@ + "John", + "family_name" => "Doe", + "email" => "johndoe@example.com", + "title" => "Mr", + "street_address" => "13 New Burlington St", + "street_address2" => "Apt 214", + "postal_code" => "W13 3BG", + "city" => "London", + "region" => "", + "phone" => "01895808221", + "country" => "GB" +]; + +$data = [ + "billing_address" => $address, + "shipping_address" => $address, + "purchase_country" => "GB", + "purchase_currency" => "GBP", + "locale" => "en-GB", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); + $data = $order->create($data); + + print_r($data); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php new file mode 100644 index 00000000000..db15da2bf1c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php @@ -0,0 +1,82 @@ + "GB", + "purchase_currency" => "GBP", + "locale" => "en-GB", + "billing_address" => [ + "given_name" => "John", + "family_name" => "Doe", + "email" => "johndoe@example.com", + "title" => "Mr", + "street_address" => "13 New Burlington St", + "street_address2" => "Apt 214", + "postal_code" => "W13 3BG", + "city" => "London", + "region" => "", + "phone" => "01895808221", + "country" => "GB" + ], + "customer" => [ // MUST MATCH line by line to the customer details that was used to get an Authorization Token + "date_of_birth" => "1970-01-01", + "gender" => "male", + ], + "description" => "For testing purposes", + "intended_use" => "SUBSCRIPTION" +]; + +try { + $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); + $token = $order->generateToken($data); + + print_r($token); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php new file mode 100644 index 00000000000..216b32cd5c9 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php @@ -0,0 +1,96 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $session = new Klarna\Rest\Payments\Sessions($connector); + $session->create($order); + + // Store session id + $sessionId = $session->getId(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php new file mode 100644 index 00000000000..bbb87c9635d --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php @@ -0,0 +1,57 @@ +fetch(); + + print_r($session->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php new file mode 100644 index 00000000000..5be79859d9f --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php @@ -0,0 +1,79 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 4000, + "order_tax_amount" => 800, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "543670", + "name" => "New updated bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $session = new Klarna\Rest\Payments\Sessions($connector, $sessionId); + $session->update($order); + + echo 'Order has been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php new file mode 100644 index 00000000000..b6dfffb3945 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php @@ -0,0 +1,61 @@ +getAllPayouts([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT), + 'size' => 10, + ]); + + print_r($payouts); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php new file mode 100644 index 00000000000..80e43521c26 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php @@ -0,0 +1,57 @@ +getPayout($paymentReference); + + print_r($payout); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php new file mode 100644 index 00000000000..35d08e5a704 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php @@ -0,0 +1,61 @@ +getSummary([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT) + ]); + + print_r($summary); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php new file mode 100644 index 00000000000..1a7853c3541 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php @@ -0,0 +1,58 @@ +getCSVPayoutReport($paymentReference); + + file_put_contents('report.csv', $report); + echo 'Saved to report.csv'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php new file mode 100644 index 00000000000..6666b77cc5b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php @@ -0,0 +1,58 @@ +getPDFPayoutReport($paymentReference); + + file_put_contents('report.pdf', $report); + echo 'Saved to report.pdf'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php new file mode 100644 index 00000000000..0f68fdbccf6 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php @@ -0,0 +1,62 @@ +getCSVPayoutsSummaryReport([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT) + ]); + + file_put_contents('summary_report.csv', $report); + echo 'Saved to summary_report.csv'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php new file mode 100644 index 00000000000..2d67e710daa --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php @@ -0,0 +1,62 @@ +getPDFPayoutsSummaryReport([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT) + ]); + + file_put_contents('summary_report.pdf', $report); + echo 'Saved to summary_report.pdf'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php new file mode 100644 index 00000000000..36db249f4e0 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php @@ -0,0 +1,61 @@ + 10, // How many elements to include in the result + 'offset' => 0, // The current offset. Describes "where" in a collection the current starts + ]; + $data = $transactions->getTransactions($params); + + print_r($data); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md b/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md new file mode 100644 index 00000000000..cac0461a18e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md @@ -0,0 +1,79 @@ +How to use SDK HTTP Transport +======================================================== + +The SDK functionality relies on an "HTTP Transport" mechanism to handle HTTP communication +(requests / responses). The mechanism is decoupled from the SDK implementation itself +and allows for usage of different libraries that can handle the HTTP communication. + +All the transports should be responsible to get the information to be send and return the result. +There is no any SDK/Api Resources logic inside the transport. + +Previously the SDK used Guzzle HTTP library and it forces SDK users to use Composer. There was no +ability to install the Guzzle library manually. Currently, there is a new cURL Transport, that +allows to use the PHP SDK without Composer and any other extra dependencies. + +## Basic Transport Usage + +The basic SDK usage looks like in the example. You need to create an HTTP Transport connector +and pass the connector to the API Service resource: + +```php +$connector = Klarna\Rest\Transport\Connector::create($merchantId, $sharedSecret, $apiEndpoint); +$api = new Klarna\Rest\ApiService\Resource($connector); +$api->someMethod($someData); +``` + +## Guzzle HTTP Transport (Klarna\Rest\Transport\GuzzleConnector) + +By default all the SDK examples use Guzzle HTTP Transport (Composer is required in this case). +You need to include the SDK into your PHP file using the Composer autoloader: + +```php +require('/path/to/project/vendor/autoload.php'); + +$merchantId = 'K123456_abcd12345'; +$sharedSecret = 'sharedSecret'; +$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; + +// Create Guzzle HTTP Transport Connector +$connector = Klarna\Rest\Transport\GuzzleConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint +); + +$checkout = new Klarna\Rest\Checkout\Order($connector); +$checkout->create($order); +``` + +## cURL HTTP Transport (Klarna\Rest\Transport\CURLConnector) + +The transport uses PHP cURL Library (libcurl): https://www.php.net/manual/en/book.curl.php + +This library does not require any Composer libraries and relies only on `libcurl`. It means you +do not have any `vendor` autoloader and need to include the SDK SPL autoloader. + +```php +// `src` instead of vendor +require('/path/to/project/src/autoload.php'); + +$merchantId = 'K123456_abcd12345'; +$sharedSecret = 'sharedSecret'; +$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; + +// Create cURL HTTP Transport Connector +$connector = Klarna\Rest\Transport\CURLConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint +); + +$checkout = new Klarna\Rest\Checkout\Order($connector); +$checkout->create($order); +``` + +## HTTP Transport Response and Exceptions + +All the Transports should implement the `ConnectorInterface` interface. It imposes some restrictions: +- The only allowed response is [ApiResponse](https://github.com/klarna/kco_rest_php/blob/v4.1/src/Klarna/Rest/Transport/ApiResponse.php) +- The only allowed exceptions that can be thrown from the Transport is `RuntimeException`. diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php new file mode 100644 index 00000000000..1cbc8991d58 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php @@ -0,0 +1,27 @@ +setLocation(self::$path . "/{$orderId}"); + $this[static::ID_FIELD] = $orderId; + } + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json'); + + $this->exchangeArray($response->getJson()); + $this->setLocation($response->getLocation()); + + return $this; + } + + /** + * Updates the resource. + * + * @param array $data Update data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function update(array $data) + { + $response = $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + $this->exchangeArray($response); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php new file mode 100644 index 00000000000..e6c1c56da10 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php @@ -0,0 +1,116 @@ +setLocation(self::$path . "/{$customerToken}"); + $this[static::ID_FIELD] = $customerToken; + } + + /** + * Creates order using Customer Token. + * + * @param array $data Order data + * @param string $klarnaIdempotencyKey Idempotency Key + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array created order data + */ + public function createOrder(array $data, $klarnaIdempotencyKey = null) + { + $headers = ['Content-Type' => 'application/json']; + if (!is_null($klarnaIdempotencyKey)) { + $headers['Klarna-Idempotency-Key'] = $klarnaIdempotencyKey; + } + + return $this->request( + 'POST', + $this->getLocation() . '/order', + $headers, + $data !== null ? \json_encode($data) : null + ) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Update the status of a customer token. + * + * @param array $data Customer token data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateTokenStatus(array $data) + { + $this->patch($this->getLocation() . '/status', $data) + ->expectSuccessfull() + ->status('202'); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php new file mode 100644 index 00000000000..b7f757daf4b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php @@ -0,0 +1,145 @@ +setLocation(self::$path . "/{$sessionId}"); + $this[static::ID_FIELD] = $sessionId; + } + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-create-a-new-hpp-session + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Session data + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json') + ->getJson(); + + return $response; + } + + /** + * Disables HPP session. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-disable-hpp-session + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If sessionId was not specified when creating a resource + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function disable() + { + if (empty($this[static::ID_FIELD])) { + throw new \RuntimeException('HPP Session ID is not defined'); + } + + $this->delete($this->getLocation()) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Distributes link to the HPP session. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session + * + * @param array $data Distribute data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function distributeLink(array $data) + { + $this->post($this->getLocation() . '/distribution', $data) + ->expectSuccessfull() + ->status(['200', '201']); + + return $this; + } + + /** + * @deprecated HPP API no longer suppors getting the status. Use fetch (getSession) to fetch data; + * @deprecated This method will be removed in the future versions of SDK. + */ + public function getSessionStatus() + { + return $this->fetch(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php new file mode 100644 index 00000000000..352616d1d34 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php @@ -0,0 +1,137 @@ +setLocation(self::$path . "/{$buttonKey}"); + $this[static::ID_FIELD] = $buttonKey; + } + } + + /** + * Creates a button key based on setup options. + * + * @param array $data Creation data + * + * @see https://developers.klarna.com/api/#instant-shopping-api-create-a-button-key-based-on-setup-options + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Button properties + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json'); + + $url = $response->getLocation(); + $this->setLocation($url); + + return $response->getJson(); + } + + /** + * Updates the setup options for a specific button key. + * + * @param array $data Update data + * + * @see https://developers.klarna.com/api/#instant-shopping-api-update-the-setup-options-for-a-specific-button-key + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \RuntimeException If key was not specified when creating a resource + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Button properties + */ + public function update(array $data) + { + if (empty($this[static::ID_FIELD])) { + throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); + } + + return $this->put($this->getLocation(), $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * See the setup options for a specific button key. + * + * @see https://developers.klarna.com/api/#instant-shopping-api-see-the-setup-options-for-a-specific-button-key + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If key was not specified when creating a resource + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function retrieve() + { + if (empty($this[static::ID_FIELD])) { + throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); + } + + return $this->fetch(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php new file mode 100644 index 00000000000..0522f2d97eb --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php @@ -0,0 +1,128 @@ +setLocation(self::$path . "/{$authorizationToken}"); + $this[static::ID_FIELD] = $authorizationToken; + } + + /** + * Retrieves an authorized order based on the authorization token. + * + * @codingStandardsIgnoreStart + * @see https://developers.klarna.com/api/#instant-shopping-api-retrieves-an-authorized-order-based-on-the-authorization-token + * @codingStandardsIgnoreEnd + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function retrieve() + { + return $this->fetch(); + } + + /** + * Declines an authorized order identified by the authorization token. + * + * @codingStandardsIgnoreStart + * @see https://developers.klarna.com/api/#instant-shopping-api-declines-an-authorized-order-identified-by-the-authorization-token + * @codingStandardsIgnoreEnd + * + * @param array $data Decline data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function decline(array $data = null) + { + $this->delete($this->getLocation(), $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Approves the authorized order and places an order identified by the authorization token. + * + * @codingStandardsIgnoreStart + * @see https://developers.klarna.com/api/#instant-shopping-api-approve-the-authorized-order-and-place-an-order-identified-by-the-authorization-token + * @codingStandardsIgnoreEnd + * + * @param array $data Order data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array approving status + */ + public function approve(array $data) + { + return $this->post($this->getLocation() . '/orders', $data) + ->expectSuccessfull() + ->status('200') + ->getJson(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php new file mode 100644 index 00000000000..a2cae563914 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php @@ -0,0 +1,151 @@ +post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json') + ->getJson(); + + return $response; + } + + /** + * Retrieve an existing settlement. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session + * + * @param array $data Distribute data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Settlement data + */ + public function retrieveSettlement($settlementId, $keyId) + { + $response = $this->request( + 'GET', + self::$path . "/$settlementId", + ['KeyId' => $keyId] + ) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + return $response; + } + + /** + * Retrieves a settled order's settlement. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session + * + * @param array $data Distribute data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Order's settlement data + */ + public function retrieveOrderSettlement($orderId, $keyId) + { + $response = $this->request( + 'GET', + self::$path . "/order/$orderId", + ['KeyId' => $keyId] + ) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + return $response; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php new file mode 100644 index 00000000000..05a7ae0e648 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php @@ -0,0 +1,152 @@ +setLocation($url); + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $url = $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('201') + ->getLocation(); + + $this->setLocation($url); + + return $this; + } + + /** + * Appends shipping information to the capture. + * + * @param array $data Shipping info data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function addShippingInfo(array $data) + { + $this->post($this->getLocation() . '/shipping-info', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Updates the customers details. + * + * @param array $data Customer details data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateCustomerDetails(array $data) + { + $this->patch($this->getLocation() . '/customer-details', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Trigger send outs for this capture. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function triggerSendout() + { + $this->post($this->getLocation() . '/trigger-send-out') + ->expectSuccessfull() + ->status('204'); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php new file mode 100644 index 00000000000..c41804facac --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php @@ -0,0 +1,407 @@ +setLocation(self::$path . "/{$orderId}"); + $this[static::ID_FIELD] = $orderId; + } + + /** + * Fetches the order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function fetch() + { + parent::fetch(); + + // Convert captures data to Capture[] + + $captures = []; + foreach ($this['captures'] as $capture) { + $captureId = $capture[Capture::ID_FIELD]; + + $object = new Capture( + $this->connector, + $this->getLocation(), + $captureId + ); + $object->exchangeArray($capture); + + $captures[] = $object; + } + + $this['captures'] = $captures; + + + // Convert refunds data to Refund[] + if (isset($this['refunds'])) { + $refunds = []; + foreach ($this['refunds'] as $refund) { + $refundId = null; + if (isset($refund[Refund::ID_FIELD])) { + $refundId = $refund[Refund::ID_FIELD]; + } + + $object = new Refund( + $this->connector, + $this->getLocation(), + $refundId + ); + $object->exchangeArray($refund); + + $refunds[] = $object; + } + $this['refunds'] = $refunds; + } + + return $this; + } + + /** + * Acknowledges the order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function acknowledge() + { + $this->post($this->getLocation() . '/acknowledge') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Cancels this order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function cancel() + { + $this->post($this->getLocation() . '/cancel') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Updates the authorization data. Sets new order amount and order lines + * + * @param array $data Authorization data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateAuthorization(array $data) + { + $this->patch($this->getLocation() . '/authorization', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Extends the authorization time. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function extendAuthorizationTime() + { + $this->post($this->getLocation() . '/extend-authorization-time') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Update the merchant references. + * + * @param array $data Merchant references + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateMerchantReferences(array $data) + { + $this->patch($this->getLocation() . '/merchant-references', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Updates the customer details. + * + * @param array $data Customer data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateCustomerDetails(array $data) + { + $this->patch($this->getLocation() . '/customer-details', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Refunds an amount of a captured order. + * + * @param array $data Refund data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Refund + */ + public function refund(array $data) + { + $refund = new Refund($this->connector, $this->getLocation()); + $refund->create($data); + + return $refund; + } + + /** + * Release the remaining authorization for an order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function releaseRemainingAuthorization() + { + $this->post($this->getLocation() . '/release-remaining-authorization') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Capture all or part of an order. + * + * @param array $data Capture data + * + * @see Capture::create() For more information on how to create a capture + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Capture + */ + public function createCapture(array $data) + { + $capture = new Capture($this->connector, $this->getLocation()); + + $capture->create($data); + + $this['captures'][] = $capture; + + return $capture; + } + + /** + * Fetches the specified capture. + * + * @param string $captureId Capture ID + * + * @see Capture::fetch() For more information on how to fetch a capture + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Capture + */ + public function fetchCapture($captureId) + { + if ($this->offsetExists('captures')) { + foreach ($this['captures'] as $capture) { + if ($capture->getId() !== $captureId) { + continue; + } + + return $capture->fetch(); + } + } + + $capture = new Capture($this->connector, $this->getLocation(), $captureId); + $capture->fetch(); + + $this['captures'][] = $capture; + + return $capture; + } + + /** + * Fetches the specified refund. + * + * @param string $refundId Refund ID + * + * @see Refund::fetch() For more information on how to fetch a refund + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Refund + */ + public function fetchRefund($refundId) + { + if ($this->offsetExists('refunds')) { + foreach ($this['refunds'] as $refund) { + if ($refund->getId() !== $refundId) { + continue; + } + + return $refund; + } + } + + $refund = new Refund($this->connector, $this->getLocation(), $refundId); + $refund->fetch(); + + $this['refunds'][] = $refund; + + return $refund; + } + + /** + * Fetches all captures. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Capture[] + */ + public function fetchCaptures() + { + $captures = new Capture($this->connector, $this->getLocation()); + $captures = $captures->fetch()->getArrayCopy(); + + foreach ($captures as $id => $capture) { + $captures[$id] = new Capture($this->connector, $this->getLocation(), $capture['capture_id']); + $captures[$id]->exchangeArray($capture); + } + return $captures; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php new file mode 100644 index 00000000000..ab6045220ca --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php @@ -0,0 +1,89 @@ +setLocation($url); + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $url = $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('201') + ->getLocation(); + + $this->setLocation($url); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php new file mode 100644 index 00000000000..da538388b11 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php @@ -0,0 +1,141 @@ +setLocation(self::$path . "/{$authorizationToken}"); + $this[static::ID_FIELD] = $authorizationToken; + } + + /** + * Not applicable. + * + * @throws NotApplicableException + */ + public function fetch() + { + throw new NotApplicableException('Not applicable'); + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Order data + */ + public function create(array $data) + { + return $this->post($this->getLocation() . '/order', $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Cancels the authorization. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function cancelAuthorization() + { + $this->delete($this->getLocation()) + ->expectSuccessfull() + ->status('204'); + // ->contentType('application/json'); + // TODO: We cannot check the Content-type here because of an inconsistency + // between service and documentation. The real Content-Type is + // "application/octet-stream but not the "application/json" as in the docs. + + return $this; + } + + /** + * Generates consumer token. + * + * @param array $data Token data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Token data + */ + public function generateToken(array $data) + { + $response = $this->post($this->getLocation() . '/customer-token', $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + return $response; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php new file mode 100644 index 00000000000..3923b8e2b55 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php @@ -0,0 +1,117 @@ +setLocation(self::$path . "/{$sessionId}"); + $this[static::ID_FIELD] = $sessionId; + } + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json'); + + $this->exchangeArray($response->getJson()); + + // Payments API does not send Location header after creating a new session. + // Use workaround to set new location. + $this->setLocation(self::$path . '/' . $this->getId()); + + return $this; + } + + /** + * Updates the resource. + * + * @param array $data Update data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function update(array $data) + { + $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('204'); + // ->contentType('application/json'); + // TODO: We cannot check the Content-type here because of an inconsistency + // between service and documentation. The real Content-Type is + // "application/octet-stream but not the "application/json" as in the docs. + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php new file mode 100644 index 00000000000..35a78c2e00e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php @@ -0,0 +1,332 @@ +connector = $connector; + } + + /** + * Gets the resource id. + * + * @return string|null + */ + public function getId() + { + return isset($this[static::ID_FIELD]) ? $this[static::ID_FIELD] : null; + } + + /** + * Gets the resource location. + * + * @return string|null + */ + public function getLocation() + { + return $this->url; + } + + /** + * Sets the resource location. + * + * @param string $url Url to the resource + * + * @return self + */ + public function setLocation($url) + { + $this->url = $url; + + return $this; + } + + /** + * Overrides: Stores the ID KEY field in order to restore it after exchanging the array without + * the ID field. + * + * @param array $array Data to be exchanged + */ + public function exchangeArray($array) + { + $id = $this->getId(); + + if (!is_null($array)) { + parent::exchangeArray($array); + } + if (is_null($this->getId()) && !is_null($id)) { + $this->setId($id); + } + } + + /** + * Fetches the resource. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function fetch() + { + $data = $this->get($this->getLocation()) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + $this->exchangeArray($data); + + return $this; + } + + /** + * Sets new ID KEY field. + * + * @param mixed $id ID field + * + * @return self + */ + protected function setId($id) + { + $this[static::ID_FIELD] = $id; + return $this; + } + + /** + * Sends a HTTP request to the specified url. + * + * @param string $method HTTP method, e.g. 'GET' + * @param string $url Request destination + * @param array $headers + * @param string $body + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response' + * @return ResponseValidator When the API replies with an error response + * + */ + protected function request($method, $url, array $headers = [], $body = null) + { + $debug = getenv('DEBUG_SDK') || defined('DEBUG_SDK'); + + if ($debug) { + $methodDebug = str_pad($method, 7, ' ', STR_PAD_LEFT); + $debugHeaders = json_encode($headers); + echo <<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +{$methodDebug} : {$url} +Headers : $debugHeaders + Body : {$body} +\n +DEBUG_BODY; + } + + switch ($method) { + case Method::GET: + $response = $this->connector->get($url, $headers); + break; + case Method::POST: + $response = $this->connector->post($url, $body, $headers); + break; + case Method::PUT: + $response = $this->connector->put($url, $body, $headers); + break; + case Method::DELETE: + $response = $this->connector->delete($url, $body, $headers); + break; + case Method::PATCH: + $response = $this->connector->patch($url, $body, $headers); + break; + default: + throw new \RuntimeException('Unknown request method ' + $method); + } + + if ($debug) { + $debugHeaders = json_encode($response->getHeaders()); + echo <<getBody()} +\n +DEBUG_BODY; + } + + $location = $response->getLocation(); + if (!empty($location)) { + $this->setLocation($location); + } + + return new ResponseValidator($response); + } + + /** + * Sends a HTTP GET request to the specified url. + * + * @param string $url Request destination + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function get($url) + { + return $this->request('GET', $url); + } + + /** + * Sends a HTTP DELETE request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function delete($url, array $data = null) + { + return $this->request( + 'DELETE', + $url, + ['Content-Type' => 'application/json'], + $data !== null ? json_encode($data) : null + ); + } + + /** + * Sends a HTTP PATCH request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function patch($url, array $data) + { + return $this->request( + 'PATCH', + $url, + ['Content-Type' => 'application/json'], + json_encode($data) + ); + } + + /** + * Sends a HTTP PUT request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function put($url, array $data) + { + return $this->request( + 'PUT', + $url, + ['Content-Type' => 'application/json'], + json_encode($data) + ); + } + + /** + * Sends a HTTP POST request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function post($url, array $data = null) + { + return $this->request( + 'POST', + $url, + ['Content-Type' => 'application/json'], + $data !== null ? \json_encode($data) : null + ); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php new file mode 100644 index 00000000000..bab484fb28f --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php @@ -0,0 +1,139 @@ +get(self::$path . "/{$paymentReference}") + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Returns a collection of payouts. + * + * @param array $params Additional query params to filter payouts. + * + * @see https://developers.klarna.com/api/#settlements-api-get-all-payouts + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Payouts data + */ + public function getAllPayouts(array $params = []) + { + return $this->get(self::$path . '?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Returns a summary of payouts for each currency code in a date range. + * + * @param array $params Additional query params to filter summary data. + * + * @see https://developers.klarna.com/api/#settlements-api-get-summary-of-payouts + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array summary of payouts + */ + public function getSummary(array $params = []) + { + return $this->get(self::$path . '/summary?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php new file mode 100644 index 00000000000..f5f01f7f96d --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php @@ -0,0 +1,156 @@ +get(self::$path . "/payout-with-transactions?payment_reference={$paymentReference}") + ->expectSuccessfull() + ->status('200') + ->contentType('text/csv') + ->getBody(); + } + + /** + * Returns a single settlement summed up in pdf format. + * + * @param string $paymentReference The reference id of the payout. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return string Binary PDF representation of Payout report + */ + public function getPDFPayoutReport($paymentReference) + { + return $this->get(self::$path . "/payout?payment_reference={$paymentReference}") + ->expectSuccessfull() + ->status('200') + ->contentType('application/pdf') + ->getBody(); + } + + /** + * Returns CSV summary. + * + * @param array $params Additional query params to filter payouts. + * + * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return string CSV Summary report + */ + public function getCSVPayoutsSummaryReport(array $params = []) + { + return $this->get(self::$path . '/payouts-summary-with-transactions?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('text/csv') + ->getBody(); + } + + /** + * Returns PDF summary. + * + * @param array $params Additional query params to filter payouts. + * + * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return string PDF Summary report + */ + public function getPDFPayoutsSummaryReport(array $params = []) + { + return $this->get(self::$path . '/payouts-summary?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/pdf') + ->getBody(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php new file mode 100644 index 00000000000..6265d08d619 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php @@ -0,0 +1,84 @@ +get(self::$path . '?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php new file mode 100644 index 00000000000..22964cbb7c8 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php @@ -0,0 +1,148 @@ +setStatus($status); + $this->setBody($body); + $this->setHeaders($headers); + } + /** + * Sets HTTP Status code. + * + * @param status HTTP status + * @return self + */ + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + /** + * Gets HTTP Status code. + * + * @return Status code + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets binary body payload. + * + * @param body Payout + * @return self + */ + public function setBody($body) + { + $this->body = $body; + return $this; + } + + /** + * Gets binary body payload. + * + * @return Payout + */ + public function getBody() + { + return $this->body; + } + + /** + * Sets HTTP headers map + * + * @param headers Headers + * @return self + */ + public function setHeaders($headers) + { + $this->headers = $headers; + return $this; + } + + /** + * Sets single HTTP header value. + * + * @param name Header name + * @param values Header values + * @return self + */ + public function setHeader($name, $values) + { + $this->headers[$name] = $values; + return $this; + } + + /** + * Gets HTTP Headers map + * + * @return Headers + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Gets single header value + * + * @param name Header name + * @return Header values + */ + public function getHeader($name) + { + return isset($this->headers[$name]) ? $this->headers[$name] : null; + } + + /** + * Gets the Location header helper. + * + * @return string Location if exists, null otherwise + */ + public function getLocation() + { + return empty($this->headers['Location']) ? null : $this->headers['Location'][0]; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php new file mode 100644 index 00000000000..439a9b794f9 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php @@ -0,0 +1,303 @@ +merchantId = $merchantId; + $this->sharedSecret = $sharedSecret; + $this->baseUrl = rtrim($baseUrl, '/'); + + if ($userAgent === null) { + $userAgent = UserAgent::createDefault(['CURLConnector/' . curl_version()['version']]); + } + $this->userAgent = $userAgent; + } + + /** + * Sets CURL request options. + * + * @param options CURL options + * + * @return self instance + */ + public function setOptions($options) + { + $this->options = $options; + return $this; + } + + /** + * Sends HTTP GET request to specified path. + * + * @param string $path URL path. + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function get($path, $headers = []) + { + return $this->request(Method::GET, $path, $headers); + } + + /** + * Sends HTTP POST request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function post($path, $data = null, $headers = []) + { + return $this->request(Method::POST, $path, $headers, $data); + } + + /** + * Sends HTTP PUT request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function put($path, $data = null, $headers = []) + { + return $this->request(Method::PUT, $path, $headers, $data); + } + + /** + * Sends HTTP PATCH request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function patch($path, $data = null, $headers = []) + { + return $this->request(Method::PATCH, $path, $headers, $data); + } + + /** + * Sends HTTP DELETE request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function delete($path, $data = null, $headers = []) + { + return $this->request(Method::DELETE, $path, $headers, $data); + } + + /** + * Performs HTTP(S) request. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + protected function request($method, $url, array $headers = [], $data = null) + { + $headers = array_merge([ + 'User-Agent' => (string) $this->userAgent, + ], $headers); + + if (isset($this->options['headers'])) { + $headers = array_merge($headers, $this->options['headers']); + } + array_walk($headers, function (&$v, $k) { + $v = $k . ': ' . $v; + }); + + $ch = curl_init(); + + if (!empty($this->merchantId)) { + curl_setopt($ch, CURLOPT_USERPWD, $this->merchantId . ':' . $this->sharedSecret); + } + if (!empty($this->options['ssl_cert'])) { + curl_setopt($ch, CURLOPT_SSLCERT, $this->options['ssl_cert']); + if (!empty($this->options['ssl_key'])) { + curl_setopt($ch, CURLOPT_SSLKEY, $this->options['ssl_key']); + } + } + + if (!empty($this->options['timeout'])) { + curl_setopt($ch, CURLOPT_TIMEOUT, $this->options['timeout']); + } + + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + + if ($method == Method::GET) { + curl_setopt($ch, CURLOPT_HTTPGET, 1); + } elseif ($method == Method::POST) { + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + } else { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + } + + curl_setopt($ch, CURLOPT_URL, $this->baseUrl . $url); + curl_setopt($ch, CURLOPT_HEADER, 1); + + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + if ($proxy = getenv('HTTP_PROXY')) { + $proxy = parse_url($proxy); + + $proxyHost = $proxy['host']; + $proxyPort = $proxy['port'] ? ':' . $proxy['post'] : ''; + curl_setopt($ch, CURLOPT_PROXY, $proxyHost . $proxyPort); + if (!empty($proxy['user'])) { + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy['user'] . ':' . $proxy['pass']); + } + } + + $response = curl_exec($ch); + + $errno = curl_errno($ch); + $error = curl_error($ch); + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + + curl_close($ch); + + // Check the TCP transport issues + if (!empty($errno)) { + throw new \RuntimeException($error, $errno); + } + + $rawHeaders = substr($response, 0, $header_size); + $body = substr($response, $header_size); + $headers = self::parseHeaders($rawHeaders); + + return new ApiResponse($http_code, $body, $headers); + } + + /** + * Factory method to create a connector instance. + * + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param string $baseUrl Base URL for HTTP requests + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + * + * @return self + */ + public static function create( + $merchantId, + $sharedSecret, + $baseUrl = self::EU_BASE_URL, + UserAgentInterface $userAgent = null + ) { + return new static($merchantId, $sharedSecret, $baseUrl, $userAgent); + } + + + /** + * Converts raw curl headers response to array. + * + * @param string $rawHeaders Headers part from the curl response + * + * @return array list of HTTP headers + */ + protected static function parseHeaders($rawHeaders) + { + $headers = []; + foreach (explode("\r\n", $rawHeaders) as $i => $line) { + if (strlen($line) == 0) { + continue; + } + + if (strpos($line, 'HTTP/') !== false) { + // The line contains the HTTP response information + $headers['Http'] = $line; + continue; + } + list($key, $value) = explode(': ', $line); + $headers[ucwords($key, '-_')][] = $value; + } + return $headers; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php new file mode 100644 index 00000000000..602887d7f4f --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php @@ -0,0 +1,30 @@ +errorCode = $data['error_code']; + $this->messages = $data['error_messages']; + $this->correlationId = $data['correlation_id']; + $this->serviceVersion = $serviceVersion; + } + + /** + * Gets the API error code for this exception. + * + * @return string + */ + public function getErrorCode() + { + return $this->errorCode; + } + + /** + * Gets the API error messages for this exception. + * + * @return array + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Gets the API correlation ID for this exception. + * + * @return string + */ + public function getCorrelationId() + { + return $this->correlationId; + } + + /** + * Gets the API Service version for this exception. + * + * @return string + */ + public function getServiceVersion() + { + return $this->serviceVersion; + } + + /** + * @deprecated Function is not longer used. Will always return null + * Gets the HTTP response for this API error. + * + * @return null + */ + public function getResponse() + { + return null; + } + + private static function setDefaultData($data) + { + $defaults = [ + 'error_code' => 'UNDEFINED', + 'error_messages' => [], + 'correlation_id' => 'UNDEFINED', + ]; + + foreach ($defaults as $field => $default) { + if (!isset($data[$field])) { + $data[$field] = $default; + } + } + + // We need to have a special check for error_message and merge the message to error_messages + if (isset($data['error_message'])) { + array_push($data['error_messages'], $data['error_message']); + } + + return $data; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php new file mode 100644 index 00000000000..6c04adb3db0 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php @@ -0,0 +1,280 @@ + 'https://api.klarna.com']); + * $connector = new \Klarna\Transport\Connector($client, '0', 'sharedSecret'); + * + * + * @param ClientInterface $client HTTP transport client + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + */ + public function __construct( + ClientInterface $client, + $merchantId, + $sharedSecret, + UserAgentInterface $userAgent = null + ) { + $this->client = $client; + $this->merchantId = $merchantId; + $this->sharedSecret = $sharedSecret; + + if ($userAgent === null) { + $userAgent = UserAgent::createDefault(['Guzzle/' . ClientInterface::VERSION]); + } + $this->userAgent = $userAgent; + } + + /** + * Sends HTTP GET request to specified path. + * + * @param string $path URL path. + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function get($path, $headers = []) + { + $request = $this->createRequest($path, Method::GET, $headers); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP POST request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function post($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::POST, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP PUT request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function put($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::PUT, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP PATCH request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function patch($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::PATCH, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP DELETE request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function delete($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::DELETE, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Converts ResponseInterface to ApiResponse. + * + * @param response ResponseInterface intance + * @return ApiResponse + */ + protected function getApiResponse(ResponseInterface $response) + { + return new ApiResponse( + $response->getStatusCode(), + $response->getBody()->getContents(), + $response->getHeaders() + ); + } + + /** + * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. + * Creates a request object. + * + * @param string $url URL + * @param string $method HTTP method + * + * @return RequestInterface + */ + public function createRequest($url, $method = 'GET', array $headers = [], $body = null) + { + $headers = array_merge($headers, ['User-Agent' => strval($this->userAgent)]); + return new Request($method, $url, $headers, $body); + } + + /** + * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. + * Sends the request. + * + * @param RequestInterface $request Request to send + * @param string[] $options Request options + * + * @throws RequestException When an error is encountered + * @throws \RuntimeException When the adapter does not populate a response + * + * @return ResponseInterface + */ + public function send(RequestInterface $request, array $options = []) + { + $requestOptions = $this->client->getConfig('request'); + if (is_array($requestOptions)) { + $options = array_merge($requestOptions, $options); + } + $options['auth'] = [$this->merchantId, $this->sharedSecret, 'basic']; + $options['http_errors'] = false; + + try { + $response = $this->client->send($request, $options); + return $response; + } catch (RequestException $e) { + throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); + } catch (\Throwable $e) { + throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Gets the HTTP transport client. + * + * @return ClientInterface + */ + public function getClient() + { + return $this->client; + } + + /** + * Gets the user agent. + * + * @return UserAgentInterface + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Factory method to create a connector instance. + * + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param string $baseUrl Base URL for HTTP requests + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + * + * @return self + */ + public static function create( + $merchantId, + $sharedSecret, + $baseUrl = self::EU_BASE_URL, + UserAgentInterface $userAgent = null + ) { + $client = new Client(['base_uri' => $baseUrl]); + + return new static($client, $merchantId, $sharedSecret, $userAgent); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php new file mode 100644 index 00000000000..f2a068e7a71 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php @@ -0,0 +1,29 @@ +response = $response; + } + + /** + * Gets the response object. + * + * @return ApiResponse + */ + public function getResponse() + { + return $this->response; + } + + /** + * Asserts the HTTP response status code. + * + * @param string|string[] $status Expected status code(s) + * + * @throws \RuntimeException If status code does not match + * + * @return self + */ + public function status($status) + { + $httpStatus = (string) $this->response->getStatus(); + if (is_array($status) && !in_array($httpStatus, $status)) { + throw new \RuntimeException( + "Unexpected response status code: {$httpStatus}" + ); + } + + if (is_string($status) && $httpStatus !== $status) { + throw new \RuntimeException( + "Unexpected response status code: {$httpStatus}" + ); + } + + return $this; + } + + /** + * Asserts the Content-Type header. Checks partial matching. + * Validation PASSES in the following cases: + * Content-Type: application/json + * $mediaType = 'application/json' + * + * Content-Type: application/json; charset=utf-8 + * $mediaType = 'application/json' + * + * Validation FAILS in the following cases: + * Content-Type: plain/text + * $mediaType = 'application/json' + * + * Content-Type: application/json; charset=utf-8 + * $mediaType = 'application/json; charset=cp-1251' + * + * @param string $mediaType Expected media type. RegExp rules can be used. + * + * @throws \RuntimeException If Content-Type header is missing + * @throws \RuntimeException If Content-Type header does not match + * + * @return self + */ + public function contentType($mediaType) + { + $contentType = $this->response->getHeader('Content-Type'); + if (empty($contentType)) { + throw new \RuntimeException('Response is missing a Content-Type header'); + } + $mediaFound = false; + foreach ($contentType as $type) { + if (preg_match('#' . $mediaType . '#', $type)) { + $mediaFound = true; + break; + } + } + + if (!$mediaFound) { + throw new \RuntimeException( + 'Unexpected Content-Type header received: ' + . implode(',', $contentType) . '. Expected: ' . $mediaType + ); + } + + return $this; + } + + /** + * Gets the decoded JSON response. + * + * @throws \RuntimeException If the response body is not in JSON format + * @throws \InvalidArgumentException If the JSON cannot be parsed + * + * @return array + */ + public function getJson() + { + return \json_decode($this->response->getBody(), true); + } + + /** + * Gets response body. + * + * @throws \RuntimeException If the response body is not in JSON format + * @throws \InvalidArgumentException If the JSON cannot be parsed + * + * @return StreamInterface the body as a stream + */ + public function getBody() + { + return $this->response->getBody(); + } + + /** + * Gets the Location header. + * + * @throws \RuntimeException If the Location header is missing + * + * @return string + */ + public function getLocation() + { + $location = $this->response->getHeader('Location'); + if (empty($location)) { + throw new \RuntimeException('Response is missing a Location header'); + } + return $location[0]; + } + + + /** + * Asserts and analyze the response. Checks if the reponse has SUCCESSFULL family + * and try to parse the Klarna error message if possbile. + * + * @throws ConnectorException if response has non-2xx HTTP CODE and contains + * a Error + * @throws \RuntimeException if response has non-2xx HTTP CODE and body is not parsable + * + * @return void + */ + public function expectSuccessfull() + { + if ($this->isSuccessfull()) { + return $this; + } + + $data = json_decode($this->response->getBody(), true); + if (is_array($data) && array_key_exists('error_code', $data)) { + throw new ConnectorException($data, $this->response->getStatus()); + } + + throw new \RuntimeException( + 'Unexpected reponse HTTP status ' . $this->response->getStatus() . + '. Excepted HTTP status should be in 2xx range', + $this->response->getStatus() + ); + } + + public function isSuccessfull() + { + $status = $this->response->getStatus(); + return $status >= 200 && $status < 300; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php new file mode 100644 index 00000000000..a60f7fbd693 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php @@ -0,0 +1,120 @@ + $name + ]; + + if (!empty($version)) { + $field['version'] = $version; + } + + if (!empty($options)) { + $field['options'] = $options; + } + + $this->fields[$key] = $field; + + return $this; + } + + /** + * Serialises the user agent. + * + * @return string + */ + public function __toString() + { + $parts = []; + + foreach ($this->fields as $key => $value) { + $component = "{$key}/{$value['name']}"; + if (!empty($value['version'])) { + $component .= "_{$value['version']}"; + } + + $parts[] = $component; + + if (empty($value['options'])) { + continue; + } + + $opts = implode('; ', $value['options']); + $parts[] = "({$opts})"; + } + + return implode(' ', $parts); + } + + /** + * Creates the default user agent. + * + * @return self + */ + public static function createDefault($options = []) + { + $agent = new static(); + + if (extension_loaded('curl')) { + $options[] = 'curl/' . curl_version()['version']; + } + + return $agent + ->setField('Library', static::NAME, static::VERSION, $options) + ->setField('OS', php_uname('s'), php_uname('r')) + ->setField('Language', 'PHP', phpversion()); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php new file mode 100644 index 00000000000..a4ed6f76160 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php @@ -0,0 +1,117 @@ + Date: Fri, 4 Mar 2022 16:36:00 +0000 Subject: [PATCH 31/39] Support for PHP 8.0 and 8.1 --- composer.json | 3 +- composer.lock | 54 +++++++++++++++++- .../storage/vendor/composer/autoload_psr4.php | 1 + .../vendor/composer/autoload_static.php | 8 +++ .../storage/vendor/composer/installed.json | 55 +++++++++++++++++++ .../storage/vendor/composer/installed.php | 13 ++++- 6 files changed, 130 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ca157c4e5bb..cd2a1b31afb 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ "braintree/braintree_php": "^6.7", "cardinity/cardinity-sdk-php": "^3.0", "divido/divido-php": "^1.15", - "zoujingli/wechat-php-sdk": "^1.3" + "zoujingli/wechat-php-sdk": "^1.3", + "klarna/kco_rest": "^4.2" } } diff --git a/composer.lock b/composer.lock index adf7ef10412..89f029bbc6c 100644 --- a/composer.lock +++ b/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": "5f7477d996d7712fa2980dcd28c9d064", + "content-hash": "7fc9af796366d8ed1b0ccbb54c20f5fb", "packages": [ { "name": "braintree/braintree_php", @@ -464,6 +464,58 @@ ], "time": "2021-10-05T13:56:00+00:00" }, + { + "name": "klarna/kco_rest", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/klarna/kco_rest_php.git", + "reference": "6c092bdd155cc8d6564503beb703ea721958381a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/6c092bdd155cc8d6564503beb703ea721958381a", + "reference": "6c092bdd155cc8d6564503beb703ea721958381a", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6.0", + "php": ">=5.5.0" + }, + "require-dev": { + "apigen/apigen": "4.1.*", + "klarna/apigen-theme": "2.1.0", + "php-coveralls/php-coveralls": "^2.1", + "phploc/phploc": "2.0.*", + "phpmd/phpmd": "2.1.*", + "phpunit/phpunit": ">=4.0.0, <6.0", + "sebastian/phpcpd": "2.0.*", + "squizlabs/php_codesniffer": "1.5.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Klarna\\": "src/Klarna/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Klarna AB" + } + ], + "description": "Official Klarna REST PHP SDK", + "homepage": "http://developers.klarna.com", + "support": { + "issues": "https://github.com/klarna/kco_rest_php/issues", + "source": "https://github.com/klarna/kco_rest_php/tree/v4.x" + }, + "abandoned": true, + "time": "2020-02-14T09:31:35+00:00" + }, { "name": "psr/http-message", "version": "1.0.1", diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index e8e15603fe5..180da0745c2 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -21,6 +21,7 @@ 'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'), 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), + 'Klarna\\' => array($vendorDir . '/klarna/kco_rest/src/Klarna'), 'GuzzleHttp\\Subscriber\\Oauth\\' => array($vendorDir . '/guzzlehttp/oauth-subscriber/src'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index aaed2282f1f..ea600907b5d 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -54,6 +54,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 'Psr\\Http\\Message\\' => 17, ), + 'K' => + array ( + 'Klarna\\' => 7, + ), 'G' => array ( 'GuzzleHttp\\Subscriber\\Oauth\\' => 28, @@ -132,6 +136,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/psr/http-message/src', ), + 'Klarna\\' => + array ( + 0 => __DIR__ . '/..' . '/klarna/kco_rest/src/Klarna', + ), 'GuzzleHttp\\Subscriber\\Oauth\\' => array ( 0 => __DIR__ . '/..' . '/guzzlehttp/oauth-subscriber/src', diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 0a269f77bc2..20955814982 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -479,6 +479,61 @@ ], "install-path": "../guzzlehttp/psr7" }, + { + "name": "klarna/kco_rest", + "version": "v4.2.3", + "version_normalized": "4.2.3.0", + "source": { + "type": "git", + "url": "https://github.com/klarna/kco_rest_php.git", + "reference": "6c092bdd155cc8d6564503beb703ea721958381a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/6c092bdd155cc8d6564503beb703ea721958381a", + "reference": "6c092bdd155cc8d6564503beb703ea721958381a", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~6.0", + "php": ">=5.5.0" + }, + "require-dev": { + "apigen/apigen": "4.1.*", + "klarna/apigen-theme": "2.1.0", + "php-coveralls/php-coveralls": "^2.1", + "phploc/phploc": "2.0.*", + "phpmd/phpmd": "2.1.*", + "phpunit/phpunit": ">=4.0.0, <6.0", + "sebastian/phpcpd": "2.0.*", + "squizlabs/php_codesniffer": "1.5.*" + }, + "time": "2020-02-14T09:31:35+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Klarna\\": "src/Klarna/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Klarna AB" + } + ], + "description": "Official Klarna REST PHP SDK", + "homepage": "http://developers.klarna.com", + "support": { + "issues": "https://github.com/klarna/kco_rest_php/issues", + "source": "https://github.com/klarna/kco_rest_php/tree/v4.x" + }, + "abandoned": true, + "install-path": "../klarna/kco_rest" + }, { "name": "psr/http-message", "version": "1.0.1", diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 6356f318105..50b62676e63 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '5752a07a9627148655e9d80e4d5477ddce212916', + 'reference' => 'fa0a664dcc0192810452fc7651d72bfcebe6e554', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -73,13 +73,22 @@ 'reference' => '1afdd860a2566ed3c2b0b4a3de6e23434a79ec85', 'dev_requirement' => false, ), + 'klarna/kco_rest' => array( + 'pretty_version' => 'v4.2.3', + 'version' => '4.2.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../klarna/kco_rest', + 'aliases' => array(), + 'reference' => '6c092bdd155cc8d6564503beb703ea721958381a', + 'dev_requirement' => false, + ), 'opencart/opencart' => array( 'pretty_version' => 'dev-3.0.x.x_Maintenance', 'version' => 'dev-3.0.x.x_Maintenance', 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => '5752a07a9627148655e9d80e4d5477ddce212916', + 'reference' => 'fa0a664dcc0192810452fc7651d72bfcebe6e554', 'dev_requirement' => false, ), 'psr/http-message' => array( From d36edd20e4a6344d7a7210a2f57e4d34c6bf04cc Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 16:37:57 +0000 Subject: [PATCH 32/39] Support for PHP 8.0 and 8.1 --- .../vendor/klarna/kco_rest/.gitattributes | 9 - .../vendor/klarna/kco_rest/CHANGELOG.md | 223 ---------- .../storage/vendor/klarna/kco_rest/LICENSE | 201 --------- .../storage/vendor/klarna/kco_rest/README.md | 165 ------- .../vendor/klarna/kco_rest/composer.json | 55 --- .../examples/CheckoutAPI/create_checkout.php | 111 ----- .../create_checkout_attachment.php | 126 ------ .../docs/examples/CheckoutAPI/discounts.php | 103 ----- .../examples/CheckoutAPI/fetch_checkout.php | 62 --- .../CheckoutAPI/handling_exceptions.php | 64 --- .../examples/CheckoutAPI/update_checkout.php | 103 ----- .../examples/Common/change_user_agent.php | 113 ----- .../CustomerTokenAPI/Tokens/create_order.php | 106 ----- .../Tokens/read_token_details.php | 57 --- .../Tokens/update_token_status.php | 59 --- .../Sessions/create_new_hpp_session.php | 80 ---- .../Sessions/disable_session.php | 57 --- .../Sessions/distribute_link.php | 67 --- .../Sessions/get_hpp_session_status.php | 57 --- .../ButtonKeys/create_button_key.php | 111 ----- .../ButtonKeys/see_button_key_options.php | 57 --- .../ButtonKeys/update_button_key.php | 81 ---- .../Orders/approve_order.php | 122 ------ .../Orders/decline_order.php | 62 --- .../Orders/retrieve_order.php | 57 --- .../Captures/add_shipping_info.php | 72 ---- .../Captures/trigger_send_out.php | 60 --- .../Captures/update_customer_details.php | 65 --- .../Orders/acknowledge_order.php | 60 --- .../Orders/cancel_order.php | 59 --- .../Orders/create_capture.php | 87 ---- .../Orders/extend_authorization_time.php | 57 --- .../Orders/fetch_all_captures.php | 58 --- .../Orders/fetch_capture.php | 58 --- .../OrderManagementAPI/Orders/fetch_order.php | 57 --- .../release_remaining_authorization.php | 59 --- .../Orders/update_customer_details.php | 68 --- .../Orders/update_merchant_references.php | 63 --- .../Orders/update_order_lines.php | 75 ---- .../Refunds/fetch_refund.php | 58 --- .../Refunds/refund_order.php | 76 ---- .../Orders/cancel_existing_authorization.php | 57 --- .../PaymentsAPI/Orders/create_order.php | 106 ----- .../Orders/generate_customer_token.php | 82 ---- .../Sessions/create_new_credit_session.php | 96 ----- .../Sessions/read_credit_session.php | 57 --- .../Sessions/update_credit_session.php | 79 ---- .../Payouts/get_all_payouts.php | 61 --- .../SettlementsAPI/Payouts/get_payout.php | 57 --- .../SettlementsAPI/Payouts/get_summary.php | 61 --- .../Reports/payout_report_csv.php | 58 --- .../Reports/payout_report_pdf.php | 58 --- .../Reports/summary_report_cvs.php | 62 --- .../Reports/summary_report_pdf.php | 62 --- .../Transactions/get_transactions.php | 61 --- .../klarna/kco_rest/docs/http_transport.md | 79 ---- .../Exceptions/NotApplicableException.php | 27 -- .../src/Klarna/Rest/Checkout/Order.php | 116 ----- .../src/Klarna/Rest/CustomerToken/Tokens.php | 116 ----- .../Rest/HostedPaymentPage/Sessions.php | 145 ------- .../Rest/InstantShopping/ButtonKeys.php | 137 ------ .../Klarna/Rest/InstantShopping/Orders.php | 128 ------ .../MerchantCardService/VCCSettlements.php | 151 ------- .../Klarna/Rest/OrderManagement/Capture.php | 152 ------- .../src/Klarna/Rest/OrderManagement/Order.php | 407 ------------------ .../Klarna/Rest/OrderManagement/Refund.php | 89 ---- .../src/Klarna/Rest/Payments/Orders.php | 141 ------ .../src/Klarna/Rest/Payments/Sessions.php | 117 ----- .../kco_rest/src/Klarna/Rest/Resource.php | 332 -------------- .../src/Klarna/Rest/Settlements/Payouts.php | 139 ------ .../src/Klarna/Rest/Settlements/Reports.php | 156 ------- .../Klarna/Rest/Settlements/Transactions.php | 84 ---- .../src/Klarna/Rest/Transport/ApiResponse.php | 148 ------- .../Klarna/Rest/Transport/CURLConnector.php | 303 ------------- .../src/Klarna/Rest/Transport/Connector.php | 30 -- .../Rest/Transport/ConnectorInterface.php | 124 ------ .../Exception/ConnectorException.php | 144 ------- .../Klarna/Rest/Transport/GuzzleConnector.php | 280 ------------ .../src/Klarna/Rest/Transport/Method.php | 29 -- .../Rest/Transport/ResponseValidator.php | 207 --------- .../src/Klarna/Rest/Transport/UserAgent.php | 120 ------ .../Rest/Transport/UserAgentInterface.php | 117 ----- .../vendor/klarna/kco_rest/src/autoload.php | 30 -- 83 files changed, 8345 deletions(-) delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/.gitattributes delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/LICENSE delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/README.md delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/composer.json delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Checkout/Order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ResponseValidator.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/autoload.php diff --git a/upload/system/storage/vendor/klarna/kco_rest/.gitattributes b/upload/system/storage/vendor/klarna/kco_rest/.gitattributes deleted file mode 100644 index 2013edf972a..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ -.github export-ignore -git_hooks export-ignore -tests export-ignore -.coveralls.yml export-ignore -.editorconfig export-ignore -.gitignore export-ignore -.travis.yml export-ignore -phpmd.xml export-ignore -phpunit.xml.dist export-ignore diff --git a/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md b/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md deleted file mode 100644 index afca0b76e3c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md +++ /dev/null @@ -1,223 +0,0 @@ - - -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -## [4.2.3] - 2020-02-14 - -### Added - -- HTTP Transport: Oceania Base URLs (playground and production) - - -## [4.2.2] - 2019-11-05 - -### Changed - -- Remove "src" folder from a PSR4 autoload definition as fallback directory. - - -## [4.2.1] - 2019-10-15 - -### Added - -- Test against php 7.3 - -### Fixed - -- CURL Transport: Add processing of multiple HTTP headers in response.[Caught exception: Response is missing a Content-Type header #44](https://github.com/klarna/kco_rest_php/issues/44); -- Fix exception namespace and PHPDoc -- Stores the KEY ID field in order to restore the ID after fetching data without the KEY field. [Payments Session ID is reset after fetch() #37](https://github.com/klarna/kco_rest_php/issues/37) - -## [4.2.0] - 2019-06-11 - -This release has a number of **[no-backward-compatibility]** flags. But these incompatible changes related -only to the "under the hood" files. It means, if you operate only with high-level instances, like -`Connector` and `Rest\`/`Checkout/Payments/OrderManagement/etc` resources (you have the code, -like in the example files) - you are safe for upgrade. - -If you have your own implementation of REST API Services, HTTP Transport or Base Resource instance, -you need to check the code before go live. - -### Added - -- Add new HTTP Transport `CURLTransport`. This transport does not require any package dependencies -- Add PHP SDK SPL Autoloader -- Add `ApiResponse` class to unify an HTTP Transport reponse - -### Changed - -- Decouple the HTTP Transport Connector interface. Remove Guzzle hardcoded dependency **[no-backward-compatibility]** -- Decouple `ConnectorException`. Remove Guzzle hardcoded dependency **[partial-backward-compatibility]** - - Change the constructor signature. Replace `RequestException` exception with `int $code` - - `getResponse` method is not longer return Guzzle `ResponseInterface`. - This method marked as deprecated and return `null` -- Rename `Klarna/Rest/Transport/Connector.php` to `Klarna/Rest/Transport/GuzzleConnector.php` to - make the name explicit. **[backward-compatible]** - The `Klarna/Rest/Transport/Connector.php` still exists, but marked as deprecated -- Change the structure and return values for all the methods in `GuzzleConnector` (ex `Connector`) - to follow the new Connector interface. **[no-backward-compatibility]** -- Exception throwing behavior: **[partial-backward-compatibility]** - - `GuzzleConnector` (ex `Connector`) no longer throws Guzzle related `RuntimeException` exceptions. - The Connector throws only `RuntimeException` - - The only two types of exceptions can be thrown by SDK now: - - `RuntimeException` - - `ConnectorException` -- Extend `ResponseValidator` with `expectSuccessfull` and `isSuccessfull` methods. The methods allows - to validate the reponse code and parse the Klarna Error Message if possible - -## [4.1.5] - 2019-05-21 - -### Added - -- Add `.gitattributes` file to remove needless load from composer imports -- Examples: Add "How to set a discount" example. - -### Changed - -- Remove unused phpunit/phpcov package; -- Examples: Checkout API: Add more callback URLs; - -### Fixed - -- Debug mode: Request body and headers were not displayed when getting 400 HTTP response code. -- Examples: Checkout API: Fix typo in the attachments file; - -## [4.1.4] - 2019-03-15 - -### Added - -- Add full support of Instant Shopping API -- Repo now has an Apache 2.0 LICENSE file on its root -- HTTP Transport: Add support of PUT method -- Examples: Add Instant Shopping examples. - -### Fixed - -- HTTP Transport: Stop throwing an exception when an API service return a bad structured Error; - -## [4.1.3] - 2019-01-23 - -### Added - -- HPP API: Add support for disabling an HPP session; -- Customer Token API: Add ability to use Klarna-Idempotency-Key when creating order -- Customer Token API: Add new feature: Update token status; -- Examples: Add example of changing the User-Agent. - -## [4.1.2] - 2018-11-22 - -### Fixed - -- Order management API threw Error Notice when fetching an order with refunds. - -## [4.1.1] - 2018-10-31 - -### Added - -- Add support of Merchant Card Service API - -### Changed - -- HPP: HPP service changed API completely without backward compatibility. Adopt SDK to the new changes. - Mark `getSessionStatus` as `@deprecated`. Replaced by fetch function. - Return data was changed by HPP API service. - **[partial-backward-compatibility]** - -## [4.0.0] - 2018-08-27 (Major release) - -### Added - -- `OrderManagement`: - - Add ability to fetch Captures; - - Add support of Refunds **[partial-backward-compatibility]**; -- Add full support of Customer Token API; -- Add full support of Settlements API; -- Add full support of Payments API; -- Add full support of Hosted Payment Page API; -- Add 'Debug Mode' to be able to debug requests and responses; -- Put SDK References documentation to GH Pages: [https://klarna.github.io/kco_rest_php/](https://klarna.github.io/kco_rest_php/) -- More Examples for all Klarna Services. - -### Changed - -- OrderManagementAPI: Changed `refund` function. Before returned `$this`, now returns - `Refund` object; -- OrderManagementAPI: Order object now has an `array` of `Refund` objects instead of just array of data. - **[backward-compatible]** - -### Fixed - -- Fix: Settlements API [Unexpected Header #15](https://github.com/klarna/kco_rest_php/issues/15); - -## [3.0.1] - 2017-01-16 - -### Fixed - -- smaller fixes - -## [3.0.0] - 2017-12-12 - -### Changed - -- support for guzzle >6.0 - -## [2.2.0] - 2015-12-7 - -### Added - -- **NEW META-13** Allow for 201 response on refund - *Joakim.L* - -## [2.1.0] - 2015-07-29 - -### Changed - -- **NEW MINT-2262** Support Guzzle 5.x versions - *Omer.K, Joakim.L* - -## [2.0.0] - 2015-06-10 - -### Added - -- **NEW MINT-2214** Add base URLs for North America - *Joakim.L* - -### Fixed - -- **NEW MINT-2203** Use order id instead of URL for checkout orders - *Joakim.L* - -## [1.0.1] - 2015-03-30 - -### Added - -- **NEW MINT-2097** Add apigen and custom styling - *Petros.G* - -### Fixed - -- **FIX MINT-2002** Handle errors with an empty payload - *David.K* - -## 1.0.0 - 2014-10-16 - -### Added - -- **NEW MINT-1804** Support checkout v3 and ordermanagement v1 APIs - *Joakim.L* - -[Unreleased]: https://github.com/klarna/kco_rest_php/compare/v4.2.3...HEAD -[4.2.3]: https://github.com/klarna/kco_rest_php/compare/v4.2.2...v4.2.3 -[4.2.2]: https://github.com/klarna/kco_rest_php/compare/v4.2.1...v4.2.2 -[4.2.1]: https://github.com/klarna/kco_rest_php/compare/v4.2.0...v4.2.1 -[4.2.0]: https://github.com/klarna/kco_rest_php/compare/v4.1.5...v4.2.0 -[4.1.5]: https://github.com/klarna/kco_rest_php/compare/v4.1.4...v4.1.5 -[4.1.4]: https://github.com/klarna/kco_rest_php/compare/v4.1.3...v4.1.4 -[4.1.3]: https://github.com/klarna/kco_rest_php/compare/v4.1.2...v4.1.3 -[4.1.2]: https://github.com/klarna/kco_rest_php/compare/v4.1.1...v4.1.2 -[4.1.1]: https://github.com/klarna/kco_rest_php/compare/v4.0.0...v4.1.2 -[4.0.0]: https://github.com/klarna/kco_rest_php/compare/v3.0.1...v4.0.0 -[3.0.1]: https://github.com/klarna/kco_rest_php/compare/v3.0.0...v3.0.1 -[3.0.0]: https://github.com/klarna/kco_rest_php/compare/v2.1.0...v3.0.0 -[2.1.0]: https://github.com/klarna/kco_rest_php/compare/v2.0.0...v2.1.0 -[2.0.0]: https://github.com/klarna/kco_rest_php/compare/v1.0.1...v2.0.0 -[1.0.1]: https://github.com/klarna/kco_rest_php/compare/v1.0.0...v1.0.1 diff --git a/upload/system/storage/vendor/klarna/kco_rest/LICENSE b/upload/system/storage/vendor/klarna/kco_rest/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/upload/system/storage/vendor/klarna/kco_rest/README.md b/upload/system/storage/vendor/klarna/kco_rest/README.md deleted file mode 100644 index 3f956572694..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/README.md +++ /dev/null @@ -1,165 +0,0 @@ -# Official Klarna REST PHP SDK -[![Packagist Version][packagist-image]](https://packagist.org/packages/klarna/kco_rest) -[![Build Status][travis-image]](https://travis-ci.org/klarna/kco_rest_php) -[![Coverage Status][coveralls-image]](https://coveralls.io/r/klarna/kco_rest_php?branch=v4.x) - -## Shop now. Pay later. - -Shop at your favorite stores today and experience the freedom to pay later with Klarna. - - -## Getting started - -SDK covers all of Klarna API: https://developers.klarna.com/api/ - -### Prerequisites -* PHP 5.5 or above -* [API credentials](#api-credentials) -* [Composer](https://getcomposer.org/) (optional) - - -### API Credentials - -Before getting a production account you can get a playground one. -Register here to be able to test your SDK integration before go live: - -- https://playground.eu.portal.klarna.com/developer-sign-up - for EU countries -- https://playground.us.portal.klarna.com/developer-sign-up - for the US - - -## PHP SDK Installation and Usage - -### Install via Composer - -To install the PHP SDK from the Central Composer repository use composer: - -```shell -composer require klarna/kco_rest -``` - -Highly recommended to use version tag when installing SDK. - -```shell -composer require klarna/kco_rest:1.2.3.4 -``` - -Detailed information about the PHP SDK package and a list of available versions can be found here: -https://packagist.org/packages/klarna/kco_rest - -Include the SDK into your PHP file using the Composer autoloader: - -```php - -``` - -or - -```shell -$ export DEBUG_SDK=1 -$ php -``` - -Another way to enable Debugging Mode is `define` the **DEBUG_SDK** inside your script: - -```php ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - GET : https://api.playground.klarna.com/customer-token/v1/tokens/TOKEN -Headers : {"User-Agent":["Library\/Klarna.kco_rest_php_3.1.0 (Guzzle\/6.3.3; curl\/7.54.0) OS\/Darwin_17.5.0 Language\/PHP_5.6.37"]} - Body : - -DEBUG MODE: Response -<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -Headers : {"Content-Type":["application\/json"],"Date":["Wed, 15 Aug 2018 15:55:53 GMT"],"Klarna-Correlation-Id":["ABC-123"],"Server":["openresty"],"Content-Length":["62"],"Connection":["keep-alive"]} - Body : { - "status" : "ACTIVE", - "payment_method_type" : "INVOICE" - } -``` - - -## Questions and feedback -If you have any questions concerning this product or the implementation, -please create an issue: https://github.com/klarna/kco_rest_php/issues/new/choose - -Use an official Klarna Contact us form (https://klarna.com) if you have a question about the integration. - - -## How to contribute -At Klarna, we strive toward achieving the highest possible quality for our -products. Therefore, we require you to follow these guidelines if you wish -to contribute. - -To contribute, the following criteria needs to be fulfilled: - -* Description regarding what has been changed and why -* Pull requests should implement a boxed change -* All code and documentation must follow the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) -* New features and bug fixes must have accompanying unit tests: - * Positive tests - * Negative tests - * Boundary tests (if possible) - * No less than 90% decision coverage -* All tests should pass - - -## License -Klarna Checkout REST PHP SDK is licensed under -[Apache License, Version 2.0](http://www.apache.org/LICENSE-2.0) - -[packagist-image]: https://img.shields.io/packagist/v/klarna/kco_rest.svg?style=flat -[travis-image]: https://img.shields.io/travis/klarna/kco_rest_php/v4.x.svg?style=flat -[coveralls-image]: https://img.shields.io/coveralls/klarna/kco_rest_php/v4.x.svg?style=flat diff --git a/upload/system/storage/vendor/klarna/kco_rest/composer.json b/upload/system/storage/vendor/klarna/kco_rest/composer.json deleted file mode 100644 index 17e62fa1f95..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/composer.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "klarna/kco_rest", - "description": "Official Klarna REST PHP SDK", - "homepage": "http://developers.klarna.com", - "license": "Apache-2.0", - "type": "library", - "authors": [ - { - "name": "Klarna AB" - } - ], - "autoload": { - "psr-4": { - "Klarna\\": "src/Klarna/" - } - }, - "autoload-dev": { - "psr-4": { - "Klarna\\Rest\\Tests\\": "tests/" - } - }, - "minimum-stability": "stable", - "require": { - "php": ">=5.5.0", - "guzzlehttp/guzzle": "~6.0" - }, - "require-dev": { - "phpunit/phpunit": ">=4.0.0, <6.0", - "squizlabs/php_codesniffer": "1.5.*", - "phpmd/phpmd": "2.1.*", - "phploc/phploc": "2.0.*", - "sebastian/phpcpd": "2.0.*", - "php-coveralls/php-coveralls": "^2.1", - "apigen/apigen": "4.1.*", - "klarna/apigen-theme": "2.1.0" - }, - "scripts": { - "test": "vendor/bin/phpunit --colors", - "reference": "vendor/bin/apigen generate -s src -d docs/reference --template-config='vendor/klarna/apigen-theme/src/config.neon'", - "checkstyle": "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --extensions=php src/ tests/", - "check": [ - "@test", - "@checkstyle" - ], - "analyze": [ - "mkdir -p build/logs", - "vendor/bin/phploc --log-csv build/logs/phploc.csv src/ tests/", - "mkdir -p build/pdepend", - "vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg src/", - "vendor/bin/phpmd src/,tests/ xml phpmd.xml --reportfile build/logs/pmd.xml || true", - "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --report-file=build/logs/checkstyle.xml --extensions=php src/ tests/", - "vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml src/ tests/ || true" - ] - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php deleted file mode 100644 index 2f796c37027..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php +++ /dev/null @@ -1,111 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://www.example.com/terms.html", - "cancellation_terms" => "https://www.example.com/terms/cancellation.html", - "checkout" => "https://www.example.com/checkout.html", - "confirmation" => "https://www.example.com/confirmation.html", - - // Callbacks - "push" => "https://www.example.com/api/push", - "validation" => "https://www.example.com/api/validation", - "shipping_option_update" => "https://www.example.com/api/shipment", - "address_update" => "https://www.example.com/api/address", - "notification" => "https://www.example.com/api/pending", - "country_change" => "https://www.example.com/api/country" - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - // Store checkout order id - $orderId = $checkout->getId(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php deleted file mode 100644 index 0c991ca9252..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php +++ /dev/null @@ -1,126 +0,0 @@ - [ - [ - "unique_account_identifier" => "Test Testperson", - "payment_option" => "card", - "number_paid_purchases" => 1, - "total_amount_paid_purchases" => 10000, - "date_of_last_paid_purchase" => (new DateTime())->format(DATE_FORMAT), - "date_of_first_paid_purchase" => (new DateTime())->format(DATE_FORMAT) - ] - ] -]; - -$order = [ - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://www.example.com/terms.html", - "cancellation_terms" => "https://www.example.com/terms/cancellation.html", - "checkout" => "https://www.example.com/checkout.html", - "confirmation" => "https://www.example.com/confirmation.html", - - // Callbacks - "push" => "https://www.example.com/api/push", - "validation" => "https://www.example.com/api/validation", - "shipping_option_update" => "https://www.example.com/api/shipment", - "address_update" => "https://www.example.com/api/address", - "notification" => "https://www.example.com/api/pending", - "country_change" => "https://www.example.com/api/country" - ], - "attachment" => [ - "content_type" => "application/vnd.klarna.internal.emd-v2+json", - "body" => json_encode($emd) - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - // Store checkout order id - $orderId = $checkout->getId(); - - // Get some data if needed - print_r($checkout['attachment']); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php deleted file mode 100644 index 6703a1cc706..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php +++ /dev/null @@ -1,103 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 9000, - "order_tax_amount" => 818, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "19-402-USA", - "name" => "Red T-Shirt", - "quantity" => 1, - "quantity_unit" => "pcs", - "unit_price" => 10000, - "tax_rate" => 1000, - "total_amount" => 10000, - "total_tax_amount" => 909 - ], - - // Add discount as an order line - [ - "type" => "discount", - "reference" => "10-gbp-order-discount", - "name" => "Discount", - "quantity" => 1, - "unit_price" => -1000, - "tax_rate" => 1000, - "total_amount" => -1000, - "total_tax_amount" => -91 - ] - ], - "merchant_urls" => [ - "terms" => "https://www.example.com/terms.html", - "cancellation_terms" => "https://www.example.com/terms/cancellation.html", - "checkout" => "https://www.example.com/checkout.html", - "confirmation" => "https://www.example.com/confirmation.html", - - // Callbacks - "push" => "https://www.example.com/api/push", - "validation" => "https://www.example.com/api/validation", - "shipping_option_update" => "https://www.example.com/api/shipment", - "address_update" => "https://www.example.com/api/address", - "notification" => "https://www.example.com/api/pending", - "country_change" => "https://www.example.com/api/country" - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - echo $checkout['html_snippet']; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php deleted file mode 100644 index 270aca35559..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php +++ /dev/null @@ -1,62 +0,0 @@ -fetch(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php deleted file mode 100644 index ef6652330f3..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php +++ /dev/null @@ -1,64 +0,0 @@ -create([ - 'wrong order data' - ]); -} catch (ConnectorException $e) { - echo 'Message: ' . $e->getMessage() . "\n"; - echo 'Code: ' . $e->getCode() . "\n"; - echo 'ErrorCode: ' . $e->getErrorCode() . "\n"; - echo 'CorrelationID: ' . $e->getCorrelationId() . "\n"; - echo 'ServiceVersion: ' . $e->getServiceVersion() . "\n"; -} catch (Exception $e) { - echo 'Unhandled exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php deleted file mode 100644 index 11e0463805a..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php +++ /dev/null @@ -1,103 +0,0 @@ - 11000, - "order_tax_amount" => 2200, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ], - [ - "type" => "shipping_fee", - "name" => "Express delivery", - "quantity" => 1, - "unit_price" => 1000, - "tax_rate" => 2500, - "total_amount" => 1000, - "total_tax_amount" => 200 - ] - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector, $orderId); - $checkout->update($updatedOrder); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php deleted file mode 100644 index 26e705493cb..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php +++ /dev/null @@ -1,113 +0,0 @@ -setField('Platform', 'MyCustomShop', '1.2.3.4.5', ['seoAddon', 'promo']); -$customUserAgent->setField('PHP', 'Version', '5.4'); -$customUserAgent->setField('Hello', 'World'); - -// Headers: "User-Agent": ["Platform/MyCustomShop_1.2.3.4.5 (seoAddon; promo) PHP/Version_5.4 Hello/World"] - -$connector = Klarna\Rest\Transport\GuzzleConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint, - $customUserAgent -); - -$order = [ - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://example.com/toc", - "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", - "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", - "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - // Store checkout order id - $orderId = $checkout->getId(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php deleted file mode 100644 index 5a75a47ef0b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php +++ /dev/null @@ -1,106 +0,0 @@ - "John", - "family_name" => "Doe", - "email" => "johndoe@example.com", - "title" => "Mr", - "street_address" => "13 New Burlington St", - "street_address2" => "Apt 214", - "postal_code" => "W13 3BG", - "city" => "London", - "region" => "", - "phone" => "01895808221", - "country" => "GB" -]; - -$data = [ - "billing_address" => $address, - "shipping_address" => $address, - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $token = new Klarna\Rest\CustomerToken\Tokens($connector, $customerToken); - $order = $token->createOrder($data); - - print_r($order); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php deleted file mode 100644 index 7010a13b41c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php +++ /dev/null @@ -1,57 +0,0 @@ -fetch(); - - print_r($token->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php deleted file mode 100644 index f1419c9a5bd..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php +++ /dev/null @@ -1,59 +0,0 @@ -updateTokenStatus([ - 'status' => 'CANCELLED' - ]); - - echo 'Token patch request has been accepted and is being processed.'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php deleted file mode 100644 index 7850a0d978a..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php +++ /dev/null @@ -1,80 +0,0 @@ - [ - "cancel" => "https://example.com/cancel", - "failure" => "https://example.com/fail", - "privacy_policy" => "https://example.com/privacy_policy", - "success" => "https://example.com/success?token={{authorization_token}}", - "terms" => "https://example.com/terms" - ], - "options" => [ - "background_images" => [ - [ - "url" => "https://example.com/bgimage.jpg", - "width" => 1200 - ] - ], - "logo_url" => "https://example.com/logo.jpg", - "page_title" => "Complete your purchase", - "payment_method_category" => "pay_later", - "purchase_type" => "buy" - ], - "payment_session_url" => "https://api.klarna.com/payments/v1/sessions/$sessionId" -]; - -try { - $hpp = new Klarna\Rest\HostedPaymentPage\Sessions($connector); - $sessionData = $hpp->create($session); - - print_r($sessionData); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php deleted file mode 100644 index 111a6d76918..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php +++ /dev/null @@ -1,57 +0,0 @@ -disable(); - - echo 'The session has been disabled'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php deleted file mode 100644 index 89925f946a3..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php +++ /dev/null @@ -1,67 +0,0 @@ - [ - "email" => "test@example.com", - "phone" => "07000212345", - "phone_country" => "SE" - ], - "method" => "sms", - "template" => "INSTORE_PURCHASE" - ]; - - $session = new Klarna\Rest\HostedPaymentPage\Sessions($connector, $sessionId); - $session->distributeLink($data); - - echo 'The session link has been distributed'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php deleted file mode 100644 index 9d6f731b7fe..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php +++ /dev/null @@ -1,57 +0,0 @@ -getSessionStatus(); - - print_r($status); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php deleted file mode 100644 index 76218fa0e42..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php +++ /dev/null @@ -1,111 +0,0 @@ - 'John Doe', - 'merchant_urls' => [ - 'place_order' => 'https://example.com/place-callback', - 'push' => 'https://example.com/push-callback', - 'confirmation' => 'https://example.com/confirmation-callback', - 'terms' => 'https://example.com/terms-callback', - 'notification' => 'https://example.com/notification-callback', - 'update' => 'https://example.com/update-callback', - ], - 'purchase_currency' => 'EUR', - 'purchase_country' => 'DE', - 'billing_countries' => ["UK", "DE", "SE"], - 'shipping_countries' => ["UK", "DE", "SE"], - 'locale' => 'en-US', - 'order_amount' => 50000, - 'order_tax_amount' => 0, - 'order_lines' => [ - [ - 'name' => 'Red T-Shirt', - 'type' => 'physical', - 'reference' => '19-402-USA', - 'quantity' => 5, - 'quantity_unit' => 'pcs', - 'tax_rate' => 0, - 'total_amount' => 50000, - 'total_discount_amount' => 0, - 'total_tax_amount' => 0, - 'unit_price' => 10000, - 'product_url' => 'https://www.estore.com/products/f2a8d7e34', - 'image_url' => 'https://www.exampleobjects.com/logo.png', - 'product_identifiers' => - [ - 'category_path' => 'Electronics Store > Computers & Tablets > Desktops', - 'global_trade_item_number' => '735858293167', - 'manufacturer_part_number' => 'BOXNUC5CPYH', - 'brand' => 'Intel', - ], - ], - ], - 'shipping_options' => [ - [ - 'id' => 'my-shipping-id', - 'name' => 'Pickup Store', - 'description' => 'My custom description', - 'promo' => 'string', - 'price' => 10, - 'tax_amount' => 0, - 'tax_rate' => 0, - 'preselected' => true, - 'shipping_method' => 'PICKUPSTORE', - ], - ], - ]; - $button = $buttonsApi->create($data); - - echo 'Button has been successfully created' . PHP_EOL; - print_r($button); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php deleted file mode 100644 index 565d2c4b7c9..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php +++ /dev/null @@ -1,57 +0,0 @@ -retrieve(); - - print_r($button->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php deleted file mode 100644 index 6318c44bd73..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php +++ /dev/null @@ -1,81 +0,0 @@ - 'New name', - 'merchant_urls' => [ - 'place_order' => 'https://example.com/place-callback', - 'push' => 'https://example.com/push-callback', - 'confirmation' => 'https://example.com/confirmation-callback', - 'terms' => 'https://example.com/terms-callback', - 'notification' => 'https://example.com/notification-callback', - 'update' => 'https://example.com/update-callback', - ], - 'shipping_options' => [ - [ - 'id' => 'my-new-shipping-id', - 'name' => 'Priority delivery', - 'description' => '', - 'price' => 300, - 'tax_amount' => 0, - 'tax_rate' => 0, - 'preselected' => false, - 'shipping_method' => 'PRIME_DELIVERY', - ], - ], - ]; - $button = $buttonsApi->update($data); - - echo 'Button has been successfully updated' . PHP_EOL; - print_r($button); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php deleted file mode 100644 index 494f40609f2..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php +++ /dev/null @@ -1,122 +0,0 @@ - https://github.com/klarna/kco_rest_php/#api-credentials - * - * Make sure that your credentials belong to the right endpoint. If you have credentials for the US Playground, - * such credentials will not work for the EU Playground and you will get 401 Unauthorized exception. - */ -$merchantId = getenv('USERNAME') ?: 'K123456_abcd12345'; -$sharedSecret = getenv('PASSWORD') ?: 'sharedSecret'; -$authToken = getenv('AUTH_TOKEN') ?: 'authorization_token'; - -/* -EU_BASE_URL = 'https://api.klarna.com' -EU_TEST_BASE_URL = 'https://api.playground.klarna.com' -NA_BASE_URL = 'https://api-na.klarna.com' -NA_TEST_BASE_URL = 'https://api-na.playground.klarna.com' -OC_BASE_URL = 'https://api-oc.klarna.com' -OC_TEST_BASE_URL = 'https://api-oc.playground.klarna.com' -*/ -$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; - -$connector = Klarna\Rest\Transport\GuzzleConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint -); - -$order = [ - "order_id" => "f3392f8b-6116-4073-ab96-e330819e2c07", - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "billing_address" => [ - "given_name" => "Jane", - "family_name"=> "Doe", - "email"=> "jane-doe@example.com", - "title"=> "Ms", - "street_address"=> "Lombard St 10", - "street_address2"=> "Apt 214", - "postal_code"=> "90210", - "city"=> "Beverly Hills", - "region"=> "CA", - "phone"=> "333444555", - "country"=> "US" - ], - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://example.com/toc", - "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", - "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", - "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" - ], - "customer" => [ - "date_of_birth" => "1995-10-20", - "title" => "Mr", - "gender" => "male", - "last_four_ssn" => "0512", - "national_identification_number" => "3108971100", - "type" => "person", - "vat_id" => "string", - "organization_registration_id" => "556737-0431", - "organization_entity_type" => "LIMITED_COMPANY" - ] -]; - -try { - $orderApi = new Klarna\Rest\InstantShopping\Orders($connector, $authToken); - $status = $orderApi->approve($order); - - echo 'The order has been approved' . PHP_EOL; - print_r($status); -} catch (Exception $e) { - echo 'Caught exception => ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php deleted file mode 100644 index 3a1ee128525..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php +++ /dev/null @@ -1,62 +0,0 @@ - "https://example.com/rejected.html", - "deny_code" => "other", - "deny_message" => "You are not permitted to purchase this product", - ]; - $orderApi->decline($data); - echo 'The order has been declined'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php deleted file mode 100644 index a9570c577cf..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php +++ /dev/null @@ -1,57 +0,0 @@ -retrieve(); - - print_r($order->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php deleted file mode 100644 index 5c268b449dc..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php +++ /dev/null @@ -1,72 +0,0 @@ -fetchCapture($captureId); - $capture->addShippingInfo([ - "shipping_info" => [ - [ - "shipping_company" => "DHL", - "shipping_method" => "Home", - "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", - "tracking_number" => "1234567890", - "return_tracking_number" => "E-55-KL", - "return_shipping_company" => "DHL", - "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" - ] - ] - ]); - - echo 'Shipping info has been appended'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php deleted file mode 100644 index 6052df03c3b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php +++ /dev/null @@ -1,60 +0,0 @@ -fetchCapture($captureId); - $capture->triggerSendout(); - - echo 'Triggered a new send out of customer payment communication'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php deleted file mode 100644 index db7151a2352..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php +++ /dev/null @@ -1,65 +0,0 @@ -fetchCapture($captureId); - $capture->updateCustomerDetails([ - "billing_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ] - ]); - - echo 'Billing address of the customer has been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php deleted file mode 100644 index 9cf3ebbbfaa..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php +++ /dev/null @@ -1,60 +0,0 @@ -acknowledge(); - - echo 'Order has been acknowledged'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php deleted file mode 100644 index 2a04a1431ea..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php +++ /dev/null @@ -1,59 +0,0 @@ -cancel(); - - echo 'Order has been cancelled'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php deleted file mode 100644 index d5721c1569e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php +++ /dev/null @@ -1,87 +0,0 @@ -createCapture([ - "captured_amount" => 6000, - "description" => "Shipped part of the order", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ] - ], - "shipping_info" => [ - [ - "shipping_company" => "DHL", - "shipping_method" => "Home", - "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", - "tracking_number" => "1234567890", - "return_tracking_number" => "E-55-KL", - "return_shipping_company" => "DHL", - "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" - ] - ] - ]); - - echo 'Capture has been created'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php deleted file mode 100644 index 6e164fa7600..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php +++ /dev/null @@ -1,57 +0,0 @@ -extendAuthorizationTime(); - - echo 'The expiry time of an order has been extend'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php deleted file mode 100644 index 7ae89e83f83..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php +++ /dev/null @@ -1,58 +0,0 @@ -fetchCaptures(); - foreach ($captures as $capture) { - print_r($capture->getArrayCopy()); - } -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php deleted file mode 100644 index 50ee23ead75..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php +++ /dev/null @@ -1,58 +0,0 @@ -fetchCapture($captureId); - - print_r($capture->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php deleted file mode 100644 index b611ad5a272..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php +++ /dev/null @@ -1,57 +0,0 @@ -fetch(); - - print_r($order->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php deleted file mode 100644 index 5b1cca93153..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php +++ /dev/null @@ -1,59 +0,0 @@ -releaseRemainingAuthorization(); - - echo 'Remaining authorised amount has been released'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php deleted file mode 100644 index 87f77cafd42..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php +++ /dev/null @@ -1,68 +0,0 @@ -updateCustomerDetails([ - "billing_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ], - "shipping_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ] - ]); - - echo 'Customer details have been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php deleted file mode 100644 index b50574487f1..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php +++ /dev/null @@ -1,63 +0,0 @@ -updateMerchantReferences([ - "merchant_reference1" => "15632423", - "merchant_reference2" => "special order" - ]); - - echo 'Merchant references have been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php deleted file mode 100644 index 561ac15d817..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php +++ /dev/null @@ -1,75 +0,0 @@ -updateAuthorization([ - "order_amount" => 6000, - "description" => "Removed bad bananas", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ] - ] - ]); - - echo 'New order amount and order lines have been set'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php deleted file mode 100644 index e5673834184..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php +++ /dev/null @@ -1,58 +0,0 @@ -fetchRefund($refundId); - - print_r($capture->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php deleted file mode 100644 index 63e72cb571c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php +++ /dev/null @@ -1,76 +0,0 @@ -refund([ - "refunded_amount" => 3000, - "description" => "Refunding half the tomatoes", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 5, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 3000, - "total_tax_amount" => 600 - ] - ] - ]); - - $refund->fetch(); - print_r($refund->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php deleted file mode 100644 index ee0477a1d6d..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php +++ /dev/null @@ -1,57 +0,0 @@ -cancelAuthorization(); - - echo 'Authorization has been cancelled'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php deleted file mode 100644 index f742d5976c5..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php +++ /dev/null @@ -1,106 +0,0 @@ - "John", - "family_name" => "Doe", - "email" => "johndoe@example.com", - "title" => "Mr", - "street_address" => "13 New Burlington St", - "street_address2" => "Apt 214", - "postal_code" => "W13 3BG", - "city" => "London", - "region" => "", - "phone" => "01895808221", - "country" => "GB" -]; - -$data = [ - "billing_address" => $address, - "shipping_address" => $address, - "purchase_country" => "GB", - "purchase_currency" => "GBP", - "locale" => "en-GB", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); - $data = $order->create($data); - - print_r($data); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php deleted file mode 100644 index db15da2bf1c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php +++ /dev/null @@ -1,82 +0,0 @@ - "GB", - "purchase_currency" => "GBP", - "locale" => "en-GB", - "billing_address" => [ - "given_name" => "John", - "family_name" => "Doe", - "email" => "johndoe@example.com", - "title" => "Mr", - "street_address" => "13 New Burlington St", - "street_address2" => "Apt 214", - "postal_code" => "W13 3BG", - "city" => "London", - "region" => "", - "phone" => "01895808221", - "country" => "GB" - ], - "customer" => [ // MUST MATCH line by line to the customer details that was used to get an Authorization Token - "date_of_birth" => "1970-01-01", - "gender" => "male", - ], - "description" => "For testing purposes", - "intended_use" => "SUBSCRIPTION" -]; - -try { - $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); - $token = $order->generateToken($data); - - print_r($token); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php deleted file mode 100644 index 216b32cd5c9..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php +++ /dev/null @@ -1,96 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $session = new Klarna\Rest\Payments\Sessions($connector); - $session->create($order); - - // Store session id - $sessionId = $session->getId(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php deleted file mode 100644 index bbb87c9635d..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php +++ /dev/null @@ -1,57 +0,0 @@ -fetch(); - - print_r($session->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php deleted file mode 100644 index 5be79859d9f..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php +++ /dev/null @@ -1,79 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 4000, - "order_tax_amount" => 800, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "543670", - "name" => "New updated bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $session = new Klarna\Rest\Payments\Sessions($connector, $sessionId); - $session->update($order); - - echo 'Order has been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php deleted file mode 100644 index b6dfffb3945..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php +++ /dev/null @@ -1,61 +0,0 @@ -getAllPayouts([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT), - 'size' => 10, - ]); - - print_r($payouts); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php deleted file mode 100644 index 80e43521c26..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php +++ /dev/null @@ -1,57 +0,0 @@ -getPayout($paymentReference); - - print_r($payout); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php deleted file mode 100644 index 35d08e5a704..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php +++ /dev/null @@ -1,61 +0,0 @@ -getSummary([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT) - ]); - - print_r($summary); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php deleted file mode 100644 index 1a7853c3541..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php +++ /dev/null @@ -1,58 +0,0 @@ -getCSVPayoutReport($paymentReference); - - file_put_contents('report.csv', $report); - echo 'Saved to report.csv'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php deleted file mode 100644 index 6666b77cc5b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php +++ /dev/null @@ -1,58 +0,0 @@ -getPDFPayoutReport($paymentReference); - - file_put_contents('report.pdf', $report); - echo 'Saved to report.pdf'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php deleted file mode 100644 index 0f68fdbccf6..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php +++ /dev/null @@ -1,62 +0,0 @@ -getCSVPayoutsSummaryReport([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT) - ]); - - file_put_contents('summary_report.csv', $report); - echo 'Saved to summary_report.csv'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php deleted file mode 100644 index 2d67e710daa..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php +++ /dev/null @@ -1,62 +0,0 @@ -getPDFPayoutsSummaryReport([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT) - ]); - - file_put_contents('summary_report.pdf', $report); - echo 'Saved to summary_report.pdf'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php deleted file mode 100644 index 36db249f4e0..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php +++ /dev/null @@ -1,61 +0,0 @@ - 10, // How many elements to include in the result - 'offset' => 0, // The current offset. Describes "where" in a collection the current starts - ]; - $data = $transactions->getTransactions($params); - - print_r($data); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md b/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md deleted file mode 100644 index cac0461a18e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md +++ /dev/null @@ -1,79 +0,0 @@ -How to use SDK HTTP Transport -======================================================== - -The SDK functionality relies on an "HTTP Transport" mechanism to handle HTTP communication -(requests / responses). The mechanism is decoupled from the SDK implementation itself -and allows for usage of different libraries that can handle the HTTP communication. - -All the transports should be responsible to get the information to be send and return the result. -There is no any SDK/Api Resources logic inside the transport. - -Previously the SDK used Guzzle HTTP library and it forces SDK users to use Composer. There was no -ability to install the Guzzle library manually. Currently, there is a new cURL Transport, that -allows to use the PHP SDK without Composer and any other extra dependencies. - -## Basic Transport Usage - -The basic SDK usage looks like in the example. You need to create an HTTP Transport connector -and pass the connector to the API Service resource: - -```php -$connector = Klarna\Rest\Transport\Connector::create($merchantId, $sharedSecret, $apiEndpoint); -$api = new Klarna\Rest\ApiService\Resource($connector); -$api->someMethod($someData); -``` - -## Guzzle HTTP Transport (Klarna\Rest\Transport\GuzzleConnector) - -By default all the SDK examples use Guzzle HTTP Transport (Composer is required in this case). -You need to include the SDK into your PHP file using the Composer autoloader: - -```php -require('/path/to/project/vendor/autoload.php'); - -$merchantId = 'K123456_abcd12345'; -$sharedSecret = 'sharedSecret'; -$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; - -// Create Guzzle HTTP Transport Connector -$connector = Klarna\Rest\Transport\GuzzleConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint -); - -$checkout = new Klarna\Rest\Checkout\Order($connector); -$checkout->create($order); -``` - -## cURL HTTP Transport (Klarna\Rest\Transport\CURLConnector) - -The transport uses PHP cURL Library (libcurl): https://www.php.net/manual/en/book.curl.php - -This library does not require any Composer libraries and relies only on `libcurl`. It means you -do not have any `vendor` autoloader and need to include the SDK SPL autoloader. - -```php -// `src` instead of vendor -require('/path/to/project/src/autoload.php'); - -$merchantId = 'K123456_abcd12345'; -$sharedSecret = 'sharedSecret'; -$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; - -// Create cURL HTTP Transport Connector -$connector = Klarna\Rest\Transport\CURLConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint -); - -$checkout = new Klarna\Rest\Checkout\Order($connector); -$checkout->create($order); -``` - -## HTTP Transport Response and Exceptions - -All the Transports should implement the `ConnectorInterface` interface. It imposes some restrictions: -- The only allowed response is [ApiResponse](https://github.com/klarna/kco_rest_php/blob/v4.1/src/Klarna/Rest/Transport/ApiResponse.php) -- The only allowed exceptions that can be thrown from the Transport is `RuntimeException`. diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php deleted file mode 100644 index 1cbc8991d58..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php +++ /dev/null @@ -1,27 +0,0 @@ -setLocation(self::$path . "/{$orderId}"); - $this[static::ID_FIELD] = $orderId; - } - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $response = $this->post(self::$path, $data) - ->expectSuccessfull() - ->status('201') - ->contentType('application/json'); - - $this->exchangeArray($response->getJson()); - $this->setLocation($response->getLocation()); - - return $this; - } - - /** - * Updates the resource. - * - * @param array $data Update data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function update(array $data) - { - $response = $this->post($this->getLocation(), $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - $this->exchangeArray($response); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php deleted file mode 100644 index e6c1c56da10..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php +++ /dev/null @@ -1,116 +0,0 @@ -setLocation(self::$path . "/{$customerToken}"); - $this[static::ID_FIELD] = $customerToken; - } - - /** - * Creates order using Customer Token. - * - * @param array $data Order data - * @param string $klarnaIdempotencyKey Idempotency Key - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array created order data - */ - public function createOrder(array $data, $klarnaIdempotencyKey = null) - { - $headers = ['Content-Type' => 'application/json']; - if (!is_null($klarnaIdempotencyKey)) { - $headers['Klarna-Idempotency-Key'] = $klarnaIdempotencyKey; - } - - return $this->request( - 'POST', - $this->getLocation() . '/order', - $headers, - $data !== null ? \json_encode($data) : null - ) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Update the status of a customer token. - * - * @param array $data Customer token data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateTokenStatus(array $data) - { - $this->patch($this->getLocation() . '/status', $data) - ->expectSuccessfull() - ->status('202'); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php deleted file mode 100644 index b7f757daf4b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php +++ /dev/null @@ -1,145 +0,0 @@ -setLocation(self::$path . "/{$sessionId}"); - $this[static::ID_FIELD] = $sessionId; - } - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-create-a-new-hpp-session - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Session data - */ - public function create(array $data) - { - $response = $this->post(self::$path, $data) - ->expectSuccessfull() - ->status('201') - ->contentType('application/json') - ->getJson(); - - return $response; - } - - /** - * Disables HPP session. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-disable-hpp-session - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If sessionId was not specified when creating a resource - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function disable() - { - if (empty($this[static::ID_FIELD])) { - throw new \RuntimeException('HPP Session ID is not defined'); - } - - $this->delete($this->getLocation()) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Distributes link to the HPP session. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session - * - * @param array $data Distribute data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function distributeLink(array $data) - { - $this->post($this->getLocation() . '/distribution', $data) - ->expectSuccessfull() - ->status(['200', '201']); - - return $this; - } - - /** - * @deprecated HPP API no longer suppors getting the status. Use fetch (getSession) to fetch data; - * @deprecated This method will be removed in the future versions of SDK. - */ - public function getSessionStatus() - { - return $this->fetch(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php deleted file mode 100644 index 352616d1d34..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php +++ /dev/null @@ -1,137 +0,0 @@ -setLocation(self::$path . "/{$buttonKey}"); - $this[static::ID_FIELD] = $buttonKey; - } - } - - /** - * Creates a button key based on setup options. - * - * @param array $data Creation data - * - * @see https://developers.klarna.com/api/#instant-shopping-api-create-a-button-key-based-on-setup-options - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Button properties - */ - public function create(array $data) - { - $response = $this->post(self::$path, $data) - ->expectSuccessfull() - ->status('201') - ->contentType('application/json'); - - $url = $response->getLocation(); - $this->setLocation($url); - - return $response->getJson(); - } - - /** - * Updates the setup options for a specific button key. - * - * @param array $data Update data - * - * @see https://developers.klarna.com/api/#instant-shopping-api-update-the-setup-options-for-a-specific-button-key - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \RuntimeException If key was not specified when creating a resource - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Button properties - */ - public function update(array $data) - { - if (empty($this[static::ID_FIELD])) { - throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); - } - - return $this->put($this->getLocation(), $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * See the setup options for a specific button key. - * - * @see https://developers.klarna.com/api/#instant-shopping-api-see-the-setup-options-for-a-specific-button-key - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If key was not specified when creating a resource - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function retrieve() - { - if (empty($this[static::ID_FIELD])) { - throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); - } - - return $this->fetch(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php deleted file mode 100644 index 0522f2d97eb..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php +++ /dev/null @@ -1,128 +0,0 @@ -setLocation(self::$path . "/{$authorizationToken}"); - $this[static::ID_FIELD] = $authorizationToken; - } - - /** - * Retrieves an authorized order based on the authorization token. - * - * @codingStandardsIgnoreStart - * @see https://developers.klarna.com/api/#instant-shopping-api-retrieves-an-authorized-order-based-on-the-authorization-token - * @codingStandardsIgnoreEnd - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function retrieve() - { - return $this->fetch(); - } - - /** - * Declines an authorized order identified by the authorization token. - * - * @codingStandardsIgnoreStart - * @see https://developers.klarna.com/api/#instant-shopping-api-declines-an-authorized-order-identified-by-the-authorization-token - * @codingStandardsIgnoreEnd - * - * @param array $data Decline data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function decline(array $data = null) - { - $this->delete($this->getLocation(), $data) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Approves the authorized order and places an order identified by the authorization token. - * - * @codingStandardsIgnoreStart - * @see https://developers.klarna.com/api/#instant-shopping-api-approve-the-authorized-order-and-place-an-order-identified-by-the-authorization-token - * @codingStandardsIgnoreEnd - * - * @param array $data Order data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array approving status - */ - public function approve(array $data) - { - return $this->post($this->getLocation() . '/orders', $data) - ->expectSuccessfull() - ->status('200') - ->getJson(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php deleted file mode 100644 index a2cae563914..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php +++ /dev/null @@ -1,151 +0,0 @@ -post(self::$path, $data) - ->expectSuccessfull() - ->status('201') - ->contentType('application/json') - ->getJson(); - - return $response; - } - - /** - * Retrieve an existing settlement. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session - * - * @param array $data Distribute data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Settlement data - */ - public function retrieveSettlement($settlementId, $keyId) - { - $response = $this->request( - 'GET', - self::$path . "/$settlementId", - ['KeyId' => $keyId] - ) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - return $response; - } - - /** - * Retrieves a settled order's settlement. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session - * - * @param array $data Distribute data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Order's settlement data - */ - public function retrieveOrderSettlement($orderId, $keyId) - { - $response = $this->request( - 'GET', - self::$path . "/order/$orderId", - ['KeyId' => $keyId] - ) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - return $response; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php deleted file mode 100644 index 05a7ae0e648..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php +++ /dev/null @@ -1,152 +0,0 @@ -setLocation($url); - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $url = $this->post($this->getLocation(), $data) - ->expectSuccessfull() - ->status('201') - ->getLocation(); - - $this->setLocation($url); - - return $this; - } - - /** - * Appends shipping information to the capture. - * - * @param array $data Shipping info data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function addShippingInfo(array $data) - { - $this->post($this->getLocation() . '/shipping-info', $data) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Updates the customers details. - * - * @param array $data Customer details data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateCustomerDetails(array $data) - { - $this->patch($this->getLocation() . '/customer-details', $data) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Trigger send outs for this capture. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function triggerSendout() - { - $this->post($this->getLocation() . '/trigger-send-out') - ->expectSuccessfull() - ->status('204'); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php deleted file mode 100644 index c41804facac..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php +++ /dev/null @@ -1,407 +0,0 @@ -setLocation(self::$path . "/{$orderId}"); - $this[static::ID_FIELD] = $orderId; - } - - /** - * Fetches the order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function fetch() - { - parent::fetch(); - - // Convert captures data to Capture[] - - $captures = []; - foreach ($this['captures'] as $capture) { - $captureId = $capture[Capture::ID_FIELD]; - - $object = new Capture( - $this->connector, - $this->getLocation(), - $captureId - ); - $object->exchangeArray($capture); - - $captures[] = $object; - } - - $this['captures'] = $captures; - - - // Convert refunds data to Refund[] - if (isset($this['refunds'])) { - $refunds = []; - foreach ($this['refunds'] as $refund) { - $refundId = null; - if (isset($refund[Refund::ID_FIELD])) { - $refundId = $refund[Refund::ID_FIELD]; - } - - $object = new Refund( - $this->connector, - $this->getLocation(), - $refundId - ); - $object->exchangeArray($refund); - - $refunds[] = $object; - } - $this['refunds'] = $refunds; - } - - return $this; - } - - /** - * Acknowledges the order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function acknowledge() - { - $this->post($this->getLocation() . '/acknowledge') - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Cancels this order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function cancel() - { - $this->post($this->getLocation() . '/cancel') - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Updates the authorization data. Sets new order amount and order lines - * - * @param array $data Authorization data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateAuthorization(array $data) - { - $this->patch($this->getLocation() . '/authorization', $data) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Extends the authorization time. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function extendAuthorizationTime() - { - $this->post($this->getLocation() . '/extend-authorization-time') - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Update the merchant references. - * - * @param array $data Merchant references - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateMerchantReferences(array $data) - { - $this->patch($this->getLocation() . '/merchant-references', $data) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Updates the customer details. - * - * @param array $data Customer data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateCustomerDetails(array $data) - { - $this->patch($this->getLocation() . '/customer-details', $data) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Refunds an amount of a captured order. - * - * @param array $data Refund data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Refund - */ - public function refund(array $data) - { - $refund = new Refund($this->connector, $this->getLocation()); - $refund->create($data); - - return $refund; - } - - /** - * Release the remaining authorization for an order. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function releaseRemainingAuthorization() - { - $this->post($this->getLocation() . '/release-remaining-authorization') - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Capture all or part of an order. - * - * @param array $data Capture data - * - * @see Capture::create() For more information on how to create a capture - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Capture - */ - public function createCapture(array $data) - { - $capture = new Capture($this->connector, $this->getLocation()); - - $capture->create($data); - - $this['captures'][] = $capture; - - return $capture; - } - - /** - * Fetches the specified capture. - * - * @param string $captureId Capture ID - * - * @see Capture::fetch() For more information on how to fetch a capture - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Capture - */ - public function fetchCapture($captureId) - { - if ($this->offsetExists('captures')) { - foreach ($this['captures'] as $capture) { - if ($capture->getId() !== $captureId) { - continue; - } - - return $capture->fetch(); - } - } - - $capture = new Capture($this->connector, $this->getLocation(), $captureId); - $capture->fetch(); - - $this['captures'][] = $capture; - - return $capture; - } - - /** - * Fetches the specified refund. - * - * @param string $refundId Refund ID - * - * @see Refund::fetch() For more information on how to fetch a refund - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Refund - */ - public function fetchRefund($refundId) - { - if ($this->offsetExists('refunds')) { - foreach ($this['refunds'] as $refund) { - if ($refund->getId() !== $refundId) { - continue; - } - - return $refund; - } - } - - $refund = new Refund($this->connector, $this->getLocation(), $refundId); - $refund->fetch(); - - $this['refunds'][] = $refund; - - return $refund; - } - - /** - * Fetches all captures. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Capture[] - */ - public function fetchCaptures() - { - $captures = new Capture($this->connector, $this->getLocation()); - $captures = $captures->fetch()->getArrayCopy(); - - foreach ($captures as $id => $capture) { - $captures[$id] = new Capture($this->connector, $this->getLocation(), $capture['capture_id']); - $captures[$id]->exchangeArray($capture); - } - return $captures; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php deleted file mode 100644 index ab6045220ca..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php +++ /dev/null @@ -1,89 +0,0 @@ -setLocation($url); - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $url = $this->post($this->getLocation(), $data) - ->expectSuccessfull() - ->status('201') - ->getLocation(); - - $this->setLocation($url); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php deleted file mode 100644 index da538388b11..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php +++ /dev/null @@ -1,141 +0,0 @@ -setLocation(self::$path . "/{$authorizationToken}"); - $this[static::ID_FIELD] = $authorizationToken; - } - - /** - * Not applicable. - * - * @throws NotApplicableException - */ - public function fetch() - { - throw new NotApplicableException('Not applicable'); - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Order data - */ - public function create(array $data) - { - return $this->post($this->getLocation() . '/order', $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Cancels the authorization. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function cancelAuthorization() - { - $this->delete($this->getLocation()) - ->expectSuccessfull() - ->status('204'); - // ->contentType('application/json'); - // TODO: We cannot check the Content-type here because of an inconsistency - // between service and documentation. The real Content-Type is - // "application/octet-stream but not the "application/json" as in the docs. - - return $this; - } - - /** - * Generates consumer token. - * - * @param array $data Token data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Token data - */ - public function generateToken(array $data) - { - $response = $this->post($this->getLocation() . '/customer-token', $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - return $response; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php deleted file mode 100644 index 3923b8e2b55..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php +++ /dev/null @@ -1,117 +0,0 @@ -setLocation(self::$path . "/{$sessionId}"); - $this[static::ID_FIELD] = $sessionId; - } - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $response = $this->post(self::$path, $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json'); - - $this->exchangeArray($response->getJson()); - - // Payments API does not send Location header after creating a new session. - // Use workaround to set new location. - $this->setLocation(self::$path . '/' . $this->getId()); - - return $this; - } - - /** - * Updates the resource. - * - * @param array $data Update data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function update(array $data) - { - $this->post($this->getLocation(), $data) - ->expectSuccessfull() - ->status('204'); - // ->contentType('application/json'); - // TODO: We cannot check the Content-type here because of an inconsistency - // between service and documentation. The real Content-Type is - // "application/octet-stream but not the "application/json" as in the docs. - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php deleted file mode 100644 index 35a78c2e00e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php +++ /dev/null @@ -1,332 +0,0 @@ -connector = $connector; - } - - /** - * Gets the resource id. - * - * @return string|null - */ - public function getId() - { - return isset($this[static::ID_FIELD]) ? $this[static::ID_FIELD] : null; - } - - /** - * Gets the resource location. - * - * @return string|null - */ - public function getLocation() - { - return $this->url; - } - - /** - * Sets the resource location. - * - * @param string $url Url to the resource - * - * @return self - */ - public function setLocation($url) - { - $this->url = $url; - - return $this; - } - - /** - * Overrides: Stores the ID KEY field in order to restore it after exchanging the array without - * the ID field. - * - * @param array $array Data to be exchanged - */ - public function exchangeArray($array) - { - $id = $this->getId(); - - if (!is_null($array)) { - parent::exchangeArray($array); - } - if (is_null($this->getId()) && !is_null($id)) { - $this->setId($id); - } - } - - /** - * Fetches the resource. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function fetch() - { - $data = $this->get($this->getLocation()) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - $this->exchangeArray($data); - - return $this; - } - - /** - * Sets new ID KEY field. - * - * @param mixed $id ID field - * - * @return self - */ - protected function setId($id) - { - $this[static::ID_FIELD] = $id; - return $this; - } - - /** - * Sends a HTTP request to the specified url. - * - * @param string $method HTTP method, e.g. 'GET' - * @param string $url Request destination - * @param array $headers - * @param string $body - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response' - * @return ResponseValidator When the API replies with an error response - * - */ - protected function request($method, $url, array $headers = [], $body = null) - { - $debug = getenv('DEBUG_SDK') || defined('DEBUG_SDK'); - - if ($debug) { - $methodDebug = str_pad($method, 7, ' ', STR_PAD_LEFT); - $debugHeaders = json_encode($headers); - echo <<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -{$methodDebug} : {$url} -Headers : $debugHeaders - Body : {$body} -\n -DEBUG_BODY; - } - - switch ($method) { - case Method::GET: - $response = $this->connector->get($url, $headers); - break; - case Method::POST: - $response = $this->connector->post($url, $body, $headers); - break; - case Method::PUT: - $response = $this->connector->put($url, $body, $headers); - break; - case Method::DELETE: - $response = $this->connector->delete($url, $body, $headers); - break; - case Method::PATCH: - $response = $this->connector->patch($url, $body, $headers); - break; - default: - throw new \RuntimeException('Unknown request method ' + $method); - } - - if ($debug) { - $debugHeaders = json_encode($response->getHeaders()); - echo <<getBody()} -\n -DEBUG_BODY; - } - - $location = $response->getLocation(); - if (!empty($location)) { - $this->setLocation($location); - } - - return new ResponseValidator($response); - } - - /** - * Sends a HTTP GET request to the specified url. - * - * @param string $url Request destination - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function get($url) - { - return $this->request('GET', $url); - } - - /** - * Sends a HTTP DELETE request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function delete($url, array $data = null) - { - return $this->request( - 'DELETE', - $url, - ['Content-Type' => 'application/json'], - $data !== null ? json_encode($data) : null - ); - } - - /** - * Sends a HTTP PATCH request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function patch($url, array $data) - { - return $this->request( - 'PATCH', - $url, - ['Content-Type' => 'application/json'], - json_encode($data) - ); - } - - /** - * Sends a HTTP PUT request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function put($url, array $data) - { - return $this->request( - 'PUT', - $url, - ['Content-Type' => 'application/json'], - json_encode($data) - ); - } - - /** - * Sends a HTTP POST request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function post($url, array $data = null) - { - return $this->request( - 'POST', - $url, - ['Content-Type' => 'application/json'], - $data !== null ? \json_encode($data) : null - ); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php deleted file mode 100644 index bab484fb28f..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php +++ /dev/null @@ -1,139 +0,0 @@ -get(self::$path . "/{$paymentReference}") - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Returns a collection of payouts. - * - * @param array $params Additional query params to filter payouts. - * - * @see https://developers.klarna.com/api/#settlements-api-get-all-payouts - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Payouts data - */ - public function getAllPayouts(array $params = []) - { - return $this->get(self::$path . '?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Returns a summary of payouts for each currency code in a date range. - * - * @param array $params Additional query params to filter summary data. - * - * @see https://developers.klarna.com/api/#settlements-api-get-summary-of-payouts - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array summary of payouts - */ - public function getSummary(array $params = []) - { - return $this->get(self::$path . '/summary?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php deleted file mode 100644 index f5f01f7f96d..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php +++ /dev/null @@ -1,156 +0,0 @@ -get(self::$path . "/payout-with-transactions?payment_reference={$paymentReference}") - ->expectSuccessfull() - ->status('200') - ->contentType('text/csv') - ->getBody(); - } - - /** - * Returns a single settlement summed up in pdf format. - * - * @param string $paymentReference The reference id of the payout. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return string Binary PDF representation of Payout report - */ - public function getPDFPayoutReport($paymentReference) - { - return $this->get(self::$path . "/payout?payment_reference={$paymentReference}") - ->expectSuccessfull() - ->status('200') - ->contentType('application/pdf') - ->getBody(); - } - - /** - * Returns CSV summary. - * - * @param array $params Additional query params to filter payouts. - * - * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return string CSV Summary report - */ - public function getCSVPayoutsSummaryReport(array $params = []) - { - return $this->get(self::$path . '/payouts-summary-with-transactions?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('text/csv') - ->getBody(); - } - - /** - * Returns PDF summary. - * - * @param array $params Additional query params to filter payouts. - * - * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return string PDF Summary report - */ - public function getPDFPayoutsSummaryReport(array $params = []) - { - return $this->get(self::$path . '/payouts-summary?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/pdf') - ->getBody(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php deleted file mode 100644 index 6265d08d619..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php +++ /dev/null @@ -1,84 +0,0 @@ -get(self::$path . '?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php deleted file mode 100644 index 22964cbb7c8..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php +++ /dev/null @@ -1,148 +0,0 @@ -setStatus($status); - $this->setBody($body); - $this->setHeaders($headers); - } - /** - * Sets HTTP Status code. - * - * @param status HTTP status - * @return self - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * Gets HTTP Status code. - * - * @return Status code - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets binary body payload. - * - * @param body Payout - * @return self - */ - public function setBody($body) - { - $this->body = $body; - return $this; - } - - /** - * Gets binary body payload. - * - * @return Payout - */ - public function getBody() - { - return $this->body; - } - - /** - * Sets HTTP headers map - * - * @param headers Headers - * @return self - */ - public function setHeaders($headers) - { - $this->headers = $headers; - return $this; - } - - /** - * Sets single HTTP header value. - * - * @param name Header name - * @param values Header values - * @return self - */ - public function setHeader($name, $values) - { - $this->headers[$name] = $values; - return $this; - } - - /** - * Gets HTTP Headers map - * - * @return Headers - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Gets single header value - * - * @param name Header name - * @return Header values - */ - public function getHeader($name) - { - return isset($this->headers[$name]) ? $this->headers[$name] : null; - } - - /** - * Gets the Location header helper. - * - * @return string Location if exists, null otherwise - */ - public function getLocation() - { - return empty($this->headers['Location']) ? null : $this->headers['Location'][0]; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php deleted file mode 100644 index 439a9b794f9..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php +++ /dev/null @@ -1,303 +0,0 @@ -merchantId = $merchantId; - $this->sharedSecret = $sharedSecret; - $this->baseUrl = rtrim($baseUrl, '/'); - - if ($userAgent === null) { - $userAgent = UserAgent::createDefault(['CURLConnector/' . curl_version()['version']]); - } - $this->userAgent = $userAgent; - } - - /** - * Sets CURL request options. - * - * @param options CURL options - * - * @return self instance - */ - public function setOptions($options) - { - $this->options = $options; - return $this; - } - - /** - * Sends HTTP GET request to specified path. - * - * @param string $path URL path. - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function get($path, $headers = []) - { - return $this->request(Method::GET, $path, $headers); - } - - /** - * Sends HTTP POST request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function post($path, $data = null, $headers = []) - { - return $this->request(Method::POST, $path, $headers, $data); - } - - /** - * Sends HTTP PUT request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function put($path, $data = null, $headers = []) - { - return $this->request(Method::PUT, $path, $headers, $data); - } - - /** - * Sends HTTP PATCH request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function patch($path, $data = null, $headers = []) - { - return $this->request(Method::PATCH, $path, $headers, $data); - } - - /** - * Sends HTTP DELETE request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function delete($path, $data = null, $headers = []) - { - return $this->request(Method::DELETE, $path, $headers, $data); - } - - /** - * Performs HTTP(S) request. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - protected function request($method, $url, array $headers = [], $data = null) - { - $headers = array_merge([ - 'User-Agent' => (string) $this->userAgent, - ], $headers); - - if (isset($this->options['headers'])) { - $headers = array_merge($headers, $this->options['headers']); - } - array_walk($headers, function (&$v, $k) { - $v = $k . ': ' . $v; - }); - - $ch = curl_init(); - - if (!empty($this->merchantId)) { - curl_setopt($ch, CURLOPT_USERPWD, $this->merchantId . ':' . $this->sharedSecret); - } - if (!empty($this->options['ssl_cert'])) { - curl_setopt($ch, CURLOPT_SSLCERT, $this->options['ssl_cert']); - if (!empty($this->options['ssl_key'])) { - curl_setopt($ch, CURLOPT_SSLKEY, $this->options['ssl_key']); - } - } - - if (!empty($this->options['timeout'])) { - curl_setopt($ch, CURLOPT_TIMEOUT, $this->options['timeout']); - } - - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - - if ($method == Method::GET) { - curl_setopt($ch, CURLOPT_HTTPGET, 1); - } elseif ($method == Method::POST) { - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - } else { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - } - - curl_setopt($ch, CURLOPT_URL, $this->baseUrl . $url); - curl_setopt($ch, CURLOPT_HEADER, 1); - - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - - if ($proxy = getenv('HTTP_PROXY')) { - $proxy = parse_url($proxy); - - $proxyHost = $proxy['host']; - $proxyPort = $proxy['port'] ? ':' . $proxy['post'] : ''; - curl_setopt($ch, CURLOPT_PROXY, $proxyHost . $proxyPort); - if (!empty($proxy['user'])) { - curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy['user'] . ':' . $proxy['pass']); - } - } - - $response = curl_exec($ch); - - $errno = curl_errno($ch); - $error = curl_error($ch); - $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); - - curl_close($ch); - - // Check the TCP transport issues - if (!empty($errno)) { - throw new \RuntimeException($error, $errno); - } - - $rawHeaders = substr($response, 0, $header_size); - $body = substr($response, $header_size); - $headers = self::parseHeaders($rawHeaders); - - return new ApiResponse($http_code, $body, $headers); - } - - /** - * Factory method to create a connector instance. - * - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param string $baseUrl Base URL for HTTP requests - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - * - * @return self - */ - public static function create( - $merchantId, - $sharedSecret, - $baseUrl = self::EU_BASE_URL, - UserAgentInterface $userAgent = null - ) { - return new static($merchantId, $sharedSecret, $baseUrl, $userAgent); - } - - - /** - * Converts raw curl headers response to array. - * - * @param string $rawHeaders Headers part from the curl response - * - * @return array list of HTTP headers - */ - protected static function parseHeaders($rawHeaders) - { - $headers = []; - foreach (explode("\r\n", $rawHeaders) as $i => $line) { - if (strlen($line) == 0) { - continue; - } - - if (strpos($line, 'HTTP/') !== false) { - // The line contains the HTTP response information - $headers['Http'] = $line; - continue; - } - list($key, $value) = explode(': ', $line); - $headers[ucwords($key, '-_')][] = $value; - } - return $headers; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php deleted file mode 100644 index 602887d7f4f..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php +++ /dev/null @@ -1,30 +0,0 @@ -errorCode = $data['error_code']; - $this->messages = $data['error_messages']; - $this->correlationId = $data['correlation_id']; - $this->serviceVersion = $serviceVersion; - } - - /** - * Gets the API error code for this exception. - * - * @return string - */ - public function getErrorCode() - { - return $this->errorCode; - } - - /** - * Gets the API error messages for this exception. - * - * @return array - */ - public function getMessages() - { - return $this->messages; - } - - /** - * Gets the API correlation ID for this exception. - * - * @return string - */ - public function getCorrelationId() - { - return $this->correlationId; - } - - /** - * Gets the API Service version for this exception. - * - * @return string - */ - public function getServiceVersion() - { - return $this->serviceVersion; - } - - /** - * @deprecated Function is not longer used. Will always return null - * Gets the HTTP response for this API error. - * - * @return null - */ - public function getResponse() - { - return null; - } - - private static function setDefaultData($data) - { - $defaults = [ - 'error_code' => 'UNDEFINED', - 'error_messages' => [], - 'correlation_id' => 'UNDEFINED', - ]; - - foreach ($defaults as $field => $default) { - if (!isset($data[$field])) { - $data[$field] = $default; - } - } - - // We need to have a special check for error_message and merge the message to error_messages - if (isset($data['error_message'])) { - array_push($data['error_messages'], $data['error_message']); - } - - return $data; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php deleted file mode 100644 index 6c04adb3db0..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php +++ /dev/null @@ -1,280 +0,0 @@ - 'https://api.klarna.com']); - * $connector = new \Klarna\Transport\Connector($client, '0', 'sharedSecret'); - * - * - * @param ClientInterface $client HTTP transport client - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - */ - public function __construct( - ClientInterface $client, - $merchantId, - $sharedSecret, - UserAgentInterface $userAgent = null - ) { - $this->client = $client; - $this->merchantId = $merchantId; - $this->sharedSecret = $sharedSecret; - - if ($userAgent === null) { - $userAgent = UserAgent::createDefault(['Guzzle/' . ClientInterface::VERSION]); - } - $this->userAgent = $userAgent; - } - - /** - * Sends HTTP GET request to specified path. - * - * @param string $path URL path. - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function get($path, $headers = []) - { - $request = $this->createRequest($path, Method::GET, $headers); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP POST request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function post($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::POST, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP PUT request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function put($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::PUT, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP PATCH request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function patch($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::PATCH, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP DELETE request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function delete($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::DELETE, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Converts ResponseInterface to ApiResponse. - * - * @param response ResponseInterface intance - * @return ApiResponse - */ - protected function getApiResponse(ResponseInterface $response) - { - return new ApiResponse( - $response->getStatusCode(), - $response->getBody()->getContents(), - $response->getHeaders() - ); - } - - /** - * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. - * Creates a request object. - * - * @param string $url URL - * @param string $method HTTP method - * - * @return RequestInterface - */ - public function createRequest($url, $method = 'GET', array $headers = [], $body = null) - { - $headers = array_merge($headers, ['User-Agent' => strval($this->userAgent)]); - return new Request($method, $url, $headers, $body); - } - - /** - * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. - * Sends the request. - * - * @param RequestInterface $request Request to send - * @param string[] $options Request options - * - * @throws RequestException When an error is encountered - * @throws \RuntimeException When the adapter does not populate a response - * - * @return ResponseInterface - */ - public function send(RequestInterface $request, array $options = []) - { - $requestOptions = $this->client->getConfig('request'); - if (is_array($requestOptions)) { - $options = array_merge($requestOptions, $options); - } - $options['auth'] = [$this->merchantId, $this->sharedSecret, 'basic']; - $options['http_errors'] = false; - - try { - $response = $this->client->send($request, $options); - return $response; - } catch (RequestException $e) { - throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); - } catch (\Throwable $e) { - throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Gets the HTTP transport client. - * - * @return ClientInterface - */ - public function getClient() - { - return $this->client; - } - - /** - * Gets the user agent. - * - * @return UserAgentInterface - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Factory method to create a connector instance. - * - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param string $baseUrl Base URL for HTTP requests - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - * - * @return self - */ - public static function create( - $merchantId, - $sharedSecret, - $baseUrl = self::EU_BASE_URL, - UserAgentInterface $userAgent = null - ) { - $client = new Client(['base_uri' => $baseUrl]); - - return new static($client, $merchantId, $sharedSecret, $userAgent); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php deleted file mode 100644 index f2a068e7a71..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php +++ /dev/null @@ -1,29 +0,0 @@ -response = $response; - } - - /** - * Gets the response object. - * - * @return ApiResponse - */ - public function getResponse() - { - return $this->response; - } - - /** - * Asserts the HTTP response status code. - * - * @param string|string[] $status Expected status code(s) - * - * @throws \RuntimeException If status code does not match - * - * @return self - */ - public function status($status) - { - $httpStatus = (string) $this->response->getStatus(); - if (is_array($status) && !in_array($httpStatus, $status)) { - throw new \RuntimeException( - "Unexpected response status code: {$httpStatus}" - ); - } - - if (is_string($status) && $httpStatus !== $status) { - throw new \RuntimeException( - "Unexpected response status code: {$httpStatus}" - ); - } - - return $this; - } - - /** - * Asserts the Content-Type header. Checks partial matching. - * Validation PASSES in the following cases: - * Content-Type: application/json - * $mediaType = 'application/json' - * - * Content-Type: application/json; charset=utf-8 - * $mediaType = 'application/json' - * - * Validation FAILS in the following cases: - * Content-Type: plain/text - * $mediaType = 'application/json' - * - * Content-Type: application/json; charset=utf-8 - * $mediaType = 'application/json; charset=cp-1251' - * - * @param string $mediaType Expected media type. RegExp rules can be used. - * - * @throws \RuntimeException If Content-Type header is missing - * @throws \RuntimeException If Content-Type header does not match - * - * @return self - */ - public function contentType($mediaType) - { - $contentType = $this->response->getHeader('Content-Type'); - if (empty($contentType)) { - throw new \RuntimeException('Response is missing a Content-Type header'); - } - $mediaFound = false; - foreach ($contentType as $type) { - if (preg_match('#' . $mediaType . '#', $type)) { - $mediaFound = true; - break; - } - } - - if (!$mediaFound) { - throw new \RuntimeException( - 'Unexpected Content-Type header received: ' - . implode(',', $contentType) . '. Expected: ' . $mediaType - ); - } - - return $this; - } - - /** - * Gets the decoded JSON response. - * - * @throws \RuntimeException If the response body is not in JSON format - * @throws \InvalidArgumentException If the JSON cannot be parsed - * - * @return array - */ - public function getJson() - { - return \json_decode($this->response->getBody(), true); - } - - /** - * Gets response body. - * - * @throws \RuntimeException If the response body is not in JSON format - * @throws \InvalidArgumentException If the JSON cannot be parsed - * - * @return StreamInterface the body as a stream - */ - public function getBody() - { - return $this->response->getBody(); - } - - /** - * Gets the Location header. - * - * @throws \RuntimeException If the Location header is missing - * - * @return string - */ - public function getLocation() - { - $location = $this->response->getHeader('Location'); - if (empty($location)) { - throw new \RuntimeException('Response is missing a Location header'); - } - return $location[0]; - } - - - /** - * Asserts and analyze the response. Checks if the reponse has SUCCESSFULL family - * and try to parse the Klarna error message if possbile. - * - * @throws ConnectorException if response has non-2xx HTTP CODE and contains - * a Error - * @throws \RuntimeException if response has non-2xx HTTP CODE and body is not parsable - * - * @return void - */ - public function expectSuccessfull() - { - if ($this->isSuccessfull()) { - return $this; - } - - $data = json_decode($this->response->getBody(), true); - if (is_array($data) && array_key_exists('error_code', $data)) { - throw new ConnectorException($data, $this->response->getStatus()); - } - - throw new \RuntimeException( - 'Unexpected reponse HTTP status ' . $this->response->getStatus() . - '. Excepted HTTP status should be in 2xx range', - $this->response->getStatus() - ); - } - - public function isSuccessfull() - { - $status = $this->response->getStatus(); - return $status >= 200 && $status < 300; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php deleted file mode 100644 index a60f7fbd693..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php +++ /dev/null @@ -1,120 +0,0 @@ - $name - ]; - - if (!empty($version)) { - $field['version'] = $version; - } - - if (!empty($options)) { - $field['options'] = $options; - } - - $this->fields[$key] = $field; - - return $this; - } - - /** - * Serialises the user agent. - * - * @return string - */ - public function __toString() - { - $parts = []; - - foreach ($this->fields as $key => $value) { - $component = "{$key}/{$value['name']}"; - if (!empty($value['version'])) { - $component .= "_{$value['version']}"; - } - - $parts[] = $component; - - if (empty($value['options'])) { - continue; - } - - $opts = implode('; ', $value['options']); - $parts[] = "({$opts})"; - } - - return implode(' ', $parts); - } - - /** - * Creates the default user agent. - * - * @return self - */ - public static function createDefault($options = []) - { - $agent = new static(); - - if (extension_loaded('curl')) { - $options[] = 'curl/' . curl_version()['version']; - } - - return $agent - ->setField('Library', static::NAME, static::VERSION, $options) - ->setField('OS', php_uname('s'), php_uname('r')) - ->setField('Language', 'PHP', phpversion()); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php deleted file mode 100644 index a4ed6f76160..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php +++ /dev/null @@ -1,117 +0,0 @@ - Date: Fri, 4 Mar 2022 16:40:09 +0000 Subject: [PATCH 33/39] Support for PHP 8.0 and 8.1 --- .../vendor/klarna/kco_rest/.gitattributes | 9 + .../vendor/klarna/kco_rest/CHANGELOG.md | 223 ++++++++++ .../storage/vendor/klarna/kco_rest/LICENSE | 201 +++++++++ .../storage/vendor/klarna/kco_rest/README.md | 165 +++++++ .../vendor/klarna/kco_rest/composer.json | 55 +++ .../examples/CheckoutAPI/create_checkout.php | 111 +++++ .../create_checkout_attachment.php | 126 ++++++ .../docs/examples/CheckoutAPI/discounts.php | 103 +++++ .../examples/CheckoutAPI/fetch_checkout.php | 62 +++ .../CheckoutAPI/handling_exceptions.php | 64 +++ .../examples/CheckoutAPI/update_checkout.php | 103 +++++ .../examples/Common/change_user_agent.php | 113 +++++ .../CustomerTokenAPI/Tokens/create_order.php | 106 +++++ .../Tokens/read_token_details.php | 57 +++ .../Tokens/update_token_status.php | 59 +++ .../Sessions/create_new_hpp_session.php | 80 ++++ .../Sessions/disable_session.php | 57 +++ .../Sessions/distribute_link.php | 67 +++ .../Sessions/get_hpp_session_status.php | 57 +++ .../ButtonKeys/create_button_key.php | 111 +++++ .../ButtonKeys/see_button_key_options.php | 57 +++ .../ButtonKeys/update_button_key.php | 81 ++++ .../Orders/approve_order.php | 122 ++++++ .../Orders/decline_order.php | 62 +++ .../Orders/retrieve_order.php | 57 +++ .../Captures/add_shipping_info.php | 72 ++++ .../Captures/trigger_send_out.php | 60 +++ .../Captures/update_customer_details.php | 65 +++ .../Orders/acknowledge_order.php | 60 +++ .../Orders/cancel_order.php | 59 +++ .../Orders/create_capture.php | 87 ++++ .../Orders/extend_authorization_time.php | 57 +++ .../Orders/fetch_all_captures.php | 58 +++ .../Orders/fetch_capture.php | 58 +++ .../OrderManagementAPI/Orders/fetch_order.php | 57 +++ .../release_remaining_authorization.php | 59 +++ .../Orders/update_customer_details.php | 68 +++ .../Orders/update_merchant_references.php | 63 +++ .../Orders/update_order_lines.php | 75 ++++ .../Refunds/fetch_refund.php | 58 +++ .../Refunds/refund_order.php | 76 ++++ .../Orders/cancel_existing_authorization.php | 57 +++ .../PaymentsAPI/Orders/create_order.php | 106 +++++ .../Orders/generate_customer_token.php | 82 ++++ .../Sessions/create_new_credit_session.php | 96 +++++ .../Sessions/read_credit_session.php | 57 +++ .../Sessions/update_credit_session.php | 79 ++++ .../Payouts/get_all_payouts.php | 61 +++ .../SettlementsAPI/Payouts/get_payout.php | 57 +++ .../SettlementsAPI/Payouts/get_summary.php | 61 +++ .../Reports/payout_report_csv.php | 58 +++ .../Reports/payout_report_pdf.php | 58 +++ .../Reports/summary_report_cvs.php | 62 +++ .../Reports/summary_report_pdf.php | 62 +++ .../Transactions/get_transactions.php | 61 +++ .../klarna/kco_rest/docs/http_transport.md | 79 ++++ .../Exceptions/NotApplicableException.php | 27 ++ .../src/Klarna/Rest/Checkout/Order.php | 116 +++++ .../src/Klarna/Rest/CustomerToken/Tokens.php | 116 +++++ .../Rest/HostedPaymentPage/Sessions.php | 145 +++++++ .../Rest/InstantShopping/ButtonKeys.php | 137 ++++++ .../Klarna/Rest/InstantShopping/Orders.php | 128 ++++++ .../MerchantCardService/VCCSettlements.php | 151 +++++++ .../Klarna/Rest/OrderManagement/Capture.php | 152 +++++++ .../src/Klarna/Rest/OrderManagement/Order.php | 407 ++++++++++++++++++ .../Klarna/Rest/OrderManagement/Refund.php | 89 ++++ .../src/Klarna/Rest/Payments/Orders.php | 141 ++++++ .../src/Klarna/Rest/Payments/Sessions.php | 117 +++++ .../kco_rest/src/Klarna/Rest/Resource.php | 332 ++++++++++++++ .../src/Klarna/Rest/Settlements/Payouts.php | 139 ++++++ .../src/Klarna/Rest/Settlements/Reports.php | 156 +++++++ .../Klarna/Rest/Settlements/Transactions.php | 84 ++++ .../src/Klarna/Rest/Transport/ApiResponse.php | 148 +++++++ .../Klarna/Rest/Transport/CURLConnector.php | 303 +++++++++++++ .../src/Klarna/Rest/Transport/Connector.php | 30 ++ .../Rest/Transport/ConnectorInterface.php | 124 ++++++ .../Exception/ConnectorException.php | 144 +++++++ .../Klarna/Rest/Transport/GuzzleConnector.php | 280 ++++++++++++ .../src/Klarna/Rest/Transport/Method.php | 29 ++ .../Rest/Transport/ResponseValidator.php | 207 +++++++++ .../src/Klarna/Rest/Transport/UserAgent.php | 120 ++++++ .../Rest/Transport/UserAgentInterface.php | 117 +++++ .../vendor/klarna/kco_rest/src/autoload.php | 30 ++ 83 files changed, 8345 insertions(+) create mode 100644 upload/system/storage/vendor/klarna/kco_rest/.gitattributes create mode 100644 upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md create mode 100644 upload/system/storage/vendor/klarna/kco_rest/LICENSE create mode 100644 upload/system/storage/vendor/klarna/kco_rest/README.md create mode 100644 upload/system/storage/vendor/klarna/kco_rest/composer.json create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Checkout/Order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ResponseValidator.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/autoload.php diff --git a/upload/system/storage/vendor/klarna/kco_rest/.gitattributes b/upload/system/storage/vendor/klarna/kco_rest/.gitattributes new file mode 100644 index 00000000000..2013edf972a --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/.gitattributes @@ -0,0 +1,9 @@ +.github export-ignore +git_hooks export-ignore +tests export-ignore +.coveralls.yml export-ignore +.editorconfig export-ignore +.gitignore export-ignore +.travis.yml export-ignore +phpmd.xml export-ignore +phpunit.xml.dist export-ignore diff --git a/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md b/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md new file mode 100644 index 00000000000..afca0b76e3c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/CHANGELOG.md @@ -0,0 +1,223 @@ + + +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [4.2.3] - 2020-02-14 + +### Added + +- HTTP Transport: Oceania Base URLs (playground and production) + + +## [4.2.2] - 2019-11-05 + +### Changed + +- Remove "src" folder from a PSR4 autoload definition as fallback directory. + + +## [4.2.1] - 2019-10-15 + +### Added + +- Test against php 7.3 + +### Fixed + +- CURL Transport: Add processing of multiple HTTP headers in response.[Caught exception: Response is missing a Content-Type header #44](https://github.com/klarna/kco_rest_php/issues/44); +- Fix exception namespace and PHPDoc +- Stores the KEY ID field in order to restore the ID after fetching data without the KEY field. [Payments Session ID is reset after fetch() #37](https://github.com/klarna/kco_rest_php/issues/37) + +## [4.2.0] - 2019-06-11 + +This release has a number of **[no-backward-compatibility]** flags. But these incompatible changes related +only to the "under the hood" files. It means, if you operate only with high-level instances, like +`Connector` and `Rest\`/`Checkout/Payments/OrderManagement/etc` resources (you have the code, +like in the example files) - you are safe for upgrade. + +If you have your own implementation of REST API Services, HTTP Transport or Base Resource instance, +you need to check the code before go live. + +### Added + +- Add new HTTP Transport `CURLTransport`. This transport does not require any package dependencies +- Add PHP SDK SPL Autoloader +- Add `ApiResponse` class to unify an HTTP Transport reponse + +### Changed + +- Decouple the HTTP Transport Connector interface. Remove Guzzle hardcoded dependency **[no-backward-compatibility]** +- Decouple `ConnectorException`. Remove Guzzle hardcoded dependency **[partial-backward-compatibility]** + - Change the constructor signature. Replace `RequestException` exception with `int $code` + - `getResponse` method is not longer return Guzzle `ResponseInterface`. + This method marked as deprecated and return `null` +- Rename `Klarna/Rest/Transport/Connector.php` to `Klarna/Rest/Transport/GuzzleConnector.php` to + make the name explicit. **[backward-compatible]** + The `Klarna/Rest/Transport/Connector.php` still exists, but marked as deprecated +- Change the structure and return values for all the methods in `GuzzleConnector` (ex `Connector`) + to follow the new Connector interface. **[no-backward-compatibility]** +- Exception throwing behavior: **[partial-backward-compatibility]** + - `GuzzleConnector` (ex `Connector`) no longer throws Guzzle related `RuntimeException` exceptions. + The Connector throws only `RuntimeException` + - The only two types of exceptions can be thrown by SDK now: + - `RuntimeException` + - `ConnectorException` +- Extend `ResponseValidator` with `expectSuccessfull` and `isSuccessfull` methods. The methods allows + to validate the reponse code and parse the Klarna Error Message if possible + +## [4.1.5] - 2019-05-21 + +### Added + +- Add `.gitattributes` file to remove needless load from composer imports +- Examples: Add "How to set a discount" example. + +### Changed + +- Remove unused phpunit/phpcov package; +- Examples: Checkout API: Add more callback URLs; + +### Fixed + +- Debug mode: Request body and headers were not displayed when getting 400 HTTP response code. +- Examples: Checkout API: Fix typo in the attachments file; + +## [4.1.4] - 2019-03-15 + +### Added + +- Add full support of Instant Shopping API +- Repo now has an Apache 2.0 LICENSE file on its root +- HTTP Transport: Add support of PUT method +- Examples: Add Instant Shopping examples. + +### Fixed + +- HTTP Transport: Stop throwing an exception when an API service return a bad structured Error; + +## [4.1.3] - 2019-01-23 + +### Added + +- HPP API: Add support for disabling an HPP session; +- Customer Token API: Add ability to use Klarna-Idempotency-Key when creating order +- Customer Token API: Add new feature: Update token status; +- Examples: Add example of changing the User-Agent. + +## [4.1.2] - 2018-11-22 + +### Fixed + +- Order management API threw Error Notice when fetching an order with refunds. + +## [4.1.1] - 2018-10-31 + +### Added + +- Add support of Merchant Card Service API + +### Changed + +- HPP: HPP service changed API completely without backward compatibility. Adopt SDK to the new changes. + Mark `getSessionStatus` as `@deprecated`. Replaced by fetch function. + Return data was changed by HPP API service. + **[partial-backward-compatibility]** + +## [4.0.0] - 2018-08-27 (Major release) + +### Added + +- `OrderManagement`: + - Add ability to fetch Captures; + - Add support of Refunds **[partial-backward-compatibility]**; +- Add full support of Customer Token API; +- Add full support of Settlements API; +- Add full support of Payments API; +- Add full support of Hosted Payment Page API; +- Add 'Debug Mode' to be able to debug requests and responses; +- Put SDK References documentation to GH Pages: [https://klarna.github.io/kco_rest_php/](https://klarna.github.io/kco_rest_php/) +- More Examples for all Klarna Services. + +### Changed + +- OrderManagementAPI: Changed `refund` function. Before returned `$this`, now returns - `Refund` object; +- OrderManagementAPI: Order object now has an `array` of `Refund` objects instead of just array of data. + **[backward-compatible]** + +### Fixed + +- Fix: Settlements API [Unexpected Header #15](https://github.com/klarna/kco_rest_php/issues/15); + +## [3.0.1] - 2017-01-16 + +### Fixed + +- smaller fixes + +## [3.0.0] - 2017-12-12 + +### Changed + +- support for guzzle >6.0 + +## [2.2.0] - 2015-12-7 + +### Added + +- **NEW META-13** Allow for 201 response on refund - *Joakim.L* + +## [2.1.0] - 2015-07-29 + +### Changed + +- **NEW MINT-2262** Support Guzzle 5.x versions - *Omer.K, Joakim.L* + +## [2.0.0] - 2015-06-10 + +### Added + +- **NEW MINT-2214** Add base URLs for North America - *Joakim.L* + +### Fixed + +- **NEW MINT-2203** Use order id instead of URL for checkout orders - *Joakim.L* + +## [1.0.1] - 2015-03-30 + +### Added + +- **NEW MINT-2097** Add apigen and custom styling - *Petros.G* + +### Fixed + +- **FIX MINT-2002** Handle errors with an empty payload - *David.K* + +## 1.0.0 - 2014-10-16 + +### Added + +- **NEW MINT-1804** Support checkout v3 and ordermanagement v1 APIs - *Joakim.L* + +[Unreleased]: https://github.com/klarna/kco_rest_php/compare/v4.2.3...HEAD +[4.2.3]: https://github.com/klarna/kco_rest_php/compare/v4.2.2...v4.2.3 +[4.2.2]: https://github.com/klarna/kco_rest_php/compare/v4.2.1...v4.2.2 +[4.2.1]: https://github.com/klarna/kco_rest_php/compare/v4.2.0...v4.2.1 +[4.2.0]: https://github.com/klarna/kco_rest_php/compare/v4.1.5...v4.2.0 +[4.1.5]: https://github.com/klarna/kco_rest_php/compare/v4.1.4...v4.1.5 +[4.1.4]: https://github.com/klarna/kco_rest_php/compare/v4.1.3...v4.1.4 +[4.1.3]: https://github.com/klarna/kco_rest_php/compare/v4.1.2...v4.1.3 +[4.1.2]: https://github.com/klarna/kco_rest_php/compare/v4.1.1...v4.1.2 +[4.1.1]: https://github.com/klarna/kco_rest_php/compare/v4.0.0...v4.1.2 +[4.0.0]: https://github.com/klarna/kco_rest_php/compare/v3.0.1...v4.0.0 +[3.0.1]: https://github.com/klarna/kco_rest_php/compare/v3.0.0...v3.0.1 +[3.0.0]: https://github.com/klarna/kco_rest_php/compare/v2.1.0...v3.0.0 +[2.1.0]: https://github.com/klarna/kco_rest_php/compare/v2.0.0...v2.1.0 +[2.0.0]: https://github.com/klarna/kco_rest_php/compare/v1.0.1...v2.0.0 +[1.0.1]: https://github.com/klarna/kco_rest_php/compare/v1.0.0...v1.0.1 diff --git a/upload/system/storage/vendor/klarna/kco_rest/LICENSE b/upload/system/storage/vendor/klarna/kco_rest/LICENSE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/upload/system/storage/vendor/klarna/kco_rest/README.md b/upload/system/storage/vendor/klarna/kco_rest/README.md new file mode 100644 index 00000000000..3f956572694 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/README.md @@ -0,0 +1,165 @@ +# Official Klarna REST PHP SDK +[![Packagist Version][packagist-image]](https://packagist.org/packages/klarna/kco_rest) +[![Build Status][travis-image]](https://travis-ci.org/klarna/kco_rest_php) +[![Coverage Status][coveralls-image]](https://coveralls.io/r/klarna/kco_rest_php?branch=v4.x) + +## Shop now. Pay later. + +Shop at your favorite stores today and experience the freedom to pay later with Klarna. + + +## Getting started + +SDK covers all of Klarna API: https://developers.klarna.com/api/ + +### Prerequisites +* PHP 5.5 or above +* [API credentials](#api-credentials) +* [Composer](https://getcomposer.org/) (optional) + + +### API Credentials + +Before getting a production account you can get a playground one. +Register here to be able to test your SDK integration before go live: + +- https://playground.eu.portal.klarna.com/developer-sign-up - for EU countries +- https://playground.us.portal.klarna.com/developer-sign-up - for the US + + +## PHP SDK Installation and Usage + +### Install via Composer + +To install the PHP SDK from the Central Composer repository use composer: + +```shell +composer require klarna/kco_rest +``` + +Highly recommended to use version tag when installing SDK. + +```shell +composer require klarna/kco_rest:1.2.3.4 +``` + +Detailed information about the PHP SDK package and a list of available versions can be found here: +https://packagist.org/packages/klarna/kco_rest + +Include the SDK into your PHP file using the Composer autoloader: + +```php + +``` + +or + +```shell +$ export DEBUG_SDK=1 +$ php +``` + +Another way to enable Debugging Mode is `define` the **DEBUG_SDK** inside your script: + +```php +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + GET : https://api.playground.klarna.com/customer-token/v1/tokens/TOKEN +Headers : {"User-Agent":["Library\/Klarna.kco_rest_php_3.1.0 (Guzzle\/6.3.3; curl\/7.54.0) OS\/Darwin_17.5.0 Language\/PHP_5.6.37"]} + Body : + +DEBUG MODE: Response +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +Headers : {"Content-Type":["application\/json"],"Date":["Wed, 15 Aug 2018 15:55:53 GMT"],"Klarna-Correlation-Id":["ABC-123"],"Server":["openresty"],"Content-Length":["62"],"Connection":["keep-alive"]} + Body : { + "status" : "ACTIVE", + "payment_method_type" : "INVOICE" + } +``` + + +## Questions and feedback +If you have any questions concerning this product or the implementation, +please create an issue: https://github.com/klarna/kco_rest_php/issues/new/choose + +Use an official Klarna Contact us form (https://klarna.com) if you have a question about the integration. + + +## How to contribute +At Klarna, we strive toward achieving the highest possible quality for our +products. Therefore, we require you to follow these guidelines if you wish +to contribute. + +To contribute, the following criteria needs to be fulfilled: + +* Description regarding what has been changed and why +* Pull requests should implement a boxed change +* All code and documentation must follow the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) +* New features and bug fixes must have accompanying unit tests: + * Positive tests + * Negative tests + * Boundary tests (if possible) + * No less than 90% decision coverage +* All tests should pass + + +## License +Klarna Checkout REST PHP SDK is licensed under +[Apache License, Version 2.0](http://www.apache.org/LICENSE-2.0) + +[packagist-image]: https://img.shields.io/packagist/v/klarna/kco_rest.svg?style=flat +[travis-image]: https://img.shields.io/travis/klarna/kco_rest_php/v4.x.svg?style=flat +[coveralls-image]: https://img.shields.io/coveralls/klarna/kco_rest_php/v4.x.svg?style=flat diff --git a/upload/system/storage/vendor/klarna/kco_rest/composer.json b/upload/system/storage/vendor/klarna/kco_rest/composer.json new file mode 100644 index 00000000000..17e62fa1f95 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/composer.json @@ -0,0 +1,55 @@ +{ + "name": "klarna/kco_rest", + "description": "Official Klarna REST PHP SDK", + "homepage": "http://developers.klarna.com", + "license": "Apache-2.0", + "type": "library", + "authors": [ + { + "name": "Klarna AB" + } + ], + "autoload": { + "psr-4": { + "Klarna\\": "src/Klarna/" + } + }, + "autoload-dev": { + "psr-4": { + "Klarna\\Rest\\Tests\\": "tests/" + } + }, + "minimum-stability": "stable", + "require": { + "php": ">=5.5.0", + "guzzlehttp/guzzle": "~6.0" + }, + "require-dev": { + "phpunit/phpunit": ">=4.0.0, <6.0", + "squizlabs/php_codesniffer": "1.5.*", + "phpmd/phpmd": "2.1.*", + "phploc/phploc": "2.0.*", + "sebastian/phpcpd": "2.0.*", + "php-coveralls/php-coveralls": "^2.1", + "apigen/apigen": "4.1.*", + "klarna/apigen-theme": "2.1.0" + }, + "scripts": { + "test": "vendor/bin/phpunit --colors", + "reference": "vendor/bin/apigen generate -s src -d docs/reference --template-config='vendor/klarna/apigen-theme/src/config.neon'", + "checkstyle": "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --extensions=php src/ tests/", + "check": [ + "@test", + "@checkstyle" + ], + "analyze": [ + "mkdir -p build/logs", + "vendor/bin/phploc --log-csv build/logs/phploc.csv src/ tests/", + "mkdir -p build/pdepend", + "vendor/bin/pdepend --jdepend-xml=build/logs/jdepend.xml --jdepend-chart=build/pdepend/dependencies.svg --overview-pyramid=build/pdepend/overview-pyramid.svg src/", + "vendor/bin/phpmd src/,tests/ xml phpmd.xml --reportfile build/logs/pmd.xml || true", + "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --report-file=build/logs/checkstyle.xml --extensions=php src/ tests/", + "vendor/bin/phpcpd --log-pmd build/logs/pmd-cpd.xml src/ tests/ || true" + ] + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php new file mode 100644 index 00000000000..2f796c37027 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php @@ -0,0 +1,111 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://www.example.com/terms.html", + "cancellation_terms" => "https://www.example.com/terms/cancellation.html", + "checkout" => "https://www.example.com/checkout.html", + "confirmation" => "https://www.example.com/confirmation.html", + + // Callbacks + "push" => "https://www.example.com/api/push", + "validation" => "https://www.example.com/api/validation", + "shipping_option_update" => "https://www.example.com/api/shipment", + "address_update" => "https://www.example.com/api/address", + "notification" => "https://www.example.com/api/pending", + "country_change" => "https://www.example.com/api/country" + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + // Store checkout order id + $orderId = $checkout->getId(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php new file mode 100644 index 00000000000..0c991ca9252 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php @@ -0,0 +1,126 @@ + [ + [ + "unique_account_identifier" => "Test Testperson", + "payment_option" => "card", + "number_paid_purchases" => 1, + "total_amount_paid_purchases" => 10000, + "date_of_last_paid_purchase" => (new DateTime())->format(DATE_FORMAT), + "date_of_first_paid_purchase" => (new DateTime())->format(DATE_FORMAT) + ] + ] +]; + +$order = [ + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://www.example.com/terms.html", + "cancellation_terms" => "https://www.example.com/terms/cancellation.html", + "checkout" => "https://www.example.com/checkout.html", + "confirmation" => "https://www.example.com/confirmation.html", + + // Callbacks + "push" => "https://www.example.com/api/push", + "validation" => "https://www.example.com/api/validation", + "shipping_option_update" => "https://www.example.com/api/shipment", + "address_update" => "https://www.example.com/api/address", + "notification" => "https://www.example.com/api/pending", + "country_change" => "https://www.example.com/api/country" + ], + "attachment" => [ + "content_type" => "application/vnd.klarna.internal.emd-v2+json", + "body" => json_encode($emd) + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + // Store checkout order id + $orderId = $checkout->getId(); + + // Get some data if needed + print_r($checkout['attachment']); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php new file mode 100644 index 00000000000..6703a1cc706 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php @@ -0,0 +1,103 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 9000, + "order_tax_amount" => 818, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "19-402-USA", + "name" => "Red T-Shirt", + "quantity" => 1, + "quantity_unit" => "pcs", + "unit_price" => 10000, + "tax_rate" => 1000, + "total_amount" => 10000, + "total_tax_amount" => 909 + ], + + // Add discount as an order line + [ + "type" => "discount", + "reference" => "10-gbp-order-discount", + "name" => "Discount", + "quantity" => 1, + "unit_price" => -1000, + "tax_rate" => 1000, + "total_amount" => -1000, + "total_tax_amount" => -91 + ] + ], + "merchant_urls" => [ + "terms" => "https://www.example.com/terms.html", + "cancellation_terms" => "https://www.example.com/terms/cancellation.html", + "checkout" => "https://www.example.com/checkout.html", + "confirmation" => "https://www.example.com/confirmation.html", + + // Callbacks + "push" => "https://www.example.com/api/push", + "validation" => "https://www.example.com/api/validation", + "shipping_option_update" => "https://www.example.com/api/shipment", + "address_update" => "https://www.example.com/api/address", + "notification" => "https://www.example.com/api/pending", + "country_change" => "https://www.example.com/api/country" + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + echo $checkout['html_snippet']; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php new file mode 100644 index 00000000000..270aca35559 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php @@ -0,0 +1,62 @@ +fetch(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php new file mode 100644 index 00000000000..ef6652330f3 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php @@ -0,0 +1,64 @@ +create([ + 'wrong order data' + ]); +} catch (ConnectorException $e) { + echo 'Message: ' . $e->getMessage() . "\n"; + echo 'Code: ' . $e->getCode() . "\n"; + echo 'ErrorCode: ' . $e->getErrorCode() . "\n"; + echo 'CorrelationID: ' . $e->getCorrelationId() . "\n"; + echo 'ServiceVersion: ' . $e->getServiceVersion() . "\n"; +} catch (Exception $e) { + echo 'Unhandled exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php new file mode 100644 index 00000000000..11e0463805a --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php @@ -0,0 +1,103 @@ + 11000, + "order_tax_amount" => 2200, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ], + [ + "type" => "shipping_fee", + "name" => "Express delivery", + "quantity" => 1, + "unit_price" => 1000, + "tax_rate" => 2500, + "total_amount" => 1000, + "total_tax_amount" => 200 + ] + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector, $orderId); + $checkout->update($updatedOrder); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php new file mode 100644 index 00000000000..26e705493cb --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php @@ -0,0 +1,113 @@ +setField('Platform', 'MyCustomShop', '1.2.3.4.5', ['seoAddon', 'promo']); +$customUserAgent->setField('PHP', 'Version', '5.4'); +$customUserAgent->setField('Hello', 'World'); + +// Headers: "User-Agent": ["Platform/MyCustomShop_1.2.3.4.5 (seoAddon; promo) PHP/Version_5.4 Hello/World"] + +$connector = Klarna\Rest\Transport\GuzzleConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint, + $customUserAgent +); + +$order = [ + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://example.com/toc", + "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", + "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", + "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" + ] +]; + +try { + $checkout = new Klarna\Rest\Checkout\Order($connector); + $checkout->create($order); + + // Store checkout order id + $orderId = $checkout->getId(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php new file mode 100644 index 00000000000..5a75a47ef0b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php @@ -0,0 +1,106 @@ + "John", + "family_name" => "Doe", + "email" => "johndoe@example.com", + "title" => "Mr", + "street_address" => "13 New Burlington St", + "street_address2" => "Apt 214", + "postal_code" => "W13 3BG", + "city" => "London", + "region" => "", + "phone" => "01895808221", + "country" => "GB" +]; + +$data = [ + "billing_address" => $address, + "shipping_address" => $address, + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $token = new Klarna\Rest\CustomerToken\Tokens($connector, $customerToken); + $order = $token->createOrder($data); + + print_r($order); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php new file mode 100644 index 00000000000..7010a13b41c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php @@ -0,0 +1,57 @@ +fetch(); + + print_r($token->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php new file mode 100644 index 00000000000..f1419c9a5bd --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php @@ -0,0 +1,59 @@ +updateTokenStatus([ + 'status' => 'CANCELLED' + ]); + + echo 'Token patch request has been accepted and is being processed.'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php new file mode 100644 index 00000000000..7850a0d978a --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php @@ -0,0 +1,80 @@ + [ + "cancel" => "https://example.com/cancel", + "failure" => "https://example.com/fail", + "privacy_policy" => "https://example.com/privacy_policy", + "success" => "https://example.com/success?token={{authorization_token}}", + "terms" => "https://example.com/terms" + ], + "options" => [ + "background_images" => [ + [ + "url" => "https://example.com/bgimage.jpg", + "width" => 1200 + ] + ], + "logo_url" => "https://example.com/logo.jpg", + "page_title" => "Complete your purchase", + "payment_method_category" => "pay_later", + "purchase_type" => "buy" + ], + "payment_session_url" => "https://api.klarna.com/payments/v1/sessions/$sessionId" +]; + +try { + $hpp = new Klarna\Rest\HostedPaymentPage\Sessions($connector); + $sessionData = $hpp->create($session); + + print_r($sessionData); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php new file mode 100644 index 00000000000..111a6d76918 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php @@ -0,0 +1,57 @@ +disable(); + + echo 'The session has been disabled'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php new file mode 100644 index 00000000000..89925f946a3 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php @@ -0,0 +1,67 @@ + [ + "email" => "test@example.com", + "phone" => "07000212345", + "phone_country" => "SE" + ], + "method" => "sms", + "template" => "INSTORE_PURCHASE" + ]; + + $session = new Klarna\Rest\HostedPaymentPage\Sessions($connector, $sessionId); + $session->distributeLink($data); + + echo 'The session link has been distributed'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php new file mode 100644 index 00000000000..9d6f731b7fe --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php @@ -0,0 +1,57 @@ +getSessionStatus(); + + print_r($status); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php new file mode 100644 index 00000000000..76218fa0e42 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php @@ -0,0 +1,111 @@ + 'John Doe', + 'merchant_urls' => [ + 'place_order' => 'https://example.com/place-callback', + 'push' => 'https://example.com/push-callback', + 'confirmation' => 'https://example.com/confirmation-callback', + 'terms' => 'https://example.com/terms-callback', + 'notification' => 'https://example.com/notification-callback', + 'update' => 'https://example.com/update-callback', + ], + 'purchase_currency' => 'EUR', + 'purchase_country' => 'DE', + 'billing_countries' => ["UK", "DE", "SE"], + 'shipping_countries' => ["UK", "DE", "SE"], + 'locale' => 'en-US', + 'order_amount' => 50000, + 'order_tax_amount' => 0, + 'order_lines' => [ + [ + 'name' => 'Red T-Shirt', + 'type' => 'physical', + 'reference' => '19-402-USA', + 'quantity' => 5, + 'quantity_unit' => 'pcs', + 'tax_rate' => 0, + 'total_amount' => 50000, + 'total_discount_amount' => 0, + 'total_tax_amount' => 0, + 'unit_price' => 10000, + 'product_url' => 'https://www.estore.com/products/f2a8d7e34', + 'image_url' => 'https://www.exampleobjects.com/logo.png', + 'product_identifiers' => + [ + 'category_path' => 'Electronics Store > Computers & Tablets > Desktops', + 'global_trade_item_number' => '735858293167', + 'manufacturer_part_number' => 'BOXNUC5CPYH', + 'brand' => 'Intel', + ], + ], + ], + 'shipping_options' => [ + [ + 'id' => 'my-shipping-id', + 'name' => 'Pickup Store', + 'description' => 'My custom description', + 'promo' => 'string', + 'price' => 10, + 'tax_amount' => 0, + 'tax_rate' => 0, + 'preselected' => true, + 'shipping_method' => 'PICKUPSTORE', + ], + ], + ]; + $button = $buttonsApi->create($data); + + echo 'Button has been successfully created' . PHP_EOL; + print_r($button); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php new file mode 100644 index 00000000000..565d2c4b7c9 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php @@ -0,0 +1,57 @@ +retrieve(); + + print_r($button->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php new file mode 100644 index 00000000000..6318c44bd73 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php @@ -0,0 +1,81 @@ + 'New name', + 'merchant_urls' => [ + 'place_order' => 'https://example.com/place-callback', + 'push' => 'https://example.com/push-callback', + 'confirmation' => 'https://example.com/confirmation-callback', + 'terms' => 'https://example.com/terms-callback', + 'notification' => 'https://example.com/notification-callback', + 'update' => 'https://example.com/update-callback', + ], + 'shipping_options' => [ + [ + 'id' => 'my-new-shipping-id', + 'name' => 'Priority delivery', + 'description' => '', + 'price' => 300, + 'tax_amount' => 0, + 'tax_rate' => 0, + 'preselected' => false, + 'shipping_method' => 'PRIME_DELIVERY', + ], + ], + ]; + $button = $buttonsApi->update($data); + + echo 'Button has been successfully updated' . PHP_EOL; + print_r($button); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php new file mode 100644 index 00000000000..494f40609f2 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php @@ -0,0 +1,122 @@ + https://github.com/klarna/kco_rest_php/#api-credentials + * + * Make sure that your credentials belong to the right endpoint. If you have credentials for the US Playground, + * such credentials will not work for the EU Playground and you will get 401 Unauthorized exception. + */ +$merchantId = getenv('USERNAME') ?: 'K123456_abcd12345'; +$sharedSecret = getenv('PASSWORD') ?: 'sharedSecret'; +$authToken = getenv('AUTH_TOKEN') ?: 'authorization_token'; + +/* +EU_BASE_URL = 'https://api.klarna.com' +EU_TEST_BASE_URL = 'https://api.playground.klarna.com' +NA_BASE_URL = 'https://api-na.klarna.com' +NA_TEST_BASE_URL = 'https://api-na.playground.klarna.com' +OC_BASE_URL = 'https://api-oc.klarna.com' +OC_TEST_BASE_URL = 'https://api-oc.playground.klarna.com' +*/ +$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; + +$connector = Klarna\Rest\Transport\GuzzleConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint +); + +$order = [ + "order_id" => "f3392f8b-6116-4073-ab96-e330819e2c07", + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "billing_address" => [ + "given_name" => "Jane", + "family_name"=> "Doe", + "email"=> "jane-doe@example.com", + "title"=> "Ms", + "street_address"=> "Lombard St 10", + "street_address2"=> "Apt 214", + "postal_code"=> "90210", + "city"=> "Beverly Hills", + "region"=> "CA", + "phone"=> "333444555", + "country"=> "US" + ], + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "https://example.com/toc", + "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", + "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", + "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" + ], + "customer" => [ + "date_of_birth" => "1995-10-20", + "title" => "Mr", + "gender" => "male", + "last_four_ssn" => "0512", + "national_identification_number" => "3108971100", + "type" => "person", + "vat_id" => "string", + "organization_registration_id" => "556737-0431", + "organization_entity_type" => "LIMITED_COMPANY" + ] +]; + +try { + $orderApi = new Klarna\Rest\InstantShopping\Orders($connector, $authToken); + $status = $orderApi->approve($order); + + echo 'The order has been approved' . PHP_EOL; + print_r($status); +} catch (Exception $e) { + echo 'Caught exception => ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php new file mode 100644 index 00000000000..3a1ee128525 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php @@ -0,0 +1,62 @@ + "https://example.com/rejected.html", + "deny_code" => "other", + "deny_message" => "You are not permitted to purchase this product", + ]; + $orderApi->decline($data); + echo 'The order has been declined'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php new file mode 100644 index 00000000000..a9570c577cf --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php @@ -0,0 +1,57 @@ +retrieve(); + + print_r($order->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php new file mode 100644 index 00000000000..5c268b449dc --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php @@ -0,0 +1,72 @@ +fetchCapture($captureId); + $capture->addShippingInfo([ + "shipping_info" => [ + [ + "shipping_company" => "DHL", + "shipping_method" => "Home", + "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", + "tracking_number" => "1234567890", + "return_tracking_number" => "E-55-KL", + "return_shipping_company" => "DHL", + "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" + ] + ] + ]); + + echo 'Shipping info has been appended'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php new file mode 100644 index 00000000000..6052df03c3b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php @@ -0,0 +1,60 @@ +fetchCapture($captureId); + $capture->triggerSendout(); + + echo 'Triggered a new send out of customer payment communication'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php new file mode 100644 index 00000000000..db7151a2352 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php @@ -0,0 +1,65 @@ +fetchCapture($captureId); + $capture->updateCustomerDetails([ + "billing_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ] + ]); + + echo 'Billing address of the customer has been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php new file mode 100644 index 00000000000..9cf3ebbbfaa --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php @@ -0,0 +1,60 @@ +acknowledge(); + + echo 'Order has been acknowledged'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php new file mode 100644 index 00000000000..2a04a1431ea --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php @@ -0,0 +1,59 @@ +cancel(); + + echo 'Order has been cancelled'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php new file mode 100644 index 00000000000..d5721c1569e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php @@ -0,0 +1,87 @@ +createCapture([ + "captured_amount" => 6000, + "description" => "Shipped part of the order", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ] + ], + "shipping_info" => [ + [ + "shipping_company" => "DHL", + "shipping_method" => "Home", + "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", + "tracking_number" => "1234567890", + "return_tracking_number" => "E-55-KL", + "return_shipping_company" => "DHL", + "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" + ] + ] + ]); + + echo 'Capture has been created'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php new file mode 100644 index 00000000000..6e164fa7600 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php @@ -0,0 +1,57 @@ +extendAuthorizationTime(); + + echo 'The expiry time of an order has been extend'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php new file mode 100644 index 00000000000..7ae89e83f83 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php @@ -0,0 +1,58 @@ +fetchCaptures(); + foreach ($captures as $capture) { + print_r($capture->getArrayCopy()); + } +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php new file mode 100644 index 00000000000..50ee23ead75 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php @@ -0,0 +1,58 @@ +fetchCapture($captureId); + + print_r($capture->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php new file mode 100644 index 00000000000..b611ad5a272 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php @@ -0,0 +1,57 @@ +fetch(); + + print_r($order->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php new file mode 100644 index 00000000000..5b1cca93153 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php @@ -0,0 +1,59 @@ +releaseRemainingAuthorization(); + + echo 'Remaining authorised amount has been released'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php new file mode 100644 index 00000000000..87f77cafd42 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php @@ -0,0 +1,68 @@ +updateCustomerDetails([ + "billing_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ], + "shipping_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ] + ]); + + echo 'Customer details have been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php new file mode 100644 index 00000000000..b50574487f1 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php @@ -0,0 +1,63 @@ +updateMerchantReferences([ + "merchant_reference1" => "15632423", + "merchant_reference2" => "special order" + ]); + + echo 'Merchant references have been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php new file mode 100644 index 00000000000..561ac15d817 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php @@ -0,0 +1,75 @@ +updateAuthorization([ + "order_amount" => 6000, + "description" => "Removed bad bananas", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ] + ] + ]); + + echo 'New order amount and order lines have been set'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php new file mode 100644 index 00000000000..e5673834184 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php @@ -0,0 +1,58 @@ +fetchRefund($refundId); + + print_r($capture->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php new file mode 100644 index 00000000000..63e72cb571c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php @@ -0,0 +1,76 @@ +refund([ + "refunded_amount" => 3000, + "description" => "Refunding half the tomatoes", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 5, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 3000, + "total_tax_amount" => 600 + ] + ] + ]); + + $refund->fetch(); + print_r($refund->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php new file mode 100644 index 00000000000..ee0477a1d6d --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php @@ -0,0 +1,57 @@ +cancelAuthorization(); + + echo 'Authorization has been cancelled'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php new file mode 100644 index 00000000000..f742d5976c5 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php @@ -0,0 +1,106 @@ + "John", + "family_name" => "Doe", + "email" => "johndoe@example.com", + "title" => "Mr", + "street_address" => "13 New Burlington St", + "street_address2" => "Apt 214", + "postal_code" => "W13 3BG", + "city" => "London", + "region" => "", + "phone" => "01895808221", + "country" => "GB" +]; + +$data = [ + "billing_address" => $address, + "shipping_address" => $address, + "purchase_country" => "GB", + "purchase_currency" => "GBP", + "locale" => "en-GB", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); + $data = $order->create($data); + + print_r($data); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php new file mode 100644 index 00000000000..db15da2bf1c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php @@ -0,0 +1,82 @@ + "GB", + "purchase_currency" => "GBP", + "locale" => "en-GB", + "billing_address" => [ + "given_name" => "John", + "family_name" => "Doe", + "email" => "johndoe@example.com", + "title" => "Mr", + "street_address" => "13 New Burlington St", + "street_address2" => "Apt 214", + "postal_code" => "W13 3BG", + "city" => "London", + "region" => "", + "phone" => "01895808221", + "country" => "GB" + ], + "customer" => [ // MUST MATCH line by line to the customer details that was used to get an Authorization Token + "date_of_birth" => "1970-01-01", + "gender" => "male", + ], + "description" => "For testing purposes", + "intended_use" => "SUBSCRIPTION" +]; + +try { + $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); + $token = $order->generateToken($data); + + print_r($token); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php new file mode 100644 index 00000000000..216b32cd5c9 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php @@ -0,0 +1,96 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $session = new Klarna\Rest\Payments\Sessions($connector); + $session->create($order); + + // Store session id + $sessionId = $session->getId(); + + // Get some data if needed + echo <<getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php new file mode 100644 index 00000000000..bbb87c9635d --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php @@ -0,0 +1,57 @@ +fetch(); + + print_r($session->getArrayCopy()); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php new file mode 100644 index 00000000000..5be79859d9f --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php @@ -0,0 +1,79 @@ + "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 4000, + "order_tax_amount" => 800, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "543670", + "name" => "New updated bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ] +]; + +try { + $session = new Klarna\Rest\Payments\Sessions($connector, $sessionId); + $session->update($order); + + echo 'Order has been updated'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php new file mode 100644 index 00000000000..b6dfffb3945 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php @@ -0,0 +1,61 @@ +getAllPayouts([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT), + 'size' => 10, + ]); + + print_r($payouts); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php new file mode 100644 index 00000000000..80e43521c26 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php @@ -0,0 +1,57 @@ +getPayout($paymentReference); + + print_r($payout); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php new file mode 100644 index 00000000000..35d08e5a704 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php @@ -0,0 +1,61 @@ +getSummary([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT) + ]); + + print_r($summary); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php new file mode 100644 index 00000000000..1a7853c3541 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php @@ -0,0 +1,58 @@ +getCSVPayoutReport($paymentReference); + + file_put_contents('report.csv', $report); + echo 'Saved to report.csv'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php new file mode 100644 index 00000000000..6666b77cc5b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php @@ -0,0 +1,58 @@ +getPDFPayoutReport($paymentReference); + + file_put_contents('report.pdf', $report); + echo 'Saved to report.pdf'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php new file mode 100644 index 00000000000..0f68fdbccf6 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php @@ -0,0 +1,62 @@ +getCSVPayoutsSummaryReport([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT) + ]); + + file_put_contents('summary_report.csv', $report); + echo 'Saved to summary_report.csv'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php new file mode 100644 index 00000000000..2d67e710daa --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php @@ -0,0 +1,62 @@ +getPDFPayoutsSummaryReport([ + 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), + 'end_date' => (new DateTime())->format(DATE_FORMAT) + ]); + + file_put_contents('summary_report.pdf', $report); + echo 'Saved to summary_report.pdf'; +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php new file mode 100644 index 00000000000..36db249f4e0 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php @@ -0,0 +1,61 @@ + 10, // How many elements to include in the result + 'offset' => 0, // The current offset. Describes "where" in a collection the current starts + ]; + $data = $transactions->getTransactions($params); + + print_r($data); +} catch (Exception $e) { + echo 'Caught exception: ' . $e->getMessage() . "\n"; +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md b/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md new file mode 100644 index 00000000000..cac0461a18e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md @@ -0,0 +1,79 @@ +How to use SDK HTTP Transport +======================================================== + +The SDK functionality relies on an "HTTP Transport" mechanism to handle HTTP communication +(requests / responses). The mechanism is decoupled from the SDK implementation itself +and allows for usage of different libraries that can handle the HTTP communication. + +All the transports should be responsible to get the information to be send and return the result. +There is no any SDK/Api Resources logic inside the transport. + +Previously the SDK used Guzzle HTTP library and it forces SDK users to use Composer. There was no +ability to install the Guzzle library manually. Currently, there is a new cURL Transport, that +allows to use the PHP SDK without Composer and any other extra dependencies. + +## Basic Transport Usage + +The basic SDK usage looks like in the example. You need to create an HTTP Transport connector +and pass the connector to the API Service resource: + +```php +$connector = Klarna\Rest\Transport\Connector::create($merchantId, $sharedSecret, $apiEndpoint); +$api = new Klarna\Rest\ApiService\Resource($connector); +$api->someMethod($someData); +``` + +## Guzzle HTTP Transport (Klarna\Rest\Transport\GuzzleConnector) + +By default all the SDK examples use Guzzle HTTP Transport (Composer is required in this case). +You need to include the SDK into your PHP file using the Composer autoloader: + +```php +require('/path/to/project/vendor/autoload.php'); + +$merchantId = 'K123456_abcd12345'; +$sharedSecret = 'sharedSecret'; +$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; + +// Create Guzzle HTTP Transport Connector +$connector = Klarna\Rest\Transport\GuzzleConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint +); + +$checkout = new Klarna\Rest\Checkout\Order($connector); +$checkout->create($order); +``` + +## cURL HTTP Transport (Klarna\Rest\Transport\CURLConnector) + +The transport uses PHP cURL Library (libcurl): https://www.php.net/manual/en/book.curl.php + +This library does not require any Composer libraries and relies only on `libcurl`. It means you +do not have any `vendor` autoloader and need to include the SDK SPL autoloader. + +```php +// `src` instead of vendor +require('/path/to/project/src/autoload.php'); + +$merchantId = 'K123456_abcd12345'; +$sharedSecret = 'sharedSecret'; +$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; + +// Create cURL HTTP Transport Connector +$connector = Klarna\Rest\Transport\CURLConnector::create( + $merchantId, + $sharedSecret, + $apiEndpoint +); + +$checkout = new Klarna\Rest\Checkout\Order($connector); +$checkout->create($order); +``` + +## HTTP Transport Response and Exceptions + +All the Transports should implement the `ConnectorInterface` interface. It imposes some restrictions: +- The only allowed response is [ApiResponse](https://github.com/klarna/kco_rest_php/blob/v4.1/src/Klarna/Rest/Transport/ApiResponse.php) +- The only allowed exceptions that can be thrown from the Transport is `RuntimeException`. diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php new file mode 100644 index 00000000000..1cbc8991d58 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php @@ -0,0 +1,27 @@ +setLocation(self::$path . "/{$orderId}"); + $this[static::ID_FIELD] = $orderId; + } + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json'); + + $this->exchangeArray($response->getJson()); + $this->setLocation($response->getLocation()); + + return $this; + } + + /** + * Updates the resource. + * + * @param array $data Update data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function update(array $data) + { + $response = $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + $this->exchangeArray($response); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php new file mode 100644 index 00000000000..e6c1c56da10 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php @@ -0,0 +1,116 @@ +setLocation(self::$path . "/{$customerToken}"); + $this[static::ID_FIELD] = $customerToken; + } + + /** + * Creates order using Customer Token. + * + * @param array $data Order data + * @param string $klarnaIdempotencyKey Idempotency Key + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array created order data + */ + public function createOrder(array $data, $klarnaIdempotencyKey = null) + { + $headers = ['Content-Type' => 'application/json']; + if (!is_null($klarnaIdempotencyKey)) { + $headers['Klarna-Idempotency-Key'] = $klarnaIdempotencyKey; + } + + return $this->request( + 'POST', + $this->getLocation() . '/order', + $headers, + $data !== null ? \json_encode($data) : null + ) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Update the status of a customer token. + * + * @param array $data Customer token data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateTokenStatus(array $data) + { + $this->patch($this->getLocation() . '/status', $data) + ->expectSuccessfull() + ->status('202'); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php new file mode 100644 index 00000000000..b7f757daf4b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php @@ -0,0 +1,145 @@ +setLocation(self::$path . "/{$sessionId}"); + $this[static::ID_FIELD] = $sessionId; + } + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-create-a-new-hpp-session + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Session data + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json') + ->getJson(); + + return $response; + } + + /** + * Disables HPP session. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-disable-hpp-session + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If sessionId was not specified when creating a resource + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function disable() + { + if (empty($this[static::ID_FIELD])) { + throw new \RuntimeException('HPP Session ID is not defined'); + } + + $this->delete($this->getLocation()) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Distributes link to the HPP session. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session + * + * @param array $data Distribute data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function distributeLink(array $data) + { + $this->post($this->getLocation() . '/distribution', $data) + ->expectSuccessfull() + ->status(['200', '201']); + + return $this; + } + + /** + * @deprecated HPP API no longer suppors getting the status. Use fetch (getSession) to fetch data; + * @deprecated This method will be removed in the future versions of SDK. + */ + public function getSessionStatus() + { + return $this->fetch(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php new file mode 100644 index 00000000000..352616d1d34 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php @@ -0,0 +1,137 @@ +setLocation(self::$path . "/{$buttonKey}"); + $this[static::ID_FIELD] = $buttonKey; + } + } + + /** + * Creates a button key based on setup options. + * + * @param array $data Creation data + * + * @see https://developers.klarna.com/api/#instant-shopping-api-create-a-button-key-based-on-setup-options + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Button properties + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json'); + + $url = $response->getLocation(); + $this->setLocation($url); + + return $response->getJson(); + } + + /** + * Updates the setup options for a specific button key. + * + * @param array $data Update data + * + * @see https://developers.klarna.com/api/#instant-shopping-api-update-the-setup-options-for-a-specific-button-key + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \RuntimeException If key was not specified when creating a resource + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Button properties + */ + public function update(array $data) + { + if (empty($this[static::ID_FIELD])) { + throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); + } + + return $this->put($this->getLocation(), $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * See the setup options for a specific button key. + * + * @see https://developers.klarna.com/api/#instant-shopping-api-see-the-setup-options-for-a-specific-button-key + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If key was not specified when creating a resource + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function retrieve() + { + if (empty($this[static::ID_FIELD])) { + throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); + } + + return $this->fetch(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php new file mode 100644 index 00000000000..0522f2d97eb --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php @@ -0,0 +1,128 @@ +setLocation(self::$path . "/{$authorizationToken}"); + $this[static::ID_FIELD] = $authorizationToken; + } + + /** + * Retrieves an authorized order based on the authorization token. + * + * @codingStandardsIgnoreStart + * @see https://developers.klarna.com/api/#instant-shopping-api-retrieves-an-authorized-order-based-on-the-authorization-token + * @codingStandardsIgnoreEnd + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function retrieve() + { + return $this->fetch(); + } + + /** + * Declines an authorized order identified by the authorization token. + * + * @codingStandardsIgnoreStart + * @see https://developers.klarna.com/api/#instant-shopping-api-declines-an-authorized-order-identified-by-the-authorization-token + * @codingStandardsIgnoreEnd + * + * @param array $data Decline data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function decline(array $data = null) + { + $this->delete($this->getLocation(), $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Approves the authorized order and places an order identified by the authorization token. + * + * @codingStandardsIgnoreStart + * @see https://developers.klarna.com/api/#instant-shopping-api-approve-the-authorized-order-and-place-an-order-identified-by-the-authorization-token + * @codingStandardsIgnoreEnd + * + * @param array $data Order data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array approving status + */ + public function approve(array $data) + { + return $this->post($this->getLocation() . '/orders', $data) + ->expectSuccessfull() + ->status('200') + ->getJson(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php new file mode 100644 index 00000000000..a2cae563914 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php @@ -0,0 +1,151 @@ +post(self::$path, $data) + ->expectSuccessfull() + ->status('201') + ->contentType('application/json') + ->getJson(); + + return $response; + } + + /** + * Retrieve an existing settlement. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session + * + * @param array $data Distribute data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Settlement data + */ + public function retrieveSettlement($settlementId, $keyId) + { + $response = $this->request( + 'GET', + self::$path . "/$settlementId", + ['KeyId' => $keyId] + ) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + return $response; + } + + /** + * Retrieves a settled order's settlement. + * + * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session + * + * @param array $data Distribute data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Order's settlement data + */ + public function retrieveOrderSettlement($orderId, $keyId) + { + $response = $this->request( + 'GET', + self::$path . "/order/$orderId", + ['KeyId' => $keyId] + ) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + return $response; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php new file mode 100644 index 00000000000..05a7ae0e648 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php @@ -0,0 +1,152 @@ +setLocation($url); + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $url = $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('201') + ->getLocation(); + + $this->setLocation($url); + + return $this; + } + + /** + * Appends shipping information to the capture. + * + * @param array $data Shipping info data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function addShippingInfo(array $data) + { + $this->post($this->getLocation() . '/shipping-info', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Updates the customers details. + * + * @param array $data Customer details data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateCustomerDetails(array $data) + { + $this->patch($this->getLocation() . '/customer-details', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Trigger send outs for this capture. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function triggerSendout() + { + $this->post($this->getLocation() . '/trigger-send-out') + ->expectSuccessfull() + ->status('204'); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php new file mode 100644 index 00000000000..c41804facac --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php @@ -0,0 +1,407 @@ +setLocation(self::$path . "/{$orderId}"); + $this[static::ID_FIELD] = $orderId; + } + + /** + * Fetches the order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function fetch() + { + parent::fetch(); + + // Convert captures data to Capture[] + + $captures = []; + foreach ($this['captures'] as $capture) { + $captureId = $capture[Capture::ID_FIELD]; + + $object = new Capture( + $this->connector, + $this->getLocation(), + $captureId + ); + $object->exchangeArray($capture); + + $captures[] = $object; + } + + $this['captures'] = $captures; + + + // Convert refunds data to Refund[] + if (isset($this['refunds'])) { + $refunds = []; + foreach ($this['refunds'] as $refund) { + $refundId = null; + if (isset($refund[Refund::ID_FIELD])) { + $refundId = $refund[Refund::ID_FIELD]; + } + + $object = new Refund( + $this->connector, + $this->getLocation(), + $refundId + ); + $object->exchangeArray($refund); + + $refunds[] = $object; + } + $this['refunds'] = $refunds; + } + + return $this; + } + + /** + * Acknowledges the order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function acknowledge() + { + $this->post($this->getLocation() . '/acknowledge') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Cancels this order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function cancel() + { + $this->post($this->getLocation() . '/cancel') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Updates the authorization data. Sets new order amount and order lines + * + * @param array $data Authorization data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateAuthorization(array $data) + { + $this->patch($this->getLocation() . '/authorization', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Extends the authorization time. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function extendAuthorizationTime() + { + $this->post($this->getLocation() . '/extend-authorization-time') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Update the merchant references. + * + * @param array $data Merchant references + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateMerchantReferences(array $data) + { + $this->patch($this->getLocation() . '/merchant-references', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Updates the customer details. + * + * @param array $data Customer data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function updateCustomerDetails(array $data) + { + $this->patch($this->getLocation() . '/customer-details', $data) + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Refunds an amount of a captured order. + * + * @param array $data Refund data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Refund + */ + public function refund(array $data) + { + $refund = new Refund($this->connector, $this->getLocation()); + $refund->create($data); + + return $refund; + } + + /** + * Release the remaining authorization for an order. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function releaseRemainingAuthorization() + { + $this->post($this->getLocation() . '/release-remaining-authorization') + ->expectSuccessfull() + ->status('204'); + + return $this; + } + + /** + * Capture all or part of an order. + * + * @param array $data Capture data + * + * @see Capture::create() For more information on how to create a capture + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Capture + */ + public function createCapture(array $data) + { + $capture = new Capture($this->connector, $this->getLocation()); + + $capture->create($data); + + $this['captures'][] = $capture; + + return $capture; + } + + /** + * Fetches the specified capture. + * + * @param string $captureId Capture ID + * + * @see Capture::fetch() For more information on how to fetch a capture + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Capture + */ + public function fetchCapture($captureId) + { + if ($this->offsetExists('captures')) { + foreach ($this['captures'] as $capture) { + if ($capture->getId() !== $captureId) { + continue; + } + + return $capture->fetch(); + } + } + + $capture = new Capture($this->connector, $this->getLocation(), $captureId); + $capture->fetch(); + + $this['captures'][] = $capture; + + return $capture; + } + + /** + * Fetches the specified refund. + * + * @param string $refundId Refund ID + * + * @see Refund::fetch() For more information on how to fetch a refund + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Refund + */ + public function fetchRefund($refundId) + { + if ($this->offsetExists('refunds')) { + foreach ($this['refunds'] as $refund) { + if ($refund->getId() !== $refundId) { + continue; + } + + return $refund; + } + } + + $refund = new Refund($this->connector, $this->getLocation(), $refundId); + $refund->fetch(); + + $this['refunds'][] = $refund; + + return $refund; + } + + /** + * Fetches all captures. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return Capture[] + */ + public function fetchCaptures() + { + $captures = new Capture($this->connector, $this->getLocation()); + $captures = $captures->fetch()->getArrayCopy(); + + foreach ($captures as $id => $capture) { + $captures[$id] = new Capture($this->connector, $this->getLocation(), $capture['capture_id']); + $captures[$id]->exchangeArray($capture); + } + return $captures; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php new file mode 100644 index 00000000000..ab6045220ca --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php @@ -0,0 +1,89 @@ +setLocation($url); + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $url = $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('201') + ->getLocation(); + + $this->setLocation($url); + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php new file mode 100644 index 00000000000..da538388b11 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php @@ -0,0 +1,141 @@ +setLocation(self::$path . "/{$authorizationToken}"); + $this[static::ID_FIELD] = $authorizationToken; + } + + /** + * Not applicable. + * + * @throws NotApplicableException + */ + public function fetch() + { + throw new NotApplicableException('Not applicable'); + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Order data + */ + public function create(array $data) + { + return $this->post($this->getLocation() . '/order', $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Cancels the authorization. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function cancelAuthorization() + { + $this->delete($this->getLocation()) + ->expectSuccessfull() + ->status('204'); + // ->contentType('application/json'); + // TODO: We cannot check the Content-type here because of an inconsistency + // between service and documentation. The real Content-Type is + // "application/octet-stream but not the "application/json" as in the docs. + + return $this; + } + + /** + * Generates consumer token. + * + * @param array $data Token data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Token data + */ + public function generateToken(array $data) + { + $response = $this->post($this->getLocation() . '/customer-token', $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + return $response; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php new file mode 100644 index 00000000000..3923b8e2b55 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php @@ -0,0 +1,117 @@ +setLocation(self::$path . "/{$sessionId}"); + $this[static::ID_FIELD] = $sessionId; + } + } + + /** + * Creates the resource. + * + * @param array $data Creation data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException If the location header is missing + * @throws \RuntimeException If the API replies with an unexpected response + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function create(array $data) + { + $response = $this->post(self::$path, $data) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json'); + + $this->exchangeArray($response->getJson()); + + // Payments API does not send Location header after creating a new session. + // Use workaround to set new location. + $this->setLocation(self::$path . '/' . $this->getId()); + + return $this; + } + + /** + * Updates the resource. + * + * @param array $data Update data + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function update(array $data) + { + $this->post($this->getLocation(), $data) + ->expectSuccessfull() + ->status('204'); + // ->contentType('application/json'); + // TODO: We cannot check the Content-type here because of an inconsistency + // between service and documentation. The real Content-Type is + // "application/octet-stream but not the "application/json" as in the docs. + + return $this; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php new file mode 100644 index 00000000000..35a78c2e00e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php @@ -0,0 +1,332 @@ +connector = $connector; + } + + /** + * Gets the resource id. + * + * @return string|null + */ + public function getId() + { + return isset($this[static::ID_FIELD]) ? $this[static::ID_FIELD] : null; + } + + /** + * Gets the resource location. + * + * @return string|null + */ + public function getLocation() + { + return $this->url; + } + + /** + * Sets the resource location. + * + * @param string $url Url to the resource + * + * @return self + */ + public function setLocation($url) + { + $this->url = $url; + + return $this; + } + + /** + * Overrides: Stores the ID KEY field in order to restore it after exchanging the array without + * the ID field. + * + * @param array $array Data to be exchanged + */ + public function exchangeArray($array) + { + $id = $this->getId(); + + if (!is_null($array)) { + parent::exchangeArray($array); + } + if (is_null($this->getId()) && !is_null($id)) { + $this->setId($id); + } + } + + /** + * Fetches the resource. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return self + */ + public function fetch() + { + $data = $this->get($this->getLocation()) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + + $this->exchangeArray($data); + + return $this; + } + + /** + * Sets new ID KEY field. + * + * @param mixed $id ID field + * + * @return self + */ + protected function setId($id) + { + $this[static::ID_FIELD] = $id; + return $this; + } + + /** + * Sends a HTTP request to the specified url. + * + * @param string $method HTTP method, e.g. 'GET' + * @param string $url Request destination + * @param array $headers + * @param string $body + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response' + * @return ResponseValidator When the API replies with an error response + * + */ + protected function request($method, $url, array $headers = [], $body = null) + { + $debug = getenv('DEBUG_SDK') || defined('DEBUG_SDK'); + + if ($debug) { + $methodDebug = str_pad($method, 7, ' ', STR_PAD_LEFT); + $debugHeaders = json_encode($headers); + echo <<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +{$methodDebug} : {$url} +Headers : $debugHeaders + Body : {$body} +\n +DEBUG_BODY; + } + + switch ($method) { + case Method::GET: + $response = $this->connector->get($url, $headers); + break; + case Method::POST: + $response = $this->connector->post($url, $body, $headers); + break; + case Method::PUT: + $response = $this->connector->put($url, $body, $headers); + break; + case Method::DELETE: + $response = $this->connector->delete($url, $body, $headers); + break; + case Method::PATCH: + $response = $this->connector->patch($url, $body, $headers); + break; + default: + throw new \RuntimeException('Unknown request method ' + $method); + } + + if ($debug) { + $debugHeaders = json_encode($response->getHeaders()); + echo <<getBody()} +\n +DEBUG_BODY; + } + + $location = $response->getLocation(); + if (!empty($location)) { + $this->setLocation($location); + } + + return new ResponseValidator($response); + } + + /** + * Sends a HTTP GET request to the specified url. + * + * @param string $url Request destination + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function get($url) + { + return $this->request('GET', $url); + } + + /** + * Sends a HTTP DELETE request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function delete($url, array $data = null) + { + return $this->request( + 'DELETE', + $url, + ['Content-Type' => 'application/json'], + $data !== null ? json_encode($data) : null + ); + } + + /** + * Sends a HTTP PATCH request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function patch($url, array $data) + { + return $this->request( + 'PATCH', + $url, + ['Content-Type' => 'application/json'], + json_encode($data) + ); + } + + /** + * Sends a HTTP PUT request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function put($url, array $data) + { + return $this->request( + 'PUT', + $url, + ['Content-Type' => 'application/json'], + json_encode($data) + ); + } + + /** + * Sends a HTTP POST request to the specified url. + * + * @param string $url Request destination + * @param array $data Data to be JSON encoded + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When Guzzle cannot populate the response + * + * @return ResponseValidator + */ + protected function post($url, array $data = null) + { + return $this->request( + 'POST', + $url, + ['Content-Type' => 'application/json'], + $data !== null ? \json_encode($data) : null + ); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php new file mode 100644 index 00000000000..bab484fb28f --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php @@ -0,0 +1,139 @@ +get(self::$path . "/{$paymentReference}") + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Returns a collection of payouts. + * + * @param array $params Additional query params to filter payouts. + * + * @see https://developers.klarna.com/api/#settlements-api-get-all-payouts + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array Payouts data + */ + public function getAllPayouts(array $params = []) + { + return $this->get(self::$path . '?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } + + /** + * Returns a summary of payouts for each currency code in a date range. + * + * @param array $params Additional query params to filter summary data. + * + * @see https://developers.klarna.com/api/#settlements-api-get-summary-of-payouts + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return array summary of payouts + */ + public function getSummary(array $params = []) + { + return $this->get(self::$path . '/summary?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php new file mode 100644 index 00000000000..f5f01f7f96d --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php @@ -0,0 +1,156 @@ +get(self::$path . "/payout-with-transactions?payment_reference={$paymentReference}") + ->expectSuccessfull() + ->status('200') + ->contentType('text/csv') + ->getBody(); + } + + /** + * Returns a single settlement summed up in pdf format. + * + * @param string $paymentReference The reference id of the payout. + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return string Binary PDF representation of Payout report + */ + public function getPDFPayoutReport($paymentReference) + { + return $this->get(self::$path . "/payout?payment_reference={$paymentReference}") + ->expectSuccessfull() + ->status('200') + ->contentType('application/pdf') + ->getBody(); + } + + /** + * Returns CSV summary. + * + * @param array $params Additional query params to filter payouts. + * + * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return string CSV Summary report + */ + public function getCSVPayoutsSummaryReport(array $params = []) + { + return $this->get(self::$path . '/payouts-summary-with-transactions?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('text/csv') + ->getBody(); + } + + /** + * Returns PDF summary. + * + * @param array $params Additional query params to filter payouts. + * + * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions + * + * @throws ConnectorException When the API replies with an error response + * @throws RequestException When an error is encountered + * @throws \RuntimeException On an unexpected API response + * @throws \RuntimeException If the response content type is not JSON + * @throws \InvalidArgumentException If the JSON cannot be parsed + * @throws \LogicException When Guzzle cannot populate the response + * + * @return string PDF Summary report + */ + public function getPDFPayoutsSummaryReport(array $params = []) + { + return $this->get(self::$path . '/payouts-summary?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/pdf') + ->getBody(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php new file mode 100644 index 00000000000..6265d08d619 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php @@ -0,0 +1,84 @@ +get(self::$path . '?' . http_build_query($params)) + ->expectSuccessfull() + ->status('200') + ->contentType('application/json') + ->getJson(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php new file mode 100644 index 00000000000..22964cbb7c8 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php @@ -0,0 +1,148 @@ +setStatus($status); + $this->setBody($body); + $this->setHeaders($headers); + } + /** + * Sets HTTP Status code. + * + * @param status HTTP status + * @return self + */ + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + /** + * Gets HTTP Status code. + * + * @return Status code + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets binary body payload. + * + * @param body Payout + * @return self + */ + public function setBody($body) + { + $this->body = $body; + return $this; + } + + /** + * Gets binary body payload. + * + * @return Payout + */ + public function getBody() + { + return $this->body; + } + + /** + * Sets HTTP headers map + * + * @param headers Headers + * @return self + */ + public function setHeaders($headers) + { + $this->headers = $headers; + return $this; + } + + /** + * Sets single HTTP header value. + * + * @param name Header name + * @param values Header values + * @return self + */ + public function setHeader($name, $values) + { + $this->headers[$name] = $values; + return $this; + } + + /** + * Gets HTTP Headers map + * + * @return Headers + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Gets single header value + * + * @param name Header name + * @return Header values + */ + public function getHeader($name) + { + return isset($this->headers[$name]) ? $this->headers[$name] : null; + } + + /** + * Gets the Location header helper. + * + * @return string Location if exists, null otherwise + */ + public function getLocation() + { + return empty($this->headers['Location']) ? null : $this->headers['Location'][0]; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php new file mode 100644 index 00000000000..439a9b794f9 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php @@ -0,0 +1,303 @@ +merchantId = $merchantId; + $this->sharedSecret = $sharedSecret; + $this->baseUrl = rtrim($baseUrl, '/'); + + if ($userAgent === null) { + $userAgent = UserAgent::createDefault(['CURLConnector/' . curl_version()['version']]); + } + $this->userAgent = $userAgent; + } + + /** + * Sets CURL request options. + * + * @param options CURL options + * + * @return self instance + */ + public function setOptions($options) + { + $this->options = $options; + return $this; + } + + /** + * Sends HTTP GET request to specified path. + * + * @param string $path URL path. + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function get($path, $headers = []) + { + return $this->request(Method::GET, $path, $headers); + } + + /** + * Sends HTTP POST request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function post($path, $data = null, $headers = []) + { + return $this->request(Method::POST, $path, $headers, $data); + } + + /** + * Sends HTTP PUT request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function put($path, $data = null, $headers = []) + { + return $this->request(Method::PUT, $path, $headers, $data); + } + + /** + * Sends HTTP PATCH request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function patch($path, $data = null, $headers = []) + { + return $this->request(Method::PATCH, $path, $headers, $data); + } + + /** + * Sends HTTP DELETE request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function delete($path, $data = null, $headers = []) + { + return $this->request(Method::DELETE, $path, $headers, $data); + } + + /** + * Performs HTTP(S) request. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + protected function request($method, $url, array $headers = [], $data = null) + { + $headers = array_merge([ + 'User-Agent' => (string) $this->userAgent, + ], $headers); + + if (isset($this->options['headers'])) { + $headers = array_merge($headers, $this->options['headers']); + } + array_walk($headers, function (&$v, $k) { + $v = $k . ': ' . $v; + }); + + $ch = curl_init(); + + if (!empty($this->merchantId)) { + curl_setopt($ch, CURLOPT_USERPWD, $this->merchantId . ':' . $this->sharedSecret); + } + if (!empty($this->options['ssl_cert'])) { + curl_setopt($ch, CURLOPT_SSLCERT, $this->options['ssl_cert']); + if (!empty($this->options['ssl_key'])) { + curl_setopt($ch, CURLOPT_SSLKEY, $this->options['ssl_key']); + } + } + + if (!empty($this->options['timeout'])) { + curl_setopt($ch, CURLOPT_TIMEOUT, $this->options['timeout']); + } + + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + + if ($method == Method::GET) { + curl_setopt($ch, CURLOPT_HTTPGET, 1); + } elseif ($method == Method::POST) { + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + } else { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + } + + curl_setopt($ch, CURLOPT_URL, $this->baseUrl . $url); + curl_setopt($ch, CURLOPT_HEADER, 1); + + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + if ($proxy = getenv('HTTP_PROXY')) { + $proxy = parse_url($proxy); + + $proxyHost = $proxy['host']; + $proxyPort = $proxy['port'] ? ':' . $proxy['post'] : ''; + curl_setopt($ch, CURLOPT_PROXY, $proxyHost . $proxyPort); + if (!empty($proxy['user'])) { + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy['user'] . ':' . $proxy['pass']); + } + } + + $response = curl_exec($ch); + + $errno = curl_errno($ch); + $error = curl_error($ch); + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + + curl_close($ch); + + // Check the TCP transport issues + if (!empty($errno)) { + throw new \RuntimeException($error, $errno); + } + + $rawHeaders = substr($response, 0, $header_size); + $body = substr($response, $header_size); + $headers = self::parseHeaders($rawHeaders); + + return new ApiResponse($http_code, $body, $headers); + } + + /** + * Factory method to create a connector instance. + * + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param string $baseUrl Base URL for HTTP requests + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + * + * @return self + */ + public static function create( + $merchantId, + $sharedSecret, + $baseUrl = self::EU_BASE_URL, + UserAgentInterface $userAgent = null + ) { + return new static($merchantId, $sharedSecret, $baseUrl, $userAgent); + } + + + /** + * Converts raw curl headers response to array. + * + * @param string $rawHeaders Headers part from the curl response + * + * @return array list of HTTP headers + */ + protected static function parseHeaders($rawHeaders) + { + $headers = []; + foreach (explode("\r\n", $rawHeaders) as $i => $line) { + if (strlen($line) == 0) { + continue; + } + + if (strpos($line, 'HTTP/') !== false) { + // The line contains the HTTP response information + $headers['Http'] = $line; + continue; + } + list($key, $value) = explode(': ', $line); + $headers[ucwords($key, '-_')][] = $value; + } + return $headers; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php new file mode 100644 index 00000000000..602887d7f4f --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php @@ -0,0 +1,30 @@ +errorCode = $data['error_code']; + $this->messages = $data['error_messages']; + $this->correlationId = $data['correlation_id']; + $this->serviceVersion = $serviceVersion; + } + + /** + * Gets the API error code for this exception. + * + * @return string + */ + public function getErrorCode() + { + return $this->errorCode; + } + + /** + * Gets the API error messages for this exception. + * + * @return array + */ + public function getMessages() + { + return $this->messages; + } + + /** + * Gets the API correlation ID for this exception. + * + * @return string + */ + public function getCorrelationId() + { + return $this->correlationId; + } + + /** + * Gets the API Service version for this exception. + * + * @return string + */ + public function getServiceVersion() + { + return $this->serviceVersion; + } + + /** + * @deprecated Function is not longer used. Will always return null + * Gets the HTTP response for this API error. + * + * @return null + */ + public function getResponse() + { + return null; + } + + private static function setDefaultData($data) + { + $defaults = [ + 'error_code' => 'UNDEFINED', + 'error_messages' => [], + 'correlation_id' => 'UNDEFINED', + ]; + + foreach ($defaults as $field => $default) { + if (!isset($data[$field])) { + $data[$field] = $default; + } + } + + // We need to have a special check for error_message and merge the message to error_messages + if (isset($data['error_message'])) { + array_push($data['error_messages'], $data['error_message']); + } + + return $data; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php new file mode 100644 index 00000000000..6c04adb3db0 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php @@ -0,0 +1,280 @@ + 'https://api.klarna.com']); + * $connector = new \Klarna\Transport\Connector($client, '0', 'sharedSecret'); + * + * + * @param ClientInterface $client HTTP transport client + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + */ + public function __construct( + ClientInterface $client, + $merchantId, + $sharedSecret, + UserAgentInterface $userAgent = null + ) { + $this->client = $client; + $this->merchantId = $merchantId; + $this->sharedSecret = $sharedSecret; + + if ($userAgent === null) { + $userAgent = UserAgent::createDefault(['Guzzle/' . ClientInterface::VERSION]); + } + $this->userAgent = $userAgent; + } + + /** + * Sends HTTP GET request to specified path. + * + * @param string $path URL path. + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function get($path, $headers = []) + { + $request = $this->createRequest($path, Method::GET, $headers); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP POST request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function post($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::POST, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP PUT request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function put($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::PUT, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP PATCH request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function patch($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::PATCH, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Sends HTTP DELETE request to specified path. + * + * @param string $path URL path. + * @param string $data Data to be sent to API server in a payload. Example: json-encoded string + * @param array $headers HTTP request headers + * @return ApiResponse Processed response + * + * @throws RuntimeException if HTTP transport failed to execute a call + */ + public function delete($path, $data = null, $headers = []) + { + $request = $this->createRequest($path, Method::DELETE, $headers, $data); + $response = $this->send($request); + return $this->getApiResponse($response); + } + + /** + * Converts ResponseInterface to ApiResponse. + * + * @param response ResponseInterface intance + * @return ApiResponse + */ + protected function getApiResponse(ResponseInterface $response) + { + return new ApiResponse( + $response->getStatusCode(), + $response->getBody()->getContents(), + $response->getHeaders() + ); + } + + /** + * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. + * Creates a request object. + * + * @param string $url URL + * @param string $method HTTP method + * + * @return RequestInterface + */ + public function createRequest($url, $method = 'GET', array $headers = [], $body = null) + { + $headers = array_merge($headers, ['User-Agent' => strval($this->userAgent)]); + return new Request($method, $url, $headers, $body); + } + + /** + * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. + * Sends the request. + * + * @param RequestInterface $request Request to send + * @param string[] $options Request options + * + * @throws RequestException When an error is encountered + * @throws \RuntimeException When the adapter does not populate a response + * + * @return ResponseInterface + */ + public function send(RequestInterface $request, array $options = []) + { + $requestOptions = $this->client->getConfig('request'); + if (is_array($requestOptions)) { + $options = array_merge($requestOptions, $options); + } + $options['auth'] = [$this->merchantId, $this->sharedSecret, 'basic']; + $options['http_errors'] = false; + + try { + $response = $this->client->send($request, $options); + return $response; + } catch (RequestException $e) { + throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); + } catch (\Throwable $e) { + throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Gets the HTTP transport client. + * + * @return ClientInterface + */ + public function getClient() + { + return $this->client; + } + + /** + * Gets the user agent. + * + * @return UserAgentInterface + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Factory method to create a connector instance. + * + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param string $baseUrl Base URL for HTTP requests + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + * + * @return self + */ + public static function create( + $merchantId, + $sharedSecret, + $baseUrl = self::EU_BASE_URL, + UserAgentInterface $userAgent = null + ) { + $client = new Client(['base_uri' => $baseUrl]); + + return new static($client, $merchantId, $sharedSecret, $userAgent); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php new file mode 100644 index 00000000000..f2a068e7a71 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php @@ -0,0 +1,29 @@ +response = $response; + } + + /** + * Gets the response object. + * + * @return ApiResponse + */ + public function getResponse() + { + return $this->response; + } + + /** + * Asserts the HTTP response status code. + * + * @param string|string[] $status Expected status code(s) + * + * @throws \RuntimeException If status code does not match + * + * @return self + */ + public function status($status) + { + $httpStatus = (string) $this->response->getStatus(); + if (is_array($status) && !in_array($httpStatus, $status)) { + throw new \RuntimeException( + "Unexpected response status code: {$httpStatus}" + ); + } + + if (is_string($status) && $httpStatus !== $status) { + throw new \RuntimeException( + "Unexpected response status code: {$httpStatus}" + ); + } + + return $this; + } + + /** + * Asserts the Content-Type header. Checks partial matching. + * Validation PASSES in the following cases: + * Content-Type: application/json + * $mediaType = 'application/json' + * + * Content-Type: application/json; charset=utf-8 + * $mediaType = 'application/json' + * + * Validation FAILS in the following cases: + * Content-Type: plain/text + * $mediaType = 'application/json' + * + * Content-Type: application/json; charset=utf-8 + * $mediaType = 'application/json; charset=cp-1251' + * + * @param string $mediaType Expected media type. RegExp rules can be used. + * + * @throws \RuntimeException If Content-Type header is missing + * @throws \RuntimeException If Content-Type header does not match + * + * @return self + */ + public function contentType($mediaType) + { + $contentType = $this->response->getHeader('Content-Type'); + if (empty($contentType)) { + throw new \RuntimeException('Response is missing a Content-Type header'); + } + $mediaFound = false; + foreach ($contentType as $type) { + if (preg_match('#' . $mediaType . '#', $type)) { + $mediaFound = true; + break; + } + } + + if (!$mediaFound) { + throw new \RuntimeException( + 'Unexpected Content-Type header received: ' + . implode(',', $contentType) . '. Expected: ' . $mediaType + ); + } + + return $this; + } + + /** + * Gets the decoded JSON response. + * + * @throws \RuntimeException If the response body is not in JSON format + * @throws \InvalidArgumentException If the JSON cannot be parsed + * + * @return array + */ + public function getJson() + { + return \json_decode($this->response->getBody(), true); + } + + /** + * Gets response body. + * + * @throws \RuntimeException If the response body is not in JSON format + * @throws \InvalidArgumentException If the JSON cannot be parsed + * + * @return StreamInterface the body as a stream + */ + public function getBody() + { + return $this->response->getBody(); + } + + /** + * Gets the Location header. + * + * @throws \RuntimeException If the Location header is missing + * + * @return string + */ + public function getLocation() + { + $location = $this->response->getHeader('Location'); + if (empty($location)) { + throw new \RuntimeException('Response is missing a Location header'); + } + return $location[0]; + } + + + /** + * Asserts and analyze the response. Checks if the reponse has SUCCESSFULL family + * and try to parse the Klarna error message if possbile. + * + * @throws ConnectorException if response has non-2xx HTTP CODE and contains + * a Error + * @throws \RuntimeException if response has non-2xx HTTP CODE and body is not parsable + * + * @return void + */ + public function expectSuccessfull() + { + if ($this->isSuccessfull()) { + return $this; + } + + $data = json_decode($this->response->getBody(), true); + if (is_array($data) && array_key_exists('error_code', $data)) { + throw new ConnectorException($data, $this->response->getStatus()); + } + + throw new \RuntimeException( + 'Unexpected reponse HTTP status ' . $this->response->getStatus() . + '. Excepted HTTP status should be in 2xx range', + $this->response->getStatus() + ); + } + + public function isSuccessfull() + { + $status = $this->response->getStatus(); + return $status >= 200 && $status < 300; + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php new file mode 100644 index 00000000000..a60f7fbd693 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php @@ -0,0 +1,120 @@ + $name + ]; + + if (!empty($version)) { + $field['version'] = $version; + } + + if (!empty($options)) { + $field['options'] = $options; + } + + $this->fields[$key] = $field; + + return $this; + } + + /** + * Serialises the user agent. + * + * @return string + */ + public function __toString() + { + $parts = []; + + foreach ($this->fields as $key => $value) { + $component = "{$key}/{$value['name']}"; + if (!empty($value['version'])) { + $component .= "_{$value['version']}"; + } + + $parts[] = $component; + + if (empty($value['options'])) { + continue; + } + + $opts = implode('; ', $value['options']); + $parts[] = "({$opts})"; + } + + return implode(' ', $parts); + } + + /** + * Creates the default user agent. + * + * @return self + */ + public static function createDefault($options = []) + { + $agent = new static(); + + if (extension_loaded('curl')) { + $options[] = 'curl/' . curl_version()['version']; + } + + return $agent + ->setField('Library', static::NAME, static::VERSION, $options) + ->setField('OS', php_uname('s'), php_uname('r')) + ->setField('Language', 'PHP', phpversion()); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php new file mode 100644 index 00000000000..a4ed6f76160 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php @@ -0,0 +1,117 @@ + Date: Fri, 4 Mar 2022 16:40:39 +0000 Subject: [PATCH 34/39] Support for PHP 8.0 and 8.1 --- upload/system/storage/vendor/composer/installed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 50b62676e63..fb6d8a74e64 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => 'fa0a664dcc0192810452fc7651d72bfcebe6e554', + 'reference' => 'd36edd20e4a6344d7a7210a2f57e4d34c6bf04cc', 'name' => 'opencart/opencart', 'dev' => true, ), @@ -88,7 +88,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), - 'reference' => 'fa0a664dcc0192810452fc7651d72bfcebe6e554', + 'reference' => 'd36edd20e4a6344d7a7210a2f57e4d34c6bf04cc', 'dev_requirement' => false, ), 'psr/http-message' => array( From 2b2b7581f9af1ea7ec10f75c2d35277095c5c774 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 16:50:17 +0000 Subject: [PATCH 35/39] Support for PHP 8.0 and 8.1 --- upload/catalog/controller/startup/startup.php | 12 ++++++++++++ upload/catalog/model/catalog/product.php | 2 +- upload/system/library/db/mysqli.php | 2 +- upload/system/library/session/db.php | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/upload/catalog/controller/startup/startup.php b/upload/catalog/controller/startup/startup.php index 954de01b52e..22e7f44a6aa 100644 --- a/upload/catalog/controller/startup/startup.php +++ b/upload/catalog/controller/startup/startup.php @@ -1,5 +1,17 @@ registry) { + if ($this->registry->get($key)!==null) { + return true; + } + } + return false; + } + public function index() { // Store if ($this->request->server['HTTPS']) { diff --git a/upload/catalog/model/catalog/product.php b/upload/catalog/model/catalog/product.php index e07bd589227..55d66a25774 100644 --- a/upload/catalog/model/catalog/product.php +++ b/upload/catalog/model/catalog/product.php @@ -42,7 +42,7 @@ public function getProduct($product_id) { 'height' => $query->row['height'], 'length_class_id' => $query->row['length_class_id'], 'subtract' => $query->row['subtract'], - 'rating' => round($query->row['rating']), + 'rating' => round(($query->row['rating']===null) ? 0 : $query->row['rating']), 'reviews' => $query->row['reviews'] ? $query->row['reviews'] : 0, 'minimum' => $query->row['minimum'], 'sort_order' => $query->row['sort_order'], diff --git a/upload/system/library/db/mysqli.php b/upload/system/library/db/mysqli.php index b773e3f0e1e..ab753c509bc 100644 --- a/upload/system/library/db/mysqli.php +++ b/upload/system/library/db/mysqli.php @@ -50,7 +50,7 @@ public function query($sql) { } public function escape($value) { - return $this->connection->real_escape_string($value); + return $this->connection->real_escape_string(($value===null) ? '' : $value); } public function countAffected() { diff --git a/upload/system/library/session/db.php b/upload/system/library/session/db.php index 8cd7099f914..8cce7441db7 100644 --- a/upload/system/library/session/db.php +++ b/upload/system/library/session/db.php @@ -18,7 +18,7 @@ public function read($session_id) { if ($query->num_rows) { return json_decode($query->row['data'], true); } else { - return false; + return array(); } } From b2a5465403536d86a09419815b549033b78642c1 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 17:02:54 +0000 Subject: [PATCH 36/39] Support for PHP 8.0 and 8.1 --- upload/admin/model/extension/dashboard/sale.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload/admin/model/extension/dashboard/sale.php b/upload/admin/model/extension/dashboard/sale.php index b251acb5939..9c3989a475b 100644 --- a/upload/admin/model/extension/dashboard/sale.php +++ b/upload/admin/model/extension/dashboard/sale.php @@ -9,7 +9,7 @@ public function getTotalSales($data = array()) { $query = $this->db->query($sql); - return $query->row['total']; + return isset($query->row['total']) ? $query->row['total'] : 0.00; } public function getTotalOrdersByCountry() { From 94a8e8254518f4f649aa21315810b9ff2499895a Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Fri, 4 Mar 2022 17:42:54 +0000 Subject: [PATCH 37/39] Support for PHP 8.0 and 8.1 --- .../storage/vendor/composer/ClassLoader.php | 157 +- .../vendor/composer/InstalledVersions.php | 350 -- .../vendor/composer/autoload_classmap.php | 9 - .../vendor/composer/autoload_files.php | 15 +- .../vendor/composer/autoload_namespaces.php | 2 + .../storage/vendor/composer/autoload_psr4.php | 18 +- .../storage/vendor/composer/autoload_real.php | 15 +- .../vendor/composer/autoload_static.php | 126 +- .../storage/vendor/composer/installed.json | 2899 ++++++----------- .../storage/vendor/composer/installed.php | 254 -- .../vendor/composer/platform_check.php | 26 - 11 files changed, 1115 insertions(+), 2756 deletions(-) delete mode 100644 upload/system/storage/vendor/composer/InstalledVersions.php delete mode 100644 upload/system/storage/vendor/composer/installed.php delete mode 100644 upload/system/storage/vendor/composer/platform_check.php diff --git a/upload/system/storage/vendor/composer/ClassLoader.php b/upload/system/storage/vendor/composer/ClassLoader.php index afef3fa2ad8..fce8549f078 100644 --- a/upload/system/storage/vendor/composer/ClassLoader.php +++ b/upload/system/storage/vendor/composer/ClassLoader.php @@ -37,130 +37,57 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ */ class ClassLoader { - /** @var ?string */ - private $vendorDir; - // PSR-4 - /** - * @var array[] - * @psalm-var array> - */ private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array> - */ private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array - */ private $fallbackDirsPsr4 = array(); // PSR-0 - /** - * @var array[] - * @psalm-var array> - */ private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array - */ private $fallbackDirsPsr0 = array(); - /** @var bool */ private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array - */ private $classMap = array(); - - /** @var bool */ private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array - */ private $missingClasses = array(); - - /** @var ?string */ private $apcuPrefix; - /** - * @var self[] - */ - private static $registeredLoaders = array(); - - /** - * @param ?string $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - } - - /** - * @return string[] - */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + return call_user_func_array('array_merge', $this->prefixesPsr0); } return array(); } - /** - * @return array[] - * @psalm-return array> - */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } - /** - * @return array[] - * @psalm-return array - */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } - /** - * @return array[] - * @psalm-return array - */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } - /** - * @return string[] Array of classname => path - * @psalm-return array - */ public function getClassMap() { return $this->classMap; } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void + * @param array $classMap Class to filename map */ public function addClassMap(array $classMap) { @@ -175,11 +102,9 @@ 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 - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories */ public function add($prefix, $paths, $prepend = false) { @@ -222,13 +147,11 @@ 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 array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException - * - * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -272,10 +195,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 - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories */ public function set($prefix, $paths) { @@ -290,12 +211,10 @@ 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 array|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException - * - * @return void */ public function setPsr4($prefix, $paths) { @@ -315,8 +234,6 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath - * - * @return void */ public function setUseIncludePath($useIncludePath) { @@ -339,8 +256,6 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative - * - * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -361,8 +276,6 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix - * - * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -383,44 +296,25 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } } /** * Unregisters this instance as an autoloader. - * - * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return true|null True if loaded, null otherwise + * @return bool|null True if loaded, null otherwise */ public function loadClass($class) { @@ -429,8 +323,6 @@ public function loadClass($class) return true; } - - return null; } /** @@ -475,21 +367,6 @@ public function findFile($class) return $file; } - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -561,10 +438,6 @@ private function findFileWithExtension($class, $ext) * Scope isolated include. * * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private */ function includeFile($file) { diff --git a/upload/system/storage/vendor/composer/InstalledVersions.php b/upload/system/storage/vendor/composer/InstalledVersions.php deleted file mode 100644 index d50e0c9fcc4..00000000000 --- a/upload/system/storage/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,350 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - */ -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 - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - 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 false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @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} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // 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 = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @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 - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - 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'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // 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'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } -} diff --git a/upload/system/storage/vendor/composer/autoload_classmap.php b/upload/system/storage/vendor/composer/autoload_classmap.php index 75cf84ebf1c..b9461a63714 100644 --- a/upload/system/storage/vendor/composer/autoload_classmap.php +++ b/upload/system/storage/vendor/composer/autoload_classmap.php @@ -6,13 +6,4 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.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', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_files.php b/upload/system/storage/vendor/composer/autoload_files.php index 8426712e368..e4a930d222e 100644 --- a/upload/system/storage/vendor/composer/autoload_files.php +++ b/upload/system/storage/vendor/composer/autoload_files.php @@ -6,18 +6,7 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', - 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_namespaces.php b/upload/system/storage/vendor/composer/autoload_namespaces.php index 13f1295d4c0..89454da8809 100644 --- a/upload/system/storage/vendor/composer/autoload_namespaces.php +++ b/upload/system/storage/vendor/composer/autoload_namespaces.php @@ -6,5 +6,7 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( + 'Twig_' => array($vendorDir . '/twig/twig/lib'), 'Divido' => array($vendorDir . '/divido/divido-php/lib'), + 'Braintree' => array($vendorDir . '/braintree/braintree_php/lib'), ); diff --git a/upload/system/storage/vendor/composer/autoload_psr4.php b/upload/system/storage/vendor/composer/autoload_psr4.php index 180da0745c2..fbaa4473532 100644 --- a/upload/system/storage/vendor/composer/autoload_psr4.php +++ b/upload/system/storage/vendor/composer/autoload_psr4.php @@ -8,24 +8,18 @@ return array( 'Wechat\\' => array($vendorDir . '/zoujingli/wechat-php-sdk/Wechat'), 'Twig\\' => array($vendorDir . '/twig/twig/src'), - 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), - 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), - 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'), 'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'), + 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), 'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'), 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), - 'Klarna\\' => array($vendorDir . '/klarna/kco_rest/src/Klarna'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'GuzzleHttp\\Subscriber\\Oauth\\' => array($vendorDir . '/guzzlehttp/oauth-subscriber/src'), - 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), - 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), + 'GuzzleHttp\\Subscriber\\Log\\' => array($vendorDir . '/guzzlehttp/log-subscriber/src'), + 'GuzzleHttp\\Stream\\' => array($vendorDir . '/guzzlehttp/streams/src'), + 'GuzzleHttp\\Ring\\' => array($vendorDir . '/guzzlehttp/ringphp/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Cardinity\\' => array($vendorDir . '/cardinity/cardinity-sdk-php/src'), - 'Braintree\\' => array($vendorDir . '/braintree/braintree_php/lib/Braintree'), + '' => array($vendorDir . '/klarna/kco_rest/src'), ); diff --git a/upload/system/storage/vendor/composer/autoload_real.php b/upload/system/storage/vendor/composer/autoload_real.php index 3caebdf2ffa..4bdcde48e43 100644 --- a/upload/system/storage/vendor/composer/autoload_real.php +++ b/upload/system/storage/vendor/composer/autoload_real.php @@ -22,15 +22,13 @@ public static function getLoader() return self::$loader; } - require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59', '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_once __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::getInitializer($loader)); } else { @@ -65,16 +63,11 @@ public static function getLoader() } } -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ function composerRequirea8cb75283b86ff94542c6f1327c4ce59($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - require $file; + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; } } diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index ea600907b5d..d105a184097 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -7,20 +7,9 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 { public static $files = array ( - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', - 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', - 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( @@ -34,16 +23,10 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ), 'S' => array ( - 'Symfony\\Polyfill\\Php81\\' => 23, - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php73\\' => 23, - 'Symfony\\Polyfill\\Php72\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, - 'Symfony\\Polyfill\\Intl\\Idn\\' => 26, 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\Translation\\' => 30, 'Symfony\\Component\\Validator\\' => 28, + 'Symfony\\Component\\Translation\\' => 30, 'ScssPhp\\ScssPhp\\' => 16, ), 'R' => @@ -52,27 +35,20 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ), 'P' => array ( - 'Psr\\Http\\Message\\' => 17, - ), - 'K' => - array ( - 'Klarna\\' => 7, + 'Psr\\Log\\' => 8, ), 'G' => array ( 'GuzzleHttp\\Subscriber\\Oauth\\' => 28, - 'GuzzleHttp\\Psr7\\' => 16, - 'GuzzleHttp\\Promise\\' => 19, + 'GuzzleHttp\\Subscriber\\Log\\' => 26, + 'GuzzleHttp\\Stream\\' => 18, + 'GuzzleHttp\\Ring\\' => 16, 'GuzzleHttp\\' => 11, ), 'C' => array ( 'Cardinity\\' => 10, ), - 'B' => - array ( - 'Braintree\\' => 10, - ), ); public static $prefixDirsPsr4 = array ( @@ -84,46 +60,22 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/twig/twig/src', ), - 'Symfony\\Polyfill\\Php81\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', - ), - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Php73\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', - ), - 'Symfony\\Polyfill\\Php72\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', - ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', - ), - 'Symfony\\Polyfill\\Intl\\Idn\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn', - ), 'Symfony\\Polyfill\\Ctype\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', ), - 'Symfony\\Contracts\\Translation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/translation-contracts', - ), 'Symfony\\Component\\Validator\\' => array ( 0 => __DIR__ . '/..' . '/symfony/validator', ), + 'Symfony\\Component\\Translation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/translation', + ), 'ScssPhp\\ScssPhp\\' => array ( 0 => __DIR__ . '/..' . '/scssphp/scssphp/src', @@ -132,25 +84,25 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/react/promise/src', ), - 'Psr\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-message/src', - ), - 'Klarna\\' => + 'Psr\\Log\\' => array ( - 0 => __DIR__ . '/..' . '/klarna/kco_rest/src/Klarna', + 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', ), 'GuzzleHttp\\Subscriber\\Oauth\\' => array ( 0 => __DIR__ . '/..' . '/guzzlehttp/oauth-subscriber/src', ), - 'GuzzleHttp\\Psr7\\' => + 'GuzzleHttp\\Subscriber\\Log\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/log-subscriber/src', + ), + 'GuzzleHttp\\Stream\\' => array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + 0 => __DIR__ . '/..' . '/guzzlehttp/streams/src', ), - 'GuzzleHttp\\Promise\\' => + 'GuzzleHttp\\Ring\\' => array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', + 0 => __DIR__ . '/..' . '/guzzlehttp/ringphp/src', ), 'GuzzleHttp\\' => array ( @@ -160,13 +112,20 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 array ( 0 => __DIR__ . '/..' . '/cardinity/cardinity-sdk-php/src', ), - 'Braintree\\' => - array ( - 0 => __DIR__ . '/..' . '/braintree/braintree_php/lib/Braintree', - ), + ); + + public static $fallbackDirsPsr4 = array ( + 0 => __DIR__ . '/..' . '/klarna/kco_rest/src', ); public static $prefixesPsr0 = array ( + 'T' => + array ( + 'Twig_' => + array ( + 0 => __DIR__ . '/..' . '/twig/twig/lib', + ), + ), 'D' => array ( 'Divido' => @@ -174,18 +133,13 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 0 => __DIR__ . '/..' . '/divido/divido-php/lib', ), ), - ); - - public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.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', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', + 'B' => + array ( + 'Braintree' => + array ( + 0 => __DIR__ . '/..' . '/braintree/braintree_php/lib', + ), + ), ); public static function getInitializer(ClassLoader $loader) @@ -193,8 +147,8 @@ public static function getInitializer(ClassLoader $loader) return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixDirsPsr4; + $loader->fallbackDirsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$fallbackDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixesPsr0; - $loader->classMap = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$classMap; }, null, ClassLoader::class); } diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 20955814982..16b586b5bb1 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1,1853 +1,1046 @@ -{ - "packages": [ - { - "name": "braintree/braintree_php", - "version": "6.7.0", - "version_normalized": "6.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/braintree/braintree_php.git", - "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/braintree/braintree_php/zipball/3406aa331c3eb5ac38aecb135389897dd50f35a1", - "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-dom": "*", - "ext-hash": "*", - "ext-openssl": "*", - "ext-xmlwriter": "*", - "php": ">=7.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.0", - "squizlabs/php_codesniffer": "^3.0" - }, - "time": "2022-02-23T22:28:07+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Braintree\\": "lib/Braintree" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Braintree", - "homepage": "https://www.braintreepayments.com" - } - ], - "description": "Braintree PHP Client Library", - "support": { - "issues": "https://github.com/braintree/braintree_php/issues", - "source": "https://github.com/braintree/braintree_php/tree/6.7.0" - }, - "install-path": "../braintree/braintree_php" - }, - { - "name": "cardinity/cardinity-sdk-php", - "version": "v3.0.4", - "version_normalized": "3.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/cardinity/cardinity-sdk-php.git", - "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", - "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.2.1", - "guzzlehttp/oauth-subscriber": "0.3.*", - "php": ">=7.2.5", - "symfony/validator": "^5.0.0" - }, - "require-dev": { - "monolog/monolog": "~1.0", - "phpspec/phpspec": "~6.2", - "phpunit/phpunit": "^8.5", - "symfony/yaml": "^4.4" - }, - "time": "2022-02-02T11:25:15+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Cardinity\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Client library for Cardinity credit card processing API", - "homepage": "https://cardinity.com", - "support": { - "issues": "https://github.com/cardinity/cardinity-sdk-php/issues", - "source": "https://github.com/cardinity/cardinity-sdk-php/tree/v3.0.4" - }, - "install-path": "../cardinity/cardinity-sdk-php" - }, - { - "name": "divido/divido-php", - "version": "v1.15-stable", - "version_normalized": "1.15.0.0", - "source": { - "type": "git", - "url": "git@github.com:DividoFinancialServices/divido-api-php.git", - "reference": "8edd902ec2be8151331985021107031292b41ca1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/DividoFinancialServices/divido-api-php/zipball/8edd902ec2be8151331985021107031292b41ca1", - "reference": "8edd902ec2be8151331985021107031292b41ca1", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.2.0" - }, - "time": "2018-01-21T15:38:57+00:00", - "type": "library", - "extra": { - "branch-alias": { - "master": "2.0-dev", - "v1.1.1": "1.1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Divido": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Divido PHP library", - "homepage": "https://www.divido.com/", - "keywords": [ - "api", - "divido", - "finance", - "instalments", - "payment processing" - ], - "install-path": "../divido/divido-php" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.5.5", - "version_normalized": "6.5.5.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "time": "2020-06-16T21:01:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5" - }, - "install-path": "../guzzlehttp/guzzle" - }, - { - "name": "guzzlehttp/oauth-subscriber", - "version": "0.3.0", - "version_normalized": "0.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/oauth-subscriber.git", - "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", - "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~6.0", - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2015-08-15T19:44:28+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Subscriber\\Oauth\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle OAuth 1.0 subscriber", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "oauth" - ], - "support": { - "issues": "https://github.com/guzzle/oauth-subscriber/issues", - "source": "https://github.com/guzzle/oauth-subscriber/tree/master" - }, - "install-path": "../guzzlehttp/oauth-subscriber" - }, - { - "name": "guzzlehttp/promises", - "version": "1.5.1", - "version_normalized": "1.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "time": "2021-10-22T20:56:57+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "install-path": "../guzzlehttp/promises" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.8.3", - "version_normalized": "1.8.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "time": "2021-10-05T13:56:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.3" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "install-path": "../guzzlehttp/psr7" - }, - { - "name": "klarna/kco_rest", - "version": "v4.2.3", - "version_normalized": "4.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/klarna/kco_rest_php.git", - "reference": "6c092bdd155cc8d6564503beb703ea721958381a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/6c092bdd155cc8d6564503beb703ea721958381a", - "reference": "6c092bdd155cc8d6564503beb703ea721958381a", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~6.0", - "php": ">=5.5.0" - }, - "require-dev": { - "apigen/apigen": "4.1.*", - "klarna/apigen-theme": "2.1.0", - "php-coveralls/php-coveralls": "^2.1", - "phploc/phploc": "2.0.*", - "phpmd/phpmd": "2.1.*", - "phpunit/phpunit": ">=4.0.0, <6.0", - "sebastian/phpcpd": "2.0.*", - "squizlabs/php_codesniffer": "1.5.*" - }, - "time": "2020-02-14T09:31:35+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Klarna\\": "src/Klarna/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Klarna AB" - } - ], - "description": "Official Klarna REST PHP SDK", - "homepage": "http://developers.klarna.com", - "support": { - "issues": "https://github.com/klarna/kco_rest_php/issues", - "source": "https://github.com/klarna/kco_rest_php/tree/v4.x" - }, - "abandoned": true, - "install-path": "../klarna/kco_rest" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2016-08-06T14:39:51+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "install-path": "../psr/http-message" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "time": "2019-03-08T08:55:37+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "install-path": "../ralouphie/getallheaders" - }, - { - "name": "react/promise", - "version": "v2.9.0", - "version_normalized": "2.9.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "time": "2022-02-11T10:27:51+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "install-path": "../react/promise" - }, - { - "name": "scssphp/scssphp", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/scssphp/scssphp.git", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/824e4cec10b2bfa88eec5dac23991cb9106622c1", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", - "squizlabs/php_codesniffer": "~3.5", - "twbs/bootstrap": "~4.3", - "zurb/foundation": "~6.5" - }, - "time": "2020-06-04T17:30:40+00:00", - "bin": [ - "bin/pscss" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ScssPhp\\ScssPhp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "homepage": "https://github.com/robocoder" - }, - { - "name": "Cédric Morin", - "email": "cedric@yterium.com", - "homepage": "https://github.com/Cerdic" - } - ], - "description": "scssphp is a compiler for SCSS written in PHP.", - "homepage": "http://scssphp.github.io/scssphp/", - "keywords": [ - "css", - "less", - "sass", - "scss", - "stylesheet" - ], - "install-path": "../scssphp/scssphp" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "time": "2021-11-01T23:48:49+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2021-10-20T20:35:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2021-09-14T14:02:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-idn" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2021-02-19T12:13:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-normalizer" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2021-11-30T18:21:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-05-27T09:17:38+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php72" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-06-05T21:20:04+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php73" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-03-04T08:16:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-09-13T13:58:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php81" - }, - { - "name": "symfony/translation-contracts", - "version": "v3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "time": "2021-09-07T12:43:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to translation", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/translation-contracts" - }, - { - "name": "symfony/validator", - "version": "v5.4.5", - "version_normalized": "5.4.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/06c3d849fa19a0ece7b6eed240036772c4b5faaf", - "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/translation-contracts": "^1.1|^2|^3" - }, - "conflict": { - "doctrine/annotations": "<1.13", - "doctrine/cache": "<1.11", - "doctrine/lexer": "<1.1", - "phpunit/phpunit": "<5.4.3", - "symfony/dependency-injection": "<4.4", - "symfony/expression-language": "<5.1", - "symfony/http-kernel": "<4.4", - "symfony/intl": "<4.4", - "symfony/property-info": "<5.3", - "symfony/translation": "<4.4", - "symfony/yaml": "<4.4" - }, - "require-dev": { - "doctrine/annotations": "^1.13", - "doctrine/cache": "^1.11|^2.0", - "egulias/email-validator": "^2.1.10|^3", - "symfony/cache": "^4.4|^5.0|^6.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", - "symfony/expression-language": "^5.1|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/property-info": "^5.3|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "egulias/email-validator": "Strict (RFC compliant) email validation", - "psr/cache-implementation": "For using the mapping cache.", - "symfony/config": "", - "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For accessing properties within comparison constraints", - "symfony/property-info": "To automatically add NotNull and Type constraints", - "symfony/translation": "For translating validation errors.", - "symfony/yaml": "" - }, - "time": "2022-02-25T08:05:40+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to validate values", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/validator/tree/v5.4.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/validator" - }, - { - "name": "twig/twig", - "version": "v3.3.8", - "version_normalized": "3.3.8.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "972d8604a92b7054828b539f2febb0211dd5945c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/972d8604a92b7054828b539f2febb0211dd5945c", - "reference": "972d8604a92b7054828b539f2febb0211dd5945c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" - }, - "time": "2022-02-04T06:59:48+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "support": { - "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.8" - }, - "funding": [ - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/twig/twig", - "type": "tidelift" - } - ], - "install-path": "../twig/twig" - }, - { - "name": "zoujingli/wechat-php-sdk", - "version": "v1.3.18", - "version_normalized": "1.3.18.0", - "source": { - "type": "git", - "url": "https://github.com/zoujingli/wechat-php-sdk.git", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-libxml": "*", - "ext-simplexml": "*", - "php": ">=5.3.3" - }, - "time": "2019-10-10T09:42:15+00:00", - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Wechat\\": "./Wechat" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "WeChat development of SDK", - "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", - "keywords": [ - "wechat-php-sdk" - ], - "support": { - "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", - "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" - }, - "install-path": "../zoujingli/wechat-php-sdk" - } - ], - "dev": true, - "dev-package-names": [] -} +[ + { + "name": "braintree/braintree_php", + "version": "3.40.0", + "version_normalized": "3.40.0.0", + "source": { + "type": "git", + "url": "https://github.com/braintree/braintree_php.git", + "reference": "840fc6ebf8d96756fed475cce94565fef178187d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", + "reference": "840fc6ebf8d96756fed475cce94565fef178187d", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-dom": "*", + "ext-hash": "*", + "ext-openssl": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, + "time": "2015-07-15T15:07:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Braintree": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Braintree", + "homepage": "http://www.braintreepayments.com" + } + ], + "description": "Braintree PHP Client Library" + }, + { + "name": "cardinity/cardinity-sdk-php", + "version": "v1.0.3", + "version_normalized": "1.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/cardinity/cardinity-sdk-php.git", + "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/f51f6fbacee393b4eeff7b80be2b1cee77896b4c", + "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~5.1", + "guzzlehttp/log-subscriber": "~1.0", + "guzzlehttp/oauth-subscriber": "0.2.*", + "php": ">=5.4.0", + "symfony/validator": "~2.6" + }, + "require-dev": { + "monolog/monolog": "~1.0", + "phpspec/phpspec": "~2.1", + "phpunit/phpunit": "~4.3" + }, + "time": "2016-12-29T09:57:23+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Cardinity\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Client library for Cardinity credit card processing API", + "homepage": "http://cardinity.com" + }, + { + "name": "divido/divido-php", + "version": "v1.15-stable", + "version_normalized": "1.15.0.0", + "source": { + "type": "git", + "url": "git@github.com:DividoFinancialServices/divido-api-php.git", + "reference": "8edd902ec2be8151331985021107031292b41ca1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DividoFinancialServices/divido-api-php/zipball/8edd902ec2be8151331985021107031292b41ca1", + "reference": "8edd902ec2be8151331985021107031292b41ca1", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.2.0" + }, + "time": "2018-01-21T15:38:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "master": "2.0-dev", + "v1.1.1": "1.1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Divido": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Divido PHP library", + "homepage": "https://www.divido.com/", + "keywords": [ + "api", + "divido", + "finance", + "instalments", + "payment processing" + ] + }, + { + "name": "guzzlehttp/guzzle", + "version": "5.3.4", + "version_normalized": "5.3.4.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", + "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", + "shasum": "" + }, + "require": { + "guzzlehttp/ringphp": "^1.1", + "php": ">=5.4.0", + "react/promise": "^2.2" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0" + }, + "time": "2019-10-30T09:32:00+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ] + }, + { + "name": "guzzlehttp/log-subscriber", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/log-subscriber.git", + "reference": "99c3c0004165db721d8ef7bbef60c996210e538a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/log-subscriber/zipball/99c3c0004165db721d8ef7bbef60c996210e538a", + "reference": "99c3c0004165db721d8ef7bbef60c996210e538a", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~4.0 | ~5.0", + "php": ">=5.4.0", + "psr/log": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2014-10-13T03:31:43+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Subscriber\\Log\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Logs HTTP requests and responses as they are sent over the wire (Guzzle 4+)", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "log", + "plugin" + ], + "abandoned": true + }, + { + "name": "guzzlehttp/oauth-subscriber", + "version": "0.2.0", + "version_normalized": "0.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/oauth-subscriber.git", + "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/03f1ebe31d3112526106d0570c80eba6820e86e5", + "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~4.0|~5.0", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2014-10-23T22:19:02+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Subscriber\\Oauth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle OAuth 1.0 subscriber", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "oauth" + ] + }, + { + "name": "guzzlehttp/ringphp", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/RingPHP.git", + "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", + "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", + "shasum": "" + }, + "require": { + "guzzlehttp/streams": "~3.0", + "php": ">=5.4.0", + "react/promise": "~2.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "ext-curl": "Guzzle will use specific adapters if cURL is present" + }, + "time": "2018-07-31T13:22:33+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Ring\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", + "abandoned": true + }, + { + "name": "guzzlehttp/streams", + "version": "3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/streams.git", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2014-10-12T19:18:40+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple abstraction over streams of data", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "stream" + ], + "abandoned": true + }, + { + "name": "klarna/kco_rest", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/klarna/kco_rest_php.git", + "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/8a2142a2ebb087bb61901d51d1bb9698790e78c5", + "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": ">=4.2,<6.0", + "php": ">=5.4.0" + }, + "require-dev": { + "apigen/apigen": "4.0.*", + "klarna/apigen-theme": "~1.0", + "phploc/phploc": "2.0.*", + "phpmd/phpmd": "2.1.*", + "phpunit/phpunit": "4.2.*", + "satooshi/php-coveralls": "0.6.*", + "sebastian/phpcpd": "2.0.*", + "squizlabs/php_codesniffer": "1.5.*" + }, + "time": "2015-12-07T09:51:35+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Klarna AB", + "email": "integration@klarna.com" + } + ], + "description": "Klarna Checkout PHP SDK", + "homepage": "http://developers.klarna.com", + "abandoned": true + }, + { + "name": "psr/log", + "version": "1.1.3", + "version_normalized": "1.1.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2020-03-23T09:12:05+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ] + }, + { + "name": "react/promise", + "version": "v2.8.0", + "version_normalized": "2.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + }, + "time": "2020-05-12T15:16:56+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ] + }, + { + "name": "scssphp/scssphp", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/scssphp/scssphp.git", + "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/scssphp/scssphp/zipball/824e4cec10b2bfa88eec5dac23991cb9106622c1", + "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", + "squizlabs/php_codesniffer": "~3.5", + "twbs/bootstrap": "~4.3", + "zurb/foundation": "~6.5" + }, + "time": "2020-06-04T17:30:40+00:00", + "bin": [ + "bin/pscss" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "ScssPhp\\ScssPhp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "homepage": "https://github.com/robocoder" + }, + { + "name": "Cédric Morin", + "email": "cedric@yterium.com", + "homepage": "https://github.com/Cerdic" + } + ], + "description": "scssphp is a compiler for SCSS written in PHP.", + "homepage": "http://scssphp.github.io/scssphp/", + "keywords": [ + "css", + "less", + "sass", + "scss", + "stylesheet" + ] + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.18.0", + "version_normalized": "1.18.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2020-07-14T12:35:20+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ] + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.18.0", + "version_normalized": "1.18.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2020-07-14T12:35:20+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ] + }, + { + "name": "symfony/translation", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "time": "2016-07-30T07:22:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/validator", + "version": "v2.8.52", + "version_normalized": "2.8.52.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.4|~3.0.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.1", + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.4|~3.0.0", + "symfony/http-foundation": "~2.3|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/property-access": "~2.3|~3.0.0", + "symfony/yaml": "^2.0.5|~3.0.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "symfony/config": "", + "symfony/expression-language": "For using the 2.4 Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For using the 2.4 Validator API", + "symfony/yaml": "" + }, + "time": "2018-11-14T14:06:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "https://symfony.com" + }, + { + "name": "twig/twig", + "version": "v2.13.0", + "version_normalized": "2.13.0.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/46a612ba1bbf6ee1c58acabacd868212ff8a2911", + "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + }, + "time": "2020-07-05T13:08:05+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.13-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "funding": [ + { + "url": "https://certification.symfony.com/", + "type": "custom" + }, + { + "url": "https://live.symfony.com/", + "type": "custom" + }, + { + "url": "https://symfony.com/cloud/", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ] + }, + { + "name": "zoujingli/wechat-php-sdk", + "version": "v1.3.18", + "version_normalized": "1.3.18.0", + "source": { + "type": "git", + "url": "https://github.com/zoujingli/wechat-php-sdk.git", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "time": "2019-10-10T09:42:15+00:00", + "type": "project", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WeChat development of SDK", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "keywords": [ + "wechat-php-sdk" + ] + } +] diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php deleted file mode 100644 index fb6d8a74e64..00000000000 --- a/upload/system/storage/vendor/composer/installed.php +++ /dev/null @@ -1,254 +0,0 @@ - array( - 'pretty_version' => 'dev-3.0.x.x_Maintenance', - 'version' => 'dev-3.0.x.x_Maintenance', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../../../../', - 'aliases' => array(), - 'reference' => 'd36edd20e4a6344d7a7210a2f57e4d34c6bf04cc', - 'name' => 'opencart/opencart', - 'dev' => true, - ), - 'versions' => array( - 'braintree/braintree_php' => array( - 'pretty_version' => '6.7.0', - 'version' => '6.7.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../braintree/braintree_php', - 'aliases' => array(), - 'reference' => '3406aa331c3eb5ac38aecb135389897dd50f35a1', - 'dev_requirement' => false, - ), - 'cardinity/cardinity-sdk-php' => array( - 'pretty_version' => 'v3.0.4', - 'version' => '3.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../cardinity/cardinity-sdk-php', - 'aliases' => array(), - 'reference' => '8a3e79ebc89cf26777f27a061ff356e8eeb1c47f', - 'dev_requirement' => false, - ), - 'divido/divido-php' => array( - 'pretty_version' => 'v1.15-stable', - 'version' => '1.15.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../divido/divido-php', - 'aliases' => array(), - 'reference' => '8edd902ec2be8151331985021107031292b41ca1', - 'dev_requirement' => false, - ), - 'guzzlehttp/guzzle' => array( - 'pretty_version' => '6.5.5', - 'version' => '6.5.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', - 'aliases' => array(), - 'reference' => '9d4290de1cfd701f38099ef7e183b64b4b7b0c5e', - 'dev_requirement' => false, - ), - 'guzzlehttp/oauth-subscriber' => array( - 'pretty_version' => '0.3.0', - 'version' => '0.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/oauth-subscriber', - 'aliases' => array(), - 'reference' => '04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf', - 'dev_requirement' => false, - ), - 'guzzlehttp/promises' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/promises', - 'aliases' => array(), - 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', - 'dev_requirement' => false, - ), - 'guzzlehttp/psr7' => array( - 'pretty_version' => '1.8.3', - 'version' => '1.8.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/psr7', - 'aliases' => array(), - 'reference' => '1afdd860a2566ed3c2b0b4a3de6e23434a79ec85', - 'dev_requirement' => false, - ), - 'klarna/kco_rest' => array( - 'pretty_version' => 'v4.2.3', - 'version' => '4.2.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../klarna/kco_rest', - 'aliases' => array(), - 'reference' => '6c092bdd155cc8d6564503beb703ea721958381a', - 'dev_requirement' => false, - ), - 'opencart/opencart' => array( - 'pretty_version' => 'dev-3.0.x.x_Maintenance', - 'version' => 'dev-3.0.x.x_Maintenance', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../../../../', - 'aliases' => array(), - 'reference' => 'd36edd20e4a6344d7a7210a2f57e4d34c6bf04cc', - 'dev_requirement' => false, - ), - 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-message', - 'aliases' => array(), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', - 'dev_requirement' => false, - ), - 'psr/http-message-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'ralouphie/getallheaders' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ralouphie/getallheaders', - 'aliases' => array(), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - 'dev_requirement' => false, - ), - 'react/promise' => array( - 'pretty_version' => 'v2.9.0', - 'version' => '2.9.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/promise', - 'aliases' => array(), - 'reference' => '234f8fd1023c9158e2314fa9d7d0e6a83db42910', - 'dev_requirement' => false, - ), - 'scssphp/scssphp' => array( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../scssphp/scssphp', - 'aliases' => array(), - 'reference' => '824e4cec10b2bfa88eec5dac23991cb9106622c1', - 'dev_requirement' => false, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.0.0', - 'version' => '3.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => 'c726b64c1ccfe2896cb7df2e1331c357ad1c8ced', - 'dev_requirement' => false, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'reference' => '30885182c981ab175d4d034db0f6f469898070ab', - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', - 'aliases' => array(), - 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44', - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', - 'aliases' => array(), - 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', - 'dev_requirement' => false, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php72' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php72', - 'aliases' => array(), - 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php73', - 'aliases' => array(), - 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php81', - 'aliases' => array(), - 'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f', - 'dev_requirement' => false, - ), - 'symfony/translation-contracts' => array( - 'pretty_version' => 'v3.0.0', - 'version' => '3.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/translation-contracts', - 'aliases' => array(), - 'reference' => '1b6ea5a7442af5a12dba3dbd6d71034b5b234e77', - 'dev_requirement' => false, - ), - 'symfony/validator' => array( - 'pretty_version' => 'v5.4.5', - 'version' => '5.4.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/validator', - 'aliases' => array(), - 'reference' => '06c3d849fa19a0ece7b6eed240036772c4b5faaf', - 'dev_requirement' => false, - ), - 'twig/twig' => array( - 'pretty_version' => 'v3.3.8', - 'version' => '3.3.8.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../twig/twig', - 'aliases' => array(), - 'reference' => '972d8604a92b7054828b539f2febb0211dd5945c', - 'dev_requirement' => false, - ), - 'zoujingli/wechat-php-sdk' => array( - 'pretty_version' => 'v1.3.18', - 'version' => '1.3.18.0', - 'type' => 'project', - 'install_path' => __DIR__ . '/../zoujingli/wechat-php-sdk', - 'aliases' => array(), - 'reference' => 'd37d0c1919ede2ee54e65100ac3792e947b1e0ef', - 'dev_requirement' => false, - ), - ), -); diff --git a/upload/system/storage/vendor/composer/platform_check.php b/upload/system/storage/vendor/composer/platform_check.php deleted file mode 100644 index b168ddd5d91..00000000000 --- a/upload/system/storage/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 80002)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} From d227aa5c1568bcabcff40613ff2c6611065532ee Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Wed, 9 Mar 2022 13:56:46 +0000 Subject: [PATCH 38/39] Support for PHP 8.0 and 8.1 --- composer.json | 13 +- composer.lock | 1321 +--- upload/system/storage/vendor/autoload.php | 2 +- upload/system/storage/vendor/bin/pscss | 105 +- upload/system/storage/vendor/bin/pscss.bat | 4 - .../braintree/braintree_php/CHANGELOG.md | 206 - .../vendor/braintree/braintree_php/LICENSE | 2 +- .../vendor/braintree/braintree_php/README.md | 74 +- .../braintree/braintree_php/composer.json | 8 +- .../braintree/braintree_php/lib/Braintree.php | 31 +- .../Braintree/AccountUpdaterDailyReport.php | 22 +- .../lib/Braintree/AchMandate.php | 25 +- .../braintree_php/lib/Braintree/AddOn.php | 27 +- .../lib/Braintree/AddOnGateway.php | 27 +- .../braintree_php/lib/Braintree/Address.php | 109 +- .../lib/Braintree/AddressGateway.php | 129 +- .../lib/Braintree/ApplePayCard.php | 37 +- .../lib/Braintree/ApplePayGateway.php | 49 +- .../lib/Braintree/ApplePayOptions.php | 14 +- .../lib/Braintree/AuthorizationAdjustment.php | 19 +- .../braintree_php/lib/Braintree/Base.php | 55 +- .../braintree_php/lib/Braintree/BinData.php | 31 +- .../lib/Braintree/ClientToken.php | 41 +- .../lib/Braintree/ClientTokenGateway.php | 70 +- .../lib/Braintree/Collection.php | 86 +- .../lib/Braintree/Configuration.php | 532 +- .../ConnectedMerchantPayPalStatusChanged.php | 17 +- .../ConnectedMerchantStatusTransitioned.php | 17 +- .../lib/Braintree/CredentialsParser.php | 64 +- .../lib/Braintree/CreditCard.php | 224 +- .../lib/Braintree/CreditCardGateway.php | 295 +- .../lib/Braintree/CreditCardVerification.php | 65 +- .../CreditCardVerificationGateway.php | 36 +- .../CreditCardVerificationSearch.php | 107 +- .../braintree_php/lib/Braintree/Customer.php | 318 +- .../lib/Braintree/CustomerGateway.php | 325 +- .../lib/Braintree/CustomerSearch.php | 275 +- .../lib/Braintree/Descriptor.php | 6 +- .../braintree_php/lib/Braintree/Digest.php | 15 +- .../lib/Braintree/Disbursement.php | 39 +- .../lib/Braintree/DisbursementDetails.php | 21 +- .../braintree_php/lib/Braintree/Discount.php | 36 +- .../lib/Braintree/DiscountGateway.php | 13 +- .../braintree_php/lib/Braintree/Dispute.php | 147 +- .../lib/Braintree/Dispute/EvidenceDetails.php | 15 +- .../Dispute/PayPalMessageDetails.php | 14 - .../Dispute/StatusHistoryDetails.php | 10 +- .../Braintree/Dispute/TransactionDetails.php | 15 +- .../lib/Braintree/DisputeGateway.php | 86 +- .../lib/Braintree/DisputeSearch.php | 103 +- .../lib/Braintree/DocumentUpload.php | 27 +- .../lib/Braintree/DocumentUploadGateway.php | 35 +- .../lib/Braintree/EndsWithNode.php | 19 +- .../lib/Braintree/EnrichedCustomerData.php | 46 - .../lib/Braintree/EqualityNode.php | 15 +- .../lib/Braintree/Error/Codes.php | 245 +- .../lib/Braintree/Error/ErrorCollection.php | 54 +- .../lib/Braintree/Error/Validation.php | 37 +- .../Error/ValidationErrorCollection.php | 94 +- .../braintree_php/lib/Braintree/Exception.php | 5 +- .../Braintree/Exception/Authentication.php | 6 +- .../lib/Braintree/Exception/Authorization.php | 6 +- .../lib/Braintree/Exception/Configuration.php | 7 +- .../lib/Braintree/Exception/Connection.php | 7 +- .../Braintree/Exception/GatewayTimeout.php | 12 - .../Braintree/Exception/InvalidChallenge.php | 7 +- .../Braintree/Exception/InvalidSignature.php | 7 +- .../lib/Braintree/Exception/NotFound.php | 6 +- .../Braintree/Exception/RequestTimeout.php | 12 - .../Braintree/Exception/SSLCaFileNotFound.php | 6 +- .../Braintree/Exception/SSLCertificate.php | 6 +- .../lib/Braintree/Exception/ServerError.php | 6 +- .../Exception/ServiceUnavailable.php | 12 - .../TestOperationPerformedInProduction.php | 5 +- .../lib/Braintree/Exception/Timeout.php | 6 +- .../Braintree/Exception/TooManyRequests.php | 6 +- .../lib/Braintree/Exception/Unexpected.php | 6 +- .../Braintree/Exception/UpgradeRequired.php | 6 +- .../Braintree/Exception/ValidationsFailed.php | 6 +- .../lib/Braintree/FacilitatedDetails.php | 27 +- .../lib/Braintree/FacilitatorDetails.php | 27 +- .../braintree_php/lib/Braintree/Gateway.php | 33 +- .../lib/Braintree/GooglePayCard.php | 68 - .../GrantedPaymentInstrumentUpdate.php | 35 +- .../braintree_php/lib/Braintree/GraphQL.php | 22 +- .../lib/Braintree/GraphQLClient.php | 29 - .../braintree_php/lib/Braintree/Http.php | 229 +- .../lib/Braintree/HttpHelpers/Curl.php | 190 - .../lib/Braintree/HttpHelpers/CurlRequest.php | 51 - .../lib/Braintree/HttpHelpers/HttpRequest.php | 20 - .../braintree_php/lib/Braintree/Instance.php | 51 +- .../braintree_php/lib/Braintree/IsNode.php | 19 +- .../lib/Braintree/KeyValueNode.php | 22 +- .../lib/Braintree/LocalPaymentCompleted.php | 46 +- .../lib/Braintree/LocalPaymentExpired.php | 36 - .../lib/Braintree/LocalPaymentFunded.php | 46 - .../lib/Braintree/LocalPaymentReversed.php | 51 - .../braintree_php/lib/Braintree/Merchant.php | 23 +- .../lib/Braintree/MerchantAccount.php | 20 +- .../MerchantAccount/AddressDetails.php | 5 +- .../MerchantAccount/BusinessDetails.php | 14 +- .../MerchantAccount/FundingDetails.php | 7 +- .../MerchantAccount/IndividualDetails.php | 14 +- .../lib/Braintree/MerchantAccountGateway.php | 55 +- .../lib/Braintree/MerchantGateway.php | 9 +- .../lib/Braintree/Modification.php | 19 +- .../lib/Braintree/MultipleValueNode.php | 46 +- .../lib/Braintree/MultipleValueOrTextNode.php | 47 +- .../lib/Braintree/OAuthAccessRevocation.php | 16 +- .../lib/Braintree/OAuthCredentials.php | 19 +- .../lib/Braintree/OAuthGateway.php | 52 +- .../lib/Braintree/OAuthResult.php | 19 +- .../lib/Braintree/PaginatedCollection.php | 48 +- .../lib/Braintree/PaginatedResult.php | 21 +- .../lib/Braintree/PartialMatchNode.php | 21 +- .../lib/Braintree/PartnerMerchant.php | 13 +- .../lib/Braintree/PayPalAccount.php | 89 +- .../lib/Braintree/PayPalAccountGateway.php | 79 +- .../lib/Braintree/PaymentInstrumentType.php | 25 +- .../lib/Braintree/PaymentMethod.php | 55 +- ...ymentMethodCustomerDataUpdatedMetadata.php | 49 - .../lib/Braintree/PaymentMethodGateway.php | 168 +- .../lib/Braintree/PaymentMethodNonce.php | 59 +- .../Braintree/PaymentMethodNonceGateway.php | 51 +- .../lib/Braintree/PaymentMethodParser.php | 51 +- .../braintree_php/lib/Braintree/Plan.php | 80 +- .../lib/Braintree/PlanGateway.php | 164 +- .../lib/Braintree/ProcessorResponseTypes.php | 10 +- .../braintree_php/lib/Braintree/RangeNode.php | 43 +- .../lib/Braintree/ResourceCollection.php | 55 +- .../Result/CreditCardVerification.php | 58 +- .../lib/Braintree/Result/Error.php | 123 +- .../lib/Braintree/Result/Successful.php | 64 +- .../Result/UsBankAccountVerification.php | 52 +- .../RevokedPaymentMethodMetadata.php | 29 +- .../braintree_php/lib/Braintree/RiskData.php | 28 +- .../lib/Braintree/SamsungPayCard.php | 56 +- .../lib/Braintree/SettlementBatchSummary.php | 29 +- .../SettlementBatchSummaryGateway.php | 56 +- .../lib/Braintree/ShippingMethod.php | 18 - .../lib/Braintree/SignatureService.php | 6 +- .../lib/Braintree/Subscription.php | 140 +- .../Braintree/Subscription/StatusDetails.php | 13 +- .../lib/Braintree/SubscriptionGateway.php | 91 +- .../lib/Braintree/SubscriptionSearch.php | 65 +- .../lib/Braintree/Test/AuthenticationIds.php | 34 - .../lib/Braintree/Test/CreditCardNumbers.php | 22 +- .../lib/Braintree/Test/MerchantAccount.php | 7 +- .../lib/Braintree/Test/Nonces.php | 135 +- .../lib/Braintree/Test/Transaction.php | 14 +- .../lib/Braintree/Test/TransactionAmounts.php | 11 +- .../lib/Braintree/Test/VenmoSdk.php | 17 +- .../lib/Braintree/TestingGateway.php | 3 +- .../braintree_php/lib/Braintree/TextNode.php | 13 +- .../lib/Braintree/ThreeDSecureInfo.php | 25 +- .../lib/Braintree/Transaction.php | 457 +- .../Braintree/Transaction/AddressDetails.php | 16 +- .../Transaction/ApplePayCardDetails.php | 20 +- .../Transaction/CreditCardDetails.php | 21 +- .../Braintree/Transaction/CustomerDetails.php | 14 +- .../Transaction/GooglePayCardDetails.php | 27 - .../Transaction/LocalPaymentDetails.php | 25 - .../Braintree/Transaction/PayPalDetails.php | 32 +- .../Transaction/PayPalHereDetails.php | 25 - .../Transaction/SamsungPayCardDetails.php | 34 +- .../Braintree/Transaction/StatusDetails.php | 10 +- .../Transaction/SubscriptionDetails.php | 8 +- .../Transaction/UsBankAccountDetails.php | 18 +- .../Transaction/VenmoAccountDetails.php | 25 +- .../Transaction/VisaCheckoutCardDetails.php | 34 +- .../lib/Braintree/TransactionGateway.php | 413 +- .../lib/Braintree/TransactionLineItem.php | 42 +- .../Braintree/TransactionLineItemGateway.php | 24 +- .../lib/Braintree/TransactionReview.php | 34 - .../lib/Braintree/TransactionSearch.php | 676 +- .../lib/Braintree/UnknownPaymentMethod.php | 29 +- .../lib/Braintree/UsBankAccount.php | 66 +- .../lib/Braintree/UsBankAccountGateway.php | 39 +- .../Braintree/UsBankAccountVerification.php | 50 +- .../UsBankAccountVerificationGateway.php | 40 +- .../UsBankAccountVerificationSearch.php | 90 +- .../braintree_php/lib/Braintree/Util.php | 270 +- .../lib/Braintree/VenmoAccount.php | 30 +- .../lib/Braintree/VenmoProfileData.php | 36 - .../braintree_php/lib/Braintree/Version.php | 16 +- .../lib/Braintree/VisaCheckoutCard.php | 62 +- .../lib/Braintree/WebhookNotification.php | 118 +- .../Braintree/WebhookNotificationGateway.php | 31 +- .../lib/Braintree/WebhookTesting.php | 4 +- .../lib/Braintree/WebhookTestingGateway.php | 353 +- .../braintree_php/lib/Braintree/Xml.php | 18 +- .../lib/Braintree/Xml/Generator.php | 52 +- .../lib/Braintree/Xml/Parser.php | 114 +- .../braintree/braintree_php/lib/autoload.php | 3 +- .../vendor/braintree/braintree_php/phpcs.xml | 70 - .../cardinity/cardinity-sdk-php/.editorconfig | 15 - .../.github/workflows/php.yml | 39 - .../cardinity/cardinity-sdk-php/.gitignore | 4 - .../cardinity/cardinity-sdk-php/.travis.yml | 7 +- .../cardinity/cardinity-sdk-php/CHANGELOG.md | 83 - .../cardinity/cardinity-sdk-php/LICENSE | 2 +- .../cardinity/cardinity-sdk-php/README.md | 123 +- .../cardinity/cardinity-sdk-php/composer.json | 19 +- .../cardinity-sdk-php/docs/README.md | 47 +- .../cardinity-sdk-php/phpunit.xml.dist | 26 +- .../cardinity-sdk-php/spec/ClientSpec.php | 3 + .../spec/Exception/DeclinedSpec.php | 3 +- .../spec/Exception/ForbiddenSpec.php | 1 + .../Exception/InternalServerErrorSpec.php | 3 +- .../Exception/InvalidAttributeValueSpec.php | 1 + .../spec/Exception/MethodNotAllowedSpec.php | 3 +- .../spec/Exception/NotAcceptableSpec.php | 3 +- .../spec/Exception/NotFoundSpec.php | 3 +- .../spec/Exception/RequestSpec.php | 11 +- .../spec/Exception/RequestTimeoutSpec.php | 1 + .../spec/Exception/ServiceUnavailableSpec.php | 3 +- .../spec/Exception/UnauthorizedSpec.php | 3 +- .../spec/Exception/UnexpectedErrorSpec.php | 1 + .../spec/Exception/UnexpectedResponseSpec.php | 1 + .../spec/Exception/ValidationFailedSpec.php | 1 + .../spec/Http/Guzzle/ClientAdapterSpec.php | 27 +- .../spec/Http/Guzzle/ExceptionMapperSpec.php | 59 +- .../spec/Method/ErrorSpec.php | 1 + .../Payment/AuthorizationInformationSpec.php | 1 + .../spec/Method/Payment/CreateSpec.php | 31 +- .../spec/Method/Payment/FinalizeSpec.php | 10 +- .../spec/Method/Payment/GetAllSpec.php | 10 +- .../spec/Method/Payment/GetSpec.php | 10 +- .../Payment/PaymentInstrumentCardSpec.php | 1 + .../PaymentInstrumentRecurringSpec.php | 1 + .../spec/Method/Payment/PaymentSpec.php | 35 +- .../ThreeDS2AuthorizationInformationSpec.php | 41 - .../spec/Method/Refund/CreateSpec.php | 10 +- .../spec/Method/Refund/GetAllSpec.php | 10 +- .../spec/Method/Refund/GetSpec.php | 10 +- .../spec/Method/Refund/RefundSpec.php | 1 + .../spec/Method/ResultObjectMapperSpec.php | 39 +- .../spec/Method/Settlement/CreateSpec.php | 10 +- .../spec/Method/Settlement/GetAllSpec.php | 10 +- .../spec/Method/Settlement/GetSpec.php | 10 +- .../spec/Method/Settlement/SettlementSpec.php | 1 + .../spec/Method/ValidatorSpec.php | 26 +- .../spec/Method/VoidPayment/CreateSpec.php | 62 - .../spec/Method/VoidPayment/GetAllSpec.php | 50 - .../spec/Method/VoidPayment/GetSpec.php | 58 - .../Method/VoidPayment/VoidPaymentSpec.php | 18 - .../cardinity-sdk-php/src/Client.php | 68 +- .../src/Exception/Request.php | 2 +- .../ResultObjectPropertyNotFound.php | 5 +- .../src/Exception/UnexpectedError.php | 1 - .../src/Http/ClientInterface.php | 1 - .../src/Http/Guzzle/ClientAdapter.php | 6 +- .../src/Http/Guzzle/ExceptionMapper.php | 5 +- .../cardinity-sdk-php/src/Method/Error.php | 26 +- .../src/Method/MethodInterface.php | 7 +- .../MethodResultCollectionInterface.php | 2 +- .../Payment/AuthorizationInformation.php | 16 +- .../src/Method/Payment/Create.php | 219 +- .../src/Method/Payment/Finalize.php | 32 +- .../src/Method/Payment/Get.php | 2 +- .../src/Method/Payment/GetAll.php | 2 +- .../src/Method/Payment/Payment.php | 141 +- .../Method/Payment/PaymentInstrumentCard.php | 22 +- .../Payment/PaymentInstrumentInterface.php | 2 +- .../Payment/PaymentInstrumentRecurring.php | 4 +- .../ThreeDS2AuthorizationInformation.php | 58 - .../src/Method/Refund/Get.php | 2 +- .../src/Method/Refund/GetAll.php | 2 +- .../src/Method/Refund/Refund.php | 62 +- .../src/Method/ResultObject.php | 33 +- .../src/Method/ResultObjectMapper.php | 26 +- .../Method/ResultObjectMapperInterface.php | 1 - .../src/Method/Settlement/Create.php | 1 - .../src/Method/Settlement/Get.php | 2 +- .../src/Method/Settlement/GetAll.php | 2 +- .../src/Method/Settlement/Settlement.php | 62 +- .../src/Method/Validator.php | 11 +- .../src/Method/ValidatorInterface.php | 4 +- .../Validators/CallbackUrlConstraint.php | 17 - .../CallbackUrlConstraintValidator.php | 32 - .../src/Method/VoidPayment/Create.php | 56 - .../src/Method/VoidPayment/Get.php | 57 - .../src/Method/VoidPayment/GetAll.php | 50 - .../src/Method/VoidPayment/VoidPayment.php | 239 - .../tests/ClientEndpointTest.php | 85 - .../cardinity-sdk-php/tests/ClientTest.php | 183 - .../tests/ClientTestCase.php | 132 +- .../cardinity-sdk-php/tests/ErrorTest.php | 50 +- .../cardinity-sdk-php/tests/PaymentTest.php | 160 +- .../cardinity-sdk-php/tests/RefundTest.php | 25 +- .../tests/SettlementTest.php | 24 +- .../cardinity-sdk-php/tests/ThreeDS2Test.php | 55 - .../tests/VoidPaymentTest.php | 121 - .../storage/vendor/composer/ClassLoader.php | 157 +- .../vendor/composer/autoload_classmap.php | 1 + .../vendor/composer/autoload_namespaces.php | 1 - .../storage/vendor/composer/autoload_real.php | 29 +- .../vendor/composer/autoload_static.php | 22 +- .../storage/vendor/composer/installed.json | 2103 +++--- .../storage/vendor/guzzlehttp/guzzle/.php_cs | 23 - .../vendor/guzzlehttp/guzzle/CHANGELOG.md | 291 +- .../vendor/guzzlehttp/guzzle/Dockerfile | 18 - .../storage/vendor/guzzlehttp/guzzle/LICENSE | 2 +- .../vendor/guzzlehttp/guzzle/README.md | 96 +- .../vendor/guzzlehttp/guzzle/UPGRADING.md | 159 +- .../vendor/guzzlehttp/guzzle/composer.json | 43 +- .../vendor/guzzlehttp/guzzle/src/Client.php | 639 +- .../guzzlehttp/guzzle/src/ClientInterface.php | 155 +- .../guzzle/src/Cookie/CookieJar.php | 128 +- .../guzzle/src/Cookie/CookieJarInterface.php | 27 +- .../guzzle/src/Cookie/FileCookieJar.php | 29 +- .../guzzle/src/Cookie/SessionCookieJar.php | 26 +- .../guzzle/src/Cookie/SetCookie.php | 66 +- .../src/Exception/BadResponseException.php | 22 +- .../guzzle/src/Exception/ClientException.php | 4 +- .../guzzle/src/Exception/ConnectException.php | 35 +- .../guzzle/src/Exception/GuzzleException.php | 23 - .../Exception/InvalidArgumentException.php | 7 - .../guzzle/src/Exception/RequestException.php | 129 +- .../guzzle/src/Exception/SeekException.php | 27 - .../guzzle/src/Exception/ServerException.php | 4 +- .../Exception/TooManyRedirectsException.php | 4 +- .../src/Exception/TransferException.php | 4 +- .../guzzle/src/Handler/CurlFactory.php | 585 -- .../src/Handler/CurlFactoryInterface.php | 27 - .../guzzle/src/Handler/CurlHandler.php | 45 - .../guzzle/src/Handler/CurlMultiHandler.php | 219 - .../guzzle/src/Handler/EasyHandle.php | 92 - .../guzzle/src/Handler/MockHandler.php | 195 - .../guzzlehttp/guzzle/src/Handler/Proxy.php | 55 - .../guzzle/src/Handler/StreamHandler.php | 545 -- .../guzzlehttp/guzzle/src/HandlerStack.php | 277 - .../guzzle/src/MessageFormatter.php | 185 - .../guzzlehttp/guzzle/src/Middleware.php | 254 - .../vendor/guzzlehttp/guzzle/src/Pool.php | 375 +- .../guzzle/src/PrepareBodyMiddleware.php | 111 - .../guzzle/src/RedirectMiddleware.php | 255 - .../guzzlehttp/guzzle/src/RequestOptions.php | 263 - .../guzzlehttp/guzzle/src/RetryMiddleware.php | 128 - .../guzzlehttp/guzzle/src/TransferStats.php | 126 - .../guzzlehttp/guzzle/src/UriTemplate.php | 58 +- .../vendor/guzzlehttp/guzzle/src/Utils.php | 231 +- .../guzzlehttp/guzzle/src/functions.php | 334 - .../guzzle/src/functions_include.php | 6 - .../guzzlehttp/oauth-subscriber/.travis.yml | 14 +- .../guzzlehttp/oauth-subscriber/CHANGELOG.md | 6 - .../guzzlehttp/oauth-subscriber/README.rst | 60 +- .../guzzlehttp/oauth-subscriber/composer.json | 6 +- .../oauth-subscriber/src/Oauth1.php | 142 +- .../oauth-subscriber/tests/Oauth1Test.php | 343 +- .../vendor/guzzlehttp/promises/CHANGELOG.md | 103 - .../vendor/guzzlehttp/promises/LICENSE | 24 - .../vendor/guzzlehttp/promises/Makefile | 13 - .../vendor/guzzlehttp/promises/README.md | 547 -- .../vendor/guzzlehttp/promises/composer.json | 58 - .../promises/src/AggregateException.php | 17 - .../promises/src/CancellationException.php | 10 - .../guzzlehttp/promises/src/Coroutine.php | 169 - .../vendor/guzzlehttp/promises/src/Create.php | 84 - .../vendor/guzzlehttp/promises/src/Each.php | 90 - .../guzzlehttp/promises/src/EachPromise.php | 255 - .../promises/src/FulfilledPromise.php | 84 - .../vendor/guzzlehttp/promises/src/Is.php | 46 - .../guzzlehttp/promises/src/Promise.php | 278 - .../promises/src/PromiseInterface.php | 97 - .../promises/src/PromisorInterface.php | 16 - .../promises/src/RejectedPromise.php | 91 - .../promises/src/RejectionException.php | 48 - .../guzzlehttp/promises/src/TaskQueue.php | 67 - .../promises/src/TaskQueueInterface.php | 24 - .../vendor/guzzlehttp/promises/src/Utils.php | 276 - .../guzzlehttp/promises/src/functions.php | 363 -- .../promises/src/functions_include.php | 6 - .../guzzlehttp/psr7/.github/FUNDING.yml | 2 - .../vendor/guzzlehttp/psr7/.github/stale.yml | 14 - .../guzzlehttp/psr7/.github/workflows/ci.yml | 34 - .../psr7/.github/workflows/integration.yml | 37 - .../psr7/.github/workflows/static.yml | 29 - .../vendor/guzzlehttp/psr7/.php_cs.dist | 56 - .../vendor/guzzlehttp/psr7/CHANGELOG.md | 300 - .../storage/vendor/guzzlehttp/psr7/LICENSE | 26 - .../storage/vendor/guzzlehttp/psr7/README.md | 824 --- .../vendor/guzzlehttp/psr7/composer.json | 73 - .../guzzlehttp/psr7/src/AppendStream.php | 246 - .../guzzlehttp/psr7/src/BufferStream.php | 142 - .../guzzlehttp/psr7/src/CachingStream.php | 147 - .../guzzlehttp/psr7/src/DroppingStream.php | 45 - .../vendor/guzzlehttp/psr7/src/FnStream.php | 163 - .../vendor/guzzlehttp/psr7/src/Header.php | 71 - .../guzzlehttp/psr7/src/InflateStream.php | 56 - .../guzzlehttp/psr7/src/LazyOpenStream.php | 42 - .../guzzlehttp/psr7/src/LimitStream.php | 157 - .../vendor/guzzlehttp/psr7/src/Message.php | 252 - .../guzzlehttp/psr7/src/MessageTrait.php | 214 - .../vendor/guzzlehttp/psr7/src/MimeType.php | 140 - .../guzzlehttp/psr7/src/MultipartStream.php | 158 - .../guzzlehttp/psr7/src/NoSeekStream.php | 25 - .../vendor/guzzlehttp/psr7/src/PumpStream.php | 170 - .../vendor/guzzlehttp/psr7/src/Query.php | 113 - .../vendor/guzzlehttp/psr7/src/Request.php | 152 - .../vendor/guzzlehttp/psr7/src/Response.php | 155 - .../vendor/guzzlehttp/psr7/src/Rfc7230.php | 19 - .../guzzlehttp/psr7/src/ServerRequest.php | 379 -- .../vendor/guzzlehttp/psr7/src/Stream.php | 270 - .../psr7/src/StreamDecoratorTrait.php | 152 - .../guzzlehttp/psr7/src/StreamWrapper.php | 165 - .../guzzlehttp/psr7/src/UploadedFile.php | 328 - .../vendor/guzzlehttp/psr7/src/Uri.php | 810 --- .../guzzlehttp/psr7/src/UriNormalizer.php | 219 - .../guzzlehttp/psr7/src/UriResolver.php | 222 - .../vendor/guzzlehttp/psr7/src/Utils.php | 428 -- .../vendor/guzzlehttp/psr7/src/functions.php | 422 -- .../guzzlehttp/psr7/src/functions_include.php | 6 - .../vendor/klarna/kco_rest/.gitattributes | 9 - .../vendor/klarna/kco_rest/CHANGELOG.md | 220 +- .../storage/vendor/klarna/kco_rest/LICENSE | 201 - .../storage/vendor/klarna/kco_rest/README.md | 150 +- .../vendor/klarna/kco_rest/composer.json | 29 +- .../examples/CheckoutAPI/create_checkout.php | 111 - .../create_checkout_attachment.php | 126 - .../docs/examples/CheckoutAPI/discounts.php | 103 - .../examples/CheckoutAPI/fetch_checkout.php | 62 - .../CheckoutAPI/handling_exceptions.php | 64 - .../examples/CheckoutAPI/update_checkout.php | 103 - .../examples/Common/change_user_agent.php | 113 - .../CustomerTokenAPI/Tokens/create_order.php | 106 - .../Tokens/read_token_details.php | 57 - .../Tokens/update_token_status.php | 59 - .../Sessions/create_new_hpp_session.php | 80 - .../Sessions/disable_session.php | 57 - .../Sessions/distribute_link.php | 67 - .../Sessions/get_hpp_session_status.php | 57 - .../ButtonKeys/create_button_key.php | 111 - .../ButtonKeys/see_button_key_options.php | 57 - .../ButtonKeys/update_button_key.php | 81 - .../Orders/approve_order.php | 122 - .../Orders/decline_order.php | 62 - .../Orders/retrieve_order.php | 57 - .../Captures/add_shipping_info.php | 72 - .../Captures/trigger_send_out.php | 60 - .../Captures/update_customer_details.php | 65 - .../Orders/acknowledge_order.php | 60 - .../Orders/cancel_order.php | 59 - .../Orders/create_capture.php | 87 - .../Orders/extend_authorization_time.php | 57 - .../Orders/fetch_all_captures.php | 58 - .../Orders/fetch_capture.php | 58 - .../OrderManagementAPI/Orders/fetch_order.php | 57 - .../release_remaining_authorization.php | 59 - .../Orders/update_customer_details.php | 68 - .../Orders/update_merchant_references.php | 63 - .../Orders/update_order_lines.php | 75 - .../Refunds/fetch_refund.php | 58 - .../Refunds/refund_order.php | 76 - .../Orders/cancel_existing_authorization.php | 57 - .../PaymentsAPI/Orders/create_order.php | 106 - .../Orders/generate_customer_token.php | 82 - .../Sessions/create_new_credit_session.php | 96 - .../Sessions/read_credit_session.php | 57 - .../Sessions/update_credit_session.php | 79 - .../Payouts/get_all_payouts.php | 61 - .../SettlementsAPI/Payouts/get_payout.php | 57 - .../SettlementsAPI/Payouts/get_summary.php | 61 - .../Reports/payout_report_csv.php | 58 - .../Reports/payout_report_pdf.php | 58 - .../Reports/summary_report_cvs.php | 62 - .../Reports/summary_report_pdf.php | 62 - .../Transactions/get_transactions.php | 61 - .../klarna/kco_rest/docs/http_transport.md | 79 - .../Exceptions/NotApplicableException.php | 27 - .../src/Klarna/Rest/Checkout/Order.php | 28 +- .../src/Klarna/Rest/CustomerToken/Tokens.php | 116 - .../Rest/HostedPaymentPage/Sessions.php | 145 - .../Rest/InstantShopping/ButtonKeys.php | 137 - .../Klarna/Rest/InstantShopping/Orders.php | 128 - .../MerchantCardService/VCCSettlements.php | 151 - .../Klarna/Rest/OrderManagement/Capture.php | 23 +- .../src/Klarna/Rest/OrderManagement/Order.php | 128 +- .../Klarna/Rest/OrderManagement/Refund.php | 89 - .../src/Klarna/Rest/Payments/Orders.php | 141 - .../src/Klarna/Rest/Payments/Sessions.php | 117 - .../kco_rest/src/Klarna/Rest/Resource.php | 170 +- .../src/Klarna/Rest/Settlements/Payouts.php | 139 - .../src/Klarna/Rest/Settlements/Reports.php | 156 - .../Klarna/Rest/Settlements/Transactions.php | 84 - .../src/Klarna/Rest/Transport/ApiResponse.php | 148 - .../Klarna/Rest/Transport/CURLConnector.php | 303 - .../src/Klarna/Rest/Transport/Connector.php | 168 +- .../Rest/Transport/ConnectorInterface.php | 74 +- .../Exception/ConnectorException.php | 52 +- .../Klarna/Rest/Transport/GuzzleConnector.php | 280 - .../src/Klarna/Rest/Transport/Method.php | 29 - .../Rest/Transport/ResponseValidator.php | 104 +- .../src/Klarna/Rest/Transport/UserAgent.php | 18 +- .../Rest/Transport/UserAgentInterface.php | 2 +- .../vendor/klarna/kco_rest/src/autoload.php | 30 - .../vendor/psr/http-message/CHANGELOG.md | 36 - .../storage/vendor/psr/http-message/LICENSE | 19 - .../storage/vendor/psr/http-message/README.md | 13 - .../vendor/psr/http-message/composer.json | 26 - .../psr/http-message/src/MessageInterface.php | 187 - .../psr/http-message/src/RequestInterface.php | 129 - .../http-message/src/ResponseInterface.php | 68 - .../src/ServerRequestInterface.php | 261 - .../psr/http-message/src/StreamInterface.php | 158 - .../src/UploadedFileInterface.php | 123 - .../psr/http-message/src/UriInterface.php | 323 - .../vendor/ralouphie/getallheaders/LICENSE | 21 - .../vendor/ralouphie/getallheaders/README.md | 27 - .../ralouphie/getallheaders/composer.json | 26 - .../getallheaders/src/getallheaders.php | 46 - .../storage/vendor/react/promise/CHANGELOG.md | 24 - .../storage/vendor/react/promise/LICENSE | 4 +- .../storage/vendor/react/promise/README.md | 10 +- .../vendor/react/promise/composer.json | 23 +- .../vendor/react/promise/src/functions.php | 60 +- .../storage/vendor/scssphp/scssphp/bin/pscss | 0 .../symfony/deprecation-contracts/.gitignore | 3 - .../deprecation-contracts/CHANGELOG.md | 5 - .../symfony/deprecation-contracts/LICENSE | 19 - .../symfony/deprecation-contracts/README.md | 26 - .../deprecation-contracts/composer.json | 35 - .../deprecation-contracts/function.php | 27 - .../vendor/symfony/polyfill-ctype/Ctype.php | 53 +- .../symfony/polyfill-ctype/bootstrap.php | 4 - .../symfony/polyfill-ctype/bootstrap80.php | 46 - .../symfony/polyfill-ctype/composer.json | 7 +- .../vendor/symfony/polyfill-intl-idn/Idn.php | 925 --- .../vendor/symfony/polyfill-intl-idn/Info.php | 23 - .../vendor/symfony/polyfill-intl-idn/LICENSE | 19 - .../symfony/polyfill-intl-idn/README.md | 12 - .../Resources/unidata/DisallowedRanges.php | 375 -- .../Resources/unidata/Regex.php | 24 - .../Resources/unidata/deviation.php | 8 - .../Resources/unidata/disallowed.php | 2638 -------- .../unidata/disallowed_STD3_mapped.php | 308 - .../unidata/disallowed_STD3_valid.php | 71 - .../Resources/unidata/ignored.php | 273 - .../Resources/unidata/mapped.php | 5778 ----------------- .../Resources/unidata/virama.php | 65 - .../symfony/polyfill-intl-idn/bootstrap.php | 145 - .../symfony/polyfill-intl-idn/bootstrap80.php | 125 - .../symfony/polyfill-intl-idn/composer.json | 44 - .../symfony/polyfill-intl-normalizer/LICENSE | 19 - .../polyfill-intl-normalizer/Normalizer.php | 310 - .../polyfill-intl-normalizer/README.md | 14 - .../Resources/stubs/Normalizer.php | 17 - .../unidata/canonicalComposition.php | 945 --- .../unidata/canonicalDecomposition.php | 2065 ------ .../Resources/unidata/combiningClass.php | 876 --- .../unidata/compatibilityDecomposition.php | 3695 ----------- .../polyfill-intl-normalizer/bootstrap.php | 23 - .../polyfill-intl-normalizer/bootstrap80.php | 19 - .../polyfill-intl-normalizer/composer.json | 39 - .../symfony/polyfill-mbstring/Mbstring.php | 188 +- .../Resources/unidata/lowerCase.php | 2 +- .../Resources/unidata/upperCase.php | 129 +- .../symfony/polyfill-mbstring/bootstrap.php | 76 +- .../symfony/polyfill-mbstring/bootstrap80.php | 143 - .../symfony/polyfill-mbstring/composer.json | 7 +- .../vendor/symfony/polyfill-php72/LICENSE | 19 - .../vendor/symfony/polyfill-php72/Php72.php | 217 - .../vendor/symfony/polyfill-php72/README.md | 28 - .../symfony/polyfill-php72/bootstrap.php | 57 - .../symfony/polyfill-php72/composer.json | 35 - .../vendor/symfony/polyfill-php73/LICENSE | 19 - .../vendor/symfony/polyfill-php73/Php73.php | 43 - .../vendor/symfony/polyfill-php73/README.md | 18 - .../Resources/stubs/JsonException.php | 16 - .../symfony/polyfill-php73/bootstrap.php | 31 - .../symfony/polyfill-php73/composer.json | 36 - .../vendor/symfony/polyfill-php80/LICENSE | 19 - .../vendor/symfony/polyfill-php80/Php80.php | 115 - .../symfony/polyfill-php80/PhpToken.php | 103 - .../vendor/symfony/polyfill-php80/README.md | 24 - .../Resources/stubs/Attribute.php | 22 - .../Resources/stubs/PhpToken.php | 7 - .../Resources/stubs/Stringable.php | 11 - .../Resources/stubs/UnhandledMatchError.php | 7 - .../Resources/stubs/ValueError.php | 7 - .../symfony/polyfill-php80/bootstrap.php | 42 - .../symfony/polyfill-php80/composer.json | 40 - .../vendor/symfony/polyfill-php81/LICENSE | 19 - .../vendor/symfony/polyfill-php81/Php81.php | 37 - .../vendor/symfony/polyfill-php81/README.md | 16 - .../Resources/stubs/ReturnTypeWillChange.php | 11 - .../symfony/polyfill-php81/bootstrap.php | 28 - .../symfony/polyfill-php81/composer.json | 36 - .../symfony/translation-contracts/.gitignore | 3 - .../translation-contracts/CHANGELOG.md | 5 - .../symfony/translation-contracts/LICENSE | 19 - .../LocaleAwareInterface.php | 27 - .../symfony/translation-contracts/README.md | 9 - .../Test/TranslatorTest.php | 384 -- .../TranslatableInterface.php | 20 - .../TranslatorInterface.php | 68 - .../translation-contracts/TranslatorTrait.php | 260 - .../translation-contracts/composer.json | 37 - .../vendor/symfony/validator/CHANGELOG.md | 180 - .../validator/Command/DebugCommand.php | 203 - .../vendor/symfony/validator/Constraint.php | 143 +- .../symfony/validator/ConstraintValidator.php | 99 +- .../validator/ConstraintValidatorFactory.php | 9 +- .../ConstraintValidatorInterface.php | 7 +- .../symfony/validator/ConstraintViolation.php | 75 +- .../ConstraintViolationInterface.php | 13 +- .../validator/ConstraintViolationList.php | 66 +- .../ConstraintViolationListInterface.php | 20 +- .../Constraints/AbstractComparison.php | 30 +- .../AbstractComparisonValidator.php | 84 +- .../symfony/validator/Constraints/All.php | 10 +- .../validator/Constraints/AllValidator.php | 21 +- .../validator/Constraints/AtLeastOneOf.php | 57 - .../Constraints/AtLeastOneOfValidator.php | 63 - .../symfony/validator/Constraints/Bic.php | 54 +- .../validator/Constraints/BicValidator.php | 83 +- .../symfony/validator/Constraints/Blank.php | 14 +- .../validator/Constraints/BlankValidator.php | 18 +- .../validator/Constraints/Callback.php | 35 +- .../Constraints/CallbackValidator.php | 53 +- .../validator/Constraints/CardScheme.php | 42 +- .../Constraints/CardSchemeValidator.php | 93 +- .../symfony/validator/Constraints/Cascade.php | 42 - .../symfony/validator/Constraints/Choice.php | 49 +- .../validator/Constraints/ChoiceValidator.php | 94 +- .../symfony/validator/Constraints/Cidr.php | 80 - .../validator/Constraints/CidrValidator.php | 77 - .../validator/Constraints/Collection.php | 34 +- .../Constraints/CollectionValidator.php | 63 +- .../validator/Constraints/Composite.php | 38 +- .../validator/Constraints/Compound.php | 52 - .../Constraints/CompoundValidator.php | 35 - .../symfony/validator/Constraints/Count.php | 66 +- .../validator/Constraints/CountValidator.php | 72 +- .../symfony/validator/Constraints/Country.php | 27 +- .../Constraints/CountryValidator.php | 28 +- .../validator/Constraints/CssColor.php | 106 - .../Constraints/CssColorValidator.php | 86 - .../validator/Constraints/Currency.php | 20 +- .../Constraints/CurrencyValidator.php | 28 +- .../symfony/validator/Constraints/Date.php | 16 +- .../validator/Constraints/DateTime.php | 35 +- .../Constraints/DateTimeValidator.php | 57 +- .../validator/Constraints/DateValidator.php | 54 +- .../Constraints/DisableAutoMapping.php | 46 - .../validator/Constraints/DivisibleBy.php | 30 - .../Constraints/DivisibleByValidator.php | 56 - .../symfony/validator/Constraints/Email.php | 61 +- .../validator/Constraints/EmailValidator.php | 140 +- .../Constraints/EnableAutoMapping.php | 46 - .../symfony/validator/Constraints/EqualTo.php | 7 +- .../validator/Constraints/Existence.php | 2 +- .../validator/Constraints/Expression.php | 46 +- .../Constraints/ExpressionLanguageSyntax.php | 51 - .../ExpressionLanguageSyntaxValidator.php | 60 - .../Constraints/ExpressionValidator.php | 69 +- .../symfony/validator/Constraints/File.php | 113 +- .../validator/Constraints/FileValidator.php | 257 +- .../validator/Constraints/GreaterThan.php | 7 +- .../Constraints/GreaterThanOrEqual.php | 7 +- .../GreaterThanOrEqualValidator.php | 2 +- .../Constraints/GreaterThanValidator.php | 2 +- .../validator/Constraints/GroupSequence.php | 130 +- .../Constraints/GroupSequenceProvider.php | 1 - .../validator/Constraints/Hostname.php | 46 - .../Constraints/HostnameValidator.php | 69 - .../symfony/validator/Constraints/Iban.php | 30 +- .../validator/Constraints/IbanValidator.php | 94 +- .../validator/Constraints/IdenticalTo.php | 7 +- .../symfony/validator/Constraints/Image.php | 140 +- .../validator/Constraints/ImageValidator.php | 246 +- .../symfony/validator/Constraints/Ip.php | 60 +- .../validator/Constraints/IpValidator.php | 51 +- .../symfony/validator/Constraints/IsFalse.php | 14 +- .../Constraints/IsFalseValidator.php | 18 +- .../symfony/validator/Constraints/IsNull.php | 14 +- .../validator/Constraints/IsNullValidator.php | 18 +- .../symfony/validator/Constraints/IsTrue.php | 14 +- .../validator/Constraints/IsTrueValidator.php | 18 +- .../symfony/validator/Constraints/Isbn.php | 51 +- .../validator/Constraints/IsbnValidator.php | 78 +- .../symfony/validator/Constraints/Isin.php | 46 - .../validator/Constraints/IsinValidator.php | 81 - .../symfony/validator/Constraints/Issn.php | 34 +- .../validator/Constraints/IssnValidator.php | 118 +- .../symfony/validator/Constraints/Json.php | 39 - .../validator/Constraints/JsonValidator.php | 51 - .../validator/Constraints/Language.php | 27 +- .../Constraints/LanguageValidator.php | 28 +- .../symfony/validator/Constraints/Length.php | 75 +- .../validator/Constraints/LengthValidator.php | 97 +- .../validator/Constraints/LessThan.php | 7 +- .../validator/Constraints/LessThanOrEqual.php | 7 +- .../Constraints/LessThanOrEqualValidator.php | 2 +- .../Constraints/LessThanValidator.php | 2 +- .../symfony/validator/Constraints/Locale.php | 27 +- .../validator/Constraints/LocaleValidator.php | 35 +- .../symfony/validator/Constraints/Luhn.php | 20 +- .../validator/Constraints/LuhnValidator.php | 41 +- .../validator/Constraints/Negative.php | 26 - .../validator/Constraints/NegativeOrZero.php | 26 - .../validator/Constraints/NotBlank.php | 24 +- .../Constraints/NotBlankValidator.php | 27 +- .../Constraints/NotCompromisedPassword.php | 49 - .../NotCompromisedPasswordValidator.php | 105 - .../validator/Constraints/NotEqualTo.php | 7 +- .../validator/Constraints/NotIdenticalTo.php | 7 +- .../symfony/validator/Constraints/NotNull.php | 14 +- .../Constraints/NotNullValidator.php | 18 +- .../Constraints/NumberConstraintTrait.php | 45 - .../validator/Constraints/Positive.php | 26 - .../validator/Constraints/PositiveOrZero.php | 26 - .../symfony/validator/Constraints/Range.php | 107 +- .../validator/Constraints/RangeValidator.php | 185 +- .../symfony/validator/Constraints/Regex.php | 53 +- .../validator/Constraints/RegexValidator.php | 25 +- .../validator/Constraints/Sequentially.php | 52 - .../Constraints/SequentiallyValidator.php | 44 - .../symfony/validator/Constraints/Time.php | 20 +- .../validator/Constraints/TimeValidator.php | 48 +- .../validator/Constraints/Timezone.php | 89 - .../Constraints/TimezoneValidator.php | 124 - .../validator/Constraints/Traverse.php | 12 +- .../symfony/validator/Constraints/Type.php | 27 +- .../validator/Constraints/TypeValidator.php | 73 +- .../symfony/validator/Constraints/Ulid.php | 48 - .../validator/Constraints/UlidValidator.php | 69 - .../symfony/validator/Constraints/Unique.php | 51 - .../validator/Constraints/UniqueValidator.php | 68 - .../symfony/validator/Constraints/Url.php | 35 +- .../validator/Constraints/UrlValidator.php | 64 +- .../symfony/validator/Constraints/Uuid.php | 74 +- .../validator/Constraints/UuidValidator.php | 214 +- .../symfony/validator/Constraints/Valid.php | 28 +- .../validator/Constraints/ValidValidator.php | 38 - .../ZeroComparisonConstraintTrait.php | 45 - .../ContainerConstraintValidatorFactory.php | 62 - .../validator/Context/ExecutionContext.php | 223 +- .../Context/ExecutionContextFactory.php | 15 +- .../ExecutionContextFactoryInterface.php | 7 +- .../Context/ExecutionContextInterface.php | 172 +- .../DataCollector/ValidatorDataCollector.php | 108 - .../AddAutoMappingConfigurationPass.php | 100 - .../AddConstraintValidatorsPass.php | 60 - .../AddValidatorInitializersPass.php | 50 - .../Exception/ExceptionInterface.php | 2 +- .../Exception/InvalidOptionsException.php | 2 +- .../validator/Exception/LogicException.php | 16 - .../Exception/MissingOptionsException.php | 2 +- .../Exception/UnexpectedTypeException.php | 4 +- .../Exception/UnexpectedValueException.php | 32 - .../Exception/ValidationFailedException.php | 40 - .../GroupSequenceProviderInterface.php | 2 +- .../storage/vendor/symfony/validator/LICENSE | 2 +- .../validator/Mapping/AutoMappingStrategy.php | 42 - .../validator/Mapping/CascadingStrategy.php | 4 +- .../validator/Mapping/ClassMetadata.php | 222 +- .../Mapping/ClassMetadataInterface.php | 55 +- .../Factory/BlackHoleMetadataFactory.php | 4 +- .../Factory/LazyLoadingMetadataFactory.php | 68 +- .../Factory/MetadataFactoryInterface.php | 24 +- .../validator/Mapping/GenericMetadata.php | 81 +- .../validator/Mapping/GetterMetadata.php | 8 +- .../Mapping/Loader/AbstractLoader.php | 21 +- .../Mapping/Loader/AnnotationLoader.php | 45 +- .../Mapping/Loader/AutoMappingTrait.php | 34 - .../validator/Mapping/Loader/FileLoader.php | 8 +- .../validator/Mapping/Loader/FilesLoader.php | 14 +- .../validator/Mapping/Loader/LoaderChain.php | 10 +- .../Mapping/Loader/LoaderInterface.php | 2 +- .../Mapping/Loader/PropertyInfoLoader.php | 179 - .../Mapping/Loader/StaticMethodLoader.php | 4 +- .../Mapping/Loader/XmlFileLoader.php | 72 +- .../Mapping/Loader/XmlFilesLoader.php | 2 +- .../Mapping/Loader/YamlFileLoader.php | 69 +- .../Mapping/Loader/YamlFilesLoader.php | 2 +- .../validator/Mapping/MemberMetadata.php | 98 +- .../validator/Mapping/MetadataInterface.php | 18 +- .../validator/Mapping/PropertyMetadata.php | 25 +- .../Mapping/PropertyMetadataInterface.php | 20 +- .../validator/Mapping/TraversalStrategy.php | 16 +- .../validator/ObjectInitializerInterface.php | 11 +- .../vendor/symfony/validator/README.md | 12 +- .../Resources/translations/validators.af.xlf | 160 - .../Resources/translations/validators.ar.xlf | 92 - .../Resources/translations/validators.az.xlf | 164 - .../Resources/translations/validators.be.xlf | 407 -- .../Resources/translations/validators.bg.xlf | 118 +- .../Resources/translations/validators.bs.xlf | 407 -- .../Resources/translations/validators.ca.xlf | 96 - .../Resources/translations/validators.cs.xlf | 84 - .../Resources/translations/validators.cy.xlf | 108 - .../Resources/translations/validators.da.xlf | 158 +- .../Resources/translations/validators.de.xlf | 80 - .../Resources/translations/validators.el.xlf | 134 +- .../Resources/translations/validators.en.xlf | 76 - .../Resources/translations/validators.es.xlf | 82 +- .../Resources/translations/validators.et.xlf | 136 +- .../Resources/translations/validators.eu.xlf | 104 - .../Resources/translations/validators.fa.xlf | 244 +- .../Resources/translations/validators.fi.xlf | 176 - .../Resources/translations/validators.fr.xlf | 82 +- .../Resources/translations/validators.gl.xlf | 90 +- .../Resources/translations/validators.he.xlf | 128 +- .../Resources/translations/validators.hr.xlf | 120 +- .../Resources/translations/validators.hu.xlf | 80 - .../Resources/translations/validators.hy.xlf | 104 +- .../Resources/translations/validators.id.xlf | 84 - .../Resources/translations/validators.it.xlf | 80 - .../Resources/translations/validators.ja.xlf | 76 - .../Resources/translations/validators.lb.xlf | 72 +- .../Resources/translations/validators.lt.xlf | 110 +- .../Resources/translations/validators.lv.xlf | 94 +- .../Resources/translations/validators.mn.xlf | 254 +- .../Resources/translations/validators.my.xlf | 395 -- .../Resources/translations/validators.nb.xlf | 72 - .../Resources/translations/validators.nl.xlf | 84 - .../Resources/translations/validators.nn.xlf | 166 +- .../Resources/translations/validators.no.xlf | 72 - .../Resources/translations/validators.pl.xlf | 78 +- .../Resources/translations/validators.pt.xlf | 116 +- .../translations/validators.pt_BR.xlf | 88 - .../Resources/translations/validators.ro.xlf | 116 - .../Resources/translations/validators.ru.xlf | 102 +- .../Resources/translations/validators.sk.xlf | 90 +- .../Resources/translations/validators.sl.xlf | 84 - .../Resources/translations/validators.sq.xlf | 202 +- .../translations/validators.sr_Cyrl.xlf | 108 +- .../translations/validators.sr_Latn.xlf | 194 +- .../Resources/translations/validators.sv.xlf | 84 - .../Resources/translations/validators.th.xlf | 150 +- .../Resources/translations/validators.tl.xlf | 90 +- .../Resources/translations/validators.tr.xlf | 178 +- .../Resources/translations/validators.uk.xlf | 84 - .../Resources/translations/validators.uz.xlf | 407 -- .../Resources/translations/validators.vi.xlf | 142 +- .../translations/validators.zh_CN.xlf | 112 +- .../translations/validators.zh_TW.xlf | 138 +- .../Test/ConstraintValidatorTestCase.php | 584 -- .../symfony/validator/Util/PropertyPath.php | 11 +- .../vendor/symfony/validator/Validation.php | 60 +- .../ContextualValidatorInterface.php | 29 +- .../validator/Validator/LazyProperty.php | 32 - .../RecursiveContextualValidator.php | 261 +- .../Validator/RecursiveValidator.php | 68 +- .../Validator/TraceableValidator.php | 136 - .../Validator/ValidatorInterface.php | 27 +- .../symfony/validator/ValidatorBuilder.php | 276 +- .../Violation/ConstraintViolationBuilder.php | 39 +- .../ConstraintViolationBuilderInterface.php | 14 +- .../vendor/symfony/validator/composer.json | 66 +- 851 files changed, 11838 insertions(+), 72591 deletions(-) mode change 100644 => 100755 upload/system/storage/vendor/bin/pscss delete mode 100644 upload/system/storage/vendor/bin/pscss.bat delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/PayPalMessageDetails.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/GatewayTimeout.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/RequestTimeout.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/ServiceUnavailable.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/AuthenticationIds.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/GooglePayCardDetails.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/PayPalHereDetails.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php delete mode 100644 upload/system/storage/vendor/braintree/braintree_php/phpcs.xml delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraint.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraintValidator.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php delete mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/oauth-subscriber/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/LICENSE delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/Makefile delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/README.md delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/composer.json delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/CancellationException.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Coroutine.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Create.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Each.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Is.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/PromisorInterface.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/RejectedPromise.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/Utils.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/functions.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/FUNDING.yml delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/stale.yml delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/LICENSE delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/README.md delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/composer.json delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/PumpStream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php delete mode 100644 upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/.gitattributes delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/LICENSE delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php delete mode 100644 upload/system/storage/vendor/klarna/kco_rest/src/autoload.php delete mode 100644 upload/system/storage/vendor/psr/http-message/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/psr/http-message/LICENSE delete mode 100644 upload/system/storage/vendor/psr/http-message/README.md delete mode 100644 upload/system/storage/vendor/psr/http-message/composer.json delete mode 100644 upload/system/storage/vendor/psr/http-message/src/MessageInterface.php delete mode 100644 upload/system/storage/vendor/psr/http-message/src/RequestInterface.php delete mode 100644 upload/system/storage/vendor/psr/http-message/src/ResponseInterface.php delete mode 100644 upload/system/storage/vendor/psr/http-message/src/ServerRequestInterface.php delete mode 100644 upload/system/storage/vendor/psr/http-message/src/StreamInterface.php delete mode 100644 upload/system/storage/vendor/psr/http-message/src/UploadedFileInterface.php delete mode 100644 upload/system/storage/vendor/psr/http-message/src/UriInterface.php delete mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/LICENSE delete mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/README.md delete mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/composer.json delete mode 100644 upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php mode change 100644 => 100755 upload/system/storage/vendor/scssphp/scssphp/bin/pscss delete mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore delete mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/README.md delete mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/composer.json delete mode 100644 upload/system/storage/vendor/symfony/deprecation-contracts/function.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/deviation.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json delete mode 100644 upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/Php72.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/README.md delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php72/composer.json delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/Php73.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/README.md delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php73/composer.json delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Php80.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/README.md delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/bootstrap.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php80/composer.json delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/Php81.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/README.md delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/bootstrap.php delete mode 100644 upload/system/storage/vendor/symfony/polyfill-php81/composer.json delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/.gitignore delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/LICENSE delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/README.md delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php delete mode 100644 upload/system/storage/vendor/symfony/translation-contracts/composer.json delete mode 100644 upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Compound.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Isin.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Json.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Negative.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Positive.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Unique.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php delete mode 100644 upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php delete mode 100644 upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php delete mode 100644 upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php delete mode 100644 upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php delete mode 100644 upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Exception/LogicException.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf delete mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf delete mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf delete mode 100644 upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf delete mode 100644 upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php delete mode 100644 upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php diff --git a/composer.json b/composer.json index cd2a1b31afb..23168a149e4 100644 --- a/composer.json +++ b/composer.json @@ -9,14 +9,13 @@ "vendor-dir": "./upload/system/storage/vendor/" }, "require": { + "braintree/braintree_php" : "3.40.0", + "cardinity/cardinity-sdk-php": "^1.0", + "divido/divido-php": ">=1.1.1", + "klarna/kco_rest": "^2.2", "php": ">=5.4.0", "scssphp/scssphp": "1.1.1", - "react/promise": "^2.9", - "twig/twig": "^3.3", - "braintree/braintree_php": "^6.7", - "cardinity/cardinity-sdk-php": "^3.0", - "divido/divido-php": "^1.15", - "zoujingli/wechat-php-sdk": "^1.3", - "klarna/kco_rest": "^4.2" + "zoujingli/wechat-php-sdk": ">=1.3.10", + "twig/twig": "^3.0" } } diff --git a/composer.lock b/composer.lock index 89f029bbc6c..d137724d121 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7fc9af796366d8ed1b0ccbb54c20f5fb", + "content-hash": "5cc983b6051cd7110cdf897ca88bbefc", "packages": [ { "name": "braintree/braintree_php", - "version": "6.7.0", + "version": "3.40.0", "source": { "type": "git", "url": "https://github.com/braintree/braintree_php.git", - "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1" + "reference": "840fc6ebf8d96756fed475cce94565fef178187d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/braintree/braintree_php/zipball/3406aa331c3eb5ac38aecb135389897dd50f35a1", - "reference": "3406aa331c3eb5ac38aecb135389897dd50f35a1", + "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", + "reference": "840fc6ebf8d96756fed475cce94565fef178187d", "shasum": "" }, "require": { @@ -26,16 +26,15 @@ "ext-hash": "*", "ext-openssl": "*", "ext-xmlwriter": "*", - "php": ">=7.3.0" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0", - "squizlabs/php_codesniffer": "^3.0" + "phpunit/phpunit": "3.7.*" }, "type": "library", "autoload": { - "psr-4": { - "Braintree\\": "lib/Braintree" + "psr-0": { + "Braintree": "lib" } }, "notification-url": "https://packagist.org/downloads/", @@ -45,41 +44,37 @@ "authors": [ { "name": "Braintree", - "homepage": "https://www.braintreepayments.com" + "homepage": "http://www.braintreepayments.com" } ], "description": "Braintree PHP Client Library", - "support": { - "issues": "https://github.com/braintree/braintree_php/issues", - "source": "https://github.com/braintree/braintree_php/tree/6.7.0" - }, - "time": "2022-02-23T22:28:07+00:00" + "time": "2015-07-15T15:07:13+00:00" }, { "name": "cardinity/cardinity-sdk-php", - "version": "v3.0.4", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/cardinity/cardinity-sdk-php.git", - "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f" + "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", - "reference": "8a3e79ebc89cf26777f27a061ff356e8eeb1c47f", + "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/f51f6fbacee393b4eeff7b80be2b1cee77896b4c", + "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.2.1", - "guzzlehttp/oauth-subscriber": "0.3.*", - "php": ">=7.2.5", - "symfony/validator": "^5.0.0" + "guzzlehttp/guzzle": "~5.1", + "guzzlehttp/log-subscriber": "~1.0", + "guzzlehttp/oauth-subscriber": "0.2.*", + "php": ">=5.4.0", + "symfony/validator": "~2.6" }, "require-dev": { "monolog/monolog": "~1.0", - "phpspec/phpspec": "~6.2", - "phpunit/phpunit": "^8.5", - "symfony/yaml": "^4.4" + "phpspec/phpspec": "~2.1", + "phpunit/phpunit": "~4.3" }, "type": "library", "autoload": { @@ -92,12 +87,8 @@ "MIT" ], "description": "Client library for Cardinity credit card processing API", - "homepage": "https://cardinity.com", - "support": { - "issues": "https://github.com/cardinity/cardinity-sdk-php/issues", - "source": "https://github.com/cardinity/cardinity-sdk-php/tree/v3.0.4" - }, - "time": "2022-02-02T11:25:15+00:00" + "homepage": "http://cardinity.com", + "time": "2016-12-29T09:57:23+00:00" }, { "name": "divido/divido-php", @@ -146,43 +137,29 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.5", + "version": "5.3.4", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", + "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", "shasum": "" }, "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17.0" + "guzzlehttp/ringphp": "^1.1", + "php": ">=5.4.0", + "react/promise": "^2.2" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" + "phpunit/phpunit": "^4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5-dev" - } - }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" } @@ -198,7 +175,7 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Guzzle is a PHP HTTP client library", + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -209,29 +186,26 @@ "rest", "web service" ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5" - }, - "time": "2020-06-16T21:01:06+00:00" + "time": "2019-10-30T09:32:00+00:00" }, { - "name": "guzzlehttp/oauth-subscriber", - "version": "0.3.0", + "name": "guzzlehttp/log-subscriber", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/guzzle/oauth-subscriber.git", - "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf" + "url": "https://github.com/guzzle/log-subscriber.git", + "reference": "99c3c0004165db721d8ef7bbef60c996210e538a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", - "reference": "04960cdef3cd80ea401d6b0ca8b3e110e9bf12cf", + "url": "https://api.github.com/repos/guzzle/log-subscriber/zipball/99c3c0004165db721d8ef7bbef60c996210e538a", + "reference": "99c3c0004165db721d8ef7bbef60c996210e538a", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "~6.0", - "php": ">=5.5.0" + "guzzlehttp/guzzle": "~4.0 | ~5.0", + "php": ">=5.4.0", + "psr/log": "~1.0" }, "require-dev": { "phpunit/phpunit": "~4.0" @@ -239,12 +213,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.3-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "GuzzleHttp\\Subscriber\\Oauth\\": "src" + "GuzzleHttp\\Subscriber\\Log\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -258,50 +232,46 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Guzzle OAuth 1.0 subscriber", + "description": "Logs HTTP requests and responses as they are sent over the wire (Guzzle 4+)", "homepage": "http://guzzlephp.org/", "keywords": [ "Guzzle", - "oauth" + "log", + "plugin" ], - "support": { - "issues": "https://github.com/guzzle/oauth-subscriber/issues", - "source": "https://github.com/guzzle/oauth-subscriber/tree/master" - }, - "time": "2015-08-15T19:44:28+00:00" + "abandoned": true, + "time": "2014-10-13T03:31:43+00:00" }, { - "name": "guzzlehttp/promises", - "version": "1.5.1", + "name": "guzzlehttp/oauth-subscriber", + "version": "0.2.0", "source": { "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "url": "https://github.com/guzzle/oauth-subscriber.git", + "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/03f1ebe31d3112526106d0570c80eba6820e86e5", + "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5", "shasum": "" }, "require": { - "php": ">=5.5" + "guzzlehttp/guzzle": "~4.0|~5.0", + "php": ">=5.4.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "0.1-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { - "GuzzleHttp\\Promise\\": "src/" + "GuzzleHttp\\Subscriber\\Oauth\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -309,92 +279,55 @@ "MIT" ], "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" } ], - "description": "Guzzle promises library", + "description": "Guzzle OAuth 1.0 subscriber", + "homepage": "http://guzzlephp.org/", "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } + "Guzzle", + "oauth" ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2014-10-23T22:19:02+00:00" }, { - "name": "guzzlehttp/psr7", - "version": "1.8.3", + "name": "guzzlehttp/ringphp", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" + "url": "https://github.com/guzzle/RingPHP.git", + "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", - "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", + "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", "shasum": "" }, "require": { + "guzzlehttp/streams": "~3.0", "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" + "react/promise": "~2.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "ext-curl": "*", + "phpunit/phpunit": "~4.0" }, "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + "ext-curl": "Guzzle will use specific adapters if cURL is present" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.1-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" + "GuzzleHttp\\Ring\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -402,100 +335,99 @@ "MIT" ], "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" } ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.3" + "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", + "abandoned": true, + "time": "2018-07-31T13:22:33+00:00" + }, + { + "name": "guzzlehttp/streams", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/streams.git", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" } ], - "time": "2021-10-05T13:56:00+00:00" + "description": "Provides a simple abstraction over streams of data", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "stream" + ], + "abandoned": true, + "time": "2014-10-12T19:18:40+00:00" }, { "name": "klarna/kco_rest", - "version": "v4.2.3", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/klarna/kco_rest_php.git", - "reference": "6c092bdd155cc8d6564503beb703ea721958381a" + "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/6c092bdd155cc8d6564503beb703ea721958381a", - "reference": "6c092bdd155cc8d6564503beb703ea721958381a", + "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/8a2142a2ebb087bb61901d51d1bb9698790e78c5", + "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "~6.0", - "php": ">=5.5.0" + "guzzlehttp/guzzle": ">=4.2,<6.0", + "php": ">=5.4.0" }, "require-dev": { - "apigen/apigen": "4.1.*", - "klarna/apigen-theme": "2.1.0", - "php-coveralls/php-coveralls": "^2.1", + "apigen/apigen": "4.0.*", + "klarna/apigen-theme": "~1.0", "phploc/phploc": "2.0.*", "phpmd/phpmd": "2.1.*", - "phpunit/phpunit": ">=4.0.0, <6.0", + "phpunit/phpunit": "4.2.*", + "satooshi/php-coveralls": "0.6.*", "sebastian/phpcpd": "2.0.*", "squizlabs/php_codesniffer": "1.5.*" }, "type": "library", "autoload": { "psr-4": { - "Klarna\\": "src/Klarna/" + "": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -504,30 +436,27 @@ ], "authors": [ { - "name": "Klarna AB" + "name": "Klarna AB", + "email": "integration@klarna.com" } ], - "description": "Official Klarna REST PHP SDK", + "description": "Klarna Checkout PHP SDK", "homepage": "http://developers.klarna.com", - "support": { - "issues": "https://github.com/klarna/kco_rest_php/issues", - "source": "https://github.com/klarna/kco_rest_php/tree/v4.x" - }, "abandoned": true, - "time": "2020-02-14T09:31:35+00:00" + "time": "2015-12-07T09:51:35+00:00" }, { - "name": "psr/http-message", - "version": "1.0.1", + "name": "psr/log", + "version": "1.1.3", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "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/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -536,12 +465,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Http\\Message\\": "src/" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -554,93 +483,43 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "http", - "http-message", + "log", "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } + "psr-3" ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "react/promise", - "version": "v2.9.0", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "React\\Promise\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -649,23 +528,7 @@ "authors": [ { "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" + "email": "jsorgalla@gmail.com" } ], "description": "A lightweight implementation of CommonJS Promises/A for PHP", @@ -673,21 +536,7 @@ "promise", "promises" ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" - }, - "funding": [ - { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-11T10:27:51+00:00" + "time": "2020-05-12T15:16:56+00:00" }, { "name": "scssphp/scssphp", @@ -748,42 +597,44 @@ "scss", "stylesheet" ], - "support": { - "issues": "https://github.com/scssphp/scssphp/issues", - "source": "https://github.com/scssphp/scssphp/tree/1.1.1" - }, "time": "2020-06-04T17:30:40+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v3.0.0", + "name": "symfony/polyfill-ctype", + "version": "v1.18.0", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-master": "1.18-dev" }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, "files": [ - "function.php" + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -792,19 +643,22 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A generic function and convention to trigger deprecation notices", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" - }, + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -819,35 +673,32 @@ "type": "tidelift" } ], - "time": "2021-11-01T23:48:49+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.25.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.18.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" + "php": ">=5.3.3" }, "suggest": { - "ext-ctype": "For best performance" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", @@ -855,12 +706,12 @@ } }, "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, "files": [ "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -868,25 +719,23 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", + "mbstring", "polyfill", - "portable" + "portable", + "shim" ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" - }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -901,47 +750,53 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { - "name": "symfony/polyfill-intl-idn", - "version": "v1.25.0", + "name": "symfony/translation", + "version": "v3.0.9", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44" + "url": "https://github.com/symfony/translation.git", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", - "reference": "749045c69efb97c70d25d7463abba812e91f3a44", + "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" }, "suggest": { - "ext-intl": "For best performance" + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "dev-master": "3.0-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -949,679 +804,66 @@ ], "authors": [ { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-09-14T14:02:44+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-30T18:21:41+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T09:17:38+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-06-05T21:20:04+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-03-04T08:16:47+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-09-13T13:58:11+00:00" - }, - { - "name": "symfony/translation-contracts", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to translation", + "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-09-07T12:43:40+00:00" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/validator", - "version": "v5.4.5", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf" + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/06c3d849fa19a0ece7b6eed240036772c4b5faaf", - "reference": "06c3d849fa19a0ece7b6eed240036772c4b5faaf", + "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=5.3.9", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/translation-contracts": "^1.1|^2|^3" - }, - "conflict": { - "doctrine/annotations": "<1.13", - "doctrine/cache": "<1.11", - "doctrine/lexer": "<1.1", - "phpunit/phpunit": "<5.4.3", - "symfony/dependency-injection": "<4.4", - "symfony/expression-language": "<5.1", - "symfony/http-kernel": "<4.4", - "symfony/intl": "<4.4", - "symfony/property-info": "<5.3", - "symfony/translation": "<4.4", - "symfony/yaml": "<4.4" + "symfony/translation": "~2.4|~3.0.0" }, "require-dev": { - "doctrine/annotations": "^1.13", - "doctrine/cache": "^1.11|^2.0", - "egulias/email-validator": "^2.1.10|^3", - "symfony/cache": "^4.4|^5.0|^6.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", - "symfony/expression-language": "^5.1|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/property-info": "^5.3|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.1", + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.4|~3.0.0", + "symfony/http-foundation": "~2.3|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/property-access": "~2.3|~3.0.0", + "symfony/yaml": "^2.0.5|~3.0.0" }, "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", "egulias/email-validator": "Strict (RFC compliant) email validation", - "psr/cache-implementation": "For using the mapping cache.", "symfony/config": "", - "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints", + "symfony/expression-language": "For using the 2.4 Expression validator", "symfony/http-foundation": "", "symfony/intl": "", - "symfony/property-access": "For accessing properties within comparison constraints", - "symfony/property-info": "To automatically add NotNull and Type constraints", - "symfony/translation": "For translating validation errors.", + "symfony/property-access": "For using the 2.4 Validator API", "symfony/yaml": "" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, "autoload": { "psr-4": { "Symfony\\Component\\Validator\\": "" @@ -1644,26 +886,9 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides tools to validate values", + "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/validator/tree/v5.4.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-02-25T08:05:40+00:00" + "time": "2018-11-14T14:06:48+00:00" }, { "name": "twig/twig", @@ -1776,10 +1001,6 @@ "keywords": [ "wechat-php-sdk" ], - "support": { - "issues": "https://github.com/zoujingli/wechat-php-sdk/issues", - "source": "https://github.com/zoujingli/wechat-php-sdk/tree/v1.3.18" - }, "time": "2019-10-10T09:42:15+00:00" } ], diff --git a/upload/system/storage/vendor/autoload.php b/upload/system/storage/vendor/autoload.php index 3871e94aa54..90ade14a0bf 100644 --- a/upload/system/storage/vendor/autoload.php +++ b/upload/system/storage/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59::getLoader(); +return ComposerAutoloaderInit739b8c4876316c3496b6b4e434ec69a5::getLoader(); diff --git a/upload/system/storage/vendor/bin/pscss b/upload/system/storage/vendor/bin/pscss old mode 100644 new mode 100755 index 2879dcb9771..c1aa681516e --- a/upload/system/storage/vendor/bin/pscss +++ b/upload/system/storage/vendor/bin/pscss @@ -1,14 +1,97 @@ -#!/usr/bin/env sh +#!/usr/bin/env php + /dev/null; cd "../scssphp/scssphp/bin" && pwd) +/** + * Proxy PHP file generated by Composer + * + * This file includes the referenced bin path (../scssphp/scssphp/bin/pscss) + * using a stream wrapper to prevent the shebang from being output on PHP<8 + * + * @generated + */ -if [ -d /proc/cygdrive ]; then - case $(which php) in - $(readlink -n /proc/cygdrive)/*) - # We are in Cygwin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); - ;; - esac -fi +namespace Composer; -"${dir}/pscss" "$@" +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 21); + $opened_path = realpath($opened_path) ?: $opened_path; + $this->handle = fopen($opened_path, $mode); + $this->position = 0; + + // remove all traces of this stream wrapper once it has been used + stream_wrapper_unregister('composer-bin-proxy'); + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return fstat($this->handle); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { + include("composer-bin-proxy://" . __DIR__ . '/..'.'/scssphp/scssphp/bin/pscss'); + exit(0); + } +} + +include __DIR__ . '/..'.'/scssphp/scssphp/bin/pscss'; diff --git a/upload/system/storage/vendor/bin/pscss.bat b/upload/system/storage/vendor/bin/pscss.bat deleted file mode 100644 index 1e368dc9237..00000000000 --- a/upload/system/storage/vendor/bin/pscss.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../scssphp/scssphp/bin/pscss -php "%BIN_TARGET%" %* diff --git a/upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md b/upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md index 9afa12ef52c..f0d3304ec58 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md +++ b/upload/system/storage/vendor/braintree/braintree_php/CHANGELOG.md @@ -1,213 +1,7 @@ -# Changelog - -## 6.7.0 -* Fix lint errors on unit test - -## 6.6.0 -* Add `PaymentMethodCustomerDataUpdated` webhook notification support - -## 6.5.1 -* Address PHP 8.1 Deprecation warnings - -## 6.5.0 -* Add plan create/update/find API endpoint -* Add `TransactionReview` webhook notification - -## 6.4.1 -* Add `exchangeRateQuoteId` to `Transaction.sale` -* Add error code `EXCHANGE_RATE_QUOTE_ID_IS_TOO_LONG` -* Added the following fields to GooglePayCard and ApplePayCard: - * `commercial` - * `debit` - * `durbinRegulated` - * `healthcare` - * `payroll` - * `prepaid` - * `productId` - * `countryOfIssuance` - * `issuingBank` -* Add `LocalPaymentExpired` and `LocalPaymentFunded` webhook notification support - -## 6.3.0 -* Add `paymentReaderCardDetails` parameter to `Transaction.sale` -* Add error code `TRANSACTION_TAX_AMOUNT_IS_REQUIRED_FOR_AIB_SWEDISH` for attribute `taxAmount` in `transaction` key for AIB:Domestic transactions in Sweden. - -## 6.2.0 -* Add `chargebackProtectionLevel ` to `Dispute` and `DisputeSearch` -* Add `skipAdvancedFraudChecking` to: - * `CreditCard.create` and `CreditCard.update` - * `PaymentMethod.create` and `PaymentMethod.update` - -## 6.1.0 -* Add `paypalMessages` to `Dispute` -* Fix bug where `__isset` methods in `Instance` and `Base` classes treated `null` value as set (Thanks @sklodzio) -* Add `tax_identifiers` parameter to `Customer.create` and `Customer.update` -* Add webhook sample for `GrantedPaymentMethodRevoked` -* Add sample webhook notifications for `SUBSCRIPTION_EXPIRED`, `SUBSCRIPTION_CANCELED` and `SUBSCRIPTION_WENT_PAST_DUE` (thanks @antonvolokha) - -## 6.0.0 -* Add `LocalPaymentReversed` webhook -* Add `adjustAuthorization` method to Transaction, for supporting multiple authorizations on a single transaction -* Add `storeId` and `storeIds` to Transaction search -* Add `merchantAccountId` parameter to Transaction refund -* Parameters that supported DateTime objects can also support DateTimeImmutable objects (closes #278) -* Add `toArray` function to Base and Instance classes (resolves #289) -* Add `jsonSerialize` to Instance class -* Breaking Changes: - * Require PHP 7.3 or higher - * Rename `AndroidPayCard` to `GooglePayCard` - * Rename `AndroidPayCardDetails` to `GooglePayCardDetails` - * Remove Configuration#isAuthenticatedInstanceProxy method in favor of Configuration#isAuthenticatedProxy - * Remove Configuration#isUsingInstanceProxy method in favor of Configuration#isUsingProxy - * Remove `TRANSACTION_EXTERNAL_VAULT_CARD_TYPE_IS_INVALID ` and `RISK_DATA_CUSTOMER_BROWSER_IS_TOO_LONG` error codes - * Remove `customer_ip` and `customer_browser` snake case parameters in favor of camel case `customerIp` and `customerBrowser` accepted in `Customer#create` and `Transaction#sale` - * Remove `AmexExpressCheckoutCard` and `AmexExpressCheckoutCardDetails` - * Remove `MasterpassCard` and `MasterpassCardDetails` - * Remove deprecated parameters: - * `deviceSessionId` from CreditCardGateway#update, CreditCardGateway#create, CustomerGateway#create, CustomerGateway#update, PaymentMethodGateay#update, and TransactionGateway#create - * `fraudMerchantId` from CreditCardGateway#update, CreditCardGateway#create, CustomerGateway#create, CustomerGateway#update, PaymentMethodGateay#update, and TransactionGateway#create - -## 5.5.0 -* Add `scaExemption` to Transaction sale -* Deprecate `deviceSessionId` and `fraudMerchantId` in `CreditCardGateway`, `CustomerGateway`, `PaymentMethodGateway`, and `TransactionGateway` classes -* Add `installments` to Transaction sale -* Add `count` to `installments` - -## 5.4.0 -* Add `AcquirerReferenceNumber` to `Transaction` -* Add `billingAgreementId` to `PayPalDetails` -* Deprecate `recurring` in Transaction sale -* Deprecate `tag` in Dispute add text evidence - -## 5.3.1 -* Deprecate `masterpassCard` and `amexExpressCheckoutCard` payment methods -* Deprecate `amexExpressCheckoutCardDetails` - -## 5.3.0 -* Add `RISK_THRESHOLD` to `GatewayRejectionReason` constants -* Add `networkTransactionId` to `CreditCardVerification` -* Add `processedWithNetworkToken` to `Transaction` -* Add `isNetworkTokenized` to `CreditCard` -* Add `productSku` to `Transaction` -* Add `phoneNumber` and `shippingMethod` to `Address` -* Add `customerDeviceId`, `customerLocationZip`, and `customerTenure` to `RiskData` -* Add error codes - * `TRANSACTION_PRODUCT_SKU_IS_INVALID` - * `TRANSACTION_SHIPPING_METHOD_IS_INVALID` - * `TRANSACTION_SHIPPING_PHONE_NUMBER_IS_INVALID` - * `TRANSACTION_BILLING_PHONE_NUMBER_IS_INVALID` - * `RISK_DATA_CUSTOMER_BROWSER_IS_TOO_LONG` - * `RISK_DATA_CUSTOMER_DEVICE_ID_IS_TOO_LONG` - * `RISK_DATA_CUSTOMER_LOCATION_ZIP_INVALID_CHARACTERS` - * `RISK_DATA_CUSTOMER_LOCATION_ZIP_IS_INVALID` - * `RISK_DATA_CUSTOMER_LOCATION_ZIP_IS_TOO_LONG` - * `RISK_DATA_CUSTOMER_TENURE_IS_TOO_LONG` - * `RISK_DATA_CUSTOMER_TENURE_IS_INVALID` - -## 5.2.0 -* Add `retrieval_reference_number` to `Transaction` -* Fix class alias issue where Exceptions could not be thrown for missing libraries or older PHP versions. -* Fix issue where `proxyHost`, `proxyPort`, `proxyType`, `proxyUser`, `proxyPassword`, and `sslVersion` were not being set on Gateway or Configuration objects. - -## 5.1.0 -* Add `threeDSecurePassThru` parameters to `Customer.create`, `PaymentMethod.create`, `CreditCard.create`, `Customer.update`, `PaymentMethod.update` and `CreditCard.update` -* Add `recurringCustomerConsent` and `recurringMaxAmount` to `authenticationInsightOptions` for `PaymentMethodNonce.create` -* Add `DOCUMENT_UPLOAD_FILE_IS_EMPTY` error code -* phpDocs fixes (thanks @pupitooo) - -## 5.0.0 -* Add `DISPUTE_ACCEPTED`, `DISPUTE_DISPUTED`, and `DISPUTE_EXPIRED` webhook constants -* Breaking Changes: - * Upgrade API version to retrieve declined refund transactions - * Throw `RequestTimeout` instead of `Timeout` for transaction search - * Drop PSR-0 Support and remove class aliases - * Remove EuropeBankAccount and IbanBankAccount modules - * Remove deprecated SEPA error codes - * Remove `paypalVaultWithoutUpgrade` - * Invalid transaction IDs are validated by the gateway and not the SDK - -## 4.8.0 -* Add `Authentication Insight` to payment method nonce create -* Add `threeDSecureAuthenticationId` support to transaction sale -* Add ThreeDSecure test payment method nonces -* Add test `AuthenticationId`s - -## 4.7.0 -* Add `RefundAuthHardDeclined` and `RefundAuthSoftDeclined` to validation errors -* Add level 2 processing options `purchaseOrderNumber`, `taxAmount`, and `taxExempt` to Transaction submit for settlement -* Add level 3 processing options `discountAmount`, `shippingAmount`, `shipsFromPostalCode`, and `lineItems` to Transaction submit for settlement - -## 4.6.0 -* Add `isNetworkTokenized` to `AndroidPayCard` and `AndroidPayCardDetails` -* Add GraphQL ID to `CreditCardVerification`, `Customer`, `Dispute`, and `Transaction` -* Add support for PHP 7.4 (#262 thanks @slt) -* Add `threeDSecurePassThru` params to PaymentMethod update - -## 4.5.0 -* Add `PROCESSOR_DOES_NOT_SUPPORT_MOTO_FOR_CARD_TYPE` to validation errors -* Make errors JSON serializable (#256 thanks @sebdesign) - -## 4.4.0 -* Add `AMOUNT_NOT_SUPPORTED_BY_PROCESSOR` to validation errors -* Forward `forwardedComments` to `processorComments` - -## 4.3.0 -* Add `PayPalHereDetails` to transactions -* Add `network_response_code` and `network_response_text` to `Transaction` and `CreditCardVerification` -* Add `xid`, `cavv`, `eciFlag`, `dsTransactionId`, and `threeDSecureVersion` to `ThreeDSecureInfo` -* Add `threeDSecureInfo` to `CreditCardVerification` -* Add `GraphQLClient` to `BraintreeGateway` class - -## 4.2.0 -* Add `captureId` to `LocalPaymentDetails` -* Add `debugId` to `LocalPaymentDetails` -* Add `refundId` to `LocalPaymentDetails` -* Add `transactionFeeAmount` to `LocalPaymentDetails` -* Add `transactionFeeCurrencyIsoCode` to `LocalPaymentDetails` -* Add `refundFromTransactionFeeAmount` to `LocalPaymentDetails` -* Add `refundFromTransactionFeeCurrencyIsoCode` to `LocalPaymentDetails` -* Add `threeDSecureVersion`, `authenticationResponse`, `directoryResponse`, `cavvAlgorithm` and `dsTransactionId` to 3DS pass thru fields -* Add `payerInfo` to `PaymentMethodNonce` details -* Add `roomTax` field to Transaction sale -* Add `noShow` field to Transaction sale -* Add `advancedDeposit` field to Transaction sale -* Add `fireSafe` field to Transaction sale -* Add `propertyPhone` field to Transaction sale -* Add `additionalCharges` field to Transaction sale -* Add `PostalCodeIsRequiredForCardBrandAndProcessor` to validation errors - -## 4.1.0 -* Add `revokedAt` field to `PayPalAccount` -* Add support for `PAYMENT_METHOD_REVOKED_BY_CUSTOMER` webhook -* Add `payment_method_nonce` field to `LocalPaymentCompleted` webhook -* Add `transaction` field to `LocalPaymentCompleted` webhook -* Add `localPaymentDetail` to transactions -* Add `TOKEN_ISSUANCE` gatewayRejectionReason enum to `Transaction` - -## 4.0.0 -* Add support for PHP 7 (Thanks to @briandotdev) -* Require PHP 7.2 or higher -* Remove support for HHVM and PHP 5 -* Update to PHPUnit 7 -* Remove deprecated `GRANTED_PAYMENT_INSTRUMENT_UPDATE` -* Remove deprecated Coinbase payment method -* Remove deprecated iDEAL payment method -* Remove deprecated `MerchantAccountGateway` creation with `applicantDetails`. Please use `individual`, `business`, and `funding`. -* When a `Customer` is created, the `customFields` property is always an array rather than potentially `null`. -* Remove Transparent Redirect -* Remove `riskData`, `applePay`, `applePayCard`, `threeDSecure`, and `venmo.profileId` snakecase attributes -* HTTPS requests throw an `SSLCertificate` exception when related to SSL, otherwise a `Connection` exception is thrown. -* Rename `DownForMaintence` Exception to `ServiceUnavailable`. Throw `Timeout` exception for transaction search errors instead of `DownForMaintenance`. -* Add `RequestTimeout` and `GatewayTimeout` exceptions. -* Add `revokedAt` field to `PayPalAccount` -* Add support for `PAYMENT_METHOD_REVOKED_BY_CUSTOMER` webhook - ## 3.40.0 * Deprecate `GRANTED_PAYMENT_INSTRUMENT_UPDATE` and add `GRANTOR_UPDATED_GRANTED_PAYMENT_METHOD` and `RECIPIENT_UPDATED_GRANTED_PAYMENT_METHOD` * Add `accountType` field to `TransactionGateway`, `CreditCardGateway`, `PaymentMethodGateway`, and `CreditCardVerification`. * Add Hiper and Hipercard test numbers. -* Add `refundFromTransactionFeeAmount` field to `PayPalDetails` -* Add `refundFromTransactionFeeCurrencyIsoCode` field to `PayPalDetails` ## 3.39.0 * Add `bin` field to `paymentMethodNonceDetails` diff --git a/upload/system/storage/vendor/braintree/braintree_php/LICENSE b/upload/system/storage/vendor/braintree/braintree_php/LICENSE index 305dd595a0f..24a605bb688 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/LICENSE +++ b/upload/system/storage/vendor/braintree/braintree_php/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2021 Braintree, a division of PayPal, Inc. +Copyright (c) 2017 Braintree, a division of PayPal, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/upload/system/storage/vendor/braintree/braintree_php/README.md b/upload/system/storage/vendor/braintree/braintree_php/README.md index 9a6dc533921..6f5e6d90f89 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/README.md +++ b/upload/system/storage/vendor/braintree/braintree_php/README.md @@ -2,11 +2,13 @@ The Braintree PHP library provides integration access to the Braintree Gateway. -## TLS 1.2 required -> **The Payment Card Industry (PCI) Council has [mandated](https://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls) that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, Braintree has updated its services to require TLS 1.2 for all HTTPS connections. Braintrees require HTTP/1.1 for all connections. Please see our [technical documentation](https://github.com/paypal/tls-update) for more information.** +## Please Note +> **The Payment Card Industry (PCI) Council has [mandated](https://blog.pcisecuritystandards.org/migrating-from-ssl-and-early-tls) that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, Braintree is updating its services to require TLS 1.2 for all HTTPS connections. Braintree will also require HTTP/1.1 for all connections. Please see our [technical documentation](https://github.com/paypal/tls-update) for more information.** ## Dependencies +PHP version >= 5.4.0 is required. + The following PHP extensions are required: * curl @@ -15,27 +17,6 @@ The following PHP extensions are required: * openssl * xmlwriter -PHP version >= 7.3 is required. The Braintree PHP SDK is tested against PHP versions 7.3 and 7.4, and 8.0. - -_The PHP core development community has released [End-of-Life branches](https://www.php.net/eol.php) for PHP versions 5.4 - 7.2, and are no longer receiving security updates. As a result, Braintree does not support these versions of PHP._ - -## Versions - -Braintree employs a deprecation policy for our SDKs. For more information on the statuses of an SDK check our [developer docs](https://developer.paypal.com/braintree/docs/reference/general/server-sdk-deprecation-policy). - -| Major version number | Status | Released | Deprecated | Unsupported | -| -------------------- | ------ | -------- | ---------- | ----------- | -| 6.x.x | Active | March 2021 | TBA | TBA | -| 5.x.x | Inactive | March 2020 | March 2023 | March 2024 | -| 4.x.x | Inactive | May 2019 | March 2022 | March 2023 | -| 3.x.x | Inactive | May 2015 | March 2022 | March 2023 | - -## Documentation - - * [Official documentation](https://developer.paypal.com/braintree/docs/start/hello-server/php) - -Updating from an Inactive, Deprecated, or Unsupported version of this SDK? Check our [Migration Guide](https://developer.paypal.com/braintree/docs/reference/general/server-sdk-migration-guide/php) for tips. - ## Quick Start Example ```php @@ -44,7 +25,7 @@ Updating from an Inactive, Deprecated, or Unsupported version of this SDK? Check require_once 'PATH_TO_BRAINTREE/lib/Braintree.php'; // Instantiate a Braintree Gateway either like this: -$gateway = new Braintree\Gateway([ +$gateway = new Braintree_Gateway([ 'environment' => 'sandbox', 'merchantId' => 'your_merchant_id', 'publicKey' => 'your_public_key', @@ -52,7 +33,7 @@ $gateway = new Braintree\Gateway([ ]); // or like this: -$config = new Braintree\Configuration([ +$config = new Braintree_Configuration([ 'environment' => 'sandbox', 'merchantId' => 'your_merchant_id', 'publicKey' => 'your_public_key', @@ -62,10 +43,9 @@ $gateway = new Braintree\Gateway($config) // Then, create a transaction: $result = $gateway->transaction()->sale([ - 'amount' => '10.00', - 'paymentMethodNonce' => $nonceFromTheClient, - 'deviceData' => $deviceDataFromTheClient, - 'options' => [ 'submitForSettlement' => True ] + 'amount' => '1000.00', + 'paymentMethodNonce' => 'nonceFromTheClient', + 'options' => [ 'submitForSettlement' => true ] ]); if ($result->success) { @@ -75,15 +55,13 @@ if ($result->success) { print_r("\n code: " . $result->transaction->processorResponseCode); print_r("\n text: " . $result->transaction->processorResponseText); } else { - foreach($result->errors->deepAll() AS $error) { - print_r($error->code . ": " . $error->message . "\n"); - } + print_r("Validation errors: \n"); + print_r($result->errors->deepAll()); } ``` -## Namespacing - -As of major version 5.x.x, only PSR-4 namespacing is supported. This means you'll have to reference classes using PSR-4 namespacing: +Both PSR-0 and PSR-4 namespacing are supported. If you are using composer with `--classmap-authoritative` or +`--optimize-autoloader` enabled, you'll have to reference classes using PSR-4 namespacing: ```php $gateway = new Braintree\Gateway([ @@ -104,6 +82,10 @@ $config = new Braintree\Configuration([ $gateway = new Braintree\Gateway($config) ``` +## HHVM Support + +The Braintree PHP library will run on HHVM >= 3.4.2. + ## Google App Engine Support When using Google App Engine include the curl extention in your `php.ini` file (see [#190](https://github.com/braintree/braintree_php/issues/190) for more information): @@ -122,6 +104,14 @@ $gateway = new Braintree\Gateway([ ]); ``` +## Legacy PHP Support + +Version [2.40.0](https://github.com/braintree/braintree_php/releases/tag/2.40.0) is compatible with PHP 5.2 and 5.3. You can find it on our releases page. + +## Documentation + + * [Official documentation](https://developers.braintreepayments.com/php/sdk/server/overview) + ## Developing (Docker) The `Makefile` and `Dockerfile` will build an image containing the dependencies and drop you to a terminal where you can run tests. @@ -130,20 +120,14 @@ The `Makefile` and `Dockerfile` will build an image containing the dependencies make ``` -## Linting - -The Rakefile includes commands to run [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) and [PHP Code Beautifier & Fixer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically). To run the linter commands use rake: - -```sh -rake lint:fix # runs the auto-fixer first, then sniffs for any remaining code smells -rake lint:sniff[y] # gives a detailed report of code smells -``` - ## Testing The unit specs can be run by anyone on any system, but the integration specs are meant to be run against a local development server of our gateway code. These integration specs are not meant for public consumption and will likely fail if run on your system. To run unit tests use rake: `rake test:unit`. -To lint and run all tests, use rake: `rake test`. +The benefit of the `rake` tasks is that testing covers default `hhvm` and `php` interpreters. However, if you want to run tests manually simply use the following command: +``` +phpunit tests/unit/ +``` ## License diff --git a/upload/system/storage/vendor/braintree/braintree_php/composer.json b/upload/system/storage/vendor/braintree/braintree_php/composer.json index d229c49dd82..0e8d28ad9ca 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/composer.json +++ b/upload/system/storage/vendor/braintree/braintree_php/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=7.3.0", + "php": ">=5.4.0", "ext-curl": "*", "ext-dom": "*", "ext-hash": "*", @@ -18,10 +18,12 @@ "ext-xmlwriter": "*" }, "require-dev": { - "phpunit/phpunit": "^9.0", - "squizlabs/php_codesniffer": "^3.0" + "phpunit/phpunit": "3.7.*" }, "autoload": { + "psr-0": { + "Braintree": "lib/" + }, "psr-4": { "Braintree\\": "lib/Braintree" } diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php index 15213b1acb1..066107acc6d 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree.php @@ -1,30 +1,21 @@ -= 7.3.0 required'); +if (version_compare(PHP_VERSION, '5.4.0', '<')) { + throw new Braintree_Exception('PHP version >= 5.4.0 required'); } -/** - * Braintree PHP Library - * Creates class_aliases for old class names replaced by PSR-4 Namespaces - */ -class Braintree -{ - /** - * Checks for required dependencies - * - * @throws Braintree/Exception With the missing extension - * - * @return void - */ - public static function requireDependencies() - { +class Braintree { + public static function requireDependencies() { $requiredExtensions = ['xmlwriter', 'openssl', 'dom', 'hash', 'curl']; - foreach ($requiredExtensions as $ext) { + foreach ($requiredExtensions AS $ext) { if (!extension_loaded($ext)) { - throw new Braintree\Exception('The Braintree library requires the ' . $ext . ' extension.'); + throw new Braintree_Exception('The Braintree library requires the ' . $ext . ' extension.'); } } } diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php index a779f933ccf..226bdfe77f0 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AccountUpdaterDailyReport.php @@ -1,11 +1,14 @@ _attributes = $disputeAttribs; } - /** - * Creates an instance of an AccountUpdaterDailyReport from given attributes - * - * @param array $attributes to generate new AccountUpdaterDailyReport - * - * @return AccountUpdaterDailyReport - */ public static function factory($attributes) { $instance = new self(); @@ -30,18 +26,18 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + public function __toString() { $display = [ 'reportDate', 'reportUrl' ]; $displayAttributes = []; - foreach ($display as $attrib) { + foreach ($display AS $attrib) { $displayAttributes[$attrib] = $this->$attrib; } return __CLASS__ . '[' . - Util::attributesToString($displayAttributes) . ']'; + Util::attributesToString($displayAttributes) .']'; } } +class_alias('Braintree\AccountUpdaterDailyReport', 'Braintree_AccountUpdaterDailyReport'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php index d04ff532a03..86eeea6c866 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AchMandate.php @@ -1,16 +1,24 @@ _attributes) . ']'; @@ -19,8 +27,9 @@ public function __toString() /** * sets instance properties from an array of values * + * @ignore + * @access protected * @param array $achAttribs array of achMandate data - * * @return void */ protected function _initialize($achAttribs) @@ -32,9 +41,7 @@ protected function _initialize($achAttribs) /** * factory method: returns an instance of AchMandate * to the requesting method, with populated properties - * - * @param array $attributes response object attributes - * + * @ignore * @return AchMandate */ public static function factory($attributes) @@ -42,5 +49,7 @@ public static function factory($attributes) $instance = new self(); $instance->_initialize($attributes); return $instance; + } } +class_alias('Braintree\AchMandate', 'Braintree_Mandate'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php index e30e4202360..3eb5612af5d 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOn.php @@ -1,21 +1,25 @@ addOn()->all(); } } +class_alias('Braintree\AddOn', 'Braintree_AddOn'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php index e13dabc98dc..9ecf942a63d 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddOnGateway.php @@ -1,19 +1,30 @@ _gateway = $gateway; @@ -23,7 +34,6 @@ public function __construct($gateway) } /** - * Retrieve all add ons * * @return AddOn[] */ @@ -40,3 +50,4 @@ public function all() ); } } +class_alias('Braintree\AddOnGateway', 'Braintree_AddOnGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php index 49f90633db2..ee12524f44c 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Address.php @@ -1,16 +1,30 @@ id === $other->id && $this->customerId === $other->customerId); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @ignore + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sets instance properties from an array of values + * + * @ignore + * @access protected + * @param array $addressAttribs array of address data + * @return void + */ protected function _initialize($addressAttribs) { // set the attributes @@ -44,10 +69,9 @@ protected function _initialize($addressAttribs) } /** - * Creates an instance of an Address from given attributes - * - * @param array $attributes response object attributes - * + * factory method: returns an instance of Address + * to the requesting method, with populated properties + * @ignore * @return Address */ public static function factory($attributes) @@ -55,16 +79,16 @@ public static function factory($attributes) $instance = new self(); $instance->_initialize($attributes); return $instance; + } + + // static methods redirecting to gateway + /** - * static method redirecting to gateway class - * - * @param array $attribs containing request parameters * - * @see AddressGateway::create() - * - * @return Result\Successful|Result\Error + * @param array $attribs + * @return Address */ public static function create($attribs) { @@ -72,14 +96,8 @@ public static function create($attribs) } /** - * static method redirecting to gateway class - * - * @param array $attribs containing request parameters - * - * @see AddressGateway::createNoValidate() - * - * @throws Exception\ValidationError * + * @param array $attribs * @return Address */ public static function createNoValidate($attribs) @@ -88,14 +106,11 @@ public static function createNoValidate($attribs) } /** - * static method redirecting to gateway class - * - * @param mixed $customerOrId either a customer object or string ID of customer - * @param string $addressId optional unique identifier * - * @see AddressGateway::delete() - * - * @return Result\Successful|Result\Error + * @param Customer|int $customerOrId + * @param int $addressId + * @throws InvalidArgumentException + * @return Result\Successful */ public static function delete($customerOrId = null, $addressId = null) { @@ -103,15 +118,10 @@ public static function delete($customerOrId = null, $addressId = null) } /** - * static method redirecting to gateway class - * - * @param mixed $customerOrId either a customer object or string ID of customer - * @param string $addressId optional unique identifier - * - * @see AddressGateway::find() * + * @param Customer|int $customerOrId + * @param int $addressId * @throws Exception\NotFound - * * @return Address */ public static function find($customerOrId, $addressId) @@ -120,14 +130,11 @@ public static function find($customerOrId, $addressId) } /** - * static method redirecting to gateway class - * - * @param mixed $customerOrId (only used in call) - * @param string $addressId (only used in call) - * @param array $attributes containing request parameters - * - * @see AddressGateway::update() * + * @param Customer|int $customerOrId + * @param int $addressId + * @param array $attributes + * @throws Exception\Unexpected * @return Result\Successful|Result\Error */ public static function update($customerOrId, $addressId, $attributes) @@ -135,21 +142,9 @@ public static function update($customerOrId, $addressId, $attributes) return Configuration::gateway()->address()->update($customerOrId, $addressId, $attributes); } - /** - * static method redirecting to gateway class - * - * @param mixed $customerOrId (only used in call) - * @param string $addressId (only used in call) - * @param array $attributes containing request parameters - * - * @see AddressGateway::updateNoValidate() - * - * @throws Exception\ValidationsFailed - * - * @return Address - */ public static function updateNoValidate($customerOrId, $addressId, $attributes) { return Configuration::gateway()->address()->updateNoValidate($customerOrId, $addressId, $attributes); } } +class_alias('Braintree\Address', 'Braintree_Address'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php index 37d9e902fc4..a0256c08beb 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AddressGateway.php @@ -1,24 +1,43 @@ _gateway = $gateway; @@ -28,11 +47,11 @@ public function __construct($gateway) } + /* public class methods */ /** - * Create an Address - * - * @param array $attribs containing request parameters * + * @access public + * @param array $attribs * @return Result\Successful|Result\Error */ public function create($attribs) @@ -60,25 +79,23 @@ public function create($attribs) * attempts the create operation assuming all data will validate * returns a Address object instead of a Result * - * @param array $attribs containing request parameters - * + * @access public + * @param array $attribs + * @return self * @throws Exception\ValidationError - * - * @return Address */ public function createNoValidate($attribs) { $result = $this->create($attribs); return Util::returnObjectOrThrowException(__CLASS__, $result); + } /** * delete an address by id * - * @param mixed $customerOrId either a customer object or string ID of customer - * @param string $addressId optional unique identifier - * - * @return Result\Successful|Result\Error + * @param mixed $customerOrId + * @param string $addressId */ public function delete($customerOrId = null, $addressId = null) { @@ -96,12 +113,12 @@ public function delete($customerOrId = null, $addressId = null) * to the given customerOrId. * If the address cannot be found, a NotFound exception will be thrown. * - * @param mixed $customerOrId either a customer object or string ID of customer - * @param string $addressId optional unique identifier - * - * @throws Exception\NotFound * + * @access public + * @param mixed $customerOrId + * @param string $addressId * @return Address + * @throws Exception\NotFound */ public function find($customerOrId, $addressId) { @@ -115,10 +132,11 @@ public function find($customerOrId, $addressId) return Address::factory($response['address']); } catch (Exception\NotFound $e) { throw new Exception\NotFound( - 'address for customer ' . $customerId . + 'address for customer ' . $customerId . ' with id ' . $addressId . ' not found.' ); } + } /** @@ -128,10 +146,11 @@ public function find($customerOrId, $addressId) * customerOrId is the 2nd attribute, addressId 3rd. * customerOrId & addressId are not sent in object context. * - * @param mixed $customerOrId (only used in call) - * @param string $addressId (only used in call) - * @param array $attributes containing request parameters * + * @access public + * @param array $attributes + * @param mixed $customerOrId (only used in call) + * @param string $addressId (only used in call) * @return Result\Successful|Result\Error */ public function update($customerOrId, $addressId, $attributes) @@ -144,6 +163,7 @@ public function update($customerOrId, $addressId, $attributes) $response = $this->_http->put($path, ['address' => $attributes]); return $this->_verifyGatewayResponse($response); + } /** @@ -153,15 +173,12 @@ public function update($customerOrId, $addressId, $attributes) * customerOrId is the 2nd attribute, addressId 3rd. * customerOrId & addressId are not sent in object context. * - * @param mixed $customerOrId (only used in call) - * @param string $addressId (only used in call) - * @param array $attributes containing request parameters - * + * @access public + * @param array $transactionAttribs + * @param string $customerId + * @return Transaction * @throws Exception\ValidationsFailed - * * @see Address::update() - * - * @return Address */ public function updateNoValidate($customerOrId, $addressId, $attributes) { @@ -171,7 +188,6 @@ public function updateNoValidate($customerOrId, $addressId, $attributes) /** * creates a full array signature of a valid create request - * * @return array gateway create request format */ public static function createSignature() @@ -185,65 +201,60 @@ public static function createSignature() /** * creates a full array signature of a valid update request - * * @return array gateway update request format */ public static function updateSignature() { + // TODO: remove customerId from update signature return self::createSignature(); + } /** * verifies that a valid address id is being used - * + * @ignore * @param string $id address id - * * @throws InvalidArgumentException - * - * @return self */ private function _validateId($id = null) { if (empty($id) || trim($id) == "") { throw new InvalidArgumentException( - 'expected address id to be set' + 'expected address id to be set' ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { throw new InvalidArgumentException( - $id . ' is an invalid address id.' + $id . ' is an invalid address id.' ); } } /** * verifies that a valid customer id is being used - * + * @ignore * @param string $id customer id - * * @throws InvalidArgumentException - * - * @return self */ private function _validateCustomerId($id = null) { if (empty($id) || trim($id) == "") { throw new InvalidArgumentException( - 'expected customer id to be set' + 'expected customer id to be set' ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { throw new InvalidArgumentException( - $id . ' is an invalid customer id.' + $id . ' is an invalid customer id.' ); } + } /** * determines if a string id or Customer object was passed - * - * @param mixed $customerOrId either a customer object or string unique identifier - * + * @ignore + * @param mixed $customerOrId * @return string customerId */ private function _determineCustomerId($customerOrId) @@ -251,8 +262,17 @@ private function _determineCustomerId($customerOrId) $customerId = ($customerOrId instanceof Customer) ? $customerOrId->id : $customerOrId; $this->_validateCustomerId($customerId); return $customerId; + } + /* private class methods */ + /** + * sends the create request to the gateway + * @ignore + * @param string $subPath + * @param array $params + * @return Result\Successful|Result\Error + */ private function _doCreate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -261,6 +281,19 @@ private function _doCreate($subPath, $params) return $this->_verifyGatewayResponse($response); } + /** + * generic method for validating incoming gateway responses + * + * creates a new Address object and encapsulates + * it inside a Result\Successful object, or + * encapsulates an Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid + * + * @ignore + * @param array $response gateway response values + * @return Result\Successful|Result\Error + * @throws Exception\Unexpected + */ private function _verifyGatewayResponse($response) { if (isset($response['address'])) { @@ -268,12 +301,14 @@ private function _verifyGatewayResponse($response) return new Result\Successful( Address::factory($response['address']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - "Expected address or apiErrorResponse" + "Expected address or apiErrorResponse" ); } + } } +class_alias('Braintree\AddressGateway', 'Braintree_AddressGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php index 3137dc4df48..51f10fac590 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php @@ -1,12 +1,33 @@ + * == More information == + * + * See {@link https://developers.braintreepayments.com/javascript+php}
    + * + * @package Braintree + * @category Resources + * + * @property-read string $bin + * @property-read string $cardType + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read boolean $default + * @property-read string $expirationDate + * @property-read string $expirationMonth + * @property-read string $expirationYear + * @property-read boolean $expired + * @property-read string $imageUrl + * @property-read string $last4 + * @property-read string $token + * @property-read string $paymentInstrumentName + * @property-read string $sourceDescription + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read \DateTime $updatedAt */ class ApplePayCard extends Base { @@ -40,15 +61,14 @@ public function isExpired() * factory method: returns an instance of ApplePayCard * to the requesting method, with populated properties * - * @param mixed $attributes of the ApplePayCard object - * + * @ignore * @return ApplePayCard */ public static function factory($attributes) { $defaultAttributes = [ - 'expirationMonth' => '', - 'expirationYear' => '', + 'expirationMonth' => '', + 'expirationYear' => '', 'last4' => '', ]; @@ -60,8 +80,8 @@ public static function factory($attributes) /** * sets instance properties from an array of values * + * @access protected * @param array $applePayCardAttribs array of Apple Pay card properties - * * @return void */ protected function _initialize($applePayCardAttribs) @@ -71,7 +91,7 @@ protected function _initialize($applePayCardAttribs) $subscriptionArray = []; if (isset($applePayCardAttribs['subscriptions'])) { - foreach ($applePayCardAttribs['subscriptions'] as $subscription) { + foreach ($applePayCardAttribs['subscriptions'] AS $subscription) { $subscriptionArray[] = Subscription::factory($subscription); } } @@ -80,3 +100,4 @@ protected function _initialize($applePayCardAttribs) $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); } } +class_alias('Braintree\ApplePayCard', 'Braintree_ApplePayCard'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php index e5548fc7040..c8291be4eef 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayGateway.php @@ -1,10 +1,12 @@ _gateway = $gateway; @@ -21,56 +22,44 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /* - * Register a domain for apple pay - * - * @see https://developer.paypal.com/braintree/docs/guides/apple-pay/configuration#domain-registration - * - * @param string $domain to be registered - * - * @return Result\Successful|Result\Error - */ public function registerDomain($domain) { $path = $this->_config->merchantPath() . '/processing/apple_pay/validate_domains'; $response = $this->_http->post($path, ['url' => $domain]); - if (array_key_exists('response', $response) && $response['response']['success']) { - return new Result\Successful(); - } elseif (array_key_exists('apiErrorResponse', $response)) { + if (array_key_exists('response', $response) && $response['response']['success']) + { + return new Result\Successful; + } + else if (array_key_exists('apiErrorResponse', $response)) + { return new Result\Error($response['apiErrorResponse']); } } - /* - * Unregister a domain for apple pay - * - * @param string $domain to be unregistered - * - * @return Result\Successful - */ public function unregisterDomain($domain) { $path = $this->_config->merchantPath() . '/processing/apple_pay/unregister_domain'; $this->_http->delete($path, ['url' => $domain]); - return new Result\Successful(); + return new Result\Successful; } - /* - * Retrieve a list of all registered domains for apple pay - * - * @return Result\Successful|Result\Error - */ public function registeredDomains() { $path = $this->_config->merchantPath() . '/processing/apple_pay/registered_domains'; $response = $this->_http->get($path); - if (array_key_exists('response', $response) && array_key_exists('domains', $response['response'])) { + if (array_key_exists('response', $response) && array_key_exists('domains', $response['response'])) + { $options = ApplePayOptions::factory($response['response']); return new Result\Successful($options, 'applePayOptions'); - } elseif (array_key_exists('apiErrorResponse', $response)) { + } + else if (array_key_exists('apiErrorResponse', $response)) + { return new Result\Error($response['apiErrorResponse']); - } else { + } + else + { throw new Exception\Unexpected('expected response or apiErrorResponse'); } } } +class_alias('Braintree\ApplePayGateway', 'Braintree_ApplePayGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php index ea548bcb532..40b2cefc111 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ApplePayOptions.php @@ -1,23 +1,18 @@ _attributes = $attributes; } } +class_alias('Braintree\ApplePayOptions', 'Braintree_ApplePayOptions'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php index 65847fcb765..a2eeea5531f 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php @@ -1,22 +1,19 @@ _attributes = $authorizationAdjustmentAttribs; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } } +class_alias('Braintree\AuthorizationAdjustment', 'Braintree_Authorization_Adjustment'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php index f3fec514c72..1190862e00d 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Base.php @@ -1,5 +1,4 @@ _attributes['globalId'])) { - $this->_attributes['graphQLId'] = $this->_attributes['globalId']; - } if (array_key_exists($name, $this->_attributes)) { return $this->_attributes[$name]; - } else { + } + else { trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE); return null; } @@ -52,52 +54,35 @@ public function __get($name) /** * Checks for the existence of a property stored in the private $_attributes property * - * @param string $name of the key - * + * @ignore + * @param string $name * @return boolean */ public function __isset($name) { - return isset($this->_attributes[$name]); + return array_key_exists($name, $this->_attributes); } /** * Mutator for instance properties stored in the private $_attributes property * - * @param string $key to be set - * @param mixed $value to be set - * - * @return mixed + * @ignore + * @param string $key + * @param mixed $value */ public function _set($key, $value) { $this->_attributes[$key] = $value; } - + /** - * Implementation of JsonSerializable - * + * Implementation of JsonSerializable + * + * @ignore * @return array */ - #[\ReturnTypeWillChange] public function jsonSerialize() { - return $this->_attributes; - } - - /** - * Implementation of to an Array - * - * @return array - */ - public function toArray() - { - return array_map(function ($value) { - if (!is_array($value)) { - return method_exists($value, 'toArray') ? $value->toArray() : $value; - } else { - return $value; - } - }, $this->_attributes); + return $this->_attributes; } } diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php index ffdc39cb5f9..5a668dee665 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/BinData.php @@ -1,21 +1,19 @@ _attributes = $attributes; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the bin data + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } + } +class_alias('Braintree\BinData', 'Braintree_BinData'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php index 6853d3b8f20..f3d48845e74 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientToken.php @@ -1,64 +1,49 @@ clientToken()->generate($params); } - /* - * static method redirecting to gateway class - * - * @param array $params to be verified - * - * @see ClientTokenGateway::conditionallyVerifyKeys() + /** * - * @return array + * @param type $params + * @throws InvalidArgumentException */ public static function conditionallyVerifyKeys($params) { return Configuration::gateway()->clientToken()->conditionallyVerifyKeys($params); } - /* - * static method redirecting to gateway class - * - * @see ClientTokenGateway::generateWithCustomerIdSignature() - * - * @return array + /** * + * @return string client token retrieved from server */ public static function generateWithCustomerIdSignature() { return Configuration::gateway()->clientToken()->generateWithCustomerIdSignature(); } - /* - * static method redirecting to gateway class - * - * @see ClientTokenGateway::generateWithoutCustomerIdSignature() + /** * - * @return array + * @return string client token retrieved from server */ public static function generateWithoutCustomerIdSignature() { return Configuration::gateway()->clientToken()->generateWithoutCustomerIdSignature(); } } +class_alias('Braintree\ClientToken', 'Braintree_ClientToken'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php index dd41b5fc169..b2fcbf5de94 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ClientTokenGateway.php @@ -1,22 +1,32 @@ - */ class ClientTokenGateway { + /** + * + * @var Gateway + */ private $_gateway; + + /** + * + * @var Configuration + */ private $_config; + + /** + * + * @var Http + */ private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * + * @param Gateway $gateway + */ public function __construct($gateway) { $this->_gateway = $gateway; @@ -25,14 +35,7 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /** - * Generate a client token for client-side authorization - * - * @param Optional $params containing request parameters - * - * @return string client token - */ - public function generate($params = []) + public function generate($params=[]) { if (!array_key_exists("version", $params)) { $params["version"] = ClientToken::DEFAULT_VERSION; @@ -44,7 +47,14 @@ public function generate($params = []) return $this->_doGenerate('/client_token', $generateParams); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the generate request to the gateway + * + * @ignore + * @param var $url + * @param array $params + * @return string + */ public function _doGenerate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -53,12 +63,10 @@ public function _doGenerate($subPath, $params) return $this->_verifyGatewayResponse($response); } - /* - * Checks if customer id is provided prior to verifying keys provided in params - * - * @param array $params to be verified + /** * - * @return array + * @param array $params + * @throws InvalidArgumentException */ public function conditionallyVerifyKeys($params) { @@ -69,11 +77,9 @@ public function conditionallyVerifyKeys($params) } } - /* - * returns an array of keys including customer id - * - * @return array + /** * + * @return mixed[] */ public function generateWithCustomerIdSignature() { @@ -83,10 +89,9 @@ public function generateWithCustomerIdSignature() "merchantAccountId"]; } - /* - * returns an array of keys without customer id + /** * - * @return array + * @return string[] */ public function generateWithoutCustomerIdSignature() { @@ -100,11 +105,10 @@ public function generateWithoutCustomerIdSignature() * Otherwise, throws an InvalidArgumentException with the error * response from the Gateway or an HTTP status code exception. * + * @ignore * @param array $response gateway response values - * - * @throws InvalidArgumentException | HTTP status code exception - * * @return string client token + * @throws InvalidArgumentException | HTTP status code exception */ private function _verifyGatewayResponse($response) { @@ -120,4 +124,6 @@ private function _verifyGatewayResponse($response) ); } } + } +class_alias('Braintree\ClientTokenGateway', 'Braintree_ClientTokenGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php index c26c2189997..1cbec1d8616 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php @@ -1,5 +1,4 @@ -= $this->count()) { + if($index >= $this->count()) throw new OutOfRangeException('Index out of range'); - } $this->_collection[$index] = $value; } /** * Remove a value from the collection - * * @param integer $index index to remove - * * @throws OutOfRangeException if index is out of range - * - * @return mixed */ public function remove($index) { - if ($index >= $this->count()) { + if($index >= $this->count()) throw new OutOfRangeException('Index out of range'); - } array_splice($this->_collection, $index, 1); } /** * Return value at index - * - * @param integer $index of value to be retrieved - * - * @throws OutOfRangeException - * + * @param integer $index * @return mixed + * @throws OutOfRangeException */ public function get($index) { - if ($index >= $this->count()) { + if($index >= $this->count()) throw new OutOfRangeException('Index out of range'); - } return $this->_collection[$index]; } /** * Determine if index exists - * - * @param integer $index to check for existence - * + * @param integer $index * @return boolean */ public function exists($index) { - if ($index >= $this->count()) { + if($index >= $this->count()) return false; - } return true; } /** * Return count of items in collection * Implements countable - * * @return integer */ - #[\ReturnTypeWillChange] public function count() { return count($this->_collection); @@ -117,10 +103,8 @@ public function count() /** * Return an iterator * Implements IteratorAggregate - * * @return ArrayIterator */ - #[\ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->_collection); @@ -129,15 +113,10 @@ public function getIterator() /** * Set offset to value * Implements ArrayAccess - * - * @param integer $offset - * @param mixed $value - * * @see set - * - * @return mixed + * @param integer $offset + * @param mixed $value */ - #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->set($offset, $value); @@ -146,14 +125,9 @@ public function offsetSet($offset, $value) /** * Unset offset * Implements ArrayAccess - * - * @param integer $offset - * * @see remove - * - * @return mixed + * @param integer $offset */ - #[\ReturnTypeWillChange] public function offsetUnset($offset) { $this->remove($offset); @@ -162,14 +136,10 @@ public function offsetUnset($offset) /** * get an offset's value * Implements ArrayAccess - * - * @param integer $offset - * * @see get - * + * @param integer $offset * @return mixed */ - #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->get($offset); @@ -178,16 +148,14 @@ public function offsetGet($offset) /** * Determine if offset exists * Implements ArrayAccess - * - * @param integer $offset - * * @see exists - * + * @param integer $offset * @return boolean */ - #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->exists($offset); } + } +class_alias('Braintree\Collection', 'Braintree_Collection'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php index 349f4745aae..b72c30beb93 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Configuration.php @@ -1,10 +1,14 @@ - $value) { @@ -48,36 +52,16 @@ public function __construct($attribs = []) if ($kind == 'privateKey') { $this->_privateKey = $value; } - if ($kind == 'proxyHost') { - $this->_proxyHost = $value; - } - if ($kind == 'proxyPort') { - $this->_proxyPort = $value; - } - if ($kind == 'proxyType') { - $this->_proxyType = $value; - } - if ($kind == 'proxyUser') { - $this->_proxyUser = $value; - } - if ($kind == 'proxyPassword') { - $this->_proxyPassword = $value; - } if ($kind == 'timeout') { $this->_timeout = $value; } - if ($kind == 'sslVersion') { - $this->_sslVersion = $value; - } if ($kind == 'acceptGzipEncoding') { $this->_acceptGzipEncoding = $value; } } if (isset($attribs['clientId']) || isset($attribs['accessToken'])) { - // phpcs:ignore Generic.Files.LineLength if (isset($attribs['environment']) || isset($attribs['merchantId']) || isset($attribs['publicKey']) || isset($attribs['privateKey'])) { - // phpcs:ignore Generic.Files.LineLength throw new Exception\Configuration('Cannot mix OAuth credentials (clientId, clientSecret, accessToken) with key credentials (publicKey, privateKey, environment, merchantId).'); } $parsedCredentials = new CredentialsParser($attribs); @@ -92,32 +76,19 @@ public function __construct($attribs = []) /** * resets configuration to default - * - * @return Configuration + * @access public */ public static function reset() { self::$global = new Configuration(); } - /** - * Create new gateway - * - * @return Gateway - */ public static function gateway() { return new Gateway(self::$global); } - /** - * Getter/Setter for configuration environment - * - * @param string $value If provided, sets the environment - * - * @return self - */ - public static function environment($value = null) + public static function environment($value=null) { if (empty($value)) { return self::$global->getEnvironment(); @@ -126,14 +97,7 @@ public static function environment($value = null) self::$global->setEnvironment($value); } - /** - * Getter/Setter for configuration merchant ID - * - * @param string $value If provided, sets the merchantId - * - * @return self - */ - public static function merchantId($value = null) + public static function merchantId($value=null) { if (empty($value)) { return self::$global->getMerchantId(); @@ -141,14 +105,7 @@ public static function merchantId($value = null) self::$global->setMerchantId($value); } - /** - * Getter/Setter for configuration public key - * - * @param string $value If provided, sets the public key - * - * @return self - */ - public static function publicKey($value = null) + public static function publicKey($value=null) { if (empty($value)) { return self::$global->getPublicKey(); @@ -156,14 +113,7 @@ public static function publicKey($value = null) self::$global->setPublicKey($value); } - /** - * Getter/Setter for configuration private key - * - * @param string $value If provided, sets the private key - * - * @return self - */ - public static function privateKey($value = null) + public static function privateKey($value=null) { if (empty($value)) { return self::$global->getPrivateKey(); @@ -175,10 +125,9 @@ public static function privateKey($value = null) * Sets or gets the read timeout to use for making requests. * * @param integer $value If provided, sets the read timeout - * * @return integer The read timeout used for connecting to Braintree */ - public static function timeout($value = null) + public static function timeout($value=null) { if (empty($value)) { return self::$global->getTimeout(); @@ -192,10 +141,9 @@ public static function timeout($value = null) * CURLOPT_SSLVERSION values. * * @param integer $value If provided, sets the SSL version - * * @return integer The SSL version used for connecting to Braintree */ - public static function sslVersion($value = null) + public static function sslVersion($value=null) { if (empty($value)) { return self::$global->getSslVersion(); @@ -207,7 +155,6 @@ public static function sslVersion($value = null) * Sets or gets the proxy host to use for connecting to Braintree * * @param string $value If provided, sets the proxy host - * * @return string The proxy host used for connecting to Braintree */ public static function proxyHost($value = null) @@ -222,7 +169,6 @@ public static function proxyHost($value = null) * Sets or gets the port of the proxy to use for connecting to Braintree * * @param string $value If provided, sets the port of the proxy - * * @return string The port of the proxy used for connecting to Braintree */ public static function proxyPort($value = null) @@ -238,7 +184,6 @@ public static function proxyPort($value = null) * can be any of the CURLOPT_PROXYTYPE options in PHP cURL. * * @param string $value If provided, sets the proxy type - * * @return string The proxy type used for connecting to Braintree */ public static function proxyType($value = null) @@ -250,12 +195,17 @@ public static function proxyType($value = null) } /** - * Sets or gets the proxy user to use for connecting to Braintree. - * - * @param string $value If provided, sets the proxy username + * Specifies whether or not a proxy is properly configured * - * @return string The proxy type used for connecting to Braintree + * @return bool true if a proxy is configured properly, false if not */ + public static function isUsingProxy() + { + $proxyHost = self::$global->getProxyHost(); + $proxyPort = self::$global->getProxyPort(); + return !empty($proxyHost) && !empty($proxyPort); + } + public static function proxyUser($value = null) { if (empty($value)) { @@ -264,14 +214,6 @@ public static function proxyUser($value = null) self::$global->setProxyUser($value); } - /** - * Sets or gets the proxy password to use for connecting to Braintree. This value - * can be any of the CURLOPT_PROXYUSERPWD options in PHP cURL. - * - * @param string $value If provided, sets the proxy password - * - * @return string The proxy type used for connecting to Braintree - */ public static function proxyPassword($value = null) { if (empty($value)) { @@ -281,13 +223,23 @@ public static function proxyPassword($value = null) } /** - * Specify if the HTTP client is able to decode gzipped responses. - * - * // phpcs:ignore Generic.Files.LineLength + * Specified whether or not a username and password have been provided for + * use with an authenticated proxy * - * @param boolean $value If true, will send an Accept-Encoding header with a gzip value. If false, will not send an Accept-Encoding header with a gzip value. + * @return bool true if both proxyUser and proxyPassword are present + */ + public static function isAuthenticatedProxy() + { + $proxyUser = self::$global->getProxyUser(); + $proxyPwd = self::$global->getProxyPassword(); + return !empty($proxyUser) && !empty($proxyPwd); + } + + /** + * Specify if the HTTP client is able to decode gzipped responses. * - * @return boolean true if an Accept-Encoding header with a gzip value will be sent, false if not + * @param bool $value If true, will send an Accept-Encoding header with a gzip value. If false, will not send an Accept-Encoding header with a gzip value. + * @return bool true if an Accept-Encoding header with a gzip value will be sent, false if not */ public static function acceptGzipEncoding($value = null) { @@ -297,55 +249,32 @@ public static function acceptGzipEncoding($value = null) self::$global->setAcceptGzipEncoding($value); } - //phpcs:ignore public static function assertGlobalHasAccessTokenOrKeys() { self::$global->assertHasAccessTokenOrKeys(); } - /* - * Check if configuration has an access token, or api keys - * - * @throws Exception\Configuration - * - * @return self - */ public function assertHasAccessTokenOrKeys() { if (empty($this->_accessToken)) { if (empty($this->_merchantId)) { - // phpcs:ignore Generic.Files.LineLength throw new Exception\Configuration('Braintree\\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\\Gateway).'); - } elseif (empty($this->_environment)) { + } else if (empty($this->_environment)) { throw new Exception\Configuration('Braintree\\Configuration::environment needs to be set.'); - } elseif (empty($this->_publicKey)) { + } else if (empty($this->_publicKey)) { throw new Exception\Configuration('Braintree\\Configuration::publicKey needs to be set.'); - } elseif (empty($this->_privateKey)) { + } else if (empty($this->_privateKey)) { throw new Exception\Configuration('Braintree\\Configuration::privateKey needs to be set.'); } } } - /* - * Check if configuration has a client id and secret - * - * @throws Exception\Configuration - * - * @return self - */ public function assertHasClientCredentials() { $this->assertHasClientId(); $this->assertHasClientSecret(); } - /* - * Check if configuration has a client id - * - * @throws Exception\Configuration - * - * @return self - */ public function assertHasClientId() { if (empty($this->_clientId)) { @@ -353,13 +282,6 @@ public function assertHasClientId() } } - /* - * Check if configuration has a client secret - * - * @throws Exception\Configuration - * - * @return self - */ public function assertHasClientSecret() { if (empty($this->_clientSecret)) { @@ -367,253 +289,167 @@ public function assertHasClientSecret() } } - /* - * Getter function - * - * @return string environment - */ public function getEnvironment() { return $this->_environment; } - /* - * Getter function - * - * @return string merchant id + /** + * Do not use this method directly. Pass in the environment to the constructor. */ + public function setEnvironment($value) + { + $this->_environment = $value; + } + public function getMerchantId() { return $this->_merchantId; } - /* - * Getter function - * - * @return string public key + /** + * Do not use this method directly. Pass in the merchantId to the constructor. */ + public function setMerchantId($value) + { + $this->_merchantId = $value; + } + public function getPublicKey() { return $this->_publicKey; } - /* - * Getter function - * - * @return string client id - */ public function getClientId() { return $this->_clientId; } - /* - * Getter function - * - * @return string private key + /** + * Do not use this method directly. Pass in the publicKey to the constructor. */ + public function setPublicKey($value) + { + $this->_publicKey = $value; + } + public function getPrivateKey() { return $this->_privateKey; } - /* - * Getter function - * - * @return string client secret - */ public function getClientSecret() { return $this->_clientSecret; } - /* - * Getter function - * - * @return string proxy host - */ - public function getProxyHost() - { - return $this->_proxyHost; - } - /* - * Getter function - * - * @return string proxy port - */ - public function getProxyPort() - { - return $this->_proxyPort; - } - - - /* - * Getter function - * - * @return string proxy type - */ - public function getProxyType() - { - return $this->_proxyType; - } - - /* - * Getter function - * - * @return string proxy username + /** + * Do not use this method directly. Pass in the privateKey to the constructor. */ - public function getProxyUser() + public function setPrivateKey($value) { - return $this->_proxyUser; + $this->_privateKey = $value; } - /* - * Getter function - * - * @return string proxy password - */ - public function getProxyPassword() + private function setProxyHost($value) { - return $this->_proxyPassword; + $this->_proxyHost = $value; } - /* - * Getter function - * - * @return int timeout - */ - public function getTimeout() + public function getProxyHost() { - return $this->_timeout; + return $this->_proxyHost; } - /* - * Getter function - * - * @return string ssl version - */ - public function getSslVersion() + private function setProxyPort($value) { - return $this->_sslVersion; + $this->_proxyPort = $value; } - /* - * Getter function - * - * @return bool - */ - public function getAcceptGzipEncoding() + public function getProxyPort() { - return $this->_acceptGzipEncoding; + return $this->_proxyPort; } - //phpcs:disable PEAR.Commenting - /** - * Do not use this method directly. Pass in the environment to the constructor. - */ - public function setEnvironment($value) + private function setProxyType($value) { - $this->_environment = $value; + $this->_proxyType = $value; } - /** - * Do not use this method directly. Pass in the merchantId to the constructor. - */ - public function setMerchantId($value) + public function getProxyType() { - $this->_merchantId = $value; + return $this->_proxyType; } - /** - * Do not use this method directly. Pass in the publicKey to the constructor. - */ - public function setPublicKey($value) + private function setProxyUser($value) { - $this->_publicKey = $value; + $this->_proxyUser = $value; } - /** - * Do not use this method directly. Pass in the privateKey to the constructor. - */ - public function setPrivateKey($value) + public function getProxyUser() { - $this->_privateKey = $value; + return $this->_proxyUser; } - private function setProxyHost($value) + private function setProxyPassword($value) { - $this->_proxyHost = $value; + $this->_proxyPassword = $value; } - private function setProxyPort($value) + public function getProxyPassword() { - $this->_proxyPort = $value; + return $this->_proxyPassword; } - private function setProxyType($value) + private function setTimeout($value) { - $this->_proxyType = $value; + $this->_timeout = $value; } - private function setProxyUser($value) + public function getTimeout() { - $this->_proxyUser = $value; + return $this->_timeout; } - private function setProxyPassword($value) + private function setSslVersion($value) { - $this->_proxyPassword = $value; + $this->_sslVersion = $value; } - private function setTimeout($value) + private function getSslVersion() { - $this->_timeout = $value; + return $this->_sslVersion; } - private function setSslVersion($value) + public function getAcceptGzipEncoding() { - $this->_sslVersion = $value; + return $this->_acceptGzipEncoding; } private function setAcceptGzipEncoding($value) { $this->_acceptGzipEncoding = $value; } - //phpcs:enable PEAR.Commenting - /* - * Getter function - * - * @return string access token - */ public function getAccessToken() { return $this->_accessToken; } - /* - * Checks for presence of access token - * - * @return bool - */ public function isAccessToken() { return !empty($this->_accessToken); } - /* - * Checks for presence of client credentials - * - * @return bool - */ public function isClientCredentials() { return !empty($this->_clientId); } - /** * returns the base braintree gateway URL based on config values * + * @access public + * @param none * @return string braintree gateway URL */ public function baseUrl() @@ -624,16 +460,20 @@ public function baseUrl() /** * returns the base URL for Braintree's GraphQL endpoint based on config values * + * @access public + * @param none * @return string Braintree GraphQL URL */ - public function graphQLBaseUrl() - { + public function graphQLBaseUrl() + { return sprintf('%s://%s:%d/graphql', $this->protocol(), $this->graphQLServerName(), $this->graphQLPortNumber()); - } + } /** * sets the merchant path based on merchant ID * + * @access protected + * @param none * @return string merchant path uri */ public function merchantPath() @@ -644,17 +484,18 @@ public function merchantPath() /** * sets the physical path for the location of the CA certs * - * @param string $sslPath optional - * + * @access public + * @param none * @return string filepath */ - public function caFile($sslPath = null) + public function caFile($sslPath = NULL) { $sslPath = $sslPath ? $sslPath : DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'ssl' . DIRECTORY_SEPARATOR; $caPath = __DIR__ . $sslPath . 'api_braintreegateway_com.ca.crt'; - if (!file_exists($caPath)) { + if (!file_exists($caPath)) + { throw new Exception\SSLCaFileNotFound(); } @@ -664,6 +505,8 @@ public function caFile($sslPath = null) /** * returns the port number depending on environment * + * @access public + * @param none * @return int portnumber */ public function portNumber() @@ -675,9 +518,11 @@ public function portNumber() } /** - * returns the port number depending on environment + * returns the graphql port number depending on environment * - * @return integer graphql portnumber + * @access public + * @param none + * @return int graphql portnumber */ public function graphQLPortNumber() { @@ -687,34 +532,11 @@ public function graphQLPortNumber() return getenv("GRAPHQL_PORT") ?: 8080; } - /** - * Specifies whether or not a proxy is properly configured - * - * @return boolean true if a proxy is configured properly, false if not - */ - public function isUsingProxy() - { - $proxyHost = $this->getProxyHost(); - $proxyPort = $this->getProxyPort(); - return !empty($proxyHost) && !empty($proxyPort); - } - - /** - * Specified whether or not a username and password have been provided for - * use with an authenticated proxy - * - * @return boolean true if both proxyUser and proxyPassword are present - */ - public function isAuthenticatedProxy() - { - $proxyUser = $this->getProxyUser(); - $proxyPwd = $this->getProxyPassword(); - return !empty($proxyUser) && !empty($proxyPwd); - } - /** * returns http protocol depending on environment * + * @access public + * @param none * @return string http || https */ public function protocol() @@ -725,25 +547,27 @@ public function protocol() /** * returns gateway server name depending on environment * + * @access public + * @param none * @return string server domain name */ public function serverName() { - switch ($this->_environment) { - case 'production': - $serverName = 'api.braintreegateway.com'; - break; - case 'qa': - $serverName = 'gateway.qa.braintreepayments.com'; - break; - case 'sandbox': - $serverName = 'api.sandbox.braintreegateway.com'; - break; - case 'development': - case 'integration': - default: - $serverName = 'localhost'; - break; + switch($this->_environment) { + case 'production': + $serverName = 'api.braintreegateway.com'; + break; + case 'qa': + $serverName = 'gateway.qa.braintreepayments.com'; + break; + case 'sandbox': + $serverName = 'api.sandbox.braintreegateway.com'; + break; + case 'development': + case 'integration': + default: + $serverName = 'localhost'; + break; } return $serverName; @@ -752,60 +576,85 @@ public function serverName() /** * returns Braintree GraphQL server name depending on environment * + * @access public + * @param none * @return string graphql domain name */ public function graphQLServerName() { - switch ($this->_environment) { - case 'production': - $graphQLServerName = 'payments.braintree-api.com'; - break; - case 'qa': - $graphQLServerName = 'payments-qa.dev.braintree-api.com'; - break; - case 'sandbox': - $graphQLServerName = 'payments.sandbox.braintree-api.com'; - break; - case 'development': - case 'integration': - default: - $graphQLServerName = 'graphql.bt.local'; - break; + switch($this->_environment) { + case 'production': + $graphQLServerName = 'payments.braintree-api.com'; + break; + case 'qa': + $graphQLServerName = 'payments-qa.dev.braintree-api.com'; + break; + case 'sandbox': + $graphQLServerName = 'payments.sandbox.braintree-api.com'; + break; + case 'development': + case 'integration': + default: + $graphQLServerName = 'graphql.bt.local'; + break; } return $graphQLServerName; } + public function authUrl() + { + switch($this->_environment) { + case 'production': + $serverName = 'https://auth.venmo.com'; + break; + case 'qa': + $serverName = 'https://auth.qa.venmo.com'; + break; + case 'sandbox': + $serverName = 'https://auth.sandbox.venmo.com'; + break; + case 'development': + case 'integration': + default: + $serverName = 'http://auth.venmo.dev:9292'; + break; + } + + return $serverName; + } + /** * returns boolean indicating SSL is on or off for this session, * depending on environment * + * @access public + * @param none * @return boolean */ public function sslOn() { - switch ($this->_environment) { - case 'integration': - case 'development': - $ssl = false; - break; - case 'production': - case 'qa': - case 'sandbox': - default: - $ssl = true; - break; + switch($this->_environment) { + case 'integration': + case 'development': + $ssl = false; + break; + case 'production': + case 'qa': + case 'sandbox': + default: + $ssl = true; + break; } - return $ssl; + return $ssl; } /** * log message to default logger * - * @param string $message to log + * @param string $message * - * @return string */ public function logMessage($message) { @@ -813,3 +662,4 @@ public function logMessage($message) } } Configuration::reset(); +class_alias('Braintree\Configuration', 'Braintree_Configuration'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php index 2837e8b19ec..ca4e7ef531c 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantPayPalStatusChanged.php @@ -1,22 +1,21 @@ _attributes = $attributes; } } +class_alias('Braintree\ConnectedMerchantPayPalStatusChanged', 'Braintree_ConnectedMerchantPayPalStatusChanged'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php index 645c4b3b9f8..4614437dabb 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ConnectedMerchantStatusTransitioned.php @@ -1,22 +1,21 @@ _attributes = $attributes; } } +class_alias('Braintree\ConnectedMerchantStatusTransitioned', 'Braintree_ConnectedMerchantStatusTransitioned'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php index e3e9781c65d..034d9736b65 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CredentialsParser.php @@ -1,9 +1,12 @@ $value) { @@ -31,6 +33,12 @@ public function __construct($attribs) $this->parse(); } + /** + * + * @access protected + * @static + * @var array valid environments, used for validation + */ private static $_validEnvironments = [ 'development', 'integration', @@ -39,11 +47,7 @@ public function __construct($attribs) 'qa', ]; - /* - * Parses environment credentials and sets the _environment variable - * - * @return object|Exception\Configuration - */ + public function parse() { $environments = []; @@ -51,7 +55,6 @@ public function parse() $environments[] = ['clientId', $this->_parseClientCredential('clientId', $this->_clientId, 'client_id')]; } if (!empty($this->_clientSecret)) { - // phpcs:ignore Generic.Files.LineLength $environments[] = ['clientSecret', $this->_parseClientCredential('clientSecret', $this->_clientSecret, 'client_secret')]; } if (!empty($this->_accessToken)) { @@ -63,8 +66,7 @@ public function parse() if ($env[1] !== $checkEnv[1]) { throw new Exception\Configuration( 'Mismatched credential environments: ' . $checkEnv[0] . ' environment is ' . $checkEnv[1] . - ' and ' . $env[0] . ' environment is ' . $env[1] - ); + ' and ' . $env[0] . ' environment is ' . $env[1]); } } @@ -72,15 +74,7 @@ public function parse() $this->_environment = $checkEnv[1]; } - /* - * Checks that the environment passed is valid - * - * @param string $environment - * - * @return self|Exception\Configuration - */ - public static function assertValidEnvironment($environment) - { + public static function assertValidEnvironment($environment) { if (!in_array($environment, self::$_validEnvironments)) { throw new Exception\Configuration('"' . $environment . '" is not a valid environment.'); @@ -91,8 +85,7 @@ private function _parseClientCredential($credentialType, $value, $expectedValueP { $explodedCredential = explode('$', $value); if (sizeof($explodedCredential) != 3) { - $message = 'Incorrect ' . $credentialType . ' format. Expected: type$environment$token'; - throw new Exception\Configuration($message); + throw new Exception\Configuration('Incorrect ' . $credentialType . ' format. Expected: type$environment$token'); } $gotValuePrefix = $explodedCredential[0]; @@ -110,8 +103,7 @@ private function _parseAccessToken() { $accessTokenExploded = explode('$', $this->_accessToken); if (sizeof($accessTokenExploded) != 4) { - $message = 'Incorrect accessToken syntax. Expected: type$environment$merchant_id$token'; - throw new Exception\Configuration($message); + throw new Exception\Configuration('Incorrect accessToken syntax. Expected: type$environment$merchant_id$token'); } $gotValuePrefix = $accessTokenExploded[0]; @@ -127,53 +119,29 @@ private function _parseAccessToken() return $environment; } - /* - * Getter methid to retrieve the ClientId - * - * @return string - */ public function getClientId() { return $this->_clientId; } - /* - * Getter methid to retrieve the ClientSecret - * - * @return string - */ public function getClientSecret() { return $this->_clientSecret; } - /* - * Getter methid to retrieve the AccessToken - * - * @return string - */ public function getAccessToken() { return $this->_accessToken; } - /* - * Getter methid to retrieve the Environment - * - * @return string - */ public function getEnvironment() { return $this->_environment; } - /* - * Getter methid to retrieve the Merchant Id - * - * @return string - */ public function getMerchantId() { return $this->_merchantId; } } +class_alias('Braintree\CredentialsParser', 'Braintree_CredentialsParser'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php index d88229af2f2..a8895458ba0 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCard.php @@ -1,13 +1,46 @@ - * For more detailed information on CreditCard verifications, see {@link https://developer.paypal.com/braintree/docs/reference/response/credit-card-verification our developer docs} + * == More information == + * + * For more detailed information on CreditCards, see {@link https://developers.braintreepayments.com/reference/response/credit-card/php https://developers.braintreepayments.com/reference/response/credit-card/php}
    + * For more detailed information on CreditCard verifications, see {@link https://developers.braintreepayments.com/reference/response/credit-card-verification/php https://developers.braintreepayments.com/reference/response/credit-card-verification/php} + * + * @package Braintree + * @category Resources + * + * @property-read \Braintree\Address $billingAddress + * @property-read string $bin + * @property-read string $cardType + * @property-read string $cardholderName + * @property-read string $commercial + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read string $customerLocation + * @property-read string $debit + * @property-read boolean $default + * @property-read string $durbinRegulated + * @property-read string $expirationDate + * @property-read string $expirationMonth + * @property-read string $expirationYear + * @property-read boolean $expired + * @property-read boolean $healthcare + * @property-read string $imageUrl + * @property-read string $issuingBank + * @property-read string $last4 + * @property-read string $maskedNumber + * @property-read string $payroll + * @property-read string $prepaid + * @property-read string $productId + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read string $token + * @property-read string $uniqueNumberIdentifier + * @property-read \DateTime $updatedAt + * @property-read \Braintree\CreditCardVerification|null $verification */ class CreditCard extends Base { @@ -94,8 +127,8 @@ public function isVenmoSdk() /** * sets instance properties from an array of values * + * @access protected * @param array $creditCardAttribs array of creditcard data - * * @return void */ protected function _initialize($creditCardAttribs) @@ -110,7 +143,7 @@ protected function _initialize($creditCardAttribs) $subscriptionArray = []; if (isset($creditCardAttribs['subscriptions'])) { - foreach ($creditCardAttribs['subscriptions'] as $subscription) { + foreach ($creditCardAttribs['subscriptions'] AS $subscription) { $subscriptionArray[] = Subscription::factory($subscription); } } @@ -120,7 +153,7 @@ protected function _initialize($creditCardAttribs) $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); $this->_set('maskedNumber', $this->bin . '******' . $this->last4); - if (isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) { + if(isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) { $verifications = $creditCardAttribs['verifications']; usort($verifications, [$this, '_compareCreatedAtOnVerifications']); @@ -138,7 +171,6 @@ private function _compareCreatedAtOnVerifications($verificationAttrib1, $verific * or is a CreditCard with a different id * * @param object $otherCreditCard customer to compare against - * * @return boolean */ public function isEqual($otherCreditCard) @@ -146,18 +178,22 @@ public function isEqual($otherCreditCard) return !($otherCreditCard instanceof self) ? false : $this->token === $otherCreditCard->token; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } /** - * Creates an instance of an CreditCard from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of CreditCard + * to the requesting method, with populated properties * + * @ignore * @return CreditCard */ public static function factory($attributes) @@ -174,238 +210,105 @@ public static function factory($attributes) return $instance; } - /** - * static method redirecting to gateway class - * - * @param array $attribs containing request parameters - * - * @see CreditCardGateway::create() - * - * @throws Exception\ValidationError - * - * @return Result\Successful|Result\Error - */ + + // static methods redirecting to gateway + public static function create($attribs) { return Configuration::gateway()->creditCard()->create($attribs); } - /** - * Attempts the create operation assuming all data will validate - * returns a CreditCard object instead of a Result - * - * @param array $attribs containing request parameters - * - * @throws Exception\ValidationError - * - * @return CreditCard - */ public static function createNoValidate($attribs) { return Configuration::gateway()->creditCard()->createNoValidate($attribs); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function createFromTransparentRedirect($queryString) + { + return Configuration::gateway()->creditCard()->createFromTransparentRedirect($queryString); + } + public static function createCreditCardUrl() { return Configuration::gateway()->creditCard()->createCreditCardUrl(); } - /** - * Returns a ResourceCollection of expired credit cards - * - * @return ResourceCollection - */ public static function expired() { return Configuration::gateway()->creditCard()->expired(); } - /** - * Returns a ResourceCollection of expired credit cards - * - * @param string $ids containing credit card IDs - * - * @return ResourceCollection - */ public static function fetchExpired($ids) { return Configuration::gateway()->creditCard()->fetchExpired($ids); } - /** - * Returns a ResourceCollection of credit cards expiring between start/end - * - * @param string $startDate the start date of search - * @param string $endDate the end date of search - * - * @return ResourceCollection - */ public static function expiringBetween($startDate, $endDate) { return Configuration::gateway()->creditCard()->expiringBetween($startDate, $endDate); } - /** - * Returns a ResourceCollection of credit cards expiring between start/end given a set of IDs - * - * @param string $startDate the start date of search - * @param string $endDate the end date of search - * @param string $ids containing ids to search - * - * @return ResourceCollection - */ public static function fetchExpiring($startDate, $endDate, $ids) { return Configuration::gateway()->creditCard()->fetchExpiring($startDate, $endDate, $ids); } - /** - * Find a creditcard by token - * - * @param string $token credit card unique id - * - * @throws Exception\NotFound - * - * @return CreditCard - */ public static function find($token) { return Configuration::gateway()->creditCard()->find($token); } - /** - * Convert a payment method nonce to a credit card - * - * @param string $nonce payment method nonce - * - * @throws Exception\NotFound - * - * @return CreditCard - */ public static function fromNonce($nonce) { return Configuration::gateway()->creditCard()->fromNonce($nonce); } - /** - * Create a credit on the card for the passed transaction - * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters - * - * @return Result\Successful|Result\Error - */ public static function credit($token, $transactionAttribs) { return Configuration::gateway()->creditCard()->credit($token, $transactionAttribs); } - /** - * Create a credit on this card, assuming validations will pass - * - * Returns a Transaction object on success - * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters - * - * @throws Exception\ValidationError - * - * @return Transaction - */ public static function creditNoValidate($token, $transactionAttribs) { return Configuration::gateway()->creditCard()->creditNoValidate($token, $transactionAttribs); } - /** - * Create a new sale for the current card - * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters - * - * @return Result\Successful|Result\Error - */ public static function sale($token, $transactionAttribs) { return Configuration::gateway()->creditCard()->sale($token, $transactionAttribs); } - /** - * Create a new sale using this card, assuming validations will pass - * - * Returns a Transaction object on success - * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters - * - * @throws Exception\ValidationsFailed - * - * @return Transaction - */ public static function saleNoValidate($token, $transactionAttribs) { return Configuration::gateway()->creditCard()->saleNoValidate($token, $transactionAttribs); } - /** - * Updates the creditcard record - * - * If calling this method in context, $token - * is the 2nd attribute. $token is not sent in object context. - * - * @param string $token (optional) - * @param array $attributes containing request parameters - * - * @return Result\Successful|Result\Error - */ public static function update($token, $attributes) { return Configuration::gateway()->creditCard()->update($token, $attributes); } - /** - * Update a creditcard record, assuming validations will pass - * - * If calling this method in context, $token - * is the 2nd attribute. $token is not sent in object context. - * returns a CreditCard object on success - * - * @param string $token (optional) - * @param array $attributes containing request parameters - * - * @return CreditCard - * - * @throws Exception\ValidationsFailed - */ public static function updateNoValidate($token, $attributes) { return Configuration::gateway()->creditCard()->updateNoValidate($token, $attributes); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function updateCreditCardUrl() { return Configuration::gateway()->creditCard()->updateCreditCardUrl(); } - /** - * Delete a credit card record - * - * @param string $token credit card identifier - * - * @return Result - */ + public static function updateFromTransparentRedirect($queryString) + { + return Configuration::gateway()->creditCard()->updateFromTransparentRedirect($queryString); + } + public static function delete($token) { return Configuration::gateway()->creditCard()->delete($token); } - /** - * All credit card types in an array - * - * @return array - */ + /** @return array */ public static function allCardTypes() { return [ @@ -426,3 +329,4 @@ public static function allCardTypes() ]; } } +class_alias('Braintree\CreditCard', 'Braintree_CreditCard'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php index f9273cebdfb..37561e6495e 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardGateway.php @@ -1,5 +1,4 @@ - * For more detailed information on CreditCard verifications, see {@link https://developer.paypal.com/braintree/docs/reference/response/credit-card-verification/php our reference documentation} + * == More information == + * + * For more detailed information on CreditCards, see {@link https://developers.braintreepayments.com/reference/response/credit-card/php https://developers.braintreepayments.com/reference/response/credit-card/php}
    + * For more detailed information on CreditCard verifications, see {@link https://developers.braintreepayments.com/reference/response/credit-card-verification/php https://developers.braintreepayments.com/reference/response/credit-card-verification/php} + * + * @package Braintree + * @category Resources */ class CreditCardGateway { @@ -17,7 +21,6 @@ class CreditCardGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -26,16 +29,6 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /** - * Attempts the create operation - * returns a Result on success or an Error on failure - * - * @param array $attribs containing request parameterss - * - * @throws Exception\ValidationError - * - * @return Result\Successful|Result\Error - */ public function create($attribs) { Util::verifyKeys(self::createSignature(), $attribs); @@ -43,24 +36,55 @@ public function create($attribs) } /** - * Attempts the create operation assuming all data will validate + * attempts the create operation assuming all data will validate * returns a CreditCard object instead of a Result * - * @param array $attribs containing request parameters - * - * @throws Exception\ValidationError - * + * @access public + * @param array $attribs * @return CreditCard + * @throws Exception\ValidationError */ public function createNoValidate($attribs) { $result = $this->create($attribs); return Util::returnObjectOrThrowException(__CLASS__, $result); } + /** + * create a customer from a TransparentRedirect operation + * + * @deprecated since version 2.3.0 + * @access public + * @param array $attribs + * @return Result\Successful|Result\Error + */ + public function createFromTransparentRedirect($queryString) + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::confirm", E_USER_NOTICE); + $params = TransparentRedirect::parseAndValidateQueryString( + $queryString + ); + return $this->_doCreate( + '/payment_methods/all/confirm_transparent_redirect_request', + ['id' => $params['id']] + ); + } /** - * Returns a ResourceCollection of expired credit cards * + * @deprecated since version 2.3.0 + * @access public + * @param none + * @return string + */ + public function createCreditCardUrl() + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::url", E_USER_NOTICE); + return $this->_config->baseUrl() . $this->_config->merchantPath(). + '/payment_methods/all/create_via_transparent_redirect_request'; + } + + /** + * returns a ResourceCollection of expired credit cards * @return ResourceCollection */ public function expired() @@ -76,13 +100,6 @@ public function expired() return new ResourceCollection($response, $pager); } - /** - * Returns a ResourceCollection of expired credit cards - * - * @param string $ids containing credit card IDs - * - * @return ResourceCollection - */ public function fetchExpired($ids) { $path = $this->_config->merchantPath() . "/payment_methods/all/expired"; @@ -93,21 +110,14 @@ public function fetchExpired($ids) 'creditCard' ); } - /** - * Returns a ResourceCollection of credit cards expiring between start/end - * - * @param string $startDate the start date of search - * @param string $endDate the end date of search + * returns a ResourceCollection of credit cards expiring between start/end * * @return ResourceCollection */ public function expiringBetween($startDate, $endDate) { - $start = date('mY', $startDate); - $end = date('mY', $endDate); - $query = '/payment_methods/all/expiring_ids?start=' . $start . '&end=' . $end; - $queryPath = $this->_config->merchantPath() . $query; + $queryPath = $this->_config->merchantPath() . '/payment_methods/all/expiring_ids?start=' . date('mY', $startDate) . '&end=' . date('mY', $endDate); $response = $this->_http->post($queryPath); $pager = [ 'object' => $this, @@ -118,21 +128,9 @@ public function expiringBetween($startDate, $endDate) return new ResourceCollection($response, $pager); } - /** - * Returns a ResourceCollection of credit cards expiring between start/end given a set of IDs - * - * @param string $startDate the start date of search - * @param string $endDate the end date of search - * @param string $ids containing ids to search - * - * @return ResourceCollection - */ public function fetchExpiring($startDate, $endDate, $ids) { - $start = date('mY', $startDate); - $end = date('mY', $endDate); - $query = '/payment_methods/all/expiring?start=' . $start . '&end=' . $end; - $queryPath = $this->_config->merchantPath() . $query; + $queryPath = $this->_config->merchantPath() . '/payment_methods/all/expiring?start=' . date('mY', $startDate) . '&end=' . date('mY', $endDate); $response = $this->_http->post($queryPath, ['search' => ['ids' => $ids]]); return Util::extractAttributeAsArray( @@ -142,13 +140,12 @@ public function fetchExpiring($startDate, $endDate, $ids) } /** - * Find a creditcard by token + * find a creditcard by token * + * @access public * @param string $token credit card unique id - * - * @throws Exception\NotFound - * * @return CreditCard + * @throws Exception\NotFound */ public function find($token) { @@ -162,16 +159,16 @@ public function find($token) 'credit card with token ' . $token . ' not found' ); } + } /** * Convert a payment method nonce to a credit card * + * @access public * @param string $nonce payment method nonce - * - * @throws Exception\NotFound - * * @return CreditCard + * @throws Exception\NotFound */ public function fromNonce($nonce) { @@ -185,14 +182,14 @@ public function fromNonce($nonce) 'credit card with nonce ' . $nonce . ' locked, consumed or not found' ); } + } /** - * Create a credit on the card for the passed transaction - * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters + * create a credit on the card for the passed transaction * + * @access public + * @param array $attribs * @return Result\Successful|Result\Error */ public function credit($token, $transactionAttribs) @@ -207,16 +204,14 @@ public function credit($token, $transactionAttribs) } /** - * Create a credit on this card, assuming validations will pass + * create a credit on this card, assuming validations will pass * - * Returns a Transaction object on success - * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters - * - * @throws Exception\ValidationError + * returns a Transaction object on success * + * @access public + * @param array $attribs * @return Transaction + * @throws Exception\ValidationError */ public function creditNoValidate($token, $transactionAttribs) { @@ -225,12 +220,12 @@ public function creditNoValidate($token, $transactionAttribs) } /** - * Create a new sale for the current card - * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters + * create a new sale for the current card * + * @param string $token + * @param array $transactionAttribs * @return Result\Successful|Result\Error + * @see Transaction::sale() */ public function sale($token, $transactionAttribs) { @@ -244,16 +239,16 @@ public function sale($token, $transactionAttribs) } /** - * Create a new sale using this card, assuming validations will pass - * - * Returns a Transaction object on success + * create a new sale using this card, assuming validations will pass * - * @param string $token belonging to the credit card - * @param array $transactionAttribs containing request parameters - * - * @throws Exception\ValidationsFailed + * returns a Transaction object on success * + * @access public + * @param array $transactionAttribs + * @param string $token * @return Transaction + * @throws Exception\ValidationsFailed + * @see Transaction::sale() */ public function saleNoValidate($token, $transactionAttribs) { @@ -262,14 +257,14 @@ public function saleNoValidate($token, $transactionAttribs) } /** - * Updates the creditcard record + * updates the creditcard record * - * If calling this method in context, $token + * if calling this method in context, $token * is the 2nd attribute. $token is not sent in object context. * - * @param string $token (optional) - * @param array $attributes containing request parameters - * + * @access public + * @param array $attributes + * @param string $token (optional) * @return Result\Successful|Result\Error */ public function update($token, $attributes) @@ -280,17 +275,16 @@ public function update($token, $attributes) } /** - * Update a creditcard record, assuming validations will pass + * update a creditcard record, assuming validations will pass * - * If calling this method in context, $token + * if calling this method in context, $token * is the 2nd attribute. $token is not sent in object context. * returns a CreditCard object on success * - * @param string $token (optional) - * @param array $attributes containing request parameters - * + * @access public + * @param array $attributes + * @param string $token * @return CreditCard - * * @throws Exception\ValidationsFailed */ public function updateNoValidate($token, $attributes) @@ -298,14 +292,40 @@ public function updateNoValidate($token, $attributes) $result = $this->update($token, $attributes); return Util::returnObjectOrThrowException(__CLASS__, $result); } - /** - * Delete a credit card record * - * @param string $token credit card identifier + * @access public + * @param none + * @return string + */ + public function updateCreditCardUrl() + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::url", E_USER_NOTICE); + return $this->_config->baseUrl() . $this->_config->merchantPath() . + '/payment_methods/all/update_via_transparent_redirect_request'; + } + + /** + * update a customer from a TransparentRedirect operation * - * @return Result + * @deprecated since version 2.3.0 + * @access public + * @param array $attribs + * @return object */ + public function updateFromTransparentRedirect($queryString) + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::confirm", E_USER_NOTICE); + $params = TransparentRedirect::parseAndValidateQueryString( + $queryString + ); + return $this->_doUpdate( + 'post', + '/payment_methods/all/confirm_transparent_redirect_request', + ['id' => $params['id']] + ); + } + public function delete($token) { $this->_validateId($token); @@ -316,23 +336,15 @@ public function delete($token) private static function baseOptions() { - return [ - 'makeDefault', - 'skipAdvancedFraudChecking', - 'venmoSdkSession', - 'verificationAccountType', - 'verificationAmount', - 'verificationMerchantAccountId', - 'verifyCard', - ]; + return ['makeDefault', 'verificationMerchantAccountId', 'verifyCard', 'verificationAmount', 'verificationAccountType', 'venmoSdkSession']; } private static function baseSignature($options) { return [ - 'billingAddressId', 'cardholderName', 'cvv', 'number', + 'billingAddressId', 'cardholderName', 'cvv', 'number', 'deviceSessionId', 'expirationDate', 'expirationMonth', 'expirationYear', 'token', 'venmoSdkPaymentMethodCode', - 'deviceData', 'paymentMethodNonce', + 'deviceData', 'fraudMerchantId', 'paymentMethodNonce', ['options' => $options], [ 'billingAddress' => self::billingAddressSignature() @@ -340,7 +352,6 @@ private static function baseSignature($options) ]; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function billingAddressSignature() { return [ @@ -359,41 +370,20 @@ public static function billingAddressSignature() ]; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function createSignature() { $options = self::baseOptions(); $options[] = "failOnDuplicatePaymentMethod"; $signature = self::baseSignature($options); $signature[] = 'customerId'; - $signature[] = self::threeDSecurePassThruSignature(); return $signature; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public static function threeDSecurePassThruSignature() - { - return [ - 'threeDSecurePassThru' => [ - 'eciFlag', - 'cavv', - 'xid', - 'threeDSecureVersion', - 'authenticationResponse', - 'directoryResponse', - 'cavvAlgorithm', - 'dsTransactionId', - ] - ]; - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function updateSignature() { $options = self::baseOptions(); $options[] = "failOnDuplicatePaymentMethod"; $signature = self::baseSignature($options); - $signature[] = self::threeDSecurePassThruSignature(); $updateExistingBillingSignature = [ [ @@ -403,9 +393,8 @@ public static function updateSignature() ] ]; - foreach ($signature as $key => $value) { - if (is_array($value) and array_key_exists('billingAddress', $value)) { - // phpcs:ignore + foreach($signature AS $key => $value) { + if(is_array($value) and array_key_exists('billingAddress', $value)) { $signature[$key]['billingAddress'] = array_merge_recursive($value['billingAddress'], $updateExistingBillingSignature); } } @@ -413,7 +402,14 @@ public static function updateSignature() return $signature; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the create request to the gateway + * + * @ignore + * @param string $subPath + * @param array $params + * @return mixed + */ public function _doCreate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -422,20 +418,35 @@ public function _doCreate($subPath, $params) return $this->_verifyGatewayResponse($response); } + /** + * verifies that a valid credit card identifier is being used + * @ignore + * @param string $identifier + * @param Optional $string $identifierType type of identifier supplied, default "token" + * @throws InvalidArgumentException + */ private function _validateId($identifier = null, $identifierType = "token") { if (empty($identifier)) { - throw new InvalidArgumentException( - 'expected credit card id to be set' - ); + throw new InvalidArgumentException( + 'expected credit card id to be set' + ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) { throw new InvalidArgumentException( - $identifier . ' is an invalid credit card ' . $identifierType . '.' - ); + $identifier . ' is an invalid credit card ' . $identifierType . '.' + ); } } + /** + * sends the update request to the gateway + * + * @ignore + * @param string $url + * @param array $params + * @return mixed + */ private function _doUpdate($httpVerb, $subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -444,26 +455,32 @@ private function _doUpdate($httpVerb, $subPath, $params) } /** - * Generic method for validating incoming gateway responses + * generic method for validating incoming gateway responses * - * Creates a new CreditCard object and encapsulates + * creates a new CreditCard object and encapsulates * it inside a Result\Successful object, or * encapsulates a Errors object inside a Result\Error * alternatively, throws an Unexpected exception if the response is invalid + * + * @ignore + * @param array $response gateway response values + * @return Result\Successful|Result\Error + * @throws Exception\Unexpected */ private function _verifyGatewayResponse($response) { if (isset($response['creditCard'])) { // return a populated instance of Address return new Result\Successful( - CreditCard::factory($response['creditCard']) + CreditCard::factory($response['creditCard']) ); } elseif (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - "Expected address or apiErrorResponse" + "Expected address or apiErrorResponse" ); } } } +class_alias('Braintree\CreditCardGateway', 'Braintree_CreditCardGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php index 3db151e3241..ff0cccfc0bd 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerification.php @@ -1,74 +1,56 @@ creditCardVerification()->create($attributes); } - /** - * Static method redirecting to gateway class - * - * @param array $query search parameters - * @param array $ids of verifications to search - * - * @see CreditCardVerificationGateway::fetch() - * - * @return Array of CreditCardVerification objects - */ public static function fetch($query, $ids) { return Configuration::gateway()->creditCardVerification()->fetch($query, $ids); } - /** - * Static method redirecting to gateway class - * - * @param mixed $query search query - * - * @see CreditCardVerificationGateway::search() - * - * @return ResourceCollection - */ public static function search($query) { return Configuration::gateway()->creditCardVerification()->search($query); } - /* - * Returns keys that are acceptable for create requests - */ public static function createSignature() { return [ @@ -82,3 +64,4 @@ public static function createSignature() ]]; } } +class_alias('Braintree\CreditCardVerification', 'Braintree_CreditCardVerification'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php index 14ad2c58ab7..869bd6140d1 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationGateway.php @@ -1,18 +1,12 @@ _gateway = $gateway; @@ -21,28 +15,20 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /** - * Creates a credit card verification using the given +attributes+. - * - * @param array $attributes containing request parameters - * - * @return Result\Successful|Result\Error - */ public function create($attributes) { - $queryPath = $this->_config->merchantPath() . "/verifications"; - $response = $this->_http->post($queryPath, ['verification' => $attributes]); + $response = $this->_http->post($this->_config->merchantPath() . "/verifications", ['verification' => $attributes]); return $this->_verifyGatewayResponse($response); } private function _verifyGatewayResponse($response) { - if (isset($response['verification'])) { + if(isset($response['verification'])){ return new Result\Successful( CreditCardVerification::factory($response['verification']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( @@ -51,14 +37,6 @@ private function _verifyGatewayResponse($response) } } - /** - * Retrieve a credit card verification - * - * @param array $query search parameters - * @param array $ids of verifications to search - * - * @return Array of CreditCardVerification objects - */ public function fetch($query, $ids) { $criteria = []; @@ -75,13 +53,6 @@ public function fetch($query, $ids) ); } - /** - * Returns a ResourceCollection of customers matching the search query. - * - * @param mixed $query search query - * - * @return ResourceCollection - */ public function search($query) { $criteria = []; @@ -100,3 +71,4 @@ public function search($query) return new ResourceCollection($response, $pager); } } +class_alias('Braintree\CreditCardVerificationGateway', 'Braintree_CreditCardVerificationGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php index b278ad78417..2dadff94fa9 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CreditCardVerificationSearch.php @@ -1,131 +1,56 @@ == More information == * - * See our {@link https://developer.paypal.com/braintree/docs/reference/response/customer developer docs} for information on attributes + * For more detailed information on Customers, see {@link https://developers.braintreepayments.com/reference/response/customer/php https://developers.braintreepayments.com/reference/response/customer/php} + * + * @package Braintree + * @category Resources + * + * @property-read \Braintree\Address[] $addresses + * @property-read \Braintree\AndroidPayCard[] $androidPayCards + * @property-read \Braintree\AmexExpressCheckoutCard[] $amexExpressCheckoutCards + * @property-read \Braintree\ApplePayCard[] $applePayCards + * @property-read \Braintree\CoinbaseAccount[] $coinbaseAccounts + * @property-read string $company + * @property-read \DateTime $createdAt + * @property-read \Braintree\CreditCard[] $creditCards + * @property-read array $customFields custom fields passed with the request + * @property-read string $email + * @property-read string $fax + * @property-read string $firstName + * @property-read string $id + * @property-read string $lastName + * @property-read \Braintree\MasterpassCard[] $masterpassCards + * @property-read \Braintree\PaymentMethod[] $paymentMethods + * @property-read \Braintree\PayPalAccount[] $paypalAccounts + * @property-read string $phone + * @property-read \Braintree\SamsungPayCard[] $samsungPayCards + * @property-read \DateTime $updatedAt + * @property-read \Braintree\UsBankAccount[] $usBankAccounts + * @property-read \Braintree\VenmoAccount[] $venmoAccounts + * @property-read \Braintree\VisaCheckoutCard[] $visaCheckoutCards + * @property-read string $website */ class Customer extends Base { - /* - * Static method redirecting to gateway class - * - * @see CustomerGateway::all() + /** * - * @return ResourceCollection + * @return Customer[] */ public static function all() { @@ -25,13 +49,9 @@ public static function all() } /** - * Static method redirecting to gateway class - * - * @param array $query containing request params - * @param int[] $ids containing customer IDs - * - * @see CustomerGateway::fetch() * + * @param string $query + * @param int[] $ids * @return Customer|Customer[] */ public static function fetch($query, $ids) @@ -40,12 +60,8 @@ public static function fetch($query, $ids) } /** - * Static method redirecting to gateway class - * - * @param array $attribs containing request parameters - * - * @see CustomerGateway::create() * + * @param array $attribs * @return Result\Successful|Result\Error */ public static function create($attribs = []) @@ -54,14 +70,8 @@ public static function create($attribs = []) } /** - * Static method redirecting to gateway class - * - * @param array $attribs of request parameters - * - * @see CustomerGateway::createNoValidate() - * - * @throws Exception\ValidationError * + * @param array $attribs * @return Customer */ public static function createNoValidate($attribs = []) @@ -70,16 +80,29 @@ public static function createNoValidate($attribs = []) } /** - * Static method redirecting to gateway class - * - * @param string $id customer Id - * @param string $associationFilterId association filter Id - * - * @see CustomerGateway::find() + * @deprecated since version 2.3.0 + * @param string $queryString + * @return Result\Successful + */ + public static function createFromTransparentRedirect($queryString) + { + return Configuration::gateway()->customer()->createFromTransparentRedirect($queryString); + } + + /** + * @deprecated since version 2.3.0 + * @return string + */ + public static function createCustomerUrl() + { + return Configuration::gateway()->customer()->createCustomerUrl(); + } + + /** * * @throws Exception\NotFound - * - * @return Customer|boolean The customer object or false if the request fails. + * @param string $id customer id + * @return Customer */ public static function find($id, $associationFilterId = null) { @@ -87,13 +110,9 @@ public static function find($id, $associationFilterId = null) } /** - * Static method redirecting to gateway class - * - * @param integer $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * - * @see CustomerGateway::credit() * + * @param int $customerId + * @param array $transactionAttribs * @return Result\Successful|Result\Error */ public static function credit($customerId, $transactionAttribs) @@ -102,15 +121,10 @@ public static function credit($customerId, $transactionAttribs) } /** - * Static method redirecting to gateway class - * - * @param integer $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * - * @see CustomerGateway::creditNoValidate() * * @throws Exception\ValidationError - * + * @param type $customerId + * @param type $transactionAttribs * @return Transaction */ public static function creditNoValidate($customerId, $transactionAttribs) @@ -119,12 +133,9 @@ public static function creditNoValidate($customerId, $transactionAttribs) } /** - * Static method redirecting to gateway class - * - * @param string $customerId unique identifier - * - * @see CustomerGateway::delete() * + * @throws Exception on invalid id or non-200 http response code + * @param int $customerId * @return Result\Successful */ public static function delete($customerId) @@ -133,14 +144,10 @@ public static function delete($customerId) } /** - * Static method redirecting to gateway class * - * @param string $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * - * @see CustomerGateway::sale() - * - * @return Result\Successful|Result\Error + * @param int $customerId + * @param array $transactionAttribs + * @return Transaction */ public static function sale($customerId, $transactionAttribs) { @@ -148,15 +155,9 @@ public static function sale($customerId, $transactionAttribs) } /** - * Static method redirecting to gateway class - * - * @param string $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * - * @see CustomerGateway::saleNoValidate() - * - * @throws Exception\ValidationsFailed * + * @param int $customerId + * @param array $transactionAttribs * @return Transaction */ public static function saleNoValidate($customerId, $transactionAttribs) @@ -165,14 +166,9 @@ public static function saleNoValidate($customerId, $transactionAttribs) } /** - * Static method redirecting to gateway class - * - * @param mixed $query search query - * - * @see CustomerGateway::search() * * @throws InvalidArgumentException - * + * @param string $query * @return ResourceCollection */ public static function search($query) @@ -181,13 +177,10 @@ public static function search($query) } /** - * Static method redirecting to gateway class - * - * @param string $customerId to be updated - * @param array $attributes containing request params - * - * @see CustomerGateway::update() * + * @throws Exception\Unexpected + * @param int $customerId + * @param array $attributes * @return Result\Successful|Result\Error */ public static function update($customerId, $attributes) @@ -196,33 +189,55 @@ public static function update($customerId, $attributes) } /** - * update a customer record, assuming validations will pass * - * if calling this method in static context, customerId - * is the 2nd attribute. customerId is not sent in object context. - * returns a Customer object on success - * - * @param string $customerId unique identifier - * @param array $attributes request parameters - * - * @see CustomerGateway::updateNoValidate() - * - * @throws Exception\ValidationsFailed - * - * @return Customer + * @throws Exception\Unexpected + * @param int $customerId + * @param array $attributes + * @return CustomerGateway */ public static function updateNoValidate($customerId, $attributes) { return Configuration::gateway()->customer()->updateNoValidate($customerId, $attributes); } + /** + * + * @deprecated since version 2.3.0 + * @return string + */ + public static function updateCustomerUrl() + { + return Configuration::gateway()->customer()->updateCustomerUrl(); + } + + /** + * + * @deprecated since version 2.3.0 + * @param string $queryString + * @return Result\Successful|Result\Error + */ + public static function updateFromTransparentRedirect($queryString) + { + return Configuration::gateway()->customer()->updateFromTransparentRedirect($queryString); + } + + /* instance methods */ + + /** + * sets instance properties from an array of values + * + * @ignore + * @access protected + * @param array $customerAttribs array of customer data + */ protected function _initialize($customerAttribs) { $this->_attributes = $customerAttribs; $addressArray = []; if (isset($customerAttribs['addresses'])) { - foreach ($customerAttribs['addresses'] as $address) { + + foreach ($customerAttribs['addresses'] AS $address) { $addressArray[] = Address::factory($address); } } @@ -230,15 +245,23 @@ protected function _initialize($customerAttribs) $creditCardArray = []; if (isset($customerAttribs['creditCards'])) { - foreach ($customerAttribs['creditCards'] as $creditCard) { + foreach ($customerAttribs['creditCards'] AS $creditCard) { $creditCardArray[] = CreditCard::factory($creditCard); } } $this->_set('creditCards', $creditCardArray); + $coinbaseAccountArray = []; + if (isset($customerAttribs['coinbaseAccounts'])) { + foreach ($customerAttribs['coinbaseAccounts'] AS $coinbaseAccount) { + $coinbaseAccountArray[] = CoinbaseAccount::factory($coinbaseAccount); + } + } + $this->_set('coinbaseAccounts', $coinbaseAccountArray); + $paypalAccountArray = []; if (isset($customerAttribs['paypalAccounts'])) { - foreach ($customerAttribs['paypalAccounts'] as $paypalAccount) { + foreach ($customerAttribs['paypalAccounts'] AS $paypalAccount) { $paypalAccountArray[] = PayPalAccount::factory($paypalAccount); } } @@ -246,23 +269,31 @@ protected function _initialize($customerAttribs) $applePayCardArray = []; if (isset($customerAttribs['applePayCards'])) { - foreach ($customerAttribs['applePayCards'] as $applePayCard) { + foreach ($customerAttribs['applePayCards'] AS $applePayCard) { $applePayCardArray[] = ApplePayCard::factory($applePayCard); } } $this->_set('applePayCards', $applePayCardArray); - $googlePayCardArray = []; + $androidPayCardArray = []; if (isset($customerAttribs['androidPayCards'])) { - foreach ($customerAttribs['androidPayCards'] as $googlePayCard) { - $googlePayCardArray[] = GooglePayCard::factory($googlePayCard); + foreach ($customerAttribs['androidPayCards'] AS $androidPayCard) { + $androidPayCardArray[] = AndroidPayCard::factory($androidPayCard); + } + } + $this->_set('androidPayCards', $androidPayCardArray); + + $amexExpressCheckoutCardArray = []; + if (isset($customerAttribs['amexExpressCheckoutCards'])) { + foreach ($customerAttribs['amexExpressCheckoutCards'] AS $amexExpressCheckoutCard) { + $amexExpressCheckoutCardArray[] = AmexExpressCheckoutCard::factory($amexExpressCheckoutCard); } } - $this->_set('googlePayCards', $googlePayCardArray); + $this->_set('amexExpressCheckoutCards', $amexExpressCheckoutCardArray); $venmoAccountArray = array(); if (isset($customerAttribs['venmoAccounts'])) { - foreach ($customerAttribs['venmoAccounts'] as $venmoAccount) { + foreach ($customerAttribs['venmoAccounts'] AS $venmoAccount) { $venmoAccountArray[] = VenmoAccount::factory($venmoAccount); } } @@ -270,15 +301,23 @@ protected function _initialize($customerAttribs) $visaCheckoutCardArray = []; if (isset($customerAttribs['visaCheckoutCards'])) { - foreach ($customerAttribs['visaCheckoutCards'] as $visaCheckoutCard) { + foreach ($customerAttribs['visaCheckoutCards'] AS $visaCheckoutCard) { $visaCheckoutCardArray[] = VisaCheckoutCard::factory($visaCheckoutCard); } } $this->_set('visaCheckoutCards', $visaCheckoutCardArray); + $masterpassCardArray = []; + if (isset($customerAttribs['masterpassCards'])) { + foreach ($customerAttribs['masterpassCards'] AS $masterpassCard) { + $masterpassCardArray[] = MasterpassCard::factory($masterpassCard); + } + } + $this->_set('masterpassCards', $masterpassCardArray); + $samsungPayCardArray = []; if (isset($customerAttribs['samsungPayCards'])) { - foreach ($customerAttribs['samsungPayCards'] as $samsungPayCard) { + foreach ($customerAttribs['samsungPayCards'] AS $samsungPayCard) { $samsungPayCardArray[] = SamsungPayCard::factory($samsungPayCard); } } @@ -286,7 +325,7 @@ protected function _initialize($customerAttribs) $usBankAccountArray = array(); if (isset($customerAttribs['usBankAccounts'])) { - foreach ($customerAttribs['usBankAccounts'] as $usBankAccount) { + foreach ($customerAttribs['usBankAccounts'] AS $usBankAccount) { $usBankAccountArray[] = UsBankAccount::factory($usBankAccount); } } @@ -296,25 +335,25 @@ protected function _initialize($customerAttribs) $this->creditCards, $this->paypalAccounts, $this->applePayCards, - $this->googlePayCards, + $this->coinbaseAccounts, + $this->androidPayCards, + $this->amexExpressCheckoutCards, $this->venmoAccounts, $this->visaCheckoutCards, + $this->masterpassCards, $this->samsungPayCards, $this->usBankAccounts )); - - $customFields = []; - if (isset($customerAttribs['customFields'])) { - $customFields = $customerAttribs['customFields']; - } - $this->_set('customFields', $customFields); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the customer + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } /** @@ -322,7 +361,6 @@ public function __toString() * or is a Customer with a different id * * @param object $otherCust customer to compare against - * * @return boolean */ public function isEqual($otherCust) @@ -330,6 +368,18 @@ public function isEqual($otherCust) return !($otherCust instanceof Customer) ? false : $this->id === $otherCust->id; } + /** + * returns an array containt all of the customer's payment methods + * + * @deprecated since version 3.1.0 - use the paymentMethods property directly + * + * @return array + */ + public function paymentMethods() + { + return $this->paymentMethods; + } + /** * returns the customer's default payment method * @@ -341,33 +391,38 @@ public function defaultPaymentMethod() return current($defaultPaymentMethods); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function _defaultPaymentMethodFilter($paymentMethod) { return $paymentMethod->isDefault(); } + /* private class properties */ + + /** + * @access protected + * @var array registry of customer data + */ protected $_attributes = [ - 'addresses' => '', - 'company' => '', - 'creditCards' => '', - 'email' => '', - 'fax' => '', - 'firstName' => '', - 'id' => '', - 'lastName' => '', - 'phone' => '', - 'taxIdentifiers' => '', - 'createdAt' => '', - 'updatedAt' => '', - 'website' => '', + 'addresses' => '', + 'company' => '', + 'creditCards' => '', + 'email' => '', + 'fax' => '', + 'firstName' => '', + 'id' => '', + 'lastName' => '', + 'phone' => '', + 'createdAt' => '', + 'updatedAt' => '', + 'website' => '', ]; /** - * Creates an instance of a Customer from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of Customer + * to the requesting method, with populated properties * + * @ignore + * @param array $attributes * @return Customer */ public static function factory($attributes) @@ -377,3 +432,4 @@ public static function factory($attributes) return $instance; } } +class_alias('Braintree\Customer', 'Braintree_Customer'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php index fb579acd9f7..f0100824234 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerGateway.php @@ -1,5 +1,4 @@ == More information == + * + * For more detailed information on Customers, see {@link https://developers.braintreepayments.com/reference/response/customer/php https://developers.braintreepayments.com/reference/response/customer/php} + * + * @package Braintree + * @category Resources */ class CustomerGateway { @@ -17,7 +20,6 @@ class CustomerGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -26,11 +28,6 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /* - * Return all customers - * - * @return ResourceCollection - */ public function all() { $path = $this->_config->merchantPath() . '/customers/advanced_search_ids'; @@ -44,14 +41,6 @@ public function all() return new ResourceCollection($response, $pager); } - /** - * Retrieve a customer - * - * @param array $query containing request params - * @param int[] $ids containing customer IDs - * - * @return Customer|Customer[] - */ public function fetch($query, $ids) { $criteria = []; @@ -89,8 +78,8 @@ public function fetch($query, $ids) * } * * - * @param array $attribs containing request parameters - * + * @access public + * @param array $attribs * @return Result\Successful|Result\Error */ public function create($attribs = []) @@ -103,38 +92,69 @@ public function create($attribs = []) * attempts the create operation assuming all data will validate * returns a Customer object instead of a Result * - * @param array $attribs of request parameters - * - * @throws Exception\ValidationError - * + * @access public + * @param array $attribs * @return Customer + * @throws Exception\ValidationError */ public function createNoValidate($attribs = []) { $result = $this->create($attribs); return Util::returnObjectOrThrowException(__CLASS__, $result); } + /** + * create a customer from a TransparentRedirect operation + * + * @deprecated since version 2.3.0 + * @access public + * @param array $attribs + * @return Customer + */ + public function createFromTransparentRedirect($queryString) + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::confirm", E_USER_NOTICE); + $params = TransparentRedirect::parseAndValidateQueryString( + $queryString + ); + return $this->_doCreate( + '/customers/all/confirm_transparent_redirect_request', + ['id' => $params['id']] + ); + } /** - * creates a full array signature of a valid create request * + * @deprecated since version 2.3.0 + * @access public + * @param none + * @return string + */ + public function createCustomerUrl() + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::url", E_USER_NOTICE); + return $this->_config->baseUrl() . $this->_config->merchantPath() . + '/customers/all/create_via_transparent_redirect_request'; + } + + + /** + * creates a full array signature of a valid create request * @return array gateway create request format */ public static function createSignature() { $creditCardSignature = CreditCardGateway::createSignature(); unset($creditCardSignature[array_search('customerId', $creditCardSignature)]); + $signature = [ 'id', 'company', 'email', 'fax', 'firstName', - 'lastName', 'phone', 'website', 'deviceData', 'paymentMethodNonce', + 'lastName', 'phone', 'website', 'deviceData', + 'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce', ['riskData' => - ['customerBrowser', 'customerIp'] + ['customerBrowser', 'customerIp', 'customer_browser', 'customer_ip'] ], ['creditCard' => $creditCardSignature], ['customFields' => ['_anyKey_']], - ['taxIdentifiers' => - ['countryCode', 'identifier'] - ], ['options' => [ ['paypal' => [ 'payee_email', @@ -160,15 +180,14 @@ public static function createSignature() /** * creates a full array signature of a valid update request - * * @return array update request format */ public static function updateSignature() { $creditCardSignature = CreditCardGateway::updateSignature(); - foreach ($creditCardSignature as $key => $value) { - if (is_array($value) and array_key_exists('options', $value)) { + foreach($creditCardSignature AS $key => $value) { + if(is_array($value) and array_key_exists('options', $value)) { array_push($creditCardSignature[$key]['options'], 'updateExistingToken'); } } @@ -176,12 +195,9 @@ public static function updateSignature() $signature = [ 'id', 'company', 'email', 'fax', 'firstName', 'lastName', 'phone', 'website', 'deviceData', - 'paymentMethodNonce', 'defaultPaymentMethodToken', + 'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce', 'defaultPaymentMethodToken', ['creditCard' => $creditCardSignature], ['customFields' => ['_anyKey_']], - ['taxIdentifiers' => - ['countryCode', 'identifier'] - ], ['options' => [ ['paypal' => [ 'payee_email', @@ -209,12 +225,11 @@ public static function updateSignature() /** * find a customer by id * - * @param string $id customer Id - * @param string $associationFilterId association filter Id - * - * @throws Exception\NotFound - * + * @access public + * @param string id customer Id + * @param string associationFilterId association filter Id * @return Customer|boolean The customer object or false if the request fails. + * @throws Exception\NotFound */ public function find($id, $associationFilterId = null) { @@ -229,7 +244,7 @@ public function find($id, $associationFilterId = null) return Customer::factory($response['customer']); } catch (Exception\NotFound $e) { throw new Exception\NotFound( - 'customer with id ' . $id . ' not found' + 'customer with id ' . $id . ' not found' ); } } @@ -237,20 +252,19 @@ public function find($id, $associationFilterId = null) /** * credit a customer for the passed transaction * - * @param integer $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * + * @access public + * @param int $customerId + * @param array $transactionAttribs * @return Result\Successful|Result\Error */ public function credit($customerId, $transactionAttribs) { $this->_validateId($customerId); return Transaction::credit( - array_merge( - $transactionAttribs, - ['customerId' => $customerId] - ) - ); + array_merge($transactionAttribs, + ['customerId' => $customerId] + ) + ); } /** @@ -258,12 +272,11 @@ public function credit($customerId, $transactionAttribs) * * returns a Transaction object on success * - * @param integer $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * - * @throws Exception\ValidationError - * + * @access public + * @param int $customerId + * @param array $transactionAttribs * @return Transaction + * @throws Exception\ValidationError */ public function creditNoValidate($customerId, $transactionAttribs) { @@ -274,9 +287,7 @@ public function creditNoValidate($customerId, $transactionAttribs) /** * delete a customer by id * - * @param string $customerId unique identifier - * - * @return Result\Successful + * @param string $customerId */ public function delete($customerId) { @@ -289,33 +300,31 @@ public function delete($customerId) /** * create a new sale for a customer * - * @param string $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * + * @param string $customerId + * @param array $transactionAttribs * @return Result\Successful|Result\Error + * @see Transaction::sale() */ public function sale($customerId, $transactionAttribs) { $this->_validateId($customerId); return Transaction::sale( - array_merge( - $transactionAttribs, - ['customerId' => $customerId] - ) - ); + array_merge($transactionAttribs, + ['customerId' => $customerId] + ) + ); } /** * create a new sale for a customer, assuming validations will pass * * returns a Transaction object on success - * - * @param string $customerId unique identifier - * @param array $transactionAttribs containing request parameters - * - * @throws Exception\ValidationsFailed - * + * @access public + * @param string $customerId + * @param array $transactionAttribs * @return Transaction + * @throws Exception\ValidationsFailed + * @see Transaction::sale() */ public function saleNoValidate($customerId, $transactionAttribs) { @@ -328,21 +337,18 @@ public function saleNoValidate($customerId, $transactionAttribs) * * If query is a string, the search will be a basic search. * If query is a hash, the search will be an advanced search. - // phpcs:ignore Generic.Files.LineLength - * For more detailed information and examples, see {@link https://developer.paypal.com/braintree/docs/reference/request/customer/search/php our developer docs} + * For more detailed information and examples, see {@link https://developers.braintreepayments.com/reference/request/customer/search/php https://developers.braintreepayments.com/reference/request/customer/search/php} * * @param mixed $query search query - * - * @throws InvalidArgumentException - * * @return ResourceCollection + * @throws InvalidArgumentException */ public function search($query) { $criteria = []; foreach ($query as $term) { $result = $term->toparam(); - if (is_null($result) || empty($result)) { + if(is_null($result) || empty($result)) { throw new InvalidArgumentException('Operator must be provided'); } @@ -366,9 +372,9 @@ public function search($query) * if calling this method in static context, customerId * is the 2nd attribute. customerId is not sent in object context. * - * @param string $customerId to be updated - * @param array $attributes containing request params - * + * @access public + * @param string $customerId (optional) + * @param array $attributes * @return Result\Successful|Result\Error */ public function update($customerId, $attributes) @@ -389,19 +395,61 @@ public function update($customerId, $attributes) * is the 2nd attribute. customerId is not sent in object context. * returns a Customer object on success * - * @param string $customerId unique identifier - * @param array $attributes request parameters - * - * @throws Exception\ValidationsFailed - * + * @access public + * @param string $customerId + * @param array $attributes * @return Customer + * @throws Exception\ValidationsFailed */ public function updateNoValidate($customerId, $attributes) { $result = $this->update($customerId, $attributes); return Util::returnObjectOrThrowException(__CLASS__, $result); } + /** + * + * @deprecated since version 2.3.0 + * @access public + * @return string + */ + public function updateCustomerUrl() + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::url", E_USER_NOTICE); + return $this->_config->baseUrl() . $this->_config->merchantPath() . + '/customers/all/update_via_transparent_redirect_request'; + } + /** + * update a customer from a TransparentRedirect operation + * + * @deprecated since version 2.3.0 + * @access public + * @param string $queryString + * @return object + */ + public function updateFromTransparentRedirect($queryString) + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::confirm", E_USER_NOTICE); + $params = TransparentRedirect::parseAndValidateQueryString( + $queryString + ); + return $this->_doUpdate( + 'post', + '/customers/all/confirm_transparent_redirect_request', + ['id' => $params['id']] + ); + } + + /* instance methods */ + + /** + * sets instance properties from an array of values + * + * @ignore + * @access protected + * @param array $customerAttribs array of customer data + * @return void + */ protected function _initialize($customerAttribs) { // set the attributes @@ -410,7 +458,8 @@ protected function _initialize($customerAttribs) // map each address into its own object $addressArray = []; if (isset($customerAttribs['addresses'])) { - foreach ($customerAttribs['addresses'] as $address) { + + foreach ($customerAttribs['addresses'] AS $address) { $addressArray[] = Address::factory($address); } } @@ -419,16 +468,25 @@ protected function _initialize($customerAttribs) // map each creditCard into its own object $creditCardArray = []; if (isset($customerAttribs['creditCards'])) { - foreach ($customerAttribs['creditCards'] as $creditCard) { + foreach ($customerAttribs['creditCards'] AS $creditCard) { $creditCardArray[] = CreditCard::factory($creditCard); } } $this->_set('creditCards', $creditCardArray); + // map each coinbaseAccount into its own object + $coinbaseAccountArray = []; + if (isset($customerAttribs['coinbaseAccounts'])) { + foreach ($customerAttribs['coinbaseAccounts'] AS $coinbaseAccount) { + $coinbaseAccountArray[] = CoinbaseAccount::factory($coinbaseAccount); + } + } + $this->_set('coinbaseAccounts', $coinbaseAccountArray); + // map each paypalAccount into its own object $paypalAccountArray = []; if (isset($customerAttribs['paypalAccounts'])) { - foreach ($customerAttribs['paypalAccounts'] as $paypalAccount) { + foreach ($customerAttribs['paypalAccounts'] AS $paypalAccount) { $paypalAccountArray[] = PayPalAccount::factory($paypalAccount); } } @@ -437,35 +495,32 @@ protected function _initialize($customerAttribs) // map each applePayCard into its own object $applePayCardArray = []; if (isset($customerAttribs['applePayCards'])) { - foreach ($customerAttribs['applePayCards'] as $applePayCard) { + foreach ($customerAttribs['applePayCards'] AS $applePayCard) { $applePayCardArray[] = ApplePayCard::factory($applePayCard); } } $this->_set('applePayCards', $applePayCardArray); - // map each androidPayCard from gateway response to googlePayCard objects - $googlePayCardArray = []; + // map each androidPayCard into its own object + $androidPayCardArray = []; if (isset($customerAttribs['androidPayCards'])) { - foreach ($customerAttribs['androidPayCards'] as $googlePayCard) { - $googlePayCardArray[] = GooglePayCard::factory($googlePayCard); + foreach ($customerAttribs['androidPayCards'] AS $androidPayCard) { + $androidPayCardArray[] = AndroidPayCard::factory($androidPayCard); } } - $this->_set('googlePayCards', $googlePayCardArray); + $this->_set('androidPayCards', $androidPayCardArray); - $paymentMethodsArray = array_merge( - $this->creditCards, - $this->paypalAccounts, - $this->applePayCards, - $this->googlePayCards - ); - $this->_set('paymentMethods', $paymentMethodsArray); + $this->_set('paymentMethods', array_merge($this->creditCards, $this->paypalAccounts, $this->applePayCards, $this->coinbaseAccounts, $this->androidPayCards)); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the customer + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } /** @@ -473,7 +528,6 @@ public function __toString() * or is a Customer with a different id * * @param object $otherCust customer to compare against - * * @return boolean */ public function isEqual($otherCust) @@ -494,21 +548,25 @@ public function paymentMethods() /** * returns the customer's default payment method * - * @return CreditCard|PayPalAccount|ApplePayCard|GooglePayCard + * @return CreditCard|PayPalAccount|ApplePayCard|AndroidPayCard */ public function defaultPaymentMethod() { - // phpcs:ignore Generic.Files.LineLength $defaultPaymentMethods = array_filter($this->paymentMethods, 'Braintree\\Customer::_defaultPaymentMethodFilter'); return current($defaultPaymentMethods); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function _defaultPaymentMethodFilter($paymentMethod) { return $paymentMethod->isDefault(); } + /* private class properties */ + + /** + * @access protected + * @var array registry of customer data + */ protected $_attributes = [ 'addresses' => '', 'company' => '', @@ -524,7 +582,14 @@ public static function _defaultPaymentMethodFilter($paymentMethod) 'website' => '', ]; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the create request to the gateway + * + * @ignore + * @param string $subPath + * @param array $params + * @return mixed + */ public function _doCreate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -533,8 +598,13 @@ public function _doCreate($subPath, $params) return $this->_verifyGatewayResponse($response); } - private function _validateId($id = null) - { + /** + * verifies that a valid customer id is being used + * @ignore + * @param string customer id + * @throws InvalidArgumentException + */ + private function _validateId($id = null) { if (is_null($id)) { throw new InvalidArgumentException( 'expected customer id to be set' @@ -547,6 +617,17 @@ private function _validateId($id = null) } } + + /* private class methods */ + + /** + * sends the update request to the gateway + * + * @ignore + * @param string $subPath + * @param array $params + * @return mixed + */ private function _doUpdate($httpVerb, $subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -555,19 +636,33 @@ private function _doUpdate($httpVerb, $subPath, $params) return $this->_verifyGatewayResponse($response); } + /** + * generic method for validating incoming gateway responses + * + * creates a new Customer object and encapsulates + * it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid. + * + * @ignore + * @param array $response gateway response values + * @return Result\Successful|Result\Error + * @throws Exception\Unexpected + */ private function _verifyGatewayResponse($response) { if (isset($response['customer'])) { // return a populated instance of Customer return new Result\Successful( - Customer::factory($response['customer']) + Customer::factory($response['customer']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - "Expected customer or apiErrorResponse" + "Expected customer or apiErrorResponse" ); } } } +class_alias('Braintree\CustomerGateway', 'Braintree_CustomerGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php index 1b8eb922ec3..3bc734e4f6a 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CustomerSearch.php @@ -1,253 +1,34 @@ merchantAccountDetails = $disbursementAttribs['merchantAccount']; if (isset($disbursementAttribs['merchantAccount'])) { - $this->_set( - 'merchantAccount', + $this->_set('merchantAccount', MerchantAccount::factory($disbursementAttribs['merchantAccount']) ); } } - /* - * Retrieve the transactions associated with a disbursement - * - * @return ResourceCollection - */ public function transactions() { $collection = Transaction::search([ @@ -40,13 +30,6 @@ public function transactions() return $collection; } - /** - * Creates an instance of a Disbursement from given attributes - * - * @param array $attributes response object attributes - * - * @return Disbursement - */ public static function factory($attributes) { $instance = new self(); @@ -54,8 +37,7 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + public function __toString() { $display = [ 'id', 'merchantAccountDetails', 'exceptionMessage', 'amount', @@ -64,30 +46,21 @@ public function __toString() ]; $displayAttributes = []; - foreach ($display as $attrib) { + foreach ($display AS $attrib) { $displayAttributes[$attrib] = $this->$attrib; } return __CLASS__ . '[' . - Util::attributesToString($displayAttributes) . ']'; + Util::attributesToString($displayAttributes) .']'; } - /* - * Determines if a Disbursement is a debit - * - * @return bool - */ public function isDebit() { return $this->disbursementType == Disbursement::TYPE_DEBIT; } - /* - * Determines if a Disbursement is a credit - * - * @return bool - */ public function isCredit() { return $this->disbursementType == Disbursement::TYPE_CREDIT; } } +class_alias('Braintree\Disbursement', 'Braintree_Disbursement'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php index 9720939eb4e..6c5e1826bc8 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisbursementDetails.php @@ -1,23 +1,24 @@ disbursementDate); } } +class_alias('Braintree\DisbursementDetails', 'Braintree_DisbursementDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php index a5f29517187..efa3d72361c 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Discount.php @@ -1,23 +1,22 @@ discount()->all(); } } +class_alias('Braintree\Discount', 'Braintree_Discount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php index cbe7bfefcdd..d26672ac353 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DiscountGateway.php @@ -1,19 +1,12 @@ _gateway = $gateway; @@ -22,11 +15,6 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /* - * Get all discounts - * - * @return array of discount objects - */ public function all() { $path = $this->_config->merchantPath() . '/discounts'; @@ -40,3 +28,4 @@ public function all() ); } } +class_alias('Braintree\DiscountGateway', 'Braintree_DiscountGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php index 3b8a345e559..b2baa9e5690 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute.php @@ -1,11 +1,33 @@ _set('evidence', $evidenceArray); } - if (isset($disputeAttribs['paypalMessages'])) { - $paypalMessagesArray = array_map(function ($paypalMessages) { - return new Dispute\PayPalMessageDetails($paypalMessages); - }, $disputeAttribs['paypalMessages']); - $this->_set('paypalMessages', $paypalMessagesArray); - } - if (isset($disputeAttribs['statusHistory'])) { - $statusHistoryArray = array_map(function ($statusHistory) { + $statusHistoryArray = array_map(function($statusHistory) { return new Dispute\StatusHistoryDetails($statusHistory); }, $disputeAttribs['statusHistory']); $this->_set('statusHistory', $statusHistoryArray); } + + if (isset($disputeAttribs['transaction'])) { + $this->_set('transaction', + new Dispute\TransactionDetails($disputeAttribs['transaction']) + ); + } } - /** - * Creates an instance of a Dispute from given attributes - * - * @param array $attributes response object attributes - * - * @return Dispute - */ public static function factory($attributes) { $instance = new self(); @@ -88,8 +100,7 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + public function __toString() { $display = [ 'amount', 'reason', 'status', @@ -97,21 +108,17 @@ public function __toString() ]; $displayAttributes = []; - foreach ($display as $attrib) { + foreach ($display AS $attrib) { $displayAttributes[$attrib] = $this->$attrib; } return __CLASS__ . '[' . - Util::attributesToString($displayAttributes) . ']'; + Util::attributesToString($displayAttributes) .']'; } /** - * Static methods redirecting to gateway class - * - * @param string $id unique identifier + * Accepts a dispute, given a dispute ID * - * @see DisputeGateway::accept() - * - * @return Result\Successful|Result\Error + * @param string $id */ public static function accept($id) { @@ -119,14 +126,10 @@ public static function accept($id) } /** - * Static methods redirecting to gateway class - * - * @param string $disputeId unique identifier - * @param string|object $documentIdOrRequest either a unique identifier string or request object + * Adds file evidence to a dispute, given a dispute ID and a document ID * - * @see DisputeGateway::addFileEvidence() - * - * @return Result\Successful|Result\Error + * @param string $disputeId + * @param string $documentIdOrRequest */ public static function addFileEvidence($disputeId, $documentIdOrRequest) { @@ -134,19 +137,10 @@ public static function addFileEvidence($disputeId, $documentIdOrRequest) } /** - * Static methods redirecting to gateway class - * - * @param string $id unique identifier - * @param string|mixed $contentOrRequest If a string, $contentOrRequest is the text-based content - * for the dispute evidence. - * Alternatively, the second argument can also be an array containing: - * - string $content The text-based content for the dispute evidence, and - * - string $category The category for this piece of evidence - * Note: (optional) string $tag parameter is deprecated, use $category instead. - * - * @see DisputeGateway::addTextEvidence() + * Adds text evidence to a dispute, given a dispute ID and content * - * @return Result\Successful|Result\Error + * @param string $id + * @param string $contentOrRequest */ public static function addTextEvidence($id, $contentOrRequest) { @@ -154,13 +148,9 @@ public static function addTextEvidence($id, $contentOrRequest) } /** - * Static methods redirecting to gateway class - * - * @param string $id unique identifier - * - * @see DisputeGateway::finalize() + * Finalize a dispute, given a dispute ID * - * @return Result\Successful|Result\Error + * @param string $id */ public static function finalize($id) { @@ -168,13 +158,9 @@ public static function finalize($id) } /** - * Static methods redirecting to gateway class + * Find a dispute, given a dispute ID * - * @param string $id unique identifier - * - * @see DisputeGateway::find() - * - * @return Result\Successful|Result\Error + * @param string $id */ public static function find($id) { @@ -182,45 +168,24 @@ public static function find($id) } /** - * Static methods redirecting to gateway class - * - * @param string $disputeId unique identifier - * @param string $evidenceId unique identifier - * - * @see DisputeGateway::removeEvidence() + * Remove evidence from a dispute, given a dispute ID and evidence ID * - * @return Result\Successful|Result\Error + * @param string $disputeId + * @param string $evidenceId */ public static function removeEvidence($disputeId, $evidenceId) { return Configuration::gateway()->dispute()->removeEvidence($disputeId, $evidenceId); } - /* - * Static methods redirecting to gateway class + /** + * Search for Disputes, given a DisputeSearch query * * @param DisputeSearch $query - * - * @see DisputeGateway::search() - * - * @return ResourceCollection|Result\Error */ public static function search($query) { return Configuration::gateway()->dispute()->search($query); } - - /* - * Retrive all types of chargeback protection level types - * - * @return array - */ - public static function allChargebackProtectionLevelTypes() - { - return [ - Dispute::EFFORTLESS, - Dispute::STANDARD, - Dispute::NOT_PROTECTED - ]; - } } +class_alias('Braintree\Dispute', 'Braintree_Dispute'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php index 347b915e3d2..19d3c0a3a6d 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Dispute/EvidenceDetails.php @@ -1,5 +1,4 @@ _gateway = $gateway; @@ -23,17 +38,17 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } + /* public class methods */ + /** * Accepts a dispute, given a dispute ID * - * @param string $id of the dispute to be accepted - * - * @return Dispute|Exception\NotFound|Result\Error + * @param string $id */ public function accept($id) { try { - if (is_null($id) || trim($id) == "") { + if (trim($id) == "") { throw new Exception\NotFound(); } @@ -53,20 +68,18 @@ public function accept($id) /** * Adds file evidence to a dispute, given a dispute ID and a document ID * - * @param string $disputeId to have evidence added - * @param string $documentIdOrRequest either a string of the unique identifier for a DocumentUpload object or a set of request params including the DocumentUpload ID - * - * @return EvidenceDetails|Exception\NotFound + * @param string $disputeId + * @param string $documentIdOrRequest */ public function addFileEvidence($disputeId, $documentIdOrRequest) { $request = is_array($documentIdOrRequest) ? $documentIdOrRequest : ['documentId' => $documentIdOrRequest]; - if (is_null($disputeId) || trim($disputeId) == "") { + if (trim($disputeId) == "") { throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found'); } - if (is_null($request['documentId']) || trim($request['documentId']) == "") { + if (trim($request['documentId']) == "") { throw new Exception\NotFound('document with id "' . $request['documentId'] . '" not found'); } @@ -99,15 +112,13 @@ public function addFileEvidence($disputeId, $documentIdOrRequest) /** * Adds text evidence to a dispute, given a dispute ID and content * - * @param string $id of the dispute - * @param mixed $contentOrRequest text-based content for the dispute evidence - * - * @return EvidenceDetails|Exception\NotFound + * @param string $id + * @param string $content */ public function addTextEvidence($id, $contentOrRequest) { $request = is_array($contentOrRequest) ? $contentOrRequest : ['content' => $contentOrRequest]; - if (is_null($request['content']) || trim($request['content']) == "") { + if (trim($request['content']) == "") { throw new InvalidArgumentException('content cannot be blank'); } @@ -116,12 +127,11 @@ public function addTextEvidence($id, $contentOrRequest) 'comments' => $request['content'], ]; - if (is_null($id) || trim($id) == "") { + if (trim($id) == "") { throw new Exception\NotFound(); } if (array_key_exists('tag', $request)) { - trigger_error('$tag is deprecated, use $category instead', E_USER_DEPRECATED); $evidence['category'] = $request['tag']; } @@ -135,7 +145,7 @@ public function addTextEvidence($id, $contentOrRequest) if (array_key_exists('sequenceNumber', $request)) { if (trim($request['sequenceNumber']) == "") { throw new InvalidArgumentException('sequenceNumber cannot be blank'); - } elseif ((string)(int)($request['sequenceNumber']) != $request['sequenceNumber']) { + } else if ((string)(int)($request['sequenceNumber']) != $request['sequenceNumber']) { throw new InvalidArgumentException('sequenceNumber must be an integer'); } $evidence['sequenceNumber'] = (int)$request['sequenceNumber']; @@ -162,14 +172,12 @@ public function addTextEvidence($id, $contentOrRequest) /** * Finalize a dispute, given a dispute ID * - * @param string $id of the dispute - * - * @return Dispute|Result\Error + * @param string $id */ public function finalize($id) { try { - if (is_null($id) || trim($id) == "") { + if (trim($id) == "") { throw new Exception\NotFound(); } @@ -189,13 +197,11 @@ public function finalize($id) /** * Find a dispute, given a dispute ID * - * @param string $id of the dispute - * - * @return Dispute|Exception\NotFound + * @param string $id */ public function find($id) { - if (is_null($id) || trim($id) == "") { + if (trim($id) == "") { throw new Exception\NotFound('dispute with id "' . $id . '" not found'); } @@ -211,15 +217,13 @@ public function find($id) /** * Remove evidence from a dispute, given a dispute ID and evidence ID * - * @param string $disputeId unique dispute identifier - * @param string $evidenceId uniqye evidence identifier - * - * @return true|Result\Error|Exception\NotFound + * @param string $disputeId + * @param string $evidenceId */ public function removeEvidence($disputeId, $evidenceId) { try { - if (is_null($disputeId) || trim($disputeId) == "" || is_null($evidenceId) || trim($evidenceId) == "") { + if (trim($disputeId) == "" || trim($evidenceId) == "") { throw new Exception\NotFound(); } @@ -232,17 +236,14 @@ public function removeEvidence($disputeId, $evidenceId) return new Result\Successful(); } catch (Exception\NotFound $e) { - $message = 'evidence with id "' . $evidenceId . '" for dispute with id "' . $disputeId . '" not found'; - throw new Exception\NotFound($message); + throw new Exception\NotFound('evidence with id "' . $evidenceId . '" for dispute with id "' . $disputeId . '" not found'); } } /** * Search for Disputes, given a DisputeSearch query * - * @param array $query containing search fields - * - * @return ResourceCollection of Dispute objects + * @param DisputeSearch $query */ public function search($query) { @@ -258,14 +259,6 @@ public function search($query) return new PaginatedCollection($pager); } - /** - * Similar to search, with a paging object - * - * @param array $query containing search fields - * @param object $page to iterate over results - * - * @return PaginatedResults - */ public function fetchDisputes($query, $page) { $response = $this->_http->post($this->_config->merchantPath() . '/disputes/advanced_search?page=' . $page, [ @@ -278,3 +271,4 @@ public function fetchDisputes($query, $page) return new PaginatedResult($totalItems, $pageSize, $disputes); } } +class_alias('Braintree\DisputeGateway', 'Braintree_DisputeGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php index 249a6762441..b97c4638484 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DisputeSearch.php @@ -1,189 +1,90 @@ $pngFile * ]); * - * See our {@link https://developer.paypal.com/braintree/docs/reference/response/document-upload developer docs} for information on attributes + * For more information on DocumentUploads, see https://developers.braintreepayments.com/reference/request/document_upload/create + * + * @property-read string $contentType + * @property-read \DateTime $expiresAt + * @property-read string $id + * @property-read string $kind + * @property-read string $name + * @property-read int $size */ class DocumentUpload extends Base { @@ -27,27 +33,15 @@ protected function _initialize($documentUploadAttribs) /** * Creates a DocumentUpload object - * - * @param mixed $params containing: - * kind - The kind of document - * file - The open file to upload - * + * @param kind The kind of document + * @param file The open file to upload * @throws InvalidArgumentException if the params are not expected - * - * @return Result\Successful|Result\Error */ public static function create($params) { return Configuration::gateway()->documentUpload()->create($params); } - /** - * Creates an instance of a DocumentUpload from given attributes - * - * @param array $attributes response object attributes - * - * @return DocumentUpload - */ public static function factory($attributes) { $instance = new self(); @@ -55,3 +49,4 @@ public static function factory($attributes) return $instance; } } +class_alias('Braintree\DocumentUpload', 'Braintree_DocumentUpload'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php index fd995ffa7a3..28399683f8f 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/DocumentUploadGateway.php @@ -1,20 +1,35 @@ _gateway = $gateway; @@ -23,16 +38,12 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } + /* public class methods */ + /** * Accepts a dispute, given a dispute ID * - * @param mixed $params containing: - * kind - The kind of document - * file - The open file to upload - * - * @throws InvalidArgumentException if the params are not expected - * - * @return Result\Successful|Result\Error + * @param string $id */ public function create($params) { @@ -60,11 +71,6 @@ public function create($params) } } - /* - * Returns keys that are acceptable for create requests - * - * @see create - */ public static function createSignature() { return [ @@ -72,3 +78,4 @@ public static function createSignature() ]; } } +class_alias('Braintree\DocumentUploadGateway', 'Braintree_DocumentUploadGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php index 683329bc0b7..edccec212fd 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EndsWithNode.php @@ -1,40 +1,23 @@ name = $name; $this->searchTerms = []; } - /* - * sets search terms to include the value for key "ends_with" - * - * @param string $value to be sent - * - * @return self - */ public function endsWith($value) { $this->searchTerms["ends_with"] = strval($value); return $this; } - /* - * Returns params - * - * @return object - */ public function toParam() { return $this->searchTerms; } } +class_alias('Braintree\EndsWithNode', 'Braintree_EndsWithNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php deleted file mode 100644 index 1d003f1141c..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EnrichedCustomerData.php +++ /dev/null @@ -1,46 +0,0 @@ -_initialize($attributes); - return $instance; - } - - protected function _initialize($enrichedCustomerDataAttribs) - { - // set the attributes - $this->_attributes = $enrichedCustomerDataAttribs; - - if (isset($enrichedCustomerDataAttribs['profileData'])) { - $this->_set( - 'profileData', - VenmoProfileData::factory( - $enrichedCustomerDataAttribs['profileData'] - ) - ); - } - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php index 31b7256db7e..d91e1eb7dbb 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EqualityNode.php @@ -1,23 +1,12 @@ searchTerms['is_not'] = strval($value); return $this; } } +class_alias('Braintree\EqualityNode', 'Braintree_EqualityNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php index 669b98b52dc..589491cff51 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Codes.php @@ -1,8 +1,8 @@ _errors = @@ -31,7 +32,6 @@ public function __construct($errorData) * * @return integer */ - #[\ReturnTypeWillChange] public function count() { return $this->deepSize(); @@ -39,8 +39,6 @@ public function count() /** * Returns all of the validation errors at all levels of nesting in a single, flat array. - * - * @return array */ public function deepAll() { @@ -52,7 +50,7 @@ public function deepAll() *if creating a customer with a credit card and a billing address, and each of the customer, * credit card, and billing address has 1 error, this method will return 3. * - * @return integer size + * @return int size */ public function deepSize() { @@ -63,8 +61,7 @@ public function deepSize() /** * return errors for the passed key name * - * @param string $key name - * + * @param string $key * @return mixed */ public function forKey($key) @@ -76,19 +73,16 @@ public function forKey($key) * return errors for the passed html field. * For example, $result->errors->onHtmlField("transaction[customer][last_name]") * - * @param string $field html element - * + * @param string $field * @return array */ public function onHtmlField($field) { $pieces = preg_split("/[\[\]]+/", $field, 0, PREG_SPLIT_NO_EMPTY); $errors = $this; - foreach (array_slice($pieces, 0, -1) as $key) { + foreach(array_slice($pieces, 0, -1) as $key) { $errors = $errors->forKey(Util::delimiterToCamelCase($key)); - if (!isset($errors)) { - return []; - } + if (!isset($errors)) { return []; } } $finalKey = Util::delimiterToCamelCase(end($pieces)); return $errors->onAttribute($finalKey); @@ -101,35 +95,29 @@ public function onHtmlField($field) * $result = Customer::create(...); * $customerErrors = $result->errors->forKey('customer')->shallowAll(); * - * - * @return array */ public function shallowAll() { return $this->_errors->shallowAll(); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __get($name) + /** + * + * @ignore + */ + public function __get($name) { $varName = "_$name"; return isset($this->$varName) ? $this->$varName : null; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - return sprintf('%s', $this->_errors); - } - /** - * Implementation of JsonSerializable * - * @return array + * @ignore */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function __toString() { - return $this->_errors->deepAll(); + return sprintf('%s', $this->_errors); } } +class_alias('Braintree\Error\ErrorCollection', 'Braintree_Error_ErrorCollection'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php index fc91ccc4391..79a4cc1af85 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/Validation.php @@ -1,5 +1,4 @@ == More information == * - * // phpcs:ignore Generic.Files.LineLength - * See our {@link https://developer.paypal.com/braintree/docs/reference/general/result-objects#error-results developer docs} for more information + * For more detailed information on Validation errors, see {@link https://developers.braintreepayments.com/reference/general/validation-errors/overview/php https://developers.braintreepayments.com/reference/general/validation-errors/overview/php} + * + * @package Braintree + * @subpackage Error + * + * @property-read string $attribute + * @property-read string $code + * @property-read string $message */ class Validation { @@ -19,25 +24,37 @@ class Validation private $_code; private $_message; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __construct($attributes) + /** + * @ignore + * @param array $attributes + */ + public function __construct($attributes) { $this->_initializeFromArray($attributes); } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * initializes instance properties from the keys/values of an array + * @ignore + * @access protected + * @param array $attributes array of properties to set - single level + * @return void + */ private function _initializeFromArray($attributes) { - foreach ($attributes as $name => $value) { + foreach($attributes AS $name => $value) { $varName = "_$name"; $this->$varName = Util::delimiterToCamelCase($value, '_'); } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __get($name) + /** + * + * @ignore + */ + public function __get($name) { $varName = "_$name"; return isset($this->$varName) ? $this->$varName : null; } } +class_alias('Braintree\Error\Validation', 'Braintree_Error_Validation'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php index 90f18bc9b86..ff3683e3152 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php @@ -1,5 +1,4 @@ == More information == * - * // phpcs:ignore Generic.Files.LineLength - * See our {@link https://developer.paypal.com/braintree/docs/reference/general/result-objects#error-results developer docs} for information on attributes + * For more detailed information on Validation errors, see {@link https://developers.braintreepayments.com/reference/general/validation-errors/overview/php https://developers.braintreepayments.com/reference/general/validation-errors/overview/php} + * + * @package Braintree + * @subpackage Error + * + * @property-read array $errors + * @property-read array $nested */ class ValidationErrorCollection extends Collection { private $_errors = []; private $_nested = []; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __construct($data) + /** + * @ignore + */ + public function __construct($data) { - foreach ($data as $key => $errorData) { + foreach($data AS $key => $errorData) // map errors to new collections recursively if ($key == 'errors') { - foreach ($errorData as $error) { + foreach ($errorData AS $error) { $this->_errors[] = new Validation($error); } } else { $this->_nested[$key] = new ValidationErrorCollection($errorData); } - } + } - /* - * Deeply retrieve all validation errors - * - * @return array - */ public function deepAll() { $validationErrors = array_merge([], $this->_errors); - foreach ($this->_nested as $nestedErrors) { + foreach($this->_nested as $nestedErrors) + { $validationErrors = array_merge($validationErrors, $nestedErrors->deepAll()); } return $validationErrors; } - /* - * Deeply retrieve a count of errors - * - * @return int - */ public function deepSize() { $total = sizeof($this->_errors); - foreach ($this->_nested as $_nestedErrors) { + foreach($this->_nested as $_nestedErrors) + { $total = $total + $_nestedErrors->deepSize(); } return $total; } - /* - * Checks if index if a set variable - * - * @return bool - */ public function forIndex($index) { return $this->forKey("index" . $index); } - /* - * Checks if the value for a given key is a set variable - * - * @return bool - */ public function forKey($key) { return isset($this->_nested[$key]) ? $this->_nested[$key] : null; } - /* - * Returns any errors that match on a given attribute - * - * @param string $attribute to be checked for matching errors - * - * @return array - */ public function onAttribute($attribute) { $matches = []; - foreach ($this->_errors as $key => $error) { - if ($error->attribute == $attribute) { - $matches[] = $error; - } + foreach ($this->_errors AS $key => $error) { + if($error->attribute == $attribute) { + $matches[] = $error; + } } return $matches; } - /* - * Get all errors - * - * @return object - */ + public function shallowAll() { return $this->_errors; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __get($name) + /** + * + * @ignore + */ + public function __get($name) { $varName = "_$name"; return isset($this->$varName) ? $this->$varName : null; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * @ignore + */ public function __toString() { $output = []; + // TODO: implement scope if (!empty($this->_errors)) { $output[] = $this->_inspect($this->_errors); } if (!empty($this->_nested)) { - foreach ($this->_nested as $key => $values) { + foreach ($this->_nested AS $key => $values) { $output[] = $this->_inspect($this->_nested); } } return join(', ', $output); } + /** + * @ignore + */ private function _inspect($errors, $scope = null) { $eOutput = '[' . __CLASS__ . '/errors:['; - $outputErrs = []; - foreach ($errors as $error => $errorObj) { - if (is_array($errorObj->error)) { - $outputErrs[] = "({$errorObj->error['code']} {$errorObj->error['message']})"; - } + foreach($errors AS $error => $errorObj) { + $outputErrs[] = "({$errorObj->error['code']} {$errorObj->error['message']})"; } $eOutput .= join(', ', $outputErrs) . ']]'; return $eOutput; } } +class_alias('Braintree\Error\ValidationErrorCollection', 'Braintree_Error_ValidationErrorCollection'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php index e0c5ca950f2..58d08057a1c 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception.php @@ -1,10 +1,13 @@ _attributes = $attributes; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the facilitated details + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } + } +class_alias('Braintree\FacilitatedDetails', 'Braintree_FacilitatedDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php index 16db2f38d3b..d84ce21e148 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/FacilitatorDetails.php @@ -1,23 +1,13 @@ _attributes = $attributes; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the facilitator details + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } + } +class_alias('Braintree\FacilitatorDetails', 'Braintree_FacilitatorDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php index 8108584e64c..701a599bf1c 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Gateway.php @@ -1,9 +1,11 @@ -config = $config; - $this->graphQLClient = new GraphQLClient($config); } /** @@ -227,6 +221,15 @@ public function transactionLineItem() return new TransactionLineItemGateway($this); } + /** + * + * @return TransparentRedirectGateway + */ + public function transparentRedirect() + { + return new TransparentRedirectGateway($this); + } + /** * * @return UsBankAccountGateway @@ -245,6 +248,15 @@ public function usBankAccountVerification() return new UsBankAccountVerificationGateway($this); } + /** + * + * @return IdealPaymentGateway + */ + public function idealPayment() + { + return new IdealPaymentGateway($this); + } + /** * * @return WebhookNotificationGateway @@ -263,3 +275,4 @@ public function webhookTesting() return new WebhookTestingGateway($this); } } +class_alias('Braintree\Gateway', 'Braintree_Gateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php deleted file mode 100644 index 057f6e109d9..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GooglePayCard.php +++ /dev/null @@ -1,68 +0,0 @@ -== More information == - * - * See our {@link https://developer.paypal.com/braintree/docs/reference/response/google-pay-card developer docs} for information on attributes - */ -class GooglePayCard extends Base -{ - /* instance methods */ - /** - * returns false if default is null or false - * - * @return boolean - */ - public function isDefault() - { - return $this->default; - } - - /** - * Creates an instance of a GooglePayCard from given attributes - * - * @param array $attributes response object attributes - * - * @return GooglePayCard - */ - public static function factory($attributes) - { - $defaultAttributes = [ - 'expirationMonth' => '', - 'expirationYear' => '', - 'last4' => $attributes['virtualCardLast4'], - 'cardType' => $attributes['virtualCardType'], - ]; - - $instance = new self(); - $instance->_initialize(array_merge($defaultAttributes, $attributes)); - return $instance; - } - - /** - * sets instance properties from an array of values - * - * @param array $googlePayCardAttribs array of Google Pay card properties - * - * @return void - */ - protected function _initialize($googlePayCardAttribs) - { - // set the attributes - $this->_attributes = $googlePayCardAttribs; - - $subscriptionArray = []; - if (isset($googlePayCardAttribs['subscriptions'])) { - foreach ($googlePayCardAttribs['subscriptions'] as $subscription) { - $subscriptionArray[] = Subscription::factory($subscription); - } - } - - $this->_set('subscriptions', $subscriptionArray); - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php index d9e0871a27f..551b0c8ef23 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GrantedPaymentInstrumentUpdate.php @@ -1,23 +1,35 @@ == More information == + * + * + * @package Braintree + * @category Resources * - * See our {@link https://developer.paypal.com/braintree/docs/guides/extend/grant-api/webhooks developer docs} for more information + * @property-read string $grantOwnerMerchantId + * @property-read string $grantRecipientMerchantId + * @property-read string $paymentMethodNonce + * @property-read string $token + * @property-read string $updatedFields */ class GrantedPaymentInstrumentUpdate extends Base { /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of GrantedPaymentInstrumentUpdate + * to the requesting method, with populated properties * + * @ignore * @return GrantedPaymentInstrumentUpdate */ public static function factory($attributes) @@ -32,8 +44,8 @@ public static function factory($attributes) /** * sets instance properties from an array of values * + * @access protected * @param array $GrantedPaymentInstrumentAttribs array of grantedPaymentInstrumentUpdate data - * * @return void */ protected function _initialize($grantedPaymentInstrumentUpdateAttribs) @@ -47,10 +59,15 @@ protected function _initialize($grantedPaymentInstrumentUpdateAttribs) $this->_set('paymentMethodNonce', $paymentMethodNonce); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } } +class_alias('Braintree\GrantedPaymentInstrumentUpdate', 'Braintree_GrantedPaymentInstrumentUpdate'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php index 7b1d31f6b99..488d6fe7224 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQL.php @@ -1,26 +1,19 @@ $definition]; if ($variables) { $graphQLRequest["variables"] = $variables; } - // phpcs:ignore Generic.Files.LineLength $response = $this->_doUrlRequest('POST', $this->_config->graphQLBaseUrl(), json_encode($graphQLRequest), null, $this->graphQLHeaders()); $result = json_decode($response["body"], true); @@ -56,3 +40,5 @@ public function request($definition, $variables = null) return $result; } } + +class_alias('Braintree\GraphQL', 'Braintree_GraphQL'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php deleted file mode 100644 index 1ba2c965610..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/GraphQLClient.php +++ /dev/null @@ -1,29 +0,0 @@ -_service = new GraphQL($config); - } - - /* - * Make a GraphQL API request - * - * @param object $definition of the query - * @param object $variables optional - * - * @return object result - */ - public function query($definition, $variables = null) - { - return $this->_service->request($definition, $variables); - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php index 6ba23fd2f35..616be51e533 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Http.php @@ -1,9 +1,7 @@ _config = $config; } - /* - * DELETE request - * - * @param string $path URL path - * @param object $params optional any addition request parameters - * - * @return array|Exception - */ public function delete($path, $params = null) { $response = $this->_doRequest('DELETE', $path, $this->_buildXml($params)); $responseCode = $response['status']; if ($responseCode === 200 || $responseCode === 204) { return true; - } elseif ($responseCode === 422) { + } else if ($responseCode === 422) { return Xml::buildArrayFromXml($response['body']); } else { Util::throwStatusCodeException($response['status']); } } - /* - * GET request - * - * @param string $path URL path - * - * @return array|Exception - */ public function get($path) { $response = $this->_doRequest('GET', $path); @@ -58,14 +40,6 @@ public function get($path) } } - /* - * POST request - * - * @param string $path URL path - * @param object $params optional any addition request parameters - * - * @return array|Exception - */ public function post($path, $params = null) { $response = $this->_doRequest('POST', $path, $this->_buildXml($params)); @@ -77,15 +51,6 @@ public function post($path, $params = null) } } - /* - * POST request for multi parts to be sent - * - * @param string $path URL path - * @param object $params additional request parameters - * @param object $file to be uploaded - * - * @return array|Exception - */ public function postMultipart($path, $params, $file) { $headers = [ @@ -101,14 +66,6 @@ public function postMultipart($path, $params, $file) } } - /* - * PUT request - * - * @param string $path URL path - * @param object $params optional any addition request parameters - * - * @return array|Exception - */ public function put($path, $params = null) { $response = $this->_doRequest('PUT', $path, $this->_buildXml($params)); @@ -125,9 +82,32 @@ private function _buildXml($params) return empty($params) ? null : Xml::buildXmlFromArray($params); } - /* - * Sets internal variable to true - */ + private function _getHeaders() + { + return [ + 'Accept: application/xml', + ]; + } + + private function _getAuthorization() + { + if ($this->_useClientCredentials) { + return [ + 'user' => $this->_config->getClientId(), + 'password' => $this->_config->getClientSecret(), + ]; + } else if ($this->_config->isAccessToken()) { + return [ + 'token' => $this->_config->getAccessToken(), + ]; + } else { + return [ + 'user' => $this->_config->getPublicKey(), + 'password' => $this->_config->getPrivateKey(), + ]; + } + } + public function useClientCredentials() { $this->_useClientCredentials = true; @@ -138,11 +118,156 @@ private function _doRequest($httpVerb, $path, $requestBody = null, $file = null, return $this->_doUrlRequest($httpVerb, $this->_config->baseUrl() . $path, $requestBody, $file, $headers); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function _doUrlRequest($httpVerb, $url, $requestBody = null, $file = null, $customHeaders = null) { - $curlRequest = new CurlRequest($url); - // phpcs:ignore Generic.Files.LineLength - return Curl::makeRequest($httpVerb, $url, $this->_config, $curlRequest, $requestBody, $file, $customHeaders, $this->_useClientCredentials); + $curl = curl_init(); + curl_setopt($curl, CURLOPT_TIMEOUT, $this->_config->timeout()); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb); + curl_setopt($curl, CURLOPT_URL, $url); + + if ($this->_config->acceptGzipEncoding()) { + curl_setopt($curl, CURLOPT_ENCODING, 'gzip'); + } + if ($this->_config->sslVersion()) { + curl_setopt($curl, CURLOPT_SSLVERSION, $this->_config->sslVersion()); + } + + $headers = []; + if ($customHeaders) { + $headers = $customHeaders; + } else { + $headers = $this->_getHeaders($curl); + $headers[] = 'User-Agent: Braintree PHP Library ' . Version::get(); + $headers[] = 'X-ApiVersion: ' . Configuration::API_VERSION; + $headers[] = 'Content-Type: application/xml'; + } + + $authorization = $this->_getAuthorization(); + if (isset($authorization['user'])) { + curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + curl_setopt($curl, CURLOPT_USERPWD, $authorization['user'] . ':' . $authorization['password']); + } else if (isset($authorization['token'])) { + $headers[] = 'Authorization: Bearer ' . $authorization['token']; + } + + if ($this->_config->sslOn()) { + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($curl, CURLOPT_CAINFO, $this->getCaFile()); + } + + if (!empty($file)) { + $boundary = "---------------------" . md5(mt_rand() . microtime()); + $headers[] = "Content-Type: multipart/form-data; boundary={$boundary}"; + $this->prepareMultipart($curl, $requestBody, $file, $boundary); + } else if (!empty($requestBody)) { + curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody); + } + + if ($this->_config->isUsingProxy()) { + $proxyHost = $this->_config->getProxyHost(); + $proxyPort = $this->_config->getProxyPort(); + $proxyType = $this->_config->getProxyType(); + $proxyUser = $this->_config->getProxyUser(); + $proxyPwd= $this->_config->getProxyPassword(); + curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $proxyPort); + if (!empty($proxyType)) { + curl_setopt($curl, CURLOPT_PROXYTYPE, $proxyType); + } + if ($this->_config->isAuthenticatedProxy()) { + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUser . ':' . $proxyPwd); + } + } + + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($curl); + $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $error_code = curl_errno($curl); + $error = curl_error($curl); + + if ($error_code == 28 && $httpStatus == 0) { + throw new Exception\Timeout(); + } + + curl_close($curl); + if ($this->_config->sslOn()) { + if ($httpStatus == 0) { + throw new Exception\SSLCertificate($error, $error_code); + } + } else if ($error_code) { + throw new Exception\Connection($error, $error_code); + } + + return ['status' => $httpStatus, 'body' => $response]; + } + + function prepareMultipart($ch, $requestBody, $file, $boundary) { + $disallow = ["\0", "\"", "\r", "\n"]; + $fileInfo = new finfo(FILEINFO_MIME_TYPE); + $filePath = stream_get_meta_data($file)['uri']; + $data = file_get_contents($filePath); + $mimeType = $fileInfo->buffer($data); + + // build normal parameters + foreach ($requestBody as $k => $v) { + $k = str_replace($disallow, "_", $k); + $body[] = implode("\r\n", [ + "Content-Disposition: form-data; name=\"{$k}\"", + "", + filter_var($v), + ]); + } + + // build file parameter + $splitFilePath = explode(DIRECTORY_SEPARATOR, $filePath); + $filePath = end($splitFilePath); + $filePath = str_replace($disallow, "_", $filePath); + $body[] = implode("\r\n", [ + "Content-Disposition: form-data; name=\"file\"; filename=\"{$filePath}\"", + "Content-Type: {$mimeType}", + "", + $data, + ]); + + // add boundary for each parameters + array_walk($body, function (&$part) use ($boundary) { + $part = "--{$boundary}\r\n{$part}"; + }); + + // add final boundary + $body[] = "--{$boundary}--"; + $body[] = ""; + + // set options + return curl_setopt_array($ch, [ + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => implode("\r\n", $body) + ]); + } + + private function getCaFile() + { + static $memo; + + if ($memo === null) { + $caFile = $this->_config->caFile(); + + if (substr($caFile, 0, 7) !== 'phar://') { + return $caFile; + } + + $extractedCaFile = sys_get_temp_dir() . '/api_braintreegateway_com.ca.crt'; + + if (!file_exists($extractedCaFile) || sha1_file($extractedCaFile) != sha1_file($caFile)) { + if (!copy($caFile, $extractedCaFile)) { + throw new Exception\SSLCaFileNotFound(); + } + } + $memo = $extractedCaFile; + } + + return $memo; } } +class_alias('Braintree\Http', 'Braintree_Http'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php deleted file mode 100644 index 5685aa56d70..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/Curl.php +++ /dev/null @@ -1,190 +0,0 @@ -setOption(CURLOPT_TIMEOUT, $config->getTimeout()); - $httpRequest->setOption(CURLOPT_CUSTOMREQUEST, $httpVerb); - $httpRequest->setOption(CURLOPT_URL, $url); - - if ($config->getAcceptGzipEncoding()) { - $httpRequest->setOption(CURLOPT_ENCODING, 'gzip'); - } - - if ($config->getSslVersion()) { - $httpRequest->setOption(CURLOPT_SSLVERSION, $config->getSslVersion()); - } - - $headers = []; - if ($customHeaders) { - $headers = $customHeaders; - } else { - $headers[] = 'Accept: application/xml'; - $headers[] = 'Content-Type: application/xml'; - $headers[] = 'User-Agent: Braintree PHP Library ' . Version::get(); - $headers[] = 'X-ApiVersion: ' . Configuration::API_VERSION; - } - - $authorization = self::_getAuthorization($config, $useClientCredentials); - if (isset($authorization['user'])) { - $httpRequest->setOption(CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - $httpRequest->setOption(CURLOPT_USERPWD, $authorization['user'] . ':' . $authorization['password']); - } elseif (isset($authorization['token'])) { - $headers[] = 'Authorization: Bearer ' . $authorization['token']; - } - - if ($config->sslOn()) { - $httpRequest->setOption(CURLOPT_SSL_VERIFYPEER, true); - $httpRequest->setOption(CURLOPT_SSL_VERIFYHOST, 2); - $httpRequest->setOption(CURLOPT_CAINFO, self::_getCaFile($config)); - } - - if (!empty($file)) { - $boundary = "---------------------" . md5(mt_rand() . microtime()); - $headers[] = "Content-Type: multipart/form-data; boundary={$boundary}"; - self::_prepareMultipart($httpRequest, $requestBody, $file, $boundary); - } elseif (!empty($requestBody)) { - $httpRequest->setOption(CURLOPT_POSTFIELDS, $requestBody); - } - - if ($config->isUsingProxy()) { - $proxyHost = $config->getProxyHost(); - $proxyPort = $config->getProxyPort(); - $proxyType = $config->getProxyType(); - $proxyUser = $config->getProxyUser(); - $proxyPwd = $config->getProxyPassword(); - $httpRequest->setOption(CURLOPT_PROXY, $proxyHost . ':' . $proxyPort); - if (!empty($proxyType)) { - $httpRequest->setOption(CURLOPT_PROXYTYPE, $proxyType); - } - if ($config->isAuthenticatedProxy()) { - $httpRequest->setOption(CURLOPT_PROXYUSERPWD, $proxyUser . ':' . $proxyPwd); - } - } - - $httpRequest->setOption(CURLOPT_HTTPHEADER, $headers); - $httpRequest->setOption(CURLOPT_RETURNTRANSFER, true); - $response = $httpRequest->execute(); - $httpStatus = $httpRequest->getInfo(CURLINFO_HTTP_CODE); - $errorCode = $httpRequest->getErrorCode(); - $error = $httpRequest->getError(); - - if ($errorCode == 28 && $httpStatus == 0) { - throw new Exception\Timeout(); - } - - $httpRequest->close(); - if (is_null($error)) { - $error = ""; - } - if ($config->sslOn() && $errorCode == 35) { - throw new Exception\SSLCertificate($error, $errorCode); - } - - if ($errorCode) { - throw new Exception\Connection($error, $errorCode); - } - - return ['status' => $httpStatus, 'body' => $response]; - } - - private static function _getAuthorization($config, $useClientCredentials) - { - if ($useClientCredentials) { - return [ - 'user' => $config->getClientId(), - 'password' => $config->getClientSecret(), - ]; - } elseif ($config->isAccessToken()) { - return [ - 'token' => $config->getAccessToken(), - ]; - } else { - return [ - 'user' => $config->getPublicKey(), - 'password' => $config->getPrivateKey(), - ]; - } - } - - private static function _getCaFile($config) - { - static $memo; - - if ($memo === null) { - $caFile = $config->caFile(); - - if (substr($caFile, 0, 7) !== 'phar://') { - return $caFile; - } - - $extractedCaFile = sys_get_temp_dir() . '/api_braintreegateway_com.ca.crt'; - - if (!file_exists($extractedCaFile) || sha1_file($extractedCaFile) != sha1_file($caFile)) { - if (!copy($caFile, $extractedCaFile)) { - throw new Exception\SSLCaFileNotFound(); - } - } - $memo = $extractedCaFile; - } - - return $memo; - } - - private static function _prepareMultipart($httpRequest, $requestBody, $file, $boundary) - { - $disallow = ["\0", "\"", "\r", "\n"]; - $fileInfo = new finfo(FILEINFO_MIME_TYPE); - $filePath = stream_get_meta_data($file)['uri']; - $data = file_get_contents($filePath); - $mimeType = $fileInfo->buffer($data); - - // build normal parameters - foreach ($requestBody as $k => $v) { - $k = str_replace($disallow, "_", $k); - $body[] = implode("\r\n", [ - "Content-Disposition: form-data; name=\"{$k}\"", - "", - filter_var($v), - ]); - } - - // build file parameter - $splitFilePath = explode(DIRECTORY_SEPARATOR, $filePath); - $filePath = end($splitFilePath); - $filePath = str_replace($disallow, "_", $filePath); - $body[] = implode("\r\n", [ - "Content-Disposition: form-data; name=\"file\"; filename=\"{$filePath}\"", - "Content-Type: {$mimeType}", - "", - $data, - ]); - - // add boundary for each parameters - array_walk($body, function (&$part) use ($boundary) { - $part = "--{$boundary}\r\n{$part}"; - }); - - // add final boundary - $body[] = "--{$boundary}--"; - $body[] = ""; - - // set options - $httpRequest->setOption(CURLOPT_POST, true); - $httpRequest->setOption(CURLOPT_POSTFIELDS, implode("\r\n", $body)); - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php deleted file mode 100644 index 5b1b6124a2c..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/CurlRequest.php +++ /dev/null @@ -1,51 +0,0 @@ -_handle = curl_init($url); - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function setOption($name, $value) - { - curl_setopt($this->_handle, $name, $value); - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function execute() - { - return curl_exec($this->_handle); - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function getInfo($name) - { - return curl_getinfo($this->_handle, $name); - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function getErrorCode() - { - return curl_errno($this->_handle); - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function getError() - { - return curl_error($this->_handle); - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function close() - { - curl_close($this->_handle); - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php deleted file mode 100644 index c13787c36f8..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/HttpHelpers/HttpRequest.php +++ /dev/null @@ -1,20 +0,0 @@ -_initializeFromArray($attributes); @@ -21,9 +23,8 @@ public function __construct($attributes) /** * returns private/nonexistent instance properties - * + * @access public * @param string $name property name - * * @return mixed contents of instance properties */ public function __get($name) @@ -38,32 +39,30 @@ public function __get($name) /** * used by isset() and empty() - * + * @access public * @param string $name property name - * * @return boolean */ public function __isset($name) { - return isset($this->_attributes[$name]); + return array_key_exists($name, $this->_attributes); } /** * create a printable representation of the object as: * ClassName[property=value, property=value] - * * @return string */ - public function __toString() + public function __toString() { $objOutput = Util::implodeAssociativeArray($this->_attributes); - return get_class($this) . '[' . $objOutput . ']'; + return get_class($this) .'[' . $objOutput . ']'; } /** * initializes instance properties from the keys/values of an array - * + * @ignore + * @access protected * @param $aAttribs array of properties to set - single level - * * @return void */ private function _initializeFromArray($attributes) @@ -71,29 +70,5 @@ private function _initializeFromArray($attributes) $this->_attributes = $attributes; } - /** - * Implementation of JsonSerializable - * - * @return array - */ - public function jsonSerialize() - { - return $this->_attributes; - } - - /** - * Implementation of to an Array - * - * @return array - */ - public function toArray() - { - return array_map(function ($value) { - if (!is_array($value)) { - return method_exists($value, 'toArray') ? $value->toArray() : $value; - } else { - return $value; - } - }, $this->_attributes); - } } +class_alias('Braintree\Instance', 'Braintree_Instance'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php index e50eb6f4d78..6db01b0628d 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IsNode.php @@ -1,27 +1,14 @@ name = $name; $this->searchTerms = []; } - /** - * Sets the value of the object's "is" key to a string of $value - * - * @param object $value to have its string value set in $this - * - * @return object - */ public function is($value) { $this->searchTerms['is'] = strval($value); @@ -29,13 +16,9 @@ public function is($value) return $this; } - /** - * The searchTerms - * - * @return array - */ public function toParam() { return $this->searchTerms; } } +class_alias('Braintree\IsNode', 'Braintree_IsNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php index c9a2735bcbb..1fd0139c603 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/KeyValueNode.php @@ -1,41 +1,23 @@ name = $name; - $this->searchTerm = true; + $this->searchTerm = True; } - /* - * Sets search term to a value - * - * @param string $value to be assigned - * - * @return object $this - */ public function is($value) { $this->searchTerm = $value; return $this; } - /* - * turns a search term into a param - * - * @return object searchTerm - */ public function toParam() { return $this->searchTerm; } } +class_alias('Braintree\KeyValueNode', 'Braintree_KeyValueNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php index f2cca43f54c..07b73607c24 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentCompleted.php @@ -1,24 +1,36 @@ == More information == + * + * + * @package Braintree + * @category Resources * - * See our {@link https://developer.paypal.com/braintree/docs/reference/general/webhooks/local-payment-methods developer docs} for more information + * @property-read string $grantOwnerMerchantId + * @property-read string $grantRecipientMerchantId + * @property-read string $paymentMethodNonce + * @property-read string $token + * @property-read string $updatedFields */ class LocalPaymentCompleted extends Base { /** - * Creates an instance from given attributes + * factory method: returns an instance of GrantedPaymentInstrumentUpdate + * to the requesting method, with populated properties * - * @param array $attributes response object attributes - * - * @return LocalPaymentCompleted + * @ignore + * @return LocalPaymentCompleted */ public static function factory($attributes) { @@ -32,29 +44,25 @@ public static function factory($attributes) /** * sets instance properties from an array of values * + * @access protected * @param array $LocalPaymentCompletedAttribs array of localPaymentCompleted data - * * @return void */ protected function _initialize($localPaymentCompletedAttribs) { // set the attributes $this->_attributes = $localPaymentCompletedAttribs; - - if (isset($transactionAttribs['transaction'])) { - $this->_set( - 'transaction', - new Transaction( - $transactionAttribs['transaction'] - ) - ); - } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } } +class_alias('Braintree\LocalPaymentCompleted', 'Braintree_LocalPaymentCompleted'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php deleted file mode 100644 index 8618d125d2c..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentExpired.php +++ /dev/null @@ -1,36 +0,0 @@ -_initialize($attributes); - return $instance; - } - - protected function _initialize($localPaymentExpiredAttribs) - { - $this->_attributes = $localPaymentExpiredAttribs; - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php deleted file mode 100644 index 9f809210bdb..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentFunded.php +++ /dev/null @@ -1,46 +0,0 @@ -_initialize($attributes); - return $instance; - } - - protected function _initialize($localPaymentFundedAttribs) - { - // set the attributes - $this->_attributes = $localPaymentFundedAttribs; - - if (isset($transactionAttribs['transaction'])) { - $this->_set( - 'transaction', - new Transaction( - $transactionAttribs['transaction'] - ) - ); - } - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php deleted file mode 100644 index f371e50303e..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/LocalPaymentReversed.php +++ /dev/null @@ -1,51 +0,0 @@ -_initialize($attributes); - return $instance; - } - - /* instance methods */ - - /** - * sets instance properties from an array of values - * - * @param array $LocalPaymentReversedAttribs array of localPaymentReversed data - * - * @return void - */ - protected function _initialize($localPaymentReversedAttribs) - { - // set the attributes - $this->_attributes = $localPaymentReversedAttribs; - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php index f44abd8f14c..09d8bf4f837 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Merchant.php @@ -1,10 +1,6 @@ _set('merchantAccounts', $merchantAccountArray); } - /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes - * - * @return Merchant - */ public static function factory($attributes) { $instance = new self(); @@ -34,10 +23,14 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the merchant + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } } +class_alias('Braintree\Merchant', 'Braintree_Merchant'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php index 68b54d6aeec..0797e23ccee 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount.php @@ -1,9 +1,15 @@ -merchantAccount()->update($merchant_account_id, $attributes); } } +class_alias('Braintree\MerchantAccount', 'Braintree_MerchantAccount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php index b98c29d0bd7..c4caf9a5440 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantAccount/AddressDetails.php @@ -1,13 +1,10 @@ _gateway = $gateway; @@ -19,7 +17,7 @@ public function __construct($gateway) public function create($attribs) { - Util::verifyKeys(self::createSignature(), $attribs); + Util::verifyKeys(self::detectSignature($attribs), $attribs); return $this->_doCreate('/merchant_accounts/create_via_api', ['merchant_account' => $attribs]); } @@ -37,8 +35,17 @@ public function find($merchant_account_id) public function update($merchant_account_id, $attributes) { Util::verifyKeys(self::updateSignature(), $attributes); - $queryPath = '/merchant_accounts/' . $merchant_account_id . '/update_via_api'; - return $this->_doUpdate($queryPath, ['merchant_account' => $attributes]); + return $this->_doUpdate('/merchant_accounts/' . $merchant_account_id . '/update_via_api', ['merchant_account' => $attributes]); + } + + public static function detectSignature($attribs) + { + if (isset($attribs['applicantDetails'])) { + trigger_error("DEPRECATED: Passing applicantDetails to create is deprecated. Please use individual, business, and funding", E_USER_NOTICE); + return self::createDeprecatedSignature(); + } else { + return self::createSignature(); + } } public static function updateSignature() @@ -50,8 +57,7 @@ public static function updateSignature() public function createForCurrency($attribs) { - $queryPath = $this->_config->merchantPath() . '/merchant_accounts/create_for_currency'; - $response = $this->_http->post($queryPath, ['merchant_account' => $attribs]); + $response = $this->_http->post($this->_config->merchantPath() . '/merchant_accounts/create_for_currency', ['merchant_account' => $attribs]); return $this->_verifyGatewayResponse($response); } @@ -113,7 +119,31 @@ public static function createSignature() ]; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + public static function createDeprecatedSignature() + { + $applicantDetailsAddressSignature = ['streetAddress', 'postalCode', 'locality', 'region']; + $applicantDetailsSignature = [ + 'companyName', + 'firstName', + 'lastName', + 'email', + 'phone', + 'dateOfBirth', + 'ssn', + 'taxId', + 'routingNumber', + 'accountNumber', + ['address' => $applicantDetailsAddressSignature] + ]; + + return [ + ['applicantDetails' => $applicantDetailsSignature], + 'id', + 'tosAccepted', + 'masterMerchantAccountId' + ]; + } + public function _doCreate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -138,14 +168,15 @@ private function _verifyGatewayResponse($response) if (isset($response['merchantAccount'])) { // return a populated instance of merchantAccount return new Result\Successful( - MerchantAccount::factory($response['merchantAccount']) + MerchantAccount::factory($response['merchantAccount']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - "Expected merchant account or apiErrorResponse" + "Expected merchant account or apiErrorResponse" ); } } } +class_alias('Braintree\MerchantAccountGateway', 'Braintree_MerchantAccountGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php index efc3f23b7d0..d628e880397 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MerchantGateway.php @@ -1,5 +1,4 @@ -_gateway = $gateway; @@ -32,12 +30,13 @@ private function _verifyGatewayResponse($response) Merchant::factory($response['response']['merchant']), OAuthCredentials::factory($response['response']['credentials']), ]); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - "Expected merchant or apiErrorResponse" + "Expected merchant or apiErrorResponse" ); } } } +class_alias('Braintree\MerchantGateway', 'Braintree_MerchantGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php index 810f85e4110..e1d32b22e57 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Modification.php @@ -1,13 +1,6 @@ _attributes = $attributes; } - /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes - * - * @return Modification - */ public static function factory($attributes) { $instance = new self(); @@ -29,9 +15,8 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { + public function __toString() { return get_called_class() . '[' . Util::attributesToString($this->_attributes) . ']'; } } +class_alias('Braintree\Modification', 'Braintree_Modification'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php index 14decb36c82..397c610ff64 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueNode.php @@ -1,67 +1,41 @@ name = $name; $this->items = []; - $this->allowedValues = $allowedValues; + $this->allowedValues = $allowedValues; } - /** - * Sets the value of the object's items key to $values - * - * @param array $values to be set - * - * @throws InvalidArgumentException - * - * @return object - */ public function in($values) { - $bad_values = array_diff($values, $this->allowedValues); - if (count($this->allowedValues) > 0 && count($bad_values) > 0) { - $message = 'Invalid argument(s) for ' . $this->name . ':'; - foreach ($bad_values as $bad_value) { - $message .= ' ' . $bad_value; - } + $bad_values = array_diff($values, $this->allowedValues); + if (count($this->allowedValues) > 0 && count($bad_values) > 0) { + $message = 'Invalid argument(s) for ' . $this->name . ':'; + foreach ($bad_values AS $bad_value) { + $message .= ' ' . $bad_value; + } - throw new InvalidArgumentException($message); - } + throw new InvalidArgumentException($message); + } $this->items = $values; return $this; } - /** - * Sets the value of the object's items key to [$value] - * - * @param object $value to be set - * - * @return object - */ public function is($value) { return $this->in([$value]); } - /** - * Retrieves items(params) from the object - * - * @return object - */ public function toParam() { return $this->items; } } +class_alias('Braintree\MultipleValueNode', 'Braintree_MultipleValueNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php index 663be905cdd..c98ee95a9fa 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php @@ -1,92 +1,47 @@ textNode = new TextNode($name); } - /** - * Sets the value of the object's "contains" key to a string of $value - * - * @param object $value to have its string value set in $this - * - * @return object - */ public function contains($value) { $this->textNode->contains($value); return $this; } - /** - * Sets the value of the object's "ends_width" key to a string of $value - * - * @param object $value to have its string value set in $this - * - * @return object - */ public function endsWith($value) { $this->textNode->endsWith($value); return $this; } - /** - * Sets the value of the object's "is" key to a string of $value - * - * @param object $value to have its string value set in $this - * - * @return object - */ public function is($value) { $this->textNode->is($value); return $this; } - /** - * Sets the value of the object's "is_not" key to a string of $value - * - * @param object $value to have its string value set in $this - * - * @return object - */ public function isNot($value) { $this->textNode->isNot($value); return $this; } - /** - * Sets the value of the object's "starts_with" key to a string of $value - * - * @param object $value to have its string value set in $this - * - * @return object - */ public function startsWith($value) { $this->textNode->startsWith($value); return $this; } - /** - * Merges searchTerms into the parent element's params - * - * @return array - */ public function toParam() { return array_merge(parent::toParam(), $this->textNode->toParam()); } } +class_alias('Braintree\MultipleValueOrTextNode', 'Braintree_MultipleValueOrTextNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php index 9934198fd38..62a289725ef 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthAccessRevocation.php @@ -1,22 +1,17 @@ _attributes = $attributes; } } +class_alias('Braintree\OAuthAccessRevocation', 'Braintree_OAuthAccessRevocation'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php index dbd3414d884..60de5fb3221 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthCredentials.php @@ -1,9 +1,11 @@ _attributes = $attribs; } - /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes - * - * @return OauthCredentials - */ public static function factory($attributes) { $instance = new self(); @@ -26,10 +21,14 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * returns a string representation of the access token + * @return string + */ public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } } +class_alias('Braintree\OAuthCredentials', 'Braintree_OAuthCredentials'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php index e23f040d885..4e2d1b20e61 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthGateway.php @@ -1,10 +1,12 @@ _gateway = $gateway; @@ -23,36 +24,18 @@ public function __construct($gateway) $this->_config->assertHasClientCredentials(); } - /* Create an oAuth token from an authorization code - * - * @param mixed $params of request details - * - * @return Result\Successful|Result\Error - */ public function createTokenFromCode($params) { $params['grantType'] = "authorization_code"; return $this->_createToken($params); } - /* Create an oAuth token from a refresh token - * - * @param mixed $params of request details - * - * @return Result\Successful|Result\Error - */ public function createTokenFromRefreshToken($params) { $params['grantType'] = "refresh_token"; return $this->_createToken($params); } - /* Revoke an oAuth Access token - * - * @param mixed $params of request details - * - * @return Result\Successful|Result\Error - */ public function revokeAccessToken($accessToken) { $params = ['token' => $accessToken]; @@ -67,7 +50,6 @@ private function _createToken($params) return $this->_verifyGatewayResponse($response); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing private function _verifyGatewayResponse($response) { if (isset($response['credentials'])) { @@ -75,12 +57,12 @@ private function _verifyGatewayResponse($response) OAuthCredentials::factory($response['credentials']) ); return $this->_mapSuccess($result); - } elseif (isset($response['result'])) { + } else if (isset($response['result'])) { $result = new Result\Successful( OAuthResult::factory($response['result']) ); return $this->_mapAccessTokenRevokeSuccess($result); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { $result = new Result\Error($response['apiErrorResponse']); return $this->_mapError($result); } else { @@ -90,30 +72,27 @@ private function _verifyGatewayResponse($response) } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function _mapError($result) { $error = $result->errors->deepAll()[0]; if ($error->code == Error\Codes::OAUTH_INVALID_GRANT) { $result->error = 'invalid_grant'; - } elseif ($error->code == Error\Codes::OAUTH_INVALID_CREDENTIALS) { + } else if ($error->code == Error\Codes::OAUTH_INVALID_CREDENTIALS) { $result->error = 'invalid_credentials'; - } elseif ($error->code == Error\Codes::OAUTH_INVALID_SCOPE) { + } else if ($error->code == Error\Codes::OAUTH_INVALID_SCOPE) { $result->error = 'invalid_scope'; } $result->errorDescription = explode(': ', $error->message)[1]; return $result; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function _mapAccessTokenRevokeSuccess($result) { $result->revocationResult = $result->success; return $result; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function _mapSuccess($result) { $credentials = $result->credentials; @@ -124,13 +103,6 @@ public function _mapSuccess($result) return $result; } - /* - * Create URL for oAuth connection - * - * @param array $params optional - * - * @return string - */ public function connectUrl($params = []) { $query = Util::camelCaseToDelimiterArray($params, '_'); @@ -139,4 +111,14 @@ public function connectUrl($params = []) return $this->_config->baseUrl() . '/oauth/connect?' . $queryString; } + + /** + * @deprecated since version 3.26.1 + */ + public function computeSignature($url) + { + $key = hash('sha256', $this->_config->getClientSecret(), true); + return hash_hmac('sha256', $url, $key); + } } +class_alias('Braintree\OAuthGateway', 'Braintree_OAuthGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php index 75d0e4bb9aa..9c3e4e6d386 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/OAuthResult.php @@ -1,9 +1,11 @@ _attributes = $attribs; } - /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes - * - * @return OAuthResult - */ public static function factory($attributes) { $instance = new self(); @@ -26,10 +21,14 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * returns a string representation of the result + * @return string + */ public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } } +class_alias('Braintree\OAuthResult', 'Braintree_OAuthResult'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php index f0947bd4872..9deef047cd0 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedCollection.php @@ -1,5 +1,4 @@ @@ -18,6 +17,9 @@ * print_r($merchantAccount->status); * } * + * + * @package Braintree + * @subpackage Utility */ class PaginatedCollection implements Iterator { @@ -28,8 +30,14 @@ class PaginatedCollection implements Iterator private $_totalItems; private $_items; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __construct($pager) + /** + * set up the paginated collection + * + * expects an array of an object and method to call on it + * + * @param array $pager + */ + public function __construct($pager) { $this->_pager = $pager; $this->_pageSize = 0; @@ -39,44 +47,29 @@ public function __construct($pager) } /** - * Returns the current item when iterating with foreach - * - * @return object of the current item + * returns the current item when iterating with foreach */ - #[\ReturnTypeWillChange] public function current() { return $this->_items[($this->_index % $this->_pageSize)]; } - /** - * Returns null - * - * @return null - */ - #[\ReturnTypeWillChange] public function key() { return null; } /** - * Advances to the next item in the collection when iterating with foreach - * - * @return object of the next item in the collection + * advances to the next item in the collection when iterating with foreach */ - #[\ReturnTypeWillChange] public function next() { ++$this->_index; } /** - * Rewinds the collection to the first item when iterating with foreach - * - * @return mixed collection with index set to 0 + * rewinds the collection to the first item when iterating with foreach */ - #[\ReturnTypeWillChange] public function rewind() { $this->_index = 0; @@ -87,14 +80,12 @@ public function rewind() } /** - * Returns whether the current item is valid when iterating with foreach - * - * @return bool + * returns whether the current item is valid when iterating with foreach */ - #[\ReturnTypeWillChange] public function valid() { - if ($this->_currentPage == 0 || $this->_index % $this->_pageSize == 0 && $this->_index < $this->_totalItems) { + if ($this->_currentPage == 0 || $this->_index % $this->_pageSize == 0 && $this->_index < $this->_totalItems) + { $this->_getNextPage(); } @@ -121,8 +112,9 @@ private function _getNextPage() ); } - $this->_totalItems = $result->getTotalItems(); + $this->_totalItems= $result->getTotalItems(); $this->_pageSize = $result->getPageSize(); $this->_items = $result->getCurrentPage(); } } +class_alias('Braintree\PaginatedCollection', 'Braintree_PaginatedCollection'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php index cab403d71b6..9b383abcfd7 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaginatedResult.php @@ -1,17 +1,12 @@ _totalItems = $totalItems; @@ -19,33 +14,19 @@ public function __construct($totalItems, $pageSize, $currentPage) $this->_currentPage = $currentPage; } - /* - * Getter method for totalItems - * - * @return int - */ public function getTotalItems() { return $this->_totalItems; } - /* - * Getter method for page size - * - * @return int - */ public function getPageSize() { return $this->_pageSize; } - /* - * Getter method for the current page index - * - * @return int - */ public function getCurrentPage() { return $this->_currentPage; } } +class_alias('Braintree\PaginatedResult', 'Braintree_PaginatedResult'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php index c8c911997d5..5d8dc917b14 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartialMatchNode.php @@ -1,37 +1,18 @@ searchTerms["starts_with"] = strval($value); return $this; } - /** - * Sets the value of the object's "ends_width" key to a string of $value - * - * @param object $value to have its string value set in $this - * - * @return object - */ public function endsWith($value) { $this->searchTerms["ends_with"] = strval($value); return $this; } } +class_alias('Braintree\PartialMatchNode', 'Braintree_PartialMatchNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php index fd6c56392eb..d5ac1521376 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PartnerMerchant.php @@ -1,5 +1,4 @@ _attributes = $attributes; } } +class_alias('Braintree\PartnerMerchant', 'Braintree_PartnerMerchant'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php index 59cf16640e9..7cfbf976696 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccount.php @@ -1,20 +1,40 @@ == More information == + * + * + * @package Braintree + * @category Resources + * + * @property-read string $billingAgreementId + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read boolean $default + * @property-read string $email + * @property-read string $imageUrl + * @property-read string $payerId + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read string $token + * @property-read \DateTime $updatedAt */ class PayPalAccount extends Base { /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of PayPalAccount + * to the requesting method, with populated properties * + * @ignore * @return PayPalAccount */ public static function factory($attributes) @@ -39,8 +59,8 @@ public function isDefault() /** * sets instance properties from an array of values * + * @access protected * @param array $paypalAccountAttribs array of paypalAccount data - * * @return void */ protected function _initialize($paypalAccountAttribs) @@ -50,7 +70,7 @@ protected function _initialize($paypalAccountAttribs) $subscriptionArray = []; if (isset($paypalAccountAttribs['subscriptions'])) { - foreach ($paypalAccountAttribs['subscriptions'] as $subscription) { + foreach ($paypalAccountAttribs['subscriptions'] AS $subscription) { $subscriptionArray[] = Subscription::factory($subscription); } } @@ -58,73 +78,38 @@ protected function _initialize($paypalAccountAttribs) $this->_set('subscriptions', $subscriptionArray); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } - /** - * Static methods redirecting to gateway class - * - * @param string $token paypal accountunique id - * - * @see PayPalGateway::find() - * - * @throws Exception\NotFound - * - * @return PayPalAccount - */ + + // static methods redirecting to gateway + public static function find($token) { return Configuration::gateway()->payPalAccount()->find($token); } - /** - * Static methods redirecting to gateway class - * - * if calling this method in context, $token - * is the 2nd attribute. $token is not sent in object context. - * - * @param string $token (optional) - * @param array $attributes including request parameters - * - * @see PayPalGateway::update() - * - * @return Result\Successful or Result\Error - */ public static function update($token, $attributes) { return Configuration::gateway()->payPalAccount()->update($token, $attributes); } - /** - * Static methods redirecting to gateway class - * - * @param string $token paypal account identifier - * - * @see PayPalGateway::delete() - * - * @return Result - */ public static function delete($token) { return Configuration::gateway()->payPalAccount()->delete($token); } - /** - * Static methods redirecting to gateway class - * - * @param string $token paypal account identifier - * @param array $transactionAttribs containing request parameters - * - * @see PayPalGateway::sale() - * - * @return Result\Successful|Result\Error - */ public static function sale($token, $transactionAttribs) { return Configuration::gateway()->payPalAccount()->sale($token, $transactionAttribs); } } +class_alias('Braintree\PayPalAccount', 'Braintree_PayPalAccount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php index 638a81fa9a5..9302a17afab 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PayPalAccountGateway.php @@ -1,5 +1,4 @@ + * == More information == + * + * + * @package Braintree + * @category Resources */ class PayPalAccountGateway { @@ -17,7 +25,6 @@ class PayPalAccountGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -28,13 +35,12 @@ public function __construct($gateway) /** - * Find a paypalAccount by token + * find a paypalAccount by token * + * @access public * @param string $token paypal accountunique id - * - * @throws Exception\NotFound - * * @return PayPalAccount + * @throws Exception\NotFound */ public function find($token) { @@ -48,6 +54,7 @@ public function find($token) 'paypal account with token ' . $token . ' not found' ); } + } /** @@ -56,9 +63,9 @@ public function find($token) * if calling this method in context, $token * is the 2nd attribute. $token is not sent in object context. * - * @param string $token (optional) - * @param array $attributes including request parameters - * + * @access public + * @param array $attributes + * @param string $token (optional) * @return Result\Successful or Result\Error */ public function update($token, $attributes) @@ -68,13 +75,6 @@ public function update($token, $attributes) return $this->_doUpdate('put', '/payment_methods/paypal_account/' . $token, ['paypalAccount' => $attributes]); } - /** - * Delete a PayPal Account record - * - * @param string $token paypal account identifier - * - * @return Result - */ public function delete($token) { $this->_validateId($token); @@ -86,10 +86,10 @@ public function delete($token) /** * create a new sale for the current PayPal account * - * @param string $token paypal account identifier - * @param array $transactionAttribs containing request parameters - * + * @param string $token + * @param array $transactionAttribs * @return Result\Successful|Result\Error + * @see Transaction::sale() */ public function sale($token, $transactionAttribs) { @@ -102,7 +102,6 @@ public function sale($token, $transactionAttribs) ); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function updateSignature() { return [ @@ -111,7 +110,14 @@ public static function updateSignature() ]; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the update request to the gateway + * + * @ignore + * @param string $subPath + * @param array $params + * @return mixed + */ private function _doUpdate($httpVerb, $subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -127,47 +133,46 @@ private function _doUpdate($httpVerb, $subPath, $params) * encapsulates a Errors object inside a Result\Error * alternatively, throws an Unexpected exception if the response is invalid. * + * @ignore * @param array $response gateway response values - * - * @throws Exception\Unexpected - * * @return Result\Successful|Result\Error + * @throws Exception\Unexpected */ private function _verifyGatewayResponse($response) { if (isset($response['paypalAccount'])) { // return a populated instance of PayPalAccount return new Result\Successful( - PayPalAccount::factory($response['paypalAccount']) + PayPalAccount::factory($response['paypalAccount']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - 'Expected paypal account or apiErrorResponse' + 'Expected paypal account or apiErrorResponse' ); } } /** * verifies that a valid paypal account identifier is being used - * - * @param string $identifier - * @param Optional $string $identifierType type of identifier supplied, default 'token' - * + * @ignore + * @param string $identifier + * @param Optional $string $identifierType type of identifier supplied, default 'token' * @throws InvalidArgumentException */ private function _validateId($identifier = null, $identifierType = 'token') { if (empty($identifier)) { - throw new InvalidArgumentException( - 'expected paypal account id to be set' - ); + throw new InvalidArgumentException( + 'expected paypal account id to be set' + ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) { throw new InvalidArgumentException( - $identifier . ' is an invalid paypal account ' . $identifierType . '.' - ); + $identifier . ' is an invalid paypal account ' . $identifierType . '.' + ); } } } +class_alias('Braintree\PayPalAccountGateway', 'Braintree_PayPalAccountGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php index 68b31bcf4b6..8218e42807a 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentInstrumentType.php @@ -1,22 +1,19 @@ == More information == + * + * + * @package Braintree + * @category Resources */ class PaymentMethod extends Base { - /** - * Static method from gateway class - * - * @param array $attribs containing request parameterss - * - * @see PaymentMethodGateway::create() - * - * @throws Exception\ValidationError - * - * @return Result\Successful|Result\Error - */ + // static methods redirecting to gateway + public static function create($attribs) { return Configuration::gateway()->paymentMethod()->create($attribs); } - /** - * Static method from gateway class - * - * @param string $token payment method unique id - * - * @see PaymentMethodGateway::find() - * - * @throws Exception\NotFound - * - * @return CreditCard|PayPalAccount - */ public static function find($token) { return Configuration::gateway()->paymentMethod()->find($token); } - /** - * Static method from gateway class - * - * @param string $token payment method identifier - * @param array $attribs containing request parameters - * - * @see PaymentMethodGateway::update() - * - * @return Result\Successful|Result\Error - */ public static function update($token, $attribs) { return Configuration::gateway()->paymentMethod()->update($token, $attribs); } - /** - * Static method from gateway class - * - * @param string $token payment method identifier - * @param mixed $options containing optional parameters - * - * @see PaymentMethodGateway::delete() - * - * @return Result - */ - public static function delete($token, $options = []) + public static function delete($token, $options=[]) { return Configuration::gateway()->paymentMethod()->delete($token, $options); } } +class_alias('Braintree\PaymentMethod', 'Braintree_PaymentMethod'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php deleted file mode 100644 index b500bb459cd..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodCustomerDataUpdatedMetadata.php +++ /dev/null @@ -1,49 +0,0 @@ -_initialize($attributes); - return $instance; - } - - protected function _initialize($metadataAttribs) - { - // set the attributes - $this->_attributes = $metadataAttribs; - if (isset($metadataAttribs['paymentMethod'])) { - $this->paymentMethod = PaymentMethodParser::parsePaymentMethod($metadataAttribs['paymentMethod']); - } - - if (isset($metadataAttribs['enrichedCustomerData'])) { - $this->_set( - 'enrichedCustomerData', - EnrichedCustomerData::factory( - $metadataAttribs['enrichedCustomerData'] - ) - ); - } - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php index c4921d5abe4..45034bccf96 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodGateway.php @@ -1,13 +1,23 @@ + * == More information == + * + * + * @package Braintree + * @category Resources */ class PaymentMethodGateway { @@ -15,7 +25,6 @@ class PaymentMethodGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -25,16 +34,6 @@ public function __construct($gateway) } - /** - * Attempts the create operation - * returns a Result on success or an Error on failure - * - * @param array $attribs containing request parameterss - * - * @throws Exception\ValidationError - * - * @return Result\Successful|Result\Error - */ public function create($attribs) { Util::verifyKeys(self::createSignature(), $attribs); @@ -42,13 +41,11 @@ public function create($attribs) } /** - * Find a PaymentMethod by token + * find a PaymentMethod by token * * @param string $token payment method unique id - * - * @throws Exception\NotFound - * * @return CreditCard|PayPalAccount + * @throws Exception\NotFound */ public function find($token) { @@ -64,29 +61,13 @@ public function find($token) } } - /** - * Updates the payment method's record - * - * @param string $token payment method identifier - * @param array $attribs containing request parameters - * - * @return Result\Successful|Result\Error - */ public function update($token, $attribs) { Util::verifyKeys(self::updateSignature(), $attribs); return $this->_doUpdate('/payment_methods/any/' . $token, ['payment_method' => $attribs]); } - /** - * Delete a payment method record - * - * @param string $token payment method identifier - * @param mixed $options containing optional parameters - * - * @return Result - */ - public function delete($token, $options = []) + public function delete($token, $options=[]) { Util::verifyKeys(self::deleteSignature(), $options); $this->_validateId($token); @@ -97,17 +78,7 @@ public function delete($token, $options = []) return $this->_doDelete('/payment_methods/any/' . $token . $queryString); } - /** - * Grant a payment method record - * - * See our {@link https://developer.paypal.com/braintree/docs/reference/request/payment-method/grant developer docs} for more info on the Grant API. - * - * @param string $sharedPaymentMethodToken payment method identifier - * @param mixed $attribs containing request parameters - * - * @return Result - */ - public function grant($sharedPaymentMethodToken, $attribs = []) + public function grant($sharedPaymentMethodToken, $attribs=[]) { if (is_bool($attribs) === true) { $attribs = ['allow_vaulting' => $attribs]; @@ -122,15 +93,6 @@ public function grant($sharedPaymentMethodToken, $attribs = []) ); } - /** - * Deletes the version of a granted payment method from the receiving merchant's vault. - * - * See our {@link https://developer.paypal.com/braintree/docs/reference/request/payment-method/revoke developer docs} for more info on the Grant API. - * - * @param string $sharedPaymentMethodToken payment method identifier - * - * @return Result - */ public function revoke($sharedPaymentMethodToken) { return $this->_doRevoke( @@ -149,12 +111,11 @@ private static function baseSignature() $optionsSignature = [ 'failOnDuplicatePaymentMethod', 'makeDefault', - 'skipAdvancedFraudChecking', - 'usBankAccountVerificationMethod', - 'verificationAccountType', - 'verificationAmount', 'verificationMerchantAccountId', 'verifyCard', + 'verificationAccountType', + 'verificationAmount', + 'usBankAccountVerificationMethod', ['paypal' => [ 'payee_email', 'payeeEmail', @@ -189,18 +150,12 @@ private static function baseSignature() ]; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function createSignature() { - $signature = array_merge(self::baseSignature(), [ - 'customerId', - 'paypalRefreshToken', - CreditCardGateway::threeDSecurePassThruSignature() - ]); + $signature = array_merge(self::baseSignature(), ['customerId', 'paypalRefreshToken', 'paypalVaultWithoutUpgrade']); return $signature; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public static function updateSignature() { $billingAddressSignature = AddressGateway::updateSignature(); @@ -209,20 +164,11 @@ public static function updateSignature() 'updateExisting' ] ]); - $threeDSPassThruSignature = [ - 'authenticationResponse', - 'cavv', - 'cavvAlgorithm', - 'directoryResponse', - 'dsTransactionId', - 'eciFlag', - 'threeDSecureVersion', - 'xid' - ]; $signature = array_merge(self::baseSignature(), [ + 'deviceSessionId', 'venmoSdkPaymentMethodCode', - ['billingAddress' => $billingAddressSignature], - ['threeDSecurePassThru' => $threeDSPassThruSignature] + 'fraudMerchantId', + ['billingAddress' => $billingAddressSignature] ]); return $signature; } @@ -232,7 +178,14 @@ private static function deleteSignature() return ['revokeAllGrants']; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the create request to the gateway + * + * @ignore + * @param string $subPath + * @param array $params + * @return mixed + */ public function _doCreate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -241,7 +194,6 @@ public function _doCreate($subPath, $params) return $this->_verifyGatewayResponse($response); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function _doGrant($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -250,7 +202,6 @@ public function _doGrant($subPath, $params) return $this->_verifyGrantResponse($response); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function _doRevoke($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -259,7 +210,14 @@ public function _doRevoke($subPath, $params) return $this->_verifyRevokeResponse($response); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the update request to the gateway + * + * @ignore + * @param string $subPath + * @param array $params + * @return mixed + */ public function _doUpdate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -269,7 +227,13 @@ public function _doUpdate($subPath, $params) } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the delete request to the gateway + * + * @ignore + * @param string $subPath + * @return mixed + */ public function _doDelete($subPath) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -278,34 +242,38 @@ public function _doDelete($subPath) } /** - * Generic method for validating incoming gateway responses + * generic method for validating incoming gateway responses * - * Creates a new CreditCard or PayPalAccount object + * creates a new CreditCard or PayPalAccount object * and encapsulates it inside a Result\Successful object, or * encapsulates a Errors object inside a Result\Error * alternatively, throws an Unexpected exception if the response is invalid. + * + * @ignore + * @param array $response gateway response values + * @return Result\Successful|Result\Error + * @throws Exception\Unexpected */ private function _verifyGatewayResponse($response) { if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); - } elseif (($response)) { + } else if (($response)) { return new Result\Successful( PaymentMethodParser::parsePaymentMethod($response), 'paymentMethod' ); } else { throw new Exception\Unexpected( - 'Expected payment method or apiErrorResponse' + 'Expected payment method or apiErrorResponse' ); } } - private function _verifyGrantResponse($response) - { + private function _verifyGrantResponse($response) { if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); - } elseif (isset($response['paymentMethodNonce'])) { + } else if (isset($response['paymentMethodNonce'])) { return new Result\Successful( PaymentMethodNonce::factory($response['paymentMethodNonce']), 'paymentMethodNonce' @@ -317,11 +285,10 @@ private function _verifyGrantResponse($response) } } - private function _verifyRevokeResponse($response) - { + private function _verifyRevokeResponse($response) { if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); - } elseif (isset($response['success'])) { + } else if (isset($response['success'])) { return new Result\Successful(); } else { throw new Exception\Unexpected( @@ -331,19 +298,24 @@ private function _verifyRevokeResponse($response) } /** - * Verifies that a valid payment method identifier is being used + * verifies that a valid payment method identifier is being used + * @ignore + * @param string $identifier + * @param Optional $string $identifierType type of identifier supplied, default 'token' + * @throws InvalidArgumentException */ private function _validateId($identifier = null, $identifierType = 'token') { if (empty($identifier)) { - throw new InvalidArgumentException( - 'expected payment method id to be set' - ); + throw new InvalidArgumentException( + 'expected payment method id to be set' + ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) { throw new InvalidArgumentException( - $identifier . ' is an invalid payment method ' . $identifierType . '.' - ); + $identifier . ' is an invalid payment method ' . $identifierType . '.' + ); } } } +class_alias('Braintree\PaymentMethodGateway', 'Braintree_PaymentMethodGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php index 85f905cac95..4501fa9bee9 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonce.php @@ -1,54 +1,42 @@ == More information == + * + * + * @package Braintree + * @category Resources + * + * @property-read \Braintree\BinData $binData + * @property-read boolean $default + * @property-read string $nonce + * @property-read \Braintree\ThreeDSecureInfo $threeDSecureInfo + * @property-read string $type */ class PaymentMethodNonce extends Base { - /** - * Static method from gateway class - * - * @param string $token the identifier of the payment method - * @param array|null $params additional parameters to be included in the request - * - * @see PaymentMethodNonceGateway::create() - * - * @return PaymentMethodNonce|Error - */ - public static function create($token, $params = []) + // static methods redirecting to gateway + + public static function create($token) { - return Configuration::gateway()->paymentMethodNonce()->create($token, $params); + return Configuration::gateway()->paymentMethodNonce()->create($token); } - /* - * Static method from gateway class - * - * @param string $nonce the payment method nonce string to return information about - * - * @see PaymentMethodNonceGateway::find() - * - * @return PaymentMethodNonce - */ public static function find($nonce) { return Configuration::gateway()->paymentMethodNonce()->find($nonce); } - /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes - * - * @return PaymentMethodNonce - */ public static function factory($attributes) { $instance = new self(); @@ -62,16 +50,13 @@ protected function _initialize($nonceAttributes) $this->_set('nonce', $nonceAttributes['nonce']); $this->_set('type', $nonceAttributes['type']); - if (isset($nonceAttributes['authenticationInsight'])) { - $this->_set('authenticationInsight', $nonceAttributes['authenticationInsight']); + if(isset($nonceAttributes['threeDSecureInfo'])) { + $this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($nonceAttributes['threeDSecureInfo'])); } - if (isset($nonceAttributes['binData'])) { + if(isset($nonceAttributes['binData'])) { $this->_set('binData', BinData::factory($nonceAttributes['binData'])); } - - if (isset($nonceAttributes['threeDSecureInfo'])) { - $this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($nonceAttributes['threeDSecureInfo'])); - } } } +class_alias('Braintree\PaymentMethodNonce', 'Braintree_PaymentMethodNonce'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php index a158ebf125c..40ad8af7339 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodNonceGateway.php @@ -1,9 +1,21 @@ == More information == + * + * + * @package Braintree + * @category Resources */ class PaymentMethodNonceGateway { @@ -11,7 +23,6 @@ class PaymentMethodNonceGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -19,31 +30,12 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /** - * Create a payment method nonce from an existing payment method's token - * - * @param string $token the identifier of the payment method - * @param mixed|null $params additional parameters to be included in the request - * - * @return PaymentMethodNonce|Error - */ - public function create($token, $params = []) + + public function create($token) { $subPath = '/payment_methods/' . $token . '/nonces'; $fullPath = $this->_config->merchantPath() . $subPath; - $schema = [[ - 'paymentMethodNonce' => [ - 'merchantAccountId', - 'authenticationInsight', - ['authenticationInsightOptions' => [ - 'amount', - 'recurringCustomerConsent', - 'recurringMaxAmount' - ] - ]] - ]]; - Util::verifyKeys($schema, $params); - $response = $this->_http->post($fullPath, $params); + $response = $this->_http->post($fullPath); return new Result\Successful( PaymentMethodNonce::factory($response['paymentMethodNonce']), @@ -52,13 +44,8 @@ public function create($token, $params = []) } /** - * Find a Payment Method Nonce given the string value + * @access public * - * @param string $nonce to be found - * - * @throws NotFound - * - * @return PaymentMethodNonce */ public function find($nonce) { @@ -68,8 +55,10 @@ public function find($nonce) return PaymentMethodNonce::factory($response['paymentMethodNonce']); } catch (Exception\NotFound $e) { throw new Exception\NotFound( - 'payment method nonce with id ' . $nonce . ' not found' + 'payment method nonce with id ' . $nonce . ' not found' ); } + } } +class_alias('Braintree\PaymentMethodNonceGateway', 'Braintree_PaymentMethodNonceGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php index 45a3a5ba651..fea4af718b1 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PaymentMethodParser.php @@ -1,38 +1,52 @@ == More information == + * + * + * @package Braintree + * @category Resources + * */ class PaymentMethodParser { - /** - * Creates instances of the payment method in the response object - * - * @param mixed $response from Braintree API - * - * @return mixed|Exception - */ public static function parsePaymentMethod($response) { if (isset($response['creditCard'])) { return CreditCard::factory($response['creditCard']); - } elseif (isset($response['paypalAccount'])) { + } else if (isset($response['paypalAccount'])) { return PayPalAccount::factory($response['paypalAccount']); - } elseif (isset($response['applePayCard'])) { + } else if (isset($response['coinbaseAccount'])) { + return CoinbaseAccount::factory($response['coinbaseAccount']); + } else if (isset($response['applePayCard'])) { return ApplePayCard::factory($response['applePayCard']); - } elseif (isset($response['androidPayCard'])) { - return GooglePayCard::factory($response['androidPayCard']); - } elseif (isset($response['usBankAccount'])) { + } else if (isset($response['androidPayCard'])) { + return AndroidPayCard::factory($response['androidPayCard']); + } else if (isset($response['amexExpressCheckoutCard'])) { + return AmexExpressCheckoutCard::factory($response['amexExpressCheckoutCard']); + } else if (isset($response['europeBankAccount'])) { + return EuropeBankAccount::factory($response['europeBankAccount']); + } else if (isset($response['usBankAccount'])) { return UsBankAccount::factory($response['usBankAccount']); - } elseif (isset($response['venmoAccount'])) { + } else if (isset($response['venmoAccount'])) { return VenmoAccount::factory($response['venmoAccount']); - } elseif (isset($response['visaCheckoutCard'])) { + } else if (isset($response['visaCheckoutCard'])) { return VisaCheckoutCard::factory($response['visaCheckoutCard']); - } elseif (isset($response['samsungPayCard'])) { + } else if (isset($response['masterpassCard'])) { + return MasterpassCard::factory($response['masterpassCard']); + } else if (isset($response['samsungPayCard'])) { return SamsungPayCard::factory($response['samsungPayCard']); - } elseif (is_array($response)) { + } else if (is_array($response)) { return UnknownPaymentMethod::factory($response); } else { throw new Exception\Unexpected( @@ -41,3 +55,4 @@ public static function parsePaymentMethod($response) } } } +class_alias('Braintree\PaymentMethodParser', 'Braintree_PaymentMethodParser'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Plan.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Plan.php index a21b23ad77c..a65b15a147b 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Plan.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Plan.php @@ -1,21 +1,25 @@ _attributes['plans'] = $planArray; } - /** - * static methods redirecting to gateway class - * - * @see PlanGateway::all() - * - * @return Plan[] - */ - public static function all() - { - return Configuration::gateway()->plan()->all(); - } - - /** - * static methods redirecting to gateway class - * - * @param array $attributes response object attributes - * - * @return Plan - */ - public static function create($attributes) - { - return Configuration::gateway()->plan()->create($attributes); - } - /** - * static methods redirecting to gateway class - * - * @param $id int planId - * - * @return Plan - */ - public static function find($id) - { - return Configuration::gateway()->plan()->find($id); - } + // static methods redirecting to gateway - /** - * static methods redirecting to gateway class - * - * @param $planId int planId - * @param array $attributes response object attributes - * - * @return Plan - */ - public static function update($planId, $attributes) + public static function all() { - return Configuration::gateway()->plan()->update($planId, $attributes); + return Configuration::gateway()->plan()->all(); } } +class_alias('Braintree\Plan', 'Braintree_Plan'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php index 5bf696baa77..22beaeec98b 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/PlanGateway.php @@ -1,20 +1,12 @@ _gateway = $gateway; @@ -23,16 +15,11 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /* - * Retrieve all plans - * - * @return array of Plan objects - */ public function all() { $path = $this->_config->merchantPath() . '/plans'; $response = $this->_http->get($path); - if (key_exists('plans', $response)) { + if (key_exists('plans', $response)){ $plans = ["plan" => $response['plans']]; } else { $plans = ["plan" => []]; @@ -43,152 +30,5 @@ public function all() 'plan' ); } - - /* - * Request a new plan be created - * - * @param array $attributes containing request params - * - * @return Result\Sucessful|Result\Error - */ - public function create($attributes) - { - Util::verifyKeys(self::_createSignature(), $attributes); - $path = $this->_config->merchantPath() . '/plans'; - $response = $this->_http->post($path, ['plan' => $attributes]); - return $this->_verifyGatewayResponse($response); - } - - /* - * Look up a single plan - * - * @param string $id of the plan to find - * - * @return plan|Exception\NotFound - */ - public function find($id) - { - $this->_validateId($id); - - try { - $path = $this->_config->merchantPath() . '/plans/' . $id; - $response = $this->_http->get($path); - return Plan::factory($response['plan']); - } catch (Exception\NotFound $e) { - throw new Exception\NotFound('plan with id ' . $id . ' not found'); - } - } - - /* - * Updates a specific plan with given details - * - * @param string $planId the ID of the plan to be updated - * @param mixed $attributes - * - * @return plan|Exception\NotFound - */ - public function update($planId, $attributes) - { - Util::verifyKeys(self::_updateSignature(), $attributes); - $path = $this->_config->merchantPath() . '/plans/' . $planId; - $response = $this->_http->put($path, ['plan' => $attributes]); - return $this->_verifyGatewayResponse($response); - } - - private static function _createSignature() - { - return array_merge( - [ - "billingDayOfMonth", - "billingFrequency", - "currencyIsoCode", - "description", - "id", - "merchantId", - "name", - "numberOfBillingCycles", - "price", - "trialDuration", - "trialDurationUnit", - "trialPeriod" - ], - self::_addOnDiscountSignature() - ); - } - - private static function _updateSignature() - { - return array_merge( - [ - "billingDayOfMonth", - "billingFrequency", - "currencyIsoCode", - "description", - "id", - "merchantId", - "name", - "numberOfBillingCycles", - "price", - "trialDuration", - "trialDurationUnit", - "trialPeriod" - ], - self::_addOnDiscountSignature() - ); - } - - private static function _addOnDiscountSignature() - { - return [ - [ - 'addOns' => [ - ['add' => ['amount', 'inheritedFromId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], - ['update' => ['amount', 'existingId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], - ['remove' => ['_anyKey_']], - ] - ], - [ - 'discounts' => [ - ['add' => ['amount', 'inheritedFromId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], - ['update' => ['amount', 'existingId', 'neverExpires', 'numberOfBillingCycles', 'quantity']], - ['remove' => ['_anyKey_']], - ] - ] - ]; - } - - /** - * * @ignore - * */ - private function _validateId($id = null) - { - if (empty($id)) { - throw new InvalidArgumentException( - 'expected plan id to be set' - ); - } - if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { - throw new InvalidArgumentException( - $id . ' is an invalid plan id.' - ); - } - } - - /** - * * @ignore - * */ - private function _verifyGatewayResponse($response) - { - if (isset($response['plan'])) { - return new Result\Successful( - Plan::factory($response['plan']) - ); - } elseif (isset($response['apiErrorResponse'])) { - return new Result\Error($response['apiErrorResponse']); - } else { - throw new Exception\Unexpected( - "Expected plan, or apiErrorResponse" - ); - } - } } +class_alias('Braintree\PlanGateway', 'Braintree_PlanGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php index 4988a8c6ddd..746343f2c14 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ProcessorResponseTypes.php @@ -1,13 +1,15 @@ name = $name; $this->searchTerms = []; } - /** - * Sets the "min" value for search terms. - * - * @param string $value to be set for search terms - * - * @return object - */ public function greaterThanOrEqualTo($value) { $this->searchTerms['min'] = $value; return $this; } - /** - * Sets the "mixn" value for search terms. - * - * @param string $value to be set for search terms - * - * @return object - */ public function lessThanOrEqualTo($value) { $this->searchTerms['max'] = $value; return $this; } - /** - * Sets the "is" value for search terms. - * - * @param string $value to be set for search terms - * - * @return object - */ public function is($value) { $this->searchTerms['is'] = $value; return $this; } - /** - * Sets the "min" and "max" value for search terms. - * - * @param string $min minimum value to be set for search terms - * @param string $max maximum value to be set for search terms - * - * @return object - */ public function between($min, $max) { - return $this->greaterThanOrEqualTo($min)->lessThanOrEqualTo($max); + return $this->greaterThanOrEqualTo($min)->lessThanOrEqualTo($max); } - /** - * To be used as a parameter - * - * @return object search terms - */ public function toParam() { return $this->searchTerms; } } +class_alias('Braintree\RangeNode', 'Braintree_RangeNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php index def4edd140e..2a5dd4d0b6f 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ResourceCollection.php @@ -1,5 +1,4 @@ id); * } * + * + * @package Braintree + * @subpackage Utility */ class ResourceCollection implements Iterator { @@ -28,8 +30,15 @@ class ResourceCollection implements Iterator private $_pageSize; private $_pager; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __construct($response, $pager) + /** + * set up the resource collection + * + * expects an array of attributes with literal keys + * + * @param array $response + * @param array $pager + */ + public function __construct($response, $pager) { $this->_pageSize = $response["searchResults"]["pageSize"]; $this->_ids = $response["searchResults"]["ids"]; @@ -37,11 +46,8 @@ public function __construct($response, $pager) } /** - * returns the current item when iterating with foreachi - * - * @return object + * returns the current item when iterating with foreach */ - #[\ReturnTypeWillChange] public function current() { return $this->_items[$this->_index]; @@ -59,12 +65,6 @@ public function firstItem() return $page[0]; } - /* - * returns null - * - * @return null - */ - #[\ReturnTypeWillChange] public function key() { return null; @@ -72,10 +72,7 @@ public function key() /** * advances to the next item in the collection when iterating with foreach - * - * @return object */ - #[\ReturnTypeWillChange] public function next() { ++$this->_index; @@ -83,10 +80,7 @@ public function next() /** * rewinds the testIterateOverResults collection to the first item when iterating with foreach - * - * @return object */ - #[\ReturnTypeWillChange] public function rewind() { $this->_batchIndex = 0; @@ -95,10 +89,7 @@ public function rewind() /** * returns whether the current item is valid when iterating with foreach - * - * @return bool */ - #[\ReturnTypeWillChange] public function valid() { if ($this->_index == count($this->_items) && $this->_batchIndex < count($this->_ids)) { @@ -112,11 +103,6 @@ public function valid() } } - /* - * returns a maximum count - * - * @return int - */ public function maximumCount() { return count($this->_ids); @@ -124,15 +110,23 @@ public function maximumCount() private function _getNextPage() { - if (empty($this->_ids)) { + if (empty($this->_ids)) + { $this->_items = []; - } else { + } + else + { $this->_items = $this->_getPage(array_slice($this->_ids, $this->_batchIndex, $this->_pageSize)); $this->_batchIndex += $this->_pageSize; $this->_index = 0; } } + /** + * requests the next page of results for the collection + * + * @return void + */ private function _getPage($ids) { $object = $this->_pager['object']; @@ -156,6 +150,7 @@ private function _getPage($ids) */ public function getIds() { - return $this->_ids; + return $this->_ids; } } +class_alias('Braintree\ResourceCollection', 'Braintree_ResourceCollection'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php index 99a9e3a166c..f0f91b3f4fa 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/CreditCardVerification.php @@ -1,11 +1,8 @@ _initializeFromArray($attributes); } /** * initializes instance properties from the keys/values of an array - * + * @ignore + * @access protected * @param $aAttribs array of properties to set - single level - * * @return void */ private function _initializeFromArray($attributes) { - if (isset($attributes['riskData'])) { + if(isset($attributes['riskData'])) + { $attributes['riskData'] = RiskData::factory($attributes['riskData']); } - if (isset($attributes['globalId'])) { - $attributes['graphQLId'] = $attributes['globalId']; - } - - if (isset($attributes['threeDSecureInfo'])) { - $attributes['threeDSecureInfo'] = ThreeDSecureInfo::factory($attributes['threeDSecureInfo']); - } $this->_attributes = $attributes; - foreach ($attributes as $name => $value) { + foreach($attributes AS $name => $value) { $varName = "_$name"; $this->$varName = $value; } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __get($name) + /** + * @ignore + */ + public function __get($name) { $varName = "_$name"; return isset($this->$varName) ? $this->$varName : null; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the customer + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } - /** - * returns an array of all possible Credit Card Verification statuses - * - * @return array - */ public static function allStatuses() { return [ @@ -94,3 +97,4 @@ public static function allStatuses() ]; } } +class_alias('Braintree\Result\CreditCardVerification', 'Braintree_Result_CreditCardVerification'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php index 65d2671b9f3..c0d8ba73147 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Error.php @@ -1,5 +1,4 @@ * + * @package Braintree + * @subpackage Result + * * @property-read array $params original passed params * @property-read \Braintree\Error\ErrorCollection $errors * @property-read \Braintree\Result\CreditCardVerification $creditCardVerification credit card verification data - * - * See our {@link https://developer.paypal.com/braintree/docs/reference/general/result-objects developer docs} for more information */ class Error extends Base { /** - * used to determine whether an API request was successful or not - * - * @var boolean always false + * @var bool always false */ - public $success = false; + public $success = false; /** * return original value for a field * For example, if a user tried to submit 'invalid-email' in the html field transaction[customer][email], * $result->valueForHtmlField("transaction[customer][email]") would yield "invalid-email" * - * @param string $field to check submitted value - * + * @param string $field * @return string */ - public function valueForHtmlField($field) - { - $pieces = preg_split("/[\[\]]+/", $field, 0, PREG_SPLIT_NO_EMPTY); - $params = $this->params; - foreach (array_slice($pieces, 0, -1) as $key) { - $params = $params[Util::delimiterToCamelCase($key)]; - } - if ($key != 'custom_fields') { - $finalKey = Util::delimiterToCamelCase(end($pieces)); - } else { - $finalKey = end($pieces); - } - $fieldValue = isset($params[$finalKey]) ? $params[$finalKey] : null; - return $fieldValue; - } + public function valueForHtmlField($field) + { + $pieces = preg_split("/[\[\]]+/", $field, 0, PREG_SPLIT_NO_EMPTY); + $params = $this->params; + foreach(array_slice($pieces, 0, -1) as $key) { + $params = $params[Util::delimiterToCamelCase($key)]; + } + if ($key != 'custom_fields') { + $finalKey = Util::delimiterToCamelCase(end($pieces)); + } else { + $finalKey = end($pieces); + } + $fieldValue = isset($params[$finalKey]) ? $params[$finalKey] : null; + return $fieldValue; + } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __construct($response) - { - $this->_attributes = $response; - $this->_set('errors', new ErrorCollection($response['errors'])); + /** + * overrides default constructor + * @ignore + * @param array $response gateway response array + */ + public function __construct($response) + { + $this->_attributes = $response; + $this->_set('errors', new ErrorCollection($response['errors'])); - if (isset($response['verification'])) { - $this->_set('creditCardVerification', new CreditCardVerification($response['verification'])); - } else { - $this->_set('creditCardVerification', null); - } + if(isset($response['verification'])) { + $this->_set('creditCardVerification', new CreditCardVerification($response['verification'])); + } else { + $this->_set('creditCardVerification', null); + } - if (isset($response['transaction'])) { - $this->_set('transaction', Transaction::factory($response['transaction'])); - } else { - $this->_set('transaction', null); - } + if(isset($response['transaction'])) { + $this->_set('transaction', Transaction::factory($response['transaction'])); + } else { + $this->_set('transaction', null); + } - if (isset($response['subscription'])) { - $this->_set('subscription', Subscription::factory($response['subscription'])); - } else { - $this->_set('subscription', null); - } + if(isset($response['subscription'])) { + $this->_set('subscription', Subscription::factory($response['subscription'])); + } else { + $this->_set('subscription', null); + } - if (isset($response['merchantAccount'])) { - $this->_set('merchantAccount', MerchantAccount::factory($response['merchantAccount'])); - } else { - $this->_set('merchantAccount', null); - } + if(isset($response['merchantAccount'])) { + $this->_set('merchantAccount', MerchantAccount::factory($response['merchantAccount'])); + } else { + $this->_set('merchantAccount', null); + } - if (isset($response['verification'])) { - $this->_set('verification', new CreditCardVerification($response['verification'])); - } else { - $this->_set('verification', null); - } - } + if(isset($response['verification'])) { + $this->_set('verification', new CreditCardVerification($response['verification'])); + } else { + $this->_set('verification', null); + } + } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @ignore + * @return string + */ + public function __toString() { $output = Util::attributesToString($this->_attributes); if (isset($this->_creditCardVerification)) { $output .= sprintf('%s', $this->_creditCardVerification); } - return __CLASS__ . '[' . $output . ']'; + return __CLASS__ .'[' . $output . ']'; } } +class_alias('Braintree\Result\Error', 'Braintree_Result_Error'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php index e7589fba487..69f087c3cab 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/Successful.php @@ -1,5 +1,4 @@ - + * + * + * @package Braintree + * @subpackage Result */ class Successful extends Instance { @@ -37,22 +40,23 @@ class Successful extends Instance */ private $_returnObjectNames; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * @ignore + * @param array|null $objsToReturn + * @param array|null $propertyNames + */ public function __construct($objsToReturn = [], $propertyNames = []) { // Sanitize arguments (preserves backwards compatibility) - if (!is_array($objsToReturn)) { - $objsToReturn = [$objsToReturn]; - } - if (!is_array($propertyNames)) { - $propertyNames = [$propertyNames]; - } + if (!is_array($objsToReturn)) { $objsToReturn = [$objsToReturn]; } + if (!is_array($propertyNames)) { $propertyNames = [$propertyNames]; } $objects = $this->_mapPropertyNamesToObjsToReturn($propertyNames, $objsToReturn); $this->_attributes = []; $this->_returnObjectNames = []; foreach ($objects as $propertyName => $objToReturn) { + // save the name for indirect access array_push($this->_returnObjectNames, $propertyName); @@ -61,24 +65,28 @@ public function __construct($objsToReturn = [], $propertyNames = []) } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - $objects = []; - foreach ($this->_returnObjectNames as $returnObjectName) { - array_push($objects, $returnObjectName); - } - return __CLASS__ . '[' . implode(', ', $objects) . ']'; - } + /** + * + * @ignore + * @return string string representation of the object's structure + */ + public function __toString() + { + $objects = []; + foreach ($this->_returnObjectNames as $returnObjectName) { + array_push($objects, $returnObjectName); + } + return __CLASS__ . '[' . implode(', ', $objects) . ']'; + } - private function _mapPropertyNamesToObjsToReturn($propertyNames, $objsToReturn) - { - if (count($objsToReturn) != count($propertyNames)) { - $propertyNames = []; - foreach ($objsToReturn as $obj) { - array_push($propertyNames, Util::cleanClassName(get_class($obj))); - } - } - return array_combine($propertyNames, $objsToReturn); - } + private function _mapPropertyNamesToObjsToReturn($propertyNames, $objsToReturn) { + if(count($objsToReturn) != count($propertyNames)) { + $propertyNames = []; + foreach ($objsToReturn as $obj) { + array_push($propertyNames, Util::cleanClassName(get_class($obj))); + } + } + return array_combine($propertyNames, $objsToReturn); + } } +class_alias('Braintree\Result\Successful', 'Braintree_Result_Successful'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php index 47d71a6bf86..3c94c9b609f 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Result/UsBankAccountVerification.php @@ -1,11 +1,9 @@ _initializeFromArray($attributes); @@ -45,39 +55,39 @@ public function __construct($attributes) /** * initializes instance properties from the keys/values of an array - * + * @ignore + * @access protected * @param $aAttribs array of properties to set - single level - * * @return void */ private function _initializeFromArray($attributes) { $this->_attributes = $attributes; - foreach ($attributes as $name => $value) { + foreach($attributes AS $name => $value) { $varName = "_$name"; $this->$varName = $value; } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __get($name) + /** + * @ignore + */ + public function __get($name) { $varName = "_$name"; return isset($this->$varName) ? $this->$varName : null; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the customer + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } - /** - * returns an array of all possible US Bank Account Verification statuses - * - * @return array - */ public static function allStatuses() { return [ @@ -89,11 +99,6 @@ public static function allStatuses() ]; } - /** - * returns an array of all possible US Bank Account Verification methods - * - * @return array - */ public static function allVerificationMethods() { return [ @@ -104,3 +109,4 @@ public static function allVerificationMethods() ]; } } +class_alias('Braintree\Result\UsBankAccountVerification', 'Braintree_Result_UsBankAccountVerification'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php index 374be59d056..85a20365cb8 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RevokedPaymentMethodMetadata.php @@ -1,23 +1,33 @@ == More information == + * + * + * @package Braintree + * @category Resources + * + * @property-read string $customerId + * @property-read string $token + * @property-read string $revokedPaymentMethod */ class RevokedPaymentMethodMetadata extends Base { /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of RevokedPaymentMethodMetadata + * to the requesting method, with populated properties * + * @ignore * @return RevokedPaymentMethodMetadata */ public static function factory($attributes) @@ -29,10 +39,15 @@ public static function factory($attributes) return $instance; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } } +class_alias('Braintree\RevokedPaymentMethodMetadata', 'Braintree_RevokedPaymentMethodMetadata'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php index 2cfeb7ec850..11552e1c605 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/RiskData.php @@ -1,19 +1,13 @@ _attributes['decisionReasons']; - } - - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } + } +class_alias('Braintree\RiskData', 'Braintree_RiskData'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php index 4f59111c0b4..f774c980baf 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SamsungPayCard.php @@ -1,12 +1,42 @@ token === $otherSamsungPayCard->token; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of SamsungPayCard + * to the requesting method, with populated properties * + * @ignore * @return SamsungPayCard */ public static function factory($attributes) @@ -102,3 +135,4 @@ public static function factory($attributes) return $instance; } } +class_alias('Braintree\SamsungPayCard', 'Braintree_SamsungPayCard'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php index f242def944a..2906f20c88b 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummary.php @@ -1,19 +1,14 @@ _attributes = $attributes; } - /** - * Returns the value for "records" - * - * @return mixed records - */ public function records() { return $this->_attributes['records']; @@ -43,15 +36,13 @@ public function records() /** * static method redirecting to gateway * - * @param string $settlement_date Date YYYY-MM-DD - * @param string $groupByCustomField optional - * - * @see SettlementBatchSummaryGateway::generate() - * + * @param string $settlement_date Date YYYY-MM-DD + * @param string $groupByCustomField * @return Result\Successful|Result\Error */ - public static function generate($settlement_date, $groupByCustomField = null) + public static function generate($settlement_date, $groupByCustomField = NULL) { return Configuration::gateway()->settlementBatchSummary()->generate($settlement_date, $groupByCustomField); } } +class_alias('Braintree\SettlementBatchSummary', 'Braintree_SettlementBatchSummary'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php index 91f129fbf26..e70db875a0b 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SettlementBatchSummaryGateway.php @@ -1,18 +1,30 @@ _gateway = $gateway; @@ -22,24 +34,24 @@ public function __construct($gateway) } /** - * Create a Settlement Batch Summary report. - * - * @param string $settlement_date A string representing the date of the settlement batch - * @param string $groupByCustomField A string representing a transaction's custom field that you wish to group by * + * @param string $settlement_date + * @param string $groupByCustomField * @return SettlementBatchSummary|Result\Error */ - public function generate($settlement_date, $groupByCustomField = null) + public function generate($settlement_date, $groupByCustomField = NULL) { $criteria = ['settlement_date' => $settlement_date]; - if (isset($groupByCustomField)) { + if (isset($groupByCustomField)) + { $criteria['group_by_custom_field'] = $groupByCustomField; } $params = ['settlement_batch_summary' => $criteria]; $path = $this->_config->merchantPath() . '/settlement_batch_summary'; $response = $this->_http->post($path, $params); - if (isset($groupByCustomField)) { + if (isset($groupByCustomField)) + { $response['settlementBatchSummary']['records'] = $this->_underscoreCustomField( $groupByCustomField, $response['settlementBatchSummary']['records'] @@ -49,11 +61,18 @@ public function generate($settlement_date, $groupByCustomField = null) return $this->_verifyGatewayResponse($response); } + /** + * + * @param string $groupByCustomField + * @param array $records + * @return array + */ private function _underscoreCustomField($groupByCustomField, $records) { $updatedRecords = []; - foreach ($records as $record) { + foreach ($records as $record) + { $camelized = Util::delimiterToCamelCase($groupByCustomField); $record[$groupByCustomField] = $record[$camelized]; unset($record[$camelized]); @@ -63,13 +82,19 @@ private function _underscoreCustomField($groupByCustomField, $records) return $updatedRecords; } + /** + * + * @param array $response + * @return Result\Successful|Result\Error + * @throws Exception\Unexpected + */ private function _verifyGatewayResponse($response) { if (isset($response['settlementBatchSummary'])) { return new Result\Successful( SettlementBatchSummary::factory($response['settlementBatchSummary']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( @@ -78,3 +103,4 @@ private function _verifyGatewayResponse($response) } } } +class_alias('Braintree\SettlementBatchSummaryGateway', 'Braintree_SettlementBatchSummaryGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php deleted file mode 100644 index 682521ef4fb..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ShippingMethod.php +++ /dev/null @@ -1,18 +0,0 @@ -key = $key; @@ -21,4 +19,6 @@ public function hash($data) { return call_user_func($this->digest, $this->key, $data); } + } +class_alias('Braintree\SignatureService', 'Braintree_SignatureService'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php index a6fed89a96f..8530b366bea 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription.php @@ -1,12 +1,47 @@ == More information == + * + * For more detailed information on Subscriptions, see {@link https://developers.braintreepayments.com/reference/response/subscription/php https://developers.braintreepayments.com/reference/response/subscription/php} + * + * PHP Version 5 + * + * @package Braintree + * + * @property-read \Braintree\Addon[] $addOns + * @property-read string $balance + * @property-read int $billingDayOfMonth + * @property-read \DateTime $billingPeriodEndDate + * @property-read \DateTime $billingPeriodStartDate + * @property-read \DateTime $createdAt + * @property-read int $currentBillingCycle + * @property-read int|null $daysPastDue + * @property-read string|null $description + * @property-read \Braintree\Descriptor|null $descriptor + * @property-read \Braintree\Discount[] $discounts + * @property-read int $failureCount + * @property-read \DateTime $firstBillingDate + * @property-read string $id + * @property-read string $merchantAccountId + * @property-read boolean $neverExpires + * @property-read string $nextBillingPeriodAmount + * @property-read \DateTime $nextBillingDate + * @property-read int|null $numberOfBillingCycles + * @property-read \DateTime|null $paidThroughDate + * @property-read string $paymentMethodToken + * @property-read string $planId + * @property-read string $price + * @property-read string $status + * @property-read \Braintree\Subscription\StatusDetails[] $statusHistory + * @property-read \Braintree\Transaction[] $transactions + * @property-read int $trialDuration + * @property-read string $trialDurationUnit + * @property-read boolean $trialPeriod + * @property-read \DateTime $updatedAt */ class Subscription extends Base { @@ -22,11 +57,7 @@ class Subscription extends Base const RECURRING = 'recurring'; /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes - * - * @return Subscription + * @ignore */ public static function factory($attributes) { @@ -36,13 +67,16 @@ public static function factory($attributes) return $instance; } + /** + * @ignore + */ protected function _initialize($attributes) { $this->_attributes = $attributes; $addOnArray = []; if (isset($attributes['addOns'])) { - foreach ($attributes['addOns'] as $addOn) { + foreach ($attributes['addOns'] AS $addOn) { $addOnArray[] = AddOn::factory($addOn); } } @@ -50,7 +84,7 @@ protected function _initialize($attributes) $discountArray = []; if (isset($attributes['discounts'])) { - foreach ($attributes['discounts'] as $discount) { + foreach ($attributes['discounts'] AS $discount) { $discountArray[] = Discount::factory($discount); } } @@ -66,7 +100,7 @@ protected function _initialize($attributes) $statusHistory = []; if (isset($attributes['statusHistory'])) { - foreach ($attributes['statusHistory'] as $history) { + foreach ($attributes['statusHistory'] AS $history) { $statusHistory[] = new Subscription\StatusDetails($history); } } @@ -74,128 +108,68 @@ protected function _initialize($attributes) $transactionArray = []; if (isset($attributes['transactions'])) { - foreach ($attributes['transactions'] as $transaction) { + foreach ($attributes['transactions'] AS $transaction) { $transactionArray[] = Transaction::factory($transaction); } } $this->_attributes['transactions'] = $transactionArray; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the customer + * @return string + */ + public function __toString() { $excludedAttributes = ['statusHistory']; $displayAttributes = []; - foreach ($this->_attributes as $key => $val) { + foreach($this->_attributes as $key => $val) { if (!in_array($key, $excludedAttributes)) { $displayAttributes[$key] = $val; } } return __CLASS__ . '[' . - Util::attributesToString($displayAttributes) . ']'; + Util::attributesToString($displayAttributes) .']'; } - /** - * Static methods redirecting to gateway class - * - * @param array $attributes containing request params - * - * @see SubscriptionGateway::create() - * - * @return Result\Successful|Result\Error - */ + + // static methods redirecting to gateway + public static function create($attributes) { return Configuration::gateway()->subscription()->create($attributes); } - /* - * Static methods redirecting to gateway class - * - * @param string $id of the subscription to find - * - * @see SubscriptionGateway::find() - * - * @return Subscription|Exception\NotFound - */ public static function find($id) { return Configuration::gateway()->subscription()->find($id); } - /* - * Static methods redirecting to gateway class - * - * @param mixed $query of search fields - * - * @see SubscriptionGateway::search() - * - * @return ResourceCollection of Subscription objects - */ public static function search($query) { return Configuration::gateway()->subscription()->search($query); } - /* - * Static methods redirecting to gateway class - * - * @param mixed $query of search fields - * @param array $ids to be fetched - * - * @see SubscriptionGateway::fetch() - * - * @return ResourceCollection of Subscription objects - */ public static function fetch($query, $ids) { return Configuration::gateway()->subscription()->fetch($query, $ids); } - /* - * Static methods redirecting to gateway class - * - * @param string $subscriptionId the ID of the subscription to be updated - * @param mixed $attributes - * - * @see SubscriptionGateway::update() - * - * @return Subscription|Exception\NotFound - */ public static function update($subscriptionId, $attributes) { return Configuration::gateway()->subscription()->update($subscriptionId, $attributes); } - /* - * Static methods redirecting to gateway class - * - * @param string $subscriptionId the ID of the subscription with a charge being retried - * @param string $amount optional - * @param bool $submitForSettlement defaults to false unless specified true - * - * @see SubscriptionGateway::retryCharge() - * - * @return Transaction - */ public static function retryCharge($subscriptionId, $amount = null, $submitForSettlement = false) { return Configuration::gateway()->subscription()->retryCharge($subscriptionId, $amount, $submitForSettlement); } - /* - * Static methods redirecting to gateway class - * - * @param string $subscriptionId to be canceled - * - * @see SubscriptionGateway::cancel() - * - * @return Subscription|Exception\NotFound - */ public static function cancel($subscriptionId) { return Configuration::gateway()->subscription()->cancel($subscriptionId); } } +class_alias('Braintree\Subscription', 'Braintree_Subscription'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php index 43b5f91fa21..9f588ce071b 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Subscription/StatusDetails.php @@ -1,5 +1,4 @@ == More information == + * + * For more detailed information on Subscriptions, see {@link https://developers.braintreepayments.com/reference/response/subscription/php https://developers.braintreepayments.com/reference/response/subscription/php} + * + * PHP Version 5 + * + * @package Braintree */ class SubscriptionGateway { @@ -16,7 +20,6 @@ class SubscriptionGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -25,13 +28,6 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /* - * Request a new subscription be created - * - * @param array $attributes containing request params - * - * @return Result\Sucessful|Result\Error - */ public function create($attributes) { Util::verifyKeys(self::_createSignature(), $attributes); @@ -40,13 +36,6 @@ public function create($attributes) return $this->_verifyGatewayResponse($response); } - /* - * Look up a single subscription - * - * @param string $id of the subscription to find - * - * @return Subscription|Exception\NotFound - */ public function find($id) { $this->_validateId($id); @@ -58,15 +47,9 @@ public function find($id) } catch (Exception\NotFound $e) { throw new Exception\NotFound('subscription with id ' . $id . ' not found'); } + } - /* - * Search for subscriptions using a variety of criteria - * - * @param mixed $query of search fields - * - * @return ResourceCollection of Subscription objects - */ public function search($query) { $criteria = []; @@ -86,14 +69,6 @@ public function search($query) return new ResourceCollection($response, $pager); } - /* - * Fetch subscriptions using a variety of criteria - * - * @param mixed $query of search fields - * @param array $ids to be fetched - * - * @return ResourceCollection of Subscription objects - */ public function fetch($query, $ids) { $criteria = []; @@ -110,14 +85,6 @@ public function fetch($query, $ids) ); } - /* - * Updates a specific subscription with given details - * - * @param string $subscriptionId the ID of the subscription to be updated - * @param mixed $attributes - * - * @return Subscription|Exception\NotFound - */ public function update($subscriptionId, $attributes) { Util::verifyKeys(self::_updateSignature(), $attributes); @@ -126,15 +93,6 @@ public function update($subscriptionId, $attributes) return $this->_verifyGatewayResponse($response); } - /* - * Manually retry charging a past due subscription - * - * @param string $subscriptionId the ID of the subscription with a charge being retried - * @param string $amount optional - * @param bool $submitForSettlement defaults to false unless specified true - * - * @return Transaction - */ public function retryCharge($subscriptionId, $amount = null, $submitForSettlement = false) { $transaction_params = ['type' => Transaction::SALE, @@ -151,13 +109,6 @@ public function retryCharge($subscriptionId, $amount = null, $submitForSettlemen return $this->_verifyGatewayResponse($response); } - /* - * Stops billing a payment method for a subscription. Cannot be reactivated - * - * @param string $subscriptionId to be canceled - * - * @return Subscription|Exception\NotFound - */ public function cancel($subscriptionId) { $path = $this->_config->merchantPath() . '/subscriptions/' . $subscriptionId . '/cancel'; @@ -233,37 +184,43 @@ private static function _addOnDiscountSignature() ]; } - private function _validateId($id = null) - { + /** + * @ignore + */ + private function _validateId($id = null) { if (empty($id)) { - throw new InvalidArgumentException( - 'expected subscription id to be set' - ); + throw new InvalidArgumentException( + 'expected subscription id to be set' + ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { throw new InvalidArgumentException( - $id . ' is an invalid subscription id.' - ); + $id . ' is an invalid subscription id.' + ); } } + /** + * @ignore + */ private function _verifyGatewayResponse($response) { if (isset($response['subscription'])) { return new Result\Successful( Subscription::factory($response['subscription']) ); - } elseif (isset($response['transaction'])) { + } else if (isset($response['transaction'])) { // return a populated instance of Transaction, for subscription retryCharge return new Result\Successful( Transaction::factory($response['transaction']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - "Expected subscription, transaction, or apiErrorResponse" + "Expected subscription, transaction, or apiErrorResponse" ); } } } +class_alias('Braintree\SubscriptionGateway', 'Braintree_SubscriptionGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php index e4203de846e..ba2a5ef8ef0 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/SubscriptionSearch.php @@ -1,97 +1,48 @@ '4023898493988028', ]; - /** - * Get all test credit cards in one array - * - * @return array - */ public static function getAll() { return array_merge( - self::$amExes, - self::$discoverCards, - self::$eloCards, - self::$masterCards, - self::$visas - ); + self::$amExes, + self::$discoverCards, + self::$eloCards, + self::$masterCards, + self::$visas + ); } } +class_alias('Braintree\Test\CreditCardNumbers', 'Braintree_Test_CreditCardNumbers'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php index 37eb3013c42..cc00c6797aa 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/MerchantAccount.php @@ -1,9 +1,11 @@ testing()->settlementPending($transactionId); } } +class_alias('Braintree\Test\Transaction', 'Braintree_Test_Transaction'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php index fee3828c702..9258d72901b 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Test/TransactionAmounts.php @@ -1,5 +1,4 @@ searchTerms["contains"] = strval($value); return $this; } } +class_alias('Braintree\TextNode', 'Braintree_TextNode'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php index 3f159a67c15..f7abae25379 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/ThreeDSecureInfo.php @@ -1,21 +1,13 @@ _attributes = $attributes; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the three d secure info + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } + } +class_alias('Braintree\ThreeDSecureInfo', 'Braintree_ThreeDSecureInfo'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php index d3b7a5e58bd..e3cd6b6b3b1 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction.php @@ -1,10 +1,9 @@ * - * For more detailed information on Transactions, see {@link https://developer.paypal.com/braintree/docs/reference/response/transaction our developer docs} -// phpcs:enable Generic.Files.LineLength + * == More information == + * + * For more detailed information on Transactions, see {@link https://developers.braintreepayments.com/reference/response/transaction/php https://developers.braintreepayments.com/reference/response/transaction/php} + * + * @package Braintree + * @category Resources + * + * + * @property-read \Braintree\AddOn[] $addons + * @property-read string $additionalProcessorResponse raw response from processor + * @property-read string $amount transaction amount + * @property-read \Braintree\AmexExpressCheckoutCardDetails $amexExpressCheckoutCardDetails transaction Amex Express Checkout card info + * @property-read \Braintree\AndroidPayCardDetails $androidPayCardDetails transaction Android Pay card info + * @property-read \Braintree\ApplePayCardDetails $applePayCardDetails transaction Apple Pay card info + * @property-read \Braintree\AuthorizationAdjustment[] $authorizationAdjustments populated when a transaction has authorization adjustments created when submitted for settlement + * @property-read \DateTime $authorizationExpiresAt DateTime authorization will expire + * @property-read string $avsErrorResponseCode + * @property-read string $avsPostalCodeResponseCode + * @property-read string $avsStreetAddressResponseCode + * @property-read \Braintree\Transaction\AddressDetails $billingDetails transaction billing address + * @property-read string $channel + * @property-read \Braintree\CoinbaseDetails $coinbaseDetails transaction Coinbase account info + * @property-read \DateTime $createdAt transaction created DateTime + * @property-read \Braintree\CreditCardDetails $creditCardDetails transaction credit card info + * @property-read string $currencyIsoCode + * @property-read array $customFields custom fields passed with the request + * @property-read \Braintree\Transaction\CustomerDetails $customerDetails transaction customer info + * @property-read string $cvvResponseCode + * @property-read \Braintree\Descriptor $descriptor + * @property-read Braintree\DisbursementDetails $disbursementDetails populated when transaction is disbursed + * @property-read string $discountAmount + * @property-read \Braintree\Discount[] $discounts + * @property-read \Braintree\Dispute[] $disputes populated when transaction is disputed + * @property-read string $escrowStatus + * @property-read \Braintree\FacilitatedDetails $facilitatedDetails + * @property-read \Braintree\FacilitatorDetails $facilitatorDetails + * @property-read string $gatewayRejectionReason + * @property-read string $id transaction id + * @property-read \Braintree\IdealPayment $idealPaymentDetails transaction Ideal Payment info + * @property-read \Braintree\TransactionLineItem[] $lineItems + * @property-read \Braintree\MasterpassCardDetails $masterpassCardDetails transaction Masterpass card info + * @property-read string $merchantAccountId + * @property-read string $networkTransactionId + * @property-read string $orderId + * @property-read string $paymentInstrumentType + * @property-read \Braintree\PayPalDetails $paypalDetails transaction paypal account info + * @property-read string $planId + * @property-read string $processorAuthorizationCode + * @property-read string $processorResponseCode gateway response code + * @property-read string $processorResponseText + * @property-read string $processorResponseType + * @property-read string $processorSettlementResponseCode + * @property-read string $processorSettlementResponseText + * @property-read string $purchaseOrderNumber + * @property-read mixed $reccuring + * @property-read mixed $refundIds + * @property-read string $refundedTransactionId + * @property-read \Braintree\RiskData $riskData + * @property-read \Braintree\SamsungPayCardDetails $samsungPayCardDetails transaction Samsung Pay card info + * @property-read string $serviceFeeAmount + * @property-read string $settlementBatchId + * @property-read string $shippingAmount + * @property-read \Braintree\Transaction\AddressDetails $shippingDetails transaction shipping address + * @property-read string $status transaction status + * @property-read \Braintree\Transaction\StatusDetails[] $statusHistory array of StatusDetails objects + * @property-read \Braintree\Transaction\SubscriptionDetails $subscriptionDetails + * @property-read string $subscriptionId + * @property-read string $taxAmount + * @property-read string $taxExcempt + * @property-read \Braintree\ThreeDSecureInfo $threeDSecureInfo + * @property-read string $type transaction type + * @property-read \DateTime $updatedAt transaction updated DateTime + * @property-read \Braintree\VenmoAccount $venmoAccountDetails transaction Venmo Account info + * @property-read \Braintree\VisaCheckoutCardDetails $visaCheckoutCardDetails transaction Visa Checkout card info + * @property-read string $voiceReferralName + * */ + class Transaction extends Base { // Transaction Status @@ -181,9 +255,7 @@ class Transaction extends Base const CVV = 'cvv'; const DUPLICATE = 'duplicate'; const FRAUD = 'fraud'; - const RISK_THRESHOLD = 'risk_threshold'; const THREE_D_SECURE = 'three_d_secure'; - const TOKEN_ISSUANCE = 'token_issuance'; const APPLICATION_INCOMPLETE = 'application_incomplete'; // Industry Types @@ -191,19 +263,12 @@ class Transaction extends Base const TRAVEL_AND_CRUISE_INDUSTRY = 'travel_cruise'; const TRAVEL_AND_FLIGHT_INDUSTRY = 'travel_flight'; - // Additional Charge Types - const RESTAURANT = 'lodging'; - const GIFT_SHOP = 'gift_shop'; - const MINI_BAR = 'mini_bar'; - const TELEPHONE = 'telephone'; - const LAUNDRY = 'laundry'; - const OTHER = 'other'; - /** * sets instance properties from an array of values * + * @ignore + * @access protected * @param array $transactionAttribs array of transaction data - * * @return void */ protected function _initialize($transactionAttribs) @@ -211,27 +276,31 @@ protected function _initialize($transactionAttribs) $this->_attributes = $transactionAttribs; if (isset($transactionAttribs['applePay'])) { - $this->_set( - 'applePayCardDetails', + $this->_set('applePayCardDetails', new Transaction\ApplePayCardDetails( $transactionAttribs['applePay'] ) ); } - // Rename androidPayCard from API responses to GooglePayCard if (isset($transactionAttribs['androidPayCard'])) { - $this->_set( - 'googlePayCardDetails', - new Transaction\GooglePayCardDetails( + $this->_set('androidPayCardDetails', + new Transaction\AndroidPayCardDetails( $transactionAttribs['androidPayCard'] ) ); } + if (isset($transactionAttribs['masterpassCard'])) { + $this->_set('masterpassCardDetails', + new Transaction\MasterpassCardDetails( + $transactionAttribs['masterpassCard'] + ) + ); + } + if (isset($transactionAttribs['visaCheckoutCard'])) { - $this->_set( - 'visaCheckoutCardDetails', + $this->_set('visaCheckoutCardDetails', new Transaction\VisaCheckoutCardDetails( $transactionAttribs['visaCheckoutCard'] ) @@ -239,17 +308,23 @@ protected function _initialize($transactionAttribs) } if (isset($transactionAttribs['samsungPayCard'])) { - $this->_set( - 'samsungPayCardDetails', + $this->_set('samsungPayCardDetails', new Transaction\SamsungPayCardDetails( $transactionAttribs['samsungPayCard'] ) ); } + if (isset($transactionAttribs['amexExpressCheckoutCard'])) { + $this->_set('amexExpressCheckoutCardDetails', + new Transaction\AmexExpressCheckoutCardDetails( + $transactionAttribs['amexExpressCheckoutCard'] + ) + ); + } + if (isset($transactionAttribs['venmoAccount'])) { - $this->_set( - 'venmoAccountDetails', + $this->_set('venmoAccountDetails', new Transaction\VenmoAccountDetails( $transactionAttribs['venmoAccount'] ) @@ -257,53 +332,47 @@ protected function _initialize($transactionAttribs) } if (isset($transactionAttribs['creditCard'])) { - $this->_set( - 'creditCardDetails', + $this->_set('creditCardDetails', new Transaction\CreditCardDetails( $transactionAttribs['creditCard'] ) ); } - if (isset($transactionAttribs['usBankAccount'])) { - $this->_set( - 'usBankAccount', - new Transaction\UsBankAccountDetails( - $transactionAttribs['usBankAccount'] + if (isset($transactionAttribs['coinbaseAccount'])) { + $this->_set('coinbaseDetails', + new Transaction\CoinbaseDetails( + $transactionAttribs['coinbaseAccount'] ) ); } - if (isset($transactionAttribs['paypal'])) { - $this->_set( - 'paypalDetails', - new Transaction\PayPalDetails( - $transactionAttribs['paypal'] + if (isset($transactionAttribs['usBankAccount'])) { + $this->_set('usBankAccount', + new Transaction\UsBankAccountDetails( + $transactionAttribs['usBankAccount'] ) ); } - if (isset($transactionAttribs['paypalHere'])) { - $this->_set( - 'paypalHereDetails', - new Transaction\PayPalHereDetails( - $transactionAttribs['paypalHere'] + if (isset($transactionAttribs['idealPayment'])) { + $this->_set('idealPayment', + new Transaction\IdealPaymentDetails( + $transactionAttribs['idealPayment'] ) ); } - if (isset($transactionAttribs['localPayment'])) { - $this->_set( - 'localPaymentDetails', - new Transaction\LocalPaymentDetails( - $transactionAttribs['localPayment'] + if (isset($transactionAttribs['paypal'])) { + $this->_set('paypalDetails', + new Transaction\PayPalDetails( + $transactionAttribs['paypal'] ) ); } if (isset($transactionAttribs['customer'])) { - $this->_set( - 'customerDetails', + $this->_set('customerDetails', new Transaction\CustomerDetails( $transactionAttribs['customer'] ) @@ -311,8 +380,7 @@ protected function _initialize($transactionAttribs) } if (isset($transactionAttribs['billing'])) { - $this->_set( - 'billingDetails', + $this->_set('billingDetails', new Transaction\AddressDetails( $transactionAttribs['billing'] ) @@ -320,8 +388,7 @@ protected function _initialize($transactionAttribs) } if (isset($transactionAttribs['shipping'])) { - $this->_set( - 'shippingDetails', + $this->_set('shippingDetails', new Transaction\AddressDetails( $transactionAttribs['shipping'] ) @@ -329,8 +396,7 @@ protected function _initialize($transactionAttribs) } if (isset($transactionAttribs['subscription'])) { - $this->_set( - 'subscriptionDetails', + $this->_set('subscriptionDetails', new Transaction\SubscriptionDetails( $transactionAttribs['subscription'] ) @@ -338,8 +404,7 @@ protected function _initialize($transactionAttribs) } if (isset($transactionAttribs['descriptor'])) { - $this->_set( - 'descriptor', + $this->_set('descriptor', new Descriptor( $transactionAttribs['descriptor'] ) @@ -347,15 +412,14 @@ protected function _initialize($transactionAttribs) } if (isset($transactionAttribs['disbursementDetails'])) { - $this->_set( - 'disbursementDetails', + $this->_set('disbursementDetails', new DisbursementDetails($transactionAttribs['disbursementDetails']) ); } $disputes = []; if (isset($transactionAttribs['disputes'])) { - foreach ($transactionAttribs['disputes'] as $dispute) { + foreach ($transactionAttribs['disputes'] AS $dispute) { $disputes[] = Dispute::factory($dispute); } } @@ -364,7 +428,7 @@ protected function _initialize($transactionAttribs) $statusHistory = []; if (isset($transactionAttribs['statusHistory'])) { - foreach ($transactionAttribs['statusHistory'] as $history) { + foreach ($transactionAttribs['statusHistory'] AS $history) { $statusHistory[] = new Transaction\StatusDetails($history); } } @@ -373,7 +437,7 @@ protected function _initialize($transactionAttribs) $addOnArray = []; if (isset($transactionAttribs['addOns'])) { - foreach ($transactionAttribs['addOns'] as $addOn) { + foreach ($transactionAttribs['addOns'] AS $addOn) { $addOnArray[] = AddOn::factory($addOn); } } @@ -381,7 +445,7 @@ protected function _initialize($transactionAttribs) $discountArray = []; if (isset($transactionAttribs['discounts'])) { - foreach ($transactionAttribs['discounts'] as $discount) { + foreach ($transactionAttribs['discounts'] AS $discount) { $discountArray[] = Discount::factory($discount); } } @@ -389,29 +453,32 @@ protected function _initialize($transactionAttribs) $authorizationAdjustments = []; if (isset($transactionAttribs['authorizationAdjustments'])) { - foreach ($transactionAttribs['authorizationAdjustments'] as $authorizationAdjustment) { + foreach ($transactionAttribs['authorizationAdjustments'] AS $authorizationAdjustment) { $authorizationAdjustments[] = AuthorizationAdjustment::factory($authorizationAdjustment); } } $this->_set('authorizationAdjustments', $authorizationAdjustments); - if (isset($transactionAttribs['riskData'])) { + if(isset($transactionAttribs['riskData'])) { $this->_set('riskData', RiskData::factory($transactionAttribs['riskData'])); } - if (isset($transactionAttribs['threeDSecureInfo'])) { + if(isset($transactionAttribs['threeDSecureInfo'])) { $this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($transactionAttribs['threeDSecureInfo'])); } - if (isset($transactionAttribs['facilitatedDetails'])) { + if(isset($transactionAttribs['facilitatedDetails'])) { $this->_set('facilitatedDetails', FacilitatedDetails::factory($transactionAttribs['facilitatedDetails'])); } - if (isset($transactionAttribs['facilitatorDetails'])) { + if(isset($transactionAttribs['facilitatorDetails'])) { $this->_set('facilitatorDetails', FacilitatorDetails::factory($transactionAttribs['facilitatorDetails'])); } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * returns a string representation of the transaction + * @return string + */ + public function __toString() { // array of attributes to print $display = [ @@ -420,76 +487,56 @@ public function __toString() ]; $displayAttributes = []; - foreach ($display as $attrib) { + foreach ($display AS $attrib) { $displayAttributes[$attrib] = $this->$attrib; } return __CLASS__ . '[' . - Util::attributesToString($displayAttributes) . ']'; + Util::attributesToString($displayAttributes) .']'; } - /* - * Checks if one transaction's ID is the same as another transaction's Id. - * - * @param string $otherTx to be compared - * - * @return bool - */ public function isEqual($otherTx) { return $this->id === $otherTx->id; } - //NEXT_MAJOR_VERSION this function is only used for tests, the assertions this function provides are obfuscated. - //We should remove this function and update the tests to be more clear in what we're asserting. public function vaultCreditCard() { $token = $this->creditCardDetails->token; if (empty($token)) { return null; - } else { + } + else { return CreditCard::find($token); } } - //NEXT_MAJOR_VERSION this function is only used for tests, the assertions this function provides are obfuscated. - //We should remove this function and update the tests to be more clear in what we're asserting. + /** @return void|Braintree\Customer */ public function vaultCustomer() { $customerId = $this->customerDetails->id; if (empty($customerId)) { return null; - } else { + } + else { return Customer::find($customerId); } } - /** - * Checks if transactions is disbursed - * - * @return boolean - */ - public function isDisbursed() - { + /** @return boolean */ + public function isDisbursed() { return $this->disbursementDetails->isValid(); } - /** - * Static methods redirecting to gateway class - * - * @see TransactionLineItemGateway::findAll() - * - * @return ResourceCollection of TransactionLineItem objects - */ - public function lineItems() - { + /** @return line items */ + public function lineItems() { return Configuration::gateway()->transactionLineItem()->findAll($this->id); } /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of Transaction + * to the requesting method, with populated properties * + * @ignore * @return Transaction */ public static function factory($attributes) @@ -499,287 +546,107 @@ public static function factory($attributes) return $instance; } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unique identifier - * @param string $amount to be adjusted - * - * @see TransactionGateway::adjustAuthorization() - * - * @return Transction|Result\Error - */ - public static function adjustAuthorization($transactionId, $amount) - { - return Configuration::gateway()->transaction()->adjustAuthorization($transactionId, $amount); - } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId to be cloned - * @param mixed $attribs containing any additional request parameters - * - * @see TransactionGateway::cloneTransaction() - * - * @return Transction|Result\Error - */ + // static methods redirecting to gateway + public static function cloneTransaction($transactionId, $attribs) { return Configuration::gateway()->transaction()->cloneTransaction($transactionId, $attribs); } - //NEXT_MAJOR_VERSION remove this function, it was only used for a Transparent Redirect test that no longer exists + public static function createFromTransparentRedirect($queryString) + { + return Configuration::gateway()->transaction()->createFromTransparentRedirect($queryString); + } + public static function createTransactionUrl() { return Configuration::gateway()->transaction()->createTransactionUrl(); } - /** - * Static methods redirecting to gateway class - * - * @param mixed $attribs containing any request parameters - * - * @see TransactionGateway::credit() - * - * @return Result\Successful|Result\Error - */ public static function credit($attribs) { return Configuration::gateway()->transaction()->credit($attribs); } - /** - * Static methods redirecting to gateway class - * - * @param mixed $attribs containing any request parameters - * - * @see TransactionGateway::creditNoValidate() - * - * @return Transaction|Result\Error - */ public static function creditNoValidate($attribs) { return Configuration::gateway()->transaction()->creditNoValidate($attribs); } - /** - * Static methods redirecting to gateway class - * - * @param mixed $id unique identifier of the transaction to find - * - * @see TransactionGateway::find() - * - * @return Result\Successful|Exception\NotFound - */ public static function find($id) { return Configuration::gateway()->transaction()->find($id); } - /** - * Static methods redirecting to gateway class - * - * @param mixed $attribs containing any request parameters - * - * @see TransactionGateway::sale() - * - * @return Result\Successful|Exception\NotFound - */ public static function sale($attribs) { return Configuration::gateway()->transaction()->sale($attribs); } - /** - * Static methods redirecting to gateway class - * - * @param mixed $attribs containing any request parameters - * - * @see TransactionGateway::saleNoValidate() - * - * @return Transaction|Result\Error - */ public static function saleNoValidate($attribs) { return Configuration::gateway()->transaction()->saleNoValidate($attribs); } - /** - * Static methods redirecting to gateway class - * - * @param mixed $query containing search fields - * - * @see TransactionGateway::search() - * - * @return ResourceCollection of Transaction objects - */ public static function search($query) { return Configuration::gateway()->transaction()->search($query); } - /* - * Static methods redirecting to gateway class - * - * @param mixed $query of search fields - * @param array $ids to be fetched - * - * @see TransactionGateway::fetch() - * - * @return ResourceCollection of Transaction objects - */ public static function fetch($query, $ids) { return Configuration::gateway()->transaction()->fetch($query, $ids); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be voided - * - * @see TransactionGateway::void() - * - * @return Result\Successful|Exception\NotFound - */ public static function void($transactionId) { return Configuration::gateway()->transaction()->void($transactionId); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be voided - * - * @see TransactionGateway::voidNoValidate() - * - * @return Transaction|Result\Error - */ public static function voidNoValidate($transactionId) { return Configuration::gateway()->transaction()->voidNoValidate($transactionId); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be submitted for settlement - * @param string $amount optional - * @param mixed $attribs any additional request parameters - * - * @see TransactionGateway::submitForSettlement() - * - * @return Result\Successful|Exception\NotFound - */ public static function submitForSettlement($transactionId, $amount = null, $attribs = []) { return Configuration::gateway()->transaction()->submitForSettlement($transactionId, $amount, $attribs); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be submitted for settlement - * @param string $amount optional - * @param mixed $attribs any additional request parameters - * - * @see TransactionGateway::submitForSettlement() - * - * @return Transaction|Result\Error - */ public static function submitForSettlementNoValidate($transactionId, $amount = null, $attribs = []) { - // phpcs:ignore Generic.Files.LineLength return Configuration::gateway()->transaction()->submitForSettlementNoValidate($transactionId, $amount, $attribs); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId to be updated - * @param array $attribs attributes to be updated in the request - * - * @see TransactionGateway::updateDetails() - * - * @return Result\Successful|Result\Error - */ public static function updateDetails($transactionId, $attribs = []) { return Configuration::gateway()->transaction()->updateDetails($transactionId, $attribs); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be submitted for settlement - * @param string $amount optional - * @param mixed $attribs any additional request parameters - * - * @see TransactionGateway::submitForPartialSettlement() - * - * @return Result\Successful|Exception\NotFound - */ public static function submitForPartialSettlement($transactionId, $amount, $attribs = []) { return Configuration::gateway()->transaction()->submitForPartialSettlement($transactionId, $amount, $attribs); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be held in escrow - * - * @see TransactionGateway::holdInEscrow() - * - * @return Result\Successful|Exception\NotFound - */ public static function holdInEscrow($transactionId) { return Configuration::gateway()->transaction()->holdInEscrow($transactionId); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be released from escrow - * - * @see TransactionGateway::releaseFromEscrow() - * - * @return Result\Successful|Exception\NotFound - */ public static function releaseFromEscrow($transactionId) { return Configuration::gateway()->transaction()->releaseFromEscrow($transactionId); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction whose escrow release is to be canceled - * - * @see TransactionGateway::cancelRelease() - * - * @return Result\Successful|Exception\NotFound - */ public static function cancelRelease($transactionId) { return Configuration::gateway()->transaction()->cancelRelease($transactionId); } - /** - * Static methods redirecting to gateway class - * - * @param string $transactionId unque identifier of the transaction to be refunded - * @param string $amount to be refunded, optional - * - * @see TransactionGateway::refund() - * - * @return Result\Successful|Exception\NotFound - */ public static function refund($transactionId, $amount = null) { return Configuration::gateway()->transaction()->refund($transactionId, $amount); } } +class_alias('Braintree\Transaction', 'Braintree_Transaction'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php index 33cb06f3ab9..597a2080a5c 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php @@ -1,5 +1,4 @@ _attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear; $this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4; + } } +class_alias('Braintree\Transaction\CreditCardDetails', 'Braintree_Transaction_CreditCardDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php index 4b1bc7d2983..8aa6913aae4 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php @@ -1,5 +1,4 @@ _attributes['cardType'] = $this->virtualCardType; - $this->_attributes['last4'] = $this->virtualCardLast4; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php deleted file mode 100644 index fdfd37f7613..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LocalPaymentDetails.php +++ /dev/null @@ -1,25 +0,0 @@ -_attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear; $this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4; + } } +class_alias('Braintree\Transaction\SamsungPayCardDetails', 'Braintree_Transaction_SamsungPayCardDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php index 742d1ee24b8..b8e1f8f9e08 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php @@ -1,5 +1,4 @@ achMandate = $achMandate; } } +class_alias('Braintree\Transaction\UsBankAccountDetails', 'Braintree_Transaction_UsBankAccountDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php index 1f7539966ac..b48baedd561 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/VenmoAccountDetails.php @@ -1,21 +1,38 @@ _attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear; $this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4; + } } +class_alias('Braintree\Transaction\VisaCheckoutCardDetails', 'Braintree_Transaction_VisaCheckoutCardDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php index 537c54b9aea..6ad2a4b0f98 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionGateway.php @@ -1,5 +1,4 @@ == More information == + * + * For more detailed information on Transactions, see {@link https://developers.braintreepayments.com/reference/response/transaction/php https://developers.braintreepayments.com/reference/response/transaction/php} + * + * @package Braintree + * @category Resources */ class TransactionGateway @@ -18,7 +22,6 @@ class TransactionGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -27,43 +30,68 @@ public function __construct($gateway) $this->_http = new Http($gateway->config); } - /** - * Create a new transaction by copying all the attributes, except amount, of the original transaction - * - * Instead of cloning transactions, a better practice in most cases is to use the Vault to save and reuse payment method or customer information - * - * @param string $transactionId to be cloned - * @param mixed $attribs containing additional request parameters - * - * @see PaymentMethodGateway - * @see CustomerGateway - * - * @return Result\Successful|Result\Error - */ public function cloneTransaction($transactionId, $attribs) { Util::verifyKeys(self::cloneSignature(), $attribs); return $this->_doCreate('/transactions/' . $transactionId . '/clone', ['transactionClone' => $attribs]); } + /** + * @ignore + * @access private + * @param array $attribs + * @return Result\Successful|Result\Error + */ private function create($attribs) { Util::verifyKeys(self::createSignature(), $attribs); - $attribs = Util::replaceKey($attribs, 'googlePayCard', 'androidPayCard'); return $this->_doCreate('/transactions', ['transaction' => $attribs]); } + /** + * @ignore + * @access private + * @param array $attribs + * @return object + * @throws Exception\ValidationError + */ private function createNoValidate($attribs) { $result = $this->create($attribs); return Util::returnObjectOrThrowException(__CLASS__, $result); } - /** - * creates a full array signature of a valid gateway request * - * @return array gateway request signature format + * @deprecated since version 2.3.0 + * @access public + * @param array $attribs + * @return object */ + public function createFromTransparentRedirect($queryString) + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::confirm", E_USER_NOTICE); + $params = TransparentRedirect::parseAndValidateQueryString( + $queryString + ); + return $this->_doCreate( + '/transactions/all/confirm_transparent_redirect_request', + ['id' => $params['id']] + ); + } + /** + * + * @deprecated since version 2.3.0 + * @access public + * @param none + * @return string + */ + public function createTransactionUrl() + { + trigger_error("DEPRECATED: Please use TransparentRedirectRequest::url", E_USER_NOTICE); + return $this->_config->baseUrl() . $this->_config->merchantPath() . + '/transactions/all/create_via_transparent_redirect_request'; + } + public static function cloneSignature() { return ['amount', 'channel', ['options' => ['submitForSettlement']]]; @@ -71,7 +99,6 @@ public static function cloneSignature() /** * creates a full array signature of a valid gateway request - * * @return array gateway request signature format */ public static function createSignature() @@ -82,12 +109,12 @@ public static function createSignature() 'channel', 'customerId', 'deviceData', - 'exchangeRateQuoteId', + 'deviceSessionId', + 'fraudMerchantId', 'merchantAccountId', 'orderId', 'paymentMethodNonce', 'paymentMethodToken', - 'productSku', 'purchaseOrderNumber', 'recurring', 'serviceFeeAmount', @@ -100,30 +127,17 @@ public static function createSignature() 'taxAmount', 'taxExempt', 'threeDSecureToken', - 'threeDSecureAuthenticationId', 'transactionSource', 'type', 'venmoSdkPaymentMethodCode', - 'scaExemption', 'shippingAmount', 'discountAmount', 'shipsFromPostalCode', ['riskData' => - [ - 'customerBrowser', 'customerIp', 'customerDeviceId', - 'customerLocationZip', 'customerTenure'], + ['customerBrowser', 'customerIp', 'customer_browser', 'customer_ip'] ], ['creditCard' => - [ - 'token', - 'cardholderName', - 'cvv', - 'expirationDate', - 'expirationMonth', - 'expirationYear', - 'number', - ['paymentReaderCardDetails' => ['encryptedCardData', 'keySerialNumber']], - ], + ['token', 'cardholderName', 'cvv', 'expirationDate', 'expirationMonth', 'expirationYear', 'number'], ], ['customer' => [ @@ -134,26 +148,21 @@ public static function createSignature() [ 'firstName', 'lastName', 'company', 'countryName', 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', - 'extendedAddress', 'locality', 'phoneNumber', 'postalCode', 'region', + 'extendedAddress', 'locality', 'postalCode', 'region', 'streetAddress'], ], ['shipping' => [ 'firstName', 'lastName', 'company', 'countryName', 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', - 'extendedAddress', 'locality', 'phoneNumber', 'postalCode', 'region', - 'shippingMethod', 'streetAddress'], + 'extendedAddress', 'locality', 'postalCode', 'region', + 'streetAddress'], ], ['threeDSecurePassThru' => [ 'eciFlag', 'cavv', - 'xid', - 'threeDSecureVersion', - 'authenticationResponse', - 'directoryResponse', - 'cavvAlgorithm', - 'dsTransactionId'], + 'xid'], ], ['options' => [ @@ -175,6 +184,10 @@ public static function createSignature() ['threeDSecure' => ['required'] ], + # TODO: Snake case version included for backwards compatiblity. Remove in the next major version + ['three_d_secure' => + ['required'] + ], ['paypal' => [ 'payeeId', @@ -194,6 +207,8 @@ public static function createSignature() ], ['venmo' => [ + # TODO: Snake case version included for backwards compatiblity. Remove in the next major version + 'profile_id', 'profileId' ] ] @@ -202,16 +217,10 @@ public static function createSignature() ['customFields' => ['_anyKey_']], ['descriptor' => ['name', 'phone', 'url']], ['paypalAccount' => ['payeeId', 'payeeEmail', 'payerId', 'paymentId']], - ['applePayCard' => - [ - 'cardholderName', - 'cryptogram', - 'eciIndicator', - 'expirationMonth', - 'expirationYear', - 'number' - ] - ], + # TODO: Snake case version included for backwards compatiblity. Remove in the next major version + ['apple_pay_card' => ['number', 'cardholder_name', 'cryptogram', 'expiration_month', 'expiration_year', 'eci_indicator']], + + ['applePayCard' => ['number', 'cardholderName', 'cryptogram', 'expirationMonth', 'expirationYear', 'eciIndicator']], ['industry' => ['industryType', ['data' => @@ -225,7 +234,6 @@ public static function createSignature() 'lodgingCheckOutDate', 'lodgingName', 'roomRate', - 'roomTax', 'passengerFirstName', 'passengerLastName', 'passengerMiddleInitial', @@ -240,10 +248,6 @@ public static function createSignature() 'feeAmount', 'taxAmount', 'restrictedTicket', - 'noShow', - 'advancedDeposit', - 'fireSafe', - 'propertyPhone', ['legs' => [ 'conjunctionTicket', @@ -264,116 +268,37 @@ public static function createSignature() 'taxAmount', 'endorsementOrRestrictions' ] - ], - ['additionalCharges' => - [ - 'kind', - 'amount' - ] ] ] ] ] ], - ['lineItems' => - [ - 'commodityCode', - 'description', - 'discountAmount', - 'kind', - 'name', - 'productCode', - 'quantity', - 'taxAmount', - 'totalAmount', - 'unitAmount', - 'unitOfMeasure', - 'unitTaxAmount', - 'url' - ] - ], + ['lineItems' => ['quantity', 'name', 'description', 'kind', 'unitAmount', 'unitTaxAmount', 'totalAmount', 'discountAmount', 'taxAmount', 'unitOfMeasure', 'productCode', 'commodityCode', 'url']], ['externalVault' => ['status' , 'previousNetworkTransactionId'], - ], - ['googlePayCard' => - [ - 'cryptogram', - 'eciIndicator', - 'expirationMonth', - 'expirationYear', - 'googleTransactionId', - 'number', - 'sourceCardLastFour', - 'sourceCardType' - ] - ], - ['installments' => ['count']] + ] ]; } - /** - * creates a full array signature of a valid gateway request - * - * @return array gateway request signature format - */ public static function submitForSettlementSignature() { - return ['orderId', ['descriptor' => ['name', 'phone', 'url']], - 'purchaseOrderNumber', - 'taxAmount', - 'taxExempt', - 'shippingAmount', - 'discountAmount', - 'shipsFromPostalCode', - ['lineItems' => - [ - 'commodityCode', - 'description', - 'discountAmount', - 'kind', - 'name', - 'productCode', - 'quantity', - 'taxAmount', - 'totalAmount', - 'unitAmount', - 'unitOfMeasure', - 'unitTaxAmount', - 'url' - ] - ], - ]; + return ['orderId', ['descriptor' => ['name', 'phone', 'url']]]; } - /** - * creates a full array signature of a valid gateway request - * - * @return array gateway request signature format - */ public static function updateDetailsSignature() { return ['amount', 'orderId', ['descriptor' => ['name', 'phone', 'url']]]; } - /** - * creates a full array signature of a valid gateway request - * - * @return array gateway request signature format - */ public static function refundSignature() { - return [ - 'amount', - 'merchantAccountId', - 'orderId' - ]; + return ['amount', 'orderId']; } /** - * Request a credit to a payment method - * - * @param array $attribs containing request parameters * + * @access public + * @param array $attribs * @return Result\Successful|Result\Error */ public function credit($attribs) @@ -382,11 +307,11 @@ public function credit($attribs) } /** - * Request a credit to a payment method. Returns either a Transaction or error - * - * @param array $attribs containing request parameters * - * @return Transaction|Result\Error + * @access public + * @param array $attribs + * @return Result\Successful|Result\Error + * @throws Exception\ValidationError */ public function creditNoValidate($attribs) { @@ -395,11 +320,9 @@ public function creditNoValidate($attribs) } /** - * Retrieve transaction information given its ID - * - * @param string $id unique identifier of the transaction - * - * @return Transaction|Exception\NotFound + * @access public + * @param string id + * @return Transaction */ public function find($id) { @@ -410,31 +333,26 @@ public function find($id) return Transaction::factory($response['transaction']); } catch (Exception\NotFound $e) { throw new Exception\NotFound( - 'transaction with id ' . $id . ' not found' + 'transaction with id ' . $id . ' not found' ); } } /** - * Request a new sale - * - * @param array $attribs (Note: $recurring param is deprecated. Use $transactionSource instead) - * + * new sale + * @param array $attribs * @return Result\Successful|Result\Error */ public function sale($attribs) { - if (array_key_exists('recurring', $attribs)) { - trigger_error('$recurring is deprecated, use $transactionSource instead', E_USER_DEPRECATED); - } return $this->create(array_merge(['type' => Transaction::SALE], $attribs)); } /** - * Request a new sale. Returns a Transaction object instead of a Result - * - * @param mixed $attribs containing any request parameters - * - * @return Transaction|Result\Error + * roughly equivalent to the ruby bang method + * @access public + * @param array $attribs + * @return array + * @throws Exception\ValidationsFailed */ public function saleNoValidate($attribs) { @@ -447,12 +365,12 @@ public function saleNoValidate($attribs) * * If query is a string, the search will be a basic search. * If query is a hash, the search will be an advanced search. - * // phpcs:ignore Generic.Files.LineLength - * For more detailed information and examples, see {@link https://developer.paypal.com/braintree/docs/reference/request/transaction/search/php our developer docs} + * For more detailed information and examples, see {@link https://developers.braintreepayments.com/reference/request/transaction/search/php https://developers.braintreepayments.com/reference/request/transaction/search/php} * * @param mixed $query search query - * + * @param array $options options such as page number * @return ResourceCollection + * @throws InvalidArgumentException */ public function search($query) { @@ -472,18 +390,10 @@ public function search($query) return new ResourceCollection($response, $pager); } else { - throw new Exception\RequestTimeout(); + throw new Exception\DownForMaintenance(); } } - /** - * Function to fetch results in building paged reults - * - * @param mixed $query including method arguments - * @param array $ids to use in searching - * - * @return array - */ public function fetch($query, $ids) { $criteria = []; @@ -500,49 +410,26 @@ public function fetch($query, $ids) 'transaction' ); } else { - throw new Exception\RequestTimeout(); + throw new Exception\DownForMaintenance(); } } - /** - * Adjusts the authorization amount of a transaction - * - * @param string $transactionId unique identifier - * @param string $amount tp be adjusted - * - * @return Result\Successful|Result\Error - */ - public function adjustAuthorization($transactionId, $amount) - { - self::_validateId($transactionId); - $params = ['amount' => $amount]; - $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/adjust_authorization'; - $response = $this->_http->put($path, ['transaction' => $params]); - return $this->_verifyGatewayResponse($response); - } - /** * void a transaction by id * - * @param string $transactionId unique identifier - * + * @param string $id transaction id * @return Result\Successful|Result\Error */ public function void($transactionId) { $this->_validateId($transactionId); - $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/void'; + $path = $this->_config->merchantPath() . '/transactions/'. $transactionId . '/void'; $response = $this->_http->put($path); return $this->_verifyGatewayResponse($response); } - /** - * void a transaction by id. Returns a Transaction instead of Result\Successful * - * @param string $transactionId unique identifier - * - * @return Transaction|Result\Error */ public function voidNoValidate($transactionId) { @@ -550,86 +437,44 @@ public function voidNoValidate($transactionId) return Util::returnObjectOrThrowException(__CLASS__, $result); } - /** - * Submits an authorized transaction be captured and submitted for settlement. - * - * @param string $transactionId uniquq identifier - * @param string|null $amount to be submitted for settlement - * @param array $attribs containing any additional request parameters - * - * @return Result\Successful|Result\Error - */ public function submitForSettlement($transactionId, $amount = null, $attribs = []) { $this->_validateId($transactionId); Util::verifyKeys(self::submitForSettlementSignature(), $attribs); $attribs['amount'] = $amount; - $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/submit_for_settlement'; + $path = $this->_config->merchantPath() . '/transactions/'. $transactionId . '/submit_for_settlement'; $response = $this->_http->put($path, ['transaction' => $attribs]); return $this->_verifyGatewayResponse($response); } - /** - * Submits an authorized transaction be captured and submitted for settlement. Returns a Transaction object on success - * - * @param string $transactionId uniquq identifier - * @param string|null $amount to be submitted for settlement - * @param array $attribs containing any additional request parameters - * - * @return Transaction|Exception - */ public function submitForSettlementNoValidate($transactionId, $amount = null, $attribs = []) { $result = $this->submitForSettlement($transactionId, $amount, $attribs); return Util::returnObjectOrThrowException(__CLASS__, $result); } - /** - * Update certain details for a transaction that has been submitted for settlement - * - * @param string $transactionId to be updated - * @param array $attribs attributes to be updated in the request - * - * @return Result\Successful|Result\Error - */ public function updateDetails($transactionId, $attribs = []) { $this->_validateId($transactionId); Util::verifyKeys(self::updateDetailsSignature(), $attribs); - $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/update_details'; + $path = $this->_config->merchantPath() . '/transactions/'. $transactionId . '/update_details'; $response = $this->_http->put($path, ['transaction' => $attribs]); return $this->_verifyGatewayResponse($response); } - /** - * Settle multiple partial amounts against the same authorization - * - * @param string $transactionId unque identifier of the transaction to be submitted for settlement - * @param string $amount optional - * @param mixed $attribs any additional request parameters - * - * @return Result\Successful|Exception\NotFound - */ public function submitForPartialSettlement($transactionId, $amount, $attribs = []) { $this->_validateId($transactionId); Util::verifyKeys(self::submitForSettlementSignature(), $attribs); $attribs['amount'] = $amount; - $path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/submit_for_partial_settlement'; + $path = $this->_config->merchantPath() . '/transactions/'. $transactionId . '/submit_for_partial_settlement'; $response = $this->_http->post($path, ['transaction' => $attribs]); return $this->_verifyGatewayResponse($response); } - /** - * Specific to Marketplace merchants - * - * @param string $transactionId unque identifier of the transaction to be held in escrow - * - * @return Result\Successful|Exception\NotFound - */ public function holdInEscrow($transactionId) { $this->_validateId($transactionId); @@ -639,13 +484,6 @@ public function holdInEscrow($transactionId) return $this->_verifyGatewayResponse($response); } - /** - * Specific to Marketplace merchants - * - * @param string $transactionId unque identifier of the transaction to be released from escrow - * - * @return Result\Successful|Exception\NotFound - */ public function releaseFromEscrow($transactionId) { $this->_validateId($transactionId); @@ -655,13 +493,6 @@ public function releaseFromEscrow($transactionId) return $this->_verifyGatewayResponse($response); } - /** - * Specific to Marketplace merchants - * - * @param string $transactionId unque identifier of the transaction whose escrow release is to be canceled - * - * @return Result\Successful|Exception\NotFound - */ public function cancelRelease($transactionId) { $this->_validateId($transactionId); @@ -671,19 +502,11 @@ public function cancelRelease($transactionId) return $this->_verifyGatewayResponse($response); } - /** - * Request a refund to a payment method - * - * @param string $transactionId unque identifier of the transaction to be refunded - * @param mixed $amount_or_options if a string amount, the amount to be refunded, if array of options, additional request parameters - * - * @return Result\Successful|Exception\NotFound - */ public function refund($transactionId, $amount_or_options = null) { self::_validateId($transactionId); - if (gettype($amount_or_options) == "array") { + if(gettype($amount_or_options) == "array") { $options = $amount_or_options; } else { $options = [ @@ -698,7 +521,14 @@ public function refund($transactionId, $amount_or_options = null) return $this->_verifyGatewayResponse($response); } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing + /** + * sends the create request to the gateway + * + * @ignore + * @param var $subPath + * @param array $params + * @return Result\Successful|Result\Error + */ public function _doCreate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; @@ -709,19 +539,20 @@ public function _doCreate($subPath, $params) /** * verifies that a valid transaction id is being used - * + * @ignore * @param string transaction id - * @throws InvalidArgumentException - * - * @return null */ - private function _validateId($id = null) - { + private function _validateId($id = null) { if (empty($id)) { + throw new InvalidArgumentException( + 'expected transaction id to be set' + ); + } + if (!preg_match('/^[0-9a-z]+$/', $id)) { throw new InvalidArgumentException( - 'expected transaction id to be set' - ); + $id . ' is an invalid transaction id.' + ); } } @@ -733,25 +564,25 @@ private function _validateId($id = null) * encapsulates a Errors object inside a Result\Error * alternatively, throws an Unexpected exception if the response is invalid. * + * @ignore * @param array $response gateway response values - * - * @throws Exception\Unexpected - * * @return Result\Successful|Result\Error + * @throws Exception\Unexpected */ private function _verifyGatewayResponse($response) { if (isset($response['transaction'])) { // return a populated instance of Transaction return new Result\Successful( - Transaction::factory($response['transaction']) + Transaction::factory($response['transaction']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - "Expected transaction or apiErrorResponse" + "Expected transaction or apiErrorResponse" ); } } } +class_alias('Braintree\TransactionGateway', 'Braintree_TransactionGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php index 2674a45cde5..69aa69f7040 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItem.php @@ -1,5 +1,4 @@ transactionLineItem()->findAll($transactionId); } } +class_alias('Braintree\TransactionLineItem', 'Braintree_TransactionLineItem'); +class_alias('Braintree\TransactionLineItem', 'Braintree\Transaction\LineItem'); +class_alias('Braintree\TransactionLineItem', 'Braintree_Transaction_LineItem'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php index d914eaee679..7b1db2fbd22 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionLineItemGateway.php @@ -1,5 +1,4 @@ _gateway = $gateway; @@ -25,11 +26,9 @@ public function __construct($gateway) } /** - * Find all Transaction Line Items or return an error - * - * @param string $id of the Transaction to search for line items - * - * @return TransactionLineItem|Exception + * @access public + * @param string id + * @return Transaction */ public function findAll($id) { @@ -40,7 +39,7 @@ public function findAll($id) $lineItems = []; if (isset($response['lineItems'])) { - foreach ($response['lineItems'] as $lineItem) { + foreach ($response['lineItems'] AS $lineItem) { $lineItems[] = new TransactionLineItem($lineItem); } } @@ -52,18 +51,17 @@ public function findAll($id) /** * verifies that a valid transaction id is being used - * + * @ignore * @param string transaction id - * * @throws InvalidArgumentException */ - private function _validateId($id = null) - { + private function _validateId($id = null) { if (empty($id)) { - throw new InvalidArgumentException('expected transaction id to be set'); + throw new InvalidArgumentException('expected transaction id to be set'); } if (!preg_match('/^[0-9a-z]+$/', $id)) { throw new InvalidArgumentException($id . ' is an invalid transaction id.'); } } } +class_alias('Braintree\TransactionLineItemGateway', 'Braintree_TransactionLineItemGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php deleted file mode 100644 index 6efc6d3c06f..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionReview.php +++ /dev/null @@ -1,34 +0,0 @@ -_initialize($attributes); - - return $instance; - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - protected function _initialize($attributes) - { - $this->_attributes = $attributes; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php index 9abb438d81a..5271b0b6504 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransactionSearch.php @@ -1,602 +1,66 @@ == More information == + * + * + * @package Braintree + * @category Resources + * + * @property-read string $token + * @property-read string $imageUrl + */ class UnknownPaymentMethod extends Base { + + /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of UnknownPaymentMethod + * to the requesting method, with populated properties * + * @ignore * @return UnknownPaymentMethod */ public static function factory($attributes) @@ -41,8 +54,8 @@ public function isDefault() /** * sets instance properties from an array of values * + * @access protected * @param array $unknownPaymentMethodAttribs array of unknownPaymentMethod data - * * @return void */ protected function _initialize($unknownPaymentMethodAttribs) @@ -51,4 +64,6 @@ protected function _initialize($unknownPaymentMethodAttribs) $this->imageUrl = 'https://assets.braintreegateway.com/payment_method_logo/unknown.png'; $this->_attributes = $unknownPaymentMethodAttribs; } + } +class_alias('Braintree\UnknownPaymentMethod', 'Braintree_UnknownPaymentMethod'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php index fe7b0d94cc2..4ebc420c878 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php @@ -1,20 +1,42 @@ == More information == + * + * + * @package Braintree + * @category Resources + * + * @property-read string $customerId + * @property-read string $email + * @property-read string $token + * @property-read string $imageUrl + * @property-read string $routingNumber + * @property-read string $accountType + * @property-read string $accountHolderName + * @property-read string $last4 + * @property-read string $bankName + * @property-read string $achMandate + * @property-read boolean $default + * @property-read boolean $verified */ class UsBankAccount extends Base { /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of UsBankAccount + * to the requesting method, with populated properties * + * @ignore * @return UsBankAccount */ public static function factory($attributes) @@ -24,12 +46,14 @@ public static function factory($attributes) return $instance; } + /* instance methods */ + /** * sets instance properties from an array of values * + * @access protected * @param array $usBankAccountAttribs array of usBankAccount data - * - * @return mixed + * @return void */ protected function _initialize($usBankAccountAttribs) { @@ -54,8 +78,12 @@ protected function _initialize($usBankAccountAttribs) } } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; @@ -71,28 +99,13 @@ public function isDefault() return $this->default; } - /** - * Static methods redirecting to gateway class - * - * @param string $token the payment method identifier - * - * @see USBankAccountGateway::find() - * - * @return UsBankAccount|Error - */ + // static methods redirecting to gateway + public static function find($token) { return Configuration::gateway()->usBankAccount()->find($token); } - /** - * DO NOT USE, Use Transaction#sale instead. If you do choose to use this function, note that the subsequent transaction (if successful) will be automatically submitted for settlement. - * - * @param string $token the payment method identifier - * @param array $transactionAttribs all other transaction parameters - * - * @return UsBankAccount|Error - */ public static function sale($token, $transactionAttribs) { $transactionAttribs['options'] = [ @@ -101,3 +114,4 @@ public static function sale($token, $transactionAttribs) return Configuration::gateway()->usBankAccount()->sale($token, $transactionAttribs); } } +class_alias('Braintree\UsBankAccount', 'Braintree_UsBankAccount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php index 2687ac23352..6e3393c01a1 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountGateway.php @@ -1,5 +1,4 @@ == More information == + * + * + * @package Braintree + * @category Resources */ class UsBankAccountGateway { @@ -15,7 +25,6 @@ class UsBankAccountGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -28,11 +37,10 @@ public function __construct($gateway) /** * find a usBankAccount by token * + * @access public * @param string $token paypal accountunique id - * - * @throws Exception\NotFound - * * @return UsBankAccount + * @throws Exception\NotFound */ public function find($token) { @@ -45,17 +53,16 @@ public function find($token) 'US bank account with token ' . $token . ' not found' ); } + } /** * create a new sale for the current UsBank account * - * @param string $token payment method identifier - * @param array $transactionAttribs request parameters - * - * @see Transaction::sale() - * + * @param string $token + * @param array $transactionAttribs * @return Result\Successful|Result\Error + * @see Transaction::sale() */ public function sale($token, $transactionAttribs) { @@ -75,25 +82,25 @@ public function sale($token, $transactionAttribs) * encapsulates a Errors object inside a Result\Error * alternatively, throws an Unexpected exception if the response is invalid. * + * @ignore * @param array $response gateway response values - * - * @throws Exception\Unexpected - * * @return Result\Successful|Result\Error + * @throws Exception\Unexpected */ private function _verifyGatewayResponse($response) { if (isset($response['usBankAccount'])) { // return a populated instance of UsBankAccount return new Result\Successful( - UsBankAccount::factory($response['usBankAccount']) + UsBankAccount::factory($response['usBankAccount']) ); - } elseif (isset($response['apiErrorResponse'])) { + } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( - 'Expected US bank account or apiErrorResponse' + 'Expected US bank account or apiErrorResponse' ); } } } +class_alias('Braintree\UsBankAccountGateway', 'Braintree_UsBankAccountGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php index 4f69fa03092..a062a55e845 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php @@ -1,23 +1,30 @@ == More information == + * + * + * @package Braintree + * @category Resources + * */ class UsBankAccountVerification extends Result\UsBankAccountVerification { /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of UsBankAccountVerification + * to the requesting method, with populated properties * + * @ignore * @return UsBankAccountVerification */ public static function factory($attributes) @@ -32,8 +39,8 @@ public static function factory($attributes) /** * sets instance properties from an array of values * + * @access protected * @param array $usBankAccountVerificationAttribs array of usBankAccountVerification data - * * @return void */ protected function _initialize($usBankAccountVerificationAttribs) @@ -42,20 +49,24 @@ protected function _initialize($usBankAccountVerificationAttribs) $this->_attributes = $usBankAccountVerificationAttribs; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']'; } + // static methods redirecting to gateway + /** - * Static methods redirecting to gateway class + * finds a US bank account verification * + * @access public * @param string $token unique id - * - * @see UsBankAccountVerificationGateway::find() - * * @return UsBankAccountVerification */ public static function find($token) @@ -64,12 +75,10 @@ public static function find($token) } /** - * Static methods redirecting to gateway class + * Returns a ResourceCollection of US bank account verifications matching the search query. * + * @access public * @param mixed $query search query - * - * @see UsBankAccountVerificationGateway::search() - * * @return ResourceCollection */ public static function search($query) @@ -78,13 +87,11 @@ public static function search($query) } /** - * Static methods redirecting to gateway class - * - * @param string $token unique id - * @param array $amounts micro transfer amounts - * - * @see UsBankAccountVerificationGateway::confirmMicroTransferAmounts() + * Returns a ResourceCollection of US bank account verifications matching the search query. * + * @access public + * @param string $token unique id + * @param array $amounts micro transfer amounts * @return ResourceCollection */ public static function confirmMicroTransferAmounts($token, $amounts) @@ -92,3 +99,4 @@ public static function confirmMicroTransferAmounts($token, $amounts) return Configuration::gateway()->usBankAccountVerification()->confirmMicroTransferAmounts($token, $amounts); } } +class_alias('Braintree\UsBankAccountVerification', 'Braintree_UsBankAccountVerification'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php index 03ba5a95f41..31397ada8b3 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationGateway.php @@ -1,17 +1,23 @@ == More information == + * + * + * @package Braintree + * @category Resources */ class UsBankAccountVerificationGateway { @@ -19,7 +25,6 @@ class UsBankAccountVerificationGateway private $_config; private $_http; - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing public function __construct($gateway) { $this->_gateway = $gateway; @@ -31,11 +36,10 @@ public function __construct($gateway) /** * find a usBankAccountVerification by token * + * @access public * @param string $token unique id - * - * @throws Exception\NotFound - * * @return UsBankAccountVerification + * @throws Exception\NotFound */ public function find($token) { @@ -50,13 +54,6 @@ public function find($token) } } - /** - * Returns a ResourceCollection of US bank account verifications matching the search query. - * - * @param mixed $query search query - * - * @return ResourceCollection - */ public function search($query) { $criteria = []; @@ -78,17 +75,15 @@ public function search($query) /** * complete micro transfer verification by confirming the transfer amounts * - * @param string $token unique id - * @param array $amounts amounts deposited in micro transfer - * - * @throws Exception\Unexpected - * + * @access public + * @param string $token unique id + * @param array $amounts amounts deposited in micro transfer * @return UsBankAccountVerification + * @throws Exception\Unexpected */ public function confirmMicroTransferAmounts($token, $amounts) { try { - // phpcs:ignore Generic.Files.LineLength $path = $this->_config->merchantPath() . '/us_bank_account_verifications/' . $token . '/confirm_micro_transfer_amounts'; $response = $this->_http->put($path, [ "us_bank_account_verification" => ["deposit_amounts" => $amounts] @@ -109,17 +104,16 @@ public function confirmMicroTransferAmounts($token, $amounts) * encapsulates a Errors object inside a Result\Error * alternatively, throws an Unexpected exception if the response is invalid. * + * @ignore * @param array $response gateway response values - * - * @throws Exception\Unexpected - * * @return Result\Successful|Result\Error + * @throws Exception\Unexpected */ private function _verifyGatewayResponse($response) { if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); - } elseif (isset($response['usBankAccountVerification'])) { + } else if (isset($response['usBankAccountVerification'])) { // return a populated instance of UsBankAccountVerification return new Result\Successful( UsBankAccountVerification::factory($response['usBankAccountVerification']) @@ -131,3 +125,5 @@ private function _verifyGatewayResponse($response) } } } + +class_alias('Braintree\UsBankAccountVerificationGateway', 'Braintree_UsBankAccountVerificationGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php index fb9628f104a..a6336dc24ac 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerificationSearch.php @@ -1,88 +1,36 @@ 'creditCard', + 'Braintree_CreditCard' => 'creditCard', 'Braintree\CreditCardGateway' => 'creditCard', + 'Braintree_CreditCardGateway' => 'creditCard', 'Braintree\Customer' => 'customer', + 'Braintree_Customer' => 'customer', 'Braintree\CustomerGateway' => 'customer', + 'Braintree_CustomerGateway' => 'customer', 'Braintree\Subscription' => 'subscription', + 'Braintree_Subscription' => 'subscription', 'Braintree\SubscriptionGateway' => 'subscription', + 'Braintree_SubscriptionGateway' => 'subscription', 'Braintree\Transaction' => 'transaction', + 'Braintree_Transaction' => 'transaction', 'Braintree\TransactionGateway' => 'transaction', + 'Braintree_TransactionGateway' => 'transaction', 'Braintree\CreditCardVerification' => 'verification', + 'Braintree_CreditCardVerification' => 'verification', 'Braintree\CreditCardVerificationGateway' => 'verification', + 'Braintree_CreditCardVerificationGateway' => 'verification', 'Braintree\AddOn' => 'addOn', + 'Braintree_AddOn' => 'addOn', 'Braintree\AddOnGateway' => 'addOn', + 'Braintree_AddOnGateway' => 'addOn', 'Braintree\Discount' => 'discount', + 'Braintree_Discount' => 'discount', 'Braintree\DiscountGateway' => 'discount', + 'Braintree_DiscountGateway' => 'discount', 'Braintree\Dispute' => 'dispute', + 'Braintree_Dispute' => 'dispute', 'Braintree\Dispute\EvidenceDetails' => 'evidence', + 'Braintree_Dispute_EvidenceDetails' => 'evidence', 'Braintree\DocumentUpload' => 'documentUpload', + 'Braintree_DocumentUpload' => 'doumentUpload', 'Braintree\Plan' => 'plan', + 'Braintree_Plan' => 'plan', 'Braintree\PlanGateway' => 'plan', + 'Braintree_PlanGateway' => 'plan', 'Braintree\Address' => 'address', + 'Braintree_Address' => 'address', 'Braintree\AddressGateway' => 'address', + 'Braintree_AddressGateway' => 'address', 'Braintree\SettlementBatchSummary' => 'settlementBatchSummary', + 'Braintree_SettlementBatchSummary' => 'settlementBatchSummary', 'Braintree\SettlementBatchSummaryGateway' => 'settlementBatchSummary', + 'Braintree_SettlementBatchSummaryGateway' => 'settlementBatchSummary', 'Braintree\Merchant' => 'merchant', + 'Braintree_Merchant' => 'merchant', 'Braintree\MerchantGateway' => 'merchant', + 'Braintree_MerchantGateway' => 'merchant', 'Braintree\MerchantAccount' => 'merchantAccount', + 'Braintree_MerchantAccount' => 'merchantAccount', 'Braintree\MerchantAccountGateway' => 'merchantAccount', + 'Braintree_MerchantAccountGateway' => 'merchantAccount', 'Braintree\OAuthCredentials' => 'credentials', + 'Braintree_OAuthCredentials' => 'credentials', 'Braintree\OAuthResult' => 'result', + 'Braintree_OAuthResult' => 'result', 'Braintree\PayPalAccount' => 'paypalAccount', + 'Braintree_PayPalAccount' => 'paypalAccount', 'Braintree\PayPalAccountGateway' => 'paypalAccount', + 'Braintree_PayPalAccountGateway' => 'paypalAccount', 'Braintree\UsBankAccountVerification' => 'usBankAccountVerification', + 'Braintree_UsBankAccountVerification' => 'usBankAccountVerification', ]; return $classNamesToResponseKeys[$name]; } /** - * Returns corresponding class name based on response keys * * @param string $name className - * * @return string ClassName */ public static function buildClassName($name) @@ -232,9 +245,9 @@ public static function buildClassName($name) /** * convert alpha-beta-gamma to alphaBetaGamma * - * @param string $string to be scrubbed for camelCase formatting - * @param null|string $delimiter to be replaced - * + * @access public + * @param string $string + * @param null|string $delimiter * @return string modified string */ public static function delimiterToCamelCase($string, $delimiter = '[\-\_]') @@ -252,8 +265,8 @@ public static function delimiterToCamelCase($string, $delimiter = '[\-\_]') /** * convert alpha-beta-gamma to alpha_beta_gamma * - * @param string $string to be modified - * + * @access public + * @param string $string * @return string modified string */ public static function delimiterToUnderscore($string) @@ -265,9 +278,9 @@ public static function delimiterToUnderscore($string) /** * find capitals and convert to delimiter + lowercase * - * @param string $string to be scrubbed - * @param null|string $delimiter to replace camelCase - * + * @access public + * @param string $string + * @param null|string $delimiter * @return string modified string */ public static function camelCaseToDelimiter($string, $delimiter = '-') @@ -275,14 +288,6 @@ public static function camelCaseToDelimiter($string, $delimiter = '-') return strtolower(preg_replace('/([A-Z])/', "$delimiter\\1", $string)); } - /** - * converts a-string-here to [aStringHere] - * - * @param array $array to be iterated over - * @param null|string $delimiter to be replaced with camelCase - * - * @return array modified array - */ public static function delimiterToCamelCaseArray($array, $delimiter = '[\-\_]') { $converted = []; @@ -305,14 +310,6 @@ public static function delimiterToCamelCaseArray($array, $delimiter = '[\-\_]') return $converted; } - /** - * find capitals and convert to delimiter + lowercase - * - * @param array $array to be iterated over - * @param null|string $delimiter to replace camelCase - * - * @return array modified array - */ public static function camelCaseToDelimiterArray($array, $delimiter = '-') { $converted = []; @@ -328,13 +325,6 @@ public static function camelCaseToDelimiterArray($array, $delimiter = '-') return $converted; } - /** - * converts a-string-here to [a_string_here] - * - * @param array $array to be iterated over - * - * @return array modified array - */ public static function delimiterToUnderscoreArray($array) { $converted = []; @@ -346,19 +336,17 @@ public static function delimiterToUnderscoreArray($array) } /** - * Join arrays with string or return false * - * @param array $array associative array to implode + * @param array $array associative array to implode * @param string $separator (optional, defaults to =) - * @param string $glue (optional, defaults to ', ') - * - * @return string|false + * @param string $glue (optional, defaults to ', ') + * @return bool */ public static function implodeAssociativeArray($array, $separator = '=', $glue = ', ') { // build a new array with joined keys and values $tmpArray = null; - foreach ($array as $key => $value) { + foreach ($array AS $key => $value) { if ($value instanceof DateTime) { $value = $value->format('r'); } @@ -368,20 +356,12 @@ public static function implodeAssociativeArray($array, $separator = '=', $glue = return (is_array($tmpArray)) ? implode($glue, $tmpArray) : false; } - /* - * Turn all attributes into a string - * - * @param array $attributes to be turned into a string - * - * @return string|false - */ - public static function attributesToString($attributes) - { + public static function attributesToString($attributes) { $printableAttribs = []; - foreach ($attributes as $key => $value) { + foreach ($attributes AS $key => $value) { if (is_array($value)) { $pAttrib = self::attributesToString($value); - } elseif ($value instanceof DateTime) { + } else if ($value instanceof DateTime) { $pAttrib = $value->format(DateTime::RFC850); } else { $pAttrib = $value; @@ -397,12 +377,8 @@ public static function attributesToString($attributes) * compares the expected signature of a gateway request * against the actual structure sent by the user * - * @param array $signature expected signature - * @param array $attributes actual structure sent by user - * - * @throws InvalidArgumentException - * - * @return self + * @param array $signature + * @param array $attributes */ public static function verifyKeys($signature, $attributes) { @@ -411,44 +387,23 @@ public static function verifyKeys($signature, $attributes) $invalidKeys = array_diff($userKeys, $validKeys); $invalidKeys = self::_removeWildcardKeys($validKeys, $invalidKeys); - if (!empty($invalidKeys)) { + if(!empty($invalidKeys)) { asort($invalidKeys); $sortedList = join(', ', $invalidKeys); throw new InvalidArgumentException('invalid keys: ' . $sortedList); } } - - /** - * replaces the value of a key in an array - * - * @param array $array to have key replaced - * @param string $oldKey to be replace - * @param string $newKey to replace - * - * @return array - */ - public static function replaceKey($array, $oldKey, $newKey) - { - if (array_key_exists($oldKey, $array)) { - $array[$newKey] = $array[$oldKey]; - unset($array[$oldKey]); - } - return $array; - } - /** * flattens a numerically indexed nested array to a single level - * - * @param array $keys + * @param array $keys * @param string $namespace - * * @return array */ private static function _flattenArray($keys, $namespace = null) { $flattenedArray = []; - foreach ($keys as $key) { - if (is_array($key)) { + foreach($keys AS $key) { + if(is_array($key)) { $theKeys = array_keys($key); $theValues = array_values($key); $scope = $theKeys[0]; @@ -465,41 +420,39 @@ private static function _flattenArray($keys, $namespace = null) private static function _flattenUserKeys($keys, $namespace = null) { - $flattenedArray = []; - - foreach ($keys as $key => $value) { - $fullKey = empty($namespace) ? $key : $namespace; - if (!is_numeric($key) && $namespace != null) { - $fullKey .= '[' . $key . ']'; - } - if (is_numeric($key) && is_string($value)) { - $fullKey .= '[' . $value . ']'; - } - if (is_array($value)) { - $more = self::_flattenUserKeys($value, $fullKey); - $flattenedArray = array_merge($flattenedArray, $more); - } else { - $flattenedArray[] = $fullKey; - } - } - sort($flattenedArray); - return $flattenedArray; + $flattenedArray = []; + + foreach($keys AS $key => $value) { + $fullKey = empty($namespace) ? $key : $namespace; + if (!is_numeric($key) && $namespace != null) { + $fullKey .= '[' . $key . ']'; + } + if (is_numeric($key) && is_string($value)) { + $fullKey .= '[' . $value . ']'; + } + if(is_array($value)) { + $more = self::_flattenUserKeys($value, $fullKey); + $flattenedArray = array_merge($flattenedArray, $more); + } else { + $flattenedArray[] = $fullKey; + } + } + sort($flattenedArray); + return $flattenedArray; } /** * removes wildcard entries from the invalid keys array - * - * @param array $validKeys + * @param array $validKeys * @param $invalidKey) { + foreach ($invalidKeys AS $index => $invalidKey) { if (stristr($invalidKey, $wildcardKey)) { unset($invalidKeys[$index]); } @@ -509,3 +462,4 @@ private static function _removeWildcardKeys($validKeys, $invalidKeys) return $invalidKeys; } } +class_alias('Braintree\Util', 'Braintree_Util'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php index abdba83b479..91f0da3a130 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoAccount.php @@ -1,12 +1,27 @@ == More information == + * + * See {@link https://developers.braintreepayments.com/javascript+php}
    + * + * @package Braintree + * @category Resources + * + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read boolean $default + * @property-read string $imageUrl + * @property-read string $sourceDescription + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read string $token + * @property-read \DateTime $updatedAt + * @property-read string $username + * @property-read string $venmoUserId */ class VenmoAccount extends Base { @@ -22,10 +37,10 @@ public function isDefault() } /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of VenmoAccount + * to the requesting method, with populated properties * + * @ignore * @return VenmoAccount */ public static function factory($attributes) @@ -39,8 +54,8 @@ public static function factory($attributes) /** * sets instance properties from an array of values * + * @access protected * @param array $venmoAccountAttribs array of Venmo account properties - * * @return void */ protected function _initialize($venmoAccountAttribs) @@ -49,7 +64,7 @@ protected function _initialize($venmoAccountAttribs) $subscriptionArray = array(); if (isset($venmoAccountAttribs['subscriptions'])) { - foreach ($venmoAccountAttribs['subscriptions'] as $subscription) { + foreach ($venmoAccountAttribs['subscriptions'] AS $subscription) { $subscriptionArray[] = Subscription::factory($subscription); } } @@ -57,3 +72,4 @@ protected function _initialize($venmoAccountAttribs) $this->_set('subscriptions', $subscriptionArray); } } +class_alias('Braintree\VenmoAccount', 'Braintree_VenmoAccount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php deleted file mode 100644 index a9920d7c132..00000000000 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/VenmoProfileData.php +++ /dev/null @@ -1,36 +0,0 @@ -_initialize($attributes); - return $instance; - } - - protected function _initialize($venmoProfileDataAttribs) - { - $this->_attributes = $venmoProfileDataAttribs; - } - - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() - { - return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; - } -} diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php index b7e29367653..15f7ade976e 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Version.php @@ -1,5 +1,4 @@ == More information == + * + * For more detailed information on CreditCard verifications, see {@link https://developers.braintreepayments.com/reference/response/credit-card-verification/php https://developers.braintreepayments.com/reference/response/credit-card-verification/php} + * + * @package Braintree + * @category Resources + * + * @property-read \Braintree\Address $billingAddress + * @property-read string $bin + * @property-read string $callId + * @property-read string $cardType + * @property-read string $cardholderName + * @property-read string $commercial + * @property-read string $countryOfIssuance + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read string $customerLocation + * @property-read string $debit + * @property-read boolean $default + * @property-read string $durbinRegulated + * @property-read string $expirationDate + * @property-read string $expirationMonth + * @property-read string $expirationYear + * @property-read boolean $expired + * @property-read string $healthcare + * @property-read string $imageUrl + * @property-read string $issuingBank + * @property-read string $last4 + * @property-read string $maskedNumber + * @property-read string $payroll + * @property-read string $prepaid + * @property-read string $productId + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read string $token + * @property-read string $uniqueNumberIdentifier + * @property-read \DateTime $updatedAt */ class VisaCheckoutCard extends Base { @@ -34,8 +68,8 @@ public function isExpired() /** * sets instance properties from an array of values * + * @access protected * @param array $creditCardAttribs array of creditcard data - * * @return void */ protected function _initialize($creditCardAttribs) @@ -50,7 +84,7 @@ protected function _initialize($creditCardAttribs) $subscriptionArray = []; if (isset($creditCardAttribs['subscriptions'])) { - foreach ($creditCardAttribs['subscriptions'] as $subscription) { + foreach ($creditCardAttribs['subscriptions'] AS $subscription) { $subscriptionArray[] = Subscription::factory($subscription); } } @@ -60,7 +94,7 @@ protected function _initialize($creditCardAttribs) $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); $this->_set('maskedNumber', $this->bin . '******' . $this->last4); - if (isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) { + if(isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) { $verifications = $creditCardAttribs['verifications']; usort($verifications, [$this, '_compareCreatedAtOnVerifications']); @@ -78,7 +112,6 @@ private function _compareCreatedAtOnVerifications($verificationAttrib1, $verific * or is a VisaCheckoutCard with a different id * * @param object $otherVisaCheckoutCard customer to compare against - * * @return boolean */ public function isEqual($otherVisaCheckoutCard) @@ -86,18 +119,22 @@ public function isEqual($otherVisaCheckoutCard) return !($otherVisaCheckoutCard instanceof self) ? false : $this->token === $otherVisaCheckoutCard->token; } - // phpcs:ignore PEAR.Commenting.FunctionComment.Missing - public function __toString() + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() { return __CLASS__ . '[' . - Util::attributesToString($this->_attributes) . ']'; + Util::attributesToString($this->_attributes) .']'; } /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes + * factory method: returns an instance of VisaCheckoutCard + * to the requesting method, with populated properties * + * @ignore * @return VisaCheckoutCard */ public static function factory($attributes) @@ -114,3 +151,4 @@ public static function factory($attributes) return $instance; } } +class_alias('Braintree\VisaCheckoutCard', 'Braintree_VisaCheckoutCard'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php index dbd686d714c..af397c9d5f0 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotification.php @@ -1,39 +1,8 @@ webhookNotification()->parse($signature, $payload); } - /* - * Static methods redirecting to gateway class - * - * @param object $challenge to be verified - * - * @see WebHookNotificationGateway::verify() - * - * @return string|Exception - */ - public static function verify($challenge) - { + public static function verify($challenge) { return Configuration::gateway()->webhookNotification()->verify($challenge); } - /** - * Creates an instance from given attributes - * - * @param array $attributes response object attributes - * - * @return WebhookNotification - */ public static function factory($attributes) { $instance = new self(); @@ -94,7 +55,6 @@ public static function factory($attributes) protected function _initialize($attributes) { - // phpcs:disable Generic.Files.LineLength $this->_attributes = $attributes; if (!isset($attributes['sourceMerchantId'])) { @@ -119,10 +79,6 @@ protected function _initialize($attributes) $this->_set('transaction', Transaction::factory($wrapperNode['transaction'])); } - if (isset($wrapperNode['transactionReview'])) { - $this->_set('transactionReview', TransactionReview::factory($wrapperNode['transactionReview'])); - } - if (isset($wrapperNode['disbursement'])) { $this->_set('disbursement', Disbursement::factory($wrapperNode['disbursement'])); } @@ -151,11 +107,15 @@ protected function _initialize($attributes) $this->_set('accountUpdaterDailyReport', AccountUpdaterDailyReport::factory($wrapperNode['accountUpdaterDailyReport'])); } + if (isset($wrapperNode['idealPayment'])) { + $this->_set('idealPayment', IdealPayment::factory($wrapperNode['idealPayment'])); + } + if (isset($wrapperNode['grantedPaymentInstrumentUpdate'])) { $this->_set('grantedPaymentInstrumentUpdate', GrantedPaymentInstrumentUpdate::factory($wrapperNode['grantedPaymentInstrumentUpdate'])); } - if (in_array($attributes['kind'], [self::GRANTED_PAYMENT_METHOD_REVOKED, self::PAYMENT_METHOD_REVOKED_BY_CUSTOMER])) { + if ($attributes['kind'] == self::GRANTED_PAYMENT_METHOD_REVOKED) { $this->_set('revokedPaymentMethodMetadata', RevokedPaymentMethodMetadata::factory($wrapperNode)); } @@ -163,26 +123,10 @@ protected function _initialize($attributes) $this->_set('localPaymentCompleted', LocalPaymentCompleted::factory($wrapperNode['localPayment'])); } - if (isset($wrapperNode['localPaymentExpired'])) { - $this->_set('localPaymentExpired', LocalPaymentExpired::factory($wrapperNode['localPaymentExpired'])); - } - - if (isset($wrapperNode['localPaymentFunded'])) { - $this->_set('localPaymentFunded', LocalPaymentFunded::factory($wrapperNode['localPaymentFunded'])); - } - - if (isset($wrapperNode['localPaymentReversed'])) { - $this->_set('localPaymentReversed', LocalPaymentReversed::factory($wrapperNode['localPaymentReversed'])); - } - - if (isset($wrapperNode['paymentMethodCustomerDataUpdatedMetadata'])) { - $this->_set('paymentMethodCustomerDataUpdatedMetadata', PaymentMethodCustomerDataUpdatedMetadata::factory($wrapperNode['paymentMethodCustomerDataUpdatedMetadata'])); - } - if (isset($wrapperNode['errors'])) { $this->_set('errors', new Error\ValidationErrorCollection($wrapperNode['errors'])); $this->_set('message', $wrapperNode['message']); } - // phpcs:enable Generic.Files.LineLength } } +class_alias('Braintree\WebhookNotification', 'Braintree_WebhookNotification'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php index a84e1c2dd22..17ef2bb5f96 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookNotificationGateway.php @@ -1,30 +1,15 @@ config = $gateway->config; $this->config->assertHasAccessTokenOrKeys(); } - /** - * Parses a webhook from the Braintree API - * - * @param string $signature used to verify before parsing - * @param mixed $payload to be parsed - * - * @throws Exception\InvalidSignature - * - * @return WebhookNotification object - */ public function parse($signature, $payload) { if (is_null($signature)) { @@ -46,15 +31,6 @@ public function parse($signature, $payload) return WebhookNotification::factory($attributes['notification']); } - /* - * Verify a webhook challenge - * - * @param object $challenge to be verified - * - * @throws Exception\InvalidChallenge - * - * @return string - */ public function verify($challenge) { if (!preg_match('/^[a-f0-9]{20,32}$/', $challenge)) { @@ -86,7 +62,8 @@ private function _validateSignature($signatureString, $payload) private function _matchingSignature($signaturePairs) { - foreach ($signaturePairs as $pair) { + foreach ($signaturePairs as $pair) + { $components = preg_split("/\|/", $pair); if ($components[0] == $this->config->getPublicKey()) { return $components[1]; @@ -96,3 +73,5 @@ private function _matchingSignature($signaturePairs) return null; } } + +class_alias('Braintree\WebhookNotificationGateway', 'Braintree_WebhookNotificationGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php index 4c21356578d..350591ce8a1 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTesting.php @@ -1,5 +1,4 @@ -webhookTesting()->sampleNotification($kind, $id, $sourceMerchantId); } } +class_alias('Braintree\WebhookTesting', 'Braintree_WebhookTesting'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php index 2fc0b17bbb7..a17e0b778ee 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/WebhookTestingGateway.php @@ -1,36 +1,20 @@ config = $gateway->config; $this->config->assertHasAccessTokenOrKeys(); } - /** - * Build a sample Webhook - * - * @param string $kind the kind of Webhook you want to generate - * @param string $id unique identifier - * @param string $sourceMerchantId optional - * - * @return Webhook - */ public function sampleNotification($kind, $id, $sourceMerchantId = null) { $xml = self::_sampleXml($kind, $id, $sourceMerchantId); $payload = base64_encode($xml) . "\n"; - $publicKey = $this->config->getPublicKey(); - $sha = Digest::hexDigestSha1($this->config->getPrivateKey(), $payload); - $signature = $publicKey . "|" . $sha; + $signature = $this->config->getPublicKey() . "|" . Digest::hexDigestSha1($this->config->getPrivateKey(), $payload); return [ 'bt_signature' => $signature, @@ -50,9 +34,6 @@ private static function _sampleXml($kind, $id, $sourceMerchantId) case WebhookNotification::TRANSACTION_DISBURSED: $subjectXml = self::_transactionDisbursedSampleXml($id); break; - case WebhookNotification::TRANSACTION_REVIEWED: - $subjectXml = self::_transactionReviewedSampleXml($id); - break; case WebhookNotification::TRANSACTION_SETTLED: $subjectXml = self::_transactionSettledSampleXml($id); break; @@ -92,63 +73,37 @@ private static function _sampleXml($kind, $id, $sourceMerchantId) case WebhookNotification::DISPUTE_WON: $subjectXml = self::_disputeWonSampleXml($id); break; - case WebhookNotification::DISPUTE_ACCEPTED: - $subjectXml = self::_disputeAcceptedSampleXml($id); - break; - case WebhookNotification::DISPUTE_DISPUTED: - $subjectXml = self::_disputeDisputedSampleXml($id); - break; - case WebhookNotification::DISPUTE_EXPIRED: - $subjectXml = self::_disputeExpiredSampleXml($id); - break; case WebhookNotification::SUBSCRIPTION_CHARGED_SUCCESSFULLY: $subjectXml = self::_subscriptionChargedSuccessfullySampleXml($id); break; case WebhookNotification::SUBSCRIPTION_CHARGED_UNSUCCESSFULLY: $subjectXml = self::_subscriptionChargedUnsuccessfullySampleXml($id); break; - case WebhookNotification::SUBSCRIPTION_EXPIRED: - $subjectXml = self::_subscriptionExpiredSampleXml($id); - break; - case WebhookNotification::SUBSCRIPTION_CANCELED: - $subjectXml = self::_subscriptionCanceledSampleXml($id); - break; - case WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE: - $subjectXml = self::_subscriptionWentPastDueSampleXml($id); - break; case WebhookNotification::CHECK: $subjectXml = self::_checkSampleXml(); break; case WebhookNotification::ACCOUNT_UPDATER_DAILY_REPORT: $subjectXml = self::_accountUpdaterDailyReportSampleXml($id); break; + case WebhookNotification::IDEAL_PAYMENT_COMPLETE: + $subjectXml = self::_idealPaymentCompleteSampleXml($id); + break; + case WebhookNotification::IDEAL_PAYMENT_FAILED: + $subjectXml = self::_idealPaymentFailedSampleXml($id); + break; + // NEXT_MAJOR_VERSION remove GRANTED_PAYMENT_INSTRUMENT_UPDATE + case WebhookNotification::GRANTED_PAYMENT_INSTRUMENT_UPDATE: + $subjectXml = self::_grantedPaymentInstrumentUpdateSampleXml(); + break; case WebhookNotification::GRANTOR_UPDATED_GRANTED_PAYMENT_METHOD: $subjectXml = self::_grantedPaymentInstrumentUpdateSampleXml(); break; case WebhookNotification::RECIPIENT_UPDATED_GRANTED_PAYMENT_METHOD: $subjectXml = self::_grantedPaymentInstrumentUpdateSampleXml(); break; - case WebhookNotification::GRANTED_PAYMENT_METHOD_REVOKED: - $subjectXml = self::_venmoAccountXml($id); - break; - case WebhookNotification::PAYMENT_METHOD_REVOKED_BY_CUSTOMER: - $subjectXml = self::_paymentMethodRevokedByCustomerSampleXml($id); - break; case WebhookNotification::LOCAL_PAYMENT_COMPLETED: $subjectXml = self::_localPaymentCompletedSampleXml(); break; - case WebhookNotification::LOCAL_PAYMENT_EXPIRED: - $subjectXml = self::_localPaymentExpiredSampleXml(); - break; - case WebhookNotification::LOCAL_PAYMENT_FUNDED: - $subjectXml = self::_localPaymentFundedSampleXml(); - break; - case WebhookNotification::LOCAL_PAYMENT_REVERSED: - $subjectXml = self::_localPaymentReversedSampleXml(); - break; - case WebhookNotification::PAYMENT_METHOD_CUSTOMER_DATA_UPDATED: - $subjectXml = self::_paymentMethodCustomerDataUpdatedSampleXml($id); - break; default: $subjectXml = self::_subscriptionSampleXml($id); break; @@ -226,19 +181,6 @@ private static function _transactionDisbursedSampleXml($id) "; } - private static function _transactionReviewedSampleXml($id) - { - return " - - my_id - smart_decision - hey@girl.com - I reviewed this - 2018-10-11T21:28:37Z - - "; - } - private static function _transactionSettledSampleXml($id) { return " @@ -402,81 +344,11 @@ private static function _disputeWonSampleXml($id) "; } - private static function _disputeAcceptedSampleXml($id) - { - return " - - 250.00 - 250.0 - 245.00 - USD - 2014-03-01 - 2014-03-21 - chargeback - accepted - fraud - ${id} - - ${id} - 250.00 - - 2014-03-21 - - "; - } - - private static function _disputeDisputedSampleXml($id) - { - return " - - 250.00 - 250.0 - 245.00 - USD - 2014-03-01 - 2014-03-21 - chargeback - disputed - fraud - ${id} - - ${id} - 250.00 - - 2014-03-21 - - "; - } - - private static function _disputeExpiredSampleXml($id) - { - return " - - 250.00 - 250.0 - 245.00 - USD - 2014-03-01 - 2014-03-21 - chargeback - expired - fraud - ${id} - - ${id} - 250.00 - - 2014-03-21 - - "; - } - private static function _subscriptionSampleXml($id) { return " {$id} - Active @@ -492,7 +364,6 @@ private static function _subscriptionChargedSuccessfullySampleXml($id) return " {$id} - Active 2016-03-21 2017-03-31 @@ -515,7 +386,6 @@ private static function _subscriptionChargedUnsuccessfullySampleXml($id) return " {$id} - Active 2016-03-21 2017-03-31 @@ -533,54 +403,6 @@ private static function _subscriptionChargedUnsuccessfullySampleXml($id) "; } - private static function _subscriptionExpiredSampleXml($id) - { - return " - - {$id} - Expired - - - - - - - - "; - } - - private static function _subscriptionCanceledSampleXml($id) - { - return " - - {$id} - Canceled - - - - - - - - "; - } - - private static function _subscriptionWentPastDueSampleXml($id) - { - return " - - {$id} - Past Due - - - - - - - - "; - } - private static function _checkSampleXml() { return " @@ -661,8 +483,42 @@ private static function _connectedMerchantPayPalStatusChangedSampleXml($id) "; } - private static function _grantedPaymentInstrumentUpdateSampleXml() + private static function _idealPaymentCompleteSampleXml($id) { + return " + + {$id} + COMPLETE + ABCISSUER + ORDERABC + EUR + 10.00 + 2016-11-29T23:27:34.547Z + https://example.com + 1234567890 + + "; + } + + private static function _idealPaymentFailedSampleXml($id) + { + return " + + {$id} + FAILED + ABCISSUER + ORDERABC + EUR + 10.00 + 2016-11-29T23:27:34.547Z + https://example.com + 1234567890 + + "; + } + + private static function _grantedPaymentInstrumentUpdateSampleXml() + { return " vczo7jqrpwrsi2px @@ -681,133 +537,24 @@ private static function _grantedPaymentInstrumentUpdateSampleXml() "; } - private static function _paymentMethodRevokedByCustomerSampleXml($id) - { - return " - - a-billing-agreement-id - 2019-01-01T12:00:00Z - a-customer-id - true - name@email.com - cGF5bWVudG1ldGhvZF9jaDZieXNz - https://assets.braintreegateway.com/payment_method_logo/paypal.png?environment=test - - {$id} - 2019-01-02T12:00:00Z - - a-payer-id - - - 2019-01-02T12:00:00Z - - "; - } - private static function _localPaymentCompletedSampleXml() - { + { return " a-payment-id a-payer-id - ee257d98-de40-47e8-96b3-a6954ea7a9a4 - - 1 - authorizing - 10.00 - order1234 - "; } - private static function _localPaymentExpiredSampleXml() - { - return " - - a-payment-id - a-payment-context-id - - "; - } - - private static function _localPaymentFundedSampleXml() - { - return " - - a-payment-id - a-payment-context-id - - 1 - settled - 10.00 - order1234 - - - "; - } - - private static function _localPaymentReversedSampleXml() - { - return " - - a-payment-id - - "; - } - - private static function _paymentMethodCustomerDataUpdatedSampleXml($id) - { - $venmoAccountXml = self::_venmoAccountXml($id); - return " - - TOKEN-12345 - - {$venmoAccountXml} - - 2022-01-01T21:28:37Z - - - firstName - - - venmo_username - John - Doe - 1231231234 - john.doe@paypal.com - - - - "; - } - - private static function _venmoAccountXml($id) - { - return " - - 2018-10-11T21:28:37Z - 2018-10-11T21:28:37Z - true - https://assets.braintreegateway.com/payment_method_logo/venmo.png?environment=test - {$id} - Venmo Account: venmojoe - venmojoe - 456 - - venmo_customer_id - cGF5bWVudG1ldGhvZF92ZW5tb2FjY291bnQ - - "; - } - private static function _timestamp() { $originalZone = date_default_timezone_get(); date_default_timezone_set('UTC'); - $timestamp = date("Y-m-d\TH:i:s\Z", time()); + $timestamp = strftime('%Y-%m-%dT%TZ'); date_default_timezone_set($originalZone); return $timestamp; } } +class_alias('Braintree\WebhookTestingGateway', 'Braintree_WebhookTestingGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php index 801ceb639b1..e938c40a746 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml.php @@ -1,23 +1,24 @@ text($aData); } - return; + return; } - foreach ($aData as $elementName => $element) { + foreach ($aData AS $elementName => $element) { // handle child elements $writer->startElement($elementName); if (is_array($element)) { if (array_key_exists(0, $element) || empty($element)) { $writer->writeAttribute('type', 'array'); - foreach ($element as $ignored => $itemInArray) { + foreach ($element AS $ignored => $itemInArray) { $writer->startElement('item'); self::_createElementsFromArray($writer, $itemInArray); $writer->endElement(); } - } else { + } + else { self::_createElementsFromArray($writer, $element); } } else { @@ -87,11 +90,7 @@ private static function _createElementsFromArray(&$writer, $aData) $writer->writeAttribute($attribute[0], $attribute[1]); $element = $attribute[2]; } - if (!is_null($element)) { - $writer->text($element); - } else { - $writer->text(""); - } + $writer->text($element); } $writer->endElement(); } @@ -100,15 +99,14 @@ private static function _createElementsFromArray(&$writer, $aData) /** * convert passed data into an array of attributeType, attributeName, and value * dates sent as DateTime objects will be converted to strings - * + * @access protected * @param mixed $value - * * @return array attributes and element value */ private static function _generateXmlAttribute($value) { - if ($value instanceof DateTime || is_a($value, 'DateTimeImmutable')) { - return ['type', 'datetime', self::_convertDateTimeObjectToXmlTimestamp($value)]; + if ($value instanceof DateTime) { + return ['type', 'datetime', self::_dateTimeToXmlTimestamp($value)]; } if (is_int($value)) { return ['type', 'integer', $value]; @@ -116,24 +114,19 @@ private static function _generateXmlAttribute($value) if (is_bool($value)) { return ['type', 'boolean', ($value ? 'true' : 'false')]; } - if ($value === null) { + if ($value === NULL) { return ['nil', 'true', $value]; } } /** * converts datetime back to xml schema format - * + * @access protected * @param object $dateTime - * * @return string XML schema formatted timestamp */ - private static function _convertDateTimeObjectToXmlTimestamp($dateTime) + private static function _dateTimeToXmlTimestamp($dateTime) { - if (is_a($dateTime, 'DateTimeImmutable')) { - $dateTimeForUTC = DateTime::createFromImmutable($dateTime); - } else { - $dateTimeForUTC = clone $dateTime; - } + $dateTimeForUTC = clone $dateTime; $dateTimeForUTC->setTimeZone(new DateTimeZone('UTC')); return ($dateTimeForUTC->format('Y-m-d\TH:i:s') . 'Z'); @@ -143,13 +136,14 @@ private static function _castDateTime($string) { try { if (empty($string)) { - return false; + return false; } $dateTime = new DateTime($string); - return self::_convertDateTimeObjectToXmlTimestamp($dateTime); + return self::_dateTimeToXmlTimestamp($dateTime); } catch (Exception $e) { // not a datetime return false; } } } +class_alias('Braintree\Xml\Generator', 'Braintree_Xml_Generator'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php index bd52dc2d5f6..1c0d05e6429 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Xml/Parser.php @@ -1,5 +1,4 @@ getAttribute('type'); } - switch ($type) { - case 'array': - $array = []; - foreach ($node->childNodes as $child) { - $value = self::_nodeToValue($child); - if ($value !== null) { - $array[] = $value; - } + switch($type) { + case 'array': + $array = []; + foreach ($node->childNodes as $child) { + $value = self::_nodeToValue($child); + if ($value !== null) { + $array[] = $value; } - return $array; - case 'collection': - $collection = []; - foreach ($node->childNodes as $child) { - $value = self::_nodetoValue($child); - if ($value !== null) { - if (!isset($collection[$child->nodeName])) { - $collection[$child->nodeName] = []; - } - $collection[$child->nodeName][] = self::_nodeToValue($child); + } + return $array; + case 'collection': + $collection = []; + foreach ($node->childNodes as $child) { + $value = self::_nodetoValue($child); + if ($value !== null) { + if (!isset($collection[$child->nodeName])) { + $collection[$child->nodeName] = []; } + $collection[$child->nodeName][] = self::_nodeToValue($child); } - return $collection; - default: - $values = []; - if ($node->childNodes->length === 1 && $node->childNodes->item(0) instanceof DOMText) { - return $node->childNodes->item(0)->nodeValue; - } else { - foreach ($node->childNodes as $child) { - if (!$child instanceof DOMText) { - $values[$child->nodeName] = self::_nodeToValue($child); - } + } + return $collection; + default: + $values = []; + if ($node->childNodes->length === 1 && $node->childNodes->item(0) instanceof DOMText) { + return $node->childNodes->item(0)->nodeValue; + } else { + foreach ($node->childNodes as $child) { + if (!$child instanceof DOMText) { + $values[$child->nodeName] = self::_nodeToValue($child); } - return $values; } + return $values; + } } } @@ -88,7 +85,6 @@ private static function _nodeToArray($node) * Converts a node to a PHP value * * @param DOMNode $node - * * @return mixed */ private static function _nodeToValue($node) @@ -98,31 +94,31 @@ private static function _nodeToValue($node) $type = $node->getAttribute('type'); } - switch ($type) { - case 'datetime': - return self::_timestampToUTC((string) $node->nodeValue); - case 'date': - return new DateTime((string) $node->nodeValue); - case 'integer': - return (int) $node->nodeValue; - case 'boolean': - $value = (string) $node->nodeValue; - if (is_numeric($value)) { - return (bool) $value; - } else { - return ($value !== "true") ? false : true; - } - case 'array': - case 'collection': + switch($type) { + case 'datetime': + return self::_timestampToUTC((string) $node->nodeValue); + case 'date': + return new DateTime((string) $node->nodeValue); + case 'integer': + return (int) $node->nodeValue; + case 'boolean': + $value = (string) $node->nodeValue; + if(is_numeric($value)) { + return (bool) $value; + } else { + return ($value !== "true") ? false : true; + } + case 'array': + case 'collection': + return self::_nodeToArray($node); + default: + if ($node->hasChildNodes()) { return self::_nodeToArray($node); - default: - if ($node->hasChildNodes()) { - return self::_nodeToArray($node); - } elseif (trim($node->nodeValue) === '') { - return null; - } else { - return $node->nodeValue; - } + } elseif (trim($node->nodeValue) === '') { + return null; + } else { + return $node->nodeValue; + } } } @@ -131,7 +127,6 @@ private static function _nodeToValue($node) * Converts XML timestamps into DateTime instances * * @param string $timestamp - * * @return DateTime */ private static function _timestampToUTC($timestamp) @@ -142,3 +137,4 @@ private static function _timestampToUTC($timestamp) return $dateTime; } } +class_alias('Braintree\Xml\Parser', 'Braintree_Xml_Parser'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php b/upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php index 84018011733..1b5edc0b7fa 100644 --- a/upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/autoload.php @@ -1,4 +1,4 @@ - - - Coding standard based on internal Braintree coding practices. - - - - - - - - tests/* - - - - - - tests/* - - - - - - - - - - - - - - - - - - - - - - - tests/* - lib/Braintree/Test/* - - - - - - - - - - tests/* - lib/Braintree/Test/* - - - - - - - - - - - - diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig deleted file mode 100644 index 9a9710a901b..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false - -[*.yml] -indent_size = 2 \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml deleted file mode 100644 index 5e131c47002..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.github/workflows/php.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: PHP Composer - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - phpunit-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - - name: Run test suite - env: - CONSUMER_KEY: ${{secrets.CRD_KEY}} - CONSUMER_SECRET: ${{secrets.CRD_SECRET}} - run: composer run-script test diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore index ad78b24b878..16a8fefbe54 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.gitignore @@ -3,10 +3,6 @@ bin/ build/ specs/ phpunit.xml -.phpunit.result.cache phpspec.yml tests/info.log composer.lock -.idea/ -phpstan.neon -.phpunit.result.cache diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml index 7751733d42d..abbac7b5bdd 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/.travis.yml @@ -1,10 +1,9 @@ language: php -dist: trusty php: - - 7.2 - - 7.3 - - 7.4 + - 5.4 + - 5.5 + - 5.6 before_script: - composer self-update diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md deleted file mode 100644 index 6e36d1fa831..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/CHANGELOG.md +++ /dev/null @@ -1,83 +0,0 @@ -# Cardinity Client PHP Library - -## v3.0.3 - -### Added -- Added `Method\Validators\CallbackUrlConstraint` custom validation constraint class -- Added `Method\Validators\CallbackUrlConstraintValidator` custom constraint validation class -- Added `getInsideArray` method to `Method\Payment\Create` class -- Added `getNotificationUrlConstraints` method to `Method\Payment\Create` for `notification_url` parameter -- Added `getIpAddressConstraints` method to `Method\Payment\Create` for `ip_address` parameter. -- Added unit tests for new methods. -- Added `getStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. -- Added `setStatementDescriptorDuffix` method to `Method\Payment\Payment` for `statement_descriptor_prefix` parameter. - - -### Updated -- Updated `getThreeDS2DataConstraints` method of `Method\Payment\Create` class -- Updated `getBrowserInfoConstraints` method of `Method\Payment\Create` class. -- Updated `getValidationConstraints` method of `Method\Payment\Create` class - -## v3.0.2 - -### Changed - -- Changed `getThreeds2data` method to `getThreeds2Data` of class `Method\Payment\Payment` -- Changed `setThreeds2data` method to `setThreeds2Data` of class `Method\Payment\Payment` -- Changed `unserialize` method of `Method\ResultObject` class -- Changed `propertyName` method of `Method\ResultObject` class - - -## v3.0.1 - -### Fixed - -- Removed redundant comma in `Method\Payment\Create.php` line 84. - -## v3.0.0 - -### Added -- Added `threeDS2AuthorizationInformation` property to `Payment` class -- Added `getThreeds2data` method to `Payment` class -- Added `setThreeds2data` method to `Payment` class -- Added `isThreedsV1` method to `Payment` class -- Added `isThreedsV2` method to `Payment` class -- Added `getThreeDS2DataConstraints` method to `Create` class -- Added `getBrowserInfoConstraints` method to `Create` class -- Added `getAdressConstraints` method to `Create` class -- Added `getCardHolderInfoConstraints` method to `Create` class -- Added `buildElement` method to `Create` class -- Added `paymentId` property to `Finalize` class -- Added `finalizeKey` property to `Finalize` class -- Added `Method\Payment\ThreeDS2Data` parameters -- Added `Method\Payment\TreeDS2AthorizationInformation` class - -### Changed -- Updated `php` to version 7.2.x -- Updated `symfony/validator` to versin 5.x -- Updated `phpspec/phpspec` to version 6.2 -- Updated `phpunit/phpunit` to version 8.5 -- Updated `symfony/yaml` to version 4.4 -- Refactored `Create` class to build validation parameters using `buildElement` method -- Updated `getValidationConstraints` method of `Create` class -- Updated `getPaymentInstrumentConstraints` method of `Create` class -- Updated `__construct` method of `Finalize` class -- Updated `getAttributes` method of `Finalize` class -- Updated `getValidationConstraints` method of `Finalize` class - -## v2.1.0 - -### Added -- Added `isDeclined` method to `Payment` class -- Added `isApproved` and `isDeclined` methods to `Refund` class -- Added `isApproved` and `isDeclined` methods to `Settlement` class -- Added `isApproved` and `isDeclined` methods to `VoidPayment` class - -## v2.0.0 - -### Changed -- Renamed `Cardinity\Method\Void` to `Cardinity\Method\VoidPayment` -- Renamed `Void.php` to `VoidPayment.php` - -### Removed -- Removed `ResultObjectPropertyNotFound.php` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE index 97bfca21cb6..e98d92519f8 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Cardinity +Copyright (c) 2014 Joe Linn 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/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md index 692fb347da4..cbb099d39e9 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/README.md @@ -1,8 +1,9 @@ Cardinity Client PHP Library ================================================ -[![Build Status](https://app.travis-ci.com/cardinity/cardinity-sdk-php.svg?branch=master)](https://app.travis-ci.com/cardinity/cardinity-sdk-php) +[![Build Status](https://travis-ci.org/cardinity/cardinity-sdk-php.svg?branch=master)](http://travis-ci.org/cardinity/cardinity-sdk-php) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/cardinity/cardinity-sdk-php/?branch=master) +[![SensioLabsInsight](https://insight.sensiolabs.com/projects/536548a5-73e5-4c71-8a8b-d6fdd6e5e7a6/mini.png)](https://insight.sensiolabs.com/projects/536548a5-73e5-4c71-8a8b-d6fdd6e5e7a6) This is official PHP client library for [Cardinity's](https://developers.cardinity.com/api/v1/) API. Library includes all the functionality provided by API. Library was designed to be flexible and self-explanatory for developers to implement. @@ -31,7 +32,6 @@ $client = Client::create([ #### Create new payment ```php use Cardinity\Method\Payment; - $method = new Payment\Create([ 'amount' => 50.00, 'currency' => 'EUR', @@ -42,121 +42,17 @@ $method = new Payment\Create([ 'payment_method' => Payment\Create::CARD, 'payment_instrument' => [ 'pan' => '4111111111111111', - 'exp_year' => 2021, + 'exp_year' => 2016, 'exp_month' => 12, 'cvc' => '456', 'holder' => 'Mike Dough' ], - 'threeds2_data' => [ - "notification_url" => "your_shop_url_for_handling_callback", - "browser_info" => [ - "accept_header" => "text/html", - "browser_language" => "en-US", - "screen_width" => 600, - "screen_height" => 400, - 'challenge_window_size' => "600x400", - "user_agent" => "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0", - "color_depth" => 24, - "time_zone" => -60 - ], - ], -]); -``` -#### All the `threeds2_data` parameters should be set dynamically. -Parameters `screen_width`, `screen_height`, `browser_language`, `color_depth`, `time_zone` of `browser_info` could be collected dynamically using `javascript`: -```javascript -document.addEventListener("DOMContentLoaded", function() { - document.getElementById("screen_width").value = screen.availWidth; - document.getElementById("screen_height").value = screen.availHeight; - document.getElementById("browser_language").value = navigator.language; - document.getElementById("color_depth").value = screen.colorDepth; - document.getElementById("time_zone").value = new Date().getTimezoneOffset(); -}); -``` -and placed into a `html` form -```html - - - - - - - -``` -Then call to Cardinity API should be executed using `try ... catch` blocks: -```php -$errors = []; -try { - /** @type Cardinity\Method\Payment\Payment */ - $payment = $client->call($method); - $status = $payment->getStatus(); - if ($status == 'approved') { - echo '

    Your payment approved without 3D secure.

    '; - } elseif ($status == 'pending') { - if ($payment->isThreedsV2()) { - // $auth object for data required to finalize payment - $auth = $payment->getThreeds2Data(); - // finalize process should be done here. - }else if ($payment->isThreedsV1()) { - // $auth object for data required to finalize payment - $auth = $payment->getAuthorizationInformation(); - // finalize process should be done here. - } - } -} catch (Cardinity\Exception\InvalidAttributeValue $exception) { - foreach ($exception->getViolations() as $key => $violation) { - array_push($errors, $violation->getPropertyPath() . ' ' . $violation->getMessage()); - } -} catch (Cardinity\Exception\ValidationFailed $exception) { - foreach ($exception->getErrors() as $key => $error) { - array_push($errors, $error['message']); - } -} catch (Cardinity\Exception\Declined $exception) { - foreach ($exception->getErrors() as $key => $error) { - array_push($errors, $error['message']); - } -} catch (Cardinity\Exception\NotFound $exception) { - foreach ($exception->getErrors() as $key => $error) { - array_push($errors, $error['message']); - } -} catch (Exception $exception) { - $errors = [$exception->getMessage()]; -} -if ($errors) { - print_r($errors); -} -``` -#### Finalize payment -To finalize payment it should have status `pending`. Data received from 3D secure system should be used to create Finalize `$method`. -```php -use Cardinity\Method\Payment; - -$client = Client::create([ - 'consumerKey' => 'YOUR_CONSUMER_KEY', - 'consumerSecret' => 'YOUR_CONSUMER_SECRET', ]); - -if($v2){ - $method = new Payment\Finalize( - $payment->getId(), // payment object received from API call - $auth->getCreq(), // payment object received from API call - true // BOOL `true` to enable 3D secure V2 parameters - ); -}elseif($v1){ - $method = new Payment\Finalize( - $payment->getId(), // payment object received from API call - $auth->getData(), // payment object received from API call - false // BOOL `false` to enable 3D secure V1 parameters - ); -} - -// again use same try ... catch block -try { - $payment = $client->call($method); -} -// same catch blocks ... -// ... - +/** @type Cardinity\Method\Payment\Payment */ +$payment = $client->call($method); +$paymentId = $payment->getId(); +// serializes object into string for storing in database +$serialized = serialize($payment); ``` #### Get existing payment @@ -171,6 +67,3 @@ $payment = $client->call($method); ## Development Status All the API __v1__ methods are implemented. - -### Tests -for windows `php vendor/phpunit/phpunit/phpunit` diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json index f131189a55e..4cf86f2dd41 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/composer.json @@ -3,18 +3,18 @@ "description": "Client library for Cardinity credit card processing API", "type": "library", "license": "MIT", - "homepage": "https://cardinity.com", + "homepage": "http://cardinity.com", "require": { - "php" : ">=7.2.5", - "guzzlehttp/guzzle" : "^6.2.1", - "guzzlehttp/oauth-subscriber": "0.3.*", - "symfony/validator" : "^5.0.0" + "php" : ">=5.4.0", + "guzzlehttp/guzzle" : "~5.1", + "guzzlehttp/log-subscriber" : "~1.0", + "guzzlehttp/oauth-subscriber": "0.2.*", + "symfony/validator" : "~2.6" }, "require-dev": { "monolog/monolog" : "~1.0", - "phpspec/phpspec" : "~6.2", - "phpunit/phpunit" : "^8.5", - "symfony/yaml" : "^4.4" + "phpspec/phpspec" : "~2.1", + "phpunit/phpunit" : "~4.3" }, "config": { "bin-dir": "bin" @@ -26,8 +26,5 @@ "psr-4": { "Cardinity\\Tests\\": "tests/" } - }, - "scripts": { - "test": "phpunit" } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md index 64884fb3325..6764604d652 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/docs/README.md @@ -28,9 +28,9 @@ $method = new Payment\Create([ 'payment_method' => Payment\Create::CARD, 'payment_instrument' => [ 'pan' => '4111111111111111', - 'exp_year' => 2021, + 'exp_year' => 2016, 'exp_month' => 12, - 'cvc' => '456', + 'cvc' => 456, 'holder' => 'Mike Dough' ], ]); @@ -57,9 +57,9 @@ $method = new Payment\Create([ 'payment_method' => Payment\Create::RECURRING, 'payment_instrument' => [ 'pan' => '4111111111111111', - 'exp_year' => 2021, + 'exp_year' => 2016, 'exp_month' => 12, - 'cvc' => '456', + 'cvc' => 456, 'holder' => 'Mike Dough' ], ]); @@ -242,12 +242,12 @@ $settlement = $result[0]; ## Voids [API](https://developers.cardinity.com/api/v1/#voids) ### Create new void ```php -use Cardinity\Method\VoidPayment; -$method = new VoidPayment\Create( +use Cardinity\Method\Void; +$method = new Void\Create( $payment->getId(), 'my description' ); -/** @type Cardinity\Method\VoidPayment\VoidPayment */ +/** @type Cardinity\Method\Void\Void */ $result = $client->call($method); ``` @@ -257,18 +257,18 @@ exception will be thrown. ```php use Cardinity\Exception; -use Cardinity\Method\VoidPayment; +use Cardinity\Method\Void; -$method = new VoidPayment\Create( +$method = new Void\Create( $payment->getId(), 'fail' ); try { - /** @type Cardinity\Method\VoidPayment\VoidPayment */ + /** @type Cardinity\Method\Void\Void */ $void = $client->call($method); } catch (Exception\Declined $exception) { - /** @type Cardinity\Method\VoidPayment\VoidPayment */ + /** @type Cardinity\Method\Void\Void */ $void = $exception->getResult(); $status = $void->getStatus(); // value will be 'declined' $errors = $exception->getErrors(); // list of errors occured @@ -277,23 +277,23 @@ try { ### Get existing void ```php -use Cardinity\Method\VoidPayment; -$method = new VoidPayment\Get( +use Cardinity\Method\Void; +$method = new Void\Get( $payment->getId(), $void->getId() ); -/** @type Cardinity\Method\VoidPayment\VoidPayment */ +/** @type Cardinity\Method\Void\Void */ $void = $client->call($method); ``` ### Get all voids ```php -use Cardinity\Method\VoidPayment; -$method = new VoidPayment\GetAll( +use Cardinity\Method\Void; +$method = new Void\GetAll( $payment->getId() ); $result = $client->call($method); -/** @type Cardinity\Method\VoidPayment\VoidPayment */ +/** @type Cardinity\Method\Void\Void */ $void = $result[0]; ``` @@ -303,8 +303,8 @@ $void = $result[0]; #### Base class for API error response exceptions Class: `Cardinity\Exception\Request` Methods: -- `getErrors()` returns list of errors occurred -- `getErrorsAsString()` returns list of errors occurred in string form +- `getErrors()` returns list of errors occured +- `getErrorsAsString()` returns list of errors occured in string form - `getResult()` returns object, the instance of `ResultObjectInterface`. #### All classes @@ -346,6 +346,10 @@ Class: `Cardinity\Exception\InvalidAttributeValue` Methods: - `getViolations()` returns list of validation violations +#### Response mapping to result object failure +Class: `Cardinity\Exception\ResultObjectInterfacePropertyNotFound` +Got unexpected response? Response object changed? + #### Unexpected error Class: `Cardinity\Exception\UnexpectedError` @@ -358,12 +362,13 @@ Catching this exception ensures that you handle all cardinity failure use cases. ### Debug, log request/response `Client::create()` accepts second argument, which defines the logger. -Available values: `Client::LOG_NONE` or PSR-3 `LoggerInterface`. +Available values: `Client::LOG_NONE`, `Client::LOG_DEBUG` or PSR-3 `LoggerInterface`. - `Client::LOG_NONE` - log disabled. +- `Client::LOG_DEBUG` - logs request/response with direct output to the screen. - `LoggerInterface` - custom logger implementation, for eg. `Monolog`. ```php -$client = Client::create($config, Client::LOG_NONE); +$client = Client::create($config, Client::LOG_DEBUG); ``` ### Use Monolog for logging diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist index badbd18809e..1fd9f2863d7 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/phpunit.xml.dist @@ -2,21 +2,23 @@ + backupGlobals = "false" + backupStaticAttributes = "false" + colors = "true" + convertErrorsToExceptions = "true" + convertNoticesToExceptions = "true" + convertWarningsToExceptions = "true" + processIsolation = "false" + stopOnFailure = "false" + syntaxCheck = "false" + bootstrap = "vendor/autoload.php" + mapTestClassNameToCoveredClassName = "true" + forceCoversAnnotation = "false"> - - + + diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php index 37fe4c52ca4..4ff4dfeea30 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/ClientSpec.php @@ -9,6 +9,7 @@ use Cardinity\Method\Payment\Payment; use Cardinity\Method\ResultObjectMapperInterface; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class ClientSpec extends ObjectBehavior { @@ -198,4 +199,6 @@ function it_performs_request_without_validation( $this->callNoValidate($method)->shouldReturn($resultObject); } + + } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php index 031d0d887d9..8c201b7ed26 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/DeclinedSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class DeclinedSpec extends ObjectBehavior { @@ -14,7 +15,7 @@ function let(\RuntimeException $exception, ResultObject $error) $error ); } - + function it_is_initializable() { $this->shouldHaveType('Cardinity\Exception\Declined'); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php index 0196eff1251..0322a076152 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ForbiddenSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Exception; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class ForbiddenSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php index cbc9598f631..9d35c32203d 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InternalServerErrorSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class InternalServerErrorSpec extends ObjectBehavior { @@ -14,7 +15,7 @@ function let(\RuntimeException $exception, ResultObject $error) $error ); } - + function it_should_extend_request() { $this->shouldHaveType('Cardinity\Exception\Request'); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php index 03867c377ea..7bea5f5f0bf 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/InvalidAttributeValueSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Exception; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; use Symfony\Component\Validator\ConstraintViolationList; class InvalidAttributeValueSpec extends ObjectBehavior diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php index 4e62a9edbb6..fdddf4db548 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/MethodNotAllowedSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class MethodNotAllowedSpec extends ObjectBehavior { @@ -14,7 +15,7 @@ function let(\RuntimeException $exception, ResultObject $error) $error ); } - + function it_is_initializable() { $this->shouldHaveType('Cardinity\Exception\MethodNotAllowed'); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php index 47f139004ff..2fcc9b6dd3f 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotAcceptableSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class NotAcceptableSpec extends ObjectBehavior { @@ -14,7 +15,7 @@ function let(\RuntimeException $exception, ResultObject $error) $error ); } - + function it_is_initializable() { $this->shouldHaveType('Cardinity\Exception\NotAcceptable'); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php index a00d66a46cd..b632984f2dd 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/NotFoundSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class NotFoundSpec extends ObjectBehavior { @@ -14,7 +15,7 @@ function let(\RuntimeException $exception, ResultObject $error) $error ); } - + function it_is_initializable() { $this->shouldHaveType('Cardinity\Exception\NotFound'); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php index 33a8174f9f0..7008fe39de5 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestSpec.php @@ -5,6 +5,7 @@ use Cardinity\Method\Error; use Cardinity\Method\Payment\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class RequestSpec extends ObjectBehavior { @@ -57,17 +58,21 @@ function it_should_have_message_containing_response_data() $this->getMessage()->shouldEndWith($string); } - function it_returns_errors_from_error_result_object() + function it_returns_erros_from_error_result_object() { $this->getErrors()->shouldReturn($this->result['errors']); } function it_returns_errors_as_string() { - $this->getErrorsAsString()->shouldReturn("currency: invalid or unsupported currency ('EGR' given);\npayment_instrument.exp_month: must be between 1 and 12 ('13' given);"); + $this + ->getErrorsAsString() + ->shouldReturn("currency: invalid or unsupported currency ('EGR' given); +payment_instrument.exp_month: must be between 1 and 12 ('13' given);") + ; } - function it_returns_errors_from_payment_result_object(\RuntimeException $exception) + function it_returns_erros_from_payment_result_object(\RuntimeException $exception) { $msg = 'Payment error'; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php index 27b269ad879..9d5daa3f33f 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/RequestTimeoutSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class RequestTimeoutSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php index 60f27ada78a..cafecc70e6f 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ServiceUnavailableSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class ServiceUnavailableSpec extends ObjectBehavior { @@ -14,7 +15,7 @@ function let(\RuntimeException $exception, ResultObject $error) $error ); } - + function it_is_initializable() { $this->shouldHaveType('Cardinity\Exception\ServiceUnavailable'); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php index 7f4ad3f9d37..2772fb7e933 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnauthorizedSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class UnauthorizedSpec extends ObjectBehavior { @@ -14,7 +15,7 @@ function let(\RuntimeException $exception, ResultObject $error) $error ); } - + function it_is_initializable() { $this->shouldHaveType('Cardinity\Exception\Unauthorized'); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php index 4280a54be1b..1799c0c3577 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedErrorSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Exception; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class UnexpectedErrorSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php index 1cccb794fb9..16d3e2f24e6 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/UnexpectedResponseSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class UnexpectedResponseSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php index d1e7b542bd2..61de3a75336 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Exception/ValidationFailedSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\ResultObject; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class ValidationFailedSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php index 38c0e885075..7f5194676c4 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ClientAdapterSpec.php @@ -2,21 +2,31 @@ namespace spec\Cardinity\Http\Guzzle; +use Cardinity\Exception; use Cardinity\Http\ClientInterface; use Cardinity\Http\Guzzle\ExceptionMapper; use Cardinity\Method\MethodInterface; use GuzzleHttp\Client; use GuzzleHttp\Exception\ClientException; -use Psr\Http\Message\ResponseInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Message\RequestInterface; +use GuzzleHttp\Message\ResponseInterface; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class ClientAdapterSpec extends ObjectBehavior { function let( Client $client, - ExceptionMapper $mapper + ExceptionMapper $mapper, + RequestInterface $request ) { $this->beConstructedWith($client, $mapper); + + $client + ->createRequest('POST', 'https://api.cardinity.com/v1/', []) + ->willReturn($request) + ; } function it_is_initializable() @@ -27,15 +37,16 @@ function it_is_initializable() function it_sends_post_and_returns_result( MethodInterface $method, Client $client, + RequestInterface $request, ResponseInterface $response ) { $response - ->getBody() + ->json() ->shouldBeCalled() - ->willReturn(json_encode(['foo' => 'bar'])) + ->willReturn(['foo' => 'bar']) ; $client - ->request('POST', 'https://api.cardinity.com/v1/', []) + ->send($request) ->shouldBeCalled() ->willReturn($response) ; @@ -48,11 +59,12 @@ function it_sends_post_and_returns_result( function it_wraps_client_exceptions_with_ours( MethodInterface $method, ClientInterface $client, + RequestInterface $request, ExceptionMapper $mapper, ClientException $exception ) { $client - ->request('POST', 'https://api.cardinity.com/v1/', []) + ->send($request) ->willThrow($exception->getWrappedObject()) ; $mapper @@ -69,11 +81,12 @@ function it_wraps_client_exceptions_with_ours( function it_handles_unexpected_exceptions( MethodInterface $method, ClientInterface $client, + RequestInterface $request, \Exception $exception ) { $client - ->request('POST', 'https://api.cardinity.com/v1/', []) + ->send($request) ->willThrow($exception->getWrappedObject()) ; $this diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php index eeb96faa515..6f35625ec0c 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Http/Guzzle/ExceptionMapperSpec.php @@ -7,9 +7,10 @@ use Cardinity\Method\Payment\Payment; use Cardinity\Method\ResultObjectMapperInterface; use GuzzleHttp\Exception\ClientException; -use GuzzleHttp\Psr7\Request; -use GuzzleHttp\Psr7\Response; +use GuzzleHttp\Message\Request; +use GuzzleHttp\Message\Response; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class ExceptionMapperSpec extends ObjectBehavior { @@ -33,14 +34,14 @@ function it_maps_expected_exception_code( Response $response, MethodInterface $method ) { - $result = []; - + $response->json()->willReturn([]); $response->getStatusCode()->willReturn(400); - $response->getBody()->willReturn(json_encode($result)); - $exception->getResponse()->willReturn($response); - $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\ValidationFailed'); + $this + ->get($exception, $method) + ->shouldReturnAnInstanceOf('Cardinity\Exception\ValidationFailed') + ; } function it_handles_unexpected_exception_code( @@ -48,14 +49,14 @@ function it_handles_unexpected_exception_code( Response $response, MethodInterface $method ) { - $result = []; - + $response->json()->willReturn([]); $response->getStatusCode()->willReturn(999); - $response->getBody()->willReturn(json_encode($result)); - $exception->getResponse()->willReturn($response); - - $this->get($exception, $method)->shouldReturnAnInstanceOf('Cardinity\Exception\UnexpectedResponse'); + + $this + ->get($exception, $method) + ->shouldReturnAnInstanceOf('Cardinity\Exception\UnexpectedResponse') + ; } function it_maps_error_response_to_error_result_object( @@ -68,14 +69,22 @@ function it_maps_error_response_to_error_result_object( $resultObject = new Error(); $response->getStatusCode()->willReturn(400); - $response->getBody()->willReturn(json_encode($result)); + $response->json()->willReturn($result); $method->createResultObject()->willReturn($resultObject); $exception->getResponse()->willReturn($response); - $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $this->get($exception, $method)->getResult()->shouldReturn($resultObject); + $resultMapper + ->map($result, $resultObject) + ->shouldBeCalled() + ->willReturn($resultObject) + ; + + $this + ->get($exception, $method) + ->getResult() + ->shouldReturn($resultObject) + ; } function it_maps_declined_response_402_to_payment_result_object( @@ -88,13 +97,21 @@ function it_maps_declined_response_402_to_payment_result_object( $resultObject = new Payment(); $response->getStatusCode()->willReturn(402); - $response->getBody()->willReturn(json_encode($result)); + $response->json()->willReturn($result); $method->createResultObject()->willReturn($resultObject); $exception->getResponse()->willReturn($response); - $resultMapper->map($result, $resultObject)->shouldBeCalled()->willReturn($resultObject); - - $this->get($exception, $method)->getResult()->shouldReturn($resultObject); + $resultMapper + ->map($result, $resultObject) + ->shouldBeCalled() + ->willReturn($resultObject) + ; + + $this + ->get($exception, $method) + ->getResult() + ->shouldReturn($resultObject) + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php index 9d0c2fd3585..11ed235feec 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ErrorSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class ErrorSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php index 8bf92353da3..87386f4339c 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/AuthorizationInformationSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class AuthorizationInformationSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php index a7d84069adc..c0b6c0fd356 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/CreateSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class CreateSpec extends ObjectBehavior { @@ -10,26 +11,6 @@ class CreateSpec extends ObjectBehavior function let() { - $browserInfo = [ - 'accept_header' => 'Some header', - 'browser_language' => 'LT', - 'screen_width' => 390, - 'screen_height' => 400, - 'challenge_window_size' => '390x400', - 'user_agent' => 'super user agent', - 'color_depth' => 24, - 'time_zone' => -60, - // 'ip_address' => '192.168.0.1', - ]; - $billingAddress = [ - 'address_line1' => 'first address line', - 'city' => 'balbieriskis', - 'country' => 'LT', - 'postal_code' => '0234' - ]; - $threeds2Data['notification_url'] = 'http://localhost:8000/3dsv2_callback.php'; - $threeds2Data['browser_info'] = $browserInfo; - $this->options = [ 'amount' => 12.99, 'currency' => 'EUR', @@ -45,7 +26,6 @@ function let() 'cvc' => '456', 'holder' => 'Mr Tester', ], - 'threeds2_data' => $threeds2Data ]; $this->beConstructedWith($this->options); } @@ -77,11 +57,16 @@ function it_has_body() function it_creates_result_object() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php index dbba8c38c0e..294c15a6508 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/FinalizeSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class FinalizeSpec extends ObjectBehavior { @@ -46,11 +47,16 @@ function it_has_body() function it_creates_result_object() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php index 332a551bc7e..76a5512bbb9 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetAllSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class GetAllSpec extends ObjectBehavior { @@ -40,11 +41,16 @@ function it_has_body() function it_has_create_result() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php index 09a27f38f27..4a933f53731 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/GetSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class GetSpec extends ObjectBehavior { @@ -40,11 +41,16 @@ function it_has_query() function it_creates_result_object() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Payment\Payment') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php index 3009058caf2..e656d7ca5f9 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentCardSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class PaymentInstrumentCardSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php index c3ae7f82fcc..d0b9c216171 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentInstrumentRecurringSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Payment; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class PaymentInstrumentRecurringSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php index d2a0532fa78..086cfeb71b6 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/PaymentSpec.php @@ -3,8 +3,8 @@ namespace spec\Cardinity\Method\Payment; use Cardinity\Method\Payment\AuthorizationInformation; -use Cardinity\Method\Payment\ThreeDS2AuthorizationInformation; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class PaymentSpec extends ObjectBehavior { @@ -44,13 +44,13 @@ function it_is_able_to_unserialize_authorization_information() function it_is_able_to_unserialize_card_payment_instrument() { - $json = '{"payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":2024,"exp_month":5,"holder":"John Smith"}}'; + $json = '{"payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":2017,"exp_month":5,"holder":"John Smith"}}'; $this->unserialize($json); $this->getPaymentMethod()->shouldReturn('card'); $this->getPaymentInstrument()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard'); $this->getPaymentInstrument()->getCardBrand()->shouldReturn('Visa'); - $this->getPaymentInstrument()->getExpYear()->shouldReturn(2024); + $this->getPaymentInstrument()->getExpYear()->shouldReturn(2017); } function it_is_able_to_unserialize_recurring_payment_instrument() @@ -63,35 +63,6 @@ function it_is_able_to_unserialize_recurring_payment_instrument() $this->getPaymentInstrument()->getPaymentId()->shouldReturn('ba3119f2-9a73'); } - - function it_is_able_to_take_threeds2_data() - { - - $tds2Auth = new ThreeDS2AuthorizationInformation(); - $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); - $tds2Auth->setCreq('eyJyZXR1c...'); - - $this->setThreeds2Data($tds2Auth); - $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); - $this->getThreeds2Data()->shouldReturn($tds2Auth); - - } - - function it_is_able_to_serialize_tdsv2(){ - $json = '{"acs_url":"https:\/\/acs.cardinity.com\/v2\/","c_req":"eyJyZXR1c..."}'; - - $tds2Auth = new ThreeDS2AuthorizationInformation(); - $tds2Auth->setAcsUrl('https://acs.cardinity.com/v2/'); - $tds2Auth->setCreq('eyJyZXR1c...'); - - $this->setThreeds2Data($tds2Auth); - $this->getThreeds2Data()->shouldReturnAnInstanceOf('Cardinity\Method\Payment\ThreeDS2AuthorizationInformation'); - $this->getThreeds2Data()->shouldReturn($tds2Auth); - - $this->getThreeds2Data()->serialize()->shouldReturn($json); - } - - function it_handles_unexpected_values() { $json = '{"payment_instrument":{"payment_id":"ba3119f2-9a73"}}'; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php deleted file mode 100644 index c6c18dfe907..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Payment/ThreeDS2AuthorizationInformationSpec.php +++ /dev/null @@ -1,41 +0,0 @@ -tds2_data['acs_url'] = 'http://mynotifactionurl.com'; - $this->tds2_data['creq'] = "asdf123xcxzcv"; - - $this->setAcsUrl($this->tds2_data['acs_url']); - $this->setCReq($this->tds2_data['creq']); - } - - function it_is_initalizable(){ - $this->shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_contains_acs_url() - { - $this->getAcsUrl()->shouldReturn($this->tds2_data['acs_url']); - } - - function it_contains_creq() - { - $this->getCReq()->shouldReturn($this->tds2_data['creq']); - } - - - - - - -} - - diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php index 77162e53a23..5f84e23676b 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/CreateSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Refund; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class CreateSpec extends ObjectBehavior { @@ -56,11 +57,16 @@ function it_has_body() function it_creates_result_object() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php index 22f662e9162..3f52a8bfc62 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetAllSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Refund; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class GetAllSpec extends ObjectBehavior { @@ -42,11 +43,16 @@ function it_has_query() function it_has_create_result() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php index 0e9a297412d..358aca225f9 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/GetSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Refund; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class GetSpec extends ObjectBehavior { @@ -48,11 +49,16 @@ function it_has_query() function it_creates_result_object() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Refund\Refund') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php index f9d43d10635..096e913fce5 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Refund/RefundSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Refund; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class RefundSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php index 6f3b185b6b7..1b58ddd8b58 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ResultObjectMapperSpec.php @@ -1,19 +1,21 @@ shouldImplement('Cardinity\Method\ResultObjectMapper'); + $this->shouldImplement('Cardinity\ResultObjectMapperInterface'); } function it_maps_array_to_object(Payment $object) @@ -29,6 +31,18 @@ function it_maps_array_to_object(Payment $object) $this->map($data, $object); } + function it_throws_exception_if_object_property_not_found(Payment $object) + { + $data = [ + 'randomField' => 'randomValue', + ]; + + $this + ->shouldThrow('Cardinity\Exception\ResultObjectInterfacePropertyNotFound') + ->duringMap($data, $object) + ; + } + function it_maps_card_payment_instrument(Payment $payment) { $data = [ @@ -36,8 +50,8 @@ function it_maps_card_payment_instrument(Payment $payment) 'payment_instrument' => [ 'card_brand' => 'Visa', 'pan' => '0067', - 'exp_year' => 2021, - 'exp_month' => 12, + 'exp_year' => 2016, + 'exp_month' => 11, 'holder' => 'Mike Dough' ], ]; @@ -45,8 +59,8 @@ function it_maps_card_payment_instrument(Payment $payment) $instrument = new PaymentInstrumentCard(); $instrument->setCardBrand('Visa'); $instrument->setPan('0067'); - $instrument->setExpYear(2021); - $instrument->setExpMonth(12); + $instrument->setExpYear(2016); + $instrument->setExpMonth(11); $instrument->setHolder('Mike Dough'); $payment->setPaymentMethod('card')->shouldBeCalled(); @@ -80,7 +94,10 @@ function it_throws_exception_for_unknown_payment_method(Payment $payment) 'payment_instrument' => [], ]; - $this->shouldThrow('Cardinity\Exception\Runtime')->duringMap($data, $payment); + $this + ->shouldThrow('Cardinity\Exception\Runtime') + ->duringMap($data, $payment) + ; } function it_maps_authorization_information(Payment $payment) @@ -101,13 +118,17 @@ function it_maps_authorization_information(Payment $payment) $this->map($data, $payment); } - function it_maps_data_collection(MethodResultCollectionInterface $method, Payment $object) + function it_maps_data_collection(ResultCollectionInterface $method, Payment $object) { $data = [ ['id' => 32, 'type' => 'my_type'], ]; - $method->createResultObject()->shouldBeCalled()->willReturn($object); + $method + ->createResultObject() + ->shouldBeCalled() + ->willReturn($object) + ; $object->setId(32)->shouldBeCalled(); $object->setType('my_type')->shouldBeCalled(); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php index b94a2323099..c549073b008 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/CreateSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Settlement; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class CreateSpec extends ObjectBehavior { @@ -56,11 +57,16 @@ function it_has_body() function it_creates_result_object() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php index 8d17d7199ed..c04dbf097a6 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetAllSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Settlement; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class GetAllSpec extends ObjectBehavior { @@ -42,11 +43,16 @@ function it_has_query() function it_has_create_result() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php index cda82405141..f87ee92658f 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/GetSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Settlement; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class GetSpec extends ObjectBehavior { @@ -48,11 +49,16 @@ function it_has_query() function it_creates_result_object() { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement'); + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Settlement\Settlement') + ; } function it_has_validation_constraints() { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php index 4175040b073..d8f30dfdbb9 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Settlement/SettlementSpec.php @@ -3,6 +3,7 @@ namespace spec\Cardinity\Method\Settlement; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; class SettlementSpec extends ObjectBehavior { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php index 8b7d9a9da9d..73230738f8e 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/ValidatorSpec.php @@ -4,6 +4,7 @@ use Cardinity\Method\MethodInterface; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -19,8 +20,10 @@ function it_implements_validator_interface() $this->shouldImplement('Cardinity\Method\ValidatorInterface'); } - function it_validates_given_method_instance(MethodInterface $method, ValidatorInterface $validator) - { + function it_validates_given_method_instance( + MethodInterface $method, + ValidatorInterface $validator + ) { $attributes = ['field' => 'value']; $constraints = ['constraints']; @@ -46,13 +49,21 @@ function it_throws_exception_on_validation_failure( $violations->count()->willReturn(1); $violations->__toString()->willReturn(''); - $validator->validate($attributes, $constraints)->willReturn($violations); + $validator + ->validate($attributes, $constraints) + ->willReturn($violations) + ; - $this->shouldThrow('Cardinity\Exception\InvalidAttributeValue')->duringValidate($method); + $this + ->shouldThrow('Cardinity\Exception\InvalidAttributeValue') + ->duringValidate($method) + ; } - function it_does_not_validate_method_with_no_constraints(MethodInterface $method, ValidatorInterface $validator) - { + function it_does_not_validate_method_with_no_constraints( + MethodInterface $method, + ValidatorInterface $validator + ) { $constraints = []; $method->getValidationConstraints()->shouldBeCalled()->willReturn($constraints); @@ -61,4 +72,5 @@ function it_does_not_validate_method_with_no_constraints(MethodInterface $method $this->validate($method); } -} +} + \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php deleted file mode 100644 index c84260d372d..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/CreateSpec.php +++ /dev/null @@ -1,62 +0,0 @@ -beConstructedWith($this->paymentId, $this->description); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_contains_loaded_options() - { - $this->getAttributes()->shouldReturn([ - 'description' => $this->description, - ]); - } - - function it_does_not_contain_optional_properties() - { - $this->beConstructedWith($this->paymentId); - - $this->getAttributes()->shouldReturn([]); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - sprintf('payments/%s/voids', $this->paymentId) - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('POST'); - } - - function it_has_body() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php deleted file mode 100644 index 6cccb6bb261..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetAllSpec.php +++ /dev/null @@ -1,50 +0,0 @@ -beConstructedWith($this->paymentId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn('payments/' . $this->paymentId . '/voids'); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_has_create_result() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php deleted file mode 100644 index e41c5297b71..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/GetSpec.php +++ /dev/null @@ -1,58 +0,0 @@ -beConstructedWith($this->paymentId, $this->voidId); - } - - function it_is_initializable() - { - $this->shouldImplement('Cardinity\Method\MethodInterface'); - } - - function it_has_payment_id() - { - $this->getPaymentId()->shouldReturn($this->paymentId); - } - - function it_has_settlement_id() - { - $this->getvoidId()->shouldReturn($this->voidId); - } - - function it_has_action() - { - $this->getAction()->shouldReturn( - 'payments/' . $this->paymentId . '/voids/' . $this->voidId - ); - } - - function it_has_method() - { - $this->getMethod()->shouldReturn('GET'); - } - - function it_has_query() - { - $this->getAttributes()->shouldBeArray(); - } - - function it_creates_result_object() - { - $this->createResultObject()->shouldReturnAnInstanceOf('Cardinity\Method\VoidPayment\VoidPayment'); - } - - function it_has_validation_constraints() - { - $this->getValidationConstraints()->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php deleted file mode 100644 index 080ba892ce6..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/VoidPayment/VoidPaymentSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldImplement('Cardinity\Method\ResultObjectInterface'); - } - - function it_is_serializable() - { - $this->shouldImplement('\Serializable'); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php index bd18aa9144f..03fa36a3cbd 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Client.php @@ -6,17 +6,14 @@ use Cardinity\Http\Guzzle; use Cardinity\Method\MethodInterface; use Cardinity\Method\MethodResultCollectionInterface; -use Cardinity\Method\ResultObjectInterface; use Cardinity\Method\ResultObjectMapper; use Cardinity\Method\ResultObjectMapperInterface; use Cardinity\Method\Validator; use Cardinity\Method\ValidatorInterface; -use GuzzleHttp\HandlerStack; -use GuzzleHttp\Middleware; -use GuzzleHttp\MessageFormatter; +use GuzzleHttp\Subscriber\Log\Formatter; +use GuzzleHttp\Subscriber\Log\LogSubscriber; use GuzzleHttp\Subscriber\Oauth\Oauth1; use Symfony\Component\Validator\Validation; -use Symfony\Component\Validator\Constraints\Url; class Client { @@ -49,48 +46,40 @@ class Client * 'consumerKey' => 'foo', * 'consumerSecret' => 'bar', * ] - * @param LoggerInterface $logger Logs messages. + * @param mixed $logger Logger used to log + * messages. Pass a LoggerInterface to use a PSR-3 logger. Pass a + * callable to log messages to a function that accepts a string of + * data. Pass a resource returned from ``fopen()`` to log to an open + * resource. Pass null or leave empty to write log messages using + * ``echo()``. * @return self */ public static function create(array $options = [], $logger = Client::LOG_NONE) { - $oauth = new Oauth1([ - 'token_secret' => '', - 'consumer_key' => $options['consumerKey'], - 'consumer_secret' => $options['consumerSecret'] + $client = new \GuzzleHttp\Client([ + 'base_url' => self::$url, + 'defaults' => ['auth' => 'oauth'] ]); - $validator = Validation::createValidator(); - - if(isset($options['apiEndpoint'])){ - self::validateClientEndpoint($options, $validator); - self::$url = $options['apiEndpoint']; + if ($logger !== false) { + $subscriber = new LogSubscriber($logger, Formatter::DEBUG); + $client->getEmitter()->attach($subscriber); } - $stack = HandlerStack::create(); - $stack->push($oauth); - - if (!empty($logger)) { - $stack->push( - Middleware::log($logger, new MessageFormatter(MessageFormatter::DEBUG)) - ); - } - - $client = new \GuzzleHttp\Client([ - 'base_uri' => self::$url, - 'handler' => $stack, - 'auth' => 'oauth' + $oauth = new Oauth1([ + 'consumer_key' => $options['consumerKey'], + 'consumer_secret' => $options['consumerSecret'] ]); + $client->getEmitter()->attach($oauth); $mapper = new ResultObjectMapper(); return new self( new Guzzle\ClientAdapter($client, new Guzzle\ExceptionMapper($mapper)), - new Validator($validator), + new Validator(Validation::createValidator()), $mapper ); } - /** * @param ClientInterface $client * @param ValidatorInterface $validator @@ -193,23 +182,4 @@ private function prepareAttributes(array $data) return $data; } - - /** - * Validate endPoint is a valid URL - * - * @param [array] $options - * @param [Validator] $validator - * @return void - */ - private static function validateClientEndpoint($options, $validator){ - $violations = $validator->validate($options['apiEndpoint'], [ - new Url(), - ]); - if(count($violations) != 0){ - throw new Exception\InvalidAttributeValue( - 'Your API endpoint is not a valid URL', - $violations - ); - } - } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Request.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Request.php index 7cdc65a208b..912fea6371f 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Request.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/Request.php @@ -8,7 +8,7 @@ class Request extends Runtime { /** @type ResultObjectInterface */ private $result; - + /** * @param \Exception $previous * @param ResultObjectInterface $result diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ResultObjectPropertyNotFound.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ResultObjectPropertyNotFound.php index 405d95b37bb..d2bb4a6e33d 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ResultObjectPropertyNotFound.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/ResultObjectPropertyNotFound.php @@ -2,7 +2,8 @@ namespace Cardinity\Exception; -class ResultObjectPropertyNotFound extends Runtime -{ +use Symfony\Component\Validator\ConstraintViolationListInterface; +class ResultObjectInterfacePropertyNotFound extends Runtime +{ } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedError.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedError.php index 22cce28f0aa..ff958ba22ea 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedError.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Exception/UnexpectedError.php @@ -4,5 +4,4 @@ class UnexpectedError extends Runtime { - } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/ClientInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/ClientInterface.php index 1f36c5f3972..3f457c956f4 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/ClientInterface.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/ClientInterface.php @@ -1,5 +1,4 @@ client->request($requestMethod, $url, $options); - return json_decode($response->getBody(), true); + $response = $this->client->send( + $this->client->createRequest($requestMethod, $url, $options) + ); + return $response->json(); } catch (ClientException $e) { throw $this->mapper->get($e, $method); } catch (\Exception $e) { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php index b1d772fde66..24ba1eb9719 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Http/Guzzle/ExceptionMapper.php @@ -2,6 +2,7 @@ namespace Cardinity\Http\Guzzle; +use Cardinity\Exception; use Cardinity\Method\Error; use Cardinity\Method\MethodInterface; use Cardinity\Method\ResultObjectMapperInterface; @@ -69,9 +70,9 @@ private function getMap() ]; } - private function create($class, ClientException $exception, MethodInterface $method) + private function create($class, $exception, MethodInterface $method) { - $response = json_decode($exception->getResponse()->getBody(), true); + $response = $exception->getResponse()->json(); // map declined response to result object if ($exception->getCode() == 402) { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php index ceb3fd93d48..4711464cc59 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Error.php @@ -6,19 +6,19 @@ class Error extends ResultObject { /** @type string URL to error’s documentation page */ private $type; - + /** @type string Title of an error */ private $title; - + /** @type string HTTP response code */ private $status; - + /** @type string Human readable information about the error */ private $detail; /** @type array Optional. In case of validation errors all the fields with incorrect information are returned. */ private $errors = []; - + /** * Gets the value of type. * @return mixed @@ -27,7 +27,7 @@ public function getType() { return $this->type; } - + /** * Sets the value of type. * @param mixed $type the type @@ -37,7 +37,7 @@ public function setType($type) { $this->type = $type; } - + /** * Gets the value of title. * @return mixed @@ -46,7 +46,7 @@ public function getTitle() { return $this->title; } - + /** * Sets the value of title. * @param mixed $title the title @@ -56,7 +56,7 @@ public function setTitle($title) { $this->title = $title; } - + /** * Gets the value of status. * @return mixed @@ -65,7 +65,7 @@ public function getStatus() { return $this->status; } - + /** * Sets the value of status. * @param mixed $status the status @@ -75,7 +75,7 @@ public function setStatus($status) { $this->status = $status; } - + /** * Gets the value of detail. * @return mixed @@ -84,7 +84,7 @@ public function getDetail() { return $this->detail; } - + /** * Sets the value of detail. * @param mixed $detail the detail @@ -94,7 +94,7 @@ public function setDetail($detail) { $this->detail = $detail; } - + /** * Gets the value of errors. * @return array @@ -103,7 +103,7 @@ public function getErrors() { return $this->errors; } - + /** * Sets the value of errors. * @param array $errors the errors diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php index d494ab8731c..0ca3889fd20 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/MethodInterface.php @@ -1,5 +1,4 @@ url; } - + /** * Sets the value of url. * @param mixed $url the url @@ -34,7 +34,7 @@ public function setUrl($url) { $this->url = $url; } - + /** * Gets the value of data. * @return mixed @@ -43,7 +43,7 @@ public function getData() { return $this->data; } - + /** * Sets the value of data. * @param mixed $data the data diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php index 817c6b074bf..1e0fe9030ae 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Create.php @@ -4,8 +4,6 @@ use Cardinity\Method\MethodInterface; use Symfony\Component\Validator\Constraints as Assert; -use Cardinity\Method\Validators\CallbackUrlConstraint; - class Create implements MethodInterface { @@ -14,28 +12,27 @@ class Create implements MethodInterface private $attributes; - public function __construct(array $attributes) { $this->attributes = $attributes; } - public function getAction(): string + public function getAction() { return 'payments'; } - public function getMethod(): string + public function getMethod() { return MethodInterface::POST; } - public function getAttributes(): array + public function getAttributes() { return $this->attributes; } - public function createResultObject(): Payment + public function createResultObject() { return new Payment(); } @@ -43,18 +40,39 @@ public function createResultObject(): Payment public function getValidationConstraints() { return new Assert\Collection([ - 'amount' => $this->buildElement('float', 1), - 'currency' => $this->buildElement('string', 1, ['min' => 3,'max' => 3]), - 'settle' => $this->buildElement('bool'), - 'order_id' => $this->buildElement('string', 0, ['min' => 2,'max' => 50]), - 'description' => $this->buildElement('string', 0, ['max' => 255]), - 'statement_descriptor_suffix' => $this->buildElement('string', 0, ['max' => 25]), - 'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]), - 'payment_method' => new Assert\Required([ - new Assert\Type([ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' + 'amount' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'float']) + ]), + 'currency' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'min' => 3, + 'max' => 3 ]), + ]), + 'settle' => new Assert\Optional([ + new Assert\Type(['type' => 'bool']) + ]), + 'order_id' => new Assert\Optional([ + new Assert\Type(['type' => 'string']) + ]), + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + 'country' => new Assert\Required([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'min' => 2, + 'max' => 2 + ]), + ]), + 'payment_method' => new Assert\Required([ + new Assert\Type(['type' => 'string']), new Assert\Choice([ 'choices' => [ self::CARD, @@ -65,13 +83,10 @@ public function getValidationConstraints() 'payment_instrument' => $this->getPaymentInstrumentConstraints( $this->getAttributes()['payment_method'] ), - 'threeds2_data' => new Assert\Optional( - $this->getThreeDS2DataConstraints() - ) ]); } - private function getPaymentInstrumentConstraints($method): ?object + private function getPaymentInstrumentConstraints($method) { switch ($method) { case self::CARD: @@ -80,18 +95,39 @@ private function getPaymentInstrumentConstraints($method): ?object new Assert\NotBlank(), new Assert\Luhn() ]), - 'exp_year' => $this->buildElement( - 'integer', 1, - ['min' => 4,'max' => 4], - new Assert\Range(['min' => date('Y')]) - ), - 'exp_month' => $this->buildElement('integer', 1), - 'cvc' => $this->buildElement('string', 1, ['min' => 3, 'max' => 4]), - 'holder' => $this->buildElement('string', 1, ['max' => 32]), + 'exp_year' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'integer']), + new Assert\Length([ + 'min' => 4, + 'max' => 4 + ]), + new Assert\Range([ + 'min' => date('Y') + ]), + ]), + 'exp_month' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'integer']), + ]), + 'cvc' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'string']), + ]), + 'holder' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 32 + ]), + ]), ]); case self::RECURRING: return new Assert\Collection([ - 'payment_id' => $this->buildElement('string', 1), + 'payment_id' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'string']), + ]) ]); } @@ -102,125 +138,4 @@ private function getPaymentInstrumentConstraints($method): ?object ) ); } - - private function getThreeDS2DataConstraints(): object - { - return new Assert\Collection([ - 'notification_url' => $this->getNotificationUrlConstraints(), - 'browser_info' => $this->getBrowserInfoConstraints(), - 'billing_address' => new Assert\Optional( - $this->getAdressConstraints() - ), - 'delivery_address' => new Assert\Optional( - $this->getAdressConstraints() - ), - 'cardholder_info' => new Assert\Optional( - $this->getCardHolderInfoConstraints() - ), - ]); - } - - public function getNotificationUrlConstraints() - { - return new Assert\Required([ - new Assert\NotBlank(), - new Assert\Type([ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]), - new CallbackUrlConstraint(), - new Assert\Url([ - 'message' => 'The protocol of {{ value }} should be "http" or "https".', - 'protocols' => ['http', 'https'], - ]), - ]); - } - - public function getIpAddressConstraints() - { - return new Assert\Optional([ - new Assert\NotBlank(), - new CallbackUrlConstraint(), - new Assert\Type([ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]), - ]); - } - - private function getBrowserInfoConstraints() - { - return new Assert\Collection([ - 'accept_header' => $this->buildElement('string', 1), - 'browser_language' => $this->buildElement('string', 1), - 'screen_width' => $this->buildElement('integer', 1), - 'screen_height' => $this->buildElement('integer', 1), - 'challenge_window_size' => $this->buildElement('string', 1), - 'user_agent' => $this->buildElement('string', 1), - 'color_depth' => $this->buildElement('integer', 1), - 'time_zone' => $this->buildElement('integer', 1), - 'ip_address' => $this->getIpAddressConstraints(), - 'javascript_enabled' => new Assert\Optional($this->buildElement('bool')), - 'java_enabled' => new Assert\Optional($this->buildElement('bool')), - ]); - } - - private function getAdressConstraints(): object - { - return new Assert\Collection([ - 'address_line1' => $this->buildElement('string', 1, ['max' => 50]), - 'address_line2' => new Assert\Optional( - $this->buildElement('string', 1, ['max' => 50]) - ), - 'address_line3' => new Assert\Optional( - $this->buildElement('string', 0, ['max' => 50]) - ), - 'city' => $this->buildElement('string', 1, ['max' => 50]), - 'country' => $this->buildElement('string', 1, ['max' => 10]), - 'postal_code' => $this->buildElement('string', 1, ['max' => 16]), - 'state' => new Assert\Optional( - $this->buildElement('string', 0, ['max' => 14]) - ), - ]); - } - - private function getCardHolderInfoConstraints(): object - { - return new Assert\Collection([ - 'email_address' => new Assert\Optional( - new Assert\Email(['mode' => 'loose']) - ), - 'mobile_phone_number' => new Assert\Optional($this->buildElement('string')), - 'work_phone_number' => new Assert\Optional($this->buildElement('string')), - 'home_phone_number' => new Assert\Optional($this->buildElement('string')), - ]); - } - - private function buildElement( - string $typeValue, - bool $isRequired = false, - array $length = null, - $args = null // TODO can it be null? - ): object - { - $inside_array = $this->getInsideArray($typeValue); - if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); - if ($length) array_push($inside_array, new Assert\Length($length)); - if ($args) array_push($inside_array, $args); - - return $isRequired - ? new Assert\Required($inside_array) - : new Assert\Optional($inside_array) - ; - } - - private function getInsideArray(string $typeValue): array - { - return [ - new Assert\Type([ - 'type' => $typeValue, - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]), - ]; - } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php index d344626515d..b9efa9704c1 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Finalize.php @@ -9,18 +9,11 @@ class Finalize implements MethodInterface { private $paymentId; private $authorizeData; - private $finalizeKey; - - /** - * @param STRING payment ID of the Cardinity system - * @param STRING authorize data 'cres' or 'authorize_data' - * @param BOOL should it be 3D secure v2 ? - */ - public function __construct(string $paymentId, string $authorizeData, $isV2=false) + + public function __construct($paymentId, $authorizeData) { $this->paymentId = $paymentId; $this->authorizeData = $authorizeData; - $this->finalizeKey = $isV2 ? 'cres' : 'authorize_data'; } public function getPaymentId() @@ -51,28 +44,17 @@ public function createResultObject() public function getAttributes() { return [ - $this->finalizeKey => $this->getAuthorizeData(), - $this->paymentId => $this->getPaymentId(), + 'authorize_data' => $this->getAuthorizeData() ]; } public function getValidationConstraints() { - $type_params = [ - 'type' => 'string', - 'message' => 'The value {{ value }} is not a valid {{ type }}.' - ]; return new Assert\Collection([ - 'fields' => [ - $this->finalizeKey => new Assert\Required([ - new Assert\NotBlank(["message"=>"$this->finalizeKey missing."]), - new Assert\Type($type_params) - ]), - $this->paymentId => new Assert\Required([ - new Assert\NotBlank(["message"=>"paymentId missing."]), - new Assert\Type($type_params) - ]), - ], + 'authorize_data' => new Assert\Required([ + new Assert\NotBlank(), + new Assert\Type(['type' => 'string']), + ]) ]); } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php index 4ec5d3cb74f..0170a95e5ee 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Get.php @@ -8,7 +8,7 @@ class Get implements MethodInterface { private $paymentId; - + public function __construct($paymentId) { $this->paymentId = $paymentId; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php index 155f4254ca7..c603bab8381 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/GetAll.php @@ -9,7 +9,7 @@ class GetAll implements MethodResultCollectionInterface { private $limit; - + public function __construct($limit = 10) { $this->limit = $limit; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php index 64f8d32253a..90261f701f8 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/Payment.php @@ -3,8 +3,6 @@ namespace Cardinity\Method\Payment; use Cardinity\Method\ResultObject; -use Cardinity\Method\Payment\ThreeDS2Data; -use Cardinity\Method\Payment\ThreeDS2AuthorizationInformation; class Payment extends ResultObject { @@ -72,8 +70,7 @@ class Payment extends ResultObject */ private $paymentInstrument; - /** @deprecated - * @type string Used to provide additional information (PATCH verb) once + /** @type string Used to provide additional information (PATCH verb) once customer completes authorization process. */ private $authorizeData; @@ -81,14 +78,7 @@ class Payment extends ResultObject payment authorization is needed (i.e. payment status is pending). Value assigned by Cardinity. */ private $authorizationInformation; - - /** @type ThreeDS2AuthorizationInformation */ - private $threeDS2AuthorizationInformation; - - /** @type string a descriptor to include in statement provided by a merchant. limit will vary based on merchant name - Maximum length 25 characters. */ - private $statementDescriptorSuffix; - + /** * Gets the value of id. * @return mixed @@ -97,7 +87,7 @@ public function getId() { return $this->id; } - + /** * Sets the value of id. * @param mixed $id the id @@ -107,7 +97,7 @@ public function setId($id) { $this->id = $id; } - + /** * Gets the value of amount. * @return mixed @@ -116,7 +106,7 @@ public function getAmount() { return $this->amount; } - + /** * Sets the value of amount. * @param mixed $amount the amount @@ -126,7 +116,7 @@ public function setAmount($amount) { $this->amount = $amount; } - + /** * Gets the value of currency. * @return mixed @@ -135,7 +125,7 @@ public function getCurrency() { return $this->currency; } - + /** * Sets the value of currency. * @param mixed $currency the currency @@ -145,7 +135,7 @@ public function setCurrency($currency) { $this->currency = $currency; } - + /** * Gets the value of created. * @return mixed @@ -154,7 +144,7 @@ public function getCreated() { return $this->created; } - + /** * Sets the value of created. * @param mixed $created the created @@ -164,7 +154,7 @@ public function setCreated($created) { $this->created = $created; } - + /** * Gets the value of type. * @return mixed @@ -173,7 +163,7 @@ public function getType() { return $this->type; } - + /** * Sets the value of type. * @param mixed $type the type @@ -183,7 +173,7 @@ public function setType($type) { $this->type = $type; } - + /** * Gets the value of live. * @return mixed @@ -192,7 +182,7 @@ public function getLive() { return $this->live; } - + /** * Sets the value of live. * @param mixed $live the live @@ -202,7 +192,7 @@ public function setLive($live) { $this->live = $live; } - + /** * Gets the value of settle. * @return mixed @@ -211,7 +201,7 @@ public function getSettle() { return $this->settle; } - + /** * Sets the value of settle. * @param mixed $settle the settle @@ -221,7 +211,7 @@ public function setSettle($settle) { $this->settle = $settle; } - + /** * Gets the value of status. * @return mixed @@ -230,7 +220,7 @@ public function getStatus() { return $this->status; } - + /** * Sets the value of status. * @param mixed $status the status @@ -240,7 +230,7 @@ public function setStatus($status) { $this->status = $status; } - + /** * Gets the value of error. * @return mixed @@ -249,7 +239,7 @@ public function getError() { return $this->error; } - + /** * Sets the value of error. * @param mixed $error the error @@ -259,7 +249,7 @@ public function setError($error) { $this->error = $error; } - + /** * Gets the value of orderId. * @return mixed @@ -268,7 +258,7 @@ public function getOrderId() { return $this->orderId; } - + /** * Sets the value of orderId. * @param mixed $orderId the order id @@ -278,7 +268,7 @@ public function setOrderId($orderId) { $this->orderId = $orderId; } - + /** * Gets the value of description. * @return mixed @@ -287,7 +277,7 @@ public function getDescription() { return $this->description; } - + /** * Sets the value of description. * @param mixed $description the description @@ -297,7 +287,7 @@ public function setDescription($description) { $this->description = $description; } - + /** * Gets the value of country. * @return mixed @@ -306,7 +296,7 @@ public function getCountry() { return $this->country; } - + /** * Sets the value of country. * @param mixed $country the country @@ -316,7 +306,7 @@ public function setCountry($country) { $this->country = $country; } - + /** * Gets the value of paymentMethod. * @return mixed @@ -325,7 +315,7 @@ public function getPaymentMethod() { return $this->paymentMethod; } - + /** * Sets the value of paymentMethod. * @param mixed $paymentMethod the payment method @@ -335,7 +325,7 @@ public function setPaymentMethod($paymentMethod) { $this->paymentMethod = $paymentMethod; } - + /** * Gets the value of paymentInstrument. * @return PaymentInstrumentInterface @@ -344,7 +334,7 @@ public function getPaymentInstrument() { return $this->paymentInstrument; } - + /** * Sets the value of paymentInstrument. * @param PaymentInstrumentInterface $paymentInstrument the payment instrument @@ -354,9 +344,8 @@ public function setPaymentInstrument(PaymentInstrumentInterface $paymentInstrume { $this->paymentInstrument = $paymentInstrument; } - + /** - * @deprecated method is deprecated and shouldn't be used. * Gets the value of authorizeData. * @return mixed */ @@ -364,9 +353,8 @@ public function getAuthorizeData() { return $this->authorizeData; } - + /** - * @deprecated method is deprecated and shouldn't be used. * Sets the value of authorizeData. * @param mixed $authorizeData the authorize data * @return void @@ -375,7 +363,7 @@ public function setAuthorizeData($authorizeData) { $this->authorizeData = $authorizeData; } - + /** * Gets the value of authorizationInformation. * @return AuthorizationInformation @@ -384,7 +372,7 @@ public function getAuthorizationInformation() { return $this->authorizationInformation; } - + /** * Sets the value of authorizationInformation. * @param AuthorizationInformation $authorizationInformation the authorization information @@ -395,60 +383,6 @@ public function setAuthorizationInformation(AuthorizationInformation $authorizat $this->authorizationInformation = $authorizationInformation; } - /** - * @return ThreeDS2AuthorizationInformation - */ - public function getThreeds2Data() - { - return $this->threeDS2AuthorizationInformation; - } - - /** - * @param ThreeDS2AuthorizationInformation - * @return VOID - */ - public function setThreeds2Data( - ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation - ){ - $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation; - } - - /** - * Gets the value of statementDescriptorSuffix. - * @return mixed - */ - public function getStatementDescriptorSuffix() - { - return $this->statementDescriptorSuffix; - } - - /** - * Sets the value of statementDescriptorSuffix. - * @param mixed $statementDescriptorSuffix the description included in statement - * @return void - */ - public function setStatementDescriptorSuffix($statementDescriptorSuffix) - { - $this->statementDescriptorSuffix = $statementDescriptorSuffix; - } - - - /** - * @return BOOL is it 3D secure v1? - */ - public function isThreedsV1() : bool - { - return $this->authorizationInformation != null; - } - - /** - * @return BOOL is it 3D secure v2? - */ - public function isThreedsV2() : bool - { - return $this->threeDS2AuthorizationInformation != null; - } - /** * Check if payment is pending * @return boolean @@ -466,13 +400,4 @@ public function isApproved() { return $this->getStatus() === 'approved'; } - - /** - * Check if payment is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php index 35691823cda..8c2575182f4 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentCard.php @@ -15,7 +15,7 @@ class PaymentInstrumentCard extends ResultObject implements PaymentInstrumentInt retrieving an existing payments only last 4 digits are returned. */ private $pan; - /** @type integer Expiration year. 4 digits, e.g. 2021. */ + /** @type integer Expiration year. 4 digits, e.g. 2016. */ private $expYear; /** @type integer Expiration month, e.g. 9. */ @@ -23,7 +23,7 @@ class PaymentInstrumentCard extends ResultObject implements PaymentInstrumentInt /** @type string Card holder’s name. Max length 32 characters. */ private $holder; - + /** * Gets the value of cardBrand. * @return mixed @@ -32,7 +32,7 @@ public function getCardBrand() { return $this->cardBrand; } - + /** * Sets the value of cardBrand. * @param mixed $cardBrand the card brand @@ -42,7 +42,7 @@ public function setCardBrand($cardBrand) { $this->cardBrand = $cardBrand; } - + /** * Gets the value of pan. * @return mixed @@ -51,7 +51,7 @@ public function getPan() { return $this->pan; } - + /** * Sets the value of pan. * @param mixed $pan the pan @@ -61,7 +61,7 @@ public function setPan($pan) { $this->pan = $pan; } - + /** * Gets the value of expYear. * @return mixed @@ -70,7 +70,7 @@ public function getExpYear() { return $this->expYear; } - + /** * Sets the value of expYear. * @param mixed $expYear the exp year @@ -80,7 +80,7 @@ public function setExpYear($expYear) { $this->expYear = $expYear; } - + /** * Gets the value of expMonth. * @return mixed @@ -89,7 +89,7 @@ public function getExpMonth() { return $this->expMonth; } - + /** * Sets the value of expMonth. * @param mixed $expMonth the exp month @@ -99,7 +99,7 @@ public function setExpMonth($expMonth) { $this->expMonth = $expMonth; } - + /** * Gets the value of holder. * @return mixed @@ -108,7 +108,7 @@ public function getHolder() { return $this->holder; } - + /** * Sets the value of holder. * @param mixed $holder the holder diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php index b844435dafe..b6ac06f026d 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentInterface.php @@ -4,5 +4,5 @@ interface PaymentInstrumentInterface { - + } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentRecurring.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentRecurring.php index db156184215..d019854a326 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentRecurring.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/PaymentInstrumentRecurring.php @@ -9,7 +9,7 @@ class PaymentInstrumentRecurring extends ResultObject implements PaymentInstrume /** @type string Id of the approved payment in the past. Same card will be used to create a new payment. */ private $paymentId; - + /** * Gets the value of paymentId. * @return mixed @@ -18,7 +18,7 @@ public function getPaymentId() { return $this->paymentId; } - + /** * Sets the value of paymentId. * @param mixed $paymentId the payment id diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php deleted file mode 100644 index 1511bff380f..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Payment/ThreeDS2AuthorizationInformation.php +++ /dev/null @@ -1,58 +0,0 @@ -acsUrl; - } - - - /** - * @param STRING - * @return VOID - */ - public function setAcsUrl(string $acsUrl) : void - { - $this->acsUrl = $acsUrl; - } - - - /** - * @return STRING - */ - public function getCReq() - { - return $this->cReq; - } - - - /** - * @param STRING - * @return VOID - */ - public function setCReq(string $cReq) : void - { - $this->cReq = $cReq; - } - - public function getErrors() - { - - } -} \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php index eda5e22c8b0..adc6284add4 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Get.php @@ -9,7 +9,7 @@ class Get implements MethodInterface { private $paymentId; private $refundId; - + public function __construct($paymentId, $refundId) { $this->paymentId = $paymentId; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php index 1936fce7d24..2296e4dead0 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/GetAll.php @@ -9,7 +9,7 @@ class GetAll implements MethodResultCollectionInterface { private $paymentId; - + public function __construct($paymentId) { $this->paymentId = $paymentId; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php index 50a14b3e663..e3a4012de2c 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Refund/Refund.php @@ -56,7 +56,7 @@ class Refund extends ResultObject /** @type string Refund description provided by a merchant. Maximum length 255 characters. */ private $description; - + /** * Gets the value of id. * @return mixed @@ -65,7 +65,7 @@ public function getId() { return $this->id; } - + /** * Sets the value of id. * @param mixed $id the id @@ -75,7 +75,7 @@ public function setId($id) { $this->id = $id; } - + /** * Gets the value of amount. * @return mixed @@ -84,7 +84,7 @@ public function getAmount() { return $this->amount; } - + /** * Sets the value of amount. * @param mixed $amount the amount @@ -94,7 +94,7 @@ public function setAmount($amount) { $this->amount = $amount; } - + /** * Gets the value of currency. * @return mixed @@ -103,7 +103,7 @@ public function getCurrency() { return $this->currency; } - + /** * Sets the value of currency. * @param mixed $currency the currency @@ -113,7 +113,7 @@ public function setCurrency($currency) { $this->currency = $currency; } - + /** * Gets the value of type. * @return mixed @@ -122,7 +122,7 @@ public function getType() { return $this->type; } - + /** * Sets the value of type. * @param mixed $type the type @@ -132,7 +132,7 @@ public function setType($type) { $this->type = $type; } - + /** * Gets the value of created. * @return mixed @@ -141,7 +141,7 @@ public function getCreated() { return $this->created; } - + /** * Sets the value of created. * @param mixed $created the created @@ -151,7 +151,7 @@ public function setCreated($created) { $this->created = $created; } - + /** * Gets the value of live. * @return mixed @@ -160,7 +160,7 @@ public function getLive() { return $this->live; } - + /** * Sets the value of live. * @param mixed $live the live @@ -170,7 +170,7 @@ public function setLive($live) { $this->live = $live; } - + /** * Gets the value of parentId. * @return mixed @@ -179,7 +179,7 @@ public function getParentId() { return $this->parentId; } - + /** * Sets the value of parentId. * @param mixed $parentId the parent id @@ -189,7 +189,7 @@ public function setParentId($parentId) { $this->parentId = $parentId; } - + /** * Gets the value of status. * @return mixed @@ -198,7 +198,7 @@ public function getStatus() { return $this->status; } - + /** * Sets the value of status. * @param mixed $status the status @@ -208,7 +208,7 @@ public function setStatus($status) { $this->status = $status; } - + /** * Gets the value of error. * @return mixed @@ -217,7 +217,7 @@ public function getError() { return $this->error; } - + /** * Sets the value of error. * @param mixed $error the error @@ -227,7 +227,7 @@ public function setError($error) { $this->error = $error; } - + /** * Gets the value of orderId. * @return mixed @@ -236,7 +236,7 @@ public function getOrderId() { return $this->orderId; } - + /** * Sets the value of orderId. * @param mixed $orderId the order id @@ -246,7 +246,7 @@ public function setOrderId($orderId) { $this->orderId = $orderId; } - + /** * Gets the value of description. * @return mixed @@ -255,7 +255,7 @@ public function getDescription() { return $this->description; } - + /** * Sets the value of description. * @param mixed $description the description @@ -265,22 +265,4 @@ public function setDescription($description) { $this->description = $description; } - - /** - * Check if refund is approved - * @return boolean - */ - public function isApproved() - { - return $this->getStatus() === 'approved'; - } - - /** - * Check if refund is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php index eb479c9e1ae..006d9e7bc1e 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObject.php @@ -6,7 +6,6 @@ use Cardinity\Method\Payment\AuthorizationInformation; use Cardinity\Method\Payment\PaymentInstrumentCard; use Cardinity\Method\Payment\PaymentInstrumentRecurring; -use Cardinity\Method\Payment\ThreeDS2AuthorizationInformation; abstract class ResultObject implements ResultObjectInterface { @@ -35,7 +34,7 @@ public function getError() /** * Serializes result object to json object * @param boolean $toJson encode result to json - * @return array|object + * @return string */ public function serialize($toJson = true) { @@ -82,25 +81,15 @@ public function unserialize($string) $object = new AuthorizationInformation(); $object->unserialize(json_encode($value)); $value = $object; - } elseif ($property == 'threeds2_data') { - $object = new ThreeDS2AuthorizationInformation(); - $object->unserialize(json_encode($value)); - $value = $object; } elseif ($property == 'payment_instrument') { if (!isset($data->payment_method)) { throw new Exception\Runtime('Property "payment_method" is missing'); } - switch ($data->payment_method) { - case Payment\Create::CARD: - $object = new PaymentInstrumentCard(); - break; - case Payment\Create::RECURRING: - $object = new PaymentInstrumentRecurring(); - break; - default: - $object = new PaymentInstrumentCard(); - break; + if ($data->payment_method == Payment\Create::CARD) { + $object = new PaymentInstrumentCard(); + } elseif ($data->payment_method == Payment\Create::RECURRING) { + $object = new PaymentInstrumentRecurring(); } $object->unserialize(json_encode($value)); $value = $object; @@ -113,7 +102,6 @@ public function unserialize($string) /** * @param string $class - * @return array */ private function classGetters($class) { @@ -133,22 +121,13 @@ private function classGetters($class) }); } - /** - * @param string $method - * @return string - */ private function propertyName($method) { $method = lcfirst(substr($method, 3)); - $method = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $method)); - + $method = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $method)); return $method; } - /** - * @param string $property - * @return string - */ private function setterName($property) { $parts = explode('_', $property); diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapper.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapper.php index b1b2ffc2455..b4b1c673995 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapper.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapper.php @@ -3,10 +3,11 @@ namespace Cardinity\Method; use Cardinity\Exception; +use Cardinity\Method\MethodInterface; +use Cardinity\Method\MethodResultCollectionInterface; use Cardinity\Method\Payment\AuthorizationInformation; use Cardinity\Method\Payment\PaymentInstrumentCard; use Cardinity\Method\Payment\PaymentInstrumentRecurring; -use Cardinity\Method\Payment\ThreeDS2AuthorizationInformation; class ResultObjectMapper implements ResultObjectMapperInterface { @@ -30,7 +31,7 @@ public function mapCollection(array $response, MethodResultCollectionInterface $ /** * Map response data to instance of ResultObjectInterface - * @param array $response + * @param array $response * @param ResultObjectInterface $result * * @return ResultObjectInterface @@ -41,15 +42,19 @@ public function map(array $response, ResultObjectInterface $result) $method = $this->getSetterName($field); if (!method_exists($result, $method)) { - continue; + throw new Exception\ResultObjectInterfacePropertyNotFound( + sprintf( + 'Result object %s property "%s" not found.', + get_class($result), + $field + ) + ); } if ($field == 'payment_instrument') { $value = $this->transformPaymentInstrumentValue($value, $response['payment_method']); } elseif ($field == 'authorization_information') { $value = $this->transformAuthorizationInformationValue($value); - } elseif ($field == 'threeds2_data') { - $value = $this->transformThreeDS2DataValue($value); } $result->$method($value); @@ -107,15 +112,4 @@ private function transformAuthorizationInformationValue($data) return $info; } - - /** - * @param ARRAY $data - * @return ThreeDS2AuthorizationInformation - */ - private function transformThreeDS2DataValue($data) - { - $threeds2 = new ThreeDS2AuthorizationInformation(); - $this->map($data, $threeds2); - return $threeds2; - } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php index f7d9b3c78ee..7cf1e646fea 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ResultObjectMapperInterface.php @@ -5,6 +5,5 @@ interface ResultObjectMapperInterface { public function map(array $response, ResultObjectInterface $result); - public function mapCollection(array $response, MethodResultCollectionInterface $result); } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Create.php index b1986c03d77..d3e069fed95 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Create.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Create.php @@ -10,7 +10,6 @@ class Create implements MethodInterface private $paymentId; private $amount; private $description; - public function __construct($paymentId, $amount, $description = null) { $this->paymentId = $paymentId; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php index 9d14e3a7263..b5a82b45c2d 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Get.php @@ -9,7 +9,7 @@ class Get implements MethodInterface { private $paymentId; private $settlementId; - + public function __construct($paymentId, $settlementId) { $this->paymentId = $paymentId; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php index 937fe0de032..c893f8cfbd9 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/GetAll.php @@ -9,7 +9,7 @@ class GetAll implements MethodResultCollectionInterface { private $paymentId; - + public function __construct($paymentId) { $this->paymentId = $paymentId; diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php index 8443b9f26cc..642871c4a33 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Settlement/Settlement.php @@ -56,7 +56,7 @@ class Settlement extends ResultObject /** @type string Settlement description provided by a merchant. Maximum length 255 characters. */ private $description; - + /** * Gets the value of id. * @return mixed @@ -65,7 +65,7 @@ public function getId() { return $this->id; } - + /** * Sets the value of id. * @param mixed $id the id @@ -75,7 +75,7 @@ public function setId($id) { $this->id = $id; } - + /** * Gets the value of amount. * @return mixed @@ -84,7 +84,7 @@ public function getAmount() { return $this->amount; } - + /** * Sets the value of amount. * @param mixed $amount the amount @@ -94,7 +94,7 @@ public function setAmount($amount) { $this->amount = $amount; } - + /** * Gets the value of currency. * @return mixed @@ -103,7 +103,7 @@ public function getCurrency() { return $this->currency; } - + /** * Sets the value of currency. * @param mixed $currency the currency @@ -113,7 +113,7 @@ public function setCurrency($currency) { $this->currency = $currency; } - + /** * Gets the value of type. * @return mixed @@ -122,7 +122,7 @@ public function getType() { return $this->type; } - + /** * Sets the value of type. * @param mixed $type the type @@ -132,7 +132,7 @@ public function setType($type) { $this->type = $type; } - + /** * Gets the value of created. * @return mixed @@ -141,7 +141,7 @@ public function getCreated() { return $this->created; } - + /** * Sets the value of created. * @param mixed $created the created @@ -151,7 +151,7 @@ public function setCreated($created) { $this->created = $created; } - + /** * Gets the value of live. * @return mixed @@ -160,7 +160,7 @@ public function getLive() { return $this->live; } - + /** * Sets the value of live. * @param mixed $live the live @@ -170,7 +170,7 @@ public function setLive($live) { $this->live = $live; } - + /** * Gets the value of parentId. * @return mixed @@ -179,7 +179,7 @@ public function getParentId() { return $this->parentId; } - + /** * Sets the value of parentId. * @param mixed $parentId the parent id @@ -189,7 +189,7 @@ public function setParentId($parentId) { $this->parentId = $parentId; } - + /** * Gets the value of status. * @return mixed @@ -198,7 +198,7 @@ public function getStatus() { return $this->status; } - + /** * Sets the value of status. * @param mixed $status the status @@ -208,7 +208,7 @@ public function setStatus($status) { $this->status = $status; } - + /** * Gets the value of error. * @return mixed @@ -217,7 +217,7 @@ public function getError() { return $this->error; } - + /** * Sets the value of error. * @param mixed $error the error @@ -227,7 +227,7 @@ public function setError($error) { $this->error = $error; } - + /** * Gets the value of orderId. * @return mixed @@ -236,7 +236,7 @@ public function getOrderId() { return $this->orderId; } - + /** * Sets the value of orderId. * @param mixed $orderId the order id @@ -246,7 +246,7 @@ public function setOrderId($orderId) { $this->orderId = $orderId; } - + /** * Gets the value of description. * @return mixed @@ -255,7 +255,7 @@ public function getDescription() { return $this->description; } - + /** * Sets the value of description. * @param mixed $description the description @@ -265,22 +265,4 @@ public function setDescription($description) { $this->description = $description; } - - /** - * Check if settlement is approved - * @return boolean - */ - public function isApproved() - { - return $this->getStatus() === 'approved'; - } - - /** - * Check if settlement is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php index 5a047382fc3..8537e07f3a0 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validator.php @@ -3,6 +3,7 @@ namespace Cardinity\Method; use Cardinity\Exception; +use Cardinity\Method\MethodInterface; use Symfony\Component\Validator\Validator\ValidatorInterface as BaseValidator; class Validator implements ValidatorInterface @@ -18,12 +19,6 @@ public function __construct(BaseValidator $validator) $this->validator = $validator; } - /** - * Validates given method values against its constraints - * - * @param MethodInterface $method - * @throws Exception\InvalidAttributeValue - */ public function validate(MethodInterface $method) { $constraints = $method->getValidationConstraints(); @@ -36,9 +31,7 @@ public function validate(MethodInterface $method) $constraints ); - $countable = is_array($violations) || $violations instanceof \Countable; - - if ($countable && count($violations) !== 0) { + if (count($violations) !== 0) { throw new Exception\InvalidAttributeValue( 'Your method contains invalid attribute value', $violations diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php index b72aa1ba13d..f59e71c7045 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/ValidatorInterface.php @@ -2,8 +2,6 @@ namespace Cardinity\Method; -use Cardinity\Exception; - /** * Interface for method validators */ @@ -13,7 +11,7 @@ interface ValidatorInterface * Validates given method values against its constraints * * @param MethodInterface $method - * @throws Exception\InvalidAttributeValue + * @throws Cardinity\Exception\InvalidData */ public function validate(MethodInterface $method); } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraint.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraint.php deleted file mode 100644 index c6aebf6a56b..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Validators/CallbackUrlConstraint.php +++ /dev/null @@ -1,17 +0,0 @@ -context->buildViolation($constraint->message) - ->setParameter('{{ param }}', $value) - ->addViolation(); - } - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php deleted file mode 100644 index a05654aa6fa..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Create.php +++ /dev/null @@ -1,56 +0,0 @@ -paymentId = $paymentId; - $this->description = $description; - } - - public function getAction() - { - return sprintf('payments/%s/voids', $this->paymentId); - } - - public function getMethod() - { - return MethodInterface::POST; - } - - public function getAttributes() - { - $return = []; - - if ($this->description !== null) { - $return['description'] = $this->description; - } - - return $return; - } - - public function createResultObject() - { - return new VoidPayment(); - } - - public function getValidationConstraints() - { - return new Assert\Collection([ - 'description' => new Assert\Optional([ - new Assert\Type(['type' => 'string']), - new Assert\Length([ - 'max' => 255 - ]), - ]), - ]); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php deleted file mode 100644 index 75165619d24..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/Get.php +++ /dev/null @@ -1,57 +0,0 @@ -paymentId = $paymentId; - $this->voidId = $voidId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/voids/%s', - $this->getPaymentId(), - $this->getvoidId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new VoidPayment(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } - - public function getvoidId() - { - return $this->voidId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php deleted file mode 100644 index 01ca7c9a11e..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/GetAll.php +++ /dev/null @@ -1,50 +0,0 @@ -paymentId = $paymentId; - } - - public function getAction() - { - return sprintf( - 'payments/%s/voids', - $this->getPaymentId() - ); - } - - public function getMethod() - { - return MethodInterface::GET; - } - - public function createResultObject() - { - return new VoidPayment(); - } - - public function getAttributes() - { - return []; - } - - public function getValidationConstraints() - { - return new Assert\Collection([]); - } - - public function getPaymentId() - { - return $this->paymentId; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php deleted file mode 100644 index 9fba8392ac3..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/VoidPayment/VoidPayment.php +++ /dev/null @@ -1,239 +0,0 @@ -id; - } - - /** - * Sets the value of id. - * @param mixed $id the id - * @return void - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * Gets the value of type. - * @return mixed - */ - public function getType() - { - return $this->type; - } - - /** - * Sets the value of type. - * @param mixed $type the type - * @return void - */ - public function setType($type) - { - $this->type = $type; - } - - /** - * Gets the value of created. - * @return mixed - */ - public function getCreated() - { - return $this->created; - } - - /** - * Sets the value of created. - * @param mixed $created the created - * @return void - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * Gets the value of live. - * @return mixed - */ - public function getLive() - { - return $this->live; - } - - /** - * Sets the value of live. - * @param mixed $live the live - * @return void - */ - public function setLive($live) - { - $this->live = $live; - } - - /** - * Gets the value of parentId. - * @return mixed - */ - public function getParentId() - { - return $this->parentId; - } - - /** - * Sets the value of parentId. - * @param mixed $parentId the parent id - * @return void - */ - public function setParentId($parentId) - { - $this->parentId = $parentId; - } - - /** - * Gets the value of status. - * @return mixed - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets the value of status. - * @param mixed $status the status - * @return void - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * Gets the value of error. - * @return mixed - */ - public function getError() - { - return $this->error; - } - - /** - * Sets the value of error. - * @param mixed $error the error - * @return void - */ - public function setError($error) - { - $this->error = $error; - } - - /** - * Gets the value of orderId. - * @return mixed - */ - public function getOrderId() - { - return $this->orderId; - } - - /** - * Sets the value of orderId. - * @param mixed $orderId the order id - * @return void - */ - public function setOrderId($orderId) - { - $this->orderId = $orderId; - } - - /** - * Gets the value of description. - * @return mixed - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the value of description. - * @param mixed $description the description - * @return void - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * Check if void is approved - * @return boolean - */ - public function isApproved() - { - return $this->getStatus() === 'approved'; - } - - /** - * Check if void is declined - * @return boolean - */ - public function isDeclined() - { - return $this->getStatus() === 'declined'; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php deleted file mode 100644 index c010b0d5cf1..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientEndpointTest.php +++ /dev/null @@ -1,85 +0,0 @@ -baseConfig = [ - 'consumerKey' => $_ENV['CONSUMER_KEY'], - 'consumerSecret' => $_ENV['CONSUMER_SECRET'], - ]; - $this->log = Client::LOG_NONE; - } - - /** - * Test create client with invalid URL - * - * @return void - */ - public function testInvalidURLEndpoint(){ - - $this->baseConfig['apiEndpoint'] = '123abc'; - try { - Client::create($this->baseConfig, $this->log); - } catch (\Exception $e) { - $this->assertStringContainsString('Your API endpoint is not a valid URL', $e->getMessage()); - } - } - - /** - * Test create client with valid URL, - * - * @return void - */ - public function testValidUrlWrongEndpoint(){ - - $this->baseConfig['apiEndpoint'] = 'https://example.com/'; - - try { - $client = Client::create($this->baseConfig, $this->log); - } catch (\Exception $e) { - $this->assertStringContainsString('error', $e->getMessage()); - } - $this->assertInstanceOf('Cardinity\Client', $client); - } - - /** - * Test create client with valid URL, - * - * @return void - */ - public function testValidURLValidEndpoint(){ - - $this->baseConfig['apiEndpoint'] = 'https://api.cardinity.com/v1/'; - $client = Client::create($this->baseConfig, $this->log); - $this->assertInstanceOf('Cardinity\Client', $client); - } - - /** - * Test create client with valid URL, - * - * @return void - */ - public function testNoEndpoint(){ - - unset($this->baseConfig['apiEndpoint']); - $client = Client::create($this->baseConfig, $this->log); - - $reflection = new \ReflectionObject($client); - $urlProperty = $reflection->getProperty('url'); - $urlProperty->setAccessible(true); - - $this->assertSame($urlProperty->getValue(),'https://api.cardinity.com/v1/'); - $this->assertInstanceOf('Cardinity\Client', $client); - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php deleted file mode 100644 index ba7b7dc07a9..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTest.php +++ /dev/null @@ -1,183 +0,0 @@ -payment3ds2Params = $this->get3ds2PaymentParams(); - parent::setUp(); - } - - /** - * @dataProvider localhostUrlValidationDataProvider - * @param string $address - * @param string $expectedMessage - * @return void - */ - public function testLocalhostUrlExeptionRised($address, $expectedMessage) - { - $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; - $method = new Payment\Create($this->payment3ds2Params); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function localhostUrlValidationDataProvider() - { - return [ - [ - 'http://localhost', - $this->getRestrictedHostnameErrorMsg('http://localhost'), - ],[ - 'https://localhost', - $this->getRestrictedHostnameErrorMsg('https://localhost'), - ],[ - 'http://127.0.0.1', - $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), - ],[ - 'https://127.0.0.1', - $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), - ] - ]; - } - - - /** - * @dataProvider protocolUrlValidationDataProvider - * @param string $address - * @param string $expectedMessage - * @return void - */ - public function testProtocolUrlExeptionRised($address, $expectedMessage) - { - $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; - $method = new Payment\Create($this->payment3ds2Params); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function protocolUrlValidationDataProvider() - { - return [ - [ - 'ftp://example.com', - 'The protocol of "ftp://example.com" should be "http" or "https".' - ],[ - 'htt://example.com', - 'The protocol of "htt://example.com" should be "http" or "https".' - ],[ - 'f://example.com', - 'The protocol of "f://example.com" should be "http" or "https".' - ] - ]; - } - - - /** - * @dataProvider localhostUrlNotStringDataProvider - * @return void - */ - public function testLocalhostUrlNotStringExeptionRised($address, $expectedMessage) - { - $this->payment3ds2Params['threeds2_data']['notification_url'] = $address; - $method = new Payment\Create($this->payment3ds2Params); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function localhostUrlNotStringDataProvider() - { - return [ - [ - 123, - 'This value should be of type string.' - ],[ - null, - 'This value should not be blank.' - ], - ]; - } - - /** - * @dataProvider browserInfoIpAddressDataProvider - * @param array $address - * @param string $expectedMessage - * @return void - */ - public function testBrowserInfoIpAddressExeptionRised($address, $expectedMessage) - { - $paymentParams = $this->get3ds2PaymentParams($address); - $method = new Payment\Create($paymentParams); - - $this->expectException(Exception\InvalidAttributeValue::class); - $this->expectErrorMessage($expectedMessage); - - $payment = $this->client->call($method); - } - - /** - * @return array - */ - public function browserInfoIpAddressDataProvider() - { - return [ - [ - ['ip_address' => 123], - 'This value should be of type string.' - ],[ - ['ip_address' => ''], - 'This value should not be blank.' - ],[ - ['ip_address' => 'http://localhost'], - $this->getRestrictedHostnameErrorMsg('http://localhost'), - ],[ - ['ip_address' => 'https://localhost'], - $this->getRestrictedHostnameErrorMsg('https://localhost'), - ],[ - ['ip_address' => 'http://127.0.0.1'], - $this->getRestrictedHostnameErrorMsg('http://127.0.0.1'), - ],[ - ['ip_address' => 'https://127.0.0.1'], - $this->getRestrictedHostnameErrorMsg('https://127.0.0.1'), - ], - ]; - } - - /** - * @param string $address url or ip - * @return string - */ - private function getRestrictedHostnameErrorMsg(string $address) - { - return 'The url "' . $address . - '" contains restricted values. Do not use "localhost" or "127.0.0.1".'; - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php index 1915cd264e7..60919659a98 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ClientTestCase.php @@ -6,36 +6,34 @@ use Monolog\Handler\StreamHandler; use Monolog\Logger; use Cardinity\Method\Payment; -use PHPUnit\Framework\TestCase; -class ClientTestCase extends TestCase +class ClientTestCase extends \PHPUnit_Framework_TestCase { - /** - * @return void - */ - public function setUp(): void + public function setUp() { $log = Client::LOG_NONE; + // @NOTE uncomment if request/response debugging is needed + // Use 'null' value for printing request to console + // $log = Client::LOG_DEBUG; + + // Use monolog logger to log requests into the file + // $log = new Logger('requests'); + // $log->pushHandler(new StreamHandler(__DIR__ . '/info.log', Logger::INFO)); + $this->client = Client::create($this->getConfig(), $log); $this->assertInstanceOf('Cardinity\Client', $this->client); } - /** - * @return array - */ protected function getConfig() { return [ - 'consumerKey' => $_ENV['CONSUMER_KEY'], - 'consumerSecret' => $_ENV['CONSUMER_SECRET'], + 'consumerKey' => CONSUMER_KEY, + 'consumerSecret' => CONSUMER_SECRET, ]; } - /** - * @return array - */ protected function getPaymentParams() { return [ @@ -48,113 +46,11 @@ protected function getPaymentParams() 'payment_method' => Payment\Create::CARD, 'payment_instrument' => [ 'pan' => '4111111111111111', - 'exp_year' => date('Y') + 4, + 'exp_year' => 2016, 'exp_month' => 12, 'cvc' => '456', 'holder' => 'Mike Dough' ], ]; } - - /** - * @param array optional - * @return array - */ - public function get3ds2PaymentParams($browserData = []) - { - return array_merge( - $this->getPaymentParams(), - [ - 'threeds2_data' => $this->getThreeDS2Data($browserData) - ] - ); - } - - /** - * @return Payment\Payment - */ - public function getPayment() - { - $payment = new Payment\Payment(); - $payment->setId('foo'); - $payment->setType('bar'); - $payment->setCurrency(null); - $payment->setAmount('55.00'); - $payment->setPaymentMethod(Payment\Create::CARD); - return $payment; - } - - /** - * @param array optional - * @return array - */ - public function getBrowserInfo($args = []) - { - $browserInfo = [ - 'accept_header' => 'Some header', - 'browser_language' => 'LT', - 'screen_width' => 390, - 'screen_height' => 400, - 'challenge_window_size' => '390x400', - 'user_agent' => 'super user agent', - 'color_depth' => 24, - 'time_zone' => -60, - ]; - if ($args) { - foreach($args as $key => $val) { - $browserInfo[$key] = $val; - } - } - return $browserInfo; - } - - /** - * @param array optional - * @return array - */ - public function getAddress($args = []) - { - $address = [ - 'address_line1' => 'first address line', - 'city' => 'balbieriskis', - 'country' => 'LT', - 'postal_code' => '0234' - ]; - if ($args && isset($args['address_line2'])) { - $address['address_line2'] = $args['address_line2']; - } - if ($args && isset($args['address_line3'])) { - $address['address_line3'] = $args['address_line3']; - } - if ($args && isset($args['state'])) { - $address['state'] = $args['state']; - } - return $address; - } - - /** - * @param array optional - * @return array - */ - public function getThreeDS2Data($browserData = []) - { - return [ - 'notification_url' => 'https://notification.url/', - 'browser_info' => $this->getBrowserInfo($browserData), - ]; - } - - /** - * @return Payment\PaymentInstrumentCard - */ - public function getCard() - { - $card = new Payment\PaymentInstrumentCard(); - $card->setCardBrand('Visa'); - $card->setPan('4447'); - $card->setExpYear(date('Y') + 4); - $card->setExpMonth(11); - $card->setHolder('James Bond'); - return $card; - } -} +} \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php index 0fc0cc87b3d..b1a3d77ed61 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ErrorTest.php @@ -1,31 +1,18 @@ getMockBuilder('Cardinity\Method\Payment\Get') ->disableOriginalConstructor() ->getMock() ; - } - - /** - * @return void - */ - public function testErrorResultObjectForErrorResponse() - { - $method = $this->getPaymentMethodMock(); $method->method('getAction')->willReturn('payments'); $method->method('getAttributes')->willReturn([]); $method->method('getMethod')->willReturn(Payment\Get::POST); @@ -37,14 +24,14 @@ public function testErrorResultObjectForErrorResponse() $this->assertInstanceOf('Cardinity\Method\Error', $result); $this->assertSame('https://developers.cardinity.com/api/v1/#400', $result->getType()); $this->assertSame('Validation Failed', $result->getTitle()); - $this->assertStringContainsString('validation errors', $result->getDetail()); + $this->assertContains('validation errors', $result->getDetail()); $this->assertTrue(is_array($result->getErrors())); $this->assertNotEmpty($result->getErrors()); } } /** - * @return void + * @expectedException Cardinity\Exception\Unauthorized */ public function testUnauthorizedResponse() { @@ -52,51 +39,60 @@ public function testUnauthorizedResponse() 'consumerKey' => 'no', 'consumerSecret' => 'yes', ]); + $method = new Payment\Get('xxxyyy'); - $this->expectException(\Cardinity\Exception\Unauthorized::class); $client->call($method); } /** - * @return void + * @expectedException Cardinity\Exception\ValidationFailed */ public function testBadRequest() { - $method = $this->getPaymentMethodMock(); + $method = $this + ->getMockBuilder('Cardinity\Method\Payment\Get') + ->disableOriginalConstructor() + ->getMock() + ; $method->method('getAction')->willReturn('payments'); $method->method('getAttributes')->willReturn([]); $method->method('getMethod')->willReturn(Payment\Get::POST); - $this->expectException(\Cardinity\Exception\ValidationFailed::class); $this->client->call($method); } /** - * @return void + * @expectedException Cardinity\Exception\NotFound */ public function testNotFound() { - $method = $this->getPaymentMethodMock(); + $method = $this + ->getMockBuilder('Cardinity\Method\Payment\Get') + ->disableOriginalConstructor() + ->getMock() + ; $method->method('getAction')->willReturn('my_dreamy_action'); $method->method('getAttributes')->willReturn([]); $method->method('getMethod')->willReturn(Payment\Get::POST); - $this->expectException(\Cardinity\Exception\NotFound::class); $this->client->call($method); } /** - * @return void + * @expectedException Cardinity\Exception\MethodNotAllowed */ public function testMethodNotAllowed() { - $method = $this->getPaymentMethodMock();; + $method = $this + ->getMockBuilder('Cardinity\Method\Payment\Get') + ->disableOriginalConstructor() + ->getMock() + ; $method->method('getAction')->willReturn('payments'); $method->method('getAttributes')->willReturn([]); $method->method('getMethod')->willReturn('DELETE'); - $this->expectException(\Cardinity\Exception\MethodNotAllowed::class); $this->client->call($method); } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php index 70e825644f6..d97318fe568 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/PaymentTest.php @@ -1,30 +1,26 @@ paymentParams = $this->getPaymentParams(); - parent::setUp(); - } - - /** - * @return void - */ public function testResultObjectSerialization() { - $payment = $this->getPayment(); - - $card = $this->getCard(); + $payment = new Payment\Payment(); + $payment->setId('foo'); + $payment->setType('bar'); + $payment->setCurrency(null); + $payment->setAmount('55.00'); + $payment->setPaymentMethod(Payment\Create::CARD); + + $card = new Payment\PaymentInstrumentCard(); + $card->setCardBrand('Visa'); + $card->setPan('4447'); + $card->setExpYear(2017); + $card->setExpMonth(5); + $card->setHolder('John Smith'); $payment->setPaymentInstrument($card); $info = new Payment\AuthorizationInformation(); @@ -33,17 +29,14 @@ public function testResultObjectSerialization() $payment->setAuthorizationInformation($info); $this->assertSame( - '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}', + '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":2017,"exp_month":5,"holder":"John Smith"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}', $payment->serialize() ); } - /** - * @return void - */ public function testResultObjectUnserialization() { - $json = '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":'.(date('Y')+4).',"exp_month":11,"holder":"James Bond"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; + $json = '{"id":"foo","amount":"55.00","type":"bar","payment_method":"card","payment_instrument":{"card_brand":"Visa","pan":"4447","exp_year":2017,"exp_month":5,"holder":"John Smith"},"authorization_information":{"url":"http:\/\/...","data":"some_data"}}'; $payment = new Payment\Payment(); $payment->unserialize($json); @@ -55,27 +48,22 @@ public function testResultObjectUnserialization() $this->assertInstanceOf('Cardinity\Method\Payment\AuthorizationInformation', $payment->getAuthorizationInformation()); $this->assertSame('http://...', $payment->getAuthorizationInformation()->getUrl()); $this->assertInstanceOf('Cardinity\Method\Payment\PaymentInstrumentCard', $payment->getPaymentInstrument()); - $this->assertSame('James Bond', $payment->getPaymentInstrument()->getHolder()); + $this->assertSame('John Smith', $payment->getPaymentInstrument()->getHolder()); } /** - * @dataProvider invalidAmountValuesData - * @param mixed $amount - * @return void + * @expectedException Cardinity\Exception\InvalidAttributeValue + * @dataProvider invalidaAmountValuesData */ public function testAmountValidationConstraint($amount) { - $this->paymentParams['amount'] = $amount; - $method = new Payment\Create($this->paymentParams); - - $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); - $this->client->call($method); + $params = $this->getPaymentParams(); + $params['amount'] = $amount; + $method = new Payment\Create($params); + $result = $this->client->call($method); } - /** - * @return array - */ - public function invalidAmountValuesData() + public function invalidaAmountValuesData() { return [ ['150.01'], @@ -84,60 +72,91 @@ public function invalidAmountValuesData() } /** - * @return void + * @expectedException Cardinity\Exception\InvalidAttributeValue */ public function testMissingRequiredAttribute() { $params = $this->getPaymentParams(); unset($params['currency']); $method = new Payment\Create($params); - $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); - $this->client->call($method); + $result = $this->client->call($method); + } + + /** + * In order to simulate a failed payment: + * status declined: Amount larger than 150.00 will trigger a declined payment. + */ + public function testCreateDeclined() + { + $params = $this->getPaymentParams(); + $params['amount'] = 150.01; + + try { + $method = new Payment\Create($params); + $result = $this->client->call($method); + } catch (Exception\Declined $e) { + $result = $e->getResult(); + + $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); + $this->assertSame('declined', $result->getStatus()); + $this->assertSame('CRD-TEST: Do Not Honor', $result->getError()); + $this->assertContains('status: CRD-TEST: Do Not Honor;', $e->getErrorsAsString()); + + return; + } + + $this->fail('An expected exception has not been raised.'); } /** * Invalid data. Check error message. - * @return void */ public function testCreateFailPanValidation() { - $this->paymentParams['payment_instrument']['pan'] = '4242424242424241'; - $method = new Payment\Create($this->paymentParams); - $this->expectException(\Cardinity\Exception\InvalidAttributeValue::class); - $this->client->call($method); + $params = $this->getPaymentParams(); + $params['payment_instrument']['pan'] = '4242424242424241'; + + try { + $method = new Payment\Create($params); + $result = $this->client->callNoValidate($method); + } catch (Exception\ValidationFailed $e) { + $result = $e->getResult(); + + $this->assertInstanceOf('Cardinity\Method\Error', $result); + $this->assertSame('invalid credit card number.', $e->getErrors()[0]['message']); + return; + } + + $this->fail('An expected exception has not been raised.'); } /** * Invalid data. Generic handling. - * @return void + * @expectedException Cardinity\Exception\ValidationFailed */ public function testCreateFailMonthValidation() { - $this->paymentParams['payment_instrument']['exp_month'] = 13; - $method = new Payment\Create($this->paymentParams); - $this->expectException(\Cardinity\Exception\ValidationFailed::class); - $this->client->call($method); + $params = $this->getPaymentParams(); + $params['payment_instrument']['exp_month'] = 13; + + $method = new Payment\Create($params); + $result = $this->client->call($method); } - /** - * @return ResultObject - */ public function testCreate() { - $method = new Payment\Create($this->paymentParams); + $params = $this->getPaymentParams(); + $method = new Payment\Create($params); $result = $this->client->call($method); $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); return $result; } /** * @depends testCreate - * @param Payment\Payment - * @return ResultObject */ public function testCreateRecurring(Payment\Payment $payment) { @@ -152,15 +171,12 @@ public function testCreateRecurring(Payment\Payment $payment) $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); return $result; } /** * @depends testCreate - * @param Payment\Payment - * @return void */ public function testGet(Payment\Payment $payment) { @@ -169,12 +185,8 @@ public function testGet(Payment\Payment $payment) $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); } - /** - * @return void - */ public function testGetAll() { $method = new Payment\GetAll(5); @@ -184,19 +196,16 @@ public function testGetAll() $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result[0]); } - /** - * @return ResultObject - */ public function testCreate3dFail() { - $this->paymentParams['description'] = '3d-fail'; + $params = $this->getPaymentParams(); + $params['description'] = '3d-fail'; - $method = new Payment\Create($this->paymentParams); + $method = new Payment\Create($params); $result = $this->client->call($method); $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); $this->assertSame('pending', $result->getStatus()); - $this->assertSame(true, $result->isPending()); $this->assertSame('3d-fail', $result->getAuthorizationInformation()->getData()); return $result; @@ -204,7 +213,6 @@ public function testCreate3dFail() /** * @depends testCreate3dFail - * @param Payment\Payment */ public function testFinalizePaymentFail(Payment\Payment $payment) { @@ -213,14 +221,13 @@ public function testFinalizePaymentFail(Payment\Payment $payment) try { $method = new Payment\Finalize($paymentId, $authorizationInformation); - $this->client->call($method); - } catch (\Cardinity\Exception\Declined $e) { + $result = $this->client->call($method); + } catch (Exception\Declined $e) { $result = $e->getResult(); $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); $this->assertSame('declined', $result->getStatus()); - $this->assertSame(true, $result->isDeclined()); - $this->assertStringContainsString('status: 33333: 3D Secure Authorization Failed.;', $e->getErrorsAsString()); + $this->assertContains('status: 33333: 3D Secure Authorization Failed.;', $e->getErrorsAsString()); return; } @@ -228,9 +235,6 @@ public function testFinalizePaymentFail(Payment\Payment $payment) $this->fail('An expected exception has not been raised.'); } - /** - * @return ResultObject - */ public function testCreate3dPass() { $params = $this->getPaymentParams(); @@ -241,7 +245,6 @@ public function testCreate3dPass() $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); $this->assertSame('pending', $result->getStatus()); - $this->assertSame(true, $result->isPending()); $this->assertSame('3d-pass', $result->getAuthorizationInformation()->getData()); return $result; @@ -249,8 +252,6 @@ public function testCreate3dPass() /** * @depends testCreate3dPass - * @param Payment\Payment - * @return void */ public function testFinalizePaymentPass(Payment\Payment $payment) { @@ -262,6 +263,5 @@ public function testFinalizePaymentPass(Payment\Payment $payment) $this->assertInstanceOf('Cardinity\Method\Payment\Payment', $result); $this->assertSame('approved', $result->getStatus()); - $this->assertSame(true, $result->isApproved()); } } diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php index 411c7cba8d8..1014ace16e0 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/RefundTest.php @@ -6,9 +6,6 @@ class RefundTest extends ClientTestCase { - /** - * @return void - */ public function testResultObjectSerialization() { $refund = new Refund\Refund(); @@ -23,9 +20,6 @@ public function testResultObjectSerialization() ); } - /** - * @return void - */ public function testResultObjectUnserialization() { $json = '{"id":"foo","amount":"55.00","type":"bar"}'; @@ -40,7 +34,7 @@ public function testResultObjectUnserialization() } /** - * @return Cardinity\Method\ResultObject $result + * @return Payment\Payment */ public function testCreatePayment() { @@ -55,8 +49,7 @@ public function testCreatePayment() /** * @depends testCreatePayment - * @param Payment\Payment - * @return void + * @expectedException Cardinity\Exception\Declined */ public function testCreateFail(Payment\Payment $payment) { @@ -65,14 +58,12 @@ public function testCreateFail(Payment\Payment $payment) 10.00, 'fail' ); - $this->expectException(\Cardinity\Exception\Declined::class); $this->client->call($method); } /** * @depends testCreatePayment - * @param Payment\Payment - * @return Cardinity\Method\ResultObject $result + * @return Refund\Refund */ public function testCreate(Payment\Payment $payment) { @@ -85,15 +76,12 @@ public function testCreate(Payment\Payment $payment) $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result); $this->assertSame('10.00', $result->getAmount()); - $this->assertSame(true, $result->isApproved()); return $result; } /** * @depends testCreate - * @param Refund\Refund - * @return void */ public function testGet(Refund\Refund $refund) { @@ -112,8 +100,6 @@ public function testGet(Refund\Refund $refund) /** * @depends testCreate - * @param Refund\Refund - * @return void */ public function testGetAll(Refund\Refund $refund) { @@ -122,9 +108,8 @@ public function testGetAll(Refund\Refund $refund) ); $result = $this->client->call($method); - $this->assertIsArray($result); $this->assertInstanceOf('Cardinity\Method\Refund\Refund', $result[0]); - $this->assertSame($refund->getParentId(), $result[0]->getParentId()); $this->assertSame($refund->getId(), $result[0]->getId()); + $this->assertSame($refund->getParentId(), $result[0]->getParentId()); } -} +} \ No newline at end of file diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php index 3151248c965..cc6b08e3750 100644 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/SettlementTest.php @@ -1,5 +1,4 @@ expectException(\Cardinity\Exception\Declined::class); $this->client->call($method); } /** * @depends testCreatePayment - * @param Payment\Payment $payment - * @return Cardinity\Method\ResultObject $result */ public function testCreate(Payment\Payment $payment) { @@ -81,17 +70,14 @@ public function testCreate(Payment\Payment $payment) ); $result = $this->client->call($method); - $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); $this->assertSame('10.00', $result->getAmount()); - $this->assertSame(true, $result->isApproved()); return $result; } /** * @depends testCreate - * @param Settlement\Settlement $settlement - * @return void */ public function testGet(Settlement\Settlement $settlement) { @@ -101,7 +87,7 @@ public function testGet(Settlement\Settlement $settlement) ); $result = $this->client->call($method); - $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); + $this->assertInstanceOf('Cardinity\Method\Settlement\Settlement', $result); $this->assertSame($settlement->getParentId(), $result->getParentId()); $this->assertSame('10.00', $result->getAmount()); $this->assertSame('settlement', $result->getType()); @@ -110,8 +96,6 @@ public function testGet(Settlement\Settlement $settlement) /** * @depends testCreate - * @param Settlement\Settlement $settlement - * @return void */ public function testGetAll(Settlement\Settlement $settlement) { diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php deleted file mode 100644 index 48503a6ef01..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/ThreeDS2Test.php +++ /dev/null @@ -1,55 +0,0 @@ -getThreeDS2Data(); - - $method = new Payment\Create([ - 'amount' => 59.01, - 'currency' => 'EUR', - 'settle' => true, - 'description' => '3ds2-Testing-for-pass', - 'order_id' => 'orderid123', - 'country' => 'LT', - 'payment_method' => Payment\Create::CARD, - 'payment_instrument' => [ - 'pan' => '5454545454545454', - 'exp_year' => date('Y') + 4, - 'exp_month' => 12, - 'cvc' => '456', - 'holder' => 'Shb Mike Dough' - ], - 'threeds2_data' => $threeDS2Data - ]); - - try { - $payment = $this->client->call($method); - $this->assertEquals('pending', $payment->getStatus()); - } catch (Exception\Declined $exception) { - $payment = $exception->getResult(); - $status = $payment->getStatus(); - $errors = $exception->getErrors(); - } catch (Exception\ValidationFailed $exception) { - $payment = $exception->getResult(); - $status = $payment->getStatus(); - $errors = $exception->getErrors(); - } catch (Cardinity\Exception\InvalidAttributeValue $exception) { - $errors = $exception->getErrors(); - } - if (isset($errors)) { - $this->assertContains('[threeds2_data][notification_url]',$errors); - } - } -} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php deleted file mode 100644 index 0fc72ad56c3..00000000000 --- a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidPaymentTest.php +++ /dev/null @@ -1,121 +0,0 @@ -setId('foo'); - $refund->setType('bar'); - $refund->setCreated(null); - - $this->assertSame( - '{"id":"foo","type":"bar"}', - $refund->serialize() - ); - } - - /** - * @return void - */ - public function testResultObjectUnserialization() - { - $json = '{"id":"foo","type":"bar"}'; - - $payment = new VoidPayment\VoidPayment(); - $payment->unserialize($json); - - $this->assertSame('foo', $payment->getId()); - $this->assertSame('bar', $payment->getType()); - $this->assertSame(null, $payment->getDescription()); - } - - /** - * @return Cardinity\Method\ResultObject $payment - */ - public function testCreatePayment() - { - $method = new Payment\Create($this->getPaymentParams()); - $payment = $this->client->call($method); - - return $payment; - } - - /** - * @depends testCreatePayment - * @param Payment\Payment $payment - * @return void - */ - public function testCreateFail(Payment\Payment $payment) - { - $method = new VoidPayment\Create( - $payment->getId(), - 'fail' - ); - $this->expectException(\Cardinity\Exception\Declined::class); - $this->client->call($method); - } - - /** - * @depends testCreatePayment - * @param Payment\Payment $payment - * @return Cardinity\Method\ResultObject $result - */ - public function testCreate(Payment\Payment $payment) - { - $method = new VoidPayment\Create( - $payment->getId(), - 'my description' - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); - $this->assertSame(true, $result->isApproved()); - - return $result; - } - - /** - * @depends testCreate - * @param VoidPayment\VoidPayment $void - * @return void - */ - public function testGet(VoidPayment\VoidPayment $void) - { - $method = new VoidPayment\Get( - $void->getParentId(), - $void->getId() - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result); - $this->assertSame($void->getParentId(), $result->getParentId()); - $this->assertSame('void', $result->getType()); - $this->assertSame('my description', $result->getDescription()); - } - - /** - * @depends testCreate - * @param VoidPayment\VoidPayment $void - * @return void - */ - public function testGetAll(VoidPayment\VoidPayment $void) - { - $method = new VoidPayment\GetAll( - $void->getParentId() - ); - $result = $this->client->call($method); - - $this->assertInstanceOf('Cardinity\Method\VoidPayment\VoidPayment', $result[0]); - $this->assertSame($void->getParentId(), $result[0]->getParentId()); - $this->assertSame($void->getId(), $result[0]->getId()); - } -} diff --git a/upload/system/storage/vendor/composer/ClassLoader.php b/upload/system/storage/vendor/composer/ClassLoader.php index fce8549f078..afef3fa2ad8 100644 --- a/upload/system/storage/vendor/composer/ClassLoader.php +++ b/upload/system/storage/vendor/composer/ClassLoader.php @@ -37,57 +37,130 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + /** @var ?string */ + private $vendorDir; + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,9 +175,11 @@ 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 array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -147,11 +222,13 @@ 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 array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @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 * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -195,8 +272,10 @@ 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 array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +290,12 @@ 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 array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +315,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +339,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +361,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,25 +383,44 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { @@ -323,6 +429,8 @@ public function loadClass($class) return true; } + + return null; } /** @@ -367,6 +475,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -438,6 +561,10 @@ private function findFileWithExtension($class, $ext) * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/upload/system/storage/vendor/composer/autoload_classmap.php b/upload/system/storage/vendor/composer/autoload_classmap.php index b9461a63714..1a1c1136a77 100644 --- a/upload/system/storage/vendor/composer/autoload_classmap.php +++ b/upload/system/storage/vendor/composer/autoload_classmap.php @@ -6,4 +6,5 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); diff --git a/upload/system/storage/vendor/composer/autoload_namespaces.php b/upload/system/storage/vendor/composer/autoload_namespaces.php index 89454da8809..1587c87c778 100644 --- a/upload/system/storage/vendor/composer/autoload_namespaces.php +++ b/upload/system/storage/vendor/composer/autoload_namespaces.php @@ -6,7 +6,6 @@ $baseDir = dirname(dirname(dirname(dirname($vendorDir)))); return array( - 'Twig_' => array($vendorDir . '/twig/twig/lib'), 'Divido' => array($vendorDir . '/divido/divido-php/lib'), 'Braintree' => array($vendorDir . '/braintree/braintree_php/lib'), ); diff --git a/upload/system/storage/vendor/composer/autoload_real.php b/upload/system/storage/vendor/composer/autoload_real.php index 4bdcde48e43..79d4bf4fc07 100644 --- a/upload/system/storage/vendor/composer/autoload_real.php +++ b/upload/system/storage/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59 +class ComposerAutoloaderInit739b8c4876316c3496b6b4e434ec69a5 { private static $loader; @@ -22,15 +22,17 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInita8cb75283b86ff94542c6f1327c4ce59', 'loadClassLoader')); + require __DIR__ . '/platform_check.php'; + + spl_autoload_register(array('ComposerAutoloaderInit739b8c4876316c3496b6b4e434ec69a5', 'loadClassLoader'), true, true); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + spl_autoload_unregister(array('ComposerAutoloaderInit739b8c4876316c3496b6b4e434ec69a5', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -51,23 +53,28 @@ public static function getLoader() $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirea8cb75283b86ff94542c6f1327c4ce59($fileIdentifier, $file); + composerRequire739b8c4876316c3496b6b4e434ec69a5($fileIdentifier, $file); } return $loader; } } -function composerRequirea8cb75283b86ff94542c6f1327c4ce59($fileIdentifier, $file) +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire739b8c4876316c3496b6b4e434ec69a5($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/upload/system/storage/vendor/composer/autoload_static.php b/upload/system/storage/vendor/composer/autoload_static.php index d105a184097..d952ec77a54 100644 --- a/upload/system/storage/vendor/composer/autoload_static.php +++ b/upload/system/storage/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 +class ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -119,13 +119,6 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ); public static $prefixesPsr0 = array ( - 'T' => - array ( - 'Twig_' => - array ( - 0 => __DIR__ . '/..' . '/twig/twig/lib', - ), - ), 'D' => array ( 'Divido' => @@ -142,13 +135,18 @@ class ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59 ), ); + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixDirsPsr4; - $loader->fallbackDirsPsr4 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$fallbackDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInita8cb75283b86ff94542c6f1327c4ce59::$prefixesPsr0; + $loader->prefixLengthsPsr4 = ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5::$prefixDirsPsr4; + $loader->fallbackDirsPsr4 = ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5::$fallbackDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5::$prefixesPsr0; + $loader->classMap = ComposerStaticInit739b8c4876316c3496b6b4e434ec69a5::$classMap; }, null, ClassLoader::class); } diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index 16b586b5bb1..d02b174ab84 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1,1046 +1,1057 @@ -[ - { - "name": "braintree/braintree_php", - "version": "3.40.0", - "version_normalized": "3.40.0.0", - "source": { - "type": "git", - "url": "https://github.com/braintree/braintree_php.git", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", - "reference": "840fc6ebf8d96756fed475cce94565fef178187d", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-dom": "*", - "ext-hash": "*", - "ext-openssl": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*" - }, - "time": "2015-07-15T15:07:13+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Braintree": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Braintree", - "homepage": "http://www.braintreepayments.com" - } - ], - "description": "Braintree PHP Client Library" - }, - { - "name": "cardinity/cardinity-sdk-php", - "version": "v1.0.3", - "version_normalized": "1.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/cardinity/cardinity-sdk-php.git", - "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/f51f6fbacee393b4eeff7b80be2b1cee77896b4c", - "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~5.1", - "guzzlehttp/log-subscriber": "~1.0", - "guzzlehttp/oauth-subscriber": "0.2.*", - "php": ">=5.4.0", - "symfony/validator": "~2.6" - }, - "require-dev": { - "monolog/monolog": "~1.0", - "phpspec/phpspec": "~2.1", - "phpunit/phpunit": "~4.3" - }, - "time": "2016-12-29T09:57:23+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Cardinity\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Client library for Cardinity credit card processing API", - "homepage": "http://cardinity.com" - }, - { - "name": "divido/divido-php", - "version": "v1.15-stable", - "version_normalized": "1.15.0.0", - "source": { - "type": "git", - "url": "git@github.com:DividoFinancialServices/divido-api-php.git", - "reference": "8edd902ec2be8151331985021107031292b41ca1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/DividoFinancialServices/divido-api-php/zipball/8edd902ec2be8151331985021107031292b41ca1", - "reference": "8edd902ec2be8151331985021107031292b41ca1", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.2.0" - }, - "time": "2018-01-21T15:38:57+00:00", - "type": "library", - "extra": { - "branch-alias": { - "master": "2.0-dev", - "v1.1.1": "1.1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Divido": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Divido PHP library", - "homepage": "https://www.divido.com/", - "keywords": [ - "api", - "divido", - "finance", - "instalments", - "payment processing" - ] - }, - { - "name": "guzzlehttp/guzzle", - "version": "5.3.4", - "version_normalized": "5.3.4.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", - "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0", - "react/promise": "^2.2" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0" - }, - "time": "2019-10-30T09:32:00+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] - }, - { - "name": "guzzlehttp/log-subscriber", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/log-subscriber.git", - "reference": "99c3c0004165db721d8ef7bbef60c996210e538a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/log-subscriber/zipball/99c3c0004165db721d8ef7bbef60c996210e538a", - "reference": "99c3c0004165db721d8ef7bbef60c996210e538a", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~4.0 | ~5.0", - "php": ">=5.4.0", - "psr/log": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2014-10-13T03:31:43+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Subscriber\\Log\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Logs HTTP requests and responses as they are sent over the wire (Guzzle 4+)", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "log", - "plugin" - ], - "abandoned": true - }, - { - "name": "guzzlehttp/oauth-subscriber", - "version": "0.2.0", - "version_normalized": "0.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/oauth-subscriber.git", - "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/03f1ebe31d3112526106d0570c80eba6820e86e5", - "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~4.0|~5.0", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2014-10-23T22:19:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Subscriber\\Oauth\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle OAuth 1.0 subscriber", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "oauth" - ] - }, - { - "name": "guzzlehttp/ringphp", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", - "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", - "shasum": "" - }, - "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "time": "2018-07-31T13:22:33+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "abandoned": true - }, - { - "name": "guzzlehttp/streams", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2014-10-12T19:18:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "abandoned": true - }, - { - "name": "klarna/kco_rest", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/klarna/kco_rest_php.git", - "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/8a2142a2ebb087bb61901d51d1bb9698790e78c5", - "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": ">=4.2,<6.0", - "php": ">=5.4.0" - }, - "require-dev": { - "apigen/apigen": "4.0.*", - "klarna/apigen-theme": "~1.0", - "phploc/phploc": "2.0.*", - "phpmd/phpmd": "2.1.*", - "phpunit/phpunit": "4.2.*", - "satooshi/php-coveralls": "0.6.*", - "sebastian/phpcpd": "2.0.*", - "squizlabs/php_codesniffer": "1.5.*" - }, - "time": "2015-12-07T09:51:35+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Klarna AB", - "email": "integration@klarna.com" - } - ], - "description": "Klarna Checkout PHP SDK", - "homepage": "http://developers.klarna.com", - "abandoned": true - }, - { - "name": "psr/log", - "version": "1.1.3", - "version_normalized": "1.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2020-03-23T09:12:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { - "name": "react/promise", - "version": "v2.8.0", - "version_normalized": "2.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" - }, - "time": "2020-05-12T15:16:56+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ] - }, - { - "name": "scssphp/scssphp", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/scssphp/scssphp.git", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/scssphp/scssphp/zipball/824e4cec10b2bfa88eec5dac23991cb9106622c1", - "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", - "squizlabs/php_codesniffer": "~3.5", - "twbs/bootstrap": "~4.3", - "zurb/foundation": "~6.5" - }, - "time": "2020-06-04T17:30:40+00:00", - "bin": [ - "bin/pscss" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ScssPhp\\ScssPhp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "homepage": "https://github.com/robocoder" - }, - { - "name": "Cédric Morin", - "email": "cedric@yterium.com", - "homepage": "https://github.com/Cerdic" - } - ], - "description": "scssphp is a compiler for SCSS written in PHP.", - "homepage": "http://scssphp.github.io/scssphp/", - "keywords": [ - "css", - "less", - "sass", - "scss", - "stylesheet" - ] - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.18.0", - "version_normalized": "1.18.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2020-07-14T12:35:20+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.18.0", - "version_normalized": "1.18.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2020-07-14T12:35:20+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/translation", - "version": "v3.0.9", - "version_normalized": "3.0.9.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", - "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<2.8" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/intl": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2016-07-30T07:22:48+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Translation Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/validator", - "version": "v2.8.52", - "version_normalized": "2.8.52.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/validator.git", - "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a", - "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation": "~2.4|~3.0.0" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "egulias/email-validator": "^1.2.1", - "symfony/config": "~2.2|~3.0.0", - "symfony/expression-language": "~2.4|~3.0.0", - "symfony/http-foundation": "~2.3|~3.0.0", - "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", - "symfony/property-access": "~2.3|~3.0.0", - "symfony/yaml": "^2.0.5|~3.0.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "egulias/email-validator": "Strict (RFC compliant) email validation", - "symfony/config": "", - "symfony/expression-language": "For using the 2.4 Expression validator", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/property-access": "For using the 2.4 Validator API", - "symfony/yaml": "" - }, - "time": "2018-11-14T14:06:48+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Validator\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Validator Component", - "homepage": "https://symfony.com" - }, - { - "name": "twig/twig", - "version": "v2.13.0", - "version_normalized": "2.13.0.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/46a612ba1bbf6ee1c58acabacd868212ff8a2911", - "reference": "46a612ba1bbf6ee1c58acabacd868212ff8a2911", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" - }, - "time": "2020-07-05T13:08:05+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.13-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - }, - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "funding": [ - { - "url": "https://certification.symfony.com/", - "type": "custom" - }, - { - "url": "https://live.symfony.com/", - "type": "custom" - }, - { - "url": "https://symfony.com/cloud/", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/twig/twig", - "type": "tidelift" - } - ] - }, - { - "name": "zoujingli/wechat-php-sdk", - "version": "v1.3.18", - "version_normalized": "1.3.18.0", - "source": { - "type": "git", - "url": "https://github.com/zoujingli/wechat-php-sdk.git", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-libxml": "*", - "ext-simplexml": "*", - "php": ">=5.3.3" - }, - "time": "2019-10-10T09:42:15+00:00", - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Wechat\\": "./Wechat" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "WeChat development of SDK", - "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", - "keywords": [ - "wechat-php-sdk" - ] - } -] +{ + "packages": [ + { + "name": "braintree/braintree_php", + "version": "3.40.0", + "version_normalized": "3.40.0.0", + "source": { + "type": "git", + "url": "https://github.com/braintree/braintree_php.git", + "reference": "840fc6ebf8d96756fed475cce94565fef178187d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/braintree/braintree_php/zipball/840fc6ebf8d96756fed475cce94565fef178187d", + "reference": "840fc6ebf8d96756fed475cce94565fef178187d", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-dom": "*", + "ext-hash": "*", + "ext-openssl": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, + "time": "2015-07-15T15:07:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Braintree": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Braintree", + "homepage": "http://www.braintreepayments.com" + } + ], + "description": "Braintree PHP Client Library", + "install-path": "../braintree/braintree_php" + }, + { + "name": "cardinity/cardinity-sdk-php", + "version": "v1.0.3", + "version_normalized": "1.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/cardinity/cardinity-sdk-php.git", + "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cardinity/cardinity-sdk-php/zipball/f51f6fbacee393b4eeff7b80be2b1cee77896b4c", + "reference": "f51f6fbacee393b4eeff7b80be2b1cee77896b4c", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~5.1", + "guzzlehttp/log-subscriber": "~1.0", + "guzzlehttp/oauth-subscriber": "0.2.*", + "php": ">=5.4.0", + "symfony/validator": "~2.6" + }, + "require-dev": { + "monolog/monolog": "~1.0", + "phpspec/phpspec": "~2.1", + "phpunit/phpunit": "~4.3" + }, + "time": "2016-12-29T09:57:23+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Cardinity\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Client library for Cardinity credit card processing API", + "homepage": "http://cardinity.com", + "install-path": "../cardinity/cardinity-sdk-php" + }, + { + "name": "divido/divido-php", + "version": "v1.15-stable", + "version_normalized": "1.15.0.0", + "source": { + "type": "git", + "url": "git@github.com:DividoFinancialServices/divido-api-php.git", + "reference": "8edd902ec2be8151331985021107031292b41ca1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DividoFinancialServices/divido-api-php/zipball/8edd902ec2be8151331985021107031292b41ca1", + "reference": "8edd902ec2be8151331985021107031292b41ca1", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.2.0" + }, + "time": "2018-01-21T15:38:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "master": "2.0-dev", + "v1.1.1": "1.1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Divido": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Divido PHP library", + "homepage": "https://www.divido.com/", + "keywords": [ + "api", + "divido", + "finance", + "instalments", + "payment processing" + ], + "install-path": "../divido/divido-php" + }, + { + "name": "guzzlehttp/guzzle", + "version": "5.3.4", + "version_normalized": "5.3.4.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b87eda7a7162f95574032da17e9323c9899cb6b2", + "reference": "b87eda7a7162f95574032da17e9323c9899cb6b2", + "shasum": "" + }, + "require": { + "guzzlehttp/ringphp": "^1.1", + "php": ">=5.4.0", + "react/promise": "^2.2" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0" + }, + "time": "2019-10-30T09:32:00+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "install-path": "../guzzlehttp/guzzle" + }, + { + "name": "guzzlehttp/log-subscriber", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/log-subscriber.git", + "reference": "99c3c0004165db721d8ef7bbef60c996210e538a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/log-subscriber/zipball/99c3c0004165db721d8ef7bbef60c996210e538a", + "reference": "99c3c0004165db721d8ef7bbef60c996210e538a", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~4.0 | ~5.0", + "php": ">=5.4.0", + "psr/log": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2014-10-13T03:31:43+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Subscriber\\Log\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Logs HTTP requests and responses as they are sent over the wire (Guzzle 4+)", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "log", + "plugin" + ], + "abandoned": true, + "install-path": "../guzzlehttp/log-subscriber" + }, + { + "name": "guzzlehttp/oauth-subscriber", + "version": "0.2.0", + "version_normalized": "0.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/oauth-subscriber.git", + "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/oauth-subscriber/zipball/03f1ebe31d3112526106d0570c80eba6820e86e5", + "reference": "03f1ebe31d3112526106d0570c80eba6820e86e5", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~4.0|~5.0", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2014-10-23T22:19:02+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Subscriber\\Oauth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle OAuth 1.0 subscriber", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "oauth" + ], + "install-path": "../guzzlehttp/oauth-subscriber" + }, + { + "name": "guzzlehttp/ringphp", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/RingPHP.git", + "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/5e2a174052995663dd68e6b5ad838afd47dd615b", + "reference": "5e2a174052995663dd68e6b5ad838afd47dd615b", + "shasum": "" + }, + "require": { + "guzzlehttp/streams": "~3.0", + "php": ">=5.4.0", + "react/promise": "~2.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "ext-curl": "Guzzle will use specific adapters if cURL is present" + }, + "time": "2018-07-31T13:22:33+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Ring\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", + "abandoned": true, + "install-path": "../guzzlehttp/ringphp" + }, + { + "name": "guzzlehttp/streams", + "version": "3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/streams.git", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2014-10-12T19:18:40+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple abstraction over streams of data", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "stream" + ], + "abandoned": true, + "install-path": "../guzzlehttp/streams" + }, + { + "name": "klarna/kco_rest", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/klarna/kco_rest_php.git", + "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/klarna/kco_rest_php/zipball/8a2142a2ebb087bb61901d51d1bb9698790e78c5", + "reference": "8a2142a2ebb087bb61901d51d1bb9698790e78c5", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": ">=4.2,<6.0", + "php": ">=5.4.0" + }, + "require-dev": { + "apigen/apigen": "4.0.*", + "klarna/apigen-theme": "~1.0", + "phploc/phploc": "2.0.*", + "phpmd/phpmd": "2.1.*", + "phpunit/phpunit": "4.2.*", + "satooshi/php-coveralls": "0.6.*", + "sebastian/phpcpd": "2.0.*", + "squizlabs/php_codesniffer": "1.5.*" + }, + "time": "2015-12-07T09:51:35+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Klarna AB", + "email": "integration@klarna.com" + } + ], + "description": "Klarna Checkout PHP SDK", + "homepage": "http://developers.klarna.com", + "abandoned": true, + "install-path": "../klarna/kco_rest" + }, + { + "name": "psr/log", + "version": "1.1.3", + "version_normalized": "1.1.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2020-03-23T09:12:05+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "install-path": "../psr/log" + }, + { + "name": "react/promise", + "version": "v2.8.0", + "version_normalized": "2.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + }, + "time": "2020-05-12T15:16:56+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "install-path": "../react/promise" + }, + { + "name": "scssphp/scssphp", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/scssphp/scssphp.git", + "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/scssphp/scssphp/zipball/824e4cec10b2bfa88eec5dac23991cb9106622c1", + "reference": "824e4cec10b2bfa88eec5dac23991cb9106622c1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", + "squizlabs/php_codesniffer": "~3.5", + "twbs/bootstrap": "~4.3", + "zurb/foundation": "~6.5" + }, + "time": "2020-06-04T17:30:40+00:00", + "bin": [ + "bin/pscss" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "ScssPhp\\ScssPhp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "homepage": "https://github.com/robocoder" + }, + { + "name": "Cédric Morin", + "email": "cedric@yterium.com", + "homepage": "https://github.com/Cerdic" + } + ], + "description": "scssphp is a compiler for SCSS written in PHP.", + "homepage": "http://scssphp.github.io/scssphp/", + "keywords": [ + "css", + "less", + "sass", + "scss", + "stylesheet" + ], + "install-path": "../scssphp/scssphp" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.18.0", + "version_normalized": "1.18.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2020-07-14T12:35:20+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-ctype" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.18.0", + "version_normalized": "1.18.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2020-07-14T12:35:20+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/translation", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "time": "2016-07-30T07:22:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "install-path": "../symfony/translation" + }, + { + "name": "symfony/validator", + "version": "v2.8.52", + "version_normalized": "2.8.52.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "reference": "d5d2090bba3139d8ddb79959fbf516e87238fe3a", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.4|~3.0.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.1", + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.4|~3.0.0", + "symfony/http-foundation": "~2.3|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/property-access": "~2.3|~3.0.0", + "symfony/yaml": "^2.0.5|~3.0.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "symfony/config": "", + "symfony/expression-language": "For using the 2.4 Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For using the 2.4 Validator API", + "symfony/yaml": "" + }, + "time": "2018-11-14T14:06:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "https://symfony.com", + "install-path": "../symfony/validator" + }, + { + "name": "twig/twig", + "version": "v3.3.8", + "version_normalized": "3.3.8.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "972d8604a92b7054828b539f2febb0211dd5945c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/972d8604a92b7054828b539f2febb0211dd5945c", + "reference": "972d8604a92b7054828b539f2febb0211dd5945c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + }, + "time": "2022-02-04T06:59:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.3.8" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "install-path": "../twig/twig" + }, + { + "name": "zoujingli/wechat-php-sdk", + "version": "v1.3.18", + "version_normalized": "1.3.18.0", + "source": { + "type": "git", + "url": "https://github.com/zoujingli/wechat-php-sdk.git", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "reference": "d37d0c1919ede2ee54e65100ac3792e947b1e0ef", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "php": ">=5.3.3" + }, + "time": "2019-10-10T09:42:15+00:00", + "type": "project", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WeChat development of SDK", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "keywords": [ + "wechat-php-sdk" + ], + "install-path": "../zoujingli/wechat-php-sdk" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs b/upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs deleted file mode 100644 index 2dd5036c1f2..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/.php_cs +++ /dev/null @@ -1,23 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'declare_strict_types' => false, - 'concat_space' => ['spacing'=>'one'], - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - 'ordered_imports' => true, - // 'phpdoc_align' => ['align'=>'vertical'], - // 'native_function_invocation' => true, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') - ->name('*.php') - ) -; - -return $config; diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md index 464cf1c5007..6ba66a95a7e 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -1,237 +1,26 @@ -# Change Log +# CHANGELOG -## 6.5.5 - 2020-06-16 +## 5.3.4 - 2019-10-30 -* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678) +* Fix: Prevent concurrent writes in `FileCookieJar` -## 6.5.4 - 2020-05-25 +## 5.3.3 - 2018-07-31 -* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) +* Fix bug parsing 0 epoch expiry times +* Fix PHP 7.3 compatibility -## 6.5.3 - 2020-04-18 +## 5.3.2 - 2018-01-15 -* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) -* Remove use of internal functions [#2548](https://github.com/guzzle/guzzle/pull/2548) +* Improve tests +* Fix react promise dependency +* Fix PHP 7 compatibility -## 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) -* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) -* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) -* Fix: `RetryMiddleware` did not do exponential delay between retries due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) - Previously, `RetryMiddleware` would sleep for 1 millisecond, then 2 milliseconds, then 4 milliseconds. - **After this change, `RetryMiddleware` will sleep for 1 second, then 2 seconds, then 4 seconds.** - `Middleware::retry()` accepts a second callback parameter to override the default timeouts if needed. -* 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) -* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) -* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) -* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) -* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) -* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) -* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) -* 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 - - -## 6.3.2 - 2018-03-26 - -* Fix: Release process - - -## 6.3.1 - 2018-03-26 - -* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) -* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) -* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) -* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) -* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) -* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) -* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) - -+ Minor code cleanups, documentation fixes and clarifications. - - -## 6.3.0 - 2017-06-22 - -* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) -* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) -* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) -* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) -* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) -* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) -* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) -* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) -* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) -* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) -* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) -* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) -* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) -* 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 -* Only add scheme when host is present -* Fix drain case where content-length is the literal string zero -* Obfuscate in-URL credentials in exceptions - -## 6.2.1 - 2016-07-18 +## 5.3.1 - 2016-07-18 * Address HTTP_PROXY security vulnerability, CVE-2016-5385: https://httpoxy.org/ -* Fixing timeout bug with StreamHandler: - https://github.com/guzzle/guzzle/pull/1488 -* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when - 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`. - https://github.com/guzzle/guzzle/pull/1389 -* Bug fix: Fix sleep calculation when waiting for delayed requests. - https://github.com/guzzle/guzzle/pull/1324 -* Feature: More flexible history containers. - https://github.com/guzzle/guzzle/pull/1373 -* Bug fix: defer sink stream opening in StreamHandler. - https://github.com/guzzle/guzzle/pull/1377 -* Bug fix: do not attempt to escape cookie values. - https://github.com/guzzle/guzzle/pull/1406 -* Feature: report original content encoding and length on decoded responses. - https://github.com/guzzle/guzzle/pull/1409 -* Bug fix: rewind seekable request bodies before dispatching to cURL. - https://github.com/guzzle/guzzle/pull/1422 -* 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 - https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 -* Feature: HandlerStack is now more generic. - https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e -* Bug fix: setting verify to false in the StreamHandler now disables peer - verification. https://github.com/guzzle/guzzle/issues/1256 -* Feature: Middleware now uses an exception factory, including more error - context. https://github.com/guzzle/guzzle/pull/1282 -* Feature: better support for disabled functions. - https://github.com/guzzle/guzzle/pull/1287 -* 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 - statistics for requests. https://github.com/guzzle/guzzle/pull/1202 -* Feature: Added the ability to persist session cookies in CookieJars. - https://github.com/guzzle/guzzle/pull/1195 -* Feature: Some compatibility updates for Google APP Engine - https://github.com/guzzle/guzzle/pull/1216 -* Feature: Added support for NO_PROXY to prevent the use of a proxy based on - a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 -* Feature: Cookies can now contain square brackets. - https://github.com/guzzle/guzzle/pull/1237 -* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. - https://github.com/guzzle/guzzle/pull/1232 -* Bug fix: Cusotm cURL options now correctly override curl options of the - same name. https://github.com/guzzle/guzzle/pull/1221 -* Bug fix: Content-Type header is now added when using an explicitly provided - multipart body. https://github.com/guzzle/guzzle/pull/1218 -* Bug fix: Now ignoring Set-Cookie headers that have no name. -* Bug fix: Reason phrase is no longer cast to an int in some cases in the - cURL handler. https://github.com/guzzle/guzzle/pull/1187 -* Bug fix: Remove the Authorization header when redirecting if the Host - header changes. https://github.com/guzzle/guzzle/pull/1207 -* Bug fix: Cookie path matching fixes - https://github.com/guzzle/guzzle/issues/1129 -* Bug fix: Fixing the cURL `body_as_string` setting - https://github.com/guzzle/guzzle/pull/1201 -* Bug fix: quotes are no longer stripped when parsing cookies. - https://github.com/guzzle/guzzle/issues/1172 -* Bug fix: `form_params` and `query` now always uses the `&` separator. - https://github.com/guzzle/guzzle/pull/1163 -* 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 - were not being removed by `curl_reset`. -* Cookies are now extracted properly before redirects. -* Cookies now allow more character ranges. -* Decoded Content-Encoding responses are now modified to correctly reflect - their state if the encoding was automatically removed by a handler. This - means that the `Content-Encoding` header may be removed an the - `Content-Length` modified to reflect the message size after removing the - encoding. -* Added a more explicit error message when trying to use `form_params` and - `multipart` in the same request. -* Several fixes for HHVM support. -* 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 `&` - separator was missing. -* Added a better error message for when `body` is provided as an array. Please - use `form_params` or `multipart` instead. -* Various doc fixes. - -## 6.0.0 - 2015-05-26 - -* See the UPGRADING.md document for more information. -* Added `multipart` and `form_params` request options. -* Added `synchronous` request option. -* Added the `on_headers` request option. -* Fixed `expect` handling. -* No longer adding default middlewares in the client ctor. These need to be - present on the provided handler in order to work. -* Requests are no longer initiated when sending async requests with the - CurlMultiHandler. This prevents unexpected recursion from requests completing - while ticking the cURL loop. -* Removed the semantics of setting `default` to `true`. This is no longer - required now that the cURL loop is not ticked for async requests. -* Added request and response logging middleware. -* No longer allowing self signed certificates when using the StreamHandler. -* Ensuring that `sink` is valid if saving to a file. -* Request exceptions now include a "handler context" which provides handler - specific contextual information. -* Added `GuzzleHttp\RequestOptions` to allow request options to be applied - using constants. -* `$maxHandles` has been removed from CurlMultiHandler. -* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. +* Event name fix: https://github.com/guzzle/guzzle/commit/fcae91ff31de41e312fe113ec3acbcda31b2622e +* Response header case sensitivity fix: https://github.com/guzzle/guzzle/commit/043eeadf20ee40ddc6712faee4d3957a91f2b041 ## 5.3.0 - 2015-05-19 @@ -243,58 +32,6 @@ * Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. * URL scheme is now always lowercased. -## 6.0.0-beta.1 - -* Requires PHP >= 5.5 -* Updated to use PSR-7 - * Requires immutable messages, which basically means an event based system - owned by a request instance is no longer possible. - * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). - * Removed the dependency on `guzzlehttp/streams`. These stream abstractions - are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` - namespace. -* Added middleware and handler system - * Replaced the Guzzle event and subscriber system with a middleware system. - * No longer depends on RingPHP, but rather places the HTTP handlers directly - in Guzzle, operating on PSR-7 messages. - * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which - means the `guzzlehttp/retry-subscriber` is now obsolete. - * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. -* Asynchronous responses - * No longer supports the `future` request option to send an async request. - Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, - `getAsync`, etc.). - * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid - recursion required by chaining and forwarding react promises. See - https://github.com/guzzle/promises - * Added `requestAsync` and `sendAsync` to send request asynchronously. - * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests - asynchronously. -* Request options - * POST and form updates - * Added the `form_fields` and `form_files` request options. - * Removed the `GuzzleHttp\Post` namespace. - * The `body` request option no longer accepts an array for POST requests. - * The `exceptions` request option has been deprecated in favor of the - `http_errors` request options. - * The `save_to` request option has been deprecated in favor of `sink` request - option. -* Clients no longer accept an array of URI template string and variables for - URI variables. You will need to expand URI templates before passing them - into a client constructor or request method. -* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are - now magic methods that will send synchronous requests. -* Replaced `Utils.php` with plain functions in `functions.php`. -* Removed `GuzzleHttp\Collection`. -* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as - an array. -* Removed `GuzzleHttp\Query`. Query string handling is now handled using an - associative array passed into the `query` request option. The query string - is serialized using PHP's `http_build_query`. If you need more control, you - can pass the query string in as a string. -* `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 @@ -852,7 +589,7 @@ interfaces. * Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference to help with refcount based garbage collection of resources created by sending a request * Deprecating ZF1 cache and log adapters. These will be removed in the next major version. -* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it'sdeprecated). Use the HistoryPlugin for a history. * Added a `responseBody` alias for the `response_body` location * Refactored internals to no longer rely on Response::getRequest() diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile b/upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile deleted file mode 100644 index f6a095230e8..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM composer:latest as setup - -RUN mkdir /guzzle - -WORKDIR /guzzle - -RUN set -xe \ - && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ - && composer require guzzlehttp/guzzle - - -FROM php:7.3 - -RUN mkdir /guzzle - -WORKDIR /guzzle - -COPY --from=setup /guzzle /guzzle diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE b/upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE index 50a177b0320..9af9fba6828 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling +Copyright (c) 2011-2015 Michael Dowling, https://github.com/mtdowling 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/upload/system/storage/vendor/guzzlehttp/guzzle/README.md b/upload/system/storage/vendor/guzzlehttp/guzzle/README.md index 5fdb6c5f42d..d41e7e75880 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/README.md +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/README.md @@ -1,49 +1,48 @@ -Guzzle, PHP HTTP client -======================= +Guzzle, PHP HTTP client and webservice framework +================================================ -[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) -[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) -[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) +[![Build Status](https://secure.travis-ci.org/guzzle/guzzle.svg?branch=master)](http://travis-ci.org/guzzle/guzzle) Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. -- Simple interface for building query strings, POST requests, streaming large - uploads, streaming large downloads, using HTTP cookies, uploading JSON data, - etc... -- Can send both synchronous and asynchronous requests using the same interface. -- Uses PSR-7 interfaces for requests, responses, and streams. This allows you - to utilize other PSR-7 compatible libraries with Guzzle. -- Abstracts away the underlying HTTP transport, allowing you to write - environment and transport agnostic code; i.e., no hard dependency on cURL, - PHP streams, sockets, or non-blocking event loops. -- Middleware system allows you to augment and compose client behavior. +- Manages things like persistent connections, represents query strings as + collections, simplifies sending streaming POST requests with fields and + files, and abstracts away the underlying HTTP transport layer. +- Can send both synchronous and asynchronous requests using the same interface + without requiring a dependency on a specific event loop. +- Pluggable HTTP adapters allows Guzzle to integrate with any method you choose + for sending HTTP requests over the wire (e.g., cURL, sockets, PHP's stream + wrapper, non-blocking event loops like ReactPHP. +- Guzzle makes it so that you no longer need to fool around with cURL options, + stream contexts, or sockets. ```php -$client = new \GuzzleHttp\Client(); -$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); - -echo $response->getStatusCode(); # 200 -echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8' -echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}' - -# Send an asynchronous request. -$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); -$promise = $client->sendAsync($request)->then(function ($response) { - echo 'I completed! ' . $response->getBody(); +$client = new GuzzleHttp\Client(); +$response = $client->get('http://guzzlephp.org'); +$res = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]); +echo $res->getStatusCode(); +// "200" +echo $res->getHeader('content-type'); +// 'application/json; charset=utf8' +echo $res->getBody(); +// {"type":"User"...' +var_export($res->json()); +// Outputs the JSON decoded data + +// Send an asynchronous request. +$req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]); +$client->send($req)->then(function ($response) { + echo 'I completed! ' . $response; }); - -$promise->wait(); ``` -## Help and docs - -- [Documentation](http://guzzlephp.org/) -- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) -- [Gitter](https://gitter.im/guzzle/guzzle) - +Get more information and answers with the +[Documentation](http://guzzlephp.org/), +[Forums](https://groups.google.com/forum/?hl=en#!forum/guzzle), +and [Gitter](https://gitter.im/guzzle/guzzle). -## Installing Guzzle +### Installing via Composer The recommended way to install Guzzle is through [Composer](http://getcomposer.org). @@ -56,7 +55,7 @@ curl -sS https://getcomposer.org/installer | php Next, run the Composer command to install the latest stable version of Guzzle: ```bash -composer require guzzlehttp/guzzle +composer.phar require guzzlehttp/guzzle ``` After installing, you need to require Composer's autoloader: @@ -65,26 +64,7 @@ After installing, you need to require Composer's autoloader: require 'vendor/autoload.php'; ``` -You can then later update Guzzle using composer: - - ```bash -composer update - ``` - - -## 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 | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | +### Documentation -[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 -[guzzle-3-docs]: http://guzzle3.readthedocs.org -[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ -[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ +More information can be found in the online documentation at +http://guzzlephp.org/. diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md b/upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md index 91d1dcc9931..2b3877fa873 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -1,159 +1,6 @@ Guzzle Upgrade Guide ==================== -5.0 to 6.0 ----------- - -Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages. -Due to the fact that these messages are immutable, this prompted a refactoring -of Guzzle to use a middleware based system rather than an event system. Any -HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be -updated to work with the new immutable PSR-7 request and response objects. Any -event listeners or subscribers need to be updated to become middleware -functions that wrap handlers (or are injected into a -`GuzzleHttp\HandlerStack`). - -- Removed `GuzzleHttp\BatchResults` -- Removed `GuzzleHttp\Collection` -- Removed `GuzzleHttp\HasDataTrait` -- Removed `GuzzleHttp\ToArrayInterface` -- The `guzzlehttp/streams` dependency has been removed. Stream functionality - is now present in the `GuzzleHttp\Psr7` namespace provided by the - `guzzlehttp/psr7` package. -- Guzzle no longer uses ReactPHP promises and now uses the - `guzzlehttp/promises` library. We use a custom promise library for three - significant reasons: - 1. React promises (at the time of writing this) are recursive. Promise - chaining and promise resolution will eventually blow the stack. Guzzle - promises are not recursive as they use a sort of trampolining technique. - Note: there has been movement in the React project to modify promises to - no longer utilize recursion. - 2. Guzzle needs to have the ability to synchronously block on a promise to - wait for a result. Guzzle promises allows this functionality (and does - not require the use of recursion). - 3. Because we need to be able to wait on a result, doing so using React - promises requires wrapping react promises with RingPHP futures. This - overhead is no longer needed, reducing stack sizes, reducing complexity, - and improving performance. -- `GuzzleHttp\Mimetypes` has been moved to a function in - `GuzzleHttp\Psr7\mimetype_from_extension` and - `GuzzleHttp\Psr7\mimetype_from_filename`. -- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query - strings must now be passed into request objects as strings, or provided to - the `query` request option when creating requests with clients. The `query` - option uses PHP's `http_build_query` to convert an array to a string. If you - need a different serialization technique, you will need to pass the query - string in as a string. There are a couple helper functions that will make - working with query strings easier: `GuzzleHttp\Psr7\parse_query` and - `GuzzleHttp\Psr7\build_query`. -- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware - system based on PSR-7, using RingPHP and it's middleware system as well adds - more complexity than the benefits it provides. All HTTP handlers that were - present in RingPHP have been modified to work directly with PSR-7 messages - and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces - complexity in Guzzle, removes a dependency, and improves performance. RingPHP - will be maintained for Guzzle 5 support, but will no longer be a part of - Guzzle 6. -- As Guzzle now uses a middleware based systems the event system and RingPHP - integration has been removed. Note: while the event system has been removed, - it is possible to add your own type of event system that is powered by the - middleware system. - - Removed the `Event` namespace. - - Removed the `Subscriber` namespace. - - Removed `Transaction` class - - Removed `RequestFsm` - - Removed `RingBridge` - - `GuzzleHttp\Subscriber\Cookie` is now provided by - `GuzzleHttp\Middleware::cookies` - - `GuzzleHttp\Subscriber\HttpError` is now provided by - `GuzzleHttp\Middleware::httpError` - - `GuzzleHttp\Subscriber\History` is now provided by - `GuzzleHttp\Middleware::history` - - `GuzzleHttp\Subscriber\Mock` is now provided by - `GuzzleHttp\Handler\MockHandler` - - `GuzzleHttp\Subscriber\Prepare` is now provided by - `GuzzleHttp\PrepareBodyMiddleware` - - `GuzzleHttp\Subscriber\Redirect` is now provided by - `GuzzleHttp\RedirectMiddleware` -- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in - `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. -- Static functions in `GuzzleHttp\Utils` have been moved to namespaced - functions under the `GuzzleHttp` namespace. This requires either a Composer - based autoloader or you to include functions.php. -- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to - `GuzzleHttp\ClientInterface::getConfig`. -- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. -- The `json` and `xml` methods of response objects has been removed. With the - migration to strictly adhering to PSR-7 as the interface for Guzzle messages, - adding methods to message interfaces would actually require Guzzle messages - to extend from PSR-7 messages rather then work with them directly. - -## Migrating to middleware - -The change to PSR-7 unfortunately required significant refactoring to Guzzle -due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event -system from plugins. The event system relied on mutability of HTTP messages and -side effects in order to work. With immutable messages, you have to change your -workflow to become more about either returning a value (e.g., functional -middlewares) or setting a value on an object. Guzzle v6 has chosen the -functional middleware approach. - -Instead of using the event system to listen for things like the `before` event, -you now create a stack based middleware function that intercepts a request on -the way in and the promise of the response on the way out. This is a much -simpler and more predictable approach than the event system and works nicely -with PSR-7 middleware. Due to the use of promises, the middleware system is -also asynchronous. - -v5: - -```php -use GuzzleHttp\Event\BeforeEvent; -$client = new GuzzleHttp\Client(); -// Get the emitter and listen to the before event. -$client->getEmitter()->on('before', function (BeforeEvent $e) { - // Guzzle v5 events relied on mutation - $e->getRequest()->setHeader('X-Foo', 'Bar'); -}); -``` - -v6: - -In v6, you can modify the request before it is sent using the `mapRequest` -middleware. The idiomatic way in v6 to modify the request/response lifecycle is -to setup a handler middleware stack up front and inject the handler into a -client. - -```php -use GuzzleHttp\Middleware; -// Create a handler stack that has all of the default middlewares attached -$handler = GuzzleHttp\HandlerStack::create(); -// Push the handler onto the handler stack -$handler->push(Middleware::mapRequest(function (RequestInterface $request) { - // Notice that we have to return a request object - return $request->withHeader('X-Foo', 'Bar'); -})); -// Inject the handler into the client -$client = new GuzzleHttp\Client(['handler' => $handler]); -``` - -## POST Requests - -This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) -and `multipart` request options. `form_params` is an associative array of -strings or array of strings and is used to serialize an -`application/x-www-form-urlencoded` POST request. The -[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) -option is now used to send a multipart/form-data POST request. - -`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add -POST files to a multipart/form-data request. - -The `body` option no longer accepts an array to send POST requests. Please use -`multipart` or `form_params` instead. - -The `base_url` option has been renamed to `base_uri`. - 4.x to 5.0 ---------- @@ -600,7 +447,7 @@ these if needed): The following plugins are not part of the core Guzzle package, but are provided in separate repositories: -- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be muchs simpler to build custom retry policies using simple functions rather than various chained classes. See: https://github.com/guzzle/retry-subscriber - `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to @@ -664,8 +511,8 @@ that contain additional metadata accessible via `getMetadata()`. The entire concept of the StreamRequestFactory has been removed. The way this was used in Guzzle 3 broke the actual interface of sending streaming requests -(instead of getting back a Response, you got a StreamInterface). Streaming -PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. +(instead of getting back a Response, you got a StreamInterface). Streeaming +PHP requests are now implemented throught the `GuzzleHttp\Adapter\StreamAdapter`. 3.6 to 3.7 ---------- diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/composer.json b/upload/system/storage/vendor/guzzlehttp/guzzle/composer.json index c01864f013f..d8bb1203848 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/composer.json +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/composer.json @@ -1,16 +1,8 @@ { "name": "guzzlehttp/guzzle", "type": "library", - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "framework", - "http", - "rest", - "web service", - "curl", - "client", - "HTTP client" - ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"], "homepage": "http://guzzlephp.org/", "license": "MIT", "authors": [ @@ -21,39 +13,26 @@ } ], "require": { - "php": ">=5.5", - "ext-json": "*", - "symfony/polyfill-intl-idn": "^1.17.0", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1" + "php": ">=5.4.0", + "guzzlehttp/ringphp": "^1.1", + "react/promise": "^2.2" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "6.5-dev" - } + "phpunit/phpunit": "^4.0" }, "autoload": { "psr-4": { "GuzzleHttp\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "autoload-dev": { "psr-4": { "GuzzleHttp\\Tests\\": "tests/" } + }, + "scripts": { + "test": "make test", + "test-ci": "make coverage" } } diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php index 315a022cf4b..cf5dd469a9e 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Client.php @@ -1,501 +1,362 @@ 'http://www.foo.com/1.0/', - * 'timeout' => 0, - * 'allow_redirects' => false, - * 'proxy' => '192.168.16.1:10' + * 'base_url' => [ + * 'http://www.foo.com/{version}/', + * ['version' => '123'] + * ], + * 'defaults' => [ + * 'timeout' => 10, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ] * ]); * - * Client configuration settings include the following options: - * - * - handler: (callable) Function that transfers HTTP requests over the - * wire. The function is called with a Psr7\Http\Message\RequestInterface - * and array of transfer options, and must return a - * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a - * Psr7\Http\Message\ResponseInterface on success. - * If no handler is provided, a default handler will be created - * that enables all of the request options below by attaching all of the - * default middleware to the handler. - * - base_uri: (string|UriInterface) Base URI of the client that is merged - * into relative URIs. Can be a string or instance of UriInterface. - * - **: any request option - * - * @param array $config Client configuration settings. - * - * @see \GuzzleHttp\RequestOptions for a list of available request options. + * @param array $config Client configuration settings + * - base_url: Base URL of the client that is merged into relative URLs. + * Can be a string or an array that contains a URI template followed + * by an associative array of expansion variables to inject into the + * URI template. + * - handler: callable RingPHP handler used to transfer requests + * - message_factory: Factory used to create request and response object + * - defaults: Default request options to apply to each request + * - emitter: Event emitter used for request events + * - fsm: (internal use only) The request finite state machine. A + * function that accepts a transaction and optional final state. The + * function is responsible for transitioning a request through its + * lifecycle events. */ public function __construct(array $config = []) { - if (!isset($config['handler'])) { - $config['handler'] = HandlerStack::create(); - } elseif (!is_callable($config['handler'])) { - throw new \InvalidArgumentException('handler must be a callable'); - } + $this->configureBaseUrl($config); + $this->configureDefaults($config); - // Convert the base_uri to a UriInterface - if (isset($config['base_uri'])) { - $config['base_uri'] = Psr7\uri_for($config['base_uri']); + if (isset($config['emitter'])) { + $this->emitter = $config['emitter']; } - $this->configureDefaults($config); + $this->messageFactory = isset($config['message_factory']) + ? $config['message_factory'] + : new MessageFactory(); + + if (isset($config['fsm'])) { + $this->fsm = $config['fsm']; + } else { + if (isset($config['handler'])) { + $handler = $config['handler']; + } elseif (isset($config['adapter'])) { + $handler = $config['adapter']; + } else { + $handler = Utils::getDefaultHandler(); + } + $this->fsm = new RequestFsm($handler, $this->messageFactory); + } } - /** - * @param string $method - * @param array $args - * - * @return Promise\PromiseInterface - */ - public function __call($method, $args) + public function getDefaultOption($keyOrPath = null) { - if (count($args) < 1) { - throw new \InvalidArgumentException('Magic request methods require a URI and optional options array'); - } + return $keyOrPath === null + ? $this->defaults + : Utils::getPath($this->defaults, $keyOrPath); + } - $uri = $args[0]; - $opts = isset($args[1]) ? $args[1] : []; + public function setDefaultOption($keyOrPath, $value) + { + Utils::setPath($this->defaults, $keyOrPath, $value); + } - return substr($method, -5) === 'Async' - ? $this->requestAsync(substr($method, 0, -5), $uri, $opts) - : $this->request($method, $uri, $opts); + public function getBaseUrl() + { + return (string) $this->baseUrl; } - /** - * Asynchronously send an HTTP request. - * - * @param array $options Request options to apply to the given - * request and to the transfer. See \GuzzleHttp\RequestOptions. - * - * @return Promise\PromiseInterface - */ - public function sendAsync(RequestInterface $request, array $options = []) + public function createRequest($method, $url = null, array $options = []) { - // Merge the base URI into the request URI if needed. - $options = $this->prepareDefaults($options); + $options = $this->mergeDefaults($options); + // Use a clone of the client's emitter + $options['config']['emitter'] = clone $this->getEmitter(); + $url = $url || (is_string($url) && strlen($url)) + ? $this->buildUrl($url) + : (string) $this->baseUrl; + + return $this->messageFactory->createRequest($method, $url, $options); + } - return $this->transfer( - $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), - $options - ); + public function get($url = null, $options = []) + { + return $this->send($this->createRequest('GET', $url, $options)); } - /** - * Send an HTTP request. - * - * @param array $options Request options to apply to the given - * request and to the transfer. See \GuzzleHttp\RequestOptions. - * - * @return ResponseInterface - * @throws GuzzleException - */ - public function send(RequestInterface $request, array $options = []) + public function head($url = null, array $options = []) { - $options[RequestOptions::SYNCHRONOUS] = true; - return $this->sendAsync($request, $options)->wait(); + return $this->send($this->createRequest('HEAD', $url, $options)); } - /** - * Create and send an asynchronous HTTP request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string $method HTTP method - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. - * - * @return Promise\PromiseInterface - */ - public function requestAsync($method, $uri = '', array $options = []) + public function delete($url = null, array $options = []) { - $options = $this->prepareDefaults($options); - // Remove request modifying parameter because it can be done up-front. - $headers = isset($options['headers']) ? $options['headers'] : []; - $body = isset($options['body']) ? $options['body'] : null; - $version = isset($options['version']) ? $options['version'] : '1.1'; - // Merge the URI into the base URI. - $uri = $this->buildUri($uri, $options); - if (is_array($body)) { - $this->invalidBody(); - } - $request = new Psr7\Request($method, $uri, $headers, $body, $version); - // Remove the option so that they are not doubly-applied. - unset($options['headers'], $options['body'], $options['version']); + return $this->send($this->createRequest('DELETE', $url, $options)); + } - return $this->transfer($request, $options); + public function put($url = null, array $options = []) + { + return $this->send($this->createRequest('PUT', $url, $options)); } - /** - * Create and send an HTTP request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string $method HTTP method. - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. - * - * @return ResponseInterface - * @throws GuzzleException - */ - public function request($method, $uri = '', array $options = []) + public function patch($url = null, array $options = []) { - $options[RequestOptions::SYNCHRONOUS] = true; - return $this->requestAsync($method, $uri, $options)->wait(); + return $this->send($this->createRequest('PATCH', $url, $options)); } - /** - * Get a client configuration option. - * - * These options include default request options of the client, a "handler" - * (if utilized by the concrete client), and a "base_uri" if utilized by - * the concrete client. - * - * @param string|null $option The config option to retrieve. - * - * @return mixed - */ - public function getConfig($option = null) + public function post($url = null, array $options = []) { - return $option === null - ? $this->config - : (isset($this->config[$option]) ? $this->config[$option] : null); + return $this->send($this->createRequest('POST', $url, $options)); } - /** - * @param string|null $uri - * - * @return UriInterface - */ - private function buildUri($uri, array $config) + public function options($url = null, array $options = []) { - // for BC we accept null which would otherwise fail in uri_for - $uri = Psr7\uri_for($uri === null ? '' : $uri); + return $this->send($this->createRequest('OPTIONS', $url, $options)); + } - if (isset($config['base_uri'])) { - $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); - } + public function send(RequestInterface $request) + { + $isFuture = $request->getConfig()->get('future'); + $trans = new Transaction($this, $request, $isFuture); + $fn = $this->fsm; - if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { - $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion']; - $uri = Utils::idnUriConvert($uri, $idnOptions); + try { + $fn($trans); + if ($isFuture) { + // Turn the normal response into a future if needed. + return $trans->response instanceof FutureInterface + ? $trans->response + : new FutureResponse(new FulfilledPromise($trans->response)); + } + // Resolve deep futures if this is not a future + // transaction. This accounts for things like retries + // that do not have an immediate side-effect. + while ($trans->response instanceof FutureInterface) { + $trans->response = $trans->response->wait(); + } + return $trans->response; + } catch (\Exception $e) { + if ($isFuture) { + // Wrap the exception in a promise + return new FutureResponse(new RejectedPromise($e)); + } + throw RequestException::wrapException($trans->request, $e); + } catch (\TypeError $error) { + $exception = new \Exception($error->getMessage(), $error->getCode(), $error); + if ($isFuture) { + // Wrap the exception in a promise + return new FutureResponse(new RejectedPromise($exception)); + } + throw RequestException::wrapException($trans->request, $exception); } - - return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; } /** - * Configures the default options for a client. + * Get an array of default options to apply to the client * - * @param array $config - * @return void + * @return array */ - private function configureDefaults(array $config) + protected function getDefaultOptions() { - $defaults = [ - 'allow_redirects' => RedirectMiddleware::$defaultSettings, - 'http_errors' => true, + $settings = [ + 'allow_redirects' => true, + 'exceptions' => true, 'decode_content' => true, - 'verify' => true, - 'cookies' => false, - 'idn_conversion' => true, + 'verify' => true ]; // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. - // We can only trust the HTTP_PROXY environment variable in a CLI // process due to the fact that PHP has no reliable mechanism to // get environment variables that start with "HTTP_". - if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) { - $defaults['proxy']['http'] = getenv('HTTP_PROXY'); + if (php_sapi_name() == 'cli' && getenv('HTTP_PROXY')) { + $settings['proxy']['http'] = getenv('HTTP_PROXY'); } if ($proxy = getenv('HTTPS_PROXY')) { - $defaults['proxy']['https'] = $proxy; - } - - if ($noProxy = getenv('NO_PROXY')) { - $cleanedNoProxy = str_replace(' ', '', $noProxy); - $defaults['proxy']['no'] = explode(',', $cleanedNoProxy); + $settings['proxy']['https'] = $proxy; } - $this->config = $config + $defaults; - - if (!empty($config['cookies']) && $config['cookies'] === true) { - $this->config['cookies'] = new CookieJar(); - } - - // Add the default user-agent header. - if (!isset($this->config['headers'])) { - $this->config['headers'] = ['User-Agent' => default_user_agent()]; - } else { - // Add the User-Agent header if one was not already set. - foreach (array_keys($this->config['headers']) as $name) { - if (strtolower($name) === 'user-agent') { - return; - } - } - $this->config['headers']['User-Agent'] = default_user_agent(); - } + return $settings; } /** - * Merges default options into the array. - * - * @param array $options Options to modify by reference + * Expand a URI template and inherit from the base URL if it's relative * - * @return array + * @param string|array $url URL or an array of the URI template to expand + * followed by a hash of template varnames. + * @return string + * @throws \InvalidArgumentException */ - private function prepareDefaults(array $options) + private function buildUrl($url) { - $defaults = $this->config; - - if (!empty($defaults['headers'])) { - // Default headers are only added if they are not present. - $defaults['_conditional'] = $defaults['headers']; - unset($defaults['headers']); + // URI template (absolute or relative) + if (!is_array($url)) { + return strpos($url, '://') + ? (string) $url + : (string) $this->baseUrl->combine($url); } - // Special handling for headers is required as they are added as - // conditional headers and as headers passed to a request ctor. - if (array_key_exists('headers', $options)) { - // Allows default headers to be unset. - if ($options['headers'] === null) { - $defaults['_conditional'] = []; - unset($options['headers']); - } elseif (!is_array($options['headers'])) { - throw new \InvalidArgumentException('headers must be an array'); - } + if (!isset($url[1])) { + throw new \InvalidArgumentException('You must provide a hash of ' + . 'varname options in the second element of a URL array.'); } - // Shallow merge defaults underneath options. - $result = $options + $defaults; - - // Remove null values. - foreach ($result as $k => $v) { - if ($v === null) { - unset($result[$k]); - } + // Absolute URL + if (strpos($url[0], '://')) { + return Utils::uriTemplate($url[0], $url[1]); } - return $result; + // Combine the relative URL with the base URL + return (string) $this->baseUrl->combine( + Utils::uriTemplate($url[0], $url[1]) + ); } - /** - * Transfers the given request and applies request options. - * - * The URI of the request is not modified and the request options are used - * as-is without merging in default options. - * - * @param array $options See \GuzzleHttp\RequestOptions. - * - * @return Promise\PromiseInterface - */ - private function transfer(RequestInterface $request, array $options) + private function configureBaseUrl(&$config) { - // save_to -> sink - if (isset($options['save_to'])) { - $options['sink'] = $options['save_to']; - unset($options['save_to']); + if (!isset($config['base_url'])) { + $this->baseUrl = new Url('', ''); + } elseif (!is_array($config['base_url'])) { + $this->baseUrl = Url::fromString($config['base_url']); + } elseif (count($config['base_url']) < 2) { + throw new \InvalidArgumentException('You must provide a hash of ' + . 'varname options in the second element of a base_url array.'); + } else { + $this->baseUrl = Url::fromString( + Utils::uriTemplate( + $config['base_url'][0], + $config['base_url'][1] + ) + ); + $config['base_url'] = (string) $this->baseUrl; } + } - // exceptions -> http_errors - if (isset($options['exceptions'])) { - $options['http_errors'] = $options['exceptions']; - unset($options['exceptions']); + private function configureDefaults($config) + { + if (!isset($config['defaults'])) { + $this->defaults = $this->getDefaultOptions(); + } else { + $this->defaults = array_replace( + $this->getDefaultOptions(), + $config['defaults'] + ); } - $request = $this->applyOptions($request, $options); - /** @var HandlerStack $handler */ - $handler = $options['handler']; - - try { - return Promise\promise_for($handler($request, $options)); - } catch (\Exception $e) { - return Promise\rejection_for($e); + // Add the default user-agent header + if (!isset($this->defaults['headers'])) { + $this->defaults['headers'] = [ + 'User-Agent' => Utils::getDefaultUserAgent() + ]; + } elseif (!Core::hasHeader($this->defaults, 'User-Agent')) { + // Add the User-Agent header if one was not already set + $this->defaults['headers']['User-Agent'] = Utils::getDefaultUserAgent(); } } /** - * Applies the array of request options to a request. + * Merges default options into the array passed by reference. * - * @param RequestInterface $request - * @param array $options + * @param array $options Options to modify by reference * - * @return RequestInterface + * @return array */ - private function applyOptions(RequestInterface $request, array &$options) + private function mergeDefaults($options) { - $modify = [ - 'set_headers' => [], - ]; - - if (isset($options['headers'])) { - $modify['set_headers'] = $options['headers']; - unset($options['headers']); - } - - 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.'); - } - $options['body'] = http_build_query($options['form_params'], '', '&'); - unset($options['form_params']); - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; - } - - if (isset($options['multipart'])) { - $options['body'] = new Psr7\MultipartStream($options['multipart']); - unset($options['multipart']); - } - - if (isset($options['json'])) { - $options['body'] = \GuzzleHttp\json_encode($options['json']); - unset($options['json']); - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'application/json'; - } - - if (!empty($options['decode_content']) - && $options['decode_content'] !== true - ) { - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); - $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; - } - - if (isset($options['body'])) { - if (is_array($options['body'])) { - $this->invalidBody(); - } - $modify['body'] = Psr7\stream_for($options['body']); - unset($options['body']); - } - - if (!empty($options['auth']) && is_array($options['auth'])) { - $value = $options['auth']; - $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; - switch ($type) { - case 'basic': - // Ensure that we don't have the header in different case and set the new value. - $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); - $modify['set_headers']['Authorization'] = 'Basic ' - . base64_encode("$value[0]:$value[1]"); - break; - case 'digest': - // @todo: Do not rely on curl - $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST; - $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; - break; - case 'ntlm': - $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM; - $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; - break; - } - } - - if (isset($options['query'])) { - $value = $options['query']; - if (is_array($value)) { - $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986); + $defaults = $this->defaults; + + // Case-insensitively merge in default headers if both defaults and + // options have headers specified. + if (!empty($defaults['headers']) && !empty($options['headers'])) { + // Create a set of lowercased keys that are present. + $lkeys = []; + foreach (array_keys($options['headers']) as $k) { + $lkeys[strtolower($k)] = true; } - if (!is_string($value)) { - throw new \InvalidArgumentException('query must be a string or array'); + // Merge in lowercase default keys when not present in above set. + foreach ($defaults['headers'] as $key => $value) { + if (!isset($lkeys[strtolower($key)])) { + $options['headers'][$key] = $value; + } } - $modify['query'] = $value; - unset($options['query']); + // No longer need to merge in headers. + unset($defaults['headers']); } - // Ensure that sink is not an invalid value. - if (isset($options['sink'])) { - // TODO: Add more sink validation? - if (is_bool($options['sink'])) { - throw new \InvalidArgumentException('sink must not be a boolean'); + $result = array_replace_recursive($defaults, $options); + foreach ($options as $k => $v) { + if ($v === null) { + unset($result[$k]); } } - $request = Psr7\modify_request($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\_caseless_remove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' - . $request->getBody()->getBoundary(); - } + return $result; + } - // Merge in conditional headers if they are not present. - if (isset($options['_conditional'])) { - // Build up the changes so it's in a single clone of the message. - $modify = []; - foreach ($options['_conditional'] as $k => $v) { - if (!$request->hasHeader($k)) { - $modify['set_headers'][$k] = $v; - } - } - $request = Psr7\modify_request($request, $modify); - // Don't pass this internal value along to middleware/handlers. - unset($options['_conditional']); - } + /** + * @deprecated Use {@see GuzzleHttp\Pool} instead. + * @see GuzzleHttp\Pool + */ + public function sendAll($requests, array $options = []) + { + Pool::send($this, $requests, $options); + } - return $request; + /** + * @deprecated Use GuzzleHttp\Utils::getDefaultHandler + */ + public static function getDefaultHandler() + { + return Utils::getDefaultHandler(); } /** - * Throw Exception with pre-set message. - * @return void - * @throws \InvalidArgumentException Invalid body. + * @deprecated Use GuzzleHttp\Utils::getDefaultUserAgent */ - private function invalidBody() + public static function getDefaultUserAgent() { - throw new \InvalidArgumentException('Passing in the "body" request ' - . 'option as an array to send a POST request has been deprecated. ' - . '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.'); + return Utils::getDefaultUserAgent(); } } diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php index 638b75dca4d..6668597d3d9 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -1,87 +1,150 @@ getExpires() || $allowSessionCookies) { - if (!$cookie->getDiscard()) { - return true; - } - } - - return false; - } - - /** - * Finds and returns the cookie based on the name + * @param string $value Value that may or may not need to be quoted * - * @param string $name cookie name to search for - * @return SetCookie|null cookie that was found or null if not found + * @return string */ - public function getCookieByName($name) + public static function getCookieValue($value) { - // don't allow a non string name - if ($name === null || !is_scalar($name)) { - return null; - } - foreach ($this->cookies as $cookie) { - if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { - return $cookie; - } + if (substr($value, 0, 1) !== '"' && + substr($value, -1, 1) !== '"' && + strpbrk($value, ';,') + ) { + $value = '"' . $value . '"'; } - return null; + return $value; } public function toArray() @@ -122,7 +92,7 @@ public function clear($domain = null, $path = null, $name = null) } elseif (!$path) { $this->cookies = array_filter( $this->cookies, - function (SetCookie $cookie) use ($domain) { + function (SetCookie $cookie) use ($path, $domain) { return !$cookie->matchesDomain($domain); } ); @@ -158,13 +128,6 @@ function (SetCookie $cookie) { public function setCookie(SetCookie $cookie) { - // If the name string is empty (but not 0), ignore the set-cookie - // string entirely. - $name = $cookie->getName(); - if (!$name && $name !== '0') { - return false; - } - // Only allow cookies with set and valid domain, name, value $result = $cookie->validate(); if ($result !== true) { @@ -231,69 +194,38 @@ public function extractCookies( RequestInterface $request, ResponseInterface $response ) { - if ($cookieHeader = $response->getHeader('Set-Cookie')) { + if ($cookieHeader = $response->getHeaderAsArray('Set-Cookie')) { foreach ($cookieHeader as $cookie) { $sc = SetCookie::fromString($cookie); if (!$sc->getDomain()) { - $sc->setDomain($request->getUri()->getHost()); - } - if (0 !== strpos($sc->getPath(), '/')) { - $sc->setPath($this->getCookiePathFromRequest($request)); + $sc->setDomain($request->getHost()); } $this->setCookie($sc); } } } - /** - * Computes cookie path following RFC 6265 section 5.1.4 - * - * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 - * - * @param RequestInterface $request - * @return string - */ - private function getCookiePathFromRequest(RequestInterface $request) - { - $uriPath = $request->getUri()->getPath(); - if ('' === $uriPath) { - return '/'; - } - if (0 !== strpos($uriPath, '/')) { - return '/'; - } - if ('/' === $uriPath) { - return '/'; - } - if (0 === $lastSlashPos = strrpos($uriPath, '/')) { - return '/'; - } - - return substr($uriPath, 0, $lastSlashPos); - } - - public function withCookieHeader(RequestInterface $request) + public function addCookieHeader(RequestInterface $request) { $values = []; - $uri = $request->getUri(); - $scheme = $uri->getScheme(); - $host = $uri->getHost(); - $path = $uri->getPath() ?: '/'; + $scheme = $request->getScheme(); + $host = $request->getHost(); + $path = $request->getPath(); foreach ($this->cookies as $cookie) { if ($cookie->matchesPath($path) && $cookie->matchesDomain($host) && !$cookie->isExpired() && - (!$cookie->getSecure() || $scheme === 'https') + (!$cookie->getSecure() || $scheme == 'https') ) { $values[] = $cookie->getName() . '=' - . $cookie->getValue(); + . self::getCookieValue($cookie->getValue()); } } - return $values - ? $request->withHeader('Cookie', implode('; ', $values)) - : $request; + if ($values) { + $request->setHeader('Cookie', implode('; ', $values)); + } } /** diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php index 6ee11885e1f..4ea8567e877 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -1,8 +1,8 @@ filename = $cookieFile; - $this->storeSessionCookies = $storeSessionCookies; if (file_exists($cookieFile)) { $this->load($cookieFile); @@ -50,15 +45,15 @@ public function save($filename) { $json = []; foreach ($this as $cookie) { - /** @var SetCookie $cookie */ - if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + if ($cookie->getExpires() && !$cookie->getDiscard()) { $json[] = $cookie->toArray(); } } - $jsonStr = \GuzzleHttp\json_encode($json); - if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) { + if (false === file_put_contents($filename, json_encode($json), LOCK_EX)) { + // @codeCoverageIgnoreStart throw new \RuntimeException("Unable to save file {$filename}"); + // @codeCoverageIgnoreEnd } } @@ -74,14 +69,14 @@ public function load($filename) { $json = file_get_contents($filename); if (false === $json) { + // @codeCoverageIgnoreStart throw new \RuntimeException("Unable to load file {$filename}"); - } elseif ($json === '') { - return; + // @codeCoverageIgnoreEnd } - $data = \GuzzleHttp\json_decode($json, true); + $data = Utils::jsonDecode($json, true); if (is_array($data)) { - foreach (json_decode($json, true) as $cookie) { + foreach (Utils::jsonDecode($json, true) as $cookie) { $this->setCookie(new SetCookie($cookie)); } } elseif (strlen($data)) { diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php index 0224a2447b1..71a02d56dce 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -1,6 +1,8 @@ sessionKey = $sessionKey; - $this->storeSessionCookies = $storeSessionCookies; $this->load(); } @@ -43,8 +37,7 @@ public function save() { $json = []; foreach ($this as $cookie) { - /** @var SetCookie $cookie */ - if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { + if ($cookie->getExpires() && !$cookie->getDiscard()) { $json[] = $cookie->toArray(); } } @@ -57,10 +50,11 @@ public function save() */ protected function load() { - if (!isset($_SESSION[$this->sessionKey])) { - return; - } - $data = json_decode($_SESSION[$this->sessionKey], true); + $cookieJar = isset($_SESSION[$this->sessionKey]) + ? $_SESSION[$this->sessionKey] + : null; + + $data = Utils::jsonDecode($cookieJar, true); if (is_array($data)) { foreach ($data as $cookie) { $this->setCookie(new SetCookie($cookie)); diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php index 3d776a70bc7..6fdee0dd3c7 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -1,10 +1,12 @@ data['Name'] . '=' . $this->data['Value'] . '; '; foreach ($this->data as $k => $v) { - if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { - if ($k === 'Expires') { + 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) . '; '; } else { $str .= ($v === true ? $k : "{$k}={$v}") . '; '; @@ -227,7 +230,7 @@ public function setExpires($timestamp) /** * Get whether or not this is a secure cookie * - * @return bool|null + * @return null|bool */ public function getSecure() { @@ -247,7 +250,7 @@ public function setSecure($secure) /** * Get whether or not this is a session cookie * - * @return bool|null + * @return null|bool */ public function getDiscard() { @@ -285,43 +288,15 @@ public function setHttpOnly($httpOnly) } /** - * Check if the cookie matches a path value. - * - * A request-path path-matches a given cookie-path if at least one of - * the following conditions holds: - * - * - The cookie-path and the request-path are identical. - * - The cookie-path is a prefix of the request-path, and the last - * character of the cookie-path is %x2F ("/"). - * - The cookie-path is a prefix of the request-path, and the first - * character of the request-path that is not included in the cookie- - * path is a %x2F ("/") character. + * Check if the cookie matches a path value * - * @param string $requestPath Path to check against + * @param string $path Path to check against * * @return bool */ - public function matchesPath($requestPath) + public function matchesPath($path) { - $cookiePath = $this->getPath(); - - // Match on exact matches or when path is the default empty "/" - if ($cookiePath === '/' || $cookiePath == $requestPath) { - return true; - } - - // Ensure that the cookie-path is a prefix of the request path. - if (0 !== strpos($requestPath, $cookiePath)) { - return false; - } - - // Match if the last character of the cookie-path is "/" - if (substr($cookiePath, -1, 1) === '/') { - return true; - } - - // Match if the first character not included in cookie path is "/" - return substr($requestPath, strlen($cookiePath), 1) === '/'; + return !$this->getPath() || 0 === stripos($path, $this->getPath()); } /** @@ -348,7 +323,7 @@ public function matchesDomain($domain) return false; } - return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain); + return (bool) preg_match('/\.' . preg_quote($cookieDomain) . '$/i', $domain); } /** @@ -375,13 +350,8 @@ public function validate() } // Check if any of the invalid characters are present in the cookie name - if (preg_match( - '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', - $name - )) { - return 'Cookie name must not contain invalid characters: ASCII ' - . 'Control characters (0-31;127), space, tab and the ' - . 'following characters: ()<>@,;:\"/?={}'; + if (preg_match("/[=,; \t\r\n\013\014]/", $name)) { + return "Cookie name must not cannot invalid characters: =,; \\t\\r\\n\\013\\014"; } // Value must not be empty, but can be 0 diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php index 427d896fb2f..fd78431ea7c 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -1,27 +1,7 @@ getStatusCode() : 0; parent::__construct($message, $code, $previous); $this->request = $request; $this->response = $response; - $this->handlerContext = $handlerContext; } /** @@ -47,9 +43,13 @@ public function __construct( */ public static function wrapException(RequestInterface $request, \Exception $e) { - return $e instanceof RequestException - ? $e - : new RequestException($e->getMessage(), $request, null, $e); + if ($e instanceof RequestException) { + return $e; + } elseif ($e instanceof ConnectException) { + return new HttpConnectException($e->getMessage(), $request, null, $e); + } else { + return new RequestException($e->getMessage(), $request, null, $e); + } } /** @@ -58,91 +58,35 @@ public static function wrapException(RequestInterface $request, \Exception $e) * @param RequestInterface $request Request * @param ResponseInterface $response Response received * @param \Exception $previous Previous exception - * @param array $ctx Optional handler context. * * @return self */ public static function create( RequestInterface $request, ResponseInterface $response = null, - \Exception $previous = null, - array $ctx = [] + \Exception $previous = null ) { if (!$response) { - return new self( - 'Error completing request', - $request, - null, - $previous, - $ctx - ); + return new self('Error completing request', $request, null, $previous); } - $level = (int) floor($response->getStatusCode() / 100); - if ($level === 4) { - $label = 'Client error'; - $className = ClientException::class; - } elseif ($level === 5) { - $label = 'Server error'; - $className = ServerException::class; + $level = floor($response->getStatusCode() / 100); + if ($level == '4') { + $label = 'Client error response'; + $className = __NAMESPACE__ . '\\ClientException'; + } elseif ($level == '5') { + $label = 'Server error response'; + $className = __NAMESPACE__ . '\\ServerException'; } else { - $label = 'Unsuccessful request'; + $label = 'Unsuccessful response'; $className = __CLASS__; } - $uri = $request->getUri(); - $uri = static::obfuscateUri($uri); - - // Client Error: `GET /` resulted in a `404 Not Found` response: - // ... (truncated) - $message = sprintf( - '%s: `%s %s` resulted in a `%s %s` response', - $label, - $request->getMethod(), - $uri, - $response->getStatusCode(), - $response->getReasonPhrase() - ); - - $summary = static::getResponseBodySummary($response); - - if ($summary !== null) { - $message .= ":\n{$summary}\n"; - } - - return new $className($message, $request, $response, $previous, $ctx); - } - - /** - * Get a short summary of the response - * - * Will return `null` if the response is not printable. - * - * @param ResponseInterface $response - * - * @return string|null - */ - public static function getResponseBodySummary(ResponseInterface $response) - { - return \GuzzleHttp\Psr7\get_message_body_summary($response); - } - - /** - * Obfuscates URI if there is a username and a password present - * - * @param UriInterface $uri - * - * @return UriInterface - */ - private static function obfuscateUri(UriInterface $uri) - { - $userInfo = $uri->getUserInfo(); - - if (false !== ($pos = strpos($userInfo, ':'))) { - return $uri->withUserInfo(substr($userInfo, 0, $pos), '***'); - } + $message = $label . ' [url] ' . $request->getUrl() + . ' [status code] ' . $response->getStatusCode() + . ' [reason phrase] ' . $response->getReasonPhrase(); - return $uri; + return new $className($message, $request, $response, $previous); } /** @@ -174,19 +118,4 @@ public function hasResponse() { return $this->response !== null; } - - /** - * Get contextual information about the error from the underlying handler. - * - * The contents of this array will vary depending on which handler you are - * using. It may also be just an empty array. Relying on this data will - * couple you to a specific handler, but can give more debug information - * when needed. - * - * @return array - */ - public function getHandlerContext() - { - return $this->handlerContext; - } } diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php deleted file mode 100644 index a77c28926cf..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php +++ /dev/null @@ -1,27 +0,0 @@ -stream = $stream; - $msg = $msg ?: 'Could not seek the stream to position ' . $pos; - parent::__construct($msg); - } - - /** - * @return StreamInterface - */ - public function getStream() - { - return $this->stream; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php index 127094c1499..7cdd340866b 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -4,6 +4,4 @@ /** * Exception when a server error is encountered (5xx codes) */ -class ServerException extends BadResponseException -{ -} +class ServerException extends BadResponseException {} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php index fff05251d50..b60a9678d65 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php @@ -1,6 +1,4 @@ maxHandles = $maxHandles; - } - - public function create(RequestInterface $request, array $options) - { - if (isset($options['curl']['body_as_string'])) { - $options['_body_as_string'] = $options['curl']['body_as_string']; - unset($options['curl']['body_as_string']); - } - - $easy = new EasyHandle; - $easy->request = $request; - $easy->options = $options; - $conf = $this->getDefaultConf($easy); - $this->applyMethod($easy, $conf); - $this->applyHandlerOptions($easy, $conf); - $this->applyHeaders($easy, $conf); - unset($conf['_headers']); - - // Add handler options from the request configuration options - if (isset($options['curl'])) { - $conf = array_replace($conf, $options['curl']); - } - - $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); - $easy->handle = $this->handles - ? array_pop($this->handles) - : curl_init(); - curl_setopt_array($easy->handle, $conf); - - return $easy; - } - - public function release(EasyHandle $easy) - { - $resource = $easy->handle; - unset($easy->handle); - - if (count($this->handles) >= $this->maxHandles) { - curl_close($resource); - } else { - // Remove all callback functions as they can hold onto references - // and are not cleaned up by curl_reset. Using curl_setopt_array - // does not work for some reason, so removing each one - // individually. - curl_setopt($resource, CURLOPT_HEADERFUNCTION, null); - curl_setopt($resource, CURLOPT_READFUNCTION, null); - curl_setopt($resource, CURLOPT_WRITEFUNCTION, null); - curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null); - curl_reset($resource); - $this->handles[] = $resource; - } - } - - /** - * Completes a cURL transaction, either returning a response promise or a - * rejected promise. - * - * @param callable $handler - * @param EasyHandle $easy - * @param CurlFactoryInterface $factory Dictates how the handle is released - * - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public static function finish( - callable $handler, - EasyHandle $easy, - CurlFactoryInterface $factory - ) { - if (isset($easy->options['on_stats'])) { - self::invokeStats($easy); - } - - if (!$easy->response || $easy->errno) { - return self::finishError($handler, $easy, $factory); - } - - // Return the response if it is present and there is no error. - $factory->release($easy); - - // Rewind the body of the response if possible. - $body = $easy->response->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - - return new FulfilledPromise($easy->response); - } - - private static function invokeStats(EasyHandle $easy) - { - $curlStats = curl_getinfo($easy->handle); - $curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME); - $stats = new TransferStats( - $easy->request, - $easy->response, - $curlStats['total_time'], - $easy->errno, - $curlStats - ); - call_user_func($easy->options['on_stats'], $stats); - } - - private static function finishError( - callable $handler, - EasyHandle $easy, - CurlFactoryInterface $factory - ) { - // Get error information and release the handle to the factory. - $ctx = [ - 'errno' => $easy->errno, - 'error' => curl_error($easy->handle), - 'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME), - ] + curl_getinfo($easy->handle); - $ctx[self::CURL_VERSION_STR] = curl_version()['version']; - $factory->release($easy); - - // Retry when nothing is present or when curl failed to rewind. - if (empty($easy->options['_err_message']) - && (!$easy->errno || $easy->errno == 65) - ) { - return self::retryFailedRewind($handler, $easy, $ctx); - } - - return self::createRejection($easy, $ctx); - } - - private static function createRejection(EasyHandle $easy, array $ctx) - { - static $connectionErrors = [ - CURLE_OPERATION_TIMEOUTED => true, - CURLE_COULDNT_RESOLVE_HOST => true, - CURLE_COULDNT_CONNECT => true, - CURLE_SSL_CONNECT_ERROR => true, - CURLE_GOT_NOTHING => true, - ]; - - // If an exception was encountered during the onHeaders event, then - // return a rejected promise that wraps that exception. - if ($easy->onHeadersException) { - return \GuzzleHttp\Promise\rejection_for( - new RequestException( - 'An error was encountered during the on_headers event', - $easy->request, - $easy->response, - $easy->onHeadersException, - $ctx - ) - ); - } - if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) { - $message = sprintf( - 'cURL error %s: %s (%s)', - $ctx['errno'], - $ctx['error'], - 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' - ); - } else { - $message = sprintf( - 'cURL error %s: %s (%s) for %s', - $ctx['errno'], - $ctx['error'], - 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html', - $easy->request->getUri() - ); - } - - // Create a connection exception if it was a specific error code. - $error = isset($connectionErrors[$easy->errno]) - ? new ConnectException($message, $easy->request, null, $ctx) - : new RequestException($message, $easy->request, $easy->response, null, $ctx); - - return \GuzzleHttp\Promise\rejection_for($error); - } - - private function getDefaultConf(EasyHandle $easy) - { - $conf = [ - '_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, - ]; - - if (defined('CURLOPT_PROTOCOLS')) { - $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; - } - - $version = $easy->request->getProtocolVersion(); - if ($version == 1.1) { - $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; - } elseif ($version == 2.0) { - $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; - } else { - $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; - } - - return $conf; - } - - private function applyMethod(EasyHandle $easy, array &$conf) - { - $body = $easy->request->getBody(); - $size = $body->getSize(); - - if ($size === null || $size > 0) { - $this->applyBody($easy->request, $easy->options, $conf); - return; - } - - $method = $easy->request->getMethod(); - if ($method === 'PUT' || $method === 'POST') { - // See http://tools.ietf.org/html/rfc7230#section-3.3.2 - if (!$easy->request->hasHeader('Content-Length')) { - $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; - } - } elseif ($method === 'HEAD') { - $conf[CURLOPT_NOBODY] = true; - unset( - $conf[CURLOPT_WRITEFUNCTION], - $conf[CURLOPT_READFUNCTION], - $conf[CURLOPT_FILE], - $conf[CURLOPT_INFILE] - ); - } - } - - private function applyBody(RequestInterface $request, array $options, array &$conf) - { - $size = $request->hasHeader('Content-Length') - ? (int) $request->getHeaderLine('Content-Length') - : null; - - // Send the body as a string if the size is less than 1MB OR if the - // [curl][body_as_string] request value is set. - if (($size !== null && $size < 1000000) || - !empty($options['_body_as_string']) - ) { - $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody(); - // Don't duplicate the Content-Length header - $this->removeHeader('Content-Length', $conf); - $this->removeHeader('Transfer-Encoding', $conf); - } else { - $conf[CURLOPT_UPLOAD] = true; - if ($size !== null) { - $conf[CURLOPT_INFILESIZE] = $size; - $this->removeHeader('Content-Length', $conf); - } - $body = $request->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { - return $body->read($length); - }; - } - - // If the Expect header is not present, prevent curl from adding it - if (!$request->hasHeader('Expect')) { - $conf[CURLOPT_HTTPHEADER][] = 'Expect:'; - } - - // cURL sometimes adds a content-type by default. Prevent this. - if (!$request->hasHeader('Content-Type')) { - $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:'; - } - } - - private function applyHeaders(EasyHandle $easy, array &$conf) - { - foreach ($conf['_headers'] as $name => $values) { - foreach ($values as $value) { - $value = (string) $value; - if ($value === '') { - // cURL requires a special format for empty headers. - // See https://github.com/guzzle/guzzle/issues/1882 for more details. - $conf[CURLOPT_HTTPHEADER][] = "$name;"; - } else { - $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; - } - } - } - - // Remove the Accept header if one was not set - if (!$easy->request->hasHeader('Accept')) { - $conf[CURLOPT_HTTPHEADER][] = 'Accept:'; - } - } - - /** - * Remove a header from the options array. - * - * @param string $name Case-insensitive header to remove - * @param array $options Array of options to modify - */ - private function removeHeader($name, array &$options) - { - foreach (array_keys($options['_headers']) as $key) { - if (!strcasecmp($key, $name)) { - unset($options['_headers'][$key]); - return; - } - } - } - - private function applyHandlerOptions(EasyHandle $easy, array &$conf) - { - $options = $easy->options; - if (isset($options['verify'])) { - if ($options['verify'] === false) { - unset($conf[CURLOPT_CAINFO]); - $conf[CURLOPT_SSL_VERIFYHOST] = 0; - $conf[CURLOPT_SSL_VERIFYPEER] = false; - } else { - $conf[CURLOPT_SSL_VERIFYHOST] = 2; - $conf[CURLOPT_SSL_VERIFYPEER] = true; - if (is_string($options['verify'])) { - // Throw an error if the file/folder/link path is not valid or doesn't exist. - if (!file_exists($options['verify'])) { - throw new \InvalidArgumentException( - "SSL CA bundle not found: {$options['verify']}" - ); - } - // 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']) && is_dir(readlink($options['verify'])))) { - $conf[CURLOPT_CAPATH] = $options['verify']; - } else { - $conf[CURLOPT_CAINFO] = $options['verify']; - } - } - } - } - - if (!empty($options['decode_content'])) { - $accept = $easy->request->getHeaderLine('Accept-Encoding'); - if ($accept) { - $conf[CURLOPT_ENCODING] = $accept; - } else { - $conf[CURLOPT_ENCODING] = ''; - // Don't let curl send the header over the wire - $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; - } - } - - if (isset($options['sink'])) { - $sink = $options['sink']; - if (!is_string($sink)) { - $sink = \GuzzleHttp\Psr7\stream_for($sink); - } elseif (!is_dir(dirname($sink))) { - // Ensure that the directory exists before failing in curl. - throw new \RuntimeException(sprintf( - 'Directory %s does not exist for sink value of %s', - dirname($sink), - $sink - )); - } else { - $sink = new LazyOpenStream($sink, 'w+'); - } - $easy->sink = $sink; - $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { - return $sink->write($write); - }; - } else { - // Use a default temp stream if no sink was set. - $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); - $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); - } - $timeoutRequiresNoSignal = false; - if (isset($options['timeout'])) { - $timeoutRequiresNoSignal |= $options['timeout'] < 1; - $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; - } - - // CURL default value is CURL_IPRESOLVE_WHATEVER - if (isset($options['force_ip_resolve'])) { - if ('v4' === $options['force_ip_resolve']) { - $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; - } elseif ('v6' === $options['force_ip_resolve']) { - $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; - } - } - - if (isset($options['connect_timeout'])) { - $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; - $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; - } - - if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { - $conf[CURLOPT_NOSIGNAL] = true; - } - - if (isset($options['proxy'])) { - if (!is_array($options['proxy'])) { - $conf[CURLOPT_PROXY] = $options['proxy']; - } else { - $scheme = $easy->request->getUri()->getScheme(); - if (isset($options['proxy'][$scheme])) { - $host = $easy->request->getUri()->getHost(); - if (!isset($options['proxy']['no']) || - !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no']) - ) { - $conf[CURLOPT_PROXY] = $options['proxy'][$scheme]; - } - } - } - } - - if (isset($options['cert'])) { - $cert = $options['cert']; - if (is_array($cert)) { - $conf[CURLOPT_SSLCERTPASSWD] = $cert[1]; - $cert = $cert[0]; - } - if (!file_exists($cert)) { - throw new \InvalidArgumentException( - "SSL certificate not found: {$cert}" - ); - } - $conf[CURLOPT_SSLCERT] = $cert; - } - - if (isset($options['ssl_key'])) { - if (is_array($options['ssl_key'])) { - if (count($options['ssl_key']) === 2) { - list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key']; - } else { - list($sslKey) = $options['ssl_key']; - } - } - - $sslKey = isset($sslKey) ? $sslKey: $options['ssl_key']; - - if (!file_exists($sslKey)) { - throw new \InvalidArgumentException( - "SSL private key not found: {$sslKey}" - ); - } - $conf[CURLOPT_SSLKEY] = $sslKey; - } - - if (isset($options['progress'])) { - $progress = $options['progress']; - if (!is_callable($progress)) { - throw new \InvalidArgumentException( - 'progress client option must be callable' - ); - } - $conf[CURLOPT_NOPROGRESS] = false; - $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) { - $args = func_get_args(); - // PHP 5.5 pushed the handle onto the start of the args - if (is_resource($args[0])) { - array_shift($args); - } - call_user_func_array($progress, $args); - }; - } - - if (!empty($options['debug'])) { - $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']); - $conf[CURLOPT_VERBOSE] = true; - } - } - - /** - * This function ensures that a response was set on a transaction. If one - * was not set, then the request is retried if possible. This error - * typically means you are sending a payload, curl encountered a - * "Connection died, retrying a fresh connect" error, tried to rewind the - * stream, and then encountered a "necessary data rewind wasn't possible" - * error, causing the request to be sent through curl_multi_info_read() - * without an error status. - */ - private static function retryFailedRewind( - callable $handler, - EasyHandle $easy, - array $ctx - ) { - try { - // Only rewind if the body has been read from. - $body = $easy->request->getBody(); - if ($body->tell() > 0) { - $body->rewind(); - } - } 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; - return self::createRejection($easy, $ctx); - } - - // Retry no more than 3 times before giving up. - if (!isset($easy->options['_curl_retries'])) { - $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.'; - return self::createRejection($easy, $ctx); - } else { - $easy->options['_curl_retries']++; - } - - return $handler($easy->request, $easy->options); - } - - private function createHeaderFn(EasyHandle $easy) - { - if (isset($easy->options['on_headers'])) { - $onHeaders = $easy->options['on_headers']; - - if (!is_callable($onHeaders)) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - } else { - $onHeaders = null; - } - - return function ($ch, $h) use ( - $onHeaders, - $easy, - &$startingResponse - ) { - $value = trim($h); - if ($value === '') { - $startingResponse = true; - $easy->createResponse(); - if ($onHeaders !== null) { - try { - $onHeaders($easy->response); - } catch (\Exception $e) { - // Associate the exception with the handle and trigger - // a curl header write error by returning 0. - $easy->onHeadersException = $e; - return -1; - } - } - } elseif ($startingResponse) { - $startingResponse = false; - $easy->headers = [$value]; - } else { - $easy->headers[] = $value; - } - return strlen($h); - }; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php deleted file mode 100644 index b0fc236850b..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -factory = isset($options['handle_factory']) - ? $options['handle_factory'] - : new CurlFactory(3); - } - - public function __invoke(RequestInterface $request, array $options) - { - if (isset($options['delay'])) { - usleep($options['delay'] * 1000); - } - - $easy = $this->factory->create($request, $options); - curl_exec($easy->handle); - $easy->errno = curl_errno($easy->handle); - - return CurlFactory::finish($this, $easy, $this->factory); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php deleted file mode 100644 index 564c95f481e..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ /dev/null @@ -1,219 +0,0 @@ -factory = isset($options['handle_factory']) - ? $options['handle_factory'] : new CurlFactory(50); - - if (isset($options['select_timeout'])) { - $this->selectTimeout = $options['select_timeout']; - } elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { - $this->selectTimeout = $selectTimeout; - } else { - $this->selectTimeout = 1; - } - - $this->options = isset($options['options']) ? $options['options'] : []; - } - - public function __get($name) - { - if ($name === '_mh') { - $this->_mh = curl_multi_init(); - - foreach ($this->options as $option => $value) { - // A warning is raised in case of a wrong option. - curl_multi_setopt($this->_mh, $option, $value); - } - - // Further calls to _mh will return the value directly, without entering the - // __get() method at all. - return $this->_mh; - } - - throw new \BadMethodCallException(); - } - - public function __destruct() - { - if (isset($this->_mh)) { - curl_multi_close($this->_mh); - unset($this->_mh); - } - } - - public function __invoke(RequestInterface $request, array $options) - { - $easy = $this->factory->create($request, $options); - $id = (int) $easy->handle; - - $promise = new Promise( - [$this, 'execute'], - function () use ($id) { - return $this->cancel($id); - } - ); - - $this->addRequest(['easy' => $easy, 'deferred' => $promise]); - - return $promise; - } - - /** - * Ticks the curl event loop. - */ - public function tick() - { - // Add any delayed handles if needed. - if ($this->delays) { - $currentTime = Utils::currentTime(); - foreach ($this->delays as $id => $delay) { - if ($currentTime >= $delay) { - unset($this->delays[$id]); - curl_multi_add_handle( - $this->_mh, - $this->handles[$id]['easy']->handle - ); - } - } - } - - // Step through the task queue which may add additional requests. - P\queue()->run(); - - if ($this->active && - curl_multi_select($this->_mh, $this->selectTimeout) === -1 - ) { - // Perform a usleep if a select returns -1. - // See: https://bugs.php.net/bug.php?id=61141 - usleep(250); - } - - while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM); - - $this->processMessages(); - } - - /** - * Runs until all outstanding connections have completed. - */ - public function execute() - { - $queue = P\queue(); - - while ($this->handles || !$queue->isEmpty()) { - // If there are no transfers, then sleep for the next delay - if (!$this->active && $this->delays) { - usleep($this->timeToNext()); - } - $this->tick(); - } - } - - private function addRequest(array $entry) - { - $easy = $entry['easy']; - $id = (int) $easy->handle; - $this->handles[$id] = $entry; - if (empty($easy->options['delay'])) { - curl_multi_add_handle($this->_mh, $easy->handle); - } else { - $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); - } - } - - /** - * Cancels a handle from sending and removes references to it. - * - * @param int $id Handle ID to cancel and remove. - * - * @return bool True on success, false on failure. - */ - private function cancel($id) - { - // Cannot cancel if it has been processed. - if (!isset($this->handles[$id])) { - return false; - } - - $handle = $this->handles[$id]['easy']->handle; - unset($this->delays[$id], $this->handles[$id]); - curl_multi_remove_handle($this->_mh, $handle); - curl_close($handle); - - return true; - } - - private function processMessages() - { - while ($done = curl_multi_info_read($this->_mh)) { - $id = (int) $done['handle']; - curl_multi_remove_handle($this->_mh, $done['handle']); - - if (!isset($this->handles[$id])) { - // Probably was cancelled. - continue; - } - - $entry = $this->handles[$id]; - unset($this->handles[$id], $this->delays[$id]); - $entry['easy']->errno = $done['result']; - $entry['deferred']->resolve( - CurlFactory::finish( - $this, - $entry['easy'], - $this->factory - ) - ); - } - } - - private function timeToNext() - { - $currentTime = Utils::currentTime(); - $nextTime = PHP_INT_MAX; - foreach ($this->delays as $time) { - if ($time < $nextTime) { - $nextTime = $time; - } - } - - return max(0, $nextTime - $currentTime) * 1000000; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php deleted file mode 100644 index 7754e9111b7..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +++ /dev/null @@ -1,92 +0,0 @@ -headers)) { - throw new \RuntimeException('No headers have been received'); - } - - // HTTP-version SP status-code SP reason-phrase - $startLine = explode(' ', array_shift($this->headers), 3); - $headers = \GuzzleHttp\headers_from_lines($this->headers); - $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); - - if (!empty($this->options['decode_content']) - && isset($normalizedKeys['content-encoding']) - ) { - $headers['x-encoded-content-encoding'] - = $headers[$normalizedKeys['content-encoding']]; - unset($headers[$normalizedKeys['content-encoding']]); - if (isset($normalizedKeys['content-length'])) { - $headers['x-encoded-content-length'] - = $headers[$normalizedKeys['content-length']]; - - $bodyLength = (int) $this->sink->getSize(); - if ($bodyLength) { - $headers[$normalizedKeys['content-length']] = $bodyLength; - } else { - unset($headers[$normalizedKeys['content-length']]); - } - } - } - - // Attach a response to the easy handle with the parsed headers. - $this->response = new Response( - $startLine[1], - $headers, - $this->sink, - substr($startLine[0], 5), - isset($startLine[2]) ? (string) $startLine[2] : null - ); - } - - public function __get($name) - { - $msg = $name === 'handle' - ? 'The EasyHandle has been released' - : 'Invalid property: ' . $name; - throw new \BadMethodCallException($msg); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php deleted file mode 100644 index 5b312bc0428..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php +++ /dev/null @@ -1,195 +0,0 @@ -onFulfilled = $onFulfilled; - $this->onRejected = $onRejected; - - if ($queue) { - call_user_func_array([$this, 'append'], $queue); - } - } - - public function __invoke(RequestInterface $request, array $options) - { - if (!$this->queue) { - throw new \OutOfBoundsException('Mock queue is empty'); - } - - if (isset($options['delay']) && is_numeric($options['delay'])) { - usleep($options['delay'] * 1000); - } - - $this->lastRequest = $request; - $this->lastOptions = $options; - $response = array_shift($this->queue); - - if (isset($options['on_headers'])) { - if (!is_callable($options['on_headers'])) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - try { - $options['on_headers']($response); - } catch (\Exception $e) { - $msg = 'An error was encountered during the on_headers event'; - $response = new RequestException($msg, $request, $response, $e); - } - } - - if (is_callable($response)) { - $response = call_user_func($response, $request, $options); - } - - $response = $response instanceof \Exception - ? \GuzzleHttp\Promise\rejection_for($response) - : \GuzzleHttp\Promise\promise_for($response); - - return $response->then( - function ($value) use ($request, $options) { - $this->invokeStats($request, $options, $value); - if ($this->onFulfilled) { - call_user_func($this->onFulfilled, $value); - } - if (isset($options['sink'])) { - $contents = (string) $value->getBody(); - $sink = $options['sink']; - - if (is_resource($sink)) { - fwrite($sink, $contents); - } elseif (is_string($sink)) { - file_put_contents($sink, $contents); - } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) { - $sink->write($contents); - } - } - - return $value; - }, - function ($reason) use ($request, $options) { - $this->invokeStats($request, $options, null, $reason); - if ($this->onRejected) { - call_user_func($this->onRejected, $reason); - } - return \GuzzleHttp\Promise\rejection_for($reason); - } - ); - } - - /** - * Adds one or more variadic requests, exceptions, callables, or promises - * to the queue. - */ - public function append() - { - foreach (func_get_args() as $value) { - if ($value instanceof ResponseInterface - || $value instanceof \Exception - || $value instanceof PromiseInterface - || is_callable($value) - ) { - $this->queue[] = $value; - } else { - throw new \InvalidArgumentException('Expected a response or ' - . 'exception. Found ' . \GuzzleHttp\describe_type($value)); - } - } - } - - /** - * Get the last received request. - * - * @return RequestInterface - */ - public function getLastRequest() - { - return $this->lastRequest; - } - - /** - * Get the last received request options. - * - * @return array - */ - public function getLastOptions() - { - return $this->lastOptions; - } - - /** - * Returns the number of remaining items in the queue. - * - * @return int - */ - public function count() - { - return count($this->queue); - } - - public function reset() - { - $this->queue = []; - } - - private function invokeStats( - RequestInterface $request, - array $options, - ResponseInterface $response = null, - $reason = null - ) { - if (isset($options['on_stats'])) { - $transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0; - $stats = new TransferStats($request, $response, $transferTime, $reason); - call_user_func($options['on_stats'], $stats); - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php deleted file mode 100644 index f8b00be0b99..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php +++ /dev/null @@ -1,55 +0,0 @@ -withoutHeader('Expect'); - - // Append a content-length header if body size is zero to match - // cURL's behavior. - if (0 === $request->getBody()->getSize()) { - $request = $request->withHeader('Content-Length', '0'); - } - - return $this->createResponse( - $request, - $options, - $this->createStream($request, $options), - $startTime - ); - } catch (\InvalidArgumentException $e) { - throw $e; - } catch (\Exception $e) { - // Determine if the error was a networking error. - $message = $e->getMessage(); - // This list can probably get more comprehensive. - if (strpos($message, 'getaddrinfo') // DNS lookup failed - || strpos($message, 'Connection refused') - || strpos($message, "couldn't connect to host") // error on HHVM - || strpos($message, "connection attempt failed") - ) { - $e = new ConnectException($e->getMessage(), $request, $e); - } - $e = RequestException::wrapException($request, $e); - $this->invokeStats($options, $request, $startTime, null, $e); - - return \GuzzleHttp\Promise\rejection_for($e); - } - } - - private function invokeStats( - array $options, - RequestInterface $request, - $startTime, - ResponseInterface $response = null, - $error = null - ) { - if (isset($options['on_stats'])) { - $stats = new TransferStats( - $request, - $response, - Utils::currentTime() - $startTime, - $error, - [] - ); - call_user_func($options['on_stats'], $stats); - } - } - - private function createResponse( - RequestInterface $request, - array $options, - $stream, - $startTime - ) { - $hdrs = $this->lastHeaders; - $this->lastHeaders = []; - $parts = explode(' ', array_shift($hdrs), 3); - $ver = explode('/', $parts[0])[1]; - $status = $parts[1]; - $reason = isset($parts[2]) ? $parts[2] : null; - $headers = \GuzzleHttp\headers_from_lines($hdrs); - list($stream, $headers) = $this->checkDecode($options, $headers, $stream); - $stream = Psr7\stream_for($stream); - $sink = $stream; - - if (strcasecmp('HEAD', $request->getMethod())) { - $sink = $this->createSink($stream, $options); - } - - $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); - - if (isset($options['on_headers'])) { - try { - $options['on_headers']($response); - } catch (\Exception $e) { - $msg = 'An error was encountered during the on_headers event'; - $ex = new RequestException($msg, $request, $response, $e); - return \GuzzleHttp\Promise\rejection_for($ex); - } - } - - // Do not drain when the request is a HEAD request because they have - // no body. - if ($sink !== $stream) { - $this->drain( - $stream, - $sink, - $response->getHeaderLine('Content-Length') - ); - } - - $this->invokeStats($options, $request, $startTime, $response, null); - - return new FulfilledPromise($response); - } - - private function createSink(StreamInterface $stream, array $options) - { - if (!empty($options['stream'])) { - return $stream; - } - - $sink = isset($options['sink']) - ? $options['sink'] - : fopen('php://temp', 'r+'); - - return is_string($sink) - ? new Psr7\LazyOpenStream($sink, 'w+') - : Psr7\stream_for($sink); - } - - private function checkDecode(array $options, array $headers, $stream) - { - // Automatically decode responses when instructed. - if (!empty($options['decode_content'])) { - $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); - if (isset($normalizedKeys['content-encoding'])) { - $encoding = $headers[$normalizedKeys['content-encoding']]; - if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { - $stream = new Psr7\InflateStream( - Psr7\stream_for($stream) - ); - $headers['x-encoded-content-encoding'] - = $headers[$normalizedKeys['content-encoding']]; - // Remove content-encoding header - unset($headers[$normalizedKeys['content-encoding']]); - // Fix content-length header - if (isset($normalizedKeys['content-length'])) { - $headers['x-encoded-content-length'] - = $headers[$normalizedKeys['content-length']]; - - $length = (int) $stream->getSize(); - if ($length === 0) { - unset($headers[$normalizedKeys['content-length']]); - } else { - $headers[$normalizedKeys['content-length']] = [$length]; - } - } - } - } - } - - return [$stream, $headers]; - } - - /** - * Drains the source stream into the "sink" client option. - * - * @param StreamInterface $source - * @param StreamInterface $sink - * @param string $contentLength Header specifying the amount of - * data to read. - * - * @return StreamInterface - * @throws \RuntimeException when the sink option is invalid. - */ - private function drain( - StreamInterface $source, - StreamInterface $sink, - $contentLength - ) { - // If a content-length header is provided, then stop reading once - // that number of bytes has been read. This can prevent infinitely - // reading from a stream when dealing with servers that do not honor - // Connection: Close headers. - Psr7\copy_to_stream( - $source, - $sink, - (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 - ); - - $sink->seek(0); - $source->close(); - - return $sink; - } - - /** - * Create a resource and check to ensure it was created successfully - * - * @param callable $callback Callable that returns stream resource - * - * @return resource - * @throws \RuntimeException on error - */ - private function createResource(callable $callback) - { - $errors = null; - set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { - $errors[] = [ - 'message' => $msg, - 'file' => $file, - 'line' => $line - ]; - return true; - }); - - $resource = $callback(); - restore_error_handler(); - - if (!$resource) { - $message = 'Error creating resource: '; - foreach ($errors as $err) { - foreach ($err as $key => $value) { - $message .= "[$key] $value" . PHP_EOL; - } - } - throw new \RuntimeException(trim($message)); - } - - return $resource; - } - - private function createStream(RequestInterface $request, array $options) - { - static $methods; - if (!$methods) { - $methods = array_flip(get_class_methods(__CLASS__)); - } - - // HTTP/1.1 streams using the PHP stream wrapper require a - // Connection: close header - if ($request->getProtocolVersion() == '1.1' - && !$request->hasHeader('Connection') - ) { - $request = $request->withHeader('Connection', 'close'); - } - - // Ensure SSL is verified by default - if (!isset($options['verify'])) { - $options['verify'] = true; - } - - $params = []; - $context = $this->getDefaultContext($request); - - if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - - if (!empty($options)) { - foreach ($options as $key => $value) { - $method = "add_{$key}"; - if (isset($methods[$method])) { - $this->{$method}($request, $context, $value, $params); - } - } - } - - if (isset($options['stream_context'])) { - if (!is_array($options['stream_context'])) { - throw new \InvalidArgumentException('stream_context must be an array'); - } - $context = array_replace_recursive( - $context, - $options['stream_context'] - ); - } - - // Microsoft NTLM authentication only supported with curl handler - if (isset($options['auth']) - && is_array($options['auth']) - && isset($options['auth'][2]) - && 'ntlm' == $options['auth'][2] - ) { - throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); - } - - $uri = $this->resolveHost($request, $options); - - $context = $this->createResource( - function () use ($context, $params) { - return stream_context_create($context, $params); - } - ); - - return $this->createResource( - function () use ($uri, &$http_response_header, $context, $options) { - $resource = fopen((string) $uri, 'r', null, $context); - $this->lastHeaders = $http_response_header; - - if (isset($options['read_timeout'])) { - $readTimeout = $options['read_timeout']; - $sec = (int) $readTimeout; - $usec = ($readTimeout - $sec) * 100000; - stream_set_timeout($resource, $sec, $usec); - } - - return $resource; - } - ); - } - - private function resolveHost(RequestInterface $request, array $options) - { - $uri = $request->getUri(); - - if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) { - if ('v4' === $options['force_ip_resolve']) { - $records = dns_get_record($uri->getHost(), DNS_A); - if (!isset($records[0]['ip'])) { - throw new ConnectException( - sprintf( - "Could not resolve IPv4 address for host '%s'", - $uri->getHost() - ), - $request - ); - } - $uri = $uri->withHost($records[0]['ip']); - } elseif ('v6' === $options['force_ip_resolve']) { - $records = dns_get_record($uri->getHost(), DNS_AAAA); - if (!isset($records[0]['ipv6'])) { - throw new ConnectException( - sprintf( - "Could not resolve IPv6 address for host '%s'", - $uri->getHost() - ), - $request - ); - } - $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']'); - } - } - - return $uri; - } - - private function getDefaultContext(RequestInterface $request) - { - $headers = ''; - foreach ($request->getHeaders() as $name => $value) { - foreach ($value as $val) { - $headers .= "$name: $val\r\n"; - } - } - - $context = [ - 'http' => [ - 'method' => $request->getMethod(), - 'header' => $headers, - 'protocol_version' => $request->getProtocolVersion(), - 'ignore_errors' => true, - 'follow_location' => 0, - ], - ]; - - $body = (string) $request->getBody(); - - if (!empty($body)) { - $context['http']['content'] = $body; - // Prevent the HTTP handler from adding a Content-Type header. - if (!$request->hasHeader('Content-Type')) { - $context['http']['header'] .= "Content-Type:\r\n"; - } - } - - $context['http']['header'] = rtrim($context['http']['header']); - - return $context; - } - - private function add_proxy(RequestInterface $request, &$options, $value, &$params) - { - if (!is_array($value)) { - $options['http']['proxy'] = $value; - } else { - $scheme = $request->getUri()->getScheme(); - if (isset($value[$scheme])) { - if (!isset($value['no']) - || !\GuzzleHttp\is_host_in_noproxy( - $request->getUri()->getHost(), - $value['no'] - ) - ) { - $options['http']['proxy'] = $value[$scheme]; - } - } - } - } - - private function add_timeout(RequestInterface $request, &$options, $value, &$params) - { - if ($value > 0) { - $options['http']['timeout'] = $value; - } - } - - private function add_verify(RequestInterface $request, &$options, $value, &$params) - { - if ($value === true) { - // PHP 5.6 or greater will find the system cert by default. When - // < 5.6, use the Guzzle bundled cacert. - if (PHP_VERSION_ID < 50600) { - $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle(); - } - } elseif (is_string($value)) { - $options['ssl']['cafile'] = $value; - if (!file_exists($value)) { - throw new \RuntimeException("SSL CA bundle not found: $value"); - } - } elseif ($value === false) { - $options['ssl']['verify_peer'] = false; - $options['ssl']['verify_peer_name'] = false; - return; - } else { - throw new \InvalidArgumentException('Invalid verify request option'); - } - - $options['ssl']['verify_peer'] = true; - $options['ssl']['verify_peer_name'] = true; - $options['ssl']['allow_self_signed'] = false; - } - - private function add_cert(RequestInterface $request, &$options, $value, &$params) - { - if (is_array($value)) { - $options['ssl']['passphrase'] = $value[1]; - $value = $value[0]; - } - - if (!file_exists($value)) { - throw new \RuntimeException("SSL certificate not found: {$value}"); - } - - $options['ssl']['local_cert'] = $value; - } - - private function add_progress(RequestInterface $request, &$options, $value, &$params) - { - $this->addNotification( - $params, - function ($code, $a, $b, $c, $transferred, $total) use ($value) { - if ($code == STREAM_NOTIFY_PROGRESS) { - $value($total, $transferred, null, null); - } - } - ); - } - - private function add_debug(RequestInterface $request, &$options, $value, &$params) - { - if ($value === false) { - return; - } - - static $map = [ - 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', - ]; - static $args = ['severity', 'message', 'message_code', - 'bytes_transferred', 'bytes_max']; - - $value = \GuzzleHttp\debug_resource($value); - $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); - $this->addNotification( - $params, - function () use ($ident, $value, $map, $args) { - $passed = func_get_args(); - $code = array_shift($passed); - fprintf($value, '<%s> [%s] ', $ident, $map[$code]); - foreach (array_filter($passed) as $i => $v) { - fwrite($value, $args[$i] . ': "' . $v . '" '); - } - fwrite($value, "\n"); - } - ); - } - - private function addNotification(array &$params, callable $notify) - { - // Wrap the existing function if needed. - if (!isset($params['notification'])) { - $params['notification'] = $notify; - } else { - $params['notification'] = $this->callArray([ - $params['notification'], - $notify - ]); - } - } - - private function callArray(array $functions) - { - return function () use ($functions) { - $args = func_get_args(); - foreach ($functions as $fn) { - call_user_func_array($fn, $args); - } - }; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php deleted file mode 100644 index 6a49cc0690c..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ /dev/null @@ -1,277 +0,0 @@ -push(Middleware::httpErrors(), 'http_errors'); - $stack->push(Middleware::redirect(), 'allow_redirects'); - $stack->push(Middleware::cookies(), 'cookies'); - $stack->push(Middleware::prepareBody(), 'prepare_body'); - - return $stack; - } - - /** - * @param callable $handler Underlying HTTP handler. - */ - public function __construct(callable $handler = null) - { - $this->handler = $handler; - } - - /** - * Invokes the handler stack as a composed handler - * - * @param RequestInterface $request - * @param array $options - * - * @return ResponseInterface|PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - $handler = $this->resolve(); - - return $handler($request, $options); - } - - /** - * Dumps a string representation of the stack. - * - * @return string - */ - public function __toString() - { - $depth = 0; - $stack = []; - if ($this->handler) { - $stack[] = "0) Handler: " . $this->debugCallable($this->handler); - } - - $result = ''; - foreach (array_reverse($this->stack) as $tuple) { - $depth++; - $str = "{$depth}) Name: '{$tuple[1]}', "; - $str .= "Function: " . $this->debugCallable($tuple[0]); - $result = "> {$str}\n{$result}"; - $stack[] = $str; - } - - foreach (array_keys($stack) as $k) { - $result .= "< {$stack[$k]}\n"; - } - - return $result; - } - - /** - * Set the HTTP handler that actually returns a promise. - * - * @param callable $handler Accepts a request and array of options and - * returns a Promise. - */ - public function setHandler(callable $handler) - { - $this->handler = $handler; - $this->cached = null; - } - - /** - * Returns true if the builder has a handler. - * - * @return bool - */ - public function hasHandler() - { - return (bool) $this->handler; - } - - /** - * Unshift a middleware to the bottom of the stack. - * - * @param callable $middleware Middleware function - * @param string $name Name to register for this middleware. - */ - public function unshift(callable $middleware, $name = null) - { - array_unshift($this->stack, [$middleware, $name]); - $this->cached = null; - } - - /** - * Push a middleware to the top of the stack. - * - * @param callable $middleware Middleware function - * @param string $name Name to register for this middleware. - */ - public function push(callable $middleware, $name = '') - { - $this->stack[] = [$middleware, $name]; - $this->cached = null; - } - - /** - * Add a middleware before another middleware by name. - * - * @param string $findName Middleware to find - * @param callable $middleware Middleware function - * @param string $withName Name to register for this middleware. - */ - public function before($findName, callable $middleware, $withName = '') - { - $this->splice($findName, $withName, $middleware, true); - } - - /** - * Add a middleware after another middleware by name. - * - * @param string $findName Middleware to find - * @param callable $middleware Middleware function - * @param string $withName Name to register for this middleware. - */ - public function after($findName, callable $middleware, $withName = '') - { - $this->splice($findName, $withName, $middleware, false); - } - - /** - * Remove a middleware by instance or name from the stack. - * - * @param callable|string $remove Middleware to remove by instance or name. - */ - public function remove($remove) - { - $this->cached = null; - $idx = is_callable($remove) ? 0 : 1; - $this->stack = array_values(array_filter( - $this->stack, - function ($tuple) use ($idx, $remove) { - return $tuple[$idx] !== $remove; - } - )); - } - - /** - * Compose the middleware and handler into a single callable function. - * - * @return callable - */ - public function resolve() - { - if (!$this->cached) { - if (!($prev = $this->handler)) { - throw new \LogicException('No handler has been specified'); - } - - foreach (array_reverse($this->stack) as $fn) { - $prev = $fn[0]($prev); - } - - $this->cached = $prev; - } - - return $this->cached; - } - - /** - * @param string $name - * @return int - */ - private function findByName($name) - { - foreach ($this->stack as $k => $v) { - if ($v[1] === $name) { - return $k; - } - } - - throw new \InvalidArgumentException("Middleware not found: $name"); - } - - /** - * Splices a function into the middleware list at a specific position. - * - * @param string $findName - * @param string $withName - * @param callable $middleware - * @param bool $before - */ - private function splice($findName, $withName, callable $middleware, $before) - { - $this->cached = null; - $idx = $this->findByName($findName); - $tuple = [$middleware, $withName]; - - if ($before) { - if ($idx === 0) { - array_unshift($this->stack, $tuple); - } else { - $replacement = [$tuple, $this->stack[$idx]]; - array_splice($this->stack, $idx, 1, $replacement); - } - } elseif ($idx === count($this->stack) - 1) { - $this->stack[] = $tuple; - } else { - $replacement = [$this->stack[$idx], $tuple]; - array_splice($this->stack, $idx, 1, $replacement); - } - } - - /** - * Provides a debug string for a given callable. - * - * @param array|callable $fn Function to write as a string. - * - * @return string - */ - private function debugCallable($fn) - { - if (is_string($fn)) { - return "callable({$fn})"; - } - - if (is_array($fn)) { - return is_string($fn[0]) - ? "callable({$fn[0]}::{$fn[1]})" - : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])"; - } - - return 'callable(' . spl_object_hash($fn) . ')'; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php deleted file mode 100644 index dc36bb524d4..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/MessageFormatter.php +++ /dev/null @@ -1,185 +0,0 @@ ->>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; - const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; - - /** @var string Template used to format log messages */ - private $template; - - /** - * @param string $template Log message template - */ - public function __construct($template = self::CLF) - { - $this->template = $template ?: self::CLF; - } - - /** - * Returns a formatted message string. - * - * @param RequestInterface $request Request that was sent - * @param ResponseInterface $response Response that was received - * @param \Exception $error Exception that was received - * - * @return string - */ - public function format( - RequestInterface $request, - ResponseInterface $response = null, - \Exception $error = null - ) { - $cache = []; - - return preg_replace_callback( - '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', - function (array $matches) use ($request, $response, $error, &$cache) { - if (isset($cache[$matches[1]])) { - return $cache[$matches[1]]; - } - - $result = ''; - switch ($matches[1]) { - case 'request': - $result = Psr7\str($request); - break; - case 'response': - $result = $response ? Psr7\str($response) : ''; - break; - case 'req_headers': - $result = trim($request->getMethod() - . ' ' . $request->getRequestTarget()) - . ' HTTP/' . $request->getProtocolVersion() . "\r\n" - . $this->headers($request); - break; - case 'res_headers': - $result = $response ? - sprintf( - 'HTTP/%s %d %s', - $response->getProtocolVersion(), - $response->getStatusCode(), - $response->getReasonPhrase() - ) . "\r\n" . $this->headers($response) - : 'NULL'; - break; - case 'req_body': - $result = $request->getBody(); - break; - case 'res_body': - $result = $response ? $response->getBody() : 'NULL'; - break; - case 'ts': - case 'date_iso_8601': - $result = gmdate('c'); - break; - case 'date_common_log': - $result = date('d/M/Y:H:i:s O'); - break; - case 'method': - $result = $request->getMethod(); - break; - case 'version': - $result = $request->getProtocolVersion(); - break; - case 'uri': - case 'url': - $result = $request->getUri(); - break; - case 'target': - $result = $request->getRequestTarget(); - break; - case 'req_version': - $result = $request->getProtocolVersion(); - break; - case 'res_version': - $result = $response - ? $response->getProtocolVersion() - : 'NULL'; - break; - case 'host': - $result = $request->getHeaderLine('Host'); - break; - case 'hostname': - $result = gethostname(); - break; - case 'code': - $result = $response ? $response->getStatusCode() : 'NULL'; - break; - case 'phrase': - $result = $response ? $response->getReasonPhrase() : 'NULL'; - break; - case 'error': - $result = $error ? $error->getMessage() : 'NULL'; - break; - default: - // handle prefixed dynamic headers - if (strpos($matches[1], 'req_header_') === 0) { - $result = $request->getHeaderLine(substr($matches[1], 11)); - } elseif (strpos($matches[1], 'res_header_') === 0) { - $result = $response - ? $response->getHeaderLine(substr($matches[1], 11)) - : 'NULL'; - } - } - - $cache[$matches[1]] = $result; - return $result; - }, - $this->template - ); - } - - /** - * Get headers from message as string - * - * @return string - */ - private function headers(MessageInterface $message) - { - $result = ''; - foreach ($message->getHeaders() as $name => $values) { - $result .= $name . ': ' . implode(', ', $values) . "\r\n"; - } - - return trim($result); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php deleted file mode 100644 index bffc1974bbe..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Middleware.php +++ /dev/null @@ -1,254 +0,0 @@ -withCookieHeader($request); - return $handler($request, $options) - ->then( - function ($response) use ($cookieJar, $request) { - $cookieJar->extractCookies($request, $response); - return $response; - } - ); - }; - }; - } - - /** - * Middleware that throws exceptions for 4xx or 5xx responses when the - * "http_error" request option is set to true. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function httpErrors() - { - return function (callable $handler) { - return function ($request, array $options) use ($handler) { - if (empty($options['http_errors'])) { - return $handler($request, $options); - } - return $handler($request, $options)->then( - function (ResponseInterface $response) use ($request) { - $code = $response->getStatusCode(); - if ($code < 400) { - return $response; - } - throw RequestException::create($request, $response); - } - ); - }; - }; - } - - /** - * Middleware that pushes history data to an ArrayAccess container. - * - * @param array|\ArrayAccess $container Container to hold the history (by reference). - * - * @return callable Returns a function that accepts the next handler. - * @throws \InvalidArgumentException if container is not an array or ArrayAccess. - */ - public static function history(&$container) - { - if (!is_array($container) && !$container instanceof \ArrayAccess) { - throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); - } - - return function (callable $handler) use (&$container) { - return function ($request, array $options) use ($handler, &$container) { - return $handler($request, $options)->then( - function ($value) use ($request, &$container, $options) { - $container[] = [ - 'request' => $request, - 'response' => $value, - 'error' => null, - 'options' => $options - ]; - return $value; - }, - function ($reason) use ($request, &$container, $options) { - $container[] = [ - 'request' => $request, - 'response' => null, - 'error' => $reason, - 'options' => $options - ]; - return \GuzzleHttp\Promise\rejection_for($reason); - } - ); - }; - }; - } - - /** - * Middleware that invokes a callback before and after sending a request. - * - * The provided listener cannot modify or alter the response. It simply - * "taps" into the chain to be notified before returning the promise. The - * before listener accepts a request and options array, and the after - * listener accepts a request, options array, and response promise. - * - * @param callable $before Function to invoke before forwarding the request. - * @param callable $after Function invoked after forwarding. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function tap(callable $before = null, callable $after = null) - { - return function (callable $handler) use ($before, $after) { - return function ($request, array $options) use ($handler, $before, $after) { - if ($before) { - $before($request, $options); - } - $response = $handler($request, $options); - if ($after) { - $after($request, $options, $response); - } - return $response; - }; - }; - } - - /** - * Middleware that handles request redirects. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function redirect() - { - return function (callable $handler) { - return new RedirectMiddleware($handler); - }; - } - - /** - * Middleware that retries requests based on the boolean result of - * invoking the provided "decider" function. - * - * If no delay function is provided, a simple implementation of exponential - * backoff will be utilized. - * - * @param callable $decider Function that accepts the number of retries, - * a request, [response], and [exception] and - * returns true if the request is to be retried. - * @param callable $delay Function that accepts the number of retries and - * returns the number of milliseconds to delay. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function retry(callable $decider, callable $delay = null) - { - return function (callable $handler) use ($decider, $delay) { - return new RetryMiddleware($decider, $handler, $delay); - }; - } - - /** - * Middleware that logs requests, responses, and errors using a message - * formatter. - * - * @param LoggerInterface $logger Logs messages. - * @param MessageFormatter $formatter Formatter used to create message strings. - * @param string $logLevel Level at which to log requests. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */) - { - return function (callable $handler) use ($logger, $formatter, $logLevel) { - return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) { - return $handler($request, $options)->then( - function ($response) use ($logger, $request, $formatter, $logLevel) { - $message = $formatter->format($request, $response); - $logger->log($logLevel, $message); - return $response; - }, - function ($reason) use ($logger, $request, $formatter) { - $response = $reason instanceof RequestException - ? $reason->getResponse() - : null; - $message = $formatter->format($request, $response, $reason); - $logger->notice($message); - return \GuzzleHttp\Promise\rejection_for($reason); - } - ); - }; - }; - } - - /** - * This middleware adds a default content-type if possible, a default - * content-length or transfer-encoding header, and the expect header. - * - * @return callable - */ - public static function prepareBody() - { - return function (callable $handler) { - return new PrepareBodyMiddleware($handler); - }; - } - - /** - * Middleware that applies a map function to the request before passing to - * the next handler. - * - * @param callable $fn Function that accepts a RequestInterface and returns - * a RequestInterface. - * @return callable - */ - public static function mapRequest(callable $fn) - { - return function (callable $handler) use ($fn) { - return function ($request, array $options) use ($handler, $fn) { - return $handler($fn($request), $options); - }; - }; - } - - /** - * Middleware that applies a map function to the resolved promise's - * response. - * - * @param callable $fn Function that accepts a ResponseInterface and - * returns a ResponseInterface. - * @return callable - */ - public static function mapResponse(callable $fn) - { - return function (callable $handler) use ($fn) { - return function ($request, array $options) use ($handler, $fn) { - return $handler($request, $options)->then($fn); - }; - }; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php index 5838db4f4cf..7b9d83a4eaa 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Pool.php @@ -1,87 +1,97 @@ $rfn) { - if ($rfn instanceof RequestInterface) { - yield $key => $client->sendAsync($rfn, $opts); - } elseif (is_callable($rfn)) { - yield $key => $rfn($opts); - } else { - throw new \InvalidArgumentException('Each value yielded by ' - . 'the iterator must be a Psr7\Http\Message\RequestInterface ' - . 'or a callable that returns a promise that fulfills ' - . 'with a Psr7\Message\Http\ResponseInterface object.'); - } - } - }; + /** @var Deferred */ + private $deferred; - $this->each = new EachPromise($requests(), $config); - } + /** @var PromiseInterface */ + private $promise; + + private $waitQueue = []; + private $eventListeners = []; + private $poolSize; + private $isRealized = false; /** - * Get promise + * The option values for 'before', 'complete', 'error' and 'end' can be a + * callable, an associative array containing event data, or an array of + * event data arrays. Event data arrays contain the following keys: + * + * - fn: callable to invoke that receives the event + * - priority: Optional event priority (defaults to 0) + * - once: Set to true so that the event is removed after it is triggered * - * @return PromiseInterface + * @param ClientInterface $client Client used to send the requests. + * @param array|\Iterator $requests Requests to send in parallel + * @param array $options Associative array of options + * - pool_size: (callable|int) Maximum number of requests to send + * concurrently, or a callback that receives + * the current queue size and returns the + * number of new requests to send + * - before: (callable|array) Receives a BeforeEvent + * - complete: (callable|array) Receives a CompleteEvent + * - error: (callable|array) Receives a ErrorEvent + * - end: (callable|array) Receives an EndEvent */ - public function promise() - { - return $this->each->promise(); + public function __construct( + ClientInterface $client, + $requests, + array $options = [] + ) { + $this->client = $client; + $this->iter = $this->coerceIterable($requests); + $this->deferred = new Deferred(); + $this->promise = $this->deferred->promise(); + $this->poolSize = isset($options['pool_size']) + ? $options['pool_size'] : 25; + $this->eventListeners = $this->prepareListeners( + $options, + ['before', 'complete', 'error', 'end'] + ); } /** - * Sends multiple requests concurrently and returns an array of responses + * Sends multiple requests in parallel and returns an array of responses * and exceptions that uses the same ordering as the provided requests. * * IMPORTANT: This method keeps every request and response in memory, and @@ -89,12 +99,11 @@ public function promise() * indeterminate number of requests concurrently. * * @param ClientInterface $client Client used to send the requests - * @param array|\Iterator $requests Requests to send concurrently. + * @param array|\Iterator $requests Requests to send in parallel * @param array $options Passes through the options available in * {@see GuzzleHttp\Pool::__construct} * - * @return array Returns an array containing the response or an exception - * in the same order that the requests were sent. + * @return BatchResults Returns a container for the results. * @throws \InvalidArgumentException if the event format is incorrect. */ public static function batch( @@ -102,33 +111,223 @@ public static function batch( $requests, array $options = [] ) { - $res = []; - self::cmpCallback($options, 'fulfilled', $res); - self::cmpCallback($options, 'rejected', $res); - $pool = new static($client, $requests, $options); - $pool->promise()->wait(); - ksort($res); - - return $res; + $hash = new \SplObjectStorage(); + foreach ($requests as $request) { + $hash->attach($request); + } + + // In addition to the normally run events when requests complete, add + // and event to continuously track the results of transfers in the hash. + (new self($client, $requests, RequestEvents::convertEventArray( + $options, + ['end'], + [ + 'priority' => RequestEvents::LATE, + 'fn' => function (EndEvent $e) use ($hash) { + $hash[$e->getRequest()] = $e->getException() + ? $e->getException() + : $e->getResponse(); + } + ] + )))->wait(); + + return new BatchResults($hash); } /** - * Execute callback(s) + * Creates a Pool and immediately sends the requests. * - * @return void + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send in parallel + * @param array $options Passes through the options available in + * {@see GuzzleHttp\Pool::__construct} */ - private static function cmpCallback(array &$options, $name, array &$results) + public static function send( + ClientInterface $client, + $requests, + array $options = [] + ) { + $pool = new self($client, $requests, $options); + $pool->wait(); + } + + private function getPoolSize() { - if (!isset($options[$name])) { - $options[$name] = function ($v, $k) use (&$results) { - $results[$k] = $v; - }; - } else { - $currentFn = $options[$name]; - $options[$name] = function ($v, $k) use (&$results, $currentFn) { - $currentFn($v, $k); - $results[$k] = $v; - }; + return is_callable($this->poolSize) + ? call_user_func($this->poolSize, count($this->waitQueue)) + : $this->poolSize; + } + + /** + * Add as many requests as possible up to the current pool limit. + */ + private function addNextRequests() + { + $limit = max($this->getPoolSize() - count($this->waitQueue), 0); + while ($limit--) { + if (!$this->addNextRequest()) { + break; + } } } + + public function wait() + { + if ($this->isRealized) { + return false; + } + + // Seed the pool with N number of requests. + $this->addNextRequests(); + + // Stop if the pool was cancelled while transferring requests. + if ($this->isRealized) { + return false; + } + + // Wait on any outstanding FutureResponse objects. + while ($response = array_pop($this->waitQueue)) { + try { + $response->wait(); + } catch (\Exception $e) { + // Eat exceptions because they should be handled asynchronously + } + $this->addNextRequests(); + } + + // Clean up no longer needed state. + $this->isRealized = true; + $this->waitQueue = $this->eventListeners = []; + $this->client = $this->iter = null; + $this->deferred->resolve(true); + + return true; + } + + /** + * {@inheritdoc} + * + * Attempt to cancel all outstanding requests (requests that are queued for + * dereferencing). Returns true if all outstanding requests can be + * cancelled. + * + * @return bool + */ + public function cancel() + { + if ($this->isRealized) { + return false; + } + + $success = $this->isRealized = true; + foreach ($this->waitQueue as $response) { + if (!$response->cancel()) { + $success = false; + } + } + + return $success; + } + + /** + * Returns a promise that is invoked when the pool completed. There will be + * no passed value. + * + * {@inheritdoc} + */ + public function then( + callable $onFulfilled = null, + callable $onRejected = null, + callable $onProgress = null + ) { + return $this->promise->then($onFulfilled, $onRejected, $onProgress); + } + + public function promise() + { + return $this->promise; + } + + private function coerceIterable($requests) + { + if ($requests instanceof \Iterator) { + return $requests; + } elseif (is_array($requests)) { + return new \ArrayIterator($requests); + } + + throw new \InvalidArgumentException('Expected Iterator or array. ' + . 'Found ' . Core::describeType($requests)); + } + + /** + * Adds the next request to pool and tracks what requests need to be + * dereferenced when completing the pool. + */ + private function addNextRequest() + { + add_next: + + if ($this->isRealized || !$this->iter || !$this->iter->valid()) { + return false; + } + + $request = $this->iter->current(); + $this->iter->next(); + + if (!($request instanceof RequestInterface)) { + throw new \InvalidArgumentException(sprintf( + 'All requests in the provided iterator must implement ' + . 'RequestInterface. Found %s', + Core::describeType($request) + )); + } + + // Be sure to use "lazy" futures, meaning they do not send right away. + $request->getConfig()->set('future', 'lazy'); + $hash = spl_object_hash($request); + $this->attachListeners($request, $this->eventListeners); + $request->getEmitter()->on('before', [$this, '_trackRetries'], RequestEvents::EARLY); + $response = $this->client->send($request); + $this->waitQueue[$hash] = $response; + $promise = $response->promise(); + + // Don't recursively call itself for completed or rejected responses. + if ($promise instanceof FulfilledPromise + || $promise instanceof RejectedPromise + ) { + try { + $this->finishResponse($request, $response->wait(), $hash); + } catch (\Exception $e) { + $this->finishResponse($request, $e, $hash); + } + goto add_next; + } + + // Use this function for both resolution and rejection. + $thenFn = function ($value) use ($request, $hash) { + $this->finishResponse($request, $value, $hash); + if (!$request->getConfig()->get('_pool_retries')) { + $this->addNextRequests(); + } + }; + + $promise->then($thenFn, $thenFn); + + return true; + } + + public function _trackRetries(BeforeEvent $e) + { + $e->getRequest()->getConfig()->set('_pool_retries', $e->getRetryCount()); + } + + private function finishResponse($request, $value, $hash) + { + unset($this->waitQueue[$hash]); + $result = $value instanceof ResponseInterface + ? ['request' => $request, 'response' => $value, 'error' => null] + : ['request' => $request, 'response' => null, 'error' => $value]; + $this->deferred->notify($result); + } } diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php deleted file mode 100644 index 568a1e906c9..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +++ /dev/null @@ -1,111 +0,0 @@ -nextHandler = $nextHandler; - } - - /** - * @param RequestInterface $request - * @param array $options - * - * @return PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - $fn = $this->nextHandler; - - // Don't do anything if the request has no body. - if ($request->getBody()->getSize() === 0) { - return $fn($request, $options); - } - - $modify = []; - - // Add a default content-type if possible. - if (!$request->hasHeader('Content-Type')) { - if ($uri = $request->getBody()->getMetadata('uri')) { - if ($type = Psr7\mimetype_from_filename($uri)) { - $modify['set_headers']['Content-Type'] = $type; - } - } - } - - // Add a default content-length or transfer-encoding header. - if (!$request->hasHeader('Content-Length') - && !$request->hasHeader('Transfer-Encoding') - ) { - $size = $request->getBody()->getSize(); - if ($size !== null) { - $modify['set_headers']['Content-Length'] = $size; - } else { - $modify['set_headers']['Transfer-Encoding'] = 'chunked'; - } - } - - // Add the expect header if needed. - $this->addExpectHeader($request, $options, $modify); - - return $fn(Psr7\modify_request($request, $modify), $options); - } - - /** - * Add expect header - * - * @return void - */ - private function addExpectHeader( - RequestInterface $request, - array $options, - array &$modify - ) { - // Determine if the Expect header should be used - if ($request->hasHeader('Expect')) { - return; - } - - $expect = isset($options['expect']) ? $options['expect'] : null; - - // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 - if ($expect === false || $request->getProtocolVersion() < 1.1) { - return; - } - - // The expect header is unconditionally enabled - if ($expect === true) { - $modify['set_headers']['Expect'] = '100-Continue'; - return; - } - - // By default, send the expect header when the payload is > 1mb - if ($expect === null) { - $expect = 1048576; - } - - // Always add if the body cannot be rewound, the size cannot be - // determined, or the size is greater than the cutoff threshold - $body = $request->getBody(); - $size = $body->getSize(); - - if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { - $modify['set_headers']['Expect'] = '100-Continue'; - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php deleted file mode 100644 index e4644b7ac1d..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ /dev/null @@ -1,255 +0,0 @@ - 5, - 'protocols' => ['http', 'https'], - 'strict' => false, - 'referer' => false, - 'track_redirects' => false, - ]; - - /** @var callable */ - private $nextHandler; - - /** - * @param callable $nextHandler Next handler to invoke. - */ - public function __construct(callable $nextHandler) - { - $this->nextHandler = $nextHandler; - } - - /** - * @param RequestInterface $request - * @param array $options - * - * @return PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - $fn = $this->nextHandler; - - if (empty($options['allow_redirects'])) { - return $fn($request, $options); - } - - if ($options['allow_redirects'] === true) { - $options['allow_redirects'] = self::$defaultSettings; - } elseif (!is_array($options['allow_redirects'])) { - throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); - } else { - // Merge the default settings with the provided settings - $options['allow_redirects'] += self::$defaultSettings; - } - - if (empty($options['allow_redirects']['max'])) { - return $fn($request, $options); - } - - return $fn($request, $options) - ->then(function (ResponseInterface $response) use ($request, $options) { - return $this->checkRedirect($request, $options, $response); - }); - } - - /** - * @param RequestInterface $request - * @param array $options - * @param ResponseInterface $response - * - * @return ResponseInterface|PromiseInterface - */ - public function checkRedirect( - RequestInterface $request, - array $options, - ResponseInterface $response - ) { - if (substr($response->getStatusCode(), 0, 1) != '3' - || !$response->hasHeader('Location') - ) { - return $response; - } - - $this->guardMax($request, $options); - $nextRequest = $this->modifyRequest($request, $options, $response); - - if (isset($options['allow_redirects']['on_redirect'])) { - call_user_func( - $options['allow_redirects']['on_redirect'], - $request, - $response, - $nextRequest->getUri() - ); - } - - /** @var PromiseInterface|ResponseInterface $promise */ - $promise = $this($nextRequest, $options); - - // Add headers to be able to track history of redirects. - if (!empty($options['allow_redirects']['track_redirects'])) { - return $this->withTracking( - $promise, - (string) $nextRequest->getUri(), - $response->getStatusCode() - ); - } - - return $promise; - } - - /** - * Enable tracking on promise. - * - * @return PromiseInterface - */ - private function withTracking(PromiseInterface $promise, $uri, $statusCode) - { - return $promise->then( - function (ResponseInterface $response) use ($uri, $statusCode) { - // Note that we are pushing to the front of the list as this - // would be an earlier response than what is currently present - // in the history header. - $historyHeader = $response->getHeader(self::HISTORY_HEADER); - $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); - array_unshift($historyHeader, $uri); - array_unshift($statusHeader, $statusCode); - return $response->withHeader(self::HISTORY_HEADER, $historyHeader) - ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); - } - ); - } - - /** - * Check for too many redirects - * - * @return void - * - * @throws TooManyRedirectsException Too many redirects. - */ - private function guardMax(RequestInterface $request, array &$options) - { - $current = isset($options['__redirect_count']) - ? $options['__redirect_count'] - : 0; - $options['__redirect_count'] = $current + 1; - $max = $options['allow_redirects']['max']; - - if ($options['__redirect_count'] > $max) { - throw new TooManyRedirectsException( - "Will not follow more than {$max} redirects", - $request - ); - } - } - - /** - * @param RequestInterface $request - * @param array $options - * @param ResponseInterface $response - * - * @return RequestInterface - */ - public function modifyRequest( - RequestInterface $request, - array $options, - ResponseInterface $response - ) { - // Request modifications to apply. - $modify = []; - $protocols = $options['allow_redirects']['protocols']; - - // Use a GET request if this is an entity enclosing request and we are - // not forcing RFC compliance, but rather emulating what all browsers - // would do. - $statusCode = $response->getStatusCode(); - if ($statusCode == 303 || - ($statusCode <= 302 && !$options['allow_redirects']['strict']) - ) { - $modify['method'] = 'GET'; - $modify['body'] = ''; - } - - $uri = $this->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); - } - - $modify['uri'] = $uri; - Psr7\rewind_body($request); - - // Add the Referer header if it is told to do so and only - // add the header if we are not redirecting from https to http. - if ($options['allow_redirects']['referer'] - && $modify['uri']->getScheme() === $request->getUri()->getScheme() - ) { - $uri = $request->getUri()->withUserInfo(''); - $modify['set_headers']['Referer'] = (string) $uri; - } else { - $modify['remove_headers'][] = 'Referer'; - } - - // Remove Authorization header if host is different. - if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { - $modify['remove_headers'][] = 'Authorization'; - } - - return Psr7\modify_request($request, $modify); - } - - /** - * Set the appropriate URL on the request based on the location header - * - * @param RequestInterface $request - * @param ResponseInterface $response - * @param array $protocols - * - * @return UriInterface - */ - private function redirectUri( - RequestInterface $request, - ResponseInterface $response, - array $protocols - ) { - $location = Psr7\UriResolver::resolve( - $request->getUri(), - new Psr7\Uri($response->getHeaderLine('Location')) - ); - - // Ensure that the redirect URI is allowed based on the protocols. - if (!in_array($location->getScheme(), $protocols)) { - throw new BadResponseException( - sprintf( - 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s', - $location, - implode(', ', $protocols) - ), - $request, - $response - ); - } - - return $location; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php deleted file mode 100644 index 355f658f034..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestOptions.php +++ /dev/null @@ -1,263 +0,0 @@ -decider = $decider; - $this->nextHandler = $nextHandler; - $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; - } - - /** - * Default exponential backoff delay function. - * - * @param int $retries - * - * @return int milliseconds. - */ - public static function exponentialDelay($retries) - { - return (int) pow(2, $retries - 1) * 1000; - } - - /** - * @param RequestInterface $request - * @param array $options - * - * @return PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - if (!isset($options['retries'])) { - $options['retries'] = 0; - } - - $fn = $this->nextHandler; - return $fn($request, $options) - ->then( - $this->onFulfilled($request, $options), - $this->onRejected($request, $options) - ); - } - - /** - * Execute fulfilled closure - * - * @return mixed - */ - private function onFulfilled(RequestInterface $req, array $options) - { - return function ($value) use ($req, $options) { - if (!call_user_func( - $this->decider, - $options['retries'], - $req, - $value, - null - )) { - return $value; - } - return $this->doRetry($req, $options, $value); - }; - } - - /** - * Execute rejected closure - * - * @return callable - */ - private function onRejected(RequestInterface $req, array $options) - { - return function ($reason) use ($req, $options) { - if (!call_user_func( - $this->decider, - $options['retries'], - $req, - null, - $reason - )) { - return \GuzzleHttp\Promise\rejection_for($reason); - } - return $this->doRetry($req, $options); - }; - } - - /** - * @return self - */ - private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) - { - $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); - - return $this($request, $options); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php deleted file mode 100644 index 87fb3c00164..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/TransferStats.php +++ /dev/null @@ -1,126 +0,0 @@ -request = $request; - $this->response = $response; - $this->transferTime = $transferTime; - $this->handlerErrorData = $handlerErrorData; - $this->handlerStats = $handlerStats; - } - - /** - * @return RequestInterface - */ - public function getRequest() - { - return $this->request; - } - - /** - * Returns the response that was received (if any). - * - * @return ResponseInterface|null - */ - public function getResponse() - { - return $this->response; - } - - /** - * Returns true if a response was received. - * - * @return bool - */ - public function hasResponse() - { - return $this->response !== null; - } - - /** - * Gets handler specific error data. - * - * This might be an exception, a integer representing an error code, or - * anything else. Relying on this value assumes that you know what handler - * you are using. - * - * @return mixed - */ - public function getHandlerErrorData() - { - return $this->handlerErrorData; - } - - /** - * Get the effective URI the request was sent to. - * - * @return UriInterface - */ - public function getEffectiveUri() - { - return $this->request->getUri(); - } - - /** - * Get the estimated time the request was being transferred by the handler. - * - * @return float|null Time in seconds. - */ - public function getTransferTime() - { - return $this->transferTime; - } - - /** - * Gets an array of all of the handler specific transfer data. - * - * @return array - */ - public function getHandlerStats() - { - return $this->handlerStats; - } - - /** - * Get a specific handler statistic from the handler by name. - * - * @param string $stat Handler specific transfer stat to retrieve. - * - * @return mixed|null - */ - public function getHandlerStat($stat) - { - return isset($this->handlerStats[$stat]) - ? $this->handlerStats[$stat] - : null; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php index 96dcfd09cd7..55dfeb5a4c5 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/UriTemplate.php @@ -15,25 +15,25 @@ class UriTemplate private $variables; /** @var array Hash for quick operator lookups */ - private static $operatorHash = [ - '' => ['prefix' => '', 'joiner' => ',', 'query' => false], - '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], - '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], - '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], - '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], - ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], - '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], - '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true] - ]; + private static $operatorHash = array( + '' => array('prefix' => '', 'joiner' => ',', 'query' => false), + '+' => array('prefix' => '', 'joiner' => ',', 'query' => false), + '#' => array('prefix' => '#', 'joiner' => ',', 'query' => false), + '.' => array('prefix' => '.', 'joiner' => '.', 'query' => false), + '/' => array('prefix' => '/', 'joiner' => '/', 'query' => false), + ';' => array('prefix' => ';', 'joiner' => ';', 'query' => true), + '?' => array('prefix' => '?', 'joiner' => '&', 'query' => true), + '&' => array('prefix' => '&', 'joiner' => '&', 'query' => true) + ); /** @var array Delimiters */ - private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', - '&', '\'', '(', ')', '*', '+', ',', ';', '=']; + private static $delims = array(':', '/', '?', '#', '[', ']', '@', '!', '$', + '&', '\'', '(', ')', '*', '+', ',', ';', '='); /** @var array Percent encoded delimiters */ - private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', + private static $delimsPct = array('%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', - '%3B', '%3D']; + '%3B', '%3D'); public function expand($template, array $variables) { @@ -60,7 +60,7 @@ public function expand($template, array $variables) */ private function parseExpression($expression) { - $result = []; + $result = array(); if (isset(self::$operatorHash[$expression[0]])) { $result['operator'] = $expression[0]; @@ -71,12 +71,12 @@ private function parseExpression($expression) foreach (explode(',', $expression) as $value) { $value = trim($value); - $varspec = []; + $varspec = array(); if ($colonPos = strpos($value, ':')) { $varspec['value'] = substr($value, 0, $colonPos); $varspec['modifier'] = ':'; $varspec['position'] = (int) substr($value, $colonPos + 1); - } elseif (substr($value, -1) === '*') { + } elseif (substr($value, -1) == '*') { $varspec['modifier'] = '*'; $varspec['value'] = substr($value, 0, -1); } else { @@ -98,15 +98,16 @@ private function parseExpression($expression) */ private function expandMatch(array $matches) { - static $rfc1738to3986 = ['+' => '%20', '%7e' => '~']; + static $rfc1738to3986 = array('+' => '%20', '%7e' => '~'); - $replacements = []; + $replacements = array(); $parsed = self::parseExpression($matches[1]); $prefix = self::$operatorHash[$parsed['operator']]['prefix']; $joiner = self::$operatorHash[$parsed['operator']]['joiner']; $useQuery = self::$operatorHash[$parsed['operator']]['query']; foreach ($parsed['values'] as $value) { + if (!isset($this->variables[$value['value']])) { continue; } @@ -116,9 +117,11 @@ private function expandMatch(array $matches) $expanded = ''; if (is_array($variable)) { + $isAssoc = $this->isAssoc($variable); - $kvp = []; + $kvp = array(); foreach ($variable as $key => $var) { + if ($isAssoc) { $key = rawurlencode($key); $isNestedArray = is_array($var); @@ -128,14 +131,14 @@ private function expandMatch(array $matches) if (!$isNestedArray) { $var = rawurlencode($var); - if ($parsed['operator'] === '+' || - $parsed['operator'] === '#' + if ($parsed['operator'] == '+' || + $parsed['operator'] == '#' ) { $var = $this->decodeReserved($var); } } - if ($value['modifier'] === '*') { + if ($value['modifier'] == '*') { if ($isAssoc) { if ($isNestedArray) { // Nested arrays must allow for deeply nested @@ -157,7 +160,7 @@ private function expandMatch(array $matches) if (empty($variable)) { $actuallyUseQuery = false; - } elseif ($value['modifier'] === '*') { + } elseif ($value['modifier'] == '*') { $expanded = implode($joiner, $kvp); if ($isAssoc) { // Don't prepend the value name when using the explode @@ -176,18 +179,19 @@ private function expandMatch(array $matches) } $expanded = implode(',', $kvp); } + } else { - if ($value['modifier'] === ':') { + if ($value['modifier'] == ':') { $variable = substr($variable, 0, $value['position']); } $expanded = rawurlencode($variable); - if ($parsed['operator'] === '+' || $parsed['operator'] === '#') { + if ($parsed['operator'] == '+' || $parsed['operator'] == '#') { $expanded = $this->decodeReserved($expanded); } } if ($actuallyUseQuery) { - if (!$expanded && $joiner !== '&') { + if (!$expanded && $joiner != '&') { $expanded = $value['value']; } else { $expanded = $value['value'] . '=' . $expanded; diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php index c698acbf02f..1754719013a 100644 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Utils.php @@ -1,92 +1,215 @@ getHost()) { - $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); - if ($asciiHost === false) { - $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; - - $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) { - return substr($name, 0, 11) === 'IDNA_ERROR_'; - }); - - $errors = []; - foreach ($errorConstants as $errorConstant) { - if ($errorBitSet & constant($errorConstant)) { - $errors[] = $errorConstant; - } - } + $queue = explode('/', $path); + // Optimization for simple sets. + if (count($queue) === 1) { + $data[$path] = $value; + return; + } - $errorMessage = 'IDN conversion failed'; - if ($errors) { - $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; + $current =& $data; + while (null !== ($key = array_shift($queue))) { + if (!is_array($current)) { + throw new \RuntimeException("Trying to setPath {$path}, but " + . "{$key} is set and is not an array"); + } elseif (!$queue) { + if ($key == '[]') { + $current[] = $value; + } else { + $current[$key] = $value; } - - throw new InvalidArgumentException($errorMessage); + } elseif (isset($current[$key])) { + $current =& $current[$key]; } else { - if ($uri->getHost() !== $asciiHost) { - // Replace URI only if the ASCII version is different - $uri = $uri->withHost($asciiHost); - } + $current[$key] = []; + $current =& $current[$key]; } } + } + + /** + * Expands a URI template + * + * @param string $template URI template + * @param array $variables Template variables + * + * @return string + */ + public static function uriTemplate($template, array $variables) + { + if (function_exists('\\uri_template')) { + return \uri_template($template, $variables); + } + + static $uriTemplate; + if (!$uriTemplate) { + $uriTemplate = new UriTemplate(); + } + + return $uriTemplate->expand($template, $variables); + } + + /** + * Wrapper for JSON decode that implements error detection with helpful + * error messages. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return mixed + * @throws \InvalidArgumentException if the JSON cannot be parsed. + * @link http://www.php.net/manual/en/function.json-decode.php + */ + public static function jsonDecode($json, $assoc = false, $depth = 512, $options = 0) + { + if ($json === '' || $json === null) { + return null; + } + + static $jsonErrors = [ + JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded', + JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch', + JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found', + JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON', + JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded' + ]; + + $data = \json_decode($json, $assoc, $depth, $options); + + if (JSON_ERROR_NONE !== json_last_error()) { + $last = json_last_error(); + throw new \InvalidArgumentException( + 'Unable to parse JSON data: ' + . (isset($jsonErrors[$last]) + ? $jsonErrors[$last] + : 'Unknown error') + ); + } - return $uri; + return $data; } /** - * @param string $domain - * @param int $options - * @param array $info + * Get the default User-Agent string to use with Guzzle * - * @return string|false + * @return string */ - private static function idnToAsci($domain, $options, &$info = []) + public static function getDefaultUserAgent() { - if (\preg_match('%^[ -~]+$%', $domain) === 1) { - return $domain; + static $defaultAgent = ''; + if (!$defaultAgent) { + $defaultAgent = 'Guzzle/' . ClientInterface::VERSION; + if (extension_loaded('curl')) { + $defaultAgent .= ' curl/' . curl_version()['version']; + } + $defaultAgent .= ' PHP/' . PHP_VERSION; } - if (\extension_loaded('intl') && defined('INTL_IDNA_VARIANT_UTS46')) { - return \idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $info); + return $defaultAgent; + } + + /** + * Create a default handler to use based on the environment + * + * @throws \RuntimeException if no viable Handler is available. + */ + public static function getDefaultHandler() + { + $default = $future = null; + + if (extension_loaded('curl')) { + $config = [ + 'select_timeout' => getenv('GUZZLE_CURL_SELECT_TIMEOUT') ?: 1 + ]; + if ($maxHandles = getenv('GUZZLE_CURL_MAX_HANDLES')) { + $config['max_handles'] = $maxHandles; + } + if (function_exists('curl_reset')) { + $default = new CurlHandler(); + $future = new CurlMultiHandler($config); + } else { + $default = new CurlMultiHandler($config); + } } - /* - * The Idn class is marked as @internal. Verify that class and method exists. - */ - if (method_exists(Idn::class, 'idn_to_ascii')) { - return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); + if (ini_get('allow_url_fopen')) { + $default = !$default + ? new StreamHandler() + : Middleware::wrapStreaming($default, new StreamHandler()); + } elseif (!$default) { + throw new \RuntimeException('Guzzle requires cURL, the ' + . 'allow_url_fopen ini setting, or a custom HTTP handler.'); } - throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old'); + return $future ? Middleware::wrapFuture($default, $future) : $default; } } diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php deleted file mode 100644 index c2afd8c7bb1..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions.php +++ /dev/null @@ -1,334 +0,0 @@ -expand($template, $variables); -} - -/** - * Debug function used to describe the provided value type and class. - * - * @param mixed $input - * - * @return string Returns a string containing the type of the variable and - * if a class is provided, the class name. - */ -function describe_type($input) -{ - switch (gettype($input)) { - case 'object': - return 'object(' . get_class($input) . ')'; - case 'array': - return 'array(' . count($input) . ')'; - default: - ob_start(); - var_dump($input); - // normalize float vs double - return str_replace('double(', 'float(', rtrim(ob_get_clean())); - } -} - -/** - * Parses an array of header lines into an associative array of headers. - * - * @param iterable $lines Header lines array of strings in the following - * format: "Name: Value" - * @return array - */ -function headers_from_lines($lines) -{ - $headers = []; - - foreach ($lines as $line) { - $parts = explode(':', $line, 2); - $headers[trim($parts[0])][] = isset($parts[1]) - ? trim($parts[1]) - : null; - } - - return $headers; -} - -/** - * Returns a debug stream based on the provided variable. - * - * @param mixed $value Optional value - * - * @return resource - */ -function debug_resource($value = null) -{ - if (is_resource($value)) { - return $value; - } elseif (defined('STDOUT')) { - return STDOUT; - } - - return fopen('php://output', 'w'); -} - -/** - * Chooses and creates a default handler to use based on the environment. - * - * The returned handler is not wrapped by any default middlewares. - * - * @return callable Returns the best handler for the given system. - * @throws \RuntimeException if no viable Handler is available. - */ -function choose_handler() -{ - $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 (ini_get('allow_url_fopen')) { - $handler = $handler - ? Proxy::wrapStreaming($handler, new StreamHandler()) - : new StreamHandler(); - } elseif (!$handler) { - throw new \RuntimeException('GuzzleHttp requires cURL, the ' - . 'allow_url_fopen ini setting, or a custom HTTP handler.'); - } - - return $handler; -} - -/** - * Get the default User-Agent string to use with Guzzle - * - * @return string - */ -function default_user_agent() -{ - static $defaultAgent = ''; - - if (!$defaultAgent) { - $defaultAgent = 'GuzzleHttp/' . Client::VERSION; - if (extension_loaded('curl') && function_exists('curl_version')) { - $defaultAgent .= ' curl/' . \curl_version()['version']; - } - $defaultAgent .= ' PHP/' . PHP_VERSION; - } - - return $defaultAgent; -} - -/** - * Returns the default cacert bundle for the current system. - * - * First, the openssl.cafile and curl.cainfo php.ini settings are checked. - * If those settings are not configured, then the common locations for - * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X - * and Windows are checked. If any of these file locations are found on - * disk, they will be utilized. - * - * Note: the result of this function is cached for subsequent calls. - * - * @return string - * @throws \RuntimeException if no bundle can be found. - */ -function default_ca_bundle() -{ - static $cached = null; - static $cafiles = [ - // Red Hat, CentOS, Fedora (provided by the ca-certificates package) - '/etc/pki/tls/certs/ca-bundle.crt', - // Ubuntu, Debian (provided by the ca-certificates package) - '/etc/ssl/certs/ca-certificates.crt', - // FreeBSD (provided by the ca_root_nss package) - '/usr/local/share/certs/ca-root-nss.crt', - // SLES 12 (provided by the ca-certificates package) - '/var/lib/ca-certificates/ca-bundle.pem', - // OS X provided by homebrew (using the default path) - '/usr/local/etc/openssl/cert.pem', - // Google app engine - '/etc/ca-certificates.crt', - // Windows? - 'C:\\windows\\system32\\curl-ca-bundle.crt', - 'C:\\windows\\curl-ca-bundle.crt', - ]; - - if ($cached) { - return $cached; - } - - if ($ca = ini_get('openssl.cafile')) { - return $cached = $ca; - } - - if ($ca = ini_get('curl.cainfo')) { - return $cached = $ca; - } - - foreach ($cafiles as $filename) { - if (file_exists($filename)) { - return $cached = $filename; - } - } - - throw new \RuntimeException( - <<< EOT -No system CA bundle could be found in any of the the common system locations. -PHP versions earlier than 5.6 are not properly configured to use the system's -CA bundle by default. In order to verify peer certificates, you will need to -supply the path on disk to a certificate bundle to the 'verify' request -option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not -need a specific certificate bundle, then Mozilla provides a commonly used CA -bundle which can be downloaded here (provided by the maintainer of cURL): -https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once -you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP -ini setting to point to the path to the file, allowing you to omit the 'verify' -request option. See http://curl.haxx.se/docs/sslcerts.html for more -information. -EOT - ); -} - -/** - * Creates an associative array of lowercase header names to the actual - * header casing. - * - * @param array $headers - * - * @return array - */ -function normalize_header_keys(array $headers) -{ - $result = []; - foreach (array_keys($headers) as $key) { - $result[strtolower($key)] = $key; - } - - return $result; -} - -/** - * Returns true if the provided host matches any of the no proxy areas. - * - * This method will strip a port from the host if it is present. Each pattern - * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a - * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == - * "baz.foo.com", but ".foo.com" != "foo.com"). - * - * Areas are matched in the following cases: - * 1. "*" (without quotes) always matches any hosts. - * 2. An exact match. - * 3. The area starts with "." and the area is the last part of the host. e.g. - * '.mit.edu' will match any host that ends with '.mit.edu'. - * - * @param string $host Host to check against the patterns. - * @param array $noProxyArray An array of host patterns. - * - * @return bool - */ -function is_host_in_noproxy($host, array $noProxyArray) -{ - if (strlen($host) === 0) { - throw new \InvalidArgumentException('Empty host provided'); - } - - // Strip port if present. - if (strpos($host, ':')) { - $host = explode($host, ':', 2)[0]; - } - - foreach ($noProxyArray as $area) { - // Always match on wildcards. - if ($area === '*') { - return true; - } elseif (empty($area)) { - // Don't match on empty values. - continue; - } elseif ($area === $host) { - // Exact matches. - return true; - } else { - // 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) { - return true; - } - } - } - - return false; -} - -/** - * Wrapper for json_decode that throws when an error occurs. - * - * @param string $json JSON data to parse - * @param bool $assoc When true, returned objects will be converted - * into associative arrays. - * @param int $depth User specified recursion depth. - * @param int $options Bitmask of JSON decode options. - * - * @return mixed - * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. - * @link http://www.php.net/manual/en/function.json-decode.php - */ -function json_decode($json, $assoc = false, $depth = 512, $options = 0) -{ - $data = \json_decode($json, $assoc, $depth, $options); - if (JSON_ERROR_NONE !== json_last_error()) { - throw new Exception\InvalidArgumentException( - 'json_decode error: ' . json_last_error_msg() - ); - } - - return $data; -} - -/** - * Wrapper for JSON encoding that throws when an error occurs. - * - * @param mixed $value The value being encoded - * @param int $options JSON encode option bitmask - * @param int $depth Set the maximum depth. Must be greater than zero. - * - * @return string - * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. - * @link http://www.php.net/manual/en/function.json-encode.php - */ -function json_encode($value, $options = 0, $depth = 512) -{ - $json = \json_encode($value, $options, $depth); - if (JSON_ERROR_NONE !== json_last_error()) { - throw new Exception\InvalidArgumentException( - 'json_encode error: ' . json_last_error_msg() - ); - } - - return $json; -} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php deleted file mode 100644 index a93393acc4e..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/guzzle/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ - 'https://api.twitter.com/1.1/']); - $middleware = new Oauth1([ + $oauth = new Oauth1([ 'consumer_key' => 'my_key', 'consumer_secret' => 'my_secret', 'token' => 'my_token', 'token_secret' => 'my_token_secret' ]); - $stack->push($middleware); - $client = new Client([ - 'base_uri' => 'https://api.twitter.com/1.1/', - 'handler' => $stack - ]); + $client->getEmitter()->attach($oauth); // Set the "auth" request option to "oauth" to sign using oauth $res = $client->get('statuses/home_timeline.json', ['auth' => 'oauth']); You can set the ``auth`` request option to ``oauth`` for all requests sent by -the client by extending the array you feed to ``new Client`` with auth => oauth. +the client using the client's ``defaults`` constructor option. .. code-block:: php use GuzzleHttp\Client; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Subscriber\Oauth\Oauth1; - - $stack = HandlerStack::create(); - - $middleware = new Oauth1([ - 'consumer_key' => 'my_key', - 'consumer_secret' => 'my_secret', - 'token' => 'my_token', - 'token_secret' => 'my_token_secret' - ]); - $stack->push($middleware); $client = new Client([ - 'base_uri' => 'https://api.twitter.com/1.1/', - 'handler' => $stack, - 'auth' => 'oauth' + 'base_url' => 'https://api.twitter.com/1.1/', + 'defaults' => ['auth' => 'oauth'] ]); + $client->getEmitter()->attach($oauth); + // Now you don't need to add the auth parameter $res = $client->get('statuses/home_timeline.json'); .. note:: You can omit the token and token_secret options to use two-legged OAuth. - -Using the RSA-SH1 signature method -================================== - -.. code-block:: php - - use GuzzleHttp\Subscriber\Oauth\Oauth1; - - $stack = HandlerStack::create(); - - $middleware = new Oauth1([ - 'consumer_key' => 'my_key', - 'consumer_secret' => 'my_secret', - 'private_key_file' => 'my_path_to_private_key_file', - 'private_key_passphrase' => 'my_passphrase', - 'signature_method' => Oauth1::SIGNATURE_METHOD_RSA, - ]); - $stack->push($middleware); - - $client = new Client([ - 'handler' => $stack - ]); - - $response = $client->get('http://httpbin.org', ['auth' => 'oauth']); diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json index 0d0ddbfaba1..a7c08143121 100644 --- a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/composer.json @@ -12,8 +12,8 @@ } ], "require": { - "php": ">=5.5.0", - "guzzlehttp/guzzle": "~6.0" + "php": ">=5.4.0", + "guzzlehttp/guzzle": "~4.0|~5.0" }, "require-dev": { "phpunit/phpunit": "~4.0" @@ -23,7 +23,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.3-dev" + "dev-master": "0.1-dev" } } } diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php index a81c10940d9..504be401db7 100644 --- a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/src/Oauth1.php @@ -2,11 +2,14 @@ namespace GuzzleHttp\Subscriber\Oauth; -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; -use GuzzleHttp\MessageFormatter; -use GuzzleHttp\Promise; -use Psr\Http\Message\StreamInterface; +use GuzzleHttp\Collection; +use GuzzleHttp\Event\RequestEvents; +use GuzzleHttp\Event\SubscriberInterface; +use GuzzleHttp\Event\BeforeEvent; +use GuzzleHttp\Message\RequestInterface; +use GuzzleHttp\Post\PostBodyInterface; +use GuzzleHttp\Query; +use GuzzleHttp\Url; /** * OAuth 1.0 signature plugin. @@ -20,7 +23,7 @@ * * @link http://oauth.net/core/1.0/#rfc.section.9.1.1 OAuth specification */ -class Oauth1 +class Oauth1 implements SubscriberInterface { /** * Consumer request method constants. See http://oauth.net/core/1.0/#consumer_req_param @@ -32,7 +35,7 @@ class Oauth1 const SIGNATURE_METHOD_RSA = 'RSA-SHA1'; const SIGNATURE_METHOD_PLAINTEXT = 'PLAINTEXT'; - /** @var array Configuration settings */ + /** @var Collection Configuration settings */ private $config; /** @@ -45,8 +48,6 @@ class Oauth1 * - callback: OAuth callback * - consumer_key: Consumer key string. Defaults to "anonymous". * - consumer_secret: Consumer secret. Defaults to "anonymous". - * - private_key_file: The location of your private key file (RSA-SHA1 signature method only) - * - private_key_passphrase: The passphrase for your private key file (RSA-SHA1 signature method only) * - token: Client token * - token_secret: Client secret token * - verifier: OAuth verifier. @@ -59,57 +60,44 @@ class Oauth1 */ public function __construct($config) { - $this->config = [ + $this->config = Collection::fromConfig($config, [ 'version' => '1.0', 'request_method' => self::REQUEST_METHOD_HEADER, 'consumer_key' => 'anonymous', 'consumer_secret' => 'anonymous', 'signature_method' => self::SIGNATURE_METHOD_HMAC, - ]; - - foreach ($config as $key => $value) { - $this->config[$key] = $value; - } + ], ['signature_method', 'version', 'consumer_key', 'consumer_secret']); } - /** - * Called when the middleware is handled. - * - * @param callable $handler - * - * @return \Closure - */ - public function __invoke(callable $handler) + public function getEvents() { - return function ($request, array $options) use ($handler) { - - if (isset($options['auth']) && $options['auth'] == 'oauth') { - $request = $this->onBefore($request); - } - - return $handler($request, $options); - }; + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; } - private function onBefore(RequestInterface $request) + public function onBefore(BeforeEvent $event) { - $oauthparams = $this->getOauthParams( + $request = $event->getRequest(); + + // Only sign requests using "auth"="oauth" + if ($request->getConfig()['auth'] != 'oauth') { + return; + } + + $params = $this->getOauthParams( $this->generateNonce($request), $this->config ); - $oauthparams['oauth_signature'] = $this->getSignature($request, $oauthparams); - uksort($oauthparams, 'strcmp'); + $params['oauth_signature'] = $this->getSignature($request, $params); + uksort($params, 'strcmp'); switch ($this->config['request_method']) { case self::REQUEST_METHOD_HEADER: - list($header, $value) = $this->buildAuthorizationHeader($oauthparams); - $request = $request->withHeader($header, $value); + list($header, $value) = $this->buildAuthorizationHeader($params); + $request->setHeader($header, $value); break; case self::REQUEST_METHOD_QUERY: - $queryparams = \GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery()); - $preparedParams = \GuzzleHttp\Psr7\build_query($oauthparams + $queryparams); - $request = $request->withUri($request->getUri()->withQuery($preparedParams)); + $request->getQuery()->overwriteWith($params); break; default: throw new \InvalidArgumentException(sprintf( @@ -117,8 +105,6 @@ private function onBefore(RequestInterface $request) $this->config['request_method'] )); } - - return $request; } /** @@ -138,14 +124,16 @@ public function getSignature(RequestInterface $request, array $params) unset($params['oauth_signature']); // Add POST fields if the request uses POST fields and no files - if ($request->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded') { - $body = \GuzzleHttp\Psr7\parse_query($request->getBody()->getContents()); - $params += $body; + $body = $request->getBody(); + if ($body instanceof PostBodyInterface && !$body->getFiles()) { + $query = Query::fromString($body->getFields(true)); + $params += $query->toArray(); } // Parse & add query string parameters as base string parameters - $query = $request->getUri()->getQuery(); - $params += \GuzzleHttp\Psr7\parse_query($query); + $query = Query::fromString((string) $request->getQuery()); + $query->setEncodingType(Query::RFC1738); + $params += $query->toArray(); $baseString = $this->createBaseString( $request, @@ -153,22 +141,16 @@ public function getSignature(RequestInterface $request, array $params) ); // Implements double-dispatch to sign requests - switch ($this->config['signature_method']) { - case Oauth1::SIGNATURE_METHOD_HMAC: - $signature = $this->signUsingHmacSha1($baseString); - break; - case Oauth1::SIGNATURE_METHOD_RSA: - $signature = $this->signUsingRsaSha1($baseString); - break; - case Oauth1::SIGNATURE_METHOD_PLAINTEXT: - $signature = $this->signUsingPlaintext($baseString); - break; - default: - throw new \RuntimeException('Unknown signature method: ' . $this->config['signature_method']); - break; + $meth = [$this, 'sign_' . str_replace( + '-', '_', $this->config['signature_method'] + )]; + + if (!is_callable($meth)) { + throw new \RuntimeException('Unknown signature method: ' + . $this->config['signature_method']); } - return base64_encode($signature); + return base64_encode(call_user_func($meth, $baseString, $this->config)); } /** @@ -183,7 +165,7 @@ public function getSignature(RequestInterface $request, array $params) */ public function generateNonce(RequestInterface $request) { - return sha1(uniqid('', true) . $request->getUri()->getHost() . $request->getUri()->getPath()); + return sha1(uniqid('', true) . $request->getUrl()); } /** @@ -202,7 +184,8 @@ public function generateNonce(RequestInterface $request) protected function createBaseString(RequestInterface $request, array $params) { // Remove query params from URL. Ref: Spec: 9.1.2. - $url = $request->getUri()->withQuery(''); + $url = Url::fromString($request->getUrl()); + $url->setQuery(''); $query = http_build_query($params, '', '&', PHP_QUERY_RFC3986); return strtoupper($request->getMethod()) @@ -232,12 +215,7 @@ private function prepareParameters($data) return $data; } - /** - * @param string $baseString - * - * @return string - */ - private function signUsingHmacSha1($baseString) + private function sign_HMAC_SHA1($baseString) { $key = rawurlencode($this->config['consumer_secret']) . '&' . rawurlencode($this->config['token_secret']); @@ -245,12 +223,7 @@ private function signUsingHmacSha1($baseString) return hash_hmac('sha1', $baseString, $key, true); } - /** - * @param string $baseString - * - * @return string - */ - private function signUsingRsaSha1($baseString) + private function sign_RSA_SHA1($baseString) { if (!function_exists('openssl_pkey_get_private')) { throw new \RuntimeException('RSA-SHA1 signature method ' @@ -258,23 +231,18 @@ private function signUsingRsaSha1($baseString) } $privateKey = openssl_pkey_get_private( - file_get_contents($this->config['private_key_file']), - $this->config['private_key_passphrase'] + file_get_contents($this->config['consumer_secret']), + $this->config['consumer_secret'] ); - $signature = ''; + $signature = false; openssl_sign($baseString, $signature, $privateKey); openssl_free_key($privateKey); return $signature; } - /** - * @param string $baseString - * - * @return string - */ - private function signUsingPlaintext($baseString) + private function sign_PLAINTEXT($baseString) { return $baseString; } @@ -292,7 +260,7 @@ private function buildAuthorizationHeader(array $params) $params[$key] = $key . '="' . rawurlencode($value) . '"'; } - if (isset($this->config['realm'])) { + if ($this->config['realm']) { array_unshift( $params, 'realm="' . rawurlencode($this->config['realm']) . '"' @@ -306,11 +274,11 @@ private function buildAuthorizationHeader(array $params) * Get the oauth parameters as named by the oauth spec * * @param string $nonce Unique nonce - * @param array $config Configuration options of the plugin. + * @param Collection $config Configuration options of the plugin. * * @return array */ - private function getOauthParams($nonce, array $config) + private function getOauthParams($nonce, Collection $config) { $params = [ 'oauth_consumer_key' => $config['consumer_key'], diff --git a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php index 0da6e3a6f99..064608f3ad6 100644 --- a/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php +++ b/upload/system/storage/vendor/guzzlehttp/oauth-subscriber/tests/Oauth1Test.php @@ -2,11 +2,12 @@ namespace GuzzleHttp\Tests\Oauth1; +use GuzzleHttp\Transaction; use GuzzleHttp\Client; +use GuzzleHttp\Event\BeforeEvent; use GuzzleHttp\Exception\ClientException; -use GuzzleHttp\HandlerStack; -use GuzzleHttp\Middleware; -use GuzzleHttp\Psr7\Request; +use GuzzleHttp\Message\Request; +use GuzzleHttp\Post\PostBody; use GuzzleHttp\Subscriber\Oauth\Oauth1; class Oauth1Test extends \PHPUnit_Framework_TestCase @@ -21,6 +22,20 @@ class Oauth1Test extends \PHPUnit_Framework_TestCase 'token_secret' => 'dracula' ]; + protected function getRequest() + { + $body = new PostBody(); + $body->setField('e', 'f'); + + return new Request('POST', 'http://www.test.com/path?a=b&c=d', [], $body); + } + + public function testSubscribesToEvents() + { + $events = (new Oauth1([]))->getEvents(); + $this->assertArrayHasKey('before', $events); + } + public function testAcceptsConfigurationData() { $p = new Oauth1($this->config); @@ -42,32 +57,19 @@ public function testAcceptsConfigurationData() public function testCreatesStringToSignFromPostRequest() { - $stack = HandlerStack::create(); - - $middleware = new Oauth1($this->config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->post('http://httpbin.org/post', [ + $s = new Oauth1($this->config); + $client = new Client(); + $request = $client->createRequest('POST', 'http://httpbin.org', [ 'auth' => 'oauth', - 'form_params' => [ + 'body' => [ 'foo' => [ 'baz' => ['bar'], 'bam' => [null, true, false] ] ] ]); - - /* @var Request $request */ - $request = $container[0]['request']; - + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); $this->assertTrue($request->hasHeader('Authorization')); } @@ -75,59 +77,30 @@ public function testSignsPlainText() { $config = $this->config; $config['signature_method'] = Oauth1::SIGNATURE_METHOD_PLAINTEXT; - - $stack = HandlerStack::create(); - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org', ['auth' => 'oauth']); - - /* @var Request $request */ - $request = $container[0]['request']; - + $s = new Oauth1($config); + $client = new Client(); + $request = $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']); + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); $this->assertTrue($request->hasHeader('Authorization')); - $this->assertContains('oauth_signature_method="PLAINTEXT"', $request->getHeader('Authorization')[0]); - $this->assertContains('oauth_signature="', $request->getHeader('Authorization')[0]); + $this->assertContains('oauth_signature_method="PLAINTEXT"', $request->getHeader('Authorization')); + $this->assertContains('oauth_signature="', $request->getHeader('Authorization')); } public function testSignsOauthRequestsInHeader() { - $stack = HandlerStack::create(); - - $middleware = new Oauth1($this->config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->post('http://httpbin.org/post', [ - 'auth' => 'oauth', - ]); - - /* @var Request $request */ - $request = $container[0]['request']; - + $s = new Oauth1($this->config); + $client = new Client(); + $request = $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']); + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); $this->assertTrue($request->hasHeader('Authorization')); - $this->assertCount(0, \GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())); + $this->assertCount(0, $request->getQuery()); $check = ['oauth_consumer_key', 'oauth_nonce', 'oauth_signature', 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', 'oauth_version']; foreach ($check as $name) { - $this->assertContains($name . '=', $request->getHeader('Authorization')[0]); + $this->assertContains($name . '=', $request->getHeader('Authorization')); } } @@ -135,60 +108,32 @@ public function testSignsOauthQueryStringRequest() { $config = $this->config; $config['request_method'] = Oauth1::REQUEST_METHOD_QUERY; - - $stack = HandlerStack::create(); - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org', ['auth' => 'oauth']); - - /* @var Request $request */ - $request = $container[0]['request']; - + $s = new Oauth1($config); + $client = new Client(); + $request = $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']); + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); $this->assertFalse($request->hasHeader('Authorization')); $check = ['oauth_consumer_key', 'oauth_nonce', 'oauth_signature', 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', 'oauth_version']; foreach ($check as $name) { - $this->assertNotEmpty(\GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())[$name]); + $this->assertNotEmpty($request->getQuery()[$name]); } - // Ensure that no extra keys were added - $keys = array_keys(\GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())); + $keys = $request->getQuery()->getKeys(); sort($keys); $this->assertSame($keys, $check); } public function testOnlyTouchesWhenAuthConfigIsOauth() { - $stack = HandlerStack::create(); - - $middleware = new Oauth1($this->config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org'); - - /* @var Request $request */ - $request = $container[0]['request']; - - $this->assertCount(0, \GuzzleHttp\Psr7\parse_query($request->getUri()->getQuery())); + $s = new Oauth1($this->config); + $client = new Client(); + $request = $client->createRequest('GET', 'http://httpbin.org'); + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); + $this->assertCount(0, $request->getQuery()); $this->assertEmpty($request->getHeader('Authorization')); } @@ -197,19 +142,15 @@ public function testOnlyTouchesWhenAuthConfigIsOauth() */ public function testValidatesRequestMethod() { - $stack = HandlerStack::create(); - $config = $this->config; $config['request_method'] = 'Foo'; - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org', ['auth' => 'oauth']); + $s = new Oauth1($config); + $client = new Client(); + $before = new BeforeEvent(new Transaction( + $client, + $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']) + )); + $s->onBefore($before); } /** @@ -217,130 +158,79 @@ public function testValidatesRequestMethod() */ public function testExceptionOnSignatureError() { - $stack = HandlerStack::create(); - $config = $this->config; $config['signature_method'] = 'Foo'; - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org', ['auth' => 'oauth']); + $s = new Oauth1($config); + $client = new Client(); + $before = new BeforeEvent(new Transaction( + $client, + $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']) + )); + $s->onBefore($before); } public function testDoesNotAddEmptyValuesToAuthorization() { $config = $this->config; unset($config['token']); - - $stack = HandlerStack::create(); - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org', ['auth' => 'oauth']); - - /* @var Request $request */ - $request = $container[0]['request']; - + $s = new Oauth1($config); + $client = new Client(); + $request = $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']); + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); $this->assertTrue($request->hasHeader('Authorization')); - $this->assertNotContains('oauth_token=', $request->getHeader('Authorization')[0]); + $this->assertNotContains('oauth_token=', $request->getHeader('Authorization')); } public function testRandomParametersAreNotAutomaticallyAdded() { $config = $this->config; $config['foo'] = 'bar'; - - $stack = HandlerStack::create(); - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org', ['auth' => 'oauth']); - - /* @var Request $request */ - $request = $container[0]['request']; - + $s = new Oauth1($config); + $client = new Client(); + $request = $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']); + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); $this->assertTrue($request->hasHeader('Authorization')); - $this->assertNotContains('foo=bar', $request->getHeader('Authorization')[0]); + $this->assertNotContains('foo=bar', $request->getHeader('Authorization')); } public function testAllowsRealm() { $config = $this->config; $config['realm'] = 'foo'; - - $stack = HandlerStack::create(); - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - - $client = new Client([ - 'handler' => $stack - ]); - - $client->get('http://httpbin.org', ['auth' => 'oauth']); - - /* @var Request $request */ - $request = $container[0]['request']; - + $s = new Oauth1($config); + $client = new Client(); + $request = $client->createRequest('GET', 'http://httpbin.org', ['auth' => 'oauth']); + $before = new BeforeEvent(new Transaction($client, $request)); + $s->onBefore($before); $this->assertTrue($request->hasHeader('Authorization')); - $this->assertContains('OAuth realm="foo",', $request->getHeader('Authorization')[0]); + $this->assertContains('OAuth realm="foo",', $request->getHeader('Authorization')); } public function testTwitterIntegration() { - if (empty(getenv('OAUTH_CONSUMER_SECRET'))) { + if (empty($_SERVER['OAUTH_CONSUMER_SECRET'])) { $this->markTestSkipped('No OAUTH_CONSUMER_SECRET provided in phpunit.xml'); return; } - $config = $this->config; - $config['consumer_key'] = getenv('OAUTH_CONSUMER_KEY'); - $config['consumer_secret'] = getenv('OAUTH_CONSUMER_SECRET'); - $config['token'] = getenv('OAUTH_TOKEN'); - $config['token_secret'] = getenv('OAUTH_TOKEN_SECRET'); - - $stack = HandlerStack::create(); - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - $client = new Client([ - 'handler' => $stack + 'base_url' => 'https://api.twitter.com/1.1/', + 'defaults' => ['auth' => 'oauth'] + ]); + + $oauth = new Oauth1([ + 'consumer_key' => $_SERVER['OAUTH_CONSUMER_KEY'], + 'consumer_secret' => $_SERVER['OAUTH_CONSUMER_SECRET'], + 'token' => $_SERVER['OAUTH_TOKEN'], + 'token_secret' => $_SERVER['OAUTH_TOKEN_SECRET'] ]); + $client->getEmitter()->attach($oauth); + try { - $client->get('https://api.twitter.com/1.1/account/settings.json', ['auth' => 'oauth']); + $client->get('account/settings.json'); } catch (ClientException $e) { if ($e->getResponse()->getStatusCode() == 429) { $this->markTestIncomplete('You are being throttled'); @@ -352,40 +242,35 @@ public function testTwitterIntegration() public function testTwitterStreamingIntegration() { - if (empty(getenv('OAUTH_CONSUMER_SECRET'))) { + if (empty($_SERVER['OAUTH_CONSUMER_SECRET'])) { $this->markTestSkipped('No OAUTH_CONSUMER_SECRET provided in phpunit.xml'); return; } - $config = $this->config; - $config['consumer_key'] = $_SERVER['OAUTH_CONSUMER_KEY']; - $config['consumer_secret'] = $_SERVER['OAUTH_CONSUMER_SECRET']; - $config['token'] = $_SERVER['OAUTH_TOKEN']; - $config['token_secret'] = $_SERVER['OAUTH_TOKEN_SECRET']; - - $stack = HandlerStack::create(); - - $middleware = new Oauth1($config); - $stack->push($middleware); - - $container = []; - $history = Middleware::history($container); - $stack->push($history); - $client = new Client([ - 'base_uri' => 'https://stream.twitter.com/1.1/', - 'handler' => $stack, - 'auth' => 'oauth' + 'base_url' => 'https://stream.twitter.com/1.1/', + 'defaults' => ['auth' => 'oauth'] ]); + $oauth = new Oauth1([ + 'consumer_key' => $_SERVER['OAUTH_CONSUMER_KEY'], + 'consumer_secret' => $_SERVER['OAUTH_CONSUMER_SECRET'], + 'token' => $_SERVER['OAUTH_TOKEN'], + 'token_secret' => $_SERVER['OAUTH_TOKEN_SECRET'] + ]); + + $client->getEmitter()->attach($oauth); + try { $response = $client->post('statuses/filter.json', [ - 'query' => ['track' => 'bieber'], + 'body' => ['track' => 'bieber'], 'stream' => true ]); - $body = $response->getBody()->getContents(); - $this->assertContains('bieber', strtolower($body)); - $this->assertNotEmpty(json_decode($body, true)); + $body = $response->getBody(); + $data = $body::readLine($body); + $this->assertContains('bieber', strtolower($data)); + $this->assertNotEmpty(json_decode($data, true)); + $body->close(); } catch (ClientException $e) { if ($e->getResponse()->getStatusCode() == 429) { $this->markTestIncomplete('You are being throttled'); diff --git a/upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md deleted file mode 100644 index 235e13bc7d1..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/CHANGELOG.md +++ /dev/null @@ -1,103 +0,0 @@ -# CHANGELOG - -## 1.5.1 - 2021-10-22 - -### Fixed - -- 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 - -### Fixed - -- Fix manually settle promises generated with Utils::task - -## 1.4.1 - 2021-02-18 - -### Fixed - -- Fixed `each_limit` skipping promises and failing - -## 1.4.0 - 2020-09-30 - -### Added - -- Support for PHP 8 -- Optional `$recursive` flag to `all` -- Replaced functions by static methods - -### Fixed - -- Fix empty `each` processing -- Fix promise handling for Iterators of non-unique keys -- Fixed `method_exists` crashes on PHP 8 -- Memory leak on exceptions - - -## 1.3.1 - 2016-12-20 - -### Fixed - -- `wait()` foreign promise compatibility - - -## 1.3.0 - 2016-11-18 - -### Added - -- Adds support for custom task queues. - -### Fixed - -- Fixed coroutine promise memory leak. - - -## 1.2.0 - 2016-05-18 - -### Changed - -- Update to now catch `\Throwable` on PHP 7+ - - -## 1.1.0 - 2016-03-07 - -### Changed - -- Update EachPromise to prevent recurring on a iterator when advancing, as this - could trigger fatal generator errors. -- Update Promise to allow recursive waiting without unwrapping exceptions. - - -## 1.0.3 - 2015-10-15 - -### Changed - -- Update EachPromise to immediately resolve when the underlying promise iterator - is empty. Previously, such a promise would throw an exception when its `wait` - function was called. - - -## 1.0.2 - 2015-05-15 - -### Changed - -- Conditionally require functions.php. - - -## 1.0.1 - 2015-06-24 - -### Changed - -- Updating EachPromise to call next on the underlying promise iterator as late - as possible to ensure that generators that generate new requests based on - callbacks are not iterated until after callbacks are invoked. - - -## 1.0.0 - 2015-05-12 - -- Initial release diff --git a/upload/system/storage/vendor/guzzlehttp/promises/LICENSE b/upload/system/storage/vendor/guzzlehttp/promises/LICENSE deleted file mode 100644 index 9f0f943be88..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Michael Dowling -Copyright (c) 2015 Graham Campbell -Copyright (c) 2017 Tobias Schultze -Copyright (c) 2020 Tobias Nyholm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/promises/Makefile b/upload/system/storage/vendor/guzzlehttp/promises/Makefile deleted file mode 100644 index 8d5b3ef95eb..00000000000 --- a/upload/system/storage/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/upload/system/storage/vendor/guzzlehttp/promises/README.md b/upload/system/storage/vendor/guzzlehttp/promises/README.md deleted file mode 100644 index c175fec76b6..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/README.md +++ /dev/null @@ -1,547 +0,0 @@ -# Guzzle Promises - -[Promises/A+](https://promisesaplus.com/) implementation that handles promise -chaining and resolution iteratively, allowing for "infinite" promise chaining -while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/) -for a general introduction to promises. - -- [Features](#features) -- [Quick start](#quick-start) -- [Synchronous wait](#synchronous-wait) -- [Cancellation](#cancellation) -- [API](#api) - - [Promise](#promise) - - [FulfilledPromise](#fulfilledpromise) - - [RejectedPromise](#rejectedpromise) -- [Promise interop](#promise-interop) -- [Implementation notes](#implementation-notes) - - -# Features - -- [Promises/A+](https://promisesaplus.com/) implementation. -- Promise resolution and chaining is handled iteratively, allowing for - "infinite" promise chaining. -- Promises have a synchronous `wait` method. -- Promises can be cancelled. -- Works with any object that has a `then` function. -- C# style async/await coroutine promises using - `GuzzleHttp\Promise\Coroutine::of()`. - - -# 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 are registered with the `then` method by providing an optional -`$onFulfilled` followed by an optional `$onRejected` function. - - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise->then( - // $onFulfilled - function ($value) { - echo 'The promise was fulfilled.'; - }, - // $onRejected - function ($reason) { - echo 'The promise was rejected.'; - } -); -``` - -*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 -only once and in the order in which they were added. - - -## 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 -all of the onFulfilled callbacks (resolving a promise with a rejected promise -will reject the promise and trigger the `$onRejected` callbacks). - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise - ->then(function ($value) { - // Return a value and don't break the chain - return "Hello, " . $value; - }) - // This then is executed after the first then and receives the value - // returned from the first then. - ->then(function ($value) { - echo $value; - }); - -// Resolving the promise triggers the $onFulfilled callbacks and outputs -// "Hello, reader." -$promise->resolve('reader.'); -``` - - -## 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 -promise in the chain. Returning a promise in a `then` callback will cause the -subsequent promises in the chain to only be fulfilled when the returned promise -has been fulfilled. The next promise in the chain will be invoked with the -resolved value of the promise. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$nextPromise = new Promise(); - -$promise - ->then(function ($value) use ($nextPromise) { - echo $value; - return $nextPromise; - }) - ->then(function ($value) { - echo $value; - }); - -// Triggers the first callback and outputs "A" -$promise->resolve('A'); -// Triggers the second callback and outputs "B" -$nextPromise->resolve('B'); -``` - -## Promise rejection - -When a promise is rejected, the `$onRejected` callbacks are invoked with the -rejection reason. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise->then(null, function ($reason) { - echo $reason; -}); - -$promise->reject('Error!'); -// Outputs "Error!" -``` - -## Rejection forwarding - -If an exception is thrown in an `$onRejected` callback, subsequent -`$onRejected` callbacks are invoked with the thrown exception as the reason. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise->then(null, function ($reason) { - throw new Exception($reason); -})->then(null, function ($reason) { - assert($reason->getMessage() === 'Error!'); -}); - -$promise->reject('Error!'); -``` - -You can also forward a rejection down the promise chain by returning a -`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or -`$onRejected` callback. - -```php -use GuzzleHttp\Promise\Promise; -use GuzzleHttp\Promise\RejectedPromise; - -$promise = new Promise(); -$promise->then(null, function ($reason) { - return new RejectedPromise($reason); -})->then(null, function ($reason) { - assert($reason === 'Error!'); -}); - -$promise->reject('Error!'); -``` - -If an exception is not thrown in a `$onRejected` callback and the callback -does not return a rejected promise, downstream `$onFulfilled` callbacks are -invoked using the value returned from the `$onRejected` callback. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise(); -$promise - ->then(null, function ($reason) { - return "It's ok"; - }) - ->then(function ($value) { - assert($value === "It's ok"); - }); - -$promise->reject('Error!'); -``` - -# 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 -to synchronously force a promise to complete. When a wait function is invoked -it is expected to deliver a value to the promise or reject the promise. If the -wait function does not deliver a value, then an exception is thrown. The wait -function provided to a promise constructor is invoked when the `wait` function -of the promise is called. - -```php -$promise = new Promise(function () use (&$promise) { - $promise->resolve('foo'); -}); - -// Calling wait will return the value of the promise. -echo $promise->wait(); // outputs "foo" -``` - -If an exception is encountered while invoking the wait function of a promise, -the promise is rejected with the exception and the exception is thrown. - -```php -$promise = new Promise(function () use (&$promise) { - throw new Exception('foo'); -}); - -$promise->wait(); // throws the exception. -``` - -Calling `wait` on a promise that has been fulfilled will not trigger the wait -function. It will simply return the previously resolved value. - -```php -$promise = new Promise(function () { die('this is not called!'); }); -$promise->resolve('foo'); -echo $promise->wait(); // outputs "foo" -``` - -Calling `wait` on a promise that has been rejected will throw an exception. If -the rejection reason is an instance of `\Exception` the reason is thrown. -Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason -can be obtained by calling the `getReason` method of the exception. - -```php -$promise = new Promise(); -$promise->reject('foo'); -$promise->wait(); -``` - -> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' - - -## 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 -promise if it was fulfilled or throw an exception if it was rejected). This is -called "unwrapping" the promise. Waiting on a promise will by default unwrap -the promise state. - -You can force a promise to resolve and *not* unwrap the state of the promise -by passing `false` to the first argument of the `wait` function: - -```php -$promise = new Promise(); -$promise->reject('foo'); -// This will not throw an exception. It simply ensures the promise has -// been resolved. -$promise->wait(false); -``` - -When unwrapping a promise, the resolved value of the promise will be waited -upon until the unwrapped value is not a promise. This means that if you resolve -promise A with a promise B and unwrap promise A, the value returned by the -wait function will be the value delivered to promise B. - -**Note**: when you do not unwrap the promise, no value is returned. - - -# 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 -cancel function that when invoked cancels the action of computing a resolution -of the promise. - - -# API - - -## 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 -expected to resolve the promise. `$cancelFn` is a function with no arguments -that is expected to cancel the computation of a promise. It is invoked when the -`cancel()` method of a promise is called. - -```php -use GuzzleHttp\Promise\Promise; - -$promise = new Promise( - function () use (&$promise) { - $promise->resolve('waited'); - }, - function () { - // do something that will cancel the promise computation (e.g., close - // a socket, cancel a database query, etc...) - } -); - -assert('waited' === $promise->wait()); -``` - -A promise has the following methods: - -- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface` - - Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler. - -- `otherwise(callable $onRejected) : PromiseInterface` - - Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled. - -- `wait($unwrap = true) : mixed` - - Synchronously waits on the promise to complete. - - `$unwrap` controls whether or not the value of the promise is returned for a - fulfilled promise or if an exception is thrown if the promise is rejected. - This is set to `true` by default. - -- `cancel()` - - Attempts to cancel the promise if possible. The promise being cancelled and - the parent most ancestor that has not yet been resolved will also be - cancelled. Any promises waiting on the cancelled promise to resolve will also - be cancelled. - -- `getState() : string` - - Returns the state of the promise. One of `pending`, `fulfilled`, or - `rejected`. - -- `resolve($value)` - - Fulfills the promise with the given `$value`. - -- `reject($reason)` - - Rejects the promise with the given `$reason`. - - -## FulfilledPromise - -A fulfilled promise can be created to represent a promise that has been -fulfilled. - -```php -use GuzzleHttp\Promise\FulfilledPromise; - -$promise = new FulfilledPromise('value'); - -// Fulfilled callbacks are immediately invoked. -$promise->then(function ($value) { - echo $value; -}); -``` - - -## RejectedPromise - -A rejected promise can be created to represent a promise that has been -rejected. - -```php -use GuzzleHttp\Promise\RejectedPromise; - -$promise = new RejectedPromise('Error'); - -// Rejected callbacks are immediately invoked. -$promise->then(null, function ($reason) { - echo $reason; -}); -``` - - -# Promise interop - -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) -for example. When a foreign promise is returned inside of a then method -callback, promise resolution will occur recursively. - -```php -// Create a React promise -$deferred = new React\Promise\Deferred(); -$reactPromise = $deferred->promise(); - -// Create a Guzzle promise that is fulfilled with a React promise. -$guzzlePromise = new GuzzleHttp\Promise\Promise(); -$guzzlePromise->then(function ($value) use ($reactPromise) { - // Do something something with the value... - // Return the React promise - return $reactPromise; -}); -``` - -Please note that wait and cancel chaining is no longer possible when forwarding -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 - -In order to keep the stack size constant, Guzzle promises are resolved -asynchronously using a task queue. When waiting on promises synchronously, the -task queue will be automatically run to ensure that the blocking promise and -any forwarded promises are resolved. When using promises asynchronously in an -event loop, you will need to run the task queue on each tick of the loop. If -you do not run the task queue, then promises will not be resolved. - -You can run the task queue using the `run()` method of the global task queue -instance. - -```php -// Get the global task queue -$queue = GuzzleHttp\Promise\Utils::queue(); -$queue->run(); -``` - -For example, you could use Guzzle promises with React using a periodic timer: - -```php -$loop = React\EventLoop\Factory::create(); -$loop->addPeriodicTimer(0, [$queue, 'run']); -``` - -*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? - - -# Implementation notes - - -## 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. - -```php -then(function ($v) { - // The stack size remains constant (a good thing) - echo xdebug_get_stack_depth() . ', '; - return $v + 1; - }); -} - -$parent->resolve(0); -var_dump($p->wait()); // int(1000) - -``` - -When a promise is fulfilled or rejected with a non-promise value, the promise -then takes ownership of the handlers of each child promise and delivers values -down the chain without using recursion. - -When a promise is resolved with another promise, the original promise transfers -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. - -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 -the computation. This is a nice separation of computation and delivery because -consumers of the promise cannot modify the value that will be eventually -delivered. - -One side effect of being able to implement promise resolution and chaining -iteratively is that you need to be able for one promise to reach into the state -of another promise to shuffle around ownership of handlers. In order to achieve -this without making the handlers of a promise publicly mutable, a promise is -also the deferred value, allowing promises of the same parent class to reach -into and modify the private properties of promises of the same type. While this -does allow consumers of the value to modify the resolution or rejection of the -deferred, it is a small price to pay for keeping the stack size constant. - -```php -$promise = new Promise(); -$promise->then(function ($value) { echo $value; }); -// The promise is the deferred value, so you can deliver a value to it. -$promise->resolve('foo'); -// prints "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: - -| Original Function | Replacement Method | -|----------------|----------------| -| `queue` | `Utils::queue` | -| `task` | `Utils::task` | -| `promise_for` | `Create::promiseFor` | -| `rejection_for` | `Create::rejectionFor` | -| `exception_for` | `Create::exceptionFor` | -| `iter_for` | `Create::iterFor` | -| `inspect` | `Utils::inspect` | -| `inspect_all` | `Utils::inspectAll` | -| `unwrap` | `Utils::unwrap` | -| `all` | `Utils::all` | -| `some` | `Utils::some` | -| `any` | `Utils::any` | -| `settle` | `Utils::settle` | -| `each` | `Each::of` | -| `each_limit` | `Each::ofLimit` | -| `each_limit_all` | `Each::ofLimitAll` | -| `!is_fulfilled` | `Is::pending` | -| `is_fulfilled` | `Is::fulfilled` | -| `is_rejected` | `Is::rejected` | -| `is_settled` | `Is::settled` | -| `coroutine` | `Coroutine::of` | - - -## Security - -If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/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 - -The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/upload/system/storage/vendor/guzzlehttp/promises/composer.json b/upload/system/storage/vendor/guzzlehttp/promises/composer.json deleted file mode 100644 index c959fb32b41..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/composer.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "guzzlehttp/promises", - "description": "Guzzle promises library", - "keywords": ["promise"], - "license": "MIT", - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "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" - } - }, - "config": { - "preferred-install": "dist", - "sort-packages": true - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php b/upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php deleted file mode 100644 index d2b5712b925..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/AggregateException.php +++ /dev/null @@ -1,17 +0,0 @@ -then(function ($v) { echo $v; }); - * - * @param callable $generatorFn Generator function to wrap into a promise. - * - * @return Promise - * - * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration - */ -final class Coroutine implements PromiseInterface -{ - /** - * @var PromiseInterface|null - */ - private $currentPromise; - - /** - * @var Generator - */ - private $generator; - - /** - * @var Promise - */ - private $result; - - public function __construct(callable $generatorFn) - { - $this->generator = $generatorFn(); - $this->result = new Promise(function () { - 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); - } - } - - /** - * Create a new coroutine. - * - * @return self - */ - public static function of(callable $generatorFn) - { - return new self($generatorFn); - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - return $this->result->then($onFulfilled, $onRejected); - } - - public function otherwise(callable $onRejected) - { - return $this->result->otherwise($onRejected); - } - - public function wait($unwrap = true) - { - return $this->result->wait($unwrap); - } - - public function getState() - { - return $this->result->getState(); - } - - public function resolve($value) - { - $this->result->resolve($value); - } - - public function reject($reason) - { - $this->result->reject($reason); - } - - public function cancel() - { - $this->currentPromise->cancel(); - $this->result->cancel(); - } - - private function nextCoroutine($yielded) - { - $this->currentPromise = Create::promiseFor($yielded) - ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); - } - - /** - * @internal - */ - public function _handleSuccess($value) - { - unset($this->currentPromise); - try { - $next = $this->generator->send($value); - if ($this->generator->valid()) { - $this->nextCoroutine($next); - } else { - $this->result->resolve($value); - } - } catch (Exception $exception) { - $this->result->reject($exception); - } catch (Throwable $throwable) { - $this->result->reject($throwable); - } - } - - /** - * @internal - */ - public function _handleFailure($reason) - { - 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/upload/system/storage/vendor/guzzlehttp/promises/src/Create.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Create.php deleted file mode 100644 index 8d038e9c1ce..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/Create.php +++ /dev/null @@ -1,84 +0,0 @@ -then([$promise, 'resolve'], [$promise, 'reject']); - return $promise; - } - - return new FulfilledPromise($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 - */ - public static function rejectionFor($reason) - { - if ($reason instanceof PromiseInterface) { - return $reason; - } - - return new RejectedPromise($reason); - } - - /** - * Create an exception for a rejected promise value. - * - * @param mixed $reason - * - * @return \Exception|\Throwable - */ - public static function exceptionFor($reason) - { - if ($reason instanceof \Exception || $reason instanceof \Throwable) { - return $reason; - } - - return new RejectionException($reason); - } - - /** - * Returns an iterator for the given value. - * - * @param mixed $value - * - * @return \Iterator - */ - public static function iterFor($value) - { - if ($value instanceof \Iterator) { - return $value; - } - - if (is_array($value)) { - return new \ArrayIterator($value); - } - - return new \ArrayIterator([$value]); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/Each.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Each.php deleted file mode 100644 index 1dda3549932..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/Each.php +++ /dev/null @@ -1,90 +0,0 @@ - $onFulfilled, - 'rejected' => $onRejected - ]))->promise(); - } - - /** - * Like of, 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 - */ - public static function ofLimit( - $iterable, - $concurrency, - callable $onFulfilled = null, - callable $onRejected = null - ) { - return (new EachPromise($iterable, [ - 'fulfilled' => $onFulfilled, - 'rejected' => $onRejected, - 'concurrency' => $concurrency - ]))->promise(); - } - - /** - * Like 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 - */ - public static function ofLimitAll( - $iterable, - $concurrency, - callable $onFulfilled = null - ) { - return each_limit( - $iterable, - $concurrency, - $onFulfilled, - function ($reason, $idx, PromiseInterface $aggregate) { - $aggregate->reject($reason); - } - ); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php b/upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php deleted file mode 100644 index 38ecb59b158..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/EachPromise.php +++ /dev/null @@ -1,255 +0,0 @@ -iterable = Create::iterFor($iterable); - - if (isset($config['concurrency'])) { - $this->concurrency = $config['concurrency']; - } - - if (isset($config['fulfilled'])) { - $this->onFulfilled = $config['fulfilled']; - } - - if (isset($config['rejected'])) { - $this->onRejected = $config['rejected']; - } - } - - /** @psalm-suppress InvalidNullableReturnType */ - public function promise() - { - if ($this->aggregate) { - return $this->aggregate; - } - - try { - $this->createPromise(); - /** @psalm-assert Promise $this->aggregate */ - $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() - { - $this->mutex = false; - $this->aggregate = new Promise(function () { - if ($this->checkIfFinished()) { - return; - } - reset($this->pending); - // Consume a potentially fluctuating list of promises while - // ensuring that indexes are maintained (precluding array_shift). - while ($promise = current($this->pending)) { - next($this->pending); - $promise->wait(); - if (Is::settled($this->aggregate)) { - return; - } - } - }); - - // Clear the references when the promise is resolved. - $clearFn = function () { - $this->iterable = $this->concurrency = $this->pending = null; - $this->onFulfilled = $this->onRejected = null; - $this->nextPendingIndex = 0; - }; - - $this->aggregate->then($clearFn, $clearFn); - } - - private function refillPending() - { - if (!$this->concurrency) { - // Add all pending promises. - while ($this->addPending() && $this->advanceIterator()); - return; - } - - // Add only up to N pending promises. - $concurrency = is_callable($this->concurrency) - ? call_user_func($this->concurrency, count($this->pending)) - : $this->concurrency; - $concurrency = max($concurrency - count($this->pending), 0); - // Concurrency may be set to 0 to disallow new promises. - if (!$concurrency) { - return; - } - // Add the first pending promise. - $this->addPending(); - // Note this is special handling for concurrency=1 so that we do - // not advance the iterator after adding the first promise. This - // helps work around issues with generators that might not have the - // next value to yield until promise callbacks are called. - while (--$concurrency - && $this->advanceIterator() - && $this->addPending()); - } - - private function addPending() - { - if (!$this->iterable || !$this->iterable->valid()) { - return false; - } - - $promise = Create::promiseFor($this->iterable->current()); - $key = $this->iterable->key(); - - // Iterable keys may not be unique, so we use a counter to - // guarantee uniqueness - $idx = $this->nextPendingIndex++; - - $this->pending[$idx] = $promise->then( - function ($value) use ($idx, $key) { - if ($this->onFulfilled) { - call_user_func( - $this->onFulfilled, - $value, - $key, - $this->aggregate - ); - } - $this->step($idx); - }, - function ($reason) use ($idx, $key) { - if ($this->onRejected) { - call_user_func( - $this->onRejected, - $reason, - $key, - $this->aggregate - ); - } - $this->step($idx); - } - ); - - return true; - } - - private function advanceIterator() - { - // Place a lock on the iterator so that we ensure to not recurse, - // preventing fatal generator errors. - if ($this->mutex) { - return false; - } - - $this->mutex = true; - - 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) - { - // If the promise was already resolved, then ignore this step. - if (Is::settled($this->aggregate)) { - return; - } - - unset($this->pending[$idx]); - - // Only refill pending promises if we are not locked, preventing the - // EachPromise to recursively invoke the provided iterator, which - // cause a fatal error: "Cannot resume an already running generator" - if ($this->advanceIterator() && !$this->checkIfFinished()) { - // Add more pending promises if possible. - $this->refillPending(); - } - } - - private function checkIfFinished() - { - if (!$this->pending && !$this->iterable->valid()) { - // Resolve the promise if there's nothing left to do. - $this->aggregate->resolve(null); - return true; - } - - return false; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php deleted file mode 100644 index 98f72a62a6f..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/FulfilledPromise.php +++ /dev/null @@ -1,84 +0,0 @@ -value = $value; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - // Return itself if there is no onFulfilled function. - if (!$onFulfilled) { - return $this; - } - - $queue = Utils::queue(); - $p = new Promise([$queue, 'run']); - $value = $this->value; - $queue->add(static function () use ($p, $value, $onFulfilled) { - if (Is::pending($p)) { - try { - $p->resolve($onFulfilled($value)); - } catch (\Throwable $e) { - $p->reject($e); - } catch (\Exception $e) { - $p->reject($e); - } - } - }); - - return $p; - } - - public function otherwise(callable $onRejected) - { - return $this->then(null, $onRejected); - } - - public function wait($unwrap = true, $defaultDelivery = null) - { - return $unwrap ? $this->value : null; - } - - public function getState() - { - return self::FULFILLED; - } - - public function resolve($value) - { - if ($value !== $this->value) { - throw new \LogicException("Cannot resolve a fulfilled promise"); - } - } - - public function reject($reason) - { - throw new \LogicException("Cannot reject a fulfilled promise"); - } - - public function cancel() - { - // pass - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/Is.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Is.php deleted file mode 100644 index c3ed8d01433..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/Is.php +++ /dev/null @@ -1,46 +0,0 @@ -getState() === PromiseInterface::PENDING; - } - - /** - * Returns true if a promise is fulfilled or rejected. - * - * @return bool - */ - public static function settled(PromiseInterface $promise) - { - return $promise->getState() !== PromiseInterface::PENDING; - } - - /** - * Returns true if a promise is fulfilled. - * - * @return bool - */ - public static function fulfilled(PromiseInterface $promise) - { - return $promise->getState() === PromiseInterface::FULFILLED; - } - - /** - * Returns true if a promise is rejected. - * - * @return bool - */ - public static function rejected(PromiseInterface $promise) - { - return $promise->getState() === PromiseInterface::REJECTED; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php b/upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php deleted file mode 100644 index 75939057b64..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/Promise.php +++ /dev/null @@ -1,278 +0,0 @@ -waitFn = $waitFn; - $this->cancelFn = $cancelFn; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - if ($this->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) - { - return $this->then(null, $onRejected); - } - - public function wait($unwrap = true) - { - $this->waitIfPending(); - - if ($this->result instanceof PromiseInterface) { - return $this->result->wait($unwrap); - } - if ($unwrap) { - if ($this->state === self::FULFILLED) { - return $this->result; - } - // It's rejected so "unwrap" and throw an exception. - throw Create::exceptionFor($this->result); - } - } - - public function getState() - { - return $this->state; - } - - public function cancel() - { - if ($this->state !== self::PENDING) { - return; - } - - $this->waitFn = $this->waitList = null; - - if ($this->cancelFn) { - $fn = $this->cancelFn; - $this->cancelFn = null; - try { - $fn(); - } catch (\Throwable $e) { - $this->reject($e); - } catch (\Exception $e) { - $this->reject($e); - } - } - - // Reject the promise only if it wasn't rejected in a then callback. - /** @psalm-suppress RedundantCondition */ - if ($this->state === self::PENDING) { - $this->reject(new CancellationException('Promise has been cancelled')); - } - } - - public function resolve($value) - { - $this->settle(self::FULFILLED, $value); - } - - public function reject($reason) - { - $this->settle(self::REJECTED, $reason); - } - - private function settle($state, $value) - { - if ($this->state !== self::PENDING) { - // Ignore calls with the same resolution. - if ($state === $this->state && $value === $this->result) { - return; - } - throw $this->state === $state - ? new \LogicException("The promise is already {$state}.") - : new \LogicException("Cannot change a {$this->state} promise to {$state}"); - } - - if ($value === $this) { - throw new \LogicException('Cannot fulfill or reject a promise with itself'); - } - - // Clear out the state of the promise but stash the handlers. - $this->state = $state; - $this->result = $value; - $handlers = $this->handlers; - $this->handlers = null; - $this->waitList = $this->waitFn = null; - $this->cancelFn = null; - - if (!$handlers) { - return; - } - - // If the value was not a settled promise or a thenable, then resolve - // it in the task queue using the correct ID. - 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) { - foreach ($handlers as $handler) { - self::callHandler($id, $value, $handler); - } - }); - } elseif ($value instanceof Promise && Is::pending($value)) { - // We can just merge our handlers onto the next promise. - $value->handlers = array_merge($value->handlers, $handlers); - } else { - // Resolve the handlers when the forwarded promise is resolved. - $value->then( - static function ($value) use ($handlers) { - foreach ($handlers as $handler) { - self::callHandler(1, $value, $handler); - } - }, - static function ($reason) use ($handlers) { - foreach ($handlers as $handler) { - self::callHandler(2, $reason, $handler); - } - } - ); - } - } - - /** - * Call a stack of handlers using a specific callback index and value. - * - * @param int $index 1 (resolve) or 2 (reject). - * @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) - { - /** @var PromiseInterface $promise */ - $promise = $handler[0]; - - // The promise may have been cancelled or resolved before placing - // this thunk in the queue. - if (Is::settled($promise)) { - return; - } - - try { - if (isset($handler[$index])) { - /* - * If $f throws an exception, then $handler will be in the exception - * stack trace. Since $handler contains a reference to the callable - * itself we get a circular reference. We clear the $handler - * here to avoid that memory leak. - */ - $f = $handler[$index]; - unset($handler); - $promise->resolve($f($value)); - } elseif ($index === 1) { - // Forward resolution values as-is. - $promise->resolve($value); - } else { - // Forward rejections down the chain. - $promise->reject($value); - } - } catch (\Throwable $reason) { - $promise->reject($reason); - } catch (\Exception $reason) { - $promise->reject($reason); - } - } - - private function waitIfPending() - { - if ($this->state !== self::PENDING) { - return; - } elseif ($this->waitFn) { - $this->invokeWaitFn(); - } elseif ($this->waitList) { - $this->invokeWaitList(); - } 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.'); - } - - Utils::queue()->run(); - - /** @psalm-suppress RedundantCondition */ - if ($this->state === self::PENDING) { - $this->reject('Invoking the wait callback did not resolve the promise'); - } - } - - private function invokeWaitFn() - { - try { - $wfn = $this->waitFn; - $this->waitFn = null; - $wfn(true); - } catch (\Exception $reason) { - if ($this->state === self::PENDING) { - // The promise has not been resolved yet, so reject the promise - // with the exception. - $this->reject($reason); - } else { - // The promise was already resolved, so there's a problem in - // the application. - throw $reason; - } - } - } - - private function invokeWaitList() - { - $waitList = $this->waitList; - $this->waitList = null; - - foreach ($waitList as $result) { - do { - $result->waitIfPending(); - $result = $result->result; - } while ($result instanceof Promise); - - if ($result instanceof PromiseInterface) { - $result->wait(false); - } - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php b/upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php deleted file mode 100644 index e598331435a..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/PromiseInterface.php +++ /dev/null @@ -1,97 +0,0 @@ -reason = $reason; - } - - public function then( - callable $onFulfilled = null, - callable $onRejected = null - ) { - // If there's no onRejected callback then just return self. - if (!$onRejected) { - return $this; - } - - $queue = Utils::queue(); - $reason = $this->reason; - $p = new Promise([$queue, 'run']); - $queue->add(static function () use ($p, $reason, $onRejected) { - if (Is::pending($p)) { - try { - // Return a resolved promise if onRejected does not throw. - $p->resolve($onRejected($reason)); - } 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); - } - } - }); - - return $p; - } - - public function otherwise(callable $onRejected) - { - return $this->then(null, $onRejected); - } - - public function wait($unwrap = true, $defaultDelivery = null) - { - if ($unwrap) { - throw Create::exceptionFor($this->reason); - } - - return null; - } - - public function getState() - { - return self::REJECTED; - } - - public function resolve($value) - { - throw new \LogicException("Cannot resolve a rejected promise"); - } - - public function reject($reason) - { - if ($reason !== $this->reason) { - throw new \LogicException("Cannot reject a rejected promise"); - } - } - - public function cancel() - { - // pass - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php b/upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php deleted file mode 100644 index e2f137707df..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/RejectionException.php +++ /dev/null @@ -1,48 +0,0 @@ -reason = $reason; - - $message = 'The promise was rejected'; - - if ($description) { - $message .= ' with reason: ' . $description; - } elseif (is_string($reason) - || (is_object($reason) && method_exists($reason, '__toString')) - ) { - $message .= ' with reason: ' . $this->reason; - } elseif ($reason instanceof \JsonSerializable) { - $message .= ' with reason: ' - . json_encode($this->reason, JSON_PRETTY_PRINT); - } - - parent::__construct($message); - } - - /** - * Returns the rejection reason. - * - * @return mixed - */ - public function getReason() - { - return $this->reason; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php b/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php deleted file mode 100644 index f0fba2c594a..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueue.php +++ /dev/null @@ -1,67 +0,0 @@ -run(); - */ -class TaskQueue implements TaskQueueInterface -{ - private $enableShutdown = true; - private $queue = []; - - public function __construct($withShutdown = true) - { - if ($withShutdown) { - register_shutdown_function(function () { - if ($this->enableShutdown) { - // Only run the tasks if an E_ERROR didn't occur. - $err = error_get_last(); - if (!$err || ($err['type'] ^ E_ERROR)) { - $this->run(); - } - } - }); - } - } - - public function isEmpty() - { - return !$this->queue; - } - - public function add(callable $task) - { - $this->queue[] = $task; - } - - public function run() - { - while ($task = array_shift($this->queue)) { - /** @var callable $task */ - $task(); - } - } - - /** - * The task queue will be run and exhausted by default when the process - * exits IFF the exit is not the result of a PHP E_ERROR error. - * - * You can disable running the automatic shutdown of the queue by calling - * this function. If you disable the task queue shutdown process, then you - * MUST either run the task queue (as a result of running your event loop - * or manually using the run() method) or wait on each outstanding promise. - * - * Note: This shutdown will occur before any destructors are triggered. - */ - public function disableShutdown() - { - $this->enableShutdown = false; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php deleted file mode 100644 index 723d4d54eb1..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/TaskQueueInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * while ($eventLoop->isRunning()) { - * GuzzleHttp\Promise\Utils::queue()->run(); - * } - * - * - * @param TaskQueueInterface $assign Optionally specify a new queue instance. - * - * @return TaskQueueInterface - */ - public static function queue(TaskQueueInterface $assign = null) - { - static $queue; - - if ($assign) { - $queue = $assign; - } elseif (!$queue) { - $queue = new TaskQueue(); - } - - return $queue; - } - - /** - * 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 - */ - public static function task(callable $task) - { - $queue = self::queue(); - $promise = new Promise([$queue, 'run']); - $queue->add(function () use ($task, $promise) { - try { - if (Is::pending($promise)) { - $promise->resolve($task()); - } - } catch (\Throwable $e) { - $promise->reject($e); - } catch (\Exception $e) { - $promise->reject($e); - } - }); - - return $promise; - } - - /** - * 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 - */ - public static function inspect(PromiseInterface $promise) - { - try { - return [ - 'state' => PromiseInterface::FULFILLED, - '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]; - } - } - - /** - * 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 - */ - public static function inspectAll($promises) - { - $results = []; - foreach ($promises as $key => $promise) { - $results[$key] = inspect($promise); - } - - return $results; - } - - /** - * 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 - */ - public static function unwrap($promises) - { - $results = []; - foreach ($promises as $key => $promise) { - $results[$key] = $promise->wait(); - } - - return $results; - } - - /** - * 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 - */ - public static function all($promises, $recursive = false) - { - $results = []; - $promise = Each::of( - $promises, - function ($value, $idx) use (&$results) { - $results[$idx] = $value; - }, - function ($reason, $idx, Promise $aggregate) { - $aggregate->reject($reason); - } - )->then(function () use (&$results) { - ksort($results); - return $results; - }); - - if (true === $recursive) { - $promise = $promise->then(function ($results) use ($recursive, &$promises) { - foreach ($promises as $promise) { - if (Is::pending($promise)) { - return self::all($promises, $recursive); - } - } - return $results; - }); - } - - return $promise; - } - - /** - * 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 - */ - public static function some($count, $promises) - { - $results = []; - $rejections = []; - - return Each::of( - $promises, - function ($value, $idx, PromiseInterface $p) use (&$results, $count) { - if (Is::settled($p)) { - return; - } - $results[$idx] = $value; - if (count($results) >= $count) { - $p->resolve(null); - } - }, - function ($reason) use (&$rejections) { - $rejections[] = $reason; - } - )->then( - function () use (&$results, &$rejections, $count) { - if (count($results) !== $count) { - throw new AggregateException( - 'Not enough promises to fulfill count', - $rejections - ); - } - ksort($results); - return array_values($results); - } - ); - } - - /** - * 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 - */ - public static function any($promises) - { - return self::some(1, $promises)->then(function ($values) { - return $values[0]; - }); - } - - /** - * 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 - */ - public static function settle($promises) - { - $results = []; - - return Each::of( - $promises, - function ($value, $idx) use (&$results) { - $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; - }, - function ($reason, $idx) use (&$results) { - $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; - } - )->then(function () use (&$results) { - ksort($results); - return $results; - }); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/promises/src/functions.php b/upload/system/storage/vendor/guzzlehttp/promises/src/functions.php deleted file mode 100644 index c03d39d0210..00000000000 --- a/upload/system/storage/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/upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php b/upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php deleted file mode 100644 index 34cd1710aa2..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/promises/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ - - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml deleted file mode 100644 index eda7dceb56f..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/ci.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: CI - -on: - pull_request: - -jobs: - build: - name: Build - runs-on: ubuntu-latest - strategy: - max-parallel: 10 - matrix: - php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - - steps: - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: 'none' - extensions: mbstring - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Mimic PHP 8.0 - run: composer config platform.php 8.0.999 - if: matrix.php > 8 - - - name: Install dependencies - run: composer update --no-interaction --no-progress - - - name: Run tests - run: make test diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml deleted file mode 100644 index 3c31f9ef2a8..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/integration.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Integration - -on: - pull_request: - -jobs: - - build: - name: Test - runs-on: ubuntu-latest - strategy: - max-parallel: 10 - matrix: - php: ['7.2', '7.3', '7.4', '8.0'] - - steps: - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Download dependencies - uses: ramsey/composer-install@v1 - with: - composer-options: --no-interaction --optimize-autoloader - - - name: Start server - run: php -S 127.0.0.1:10002 tests/Integration/server.php & - - - name: Run tests - env: - TEST_SERVER: 127.0.0.1:10002 - run: ./vendor/bin/phpunit --testsuite Integration diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml b/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml deleted file mode 100644 index ab4d68ba30b..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/.github/workflows/static.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Static analysis - -on: - pull_request: - -jobs: - php-cs-fixer: - name: PHP-CS-Fixer - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - coverage: none - extensions: mbstring - - - name: Download dependencies - run: composer update --no-interaction --no-progress - - - name: Download PHP CS Fixer - run: composer require "friendsofphp/php-cs-fixer:2.18.4" - - - name: Execute PHP CS Fixer - run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist b/upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist deleted file mode 100644 index e4f0bd53570..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/.php_cs.dist +++ /dev/null @@ -1,56 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'concat_space' => ['spacing' => 'one'], - 'declare_strict_types' => false, - 'final_static_access' => true, - 'fully_qualified_strict_types' => true, - 'header_comment' => false, - 'is_null' => ['use_yoda_style' => true], - 'list_syntax' => ['syntax' => 'long'], - 'lowercase_cast' => true, - 'magic_method_casing' => true, - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_leading_import_slash' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unset_cast' => true, - 'no_unused_imports' => true, - 'no_whitespace_in_blank_line' => true, - 'ordered_imports' => true, - 'php_unit_ordered_covers' => true, - 'php_unit_test_annotation' => ['style' => 'prefix'], - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - 'phpdoc_align' => ['align' => 'vertical'], - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], - 'phpdoc_var_without_name' => true, - 'single_trait_insert_per_statement' => true, - 'standardize_not_equals' => true, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') - ->name('*.php') - ) -; - -return $config; diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md deleted file mode 100644 index f40736c4eb0..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/CHANGELOG.md +++ /dev/null @@ -1,300 +0,0 @@ -# Change Log - - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - - -## Unreleased - -## 1.8.3 - 2021-10-05 - -### Fixed - -- Return `null` in caching stream size if remote size is `null` - -## 1.8.2 - 2021-04-26 - -### Fixed - -- Handle possibly unset `url` in `stream_get_meta_data` - -## 1.8.1 - 2021-03-21 - -### Fixed - -- Issue parsing IPv6 URLs -- Issue modifying ServerRequest lost all its attributes - -## 1.8.0 - 2021-03-21 - -### Added - -- Locale independent URL parsing -- Most classes got a `@final` annotation to prepare for 2.0 - -### Fixed - -- Issue when creating stream from `php://input` and curl-ext is not installed -- Broken `Utils::tryFopen()` on PHP 8 - -## 1.7.0 - 2020-09-30 - -### Added - -- Replaced functions by static methods - -### Fixed - -- Converting a non-seekable stream to a string -- Handle multiple Set-Cookie correctly -- Ignore array keys in header values when merging -- Allow multibyte characters to be parsed in `Message:bodySummary()` - -### Changed - -- Restored partial HHVM 3 support - - -## [1.6.1] - 2019-07-02 - -### Fixed - -- Accept null and bool header values again - - -## [1.6.0] - 2019-06-30 - -### Added - -- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) -- Added MIME type for WEBP image format (#246) -- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) - -### Changed - -- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) -- Accept port number 0 to be valid (#270) - -### Fixed - -- Fixed subsequent reads from `php://input` in ServerRequest (#247) -- Fixed readable/writable detection for certain stream modes (#248) -- Fixed encoding of special characters in the `userInfo` component of an URI (#253) - - -## [1.5.2] - 2018-12-04 - -### Fixed - -- Check body size when getting the message summary - - -## [1.5.1] - 2018-12-04 - -### Fixed - -- Get the summary of a body only if it is readable - - -## [1.5.0] - 2018-12-03 - -### Added - -- Response first-line to response string exception (fixes #145) -- A test for #129 behavior -- `get_message_body_summary` function in order to get the message summary -- `3gp` and `mkv` mime types - -### Changed - -- Clarify exception message when stream is detached - -### Deprecated - -- Deprecated parsing folded header lines as per RFC 7230 - -### Fixed - -- Fix `AppendStream::detach` to not close streams -- `InflateStream` preserves `isSeekable` attribute of the underlying stream -- `ServerRequest::getUriFromGlobals` to support URLs in query parameters - - -Several other fixes and improvements. - - -## [1.4.2] - 2017-03-20 - -### Fixed - -- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing - calls to `trigger_error` when deprecated methods are invoked. - - -## [1.4.1] - 2017-02-27 - -### Added - -- Rriggering of silenced deprecation warnings. - -### Fixed - -- Reverted BC break by reintroducing behavior to automagically fix a URI with a - relative path and an authority by adding a leading slash to the path. It's only - deprecated now. - - -## [1.4.0] - 2017-02-21 - -### Added - -- Added common URI utility methods based on RFC 3986 (see documentation in the readme): - - `Uri::isDefaultPort` - - `Uri::isAbsolute` - - `Uri::isNetworkPathReference` - - `Uri::isAbsolutePathReference` - - `Uri::isRelativePathReference` - - `Uri::isSameDocumentReference` - - `Uri::composeComponents` - - `UriNormalizer::normalize` - - `UriNormalizer::isEquivalent` - - `UriResolver::relativize` - -### Changed - -- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. -- Allow `parse_response` to parse a response without delimiting space and reason. -- Ensure each URI modification results in a valid URI according to PSR-7 discussions. - Invalid modifications will throw an exception instead of returning a wrong URI or - doing some magic. - - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception - because the path of a URI with an authority must start with a slash "/" or be empty - - `(new Uri())->withScheme('http')` will return `'http://localhost'` - -### Deprecated - -- `Uri::resolve` in favor of `UriResolver::resolve` -- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` - -### Fixed - -- `Stream::read` when length parameter <= 0. -- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. -- `ServerRequest::getUriFromGlobals` when `Host` header contains port. -- Compatibility of URIs with `file` scheme and empty host. - - -## [1.3.1] - 2016-06-25 - -### Fixed - -- `Uri::__toString` for network path references, e.g. `//example.org`. -- Missing lowercase normalization for host. -- Handling of URI components in case they are `'0'` in a lot of places, - e.g. as a user info password. -- `Uri::withAddedHeader` to correctly merge headers with different case. -- Trimming of header values in `Uri::withAddedHeader`. Header values may - be surrounded by whitespace which should be ignored according to RFC 7230 - Section 3.2.4. This does not apply to header names. -- `Uri::withAddedHeader` with an array of header values. -- `Uri::resolve` when base path has no slash and handling of fragment. -- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the - key/value both in encoded as well as decoded form to those methods. This is - consistent with withPath, withQuery etc. -- `ServerRequest::withoutAttribute` when attribute value is null. - - -## [1.3.0] - 2016-04-13 - -### Added - -- Remaining interfaces needed for full PSR7 compatibility - (ServerRequestInterface, UploadedFileInterface, etc.). -- Support for stream_for from scalars. - -### Changed - -- Can now extend Uri. - -### Fixed -- A bug in validating request methods by making it more permissive. - - -## [1.2.3] - 2016-02-18 - -### Fixed - -- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote - streams, which can sometimes return fewer bytes than requested with `fread`. -- Handling of gzipped responses with FNAME headers. - - -## [1.2.2] - 2016-01-22 - -### Added - -- Support for URIs without any authority. -- Support for HTTP 451 'Unavailable For Legal Reasons.' -- Support for using '0' as a filename. -- Support for including non-standard ports in Host headers. - - -## [1.2.1] - 2015-11-02 - -### Changes - -- Now supporting negative offsets when seeking to SEEK_END. - - -## [1.2.0] - 2015-08-15 - -### Changed - -- Body as `"0"` is now properly added to a response. -- Now allowing forward seeking in CachingStream. -- Now properly parsing HTTP requests that contain proxy targets in - `parse_request`. -- functions.php is now conditionally required. -- user-info is no longer dropped when resolving URIs. - - -## [1.1.0] - 2015-06-24 - -### Changed - -- URIs can now be relative. -- `multipart/form-data` headers are now overridden case-insensitively. -- URI paths no longer encode the following characters because they are allowed - in URIs: "(", ")", "*", "!", "'" -- A port is no longer added to a URI when the scheme is missing and no port is - present. - - -## 1.0.0 - 2015-05-19 - -Initial release. - -Currently unsupported: - -- `Psr\Http\Message\ServerRequestInterface` -- `Psr\Http\Message\UploadedFileInterface` - - - -[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 -[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 -[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 -[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 -[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 -[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 -[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 -[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 -[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 -[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 -[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/LICENSE b/upload/system/storage/vendor/guzzlehttp/psr7/LICENSE deleted file mode 100644 index 51c7ec81cb8..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Michael Dowling -Copyright (c) 2015 Márk Sági-Kazár -Copyright (c) 2015 Graham Campbell -Copyright (c) 2016 Tobias Schultze -Copyright (c) 2016 George Mponos -Copyright (c) 2018 Tobias Nyholm - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/README.md b/upload/system/storage/vendor/guzzlehttp/psr7/README.md deleted file mode 100644 index 464cae4f22e..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/README.md +++ /dev/null @@ -1,824 +0,0 @@ -# PSR-7 Message Implementation - -This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/) -message implementation, several stream decorators, and some helpful -functionality like query string parsing. - - -[![Build Status](https://travis-ci.org/guzzle/psr7.svg?branch=master)](https://travis-ci.org/guzzle/psr7) - - -# Stream implementation - -This package comes with a number of stream implementations and stream -decorators. - - -## AppendStream - -`GuzzleHttp\Psr7\AppendStream` - -Reads from multiple streams, one after the other. - -```php -use GuzzleHttp\Psr7; - -$a = Psr7\Utils::streamFor('abc, '); -$b = Psr7\Utils::streamFor('123.'); -$composed = new Psr7\AppendStream([$a, $b]); - -$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); - -echo $composed; // abc, 123. Above all listen to me. -``` - - -## BufferStream - -`GuzzleHttp\Psr7\BufferStream` - -Provides a buffer stream that can be written to fill a buffer, and read -from to remove bytes from the buffer. - -This stream returns a "hwm" metadata value that tells upstream consumers -what the configured high water mark of the stream is, or the maximum -preferred size of the buffer. - -```php -use GuzzleHttp\Psr7; - -// When more than 1024 bytes are in the buffer, it will begin returning -// false to writes. This is an indication that writers should slow down. -$buffer = new Psr7\BufferStream(1024); -``` - - -## CachingStream - -The CachingStream is used to allow seeking over previously read bytes on -non-seekable streams. This can be useful when transferring a non-seekable -entity body fails due to needing to rewind the stream (for example, resulting -from a redirect). Data that is read from the remote stream will be buffered in -a PHP temp stream so that previously read bytes are cached first in memory, -then on disk. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); -$stream = new Psr7\CachingStream($original); - -$stream->read(1024); -echo $stream->tell(); -// 1024 - -$stream->seek(0); -echo $stream->tell(); -// 0 -``` - - -## DroppingStream - -`GuzzleHttp\Psr7\DroppingStream` - -Stream decorator that begins dropping data once the size of the underlying -stream becomes too full. - -```php -use GuzzleHttp\Psr7; - -// Create an empty stream -$stream = Psr7\Utils::streamFor(); - -// Start dropping data when the stream has more than 10 bytes -$dropping = new Psr7\DroppingStream($stream, 10); - -$dropping->write('01234567890123456789'); -echo $stream; // 0123456789 -``` - - -## FnStream - -`GuzzleHttp\Psr7\FnStream` - -Compose stream implementations based on a hash of functions. - -Allows for easy testing and extension of a provided stream without needing -to create a concrete class for a simple extension point. - -```php - -use GuzzleHttp\Psr7; - -$stream = Psr7\Utils::streamFor('hi'); -$fnStream = Psr7\FnStream::decorate($stream, [ - 'rewind' => function () use ($stream) { - echo 'About to rewind - '; - $stream->rewind(); - echo 'rewound!'; - } -]); - -$fnStream->rewind(); -// Outputs: About to rewind - rewound! -``` - - -## InflateStream - -`GuzzleHttp\Psr7\InflateStream` - -Uses PHP's zlib.inflate filter to inflate deflate or gzipped content. - -This stream decorator skips the first 10 bytes of the given stream to remove -the gzip header, converts the provided stream to a PHP stream resource, -then appends the zlib.inflate filter. The stream is then converted back -to a Guzzle stream resource to be used as a Guzzle stream. - - -## LazyOpenStream - -`GuzzleHttp\Psr7\LazyOpenStream` - -Lazily reads or writes to a file that is opened only after an IO operation -take place on the stream. - -```php -use GuzzleHttp\Psr7; - -$stream = new Psr7\LazyOpenStream('/path/to/file', 'r'); -// The file has not yet been opened... - -echo $stream->read(10); -// The file is opened and read from only when needed. -``` - - -## LimitStream - -`GuzzleHttp\Psr7\LimitStream` - -LimitStream can be used to read a subset or slice of an existing stream object. -This can be useful for breaking a large file into smaller pieces to be sent in -chunks (e.g. Amazon S3's multipart upload API). - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); -echo $original->getSize(); -// >>> 1048576 - -// Limit the size of the body to 1024 bytes and start reading from byte 2048 -$stream = new Psr7\LimitStream($original, 1024, 2048); -echo $stream->getSize(); -// >>> 1024 -echo $stream->tell(); -// >>> 0 -``` - - -## MultipartStream - -`GuzzleHttp\Psr7\MultipartStream` - -Stream that when read returns bytes for a streaming multipart or -multipart/form-data stream. - - -## NoSeekStream - -`GuzzleHttp\Psr7\NoSeekStream` - -NoSeekStream wraps a stream and does not allow seeking. - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor('foo'); -$noSeek = new Psr7\NoSeekStream($original); - -echo $noSeek->read(3); -// foo -var_export($noSeek->isSeekable()); -// false -$noSeek->seek(0); -var_export($noSeek->read(3)); -// NULL -``` - - -## PumpStream - -`GuzzleHttp\Psr7\PumpStream` - -Provides a read only stream that pumps data from a PHP callable. - -When invoking the provided callable, the PumpStream will pass the amount of -data requested to read to the callable. The callable can choose to ignore -this value and return fewer or more bytes than requested. Any extra data -returned by the provided callable is buffered internally until drained using -the read() function of the PumpStream. The provided callable MUST return -false when there is no more data to read. - - -## Implementing stream decorators - -Creating a stream decorator is very easy thanks to the -`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that -implement `Psr\Http\Message\StreamInterface` by proxying to an underlying -stream. Just `use` the `StreamDecoratorTrait` and implement your custom -methods. - -For example, let's say we wanted to call a specific function each time the last -byte is read from a stream. This could be implemented by overriding the -`read()` method. - -```php -use Psr\Http\Message\StreamInterface; -use GuzzleHttp\Psr7\StreamDecoratorTrait; - -class EofCallbackStream implements StreamInterface -{ - use StreamDecoratorTrait; - - private $callback; - - public function __construct(StreamInterface $stream, callable $cb) - { - $this->stream = $stream; - $this->callback = $cb; - } - - public function read($length) - { - $result = $this->stream->read($length); - - // Invoke the callback when EOF is hit. - if ($this->eof()) { - call_user_func($this->callback); - } - - return $result; - } -} -``` - -This decorator could be added to any existing stream and used like so: - -```php -use GuzzleHttp\Psr7; - -$original = Psr7\Utils::streamFor('foo'); - -$eofStream = new EofCallbackStream($original, function () { - echo 'EOF!'; -}); - -$eofStream->read(2); -$eofStream->read(1); -// echoes "EOF!" -$eofStream->seek(0); -$eofStream->read(3); -// echoes "EOF!" -``` - - -## PHP StreamWrapper - -You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a -PSR-7 stream as a PHP stream resource. - -Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP -stream from a PSR-7 stream. - -```php -use GuzzleHttp\Psr7\StreamWrapper; - -$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); -$resource = StreamWrapper::getResource($stream); -echo fread($resource, 6); // outputs hello! -``` - - -# Static API - -There are various static methods available under the `GuzzleHttp\Psr7` namespace. - - -## `GuzzleHttp\Psr7\Message::toString` - -`public static function toString(MessageInterface $message): string` - -Returns the string representation of an HTTP message. - -```php -$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); -echo GuzzleHttp\Psr7\Message::toString($request); -``` - - -## `GuzzleHttp\Psr7\Message::bodySummary` - -`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` - -Get a short summary of the message body. - -Will return `null` if the response is not printable. - - -## `GuzzleHttp\Psr7\Message::rewindBody` - -`public static function rewindBody(MessageInterface $message): void` - -Attempts to rewind a message body and throws an exception on failure. - -The body of the message will only be rewound if a call to `tell()` -returns a value other than `0`. - - -## `GuzzleHttp\Psr7\Message::parseMessage` - -`public static function parseMessage(string $message): array` - -Parses an HTTP message into an associative array. - -The array contains the "start-line" key containing the start line of -the message, "headers" key containing an associative array of header -array values, and a "body" key containing the body of the message. - - -## `GuzzleHttp\Psr7\Message::parseRequestUri` - -`public static function parseRequestUri(string $path, array $headers): string` - -Constructs a URI for an HTTP request message. - - -## `GuzzleHttp\Psr7\Message::parseRequest` - -`public static function parseRequest(string $message): Request` - -Parses a request message string into a request object. - - -## `GuzzleHttp\Psr7\Message::parseResponse` - -`public static function parseResponse(string $message): Response` - -Parses a response message string into a response object. - - -## `GuzzleHttp\Psr7\Header::parse` - -`public static function parse(string|array $header): array` - -Parse an array of header values containing ";" separated data into an -array of associative arrays representing the header key value pair data -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` - -`public static function normalize(string|array $header): array` - -Converts an array of header values that may contain comma separated -headers into an array of headers with no comma separated values. - - -## `GuzzleHttp\Psr7\Query::parse` - -`public static function parse(string $str, int|bool $urlEncoding = true): array` - -Parse a query string into an associative array. - -If multiple values are found for the same key, the value of that key -value pair will become an array. This function does not parse nested -PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` -will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. - - -## `GuzzleHttp\Psr7\Query::build` - -`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` - -Build a query string from an array of key value pairs. - -This function can use the return value of `parse()` to build a query -string. This function does not modify the provided keys when an array is -encountered (like `http_build_query()` would). - - -## `GuzzleHttp\Psr7\Utils::caselessRemove` - -`public static function caselessRemove(iterable $keys, $keys, array $data): array` - -Remove the items given by the keys, case insensitively from the data. - - -## `GuzzleHttp\Psr7\Utils::copyToStream` - -`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` - -Copy the contents of a stream into another stream until the given number -of bytes have been read. - - -## `GuzzleHttp\Psr7\Utils::copyToString` - -`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` - -Copy the contents of a stream into a string until the given number of -bytes have been read. - - -## `GuzzleHttp\Psr7\Utils::hash` - -`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` - -Calculate a hash of a stream. - -This method reads the entire stream to calculate a rolling hash, based on -PHP's `hash_init` functions. - - -## `GuzzleHttp\Psr7\Utils::modifyRequest` - -`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` - -Clone and modify a request with the given changes. - -This method is useful for reducing the number of clones needed to mutate -a message. - -- method: (string) Changes the HTTP method. -- set_headers: (array) Sets the given headers. -- remove_headers: (array) Remove the given headers. -- body: (mixed) Sets the given body. -- uri: (UriInterface) Set the URI. -- query: (string) Set the query string value of the URI. -- version: (string) Set the protocol version. - - -## `GuzzleHttp\Psr7\Utils::readLine` - -`public static function readLine(StreamInterface $stream, int $maxLength = null): string` - -Read a line from the stream up to the maximum allowed buffer length. - - -## `GuzzleHttp\Psr7\Utils::streamFor` - -`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` - -Create a new stream based on the input type. - -Options is an associative array that can contain the following keys: - -- metadata: Array of custom metadata. -- size: Size of the stream. - -This method accepts the following `$resource` types: - -- `Psr\Http\Message\StreamInterface`: Returns the value as-is. -- `string`: Creates a stream object that uses the given string as the contents. -- `resource`: Creates a stream object that wraps the given PHP stream resource. -- `Iterator`: If the provided value implements `Iterator`, then a read-only - stream object will be created that wraps the given iterable. Each time the - stream is read from, data from the iterator will fill a buffer and will be - continuously called until the buffer is equal to the requested read size. - Subsequent read calls will first read from the buffer and then call `next` - on the underlying iterator until it is exhausted. -- `object` with `__toString()`: If the object has the `__toString()` method, - the object will be cast to a string and then a stream will be returned that - uses the string value. -- `NULL`: When `null` is passed, an empty stream object is returned. -- `callable` When a callable is passed, a read-only stream object will be - created that invokes the given callable. The callable is invoked with the - number of suggested bytes to read. The callable can return any number of - bytes, but MUST return `false` when there is no more data to return. The - stream object that wraps the callable will invoke the callable until the - number of requested bytes are available. Any additional bytes will be - buffered and used in subsequent reads. - -```php -$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); -$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); - -$generator = function ($bytes) { - for ($i = 0; $i < $bytes; $i++) { - yield ' '; - } -} - -$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); -``` - - -## `GuzzleHttp\Psr7\Utils::tryFopen` - -`public static function tryFopen(string $filename, string $mode): resource` - -Safely opens a PHP stream resource using a filename. - -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::uriFor` - -`public static function uriFor(string|UriInterface $uri): UriInterface` - -Returns a UriInterface for the given value. - -This function accepts a string or UriInterface and returns a -UriInterface for the given value. If the value is already a -UriInterface, it is returned as-is. - - -## `GuzzleHttp\Psr7\MimeType::fromFilename` - -`public static function fromFilename(string $filename): string|null` - -Determines the mimetype of a file by looking at its extension. - - -## `GuzzleHttp\Psr7\MimeType::fromExtension` - -`public static function fromExtension(string $extension): string|null` - -Maps a file extensions to a mimetype. - - -## Upgrading from Function API - -The static API was first introduced in 1.7.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: - -| Original Function | Replacement Method | -|----------------|----------------| -| `str` | `Message::toString` | -| `uri_for` | `Utils::uriFor` | -| `stream_for` | `Utils::streamFor` | -| `parse_header` | `Header::parse` | -| `normalize_header` | `Header::normalize` | -| `modify_request` | `Utils::modifyRequest` | -| `rewind_body` | `Message::rewindBody` | -| `try_fopen` | `Utils::tryFopen` | -| `copy_to_string` | `Utils::copyToString` | -| `copy_to_stream` | `Utils::copyToStream` | -| `hash` | `Utils::hash` | -| `readline` | `Utils::readLine` | -| `parse_request` | `Message::parseRequest` | -| `parse_response` | `Message::parseResponse` | -| `parse_query` | `Query::parse` | -| `build_query` | `Query::build` | -| `mimetype_from_filename` | `MimeType::fromFilename` | -| `mimetype_from_extension` | `MimeType::fromExtension` | -| `_parse_message` | `Message::parseMessage` | -| `_parse_request_uri` | `Message::parseRequestUri` | -| `get_message_body_summary` | `Message::bodySummary` | -| `_caseless_remove` | `Utils::caselessRemove` | - - -# Additional URI Methods - -Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, -this library also provides additional functionality when working with URIs as static methods. - -## URI Types - -An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference. -An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, -the base URI. Relative references can be divided into several forms according to -[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2): - -- network-path references, e.g. `//example.com/path` -- absolute-path references, e.g. `/path` -- relative-path references, e.g. `subpath` - -The following methods can be used to identify the type of the URI. - -### `GuzzleHttp\Psr7\Uri::isAbsolute` - -`public static function isAbsolute(UriInterface $uri): bool` - -Whether the URI is absolute, i.e. it has a scheme. - -### `GuzzleHttp\Psr7\Uri::isNetworkPathReference` - -`public static function isNetworkPathReference(UriInterface $uri): bool` - -Whether the URI is a network-path reference. A relative reference that begins with two slash characters is -termed an network-path reference. - -### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference` - -`public static function isAbsolutePathReference(UriInterface $uri): bool` - -Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is -termed an absolute-path reference. - -### `GuzzleHttp\Psr7\Uri::isRelativePathReference` - -`public static function isRelativePathReference(UriInterface $uri): bool` - -Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is -termed a relative-path reference. - -### `GuzzleHttp\Psr7\Uri::isSameDocumentReference` - -`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool` - -Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its -fragment component, identical to the base URI. When no base URI is given, only an empty URI reference -(apart from its fragment) is considered a same-document reference. - -## URI Components - -Additional methods to work with URI components. - -### `GuzzleHttp\Psr7\Uri::isDefaultPort` - -`public static function isDefaultPort(UriInterface $uri): bool` - -Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null -or the standard port. This method can be used independently of the implementation. - -### `GuzzleHttp\Psr7\Uri::composeComponents` - -`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string` - -Composes a URI reference string from its various components according to -[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called -manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`. - -### `GuzzleHttp\Psr7\Uri::fromParts` - -`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. - - -### `GuzzleHttp\Psr7\Uri::withQueryValue` - -`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface` - -Creates a new URI with a specific query string value. Any existing query string values that exactly match the -provided key are removed and replaced with the given key value pair. A value of null will set the query string -key without a value, e.g. "key" instead of "key=value". - -### `GuzzleHttp\Psr7\Uri::withQueryValues` - -`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface` - -Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an -associative array of key => value. - -### `GuzzleHttp\Psr7\Uri::withoutQueryValue` - -`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface` - -Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the -provided key are removed. - -## Reference Resolution - -`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according -to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers -do when resolving a link in a website based on the current request URI. - -### `GuzzleHttp\Psr7\UriResolver::resolve` - -`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface` - -Converts the relative URI into a new URI that is resolved against the base URI. - -### `GuzzleHttp\Psr7\UriResolver::removeDotSegments` - -`public static function removeDotSegments(string $path): string` - -Removes dot segments from a path and returns the new path according to -[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4). - -### `GuzzleHttp\Psr7\UriResolver::relativize` - -`public static function relativize(UriInterface $base, UriInterface $target): UriInterface` - -Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve(): - -```php -(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) -``` - -One use-case is to use the current request URI as base URI and then generate relative links in your documents -to reduce the document size or offer self-contained downloadable document archives. - -```php -$base = new Uri('http://example.com/a/b/'); -echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. -echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. -echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. -echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. -``` - -## Normalization and Comparison - -`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to -[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6). - -### `GuzzleHttp\Psr7\UriNormalizer::normalize` - -`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface` - -Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface. -This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask -of normalizations to apply. The following normalizations are available: - -- `UriNormalizer::PRESERVING_NORMALIZATIONS` - - Default normalizations which only include the ones that preserve semantics. - -- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING` - - All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized. - - Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b` - -- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS` - - Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of - ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should - not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved - characters by URI normalizers. - - Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/` - -- `UriNormalizer::CONVERT_EMPTY_PATH` - - Converts the empty path to "/" for http and https URIs. - - Example: `http://example.org` → `http://example.org/` - -- `UriNormalizer::REMOVE_DEFAULT_HOST` - - Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host - "localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to - RFC 3986. - - Example: `file://localhost/myfile` → `file:///myfile` - -- `UriNormalizer::REMOVE_DEFAULT_PORT` - - Removes the default port of the given URI scheme from the URI. - - Example: `http://example.org:80/` → `http://example.org/` - -- `UriNormalizer::REMOVE_DOT_SEGMENTS` - - Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would - change the semantics of the URI reference. - - Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html` - -- `UriNormalizer::REMOVE_DUPLICATE_SLASHES` - - Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes - and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization - may change the semantics. Encoded slashes (%2F) are not removed. - - Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html` - -- `UriNormalizer::SORT_QUERY_PARAMETERS` - - Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be - significant (this is not defined by the standard). So this normalization is not safe and may change the semantics - of the URI. - - Example: `?lang=en&article=fred` → `?article=fred&lang=en` - -### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent` - -`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool` - -Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given -`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. -This of course assumes they will be resolved against the same base URI. If this is not the case, determination of -equivalence or difference of relative references does not mean anything. - - -## Security - -If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. - -## 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 - -The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/composer.json b/upload/system/storage/vendor/guzzlehttp/psr7/composer.json deleted file mode 100644 index bfa7cfdc16e..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/composer.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "guzzlehttp/psr7", - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], - "license": "MIT", - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10", - "ext-zlib": "*" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": ["src/functions_include.php"] - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Tests\\Psr7\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "config": { - "preferred-install": "dist", - "sort-packages": true - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php deleted file mode 100644 index fa9153d78f4..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/AppendStream.php +++ /dev/null @@ -1,246 +0,0 @@ -addStream($stream); - } - } - - public function __toString() - { - try { - $this->rewind(); - return $this->getContents(); - } catch (\Exception $e) { - return ''; - } - } - - /** - * Add a stream to the AppendStream - * - * @param StreamInterface $stream Stream to append. Must be readable. - * - * @throws \InvalidArgumentException if the stream is not readable - */ - public function addStream(StreamInterface $stream) - { - if (!$stream->isReadable()) { - throw new \InvalidArgumentException('Each stream must be readable'); - } - - // The stream is only seekable if all streams are seekable - if (!$stream->isSeekable()) { - $this->seekable = false; - } - - $this->streams[] = $stream; - } - - public function getContents() - { - return Utils::copyToString($this); - } - - /** - * Closes each attached stream. - * - * {@inheritdoc} - */ - public function close() - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->close(); - } - - $this->streams = []; - } - - /** - * Detaches each attached stream. - * - * Returns null as it's not clear which underlying stream resource to return. - * - * {@inheritdoc} - */ - public function detach() - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->detach(); - } - - $this->streams = []; - - return null; - } - - public function tell() - { - return $this->pos; - } - - /** - * Tries to calculate the size by adding the size of each stream. - * - * If any of the streams do not return a valid number, then the size of the - * append stream cannot be determined and null is returned. - * - * {@inheritdoc} - */ - public function getSize() - { - $size = 0; - - foreach ($this->streams as $stream) { - $s = $stream->getSize(); - if ($s === null) { - return null; - } - $size += $s; - } - - return $size; - } - - public function eof() - { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); - } - - public function rewind() - { - $this->seek(0); - } - - /** - * Attempts to seek to the given position. Only supports SEEK_SET. - * - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if (!$this->seekable) { - throw new \RuntimeException('This AppendStream is not seekable'); - } elseif ($whence !== SEEK_SET) { - throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); - } - - $this->pos = $this->current = 0; - - // Rewind each stream - foreach ($this->streams as $i => $stream) { - try { - $stream->rewind(); - } catch (\Exception $e) { - throw new \RuntimeException('Unable to seek stream ' - . $i . ' of the AppendStream', 0, $e); - } - } - - // Seek to the actual position by reading from each stream - while ($this->pos < $offset && !$this->eof()) { - $result = $this->read(min(8096, $offset - $this->pos)); - if ($result === '') { - break; - } - } - } - - /** - * Reads from all of the appended streams until the length is met or EOF. - * - * {@inheritdoc} - */ - public function read($length) - { - $buffer = ''; - $total = count($this->streams) - 1; - $remaining = $length; - $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++; - } - - $result = $this->streams[$this->current]->read($remaining); - - // Using a loose comparison here to match on '', false, and null - if ($result == null) { - $progressToNext = true; - continue; - } - - $buffer .= $result; - $remaining = $length - strlen($buffer); - } - - $this->pos += strlen($buffer); - - return $buffer; - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return false; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function write($string) - { - throw new \RuntimeException('Cannot write to an AppendStream'); - } - - public function getMetadata($key = null) - { - return $key ? null : []; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php deleted file mode 100644 index 783859c198b..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/BufferStream.php +++ /dev/null @@ -1,142 +0,0 @@ -hwm = $hwm; - } - - public function __toString() - { - return $this->getContents(); - } - - public function getContents() - { - $buffer = $this->buffer; - $this->buffer = ''; - - return $buffer; - } - - public function close() - { - $this->buffer = ''; - } - - public function detach() - { - $this->close(); - - return null; - } - - public function getSize() - { - return strlen($this->buffer); - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return true; - } - - public function isSeekable() - { - return false; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - throw new \RuntimeException('Cannot seek a BufferStream'); - } - - public function eof() - { - return strlen($this->buffer) === 0; - } - - public function tell() - { - throw new \RuntimeException('Cannot determine the position of a BufferStream'); - } - - /** - * Reads data from the buffer. - */ - public function read($length) - { - $currentLength = strlen($this->buffer); - - if ($length >= $currentLength) { - // No need to slice the buffer because we don't have enough data. - $result = $this->buffer; - $this->buffer = ''; - } else { - // Slice up the result to provide a subset of the buffer. - $result = substr($this->buffer, 0, $length); - $this->buffer = substr($this->buffer, $length); - } - - return $result; - } - - /** - * Writes data to the buffer. - */ - public function write($string) - { - $this->buffer .= $string; - - // TODO: What should happen here? - if (strlen($this->buffer) >= $this->hwm) { - return false; - } - - return strlen($string); - } - - public function getMetadata($key = null) - { - if ($key == 'hwm') { - return $this->hwm; - } - - return $key ? null : []; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php deleted file mode 100644 index febade9f41b..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/CachingStream.php +++ /dev/null @@ -1,147 +0,0 @@ -remoteStream = $stream; - $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); - } - - public function getSize() - { - $remoteSize = $this->remoteStream->getSize(); - - if (null === $remoteSize) { - return null; - } - - return max($this->stream->getSize(), $remoteSize); - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - if ($whence == SEEK_SET) { - $byte = $offset; - } elseif ($whence == SEEK_CUR) { - $byte = $offset + $this->tell(); - } elseif ($whence == SEEK_END) { - $size = $this->remoteStream->getSize(); - if ($size === null) { - $size = $this->cacheEntireStream(); - } - $byte = $size + $offset; - } else { - throw new \InvalidArgumentException('Invalid whence'); - } - - $diff = $byte - $this->stream->getSize(); - - if ($diff > 0) { - // Read the remoteStream until we have read in at least the amount - // of bytes requested, or we reach the end of the file. - while ($diff > 0 && !$this->remoteStream->eof()) { - $this->read($diff); - $diff = $byte - $this->stream->getSize(); - } - } else { - // We can just do a normal seek since we've already seen this byte. - $this->stream->seek($byte); - } - } - - public function read($length) - { - // Perform a regular read on any previously read data from the buffer - $data = $this->stream->read($length); - $remaining = $length - strlen($data); - - // More data was requested so read from the remote stream - if ($remaining) { - // If data was written to the buffer in a position that would have - // been filled from the remote stream, then we must skip bytes on - // the remote stream to emulate overwriting bytes from that - // position. This mimics the behavior of other PHP stream wrappers. - $remoteData = $this->remoteStream->read( - $remaining + $this->skipReadBytes - ); - - if ($this->skipReadBytes) { - $len = strlen($remoteData); - $remoteData = substr($remoteData, $this->skipReadBytes); - $this->skipReadBytes = max(0, $this->skipReadBytes - $len); - } - - $data .= $remoteData; - $this->stream->write($remoteData); - } - - return $data; - } - - public function write($string) - { - // When appending to the end of the currently read stream, you'll want - // to skip bytes from being read from the remote stream to emulate - // other stream wrappers. Basically replacing bytes of data of a fixed - // length. - $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); - if ($overflow > 0) { - $this->skipReadBytes += $overflow; - } - - return $this->stream->write($string); - } - - public function eof() - { - return $this->stream->eof() && $this->remoteStream->eof(); - } - - /** - * Close both the remote stream and buffer stream - */ - public function close() - { - $this->remoteStream->close() && $this->stream->close(); - } - - private function cacheEntireStream() - { - $target = new FnStream(['write' => 'strlen']); - Utils::copyToStream($this, $target); - - return $this->tell(); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php deleted file mode 100644 index 9f7420c405e..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ /dev/null @@ -1,45 +0,0 @@ -stream = $stream; - $this->maxLength = $maxLength; - } - - public function write($string) - { - $diff = $this->maxLength - $this->stream->getSize(); - - // Begin returning 0 when the underlying stream is too large. - if ($diff <= 0) { - return 0; - } - - // Write the stream or a subset of the stream if needed. - if (strlen($string) < $diff) { - return $this->stream->write($string); - } - - return $this->stream->write(substr($string, 0, $diff)); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php deleted file mode 100644 index 76a8cc7ba63..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/FnStream.php +++ /dev/null @@ -1,163 +0,0 @@ -methods = $methods; - - // Create the functions on the class - foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; - } - } - - /** - * Lazily determine which methods are not implemented. - * - * @throws \BadMethodCallException - */ - public function __get($name) - { - throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); - } - - /** - * The close method is called on the underlying stream only if possible. - */ - public function __destruct() - { - if (isset($this->_fn_close)) { - call_user_func($this->_fn_close); - } - } - - /** - * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. - * - * @throws \LogicException - */ - public function __wakeup() - { - throw new \LogicException('FnStream should never be unserialized'); - } - - /** - * Adds custom functionality to an underlying stream by intercepting - * specific method calls. - * - * @param StreamInterface $stream Stream to decorate - * @param array $methods Hash of method name to a closure - * - * @return FnStream - */ - public static function decorate(StreamInterface $stream, array $methods) - { - // If any of the required methods were not provided, then simply - // proxy to the decorated stream. - foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { - $methods[$diff] = [$stream, $diff]; - } - - return new self($methods); - } - - public function __toString() - { - return call_user_func($this->_fn___toString); - } - - public function close() - { - return call_user_func($this->_fn_close); - } - - public function detach() - { - return call_user_func($this->_fn_detach); - } - - public function getSize() - { - return call_user_func($this->_fn_getSize); - } - - public function tell() - { - return call_user_func($this->_fn_tell); - } - - public function eof() - { - return call_user_func($this->_fn_eof); - } - - public function isSeekable() - { - return call_user_func($this->_fn_isSeekable); - } - - public function rewind() - { - call_user_func($this->_fn_rewind); - } - - public function seek($offset, $whence = SEEK_SET) - { - call_user_func($this->_fn_seek, $offset, $whence); - } - - public function isWritable() - { - return call_user_func($this->_fn_isWritable); - } - - public function write($string) - { - return call_user_func($this->_fn_write, $string); - } - - public function isReadable() - { - return call_user_func($this->_fn_isReadable); - } - - public function read($length) - { - return call_user_func($this->_fn_read, $length); - } - - public function getContents() - { - return call_user_func($this->_fn_getContents); - } - - public function getMetadata($key = null) - { - return call_user_func($this->_fn_getMetadata, $key); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php deleted file mode 100644 index 865d7421429..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Header.php +++ /dev/null @@ -1,71 +0,0 @@ -]+>|[^=]+/', $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; - } - } - - return $params; - } - - /** - * Converts an array of header values that may contain comma separated - * headers into an array of headers with no comma separated values. - * - * @param string|array $header Header to normalize. - * - * @return array Returns the normalized header field values. - */ - public static function normalize($header) - { - if (!is_array($header)) { - return array_map('trim', explode(',', $header)); - } - - $result = []; - foreach ($header as $value) { - foreach ((array) $value as $v) { - if (strpos($v, ',') === false) { - $result[] = $v; - continue; - } - foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { - $result[] = trim($vv); - } - } - } - - return $result; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php deleted file mode 100644 index 0cbd2cce27d..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/InflateStream.php +++ /dev/null @@ -1,56 +0,0 @@ -read(10); - $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); - // Skip the header, that is 10 + length of filename + 1 (nil) bytes - $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); - $resource = StreamWrapper::getResource($stream); - stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); - $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); - } - - /** - * @param StreamInterface $stream - * @param $header - * - * @return int - */ - private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) - { - $filename_header_length = 0; - - if (substr(bin2hex($header), 6, 2) === '08') { - // we have a filename, read until nil - $filename_header_length = 1; - while ($stream->read(1) !== chr(0)) { - $filename_header_length++; - } - } - - return $filename_header_length; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php deleted file mode 100644 index 911e127d318..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ /dev/null @@ -1,42 +0,0 @@ -filename = $filename; - $this->mode = $mode; - } - - /** - * Creates the underlying stream lazily when required. - * - * @return StreamInterface - */ - protected function createStream() - { - return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php deleted file mode 100644 index 1173ec40d70..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/LimitStream.php +++ /dev/null @@ -1,157 +0,0 @@ -stream = $stream; - $this->setLimit($limit); - $this->setOffset($offset); - } - - public function eof() - { - // Always return true if the underlying stream is EOF - if ($this->stream->eof()) { - return true; - } - - // No limit and the underlying stream is not at EOF - if ($this->limit == -1) { - return false; - } - - return $this->stream->tell() >= $this->offset + $this->limit; - } - - /** - * Returns the size of the limited subset of data - * {@inheritdoc} - */ - public function getSize() - { - if (null === ($length = $this->stream->getSize())) { - return null; - } elseif ($this->limit == -1) { - return $length - $this->offset; - } else { - return min($this->limit, $length - $this->offset); - } - } - - /** - * Allow for a bounded seek on the read limited stream - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if ($whence !== SEEK_SET || $offset < 0) { - throw new \RuntimeException(sprintf( - 'Cannot seek to offset %s with whence %s', - $offset, - $whence - )); - } - - $offset += $this->offset; - - if ($this->limit !== -1) { - if ($offset > $this->offset + $this->limit) { - $offset = $this->offset + $this->limit; - } - } - - $this->stream->seek($offset); - } - - /** - * Give a relative tell() - * {@inheritdoc} - */ - public function tell() - { - return $this->stream->tell() - $this->offset; - } - - /** - * Set the offset to start limiting from - * - * @param int $offset Offset to seek to and begin byte limiting from - * - * @throws \RuntimeException if the stream cannot be seeked. - */ - public function setOffset($offset) - { - $current = $this->stream->tell(); - - if ($current !== $offset) { - // If the stream cannot seek to the offset position, then read to it - if ($this->stream->isSeekable()) { - $this->stream->seek($offset); - } elseif ($current > $offset) { - throw new \RuntimeException("Could not seek to stream offset $offset"); - } else { - $this->stream->read($offset - $current); - } - } - - $this->offset = $offset; - } - - /** - * Set the limit of bytes that the decorator allows to be read from the - * stream. - * - * @param int $limit Number of bytes to allow to be read from the stream. - * Use -1 for no limit. - */ - public function setLimit($limit) - { - $this->limit = $limit; - } - - public function read($length) - { - if ($this->limit == -1) { - return $this->stream->read($length); - } - - // Check if the current position is less than the total allowed - // bytes + original offset - $remaining = ($this->offset + $this->limit) - $this->stream->tell(); - if ($remaining > 0) { - // Only return the amount of requested data, ensuring that the byte - // limit is not exceeded - return $this->stream->read(min($remaining, $length)); - } - - return ''; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php deleted file mode 100644 index 516d1cb84ac..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Message.php +++ /dev/null @@ -1,252 +0,0 @@ -getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); - if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); - } - } elseif ($message instanceof ResponseInterface) { - $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') { - foreach ($values as $value) { - $msg .= "\r\n{$name}: " . $value; - } - } else { - $msg .= "\r\n{$name}: " . implode(', ', $values); - } - } - - return "{$msg}\r\n\r\n" . $message->getBody(); - } - - /** - * Get a short summary of the message body. - * - * Will return `null` if the response is not printable. - * - * @param MessageInterface $message The message to get the body summary - * @param int $truncateAt The maximum allowed size of the summary - * - * @return string|null - */ - public static function bodySummary(MessageInterface $message, $truncateAt = 120) - { - $body = $message->getBody(); - - if (!$body->isSeekable() || !$body->isReadable()) { - return null; - } - - $size = $body->getSize(); - - if ($size === 0) { - return null; - } - - $summary = $body->read($truncateAt); - $body->rewind(); - - if ($size > $truncateAt) { - $summary .= ' (truncated...)'; - } - - // 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)) { - return null; - } - - return $summary; - } - - /** - * Attempts to rewind a message body and throws an exception on failure. - * - * The body of the message will only be rewound if a call to `tell()` - * returns a value other than `0`. - * - * @param MessageInterface $message Message to rewind - * - * @throws \RuntimeException - */ - public static function rewindBody(MessageInterface $message) - { - $body = $message->getBody(); - - if ($body->tell()) { - $body->rewind(); - } - } - - /** - * Parses an HTTP message into an associative array. - * - * The array contains the "start-line" key containing the start line of - * the message, "headers" key containing an associative array of header - * array values, and a "body" key containing the body of the message. - * - * @param string $message HTTP request or response to parse. - * - * @return array - */ - public static function parseMessage($message) - { - if (!$message) { - throw new \InvalidArgumentException('Invalid message'); - } - - $message = ltrim($message, "\r\n"); - - $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); - - if ($messageParts === false || count($messageParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); - } - - list($rawHeaders, $body) = $messageParts; - $rawHeaders .= "\r\n"; // Put back the delimiter we split previously - $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); - - if ($headerParts === false || count($headerParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing status line'); - } - - list($startLine, $rawHeaders) = $headerParts; - - if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { - // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 - $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); - } - - /** @var array[] $headerLines */ - $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); - - // If these aren't the same, then one line didn't match and there's an invalid header. - if ($count !== substr_count($rawHeaders, "\n")) { - // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 - if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { - throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); - } - - throw new \InvalidArgumentException('Invalid header syntax'); - } - - $headers = []; - - foreach ($headerLines as $headerLine) { - $headers[$headerLine[1]][] = $headerLine[2]; - } - - return [ - 'start-line' => $startLine, - 'headers' => $headers, - 'body' => $body, - ]; - } - - /** - * Constructs a URI for an HTTP request message. - * - * @param string $path Path from the start-line - * @param array $headers Array of headers (each value an array). - * - * @return string - */ - public static function parseRequestUri($path, array $headers) - { - $hostKey = array_filter(array_keys($headers), function ($k) { - return strtolower($k) === 'host'; - }); - - // If no host is found, then a full URI cannot be constructed. - if (!$hostKey) { - return $path; - } - - $host = $headers[reset($hostKey)][0]; - $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - - return $scheme . '://' . $host . '/' . ltrim($path, '/'); - } - - /** - * Parses a request message string into a request object. - * - * @param string $message Request message string. - * - * @return Request - */ - public static function parseRequest($message) - { - $data = self::parseMessage($message); - $matches = []; - if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { - throw new \InvalidArgumentException('Invalid request string'); - } - $parts = explode(' ', $data['start-line'], 3); - $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; - - $request = new Request( - $parts[0], - $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], - $data['headers'], - $data['body'], - $version - ); - - return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); - } - - /** - * Parses a response message string into a response object. - * - * @param string $message Response message string. - * - * @return Response - */ - public static function parseResponse($message) - { - $data = self::parseMessage($message); - // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space - // 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']); - } - $parts = explode(' ', $data['start-line'], 3); - - return new Response( - (int) $parts[1], - $data['headers'], - $data['body'], - explode('/', $parts[0])[1], - isset($parts[2]) ? $parts[2] : null - ); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php deleted file mode 100644 index 99203bb43a4..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ /dev/null @@ -1,214 +0,0 @@ - array of values */ - private $headers = []; - - /** @var array Map of lowercase header name => original name at registration */ - private $headerNames = []; - - /** @var string */ - private $protocol = '1.1'; - - /** @var StreamInterface|null */ - private $stream; - - public function getProtocolVersion() - { - return $this->protocol; - } - - public function withProtocolVersion($version) - { - if ($this->protocol === $version) { - return $this; - } - - $new = clone $this; - $new->protocol = $version; - return $new; - } - - public function getHeaders() - { - return $this->headers; - } - - public function hasHeader($header) - { - return isset($this->headerNames[strtolower($header)]); - } - - public function getHeader($header) - { - $header = strtolower($header); - - if (!isset($this->headerNames[$header])) { - return []; - } - - $header = $this->headerNames[$header]; - - return $this->headers[$header]; - } - - public function getHeaderLine($header) - { - return implode(', ', $this->getHeader($header)); - } - - public function withHeader($header, $value) - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - unset($new->headers[$new->headerNames[$normalized]]); - } - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - - return $new; - } - - public function withAddedHeader($header, $value) - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $new->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - } - - return $new; - } - - public function withoutHeader($header) - { - $normalized = strtolower($header); - - if (!isset($this->headerNames[$normalized])) { - return $this; - } - - $header = $this->headerNames[$normalized]; - - $new = clone $this; - unset($new->headers[$header], $new->headerNames[$normalized]); - - return $new; - } - - public function getBody() - { - if (!$this->stream) { - $this->stream = Utils::streamFor(''); - } - - return $this->stream; - } - - public function withBody(StreamInterface $body) - { - if ($body === $this->stream) { - return $this; - } - - $new = clone $this; - $new->stream = $body; - return $new; - } - - private function setHeaders(array $headers) - { - $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; - } - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - if (isset($this->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $this->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $this->headerNames[$normalized] = $header; - $this->headers[$header] = $value; - } - } - } - - private function normalizeHeaderValue($value) - { - if (!is_array($value)) { - return $this->trimHeaderValues([$value]); - } - - if (count($value) === 0) { - throw new \InvalidArgumentException('Header value can not be an empty array.'); - } - - return $this->trimHeaderValues($value); - } - - /** - * Trims whitespace from the header values. - * - * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. - * - * header-field = field-name ":" OWS field-value OWS - * OWS = *( SP / HTAB ) - * - * @param string[] $values Header values - * - * @return string[] Trimmed header values - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 - */ - private function trimHeaderValues(array $values) - { - return array_map(function ($value) { - if (!is_scalar($value) && null !== $value) { - throw new \InvalidArgumentException(sprintf( - 'Header value must be scalar or null but %s provided.', - is_object($value) ? get_class($value) : gettype($value) - )); - } - - return trim((string) $value, " \t"); - }, array_values($values)); - } - - private function assertHeader($header) - { - if (!is_string($header)) { - throw new \InvalidArgumentException(sprintf( - 'Header name must be a string but %s provided.', - is_object($header) ? get_class($header) : gettype($header) - )); - } - - if ($header === '') { - throw new \InvalidArgumentException('Header name can not be empty.'); - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php deleted file mode 100644 index 205c7b1fa67..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/MimeType.php +++ /dev/null @@ -1,140 +0,0 @@ - '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', - ]; - - $extension = strtolower($extension); - - return isset($mimetypes[$extension]) - ? $mimetypes[$extension] - : null; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php deleted file mode 100644 index 5a6079a89f5..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ /dev/null @@ -1,158 +0,0 @@ -boundary = $boundary ?: sha1(uniqid('', true)); - $this->stream = $this->createStream($elements); - } - - /** - * Get the boundary - * - * @return string - */ - public function getBoundary() - { - return $this->boundary; - } - - public function isWritable() - { - return false; - } - - /** - * Get the headers needed before transferring the content of a POST file - */ - private function getHeaders(array $headers) - { - $str = ''; - foreach ($headers as $key => $value) { - $str .= "{$key}: {$value}\r\n"; - } - - return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; - } - - /** - * Create the aggregate stream that will be used to upload the POST data - */ - protected function createStream(array $elements) - { - $stream = new AppendStream(); - - foreach ($elements as $element) { - $this->addElement($stream, $element); - } - - // Add the trailing boundary with CRLF - $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); - - return $stream; - } - - private function addElement(AppendStream $stream, array $element) - { - foreach (['contents', 'name'] as $key) { - if (!array_key_exists($key, $element)) { - throw new \InvalidArgumentException("A '{$key}' key is required"); - } - } - - $element['contents'] = Utils::streamFor($element['contents']); - - if (empty($element['filename'])) { - $uri = $element['contents']->getMetadata('uri'); - if (substr($uri, 0, 6) !== 'php://') { - $element['filename'] = $uri; - } - } - - list($body, $headers) = $this->createElement( - $element['name'], - $element['contents'], - isset($element['filename']) ? $element['filename'] : null, - isset($element['headers']) ? $element['headers'] : [] - ); - - $stream->addStream(Utils::streamFor($this->getHeaders($headers))); - $stream->addStream($body); - $stream->addStream(Utils::streamFor("\r\n")); - } - - /** - * @return array - */ - private function createElement($name, StreamInterface $stream, $filename, array $headers) - { - // Set a default content-disposition header if one was no provided - $disposition = $this->getHeader($headers, 'content-disposition'); - if (!$disposition) { - $headers['Content-Disposition'] = ($filename === '0' || $filename) - ? sprintf( - 'form-data; name="%s"; filename="%s"', - $name, - basename($filename) - ) - : "form-data; name=\"{$name}\""; - } - - // Set a default content-length header if one was no provided - $length = $this->getHeader($headers, 'content-length'); - if (!$length) { - if ($length = $stream->getSize()) { - $headers['Content-Length'] = (string) $length; - } - } - - // 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; - } - } - - return [$stream, $headers]; - } - - private function getHeader(array $headers, $key) - { - $lowercaseHeader = strtolower($key); - foreach ($headers as $k => $v) { - if (strtolower($k) === $lowercaseHeader) { - return $v; - } - } - - return null; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php deleted file mode 100644 index d66bdde4602..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ /dev/null @@ -1,25 +0,0 @@ -source = $source; - $this->size = isset($options['size']) ? $options['size'] : null; - $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; - $this->buffer = new BufferStream(); - } - - public function __toString() - { - try { - return Utils::copyToString($this); - } catch (\Exception $e) { - return ''; - } - } - - public function close() - { - $this->detach(); - } - - public function detach() - { - $this->tellPos = false; - $this->source = null; - - return null; - } - - public function getSize() - { - return $this->size; - } - - public function tell() - { - return $this->tellPos; - } - - public function eof() - { - return !$this->source; - } - - public function isSeekable() - { - return false; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - throw new \RuntimeException('Cannot seek a PumpStream'); - } - - public function isWritable() - { - return false; - } - - public function write($string) - { - throw new \RuntimeException('Cannot write to a PumpStream'); - } - - public function isReadable() - { - return true; - } - - public function read($length) - { - $data = $this->buffer->read($length); - $readLen = strlen($data); - $this->tellPos += $readLen; - $remaining = $length - $readLen; - - if ($remaining) { - $this->pump($remaining); - $data .= $this->buffer->read($remaining); - $this->tellPos += strlen($data) - $readLen; - } - - return $data; - } - - public function getContents() - { - $result = ''; - while (!$this->eof()) { - $result .= $this->read(1000000); - } - - return $result; - } - - public function getMetadata($key = null) - { - if (!$key) { - return $this->metadata; - } - - return isset($this->metadata[$key]) ? $this->metadata[$key] : null; - } - - private function pump($length) - { - if ($this->source) { - do { - $data = call_user_func($this->source, $length); - if ($data === false || $data === null) { - $this->source = null; - return; - } - $this->buffer->write($data); - $length -= strlen($data); - } while ($length > 0); - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php deleted file mode 100644 index 5a7cc0359ed..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Query.php +++ /dev/null @@ -1,113 +0,0 @@ - '1', 'foo[b]' => '2'])`. - * - * @param string $str Query string to parse - * @param int|bool $urlEncoding How the query string is encoded - * - * @return array - */ - public static function parse($str, $urlEncoding = true) - { - $result = []; - - if ($str === '') { - return $result; - } - - if ($urlEncoding === true) { - $decoder = function ($value) { - return rawurldecode(str_replace('+', ' ', $value)); - }; - } elseif ($urlEncoding === PHP_QUERY_RFC3986) { - $decoder = 'rawurldecode'; - } elseif ($urlEncoding === PHP_QUERY_RFC1738) { - $decoder = 'urldecode'; - } else { - $decoder = function ($str) { - return $str; - }; - } - - foreach (explode('&', $str) as $kvp) { - $parts = explode('=', $kvp, 2); - $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; - if (!isset($result[$key])) { - $result[$key] = $value; - } else { - if (!is_array($result[$key])) { - $result[$key] = [$result[$key]]; - } - $result[$key][] = $value; - } - } - - return $result; - } - - /** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse()` to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like `http_build_query()` would). - * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. - * - * @return string - */ - public static function build(array $params, $encoding = PHP_QUERY_RFC3986) - { - if (!$params) { - return ''; - } - - if ($encoding === false) { - $encoder = function ($str) { - return $str; - }; - } elseif ($encoding === PHP_QUERY_RFC3986) { - $encoder = 'rawurlencode'; - } elseif ($encoding === PHP_QUERY_RFC1738) { - $encoder = 'urlencode'; - } else { - throw new \InvalidArgumentException('Invalid type'); - } - - $qs = ''; - foreach ($params as $k => $v) { - $k = $encoder($k); - if (!is_array($v)) { - $qs .= $k; - if ($v !== null) { - $qs .= '=' . $encoder($v); - } - $qs .= '&'; - } else { - foreach ($v as $vv) { - $qs .= $k; - if ($vv !== null) { - $qs .= '=' . $encoder($vv); - } - $qs .= '&'; - } - } - } - - return $qs ? (string) substr($qs, 0, -1) : ''; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php deleted file mode 100644 index c1cdaebff80..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Request.php +++ /dev/null @@ -1,152 +0,0 @@ -assertMethod($method); - if (!($uri instanceof UriInterface)) { - $uri = new Uri($uri); - } - - $this->method = strtoupper($method); - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $version; - - if (!isset($this->headerNames['host'])) { - $this->updateHostFromUri(); - } - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - } - - public function getRequestTarget() - { - if ($this->requestTarget !== null) { - return $this->requestTarget; - } - - $target = $this->uri->getPath(); - if ($target == '') { - $target = '/'; - } - if ($this->uri->getQuery() != '') { - $target .= '?' . $this->uri->getQuery(); - } - - return $target; - } - - public function withRequestTarget($requestTarget) - { - if (preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; cannot contain whitespace' - ); - } - - $new = clone $this; - $new->requestTarget = $requestTarget; - return $new; - } - - public function getMethod() - { - return $this->method; - } - - public function withMethod($method) - { - $this->assertMethod($method); - $new = clone $this; - $new->method = strtoupper($method); - return $new; - } - - public function getUri() - { - return $this->uri; - } - - public function withUri(UriInterface $uri, $preserveHost = false) - { - if ($uri === $this->uri) { - return $this; - } - - $new = clone $this; - $new->uri = $uri; - - if (!$preserveHost || !isset($this->headerNames['host'])) { - $new->updateHostFromUri(); - } - - return $new; - } - - private function updateHostFromUri() - { - $host = $this->uri->getHost(); - - if ($host == '') { - return; - } - - if (($port = $this->uri->getPort()) !== null) { - $host .= ':' . $port; - } - - if (isset($this->headerNames['host'])) { - $header = $this->headerNames['host']; - } else { - $header = 'Host'; - $this->headerNames['host'] = 'Host'; - } - // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 - $this->headers = [$header => [$host]] + $this->headers; - } - - private function assertMethod($method) - { - if (!is_string($method) || $method === '') { - throw new \InvalidArgumentException('Method must be a non-empty string.'); - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php deleted file mode 100644 index 8c01a0f5a43..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Response.php +++ /dev/null @@ -1,155 +0,0 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-status', - 208 => 'Already Reported', - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => 'Switch Proxy', - 307 => 'Temporary Redirect', - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Time-out', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Large', - 415 => 'Unsupported Media Type', - 416 => 'Requested range not satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 425 => 'Unordered Collection', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 451 => 'Unavailable For Legal Reasons', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Time-out', - 505 => 'HTTP Version not supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', - 508 => 'Loop Detected', - 511 => 'Network Authentication Required', - ]; - - /** @var string */ - private $reasonPhrase = ''; - - /** @var int */ - private $statusCode = 200; - - /** - * @param int $status Status code - * @param array $headers Response headers - * @param string|resource|StreamInterface|null $body Response body - * @param string $version Protocol version - * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) - */ - public function __construct( - $status = 200, - array $headers = [], - $body = null, - $version = '1.1', - $reason = null - ) { - $this->assertStatusCodeIsInteger($status); - $status = (int) $status; - $this->assertStatusCodeRange($status); - - $this->statusCode = $status; - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - - $this->setHeaders($headers); - if ($reason == '' && isset(self::$phrases[$this->statusCode])) { - $this->reasonPhrase = self::$phrases[$this->statusCode]; - } else { - $this->reasonPhrase = (string) $reason; - } - - $this->protocol = $version; - } - - public function getStatusCode() - { - return $this->statusCode; - } - - public function getReasonPhrase() - { - return $this->reasonPhrase; - } - - public function withStatus($code, $reasonPhrase = '') - { - $this->assertStatusCodeIsInteger($code); - $code = (int) $code; - $this->assertStatusCodeRange($code); - - $new = clone $this; - $new->statusCode = $code; - if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { - $reasonPhrase = self::$phrases[$new->statusCode]; - } - $new->reasonPhrase = (string) $reasonPhrase; - return $new; - } - - private function assertStatusCodeIsInteger($statusCode) - { - if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { - throw new \InvalidArgumentException('Status code must be an integer value.'); - } - } - - private function assertStatusCodeRange($statusCode) - { - if ($statusCode < 100 || $statusCode >= 600) { - throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php deleted file mode 100644 index 51b571f24de..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ /dev/null @@ -1,19 +0,0 @@ -@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; - const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php deleted file mode 100644 index e6d26f5ff9a..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ /dev/null @@ -1,379 +0,0 @@ -serverParams = $serverParams; - - parent::__construct($method, $uri, $headers, $body, $version); - } - - /** - * Return an UploadedFile instance array. - * - * @param array $files A array which respect $_FILES structure - * - * @return array - * - * @throws InvalidArgumentException for unrecognized values - */ - public static function normalizeFiles(array $files) - { - $normalized = []; - - foreach ($files as $key => $value) { - if ($value instanceof UploadedFileInterface) { - $normalized[$key] = $value; - } elseif (is_array($value) && isset($value['tmp_name'])) { - $normalized[$key] = self::createUploadedFileFromSpec($value); - } elseif (is_array($value)) { - $normalized[$key] = self::normalizeFiles($value); - continue; - } else { - throw new InvalidArgumentException('Invalid value in files specification'); - } - } - - return $normalized; - } - - /** - * Create and return an UploadedFile instance from a $_FILES specification. - * - * If the specification represents an array of values, this method will - * delegate to normalizeNestedFileSpec() and return that return value. - * - * @param array $value $_FILES struct - * - * @return array|UploadedFileInterface - */ - private static function createUploadedFileFromSpec(array $value) - { - if (is_array($value['tmp_name'])) { - return self::normalizeNestedFileSpec($value); - } - - return new UploadedFile( - $value['tmp_name'], - (int) $value['size'], - (int) $value['error'], - $value['name'], - $value['type'] - ); - } - - /** - * Normalize an array of file specifications. - * - * Loops through all nested files and returns a normalized array of - * UploadedFileInterface instances. - * - * @param array $files - * - * @return UploadedFileInterface[] - */ - private static function normalizeNestedFileSpec(array $files = []) - { - $normalizedFiles = []; - - 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], - ]; - $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); - } - - return $normalizedFiles; - } - - /** - * Return a ServerRequest populated with superglobals: - * $_GET - * $_POST - * $_COOKIE - * $_FILES - * $_SERVER - * - * @return ServerRequestInterface - */ - public static function fromGlobals() - { - $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; - $headers = getallheaders(); - $uri = self::getUriFromGlobals(); - $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); - $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; - - $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); - - return $serverRequest - ->withCookieParams($_COOKIE) - ->withQueryParams($_GET) - ->withParsedBody($_POST) - ->withUploadedFiles(self::normalizeFiles($_FILES)); - } - - private static function extractHostAndPortFromAuthority($authority) - { - $uri = 'http://' . $authority; - $parts = parse_url($uri); - if (false === $parts) { - return [null, null]; - } - - $host = isset($parts['host']) ? $parts['host'] : null; - $port = isset($parts['port']) ? $parts['port'] : null; - - return [$host, $port]; - } - - /** - * Get a Uri populated with values from $_SERVER. - * - * @return UriInterface - */ - public static function getUriFromGlobals() - { - $uri = new Uri(''); - - $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); - - $hasPort = false; - if (isset($_SERVER['HTTP_HOST'])) { - list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); - if ($host !== null) { - $uri = $uri->withHost($host); - } - - if ($port !== null) { - $hasPort = true; - $uri = $uri->withPort($port); - } - } elseif (isset($_SERVER['SERVER_NAME'])) { - $uri = $uri->withHost($_SERVER['SERVER_NAME']); - } elseif (isset($_SERVER['SERVER_ADDR'])) { - $uri = $uri->withHost($_SERVER['SERVER_ADDR']); - } - - if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { - $uri = $uri->withPort($_SERVER['SERVER_PORT']); - } - - $hasQuery = false; - if (isset($_SERVER['REQUEST_URI'])) { - $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); - $uri = $uri->withPath($requestUriParts[0]); - if (isset($requestUriParts[1])) { - $hasQuery = true; - $uri = $uri->withQuery($requestUriParts[1]); - } - } - - if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { - $uri = $uri->withQuery($_SERVER['QUERY_STRING']); - } - - return $uri; - } - - /** - * {@inheritdoc} - */ - public function getServerParams() - { - return $this->serverParams; - } - - /** - * {@inheritdoc} - */ - public function getUploadedFiles() - { - return $this->uploadedFiles; - } - - /** - * {@inheritdoc} - */ - public function withUploadedFiles(array $uploadedFiles) - { - $new = clone $this; - $new->uploadedFiles = $uploadedFiles; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getCookieParams() - { - return $this->cookieParams; - } - - /** - * {@inheritdoc} - */ - public function withCookieParams(array $cookies) - { - $new = clone $this; - $new->cookieParams = $cookies; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getQueryParams() - { - return $this->queryParams; - } - - /** - * {@inheritdoc} - */ - public function withQueryParams(array $query) - { - $new = clone $this; - $new->queryParams = $query; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getParsedBody() - { - return $this->parsedBody; - } - - /** - * {@inheritdoc} - */ - public function withParsedBody($data) - { - $new = clone $this; - $new->parsedBody = $data; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * {@inheritdoc} - */ - public function getAttribute($attribute, $default = null) - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $default; - } - - return $this->attributes[$attribute]; - } - - /** - * {@inheritdoc} - */ - public function withAttribute($attribute, $value) - { - $new = clone $this; - $new->attributes[$attribute] = $value; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function withoutAttribute($attribute) - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $this; - } - - $new = clone $this; - unset($new->attributes[$attribute]); - - return $new; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php deleted file mode 100644 index 3865d6d6a13..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Stream.php +++ /dev/null @@ -1,270 +0,0 @@ -size = $options['size']; - } - - $this->customMetadata = isset($options['metadata']) - ? $options['metadata'] - : []; - - $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->uri = $this->getMetadata('uri'); - } - - /** - * Closes the stream when the destructed - */ - public function __destruct() - { - $this->close(); - } - - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } catch (\Exception $e) { - return ''; - } - } - - public function getContents() - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - $contents = stream_get_contents($this->stream); - - if ($contents === false) { - throw new \RuntimeException('Unable to read stream contents'); - } - - return $contents; - } - - public function close() - { - if (isset($this->stream)) { - if (is_resource($this->stream)) { - fclose($this->stream); - } - $this->detach(); - } - } - - public function detach() - { - if (!isset($this->stream)) { - return null; - } - - $result = $this->stream; - unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - public function getSize() - { - if ($this->size !== null) { - return $this->size; - } - - if (!isset($this->stream)) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($this->uri) { - clearstatcache(true, $this->uri); - } - - $stats = fstat($this->stream); - if (isset($stats['size'])) { - $this->size = $stats['size']; - return $this->size; - } - - return null; - } - - public function isReadable() - { - return $this->readable; - } - - public function isWritable() - { - return $this->writable; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function eof() - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - return feof($this->stream); - } - - public function tell() - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - $result = ftell($this->stream); - - if ($result === false) { - throw new \RuntimeException('Unable to determine stream position'); - } - - return $result; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - $whence = (int) $whence; - - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->seekable) { - throw new \RuntimeException('Stream is not seekable'); - } - if (fseek($this->stream, $offset, $whence) === -1) { - throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); - } - } - - public function read($length) - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - if ($length < 0) { - throw new \RuntimeException('Length parameter cannot be negative'); - } - - if (0 === $length) { - return ''; - } - - $string = fread($this->stream, $length); - if (false === $string) { - throw new \RuntimeException('Unable to read from stream'); - } - - return $string; - } - - public function write($string) - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->writable) { - throw new \RuntimeException('Cannot write to a non-writable stream'); - } - - // We can't know the size after writing anything - $this->size = null; - $result = fwrite($this->stream, $string); - - if ($result === false) { - throw new \RuntimeException('Unable to write to stream'); - } - - return $result; - } - - public function getMetadata($key = null) - { - if (!isset($this->stream)) { - return $key ? null : []; - } elseif (!$key) { - return $this->customMetadata + stream_get_meta_data($this->stream); - } elseif (isset($this->customMetadata[$key])) { - return $this->customMetadata[$key]; - } - - $meta = stream_get_meta_data($this->stream); - - return isset($meta[$key]) ? $meta[$key] : null; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php deleted file mode 100644 index 5025dd67b8a..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ /dev/null @@ -1,152 +0,0 @@ -stream = $stream; - } - - /** - * Magic method used to create a new stream if streams are not added in - * the constructor of a decorator (e.g., LazyOpenStream). - * - * @param string $name Name of the property (allows "stream" only). - * - * @return StreamInterface - */ - public function __get($name) - { - if ($name == 'stream') { - $this->stream = $this->createStream(); - return $this->stream; - } - - throw new \UnexpectedValueException("$name not found on class"); - } - - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } catch (\Exception $e) { - // Really, PHP? https://bugs.php.net/bug.php?id=53648 - trigger_error('StreamDecorator::__toString exception: ' - . (string) $e, E_USER_ERROR); - return ''; - } - } - - public function getContents() - { - return Utils::copyToString($this); - } - - /** - * Allow decorators to implement custom methods - * - * @param string $method Missing method name - * @param array $args Method arguments - * - * @return mixed - */ - public function __call($method, array $args) - { - $result = call_user_func_array([$this->stream, $method], $args); - - // Always return the wrapped object if the result is a return $this - return $result === $this->stream ? $this : $result; - } - - public function close() - { - $this->stream->close(); - } - - public function getMetadata($key = null) - { - return $this->stream->getMetadata($key); - } - - public function detach() - { - return $this->stream->detach(); - } - - public function getSize() - { - return $this->stream->getSize(); - } - - public function eof() - { - return $this->stream->eof(); - } - - public function tell() - { - return $this->stream->tell(); - } - - public function isReadable() - { - return $this->stream->isReadable(); - } - - public function isWritable() - { - return $this->stream->isWritable(); - } - - public function isSeekable() - { - return $this->stream->isSeekable(); - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - $this->stream->seek($offset, $whence); - } - - public function read($length) - { - return $this->stream->read($length); - } - - public function write($string) - { - return $this->stream->write($string); - } - - /** - * Implement in subclasses to dynamically create streams when requested. - * - * @return StreamInterface - * - * @throws \BadMethodCallException - */ - protected function createStream() - { - throw new \BadMethodCallException('Not implemented'); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php deleted file mode 100644 index fc7cb969bd2..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ /dev/null @@ -1,165 +0,0 @@ -isReadable()) { - $mode = $stream->isWritable() ? 'r+' : 'r'; - } elseif ($stream->isWritable()) { - $mode = 'w'; - } else { - throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); - } - - return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); - } - - /** - * Creates a stream context that can be used to open a stream as a php stream resource. - * - * @param StreamInterface $stream - * - * @return resource - */ - public static function createStreamContext(StreamInterface $stream) - { - return stream_context_create([ - 'guzzle' => ['stream' => $stream] - ]); - } - - /** - * Registers the stream wrapper if needed - */ - public static function register() - { - if (!in_array('guzzle', stream_get_wrappers())) { - stream_wrapper_register('guzzle', __CLASS__); - } - } - - public function stream_open($path, $mode, $options, &$opened_path) - { - $options = stream_context_get_options($this->context); - - if (!isset($options['guzzle']['stream'])) { - return false; - } - - $this->mode = $mode; - $this->stream = $options['guzzle']['stream']; - - return true; - } - - public function stream_read($count) - { - return $this->stream->read($count); - } - - public function stream_write($data) - { - return (int) $this->stream->write($data); - } - - public function stream_tell() - { - return $this->stream->tell(); - } - - public function stream_eof() - { - return $this->stream->eof(); - } - - public function stream_seek($offset, $whence) - { - $this->stream->seek($offset, $whence); - - return true; - } - - public function stream_cast($cast_as) - { - $stream = clone($this->stream); - - return $stream->detach(); - } - - public function stream_stat() - { - static $modeMap = [ - 'r' => 33060, - 'rb' => 33060, - 'r+' => 33206, - '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, - 'blksize' => 0, - 'blocks' => 0 - ]; - } - - public function url_stat($path, $flags) - { - return [ - '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 - ]; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php deleted file mode 100644 index bf342c4de3b..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ /dev/null @@ -1,328 +0,0 @@ -setError($errorStatus); - $this->setSize($size); - $this->setClientFilename($clientFilename); - $this->setClientMediaType($clientMediaType); - - if ($this->isOk()) { - $this->setStreamOrFile($streamOrFile); - } - } - - /** - * Depending on the value set file or stream variable - * - * @param mixed $streamOrFile - * - * @throws InvalidArgumentException - */ - private function setStreamOrFile($streamOrFile) - { - if (is_string($streamOrFile)) { - $this->file = $streamOrFile; - } elseif (is_resource($streamOrFile)) { - $this->stream = new Stream($streamOrFile); - } elseif ($streamOrFile instanceof StreamInterface) { - $this->stream = $streamOrFile; - } else { - throw new InvalidArgumentException( - 'Invalid stream or file provided for UploadedFile' - ); - } - } - - /** - * @param int $error - * - * @throws InvalidArgumentException - */ - private function setError($error) - { - if (false === is_int($error)) { - throw new InvalidArgumentException( - 'Upload file error status must be an integer' - ); - } - - if (false === in_array($error, UploadedFile::$errors)) { - throw new InvalidArgumentException( - 'Invalid error status for UploadedFile' - ); - } - - $this->error = $error; - } - - /** - * @param int $size - * - * @throws InvalidArgumentException - */ - private function setSize($size) - { - if (false === is_int($size)) { - throw new InvalidArgumentException( - 'Upload file size must be an integer' - ); - } - - $this->size = $size; - } - - /** - * @param mixed $param - * - * @return bool - */ - private function isStringOrNull($param) - { - return in_array(gettype($param), ['string', 'NULL']); - } - - /** - * @param mixed $param - * - * @return bool - */ - private function isStringNotEmpty($param) - { - return is_string($param) && false === empty($param); - } - - /** - * @param string|null $clientFilename - * - * @throws InvalidArgumentException - */ - private function setClientFilename($clientFilename) - { - if (false === $this->isStringOrNull($clientFilename)) { - throw new InvalidArgumentException( - 'Upload file client filename must be a string or null' - ); - } - - $this->clientFilename = $clientFilename; - } - - /** - * @param string|null $clientMediaType - * - * @throws InvalidArgumentException - */ - private function setClientMediaType($clientMediaType) - { - if (false === $this->isStringOrNull($clientMediaType)) { - throw new InvalidArgumentException( - 'Upload file client media type must be a string or null' - ); - } - - $this->clientMediaType = $clientMediaType; - } - - /** - * Return true if there is no upload error - * - * @return bool - */ - private function isOk() - { - return $this->error === UPLOAD_ERR_OK; - } - - /** - * @return bool - */ - public function isMoved() - { - return $this->moved; - } - - /** - * @throws RuntimeException if is moved or not ok - */ - private function validateActive() - { - if (false === $this->isOk()) { - throw new RuntimeException('Cannot retrieve stream due to upload error'); - } - - if ($this->isMoved()) { - throw new RuntimeException('Cannot retrieve stream after it has already been moved'); - } - } - - /** - * {@inheritdoc} - * - * @throws RuntimeException if the upload was not successful. - */ - public function getStream() - { - $this->validateActive(); - - if ($this->stream instanceof StreamInterface) { - return $this->stream; - } - - return new LazyOpenStream($this->file, 'r+'); - } - - /** - * {@inheritdoc} - * - * @see http://php.net/is_uploaded_file - * @see http://php.net/move_uploaded_file - * - * @param string $targetPath Path to which to move the uploaded file. - * - * @throws RuntimeException if the upload was not successful. - * @throws InvalidArgumentException if the $path specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. - */ - public function moveTo($targetPath) - { - $this->validateActive(); - - if (false === $this->isStringNotEmpty($targetPath)) { - throw new InvalidArgumentException( - 'Invalid path provided for move operation; must be a non-empty string' - ); - } - - if ($this->file) { - $this->moved = php_sapi_name() == 'cli' - ? rename($this->file, $targetPath) - : move_uploaded_file($this->file, $targetPath); - } else { - Utils::copyToStream( - $this->getStream(), - new LazyOpenStream($targetPath, 'w') - ); - - $this->moved = true; - } - - if (false === $this->moved) { - throw new RuntimeException( - sprintf('Uploaded file could not be moved to %s', $targetPath) - ); - } - } - - /** - * {@inheritdoc} - * - * @return int|null The file size in bytes or null if unknown. - */ - public function getSize() - { - return $this->size; - } - - /** - * {@inheritdoc} - * - * @see http://php.net/manual/en/features.file-upload.errors.php - * - * @return int One of PHP's UPLOAD_ERR_XXX constants. - */ - public function getError() - { - return $this->error; - } - - /** - * {@inheritdoc} - * - * @return string|null The filename sent by the client or null if none - * was provided. - */ - public function getClientFilename() - { - return $this->clientFilename; - } - - /** - * {@inheritdoc} - */ - public function getClientMediaType() - { - return $this->clientMediaType; - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php deleted file mode 100644 index 0f9f020d3ca..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Uri.php +++ /dev/null @@ -1,810 +0,0 @@ - 80, - 'https' => 443, - 'ftp' => 21, - 'gopher' => 70, - 'nntp' => 119, - 'news' => 119, - 'telnet' => 23, - 'tn3270' => 23, - 'imap' => 143, - 'pop' => 110, - 'ldap' => 389, - ]; - - private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; - private static $charSubDelims = '!\$&\'\(\)\*\+,;='; - private static $replaceQuery = ['=' => '%3D', '&' => '%26']; - - /** @var string Uri scheme. */ - private $scheme = ''; - - /** @var string Uri user info. */ - private $userInfo = ''; - - /** @var string Uri host. */ - private $host = ''; - - /** @var int|null Uri port. */ - private $port; - - /** @var string Uri path. */ - private $path = ''; - - /** @var string Uri query string. */ - private $query = ''; - - /** @var string Uri fragment. */ - private $fragment = ''; - - /** - * @param string $uri URI to parse - */ - public function __construct($uri = '') - { - // weak type check to also accept null until we can add scalar type hints - if ($uri != '') { - $parts = self::parse($uri); - if ($parts === false) { - throw new \InvalidArgumentException("Unable to parse URI: $uri"); - } - $this->applyParts($parts); - } - } - - /** - * UTF-8 aware \parse_url() replacement. - * - * The internal function produces broken output for non ASCII domain names - * (IDN) when used with locales other than "C". - * - * On the other hand, cURL understands IDN correctly only when UTF-8 locale - * is configured ("C.UTF-8", "en_US.UTF-8", etc.). - * - * @see https://bugs.php.net/bug.php?id=52923 - * @see https://www.php.net/manual/en/function.parse-url.php#114817 - * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING - * - * @param string $url - * - * @return array|false - */ - private static function parse($url) - { - // If IPv6 - $prefix = ''; - if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { - $prefix = $matches[1]; - $url = $matches[2]; - } - - $encodedUrl = preg_replace_callback( - '%[^:/@?&=#]+%usD', - static function ($matches) { - return urlencode($matches[0]); - }, - $url - ); - - $result = parse_url($prefix . $encodedUrl); - - if ($result === false) { - return false; - } - - return array_map('urldecode', $result); - } - - public function __toString() - { - return self::composeComponents( - $this->scheme, - $this->getAuthority(), - $this->path, - $this->query, - $this->fragment - ); - } - - /** - * Composes a URI reference string from its various components. - * - * Usually this method does not need to be called manually but instead is used indirectly via - * `Psr\Http\Message\UriInterface::__toString`. - * - * PSR-7 UriInterface treats an empty component the same as a missing component as - * getQuery(), getFragment() etc. always return a string. This explains the slight - * difference to RFC 3986 Section 5.3. - * - * Another adjustment is that the authority separator is added even when the authority is missing/empty - * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with - * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But - * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to - * that format). - * - * @param string $scheme - * @param string $authority - * @param string $path - * @param string $query - * @param string $fragment - * - * @return string - * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 - */ - public static function composeComponents($scheme, $authority, $path, $query, $fragment) - { - $uri = ''; - - // weak type checks to also accept null until we can add scalar type hints - if ($scheme != '') { - $uri .= $scheme . ':'; - } - - if ($authority != ''|| $scheme === 'file') { - $uri .= '//' . $authority; - } - - $uri .= $path; - - if ($query != '') { - $uri .= '?' . $query; - } - - if ($fragment != '') { - $uri .= '#' . $fragment; - } - - return $uri; - } - - /** - * Whether the URI has the default port of the current scheme. - * - * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used - * independently of the implementation. - * - * @param UriInterface $uri - * - * @return bool - */ - public static function isDefaultPort(UriInterface $uri) - { - return $uri->getPort() === null - || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); - } - - /** - * Whether the URI is absolute, i.e. it has a scheme. - * - * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true - * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative - * to another URI, the base URI. Relative references can be divided into several forms: - * - network-path references, e.g. '//example.com/path' - * - absolute-path references, e.g. '/path' - * - relative-path references, e.g. 'subpath' - * - * @param UriInterface $uri - * - * @return bool - * - * @see Uri::isNetworkPathReference - * @see Uri::isAbsolutePathReference - * @see Uri::isRelativePathReference - * @link https://tools.ietf.org/html/rfc3986#section-4 - */ - public static function isAbsolute(UriInterface $uri) - { - return $uri->getScheme() !== ''; - } - - /** - * Whether the URI is a network-path reference. - * - * A relative reference that begins with two slash characters is termed an network-path reference. - * - * @param UriInterface $uri - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isNetworkPathReference(UriInterface $uri) - { - return $uri->getScheme() === '' && $uri->getAuthority() !== ''; - } - - /** - * Whether the URI is a absolute-path reference. - * - * A relative reference that begins with a single slash character is termed an absolute-path reference. - * - * @param UriInterface $uri - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isAbsolutePathReference(UriInterface $uri) - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && isset($uri->getPath()[0]) - && $uri->getPath()[0] === '/'; - } - - /** - * Whether the URI is a relative-path reference. - * - * A relative reference that does not begin with a slash character is termed a relative-path reference. - * - * @param UriInterface $uri - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isRelativePathReference(UriInterface $uri) - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); - } - - /** - * Whether the URI is a same-document reference. - * - * A same-document reference refers to a URI that is, aside from its fragment - * component, identical to the base URI. When no base URI is given, only an empty - * URI reference (apart from its fragment) is considered a same-document reference. - * - * @param UriInterface $uri The URI to check - * @param UriInterface|null $base An optional base URI to compare against - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.4 - */ - public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) - { - if ($base !== null) { - $uri = UriResolver::resolve($base, $uri); - - return ($uri->getScheme() === $base->getScheme()) - && ($uri->getAuthority() === $base->getAuthority()) - && ($uri->getPath() === $base->getPath()) - && ($uri->getQuery() === $base->getQuery()); - } - - return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; - } - - /** - * Removes dot segments from a path and returns the new path. - * - * @param string $path - * - * @return string - * - * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. - * @see UriResolver::removeDotSegments - */ - public static function removeDotSegments($path) - { - return UriResolver::removeDotSegments($path); - } - - /** - * Converts the relative URI into a new URI that is resolved against the base URI. - * - * @param UriInterface $base Base URI - * @param string|UriInterface $rel Relative URI - * - * @return UriInterface - * - * @deprecated since version 1.4. Use UriResolver::resolve instead. - * @see UriResolver::resolve - */ - public static function resolve(UriInterface $base, $rel) - { - if (!($rel instanceof UriInterface)) { - $rel = new self($rel); - } - - return UriResolver::resolve($base, $rel); - } - - /** - * Creates a new URI with a specific query string value removed. - * - * Any existing query string values that exactly match the provided key are - * removed. - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Query string key to remove. - * - * @return UriInterface - */ - public static function withoutQueryValue(UriInterface $uri, $key) - { - $result = self::getFilteredQueryString($uri, [$key]); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with a specific query string value. - * - * Any existing query string values that exactly match the provided key are - * removed and replaced with the given key value pair. - * - * A value of null will set the query string key without a value, e.g. "key" - * instead of "key=value". - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Key to set. - * @param string|null $value Value to set - * - * @return UriInterface - */ - public static function withQueryValue(UriInterface $uri, $key, $value) - { - $result = self::getFilteredQueryString($uri, [$key]); - - $result[] = self::generateQueryString($key, $value); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with multiple specific query string values. - * - * It has the same behavior as withQueryValue() but for an associative array of key => value. - * - * @param UriInterface $uri URI to use as a base. - * @param array $keyValueArray Associative array of key and values - * - * @return UriInterface - */ - public static function withQueryValues(UriInterface $uri, array $keyValueArray) - { - $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); - - foreach ($keyValueArray as $key => $value) { - $result[] = self::generateQueryString($key, $value); - } - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a URI from a hash of `parse_url` components. - * - * @param array $parts - * - * @return UriInterface - * - * @link http://php.net/manual/en/function.parse-url.php - * - * @throws \InvalidArgumentException If the components do not form a valid URI. - */ - public static function fromParts(array $parts) - { - $uri = new self(); - $uri->applyParts($parts); - $uri->validateState(); - - return $uri; - } - - public function getScheme() - { - return $this->scheme; - } - - public function getAuthority() - { - $authority = $this->host; - if ($this->userInfo !== '') { - $authority = $this->userInfo . '@' . $authority; - } - - if ($this->port !== null) { - $authority .= ':' . $this->port; - } - - return $authority; - } - - public function getUserInfo() - { - return $this->userInfo; - } - - public function getHost() - { - return $this->host; - } - - public function getPort() - { - return $this->port; - } - - public function getPath() - { - return $this->path; - } - - public function getQuery() - { - return $this->query; - } - - public function getFragment() - { - return $this->fragment; - } - - public function withScheme($scheme) - { - $scheme = $this->filterScheme($scheme); - - if ($this->scheme === $scheme) { - return $this; - } - - $new = clone $this; - $new->scheme = $scheme; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withUserInfo($user, $password = null) - { - $info = $this->filterUserInfoComponent($user); - if ($password !== null) { - $info .= ':' . $this->filterUserInfoComponent($password); - } - - if ($this->userInfo === $info) { - return $this; - } - - $new = clone $this; - $new->userInfo = $info; - $new->validateState(); - - return $new; - } - - public function withHost($host) - { - $host = $this->filterHost($host); - - if ($this->host === $host) { - return $this; - } - - $new = clone $this; - $new->host = $host; - $new->validateState(); - - return $new; - } - - public function withPort($port) - { - $port = $this->filterPort($port); - - if ($this->port === $port) { - return $this; - } - - $new = clone $this; - $new->port = $port; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withPath($path) - { - $path = $this->filterPath($path); - - if ($this->path === $path) { - return $this; - } - - $new = clone $this; - $new->path = $path; - $new->validateState(); - - return $new; - } - - public function withQuery($query) - { - $query = $this->filterQueryAndFragment($query); - - if ($this->query === $query) { - return $this; - } - - $new = clone $this; - $new->query = $query; - - return $new; - } - - public function withFragment($fragment) - { - $fragment = $this->filterQueryAndFragment($fragment); - - if ($this->fragment === $fragment) { - return $this; - } - - $new = clone $this; - $new->fragment = $fragment; - - return $new; - } - - /** - * Apply parse_url parts to a URI. - * - * @param array $parts Array of parse_url parts to apply. - */ - private function applyParts(array $parts) - { - $this->scheme = isset($parts['scheme']) - ? $this->filterScheme($parts['scheme']) - : ''; - $this->userInfo = isset($parts['user']) - ? $this->filterUserInfoComponent($parts['user']) - : ''; - $this->host = isset($parts['host']) - ? $this->filterHost($parts['host']) - : ''; - $this->port = isset($parts['port']) - ? $this->filterPort($parts['port']) - : null; - $this->path = isset($parts['path']) - ? $this->filterPath($parts['path']) - : ''; - $this->query = isset($parts['query']) - ? $this->filterQueryAndFragment($parts['query']) - : ''; - $this->fragment = isset($parts['fragment']) - ? $this->filterQueryAndFragment($parts['fragment']) - : ''; - if (isset($parts['pass'])) { - $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); - } - - $this->removeDefaultPort(); - } - - /** - * @param string $scheme - * - * @return string - * - * @throws \InvalidArgumentException If the scheme is invalid. - */ - private function filterScheme($scheme) - { - if (!is_string($scheme)) { - throw new \InvalidArgumentException('Scheme must be a string'); - } - - return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param string $component - * - * @return string - * - * @throws \InvalidArgumentException If the user info is invalid. - */ - private function filterUserInfoComponent($component) - { - if (!is_string($component)) { - throw new \InvalidArgumentException('User info must be a string'); - } - - return preg_replace_callback( - '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $component - ); - } - - /** - * @param string $host - * - * @return string - * - * @throws \InvalidArgumentException If the host is invalid. - */ - private function filterHost($host) - { - if (!is_string($host)) { - throw new \InvalidArgumentException('Host must be a string'); - } - - return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param int|null $port - * - * @return int|null - * - * @throws \InvalidArgumentException If the port is invalid. - */ - private function filterPort($port) - { - if ($port === null) { - return null; - } - - $port = (int) $port; - if (0 > $port || 0xffff < $port) { - throw new \InvalidArgumentException( - sprintf('Invalid port: %d. Must be between 0 and 65535', $port) - ); - } - - return $port; - } - - /** - * @param UriInterface $uri - * @param array $keys - * - * @return array - */ - private static function getFilteredQueryString(UriInterface $uri, array $keys) - { - $current = $uri->getQuery(); - - if ($current === '') { - return []; - } - - $decodedKeys = array_map('rawurldecode', $keys); - - return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { - return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); - }); - } - - /** - * @param string $key - * @param string|null $value - * - * @return string - */ - private static function generateQueryString($key, $value) - { - // Query string separators ("=", "&") within the key or value need to be encoded - // (while preventing double-encoding) before setting the query string. All other - // chars that need percent-encoding will be encoded by withQuery(). - $queryString = strtr($key, self::$replaceQuery); - - if ($value !== null) { - $queryString .= '=' . strtr($value, self::$replaceQuery); - } - - return $queryString; - } - - private function removeDefaultPort() - { - if ($this->port !== null && self::isDefaultPort($this)) { - $this->port = null; - } - } - - /** - * Filters the path of a URI - * - * @param string $path - * - * @return string - * - * @throws \InvalidArgumentException If the path is invalid. - */ - private function filterPath($path) - { - if (!is_string($path)) { - throw new \InvalidArgumentException('Path must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $path - ); - } - - /** - * Filters the query string or fragment of a URI. - * - * @param string $str - * - * @return string - * - * @throws \InvalidArgumentException If the query or fragment is invalid. - */ - private function filterQueryAndFragment($str) - { - if (!is_string($str)) { - throw new \InvalidArgumentException('Query and fragment must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $str - ); - } - - private function rawurlencodeMatchZero(array $match) - { - return rawurlencode($match[0]); - } - - private function validateState() - { - if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { - $this->host = self::HTTP_DEFAULT_HOST; - } - - if ($this->getAuthority() === '') { - if (0 === strpos($this->path, '//')) { - throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); - } - if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { - throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); - } - } elseif (isset($this->path[0]) && $this->path[0] !== '/') { - @trigger_error( - 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . - 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', - E_USER_DEPRECATED - ); - $this->path = '/' . $this->path; - //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); - } - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php deleted file mode 100644 index 81419ead426..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ /dev/null @@ -1,219 +0,0 @@ -getPath() === '' && - ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') - ) { - $uri = $uri->withPath('/'); - } - - if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { - $uri = $uri->withHost(''); - } - - if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { - $uri = $uri->withPort(null); - } - - if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { - $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); - } - - if ($flags & self::REMOVE_DUPLICATE_SLASHES) { - $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); - } - - if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { - $queryKeyValues = explode('&', $uri->getQuery()); - sort($queryKeyValues); - $uri = $uri->withQuery(implode('&', $queryKeyValues)); - } - - return $uri; - } - - /** - * Whether two URIs can be considered equivalent. - * - * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also - * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be - * resolved against the same base URI. If this is not the case, determination of equivalence or difference of - * relative references does not mean anything. - * - * @param UriInterface $uri1 An URI to compare - * @param UriInterface $uri2 An URI to compare - * @param int $normalizations A bitmask of normalizations to apply, see constants - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-6.1 - */ - public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) - { - return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); - } - - private static function capitalizePercentEncoding(UriInterface $uri) - { - $regex = '/(?:%[A-Fa-f0-9]{2})++/'; - - $callback = function (array $match) { - return strtoupper($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private static function decodeUnreservedCharacters(UriInterface $uri) - { - $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; - - $callback = function (array $match) { - return rawurldecode($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private function __construct() - { - // cannot be instantiated - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php deleted file mode 100644 index a3cb15d5703..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/UriResolver.php +++ /dev/null @@ -1,222 +0,0 @@ -getScheme() != '') { - return $rel->withPath(self::removeDotSegments($rel->getPath())); - } - - if ($rel->getAuthority() != '') { - $targetAuthority = $rel->getAuthority(); - $targetPath = self::removeDotSegments($rel->getPath()); - $targetQuery = $rel->getQuery(); - } else { - $targetAuthority = $base->getAuthority(); - if ($rel->getPath() === '') { - $targetPath = $base->getPath(); - $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); - } else { - if ($rel->getPath()[0] === '/') { - $targetPath = $rel->getPath(); - } else { - if ($targetAuthority != '' && $base->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 = self::removeDotSegments($targetPath); - $targetQuery = $rel->getQuery(); - } - } - - return new Uri(Uri::composeComponents( - $base->getScheme(), - $targetAuthority, - $targetPath, - $targetQuery, - $rel->getFragment() - )); - } - - /** - * Returns the target URI as a relative reference from the base URI. - * - * This method is the counterpart to resolve(): - * - * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) - * - * One use-case is to use the current request URI as base URI and then generate relative links in your documents - * to reduce the document size or offer self-contained downloadable document archives. - * - * $base = new Uri('http://example.com/a/b/'); - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. - * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. - * - * This method also accepts a target that is already relative and will try to relativize it further. Only a - * relative-path reference will be returned as-is. - * - * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well - * - * @param UriInterface $base Base URI - * @param UriInterface $target Target URI - * - * @return UriInterface The relative URI reference - */ - public static function relativize(UriInterface $base, UriInterface $target) - { - if ($target->getScheme() !== '' && - ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') - ) { - return $target; - } - - if (Uri::isRelativePathReference($target)) { - // As the target is already highly relative we return it as-is. It would be possible to resolve - // the target with `$target = self::resolve($base, $target);` and then try make it more relative - // by removing a duplicate query. But let's not do that automatically. - return $target; - } - - if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { - return $target->withScheme(''); - } - - // We must remove the path before removing the authority because if the path starts with two slashes, the URI - // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also - // invalid. - $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); - - if ($base->getPath() !== $target->getPath()) { - return $emptyPathUri->withPath(self::getRelativePath($base, $target)); - } - - if ($base->getQuery() === $target->getQuery()) { - // Only the target fragment is left. And it must be returned even if base and target fragment are the same. - return $emptyPathUri->withQuery(''); - } - - // If the base URI has a query but the target has none, we cannot return an empty path reference as it would - // inherit the base query component when resolving. - if ($target->getQuery() === '') { - $segments = explode('/', $target->getPath()); - $lastSegment = end($segments); - - return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); - } - - return $emptyPathUri; - } - - private static function getRelativePath(UriInterface $base, UriInterface $target) - { - $sourceSegments = explode('/', $base->getPath()); - $targetSegments = explode('/', $target->getPath()); - array_pop($sourceSegments); - $targetLastSegment = array_pop($targetSegments); - foreach ($sourceSegments as $i => $segment) { - if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { - unset($sourceSegments[$i], $targetSegments[$i]); - } else { - break; - } - } - $targetSegments[] = $targetLastSegment; - $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 - // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. - if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { - $relativePath = "./$relativePath"; - } elseif ('/' === $relativePath[0]) { - if ($base->getAuthority() != '' && $base->getPath() === '') { - // In this case an extra slash is added by resolve() automatically. So we must not add one here. - $relativePath = ".$relativePath"; - } else { - $relativePath = "./$relativePath"; - } - } - - return $relativePath; - } - - private function __construct() - { - // cannot be instantiated - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php deleted file mode 100644 index 6b6c8cced5d..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/Utils.php +++ /dev/null @@ -1,428 +0,0 @@ - $keys - * - * @return array - */ - public static function caselessRemove($keys, array $data) - { - $result = []; - - foreach ($keys as &$key) { - $key = strtolower($key); - } - - foreach ($data as $k => $v) { - if (!in_array(strtolower($k), $keys)) { - $result[$k] = $v; - } - } - - return $result; - } - - /** - * Copy the contents of a stream into another stream until the given number - * of bytes have been read. - * - * @param StreamInterface $source Stream to read from - * @param StreamInterface $dest Stream to write to - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @throws \RuntimeException on error. - */ - public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1) - { - $bufferSize = 8192; - - if ($maxLen === -1) { - while (!$source->eof()) { - if (!$dest->write($source->read($bufferSize))) { - break; - } - } - } else { - $remaining = $maxLen; - while ($remaining > 0 && !$source->eof()) { - $buf = $source->read(min($bufferSize, $remaining)); - $len = strlen($buf); - if (!$len) { - break; - } - $remaining -= $len; - $dest->write($buf); - } - } - } - - /** - * Copy the contents of a stream into a string until the given number of - * bytes have been read. - * - * @param StreamInterface $stream Stream to read - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @return string - * - * @throws \RuntimeException on error. - */ - public static function copyToString(StreamInterface $stream, $maxLen = -1) - { - $buffer = ''; - - if ($maxLen === -1) { - while (!$stream->eof()) { - $buf = $stream->read(1048576); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - } - return $buffer; - } - - $len = 0; - while (!$stream->eof() && $len < $maxLen) { - $buf = $stream->read($maxLen - $len); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - $len = strlen($buffer); - } - - return $buffer; - } - - /** - * Calculate a hash of a stream. - * - * This method reads the entire stream to calculate a rolling hash, based - * on PHP's `hash_init` functions. - * - * @param StreamInterface $stream Stream to calculate the hash for - * @param string $algo Hash algorithm (e.g. md5, crc32, etc) - * @param bool $rawOutput Whether or not to use raw output - * - * @return string Returns the hash of the stream - * - * @throws \RuntimeException on error. - */ - public static function hash(StreamInterface $stream, $algo, $rawOutput = false) - { - $pos = $stream->tell(); - - if ($pos > 0) { - $stream->rewind(); - } - - $ctx = hash_init($algo); - while (!$stream->eof()) { - hash_update($ctx, $stream->read(1048576)); - } - - $out = hash_final($ctx, (bool) $rawOutput); - $stream->seek($pos); - - return $out; - } - - /** - * Clone and modify a request with the given changes. - * - * This method is useful for reducing the number of clones needed to mutate - * a message. - * - * The changes can be one of: - * - method: (string) Changes the HTTP method. - * - set_headers: (array) Sets the given headers. - * - remove_headers: (array) Remove the given headers. - * - body: (mixed) Sets the given body. - * - uri: (UriInterface) Set the URI. - * - query: (string) Set the query string value of the URI. - * - version: (string) Set the protocol version. - * - * @param RequestInterface $request Request to clone and modify. - * @param array $changes Changes to apply. - * - * @return RequestInterface - */ - public static function modifyRequest(RequestInterface $request, array $changes) - { - if (!$changes) { - return $request; - } - - $headers = $request->getHeaders(); - - if (!isset($changes['uri'])) { - $uri = $request->getUri(); - } else { - // Remove the host header if one is on the URI - if ($host = $changes['uri']->getHost()) { - $changes['set_headers']['Host'] = $host; - - if ($port = $changes['uri']->getPort()) { - $standardPorts = ['http' => 80, 'https' => 443]; - $scheme = $changes['uri']->getScheme(); - if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':' . $port; - } - } - } - $uri = $changes['uri']; - } - - if (!empty($changes['remove_headers'])) { - $headers = self::caselessRemove($changes['remove_headers'], $headers); - } - - if (!empty($changes['set_headers'])) { - $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); - $headers = $changes['set_headers'] + $headers; - } - - if (isset($changes['query'])) { - $uri = $uri->withQuery($changes['query']); - } - - if ($request instanceof ServerRequestInterface) { - $new = (new ServerRequest( - isset($changes['method']) ? $changes['method'] : $request->getMethod(), - $uri, - $headers, - isset($changes['body']) ? $changes['body'] : $request->getBody(), - isset($changes['version']) - ? $changes['version'] - : $request->getProtocolVersion(), - $request->getServerParams() - )) - ->withParsedBody($request->getParsedBody()) - ->withQueryParams($request->getQueryParams()) - ->withCookieParams($request->getCookieParams()) - ->withUploadedFiles($request->getUploadedFiles()); - - foreach ($request->getAttributes() as $key => $value) { - $new = $new->withAttribute($key, $value); - } - - return $new; - } - - return new Request( - isset($changes['method']) ? $changes['method'] : $request->getMethod(), - $uri, - $headers, - isset($changes['body']) ? $changes['body'] : $request->getBody(), - isset($changes['version']) - ? $changes['version'] - : $request->getProtocolVersion() - ); - } - - /** - * Read a line from the stream up to the maximum allowed buffer length. - * - * @param StreamInterface $stream Stream to read from - * @param int|null $maxLength Maximum buffer length - * - * @return string - */ - public static function readLine(StreamInterface $stream, $maxLength = null) - { - $buffer = ''; - $size = 0; - - while (!$stream->eof()) { - // Using a loose equality here to match on '' and false. - if (null == ($byte = $stream->read(1))) { - return $buffer; - } - $buffer .= $byte; - // Break when a new line is found or the max length - 1 is reached - if ($byte === "\n" || ++$size === $maxLength - 1) { - break; - } - } - - return $buffer; - } - - /** - * Create a new stream based on the input type. - * - * Options is an associative array that can contain the following keys: - * - metadata: Array of custom metadata. - * - size: Size of the stream. - * - * This method accepts the following `$resource` types: - * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. - * - `string`: Creates a stream object that uses the given string as the contents. - * - `resource`: Creates a stream object that wraps the given PHP stream resource. - * - `Iterator`: If the provided value implements `Iterator`, then a read-only - * stream object will be created that wraps the given iterable. Each time the - * stream is read from, data from the iterator will fill a buffer and will be - * continuously called until the buffer is equal to the requested read size. - * Subsequent read calls will first read from the buffer and then call `next` - * on the underlying iterator until it is exhausted. - * - `object` with `__toString()`: If the object has the `__toString()` method, - * the object will be cast to a string and then a stream will be returned that - * uses the string value. - * - `NULL`: When `null` is passed, an empty stream object is returned. - * - `callable` When a callable is passed, a read-only stream object will be - * created that invokes the given callable. The callable is invoked with the - * number of suggested bytes to read. The callable can return any number of - * bytes, but MUST return `false` when there is no more data to return. The - * stream object that wraps the callable will invoke the callable until the - * number of requested bytes are available. Any additional bytes will be - * buffered and used in subsequent reads. - * - * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data - * @param array $options Additional options - * - * @return StreamInterface - * - * @throws \InvalidArgumentException if the $resource arg is not valid. - */ - public static function streamFor($resource = '', array $options = []) - { - if (is_scalar($resource)) { - $stream = self::tryFopen('php://temp', 'r+'); - if ($resource !== '') { - fwrite($stream, $resource); - fseek($stream, 0); - } - return new Stream($stream, $options); - } - - switch (gettype($resource)) { - case 'resource': - /* - * The 'php://input' is a special stream with quirks and inconsistencies. - * We avoid using that stream by reading it into php://temp - */ - $metaData = \stream_get_meta_data($resource); - if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') { - $stream = self::tryFopen('php://temp', 'w+'); - fwrite($stream, stream_get_contents($resource)); - fseek($stream, 0); - $resource = $stream; - } - return new Stream($resource, $options); - case 'object': - if ($resource instanceof StreamInterface) { - return $resource; - } elseif ($resource instanceof \Iterator) { - return new PumpStream(function () use ($resource) { - if (!$resource->valid()) { - return false; - } - $result = $resource->current(); - $resource->next(); - return $result; - }, $options); - } elseif (method_exists($resource, '__toString')) { - return Utils::streamFor((string) $resource, $options); - } - break; - case 'NULL': - return new Stream(self::tryFopen('php://temp', 'r+'), $options); - } - - if (is_callable($resource)) { - return new PumpStream($resource, $options); - } - - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); - } - - /** - * Safely opens a PHP stream resource using a filename. - * - * When fopen fails, PHP normally raises a warning. This function adds an - * error handler that checks for errors and throws an exception instead. - * - * @param string $filename File to open - * @param string $mode Mode used to open the file - * - * @return resource - * - * @throws \RuntimeException if the file cannot be opened - */ - public static function tryFopen($filename, $mode) - { - $ex = null; - set_error_handler(function () use ($filename, $mode, &$ex) { - $ex = new \RuntimeException(sprintf( - 'Unable to open "%s" using mode "%s": %s', - $filename, - $mode, - func_get_args()[1] - )); - - return true; - }); - - try { - $handle = fopen($filename, $mode); - } catch (\Throwable $e) { - $ex = new \RuntimeException(sprintf( - 'Unable to open "%s" using mode "%s": %s', - $filename, - $mode, - $e->getMessage() - ), 0, $e); - } - - restore_error_handler(); - - if ($ex) { - /** @var $ex \RuntimeException */ - throw $ex; - } - - return $handle; - } - - /** - * Returns a UriInterface for the given value. - * - * This function accepts a string or UriInterface and returns a - * UriInterface for the given value. If the value is already a - * UriInterface, it is returned as-is. - * - * @param string|UriInterface $uri - * - * @return UriInterface - * - * @throws \InvalidArgumentException - */ - public static function uriFor($uri) - { - if ($uri instanceof UriInterface) { - return $uri; - } - - if (is_string($uri)) { - return new Uri($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); - } -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php deleted file mode 100644 index b0901fadd30..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/functions.php +++ /dev/null @@ -1,422 +0,0 @@ - '1', 'foo[b]' => '2'])`. - * - * @param string $str Query string to parse - * @param int|bool $urlEncoding How the query string is encoded - * - * @return array - * - * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead. - */ -function parse_query($str, $urlEncoding = true) -{ - return Query::parse($str, $urlEncoding); -} - -/** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse_query()` to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like `http_build_query()` would). - * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. - * - * @return string - * - * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. - */ -function build_query(array $params, $encoding = PHP_QUERY_RFC3986) -{ - return Query::build($params, $encoding); -} - -/** - * Determines the mimetype of a file by looking at its extension. - * - * @param string $filename - * - * @return string|null - * - * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead. - */ -function mimetype_from_filename($filename) -{ - return MimeType::fromFilename($filename); -} - -/** - * Maps a file extensions to a mimetype. - * - * @param $extension string The file extension. - * - * @return string|null - * - * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types - * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead. - */ -function mimetype_from_extension($extension) -{ - return MimeType::fromExtension($extension); -} - -/** - * Parses an HTTP message into an associative array. - * - * The array contains the "start-line" key containing the start line of - * the message, "headers" key containing an associative array of header - * array values, and a "body" key containing the body of the message. - * - * @param string $message HTTP request or response to parse. - * - * @return array - * - * @internal - * - * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. - */ -function _parse_message($message) -{ - return Message::parseMessage($message); -} - -/** - * Constructs a URI for an HTTP request message. - * - * @param string $path Path from the start-line - * @param array $headers Array of headers (each value an array). - * - * @return string - * - * @internal - * - * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. - */ -function _parse_request_uri($path, array $headers) -{ - return Message::parseRequestUri($path, $headers); -} - -/** - * Get a short summary of the message body. - * - * Will return `null` if the response is not printable. - * - * @param MessageInterface $message The message to get the body summary - * @param int $truncateAt The maximum allowed size of the summary - * - * @return string|null - * - * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead. - */ -function get_message_body_summary(MessageInterface $message, $truncateAt = 120) -{ - return Message::bodySummary($message, $truncateAt); -} - -/** - * Remove the items given by the keys, case insensitively from the data. - * - * @param iterable $keys - * - * @return array - * - * @internal - * - * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. - */ -function _caseless_remove($keys, array $data) -{ - return Utils::caselessRemove($keys, $data); -} diff --git a/upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php b/upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php deleted file mode 100644 index 96a4a83a01a..00000000000 --- a/upload/system/storage/vendor/guzzlehttp/psr7/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ - - -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -## [4.2.3] - 2020-02-14 - -### Added - -- HTTP Transport: Oceania Base URLs (playground and production) - - -## [4.2.2] - 2019-11-05 - -### Changed - -- Remove "src" folder from a PSR4 autoload definition as fallback directory. - - -## [4.2.1] - 2019-10-15 - -### Added - -- Test against php 7.3 - -### Fixed - -- CURL Transport: Add processing of multiple HTTP headers in response.[Caught exception: Response is missing a Content-Type header #44](https://github.com/klarna/kco_rest_php/issues/44); -- Fix exception namespace and PHPDoc -- Stores the KEY ID field in order to restore the ID after fetching data without the KEY field. [Payments Session ID is reset after fetch() #37](https://github.com/klarna/kco_rest_php/issues/37) - -## [4.2.0] - 2019-06-11 - -This release has a number of **[no-backward-compatibility]** flags. But these incompatible changes related -only to the "under the hood" files. It means, if you operate only with high-level instances, like -`Connector` and `Rest\`/`Checkout/Payments/OrderManagement/etc` resources (you have the code, -like in the example files) - you are safe for upgrade. - -If you have your own implementation of REST API Services, HTTP Transport or Base Resource instance, -you need to check the code before go live. - -### Added - -- Add new HTTP Transport `CURLTransport`. This transport does not require any package dependencies -- Add PHP SDK SPL Autoloader -- Add `ApiResponse` class to unify an HTTP Transport reponse - -### Changed - -- Decouple the HTTP Transport Connector interface. Remove Guzzle hardcoded dependency **[no-backward-compatibility]** -- Decouple `ConnectorException`. Remove Guzzle hardcoded dependency **[partial-backward-compatibility]** - - Change the constructor signature. Replace `RequestException` exception with `int $code` - - `getResponse` method is not longer return Guzzle `ResponseInterface`. - This method marked as deprecated and return `null` -- Rename `Klarna/Rest/Transport/Connector.php` to `Klarna/Rest/Transport/GuzzleConnector.php` to - make the name explicit. **[backward-compatible]** - The `Klarna/Rest/Transport/Connector.php` still exists, but marked as deprecated -- Change the structure and return values for all the methods in `GuzzleConnector` (ex `Connector`) - to follow the new Connector interface. **[no-backward-compatibility]** -- Exception throwing behavior: **[partial-backward-compatibility]** - - `GuzzleConnector` (ex `Connector`) no longer throws Guzzle related `RuntimeException` exceptions. - The Connector throws only `RuntimeException` - - The only two types of exceptions can be thrown by SDK now: - - `RuntimeException` - - `ConnectorException` -- Extend `ResponseValidator` with `expectSuccessfull` and `isSuccessfull` methods. The methods allows - to validate the reponse code and parse the Klarna Error Message if possible - -## [4.1.5] - 2019-05-21 - -### Added - -- Add `.gitattributes` file to remove needless load from composer imports -- Examples: Add "How to set a discount" example. - -### Changed - -- Remove unused phpunit/phpcov package; -- Examples: Checkout API: Add more callback URLs; - -### Fixed - -- Debug mode: Request body and headers were not displayed when getting 400 HTTP response code. -- Examples: Checkout API: Fix typo in the attachments file; - -## [4.1.4] - 2019-03-15 - -### Added - -- Add full support of Instant Shopping API -- Repo now has an Apache 2.0 LICENSE file on its root -- HTTP Transport: Add support of PUT method -- Examples: Add Instant Shopping examples. - -### Fixed - -- HTTP Transport: Stop throwing an exception when an API service return a bad structured Error; - -## [4.1.3] - 2019-01-23 - -### Added - -- HPP API: Add support for disabling an HPP session; -- Customer Token API: Add ability to use Klarna-Idempotency-Key when creating order -- Customer Token API: Add new feature: Update token status; -- Examples: Add example of changing the User-Agent. - -## [4.1.2] - 2018-11-22 - -### Fixed - -- Order management API threw Error Notice when fetching an order with refunds. - -## [4.1.1] - 2018-10-31 - -### Added - -- Add support of Merchant Card Service API - -### Changed - -- HPP: HPP service changed API completely without backward compatibility. Adopt SDK to the new changes. - Mark `getSessionStatus` as `@deprecated`. Replaced by fetch function. - Return data was changed by HPP API service. - **[partial-backward-compatibility]** - -## [4.0.0] - 2018-08-27 (Major release) - -### Added - -- `OrderManagement`: - - Add ability to fetch Captures; - - Add support of Refunds **[partial-backward-compatibility]**; -- Add full support of Customer Token API; -- Add full support of Settlements API; -- Add full support of Payments API; -- Add full support of Hosted Payment Page API; -- Add 'Debug Mode' to be able to debug requests and responses; -- Put SDK References documentation to GH Pages: [https://klarna.github.io/kco_rest_php/](https://klarna.github.io/kco_rest_php/) -- More Examples for all Klarna Services. - -### Changed - -- OrderManagementAPI: Changed `refund` function. Before returned `$this`, now returns - `Refund` object; -- OrderManagementAPI: Order object now has an `array` of `Refund` objects instead of just array of data. - **[backward-compatible]** - -### Fixed - -- Fix: Settlements API [Unexpected Header #15](https://github.com/klarna/kco_rest_php/issues/15); - -## [3.0.1] - 2017-01-16 - -### Fixed - -- smaller fixes - -## [3.0.0] - 2017-12-12 - -### Changed - -- support for guzzle >6.0 - -## [2.2.0] - 2015-12-7 - -### Added - +## v2.2.0 - 2015-12-7 - **NEW META-13** Allow for 201 response on refund - *Joakim.L* -## [2.1.0] - 2015-07-29 - -### Changed - +## v2.1.0 - 2015-07-29 - **NEW MINT-2262** Support Guzzle 5.x versions - *Omer.K, Joakim.L* -## [2.0.0] - 2015-06-10 - -### Added - -- **NEW MINT-2214** Add base URLs for North America - *Joakim.L* - -### Fixed - +## v2.0.0 - 2015-06-10 - **NEW MINT-2203** Use order id instead of URL for checkout orders - *Joakim.L* +- **NEW MINT-2214** Add base URLs for North America - *Joakim.L* -## [1.0.1] - 2015-03-30 - -### Added - -- **NEW MINT-2097** Add apigen and custom styling - *Petros.G* - -### Fixed - +## v1.0.1 - 2015-03-30 - **FIX MINT-2002** Handle errors with an empty payload - *David.K* +- **NEW MINT-2097** Add apigen and custom styling - *Petros.G* -## 1.0.0 - 2014-10-16 - -### Added - +## v1.0.0 - 2014-10-16 - **NEW MINT-1804** Support checkout v3 and ordermanagement v1 APIs - *Joakim.L* -[Unreleased]: https://github.com/klarna/kco_rest_php/compare/v4.2.3...HEAD -[4.2.3]: https://github.com/klarna/kco_rest_php/compare/v4.2.2...v4.2.3 -[4.2.2]: https://github.com/klarna/kco_rest_php/compare/v4.2.1...v4.2.2 -[4.2.1]: https://github.com/klarna/kco_rest_php/compare/v4.2.0...v4.2.1 -[4.2.0]: https://github.com/klarna/kco_rest_php/compare/v4.1.5...v4.2.0 -[4.1.5]: https://github.com/klarna/kco_rest_php/compare/v4.1.4...v4.1.5 -[4.1.4]: https://github.com/klarna/kco_rest_php/compare/v4.1.3...v4.1.4 -[4.1.3]: https://github.com/klarna/kco_rest_php/compare/v4.1.2...v4.1.3 -[4.1.2]: https://github.com/klarna/kco_rest_php/compare/v4.1.1...v4.1.2 -[4.1.1]: https://github.com/klarna/kco_rest_php/compare/v4.0.0...v4.1.2 -[4.0.0]: https://github.com/klarna/kco_rest_php/compare/v3.0.1...v4.0.0 -[3.0.1]: https://github.com/klarna/kco_rest_php/compare/v3.0.0...v3.0.1 -[3.0.0]: https://github.com/klarna/kco_rest_php/compare/v2.1.0...v3.0.0 -[2.1.0]: https://github.com/klarna/kco_rest_php/compare/v2.0.0...v2.1.0 -[2.0.0]: https://github.com/klarna/kco_rest_php/compare/v1.0.1...v2.0.0 -[1.0.1]: https://github.com/klarna/kco_rest_php/compare/v1.0.0...v1.0.1 diff --git a/upload/system/storage/vendor/klarna/kco_rest/LICENSE b/upload/system/storage/vendor/klarna/kco_rest/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/upload/system/storage/vendor/klarna/kco_rest/README.md b/upload/system/storage/vendor/klarna/kco_rest/README.md index 3f956572694..537f4c98a70 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/README.md +++ b/upload/system/storage/vendor/klarna/kco_rest/README.md @@ -1,141 +1,35 @@ -# Official Klarna REST PHP SDK +# Klarna Checkout REST PHP SDK [![Packagist Version][packagist-image]](https://packagist.org/packages/klarna/kco_rest) [![Build Status][travis-image]](https://travis-ci.org/klarna/kco_rest_php) -[![Coverage Status][coveralls-image]](https://coveralls.io/r/klarna/kco_rest_php?branch=v4.x) +[![Coverage Status][coveralls-image]](https://coveralls.io/r/klarna/kco_rest_php?branch=v2.2) -## Shop now. Pay later. +Klarna Checkout is a revolutionary new payment solution that is changing the way +people shop online. First, consumers verify their purchase with a minimal +amount of information through intelligent identification, securing your order +immediately, and then complete their payment afterwards – separating buying +from paying and dramatically increasing conversion. Klarna Checkout also allows +merchants to offer all payment methods through one supplier, minimizing +administration, costs and integration time. -Shop at your favorite stores today and experience the freedom to pay later with Klarna. - -## Getting started - -SDK covers all of Klarna API: https://developers.klarna.com/api/ +## Get started ### Prerequisites -* PHP 5.5 or above -* [API credentials](#api-credentials) -* [Composer](https://getcomposer.org/) (optional) - - -### API Credentials - -Before getting a production account you can get a playground one. -Register here to be able to test your SDK integration before go live: - -- https://playground.eu.portal.klarna.com/developer-sign-up - for EU countries -- https://playground.us.portal.klarna.com/developer-sign-up - for the US - - -## PHP SDK Installation and Usage - -### Install via Composer - -To install the PHP SDK from the Central Composer repository use composer: - -```shell -composer require klarna/kco_rest -``` - -Highly recommended to use version tag when installing SDK. - -```shell -composer require klarna/kco_rest:1.2.3.4 -``` - -Detailed information about the PHP SDK package and a list of available versions can be found here: -https://packagist.org/packages/klarna/kco_rest - -Include the SDK into your PHP file using the Composer autoloader: - -```php - -``` - -or - -```shell -$ export DEBUG_SDK=1 -$ php -``` - -Another way to enable Debugging Mode is `define` the **DEBUG_SDK** inside your script: - -```php ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - GET : https://api.playground.klarna.com/customer-token/v1/tokens/TOKEN -Headers : {"User-Agent":["Library\/Klarna.kco_rest_php_3.1.0 (Guzzle\/6.3.3; curl\/7.54.0) OS\/Darwin_17.5.0 Language\/PHP_5.6.37"]} - Body : - -DEBUG MODE: Response -<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -Headers : {"Content-Type":["application\/json"],"Date":["Wed, 15 Aug 2018 15:55:53 GMT"],"Klarna-Correlation-Id":["ABC-123"],"Server":["openresty"],"Content-Length":["62"],"Connection":["keep-alive"]} - Body : { - "status" : "ACTIVE", - "payment_method_type" : "INVOICE" - } -``` - - ## Questions and feedback If you have any questions concerning this product or the implementation, -please create an issue: https://github.com/klarna/kco_rest_php/issues/new/choose - -Use an official Klarna Contact us form (https://klarna.com) if you have a question about the integration. +please contact [integration@klarna.com](mailto:integration@klarna.com). ## How to contribute @@ -156,10 +50,18 @@ To contribute, the following criteria needs to be fulfilled: * All tests should pass +## Acknowledgements +* Christer Gustavsson ([@ChristerGustavsson](https://github.com/ChristerGustavsson)) +* David Keijser ([@keis](https://github.com/keis)) +* Joakim Löfgren ([@JoakimLofgren](https://github.com/JoakimLofgren)) +* Majid Garmaroudi ([@dijam](https://github.com/dijam)) +* Omer Karadagli ([@ockcyp](https://github.com/ockcyp)) + + ## License Klarna Checkout REST PHP SDK is licensed under [Apache License, Version 2.0](http://www.apache.org/LICENSE-2.0) [packagist-image]: https://img.shields.io/packagist/v/klarna/kco_rest.svg?style=flat -[travis-image]: https://img.shields.io/travis/klarna/kco_rest_php/v4.x.svg?style=flat -[coveralls-image]: https://img.shields.io/coveralls/klarna/kco_rest_php/v4.x.svg?style=flat +[travis-image]: https://img.shields.io/travis/klarna/kco_rest_php/v2.2.svg?style=flat +[coveralls-image]: https://img.shields.io/coveralls/klarna/kco_rest_php/v2.2.svg?style=flat diff --git a/upload/system/storage/vendor/klarna/kco_rest/composer.json b/upload/system/storage/vendor/klarna/kco_rest/composer.json index 17e62fa1f95..d34e36bfbf6 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/composer.json +++ b/upload/system/storage/vendor/klarna/kco_rest/composer.json @@ -1,47 +1,38 @@ { "name": "klarna/kco_rest", - "description": "Official Klarna REST PHP SDK", + "description": "Klarna Checkout PHP SDK", "homepage": "http://developers.klarna.com", "license": "Apache-2.0", "type": "library", "authors": [ { - "name": "Klarna AB" + "name": "Klarna AB", + "email": "integration@klarna.com" } ], "autoload": { "psr-4": { - "Klarna\\": "src/Klarna/" - } - }, - "autoload-dev": { - "psr-4": { - "Klarna\\Rest\\Tests\\": "tests/" + "": "src/" } }, "minimum-stability": "stable", "require": { - "php": ">=5.5.0", - "guzzlehttp/guzzle": "~6.0" + "php": ">=5.4.0", + "guzzlehttp/guzzle": ">=4.2,<6.0" }, "require-dev": { - "phpunit/phpunit": ">=4.0.0, <6.0", + "phpunit/phpunit": "4.2.*", "squizlabs/php_codesniffer": "1.5.*", "phpmd/phpmd": "2.1.*", "phploc/phploc": "2.0.*", "sebastian/phpcpd": "2.0.*", - "php-coveralls/php-coveralls": "^2.1", - "apigen/apigen": "4.1.*", - "klarna/apigen-theme": "2.1.0" + "satooshi/php-coveralls": "0.6.*", + "apigen/apigen": "4.0.*", + "klarna/apigen-theme": "~1.0" }, "scripts": { "test": "vendor/bin/phpunit --colors", "reference": "vendor/bin/apigen generate -s src -d docs/reference --template-config='vendor/klarna/apigen-theme/src/config.neon'", - "checkstyle": "vendor/bin/phpcs --standard=PSR2 --report=checkstyle --extensions=php src/ tests/", - "check": [ - "@test", - "@checkstyle" - ], "analyze": [ "mkdir -p build/logs", "vendor/bin/phploc --log-csv build/logs/phploc.csv src/ tests/", diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php deleted file mode 100644 index 2f796c37027..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout.php +++ /dev/null @@ -1,111 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://www.example.com/terms.html", - "cancellation_terms" => "https://www.example.com/terms/cancellation.html", - "checkout" => "https://www.example.com/checkout.html", - "confirmation" => "https://www.example.com/confirmation.html", - - // Callbacks - "push" => "https://www.example.com/api/push", - "validation" => "https://www.example.com/api/validation", - "shipping_option_update" => "https://www.example.com/api/shipment", - "address_update" => "https://www.example.com/api/address", - "notification" => "https://www.example.com/api/pending", - "country_change" => "https://www.example.com/api/country" - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - // Store checkout order id - $orderId = $checkout->getId(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php deleted file mode 100644 index 0c991ca9252..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/create_checkout_attachment.php +++ /dev/null @@ -1,126 +0,0 @@ - [ - [ - "unique_account_identifier" => "Test Testperson", - "payment_option" => "card", - "number_paid_purchases" => 1, - "total_amount_paid_purchases" => 10000, - "date_of_last_paid_purchase" => (new DateTime())->format(DATE_FORMAT), - "date_of_first_paid_purchase" => (new DateTime())->format(DATE_FORMAT) - ] - ] -]; - -$order = [ - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://www.example.com/terms.html", - "cancellation_terms" => "https://www.example.com/terms/cancellation.html", - "checkout" => "https://www.example.com/checkout.html", - "confirmation" => "https://www.example.com/confirmation.html", - - // Callbacks - "push" => "https://www.example.com/api/push", - "validation" => "https://www.example.com/api/validation", - "shipping_option_update" => "https://www.example.com/api/shipment", - "address_update" => "https://www.example.com/api/address", - "notification" => "https://www.example.com/api/pending", - "country_change" => "https://www.example.com/api/country" - ], - "attachment" => [ - "content_type" => "application/vnd.klarna.internal.emd-v2+json", - "body" => json_encode($emd) - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - // Store checkout order id - $orderId = $checkout->getId(); - - // Get some data if needed - print_r($checkout['attachment']); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php deleted file mode 100644 index 6703a1cc706..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/discounts.php +++ /dev/null @@ -1,103 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 9000, - "order_tax_amount" => 818, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "19-402-USA", - "name" => "Red T-Shirt", - "quantity" => 1, - "quantity_unit" => "pcs", - "unit_price" => 10000, - "tax_rate" => 1000, - "total_amount" => 10000, - "total_tax_amount" => 909 - ], - - // Add discount as an order line - [ - "type" => "discount", - "reference" => "10-gbp-order-discount", - "name" => "Discount", - "quantity" => 1, - "unit_price" => -1000, - "tax_rate" => 1000, - "total_amount" => -1000, - "total_tax_amount" => -91 - ] - ], - "merchant_urls" => [ - "terms" => "https://www.example.com/terms.html", - "cancellation_terms" => "https://www.example.com/terms/cancellation.html", - "checkout" => "https://www.example.com/checkout.html", - "confirmation" => "https://www.example.com/confirmation.html", - - // Callbacks - "push" => "https://www.example.com/api/push", - "validation" => "https://www.example.com/api/validation", - "shipping_option_update" => "https://www.example.com/api/shipment", - "address_update" => "https://www.example.com/api/address", - "notification" => "https://www.example.com/api/pending", - "country_change" => "https://www.example.com/api/country" - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - echo $checkout['html_snippet']; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php deleted file mode 100644 index 270aca35559..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/fetch_checkout.php +++ /dev/null @@ -1,62 +0,0 @@ -fetch(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php deleted file mode 100644 index ef6652330f3..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/handling_exceptions.php +++ /dev/null @@ -1,64 +0,0 @@ -create([ - 'wrong order data' - ]); -} catch (ConnectorException $e) { - echo 'Message: ' . $e->getMessage() . "\n"; - echo 'Code: ' . $e->getCode() . "\n"; - echo 'ErrorCode: ' . $e->getErrorCode() . "\n"; - echo 'CorrelationID: ' . $e->getCorrelationId() . "\n"; - echo 'ServiceVersion: ' . $e->getServiceVersion() . "\n"; -} catch (Exception $e) { - echo 'Unhandled exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php deleted file mode 100644 index 11e0463805a..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CheckoutAPI/update_checkout.php +++ /dev/null @@ -1,103 +0,0 @@ - 11000, - "order_tax_amount" => 2200, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ], - [ - "type" => "shipping_fee", - "name" => "Express delivery", - "quantity" => 1, - "unit_price" => 1000, - "tax_rate" => 2500, - "total_amount" => 1000, - "total_tax_amount" => 200 - ] - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector, $orderId); - $checkout->update($updatedOrder); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php deleted file mode 100644 index 26e705493cb..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/Common/change_user_agent.php +++ /dev/null @@ -1,113 +0,0 @@ -setField('Platform', 'MyCustomShop', '1.2.3.4.5', ['seoAddon', 'promo']); -$customUserAgent->setField('PHP', 'Version', '5.4'); -$customUserAgent->setField('Hello', 'World'); - -// Headers: "User-Agent": ["Platform/MyCustomShop_1.2.3.4.5 (seoAddon; promo) PHP/Version_5.4 Hello/World"] - -$connector = Klarna\Rest\Transport\GuzzleConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint, - $customUserAgent -); - -$order = [ - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://example.com/toc", - "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", - "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", - "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" - ] -]; - -try { - $checkout = new Klarna\Rest\Checkout\Order($connector); - $checkout->create($order); - - // Store checkout order id - $orderId = $checkout->getId(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php deleted file mode 100644 index 5a75a47ef0b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/create_order.php +++ /dev/null @@ -1,106 +0,0 @@ - "John", - "family_name" => "Doe", - "email" => "johndoe@example.com", - "title" => "Mr", - "street_address" => "13 New Burlington St", - "street_address2" => "Apt 214", - "postal_code" => "W13 3BG", - "city" => "London", - "region" => "", - "phone" => "01895808221", - "country" => "GB" -]; - -$data = [ - "billing_address" => $address, - "shipping_address" => $address, - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $token = new Klarna\Rest\CustomerToken\Tokens($connector, $customerToken); - $order = $token->createOrder($data); - - print_r($order); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php deleted file mode 100644 index 7010a13b41c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/read_token_details.php +++ /dev/null @@ -1,57 +0,0 @@ -fetch(); - - print_r($token->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php deleted file mode 100644 index f1419c9a5bd..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/CustomerTokenAPI/Tokens/update_token_status.php +++ /dev/null @@ -1,59 +0,0 @@ -updateTokenStatus([ - 'status' => 'CANCELLED' - ]); - - echo 'Token patch request has been accepted and is being processed.'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php deleted file mode 100644 index 7850a0d978a..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/create_new_hpp_session.php +++ /dev/null @@ -1,80 +0,0 @@ - [ - "cancel" => "https://example.com/cancel", - "failure" => "https://example.com/fail", - "privacy_policy" => "https://example.com/privacy_policy", - "success" => "https://example.com/success?token={{authorization_token}}", - "terms" => "https://example.com/terms" - ], - "options" => [ - "background_images" => [ - [ - "url" => "https://example.com/bgimage.jpg", - "width" => 1200 - ] - ], - "logo_url" => "https://example.com/logo.jpg", - "page_title" => "Complete your purchase", - "payment_method_category" => "pay_later", - "purchase_type" => "buy" - ], - "payment_session_url" => "https://api.klarna.com/payments/v1/sessions/$sessionId" -]; - -try { - $hpp = new Klarna\Rest\HostedPaymentPage\Sessions($connector); - $sessionData = $hpp->create($session); - - print_r($sessionData); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php deleted file mode 100644 index 111a6d76918..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/disable_session.php +++ /dev/null @@ -1,57 +0,0 @@ -disable(); - - echo 'The session has been disabled'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php deleted file mode 100644 index 89925f946a3..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/distribute_link.php +++ /dev/null @@ -1,67 +0,0 @@ - [ - "email" => "test@example.com", - "phone" => "07000212345", - "phone_country" => "SE" - ], - "method" => "sms", - "template" => "INSTORE_PURCHASE" - ]; - - $session = new Klarna\Rest\HostedPaymentPage\Sessions($connector, $sessionId); - $session->distributeLink($data); - - echo 'The session link has been distributed'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php deleted file mode 100644 index 9d6f731b7fe..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/HostedPaymentPageAPI/Sessions/get_hpp_session_status.php +++ /dev/null @@ -1,57 +0,0 @@ -getSessionStatus(); - - print_r($status); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php deleted file mode 100644 index 76218fa0e42..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/create_button_key.php +++ /dev/null @@ -1,111 +0,0 @@ - 'John Doe', - 'merchant_urls' => [ - 'place_order' => 'https://example.com/place-callback', - 'push' => 'https://example.com/push-callback', - 'confirmation' => 'https://example.com/confirmation-callback', - 'terms' => 'https://example.com/terms-callback', - 'notification' => 'https://example.com/notification-callback', - 'update' => 'https://example.com/update-callback', - ], - 'purchase_currency' => 'EUR', - 'purchase_country' => 'DE', - 'billing_countries' => ["UK", "DE", "SE"], - 'shipping_countries' => ["UK", "DE", "SE"], - 'locale' => 'en-US', - 'order_amount' => 50000, - 'order_tax_amount' => 0, - 'order_lines' => [ - [ - 'name' => 'Red T-Shirt', - 'type' => 'physical', - 'reference' => '19-402-USA', - 'quantity' => 5, - 'quantity_unit' => 'pcs', - 'tax_rate' => 0, - 'total_amount' => 50000, - 'total_discount_amount' => 0, - 'total_tax_amount' => 0, - 'unit_price' => 10000, - 'product_url' => 'https://www.estore.com/products/f2a8d7e34', - 'image_url' => 'https://www.exampleobjects.com/logo.png', - 'product_identifiers' => - [ - 'category_path' => 'Electronics Store > Computers & Tablets > Desktops', - 'global_trade_item_number' => '735858293167', - 'manufacturer_part_number' => 'BOXNUC5CPYH', - 'brand' => 'Intel', - ], - ], - ], - 'shipping_options' => [ - [ - 'id' => 'my-shipping-id', - 'name' => 'Pickup Store', - 'description' => 'My custom description', - 'promo' => 'string', - 'price' => 10, - 'tax_amount' => 0, - 'tax_rate' => 0, - 'preselected' => true, - 'shipping_method' => 'PICKUPSTORE', - ], - ], - ]; - $button = $buttonsApi->create($data); - - echo 'Button has been successfully created' . PHP_EOL; - print_r($button); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php deleted file mode 100644 index 565d2c4b7c9..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/see_button_key_options.php +++ /dev/null @@ -1,57 +0,0 @@ -retrieve(); - - print_r($button->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php deleted file mode 100644 index 6318c44bd73..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/ButtonKeys/update_button_key.php +++ /dev/null @@ -1,81 +0,0 @@ - 'New name', - 'merchant_urls' => [ - 'place_order' => 'https://example.com/place-callback', - 'push' => 'https://example.com/push-callback', - 'confirmation' => 'https://example.com/confirmation-callback', - 'terms' => 'https://example.com/terms-callback', - 'notification' => 'https://example.com/notification-callback', - 'update' => 'https://example.com/update-callback', - ], - 'shipping_options' => [ - [ - 'id' => 'my-new-shipping-id', - 'name' => 'Priority delivery', - 'description' => '', - 'price' => 300, - 'tax_amount' => 0, - 'tax_rate' => 0, - 'preselected' => false, - 'shipping_method' => 'PRIME_DELIVERY', - ], - ], - ]; - $button = $buttonsApi->update($data); - - echo 'Button has been successfully updated' . PHP_EOL; - print_r($button); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php deleted file mode 100644 index 494f40609f2..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/approve_order.php +++ /dev/null @@ -1,122 +0,0 @@ - https://github.com/klarna/kco_rest_php/#api-credentials - * - * Make sure that your credentials belong to the right endpoint. If you have credentials for the US Playground, - * such credentials will not work for the EU Playground and you will get 401 Unauthorized exception. - */ -$merchantId = getenv('USERNAME') ?: 'K123456_abcd12345'; -$sharedSecret = getenv('PASSWORD') ?: 'sharedSecret'; -$authToken = getenv('AUTH_TOKEN') ?: 'authorization_token'; - -/* -EU_BASE_URL = 'https://api.klarna.com' -EU_TEST_BASE_URL = 'https://api.playground.klarna.com' -NA_BASE_URL = 'https://api-na.klarna.com' -NA_TEST_BASE_URL = 'https://api-na.playground.klarna.com' -OC_BASE_URL = 'https://api-oc.klarna.com' -OC_TEST_BASE_URL = 'https://api-oc.playground.klarna.com' -*/ -$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; - -$connector = Klarna\Rest\Transport\GuzzleConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint -); - -$order = [ - "order_id" => "f3392f8b-6116-4073-ab96-e330819e2c07", - "purchase_country" => "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "billing_address" => [ - "given_name" => "Jane", - "family_name"=> "Doe", - "email"=> "jane-doe@example.com", - "title"=> "Ms", - "street_address"=> "Lombard St 10", - "street_address2"=> "Apt 214", - "postal_code"=> "90210", - "city"=> "Beverly Hills", - "region"=> "CA", - "phone"=> "333444555", - "country"=> "US" - ], - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ], - "merchant_urls" => [ - "terms" => "https://example.com/toc", - "checkout" => "https://example.com/checkout?klarna_order_id={checkout.order.id}", - "confirmation" => "https://example.com/thank-you?klarna_order_id={checkout.order.id}", - "push" => "https://example.com/create_order?klarna_order_id={checkout.order.id}" - ], - "customer" => [ - "date_of_birth" => "1995-10-20", - "title" => "Mr", - "gender" => "male", - "last_four_ssn" => "0512", - "national_identification_number" => "3108971100", - "type" => "person", - "vat_id" => "string", - "organization_registration_id" => "556737-0431", - "organization_entity_type" => "LIMITED_COMPANY" - ] -]; - -try { - $orderApi = new Klarna\Rest\InstantShopping\Orders($connector, $authToken); - $status = $orderApi->approve($order); - - echo 'The order has been approved' . PHP_EOL; - print_r($status); -} catch (Exception $e) { - echo 'Caught exception => ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php deleted file mode 100644 index 3a1ee128525..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/decline_order.php +++ /dev/null @@ -1,62 +0,0 @@ - "https://example.com/rejected.html", - "deny_code" => "other", - "deny_message" => "You are not permitted to purchase this product", - ]; - $orderApi->decline($data); - echo 'The order has been declined'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php deleted file mode 100644 index a9570c577cf..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/InstantShoppingAPI/Orders/retrieve_order.php +++ /dev/null @@ -1,57 +0,0 @@ -retrieve(); - - print_r($order->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php deleted file mode 100644 index 5c268b449dc..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/add_shipping_info.php +++ /dev/null @@ -1,72 +0,0 @@ -fetchCapture($captureId); - $capture->addShippingInfo([ - "shipping_info" => [ - [ - "shipping_company" => "DHL", - "shipping_method" => "Home", - "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", - "tracking_number" => "1234567890", - "return_tracking_number" => "E-55-KL", - "return_shipping_company" => "DHL", - "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" - ] - ] - ]); - - echo 'Shipping info has been appended'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php deleted file mode 100644 index 6052df03c3b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/trigger_send_out.php +++ /dev/null @@ -1,60 +0,0 @@ -fetchCapture($captureId); - $capture->triggerSendout(); - - echo 'Triggered a new send out of customer payment communication'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php deleted file mode 100644 index db7151a2352..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Captures/update_customer_details.php +++ /dev/null @@ -1,65 +0,0 @@ -fetchCapture($captureId); - $capture->updateCustomerDetails([ - "billing_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ] - ]); - - echo 'Billing address of the customer has been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php deleted file mode 100644 index 9cf3ebbbfaa..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/acknowledge_order.php +++ /dev/null @@ -1,60 +0,0 @@ -acknowledge(); - - echo 'Order has been acknowledged'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php deleted file mode 100644 index 2a04a1431ea..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/cancel_order.php +++ /dev/null @@ -1,59 +0,0 @@ -cancel(); - - echo 'Order has been cancelled'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php deleted file mode 100644 index d5721c1569e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/create_capture.php +++ /dev/null @@ -1,87 +0,0 @@ -createCapture([ - "captured_amount" => 6000, - "description" => "Shipped part of the order", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ] - ], - "shipping_info" => [ - [ - "shipping_company" => "DHL", - "shipping_method" => "Home", - "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", - "tracking_number" => "1234567890", - "return_tracking_number" => "E-55-KL", - "return_shipping_company" => "DHL", - "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" - ] - ] - ]); - - echo 'Capture has been created'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php deleted file mode 100644 index 6e164fa7600..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php +++ /dev/null @@ -1,57 +0,0 @@ -extendAuthorizationTime(); - - echo 'The expiry time of an order has been extend'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php deleted file mode 100644 index 7ae89e83f83..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php +++ /dev/null @@ -1,58 +0,0 @@ -fetchCaptures(); - foreach ($captures as $capture) { - print_r($capture->getArrayCopy()); - } -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php deleted file mode 100644 index 50ee23ead75..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_capture.php +++ /dev/null @@ -1,58 +0,0 @@ -fetchCapture($captureId); - - print_r($capture->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php deleted file mode 100644 index b611ad5a272..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/fetch_order.php +++ /dev/null @@ -1,57 +0,0 @@ -fetch(); - - print_r($order->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php deleted file mode 100644 index 5b1cca93153..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php +++ /dev/null @@ -1,59 +0,0 @@ -releaseRemainingAuthorization(); - - echo 'Remaining authorised amount has been released'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php deleted file mode 100644 index 87f77cafd42..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_customer_details.php +++ /dev/null @@ -1,68 +0,0 @@ -updateCustomerDetails([ - "billing_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ], - "shipping_address" => [ - "email" => "user@example.com", - "phone" => "57-3895734" - ] - ]); - - echo 'Customer details have been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php deleted file mode 100644 index b50574487f1..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_merchant_references.php +++ /dev/null @@ -1,63 +0,0 @@ -updateMerchantReferences([ - "merchant_reference1" => "15632423", - "merchant_reference2" => "special order" - ]); - - echo 'Merchant references have been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php deleted file mode 100644 index 561ac15d817..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Orders/update_order_lines.php +++ /dev/null @@ -1,75 +0,0 @@ -updateAuthorization([ - "order_amount" => 6000, - "description" => "Removed bad bananas", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ] - ] - ]); - - echo 'New order amount and order lines have been set'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php deleted file mode 100644 index e5673834184..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/fetch_refund.php +++ /dev/null @@ -1,58 +0,0 @@ -fetchRefund($refundId); - - print_r($capture->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php deleted file mode 100644 index 63e72cb571c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/OrderManagementAPI/Refunds/refund_order.php +++ /dev/null @@ -1,76 +0,0 @@ -refund([ - "refunded_amount" => 3000, - "description" => "Refunding half the tomatoes", - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 5, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 3000, - "total_tax_amount" => 600 - ] - ] - ]); - - $refund->fetch(); - print_r($refund->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php deleted file mode 100644 index ee0477a1d6d..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php +++ /dev/null @@ -1,57 +0,0 @@ -cancelAuthorization(); - - echo 'Authorization has been cancelled'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php deleted file mode 100644 index f742d5976c5..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/create_order.php +++ /dev/null @@ -1,106 +0,0 @@ - "John", - "family_name" => "Doe", - "email" => "johndoe@example.com", - "title" => "Mr", - "street_address" => "13 New Burlington St", - "street_address2" => "Apt 214", - "postal_code" => "W13 3BG", - "city" => "London", - "region" => "", - "phone" => "01895808221", - "country" => "GB" -]; - -$data = [ - "billing_address" => $address, - "shipping_address" => $address, - "purchase_country" => "GB", - "purchase_currency" => "GBP", - "locale" => "en-GB", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); - $data = $order->create($data); - - print_r($data); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php deleted file mode 100644 index db15da2bf1c..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Orders/generate_customer_token.php +++ /dev/null @@ -1,82 +0,0 @@ - "GB", - "purchase_currency" => "GBP", - "locale" => "en-GB", - "billing_address" => [ - "given_name" => "John", - "family_name" => "Doe", - "email" => "johndoe@example.com", - "title" => "Mr", - "street_address" => "13 New Burlington St", - "street_address2" => "Apt 214", - "postal_code" => "W13 3BG", - "city" => "London", - "region" => "", - "phone" => "01895808221", - "country" => "GB" - ], - "customer" => [ // MUST MATCH line by line to the customer details that was used to get an Authorization Token - "date_of_birth" => "1970-01-01", - "gender" => "male", - ], - "description" => "For testing purposes", - "intended_use" => "SUBSCRIPTION" -]; - -try { - $order = new Klarna\Rest\Payments\Orders($connector, $authorizationToken); - $token = $order->generateToken($data); - - print_r($token); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php deleted file mode 100644 index 216b32cd5c9..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/create_new_credit_session.php +++ /dev/null @@ -1,96 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 10000, - "order_tax_amount" => 2000, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "123050", - "name" => "Tomatoes", - "quantity" => 10, - "quantity_unit" => "kg", - "unit_price" => 600, - "tax_rate" => 2500, - "total_amount" => 6000, - "total_tax_amount" => 1200 - ], - [ - "type" => "physical", - "reference" => "543670", - "name" => "Bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $session = new Klarna\Rest\Payments\Sessions($connector); - $session->create($order); - - // Store session id - $sessionId = $session->getId(); - - // Get some data if needed - echo <<getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php deleted file mode 100644 index bbb87c9635d..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/read_credit_session.php +++ /dev/null @@ -1,57 +0,0 @@ -fetch(); - - print_r($session->getArrayCopy()); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php deleted file mode 100644 index 5be79859d9f..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/PaymentsAPI/Sessions/update_credit_session.php +++ /dev/null @@ -1,79 +0,0 @@ - "gb", - "purchase_currency" => "gbp", - "locale" => "en-gb", - "order_amount" => 4000, - "order_tax_amount" => 800, - "order_lines" => [ - [ - "type" => "physical", - "reference" => "543670", - "name" => "New updated bananas", - "quantity" => 1, - "quantity_unit" => "bag", - "unit_price" => 5000, - "tax_rate" => 2500, - "total_amount" => 4000, - "total_discount_amount" => 1000, - "total_tax_amount" => 800 - ] - ] -]; - -try { - $session = new Klarna\Rest\Payments\Sessions($connector, $sessionId); - $session->update($order); - - echo 'Order has been updated'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php deleted file mode 100644 index b6dfffb3945..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_all_payouts.php +++ /dev/null @@ -1,61 +0,0 @@ -getAllPayouts([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT), - 'size' => 10, - ]); - - print_r($payouts); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php deleted file mode 100644 index 80e43521c26..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_payout.php +++ /dev/null @@ -1,57 +0,0 @@ -getPayout($paymentReference); - - print_r($payout); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php deleted file mode 100644 index 35d08e5a704..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Payouts/get_summary.php +++ /dev/null @@ -1,61 +0,0 @@ -getSummary([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT) - ]); - - print_r($summary); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php deleted file mode 100644 index 1a7853c3541..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_csv.php +++ /dev/null @@ -1,58 +0,0 @@ -getCSVPayoutReport($paymentReference); - - file_put_contents('report.csv', $report); - echo 'Saved to report.csv'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php deleted file mode 100644 index 6666b77cc5b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/payout_report_pdf.php +++ /dev/null @@ -1,58 +0,0 @@ -getPDFPayoutReport($paymentReference); - - file_put_contents('report.pdf', $report); - echo 'Saved to report.pdf'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php deleted file mode 100644 index 0f68fdbccf6..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_cvs.php +++ /dev/null @@ -1,62 +0,0 @@ -getCSVPayoutsSummaryReport([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT) - ]); - - file_put_contents('summary_report.csv', $report); - echo 'Saved to summary_report.csv'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php deleted file mode 100644 index 2d67e710daa..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Reports/summary_report_pdf.php +++ /dev/null @@ -1,62 +0,0 @@ -getPDFPayoutsSummaryReport([ - 'start_date' => (new DateTime('-1 year'))->format(DATE_FORMAT), - 'end_date' => (new DateTime())->format(DATE_FORMAT) - ]); - - file_put_contents('summary_report.pdf', $report); - echo 'Saved to summary_report.pdf'; -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php deleted file mode 100644 index 36db249f4e0..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/SettlementsAPI/Transactions/get_transactions.php +++ /dev/null @@ -1,61 +0,0 @@ - 10, // How many elements to include in the result - 'offset' => 0, // The current offset. Describes "where" in a collection the current starts - ]; - $data = $transactions->getTransactions($params); - - print_r($data); -} catch (Exception $e) { - echo 'Caught exception: ' . $e->getMessage() . "\n"; -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md b/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md deleted file mode 100644 index cac0461a18e..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/docs/http_transport.md +++ /dev/null @@ -1,79 +0,0 @@ -How to use SDK HTTP Transport -======================================================== - -The SDK functionality relies on an "HTTP Transport" mechanism to handle HTTP communication -(requests / responses). The mechanism is decoupled from the SDK implementation itself -and allows for usage of different libraries that can handle the HTTP communication. - -All the transports should be responsible to get the information to be send and return the result. -There is no any SDK/Api Resources logic inside the transport. - -Previously the SDK used Guzzle HTTP library and it forces SDK users to use Composer. There was no -ability to install the Guzzle library manually. Currently, there is a new cURL Transport, that -allows to use the PHP SDK without Composer and any other extra dependencies. - -## Basic Transport Usage - -The basic SDK usage looks like in the example. You need to create an HTTP Transport connector -and pass the connector to the API Service resource: - -```php -$connector = Klarna\Rest\Transport\Connector::create($merchantId, $sharedSecret, $apiEndpoint); -$api = new Klarna\Rest\ApiService\Resource($connector); -$api->someMethod($someData); -``` - -## Guzzle HTTP Transport (Klarna\Rest\Transport\GuzzleConnector) - -By default all the SDK examples use Guzzle HTTP Transport (Composer is required in this case). -You need to include the SDK into your PHP file using the Composer autoloader: - -```php -require('/path/to/project/vendor/autoload.php'); - -$merchantId = 'K123456_abcd12345'; -$sharedSecret = 'sharedSecret'; -$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; - -// Create Guzzle HTTP Transport Connector -$connector = Klarna\Rest\Transport\GuzzleConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint -); - -$checkout = new Klarna\Rest\Checkout\Order($connector); -$checkout->create($order); -``` - -## cURL HTTP Transport (Klarna\Rest\Transport\CURLConnector) - -The transport uses PHP cURL Library (libcurl): https://www.php.net/manual/en/book.curl.php - -This library does not require any Composer libraries and relies only on `libcurl`. It means you -do not have any `vendor` autoloader and need to include the SDK SPL autoloader. - -```php -// `src` instead of vendor -require('/path/to/project/src/autoload.php'); - -$merchantId = 'K123456_abcd12345'; -$sharedSecret = 'sharedSecret'; -$apiEndpoint = Klarna\Rest\Transport\ConnectorInterface::EU_TEST_BASE_URL; - -// Create cURL HTTP Transport Connector -$connector = Klarna\Rest\Transport\CURLConnector::create( - $merchantId, - $sharedSecret, - $apiEndpoint -); - -$checkout = new Klarna\Rest\Checkout\Order($connector); -$checkout->create($order); -``` - -## HTTP Transport Response and Exceptions - -All the Transports should implement the `ConnectorInterface` interface. It imposes some restrictions: -- The only allowed response is [ApiResponse](https://github.com/klarna/kco_rest_php/blob/v4.1/src/Klarna/Rest/Transport/ApiResponse.php) -- The only allowed exceptions that can be thrown from the Transport is `RuntimeException`. diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php deleted file mode 100644 index 1cbc8991d58..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Exceptions/NotApplicableException.php +++ /dev/null @@ -1,27 +0,0 @@ -post(self::$path, $data) - ->expectSuccessfull() + $url = $this->post(self::$path, $data) ->status('201') - ->contentType('application/json'); + ->getLocation(); - $this->exchangeArray($response->getJson()); - $this->setLocation($response->getLocation()); + $this->setLocation($url); return $this; } @@ -103,13 +100,12 @@ public function create(array $data) */ public function update(array $data) { - $response = $this->post($this->getLocation(), $data) - ->expectSuccessfull() + $data = $this->post($this->getLocation(), $data) ->status('200') ->contentType('application/json') ->getJson(); - $this->exchangeArray($response); + $this->exchangeArray($data); return $this; } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php deleted file mode 100644 index e6c1c56da10..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/CustomerToken/Tokens.php +++ /dev/null @@ -1,116 +0,0 @@ -setLocation(self::$path . "/{$customerToken}"); - $this[static::ID_FIELD] = $customerToken; - } - - /** - * Creates order using Customer Token. - * - * @param array $data Order data - * @param string $klarnaIdempotencyKey Idempotency Key - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array created order data - */ - public function createOrder(array $data, $klarnaIdempotencyKey = null) - { - $headers = ['Content-Type' => 'application/json']; - if (!is_null($klarnaIdempotencyKey)) { - $headers['Klarna-Idempotency-Key'] = $klarnaIdempotencyKey; - } - - return $this->request( - 'POST', - $this->getLocation() . '/order', - $headers, - $data !== null ? \json_encode($data) : null - ) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Update the status of a customer token. - * - * @param array $data Customer token data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function updateTokenStatus(array $data) - { - $this->patch($this->getLocation() . '/status', $data) - ->expectSuccessfull() - ->status('202'); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php deleted file mode 100644 index b7f757daf4b..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/HostedPaymentPage/Sessions.php +++ /dev/null @@ -1,145 +0,0 @@ -setLocation(self::$path . "/{$sessionId}"); - $this[static::ID_FIELD] = $sessionId; - } - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-create-a-new-hpp-session - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Session data - */ - public function create(array $data) - { - $response = $this->post(self::$path, $data) - ->expectSuccessfull() - ->status('201') - ->contentType('application/json') - ->getJson(); - - return $response; - } - - /** - * Disables HPP session. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-disable-hpp-session - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If sessionId was not specified when creating a resource - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function disable() - { - if (empty($this[static::ID_FIELD])) { - throw new \RuntimeException('HPP Session ID is not defined'); - } - - $this->delete($this->getLocation()) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Distributes link to the HPP session. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session - * - * @param array $data Distribute data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function distributeLink(array $data) - { - $this->post($this->getLocation() . '/distribution', $data) - ->expectSuccessfull() - ->status(['200', '201']); - - return $this; - } - - /** - * @deprecated HPP API no longer suppors getting the status. Use fetch (getSession) to fetch data; - * @deprecated This method will be removed in the future versions of SDK. - */ - public function getSessionStatus() - { - return $this->fetch(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php deleted file mode 100644 index 352616d1d34..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/ButtonKeys.php +++ /dev/null @@ -1,137 +0,0 @@ -setLocation(self::$path . "/{$buttonKey}"); - $this[static::ID_FIELD] = $buttonKey; - } - } - - /** - * Creates a button key based on setup options. - * - * @param array $data Creation data - * - * @see https://developers.klarna.com/api/#instant-shopping-api-create-a-button-key-based-on-setup-options - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Button properties - */ - public function create(array $data) - { - $response = $this->post(self::$path, $data) - ->expectSuccessfull() - ->status('201') - ->contentType('application/json'); - - $url = $response->getLocation(); - $this->setLocation($url); - - return $response->getJson(); - } - - /** - * Updates the setup options for a specific button key. - * - * @param array $data Update data - * - * @see https://developers.klarna.com/api/#instant-shopping-api-update-the-setup-options-for-a-specific-button-key - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \RuntimeException If key was not specified when creating a resource - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Button properties - */ - public function update(array $data) - { - if (empty($this[static::ID_FIELD])) { - throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); - } - - return $this->put($this->getLocation(), $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * See the setup options for a specific button key. - * - * @see https://developers.klarna.com/api/#instant-shopping-api-see-the-setup-options-for-a-specific-button-key - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If key was not specified when creating a resource - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function retrieve() - { - if (empty($this[static::ID_FIELD])) { - throw new \RuntimeException(static::ID_FIELD . ' property is not defined'); - } - - return $this->fetch(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php deleted file mode 100644 index 0522f2d97eb..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/InstantShopping/Orders.php +++ /dev/null @@ -1,128 +0,0 @@ -setLocation(self::$path . "/{$authorizationToken}"); - $this[static::ID_FIELD] = $authorizationToken; - } - - /** - * Retrieves an authorized order based on the authorization token. - * - * @codingStandardsIgnoreStart - * @see https://developers.klarna.com/api/#instant-shopping-api-retrieves-an-authorized-order-based-on-the-authorization-token - * @codingStandardsIgnoreEnd - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function retrieve() - { - return $this->fetch(); - } - - /** - * Declines an authorized order identified by the authorization token. - * - * @codingStandardsIgnoreStart - * @see https://developers.klarna.com/api/#instant-shopping-api-declines-an-authorized-order-identified-by-the-authorization-token - * @codingStandardsIgnoreEnd - * - * @param array $data Decline data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function decline(array $data = null) - { - $this->delete($this->getLocation(), $data) - ->expectSuccessfull() - ->status('204'); - - return $this; - } - - /** - * Approves the authorized order and places an order identified by the authorization token. - * - * @codingStandardsIgnoreStart - * @see https://developers.klarna.com/api/#instant-shopping-api-approve-the-authorized-order-and-place-an-order-identified-by-the-authorization-token - * @codingStandardsIgnoreEnd - * - * @param array $data Order data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array approving status - */ - public function approve(array $data) - { - return $this->post($this->getLocation() . '/orders', $data) - ->expectSuccessfull() - ->status('200') - ->getJson(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php deleted file mode 100644 index a2cae563914..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/MerchantCardService/VCCSettlements.php +++ /dev/null @@ -1,151 +0,0 @@ -post(self::$path, $data) - ->expectSuccessfull() - ->status('201') - ->contentType('application/json') - ->getJson(); - - return $response; - } - - /** - * Retrieve an existing settlement. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session - * - * @param array $data Distribute data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Settlement data - */ - public function retrieveSettlement($settlementId, $keyId) - { - $response = $this->request( - 'GET', - self::$path . "/$settlementId", - ['KeyId' => $keyId] - ) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - return $response; - } - - /** - * Retrieves a settled order's settlement. - * - * @see https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session - * - * @param array $data Distribute data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Order's settlement data - */ - public function retrieveOrderSettlement($orderId, $keyId) - { - $response = $this->request( - 'GET', - self::$path . "/order/$orderId", - ['KeyId' => $keyId] - ) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - return $response; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php index 05a7ae0e648..6f1a85b618e 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Capture.php @@ -21,16 +21,17 @@ use GuzzleHttp\Exception\RequestException; use Klarna\Rest\Resource; -use Klarna\Rest\Transport\ConnectorInterface; +use Klarna\Rest\Transport\Connector; use Klarna\Rest\Transport\Exception\ConnectorException; /** - * Order Management: Capture resource. + * Capture resource. * - * @example docs/examples/OrderManagementAPI/Captures/add_shipping_info.php - * @example docs/examples/OrderManagementAPI/Captures/fetch_captures.php - * @example docs/examples/OrderManagementAPI/Captures/trigger_send_out.php - * @example docs/examples/OrderManagementAPI/Captures/update_customer_details.php + * @example docs/examples/order/fetch_capture.php + * @example docs/examples/order/create_capture.php + * @example docs/examples/capture/append_shipping_info.php + * @example docs/examples/capture/trigger_send_out.php + * @example docs/examples/capture/update_customer_details.php */ class Capture extends Resource { @@ -45,13 +46,13 @@ class Capture extends Resource public static $path = '/captures'; /** - * Constructs a Capture instance. + * Constructs an order instance. * - * @param ConnectorInterface $connector HTTP transport connector + * @param Connector $connector HTTP transport connector * @param string $orderUrl Parent order resource url * @param string $captureId Capture ID */ - public function __construct(ConnectorInterface $connector, $orderUrl, $captureId = null) + public function __construct(Connector $connector, $orderUrl, $captureId = null) { parent::__construct($connector); @@ -80,7 +81,6 @@ public function __construct(ConnectorInterface $connector, $orderUrl, $captureId public function create(array $data) { $url = $this->post($this->getLocation(), $data) - ->expectSuccessfull() ->status('201') ->getLocation(); @@ -104,7 +104,6 @@ public function create(array $data) public function addShippingInfo(array $data) { $this->post($this->getLocation() . '/shipping-info', $data) - ->expectSuccessfull() ->status('204'); return $this; @@ -125,7 +124,6 @@ public function addShippingInfo(array $data) public function updateCustomerDetails(array $data) { $this->patch($this->getLocation() . '/customer-details', $data) - ->expectSuccessfull() ->status('204'); return $this; @@ -144,7 +142,6 @@ public function updateCustomerDetails(array $data) public function triggerSendout() { $this->post($this->getLocation() . '/trigger-send-out') - ->expectSuccessfull() ->status('204'); return $this; diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php index c41804facac..a13dfcb67d2 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Order.php @@ -21,23 +21,22 @@ use GuzzleHttp\Exception\RequestException; use Klarna\Rest\Resource; -use Klarna\Rest\Transport\ConnectorInterface; +use Klarna\Rest\Transport\Connector; use Klarna\Rest\Transport\Exception\ConnectorException; /** - * Order management: Order resource. + * Order management resource. * - * @example docs/examples/OrderManagementAPI/Orders/acknowledge_order.php - * @example docs/examples/OrderManagementAPI/Orders/cancel_order.php - * @example docs/examples/OrderManagementAPI/Orders/create_capture.php - * @example docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php - * @example docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php - * @example docs/examples/OrderManagementAPI/Orders/fetch_capture.php - * @example docs/examples/OrderManagementAPI/Orders/fetch_order.php - * @example docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php - * @example docs/examples/OrderManagementAPI/Orders/update_customer_details.php - * @example docs/examples/OrderManagementAPI/Orders/update_merchant_references.php - * @example docs/examples/OrderManagementAPI/Orders/update_order_lines.php + * @example docs/examples/order/acknowledge_order.php + * @example docs/examples/order/cancel_order.php + * @example docs/examples/order/extend_authorization_time.php + * @example docs/examples/order/fetch_order.php + * @example docs/examples/order/fetch_capture.php + * @example docs/examples/order/refund_order.php + * @example docs/examples/order/release_remaining_authorization.php + * @example docs/examples/order/update_customer_details.php + * @example docs/examples/order/update_merchant_references.php + * @example docs/examples/order/update_order_lines.php */ class Order extends Resource { @@ -54,10 +53,10 @@ class Order extends Resource /** * Constructs an order instance. * - * @param ConnectorInterface $connector HTTP transport connector + * @param Connector $connector HTTP transport connector * @param string $orderId Order ID */ - public function __construct(ConnectorInterface $connector, $orderId) + public function __construct(Connector $connector, $orderId) { parent::__construct($connector); @@ -99,28 +98,6 @@ public function fetch() $this['captures'] = $captures; - - // Convert refunds data to Refund[] - if (isset($this['refunds'])) { - $refunds = []; - foreach ($this['refunds'] as $refund) { - $refundId = null; - if (isset($refund[Refund::ID_FIELD])) { - $refundId = $refund[Refund::ID_FIELD]; - } - - $object = new Refund( - $this->connector, - $this->getLocation(), - $refundId - ); - $object->exchangeArray($refund); - - $refunds[] = $object; - } - $this['refunds'] = $refunds; - } - return $this; } @@ -137,7 +114,6 @@ public function fetch() public function acknowledge() { $this->post($this->getLocation() . '/acknowledge') - ->expectSuccessfull() ->status('204'); return $this; @@ -156,14 +132,13 @@ public function acknowledge() public function cancel() { $this->post($this->getLocation() . '/cancel') - ->expectSuccessfull() ->status('204'); return $this; } /** - * Updates the authorization data. Sets new order amount and order lines + * Updates the authorization data. * * @param array $data Authorization data * @@ -177,7 +152,6 @@ public function cancel() public function updateAuthorization(array $data) { $this->patch($this->getLocation() . '/authorization', $data) - ->expectSuccessfull() ->status('204'); return $this; @@ -196,7 +170,6 @@ public function updateAuthorization(array $data) public function extendAuthorizationTime() { $this->post($this->getLocation() . '/extend-authorization-time') - ->expectSuccessfull() ->status('204'); return $this; @@ -217,7 +190,6 @@ public function extendAuthorizationTime() public function updateMerchantReferences(array $data) { $this->patch($this->getLocation() . '/merchant-references', $data) - ->expectSuccessfull() ->status('204'); return $this; @@ -238,7 +210,6 @@ public function updateMerchantReferences(array $data) public function updateCustomerDetails(array $data) { $this->patch($this->getLocation() . '/customer-details', $data) - ->expectSuccessfull() ->status('204'); return $this; @@ -254,14 +225,14 @@ public function updateCustomerDetails(array $data) * @throws \RuntimeException If the API replies with an unexpected response * @throws \LogicException When Guzzle cannot populate the response * - * @return Refund + * @return self */ public function refund(array $data) { - $refund = new Refund($this->connector, $this->getLocation()); - $refund->create($data); + $this->post($this->getLocation() . '/refunds', $data) + ->status(['201', '204']); - return $refund; + return $this; } /** @@ -277,7 +248,6 @@ public function refund(array $data) public function releaseRemainingAuthorization() { $this->post($this->getLocation() . '/release-remaining-authorization') - ->expectSuccessfull() ->status('204'); return $this; @@ -344,64 +314,4 @@ public function fetchCapture($captureId) return $capture; } - - /** - * Fetches the specified refund. - * - * @param string $refundId Refund ID - * - * @see Refund::fetch() For more information on how to fetch a refund - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Refund - */ - public function fetchRefund($refundId) - { - if ($this->offsetExists('refunds')) { - foreach ($this['refunds'] as $refund) { - if ($refund->getId() !== $refundId) { - continue; - } - - return $refund; - } - } - - $refund = new Refund($this->connector, $this->getLocation(), $refundId); - $refund->fetch(); - - $this['refunds'][] = $refund; - - return $refund; - } - - /** - * Fetches all captures. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return Capture[] - */ - public function fetchCaptures() - { - $captures = new Capture($this->connector, $this->getLocation()); - $captures = $captures->fetch()->getArrayCopy(); - - foreach ($captures as $id => $capture) { - $captures[$id] = new Capture($this->connector, $this->getLocation(), $capture['capture_id']); - $captures[$id]->exchangeArray($capture); - } - return $captures; - } } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php deleted file mode 100644 index ab6045220ca..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/OrderManagement/Refund.php +++ /dev/null @@ -1,89 +0,0 @@ -setLocation($url); - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $url = $this->post($this->getLocation(), $data) - ->expectSuccessfull() - ->status('201') - ->getLocation(); - - $this->setLocation($url); - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php deleted file mode 100644 index da538388b11..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Orders.php +++ /dev/null @@ -1,141 +0,0 @@ -setLocation(self::$path . "/{$authorizationToken}"); - $this[static::ID_FIELD] = $authorizationToken; - } - - /** - * Not applicable. - * - * @throws NotApplicableException - */ - public function fetch() - { - throw new NotApplicableException('Not applicable'); - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Order data - */ - public function create(array $data) - { - return $this->post($this->getLocation() . '/order', $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Cancels the authorization. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function cancelAuthorization() - { - $this->delete($this->getLocation()) - ->expectSuccessfull() - ->status('204'); - // ->contentType('application/json'); - // TODO: We cannot check the Content-type here because of an inconsistency - // between service and documentation. The real Content-Type is - // "application/octet-stream but not the "application/json" as in the docs. - - return $this; - } - - /** - * Generates consumer token. - * - * @param array $data Token data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Token data - */ - public function generateToken(array $data) - { - $response = $this->post($this->getLocation() . '/customer-token', $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - - return $response; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php deleted file mode 100644 index 3923b8e2b55..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Payments/Sessions.php +++ /dev/null @@ -1,117 +0,0 @@ -setLocation(self::$path . "/{$sessionId}"); - $this[static::ID_FIELD] = $sessionId; - } - } - - /** - * Creates the resource. - * - * @param array $data Creation data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException If the location header is missing - * @throws \RuntimeException If the API replies with an unexpected response - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function create(array $data) - { - $response = $this->post(self::$path, $data) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json'); - - $this->exchangeArray($response->getJson()); - - // Payments API does not send Location header after creating a new session. - // Use workaround to set new location. - $this->setLocation(self::$path . '/' . $this->getId()); - - return $this; - } - - /** - * Updates the resource. - * - * @param array $data Update data - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return self - */ - public function update(array $data) - { - $this->post($this->getLocation(), $data) - ->expectSuccessfull() - ->status('204'); - // ->contentType('application/json'); - // TODO: We cannot check the Content-type here because of an inconsistency - // between service and documentation. The real Content-Type is - // "application/octet-stream but not the "application/json" as in the docs. - - return $this; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php index 35a78c2e00e..f1f96cebbae 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Resource.php @@ -1,6 +1,6 @@ connector = $connector; } @@ -100,24 +99,6 @@ public function setLocation($url) return $this; } - /** - * Overrides: Stores the ID KEY field in order to restore it after exchanging the array without - * the ID field. - * - * @param array $array Data to be exchanged - */ - public function exchangeArray($array) - { - $id = $this->getId(); - - if (!is_null($array)) { - parent::exchangeArray($array); - } - if (is_null($this->getId()) && !is_null($id)) { - $this->setId($id); - } - } - /** * Fetches the resource. * @@ -133,7 +114,6 @@ public function exchangeArray($array) public function fetch() { $data = $this->get($this->getLocation()) - ->expectSuccessfull() ->status('200') ->contentType('application/json') ->getJson(); @@ -143,87 +123,24 @@ public function fetch() return $this; } - /** - * Sets new ID KEY field. - * - * @param mixed $id ID field - * - * @return self - */ - protected function setId($id) - { - $this[static::ID_FIELD] = $id; - return $this; - } - /** * Sends a HTTP request to the specified url. * - * @param string $method HTTP method, e.g. 'GET' - * @param string $url Request destination - * @param array $headers - * @param string $body + * @param string $method HTTP method, e.g. 'GET' + * @param string $url Request destination + * @param array $options Request options * * @throws ConnectorException When the API replies with an error response * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response' - * @return ResponseValidator When the API replies with an error response + * @throws \LogicException When Guzzle cannot populate the response * + * @return ResponseValidator */ - protected function request($method, $url, array $headers = [], $body = null) + protected function request($method, $url, array $options = []) { - $debug = getenv('DEBUG_SDK') || defined('DEBUG_SDK'); - - if ($debug) { - $methodDebug = str_pad($method, 7, ' ', STR_PAD_LEFT); - $debugHeaders = json_encode($headers); - echo <<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -{$methodDebug} : {$url} -Headers : $debugHeaders - Body : {$body} -\n -DEBUG_BODY; - } + $request = $this->connector->createRequest($url, $method, $options); - switch ($method) { - case Method::GET: - $response = $this->connector->get($url, $headers); - break; - case Method::POST: - $response = $this->connector->post($url, $body, $headers); - break; - case Method::PUT: - $response = $this->connector->put($url, $body, $headers); - break; - case Method::DELETE: - $response = $this->connector->delete($url, $body, $headers); - break; - case Method::PATCH: - $response = $this->connector->patch($url, $body, $headers); - break; - default: - throw new \RuntimeException('Unknown request method ' + $method); - } - - if ($debug) { - $debugHeaders = json_encode($response->getHeaders()); - echo <<getBody()} -\n -DEBUG_BODY; - } - - $location = $response->getLocation(); - if (!empty($location)) { - $this->setLocation($location); - } - - return new ResponseValidator($response); + return new ResponseValidator($this->connector->send($request)); } /** @@ -242,28 +159,6 @@ protected function get($url) return $this->request('GET', $url); } - /** - * Sends a HTTP DELETE request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function delete($url, array $data = null) - { - return $this->request( - 'DELETE', - $url, - ['Content-Type' => 'application/json'], - $data !== null ? json_encode($data) : null - ); - } - /** * Sends a HTTP PATCH request to the specified url. * @@ -278,34 +173,7 @@ protected function delete($url, array $data = null) */ protected function patch($url, array $data) { - return $this->request( - 'PATCH', - $url, - ['Content-Type' => 'application/json'], - json_encode($data) - ); - } - - /** - * Sends a HTTP PUT request to the specified url. - * - * @param string $url Request destination - * @param array $data Data to be JSON encoded - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \LogicException When Guzzle cannot populate the response - * - * @return ResponseValidator - */ - protected function put($url, array $data) - { - return $this->request( - 'PUT', - $url, - ['Content-Type' => 'application/json'], - json_encode($data) - ); + return $this->request('PATCH', $url, ['json' => $data]); } /** @@ -322,11 +190,11 @@ protected function put($url, array $data) */ protected function post($url, array $data = null) { - return $this->request( - 'POST', - $url, - ['Content-Type' => 'application/json'], - $data !== null ? \json_encode($data) : null - ); + $options = []; + if ($data !== null) { + $options['json'] = $data; + } + + return $this->request('POST', $url, $options); } } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php deleted file mode 100644 index bab484fb28f..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Payouts.php +++ /dev/null @@ -1,139 +0,0 @@ -get(self::$path . "/{$paymentReference}") - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Returns a collection of payouts. - * - * @param array $params Additional query params to filter payouts. - * - * @see https://developers.klarna.com/api/#settlements-api-get-all-payouts - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array Payouts data - */ - public function getAllPayouts(array $params = []) - { - return $this->get(self::$path . '?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } - - /** - * Returns a summary of payouts for each currency code in a date range. - * - * @param array $params Additional query params to filter summary data. - * - * @see https://developers.klarna.com/api/#settlements-api-get-summary-of-payouts - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return array summary of payouts - */ - public function getSummary(array $params = []) - { - return $this->get(self::$path . '/summary?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php deleted file mode 100644 index f5f01f7f96d..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Reports.php +++ /dev/null @@ -1,156 +0,0 @@ -get(self::$path . "/payout-with-transactions?payment_reference={$paymentReference}") - ->expectSuccessfull() - ->status('200') - ->contentType('text/csv') - ->getBody(); - } - - /** - * Returns a single settlement summed up in pdf format. - * - * @param string $paymentReference The reference id of the payout. - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return string Binary PDF representation of Payout report - */ - public function getPDFPayoutReport($paymentReference) - { - return $this->get(self::$path . "/payout?payment_reference={$paymentReference}") - ->expectSuccessfull() - ->status('200') - ->contentType('application/pdf') - ->getBody(); - } - - /** - * Returns CSV summary. - * - * @param array $params Additional query params to filter payouts. - * - * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return string CSV Summary report - */ - public function getCSVPayoutsSummaryReport(array $params = []) - { - return $this->get(self::$path . '/payouts-summary-with-transactions?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('text/csv') - ->getBody(); - } - - /** - * Returns PDF summary. - * - * @param array $params Additional query params to filter payouts. - * - * @see https://developers.klarna.com/api/#settlements-api-get-payouts-summary-report-with-transactions - * - * @throws ConnectorException When the API replies with an error response - * @throws RequestException When an error is encountered - * @throws \RuntimeException On an unexpected API response - * @throws \RuntimeException If the response content type is not JSON - * @throws \InvalidArgumentException If the JSON cannot be parsed - * @throws \LogicException When Guzzle cannot populate the response - * - * @return string PDF Summary report - */ - public function getPDFPayoutsSummaryReport(array $params = []) - { - return $this->get(self::$path . '/payouts-summary?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/pdf') - ->getBody(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php deleted file mode 100644 index 6265d08d619..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Settlements/Transactions.php +++ /dev/null @@ -1,84 +0,0 @@ -get(self::$path . '?' . http_build_query($params)) - ->expectSuccessfull() - ->status('200') - ->contentType('application/json') - ->getJson(); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php deleted file mode 100644 index 22964cbb7c8..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ApiResponse.php +++ /dev/null @@ -1,148 +0,0 @@ -setStatus($status); - $this->setBody($body); - $this->setHeaders($headers); - } - /** - * Sets HTTP Status code. - * - * @param status HTTP status - * @return self - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * Gets HTTP Status code. - * - * @return Status code - */ - public function getStatus() - { - return $this->status; - } - - /** - * Sets binary body payload. - * - * @param body Payout - * @return self - */ - public function setBody($body) - { - $this->body = $body; - return $this; - } - - /** - * Gets binary body payload. - * - * @return Payout - */ - public function getBody() - { - return $this->body; - } - - /** - * Sets HTTP headers map - * - * @param headers Headers - * @return self - */ - public function setHeaders($headers) - { - $this->headers = $headers; - return $this; - } - - /** - * Sets single HTTP header value. - * - * @param name Header name - * @param values Header values - * @return self - */ - public function setHeader($name, $values) - { - $this->headers[$name] = $values; - return $this; - } - - /** - * Gets HTTP Headers map - * - * @return Headers - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Gets single header value - * - * @param name Header name - * @return Header values - */ - public function getHeader($name) - { - return isset($this->headers[$name]) ? $this->headers[$name] : null; - } - - /** - * Gets the Location header helper. - * - * @return string Location if exists, null otherwise - */ - public function getLocation() - { - return empty($this->headers['Location']) ? null : $this->headers['Location'][0]; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php deleted file mode 100644 index 439a9b794f9..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/CURLConnector.php +++ /dev/null @@ -1,303 +0,0 @@ -merchantId = $merchantId; - $this->sharedSecret = $sharedSecret; - $this->baseUrl = rtrim($baseUrl, '/'); - - if ($userAgent === null) { - $userAgent = UserAgent::createDefault(['CURLConnector/' . curl_version()['version']]); - } - $this->userAgent = $userAgent; - } - - /** - * Sets CURL request options. - * - * @param options CURL options - * - * @return self instance - */ - public function setOptions($options) - { - $this->options = $options; - return $this; - } - - /** - * Sends HTTP GET request to specified path. - * - * @param string $path URL path. - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function get($path, $headers = []) - { - return $this->request(Method::GET, $path, $headers); - } - - /** - * Sends HTTP POST request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function post($path, $data = null, $headers = []) - { - return $this->request(Method::POST, $path, $headers, $data); - } - - /** - * Sends HTTP PUT request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function put($path, $data = null, $headers = []) - { - return $this->request(Method::PUT, $path, $headers, $data); - } - - /** - * Sends HTTP PATCH request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function patch($path, $data = null, $headers = []) - { - return $this->request(Method::PATCH, $path, $headers, $data); - } - - /** - * Sends HTTP DELETE request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function delete($path, $data = null, $headers = []) - { - return $this->request(Method::DELETE, $path, $headers, $data); - } - - /** - * Performs HTTP(S) request. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - protected function request($method, $url, array $headers = [], $data = null) - { - $headers = array_merge([ - 'User-Agent' => (string) $this->userAgent, - ], $headers); - - if (isset($this->options['headers'])) { - $headers = array_merge($headers, $this->options['headers']); - } - array_walk($headers, function (&$v, $k) { - $v = $k . ': ' . $v; - }); - - $ch = curl_init(); - - if (!empty($this->merchantId)) { - curl_setopt($ch, CURLOPT_USERPWD, $this->merchantId . ':' . $this->sharedSecret); - } - if (!empty($this->options['ssl_cert'])) { - curl_setopt($ch, CURLOPT_SSLCERT, $this->options['ssl_cert']); - if (!empty($this->options['ssl_key'])) { - curl_setopt($ch, CURLOPT_SSLKEY, $this->options['ssl_key']); - } - } - - if (!empty($this->options['timeout'])) { - curl_setopt($ch, CURLOPT_TIMEOUT, $this->options['timeout']); - } - - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - - if ($method == Method::GET) { - curl_setopt($ch, CURLOPT_HTTPGET, 1); - } elseif ($method == Method::POST) { - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - } else { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - } - - curl_setopt($ch, CURLOPT_URL, $this->baseUrl . $url); - curl_setopt($ch, CURLOPT_HEADER, 1); - - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - - if ($proxy = getenv('HTTP_PROXY')) { - $proxy = parse_url($proxy); - - $proxyHost = $proxy['host']; - $proxyPort = $proxy['port'] ? ':' . $proxy['post'] : ''; - curl_setopt($ch, CURLOPT_PROXY, $proxyHost . $proxyPort); - if (!empty($proxy['user'])) { - curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy['user'] . ':' . $proxy['pass']); - } - } - - $response = curl_exec($ch); - - $errno = curl_errno($ch); - $error = curl_error($ch); - $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); - - curl_close($ch); - - // Check the TCP transport issues - if (!empty($errno)) { - throw new \RuntimeException($error, $errno); - } - - $rawHeaders = substr($response, 0, $header_size); - $body = substr($response, $header_size); - $headers = self::parseHeaders($rawHeaders); - - return new ApiResponse($http_code, $body, $headers); - } - - /** - * Factory method to create a connector instance. - * - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param string $baseUrl Base URL for HTTP requests - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - * - * @return self - */ - public static function create( - $merchantId, - $sharedSecret, - $baseUrl = self::EU_BASE_URL, - UserAgentInterface $userAgent = null - ) { - return new static($merchantId, $sharedSecret, $baseUrl, $userAgent); - } - - - /** - * Converts raw curl headers response to array. - * - * @param string $rawHeaders Headers part from the curl response - * - * @return array list of HTTP headers - */ - protected static function parseHeaders($rawHeaders) - { - $headers = []; - foreach (explode("\r\n", $rawHeaders) as $i => $line) { - if (strlen($line) == 0) { - continue; - } - - if (strpos($line, 'HTTP/') !== false) { - // The line contains the HTTP response information - $headers['Http'] = $line; - continue; - } - list($key, $value) = explode(': ', $line); - $headers[ucwords($key, '-_')][] = $value; - } - return $headers; - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php index 602887d7f4f..8a7ebd442d5 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Connector.php @@ -1,6 +1,6 @@ 'https://api.klarna.com']); + * $connector = new \Klarna\Transport\Connector($client, '0', 'sharedSecret'); + * + * + * @param ClientInterface $client HTTP transport client + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + */ + public function __construct( + ClientInterface $client, + $merchantId, + $sharedSecret, + UserAgentInterface $userAgent = null + ) { + $this->client = $client; + $this->merchantId = $merchantId; + $this->sharedSecret = $sharedSecret; + + if ($userAgent === null) { + $userAgent = UserAgent::createDefault(); + } + $this->userAgent = $userAgent; + } + + /** + * Creates a request object. + * + * @param string $url URL + * @param string $method HTTP method + * @param array $options Request options + * + * @return RequestInterface + */ + public function createRequest($url, $method = 'GET', array $options = []) + { + $options['auth'] = [$this->merchantId, $this->sharedSecret]; + $options['headers']['User-Agent'] = strval($this->userAgent); + + return $this->client->createRequest($method, $url, $options); + } + + /** + * Sends the request. + * + * @param RequestInterface $request Request to send + * + * @throws ConnectorException If the API returned an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When the adapter does not populate a response + * + * @return ResponseInterface + */ + public function send(RequestInterface $request) + { + try { + return $this->client->send($request); + } catch (RequestException $e) { + if (!$e->hasResponse()) { + throw $e; + } + + $response = $e->getResponse(); + + if ($response->getHeader('Content-Type') !== 'application/json') { + throw $e; + } + + $data = $response->json(); + + if (!is_array($data) || !array_key_exists('error_code', $data)) { + throw $e; + } + + throw new ConnectorException($data, $e); + } + } + + /** + * Gets the HTTP transport client. + * + * @return ClientInterface + */ + public function getClient() + { + return $this->client; + } + + /** + * Gets the user agent. + * + * @return UserAgentInterface + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Factory method to create a connector instance. + * + * @param string $merchantId Merchant ID + * @param string $sharedSecret Shared secret + * @param string $baseUrl Base URL for HTTP requests + * @param UserAgentInterface $userAgent HTTP user agent to identify the client + * + * @return self + */ + public static function create( + $merchantId, + $sharedSecret, + $baseUrl = self::EU_BASE_URL, + UserAgentInterface $userAgent = null + ) { + $client = new Client(['base_url' => $baseUrl]); + + return new static($client, $merchantId, $sharedSecret, $userAgent); + } } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php index 105d36e0822..4c625fd685f 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/ConnectorInterface.php @@ -21,8 +21,9 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\RequestException; -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; +use GuzzleHttp\Message\RequestInterface; +use GuzzleHttp\Message\ResponseInterface; +use Klarna\Rest\Transport\Exception\ConnectorException; /** * HTTP transport connector interface used to authenticate and make HTTP requests @@ -54,71 +55,40 @@ interface ConnectorInterface const NA_TEST_BASE_URL = 'https://api-na.playground.klarna.com'; /** - * API base URL for Oceania. - */ - const OC_BASE_URL = 'https://api-oc.klarna.com'; - - /** - * Testing API base URL for Oceania. - */ - const OC_TEST_BASE_URL = 'https://api-oc.playground.klarna.com'; - - /** - * Sends HTTP GET request to specified path. + * Creates a request object. * - * @param string $path URL path. - * @param array $headers HTTP request headers - * @return ApiResponse Processed response + * @param string $url URL + * @param string $method HTTP method + * @param array $options Request options * - * @throws RuntimeException if HTTP transport failed to execute a call + * @return RequestInterface */ - public function get($path, $headers = []); + public function createRequest($url, $method = 'GET', array $options = []); /** - * Sends HTTP POST request to specified path. + * Sends the request. * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response + * @param RequestInterface $request Request to send * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function post($path, $data = null, $headers = []); - - /** - * Sends HTTP PUT request to specified path. + * @throws ConnectorException If the API returned an error response + * @throws RequestException When an error is encountered + * @throws \LogicException When the adapter does not populate a response * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call + * @return ResponseInterface */ - public function put($path, $data = null, $headers = []); + public function send(RequestInterface $request); /** - * Sends HTTP PATCH request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response + * Gets the HTTP transport client. * - * @throws RuntimeException if HTTP transport failed to execute a call + * @return ClientInterface */ - public function patch($path, $data = null, $headers = []); + public function getClient(); /** - * Sends HTTP DELETE request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response + * Gets the user agent. * - * @throws RuntimeException if HTTP transport failed to execute a call + * @return UserAgentInterface */ - public function delete($path, $data = null, $headers = []); + public function getUserAgent(); } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php index ce0dcd9d906..aa52c1b10b3 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Exception/ConnectorException.php @@ -19,6 +19,9 @@ namespace Klarna\Rest\Transport\Exception; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Message\ResponseInterface; + /** * ConnectorException is used to represent a API error response. */ @@ -48,25 +51,21 @@ class ConnectorException extends \RuntimeException /** * Constructs a connector exception instance. * - * @param array $data Error data + * @param array $data Error data + * @param RequestException $prev Previous exception */ public function __construct( array $data, - $code = 0 + RequestException $prev ) { - $data = self::setDefaultData($data); - $messages = implode(', ', $data['error_messages']); - $serviceVersion = isset($data['service_version']) ? $data['service_version'] : ''; $message = "{$data['error_code']}: {$messages} (#{$data['correlation_id']})"; - $message .= $serviceVersion ? " ServiceVersion: $serviceVersion" : ''; - parent::__construct($message, $code); + parent::__construct($message, $prev->getCode(), $prev); $this->errorCode = $data['error_code']; $this->messages = $data['error_messages']; $this->correlationId = $data['correlation_id']; - $this->serviceVersion = $serviceVersion; } /** @@ -100,45 +99,12 @@ public function getCorrelationId() } /** - * Gets the API Service version for this exception. - * - * @return string - */ - public function getServiceVersion() - { - return $this->serviceVersion; - } - - /** - * @deprecated Function is not longer used. Will always return null * Gets the HTTP response for this API error. * - * @return null + * @return ResponseInterface */ public function getResponse() { - return null; - } - - private static function setDefaultData($data) - { - $defaults = [ - 'error_code' => 'UNDEFINED', - 'error_messages' => [], - 'correlation_id' => 'UNDEFINED', - ]; - - foreach ($defaults as $field => $default) { - if (!isset($data[$field])) { - $data[$field] = $default; - } - } - - // We need to have a special check for error_message and merge the message to error_messages - if (isset($data['error_message'])) { - array_push($data['error_messages'], $data['error_message']); - } - - return $data; + return $this->getPrevious()->getResponse(); } } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php deleted file mode 100644 index 6c04adb3db0..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/GuzzleConnector.php +++ /dev/null @@ -1,280 +0,0 @@ - 'https://api.klarna.com']); - * $connector = new \Klarna\Transport\Connector($client, '0', 'sharedSecret'); - * - * - * @param ClientInterface $client HTTP transport client - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - */ - public function __construct( - ClientInterface $client, - $merchantId, - $sharedSecret, - UserAgentInterface $userAgent = null - ) { - $this->client = $client; - $this->merchantId = $merchantId; - $this->sharedSecret = $sharedSecret; - - if ($userAgent === null) { - $userAgent = UserAgent::createDefault(['Guzzle/' . ClientInterface::VERSION]); - } - $this->userAgent = $userAgent; - } - - /** - * Sends HTTP GET request to specified path. - * - * @param string $path URL path. - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function get($path, $headers = []) - { - $request = $this->createRequest($path, Method::GET, $headers); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP POST request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function post($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::POST, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP PUT request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function put($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::PUT, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP PATCH request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function patch($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::PATCH, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Sends HTTP DELETE request to specified path. - * - * @param string $path URL path. - * @param string $data Data to be sent to API server in a payload. Example: json-encoded string - * @param array $headers HTTP request headers - * @return ApiResponse Processed response - * - * @throws RuntimeException if HTTP transport failed to execute a call - */ - public function delete($path, $data = null, $headers = []) - { - $request = $this->createRequest($path, Method::DELETE, $headers, $data); - $response = $this->send($request); - return $this->getApiResponse($response); - } - - /** - * Converts ResponseInterface to ApiResponse. - * - * @param response ResponseInterface intance - * @return ApiResponse - */ - protected function getApiResponse(ResponseInterface $response) - { - return new ApiResponse( - $response->getStatusCode(), - $response->getBody()->getContents(), - $response->getHeaders() - ); - } - - /** - * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. - * Creates a request object. - * - * @param string $url URL - * @param string $method HTTP method - * - * @return RequestInterface - */ - public function createRequest($url, $method = 'GET', array $headers = [], $body = null) - { - $headers = array_merge($headers, ['User-Agent' => strval($this->userAgent)]); - return new Request($method, $url, $headers, $body); - } - - /** - * @deprecated No longer used and not recommended. Use direct get, post, put, delete and patch methods instead. - * Sends the request. - * - * @param RequestInterface $request Request to send - * @param string[] $options Request options - * - * @throws RequestException When an error is encountered - * @throws \RuntimeException When the adapter does not populate a response - * - * @return ResponseInterface - */ - public function send(RequestInterface $request, array $options = []) - { - $requestOptions = $this->client->getConfig('request'); - if (is_array($requestOptions)) { - $options = array_merge($requestOptions, $options); - } - $options['auth'] = [$this->merchantId, $this->sharedSecret, 'basic']; - $options['http_errors'] = false; - - try { - $response = $this->client->send($request, $options); - return $response; - } catch (RequestException $e) { - throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); - } catch (\Throwable $e) { - throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Gets the HTTP transport client. - * - * @return ClientInterface - */ - public function getClient() - { - return $this->client; - } - - /** - * Gets the user agent. - * - * @return UserAgentInterface - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Factory method to create a connector instance. - * - * @param string $merchantId Merchant ID - * @param string $sharedSecret Shared secret - * @param string $baseUrl Base URL for HTTP requests - * @param UserAgentInterface $userAgent HTTP user agent to identify the client - * - * @return self - */ - public static function create( - $merchantId, - $sharedSecret, - $baseUrl = self::EU_BASE_URL, - UserAgentInterface $userAgent = null - ) { - $client = new Client(['base_uri' => $baseUrl]); - - return new static($client, $merchantId, $sharedSecret, $userAgent); - } -} diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php deleted file mode 100644 index f2a068e7a71..00000000000 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/Method.php +++ /dev/null @@ -1,29 +0,0 @@ -response = $response; } @@ -47,7 +46,7 @@ public function __construct(ApiResponse $response) /** * Gets the response object. * - * @return ApiResponse + * @return ResponseInterface */ public function getResponse() { @@ -65,7 +64,7 @@ public function getResponse() */ public function status($status) { - $httpStatus = (string) $this->response->getStatus(); + $httpStatus = (string) $this->response->getStatusCode(); if (is_array($status) && !in_array($httpStatus, $status)) { throw new \RuntimeException( "Unexpected response status code: {$httpStatus}" @@ -82,22 +81,9 @@ public function status($status) } /** - * Asserts the Content-Type header. Checks partial matching. - * Validation PASSES in the following cases: - * Content-Type: application/json - * $mediaType = 'application/json' + * Asserts the Content-Type header. * - * Content-Type: application/json; charset=utf-8 - * $mediaType = 'application/json' - * - * Validation FAILS in the following cases: - * Content-Type: plain/text - * $mediaType = 'application/json' - * - * Content-Type: application/json; charset=utf-8 - * $mediaType = 'application/json; charset=cp-1251' - * - * @param string $mediaType Expected media type. RegExp rules can be used. + * @param string $mediaType Expected media type * * @throws \RuntimeException If Content-Type header is missing * @throws \RuntimeException If Content-Type header does not match @@ -106,22 +92,14 @@ public function status($status) */ public function contentType($mediaType) { - $contentType = $this->response->getHeader('Content-Type'); - if (empty($contentType)) { + if (!$this->response->hasHeader('Content-Type')) { throw new \RuntimeException('Response is missing a Content-Type header'); } - $mediaFound = false; - foreach ($contentType as $type) { - if (preg_match('#' . $mediaType . '#', $type)) { - $mediaFound = true; - break; - } - } - if (!$mediaFound) { + $contentType = $this->response->getHeader('Content-Type'); + if ($contentType !== $mediaType) { throw new \RuntimeException( - 'Unexpected Content-Type header received: ' - . implode(',', $contentType) . '. Expected: ' . $mediaType + "Unexpected Content-Type header received: {$contentType}" ); } @@ -129,7 +107,7 @@ public function contentType($mediaType) } /** - * Gets the decoded JSON response. + * Get the decoded JSON response. * * @throws \RuntimeException If the response body is not in JSON format * @throws \InvalidArgumentException If the JSON cannot be parsed @@ -138,20 +116,7 @@ public function contentType($mediaType) */ public function getJson() { - return \json_decode($this->response->getBody(), true); - } - - /** - * Gets response body. - * - * @throws \RuntimeException If the response body is not in JSON format - * @throws \InvalidArgumentException If the JSON cannot be parsed - * - * @return StreamInterface the body as a stream - */ - public function getBody() - { - return $this->response->getBody(); + return $this->response->json(); } /** @@ -163,45 +128,10 @@ public function getBody() */ public function getLocation() { - $location = $this->response->getHeader('Location'); - if (empty($location)) { + if (!$this->response->hasHeader('Location')) { throw new \RuntimeException('Response is missing a Location header'); } - return $location[0]; - } - - - /** - * Asserts and analyze the response. Checks if the reponse has SUCCESSFULL family - * and try to parse the Klarna error message if possbile. - * - * @throws ConnectorException if response has non-2xx HTTP CODE and contains - * a Error - * @throws \RuntimeException if response has non-2xx HTTP CODE and body is not parsable - * - * @return void - */ - public function expectSuccessfull() - { - if ($this->isSuccessfull()) { - return $this; - } - - $data = json_decode($this->response->getBody(), true); - if (is_array($data) && array_key_exists('error_code', $data)) { - throw new ConnectorException($data, $this->response->getStatus()); - } - throw new \RuntimeException( - 'Unexpected reponse HTTP status ' . $this->response->getStatus() . - '. Excepted HTTP status should be in 2xx range', - $this->response->getStatus() - ); - } - - public function isSuccessfull() - { - $status = $this->response->getStatus(); - return $status >= 200 && $status < 300; + return $this->response->getHeader('Location'); } } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php index a60f7fbd693..2a1d30ee5aa 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgent.php @@ -1,6 +1,6 @@ fields = []; + } /** * Sets the specified field. @@ -104,10 +113,11 @@ public function __toString() * * @return self */ - public static function createDefault($options = []) + public static function createDefault() { $agent = new static(); + $options = ['Guzzle/' . ClientInterface::VERSION]; if (extension_loaded('curl')) { $options[] = 'curl/' . curl_version()['version']; } diff --git a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php index a4ed6f76160..7707d00f698 100644 --- a/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php +++ b/upload/system/storage/vendor/klarna/kco_rest/src/Klarna/Rest/Transport/UserAgentInterface.php @@ -1,6 +1,6 @@ =5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/upload/system/storage/vendor/psr/http-message/src/MessageInterface.php b/upload/system/storage/vendor/psr/http-message/src/MessageInterface.php deleted file mode 100644 index dd46e5ec81e..00000000000 --- a/upload/system/storage/vendor/psr/http-message/src/MessageInterface.php +++ /dev/null @@ -1,187 +0,0 @@ -getHeaders() as $name => $values) { - * echo $name . ": " . implode(", ", $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return string[][] Returns an associative array of the message's headers. Each - * key MUST be a header name, and each value MUST be an array of strings - * for that header. - */ - public function getHeaders(); - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function hasHeader($name); - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function getHeader($name); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * 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); - - /** - * Return an instance with the provided value replacing the specified header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withHeader($name, $value); - - /** - * Return an instance with the specified header appended with the given value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name Case-insensitive header field name to add. - * @param string|string[] $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function withAddedHeader($name, $value); - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name Case-insensitive header field name to remove. - * @return static - */ - public function withoutHeader($name); - - /** - * Gets the body of the message. - * - * @return StreamInterface Returns the body as a stream. - */ - public function getBody(); - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body Body. - * @return static - * @throws \InvalidArgumentException When the body is not valid. - */ - public function withBody(StreamInterface $body); -} diff --git a/upload/system/storage/vendor/psr/http-message/src/RequestInterface.php b/upload/system/storage/vendor/psr/http-message/src/RequestInterface.php deleted file mode 100644 index a96d4fd6366..00000000000 --- a/upload/system/storage/vendor/psr/http-message/src/RequestInterface.php +++ /dev/null @@ -1,129 +0,0 @@ -getQuery()` - * or from the `QUERY_STRING` server param. - * - * @return array - */ - public function getQueryParams(); - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query Array of query string arguments, typically from - * $_GET. - * @return static - */ - public function withQueryParams(array $query); - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @return array An array tree of UploadedFileInterface instances; an empty - * array MUST be returned if no data is present. - */ - public function getUploadedFiles(); - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles An array tree of UploadedFileInterface instances. - * @return static - * @throws \InvalidArgumentException if an invalid structure is provided. - */ - public function withUploadedFiles(array $uploadedFiles); - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @return null|array|object The deserialized body parameters, if any. - * These will typically be an array or object. - */ - public function getParsedBody(); - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or objects, - * or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param null|array|object $data The deserialized body data. This will - * typically be in an array or object. - * @return static - * @throws \InvalidArgumentException if an unsupported argument type is - * provided. - */ - public function withParsedBody($data); - - /** - * Retrieve attributes derived from the request. - * - * The request "attributes" may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array Attributes derived from the request. - */ - public function getAttributes(); - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $default Default value to return if the attribute does not exist. - * @return mixed - */ - public function getAttribute($name, $default = null); - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @param mixed $value The value of the attribute. - * @return static - */ - public function withAttribute($name, $value); - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @see getAttributes() - * @param string $name The attribute name. - * @return static - */ - public function withoutAttribute($name); -} diff --git a/upload/system/storage/vendor/psr/http-message/src/StreamInterface.php b/upload/system/storage/vendor/psr/http-message/src/StreamInterface.php deleted file mode 100644 index f68f391269b..00000000000 --- a/upload/system/storage/vendor/psr/http-message/src/StreamInterface.php +++ /dev/null @@ -1,158 +0,0 @@ - - * [user-info@]host[:port] - * - * - * If the port component is not set or is the standard port for the current - * scheme, it SHOULD NOT be included. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.2 - * @return string The URI authority, in "[user-info@]host[:port]" format. - */ - public function getAuthority(); - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo(); - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * @return string The URI host. - */ - public function getHost(); - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard port - * used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @return null|int The URI port. - */ - public function getPort(); - - /** - * Retrieve the path component of the URI. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * @return string The URI path. - */ - public function getPath(); - - /** - * Retrieve the query string of the URI. - * - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * @return string The URI query string. - */ - public function getQuery(); - - /** - * Retrieve the fragment component of the URI. - * - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * @return string The URI fragment. - */ - public function getFragment(); - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme The scheme to use with the new instance. - * @return static A new instance with the specified scheme. - * @throws \InvalidArgumentException for invalid or unsupported schemes. - */ - public function withScheme($scheme); - - /** - * Return an instance with the specified user information. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified user information. - * - * Password is optional, but the user information MUST include the - * user; an empty string for the user is equivalent to removing user - * information. - * - * @param string $user The user name to use for authority. - * @param null|string $password The password associated with $user. - * @return static A new instance with the specified user information. - */ - public function withUserInfo($user, $password = null); - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host The hostname to use with the new instance. - * @return static A new instance with the specified host. - * @throws \InvalidArgumentException for invalid hostnames. - */ - public function withHost($host); - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param null|int $port The port to use with the new instance; a null value - * removes the port information. - * @return static A new instance with the specified port. - * @throws \InvalidArgumentException for invalid ports. - */ - public function withPort($port); - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If the path is intended to be domain-relative rather than path relative then - * it must begin with a slash ("/"). Paths not starting with a slash ("/") - * are assumed to be relative to some base path known to the application or - * consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path The path to use with the new instance. - * @return static A new instance with the specified path. - * @throws \InvalidArgumentException for invalid paths. - */ - public function withPath($path); - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query The query string to use with the new instance. - * @return static A new instance with the specified query string. - * @throws \InvalidArgumentException for invalid query strings. - */ - public function withQuery($query); - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment The fragment to use with the new instance. - * @return static A new instance with the specified fragment. - */ - public function withFragment($fragment); - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters: - * - * - If a scheme is present, it MUST be suffixed by ":". - * - If an authority is present, it MUST be prefixed by "//". - * - The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path MUST - * be prefixed by "/". - * - If the path is starting with more than one "/" and no authority is - * present, the starting slashes MUST be reduced to one. - * - If a query is present, it MUST be prefixed by "?". - * - If a fragment is present, it MUST be prefixed by "#". - * - * @see http://tools.ietf.org/html/rfc3986#section-4.1 - * @return string - */ - public function __toString(); -} diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/LICENSE b/upload/system/storage/vendor/ralouphie/getallheaders/LICENSE deleted file mode 100644 index be5540c2af7..00000000000 --- a/upload/system/storage/vendor/ralouphie/getallheaders/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ralph Khattar - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/README.md b/upload/system/storage/vendor/ralouphie/getallheaders/README.md deleted file mode 100644 index 9430d76bbc2..00000000000 --- a/upload/system/storage/vendor/ralouphie/getallheaders/README.md +++ /dev/null @@ -1,27 +0,0 @@ -getallheaders -============= - -PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. - -[![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) -[![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) -[![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) -[![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) - - -This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). - -## Install - -For PHP version **`>= 5.6`**: - -``` -composer require ralouphie/getallheaders -``` - -For PHP version **`< 5.6`**: - -``` -composer require ralouphie/getallheaders "^2" -``` diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/composer.json b/upload/system/storage/vendor/ralouphie/getallheaders/composer.json deleted file mode 100644 index de8ce62e45d..00000000000 --- a/upload/system/storage/vendor/ralouphie/getallheaders/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "ralouphie/getallheaders", - "description": "A polyfill for getallheaders.", - "license": "MIT", - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^5 || ^6.5", - "php-coveralls/php-coveralls": "^2.1" - }, - "autoload": { - "files": ["src/getallheaders.php"] - }, - "autoload-dev": { - "psr-4": { - "getallheaders\\Tests\\": "tests/" - } - } -} diff --git a/upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php b/upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php deleted file mode 100644 index c7285a5ba16..00000000000 --- a/upload/system/storage/vendor/ralouphie/getallheaders/src/getallheaders.php +++ /dev/null @@ -1,46 +0,0 @@ - 'Content-Type', - 'CONTENT_LENGTH' => 'Content-Length', - 'CONTENT_MD5' => 'Content-Md5', - ); - - foreach ($_SERVER as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $key = substr($key, 5); - if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { - $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); - $headers[$key] = $value; - } - } elseif (isset($copy_server[$key])) { - $headers[$copy_server[$key]] = $value; - } - } - - if (!isset($headers['Authorization'])) { - if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { - $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; - } elseif (isset($_SERVER['PHP_AUTH_USER'])) { - $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; - $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); - } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { - $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; - } - } - - return $headers; - } - -} diff --git a/upload/system/storage/vendor/react/promise/CHANGELOG.md b/upload/system/storage/vendor/react/promise/CHANGELOG.md index 7f785eb5cd1..81ffffbb4d9 100644 --- a/upload/system/storage/vendor/react/promise/CHANGELOG.md +++ b/upload/system/storage/vendor/react/promise/CHANGELOG.md @@ -1,30 +1,6 @@ CHANGELOG for 2.x ================= -* 2.9.0 (2022-02-11) - - * Feature: Support union types and address deprecation of `ReflectionType::getClass()` (PHP 8+). - (#198 by @cdosoftei and @SimonFrings) - - ```php - $promise->otherwise(function (OverflowException|UnderflowException $e) { - echo 'Error: ' . $e->getMessage() . PHP_EOL; - }); - ``` - - * Feature: Support intersection types (PHP 8.1+). - (#195 by @bzikarsky) - - ```php - $promise->otherwise(function (OverflowException&CacheException $e) { - echo 'Error: ' . $e->getMessage() . PHP_EOL; - }); - ``` - - * Improve test suite, use GitHub actions for continuous integration (CI), - update to PHPUnit 9, and add full core team to the license. - (#174, #183, #186, and #201 by @SimonFrings and #211 by @clue) - * 2.8.0 (2020-05-12) * Mark `FulfilledPromise`, `RejectedPromise` and `LazyPromise` as deprecated for Promise v2 (and remove for Promise v3). diff --git a/upload/system/storage/vendor/react/promise/LICENSE b/upload/system/storage/vendor/react/promise/LICENSE index 21c1357b7a1..5919d20ff3f 100644 --- a/upload/system/storage/vendor/react/promise/LICENSE +++ b/upload/system/storage/vendor/react/promise/LICENSE @@ -1,6 +1,4 @@ -The MIT License (MIT) - -Copyright (c) 2012 Jan Sorgalla, Christian Lück, Cees-Jan Kiewiet, Chris Boden +Copyright (c) 2012-2016 Jan Sorgalla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/upload/system/storage/vendor/react/promise/README.md b/upload/system/storage/vendor/react/promise/README.md index d904a1d8f25..6588c72476e 100644 --- a/upload/system/storage/vendor/react/promise/README.md +++ b/upload/system/storage/vendor/react/promise/README.md @@ -4,7 +4,8 @@ Promise A lightweight implementation of [CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. -[![CI status](https://github.com/reactphp/promise/workflows/CI/badge.svg?branch=2.x)](https://github.com/reactphp/promise/actions) +[![Build Status](https://travis-ci.org/reactphp/promise.svg?branch=master)](http://travis-ci.org/reactphp/promise) +[![Coverage Status](https://coveralls.io/repos/github/reactphp/promise/badge.svg?branch=master)](https://coveralls.io/github/reactphp/promise?branch=master) Table of Contents ----------------- @@ -849,14 +850,15 @@ This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -$ composer require react/promise:^2.9 +$ composer require react/promise:^2.8 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.4 through current PHP 8+ and HHVM. -It's *highly recommended to use the latest supported PHP version* for this project. +extensions and supports running on legacy PHP 5.4 through current PHP 7+ and HHVM. +It's *highly recommended to use PHP 7+* for this project due to its vast +performance improvements. Credits ------- diff --git a/upload/system/storage/vendor/react/promise/composer.json b/upload/system/storage/vendor/react/promise/composer.json index f933f153767..b3e723a7aaa 100644 --- a/upload/system/storage/vendor/react/promise/composer.json +++ b/upload/system/storage/vendor/react/promise/composer.json @@ -3,32 +3,13 @@ "description": "A lightweight implementation of CommonJS Promises/A for PHP", "license": "MIT", "authors": [ - { - "name": "Jan Sorgalla", - "homepage": "https://sorgalla.com/", - "email": "jsorgalla@gmail.com" - }, - { - "name": "Christian Lück", - "homepage": "https://clue.engineering/", - "email": "christian@clue.engineering" - }, - { - "name": "Cees-Jan Kiewiet", - "homepage": "https://wyrihaximus.net/", - "email": "reactphp@ceesjankiewiet.nl" - }, - { - "name": "Chris Boden", - "homepage": "https://cboden.dev/", - "email": "cboden@gmail.com" - } + {"name": "Jan Sorgalla", "email": "jsorgalla@gmail.com"} ], "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" }, "autoload": { "psr-4": { diff --git a/upload/system/storage/vendor/react/promise/src/functions.php b/upload/system/storage/vendor/react/promise/src/functions.php index 429f0e7338f..bdbdf52d8f9 100644 --- a/upload/system/storage/vendor/react/promise/src/functions.php +++ b/upload/system/storage/vendor/react/promise/src/functions.php @@ -343,65 +343,9 @@ function _checkTypehint(callable $callback, $object) $expectedException = $parameters[0]; - // PHP before v8 used an easy API: - if (\PHP_VERSION_ID < 70100 || \defined('HHVM_VERSION')) { - if (!$expectedException->getClass()) { - return true; - } - - return $expectedException->getClass()->isInstance($object); - } - - // Extract the type of the argument and handle different possibilities - $type = $expectedException->getType(); - - $isTypeUnion = true; - $types = []; - - switch (true) { - case $type === null: - break; - case $type instanceof \ReflectionNamedType: - $types = [$type]; - break; - case $type instanceof \ReflectionIntersectionType: - $isTypeUnion = false; - case $type instanceof \ReflectionUnionType; - $types = $type->getTypes(); - break; - default: - throw new \LogicException('Unexpected return value of ReflectionParameter::getType'); - } - - // If there is no type restriction, it matches - if (empty($types)) { + if (!$expectedException->getClass()) { return true; } - foreach ($types as $type) { - if (!$type instanceof \ReflectionNamedType) { - throw new \LogicException('This implementation does not support groups of intersection or union types'); - } - - // A named-type can be either a class-name or a built-in type like string, int, array, etc. - $matches = ($type->isBuiltin() && \gettype($object) === $type->getName()) - || (new \ReflectionClass($type->getName()))->isInstance($object); - - - // If we look for a single match (union), we can return early on match - // If we look for a full match (intersection), we can return early on mismatch - if ($matches) { - if ($isTypeUnion) { - return true; - } - } else { - if (!$isTypeUnion) { - return false; - } - } - } - - // If we look for a single match (union) and did not return early, we matched no type and are false - // If we look for a full match (intersection) and did not return early, we matched all types and are true - return $isTypeUnion ? false : true; + return $expectedException->getClass()->isInstance($object); } diff --git a/upload/system/storage/vendor/scssphp/scssphp/bin/pscss b/upload/system/storage/vendor/scssphp/scssphp/bin/pscss old mode 100644 new mode 100755 diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore b/upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8df5c..00000000000 --- a/upload/system/storage/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md b/upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26132d..00000000000 --- a/upload/system/storage/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE b/upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index ad85e173748..00000000000 --- a/upload/system/storage/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-2021 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/README.md b/upload/system/storage/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933a6cc..00000000000 --- a/upload/system/storage/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/composer.json b/upload/system/storage/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index 1c1b4ba0e94..00000000000 --- a/upload/system/storage/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.0.2" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/upload/system/storage/vendor/symfony/deprecation-contracts/function.php b/upload/system/storage/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index 2d56512ba33..00000000000 --- a/upload/system/storage/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php b/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php index ba75a2c95fc..58414dc73bd 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/Ctype.php @@ -25,13 +25,13 @@ final class Ctype * * @see https://php.net/ctype-alnum * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_alnum($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); } @@ -41,13 +41,13 @@ public static function ctype_alnum($text) * * @see https://php.net/ctype-alpha * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_alpha($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); } @@ -57,13 +57,13 @@ public static function ctype_alpha($text) * * @see https://php.net/ctype-cntrl * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_cntrl($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); } @@ -73,13 +73,13 @@ public static function ctype_cntrl($text) * * @see https://php.net/ctype-digit * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_digit($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); } @@ -89,13 +89,13 @@ public static function ctype_digit($text) * * @see https://php.net/ctype-graph * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_graph($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); } @@ -105,13 +105,13 @@ public static function ctype_graph($text) * * @see https://php.net/ctype-lower * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_lower($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); } @@ -121,13 +121,13 @@ public static function ctype_lower($text) * * @see https://php.net/ctype-print * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_print($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); } @@ -137,13 +137,13 @@ public static function ctype_print($text) * * @see https://php.net/ctype-punct * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_punct($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); } @@ -153,13 +153,13 @@ public static function ctype_punct($text) * * @see https://php.net/ctype-space * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_space($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); } @@ -169,13 +169,13 @@ public static function ctype_space($text) * * @see https://php.net/ctype-upper * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_upper($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); } @@ -185,13 +185,13 @@ public static function ctype_upper($text) * * @see https://php.net/ctype-xdigit * - * @param mixed $text + * @param string|int $text * * @return bool */ public static function ctype_xdigit($text) { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); + $text = self::convert_int_to_char_for_ctype($text); return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); } @@ -204,12 +204,11 @@ public static function ctype_xdigit($text) * (negative values have 256 added in order to allow characters in the Extended ASCII range). * Any other integer is interpreted as a string containing the decimal digits of the integer. * - * @param mixed $int - * @param string $function + * @param string|int $int * * @return mixed */ - private static function convert_int_to_char_for_ctype($int, $function) + private static function convert_int_to_char_for_ctype($int) { if (!\is_int($int)) { return $int; @@ -219,10 +218,6 @@ private static function convert_int_to_char_for_ctype($int, $function) return (string) $int; } - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - if ($int < 0) { $int += 256; } diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php index d54524b31b4..8d6fc4becca 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap.php @@ -11,10 +11,6 @@ use Symfony\Polyfill\Ctype as p; -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - if (!function_exists('ctype_alnum')) { function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } } diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f8611dac..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json b/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json index ccb8e570358..90108c65bd1 100644 --- a/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-ctype/composer.json @@ -16,10 +16,7 @@ } ], "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" + "php": ">=5.3.3" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, @@ -31,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php deleted file mode 100644 index fee3026df26..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Idn.php +++ /dev/null @@ -1,925 +0,0 @@ - and Trevor Rowbotham - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Idn; - -use Exception; -use Normalizer; -use Symfony\Polyfill\Intl\Idn\Resources\unidata\DisallowedRanges; -use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex; - -/** - * @see https://www.unicode.org/reports/tr46/ - * - * @internal - */ -final class Idn -{ - public const ERROR_EMPTY_LABEL = 1; - public const ERROR_LABEL_TOO_LONG = 2; - public const ERROR_DOMAIN_NAME_TOO_LONG = 4; - public const ERROR_LEADING_HYPHEN = 8; - public const ERROR_TRAILING_HYPHEN = 0x10; - public const ERROR_HYPHEN_3_4 = 0x20; - public const ERROR_LEADING_COMBINING_MARK = 0x40; - public const ERROR_DISALLOWED = 0x80; - public const ERROR_PUNYCODE = 0x100; - public const ERROR_LABEL_HAS_DOT = 0x200; - public const ERROR_INVALID_ACE_LABEL = 0x400; - public const ERROR_BIDI = 0x800; - public const ERROR_CONTEXTJ = 0x1000; - public const ERROR_CONTEXTO_PUNCTUATION = 0x2000; - public const ERROR_CONTEXTO_DIGITS = 0x4000; - - public const INTL_IDNA_VARIANT_2003 = 0; - public const INTL_IDNA_VARIANT_UTS46 = 1; - - public const IDNA_DEFAULT = 0; - public const IDNA_ALLOW_UNASSIGNED = 1; - public const IDNA_USE_STD3_RULES = 2; - public const IDNA_CHECK_BIDI = 4; - public const IDNA_CHECK_CONTEXTJ = 8; - public const IDNA_NONTRANSITIONAL_TO_ASCII = 16; - public const IDNA_NONTRANSITIONAL_TO_UNICODE = 32; - - public const MAX_DOMAIN_SIZE = 253; - public const MAX_LABEL_SIZE = 63; - - public const BASE = 36; - public const TMIN = 1; - public const TMAX = 26; - public const SKEW = 38; - public const DAMP = 700; - public const INITIAL_BIAS = 72; - public const INITIAL_N = 128; - public const DELIMITER = '-'; - public const MAX_INT = 2147483647; - - /** - * Contains the numeric value of a basic code point (for use in representing integers) in the - * range 0 to BASE-1, or -1 if b is does not represent a value. - * - * @var array - */ - private static $basicToDigit = [ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, - - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - ]; - - /** - * @var array - */ - private static $virama; - - /** - * @var array - */ - private static $mapped; - - /** - * @var array - */ - private static $ignored; - - /** - * @var array - */ - private static $deviation; - - /** - * @var array - */ - private static $disallowed; - - /** - * @var array - */ - private static $disallowed_STD3_mapped; - - /** - * @var array - */ - private static $disallowed_STD3_valid; - - /** - * @var bool - */ - private static $mappingTableLoaded = false; - - /** - * @see https://www.unicode.org/reports/tr46/#ToASCII - * - * @param string $domainName - * @param int $options - * @param int $variant - * @param array $idna_info - * - * @return string|false - */ - public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) - { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); - } - - $options = [ - 'CheckHyphens' => true, - 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), - 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), - 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), - 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_ASCII), - 'VerifyDnsLength' => true, - ]; - $info = new Info(); - $labels = self::process((string) $domainName, $options, $info); - - foreach ($labels as $i => $label) { - // Only convert labels to punycode that contain non-ASCII code points - if (1 === preg_match('/[^\x00-\x7F]/', $label)) { - try { - $label = 'xn--'.self::punycodeEncode($label); - } catch (Exception $e) { - $info->errors |= self::ERROR_PUNYCODE; - } - - $labels[$i] = $label; - } - } - - if ($options['VerifyDnsLength']) { - self::validateDomainAndLabelLength($labels, $info); - } - - $idna_info = [ - 'result' => implode('.', $labels), - 'isTransitionalDifferent' => $info->transitionalDifferent, - 'errors' => $info->errors, - ]; - - return 0 === $info->errors ? $idna_info['result'] : false; - } - - /** - * @see https://www.unicode.org/reports/tr46/#ToUnicode - * - * @param string $domainName - * @param int $options - * @param int $variant - * @param array $idna_info - * - * @return string|false - */ - public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) - { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); - } - - $info = new Info(); - $labels = self::process((string) $domainName, [ - 'CheckHyphens' => true, - 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), - 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), - 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), - 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_UNICODE), - ], $info); - $idna_info = [ - 'result' => implode('.', $labels), - 'isTransitionalDifferent' => $info->transitionalDifferent, - 'errors' => $info->errors, - ]; - - return 0 === $info->errors ? $idna_info['result'] : false; - } - - /** - * @param string $label - * - * @return bool - */ - private static function isValidContextJ(array $codePoints, $label) - { - if (!isset(self::$virama)) { - self::$virama = require __DIR__.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'unidata'.\DIRECTORY_SEPARATOR.'virama.php'; - } - - $offset = 0; - - foreach ($codePoints as $i => $codePoint) { - if (0x200C !== $codePoint && 0x200D !== $codePoint) { - continue; - } - - if (!isset($codePoints[$i - 1])) { - return false; - } - - // If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True; - if (isset(self::$virama[$codePoints[$i - 1]])) { - continue; - } - - // If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C(Joining_Type:T)*(Joining_Type:{R,D})) Then - // True; - // Generated RegExp = ([Joining_Type:{L,D}][Joining_Type:T]*\u200C[Joining_Type:T]*)[Joining_Type:{R,D}] - if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset)) { - $offset += \strlen($matches[1][0]); - - continue; - } - - return false; - } - - return true; - } - - /** - * @see https://www.unicode.org/reports/tr46/#ProcessingStepMap - * - * @param string $input - * @param array $options - * - * @return string - */ - private static function mapCodePoints($input, array $options, Info $info) - { - $str = ''; - $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; - $transitional = $options['Transitional_Processing']; - - foreach (self::utf8Decode($input) as $codePoint) { - $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); - - switch ($data['status']) { - case 'disallowed': - $info->errors |= self::ERROR_DISALLOWED; - - // no break. - - case 'valid': - $str .= mb_chr($codePoint, 'utf-8'); - - break; - - case 'ignored': - // Do nothing. - break; - - case 'mapped': - $str .= $data['mapping']; - - break; - - case 'deviation': - $info->transitionalDifferent = true; - $str .= ($transitional ? $data['mapping'] : mb_chr($codePoint, 'utf-8')); - - break; - } - } - - return $str; - } - - /** - * @see https://www.unicode.org/reports/tr46/#Processing - * - * @param string $domain - * @param array $options - * - * @return array - */ - private static function process($domain, array $options, Info $info) - { - // If VerifyDnsLength is not set, we are doing ToUnicode otherwise we are doing ToASCII and - // we need to respect the VerifyDnsLength option. - $checkForEmptyLabels = !isset($options['VerifyDnsLength']) || $options['VerifyDnsLength']; - - if ($checkForEmptyLabels && '' === $domain) { - $info->errors |= self::ERROR_EMPTY_LABEL; - - return [$domain]; - } - - // Step 1. Map each code point in the domain name string - $domain = self::mapCodePoints($domain, $options, $info); - - // Step 2. Normalize the domain name string to Unicode Normalization Form C. - if (!Normalizer::isNormalized($domain, Normalizer::FORM_C)) { - $domain = Normalizer::normalize($domain, Normalizer::FORM_C); - } - - // Step 3. Break the string into labels at U+002E (.) FULL STOP. - $labels = explode('.', $domain); - $lastLabelIndex = \count($labels) - 1; - - // Step 4. Convert and validate each label in the domain name string. - foreach ($labels as $i => $label) { - $validationOptions = $options; - - if ('xn--' === substr($label, 0, 4)) { - try { - $label = self::punycodeDecode(substr($label, 4)); - } catch (Exception $e) { - $info->errors |= self::ERROR_PUNYCODE; - - continue; - } - - $validationOptions['Transitional_Processing'] = false; - $labels[$i] = $label; - } - - self::validateLabel($label, $info, $validationOptions, $i > 0 && $i === $lastLabelIndex); - } - - if ($info->bidiDomain && !$info->validBidiDomain) { - $info->errors |= self::ERROR_BIDI; - } - - // Any input domain name string that does not record an error has been successfully - // processed according to this specification. Conversely, if an input domain_name string - // causes an error, then the processing of the input domain_name string fails. Determining - // what to do with error input is up to the caller, and not in the scope of this document. - return $labels; - } - - /** - * @see https://tools.ietf.org/html/rfc5893#section-2 - * - * @param string $label - */ - private static function validateBidiLabel($label, Info $info) - { - if (1 === preg_match(Regex::RTL_LABEL, $label)) { - $info->bidiDomain = true; - - // Step 1. The first character must be a character with Bidi property L, R, or AL. - // If it has the R or AL property, it is an RTL label - if (1 !== preg_match(Regex::BIDI_STEP_1_RTL, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 2. In an RTL label, only characters with the Bidi properties R, AL, AN, EN, ES, - // CS, ET, ON, BN, or NSM are allowed. - if (1 === preg_match(Regex::BIDI_STEP_2, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 3. In an RTL label, the end of the label must be a character with Bidi property - // R, AL, EN, or AN, followed by zero or more characters with Bidi property NSM. - if (1 !== preg_match(Regex::BIDI_STEP_3, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 4. In an RTL label, if an EN is present, no AN may be present, and vice versa. - if (1 === preg_match(Regex::BIDI_STEP_4_AN, $label) && 1 === preg_match(Regex::BIDI_STEP_4_EN, $label)) { - $info->validBidiDomain = false; - - return; - } - - return; - } - - // We are a LTR label - // Step 1. The first character must be a character with Bidi property L, R, or AL. - // If it has the L property, it is an LTR label. - if (1 !== preg_match(Regex::BIDI_STEP_1_LTR, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 5. In an LTR label, only characters with the Bidi properties L, EN, - // ES, CS, ET, ON, BN, or NSM are allowed. - if (1 === preg_match(Regex::BIDI_STEP_5, $label)) { - $info->validBidiDomain = false; - - return; - } - - // Step 6.In an LTR label, the end of the label must be a character with Bidi property L or - // EN, followed by zero or more characters with Bidi property NSM. - if (1 !== preg_match(Regex::BIDI_STEP_6, $label)) { - $info->validBidiDomain = false; - - return; - } - } - - /** - * @param array $labels - */ - private static function validateDomainAndLabelLength(array $labels, Info $info) - { - $maxDomainSize = self::MAX_DOMAIN_SIZE; - $length = \count($labels); - - // Number of "." delimiters. - $domainLength = $length - 1; - - // If the last label is empty and it is not the first label, then it is the root label. - // Increase the max size by 1, making it 254, to account for the root label's "." - // delimiter. This also means we don't need to check the last label's length for being too - // long. - if ($length > 1 && '' === $labels[$length - 1]) { - ++$maxDomainSize; - --$length; - } - - for ($i = 0; $i < $length; ++$i) { - $bytes = \strlen($labels[$i]); - $domainLength += $bytes; - - if ($bytes > self::MAX_LABEL_SIZE) { - $info->errors |= self::ERROR_LABEL_TOO_LONG; - } - } - - if ($domainLength > $maxDomainSize) { - $info->errors |= self::ERROR_DOMAIN_NAME_TOO_LONG; - } - } - - /** - * @see https://www.unicode.org/reports/tr46/#Validity_Criteria - * - * @param string $label - * @param array $options - * @param bool $canBeEmpty - */ - private static function validateLabel($label, Info $info, array $options, $canBeEmpty) - { - if ('' === $label) { - if (!$canBeEmpty && (!isset($options['VerifyDnsLength']) || $options['VerifyDnsLength'])) { - $info->errors |= self::ERROR_EMPTY_LABEL; - } - - return; - } - - // Step 1. The label must be in Unicode Normalization Form C. - if (!Normalizer::isNormalized($label, Normalizer::FORM_C)) { - $info->errors |= self::ERROR_INVALID_ACE_LABEL; - } - - $codePoints = self::utf8Decode($label); - - if ($options['CheckHyphens']) { - // Step 2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character - // in both the thrid and fourth positions. - if (isset($codePoints[2], $codePoints[3]) && 0x002D === $codePoints[2] && 0x002D === $codePoints[3]) { - $info->errors |= self::ERROR_HYPHEN_3_4; - } - - // Step 3. If CheckHyphens, the label must neither begin nor end with a U+002D - // HYPHEN-MINUS character. - if ('-' === substr($label, 0, 1)) { - $info->errors |= self::ERROR_LEADING_HYPHEN; - } - - if ('-' === substr($label, -1, 1)) { - $info->errors |= self::ERROR_TRAILING_HYPHEN; - } - } - - // Step 4. The label must not contain a U+002E (.) FULL STOP. - if (false !== strpos($label, '.')) { - $info->errors |= self::ERROR_LABEL_HAS_DOT; - } - - // Step 5. The label must not begin with a combining mark, that is: General_Category=Mark. - if (1 === preg_match(Regex::COMBINING_MARK, $label)) { - $info->errors |= self::ERROR_LEADING_COMBINING_MARK; - } - - // Step 6. Each code point in the label must only have certain status values according to - // Section 5, IDNA Mapping Table: - $transitional = $options['Transitional_Processing']; - $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; - - foreach ($codePoints as $codePoint) { - $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); - $status = $data['status']; - - if ('valid' === $status || (!$transitional && 'deviation' === $status)) { - continue; - } - - $info->errors |= self::ERROR_DISALLOWED; - - break; - } - - // Step 7. If CheckJoiners, the label must satisify the ContextJ rules from Appendix A, in - // The Unicode Code Points and Internationalized Domain Names for Applications (IDNA) - // [IDNA2008]. - if ($options['CheckJoiners'] && !self::isValidContextJ($codePoints, $label)) { - $info->errors |= self::ERROR_CONTEXTJ; - } - - // Step 8. If CheckBidi, and if the domain name is a Bidi domain name, then the label must - // satisfy all six of the numbered conditions in [IDNA2008] RFC 5893, Section 2. - if ($options['CheckBidi'] && (!$info->bidiDomain || $info->validBidiDomain)) { - self::validateBidiLabel($label, $info); - } - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.2 - * - * @param string $input - * - * @return string - */ - private static function punycodeDecode($input) - { - $n = self::INITIAL_N; - $out = 0; - $i = 0; - $bias = self::INITIAL_BIAS; - $lastDelimIndex = strrpos($input, self::DELIMITER); - $b = false === $lastDelimIndex ? 0 : $lastDelimIndex; - $inputLength = \strlen($input); - $output = []; - $bytes = array_map('ord', str_split($input)); - - for ($j = 0; $j < $b; ++$j) { - if ($bytes[$j] > 0x7F) { - throw new Exception('Invalid input'); - } - - $output[$out++] = $input[$j]; - } - - if ($b > 0) { - ++$b; - } - - for ($in = $b; $in < $inputLength; ++$out) { - $oldi = $i; - $w = 1; - - for ($k = self::BASE; /* no condition */; $k += self::BASE) { - if ($in >= $inputLength) { - throw new Exception('Invalid input'); - } - - $digit = self::$basicToDigit[$bytes[$in++] & 0xFF]; - - if ($digit < 0) { - throw new Exception('Invalid input'); - } - - if ($digit > intdiv(self::MAX_INT - $i, $w)) { - throw new Exception('Integer overflow'); - } - - $i += $digit * $w; - - if ($k <= $bias) { - $t = self::TMIN; - } elseif ($k >= $bias + self::TMAX) { - $t = self::TMAX; - } else { - $t = $k - $bias; - } - - if ($digit < $t) { - break; - } - - $baseMinusT = self::BASE - $t; - - if ($w > intdiv(self::MAX_INT, $baseMinusT)) { - throw new Exception('Integer overflow'); - } - - $w *= $baseMinusT; - } - - $outPlusOne = $out + 1; - $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi); - - if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) { - throw new Exception('Integer overflow'); - } - - $n += intdiv($i, $outPlusOne); - $i %= $outPlusOne; - array_splice($output, $i++, 0, [mb_chr($n, 'utf-8')]); - } - - return implode('', $output); - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.3 - * - * @param string $input - * - * @return string - */ - private static function punycodeEncode($input) - { - $n = self::INITIAL_N; - $delta = 0; - $out = 0; - $bias = self::INITIAL_BIAS; - $inputLength = 0; - $output = ''; - $iter = self::utf8Decode($input); - - foreach ($iter as $codePoint) { - ++$inputLength; - - if ($codePoint < 0x80) { - $output .= \chr($codePoint); - ++$out; - } - } - - $h = $out; - $b = $out; - - if ($b > 0) { - $output .= self::DELIMITER; - ++$out; - } - - while ($h < $inputLength) { - $m = self::MAX_INT; - - foreach ($iter as $codePoint) { - if ($codePoint >= $n && $codePoint < $m) { - $m = $codePoint; - } - } - - if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) { - throw new Exception('Integer overflow'); - } - - $delta += ($m - $n) * ($h + 1); - $n = $m; - - foreach ($iter as $codePoint) { - if ($codePoint < $n && 0 === ++$delta) { - throw new Exception('Integer overflow'); - } - - if ($codePoint === $n) { - $q = $delta; - - for ($k = self::BASE; /* no condition */; $k += self::BASE) { - if ($k <= $bias) { - $t = self::TMIN; - } elseif ($k >= $bias + self::TMAX) { - $t = self::TMAX; - } else { - $t = $k - $bias; - } - - if ($q < $t) { - break; - } - - $qMinusT = $q - $t; - $baseMinusT = self::BASE - $t; - $output .= self::encodeDigit($t + ($qMinusT) % ($baseMinusT), false); - ++$out; - $q = intdiv($qMinusT, $baseMinusT); - } - - $output .= self::encodeDigit($q, false); - ++$out; - $bias = self::adaptBias($delta, $h + 1, $h === $b); - $delta = 0; - ++$h; - } - } - - ++$delta; - ++$n; - } - - return $output; - } - - /** - * @see https://tools.ietf.org/html/rfc3492#section-6.1 - * - * @param int $delta - * @param int $numPoints - * @param bool $firstTime - * - * @return int - */ - private static function adaptBias($delta, $numPoints, $firstTime) - { - // xxx >> 1 is a faster way of doing intdiv(xxx, 2) - $delta = $firstTime ? intdiv($delta, self::DAMP) : $delta >> 1; - $delta += intdiv($delta, $numPoints); - $k = 0; - - while ($delta > ((self::BASE - self::TMIN) * self::TMAX) >> 1) { - $delta = intdiv($delta, self::BASE - self::TMIN); - $k += self::BASE; - } - - return $k + intdiv((self::BASE - self::TMIN + 1) * $delta, $delta + self::SKEW); - } - - /** - * @param int $d - * @param bool $flag - * - * @return string - */ - private static function encodeDigit($d, $flag) - { - return \chr($d + 22 + 75 * ($d < 26 ? 1 : 0) - (($flag ? 1 : 0) << 5)); - } - - /** - * Takes a UTF-8 encoded string and converts it into a series of integer code points. Any - * invalid byte sequences will be replaced by a U+FFFD replacement code point. - * - * @see https://encoding.spec.whatwg.org/#utf-8-decoder - * - * @param string $input - * - * @return array - */ - private static function utf8Decode($input) - { - $bytesSeen = 0; - $bytesNeeded = 0; - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - $codePoint = 0; - $codePoints = []; - $length = \strlen($input); - - for ($i = 0; $i < $length; ++$i) { - $byte = \ord($input[$i]); - - if (0 === $bytesNeeded) { - if ($byte >= 0x00 && $byte <= 0x7F) { - $codePoints[] = $byte; - - continue; - } - - if ($byte >= 0xC2 && $byte <= 0xDF) { - $bytesNeeded = 1; - $codePoint = $byte & 0x1F; - } elseif ($byte >= 0xE0 && $byte <= 0xEF) { - if (0xE0 === $byte) { - $lowerBoundary = 0xA0; - } elseif (0xED === $byte) { - $upperBoundary = 0x9F; - } - - $bytesNeeded = 2; - $codePoint = $byte & 0xF; - } elseif ($byte >= 0xF0 && $byte <= 0xF4) { - if (0xF0 === $byte) { - $lowerBoundary = 0x90; - } elseif (0xF4 === $byte) { - $upperBoundary = 0x8F; - } - - $bytesNeeded = 3; - $codePoint = $byte & 0x7; - } else { - $codePoints[] = 0xFFFD; - } - - continue; - } - - if ($byte < $lowerBoundary || $byte > $upperBoundary) { - $codePoint = 0; - $bytesNeeded = 0; - $bytesSeen = 0; - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - --$i; - $codePoints[] = 0xFFFD; - - continue; - } - - $lowerBoundary = 0x80; - $upperBoundary = 0xBF; - $codePoint = ($codePoint << 6) | ($byte & 0x3F); - - if (++$bytesSeen !== $bytesNeeded) { - continue; - } - - $codePoints[] = $codePoint; - $codePoint = 0; - $bytesNeeded = 0; - $bytesSeen = 0; - } - - // String unexpectedly ended, so append a U+FFFD code point. - if (0 !== $bytesNeeded) { - $codePoints[] = 0xFFFD; - } - - return $codePoints; - } - - /** - * @param int $codePoint - * @param bool $useSTD3ASCIIRules - * - * @return array{status: string, mapping?: string} - */ - private static function lookupCodePointStatus($codePoint, $useSTD3ASCIIRules) - { - if (!self::$mappingTableLoaded) { - self::$mappingTableLoaded = true; - self::$mapped = require __DIR__.'/Resources/unidata/mapped.php'; - self::$ignored = require __DIR__.'/Resources/unidata/ignored.php'; - self::$deviation = require __DIR__.'/Resources/unidata/deviation.php'; - self::$disallowed = require __DIR__.'/Resources/unidata/disallowed.php'; - self::$disallowed_STD3_mapped = require __DIR__.'/Resources/unidata/disallowed_STD3_mapped.php'; - self::$disallowed_STD3_valid = require __DIR__.'/Resources/unidata/disallowed_STD3_valid.php'; - } - - if (isset(self::$mapped[$codePoint])) { - return ['status' => 'mapped', 'mapping' => self::$mapped[$codePoint]]; - } - - if (isset(self::$ignored[$codePoint])) { - return ['status' => 'ignored']; - } - - if (isset(self::$deviation[$codePoint])) { - return ['status' => 'deviation', 'mapping' => self::$deviation[$codePoint]]; - } - - if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) { - return ['status' => 'disallowed']; - } - - $isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]); - - if ($isDisallowedMapped || isset(self::$disallowed_STD3_valid[$codePoint])) { - $status = 'disallowed'; - - if (!$useSTD3ASCIIRules) { - $status = $isDisallowedMapped ? 'mapped' : 'valid'; - } - - if ($isDisallowedMapped) { - return ['status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]]; - } - - return ['status' => $status]; - } - - return ['status' => 'valid']; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php deleted file mode 100644 index 25c3582b2a6..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Info.php +++ /dev/null @@ -1,23 +0,0 @@ - and Trevor Rowbotham - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Idn; - -/** - * @internal - */ -class Info -{ - public $bidiDomain = false; - public $errors = 0; - public $validBidiDomain = true; - public $transitionalDifferent = false; -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE b/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE deleted file mode 100644 index 03c5e25774f..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier and Trevor Rowbotham - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md b/upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md deleted file mode 100644 index 2e75f2e520a..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Intl: Idn -============================ - -This component provides [`idn_to_ascii`](https://php.net/idn-to-ascii) and [`idn_to_utf8`](https://php.net/idn-to-utf8) functions to users who run php versions without 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). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php deleted file mode 100644 index 5bb70e48aca..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php +++ /dev/null @@ -1,375 +0,0 @@ -= 128 && $codePoint <= 159) { - return true; - } - - if ($codePoint >= 2155 && $codePoint <= 2207) { - return true; - } - - if ($codePoint >= 3676 && $codePoint <= 3712) { - return true; - } - - if ($codePoint >= 3808 && $codePoint <= 3839) { - return true; - } - - if ($codePoint >= 4059 && $codePoint <= 4095) { - return true; - } - - if ($codePoint >= 4256 && $codePoint <= 4293) { - return true; - } - - if ($codePoint >= 6849 && $codePoint <= 6911) { - return true; - } - - if ($codePoint >= 11859 && $codePoint <= 11903) { - return true; - } - - if ($codePoint >= 42955 && $codePoint <= 42996) { - return true; - } - - if ($codePoint >= 55296 && $codePoint <= 57343) { - return true; - } - - if ($codePoint >= 57344 && $codePoint <= 63743) { - return true; - } - - if ($codePoint >= 64218 && $codePoint <= 64255) { - return true; - } - - if ($codePoint >= 64976 && $codePoint <= 65007) { - return true; - } - - if ($codePoint >= 65630 && $codePoint <= 65663) { - return true; - } - - if ($codePoint >= 65953 && $codePoint <= 65999) { - return true; - } - - if ($codePoint >= 66046 && $codePoint <= 66175) { - return true; - } - - if ($codePoint >= 66518 && $codePoint <= 66559) { - return true; - } - - if ($codePoint >= 66928 && $codePoint <= 67071) { - return true; - } - - if ($codePoint >= 67432 && $codePoint <= 67583) { - return true; - } - - if ($codePoint >= 67760 && $codePoint <= 67807) { - return true; - } - - if ($codePoint >= 67904 && $codePoint <= 67967) { - return true; - } - - if ($codePoint >= 68256 && $codePoint <= 68287) { - return true; - } - - if ($codePoint >= 68528 && $codePoint <= 68607) { - return true; - } - - if ($codePoint >= 68681 && $codePoint <= 68735) { - return true; - } - - if ($codePoint >= 68922 && $codePoint <= 69215) { - return true; - } - - if ($codePoint >= 69298 && $codePoint <= 69375) { - return true; - } - - if ($codePoint >= 69466 && $codePoint <= 69551) { - return true; - } - - if ($codePoint >= 70207 && $codePoint <= 70271) { - return true; - } - - if ($codePoint >= 70517 && $codePoint <= 70655) { - return true; - } - - if ($codePoint >= 70874 && $codePoint <= 71039) { - return true; - } - - if ($codePoint >= 71134 && $codePoint <= 71167) { - return true; - } - - if ($codePoint >= 71370 && $codePoint <= 71423) { - return true; - } - - if ($codePoint >= 71488 && $codePoint <= 71679) { - return true; - } - - if ($codePoint >= 71740 && $codePoint <= 71839) { - return true; - } - - if ($codePoint >= 72026 && $codePoint <= 72095) { - return true; - } - - if ($codePoint >= 72441 && $codePoint <= 72703) { - return true; - } - - if ($codePoint >= 72887 && $codePoint <= 72959) { - return true; - } - - if ($codePoint >= 73130 && $codePoint <= 73439) { - return true; - } - - if ($codePoint >= 73465 && $codePoint <= 73647) { - return true; - } - - if ($codePoint >= 74650 && $codePoint <= 74751) { - return true; - } - - if ($codePoint >= 75076 && $codePoint <= 77823) { - return true; - } - - if ($codePoint >= 78905 && $codePoint <= 82943) { - return true; - } - - if ($codePoint >= 83527 && $codePoint <= 92159) { - return true; - } - - if ($codePoint >= 92784 && $codePoint <= 92879) { - return true; - } - - if ($codePoint >= 93072 && $codePoint <= 93759) { - return true; - } - - if ($codePoint >= 93851 && $codePoint <= 93951) { - return true; - } - - if ($codePoint >= 94112 && $codePoint <= 94175) { - return true; - } - - if ($codePoint >= 101590 && $codePoint <= 101631) { - return true; - } - - if ($codePoint >= 101641 && $codePoint <= 110591) { - return true; - } - - if ($codePoint >= 110879 && $codePoint <= 110927) { - return true; - } - - if ($codePoint >= 111356 && $codePoint <= 113663) { - return true; - } - - if ($codePoint >= 113828 && $codePoint <= 118783) { - return true; - } - - if ($codePoint >= 119366 && $codePoint <= 119519) { - return true; - } - - if ($codePoint >= 119673 && $codePoint <= 119807) { - return true; - } - - if ($codePoint >= 121520 && $codePoint <= 122879) { - return true; - } - - if ($codePoint >= 122923 && $codePoint <= 123135) { - return true; - } - - if ($codePoint >= 123216 && $codePoint <= 123583) { - return true; - } - - if ($codePoint >= 123648 && $codePoint <= 124927) { - return true; - } - - if ($codePoint >= 125143 && $codePoint <= 125183) { - return true; - } - - if ($codePoint >= 125280 && $codePoint <= 126064) { - return true; - } - - if ($codePoint >= 126133 && $codePoint <= 126208) { - return true; - } - - if ($codePoint >= 126270 && $codePoint <= 126463) { - return true; - } - - if ($codePoint >= 126652 && $codePoint <= 126703) { - return true; - } - - if ($codePoint >= 126706 && $codePoint <= 126975) { - return true; - } - - if ($codePoint >= 127406 && $codePoint <= 127461) { - return true; - } - - if ($codePoint >= 127590 && $codePoint <= 127743) { - return true; - } - - if ($codePoint >= 129202 && $codePoint <= 129279) { - return true; - } - - if ($codePoint >= 129751 && $codePoint <= 129791) { - return true; - } - - if ($codePoint >= 129995 && $codePoint <= 130031) { - return true; - } - - if ($codePoint >= 130042 && $codePoint <= 131069) { - return true; - } - - if ($codePoint >= 173790 && $codePoint <= 173823) { - return true; - } - - if ($codePoint >= 191457 && $codePoint <= 194559) { - return true; - } - - if ($codePoint >= 195102 && $codePoint <= 196605) { - return true; - } - - if ($codePoint >= 201547 && $codePoint <= 262141) { - return true; - } - - if ($codePoint >= 262144 && $codePoint <= 327677) { - return true; - } - - if ($codePoint >= 327680 && $codePoint <= 393213) { - return true; - } - - if ($codePoint >= 393216 && $codePoint <= 458749) { - return true; - } - - if ($codePoint >= 458752 && $codePoint <= 524285) { - return true; - } - - if ($codePoint >= 524288 && $codePoint <= 589821) { - return true; - } - - if ($codePoint >= 589824 && $codePoint <= 655357) { - return true; - } - - if ($codePoint >= 655360 && $codePoint <= 720893) { - return true; - } - - if ($codePoint >= 720896 && $codePoint <= 786429) { - return true; - } - - if ($codePoint >= 786432 && $codePoint <= 851965) { - return true; - } - - if ($codePoint >= 851968 && $codePoint <= 917501) { - return true; - } - - if ($codePoint >= 917536 && $codePoint <= 917631) { - return true; - } - - if ($codePoint >= 917632 && $codePoint <= 917759) { - return true; - } - - if ($codePoint >= 918000 && $codePoint <= 983037) { - return true; - } - - if ($codePoint >= 983040 && $codePoint <= 1048573) { - return true; - } - - if ($codePoint >= 1048576 && $codePoint <= 1114109) { - return true; - } - - return false; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php deleted file mode 100644 index 5c1c51ddeec..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php +++ /dev/null @@ -1,24 +0,0 @@ - 'ss', - 962 => 'σ', - 8204 => '', - 8205 => '', -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php deleted file mode 100644 index 25a5f564d54..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php +++ /dev/null @@ -1,2638 +0,0 @@ - true, - 889 => true, - 896 => true, - 897 => true, - 898 => true, - 899 => true, - 907 => true, - 909 => true, - 930 => true, - 1216 => true, - 1328 => true, - 1367 => true, - 1368 => true, - 1419 => true, - 1420 => true, - 1424 => true, - 1480 => true, - 1481 => true, - 1482 => true, - 1483 => true, - 1484 => true, - 1485 => true, - 1486 => true, - 1487 => true, - 1515 => true, - 1516 => true, - 1517 => true, - 1518 => true, - 1525 => true, - 1526 => true, - 1527 => true, - 1528 => true, - 1529 => true, - 1530 => true, - 1531 => true, - 1532 => true, - 1533 => true, - 1534 => true, - 1535 => true, - 1536 => true, - 1537 => true, - 1538 => true, - 1539 => true, - 1540 => true, - 1541 => true, - 1564 => true, - 1565 => true, - 1757 => true, - 1806 => true, - 1807 => true, - 1867 => true, - 1868 => true, - 1970 => true, - 1971 => true, - 1972 => true, - 1973 => true, - 1974 => true, - 1975 => true, - 1976 => true, - 1977 => true, - 1978 => true, - 1979 => true, - 1980 => true, - 1981 => true, - 1982 => true, - 1983 => true, - 2043 => true, - 2044 => true, - 2094 => true, - 2095 => true, - 2111 => true, - 2140 => true, - 2141 => true, - 2143 => true, - 2229 => true, - 2248 => true, - 2249 => true, - 2250 => true, - 2251 => true, - 2252 => true, - 2253 => true, - 2254 => true, - 2255 => true, - 2256 => true, - 2257 => true, - 2258 => true, - 2274 => true, - 2436 => true, - 2445 => true, - 2446 => true, - 2449 => true, - 2450 => true, - 2473 => true, - 2481 => true, - 2483 => true, - 2484 => true, - 2485 => true, - 2490 => true, - 2491 => true, - 2501 => true, - 2502 => true, - 2505 => true, - 2506 => true, - 2511 => true, - 2512 => true, - 2513 => true, - 2514 => true, - 2515 => true, - 2516 => true, - 2517 => true, - 2518 => true, - 2520 => true, - 2521 => true, - 2522 => true, - 2523 => true, - 2526 => true, - 2532 => true, - 2533 => true, - 2559 => true, - 2560 => true, - 2564 => true, - 2571 => true, - 2572 => true, - 2573 => true, - 2574 => true, - 2577 => true, - 2578 => true, - 2601 => true, - 2609 => true, - 2612 => true, - 2615 => true, - 2618 => true, - 2619 => true, - 2621 => true, - 2627 => true, - 2628 => true, - 2629 => true, - 2630 => true, - 2633 => true, - 2634 => true, - 2638 => true, - 2639 => true, - 2640 => true, - 2642 => true, - 2643 => true, - 2644 => true, - 2645 => true, - 2646 => true, - 2647 => true, - 2648 => true, - 2653 => true, - 2655 => true, - 2656 => true, - 2657 => true, - 2658 => true, - 2659 => true, - 2660 => true, - 2661 => true, - 2679 => true, - 2680 => true, - 2681 => true, - 2682 => true, - 2683 => true, - 2684 => true, - 2685 => true, - 2686 => true, - 2687 => true, - 2688 => true, - 2692 => true, - 2702 => true, - 2706 => true, - 2729 => true, - 2737 => true, - 2740 => true, - 2746 => true, - 2747 => true, - 2758 => true, - 2762 => true, - 2766 => true, - 2767 => true, - 2769 => true, - 2770 => true, - 2771 => true, - 2772 => true, - 2773 => true, - 2774 => true, - 2775 => true, - 2776 => true, - 2777 => true, - 2778 => true, - 2779 => true, - 2780 => true, - 2781 => true, - 2782 => true, - 2783 => true, - 2788 => true, - 2789 => true, - 2802 => true, - 2803 => true, - 2804 => true, - 2805 => true, - 2806 => true, - 2807 => true, - 2808 => true, - 2816 => true, - 2820 => true, - 2829 => true, - 2830 => true, - 2833 => true, - 2834 => true, - 2857 => true, - 2865 => true, - 2868 => true, - 2874 => true, - 2875 => true, - 2885 => true, - 2886 => true, - 2889 => true, - 2890 => true, - 2894 => true, - 2895 => true, - 2896 => true, - 2897 => true, - 2898 => true, - 2899 => true, - 2900 => true, - 2904 => true, - 2905 => true, - 2906 => true, - 2907 => true, - 2910 => true, - 2916 => true, - 2917 => true, - 2936 => true, - 2937 => true, - 2938 => true, - 2939 => true, - 2940 => true, - 2941 => true, - 2942 => true, - 2943 => true, - 2944 => true, - 2945 => true, - 2948 => true, - 2955 => true, - 2956 => true, - 2957 => true, - 2961 => true, - 2966 => true, - 2967 => true, - 2968 => true, - 2971 => true, - 2973 => true, - 2976 => true, - 2977 => true, - 2978 => true, - 2981 => true, - 2982 => true, - 2983 => true, - 2987 => true, - 2988 => true, - 2989 => true, - 3002 => true, - 3003 => true, - 3004 => true, - 3005 => true, - 3011 => true, - 3012 => true, - 3013 => true, - 3017 => true, - 3022 => true, - 3023 => true, - 3025 => true, - 3026 => true, - 3027 => true, - 3028 => true, - 3029 => true, - 3030 => true, - 3032 => true, - 3033 => true, - 3034 => true, - 3035 => true, - 3036 => true, - 3037 => true, - 3038 => true, - 3039 => true, - 3040 => true, - 3041 => true, - 3042 => true, - 3043 => true, - 3044 => true, - 3045 => true, - 3067 => true, - 3068 => true, - 3069 => true, - 3070 => true, - 3071 => true, - 3085 => true, - 3089 => true, - 3113 => true, - 3130 => true, - 3131 => true, - 3132 => true, - 3141 => true, - 3145 => true, - 3150 => true, - 3151 => true, - 3152 => true, - 3153 => true, - 3154 => true, - 3155 => true, - 3156 => true, - 3159 => true, - 3163 => true, - 3164 => true, - 3165 => true, - 3166 => true, - 3167 => true, - 3172 => true, - 3173 => true, - 3184 => true, - 3185 => true, - 3186 => true, - 3187 => true, - 3188 => true, - 3189 => true, - 3190 => true, - 3213 => true, - 3217 => true, - 3241 => true, - 3252 => true, - 3258 => true, - 3259 => true, - 3269 => true, - 3273 => true, - 3278 => true, - 3279 => true, - 3280 => true, - 3281 => true, - 3282 => true, - 3283 => true, - 3284 => true, - 3287 => true, - 3288 => true, - 3289 => true, - 3290 => true, - 3291 => true, - 3292 => true, - 3293 => true, - 3295 => true, - 3300 => true, - 3301 => true, - 3312 => true, - 3315 => true, - 3316 => true, - 3317 => true, - 3318 => true, - 3319 => true, - 3320 => true, - 3321 => true, - 3322 => true, - 3323 => true, - 3324 => true, - 3325 => true, - 3326 => true, - 3327 => true, - 3341 => true, - 3345 => true, - 3397 => true, - 3401 => true, - 3408 => true, - 3409 => true, - 3410 => true, - 3411 => true, - 3428 => true, - 3429 => true, - 3456 => true, - 3460 => true, - 3479 => true, - 3480 => true, - 3481 => true, - 3506 => true, - 3516 => true, - 3518 => true, - 3519 => true, - 3527 => true, - 3528 => true, - 3529 => true, - 3531 => true, - 3532 => true, - 3533 => true, - 3534 => true, - 3541 => true, - 3543 => true, - 3552 => true, - 3553 => true, - 3554 => true, - 3555 => true, - 3556 => true, - 3557 => true, - 3568 => true, - 3569 => true, - 3573 => true, - 3574 => true, - 3575 => true, - 3576 => true, - 3577 => true, - 3578 => true, - 3579 => true, - 3580 => true, - 3581 => true, - 3582 => true, - 3583 => true, - 3584 => true, - 3643 => true, - 3644 => true, - 3645 => true, - 3646 => true, - 3715 => true, - 3717 => true, - 3723 => true, - 3748 => true, - 3750 => true, - 3774 => true, - 3775 => true, - 3781 => true, - 3783 => true, - 3790 => true, - 3791 => true, - 3802 => true, - 3803 => true, - 3912 => true, - 3949 => true, - 3950 => true, - 3951 => true, - 3952 => true, - 3992 => true, - 4029 => true, - 4045 => true, - 4294 => true, - 4296 => true, - 4297 => true, - 4298 => true, - 4299 => true, - 4300 => true, - 4302 => true, - 4303 => true, - 4447 => true, - 4448 => true, - 4681 => true, - 4686 => true, - 4687 => true, - 4695 => true, - 4697 => true, - 4702 => true, - 4703 => true, - 4745 => true, - 4750 => true, - 4751 => true, - 4785 => true, - 4790 => true, - 4791 => true, - 4799 => true, - 4801 => true, - 4806 => true, - 4807 => true, - 4823 => true, - 4881 => true, - 4886 => true, - 4887 => true, - 4955 => true, - 4956 => true, - 4989 => true, - 4990 => true, - 4991 => true, - 5018 => true, - 5019 => true, - 5020 => true, - 5021 => true, - 5022 => true, - 5023 => true, - 5110 => true, - 5111 => true, - 5118 => true, - 5119 => true, - 5760 => true, - 5789 => true, - 5790 => true, - 5791 => true, - 5881 => true, - 5882 => true, - 5883 => true, - 5884 => true, - 5885 => true, - 5886 => true, - 5887 => true, - 5901 => true, - 5909 => true, - 5910 => true, - 5911 => true, - 5912 => true, - 5913 => true, - 5914 => true, - 5915 => true, - 5916 => true, - 5917 => true, - 5918 => true, - 5919 => true, - 5943 => true, - 5944 => true, - 5945 => true, - 5946 => true, - 5947 => true, - 5948 => true, - 5949 => true, - 5950 => true, - 5951 => true, - 5972 => true, - 5973 => true, - 5974 => true, - 5975 => true, - 5976 => true, - 5977 => true, - 5978 => true, - 5979 => true, - 5980 => true, - 5981 => true, - 5982 => true, - 5983 => true, - 5997 => true, - 6001 => true, - 6004 => true, - 6005 => true, - 6006 => true, - 6007 => true, - 6008 => true, - 6009 => true, - 6010 => true, - 6011 => true, - 6012 => true, - 6013 => true, - 6014 => true, - 6015 => true, - 6068 => true, - 6069 => true, - 6110 => true, - 6111 => true, - 6122 => true, - 6123 => true, - 6124 => true, - 6125 => true, - 6126 => true, - 6127 => true, - 6138 => true, - 6139 => true, - 6140 => true, - 6141 => true, - 6142 => true, - 6143 => true, - 6150 => true, - 6158 => true, - 6159 => true, - 6170 => true, - 6171 => true, - 6172 => true, - 6173 => true, - 6174 => true, - 6175 => true, - 6265 => true, - 6266 => true, - 6267 => true, - 6268 => true, - 6269 => true, - 6270 => true, - 6271 => true, - 6315 => true, - 6316 => true, - 6317 => true, - 6318 => true, - 6319 => true, - 6390 => true, - 6391 => true, - 6392 => true, - 6393 => true, - 6394 => true, - 6395 => true, - 6396 => true, - 6397 => true, - 6398 => true, - 6399 => true, - 6431 => true, - 6444 => true, - 6445 => true, - 6446 => true, - 6447 => true, - 6460 => true, - 6461 => true, - 6462 => true, - 6463 => true, - 6465 => true, - 6466 => true, - 6467 => true, - 6510 => true, - 6511 => true, - 6517 => true, - 6518 => true, - 6519 => true, - 6520 => true, - 6521 => true, - 6522 => true, - 6523 => true, - 6524 => true, - 6525 => true, - 6526 => true, - 6527 => true, - 6572 => true, - 6573 => true, - 6574 => true, - 6575 => true, - 6602 => true, - 6603 => true, - 6604 => true, - 6605 => true, - 6606 => true, - 6607 => true, - 6619 => true, - 6620 => true, - 6621 => true, - 6684 => true, - 6685 => true, - 6751 => true, - 6781 => true, - 6782 => true, - 6794 => true, - 6795 => true, - 6796 => true, - 6797 => true, - 6798 => true, - 6799 => true, - 6810 => true, - 6811 => true, - 6812 => true, - 6813 => true, - 6814 => true, - 6815 => true, - 6830 => true, - 6831 => true, - 6988 => true, - 6989 => true, - 6990 => true, - 6991 => true, - 7037 => true, - 7038 => true, - 7039 => true, - 7156 => true, - 7157 => true, - 7158 => true, - 7159 => true, - 7160 => true, - 7161 => true, - 7162 => true, - 7163 => true, - 7224 => true, - 7225 => true, - 7226 => true, - 7242 => true, - 7243 => true, - 7244 => true, - 7305 => true, - 7306 => true, - 7307 => true, - 7308 => true, - 7309 => true, - 7310 => true, - 7311 => true, - 7355 => true, - 7356 => true, - 7368 => true, - 7369 => true, - 7370 => true, - 7371 => true, - 7372 => true, - 7373 => true, - 7374 => true, - 7375 => true, - 7419 => true, - 7420 => true, - 7421 => true, - 7422 => true, - 7423 => true, - 7674 => true, - 7958 => true, - 7959 => true, - 7966 => true, - 7967 => true, - 8006 => true, - 8007 => true, - 8014 => true, - 8015 => true, - 8024 => true, - 8026 => true, - 8028 => true, - 8030 => true, - 8062 => true, - 8063 => true, - 8117 => true, - 8133 => true, - 8148 => true, - 8149 => true, - 8156 => true, - 8176 => true, - 8177 => true, - 8181 => true, - 8191 => true, - 8206 => true, - 8207 => true, - 8228 => true, - 8229 => true, - 8230 => true, - 8232 => true, - 8233 => true, - 8234 => true, - 8235 => true, - 8236 => true, - 8237 => true, - 8238 => true, - 8289 => true, - 8290 => true, - 8291 => true, - 8293 => true, - 8294 => true, - 8295 => true, - 8296 => true, - 8297 => true, - 8298 => true, - 8299 => true, - 8300 => true, - 8301 => true, - 8302 => true, - 8303 => true, - 8306 => true, - 8307 => true, - 8335 => true, - 8349 => true, - 8350 => true, - 8351 => true, - 8384 => true, - 8385 => true, - 8386 => true, - 8387 => true, - 8388 => true, - 8389 => true, - 8390 => true, - 8391 => true, - 8392 => true, - 8393 => true, - 8394 => true, - 8395 => true, - 8396 => true, - 8397 => true, - 8398 => true, - 8399 => true, - 8433 => true, - 8434 => true, - 8435 => true, - 8436 => true, - 8437 => true, - 8438 => true, - 8439 => true, - 8440 => true, - 8441 => true, - 8442 => true, - 8443 => true, - 8444 => true, - 8445 => true, - 8446 => true, - 8447 => true, - 8498 => true, - 8579 => true, - 8588 => true, - 8589 => true, - 8590 => true, - 8591 => true, - 9255 => true, - 9256 => true, - 9257 => true, - 9258 => true, - 9259 => true, - 9260 => true, - 9261 => true, - 9262 => true, - 9263 => true, - 9264 => true, - 9265 => true, - 9266 => true, - 9267 => true, - 9268 => true, - 9269 => true, - 9270 => true, - 9271 => true, - 9272 => true, - 9273 => true, - 9274 => true, - 9275 => true, - 9276 => true, - 9277 => true, - 9278 => true, - 9279 => true, - 9291 => true, - 9292 => true, - 9293 => true, - 9294 => true, - 9295 => true, - 9296 => true, - 9297 => true, - 9298 => true, - 9299 => true, - 9300 => true, - 9301 => true, - 9302 => true, - 9303 => true, - 9304 => true, - 9305 => true, - 9306 => true, - 9307 => true, - 9308 => true, - 9309 => true, - 9310 => true, - 9311 => true, - 9352 => true, - 9353 => true, - 9354 => true, - 9355 => true, - 9356 => true, - 9357 => true, - 9358 => true, - 9359 => true, - 9360 => true, - 9361 => true, - 9362 => true, - 9363 => true, - 9364 => true, - 9365 => true, - 9366 => true, - 9367 => true, - 9368 => true, - 9369 => true, - 9370 => true, - 9371 => true, - 11124 => true, - 11125 => true, - 11158 => true, - 11311 => true, - 11359 => true, - 11508 => true, - 11509 => true, - 11510 => true, - 11511 => true, - 11512 => true, - 11558 => true, - 11560 => true, - 11561 => true, - 11562 => true, - 11563 => true, - 11564 => true, - 11566 => true, - 11567 => true, - 11624 => true, - 11625 => true, - 11626 => true, - 11627 => true, - 11628 => true, - 11629 => true, - 11630 => true, - 11633 => true, - 11634 => true, - 11635 => true, - 11636 => true, - 11637 => true, - 11638 => true, - 11639 => true, - 11640 => true, - 11641 => true, - 11642 => true, - 11643 => true, - 11644 => true, - 11645 => true, - 11646 => true, - 11671 => true, - 11672 => true, - 11673 => true, - 11674 => true, - 11675 => true, - 11676 => true, - 11677 => true, - 11678 => true, - 11679 => true, - 11687 => true, - 11695 => true, - 11703 => true, - 11711 => true, - 11719 => true, - 11727 => true, - 11735 => true, - 11743 => true, - 11930 => true, - 12020 => true, - 12021 => true, - 12022 => true, - 12023 => true, - 12024 => true, - 12025 => true, - 12026 => true, - 12027 => true, - 12028 => true, - 12029 => true, - 12030 => true, - 12031 => true, - 12246 => true, - 12247 => true, - 12248 => true, - 12249 => true, - 12250 => true, - 12251 => true, - 12252 => true, - 12253 => true, - 12254 => true, - 12255 => true, - 12256 => true, - 12257 => true, - 12258 => true, - 12259 => true, - 12260 => true, - 12261 => true, - 12262 => true, - 12263 => true, - 12264 => true, - 12265 => true, - 12266 => true, - 12267 => true, - 12268 => true, - 12269 => true, - 12270 => true, - 12271 => true, - 12272 => true, - 12273 => true, - 12274 => true, - 12275 => true, - 12276 => true, - 12277 => true, - 12278 => true, - 12279 => true, - 12280 => true, - 12281 => true, - 12282 => true, - 12283 => true, - 12284 => true, - 12285 => true, - 12286 => true, - 12287 => true, - 12352 => true, - 12439 => true, - 12440 => true, - 12544 => true, - 12545 => true, - 12546 => true, - 12547 => true, - 12548 => true, - 12592 => true, - 12644 => true, - 12687 => true, - 12772 => true, - 12773 => true, - 12774 => true, - 12775 => true, - 12776 => true, - 12777 => true, - 12778 => true, - 12779 => true, - 12780 => true, - 12781 => true, - 12782 => true, - 12783 => true, - 12831 => true, - 13250 => true, - 13255 => true, - 13272 => true, - 40957 => true, - 40958 => true, - 40959 => true, - 42125 => true, - 42126 => true, - 42127 => true, - 42183 => true, - 42184 => true, - 42185 => true, - 42186 => true, - 42187 => true, - 42188 => true, - 42189 => true, - 42190 => true, - 42191 => true, - 42540 => true, - 42541 => true, - 42542 => true, - 42543 => true, - 42544 => true, - 42545 => true, - 42546 => true, - 42547 => true, - 42548 => true, - 42549 => true, - 42550 => true, - 42551 => true, - 42552 => true, - 42553 => true, - 42554 => true, - 42555 => true, - 42556 => true, - 42557 => true, - 42558 => true, - 42559 => true, - 42744 => true, - 42745 => true, - 42746 => true, - 42747 => true, - 42748 => true, - 42749 => true, - 42750 => true, - 42751 => true, - 42944 => true, - 42945 => true, - 43053 => true, - 43054 => true, - 43055 => true, - 43066 => true, - 43067 => true, - 43068 => true, - 43069 => true, - 43070 => true, - 43071 => true, - 43128 => true, - 43129 => true, - 43130 => true, - 43131 => true, - 43132 => true, - 43133 => true, - 43134 => true, - 43135 => true, - 43206 => true, - 43207 => true, - 43208 => true, - 43209 => true, - 43210 => true, - 43211 => true, - 43212 => true, - 43213 => true, - 43226 => true, - 43227 => true, - 43228 => true, - 43229 => true, - 43230 => true, - 43231 => true, - 43348 => true, - 43349 => true, - 43350 => true, - 43351 => true, - 43352 => true, - 43353 => true, - 43354 => true, - 43355 => true, - 43356 => true, - 43357 => true, - 43358 => true, - 43389 => true, - 43390 => true, - 43391 => true, - 43470 => true, - 43482 => true, - 43483 => true, - 43484 => true, - 43485 => true, - 43519 => true, - 43575 => true, - 43576 => true, - 43577 => true, - 43578 => true, - 43579 => true, - 43580 => true, - 43581 => true, - 43582 => true, - 43583 => true, - 43598 => true, - 43599 => true, - 43610 => true, - 43611 => true, - 43715 => true, - 43716 => true, - 43717 => true, - 43718 => true, - 43719 => true, - 43720 => true, - 43721 => true, - 43722 => true, - 43723 => true, - 43724 => true, - 43725 => true, - 43726 => true, - 43727 => true, - 43728 => true, - 43729 => true, - 43730 => true, - 43731 => true, - 43732 => true, - 43733 => true, - 43734 => true, - 43735 => true, - 43736 => true, - 43737 => true, - 43738 => true, - 43767 => true, - 43768 => true, - 43769 => true, - 43770 => true, - 43771 => true, - 43772 => true, - 43773 => true, - 43774 => true, - 43775 => true, - 43776 => true, - 43783 => true, - 43784 => true, - 43791 => true, - 43792 => true, - 43799 => true, - 43800 => true, - 43801 => true, - 43802 => true, - 43803 => true, - 43804 => true, - 43805 => true, - 43806 => true, - 43807 => true, - 43815 => true, - 43823 => true, - 43884 => true, - 43885 => true, - 43886 => true, - 43887 => true, - 44014 => true, - 44015 => true, - 44026 => true, - 44027 => true, - 44028 => true, - 44029 => true, - 44030 => true, - 44031 => true, - 55204 => true, - 55205 => true, - 55206 => true, - 55207 => true, - 55208 => true, - 55209 => true, - 55210 => true, - 55211 => true, - 55212 => true, - 55213 => true, - 55214 => true, - 55215 => true, - 55239 => true, - 55240 => true, - 55241 => true, - 55242 => true, - 55292 => true, - 55293 => true, - 55294 => true, - 55295 => true, - 64110 => true, - 64111 => true, - 64263 => true, - 64264 => true, - 64265 => true, - 64266 => true, - 64267 => true, - 64268 => true, - 64269 => true, - 64270 => true, - 64271 => true, - 64272 => true, - 64273 => true, - 64274 => true, - 64280 => true, - 64281 => true, - 64282 => true, - 64283 => true, - 64284 => true, - 64311 => true, - 64317 => true, - 64319 => true, - 64322 => true, - 64325 => true, - 64450 => true, - 64451 => true, - 64452 => true, - 64453 => true, - 64454 => true, - 64455 => true, - 64456 => true, - 64457 => true, - 64458 => true, - 64459 => true, - 64460 => true, - 64461 => true, - 64462 => true, - 64463 => true, - 64464 => true, - 64465 => true, - 64466 => true, - 64832 => true, - 64833 => true, - 64834 => true, - 64835 => true, - 64836 => true, - 64837 => true, - 64838 => true, - 64839 => true, - 64840 => true, - 64841 => true, - 64842 => true, - 64843 => true, - 64844 => true, - 64845 => true, - 64846 => true, - 64847 => true, - 64912 => true, - 64913 => true, - 64968 => true, - 64969 => true, - 64970 => true, - 64971 => true, - 64972 => true, - 64973 => true, - 64974 => true, - 64975 => true, - 65022 => true, - 65023 => true, - 65042 => true, - 65049 => true, - 65050 => true, - 65051 => true, - 65052 => true, - 65053 => true, - 65054 => true, - 65055 => true, - 65072 => true, - 65106 => true, - 65107 => true, - 65127 => true, - 65132 => true, - 65133 => true, - 65134 => true, - 65135 => true, - 65141 => true, - 65277 => true, - 65278 => true, - 65280 => true, - 65440 => true, - 65471 => true, - 65472 => true, - 65473 => true, - 65480 => true, - 65481 => true, - 65488 => true, - 65489 => true, - 65496 => true, - 65497 => true, - 65501 => true, - 65502 => true, - 65503 => true, - 65511 => true, - 65519 => true, - 65520 => true, - 65521 => true, - 65522 => true, - 65523 => true, - 65524 => true, - 65525 => true, - 65526 => true, - 65527 => true, - 65528 => true, - 65529 => true, - 65530 => true, - 65531 => true, - 65532 => true, - 65533 => true, - 65534 => true, - 65535 => true, - 65548 => true, - 65575 => true, - 65595 => true, - 65598 => true, - 65614 => true, - 65615 => true, - 65787 => true, - 65788 => true, - 65789 => true, - 65790 => true, - 65791 => true, - 65795 => true, - 65796 => true, - 65797 => true, - 65798 => true, - 65844 => true, - 65845 => true, - 65846 => true, - 65935 => true, - 65949 => true, - 65950 => true, - 65951 => true, - 66205 => true, - 66206 => true, - 66207 => true, - 66257 => true, - 66258 => true, - 66259 => true, - 66260 => true, - 66261 => true, - 66262 => true, - 66263 => true, - 66264 => true, - 66265 => true, - 66266 => true, - 66267 => true, - 66268 => true, - 66269 => true, - 66270 => true, - 66271 => true, - 66300 => true, - 66301 => true, - 66302 => true, - 66303 => true, - 66340 => true, - 66341 => true, - 66342 => true, - 66343 => true, - 66344 => true, - 66345 => true, - 66346 => true, - 66347 => true, - 66348 => true, - 66379 => true, - 66380 => true, - 66381 => true, - 66382 => true, - 66383 => true, - 66427 => true, - 66428 => true, - 66429 => true, - 66430 => true, - 66431 => true, - 66462 => true, - 66500 => true, - 66501 => true, - 66502 => true, - 66503 => true, - 66718 => true, - 66719 => true, - 66730 => true, - 66731 => true, - 66732 => true, - 66733 => true, - 66734 => true, - 66735 => true, - 66772 => true, - 66773 => true, - 66774 => true, - 66775 => true, - 66812 => true, - 66813 => true, - 66814 => true, - 66815 => true, - 66856 => true, - 66857 => true, - 66858 => true, - 66859 => true, - 66860 => true, - 66861 => true, - 66862 => true, - 66863 => true, - 66916 => true, - 66917 => true, - 66918 => true, - 66919 => true, - 66920 => true, - 66921 => true, - 66922 => true, - 66923 => true, - 66924 => true, - 66925 => true, - 66926 => true, - 67383 => true, - 67384 => true, - 67385 => true, - 67386 => true, - 67387 => true, - 67388 => true, - 67389 => true, - 67390 => true, - 67391 => true, - 67414 => true, - 67415 => true, - 67416 => true, - 67417 => true, - 67418 => true, - 67419 => true, - 67420 => true, - 67421 => true, - 67422 => true, - 67423 => true, - 67590 => true, - 67591 => true, - 67593 => true, - 67638 => true, - 67641 => true, - 67642 => true, - 67643 => true, - 67645 => true, - 67646 => true, - 67670 => true, - 67743 => true, - 67744 => true, - 67745 => true, - 67746 => true, - 67747 => true, - 67748 => true, - 67749 => true, - 67750 => true, - 67827 => true, - 67830 => true, - 67831 => true, - 67832 => true, - 67833 => true, - 67834 => true, - 67868 => true, - 67869 => true, - 67870 => true, - 67898 => true, - 67899 => true, - 67900 => true, - 67901 => true, - 67902 => true, - 68024 => true, - 68025 => true, - 68026 => true, - 68027 => true, - 68048 => true, - 68049 => true, - 68100 => true, - 68103 => true, - 68104 => true, - 68105 => true, - 68106 => true, - 68107 => true, - 68116 => true, - 68120 => true, - 68150 => true, - 68151 => true, - 68155 => true, - 68156 => true, - 68157 => true, - 68158 => true, - 68169 => true, - 68170 => true, - 68171 => true, - 68172 => true, - 68173 => true, - 68174 => true, - 68175 => true, - 68185 => true, - 68186 => true, - 68187 => true, - 68188 => true, - 68189 => true, - 68190 => true, - 68191 => true, - 68327 => true, - 68328 => true, - 68329 => true, - 68330 => true, - 68343 => true, - 68344 => true, - 68345 => true, - 68346 => true, - 68347 => true, - 68348 => true, - 68349 => true, - 68350 => true, - 68351 => true, - 68406 => true, - 68407 => true, - 68408 => true, - 68438 => true, - 68439 => true, - 68467 => true, - 68468 => true, - 68469 => true, - 68470 => true, - 68471 => true, - 68498 => true, - 68499 => true, - 68500 => true, - 68501 => true, - 68502 => true, - 68503 => true, - 68504 => true, - 68509 => true, - 68510 => true, - 68511 => true, - 68512 => true, - 68513 => true, - 68514 => true, - 68515 => true, - 68516 => true, - 68517 => true, - 68518 => true, - 68519 => true, - 68520 => true, - 68787 => true, - 68788 => true, - 68789 => true, - 68790 => true, - 68791 => true, - 68792 => true, - 68793 => true, - 68794 => true, - 68795 => true, - 68796 => true, - 68797 => true, - 68798 => true, - 68799 => true, - 68851 => true, - 68852 => true, - 68853 => true, - 68854 => true, - 68855 => true, - 68856 => true, - 68857 => true, - 68904 => true, - 68905 => true, - 68906 => true, - 68907 => true, - 68908 => true, - 68909 => true, - 68910 => true, - 68911 => true, - 69247 => true, - 69290 => true, - 69294 => true, - 69295 => true, - 69416 => true, - 69417 => true, - 69418 => true, - 69419 => true, - 69420 => true, - 69421 => true, - 69422 => true, - 69423 => true, - 69580 => true, - 69581 => true, - 69582 => true, - 69583 => true, - 69584 => true, - 69585 => true, - 69586 => true, - 69587 => true, - 69588 => true, - 69589 => true, - 69590 => true, - 69591 => true, - 69592 => true, - 69593 => true, - 69594 => true, - 69595 => true, - 69596 => true, - 69597 => true, - 69598 => true, - 69599 => true, - 69623 => true, - 69624 => true, - 69625 => true, - 69626 => true, - 69627 => true, - 69628 => true, - 69629 => true, - 69630 => true, - 69631 => true, - 69710 => true, - 69711 => true, - 69712 => true, - 69713 => true, - 69744 => true, - 69745 => true, - 69746 => true, - 69747 => true, - 69748 => true, - 69749 => true, - 69750 => true, - 69751 => true, - 69752 => true, - 69753 => true, - 69754 => true, - 69755 => true, - 69756 => true, - 69757 => true, - 69758 => true, - 69821 => true, - 69826 => true, - 69827 => true, - 69828 => true, - 69829 => true, - 69830 => true, - 69831 => true, - 69832 => true, - 69833 => true, - 69834 => true, - 69835 => true, - 69836 => true, - 69837 => true, - 69838 => true, - 69839 => true, - 69865 => true, - 69866 => true, - 69867 => true, - 69868 => true, - 69869 => true, - 69870 => true, - 69871 => true, - 69882 => true, - 69883 => true, - 69884 => true, - 69885 => true, - 69886 => true, - 69887 => true, - 69941 => true, - 69960 => true, - 69961 => true, - 69962 => true, - 69963 => true, - 69964 => true, - 69965 => true, - 69966 => true, - 69967 => true, - 70007 => true, - 70008 => true, - 70009 => true, - 70010 => true, - 70011 => true, - 70012 => true, - 70013 => true, - 70014 => true, - 70015 => true, - 70112 => true, - 70133 => true, - 70134 => true, - 70135 => true, - 70136 => true, - 70137 => true, - 70138 => true, - 70139 => true, - 70140 => true, - 70141 => true, - 70142 => true, - 70143 => true, - 70162 => true, - 70279 => true, - 70281 => true, - 70286 => true, - 70302 => true, - 70314 => true, - 70315 => true, - 70316 => true, - 70317 => true, - 70318 => true, - 70319 => true, - 70379 => true, - 70380 => true, - 70381 => true, - 70382 => true, - 70383 => true, - 70394 => true, - 70395 => true, - 70396 => true, - 70397 => true, - 70398 => true, - 70399 => true, - 70404 => true, - 70413 => true, - 70414 => true, - 70417 => true, - 70418 => true, - 70441 => true, - 70449 => true, - 70452 => true, - 70458 => true, - 70469 => true, - 70470 => true, - 70473 => true, - 70474 => true, - 70478 => true, - 70479 => true, - 70481 => true, - 70482 => true, - 70483 => true, - 70484 => true, - 70485 => true, - 70486 => true, - 70488 => true, - 70489 => true, - 70490 => true, - 70491 => true, - 70492 => true, - 70500 => true, - 70501 => true, - 70509 => true, - 70510 => true, - 70511 => true, - 70748 => true, - 70754 => true, - 70755 => true, - 70756 => true, - 70757 => true, - 70758 => true, - 70759 => true, - 70760 => true, - 70761 => true, - 70762 => true, - 70763 => true, - 70764 => true, - 70765 => true, - 70766 => true, - 70767 => true, - 70768 => true, - 70769 => true, - 70770 => true, - 70771 => true, - 70772 => true, - 70773 => true, - 70774 => true, - 70775 => true, - 70776 => true, - 70777 => true, - 70778 => true, - 70779 => true, - 70780 => true, - 70781 => true, - 70782 => true, - 70783 => true, - 70856 => true, - 70857 => true, - 70858 => true, - 70859 => true, - 70860 => true, - 70861 => true, - 70862 => true, - 70863 => true, - 71094 => true, - 71095 => true, - 71237 => true, - 71238 => true, - 71239 => true, - 71240 => true, - 71241 => true, - 71242 => true, - 71243 => true, - 71244 => true, - 71245 => true, - 71246 => true, - 71247 => true, - 71258 => true, - 71259 => true, - 71260 => true, - 71261 => true, - 71262 => true, - 71263 => true, - 71277 => true, - 71278 => true, - 71279 => true, - 71280 => true, - 71281 => true, - 71282 => true, - 71283 => true, - 71284 => true, - 71285 => true, - 71286 => true, - 71287 => true, - 71288 => true, - 71289 => true, - 71290 => true, - 71291 => true, - 71292 => true, - 71293 => true, - 71294 => true, - 71295 => true, - 71353 => true, - 71354 => true, - 71355 => true, - 71356 => true, - 71357 => true, - 71358 => true, - 71359 => true, - 71451 => true, - 71452 => true, - 71468 => true, - 71469 => true, - 71470 => true, - 71471 => true, - 71923 => true, - 71924 => true, - 71925 => true, - 71926 => true, - 71927 => true, - 71928 => true, - 71929 => true, - 71930 => true, - 71931 => true, - 71932 => true, - 71933 => true, - 71934 => true, - 71943 => true, - 71944 => true, - 71946 => true, - 71947 => true, - 71956 => true, - 71959 => true, - 71990 => true, - 71993 => true, - 71994 => true, - 72007 => true, - 72008 => true, - 72009 => true, - 72010 => true, - 72011 => true, - 72012 => true, - 72013 => true, - 72014 => true, - 72015 => true, - 72104 => true, - 72105 => true, - 72152 => true, - 72153 => true, - 72165 => true, - 72166 => true, - 72167 => true, - 72168 => true, - 72169 => true, - 72170 => true, - 72171 => true, - 72172 => true, - 72173 => true, - 72174 => true, - 72175 => true, - 72176 => true, - 72177 => true, - 72178 => true, - 72179 => true, - 72180 => true, - 72181 => true, - 72182 => true, - 72183 => true, - 72184 => true, - 72185 => true, - 72186 => true, - 72187 => true, - 72188 => true, - 72189 => true, - 72190 => true, - 72191 => true, - 72264 => true, - 72265 => true, - 72266 => true, - 72267 => true, - 72268 => true, - 72269 => true, - 72270 => true, - 72271 => true, - 72355 => true, - 72356 => true, - 72357 => true, - 72358 => true, - 72359 => true, - 72360 => true, - 72361 => true, - 72362 => true, - 72363 => true, - 72364 => true, - 72365 => true, - 72366 => true, - 72367 => true, - 72368 => true, - 72369 => true, - 72370 => true, - 72371 => true, - 72372 => true, - 72373 => true, - 72374 => true, - 72375 => true, - 72376 => true, - 72377 => true, - 72378 => true, - 72379 => true, - 72380 => true, - 72381 => true, - 72382 => true, - 72383 => true, - 72713 => true, - 72759 => true, - 72774 => true, - 72775 => true, - 72776 => true, - 72777 => true, - 72778 => true, - 72779 => true, - 72780 => true, - 72781 => true, - 72782 => true, - 72783 => true, - 72813 => true, - 72814 => true, - 72815 => true, - 72848 => true, - 72849 => true, - 72872 => true, - 72967 => true, - 72970 => true, - 73015 => true, - 73016 => true, - 73017 => true, - 73019 => true, - 73022 => true, - 73032 => true, - 73033 => true, - 73034 => true, - 73035 => true, - 73036 => true, - 73037 => true, - 73038 => true, - 73039 => true, - 73050 => true, - 73051 => true, - 73052 => true, - 73053 => true, - 73054 => true, - 73055 => true, - 73062 => true, - 73065 => true, - 73103 => true, - 73106 => true, - 73113 => true, - 73114 => true, - 73115 => true, - 73116 => true, - 73117 => true, - 73118 => true, - 73119 => true, - 73649 => true, - 73650 => true, - 73651 => true, - 73652 => true, - 73653 => true, - 73654 => true, - 73655 => true, - 73656 => true, - 73657 => true, - 73658 => true, - 73659 => true, - 73660 => true, - 73661 => true, - 73662 => true, - 73663 => true, - 73714 => true, - 73715 => true, - 73716 => true, - 73717 => true, - 73718 => true, - 73719 => true, - 73720 => true, - 73721 => true, - 73722 => true, - 73723 => true, - 73724 => true, - 73725 => true, - 73726 => true, - 74863 => true, - 74869 => true, - 74870 => true, - 74871 => true, - 74872 => true, - 74873 => true, - 74874 => true, - 74875 => true, - 74876 => true, - 74877 => true, - 74878 => true, - 74879 => true, - 78895 => true, - 78896 => true, - 78897 => true, - 78898 => true, - 78899 => true, - 78900 => true, - 78901 => true, - 78902 => true, - 78903 => true, - 78904 => true, - 92729 => true, - 92730 => true, - 92731 => true, - 92732 => true, - 92733 => true, - 92734 => true, - 92735 => true, - 92767 => true, - 92778 => true, - 92779 => true, - 92780 => true, - 92781 => true, - 92910 => true, - 92911 => true, - 92918 => true, - 92919 => true, - 92920 => true, - 92921 => true, - 92922 => true, - 92923 => true, - 92924 => true, - 92925 => true, - 92926 => true, - 92927 => true, - 92998 => true, - 92999 => true, - 93000 => true, - 93001 => true, - 93002 => true, - 93003 => true, - 93004 => true, - 93005 => true, - 93006 => true, - 93007 => true, - 93018 => true, - 93026 => true, - 93048 => true, - 93049 => true, - 93050 => true, - 93051 => true, - 93052 => true, - 94027 => true, - 94028 => true, - 94029 => true, - 94030 => true, - 94088 => true, - 94089 => true, - 94090 => true, - 94091 => true, - 94092 => true, - 94093 => true, - 94094 => true, - 94181 => true, - 94182 => true, - 94183 => true, - 94184 => true, - 94185 => true, - 94186 => true, - 94187 => true, - 94188 => true, - 94189 => true, - 94190 => true, - 94191 => true, - 94194 => true, - 94195 => true, - 94196 => true, - 94197 => true, - 94198 => true, - 94199 => true, - 94200 => true, - 94201 => true, - 94202 => true, - 94203 => true, - 94204 => true, - 94205 => true, - 94206 => true, - 94207 => true, - 100344 => true, - 100345 => true, - 100346 => true, - 100347 => true, - 100348 => true, - 100349 => true, - 100350 => true, - 100351 => true, - 110931 => true, - 110932 => true, - 110933 => true, - 110934 => true, - 110935 => true, - 110936 => true, - 110937 => true, - 110938 => true, - 110939 => true, - 110940 => true, - 110941 => true, - 110942 => true, - 110943 => true, - 110944 => true, - 110945 => true, - 110946 => true, - 110947 => true, - 110952 => true, - 110953 => true, - 110954 => true, - 110955 => true, - 110956 => true, - 110957 => true, - 110958 => true, - 110959 => true, - 113771 => true, - 113772 => true, - 113773 => true, - 113774 => true, - 113775 => true, - 113789 => true, - 113790 => true, - 113791 => true, - 113801 => true, - 113802 => true, - 113803 => true, - 113804 => true, - 113805 => true, - 113806 => true, - 113807 => true, - 113818 => true, - 113819 => true, - 119030 => true, - 119031 => true, - 119032 => true, - 119033 => true, - 119034 => true, - 119035 => true, - 119036 => true, - 119037 => true, - 119038 => true, - 119039 => true, - 119079 => true, - 119080 => true, - 119155 => true, - 119156 => true, - 119157 => true, - 119158 => true, - 119159 => true, - 119160 => true, - 119161 => true, - 119162 => true, - 119273 => true, - 119274 => true, - 119275 => true, - 119276 => true, - 119277 => true, - 119278 => true, - 119279 => true, - 119280 => true, - 119281 => true, - 119282 => true, - 119283 => true, - 119284 => true, - 119285 => true, - 119286 => true, - 119287 => true, - 119288 => true, - 119289 => true, - 119290 => true, - 119291 => true, - 119292 => true, - 119293 => true, - 119294 => true, - 119295 => true, - 119540 => true, - 119541 => true, - 119542 => true, - 119543 => true, - 119544 => true, - 119545 => true, - 119546 => true, - 119547 => true, - 119548 => true, - 119549 => true, - 119550 => true, - 119551 => true, - 119639 => true, - 119640 => true, - 119641 => true, - 119642 => true, - 119643 => true, - 119644 => true, - 119645 => true, - 119646 => true, - 119647 => true, - 119893 => true, - 119965 => true, - 119968 => true, - 119969 => true, - 119971 => true, - 119972 => true, - 119975 => true, - 119976 => true, - 119981 => true, - 119994 => true, - 119996 => true, - 120004 => true, - 120070 => true, - 120075 => true, - 120076 => true, - 120085 => true, - 120093 => true, - 120122 => true, - 120127 => true, - 120133 => true, - 120135 => true, - 120136 => true, - 120137 => true, - 120145 => true, - 120486 => true, - 120487 => true, - 120780 => true, - 120781 => true, - 121484 => true, - 121485 => true, - 121486 => true, - 121487 => true, - 121488 => true, - 121489 => true, - 121490 => true, - 121491 => true, - 121492 => true, - 121493 => true, - 121494 => true, - 121495 => true, - 121496 => true, - 121497 => true, - 121498 => true, - 121504 => true, - 122887 => true, - 122905 => true, - 122906 => true, - 122914 => true, - 122917 => true, - 123181 => true, - 123182 => true, - 123183 => true, - 123198 => true, - 123199 => true, - 123210 => true, - 123211 => true, - 123212 => true, - 123213 => true, - 123642 => true, - 123643 => true, - 123644 => true, - 123645 => true, - 123646 => true, - 125125 => true, - 125126 => true, - 125260 => true, - 125261 => true, - 125262 => true, - 125263 => true, - 125274 => true, - 125275 => true, - 125276 => true, - 125277 => true, - 126468 => true, - 126496 => true, - 126499 => true, - 126501 => true, - 126502 => true, - 126504 => true, - 126515 => true, - 126520 => true, - 126522 => true, - 126524 => true, - 126525 => true, - 126526 => true, - 126527 => true, - 126528 => true, - 126529 => true, - 126531 => true, - 126532 => true, - 126533 => true, - 126534 => true, - 126536 => true, - 126538 => true, - 126540 => true, - 126544 => true, - 126547 => true, - 126549 => true, - 126550 => true, - 126552 => true, - 126554 => true, - 126556 => true, - 126558 => true, - 126560 => true, - 126563 => true, - 126565 => true, - 126566 => true, - 126571 => true, - 126579 => true, - 126584 => true, - 126589 => true, - 126591 => true, - 126602 => true, - 126620 => true, - 126621 => true, - 126622 => true, - 126623 => true, - 126624 => true, - 126628 => true, - 126634 => true, - 127020 => true, - 127021 => true, - 127022 => true, - 127023 => true, - 127124 => true, - 127125 => true, - 127126 => true, - 127127 => true, - 127128 => true, - 127129 => true, - 127130 => true, - 127131 => true, - 127132 => true, - 127133 => true, - 127134 => true, - 127135 => true, - 127151 => true, - 127152 => true, - 127168 => true, - 127184 => true, - 127222 => true, - 127223 => true, - 127224 => true, - 127225 => true, - 127226 => true, - 127227 => true, - 127228 => true, - 127229 => true, - 127230 => true, - 127231 => true, - 127232 => true, - 127491 => true, - 127492 => true, - 127493 => true, - 127494 => true, - 127495 => true, - 127496 => true, - 127497 => true, - 127498 => true, - 127499 => true, - 127500 => true, - 127501 => true, - 127502 => true, - 127503 => true, - 127548 => true, - 127549 => true, - 127550 => true, - 127551 => true, - 127561 => true, - 127562 => true, - 127563 => true, - 127564 => true, - 127565 => true, - 127566 => true, - 127567 => true, - 127570 => true, - 127571 => true, - 127572 => true, - 127573 => true, - 127574 => true, - 127575 => true, - 127576 => true, - 127577 => true, - 127578 => true, - 127579 => true, - 127580 => true, - 127581 => true, - 127582 => true, - 127583 => true, - 128728 => true, - 128729 => true, - 128730 => true, - 128731 => true, - 128732 => true, - 128733 => true, - 128734 => true, - 128735 => true, - 128749 => true, - 128750 => true, - 128751 => true, - 128765 => true, - 128766 => true, - 128767 => true, - 128884 => true, - 128885 => true, - 128886 => true, - 128887 => true, - 128888 => true, - 128889 => true, - 128890 => true, - 128891 => true, - 128892 => true, - 128893 => true, - 128894 => true, - 128895 => true, - 128985 => true, - 128986 => true, - 128987 => true, - 128988 => true, - 128989 => true, - 128990 => true, - 128991 => true, - 129004 => true, - 129005 => true, - 129006 => true, - 129007 => true, - 129008 => true, - 129009 => true, - 129010 => true, - 129011 => true, - 129012 => true, - 129013 => true, - 129014 => true, - 129015 => true, - 129016 => true, - 129017 => true, - 129018 => true, - 129019 => true, - 129020 => true, - 129021 => true, - 129022 => true, - 129023 => true, - 129036 => true, - 129037 => true, - 129038 => true, - 129039 => true, - 129096 => true, - 129097 => true, - 129098 => true, - 129099 => true, - 129100 => true, - 129101 => true, - 129102 => true, - 129103 => true, - 129114 => true, - 129115 => true, - 129116 => true, - 129117 => true, - 129118 => true, - 129119 => true, - 129160 => true, - 129161 => true, - 129162 => true, - 129163 => true, - 129164 => true, - 129165 => true, - 129166 => true, - 129167 => true, - 129198 => true, - 129199 => true, - 129401 => true, - 129484 => true, - 129620 => true, - 129621 => true, - 129622 => true, - 129623 => true, - 129624 => true, - 129625 => true, - 129626 => true, - 129627 => true, - 129628 => true, - 129629 => true, - 129630 => true, - 129631 => true, - 129646 => true, - 129647 => true, - 129653 => true, - 129654 => true, - 129655 => true, - 129659 => true, - 129660 => true, - 129661 => true, - 129662 => true, - 129663 => true, - 129671 => true, - 129672 => true, - 129673 => true, - 129674 => true, - 129675 => true, - 129676 => true, - 129677 => true, - 129678 => true, - 129679 => true, - 129705 => true, - 129706 => true, - 129707 => true, - 129708 => true, - 129709 => true, - 129710 => true, - 129711 => true, - 129719 => true, - 129720 => true, - 129721 => true, - 129722 => true, - 129723 => true, - 129724 => true, - 129725 => true, - 129726 => true, - 129727 => true, - 129731 => true, - 129732 => true, - 129733 => true, - 129734 => true, - 129735 => true, - 129736 => true, - 129737 => true, - 129738 => true, - 129739 => true, - 129740 => true, - 129741 => true, - 129742 => true, - 129743 => true, - 129939 => true, - 131070 => true, - 131071 => true, - 177973 => true, - 177974 => true, - 177975 => true, - 177976 => true, - 177977 => true, - 177978 => true, - 177979 => true, - 177980 => true, - 177981 => true, - 177982 => true, - 177983 => true, - 178206 => true, - 178207 => true, - 183970 => true, - 183971 => true, - 183972 => true, - 183973 => true, - 183974 => true, - 183975 => true, - 183976 => true, - 183977 => true, - 183978 => true, - 183979 => true, - 183980 => true, - 183981 => true, - 183982 => true, - 183983 => true, - 194664 => true, - 194676 => true, - 194847 => true, - 194911 => true, - 195007 => true, - 196606 => true, - 196607 => true, - 262142 => true, - 262143 => true, - 327678 => true, - 327679 => true, - 393214 => true, - 393215 => true, - 458750 => true, - 458751 => true, - 524286 => true, - 524287 => true, - 589822 => true, - 589823 => true, - 655358 => true, - 655359 => true, - 720894 => true, - 720895 => true, - 786430 => true, - 786431 => true, - 851966 => true, - 851967 => true, - 917502 => true, - 917503 => true, - 917504 => true, - 917505 => true, - 917506 => true, - 917507 => true, - 917508 => true, - 917509 => true, - 917510 => true, - 917511 => true, - 917512 => true, - 917513 => true, - 917514 => true, - 917515 => true, - 917516 => true, - 917517 => true, - 917518 => true, - 917519 => true, - 917520 => true, - 917521 => true, - 917522 => true, - 917523 => true, - 917524 => true, - 917525 => true, - 917526 => true, - 917527 => true, - 917528 => true, - 917529 => true, - 917530 => true, - 917531 => true, - 917532 => true, - 917533 => true, - 917534 => true, - 917535 => true, - 983038 => true, - 983039 => true, - 1048574 => true, - 1048575 => true, - 1114110 => true, - 1114111 => true, -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php deleted file mode 100644 index 54f21cc0cdd..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php +++ /dev/null @@ -1,308 +0,0 @@ - ' ', - 168 => ' ̈', - 175 => ' Ì„', - 180 => ' Ì', - 184 => ' ̧', - 728 => ' ̆', - 729 => ' ̇', - 730 => ' ÌŠ', - 731 => ' ̨', - 732 => ' ̃', - 733 => ' Ì‹', - 890 => ' ι', - 894 => ';', - 900 => ' Ì', - 901 => ' ̈Ì', - 8125 => ' Ì“', - 8127 => ' Ì“', - 8128 => ' Í‚', - 8129 => ' ̈͂', - 8141 => ' Ì“Ì€', - 8142 => ' Ì“Ì', - 8143 => ' Ì“Í‚', - 8157 => ' ̔̀', - 8158 => ' Ì”Ì', - 8159 => ' ̔͂', - 8173 => ' ̈̀', - 8174 => ' ̈Ì', - 8175 => '`', - 8189 => ' Ì', - 8190 => ' Ì”', - 8192 => ' ', - 8193 => ' ', - 8194 => ' ', - 8195 => ' ', - 8196 => ' ', - 8197 => ' ', - 8198 => ' ', - 8199 => ' ', - 8200 => ' ', - 8201 => ' ', - 8202 => ' ', - 8215 => ' ̳', - 8239 => ' ', - 8252 => '!!', - 8254 => ' Ì…', - 8263 => '??', - 8264 => '?!', - 8265 => '!?', - 8287 => ' ', - 8314 => '+', - 8316 => '=', - 8317 => '(', - 8318 => ')', - 8330 => '+', - 8332 => '=', - 8333 => '(', - 8334 => ')', - 8448 => 'a/c', - 8449 => 'a/s', - 8453 => 'c/o', - 8454 => 'c/u', - 9332 => '(1)', - 9333 => '(2)', - 9334 => '(3)', - 9335 => '(4)', - 9336 => '(5)', - 9337 => '(6)', - 9338 => '(7)', - 9339 => '(8)', - 9340 => '(9)', - 9341 => '(10)', - 9342 => '(11)', - 9343 => '(12)', - 9344 => '(13)', - 9345 => '(14)', - 9346 => '(15)', - 9347 => '(16)', - 9348 => '(17)', - 9349 => '(18)', - 9350 => '(19)', - 9351 => '(20)', - 9372 => '(a)', - 9373 => '(b)', - 9374 => '(c)', - 9375 => '(d)', - 9376 => '(e)', - 9377 => '(f)', - 9378 => '(g)', - 9379 => '(h)', - 9380 => '(i)', - 9381 => '(j)', - 9382 => '(k)', - 9383 => '(l)', - 9384 => '(m)', - 9385 => '(n)', - 9386 => '(o)', - 9387 => '(p)', - 9388 => '(q)', - 9389 => '(r)', - 9390 => '(s)', - 9391 => '(t)', - 9392 => '(u)', - 9393 => '(v)', - 9394 => '(w)', - 9395 => '(x)', - 9396 => '(y)', - 9397 => '(z)', - 10868 => '::=', - 10869 => '==', - 10870 => '===', - 12288 => ' ', - 12443 => ' ã‚™', - 12444 => ' ã‚š', - 12800 => '(á„€)', - 12801 => '(á„‚)', - 12802 => '(ᄃ)', - 12803 => '(á„…)', - 12804 => '(ᄆ)', - 12805 => '(ᄇ)', - 12806 => '(ᄉ)', - 12807 => '(á„‹)', - 12808 => '(á„Œ)', - 12809 => '(á„Ž)', - 12810 => '(á„)', - 12811 => '(á„)', - 12812 => '(á„‘)', - 12813 => '(á„’)', - 12814 => '(ê°€)', - 12815 => '(나)', - 12816 => '(다)', - 12817 => '(ë¼)', - 12818 => '(마)', - 12819 => '(ë°”)', - 12820 => '(사)', - 12821 => '(ì•„)', - 12822 => '(ìž)', - 12823 => '(ì°¨)', - 12824 => '(ì¹´)', - 12825 => '(타)', - 12826 => '(파)', - 12827 => '(하)', - 12828 => '(주)', - 12829 => '(오전)', - 12830 => '(오후)', - 12832 => '(一)', - 12833 => '(二)', - 12834 => '(三)', - 12835 => '(å››)', - 12836 => '(五)', - 12837 => '(å…­)', - 12838 => '(七)', - 12839 => '(å…«)', - 12840 => '(ä¹)', - 12841 => '(å)', - 12842 => '(月)', - 12843 => '(ç«)', - 12844 => '(æ°´)', - 12845 => '(木)', - 12846 => '(金)', - 12847 => '(土)', - 12848 => '(æ—¥)', - 12849 => '(æ ª)', - 12850 => '(有)', - 12851 => '(社)', - 12852 => '(å)', - 12853 => '(特)', - 12854 => '(財)', - 12855 => '(ç¥)', - 12856 => '(労)', - 12857 => '(代)', - 12858 => '(呼)', - 12859 => '(å­¦)', - 12860 => '(監)', - 12861 => '(ä¼)', - 12862 => '(資)', - 12863 => '(å”)', - 12864 => '(祭)', - 12865 => '(休)', - 12866 => '(自)', - 12867 => '(至)', - 64297 => '+', - 64606 => ' ٌّ', - 64607 => ' ÙÙ‘', - 64608 => ' ÙŽÙ‘', - 64609 => ' ÙÙ‘', - 64610 => ' ÙÙ‘', - 64611 => ' ّٰ', - 65018 => 'صلى الله عليه وسلم', - 65019 => 'جل جلاله', - 65040 => ',', - 65043 => ':', - 65044 => ';', - 65045 => '!', - 65046 => '?', - 65075 => '_', - 65076 => '_', - 65077 => '(', - 65078 => ')', - 65079 => '{', - 65080 => '}', - 65095 => '[', - 65096 => ']', - 65097 => ' Ì…', - 65098 => ' Ì…', - 65099 => ' Ì…', - 65100 => ' Ì…', - 65101 => '_', - 65102 => '_', - 65103 => '_', - 65104 => ',', - 65108 => ';', - 65109 => ':', - 65110 => '?', - 65111 => '!', - 65113 => '(', - 65114 => ')', - 65115 => '{', - 65116 => '}', - 65119 => '#', - 65120 => '&', - 65121 => '*', - 65122 => '+', - 65124 => '<', - 65125 => '>', - 65126 => '=', - 65128 => '\\', - 65129 => '$', - 65130 => '%', - 65131 => '@', - 65136 => ' Ù‹', - 65138 => ' ÙŒ', - 65140 => ' Ù', - 65142 => ' ÙŽ', - 65144 => ' Ù', - 65146 => ' Ù', - 65148 => ' Ù‘', - 65150 => ' Ù’', - 65281 => '!', - 65282 => '"', - 65283 => '#', - 65284 => '$', - 65285 => '%', - 65286 => '&', - 65287 => '\'', - 65288 => '(', - 65289 => ')', - 65290 => '*', - 65291 => '+', - 65292 => ',', - 65295 => '/', - 65306 => ':', - 65307 => ';', - 65308 => '<', - 65309 => '=', - 65310 => '>', - 65311 => '?', - 65312 => '@', - 65339 => '[', - 65340 => '\\', - 65341 => ']', - 65342 => '^', - 65343 => '_', - 65344 => '`', - 65371 => '{', - 65372 => '|', - 65373 => '}', - 65374 => '~', - 65507 => ' Ì„', - 127233 => '0,', - 127234 => '1,', - 127235 => '2,', - 127236 => '3,', - 127237 => '4,', - 127238 => '5,', - 127239 => '6,', - 127240 => '7,', - 127241 => '8,', - 127242 => '9,', - 127248 => '(a)', - 127249 => '(b)', - 127250 => '(c)', - 127251 => '(d)', - 127252 => '(e)', - 127253 => '(f)', - 127254 => '(g)', - 127255 => '(h)', - 127256 => '(i)', - 127257 => '(j)', - 127258 => '(k)', - 127259 => '(l)', - 127260 => '(m)', - 127261 => '(n)', - 127262 => '(o)', - 127263 => '(p)', - 127264 => '(q)', - 127265 => '(r)', - 127266 => '(s)', - 127267 => '(t)', - 127268 => '(u)', - 127269 => '(v)', - 127270 => '(w)', - 127271 => '(x)', - 127272 => '(y)', - 127273 => '(z)', -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php deleted file mode 100644 index 223396ec4c3..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php +++ /dev/null @@ -1,71 +0,0 @@ - true, - 1 => true, - 2 => true, - 3 => true, - 4 => true, - 5 => true, - 6 => true, - 7 => true, - 8 => true, - 9 => true, - 10 => true, - 11 => true, - 12 => true, - 13 => true, - 14 => true, - 15 => true, - 16 => true, - 17 => true, - 18 => true, - 19 => true, - 20 => true, - 21 => true, - 22 => true, - 23 => true, - 24 => true, - 25 => true, - 26 => true, - 27 => true, - 28 => true, - 29 => true, - 30 => true, - 31 => true, - 32 => true, - 33 => true, - 34 => true, - 35 => true, - 36 => true, - 37 => true, - 38 => true, - 39 => true, - 40 => true, - 41 => true, - 42 => true, - 43 => true, - 44 => true, - 47 => true, - 58 => true, - 59 => true, - 60 => true, - 61 => true, - 62 => true, - 63 => true, - 64 => true, - 91 => true, - 92 => true, - 93 => true, - 94 => true, - 95 => true, - 96 => true, - 123 => true, - 124 => true, - 125 => true, - 126 => true, - 127 => true, - 8800 => true, - 8814 => true, - 8815 => true, -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php deleted file mode 100644 index b377844130e..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php +++ /dev/null @@ -1,273 +0,0 @@ - true, - 847 => true, - 6155 => true, - 6156 => true, - 6157 => true, - 8203 => true, - 8288 => true, - 8292 => true, - 65024 => true, - 65025 => true, - 65026 => true, - 65027 => true, - 65028 => true, - 65029 => true, - 65030 => true, - 65031 => true, - 65032 => true, - 65033 => true, - 65034 => true, - 65035 => true, - 65036 => true, - 65037 => true, - 65038 => true, - 65039 => true, - 65279 => true, - 113824 => true, - 113825 => true, - 113826 => true, - 113827 => true, - 917760 => true, - 917761 => true, - 917762 => true, - 917763 => true, - 917764 => true, - 917765 => true, - 917766 => true, - 917767 => true, - 917768 => true, - 917769 => true, - 917770 => true, - 917771 => true, - 917772 => true, - 917773 => true, - 917774 => true, - 917775 => true, - 917776 => true, - 917777 => true, - 917778 => true, - 917779 => true, - 917780 => true, - 917781 => true, - 917782 => true, - 917783 => true, - 917784 => true, - 917785 => true, - 917786 => true, - 917787 => true, - 917788 => true, - 917789 => true, - 917790 => true, - 917791 => true, - 917792 => true, - 917793 => true, - 917794 => true, - 917795 => true, - 917796 => true, - 917797 => true, - 917798 => true, - 917799 => true, - 917800 => true, - 917801 => true, - 917802 => true, - 917803 => true, - 917804 => true, - 917805 => true, - 917806 => true, - 917807 => true, - 917808 => true, - 917809 => true, - 917810 => true, - 917811 => true, - 917812 => true, - 917813 => true, - 917814 => true, - 917815 => true, - 917816 => true, - 917817 => true, - 917818 => true, - 917819 => true, - 917820 => true, - 917821 => true, - 917822 => true, - 917823 => true, - 917824 => true, - 917825 => true, - 917826 => true, - 917827 => true, - 917828 => true, - 917829 => true, - 917830 => true, - 917831 => true, - 917832 => true, - 917833 => true, - 917834 => true, - 917835 => true, - 917836 => true, - 917837 => true, - 917838 => true, - 917839 => true, - 917840 => true, - 917841 => true, - 917842 => true, - 917843 => true, - 917844 => true, - 917845 => true, - 917846 => true, - 917847 => true, - 917848 => true, - 917849 => true, - 917850 => true, - 917851 => true, - 917852 => true, - 917853 => true, - 917854 => true, - 917855 => true, - 917856 => true, - 917857 => true, - 917858 => true, - 917859 => true, - 917860 => true, - 917861 => true, - 917862 => true, - 917863 => true, - 917864 => true, - 917865 => true, - 917866 => true, - 917867 => true, - 917868 => true, - 917869 => true, - 917870 => true, - 917871 => true, - 917872 => true, - 917873 => true, - 917874 => true, - 917875 => true, - 917876 => true, - 917877 => true, - 917878 => true, - 917879 => true, - 917880 => true, - 917881 => true, - 917882 => true, - 917883 => true, - 917884 => true, - 917885 => true, - 917886 => true, - 917887 => true, - 917888 => true, - 917889 => true, - 917890 => true, - 917891 => true, - 917892 => true, - 917893 => true, - 917894 => true, - 917895 => true, - 917896 => true, - 917897 => true, - 917898 => true, - 917899 => true, - 917900 => true, - 917901 => true, - 917902 => true, - 917903 => true, - 917904 => true, - 917905 => true, - 917906 => true, - 917907 => true, - 917908 => true, - 917909 => true, - 917910 => true, - 917911 => true, - 917912 => true, - 917913 => true, - 917914 => true, - 917915 => true, - 917916 => true, - 917917 => true, - 917918 => true, - 917919 => true, - 917920 => true, - 917921 => true, - 917922 => true, - 917923 => true, - 917924 => true, - 917925 => true, - 917926 => true, - 917927 => true, - 917928 => true, - 917929 => true, - 917930 => true, - 917931 => true, - 917932 => true, - 917933 => true, - 917934 => true, - 917935 => true, - 917936 => true, - 917937 => true, - 917938 => true, - 917939 => true, - 917940 => true, - 917941 => true, - 917942 => true, - 917943 => true, - 917944 => true, - 917945 => true, - 917946 => true, - 917947 => true, - 917948 => true, - 917949 => true, - 917950 => true, - 917951 => true, - 917952 => true, - 917953 => true, - 917954 => true, - 917955 => true, - 917956 => true, - 917957 => true, - 917958 => true, - 917959 => true, - 917960 => true, - 917961 => true, - 917962 => true, - 917963 => true, - 917964 => true, - 917965 => true, - 917966 => true, - 917967 => true, - 917968 => true, - 917969 => true, - 917970 => true, - 917971 => true, - 917972 => true, - 917973 => true, - 917974 => true, - 917975 => true, - 917976 => true, - 917977 => true, - 917978 => true, - 917979 => true, - 917980 => true, - 917981 => true, - 917982 => true, - 917983 => true, - 917984 => true, - 917985 => true, - 917986 => true, - 917987 => true, - 917988 => true, - 917989 => true, - 917990 => true, - 917991 => true, - 917992 => true, - 917993 => true, - 917994 => true, - 917995 => true, - 917996 => true, - 917997 => true, - 917998 => true, - 917999 => true, -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php deleted file mode 100644 index 9b85fe9d3f8..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php +++ /dev/null @@ -1,5778 +0,0 @@ - 'a', - 66 => 'b', - 67 => 'c', - 68 => 'd', - 69 => 'e', - 70 => 'f', - 71 => 'g', - 72 => 'h', - 73 => 'i', - 74 => 'j', - 75 => 'k', - 76 => 'l', - 77 => 'm', - 78 => 'n', - 79 => 'o', - 80 => 'p', - 81 => 'q', - 82 => 'r', - 83 => 's', - 84 => 't', - 85 => 'u', - 86 => 'v', - 87 => 'w', - 88 => 'x', - 89 => 'y', - 90 => 'z', - 170 => 'a', - 178 => '2', - 179 => '3', - 181 => 'μ', - 185 => '1', - 186 => 'o', - 188 => '1â„4', - 189 => '1â„2', - 190 => '3â„4', - 192 => 'à', - 193 => 'á', - 194 => 'â', - 195 => 'ã', - 196 => 'ä', - 197 => 'Ã¥', - 198 => 'æ', - 199 => 'ç', - 200 => 'è', - 201 => 'é', - 202 => 'ê', - 203 => 'ë', - 204 => 'ì', - 205 => 'í', - 206 => 'î', - 207 => 'ï', - 208 => 'ð', - 209 => 'ñ', - 210 => 'ò', - 211 => 'ó', - 212 => 'ô', - 213 => 'õ', - 214 => 'ö', - 216 => 'ø', - 217 => 'ù', - 218 => 'ú', - 219 => 'û', - 220 => 'ü', - 221 => 'ý', - 222 => 'þ', - 256 => 'Ä', - 258 => 'ă', - 260 => 'Ä…', - 262 => 'ć', - 264 => 'ĉ', - 266 => 'Ä‹', - 268 => 'Ä', - 270 => 'Ä', - 272 => 'Ä‘', - 274 => 'Ä“', - 276 => 'Ä•', - 278 => 'Ä—', - 280 => 'Ä™', - 282 => 'Ä›', - 284 => 'Ä', - 286 => 'ÄŸ', - 288 => 'Ä¡', - 290 => 'Ä£', - 292 => 'Ä¥', - 294 => 'ħ', - 296 => 'Ä©', - 298 => 'Ä«', - 300 => 'Ä­', - 302 => 'į', - 304 => 'i̇', - 306 => 'ij', - 307 => 'ij', - 308 => 'ĵ', - 310 => 'Ä·', - 313 => 'ĺ', - 315 => 'ļ', - 317 => 'ľ', - 319 => 'l·', - 320 => 'l·', - 321 => 'Å‚', - 323 => 'Å„', - 325 => 'ņ', - 327 => 'ň', - 329 => 'ʼn', - 330 => 'Å‹', - 332 => 'Å', - 334 => 'Å', - 336 => 'Å‘', - 338 => 'Å“', - 340 => 'Å•', - 342 => 'Å—', - 344 => 'Å™', - 346 => 'Å›', - 348 => 'Å', - 350 => 'ÅŸ', - 352 => 'Å¡', - 354 => 'Å£', - 356 => 'Å¥', - 358 => 'ŧ', - 360 => 'Å©', - 362 => 'Å«', - 364 => 'Å­', - 366 => 'ů', - 368 => 'ű', - 370 => 'ų', - 372 => 'ŵ', - 374 => 'Å·', - 376 => 'ÿ', - 377 => 'ź', - 379 => 'ż', - 381 => 'ž', - 383 => 's', - 385 => 'É“', - 386 => 'ƃ', - 388 => 'Æ…', - 390 => 'É”', - 391 => 'ƈ', - 393 => 'É–', - 394 => 'É—', - 395 => 'ÆŒ', - 398 => 'Ç', - 399 => 'É™', - 400 => 'É›', - 401 => 'Æ’', - 403 => 'É ', - 404 => 'É£', - 406 => 'É©', - 407 => 'ɨ', - 408 => 'Æ™', - 412 => 'ɯ', - 413 => 'ɲ', - 415 => 'ɵ', - 416 => 'Æ¡', - 418 => 'Æ£', - 420 => 'Æ¥', - 422 => 'Ê€', - 423 => 'ƨ', - 425 => 'ʃ', - 428 => 'Æ­', - 430 => 'ʈ', - 431 => 'Æ°', - 433 => 'ÊŠ', - 434 => 'Ê‹', - 435 => 'Æ´', - 437 => 'ƶ', - 439 => 'Ê’', - 440 => 'ƹ', - 444 => 'ƽ', - 452 => 'dž', - 453 => 'dž', - 454 => 'dž', - 455 => 'lj', - 456 => 'lj', - 457 => 'lj', - 458 => 'nj', - 459 => 'nj', - 460 => 'nj', - 461 => 'ÇŽ', - 463 => 'Ç', - 465 => 'Ç’', - 467 => 'Ç”', - 469 => 'Ç–', - 471 => 'ǘ', - 473 => 'Çš', - 475 => 'Çœ', - 478 => 'ÇŸ', - 480 => 'Ç¡', - 482 => 'Ç£', - 484 => 'Ç¥', - 486 => 'ǧ', - 488 => 'Ç©', - 490 => 'Ç«', - 492 => 'Ç­', - 494 => 'ǯ', - 497 => 'dz', - 498 => 'dz', - 499 => 'dz', - 500 => 'ǵ', - 502 => 'Æ•', - 503 => 'Æ¿', - 504 => 'ǹ', - 506 => 'Ç»', - 508 => 'ǽ', - 510 => 'Ç¿', - 512 => 'È', - 514 => 'ȃ', - 516 => 'È…', - 518 => 'ȇ', - 520 => 'ȉ', - 522 => 'È‹', - 524 => 'È', - 526 => 'È', - 528 => 'È‘', - 530 => 'È“', - 532 => 'È•', - 534 => 'È—', - 536 => 'È™', - 538 => 'È›', - 540 => 'È', - 542 => 'ÈŸ', - 544 => 'Æž', - 546 => 'È£', - 548 => 'È¥', - 550 => 'ȧ', - 552 => 'È©', - 554 => 'È«', - 556 => 'È­', - 558 => 'ȯ', - 560 => 'ȱ', - 562 => 'ȳ', - 570 => 'â±¥', - 571 => 'ȼ', - 573 => 'Æš', - 574 => 'ⱦ', - 577 => 'É‚', - 579 => 'Æ€', - 580 => 'ʉ', - 581 => 'ÊŒ', - 582 => 'ɇ', - 584 => 'ɉ', - 586 => 'É‹', - 588 => 'É', - 590 => 'É', - 688 => 'h', - 689 => 'ɦ', - 690 => 'j', - 691 => 'r', - 692 => 'ɹ', - 693 => 'É»', - 694 => 'Ê', - 695 => 'w', - 696 => 'y', - 736 => 'É£', - 737 => 'l', - 738 => 's', - 739 => 'x', - 740 => 'Ê•', - 832 => 'Ì€', - 833 => 'Ì', - 835 => 'Ì“', - 836 => '̈Ì', - 837 => 'ι', - 880 => 'ͱ', - 882 => 'ͳ', - 884 => 'ʹ', - 886 => 'Í·', - 895 => 'ϳ', - 902 => 'ά', - 903 => '·', - 904 => 'έ', - 905 => 'ή', - 906 => 'ί', - 908 => 'ÏŒ', - 910 => 'Ï', - 911 => 'ÏŽ', - 913 => 'α', - 914 => 'β', - 915 => 'γ', - 916 => 'δ', - 917 => 'ε', - 918 => 'ζ', - 919 => 'η', - 920 => 'θ', - 921 => 'ι', - 922 => 'κ', - 923 => 'λ', - 924 => 'μ', - 925 => 'ν', - 926 => 'ξ', - 927 => 'ο', - 928 => 'Ï€', - 929 => 'Ï', - 931 => 'σ', - 932 => 'Ï„', - 933 => 'Ï…', - 934 => 'φ', - 935 => 'χ', - 936 => 'ψ', - 937 => 'ω', - 938 => 'ÏŠ', - 939 => 'Ï‹', - 975 => 'Ï—', - 976 => 'β', - 977 => 'θ', - 978 => 'Ï…', - 979 => 'Ï', - 980 => 'Ï‹', - 981 => 'φ', - 982 => 'Ï€', - 984 => 'Ï™', - 986 => 'Ï›', - 988 => 'Ï', - 990 => 'ÏŸ', - 992 => 'Ï¡', - 994 => 'Ï£', - 996 => 'Ï¥', - 998 => 'ϧ', - 1000 => 'Ï©', - 1002 => 'Ï«', - 1004 => 'Ï­', - 1006 => 'ϯ', - 1008 => 'κ', - 1009 => 'Ï', - 1010 => 'σ', - 1012 => 'θ', - 1013 => 'ε', - 1015 => 'ϸ', - 1017 => 'σ', - 1018 => 'Ï»', - 1021 => 'Í»', - 1022 => 'ͼ', - 1023 => 'ͽ', - 1024 => 'Ñ', - 1025 => 'Ñ‘', - 1026 => 'Ñ’', - 1027 => 'Ñ“', - 1028 => 'Ñ”', - 1029 => 'Ñ•', - 1030 => 'Ñ–', - 1031 => 'Ñ—', - 1032 => 'ј', - 1033 => 'Ñ™', - 1034 => 'Ñš', - 1035 => 'Ñ›', - 1036 => 'Ñœ', - 1037 => 'Ñ', - 1038 => 'Ñž', - 1039 => 'ÑŸ', - 1040 => 'а', - 1041 => 'б', - 1042 => 'в', - 1043 => 'г', - 1044 => 'д', - 1045 => 'е', - 1046 => 'ж', - 1047 => 'з', - 1048 => 'и', - 1049 => 'й', - 1050 => 'к', - 1051 => 'л', - 1052 => 'м', - 1053 => 'н', - 1054 => 'о', - 1055 => 'п', - 1056 => 'Ñ€', - 1057 => 'Ñ', - 1058 => 'Ñ‚', - 1059 => 'у', - 1060 => 'Ñ„', - 1061 => 'Ñ…', - 1062 => 'ц', - 1063 => 'ч', - 1064 => 'ш', - 1065 => 'щ', - 1066 => 'ÑŠ', - 1067 => 'Ñ‹', - 1068 => 'ÑŒ', - 1069 => 'Ñ', - 1070 => 'ÑŽ', - 1071 => 'Ñ', - 1120 => 'Ñ¡', - 1122 => 'Ñ£', - 1124 => 'Ñ¥', - 1126 => 'ѧ', - 1128 => 'Ñ©', - 1130 => 'Ñ«', - 1132 => 'Ñ­', - 1134 => 'ѯ', - 1136 => 'ѱ', - 1138 => 'ѳ', - 1140 => 'ѵ', - 1142 => 'Ñ·', - 1144 => 'ѹ', - 1146 => 'Ñ»', - 1148 => 'ѽ', - 1150 => 'Ñ¿', - 1152 => 'Ò', - 1162 => 'Ò‹', - 1164 => 'Ò', - 1166 => 'Ò', - 1168 => 'Ò‘', - 1170 => 'Ò“', - 1172 => 'Ò•', - 1174 => 'Ò—', - 1176 => 'Ò™', - 1178 => 'Ò›', - 1180 => 'Ò', - 1182 => 'ÒŸ', - 1184 => 'Ò¡', - 1186 => 'Ò£', - 1188 => 'Ò¥', - 1190 => 'Ò§', - 1192 => 'Ò©', - 1194 => 'Ò«', - 1196 => 'Ò­', - 1198 => 'Ò¯', - 1200 => 'Ò±', - 1202 => 'Ò³', - 1204 => 'Òµ', - 1206 => 'Ò·', - 1208 => 'Ò¹', - 1210 => 'Ò»', - 1212 => 'Ò½', - 1214 => 'Ò¿', - 1217 => 'Ó‚', - 1219 => 'Ó„', - 1221 => 'Ó†', - 1223 => 'Óˆ', - 1225 => 'ÓŠ', - 1227 => 'ÓŒ', - 1229 => 'ÓŽ', - 1232 => 'Ó‘', - 1234 => 'Ó“', - 1236 => 'Ó•', - 1238 => 'Ó—', - 1240 => 'Ó™', - 1242 => 'Ó›', - 1244 => 'Ó', - 1246 => 'ÓŸ', - 1248 => 'Ó¡', - 1250 => 'Ó£', - 1252 => 'Ó¥', - 1254 => 'Ó§', - 1256 => 'Ó©', - 1258 => 'Ó«', - 1260 => 'Ó­', - 1262 => 'Ó¯', - 1264 => 'Ó±', - 1266 => 'Ó³', - 1268 => 'Óµ', - 1270 => 'Ó·', - 1272 => 'Ó¹', - 1274 => 'Ó»', - 1276 => 'Ó½', - 1278 => 'Ó¿', - 1280 => 'Ô', - 1282 => 'Ôƒ', - 1284 => 'Ô…', - 1286 => 'Ô‡', - 1288 => 'Ô‰', - 1290 => 'Ô‹', - 1292 => 'Ô', - 1294 => 'Ô', - 1296 => 'Ô‘', - 1298 => 'Ô“', - 1300 => 'Ô•', - 1302 => 'Ô—', - 1304 => 'Ô™', - 1306 => 'Ô›', - 1308 => 'Ô', - 1310 => 'ÔŸ', - 1312 => 'Ô¡', - 1314 => 'Ô£', - 1316 => 'Ô¥', - 1318 => 'Ô§', - 1320 => 'Ô©', - 1322 => 'Ô«', - 1324 => 'Ô­', - 1326 => 'Ô¯', - 1329 => 'Õ¡', - 1330 => 'Õ¢', - 1331 => 'Õ£', - 1332 => 'Õ¤', - 1333 => 'Õ¥', - 1334 => 'Õ¦', - 1335 => 'Õ§', - 1336 => 'Õ¨', - 1337 => 'Õ©', - 1338 => 'Õª', - 1339 => 'Õ«', - 1340 => 'Õ¬', - 1341 => 'Õ­', - 1342 => 'Õ®', - 1343 => 'Õ¯', - 1344 => 'Õ°', - 1345 => 'Õ±', - 1346 => 'Õ²', - 1347 => 'Õ³', - 1348 => 'Õ´', - 1349 => 'Õµ', - 1350 => 'Õ¶', - 1351 => 'Õ·', - 1352 => 'Õ¸', - 1353 => 'Õ¹', - 1354 => 'Õº', - 1355 => 'Õ»', - 1356 => 'Õ¼', - 1357 => 'Õ½', - 1358 => 'Õ¾', - 1359 => 'Õ¿', - 1360 => 'Ö€', - 1361 => 'Ö', - 1362 => 'Ö‚', - 1363 => 'Öƒ', - 1364 => 'Ö„', - 1365 => 'Ö…', - 1366 => 'Ö†', - 1415 => 'Õ¥Ö‚', - 1653 => 'اٴ', - 1654 => 'وٴ', - 1655 => 'Û‡Ù´', - 1656 => 'يٴ', - 2392 => 'क़', - 2393 => 'ख़', - 2394 => 'ग़', - 2395 => 'ज़', - 2396 => 'ड़', - 2397 => 'ढ़', - 2398 => 'फ़', - 2399 => 'य़', - 2524 => 'ড়', - 2525 => 'ঢ়', - 2527 => 'য়', - 2611 => 'ਲ਼', - 2614 => 'ਸ਼', - 2649 => 'ਖ਼', - 2650 => 'ਗ਼', - 2651 => 'ਜ਼', - 2654 => 'ਫ਼', - 2908 => 'ଡ଼', - 2909 => 'ଢ଼', - 3635 => 'à¹à¸²', - 3763 => 'à»àº²', - 3804 => 'ຫນ', - 3805 => 'ຫມ', - 3852 => '་', - 3907 => 'གྷ', - 3917 => 'ཌྷ', - 3922 => 'དྷ', - 3927 => 'བྷ', - 3932 => 'ཛྷ', - 3945 => 'ཀྵ', - 3955 => 'ཱི', - 3957 => 'ཱུ', - 3958 => 'ྲྀ', - 3959 => 'ྲཱྀ', - 3960 => 'ླྀ', - 3961 => 'ླཱྀ', - 3969 => 'ཱྀ', - 3987 => 'ྒྷ', - 3997 => 'ྜྷ', - 4002 => 'ྡྷ', - 4007 => 'ྦྷ', - 4012 => 'ྫྷ', - 4025 => 'à¾à¾µ', - 4295 => 'â´§', - 4301 => 'â´­', - 4348 => 'ნ', - 5112 => 'á°', - 5113 => 'á±', - 5114 => 'á²', - 5115 => 'á³', - 5116 => 'á´', - 5117 => 'áµ', - 7296 => 'в', - 7297 => 'д', - 7298 => 'о', - 7299 => 'Ñ', - 7300 => 'Ñ‚', - 7301 => 'Ñ‚', - 7302 => 'ÑŠ', - 7303 => 'Ñ£', - 7304 => 'ꙋ', - 7312 => 'áƒ', - 7313 => 'ბ', - 7314 => 'გ', - 7315 => 'დ', - 7316 => 'ე', - 7317 => 'ვ', - 7318 => 'ზ', - 7319 => 'თ', - 7320 => 'ი', - 7321 => 'კ', - 7322 => 'ლ', - 7323 => 'მ', - 7324 => 'ნ', - 7325 => 'áƒ', - 7326 => 'პ', - 7327 => 'ჟ', - 7328 => 'რ', - 7329 => 'ს', - 7330 => 'ტ', - 7331 => 'უ', - 7332 => 'ფ', - 7333 => 'ქ', - 7334 => 'ღ', - 7335 => 'ყ', - 7336 => 'შ', - 7337 => 'ჩ', - 7338 => 'ც', - 7339 => 'ძ', - 7340 => 'წ', - 7341 => 'ჭ', - 7342 => 'ხ', - 7343 => 'ჯ', - 7344 => 'ჰ', - 7345 => 'ჱ', - 7346 => 'ჲ', - 7347 => 'ჳ', - 7348 => 'ჴ', - 7349 => 'ჵ', - 7350 => 'ჶ', - 7351 => 'ჷ', - 7352 => 'ჸ', - 7353 => 'ჹ', - 7354 => 'ჺ', - 7357 => 'ჽ', - 7358 => 'ჾ', - 7359 => 'ჿ', - 7468 => 'a', - 7469 => 'æ', - 7470 => 'b', - 7472 => 'd', - 7473 => 'e', - 7474 => 'Ç', - 7475 => 'g', - 7476 => 'h', - 7477 => 'i', - 7478 => 'j', - 7479 => 'k', - 7480 => 'l', - 7481 => 'm', - 7482 => 'n', - 7484 => 'o', - 7485 => 'È£', - 7486 => 'p', - 7487 => 'r', - 7488 => 't', - 7489 => 'u', - 7490 => 'w', - 7491 => 'a', - 7492 => 'É', - 7493 => 'É‘', - 7494 => 'á´‚', - 7495 => 'b', - 7496 => 'd', - 7497 => 'e', - 7498 => 'É™', - 7499 => 'É›', - 7500 => 'Éœ', - 7501 => 'g', - 7503 => 'k', - 7504 => 'm', - 7505 => 'Å‹', - 7506 => 'o', - 7507 => 'É”', - 7508 => 'á´–', - 7509 => 'á´—', - 7510 => 'p', - 7511 => 't', - 7512 => 'u', - 7513 => 'á´', - 7514 => 'ɯ', - 7515 => 'v', - 7516 => 'á´¥', - 7517 => 'β', - 7518 => 'γ', - 7519 => 'δ', - 7520 => 'φ', - 7521 => 'χ', - 7522 => 'i', - 7523 => 'r', - 7524 => 'u', - 7525 => 'v', - 7526 => 'β', - 7527 => 'γ', - 7528 => 'Ï', - 7529 => 'φ', - 7530 => 'χ', - 7544 => 'н', - 7579 => 'É’', - 7580 => 'c', - 7581 => 'É•', - 7582 => 'ð', - 7583 => 'Éœ', - 7584 => 'f', - 7585 => 'ÉŸ', - 7586 => 'É¡', - 7587 => 'É¥', - 7588 => 'ɨ', - 7589 => 'É©', - 7590 => 'ɪ', - 7591 => 'áµ»', - 7592 => 'Ê', - 7593 => 'É­', - 7594 => 'ᶅ', - 7595 => 'ÊŸ', - 7596 => 'ɱ', - 7597 => 'É°', - 7598 => 'ɲ', - 7599 => 'ɳ', - 7600 => 'É´', - 7601 => 'ɵ', - 7602 => 'ɸ', - 7603 => 'Ê‚', - 7604 => 'ʃ', - 7605 => 'Æ«', - 7606 => 'ʉ', - 7607 => 'ÊŠ', - 7608 => 'á´œ', - 7609 => 'Ê‹', - 7610 => 'ÊŒ', - 7611 => 'z', - 7612 => 'Ê', - 7613 => 'Ê‘', - 7614 => 'Ê’', - 7615 => 'θ', - 7680 => 'á¸', - 7682 => 'ḃ', - 7684 => 'ḅ', - 7686 => 'ḇ', - 7688 => 'ḉ', - 7690 => 'ḋ', - 7692 => 'á¸', - 7694 => 'á¸', - 7696 => 'ḑ', - 7698 => 'ḓ', - 7700 => 'ḕ', - 7702 => 'ḗ', - 7704 => 'ḙ', - 7706 => 'ḛ', - 7708 => 'á¸', - 7710 => 'ḟ', - 7712 => 'ḡ', - 7714 => 'ḣ', - 7716 => 'ḥ', - 7718 => 'ḧ', - 7720 => 'ḩ', - 7722 => 'ḫ', - 7724 => 'ḭ', - 7726 => 'ḯ', - 7728 => 'ḱ', - 7730 => 'ḳ', - 7732 => 'ḵ', - 7734 => 'ḷ', - 7736 => 'ḹ', - 7738 => 'ḻ', - 7740 => 'ḽ', - 7742 => 'ḿ', - 7744 => 'á¹', - 7746 => 'ṃ', - 7748 => 'á¹…', - 7750 => 'ṇ', - 7752 => 'ṉ', - 7754 => 'ṋ', - 7756 => 'á¹', - 7758 => 'á¹', - 7760 => 'ṑ', - 7762 => 'ṓ', - 7764 => 'ṕ', - 7766 => 'á¹—', - 7768 => 'á¹™', - 7770 => 'á¹›', - 7772 => 'á¹', - 7774 => 'ṟ', - 7776 => 'ṡ', - 7778 => 'á¹£', - 7780 => 'á¹¥', - 7782 => 'ṧ', - 7784 => 'ṩ', - 7786 => 'ṫ', - 7788 => 'á¹­', - 7790 => 'ṯ', - 7792 => 'á¹±', - 7794 => 'á¹³', - 7796 => 'á¹µ', - 7798 => 'á¹·', - 7800 => 'á¹¹', - 7802 => 'á¹»', - 7804 => 'á¹½', - 7806 => 'ṿ', - 7808 => 'áº', - 7810 => 'ẃ', - 7812 => 'ẅ', - 7814 => 'ẇ', - 7816 => 'ẉ', - 7818 => 'ẋ', - 7820 => 'áº', - 7822 => 'áº', - 7824 => 'ẑ', - 7826 => 'ẓ', - 7828 => 'ẕ', - 7834 => 'aʾ', - 7835 => 'ṡ', - 7838 => 'ss', - 7840 => 'ạ', - 7842 => 'ả', - 7844 => 'ấ', - 7846 => 'ầ', - 7848 => 'ẩ', - 7850 => 'ẫ', - 7852 => 'ậ', - 7854 => 'ắ', - 7856 => 'ằ', - 7858 => 'ẳ', - 7860 => 'ẵ', - 7862 => 'ặ', - 7864 => 'ẹ', - 7866 => 'ẻ', - 7868 => 'ẽ', - 7870 => 'ế', - 7872 => 'á»', - 7874 => 'ể', - 7876 => 'á»…', - 7878 => 'ệ', - 7880 => 'ỉ', - 7882 => 'ị', - 7884 => 'á»', - 7886 => 'á»', - 7888 => 'ố', - 7890 => 'ồ', - 7892 => 'ổ', - 7894 => 'á»—', - 7896 => 'á»™', - 7898 => 'á»›', - 7900 => 'á»', - 7902 => 'ở', - 7904 => 'ỡ', - 7906 => 'ợ', - 7908 => 'ụ', - 7910 => 'ủ', - 7912 => 'ứ', - 7914 => 'ừ', - 7916 => 'á»­', - 7918 => 'ữ', - 7920 => 'á»±', - 7922 => 'ỳ', - 7924 => 'ỵ', - 7926 => 'á»·', - 7928 => 'ỹ', - 7930 => 'á»»', - 7932 => 'ỽ', - 7934 => 'ỿ', - 7944 => 'á¼€', - 7945 => 'á¼', - 7946 => 'ἂ', - 7947 => 'ἃ', - 7948 => 'ἄ', - 7949 => 'á¼…', - 7950 => 'ἆ', - 7951 => 'ἇ', - 7960 => 'á¼', - 7961 => 'ἑ', - 7962 => 'á¼’', - 7963 => 'ἓ', - 7964 => 'á¼”', - 7965 => 'ἕ', - 7976 => 'á¼ ', - 7977 => 'ἡ', - 7978 => 'á¼¢', - 7979 => 'á¼£', - 7980 => 'ἤ', - 7981 => 'á¼¥', - 7982 => 'ἦ', - 7983 => 'ἧ', - 7992 => 'á¼°', - 7993 => 'á¼±', - 7994 => 'á¼²', - 7995 => 'á¼³', - 7996 => 'á¼´', - 7997 => 'á¼µ', - 7998 => 'ἶ', - 7999 => 'á¼·', - 8008 => 'á½€', - 8009 => 'á½', - 8010 => 'ὂ', - 8011 => 'ὃ', - 8012 => 'ὄ', - 8013 => 'á½…', - 8025 => 'ὑ', - 8027 => 'ὓ', - 8029 => 'ὕ', - 8031 => 'á½—', - 8040 => 'á½ ', - 8041 => 'ὡ', - 8042 => 'á½¢', - 8043 => 'á½£', - 8044 => 'ὤ', - 8045 => 'á½¥', - 8046 => 'ὦ', - 8047 => 'ὧ', - 8049 => 'ά', - 8051 => 'έ', - 8053 => 'ή', - 8055 => 'ί', - 8057 => 'ÏŒ', - 8059 => 'Ï', - 8061 => 'ÏŽ', - 8064 => 'ἀι', - 8065 => 'á¼Î¹', - 8066 => 'ἂι', - 8067 => 'ἃι', - 8068 => 'ἄι', - 8069 => 'ἅι', - 8070 => 'ἆι', - 8071 => 'ἇι', - 8072 => 'ἀι', - 8073 => 'á¼Î¹', - 8074 => 'ἂι', - 8075 => 'ἃι', - 8076 => 'ἄι', - 8077 => 'ἅι', - 8078 => 'ἆι', - 8079 => 'ἇι', - 8080 => 'ἠι', - 8081 => 'ἡι', - 8082 => 'ἢι', - 8083 => 'ἣι', - 8084 => 'ἤι', - 8085 => 'ἥι', - 8086 => 'ἦι', - 8087 => 'ἧι', - 8088 => 'ἠι', - 8089 => 'ἡι', - 8090 => 'ἢι', - 8091 => 'ἣι', - 8092 => 'ἤι', - 8093 => 'ἥι', - 8094 => 'ἦι', - 8095 => 'ἧι', - 8096 => 'ὠι', - 8097 => 'ὡι', - 8098 => 'ὢι', - 8099 => 'ὣι', - 8100 => 'ὤι', - 8101 => 'ὥι', - 8102 => 'ὦι', - 8103 => 'ὧι', - 8104 => 'ὠι', - 8105 => 'ὡι', - 8106 => 'ὢι', - 8107 => 'ὣι', - 8108 => 'ὤι', - 8109 => 'ὥι', - 8110 => 'ὦι', - 8111 => 'ὧι', - 8114 => 'ὰι', - 8115 => 'αι', - 8116 => 'άι', - 8119 => 'ᾶι', - 8120 => 'á¾°', - 8121 => 'á¾±', - 8122 => 'á½°', - 8123 => 'ά', - 8124 => 'αι', - 8126 => 'ι', - 8130 => 'ὴι', - 8131 => 'ηι', - 8132 => 'ήι', - 8135 => 'ῆι', - 8136 => 'á½²', - 8137 => 'έ', - 8138 => 'á½´', - 8139 => 'ή', - 8140 => 'ηι', - 8147 => 'Î', - 8152 => 'á¿', - 8153 => 'á¿‘', - 8154 => 'ὶ', - 8155 => 'ί', - 8163 => 'ΰ', - 8168 => 'á¿ ', - 8169 => 'á¿¡', - 8170 => 'ὺ', - 8171 => 'Ï', - 8172 => 'á¿¥', - 8178 => 'ὼι', - 8179 => 'ωι', - 8180 => 'ώι', - 8183 => 'ῶι', - 8184 => 'ὸ', - 8185 => 'ÏŒ', - 8186 => 'á½¼', - 8187 => 'ÏŽ', - 8188 => 'ωι', - 8209 => 'â€', - 8243 => '′′', - 8244 => '′′′', - 8246 => '‵‵', - 8247 => '‵‵‵', - 8279 => '′′′′', - 8304 => '0', - 8305 => 'i', - 8308 => '4', - 8309 => '5', - 8310 => '6', - 8311 => '7', - 8312 => '8', - 8313 => '9', - 8315 => '−', - 8319 => 'n', - 8320 => '0', - 8321 => '1', - 8322 => '2', - 8323 => '3', - 8324 => '4', - 8325 => '5', - 8326 => '6', - 8327 => '7', - 8328 => '8', - 8329 => '9', - 8331 => '−', - 8336 => 'a', - 8337 => 'e', - 8338 => 'o', - 8339 => 'x', - 8340 => 'É™', - 8341 => 'h', - 8342 => 'k', - 8343 => 'l', - 8344 => 'm', - 8345 => 'n', - 8346 => 'p', - 8347 => 's', - 8348 => 't', - 8360 => 'rs', - 8450 => 'c', - 8451 => '°c', - 8455 => 'É›', - 8457 => '°f', - 8458 => 'g', - 8459 => 'h', - 8460 => 'h', - 8461 => 'h', - 8462 => 'h', - 8463 => 'ħ', - 8464 => 'i', - 8465 => 'i', - 8466 => 'l', - 8467 => 'l', - 8469 => 'n', - 8470 => 'no', - 8473 => 'p', - 8474 => 'q', - 8475 => 'r', - 8476 => 'r', - 8477 => 'r', - 8480 => 'sm', - 8481 => 'tel', - 8482 => 'tm', - 8484 => 'z', - 8486 => 'ω', - 8488 => 'z', - 8490 => 'k', - 8491 => 'Ã¥', - 8492 => 'b', - 8493 => 'c', - 8495 => 'e', - 8496 => 'e', - 8497 => 'f', - 8499 => 'm', - 8500 => 'o', - 8501 => '×', - 8502 => 'ב', - 8503 => '×’', - 8504 => 'ד', - 8505 => 'i', - 8507 => 'fax', - 8508 => 'Ï€', - 8509 => 'γ', - 8510 => 'γ', - 8511 => 'Ï€', - 8512 => '∑', - 8517 => 'd', - 8518 => 'd', - 8519 => 'e', - 8520 => 'i', - 8521 => 'j', - 8528 => '1â„7', - 8529 => '1â„9', - 8530 => '1â„10', - 8531 => '1â„3', - 8532 => '2â„3', - 8533 => '1â„5', - 8534 => '2â„5', - 8535 => '3â„5', - 8536 => '4â„5', - 8537 => '1â„6', - 8538 => '5â„6', - 8539 => '1â„8', - 8540 => '3â„8', - 8541 => '5â„8', - 8542 => '7â„8', - 8543 => '1â„', - 8544 => 'i', - 8545 => 'ii', - 8546 => 'iii', - 8547 => 'iv', - 8548 => 'v', - 8549 => 'vi', - 8550 => 'vii', - 8551 => 'viii', - 8552 => 'ix', - 8553 => 'x', - 8554 => 'xi', - 8555 => 'xii', - 8556 => 'l', - 8557 => 'c', - 8558 => 'd', - 8559 => 'm', - 8560 => 'i', - 8561 => 'ii', - 8562 => 'iii', - 8563 => 'iv', - 8564 => 'v', - 8565 => 'vi', - 8566 => 'vii', - 8567 => 'viii', - 8568 => 'ix', - 8569 => 'x', - 8570 => 'xi', - 8571 => 'xii', - 8572 => 'l', - 8573 => 'c', - 8574 => 'd', - 8575 => 'm', - 8585 => '0â„3', - 8748 => '∫∫', - 8749 => '∫∫∫', - 8751 => '∮∮', - 8752 => '∮∮∮', - 9001 => '〈', - 9002 => '〉', - 9312 => '1', - 9313 => '2', - 9314 => '3', - 9315 => '4', - 9316 => '5', - 9317 => '6', - 9318 => '7', - 9319 => '8', - 9320 => '9', - 9321 => '10', - 9322 => '11', - 9323 => '12', - 9324 => '13', - 9325 => '14', - 9326 => '15', - 9327 => '16', - 9328 => '17', - 9329 => '18', - 9330 => '19', - 9331 => '20', - 9398 => 'a', - 9399 => 'b', - 9400 => 'c', - 9401 => 'd', - 9402 => 'e', - 9403 => 'f', - 9404 => 'g', - 9405 => 'h', - 9406 => 'i', - 9407 => 'j', - 9408 => 'k', - 9409 => 'l', - 9410 => 'm', - 9411 => 'n', - 9412 => 'o', - 9413 => 'p', - 9414 => 'q', - 9415 => 'r', - 9416 => 's', - 9417 => 't', - 9418 => 'u', - 9419 => 'v', - 9420 => 'w', - 9421 => 'x', - 9422 => 'y', - 9423 => 'z', - 9424 => 'a', - 9425 => 'b', - 9426 => 'c', - 9427 => 'd', - 9428 => 'e', - 9429 => 'f', - 9430 => 'g', - 9431 => 'h', - 9432 => 'i', - 9433 => 'j', - 9434 => 'k', - 9435 => 'l', - 9436 => 'm', - 9437 => 'n', - 9438 => 'o', - 9439 => 'p', - 9440 => 'q', - 9441 => 'r', - 9442 => 's', - 9443 => 't', - 9444 => 'u', - 9445 => 'v', - 9446 => 'w', - 9447 => 'x', - 9448 => 'y', - 9449 => 'z', - 9450 => '0', - 10764 => '∫∫∫∫', - 10972 => 'â«Ì¸', - 11264 => 'â°°', - 11265 => 'â°±', - 11266 => 'â°²', - 11267 => 'â°³', - 11268 => 'â°´', - 11269 => 'â°µ', - 11270 => 'â°¶', - 11271 => 'â°·', - 11272 => 'â°¸', - 11273 => 'â°¹', - 11274 => 'â°º', - 11275 => 'â°»', - 11276 => 'â°¼', - 11277 => 'â°½', - 11278 => 'â°¾', - 11279 => 'â°¿', - 11280 => 'â±€', - 11281 => 'â±', - 11282 => 'ⱂ', - 11283 => 'ⱃ', - 11284 => 'ⱄ', - 11285 => 'â±…', - 11286 => 'ⱆ', - 11287 => 'ⱇ', - 11288 => 'ⱈ', - 11289 => 'ⱉ', - 11290 => 'ⱊ', - 11291 => 'ⱋ', - 11292 => 'ⱌ', - 11293 => 'â±', - 11294 => 'ⱎ', - 11295 => 'â±', - 11296 => 'â±', - 11297 => 'ⱑ', - 11298 => 'â±’', - 11299 => 'ⱓ', - 11300 => 'â±”', - 11301 => 'ⱕ', - 11302 => 'â±–', - 11303 => 'â±—', - 11304 => 'ⱘ', - 11305 => 'â±™', - 11306 => 'ⱚ', - 11307 => 'â±›', - 11308 => 'ⱜ', - 11309 => 'â±', - 11310 => 'ⱞ', - 11360 => 'ⱡ', - 11362 => 'É«', - 11363 => 'áµ½', - 11364 => 'ɽ', - 11367 => 'ⱨ', - 11369 => 'ⱪ', - 11371 => 'ⱬ', - 11373 => 'É‘', - 11374 => 'ɱ', - 11375 => 'É', - 11376 => 'É’', - 11378 => 'â±³', - 11381 => 'ⱶ', - 11388 => 'j', - 11389 => 'v', - 11390 => 'È¿', - 11391 => 'É€', - 11392 => 'â²', - 11394 => 'ⲃ', - 11396 => 'â²…', - 11398 => 'ⲇ', - 11400 => 'ⲉ', - 11402 => 'ⲋ', - 11404 => 'â²', - 11406 => 'â²', - 11408 => 'ⲑ', - 11410 => 'ⲓ', - 11412 => 'ⲕ', - 11414 => 'â²—', - 11416 => 'â²™', - 11418 => 'â²›', - 11420 => 'â²', - 11422 => 'ⲟ', - 11424 => 'ⲡ', - 11426 => 'â²£', - 11428 => 'â²¥', - 11430 => 'ⲧ', - 11432 => 'ⲩ', - 11434 => 'ⲫ', - 11436 => 'â²­', - 11438 => 'ⲯ', - 11440 => 'â²±', - 11442 => 'â²³', - 11444 => 'â²µ', - 11446 => 'â²·', - 11448 => 'â²¹', - 11450 => 'â²»', - 11452 => 'â²½', - 11454 => 'ⲿ', - 11456 => 'â³', - 11458 => 'ⳃ', - 11460 => 'â³…', - 11462 => 'ⳇ', - 11464 => 'ⳉ', - 11466 => 'ⳋ', - 11468 => 'â³', - 11470 => 'â³', - 11472 => 'ⳑ', - 11474 => 'ⳓ', - 11476 => 'ⳕ', - 11478 => 'â³—', - 11480 => 'â³™', - 11482 => 'â³›', - 11484 => 'â³', - 11486 => 'ⳟ', - 11488 => 'ⳡ', - 11490 => 'â³£', - 11499 => 'ⳬ', - 11501 => 'â³®', - 11506 => 'â³³', - 11631 => 'ⵡ', - 11935 => 'æ¯', - 12019 => '龟', - 12032 => '一', - 12033 => '丨', - 12034 => '丶', - 12035 => '丿', - 12036 => 'ä¹™', - 12037 => '亅', - 12038 => '二', - 12039 => '亠', - 12040 => '人', - 12041 => 'å„¿', - 12042 => 'å…¥', - 12043 => 'å…«', - 12044 => '冂', - 12045 => '冖', - 12046 => '冫', - 12047 => '几', - 12048 => '凵', - 12049 => '刀', - 12050 => '力', - 12051 => '勹', - 12052 => '匕', - 12053 => '匚', - 12054 => '匸', - 12055 => 'å', - 12056 => 'åœ', - 12057 => 'å©', - 12058 => '厂', - 12059 => '厶', - 12060 => 'åˆ', - 12061 => 'å£', - 12062 => 'å›—', - 12063 => '土', - 12064 => '士', - 12065 => '夂', - 12066 => '夊', - 12067 => '夕', - 12068 => '大', - 12069 => '女', - 12070 => 'å­', - 12071 => '宀', - 12072 => '寸', - 12073 => 'å°', - 12074 => 'å°¢', - 12075 => 'å°¸', - 12076 => 'å±®', - 12077 => 'å±±', - 12078 => 'å·›', - 12079 => 'å·¥', - 12080 => 'å·±', - 12081 => 'å·¾', - 12082 => 'å¹²', - 12083 => '幺', - 12084 => '广', - 12085 => 'å»´', - 12086 => '廾', - 12087 => '弋', - 12088 => '弓', - 12089 => 'å½', - 12090 => '彡', - 12091 => 'å½³', - 12092 => '心', - 12093 => '戈', - 12094 => '戶', - 12095 => '手', - 12096 => '支', - 12097 => 'æ”´', - 12098 => 'æ–‡', - 12099 => 'æ–—', - 12100 => 'æ–¤', - 12101 => 'æ–¹', - 12102 => 'æ— ', - 12103 => 'æ—¥', - 12104 => 'æ›°', - 12105 => '月', - 12106 => '木', - 12107 => '欠', - 12108 => 'æ­¢', - 12109 => 'æ­¹', - 12110 => '殳', - 12111 => '毋', - 12112 => '比', - 12113 => '毛', - 12114 => 'æ°', - 12115 => 'æ°”', - 12116 => 'æ°´', - 12117 => 'ç«', - 12118 => '爪', - 12119 => '父', - 12120 => '爻', - 12121 => '爿', - 12122 => '片', - 12123 => '牙', - 12124 => '牛', - 12125 => '犬', - 12126 => '玄', - 12127 => '玉', - 12128 => 'ç“œ', - 12129 => '瓦', - 12130 => '甘', - 12131 => '生', - 12132 => '用', - 12133 => 'ç”°', - 12134 => 'ç–‹', - 12135 => 'ç–’', - 12136 => '癶', - 12137 => '白', - 12138 => 'çš®', - 12139 => 'çš¿', - 12140 => 'ç›®', - 12141 => '矛', - 12142 => '矢', - 12143 => '石', - 12144 => '示', - 12145 => '禸', - 12146 => '禾', - 12147 => 'ç©´', - 12148 => 'ç«‹', - 12149 => '竹', - 12150 => 'ç±³', - 12151 => '糸', - 12152 => '缶', - 12153 => '网', - 12154 => '羊', - 12155 => 'ç¾½', - 12156 => 'è€', - 12157 => '而', - 12158 => '耒', - 12159 => '耳', - 12160 => 'è¿', - 12161 => '肉', - 12162 => '臣', - 12163 => '自', - 12164 => '至', - 12165 => '臼', - 12166 => '舌', - 12167 => '舛', - 12168 => '舟', - 12169 => '艮', - 12170 => '色', - 12171 => '艸', - 12172 => 'è™', - 12173 => '虫', - 12174 => 'è¡€', - 12175 => 'è¡Œ', - 12176 => 'è¡£', - 12177 => '襾', - 12178 => '見', - 12179 => '角', - 12180 => '言', - 12181 => 'è°·', - 12182 => '豆', - 12183 => '豕', - 12184 => '豸', - 12185 => 'è²', - 12186 => '赤', - 12187 => 'èµ°', - 12188 => '足', - 12189 => '身', - 12190 => '車', - 12191 => 'è¾›', - 12192 => 'è¾°', - 12193 => 'è¾µ', - 12194 => 'é‚‘', - 12195 => 'é…‰', - 12196 => '釆', - 12197 => '里', - 12198 => '金', - 12199 => 'é•·', - 12200 => 'é–€', - 12201 => '阜', - 12202 => '隶', - 12203 => 'éš¹', - 12204 => '雨', - 12205 => 'é‘', - 12206 => 'éž', - 12207 => 'é¢', - 12208 => 'é©', - 12209 => '韋', - 12210 => '韭', - 12211 => '音', - 12212 => 'é ', - 12213 => '風', - 12214 => '飛', - 12215 => '食', - 12216 => '首', - 12217 => '香', - 12218 => '馬', - 12219 => '骨', - 12220 => '高', - 12221 => 'é«Ÿ', - 12222 => '鬥', - 12223 => '鬯', - 12224 => '鬲', - 12225 => '鬼', - 12226 => 'é­š', - 12227 => 'é³¥', - 12228 => 'é¹µ', - 12229 => '鹿', - 12230 => '麥', - 12231 => '麻', - 12232 => '黃', - 12233 => 'é»', - 12234 => '黑', - 12235 => '黹', - 12236 => '黽', - 12237 => '鼎', - 12238 => '鼓', - 12239 => 'é¼ ', - 12240 => 'é¼»', - 12241 => '齊', - 12242 => 'é½’', - 12243 => 'é¾', - 12244 => '龜', - 12245 => 'é¾ ', - 12290 => '.', - 12342 => '〒', - 12344 => 'å', - 12345 => 'å„', - 12346 => 'å…', - 12447 => 'より', - 12543 => 'コト', - 12593 => 'á„€', - 12594 => 'á„', - 12595 => 'ᆪ', - 12596 => 'á„‚', - 12597 => 'ᆬ', - 12598 => 'ᆭ', - 12599 => 'ᄃ', - 12600 => 'á„„', - 12601 => 'á„…', - 12602 => 'ᆰ', - 12603 => 'ᆱ', - 12604 => 'ᆲ', - 12605 => 'ᆳ', - 12606 => 'ᆴ', - 12607 => 'ᆵ', - 12608 => 'á„š', - 12609 => 'ᄆ', - 12610 => 'ᄇ', - 12611 => 'ᄈ', - 12612 => 'á„¡', - 12613 => 'ᄉ', - 12614 => 'á„Š', - 12615 => 'á„‹', - 12616 => 'á„Œ', - 12617 => 'á„', - 12618 => 'á„Ž', - 12619 => 'á„', - 12620 => 'á„', - 12621 => 'á„‘', - 12622 => 'á„’', - 12623 => 'á…¡', - 12624 => 'á…¢', - 12625 => 'á…£', - 12626 => 'á…¤', - 12627 => 'á…¥', - 12628 => 'á…¦', - 12629 => 'á…§', - 12630 => 'á…¨', - 12631 => 'á…©', - 12632 => 'á…ª', - 12633 => 'á…«', - 12634 => 'á…¬', - 12635 => 'á…­', - 12636 => 'á…®', - 12637 => 'á…¯', - 12638 => 'á…°', - 12639 => 'á…±', - 12640 => 'á…²', - 12641 => 'á…³', - 12642 => 'á…´', - 12643 => 'á…µ', - 12645 => 'á„”', - 12646 => 'á„•', - 12647 => 'ᇇ', - 12648 => 'ᇈ', - 12649 => 'ᇌ', - 12650 => 'ᇎ', - 12651 => 'ᇓ', - 12652 => 'ᇗ', - 12653 => 'ᇙ', - 12654 => 'á„œ', - 12655 => 'á‡', - 12656 => 'ᇟ', - 12657 => 'á„', - 12658 => 'á„ž', - 12659 => 'á„ ', - 12660 => 'á„¢', - 12661 => 'á„£', - 12662 => 'ᄧ', - 12663 => 'á„©', - 12664 => 'á„«', - 12665 => 'ᄬ', - 12666 => 'á„­', - 12667 => 'á„®', - 12668 => 'ᄯ', - 12669 => 'ᄲ', - 12670 => 'ᄶ', - 12671 => 'á…€', - 12672 => 'á…‡', - 12673 => 'á…Œ', - 12674 => 'ᇱ', - 12675 => 'ᇲ', - 12676 => 'á…—', - 12677 => 'á…˜', - 12678 => 'á…™', - 12679 => 'ᆄ', - 12680 => 'ᆅ', - 12681 => 'ᆈ', - 12682 => 'ᆑ', - 12683 => 'ᆒ', - 12684 => 'ᆔ', - 12685 => 'ᆞ', - 12686 => 'ᆡ', - 12690 => '一', - 12691 => '二', - 12692 => '三', - 12693 => 'å››', - 12694 => '上', - 12695 => '中', - 12696 => '下', - 12697 => '甲', - 12698 => 'ä¹™', - 12699 => '丙', - 12700 => 'ä¸', - 12701 => '天', - 12702 => '地', - 12703 => '人', - 12868 => 'å•', - 12869 => 'å¹¼', - 12870 => 'æ–‡', - 12871 => 'ç®', - 12880 => 'pte', - 12881 => '21', - 12882 => '22', - 12883 => '23', - 12884 => '24', - 12885 => '25', - 12886 => '26', - 12887 => '27', - 12888 => '28', - 12889 => '29', - 12890 => '30', - 12891 => '31', - 12892 => '32', - 12893 => '33', - 12894 => '34', - 12895 => '35', - 12896 => 'á„€', - 12897 => 'á„‚', - 12898 => 'ᄃ', - 12899 => 'á„…', - 12900 => 'ᄆ', - 12901 => 'ᄇ', - 12902 => 'ᄉ', - 12903 => 'á„‹', - 12904 => 'á„Œ', - 12905 => 'á„Ž', - 12906 => 'á„', - 12907 => 'á„', - 12908 => 'á„‘', - 12909 => 'á„’', - 12910 => 'ê°€', - 12911 => '나', - 12912 => '다', - 12913 => 'ë¼', - 12914 => '마', - 12915 => 'ë°”', - 12916 => '사', - 12917 => 'ì•„', - 12918 => 'ìž', - 12919 => 'ì°¨', - 12920 => 'ì¹´', - 12921 => '타', - 12922 => '파', - 12923 => '하', - 12924 => '참고', - 12925 => '주ì˜', - 12926 => 'ìš°', - 12928 => '一', - 12929 => '二', - 12930 => '三', - 12931 => 'å››', - 12932 => '五', - 12933 => 'å…­', - 12934 => '七', - 12935 => 'å…«', - 12936 => 'ä¹', - 12937 => 'å', - 12938 => '月', - 12939 => 'ç«', - 12940 => 'æ°´', - 12941 => '木', - 12942 => '金', - 12943 => '土', - 12944 => 'æ—¥', - 12945 => 'æ ª', - 12946 => '有', - 12947 => '社', - 12948 => 'å', - 12949 => '特', - 12950 => '財', - 12951 => 'ç¥', - 12952 => '労', - 12953 => '秘', - 12954 => 'ç”·', - 12955 => '女', - 12956 => 'é©', - 12957 => '優', - 12958 => 'å°', - 12959 => '注', - 12960 => 'é …', - 12961 => '休', - 12962 => '写', - 12963 => 'æ­£', - 12964 => '上', - 12965 => '中', - 12966 => '下', - 12967 => 'å·¦', - 12968 => 'å³', - 12969 => '医', - 12970 => 'å®—', - 12971 => 'å­¦', - 12972 => '監', - 12973 => 'ä¼', - 12974 => '資', - 12975 => 'å”', - 12976 => '夜', - 12977 => '36', - 12978 => '37', - 12979 => '38', - 12980 => '39', - 12981 => '40', - 12982 => '41', - 12983 => '42', - 12984 => '43', - 12985 => '44', - 12986 => '45', - 12987 => '46', - 12988 => '47', - 12989 => '48', - 12990 => '49', - 12991 => '50', - 12992 => '1月', - 12993 => '2月', - 12994 => '3月', - 12995 => '4月', - 12996 => '5月', - 12997 => '6月', - 12998 => '7月', - 12999 => '8月', - 13000 => '9月', - 13001 => '10月', - 13002 => '11月', - 13003 => '12月', - 13004 => 'hg', - 13005 => 'erg', - 13006 => 'ev', - 13007 => 'ltd', - 13008 => 'ã‚¢', - 13009 => 'イ', - 13010 => 'ウ', - 13011 => 'エ', - 13012 => 'オ', - 13013 => 'ã‚«', - 13014 => 'ã‚­', - 13015 => 'ク', - 13016 => 'ケ', - 13017 => 'コ', - 13018 => 'サ', - 13019 => 'ã‚·', - 13020 => 'ス', - 13021 => 'ã‚»', - 13022 => 'ソ', - 13023 => 'ã‚¿', - 13024 => 'ãƒ', - 13025 => 'ツ', - 13026 => 'テ', - 13027 => 'ト', - 13028 => 'ナ', - 13029 => 'ニ', - 13030 => 'ヌ', - 13031 => 'ãƒ', - 13032 => 'ノ', - 13033 => 'ãƒ', - 13034 => 'ヒ', - 13035 => 'フ', - 13036 => 'ヘ', - 13037 => 'ホ', - 13038 => 'マ', - 13039 => 'ミ', - 13040 => 'ム', - 13041 => 'メ', - 13042 => 'モ', - 13043 => 'ヤ', - 13044 => 'ユ', - 13045 => 'ヨ', - 13046 => 'ラ', - 13047 => 'リ', - 13048 => 'ル', - 13049 => 'レ', - 13050 => 'ロ', - 13051 => 'ワ', - 13052 => 'ヰ', - 13053 => 'ヱ', - 13054 => 'ヲ', - 13055 => '令和', - 13056 => 'アパート', - 13057 => 'アルファ', - 13058 => 'アンペア', - 13059 => 'アール', - 13060 => 'イニング', - 13061 => 'インãƒ', - 13062 => 'ウォン', - 13063 => 'エスクード', - 13064 => 'エーカー', - 13065 => 'オンス', - 13066 => 'オーム', - 13067 => 'カイリ', - 13068 => 'カラット', - 13069 => 'カロリー', - 13070 => 'ガロン', - 13071 => 'ガンマ', - 13072 => 'ギガ', - 13073 => 'ギニー', - 13074 => 'キュリー', - 13075 => 'ギルダー', - 13076 => 'キロ', - 13077 => 'キログラム', - 13078 => 'キロメートル', - 13079 => 'キロワット', - 13080 => 'グラム', - 13081 => 'グラムトン', - 13082 => 'クルゼイロ', - 13083 => 'クローãƒ', - 13084 => 'ケース', - 13085 => 'コルナ', - 13086 => 'コーãƒ', - 13087 => 'サイクル', - 13088 => 'サンãƒãƒ¼ãƒ ', - 13089 => 'シリング', - 13090 => 'センãƒ', - 13091 => 'セント', - 13092 => 'ダース', - 13093 => 'デシ', - 13094 => 'ドル', - 13095 => 'トン', - 13096 => 'ナノ', - 13097 => 'ノット', - 13098 => 'ãƒã‚¤ãƒ„', - 13099 => 'パーセント', - 13100 => 'パーツ', - 13101 => 'ãƒãƒ¼ãƒ¬ãƒ«', - 13102 => 'ピアストル', - 13103 => 'ピクル', - 13104 => 'ピコ', - 13105 => 'ビル', - 13106 => 'ファラッド', - 13107 => 'フィート', - 13108 => 'ブッシェル', - 13109 => 'フラン', - 13110 => 'ヘクタール', - 13111 => 'ペソ', - 13112 => 'ペニヒ', - 13113 => 'ヘルツ', - 13114 => 'ペンス', - 13115 => 'ページ', - 13116 => 'ベータ', - 13117 => 'ãƒã‚¤ãƒ³ãƒˆ', - 13118 => 'ボルト', - 13119 => 'ホン', - 13120 => 'ãƒãƒ³ãƒ‰', - 13121 => 'ホール', - 13122 => 'ホーン', - 13123 => 'マイクロ', - 13124 => 'マイル', - 13125 => 'マッãƒ', - 13126 => 'マルク', - 13127 => 'マンション', - 13128 => 'ミクロン', - 13129 => 'ミリ', - 13130 => 'ミリãƒãƒ¼ãƒ«', - 13131 => 'メガ', - 13132 => 'メガトン', - 13133 => 'メートル', - 13134 => 'ヤード', - 13135 => 'ヤール', - 13136 => 'ユアン', - 13137 => 'リットル', - 13138 => 'リラ', - 13139 => 'ルピー', - 13140 => 'ルーブル', - 13141 => 'レム', - 13142 => 'レントゲン', - 13143 => 'ワット', - 13144 => '0点', - 13145 => '1点', - 13146 => '2点', - 13147 => '3点', - 13148 => '4点', - 13149 => '5点', - 13150 => '6点', - 13151 => '7点', - 13152 => '8点', - 13153 => '9点', - 13154 => '10点', - 13155 => '11点', - 13156 => '12点', - 13157 => '13点', - 13158 => '14点', - 13159 => '15点', - 13160 => '16点', - 13161 => '17点', - 13162 => '18点', - 13163 => '19点', - 13164 => '20点', - 13165 => '21点', - 13166 => '22点', - 13167 => '23点', - 13168 => '24点', - 13169 => 'hpa', - 13170 => 'da', - 13171 => 'au', - 13172 => 'bar', - 13173 => 'ov', - 13174 => 'pc', - 13175 => 'dm', - 13176 => 'dm2', - 13177 => 'dm3', - 13178 => 'iu', - 13179 => 'å¹³æˆ', - 13180 => '昭和', - 13181 => '大正', - 13182 => '明治', - 13183 => 'æ ªå¼ä¼šç¤¾', - 13184 => 'pa', - 13185 => 'na', - 13186 => 'μa', - 13187 => 'ma', - 13188 => 'ka', - 13189 => 'kb', - 13190 => 'mb', - 13191 => 'gb', - 13192 => 'cal', - 13193 => 'kcal', - 13194 => 'pf', - 13195 => 'nf', - 13196 => 'μf', - 13197 => 'μg', - 13198 => 'mg', - 13199 => 'kg', - 13200 => 'hz', - 13201 => 'khz', - 13202 => 'mhz', - 13203 => 'ghz', - 13204 => 'thz', - 13205 => 'μl', - 13206 => 'ml', - 13207 => 'dl', - 13208 => 'kl', - 13209 => 'fm', - 13210 => 'nm', - 13211 => 'μm', - 13212 => 'mm', - 13213 => 'cm', - 13214 => 'km', - 13215 => 'mm2', - 13216 => 'cm2', - 13217 => 'm2', - 13218 => 'km2', - 13219 => 'mm3', - 13220 => 'cm3', - 13221 => 'm3', - 13222 => 'km3', - 13223 => 'm∕s', - 13224 => 'm∕s2', - 13225 => 'pa', - 13226 => 'kpa', - 13227 => 'mpa', - 13228 => 'gpa', - 13229 => 'rad', - 13230 => 'rad∕s', - 13231 => 'rad∕s2', - 13232 => 'ps', - 13233 => 'ns', - 13234 => 'μs', - 13235 => 'ms', - 13236 => 'pv', - 13237 => 'nv', - 13238 => 'μv', - 13239 => 'mv', - 13240 => 'kv', - 13241 => 'mv', - 13242 => 'pw', - 13243 => 'nw', - 13244 => 'μw', - 13245 => 'mw', - 13246 => 'kw', - 13247 => 'mw', - 13248 => 'kω', - 13249 => 'mω', - 13251 => 'bq', - 13252 => 'cc', - 13253 => 'cd', - 13254 => 'c∕kg', - 13256 => 'db', - 13257 => 'gy', - 13258 => 'ha', - 13259 => 'hp', - 13260 => 'in', - 13261 => 'kk', - 13262 => 'km', - 13263 => 'kt', - 13264 => 'lm', - 13265 => 'ln', - 13266 => 'log', - 13267 => 'lx', - 13268 => 'mb', - 13269 => 'mil', - 13270 => 'mol', - 13271 => 'ph', - 13273 => 'ppm', - 13274 => 'pr', - 13275 => 'sr', - 13276 => 'sv', - 13277 => 'wb', - 13278 => 'v∕m', - 13279 => 'a∕m', - 13280 => '1æ—¥', - 13281 => '2æ—¥', - 13282 => '3æ—¥', - 13283 => '4æ—¥', - 13284 => '5æ—¥', - 13285 => '6æ—¥', - 13286 => '7æ—¥', - 13287 => '8æ—¥', - 13288 => '9æ—¥', - 13289 => '10æ—¥', - 13290 => '11æ—¥', - 13291 => '12æ—¥', - 13292 => '13æ—¥', - 13293 => '14æ—¥', - 13294 => '15æ—¥', - 13295 => '16æ—¥', - 13296 => '17æ—¥', - 13297 => '18æ—¥', - 13298 => '19æ—¥', - 13299 => '20æ—¥', - 13300 => '21æ—¥', - 13301 => '22æ—¥', - 13302 => '23æ—¥', - 13303 => '24æ—¥', - 13304 => '25æ—¥', - 13305 => '26æ—¥', - 13306 => '27æ—¥', - 13307 => '28æ—¥', - 13308 => '29æ—¥', - 13309 => '30æ—¥', - 13310 => '31æ—¥', - 13311 => 'gal', - 42560 => 'ê™', - 42562 => 'ꙃ', - 42564 => 'ê™…', - 42566 => 'ꙇ', - 42568 => 'ꙉ', - 42570 => 'ꙋ', - 42572 => 'ê™', - 42574 => 'ê™', - 42576 => 'ꙑ', - 42578 => 'ꙓ', - 42580 => 'ꙕ', - 42582 => 'ê™—', - 42584 => 'ê™™', - 42586 => 'ê™›', - 42588 => 'ê™', - 42590 => 'ꙟ', - 42592 => 'ꙡ', - 42594 => 'ꙣ', - 42596 => 'ꙥ', - 42598 => 'ꙧ', - 42600 => 'ꙩ', - 42602 => 'ꙫ', - 42604 => 'ê™­', - 42624 => 'êš', - 42626 => 'ꚃ', - 42628 => 'êš…', - 42630 => 'ꚇ', - 42632 => 'ꚉ', - 42634 => 'êš‹', - 42636 => 'êš', - 42638 => 'êš', - 42640 => 'êš‘', - 42642 => 'êš“', - 42644 => 'êš•', - 42646 => 'êš—', - 42648 => 'êš™', - 42650 => 'êš›', - 42652 => 'ÑŠ', - 42653 => 'ÑŒ', - 42786 => 'ꜣ', - 42788 => 'ꜥ', - 42790 => 'ꜧ', - 42792 => 'ꜩ', - 42794 => 'ꜫ', - 42796 => 'ꜭ', - 42798 => 'ꜯ', - 42802 => 'ꜳ', - 42804 => 'ꜵ', - 42806 => 'ꜷ', - 42808 => 'ꜹ', - 42810 => 'ꜻ', - 42812 => 'ꜽ', - 42814 => 'ꜿ', - 42816 => 'ê', - 42818 => 'êƒ', - 42820 => 'ê…', - 42822 => 'ê‡', - 42824 => 'ê‰', - 42826 => 'ê‹', - 42828 => 'ê', - 42830 => 'ê', - 42832 => 'ê‘', - 42834 => 'ê“', - 42836 => 'ê•', - 42838 => 'ê—', - 42840 => 'ê™', - 42842 => 'ê›', - 42844 => 'ê', - 42846 => 'êŸ', - 42848 => 'ê¡', - 42850 => 'ê£', - 42852 => 'ê¥', - 42854 => 'ê§', - 42856 => 'ê©', - 42858 => 'ê«', - 42860 => 'ê­', - 42862 => 'ê¯', - 42864 => 'ê¯', - 42873 => 'êº', - 42875 => 'ê¼', - 42877 => 'áµ¹', - 42878 => 'ê¿', - 42880 => 'êž', - 42882 => 'ꞃ', - 42884 => 'êž…', - 42886 => 'ꞇ', - 42891 => 'ꞌ', - 42893 => 'É¥', - 42896 => 'êž‘', - 42898 => 'êž“', - 42902 => 'êž—', - 42904 => 'êž™', - 42906 => 'êž›', - 42908 => 'êž', - 42910 => 'ꞟ', - 42912 => 'êž¡', - 42914 => 'ꞣ', - 42916 => 'ꞥ', - 42918 => 'ꞧ', - 42920 => 'êž©', - 42922 => 'ɦ', - 42923 => 'Éœ', - 42924 => 'É¡', - 42925 => 'ɬ', - 42926 => 'ɪ', - 42928 => 'Êž', - 42929 => 'ʇ', - 42930 => 'Ê', - 42931 => 'ê­“', - 42932 => 'êžµ', - 42934 => 'êž·', - 42936 => 'êž¹', - 42938 => 'êž»', - 42940 => 'êž½', - 42942 => 'êž¿', - 42946 => 'ꟃ', - 42948 => 'êž”', - 42949 => 'Ê‚', - 42950 => 'ᶎ', - 42951 => 'ꟈ', - 42953 => 'ꟊ', - 42997 => 'ꟶ', - 43000 => 'ħ', - 43001 => 'Å“', - 43868 => 'ꜧ', - 43869 => 'ꬷ', - 43870 => 'É«', - 43871 => 'ê­’', - 43881 => 'Ê', - 43888 => 'Ꭰ', - 43889 => 'Ꭱ', - 43890 => 'Ꭲ', - 43891 => 'Ꭳ', - 43892 => 'Ꭴ', - 43893 => 'Ꭵ', - 43894 => 'Ꭶ', - 43895 => 'Ꭷ', - 43896 => 'Ꭸ', - 43897 => 'Ꭹ', - 43898 => 'Ꭺ', - 43899 => 'Ꭻ', - 43900 => 'Ꭼ', - 43901 => 'Ꭽ', - 43902 => 'Ꭾ', - 43903 => 'Ꭿ', - 43904 => 'Ꮀ', - 43905 => 'Ꮁ', - 43906 => 'Ꮂ', - 43907 => 'Ꮃ', - 43908 => 'Ꮄ', - 43909 => 'Ꮅ', - 43910 => 'Ꮆ', - 43911 => 'Ꮇ', - 43912 => 'Ꮈ', - 43913 => 'Ꮉ', - 43914 => 'Ꮊ', - 43915 => 'Ꮋ', - 43916 => 'Ꮌ', - 43917 => 'Ꮍ', - 43918 => 'Ꮎ', - 43919 => 'Ꮏ', - 43920 => 'á€', - 43921 => 'á', - 43922 => 'á‚', - 43923 => 'áƒ', - 43924 => 'á„', - 43925 => 'á…', - 43926 => 'á†', - 43927 => 'á‡', - 43928 => 'áˆ', - 43929 => 'á‰', - 43930 => 'áŠ', - 43931 => 'á‹', - 43932 => 'áŒ', - 43933 => 'á', - 43934 => 'áŽ', - 43935 => 'á', - 43936 => 'á', - 43937 => 'á‘', - 43938 => 'á’', - 43939 => 'á“', - 43940 => 'á”', - 43941 => 'á•', - 43942 => 'á–', - 43943 => 'á—', - 43944 => 'á˜', - 43945 => 'á™', - 43946 => 'áš', - 43947 => 'á›', - 43948 => 'áœ', - 43949 => 'á', - 43950 => 'áž', - 43951 => 'áŸ', - 43952 => 'á ', - 43953 => 'á¡', - 43954 => 'á¢', - 43955 => 'á£', - 43956 => 'á¤', - 43957 => 'á¥', - 43958 => 'á¦', - 43959 => 'á§', - 43960 => 'á¨', - 43961 => 'á©', - 43962 => 'áª', - 43963 => 'á«', - 43964 => 'á¬', - 43965 => 'á­', - 43966 => 'á®', - 43967 => 'á¯', - 63744 => '豈', - 63745 => 'æ›´', - 63746 => '車', - 63747 => '賈', - 63748 => '滑', - 63749 => '串', - 63750 => 'å¥', - 63751 => '龜', - 63752 => '龜', - 63753 => '契', - 63754 => '金', - 63755 => 'å–‡', - 63756 => '奈', - 63757 => '懶', - 63758 => '癩', - 63759 => 'ç¾…', - 63760 => '蘿', - 63761 => '螺', - 63762 => '裸', - 63763 => 'é‚', - 63764 => '樂', - 63765 => 'æ´›', - 63766 => '烙', - 63767 => 'çž', - 63768 => 'è½', - 63769 => 'é…ª', - 63770 => '駱', - 63771 => '亂', - 63772 => 'åµ', - 63773 => '欄', - 63774 => '爛', - 63775 => '蘭', - 63776 => '鸞', - 63777 => 'åµ', - 63778 => 'æ¿«', - 63779 => 'è—', - 63780 => '襤', - 63781 => '拉', - 63782 => '臘', - 63783 => 'è Ÿ', - 63784 => '廊', - 63785 => '朗', - 63786 => '浪', - 63787 => '狼', - 63788 => '郎', - 63789 => '來', - 63790 => '冷', - 63791 => 'å‹ž', - 63792 => 'æ“„', - 63793 => 'æ«“', - 63794 => 'çˆ', - 63795 => '盧', - 63796 => 'è€', - 63797 => '蘆', - 63798 => '虜', - 63799 => 'è·¯', - 63800 => '露', - 63801 => 'é­¯', - 63802 => 'é·º', - 63803 => '碌', - 63804 => '祿', - 63805 => '綠', - 63806 => 'è‰', - 63807 => '錄', - 63808 => '鹿', - 63809 => 'è«–', - 63810 => '壟', - 63811 => '弄', - 63812 => 'ç± ', - 63813 => 'è¾', - 63814 => '牢', - 63815 => '磊', - 63816 => '賂', - 63817 => 'é›·', - 63818 => '壘', - 63819 => 'å±¢', - 63820 => '樓', - 63821 => 'æ·š', - 63822 => 'æ¼', - 63823 => 'ç´¯', - 63824 => '縷', - 63825 => '陋', - 63826 => 'å‹’', - 63827 => 'è‚‹', - 63828 => '凜', - 63829 => '凌', - 63830 => '稜', - 63831 => '綾', - 63832 => 'è±', - 63833 => '陵', - 63834 => '讀', - 63835 => 'æ‹', - 63836 => '樂', - 63837 => '諾', - 63838 => '丹', - 63839 => '寧', - 63840 => '怒', - 63841 => '率', - 63842 => 'ç•°', - 63843 => '北', - 63844 => '磻', - 63845 => '便', - 63846 => '復', - 63847 => 'ä¸', - 63848 => '泌', - 63849 => '數', - 63850 => 'ç´¢', - 63851 => 'åƒ', - 63852 => 'å¡ž', - 63853 => 'çœ', - 63854 => '葉', - 63855 => '說', - 63856 => '殺', - 63857 => 'è¾°', - 63858 => '沈', - 63859 => '拾', - 63860 => 'è‹¥', - 63861 => '掠', - 63862 => 'ç•¥', - 63863 => '亮', - 63864 => 'å…©', - 63865 => '凉', - 63866 => 'æ¢', - 63867 => '糧', - 63868 => '良', - 63869 => 'è«’', - 63870 => 'é‡', - 63871 => '勵', - 63872 => 'å‘‚', - 63873 => '女', - 63874 => '廬', - 63875 => 'æ—…', - 63876 => '濾', - 63877 => '礪', - 63878 => 'é–­', - 63879 => '驪', - 63880 => '麗', - 63881 => '黎', - 63882 => '力', - 63883 => '曆', - 63884 => 'æ­·', - 63885 => 'è½¢', - 63886 => 'å¹´', - 63887 => 'æ†', - 63888 => '戀', - 63889 => 'æ’š', - 63890 => 'æ¼£', - 63891 => 'ç…‰', - 63892 => 'ç’‰', - 63893 => '秊', - 63894 => 'ç·´', - 63895 => 'è¯', - 63896 => '輦', - 63897 => 'è“®', - 63898 => '連', - 63899 => 'éŠ', - 63900 => '列', - 63901 => '劣', - 63902 => 'å’½', - 63903 => '烈', - 63904 => '裂', - 63905 => '說', - 63906 => '廉', - 63907 => '念', - 63908 => 'æ»', - 63909 => 'æ®®', - 63910 => 'ç°¾', - 63911 => 'çµ', - 63912 => '令', - 63913 => '囹', - 63914 => '寧', - 63915 => '嶺', - 63916 => '怜', - 63917 => '玲', - 63918 => 'ç‘©', - 63919 => '羚', - 63920 => 'è†', - 63921 => '鈴', - 63922 => '零', - 63923 => 'éˆ', - 63924 => 'é ˜', - 63925 => '例', - 63926 => '禮', - 63927 => '醴', - 63928 => '隸', - 63929 => '惡', - 63930 => '了', - 63931 => '僚', - 63932 => '寮', - 63933 => 'å°¿', - 63934 => 'æ–™', - 63935 => '樂', - 63936 => '燎', - 63937 => '療', - 63938 => '蓼', - 63939 => 'é¼', - 63940 => 'é¾', - 63941 => '暈', - 63942 => '阮', - 63943 => '劉', - 63944 => 'æ»', - 63945 => '柳', - 63946 => 'æµ', - 63947 => '溜', - 63948 => 'ç‰', - 63949 => 'ç•™', - 63950 => 'ç¡«', - 63951 => 'ç´', - 63952 => 'é¡ž', - 63953 => 'å…­', - 63954 => '戮', - 63955 => '陸', - 63956 => '倫', - 63957 => 'å´™', - 63958 => 'æ·ª', - 63959 => '輪', - 63960 => '律', - 63961 => 'æ…„', - 63962 => 'æ —', - 63963 => '率', - 63964 => '隆', - 63965 => '利', - 63966 => 'å', - 63967 => 'å±¥', - 63968 => '易', - 63969 => 'æŽ', - 63970 => '梨', - 63971 => 'æ³¥', - 63972 => 'ç†', - 63973 => 'ç—¢', - 63974 => 'ç½¹', - 63975 => 'è£', - 63976 => '裡', - 63977 => '里', - 63978 => '離', - 63979 => '匿', - 63980 => '溺', - 63981 => 'å', - 63982 => 'ç‡', - 63983 => 'ç’˜', - 63984 => 'è—º', - 63985 => '隣', - 63986 => 'é±—', - 63987 => '麟', - 63988 => 'æž—', - 63989 => 'æ·‹', - 63990 => '臨', - 63991 => 'ç«‹', - 63992 => '笠', - 63993 => 'ç²’', - 63994 => 'ç‹€', - 63995 => 'ç‚™', - 63996 => 'è­˜', - 63997 => '什', - 63998 => '茶', - 63999 => '刺', - 64000 => '切', - 64001 => '度', - 64002 => 'æ‹“', - 64003 => 'ç³–', - 64004 => 'å®…', - 64005 => 'æ´ž', - 64006 => 'æš´', - 64007 => 'è¼»', - 64008 => 'è¡Œ', - 64009 => 'é™', - 64010 => '見', - 64011 => '廓', - 64012 => 'å…€', - 64013 => 'å—€', - 64016 => 'å¡š', - 64018 => 'æ™´', - 64021 => '凞', - 64022 => '猪', - 64023 => '益', - 64024 => '礼', - 64025 => '神', - 64026 => '祥', - 64027 => 'ç¦', - 64028 => 'é–', - 64029 => 'ç²¾', - 64030 => 'ç¾½', - 64032 => '蘒', - 64034 => '諸', - 64037 => '逸', - 64038 => '都', - 64042 => '飯', - 64043 => '飼', - 64044 => '館', - 64045 => '鶴', - 64046 => '郞', - 64047 => 'éš·', - 64048 => 'ä¾®', - 64049 => '僧', - 64050 => 'å…', - 64051 => '勉', - 64052 => '勤', - 64053 => 'å‘', - 64054 => 'å–', - 64055 => '嘆', - 64056 => '器', - 64057 => 'å¡€', - 64058 => '墨', - 64059 => '層', - 64060 => 'å±®', - 64061 => 'æ‚”', - 64062 => 'æ…¨', - 64063 => '憎', - 64064 => '懲', - 64065 => 'æ•', - 64066 => 'æ—¢', - 64067 => 'æš‘', - 64068 => '梅', - 64069 => 'æµ·', - 64070 => '渚', - 64071 => 'æ¼¢', - 64072 => 'ç…®', - 64073 => '爫', - 64074 => 'ç¢', - 64075 => '碑', - 64076 => '社', - 64077 => '祉', - 64078 => '祈', - 64079 => 'ç¥', - 64080 => '祖', - 64081 => 'ç¥', - 64082 => 'ç¦', - 64083 => '禎', - 64084 => 'ç©€', - 64085 => 'çª', - 64086 => '節', - 64087 => 'ç·´', - 64088 => '縉', - 64089 => 'ç¹', - 64090 => 'ç½²', - 64091 => '者', - 64092 => '臭', - 64093 => '艹', - 64094 => '艹', - 64095 => 'è‘—', - 64096 => 'è¤', - 64097 => '視', - 64098 => 'è¬', - 64099 => '謹', - 64100 => '賓', - 64101 => 'è´ˆ', - 64102 => '辶', - 64103 => '逸', - 64104 => '難', - 64105 => '響', - 64106 => 'é »', - 64107 => 'æµ', - 64108 => '𤋮', - 64109 => '舘', - 64112 => '並', - 64113 => '况', - 64114 => 'å…¨', - 64115 => 'ä¾€', - 64116 => 'å……', - 64117 => '冀', - 64118 => '勇', - 64119 => '勺', - 64120 => 'å–', - 64121 => 'å••', - 64122 => 'å–™', - 64123 => 'å—¢', - 64124 => 'å¡š', - 64125 => '墳', - 64126 => '奄', - 64127 => '奔', - 64128 => 'å©¢', - 64129 => '嬨', - 64130 => 'å»’', - 64131 => 'å»™', - 64132 => '彩', - 64133 => 'å¾­', - 64134 => '惘', - 64135 => 'æ…Ž', - 64136 => '愈', - 64137 => '憎', - 64138 => 'æ… ', - 64139 => '懲', - 64140 => '戴', - 64141 => 'æ„', - 64142 => 'æœ', - 64143 => 'æ‘’', - 64144 => 'æ•–', - 64145 => 'æ™´', - 64146 => '朗', - 64147 => '望', - 64148 => 'æ–', - 64149 => 'æ­¹', - 64150 => '殺', - 64151 => 'æµ', - 64152 => 'æ»›', - 64153 => '滋', - 64154 => 'æ¼¢', - 64155 => '瀞', - 64156 => 'ç…®', - 64157 => '瞧', - 64158 => '爵', - 64159 => '犯', - 64160 => '猪', - 64161 => '瑱', - 64162 => '甆', - 64163 => 'ç”»', - 64164 => 'ç˜', - 64165 => '瘟', - 64166 => '益', - 64167 => 'ç››', - 64168 => 'ç›´', - 64169 => 'çŠ', - 64170 => 'ç€', - 64171 => '磌', - 64172 => '窱', - 64173 => '節', - 64174 => 'ç±»', - 64175 => 'çµ›', - 64176 => 'ç·´', - 64177 => 'ç¼¾', - 64178 => '者', - 64179 => 'è’', - 64180 => 'è¯', - 64181 => 'è¹', - 64182 => 'è¥', - 64183 => '覆', - 64184 => '視', - 64185 => '調', - 64186 => '諸', - 64187 => 'è«‹', - 64188 => 'è¬', - 64189 => '諾', - 64190 => 'è«­', - 64191 => '謹', - 64192 => '變', - 64193 => 'è´ˆ', - 64194 => '輸', - 64195 => 'é²', - 64196 => '醙', - 64197 => '鉶', - 64198 => '陼', - 64199 => '難', - 64200 => 'é–', - 64201 => '韛', - 64202 => '響', - 64203 => 'é ‹', - 64204 => 'é »', - 64205 => '鬒', - 64206 => '龜', - 64207 => '𢡊', - 64208 => '𢡄', - 64209 => 'ð£•', - 64210 => 'ã®', - 64211 => '䀘', - 64212 => '䀹', - 64213 => '𥉉', - 64214 => 'ð¥³', - 64215 => '𧻓', - 64216 => '齃', - 64217 => '龎', - 64256 => 'ff', - 64257 => 'fi', - 64258 => 'fl', - 64259 => 'ffi', - 64260 => 'ffl', - 64261 => 'st', - 64262 => 'st', - 64275 => 'Õ´Õ¶', - 64276 => 'Õ´Õ¥', - 64277 => 'Õ´Õ«', - 64278 => 'Õ¾Õ¶', - 64279 => 'Õ´Õ­', - 64285 => '×™Ö´', - 64287 => 'ײַ', - 64288 => '×¢', - 64289 => '×', - 64290 => 'ד', - 64291 => '×”', - 64292 => '×›', - 64293 => 'ל', - 64294 => '×', - 64295 => 'ר', - 64296 => 'ת', - 64298 => 'ש×', - 64299 => 'שׂ', - 64300 => 'שּ×', - 64301 => 'שּׂ', - 64302 => '×Ö·', - 64303 => '×Ö¸', - 64304 => '×Ö¼', - 64305 => 'בּ', - 64306 => '×’Ö¼', - 64307 => 'דּ', - 64308 => '×”Ö¼', - 64309 => 'וּ', - 64310 => '×–Ö¼', - 64312 => 'טּ', - 64313 => '×™Ö¼', - 64314 => 'ךּ', - 64315 => '×›Ö¼', - 64316 => 'לּ', - 64318 => 'מּ', - 64320 => '× Ö¼', - 64321 => 'סּ', - 64323 => '×£Ö¼', - 64324 => 'פּ', - 64326 => 'צּ', - 64327 => 'קּ', - 64328 => 'רּ', - 64329 => 'שּ', - 64330 => 'תּ', - 64331 => 'וֹ', - 64332 => 'בֿ', - 64333 => '×›Ö¿', - 64334 => 'פֿ', - 64335 => '×ל', - 64336 => 'Ù±', - 64337 => 'Ù±', - 64338 => 'Ù»', - 64339 => 'Ù»', - 64340 => 'Ù»', - 64341 => 'Ù»', - 64342 => 'Ù¾', - 64343 => 'Ù¾', - 64344 => 'Ù¾', - 64345 => 'Ù¾', - 64346 => 'Ú€', - 64347 => 'Ú€', - 64348 => 'Ú€', - 64349 => 'Ú€', - 64350 => 'Ùº', - 64351 => 'Ùº', - 64352 => 'Ùº', - 64353 => 'Ùº', - 64354 => 'Ù¿', - 64355 => 'Ù¿', - 64356 => 'Ù¿', - 64357 => 'Ù¿', - 64358 => 'Ù¹', - 64359 => 'Ù¹', - 64360 => 'Ù¹', - 64361 => 'Ù¹', - 64362 => 'Ú¤', - 64363 => 'Ú¤', - 64364 => 'Ú¤', - 64365 => 'Ú¤', - 64366 => 'Ú¦', - 64367 => 'Ú¦', - 64368 => 'Ú¦', - 64369 => 'Ú¦', - 64370 => 'Ú„', - 64371 => 'Ú„', - 64372 => 'Ú„', - 64373 => 'Ú„', - 64374 => 'Úƒ', - 64375 => 'Úƒ', - 64376 => 'Úƒ', - 64377 => 'Úƒ', - 64378 => 'Ú†', - 64379 => 'Ú†', - 64380 => 'Ú†', - 64381 => 'Ú†', - 64382 => 'Ú‡', - 64383 => 'Ú‡', - 64384 => 'Ú‡', - 64385 => 'Ú‡', - 64386 => 'Ú', - 64387 => 'Ú', - 64388 => 'ÚŒ', - 64389 => 'ÚŒ', - 64390 => 'ÚŽ', - 64391 => 'ÚŽ', - 64392 => 'Úˆ', - 64393 => 'Úˆ', - 64394 => 'Ú˜', - 64395 => 'Ú˜', - 64396 => 'Ú‘', - 64397 => 'Ú‘', - 64398 => 'Ú©', - 64399 => 'Ú©', - 64400 => 'Ú©', - 64401 => 'Ú©', - 64402 => 'Ú¯', - 64403 => 'Ú¯', - 64404 => 'Ú¯', - 64405 => 'Ú¯', - 64406 => 'Ú³', - 64407 => 'Ú³', - 64408 => 'Ú³', - 64409 => 'Ú³', - 64410 => 'Ú±', - 64411 => 'Ú±', - 64412 => 'Ú±', - 64413 => 'Ú±', - 64414 => 'Úº', - 64415 => 'Úº', - 64416 => 'Ú»', - 64417 => 'Ú»', - 64418 => 'Ú»', - 64419 => 'Ú»', - 64420 => 'Û€', - 64421 => 'Û€', - 64422 => 'Û', - 64423 => 'Û', - 64424 => 'Û', - 64425 => 'Û', - 64426 => 'Ú¾', - 64427 => 'Ú¾', - 64428 => 'Ú¾', - 64429 => 'Ú¾', - 64430 => 'Û’', - 64431 => 'Û’', - 64432 => 'Û“', - 64433 => 'Û“', - 64467 => 'Ú­', - 64468 => 'Ú­', - 64469 => 'Ú­', - 64470 => 'Ú­', - 64471 => 'Û‡', - 64472 => 'Û‡', - 64473 => 'Û†', - 64474 => 'Û†', - 64475 => 'Ûˆ', - 64476 => 'Ûˆ', - 64477 => 'Û‡Ù´', - 64478 => 'Û‹', - 64479 => 'Û‹', - 64480 => 'Û…', - 64481 => 'Û…', - 64482 => 'Û‰', - 64483 => 'Û‰', - 64484 => 'Û', - 64485 => 'Û', - 64486 => 'Û', - 64487 => 'Û', - 64488 => 'Ù‰', - 64489 => 'Ù‰', - 64490 => 'ئا', - 64491 => 'ئا', - 64492 => 'ئە', - 64493 => 'ئە', - 64494 => 'ئو', - 64495 => 'ئو', - 64496 => 'ئۇ', - 64497 => 'ئۇ', - 64498 => 'ئۆ', - 64499 => 'ئۆ', - 64500 => 'ئۈ', - 64501 => 'ئۈ', - 64502 => 'ئÛ', - 64503 => 'ئÛ', - 64504 => 'ئÛ', - 64505 => 'ئى', - 64506 => 'ئى', - 64507 => 'ئى', - 64508 => 'ÛŒ', - 64509 => 'ÛŒ', - 64510 => 'ÛŒ', - 64511 => 'ÛŒ', - 64512 => 'ئج', - 64513 => 'ئح', - 64514 => 'ئم', - 64515 => 'ئى', - 64516 => 'ئي', - 64517 => 'بج', - 64518 => 'بح', - 64519 => 'بخ', - 64520 => 'بم', - 64521 => 'بى', - 64522 => 'بي', - 64523 => 'تج', - 64524 => 'تح', - 64525 => 'تخ', - 64526 => 'تم', - 64527 => 'تى', - 64528 => 'تي', - 64529 => 'ثج', - 64530 => 'ثم', - 64531 => 'ثى', - 64532 => 'ثي', - 64533 => 'جح', - 64534 => 'جم', - 64535 => 'حج', - 64536 => 'حم', - 64537 => 'خج', - 64538 => 'خح', - 64539 => 'خم', - 64540 => 'سج', - 64541 => 'سح', - 64542 => 'سخ', - 64543 => 'سم', - 64544 => 'صح', - 64545 => 'صم', - 64546 => 'ضج', - 64547 => 'ضح', - 64548 => 'ضخ', - 64549 => 'ضم', - 64550 => 'طح', - 64551 => 'طم', - 64552 => 'ظم', - 64553 => 'عج', - 64554 => 'عم', - 64555 => 'غج', - 64556 => 'غم', - 64557 => 'Ùج', - 64558 => 'ÙØ­', - 64559 => 'ÙØ®', - 64560 => 'ÙÙ…', - 64561 => 'ÙÙ‰', - 64562 => 'ÙÙŠ', - 64563 => 'قح', - 64564 => 'قم', - 64565 => 'قى', - 64566 => 'قي', - 64567 => 'كا', - 64568 => 'كج', - 64569 => 'كح', - 64570 => 'كخ', - 64571 => 'كل', - 64572 => 'كم', - 64573 => 'كى', - 64574 => 'كي', - 64575 => 'لج', - 64576 => 'لح', - 64577 => 'لخ', - 64578 => 'لم', - 64579 => 'لى', - 64580 => 'لي', - 64581 => 'مج', - 64582 => 'مح', - 64583 => 'مخ', - 64584 => 'مم', - 64585 => 'مى', - 64586 => 'مي', - 64587 => 'نج', - 64588 => 'نح', - 64589 => 'نخ', - 64590 => 'نم', - 64591 => 'نى', - 64592 => 'ني', - 64593 => 'هج', - 64594 => 'هم', - 64595 => 'هى', - 64596 => 'هي', - 64597 => 'يج', - 64598 => 'يح', - 64599 => 'يخ', - 64600 => 'يم', - 64601 => 'يى', - 64602 => 'يي', - 64603 => 'ذٰ', - 64604 => 'رٰ', - 64605 => 'ىٰ', - 64612 => 'ئر', - 64613 => 'ئز', - 64614 => 'ئم', - 64615 => 'ئن', - 64616 => 'ئى', - 64617 => 'ئي', - 64618 => 'بر', - 64619 => 'بز', - 64620 => 'بم', - 64621 => 'بن', - 64622 => 'بى', - 64623 => 'بي', - 64624 => 'تر', - 64625 => 'تز', - 64626 => 'تم', - 64627 => 'تن', - 64628 => 'تى', - 64629 => 'تي', - 64630 => 'ثر', - 64631 => 'ثز', - 64632 => 'ثم', - 64633 => 'ثن', - 64634 => 'ثى', - 64635 => 'ثي', - 64636 => 'ÙÙ‰', - 64637 => 'ÙÙŠ', - 64638 => 'قى', - 64639 => 'قي', - 64640 => 'كا', - 64641 => 'كل', - 64642 => 'كم', - 64643 => 'كى', - 64644 => 'كي', - 64645 => 'لم', - 64646 => 'لى', - 64647 => 'لي', - 64648 => 'ما', - 64649 => 'مم', - 64650 => 'نر', - 64651 => 'نز', - 64652 => 'نم', - 64653 => 'نن', - 64654 => 'نى', - 64655 => 'ني', - 64656 => 'ىٰ', - 64657 => 'ير', - 64658 => 'يز', - 64659 => 'يم', - 64660 => 'ين', - 64661 => 'يى', - 64662 => 'يي', - 64663 => 'ئج', - 64664 => 'ئح', - 64665 => 'ئخ', - 64666 => 'ئم', - 64667 => 'ئه', - 64668 => 'بج', - 64669 => 'بح', - 64670 => 'بخ', - 64671 => 'بم', - 64672 => 'به', - 64673 => 'تج', - 64674 => 'تح', - 64675 => 'تخ', - 64676 => 'تم', - 64677 => 'ته', - 64678 => 'ثم', - 64679 => 'جح', - 64680 => 'جم', - 64681 => 'حج', - 64682 => 'حم', - 64683 => 'خج', - 64684 => 'خم', - 64685 => 'سج', - 64686 => 'سح', - 64687 => 'سخ', - 64688 => 'سم', - 64689 => 'صح', - 64690 => 'صخ', - 64691 => 'صم', - 64692 => 'ضج', - 64693 => 'ضح', - 64694 => 'ضخ', - 64695 => 'ضم', - 64696 => 'طح', - 64697 => 'ظم', - 64698 => 'عج', - 64699 => 'عم', - 64700 => 'غج', - 64701 => 'غم', - 64702 => 'Ùج', - 64703 => 'ÙØ­', - 64704 => 'ÙØ®', - 64705 => 'ÙÙ…', - 64706 => 'قح', - 64707 => 'قم', - 64708 => 'كج', - 64709 => 'كح', - 64710 => 'كخ', - 64711 => 'كل', - 64712 => 'كم', - 64713 => 'لج', - 64714 => 'لح', - 64715 => 'لخ', - 64716 => 'لم', - 64717 => 'له', - 64718 => 'مج', - 64719 => 'مح', - 64720 => 'مخ', - 64721 => 'مم', - 64722 => 'نج', - 64723 => 'نح', - 64724 => 'نخ', - 64725 => 'نم', - 64726 => 'نه', - 64727 => 'هج', - 64728 => 'هم', - 64729 => 'هٰ', - 64730 => 'يج', - 64731 => 'يح', - 64732 => 'يخ', - 64733 => 'يم', - 64734 => 'يه', - 64735 => 'ئم', - 64736 => 'ئه', - 64737 => 'بم', - 64738 => 'به', - 64739 => 'تم', - 64740 => 'ته', - 64741 => 'ثم', - 64742 => 'ثه', - 64743 => 'سم', - 64744 => 'سه', - 64745 => 'شم', - 64746 => 'شه', - 64747 => 'كل', - 64748 => 'كم', - 64749 => 'لم', - 64750 => 'نم', - 64751 => 'نه', - 64752 => 'يم', - 64753 => 'يه', - 64754 => 'Ù€ÙŽÙ‘', - 64755 => 'Ù€ÙÙ‘', - 64756 => 'Ù€ÙÙ‘', - 64757 => 'طى', - 64758 => 'طي', - 64759 => 'عى', - 64760 => 'عي', - 64761 => 'غى', - 64762 => 'غي', - 64763 => 'سى', - 64764 => 'سي', - 64765 => 'شى', - 64766 => 'شي', - 64767 => 'حى', - 64768 => 'حي', - 64769 => 'جى', - 64770 => 'جي', - 64771 => 'خى', - 64772 => 'خي', - 64773 => 'صى', - 64774 => 'صي', - 64775 => 'ضى', - 64776 => 'ضي', - 64777 => 'شج', - 64778 => 'شح', - 64779 => 'شخ', - 64780 => 'شم', - 64781 => 'شر', - 64782 => 'سر', - 64783 => 'صر', - 64784 => 'ضر', - 64785 => 'طى', - 64786 => 'طي', - 64787 => 'عى', - 64788 => 'عي', - 64789 => 'غى', - 64790 => 'غي', - 64791 => 'سى', - 64792 => 'سي', - 64793 => 'شى', - 64794 => 'شي', - 64795 => 'حى', - 64796 => 'حي', - 64797 => 'جى', - 64798 => 'جي', - 64799 => 'خى', - 64800 => 'خي', - 64801 => 'صى', - 64802 => 'صي', - 64803 => 'ضى', - 64804 => 'ضي', - 64805 => 'شج', - 64806 => 'شح', - 64807 => 'شخ', - 64808 => 'شم', - 64809 => 'شر', - 64810 => 'سر', - 64811 => 'صر', - 64812 => 'ضر', - 64813 => 'شج', - 64814 => 'شح', - 64815 => 'شخ', - 64816 => 'شم', - 64817 => 'سه', - 64818 => 'شه', - 64819 => 'طم', - 64820 => 'سج', - 64821 => 'سح', - 64822 => 'سخ', - 64823 => 'شج', - 64824 => 'شح', - 64825 => 'شخ', - 64826 => 'طم', - 64827 => 'ظم', - 64828 => 'اً', - 64829 => 'اً', - 64848 => 'تجم', - 64849 => 'تحج', - 64850 => 'تحج', - 64851 => 'تحم', - 64852 => 'تخم', - 64853 => 'تمج', - 64854 => 'تمح', - 64855 => 'تمخ', - 64856 => 'جمح', - 64857 => 'جمح', - 64858 => 'حمي', - 64859 => 'حمى', - 64860 => 'سحج', - 64861 => 'سجح', - 64862 => 'سجى', - 64863 => 'سمح', - 64864 => 'سمح', - 64865 => 'سمج', - 64866 => 'سمم', - 64867 => 'سمم', - 64868 => 'صحح', - 64869 => 'صحح', - 64870 => 'صمم', - 64871 => 'شحم', - 64872 => 'شحم', - 64873 => 'شجي', - 64874 => 'شمخ', - 64875 => 'شمخ', - 64876 => 'شمم', - 64877 => 'شمم', - 64878 => 'ضحى', - 64879 => 'ضخم', - 64880 => 'ضخم', - 64881 => 'طمح', - 64882 => 'طمح', - 64883 => 'طمم', - 64884 => 'طمي', - 64885 => 'عجم', - 64886 => 'عمم', - 64887 => 'عمم', - 64888 => 'عمى', - 64889 => 'غمم', - 64890 => 'غمي', - 64891 => 'غمى', - 64892 => 'Ùخم', - 64893 => 'Ùخم', - 64894 => 'قمح', - 64895 => 'قمم', - 64896 => 'لحم', - 64897 => 'لحي', - 64898 => 'لحى', - 64899 => 'لجج', - 64900 => 'لجج', - 64901 => 'لخم', - 64902 => 'لخم', - 64903 => 'لمح', - 64904 => 'لمح', - 64905 => 'محج', - 64906 => 'محم', - 64907 => 'محي', - 64908 => 'مجح', - 64909 => 'مجم', - 64910 => 'مخج', - 64911 => 'مخم', - 64914 => 'مجخ', - 64915 => 'همج', - 64916 => 'همم', - 64917 => 'نحم', - 64918 => 'نحى', - 64919 => 'نجم', - 64920 => 'نجم', - 64921 => 'نجى', - 64922 => 'نمي', - 64923 => 'نمى', - 64924 => 'يمم', - 64925 => 'يمم', - 64926 => 'بخي', - 64927 => 'تجي', - 64928 => 'تجى', - 64929 => 'تخي', - 64930 => 'تخى', - 64931 => 'تمي', - 64932 => 'تمى', - 64933 => 'جمي', - 64934 => 'جحى', - 64935 => 'جمى', - 64936 => 'سخى', - 64937 => 'صحي', - 64938 => 'شحي', - 64939 => 'ضحي', - 64940 => 'لجي', - 64941 => 'لمي', - 64942 => 'يحي', - 64943 => 'يجي', - 64944 => 'يمي', - 64945 => 'ممي', - 64946 => 'قمي', - 64947 => 'نحي', - 64948 => 'قمح', - 64949 => 'لحم', - 64950 => 'عمي', - 64951 => 'كمي', - 64952 => 'نجح', - 64953 => 'مخي', - 64954 => 'لجم', - 64955 => 'كمم', - 64956 => 'لجم', - 64957 => 'نجح', - 64958 => 'جحي', - 64959 => 'حجي', - 64960 => 'مجي', - 64961 => 'Ùمي', - 64962 => 'بحي', - 64963 => 'كمم', - 64964 => 'عجم', - 64965 => 'صمم', - 64966 => 'سخي', - 64967 => 'نجي', - 65008 => 'صلے', - 65009 => 'قلے', - 65010 => 'الله', - 65011 => 'اكبر', - 65012 => 'محمد', - 65013 => 'صلعم', - 65014 => 'رسول', - 65015 => 'عليه', - 65016 => 'وسلم', - 65017 => 'صلى', - 65020 => 'ریال', - 65041 => 'ã€', - 65047 => '〖', - 65048 => '〗', - 65073 => '—', - 65074 => '–', - 65081 => '〔', - 65082 => '〕', - 65083 => 'ã€', - 65084 => '】', - 65085 => '《', - 65086 => '》', - 65087 => '〈', - 65088 => '〉', - 65089 => '「', - 65090 => 'ã€', - 65091 => '『', - 65092 => 'ã€', - 65105 => 'ã€', - 65112 => '—', - 65117 => '〔', - 65118 => '〕', - 65123 => '-', - 65137 => 'ـً', - 65143 => 'Ù€ÙŽ', - 65145 => 'Ù€Ù', - 65147 => 'Ù€Ù', - 65149 => 'ـّ', - 65151 => 'ـْ', - 65152 => 'Ø¡', - 65153 => 'Ø¢', - 65154 => 'Ø¢', - 65155 => 'Ø£', - 65156 => 'Ø£', - 65157 => 'ؤ', - 65158 => 'ؤ', - 65159 => 'Ø¥', - 65160 => 'Ø¥', - 65161 => 'ئ', - 65162 => 'ئ', - 65163 => 'ئ', - 65164 => 'ئ', - 65165 => 'ا', - 65166 => 'ا', - 65167 => 'ب', - 65168 => 'ب', - 65169 => 'ب', - 65170 => 'ب', - 65171 => 'Ø©', - 65172 => 'Ø©', - 65173 => 'ت', - 65174 => 'ت', - 65175 => 'ت', - 65176 => 'ت', - 65177 => 'Ø«', - 65178 => 'Ø«', - 65179 => 'Ø«', - 65180 => 'Ø«', - 65181 => 'ج', - 65182 => 'ج', - 65183 => 'ج', - 65184 => 'ج', - 65185 => 'Ø­', - 65186 => 'Ø­', - 65187 => 'Ø­', - 65188 => 'Ø­', - 65189 => 'Ø®', - 65190 => 'Ø®', - 65191 => 'Ø®', - 65192 => 'Ø®', - 65193 => 'د', - 65194 => 'د', - 65195 => 'Ø°', - 65196 => 'Ø°', - 65197 => 'ر', - 65198 => 'ر', - 65199 => 'ز', - 65200 => 'ز', - 65201 => 'س', - 65202 => 'س', - 65203 => 'س', - 65204 => 'س', - 65205 => 'Ø´', - 65206 => 'Ø´', - 65207 => 'Ø´', - 65208 => 'Ø´', - 65209 => 'ص', - 65210 => 'ص', - 65211 => 'ص', - 65212 => 'ص', - 65213 => 'ض', - 65214 => 'ض', - 65215 => 'ض', - 65216 => 'ض', - 65217 => 'Ø·', - 65218 => 'Ø·', - 65219 => 'Ø·', - 65220 => 'Ø·', - 65221 => 'ظ', - 65222 => 'ظ', - 65223 => 'ظ', - 65224 => 'ظ', - 65225 => 'ع', - 65226 => 'ع', - 65227 => 'ع', - 65228 => 'ع', - 65229 => 'غ', - 65230 => 'غ', - 65231 => 'غ', - 65232 => 'غ', - 65233 => 'Ù', - 65234 => 'Ù', - 65235 => 'Ù', - 65236 => 'Ù', - 65237 => 'Ù‚', - 65238 => 'Ù‚', - 65239 => 'Ù‚', - 65240 => 'Ù‚', - 65241 => 'Ùƒ', - 65242 => 'Ùƒ', - 65243 => 'Ùƒ', - 65244 => 'Ùƒ', - 65245 => 'Ù„', - 65246 => 'Ù„', - 65247 => 'Ù„', - 65248 => 'Ù„', - 65249 => 'Ù…', - 65250 => 'Ù…', - 65251 => 'Ù…', - 65252 => 'Ù…', - 65253 => 'Ù†', - 65254 => 'Ù†', - 65255 => 'Ù†', - 65256 => 'Ù†', - 65257 => 'Ù‡', - 65258 => 'Ù‡', - 65259 => 'Ù‡', - 65260 => 'Ù‡', - 65261 => 'Ùˆ', - 65262 => 'Ùˆ', - 65263 => 'Ù‰', - 65264 => 'Ù‰', - 65265 => 'ÙŠ', - 65266 => 'ÙŠ', - 65267 => 'ÙŠ', - 65268 => 'ÙŠ', - 65269 => 'لآ', - 65270 => 'لآ', - 65271 => 'لأ', - 65272 => 'لأ', - 65273 => 'لإ', - 65274 => 'لإ', - 65275 => 'لا', - 65276 => 'لا', - 65293 => '-', - 65294 => '.', - 65296 => '0', - 65297 => '1', - 65298 => '2', - 65299 => '3', - 65300 => '4', - 65301 => '5', - 65302 => '6', - 65303 => '7', - 65304 => '8', - 65305 => '9', - 65313 => 'a', - 65314 => 'b', - 65315 => 'c', - 65316 => 'd', - 65317 => 'e', - 65318 => 'f', - 65319 => 'g', - 65320 => 'h', - 65321 => 'i', - 65322 => 'j', - 65323 => 'k', - 65324 => 'l', - 65325 => 'm', - 65326 => 'n', - 65327 => 'o', - 65328 => 'p', - 65329 => 'q', - 65330 => 'r', - 65331 => 's', - 65332 => 't', - 65333 => 'u', - 65334 => 'v', - 65335 => 'w', - 65336 => 'x', - 65337 => 'y', - 65338 => 'z', - 65345 => 'a', - 65346 => 'b', - 65347 => 'c', - 65348 => 'd', - 65349 => 'e', - 65350 => 'f', - 65351 => 'g', - 65352 => 'h', - 65353 => 'i', - 65354 => 'j', - 65355 => 'k', - 65356 => 'l', - 65357 => 'm', - 65358 => 'n', - 65359 => 'o', - 65360 => 'p', - 65361 => 'q', - 65362 => 'r', - 65363 => 's', - 65364 => 't', - 65365 => 'u', - 65366 => 'v', - 65367 => 'w', - 65368 => 'x', - 65369 => 'y', - 65370 => 'z', - 65375 => '⦅', - 65376 => '⦆', - 65377 => '.', - 65378 => '「', - 65379 => 'ã€', - 65380 => 'ã€', - 65381 => '・', - 65382 => 'ヲ', - 65383 => 'ã‚¡', - 65384 => 'ã‚£', - 65385 => 'ã‚¥', - 65386 => 'ェ', - 65387 => 'ã‚©', - 65388 => 'ャ', - 65389 => 'ュ', - 65390 => 'ョ', - 65391 => 'ッ', - 65392 => 'ー', - 65393 => 'ã‚¢', - 65394 => 'イ', - 65395 => 'ウ', - 65396 => 'エ', - 65397 => 'オ', - 65398 => 'ã‚«', - 65399 => 'ã‚­', - 65400 => 'ク', - 65401 => 'ケ', - 65402 => 'コ', - 65403 => 'サ', - 65404 => 'ã‚·', - 65405 => 'ス', - 65406 => 'ã‚»', - 65407 => 'ソ', - 65408 => 'ã‚¿', - 65409 => 'ãƒ', - 65410 => 'ツ', - 65411 => 'テ', - 65412 => 'ト', - 65413 => 'ナ', - 65414 => 'ニ', - 65415 => 'ヌ', - 65416 => 'ãƒ', - 65417 => 'ノ', - 65418 => 'ãƒ', - 65419 => 'ヒ', - 65420 => 'フ', - 65421 => 'ヘ', - 65422 => 'ホ', - 65423 => 'マ', - 65424 => 'ミ', - 65425 => 'ム', - 65426 => 'メ', - 65427 => 'モ', - 65428 => 'ヤ', - 65429 => 'ユ', - 65430 => 'ヨ', - 65431 => 'ラ', - 65432 => 'リ', - 65433 => 'ル', - 65434 => 'レ', - 65435 => 'ロ', - 65436 => 'ワ', - 65437 => 'ン', - 65438 => 'ã‚™', - 65439 => 'ã‚š', - 65441 => 'á„€', - 65442 => 'á„', - 65443 => 'ᆪ', - 65444 => 'á„‚', - 65445 => 'ᆬ', - 65446 => 'ᆭ', - 65447 => 'ᄃ', - 65448 => 'á„„', - 65449 => 'á„…', - 65450 => 'ᆰ', - 65451 => 'ᆱ', - 65452 => 'ᆲ', - 65453 => 'ᆳ', - 65454 => 'ᆴ', - 65455 => 'ᆵ', - 65456 => 'á„š', - 65457 => 'ᄆ', - 65458 => 'ᄇ', - 65459 => 'ᄈ', - 65460 => 'á„¡', - 65461 => 'ᄉ', - 65462 => 'á„Š', - 65463 => 'á„‹', - 65464 => 'á„Œ', - 65465 => 'á„', - 65466 => 'á„Ž', - 65467 => 'á„', - 65468 => 'á„', - 65469 => 'á„‘', - 65470 => 'á„’', - 65474 => 'á…¡', - 65475 => 'á…¢', - 65476 => 'á…£', - 65477 => 'á…¤', - 65478 => 'á…¥', - 65479 => 'á…¦', - 65482 => 'á…§', - 65483 => 'á…¨', - 65484 => 'á…©', - 65485 => 'á…ª', - 65486 => 'á…«', - 65487 => 'á…¬', - 65490 => 'á…­', - 65491 => 'á…®', - 65492 => 'á…¯', - 65493 => 'á…°', - 65494 => 'á…±', - 65495 => 'á…²', - 65498 => 'á…³', - 65499 => 'á…´', - 65500 => 'á…µ', - 65504 => '¢', - 65505 => '£', - 65506 => '¬', - 65508 => '¦', - 65509 => 'Â¥', - 65510 => 'â‚©', - 65512 => '│', - 65513 => 'â†', - 65514 => '↑', - 65515 => '→', - 65516 => '↓', - 65517 => 'â– ', - 65518 => 'â—‹', - 66560 => 'ð¨', - 66561 => 'ð©', - 66562 => 'ðª', - 66563 => 'ð«', - 66564 => 'ð¬', - 66565 => 'ð­', - 66566 => 'ð®', - 66567 => 'ð¯', - 66568 => 'ð°', - 66569 => 'ð±', - 66570 => 'ð²', - 66571 => 'ð³', - 66572 => 'ð´', - 66573 => 'ðµ', - 66574 => 'ð¶', - 66575 => 'ð·', - 66576 => 'ð¸', - 66577 => 'ð¹', - 66578 => 'ðº', - 66579 => 'ð»', - 66580 => 'ð¼', - 66581 => 'ð½', - 66582 => 'ð¾', - 66583 => 'ð¿', - 66584 => 'ð‘€', - 66585 => 'ð‘', - 66586 => 'ð‘‚', - 66587 => 'ð‘ƒ', - 66588 => 'ð‘„', - 66589 => 'ð‘…', - 66590 => 'ð‘†', - 66591 => 'ð‘‡', - 66592 => 'ð‘ˆ', - 66593 => 'ð‘‰', - 66594 => 'ð‘Š', - 66595 => 'ð‘‹', - 66596 => 'ð‘Œ', - 66597 => 'ð‘', - 66598 => 'ð‘Ž', - 66599 => 'ð‘', - 66736 => 'ð“˜', - 66737 => 'ð“™', - 66738 => 'ð“š', - 66739 => 'ð“›', - 66740 => 'ð“œ', - 66741 => 'ð“', - 66742 => 'ð“ž', - 66743 => 'ð“Ÿ', - 66744 => 'ð“ ', - 66745 => 'ð“¡', - 66746 => 'ð“¢', - 66747 => 'ð“£', - 66748 => 'ð“¤', - 66749 => 'ð“¥', - 66750 => 'ð“¦', - 66751 => 'ð“§', - 66752 => 'ð“¨', - 66753 => 'ð“©', - 66754 => 'ð“ª', - 66755 => 'ð“«', - 66756 => 'ð“¬', - 66757 => 'ð“­', - 66758 => 'ð“®', - 66759 => 'ð“¯', - 66760 => 'ð“°', - 66761 => 'ð“±', - 66762 => 'ð“²', - 66763 => 'ð“³', - 66764 => 'ð“´', - 66765 => 'ð“µ', - 66766 => 'ð“¶', - 66767 => 'ð“·', - 66768 => 'ð“¸', - 66769 => 'ð“¹', - 66770 => 'ð“º', - 66771 => 'ð“»', - 68736 => 'ð³€', - 68737 => 'ð³', - 68738 => 'ð³‚', - 68739 => 'ð³ƒ', - 68740 => 'ð³„', - 68741 => 'ð³…', - 68742 => 'ð³†', - 68743 => 'ð³‡', - 68744 => 'ð³ˆ', - 68745 => 'ð³‰', - 68746 => 'ð³Š', - 68747 => 'ð³‹', - 68748 => 'ð³Œ', - 68749 => 'ð³', - 68750 => 'ð³Ž', - 68751 => 'ð³', - 68752 => 'ð³', - 68753 => 'ð³‘', - 68754 => 'ð³’', - 68755 => 'ð³“', - 68756 => 'ð³”', - 68757 => 'ð³•', - 68758 => 'ð³–', - 68759 => 'ð³—', - 68760 => 'ð³˜', - 68761 => 'ð³™', - 68762 => 'ð³š', - 68763 => 'ð³›', - 68764 => 'ð³œ', - 68765 => 'ð³', - 68766 => 'ð³ž', - 68767 => 'ð³Ÿ', - 68768 => 'ð³ ', - 68769 => 'ð³¡', - 68770 => 'ð³¢', - 68771 => 'ð³£', - 68772 => 'ð³¤', - 68773 => 'ð³¥', - 68774 => 'ð³¦', - 68775 => 'ð³§', - 68776 => 'ð³¨', - 68777 => 'ð³©', - 68778 => 'ð³ª', - 68779 => 'ð³«', - 68780 => 'ð³¬', - 68781 => 'ð³­', - 68782 => 'ð³®', - 68783 => 'ð³¯', - 68784 => 'ð³°', - 68785 => 'ð³±', - 68786 => 'ð³²', - 71840 => 'ð‘£€', - 71841 => 'ð‘£', - 71842 => '𑣂', - 71843 => '𑣃', - 71844 => '𑣄', - 71845 => 'ð‘£…', - 71846 => '𑣆', - 71847 => '𑣇', - 71848 => '𑣈', - 71849 => '𑣉', - 71850 => '𑣊', - 71851 => '𑣋', - 71852 => '𑣌', - 71853 => 'ð‘£', - 71854 => '𑣎', - 71855 => 'ð‘£', - 71856 => 'ð‘£', - 71857 => '𑣑', - 71858 => 'ð‘£’', - 71859 => '𑣓', - 71860 => 'ð‘£”', - 71861 => '𑣕', - 71862 => 'ð‘£–', - 71863 => 'ð‘£—', - 71864 => '𑣘', - 71865 => 'ð‘£™', - 71866 => '𑣚', - 71867 => 'ð‘£›', - 71868 => '𑣜', - 71869 => 'ð‘£', - 71870 => '𑣞', - 71871 => '𑣟', - 93760 => 'ð–¹ ', - 93761 => '𖹡', - 93762 => 'ð–¹¢', - 93763 => 'ð–¹£', - 93764 => '𖹤', - 93765 => 'ð–¹¥', - 93766 => '𖹦', - 93767 => '𖹧', - 93768 => '𖹨', - 93769 => '𖹩', - 93770 => '𖹪', - 93771 => '𖹫', - 93772 => '𖹬', - 93773 => 'ð–¹­', - 93774 => 'ð–¹®', - 93775 => '𖹯', - 93776 => 'ð–¹°', - 93777 => 'ð–¹±', - 93778 => 'ð–¹²', - 93779 => 'ð–¹³', - 93780 => 'ð–¹´', - 93781 => 'ð–¹µ', - 93782 => '𖹶', - 93783 => 'ð–¹·', - 93784 => '𖹸', - 93785 => 'ð–¹¹', - 93786 => '𖹺', - 93787 => 'ð–¹»', - 93788 => 'ð–¹¼', - 93789 => 'ð–¹½', - 93790 => 'ð–¹¾', - 93791 => '𖹿', - 119134 => 'ð…—ð…¥', - 119135 => 'ð…˜ð…¥', - 119136 => 'ð…˜ð…¥ð…®', - 119137 => 'ð…˜ð…¥ð…¯', - 119138 => 'ð…˜ð…¥ð…°', - 119139 => 'ð…˜ð…¥ð…±', - 119140 => 'ð…˜ð…¥ð…²', - 119227 => 'ð†¹ð…¥', - 119228 => 'ð†ºð…¥', - 119229 => 'ð†¹ð…¥ð…®', - 119230 => 'ð†ºð…¥ð…®', - 119231 => 'ð†¹ð…¥ð…¯', - 119232 => 'ð†ºð…¥ð…¯', - 119808 => 'a', - 119809 => 'b', - 119810 => 'c', - 119811 => 'd', - 119812 => 'e', - 119813 => 'f', - 119814 => 'g', - 119815 => 'h', - 119816 => 'i', - 119817 => 'j', - 119818 => 'k', - 119819 => 'l', - 119820 => 'm', - 119821 => 'n', - 119822 => 'o', - 119823 => 'p', - 119824 => 'q', - 119825 => 'r', - 119826 => 's', - 119827 => 't', - 119828 => 'u', - 119829 => 'v', - 119830 => 'w', - 119831 => 'x', - 119832 => 'y', - 119833 => 'z', - 119834 => 'a', - 119835 => 'b', - 119836 => 'c', - 119837 => 'd', - 119838 => 'e', - 119839 => 'f', - 119840 => 'g', - 119841 => 'h', - 119842 => 'i', - 119843 => 'j', - 119844 => 'k', - 119845 => 'l', - 119846 => 'm', - 119847 => 'n', - 119848 => 'o', - 119849 => 'p', - 119850 => 'q', - 119851 => 'r', - 119852 => 's', - 119853 => 't', - 119854 => 'u', - 119855 => 'v', - 119856 => 'w', - 119857 => 'x', - 119858 => 'y', - 119859 => 'z', - 119860 => 'a', - 119861 => 'b', - 119862 => 'c', - 119863 => 'd', - 119864 => 'e', - 119865 => 'f', - 119866 => 'g', - 119867 => 'h', - 119868 => 'i', - 119869 => 'j', - 119870 => 'k', - 119871 => 'l', - 119872 => 'm', - 119873 => 'n', - 119874 => 'o', - 119875 => 'p', - 119876 => 'q', - 119877 => 'r', - 119878 => 's', - 119879 => 't', - 119880 => 'u', - 119881 => 'v', - 119882 => 'w', - 119883 => 'x', - 119884 => 'y', - 119885 => 'z', - 119886 => 'a', - 119887 => 'b', - 119888 => 'c', - 119889 => 'd', - 119890 => 'e', - 119891 => 'f', - 119892 => 'g', - 119894 => 'i', - 119895 => 'j', - 119896 => 'k', - 119897 => 'l', - 119898 => 'm', - 119899 => 'n', - 119900 => 'o', - 119901 => 'p', - 119902 => 'q', - 119903 => 'r', - 119904 => 's', - 119905 => 't', - 119906 => 'u', - 119907 => 'v', - 119908 => 'w', - 119909 => 'x', - 119910 => 'y', - 119911 => 'z', - 119912 => 'a', - 119913 => 'b', - 119914 => 'c', - 119915 => 'd', - 119916 => 'e', - 119917 => 'f', - 119918 => 'g', - 119919 => 'h', - 119920 => 'i', - 119921 => 'j', - 119922 => 'k', - 119923 => 'l', - 119924 => 'm', - 119925 => 'n', - 119926 => 'o', - 119927 => 'p', - 119928 => 'q', - 119929 => 'r', - 119930 => 's', - 119931 => 't', - 119932 => 'u', - 119933 => 'v', - 119934 => 'w', - 119935 => 'x', - 119936 => 'y', - 119937 => 'z', - 119938 => 'a', - 119939 => 'b', - 119940 => 'c', - 119941 => 'd', - 119942 => 'e', - 119943 => 'f', - 119944 => 'g', - 119945 => 'h', - 119946 => 'i', - 119947 => 'j', - 119948 => 'k', - 119949 => 'l', - 119950 => 'm', - 119951 => 'n', - 119952 => 'o', - 119953 => 'p', - 119954 => 'q', - 119955 => 'r', - 119956 => 's', - 119957 => 't', - 119958 => 'u', - 119959 => 'v', - 119960 => 'w', - 119961 => 'x', - 119962 => 'y', - 119963 => 'z', - 119964 => 'a', - 119966 => 'c', - 119967 => 'd', - 119970 => 'g', - 119973 => 'j', - 119974 => 'k', - 119977 => 'n', - 119978 => 'o', - 119979 => 'p', - 119980 => 'q', - 119982 => 's', - 119983 => 't', - 119984 => 'u', - 119985 => 'v', - 119986 => 'w', - 119987 => 'x', - 119988 => 'y', - 119989 => 'z', - 119990 => 'a', - 119991 => 'b', - 119992 => 'c', - 119993 => 'd', - 119995 => 'f', - 119997 => 'h', - 119998 => 'i', - 119999 => 'j', - 120000 => 'k', - 120001 => 'l', - 120002 => 'm', - 120003 => 'n', - 120005 => 'p', - 120006 => 'q', - 120007 => 'r', - 120008 => 's', - 120009 => 't', - 120010 => 'u', - 120011 => 'v', - 120012 => 'w', - 120013 => 'x', - 120014 => 'y', - 120015 => 'z', - 120016 => 'a', - 120017 => 'b', - 120018 => 'c', - 120019 => 'd', - 120020 => 'e', - 120021 => 'f', - 120022 => 'g', - 120023 => 'h', - 120024 => 'i', - 120025 => 'j', - 120026 => 'k', - 120027 => 'l', - 120028 => 'm', - 120029 => 'n', - 120030 => 'o', - 120031 => 'p', - 120032 => 'q', - 120033 => 'r', - 120034 => 's', - 120035 => 't', - 120036 => 'u', - 120037 => 'v', - 120038 => 'w', - 120039 => 'x', - 120040 => 'y', - 120041 => 'z', - 120042 => 'a', - 120043 => 'b', - 120044 => 'c', - 120045 => 'd', - 120046 => 'e', - 120047 => 'f', - 120048 => 'g', - 120049 => 'h', - 120050 => 'i', - 120051 => 'j', - 120052 => 'k', - 120053 => 'l', - 120054 => 'm', - 120055 => 'n', - 120056 => 'o', - 120057 => 'p', - 120058 => 'q', - 120059 => 'r', - 120060 => 's', - 120061 => 't', - 120062 => 'u', - 120063 => 'v', - 120064 => 'w', - 120065 => 'x', - 120066 => 'y', - 120067 => 'z', - 120068 => 'a', - 120069 => 'b', - 120071 => 'd', - 120072 => 'e', - 120073 => 'f', - 120074 => 'g', - 120077 => 'j', - 120078 => 'k', - 120079 => 'l', - 120080 => 'm', - 120081 => 'n', - 120082 => 'o', - 120083 => 'p', - 120084 => 'q', - 120086 => 's', - 120087 => 't', - 120088 => 'u', - 120089 => 'v', - 120090 => 'w', - 120091 => 'x', - 120092 => 'y', - 120094 => 'a', - 120095 => 'b', - 120096 => 'c', - 120097 => 'd', - 120098 => 'e', - 120099 => 'f', - 120100 => 'g', - 120101 => 'h', - 120102 => 'i', - 120103 => 'j', - 120104 => 'k', - 120105 => 'l', - 120106 => 'm', - 120107 => 'n', - 120108 => 'o', - 120109 => 'p', - 120110 => 'q', - 120111 => 'r', - 120112 => 's', - 120113 => 't', - 120114 => 'u', - 120115 => 'v', - 120116 => 'w', - 120117 => 'x', - 120118 => 'y', - 120119 => 'z', - 120120 => 'a', - 120121 => 'b', - 120123 => 'd', - 120124 => 'e', - 120125 => 'f', - 120126 => 'g', - 120128 => 'i', - 120129 => 'j', - 120130 => 'k', - 120131 => 'l', - 120132 => 'm', - 120134 => 'o', - 120138 => 's', - 120139 => 't', - 120140 => 'u', - 120141 => 'v', - 120142 => 'w', - 120143 => 'x', - 120144 => 'y', - 120146 => 'a', - 120147 => 'b', - 120148 => 'c', - 120149 => 'd', - 120150 => 'e', - 120151 => 'f', - 120152 => 'g', - 120153 => 'h', - 120154 => 'i', - 120155 => 'j', - 120156 => 'k', - 120157 => 'l', - 120158 => 'm', - 120159 => 'n', - 120160 => 'o', - 120161 => 'p', - 120162 => 'q', - 120163 => 'r', - 120164 => 's', - 120165 => 't', - 120166 => 'u', - 120167 => 'v', - 120168 => 'w', - 120169 => 'x', - 120170 => 'y', - 120171 => 'z', - 120172 => 'a', - 120173 => 'b', - 120174 => 'c', - 120175 => 'd', - 120176 => 'e', - 120177 => 'f', - 120178 => 'g', - 120179 => 'h', - 120180 => 'i', - 120181 => 'j', - 120182 => 'k', - 120183 => 'l', - 120184 => 'm', - 120185 => 'n', - 120186 => 'o', - 120187 => 'p', - 120188 => 'q', - 120189 => 'r', - 120190 => 's', - 120191 => 't', - 120192 => 'u', - 120193 => 'v', - 120194 => 'w', - 120195 => 'x', - 120196 => 'y', - 120197 => 'z', - 120198 => 'a', - 120199 => 'b', - 120200 => 'c', - 120201 => 'd', - 120202 => 'e', - 120203 => 'f', - 120204 => 'g', - 120205 => 'h', - 120206 => 'i', - 120207 => 'j', - 120208 => 'k', - 120209 => 'l', - 120210 => 'm', - 120211 => 'n', - 120212 => 'o', - 120213 => 'p', - 120214 => 'q', - 120215 => 'r', - 120216 => 's', - 120217 => 't', - 120218 => 'u', - 120219 => 'v', - 120220 => 'w', - 120221 => 'x', - 120222 => 'y', - 120223 => 'z', - 120224 => 'a', - 120225 => 'b', - 120226 => 'c', - 120227 => 'd', - 120228 => 'e', - 120229 => 'f', - 120230 => 'g', - 120231 => 'h', - 120232 => 'i', - 120233 => 'j', - 120234 => 'k', - 120235 => 'l', - 120236 => 'm', - 120237 => 'n', - 120238 => 'o', - 120239 => 'p', - 120240 => 'q', - 120241 => 'r', - 120242 => 's', - 120243 => 't', - 120244 => 'u', - 120245 => 'v', - 120246 => 'w', - 120247 => 'x', - 120248 => 'y', - 120249 => 'z', - 120250 => 'a', - 120251 => 'b', - 120252 => 'c', - 120253 => 'd', - 120254 => 'e', - 120255 => 'f', - 120256 => 'g', - 120257 => 'h', - 120258 => 'i', - 120259 => 'j', - 120260 => 'k', - 120261 => 'l', - 120262 => 'm', - 120263 => 'n', - 120264 => 'o', - 120265 => 'p', - 120266 => 'q', - 120267 => 'r', - 120268 => 's', - 120269 => 't', - 120270 => 'u', - 120271 => 'v', - 120272 => 'w', - 120273 => 'x', - 120274 => 'y', - 120275 => 'z', - 120276 => 'a', - 120277 => 'b', - 120278 => 'c', - 120279 => 'd', - 120280 => 'e', - 120281 => 'f', - 120282 => 'g', - 120283 => 'h', - 120284 => 'i', - 120285 => 'j', - 120286 => 'k', - 120287 => 'l', - 120288 => 'm', - 120289 => 'n', - 120290 => 'o', - 120291 => 'p', - 120292 => 'q', - 120293 => 'r', - 120294 => 's', - 120295 => 't', - 120296 => 'u', - 120297 => 'v', - 120298 => 'w', - 120299 => 'x', - 120300 => 'y', - 120301 => 'z', - 120302 => 'a', - 120303 => 'b', - 120304 => 'c', - 120305 => 'd', - 120306 => 'e', - 120307 => 'f', - 120308 => 'g', - 120309 => 'h', - 120310 => 'i', - 120311 => 'j', - 120312 => 'k', - 120313 => 'l', - 120314 => 'm', - 120315 => 'n', - 120316 => 'o', - 120317 => 'p', - 120318 => 'q', - 120319 => 'r', - 120320 => 's', - 120321 => 't', - 120322 => 'u', - 120323 => 'v', - 120324 => 'w', - 120325 => 'x', - 120326 => 'y', - 120327 => 'z', - 120328 => 'a', - 120329 => 'b', - 120330 => 'c', - 120331 => 'd', - 120332 => 'e', - 120333 => 'f', - 120334 => 'g', - 120335 => 'h', - 120336 => 'i', - 120337 => 'j', - 120338 => 'k', - 120339 => 'l', - 120340 => 'm', - 120341 => 'n', - 120342 => 'o', - 120343 => 'p', - 120344 => 'q', - 120345 => 'r', - 120346 => 's', - 120347 => 't', - 120348 => 'u', - 120349 => 'v', - 120350 => 'w', - 120351 => 'x', - 120352 => 'y', - 120353 => 'z', - 120354 => 'a', - 120355 => 'b', - 120356 => 'c', - 120357 => 'd', - 120358 => 'e', - 120359 => 'f', - 120360 => 'g', - 120361 => 'h', - 120362 => 'i', - 120363 => 'j', - 120364 => 'k', - 120365 => 'l', - 120366 => 'm', - 120367 => 'n', - 120368 => 'o', - 120369 => 'p', - 120370 => 'q', - 120371 => 'r', - 120372 => 's', - 120373 => 't', - 120374 => 'u', - 120375 => 'v', - 120376 => 'w', - 120377 => 'x', - 120378 => 'y', - 120379 => 'z', - 120380 => 'a', - 120381 => 'b', - 120382 => 'c', - 120383 => 'd', - 120384 => 'e', - 120385 => 'f', - 120386 => 'g', - 120387 => 'h', - 120388 => 'i', - 120389 => 'j', - 120390 => 'k', - 120391 => 'l', - 120392 => 'm', - 120393 => 'n', - 120394 => 'o', - 120395 => 'p', - 120396 => 'q', - 120397 => 'r', - 120398 => 's', - 120399 => 't', - 120400 => 'u', - 120401 => 'v', - 120402 => 'w', - 120403 => 'x', - 120404 => 'y', - 120405 => 'z', - 120406 => 'a', - 120407 => 'b', - 120408 => 'c', - 120409 => 'd', - 120410 => 'e', - 120411 => 'f', - 120412 => 'g', - 120413 => 'h', - 120414 => 'i', - 120415 => 'j', - 120416 => 'k', - 120417 => 'l', - 120418 => 'm', - 120419 => 'n', - 120420 => 'o', - 120421 => 'p', - 120422 => 'q', - 120423 => 'r', - 120424 => 's', - 120425 => 't', - 120426 => 'u', - 120427 => 'v', - 120428 => 'w', - 120429 => 'x', - 120430 => 'y', - 120431 => 'z', - 120432 => 'a', - 120433 => 'b', - 120434 => 'c', - 120435 => 'd', - 120436 => 'e', - 120437 => 'f', - 120438 => 'g', - 120439 => 'h', - 120440 => 'i', - 120441 => 'j', - 120442 => 'k', - 120443 => 'l', - 120444 => 'm', - 120445 => 'n', - 120446 => 'o', - 120447 => 'p', - 120448 => 'q', - 120449 => 'r', - 120450 => 's', - 120451 => 't', - 120452 => 'u', - 120453 => 'v', - 120454 => 'w', - 120455 => 'x', - 120456 => 'y', - 120457 => 'z', - 120458 => 'a', - 120459 => 'b', - 120460 => 'c', - 120461 => 'd', - 120462 => 'e', - 120463 => 'f', - 120464 => 'g', - 120465 => 'h', - 120466 => 'i', - 120467 => 'j', - 120468 => 'k', - 120469 => 'l', - 120470 => 'm', - 120471 => 'n', - 120472 => 'o', - 120473 => 'p', - 120474 => 'q', - 120475 => 'r', - 120476 => 's', - 120477 => 't', - 120478 => 'u', - 120479 => 'v', - 120480 => 'w', - 120481 => 'x', - 120482 => 'y', - 120483 => 'z', - 120484 => 'ı', - 120485 => 'È·', - 120488 => 'α', - 120489 => 'β', - 120490 => 'γ', - 120491 => 'δ', - 120492 => 'ε', - 120493 => 'ζ', - 120494 => 'η', - 120495 => 'θ', - 120496 => 'ι', - 120497 => 'κ', - 120498 => 'λ', - 120499 => 'μ', - 120500 => 'ν', - 120501 => 'ξ', - 120502 => 'ο', - 120503 => 'Ï€', - 120504 => 'Ï', - 120505 => 'θ', - 120506 => 'σ', - 120507 => 'Ï„', - 120508 => 'Ï…', - 120509 => 'φ', - 120510 => 'χ', - 120511 => 'ψ', - 120512 => 'ω', - 120513 => '∇', - 120514 => 'α', - 120515 => 'β', - 120516 => 'γ', - 120517 => 'δ', - 120518 => 'ε', - 120519 => 'ζ', - 120520 => 'η', - 120521 => 'θ', - 120522 => 'ι', - 120523 => 'κ', - 120524 => 'λ', - 120525 => 'μ', - 120526 => 'ν', - 120527 => 'ξ', - 120528 => 'ο', - 120529 => 'Ï€', - 120530 => 'Ï', - 120531 => 'σ', - 120532 => 'σ', - 120533 => 'Ï„', - 120534 => 'Ï…', - 120535 => 'φ', - 120536 => 'χ', - 120537 => 'ψ', - 120538 => 'ω', - 120539 => '∂', - 120540 => 'ε', - 120541 => 'θ', - 120542 => 'κ', - 120543 => 'φ', - 120544 => 'Ï', - 120545 => 'Ï€', - 120546 => 'α', - 120547 => 'β', - 120548 => 'γ', - 120549 => 'δ', - 120550 => 'ε', - 120551 => 'ζ', - 120552 => 'η', - 120553 => 'θ', - 120554 => 'ι', - 120555 => 'κ', - 120556 => 'λ', - 120557 => 'μ', - 120558 => 'ν', - 120559 => 'ξ', - 120560 => 'ο', - 120561 => 'Ï€', - 120562 => 'Ï', - 120563 => 'θ', - 120564 => 'σ', - 120565 => 'Ï„', - 120566 => 'Ï…', - 120567 => 'φ', - 120568 => 'χ', - 120569 => 'ψ', - 120570 => 'ω', - 120571 => '∇', - 120572 => 'α', - 120573 => 'β', - 120574 => 'γ', - 120575 => 'δ', - 120576 => 'ε', - 120577 => 'ζ', - 120578 => 'η', - 120579 => 'θ', - 120580 => 'ι', - 120581 => 'κ', - 120582 => 'λ', - 120583 => 'μ', - 120584 => 'ν', - 120585 => 'ξ', - 120586 => 'ο', - 120587 => 'Ï€', - 120588 => 'Ï', - 120589 => 'σ', - 120590 => 'σ', - 120591 => 'Ï„', - 120592 => 'Ï…', - 120593 => 'φ', - 120594 => 'χ', - 120595 => 'ψ', - 120596 => 'ω', - 120597 => '∂', - 120598 => 'ε', - 120599 => 'θ', - 120600 => 'κ', - 120601 => 'φ', - 120602 => 'Ï', - 120603 => 'Ï€', - 120604 => 'α', - 120605 => 'β', - 120606 => 'γ', - 120607 => 'δ', - 120608 => 'ε', - 120609 => 'ζ', - 120610 => 'η', - 120611 => 'θ', - 120612 => 'ι', - 120613 => 'κ', - 120614 => 'λ', - 120615 => 'μ', - 120616 => 'ν', - 120617 => 'ξ', - 120618 => 'ο', - 120619 => 'Ï€', - 120620 => 'Ï', - 120621 => 'θ', - 120622 => 'σ', - 120623 => 'Ï„', - 120624 => 'Ï…', - 120625 => 'φ', - 120626 => 'χ', - 120627 => 'ψ', - 120628 => 'ω', - 120629 => '∇', - 120630 => 'α', - 120631 => 'β', - 120632 => 'γ', - 120633 => 'δ', - 120634 => 'ε', - 120635 => 'ζ', - 120636 => 'η', - 120637 => 'θ', - 120638 => 'ι', - 120639 => 'κ', - 120640 => 'λ', - 120641 => 'μ', - 120642 => 'ν', - 120643 => 'ξ', - 120644 => 'ο', - 120645 => 'Ï€', - 120646 => 'Ï', - 120647 => 'σ', - 120648 => 'σ', - 120649 => 'Ï„', - 120650 => 'Ï…', - 120651 => 'φ', - 120652 => 'χ', - 120653 => 'ψ', - 120654 => 'ω', - 120655 => '∂', - 120656 => 'ε', - 120657 => 'θ', - 120658 => 'κ', - 120659 => 'φ', - 120660 => 'Ï', - 120661 => 'Ï€', - 120662 => 'α', - 120663 => 'β', - 120664 => 'γ', - 120665 => 'δ', - 120666 => 'ε', - 120667 => 'ζ', - 120668 => 'η', - 120669 => 'θ', - 120670 => 'ι', - 120671 => 'κ', - 120672 => 'λ', - 120673 => 'μ', - 120674 => 'ν', - 120675 => 'ξ', - 120676 => 'ο', - 120677 => 'Ï€', - 120678 => 'Ï', - 120679 => 'θ', - 120680 => 'σ', - 120681 => 'Ï„', - 120682 => 'Ï…', - 120683 => 'φ', - 120684 => 'χ', - 120685 => 'ψ', - 120686 => 'ω', - 120687 => '∇', - 120688 => 'α', - 120689 => 'β', - 120690 => 'γ', - 120691 => 'δ', - 120692 => 'ε', - 120693 => 'ζ', - 120694 => 'η', - 120695 => 'θ', - 120696 => 'ι', - 120697 => 'κ', - 120698 => 'λ', - 120699 => 'μ', - 120700 => 'ν', - 120701 => 'ξ', - 120702 => 'ο', - 120703 => 'Ï€', - 120704 => 'Ï', - 120705 => 'σ', - 120706 => 'σ', - 120707 => 'Ï„', - 120708 => 'Ï…', - 120709 => 'φ', - 120710 => 'χ', - 120711 => 'ψ', - 120712 => 'ω', - 120713 => '∂', - 120714 => 'ε', - 120715 => 'θ', - 120716 => 'κ', - 120717 => 'φ', - 120718 => 'Ï', - 120719 => 'Ï€', - 120720 => 'α', - 120721 => 'β', - 120722 => 'γ', - 120723 => 'δ', - 120724 => 'ε', - 120725 => 'ζ', - 120726 => 'η', - 120727 => 'θ', - 120728 => 'ι', - 120729 => 'κ', - 120730 => 'λ', - 120731 => 'μ', - 120732 => 'ν', - 120733 => 'ξ', - 120734 => 'ο', - 120735 => 'Ï€', - 120736 => 'Ï', - 120737 => 'θ', - 120738 => 'σ', - 120739 => 'Ï„', - 120740 => 'Ï…', - 120741 => 'φ', - 120742 => 'χ', - 120743 => 'ψ', - 120744 => 'ω', - 120745 => '∇', - 120746 => 'α', - 120747 => 'β', - 120748 => 'γ', - 120749 => 'δ', - 120750 => 'ε', - 120751 => 'ζ', - 120752 => 'η', - 120753 => 'θ', - 120754 => 'ι', - 120755 => 'κ', - 120756 => 'λ', - 120757 => 'μ', - 120758 => 'ν', - 120759 => 'ξ', - 120760 => 'ο', - 120761 => 'Ï€', - 120762 => 'Ï', - 120763 => 'σ', - 120764 => 'σ', - 120765 => 'Ï„', - 120766 => 'Ï…', - 120767 => 'φ', - 120768 => 'χ', - 120769 => 'ψ', - 120770 => 'ω', - 120771 => '∂', - 120772 => 'ε', - 120773 => 'θ', - 120774 => 'κ', - 120775 => 'φ', - 120776 => 'Ï', - 120777 => 'Ï€', - 120778 => 'Ï', - 120779 => 'Ï', - 120782 => '0', - 120783 => '1', - 120784 => '2', - 120785 => '3', - 120786 => '4', - 120787 => '5', - 120788 => '6', - 120789 => '7', - 120790 => '8', - 120791 => '9', - 120792 => '0', - 120793 => '1', - 120794 => '2', - 120795 => '3', - 120796 => '4', - 120797 => '5', - 120798 => '6', - 120799 => '7', - 120800 => '8', - 120801 => '9', - 120802 => '0', - 120803 => '1', - 120804 => '2', - 120805 => '3', - 120806 => '4', - 120807 => '5', - 120808 => '6', - 120809 => '7', - 120810 => '8', - 120811 => '9', - 120812 => '0', - 120813 => '1', - 120814 => '2', - 120815 => '3', - 120816 => '4', - 120817 => '5', - 120818 => '6', - 120819 => '7', - 120820 => '8', - 120821 => '9', - 120822 => '0', - 120823 => '1', - 120824 => '2', - 120825 => '3', - 120826 => '4', - 120827 => '5', - 120828 => '6', - 120829 => '7', - 120830 => '8', - 120831 => '9', - 125184 => '𞤢', - 125185 => '𞤣', - 125186 => '𞤤', - 125187 => '𞤥', - 125188 => '𞤦', - 125189 => '𞤧', - 125190 => '𞤨', - 125191 => '𞤩', - 125192 => '𞤪', - 125193 => '𞤫', - 125194 => '𞤬', - 125195 => '𞤭', - 125196 => '𞤮', - 125197 => '𞤯', - 125198 => '𞤰', - 125199 => '𞤱', - 125200 => '𞤲', - 125201 => '𞤳', - 125202 => '𞤴', - 125203 => '𞤵', - 125204 => '𞤶', - 125205 => '𞤷', - 125206 => '𞤸', - 125207 => '𞤹', - 125208 => '𞤺', - 125209 => '𞤻', - 125210 => '𞤼', - 125211 => '𞤽', - 125212 => '𞤾', - 125213 => '𞤿', - 125214 => '𞥀', - 125215 => 'ðž¥', - 125216 => '𞥂', - 125217 => '𞥃', - 126464 => 'ا', - 126465 => 'ب', - 126466 => 'ج', - 126467 => 'د', - 126469 => 'Ùˆ', - 126470 => 'ز', - 126471 => 'Ø­', - 126472 => 'Ø·', - 126473 => 'ÙŠ', - 126474 => 'Ùƒ', - 126475 => 'Ù„', - 126476 => 'Ù…', - 126477 => 'Ù†', - 126478 => 'س', - 126479 => 'ع', - 126480 => 'Ù', - 126481 => 'ص', - 126482 => 'Ù‚', - 126483 => 'ر', - 126484 => 'Ø´', - 126485 => 'ت', - 126486 => 'Ø«', - 126487 => 'Ø®', - 126488 => 'Ø°', - 126489 => 'ض', - 126490 => 'ظ', - 126491 => 'غ', - 126492 => 'Ù®', - 126493 => 'Úº', - 126494 => 'Ú¡', - 126495 => 'Ù¯', - 126497 => 'ب', - 126498 => 'ج', - 126500 => 'Ù‡', - 126503 => 'Ø­', - 126505 => 'ÙŠ', - 126506 => 'Ùƒ', - 126507 => 'Ù„', - 126508 => 'Ù…', - 126509 => 'Ù†', - 126510 => 'س', - 126511 => 'ع', - 126512 => 'Ù', - 126513 => 'ص', - 126514 => 'Ù‚', - 126516 => 'Ø´', - 126517 => 'ت', - 126518 => 'Ø«', - 126519 => 'Ø®', - 126521 => 'ض', - 126523 => 'غ', - 126530 => 'ج', - 126535 => 'Ø­', - 126537 => 'ÙŠ', - 126539 => 'Ù„', - 126541 => 'Ù†', - 126542 => 'س', - 126543 => 'ع', - 126545 => 'ص', - 126546 => 'Ù‚', - 126548 => 'Ø´', - 126551 => 'Ø®', - 126553 => 'ض', - 126555 => 'غ', - 126557 => 'Úº', - 126559 => 'Ù¯', - 126561 => 'ب', - 126562 => 'ج', - 126564 => 'Ù‡', - 126567 => 'Ø­', - 126568 => 'Ø·', - 126569 => 'ÙŠ', - 126570 => 'Ùƒ', - 126572 => 'Ù…', - 126573 => 'Ù†', - 126574 => 'س', - 126575 => 'ع', - 126576 => 'Ù', - 126577 => 'ص', - 126578 => 'Ù‚', - 126580 => 'Ø´', - 126581 => 'ت', - 126582 => 'Ø«', - 126583 => 'Ø®', - 126585 => 'ض', - 126586 => 'ظ', - 126587 => 'غ', - 126588 => 'Ù®', - 126590 => 'Ú¡', - 126592 => 'ا', - 126593 => 'ب', - 126594 => 'ج', - 126595 => 'د', - 126596 => 'Ù‡', - 126597 => 'Ùˆ', - 126598 => 'ز', - 126599 => 'Ø­', - 126600 => 'Ø·', - 126601 => 'ÙŠ', - 126603 => 'Ù„', - 126604 => 'Ù…', - 126605 => 'Ù†', - 126606 => 'س', - 126607 => 'ع', - 126608 => 'Ù', - 126609 => 'ص', - 126610 => 'Ù‚', - 126611 => 'ر', - 126612 => 'Ø´', - 126613 => 'ت', - 126614 => 'Ø«', - 126615 => 'Ø®', - 126616 => 'Ø°', - 126617 => 'ض', - 126618 => 'ظ', - 126619 => 'غ', - 126625 => 'ب', - 126626 => 'ج', - 126627 => 'د', - 126629 => 'Ùˆ', - 126630 => 'ز', - 126631 => 'Ø­', - 126632 => 'Ø·', - 126633 => 'ÙŠ', - 126635 => 'Ù„', - 126636 => 'Ù…', - 126637 => 'Ù†', - 126638 => 'س', - 126639 => 'ع', - 126640 => 'Ù', - 126641 => 'ص', - 126642 => 'Ù‚', - 126643 => 'ر', - 126644 => 'Ø´', - 126645 => 'ت', - 126646 => 'Ø«', - 126647 => 'Ø®', - 126648 => 'Ø°', - 126649 => 'ض', - 126650 => 'ظ', - 126651 => 'غ', - 127274 => '〔s〕', - 127275 => 'c', - 127276 => 'r', - 127277 => 'cd', - 127278 => 'wz', - 127280 => 'a', - 127281 => 'b', - 127282 => 'c', - 127283 => 'd', - 127284 => 'e', - 127285 => 'f', - 127286 => 'g', - 127287 => 'h', - 127288 => 'i', - 127289 => 'j', - 127290 => 'k', - 127291 => 'l', - 127292 => 'm', - 127293 => 'n', - 127294 => 'o', - 127295 => 'p', - 127296 => 'q', - 127297 => 'r', - 127298 => 's', - 127299 => 't', - 127300 => 'u', - 127301 => 'v', - 127302 => 'w', - 127303 => 'x', - 127304 => 'y', - 127305 => 'z', - 127306 => 'hv', - 127307 => 'mv', - 127308 => 'sd', - 127309 => 'ss', - 127310 => 'ppv', - 127311 => 'wc', - 127338 => 'mc', - 127339 => 'md', - 127340 => 'mr', - 127376 => 'dj', - 127488 => 'ã»ã‹', - 127489 => 'ココ', - 127490 => 'サ', - 127504 => '手', - 127505 => 'å­—', - 127506 => 'åŒ', - 127507 => 'デ', - 127508 => '二', - 127509 => '多', - 127510 => '解', - 127511 => '天', - 127512 => '交', - 127513 => '映', - 127514 => 'ç„¡', - 127515 => 'æ–™', - 127516 => 'å‰', - 127517 => '後', - 127518 => 'å†', - 127519 => 'æ–°', - 127520 => 'åˆ', - 127521 => '終', - 127522 => '生', - 127523 => '販', - 127524 => '声', - 127525 => 'å¹', - 127526 => 'æ¼”', - 127527 => '投', - 127528 => 'æ•', - 127529 => '一', - 127530 => '三', - 127531 => 'éŠ', - 127532 => 'å·¦', - 127533 => '中', - 127534 => 'å³', - 127535 => '指', - 127536 => 'èµ°', - 127537 => '打', - 127538 => 'ç¦', - 127539 => '空', - 127540 => 'åˆ', - 127541 => '満', - 127542 => '有', - 127543 => '月', - 127544 => '申', - 127545 => '割', - 127546 => 'å–¶', - 127547 => 'é…', - 127552 => '〔本〕', - 127553 => '〔三〕', - 127554 => '〔二〕', - 127555 => '〔安〕', - 127556 => '〔点〕', - 127557 => '〔打〕', - 127558 => '〔盗〕', - 127559 => '〔å‹ã€•', - 127560 => '〔敗〕', - 127568 => 'å¾—', - 127569 => 'å¯', - 130032 => '0', - 130033 => '1', - 130034 => '2', - 130035 => '3', - 130036 => '4', - 130037 => '5', - 130038 => '6', - 130039 => '7', - 130040 => '8', - 130041 => '9', - 194560 => '丽', - 194561 => '丸', - 194562 => 'ä¹', - 194563 => 'ð „¢', - 194564 => 'ä½ ', - 194565 => 'ä¾®', - 194566 => 'ä¾»', - 194567 => '倂', - 194568 => 'åº', - 194569 => 'å‚™', - 194570 => '僧', - 194571 => 'åƒ', - 194572 => 'ã’ž', - 194573 => '𠘺', - 194574 => 'å…', - 194575 => 'å…”', - 194576 => 'å…¤', - 194577 => 'å…·', - 194578 => '𠔜', - 194579 => 'ã’¹', - 194580 => 'å…§', - 194581 => 'å†', - 194582 => 'ð •‹', - 194583 => '冗', - 194584 => '冤', - 194585 => '仌', - 194586 => '冬', - 194587 => '况', - 194588 => '𩇟', - 194589 => '凵', - 194590 => '刃', - 194591 => 'ã“Ÿ', - 194592 => '刻', - 194593 => '剆', - 194594 => '割', - 194595 => '剷', - 194596 => '㔕', - 194597 => '勇', - 194598 => '勉', - 194599 => '勤', - 194600 => '勺', - 194601 => '包', - 194602 => '匆', - 194603 => '北', - 194604 => 'å‰', - 194605 => 'å‘', - 194606 => 'åš', - 194607 => 'å³', - 194608 => 'å½', - 194609 => 'å¿', - 194610 => 'å¿', - 194611 => 'å¿', - 194612 => '𠨬', - 194613 => 'ç°', - 194614 => 'åŠ', - 194615 => 'åŸ', - 194616 => 'ð ­£', - 194617 => 'å«', - 194618 => 'å±', - 194619 => 'å†', - 194620 => 'å’ž', - 194621 => 'å¸', - 194622 => '呈', - 194623 => '周', - 194624 => 'å’¢', - 194625 => '哶', - 194626 => 'å”', - 194627 => 'å•“', - 194628 => 'å•£', - 194629 => 'å–„', - 194630 => 'å–„', - 194631 => 'å–™', - 194632 => 'å–«', - 194633 => 'å–³', - 194634 => 'å—‚', - 194635 => '圖', - 194636 => '嘆', - 194637 => '圗', - 194638 => '噑', - 194639 => 'å™´', - 194640 => '切', - 194641 => '壮', - 194642 => '城', - 194643 => '埴', - 194644 => 'å ', - 194645 => 'åž‹', - 194646 => 'å ²', - 194647 => 'å ±', - 194648 => '墬', - 194649 => '𡓤', - 194650 => '売', - 194651 => '壷', - 194652 => '夆', - 194653 => '多', - 194654 => '夢', - 194655 => '奢', - 194656 => '𡚨', - 194657 => '𡛪', - 194658 => '姬', - 194659 => '娛', - 194660 => '娧', - 194661 => '姘', - 194662 => '婦', - 194663 => 'ã›®', - 194665 => '嬈', - 194666 => '嬾', - 194667 => '嬾', - 194668 => '𡧈', - 194669 => '寃', - 194670 => '寘', - 194671 => '寧', - 194672 => '寳', - 194673 => '𡬘', - 194674 => '寿', - 194675 => 'å°†', - 194677 => 'å°¢', - 194678 => 'ãž', - 194679 => 'å± ', - 194680 => 'å±®', - 194681 => 'å³€', - 194682 => 'å²', - 194683 => 'ð¡·¤', - 194684 => '嵃', - 194685 => 'ð¡·¦', - 194686 => 'åµ®', - 194687 => '嵫', - 194688 => 'åµ¼', - 194689 => 'å·¡', - 194690 => 'å·¢', - 194691 => 'ã ¯', - 194692 => 'å·½', - 194693 => '帨', - 194694 => '帽', - 194695 => '幩', - 194696 => 'ã¡¢', - 194697 => '𢆃', - 194698 => '㡼', - 194699 => '庰', - 194700 => '庳', - 194701 => '庶', - 194702 => '廊', - 194703 => '𪎒', - 194704 => '廾', - 194705 => '𢌱', - 194706 => '𢌱', - 194707 => 'èˆ', - 194708 => 'å¼¢', - 194709 => 'å¼¢', - 194710 => '㣇', - 194711 => '𣊸', - 194712 => '𦇚', - 194713 => 'å½¢', - 194714 => '彫', - 194715 => '㣣', - 194716 => '徚', - 194717 => 'å¿', - 194718 => 'å¿—', - 194719 => '忹', - 194720 => 'æ‚', - 194721 => '㤺', - 194722 => '㤜', - 194723 => 'æ‚”', - 194724 => '𢛔', - 194725 => '惇', - 194726 => 'æ…ˆ', - 194727 => 'æ…Œ', - 194728 => 'æ…Ž', - 194729 => 'æ…Œ', - 194730 => 'æ…º', - 194731 => '憎', - 194732 => '憲', - 194733 => '憤', - 194734 => '憯', - 194735 => '懞', - 194736 => '懲', - 194737 => '懶', - 194738 => 'æˆ', - 194739 => '戛', - 194740 => 'æ‰', - 194741 => '抱', - 194742 => 'æ‹”', - 194743 => 'æ', - 194744 => '𢬌', - 194745 => '挽', - 194746 => '拼', - 194747 => 'æ¨', - 194748 => '掃', - 194749 => 'æ¤', - 194750 => '𢯱', - 194751 => 'æ¢', - 194752 => 'æ…', - 194753 => '掩', - 194754 => '㨮', - 194755 => 'æ‘©', - 194756 => '摾', - 194757 => 'æ’', - 194758 => 'æ‘·', - 194759 => '㩬', - 194760 => 'æ•', - 194761 => '敬', - 194762 => '𣀊', - 194763 => 'æ—£', - 194764 => '書', - 194765 => '晉', - 194766 => '㬙', - 194767 => 'æš‘', - 194768 => '㬈', - 194769 => '㫤', - 194770 => '冒', - 194771 => '冕', - 194772 => '最', - 194773 => 'æšœ', - 194774 => 'è‚­', - 194775 => 'ä™', - 194776 => '朗', - 194777 => '望', - 194778 => '朡', - 194779 => 'æž', - 194780 => 'æ“', - 194781 => 'ð£ƒ', - 194782 => 'ã­‰', - 194783 => '柺', - 194784 => 'æž…', - 194785 => 'æ¡’', - 194786 => '梅', - 194787 => '𣑭', - 194788 => '梎', - 194789 => 'æ Ÿ', - 194790 => '椔', - 194791 => 'ã®', - 194792 => '楂', - 194793 => '榣', - 194794 => '槪', - 194795 => '檨', - 194796 => '𣚣', - 194797 => 'æ«›', - 194798 => 'ã°˜', - 194799 => '次', - 194800 => '𣢧', - 194801 => 'æ­”', - 194802 => '㱎', - 194803 => 'æ­²', - 194804 => '殟', - 194805 => '殺', - 194806 => 'æ®»', - 194807 => 'ð£ª', - 194808 => 'ð¡´‹', - 194809 => '𣫺', - 194810 => '汎', - 194811 => '𣲼', - 194812 => '沿', - 194813 => 'æ³', - 194814 => '汧', - 194815 => 'æ´–', - 194816 => 'æ´¾', - 194817 => 'æµ·', - 194818 => 'æµ', - 194819 => '浩', - 194820 => '浸', - 194821 => '涅', - 194822 => '𣴞', - 194823 => 'æ´´', - 194824 => '港', - 194825 => 'æ¹®', - 194826 => 'ã´³', - 194827 => '滋', - 194828 => '滇', - 194829 => '𣻑', - 194830 => 'æ·¹', - 194831 => 'æ½®', - 194832 => '𣽞', - 194833 => '𣾎', - 194834 => '濆', - 194835 => '瀹', - 194836 => '瀞', - 194837 => '瀛', - 194838 => '㶖', - 194839 => 'çŠ', - 194840 => 'ç½', - 194841 => 'ç·', - 194842 => 'ç‚­', - 194843 => '𠔥', - 194844 => 'ç……', - 194845 => '𤉣', - 194846 => '熜', - 194848 => '爨', - 194849 => '爵', - 194850 => 'ç‰', - 194851 => '𤘈', - 194852 => '犀', - 194853 => '犕', - 194854 => '𤜵', - 194855 => '𤠔', - 194856 => 'çº', - 194857 => '王', - 194858 => '㺬', - 194859 => '玥', - 194860 => '㺸', - 194861 => '㺸', - 194862 => '瑇', - 194863 => 'ç‘œ', - 194864 => '瑱', - 194865 => 'ç’…', - 194866 => 'ç“Š', - 194867 => 'ã¼›', - 194868 => '甤', - 194869 => '𤰶', - 194870 => '甾', - 194871 => '𤲒', - 194872 => 'ç•°', - 194873 => '𢆟', - 194874 => 'ç˜', - 194875 => '𤾡', - 194876 => '𤾸', - 194877 => 'ð¥„', - 194878 => '㿼', - 194879 => '䀈', - 194880 => 'ç›´', - 194881 => '𥃳', - 194882 => '𥃲', - 194883 => '𥄙', - 194884 => '𥄳', - 194885 => '眞', - 194886 => '真', - 194887 => '真', - 194888 => 'çŠ', - 194889 => '䀹', - 194890 => 'çž‹', - 194891 => 'ä†', - 194892 => 'ä‚–', - 194893 => 'ð¥', - 194894 => 'ç¡Ž', - 194895 => '碌', - 194896 => '磌', - 194897 => '䃣', - 194898 => '𥘦', - 194899 => '祖', - 194900 => '𥚚', - 194901 => '𥛅', - 194902 => 'ç¦', - 194903 => '秫', - 194904 => '䄯', - 194905 => 'ç©€', - 194906 => 'ç©Š', - 194907 => 'ç©', - 194908 => '𥥼', - 194909 => '𥪧', - 194910 => '𥪧', - 194912 => '䈂', - 194913 => '𥮫', - 194914 => '篆', - 194915 => '築', - 194916 => '䈧', - 194917 => '𥲀', - 194918 => 'ç³’', - 194919 => '䊠', - 194920 => '糨', - 194921 => 'ç³£', - 194922 => 'ç´€', - 194923 => '𥾆', - 194924 => 'çµ£', - 194925 => 'äŒ', - 194926 => 'ç·‡', - 194927 => '縂', - 194928 => 'ç¹…', - 194929 => '䌴', - 194930 => '𦈨', - 194931 => '𦉇', - 194932 => 'ä™', - 194933 => '𦋙', - 194934 => '罺', - 194935 => '𦌾', - 194936 => '羕', - 194937 => '翺', - 194938 => '者', - 194939 => '𦓚', - 194940 => '𦔣', - 194941 => 'è ', - 194942 => '𦖨', - 194943 => 'è°', - 194944 => 'ð£Ÿ', - 194945 => 'ä•', - 194946 => '育', - 194947 => '脃', - 194948 => 'ä‹', - 194949 => '脾', - 194950 => '媵', - 194951 => '𦞧', - 194952 => '𦞵', - 194953 => '𣎓', - 194954 => '𣎜', - 194955 => 'èˆ', - 194956 => '舄', - 194957 => '辞', - 194958 => 'ä‘«', - 194959 => '芑', - 194960 => '芋', - 194961 => 'èŠ', - 194962 => '劳', - 194963 => '花', - 194964 => '芳', - 194965 => '芽', - 194966 => '苦', - 194967 => '𦬼', - 194968 => 'è‹¥', - 194969 => 'èŒ', - 194970 => 'è£', - 194971 => '莭', - 194972 => '茣', - 194973 => '莽', - 194974 => 'è§', - 194975 => 'è‘—', - 194976 => 'è“', - 194977 => 'èŠ', - 194978 => 'èŒ', - 194979 => 'èœ', - 194980 => '𦰶', - 194981 => '𦵫', - 194982 => '𦳕', - 194983 => '䔫', - 194984 => '蓱', - 194985 => '蓳', - 194986 => 'è”–', - 194987 => 'ð§Š', - 194988 => '蕤', - 194989 => '𦼬', - 194990 => 'ä•', - 194991 => 'ä•¡', - 194992 => '𦾱', - 194993 => '𧃒', - 194994 => 'ä•«', - 194995 => 'è™', - 194996 => '虜', - 194997 => '虧', - 194998 => '虩', - 194999 => 'èš©', - 195000 => '蚈', - 195001 => '蜎', - 195002 => '蛢', - 195003 => 'è¹', - 195004 => '蜨', - 195005 => 'è«', - 195006 => '螆', - 195008 => '蟡', - 195009 => 'è ', - 195010 => 'ä—¹', - 195011 => 'è¡ ', - 195012 => 'è¡£', - 195013 => '𧙧', - 195014 => '裗', - 195015 => '裞', - 195016 => '䘵', - 195017 => '裺', - 195018 => 'ã’»', - 195019 => '𧢮', - 195020 => '𧥦', - 195021 => 'äš¾', - 195022 => '䛇', - 195023 => '誠', - 195024 => 'è«­', - 195025 => '變', - 195026 => '豕', - 195027 => '𧲨', - 195028 => '貫', - 195029 => 'è³', - 195030 => 'è´›', - 195031 => 'èµ·', - 195032 => '𧼯', - 195033 => 'ð  „', - 195034 => 'è·‹', - 195035 => '趼', - 195036 => 'è·°', - 195037 => '𠣞', - 195038 => 'è»”', - 195039 => '輸', - 195040 => '𨗒', - 195041 => '𨗭', - 195042 => 'é‚”', - 195043 => '郱', - 195044 => 'é„‘', - 195045 => '𨜮', - 195046 => 'é„›', - 195047 => '鈸', - 195048 => 'é‹—', - 195049 => '鋘', - 195050 => '鉼', - 195051 => 'é¹', - 195052 => 'é•', - 195053 => '𨯺', - 195054 => 'é–‹', - 195055 => '䦕', - 195056 => 'é–·', - 195057 => '𨵷', - 195058 => '䧦', - 195059 => '雃', - 195060 => '嶲', - 195061 => '霣', - 195062 => 'ð©……', - 195063 => '𩈚', - 195064 => 'ä©®', - 195065 => '䩶', - 195066 => '韠', - 195067 => 'ð©Š', - 195068 => '䪲', - 195069 => 'ð©’–', - 195070 => 'é ‹', - 195071 => 'é ‹', - 195072 => 'é ©', - 195073 => 'ð©–¶', - 195074 => '飢', - 195075 => '䬳', - 195076 => '餩', - 195077 => '馧', - 195078 => '駂', - 195079 => '駾', - 195080 => '䯎', - 195081 => '𩬰', - 195082 => '鬒', - 195083 => 'é±€', - 195084 => 'é³½', - 195085 => '䳎', - 195086 => 'ä³­', - 195087 => '鵧', - 195088 => '𪃎', - 195089 => '䳸', - 195090 => '𪄅', - 195091 => '𪈎', - 195092 => '𪊑', - 195093 => '麻', - 195094 => 'äµ–', - 195095 => '黹', - 195096 => '黾', - 195097 => 'é¼…', - 195098 => 'é¼', - 195099 => 'é¼–', - 195100 => 'é¼»', - 195101 => '𪘀', -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php deleted file mode 100644 index 1958e37ed25..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php +++ /dev/null @@ -1,65 +0,0 @@ - 9, - 2509 => 9, - 2637 => 9, - 2765 => 9, - 2893 => 9, - 3021 => 9, - 3149 => 9, - 3277 => 9, - 3387 => 9, - 3388 => 9, - 3405 => 9, - 3530 => 9, - 3642 => 9, - 3770 => 9, - 3972 => 9, - 4153 => 9, - 4154 => 9, - 5908 => 9, - 5940 => 9, - 6098 => 9, - 6752 => 9, - 6980 => 9, - 7082 => 9, - 7083 => 9, - 7154 => 9, - 7155 => 9, - 11647 => 9, - 43014 => 9, - 43052 => 9, - 43204 => 9, - 43347 => 9, - 43456 => 9, - 43766 => 9, - 44013 => 9, - 68159 => 9, - 69702 => 9, - 69759 => 9, - 69817 => 9, - 69939 => 9, - 69940 => 9, - 70080 => 9, - 70197 => 9, - 70378 => 9, - 70477 => 9, - 70722 => 9, - 70850 => 9, - 71103 => 9, - 71231 => 9, - 71350 => 9, - 71467 => 9, - 71737 => 9, - 71997 => 9, - 71998 => 9, - 72160 => 9, - 72244 => 9, - 72263 => 9, - 72345 => 9, - 72767 => 9, - 73028 => 9, - 73029 => 9, - 73111 => 9, -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php deleted file mode 100644 index 57c78356c99..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Idn as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('U_IDNA_PROHIBITED_ERROR')) { - define('U_IDNA_PROHIBITED_ERROR', 66560); -} -if (!defined('U_IDNA_ERROR_START')) { - define('U_IDNA_ERROR_START', 66560); -} -if (!defined('U_IDNA_UNASSIGNED_ERROR')) { - define('U_IDNA_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { - define('U_IDNA_CHECK_BIDI_ERROR', 66562); -} -if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { - define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); -} -if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { - define('U_IDNA_ACE_PREFIX_ERROR', 66564); -} -if (!defined('U_IDNA_VERIFICATION_ERROR')) { - define('U_IDNA_VERIFICATION_ERROR', 66565); -} -if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { - define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); -} -if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { - define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); -} -if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { - define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); -} -if (!defined('U_IDNA_ERROR_LIMIT')) { - define('U_IDNA_ERROR_LIMIT', 66569); -} -if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { - define('U_STRINGPREP_PROHIBITED_ERROR', 66560); -} -if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { - define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { - define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); -} -if (!defined('IDNA_DEFAULT')) { - define('IDNA_DEFAULT', 0); -} -if (!defined('IDNA_ALLOW_UNASSIGNED')) { - define('IDNA_ALLOW_UNASSIGNED', 1); -} -if (!defined('IDNA_USE_STD3_RULES')) { - define('IDNA_USE_STD3_RULES', 2); -} -if (!defined('IDNA_CHECK_BIDI')) { - define('IDNA_CHECK_BIDI', 4); -} -if (!defined('IDNA_CHECK_CONTEXTJ')) { - define('IDNA_CHECK_CONTEXTJ', 8); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { - define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { - define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); -} -if (!defined('INTL_IDNA_VARIANT_2003')) { - define('INTL_IDNA_VARIANT_2003', 0); -} -if (!defined('INTL_IDNA_VARIANT_UTS46')) { - define('INTL_IDNA_VARIANT_UTS46', 1); -} -if (!defined('IDNA_ERROR_EMPTY_LABEL')) { - define('IDNA_ERROR_EMPTY_LABEL', 1); -} -if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { - define('IDNA_ERROR_LABEL_TOO_LONG', 2); -} -if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { - define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); -} -if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { - define('IDNA_ERROR_LEADING_HYPHEN', 8); -} -if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { - define('IDNA_ERROR_TRAILING_HYPHEN', 16); -} -if (!defined('IDNA_ERROR_HYPHEN_3_4')) { - define('IDNA_ERROR_HYPHEN_3_4', 32); -} -if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { - define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); -} -if (!defined('IDNA_ERROR_DISALLOWED')) { - define('IDNA_ERROR_DISALLOWED', 128); -} -if (!defined('IDNA_ERROR_PUNYCODE')) { - define('IDNA_ERROR_PUNYCODE', 256); -} -if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { - define('IDNA_ERROR_LABEL_HAS_DOT', 512); -} -if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { - define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); -} -if (!defined('IDNA_ERROR_BIDI')) { - define('IDNA_ERROR_BIDI', 2048); -} -if (!defined('IDNA_ERROR_CONTEXTJ')) { - define('IDNA_ERROR_CONTEXTJ', 4096); -} - -if (\PHP_VERSION_ID < 70400) { - if (!function_exists('idn_to_ascii')) { - function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } - } - if (!function_exists('idn_to_utf8')) { - function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } - } -} else { - if (!function_exists('idn_to_ascii')) { - function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } - } - if (!function_exists('idn_to_utf8')) { - function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php deleted file mode 100644 index a62c2d69bf7..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/bootstrap80.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Idn as p; - -if (!defined('U_IDNA_PROHIBITED_ERROR')) { - define('U_IDNA_PROHIBITED_ERROR', 66560); -} -if (!defined('U_IDNA_ERROR_START')) { - define('U_IDNA_ERROR_START', 66560); -} -if (!defined('U_IDNA_UNASSIGNED_ERROR')) { - define('U_IDNA_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { - define('U_IDNA_CHECK_BIDI_ERROR', 66562); -} -if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { - define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); -} -if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { - define('U_IDNA_ACE_PREFIX_ERROR', 66564); -} -if (!defined('U_IDNA_VERIFICATION_ERROR')) { - define('U_IDNA_VERIFICATION_ERROR', 66565); -} -if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { - define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); -} -if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { - define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); -} -if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { - define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); -} -if (!defined('U_IDNA_ERROR_LIMIT')) { - define('U_IDNA_ERROR_LIMIT', 66569); -} -if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { - define('U_STRINGPREP_PROHIBITED_ERROR', 66560); -} -if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { - define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); -} -if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { - define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); -} -if (!defined('IDNA_DEFAULT')) { - define('IDNA_DEFAULT', 0); -} -if (!defined('IDNA_ALLOW_UNASSIGNED')) { - define('IDNA_ALLOW_UNASSIGNED', 1); -} -if (!defined('IDNA_USE_STD3_RULES')) { - define('IDNA_USE_STD3_RULES', 2); -} -if (!defined('IDNA_CHECK_BIDI')) { - define('IDNA_CHECK_BIDI', 4); -} -if (!defined('IDNA_CHECK_CONTEXTJ')) { - define('IDNA_CHECK_CONTEXTJ', 8); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { - define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); -} -if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { - define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); -} -if (!defined('INTL_IDNA_VARIANT_UTS46')) { - define('INTL_IDNA_VARIANT_UTS46', 1); -} -if (!defined('IDNA_ERROR_EMPTY_LABEL')) { - define('IDNA_ERROR_EMPTY_LABEL', 1); -} -if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { - define('IDNA_ERROR_LABEL_TOO_LONG', 2); -} -if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { - define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); -} -if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { - define('IDNA_ERROR_LEADING_HYPHEN', 8); -} -if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { - define('IDNA_ERROR_TRAILING_HYPHEN', 16); -} -if (!defined('IDNA_ERROR_HYPHEN_3_4')) { - define('IDNA_ERROR_HYPHEN_3_4', 32); -} -if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { - define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); -} -if (!defined('IDNA_ERROR_DISALLOWED')) { - define('IDNA_ERROR_DISALLOWED', 128); -} -if (!defined('IDNA_ERROR_PUNYCODE')) { - define('IDNA_ERROR_PUNYCODE', 256); -} -if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { - define('IDNA_ERROR_LABEL_HAS_DOT', 512); -} -if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { - define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); -} -if (!defined('IDNA_ERROR_BIDI')) { - define('IDNA_ERROR_BIDI', 2048); -} -if (!defined('IDNA_ERROR_CONTEXTJ')) { - define('IDNA_ERROR_CONTEXTJ', 4096); -} - -if (!function_exists('idn_to_ascii')) { - function idn_to_ascii(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); } -} -if (!function_exists('idn_to_utf8')) { - function idn_to_utf8(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json b/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json deleted file mode 100644 index c5a2a462a7a..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-idn/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "symfony/polyfill-intl-idn", - "type": "library", - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "idn"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE deleted file mode 100644 index 4cd8bdd3007..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php deleted file mode 100644 index 4443c2322af..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ /dev/null @@ -1,310 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Normalizer; - -/** - * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. - * - * It has been validated with Unicode 6.3 Normalization Conformance Test. - * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. - * - * @author Nicolas Grekas - * - * @internal - */ -class Normalizer -{ - public const FORM_D = \Normalizer::FORM_D; - public const FORM_KD = \Normalizer::FORM_KD; - public const FORM_C = \Normalizer::FORM_C; - public const FORM_KC = \Normalizer::FORM_KC; - public const NFD = \Normalizer::NFD; - public const NFKD = \Normalizer::NFKD; - public const NFC = \Normalizer::NFC; - public const NFKC = \Normalizer::NFKC; - - private static $C; - private static $D; - private static $KD; - private static $cC; - private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - private static $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"; - - public static function isNormalized(string $s, int $form = self::FORM_C) - { - if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; - } - if (!isset($s[strspn($s, self::$ASCII)])) { - return true; - } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { - return true; - } - - return self::normalize($s, $form) === $s; - } - - public static function normalize(string $s, int $form = self::FORM_C) - { - if (!preg_match('//u', $s)) { - return false; - } - - switch ($form) { - case self::NFC: $C = true; $K = false; break; - case self::NFD: $C = false; $K = false; break; - case self::NFKC: $C = true; $K = true; break; - case self::NFKD: $C = false; $K = true; break; - default: - if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); - } - - if ('' === $s) { - return ''; - } - - if ($K && null === self::$KD) { - self::$KD = self::getData('compatibilityDecomposition'); - } - - if (null === self::$D) { - self::$D = self::getData('canonicalDecomposition'); - self::$cC = self::getData('combiningClass'); - } - - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { - mb_internal_encoding('8bit'); - } - - $r = self::decompose($s, $K); - - if ($C) { - if (null === self::$C) { - self::$C = self::getData('canonicalComposition'); - } - - $r = self::recompose($r); - } - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return $r; - } - - private static function recompose($s) - { - $ASCII = self::$ASCII; - $compMap = self::$C; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - - $result = $tail = ''; - - $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; - $len = \strlen($s); - - $lastUchr = substr($s, 0, $i); - $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - if ($j = strspn($s, $ASCII, $i + 1)) { - $lastUchr .= substr($s, $i, $j); - $i += $j; - } - - $result .= $lastUchr; - $lastUchr = $s[$i]; - $lastUcls = 0; - ++$i; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - - if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr - || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr - || $lastUcls) { - // Table lookup and combining chars composition - - $ucls = $combClass[$uchr] ?? 0; - - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { - $lastUchr = $compMap[$lastUchr.$uchr]; - } elseif ($lastUcls = $ucls) { - $tail .= $uchr; - } else { - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - $result .= $lastUchr; - $lastUchr = $uchr; - } - } else { - // Hangul chars - - $L = \ord($lastUchr[2]) - 0x80; - $V = \ord($uchr[2]) - 0xA1; - $T = 0; - - $uchr = substr($s, $i + $ulen, 3); - - if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { - $T = \ord($uchr[2]) - 0xA7; - 0 > $T && $T += 0x40; - $ulen += 3; - } - - $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); - } - - $i += $ulen; - } - - return $result.$lastUchr.$tail; - } - - private static function decompose($s, $c) - { - $result = ''; - - $ASCII = self::$ASCII; - $decompMap = self::$D; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - if ($c) { - $compatMap = self::$KD; - } - - $c = []; - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $j = 1 + strspn($s, $ASCII, $i + 1); - $result .= substr($s, $i, $j); - $i += $j; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { - // Table lookup - - if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { - $uchr = $j; - - $j = \strlen($uchr); - $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; - - if ($ulen != $j) { - // Put trailing chars in $s - - $j -= $ulen; - $i -= $j; - - if (0 > $i) { - $s = str_repeat(' ', -$i).$s; - $len -= $i; - $i = 0; - } - - while ($j--) { - $s[$i + $j] = $uchr[$ulen + $j]; - } - - $uchr = substr($uchr, 0, $ulen); - } - } - if (isset($combClass[$uchr])) { - // Combining chars, for sorting - - if (!isset($c[$combClass[$uchr]])) { - $c[$combClass[$uchr]] = ''; - } - $c[$combClass[$uchr]] .= $uchr; - continue; - } - } else { - // Hangul chars - - $uchr = unpack('C*', $uchr); - $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; - - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); - - if ($j %= 28) { - $uchr .= $j < 25 - ? ("\xE1\x86".\chr(0xA7 + $j)) - : ("\xE1\x87".\chr(0x67 + $j)); - } - } - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $result .= $uchr; - } - - if ($c) { - ksort($c); - $result .= implode('', $c); - } - - return $result; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md deleted file mode 100644 index 15060c5f1fa..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Intl: Normalizer -=================================== - -This component provides a fallback implementation for the -[`Normalizer`](https://php.net/Normalizer) class provided -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). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php deleted file mode 100644 index 0fdfc890a2a..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php +++ /dev/null @@ -1,17 +0,0 @@ - 'À', - 'AÌ' => 'Ã', - 'AÌ‚' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'AÌŠ' => 'Ã…', - 'Ç' => 'Ç', - 'EÌ€' => 'È', - 'EÌ' => 'É', - 'EÌ‚' => 'Ê', - 'Ë' => 'Ë', - 'IÌ€' => 'ÃŒ', - 'IÌ' => 'Ã', - 'IÌ‚' => 'ÃŽ', - 'Ï' => 'Ã', - 'Ñ' => 'Ñ', - 'OÌ€' => 'Ã’', - 'OÌ' => 'Ó', - 'OÌ‚' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'UÌ€' => 'Ù', - 'UÌ' => 'Ú', - 'UÌ‚' => 'Û', - 'Ü' => 'Ãœ', - 'YÌ' => 'Ã', - 'aÌ€' => 'à', - 'aÌ' => 'á', - 'aÌ‚' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'aÌŠ' => 'Ã¥', - 'ç' => 'ç', - 'eÌ€' => 'è', - 'eÌ' => 'é', - 'eÌ‚' => 'ê', - 'ë' => 'ë', - 'iÌ€' => 'ì', - 'iÌ' => 'í', - 'iÌ‚' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'oÌ€' => 'ò', - 'oÌ' => 'ó', - 'oÌ‚' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'uÌ€' => 'ù', - 'uÌ' => 'ú', - 'uÌ‚' => 'û', - 'ü' => 'ü', - 'yÌ' => 'ý', - 'ÿ' => 'ÿ', - 'AÌ„' => 'Ä€', - 'aÌ„' => 'Ä', - 'Ă' => 'Ä‚', - 'ă' => 'ă', - 'Ą' => 'Ä„', - 'ą' => 'Ä…', - 'CÌ' => 'Ć', - 'cÌ' => 'ć', - 'CÌ‚' => 'Ĉ', - 'cÌ‚' => 'ĉ', - 'Ċ' => 'ÄŠ', - 'ċ' => 'Ä‹', - 'CÌŒ' => 'ÄŒ', - 'cÌŒ' => 'Ä', - 'DÌŒ' => 'ÄŽ', - 'dÌŒ' => 'Ä', - 'EÌ„' => 'Ä’', - 'eÌ„' => 'Ä“', - 'Ĕ' => 'Ä”', - 'ĕ' => 'Ä•', - 'Ė' => 'Ä–', - 'ė' => 'Ä—', - 'Ę' => 'Ę', - 'ę' => 'Ä™', - 'EÌŒ' => 'Äš', - 'eÌŒ' => 'Ä›', - 'GÌ‚' => 'Äœ', - 'gÌ‚' => 'Ä', - 'Ğ' => 'Äž', - 'ğ' => 'ÄŸ', - 'Ġ' => 'Ä ', - 'ġ' => 'Ä¡', - 'Ģ' => 'Ä¢', - 'ģ' => 'Ä£', - 'HÌ‚' => 'Ĥ', - 'hÌ‚' => 'Ä¥', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'Ä©', - 'IÌ„' => 'Ī', - 'iÌ„' => 'Ä«', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'Ä­', - 'Į' => 'Ä®', - 'į' => 'į', - 'İ' => 'Ä°', - 'JÌ‚' => 'Ä´', - 'jÌ‚' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'Ä·', - 'LÌ' => 'Ĺ', - 'lÌ' => 'ĺ', - 'Ļ' => 'Ä»', - 'ļ' => 'ļ', - 'LÌŒ' => 'Ľ', - 'lÌŒ' => 'ľ', - 'NÌ' => 'Ń', - 'nÌ' => 'Å„', - 'Ņ' => 'Å…', - 'ņ' => 'ņ', - 'NÌŒ' => 'Ň', - 'nÌŒ' => 'ň', - 'OÌ„' => 'ÅŒ', - 'oÌ„' => 'Å', - 'Ŏ' => 'ÅŽ', - 'ŏ' => 'Å', - 'OÌ‹' => 'Å', - 'oÌ‹' => 'Å‘', - 'RÌ' => 'Å”', - 'rÌ' => 'Å•', - 'Ŗ' => 'Å–', - 'ŗ' => 'Å—', - 'RÌŒ' => 'Ř', - 'rÌŒ' => 'Å™', - 'SÌ' => 'Åš', - 'sÌ' => 'Å›', - 'SÌ‚' => 'Åœ', - 'sÌ‚' => 'Å', - 'Ş' => 'Åž', - 'ş' => 'ÅŸ', - 'SÌŒ' => 'Å ', - 'sÌŒ' => 'Å¡', - 'Ţ' => 'Å¢', - 'ţ' => 'Å£', - 'TÌŒ' => 'Ť', - 'tÌŒ' => 'Å¥', - 'Ũ' => 'Ũ', - 'ũ' => 'Å©', - 'UÌ„' => 'Ū', - 'uÌ„' => 'Å«', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'Å­', - 'UÌŠ' => 'Å®', - 'uÌŠ' => 'ů', - 'UÌ‹' => 'Å°', - 'uÌ‹' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'WÌ‚' => 'Å´', - 'wÌ‚' => 'ŵ', - 'YÌ‚' => 'Ŷ', - 'yÌ‚' => 'Å·', - 'Ÿ' => 'Ÿ', - 'ZÌ' => 'Ź', - 'zÌ' => 'ź', - 'Ż' => 'Å»', - 'ż' => 'ż', - 'ZÌŒ' => 'Ž', - 'zÌŒ' => 'ž', - 'OÌ›' => 'Æ ', - 'oÌ›' => 'Æ¡', - 'UÌ›' => 'Ư', - 'uÌ›' => 'Æ°', - 'AÌŒ' => 'Ç', - 'aÌŒ' => 'ÇŽ', - 'IÌŒ' => 'Ç', - 'iÌŒ' => 'Ç', - 'OÌŒ' => 'Ç‘', - 'oÌŒ' => 'Ç’', - 'UÌŒ' => 'Ç“', - 'uÌŒ' => 'Ç”', - 'Ǖ' => 'Ç•', - 'ǖ' => 'Ç–', - 'ÃœÌ' => 'Ç—', - 'üÌ' => 'ǘ', - 'Ǚ' => 'Ç™', - 'ǚ' => 'Çš', - 'Ǜ' => 'Ç›', - 'ǜ' => 'Çœ', - 'Ǟ' => 'Çž', - 'ǟ' => 'ÇŸ', - 'Ǡ' => 'Ç ', - 'ǡ' => 'Ç¡', - 'Ǣ' => 'Ç¢', - 'ǣ' => 'Ç£', - 'GÌŒ' => 'Ǧ', - 'gÌŒ' => 'ǧ', - 'KÌŒ' => 'Ǩ', - 'kÌŒ' => 'Ç©', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'Ç«', - 'Ǭ' => 'Ǭ', - 'Ç«Ì„' => 'Ç­', - 'Æ·ÌŒ' => 'Ç®', - 'Ê’ÌŒ' => 'ǯ', - 'jÌŒ' => 'Ç°', - 'GÌ' => 'Ç´', - 'gÌ' => 'ǵ', - 'NÌ€' => 'Ǹ', - 'nÌ€' => 'ǹ', - 'Ã…Ì' => 'Ǻ', - 'Ã¥Ì' => 'Ç»', - 'ÆÌ' => 'Ǽ', - 'æÌ' => 'ǽ', - 'ØÌ' => 'Ǿ', - 'øÌ' => 'Ç¿', - 'AÌ' => 'È€', - 'aÌ' => 'È', - 'AÌ‘' => 'È‚', - 'aÌ‘' => 'ȃ', - 'EÌ' => 'È„', - 'eÌ' => 'È…', - 'EÌ‘' => 'Ȇ', - 'eÌ‘' => 'ȇ', - 'IÌ' => 'Ȉ', - 'iÌ' => 'ȉ', - 'IÌ‘' => 'ÈŠ', - 'iÌ‘' => 'È‹', - 'OÌ' => 'ÈŒ', - 'oÌ' => 'È', - 'OÌ‘' => 'ÈŽ', - 'oÌ‘' => 'È', - 'RÌ' => 'È', - 'rÌ' => 'È‘', - 'RÌ‘' => 'È’', - 'rÌ‘' => 'È“', - 'UÌ' => 'È”', - 'uÌ' => 'È•', - 'UÌ‘' => 'È–', - 'uÌ‘' => 'È—', - 'Ș' => 'Ș', - 'ș' => 'È™', - 'Ț' => 'Èš', - 'ț' => 'È›', - 'HÌŒ' => 'Èž', - 'hÌŒ' => 'ÈŸ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'È©', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'È«', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'È­', - 'Ȯ' => 'È®', - 'ȯ' => 'ȯ', - 'Ȱ' => 'È°', - 'ȱ' => 'ȱ', - 'YÌ„' => 'Ȳ', - 'yÌ„' => 'ȳ', - '¨Ì' => 'Î…', - 'ΑÌ' => 'Ά', - 'ΕÌ' => 'Έ', - 'ΗÌ' => 'Ή', - 'ΙÌ' => 'Ί', - 'ΟÌ' => 'ÎŒ', - 'Î¥Ì' => 'ÎŽ', - 'ΩÌ' => 'Î', - 'ÏŠÌ' => 'Î', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'αÌ' => 'ά', - 'εÌ' => 'έ', - 'ηÌ' => 'ή', - 'ιÌ' => 'ί', - 'Ï‹Ì' => 'ΰ', - 'ϊ' => 'ÏŠ', - 'ϋ' => 'Ï‹', - 'οÌ' => 'ÏŒ', - 'Ï…Ì' => 'Ï', - 'ωÌ' => 'ÏŽ', - 'Ï’Ì' => 'Ï“', - 'ϔ' => 'Ï”', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ð', - 'ГÌ' => 'Ѓ', - 'Ї' => 'Ї', - 'КÌ' => 'ÐŒ', - 'Ѝ' => 'Ð', - 'Ў' => 'ÐŽ', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'Ñ', - 'ё' => 'Ñ‘', - 'гÌ' => 'Ñ“', - 'ї' => 'Ñ—', - 'кÌ' => 'Ñœ', - 'ѝ' => 'Ñ', - 'ў' => 'Ñž', - 'Ñ´Ì' => 'Ѷ', - 'ѵÌ' => 'Ñ·', - 'Ӂ' => 'Ó', - 'ӂ' => 'Ó‚', - 'Ð̆' => 'Ó', - 'ӑ' => 'Ó‘', - 'Ð̈' => 'Ó’', - 'ӓ' => 'Ó“', - 'Ӗ' => 'Ó–', - 'ӗ' => 'Ó—', - 'Ӛ' => 'Óš', - 'ӛ' => 'Ó›', - 'Ӝ' => 'Óœ', - 'ӝ' => 'Ó', - 'Ӟ' => 'Óž', - 'ӟ' => 'ÓŸ', - 'Ӣ' => 'Ó¢', - 'ӣ' => 'Ó£', - 'Ӥ' => 'Ó¤', - 'ӥ' => 'Ó¥', - 'Ӧ' => 'Ó¦', - 'ӧ' => 'Ó§', - 'Ӫ' => 'Óª', - 'ӫ' => 'Ó«', - 'Ӭ' => 'Ó¬', - 'Ñ̈' => 'Ó­', - 'Ӯ' => 'Ó®', - 'ӯ' => 'Ó¯', - 'Ӱ' => 'Ó°', - 'ӱ' => 'Ó±', - 'Ӳ' => 'Ó²', - 'ӳ' => 'Ó³', - 'Ӵ' => 'Ó´', - 'ӵ' => 'Óµ', - 'Ӹ' => 'Ó¸', - 'ӹ' => 'Ó¹', - 'آ' => 'Ø¢', - 'أ' => 'Ø£', - 'ÙˆÙ”' => 'ؤ', - 'إ' => 'Ø¥', - 'ÙŠÙ”' => 'ئ', - 'Û•Ù”' => 'Û€', - 'ÛÙ”' => 'Û‚', - 'Û’Ù”' => 'Û“', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ୈ' => 'à­ˆ', - 'ୋ' => 'à­‹', - 'ୌ' => 'à­Œ', - 'ஔ' => 'à®”', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'à³€', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'à·š', - 'à·™à·' => 'à·œ', - 'ෝ' => 'à·', - 'ෞ' => 'à·ž', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'á¬á¬µ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'á­€', - 'ᭁ' => 'á­', - 'ᭃ' => 'á­ƒ', - 'AÌ¥' => 'Ḁ', - 'aÌ¥' => 'á¸', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'BÌ£' => 'Ḅ', - 'bÌ£' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'ÇÌ' => 'Ḉ', - 'çÌ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'DÌ£' => 'Ḍ', - 'dÌ£' => 'á¸', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'á¸', - 'Ḑ' => 'á¸', - 'ḑ' => 'ḑ', - 'DÌ­' => 'Ḓ', - 'dÌ­' => 'ḓ', - 'Ä’Ì€' => 'Ḕ', - 'Ä“Ì€' => 'ḕ', - 'Ä’Ì' => 'Ḗ', - 'Ä“Ì' => 'ḗ', - 'EÌ­' => 'Ḙ', - 'eÌ­' => 'ḙ', - 'EÌ°' => 'Ḛ', - 'eÌ°' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'á¸', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'GÌ„' => 'Ḡ', - 'gÌ„' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'HÌ£' => 'Ḥ', - 'hÌ£' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'HÌ®' => 'Ḫ', - 'hÌ®' => 'ḫ', - 'IÌ°' => 'Ḭ', - 'iÌ°' => 'ḭ', - 'ÃÌ' => 'Ḯ', - 'ïÌ' => 'ḯ', - 'KÌ' => 'Ḱ', - 'kÌ' => 'ḱ', - 'KÌ£' => 'Ḳ', - 'kÌ£' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'LÌ£' => 'Ḷ', - 'lÌ£' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'LÌ­' => 'Ḽ', - 'lÌ­' => 'ḽ', - 'MÌ' => 'Ḿ', - 'mÌ' => 'ḿ', - 'Ṁ' => 'á¹€', - 'ṁ' => 'á¹', - 'MÌ£' => 'Ṃ', - 'mÌ£' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'á¹…', - 'NÌ£' => 'Ṇ', - 'nÌ£' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'NÌ­' => 'Ṋ', - 'nÌ­' => 'ṋ', - 'ÕÌ' => 'Ṍ', - 'õÌ' => 'á¹', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'á¹', - 'Ṑ' => 'á¹', - 'ÅÌ€' => 'ṑ', - 'ÅŒÌ' => 'á¹’', - 'ÅÌ' => 'ṓ', - 'PÌ' => 'á¹”', - 'pÌ' => 'ṕ', - 'Ṗ' => 'á¹–', - 'ṗ' => 'á¹—', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'á¹™', - 'RÌ£' => 'Ṛ', - 'rÌ£' => 'á¹›', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'á¹', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'á¹ ', - 'ṡ' => 'ṡ', - 'SÌ£' => 'á¹¢', - 'sÌ£' => 'á¹£', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'á¹¥', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'TÌ£' => 'Ṭ', - 'tÌ£' => 'á¹­', - 'Ṯ' => 'á¹®', - 'ṯ' => 'ṯ', - 'TÌ­' => 'á¹°', - 'tÌ­' => 'á¹±', - 'Ṳ' => 'á¹²', - 'ṳ' => 'á¹³', - 'UÌ°' => 'á¹´', - 'uÌ°' => 'á¹µ', - 'UÌ­' => 'Ṷ', - 'uÌ­' => 'á¹·', - 'ŨÌ' => 'Ṹ', - 'Å©Ì' => 'á¹¹', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'á¹»', - 'Ṽ' => 'á¹¼', - 'ṽ' => 'á¹½', - 'VÌ£' => 'á¹¾', - 'vÌ£' => 'ṿ', - 'WÌ€' => 'Ẁ', - 'wÌ€' => 'áº', - 'WÌ' => 'Ẃ', - 'wÌ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'WÌ£' => 'Ẉ', - 'wÌ£' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'áº', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'áº', - 'ZÌ‚' => 'áº', - 'zÌ‚' => 'ẑ', - 'ZÌ£' => 'Ẓ', - 'zÌ£' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'wÌŠ' => 'ẘ', - 'yÌŠ' => 'ẙ', - 'ẛ' => 'ẛ', - 'AÌ£' => 'Ạ', - 'aÌ£' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'ÂÌ' => 'Ấ', - 'âÌ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ä‚Ì' => 'Ắ', - 'ăÌ' => 'ắ', - 'Ä‚Ì€' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'EÌ£' => 'Ẹ', - 'eÌ£' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'ÊÌ' => 'Ế', - 'êÌ' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'á»', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'á»…', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'IÌ£' => 'Ị', - 'iÌ£' => 'ị', - 'OÌ£' => 'Ọ', - 'oÌ£' => 'á»', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'á»', - 'ÔÌ' => 'á»', - 'ôÌ' => 'ố', - 'Ồ' => 'á»’', - 'ồ' => 'ồ', - 'Ổ' => 'á»”', - 'ổ' => 'ổ', - 'Ỗ' => 'á»–', - 'ỗ' => 'á»—', - 'Ộ' => 'Ộ', - 'á»Ì‚' => 'á»™', - 'Æ Ì' => 'Ớ', - 'Æ¡Ì' => 'á»›', - 'Ờ' => 'Ờ', - 'Æ¡Ì€' => 'á»', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'á» ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'Æ¡Ì£' => 'ợ', - 'UÌ£' => 'Ụ', - 'uÌ£' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'ƯÌ' => 'Ứ', - 'Æ°Ì' => 'ứ', - 'Ừ' => 'Ừ', - 'Æ°Ì€' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'á»­', - 'Ữ' => 'á»®', - 'ữ' => 'ữ', - 'Ự' => 'á»°', - 'Æ°Ì£' => 'á»±', - 'YÌ€' => 'Ỳ', - 'yÌ€' => 'ỳ', - 'YÌ£' => 'á»´', - 'yÌ£' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'á»·', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'á¼€', - 'ἁ' => 'á¼', - 'ἂ' => 'ἂ', - 'á¼Ì€' => 'ἃ', - 'á¼€Ì' => 'ἄ', - 'á¼Ì' => 'á¼…', - 'ἆ' => 'ἆ', - 'á¼Í‚' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'ἈÌ' => 'Ἄ', - 'ἉÌ' => 'á¼', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'á¼', - 'ἐ' => 'á¼', - 'ἑ' => 'ἑ', - 'á¼Ì€' => 'á¼’', - 'ἓ' => 'ἓ', - 'á¼Ì' => 'á¼”', - 'ἑÌ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'á¼™', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'á¼›', - 'ἘÌ' => 'Ἔ', - 'á¼™Ì' => 'á¼', - 'ἠ' => 'á¼ ', - 'ἡ' => 'ἡ', - 'ἢ' => 'á¼¢', - 'ἣ' => 'á¼£', - 'á¼ Ì' => 'ἤ', - 'ἡÌ' => 'á¼¥', - 'á¼ Í‚' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'ἨÌ' => 'Ἤ', - 'ἩÌ' => 'á¼­', - 'Ἦ' => 'á¼®', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'á¼°', - 'ἱ' => 'á¼±', - 'á¼°Ì€' => 'á¼²', - 'ἳ' => 'á¼³', - 'á¼°Ì' => 'á¼´', - 'á¼±Ì' => 'á¼µ', - 'á¼°Í‚' => 'ἶ', - 'ἷ' => 'á¼·', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'á¼¹', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'á¼»', - 'ἸÌ' => 'á¼¼', - 'á¼¹Ì' => 'á¼½', - 'Ἶ' => 'á¼¾', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'á½€', - 'ὁ' => 'á½', - 'ὂ' => 'ὂ', - 'á½Ì€' => 'ὃ', - 'á½€Ì' => 'ὄ', - 'á½Ì' => 'á½…', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'ὈÌ' => 'Ὄ', - 'ὉÌ' => 'á½', - 'Ï…Ì“' => 'á½', - 'Ï…Ì”' => 'ὑ', - 'á½Ì€' => 'á½’', - 'ὓ' => 'ὓ', - 'á½Ì' => 'á½”', - 'ὑÌ' => 'ὕ', - 'á½Í‚' => 'á½–', - 'ὗ' => 'á½—', - 'Ὑ' => 'á½™', - 'Ὓ' => 'á½›', - 'á½™Ì' => 'á½', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'á½ ', - 'ὡ' => 'ὡ', - 'ὢ' => 'á½¢', - 'ὣ' => 'á½£', - 'á½ Ì' => 'ὤ', - 'ὡÌ' => 'á½¥', - 'á½ Í‚' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'ὨÌ' => 'Ὤ', - 'ὩÌ' => 'á½­', - 'Ὦ' => 'á½®', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'á½°', - 'ὲ' => 'á½²', - 'ὴ' => 'á½´', - 'ὶ' => 'ὶ', - 'ὸ' => 'ὸ', - 'Ï…Ì€' => 'ὺ', - 'ὼ' => 'á½¼', - 'ᾀ' => 'á¾€', - 'á¼Í…' => 'á¾', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'á¼…Í…' => 'á¾…', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'á¼Í…' => 'á¾', - 'ᾎ' => 'ᾎ', - 'á¼Í…' => 'á¾', - 'á¼ Í…' => 'á¾', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'á¾’', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'á¾”', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'á¾–', - 'ᾗ' => 'á¾—', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'á¾™', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'á¾›', - 'ᾜ' => 'ᾜ', - 'á¼­Í…' => 'á¾', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'á½ Í…' => 'á¾ ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'á¾¢', - 'ᾣ' => 'á¾£', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'á¾¥', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'á½­Í…' => 'á¾­', - 'ᾮ' => 'á¾®', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'á¾°', - 'ᾱ' => 'á¾±', - 'á½°Í…' => 'á¾²', - 'ᾳ' => 'á¾³', - 'ᾴ' => 'á¾´', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'á¾·', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'á¾¹', - 'Ὰ' => 'Ὰ', - 'ᾼ' => 'á¾¼', - '῁' => 'á¿', - 'á½´Í…' => 'á¿‚', - 'ῃ' => 'ῃ', - 'ῄ' => 'á¿„', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Ὴ' => 'á¿Š', - 'ῌ' => 'á¿Œ', - '῍' => 'á¿', - '᾿Ì' => 'á¿Ž', - '῏' => 'á¿', - 'ῐ' => 'á¿', - 'ῑ' => 'á¿‘', - 'ÏŠÌ€' => 'á¿’', - 'ῖ' => 'á¿–', - 'ÏŠÍ‚' => 'á¿—', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'á¿™', - 'Ὶ' => 'á¿š', - '῝' => 'á¿', - '῾Ì' => 'á¿ž', - '῟' => 'á¿Ÿ', - 'ῠ' => 'á¿ ', - 'Ï…Ì„' => 'á¿¡', - 'Ï‹Ì€' => 'á¿¢', - 'ÏÌ“' => 'ῤ', - 'ÏÌ”' => 'á¿¥', - 'Ï…Í‚' => 'ῦ', - 'Ï‹Í‚' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'á¿©', - 'Ὺ' => 'Ὺ', - 'Ῥ' => 'Ῥ', - '῭' => 'á¿­', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ÏŽÍ…' => 'á¿´', - 'ῶ' => 'ῶ', - 'ῷ' => 'á¿·', - 'Ὸ' => 'Ὸ', - 'Ὼ' => 'Ὼ', - 'ῼ' => 'ῼ', - 'â†Ì¸' => '↚', - '↛' => '↛', - '↮' => '↮', - 'â‡Ì¸' => 'â‡', - '⇎' => '⇎', - '⇏' => 'â‡', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => 'â‰', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - 'â‰Ì¸' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => 'âŠ', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => 'â‹ ', - '⋡' => 'â‹¡', - '⋢' => 'â‹¢', - '⋣' => 'â‹£', - '⋪' => '⋪', - '⋫' => 'â‹«', - '⋬' => '⋬', - '⋭' => 'â‹­', - 'ã‹ã‚™' => 'ãŒ', - 'ãã‚™' => 'ãŽ', - 'ãã‚™' => 'ã', - 'ã‘ã‚™' => 'ã’', - 'ã“ã‚™' => 'ã”', - 'ã•ã‚™' => 'ã–', - 'ã—ã‚™' => 'ã˜', - 'ã™ã‚™' => 'ãš', - 'ã›ã‚™' => 'ãœ', - 'ãã‚™' => 'ãž', - 'ãŸã‚™' => 'ã ', - 'ã¡ã‚™' => 'ã¢', - 'ã¤ã‚™' => 'ã¥', - 'ã¦ã‚™' => 'ã§', - 'ã¨ã‚™' => 'ã©', - 'ã¯ã‚™' => 'ã°', - 'ã¯ã‚š' => 'ã±', - 'ã²ã‚™' => 'ã³', - 'ã²ã‚š' => 'ã´', - 'ãµã‚™' => 'ã¶', - 'ãµã‚š' => 'ã·', - 'ã¸ã‚™' => 'ã¹', - 'ã¸ã‚š' => 'ãº', - 'ã»ã‚™' => 'ã¼', - 'ã»ã‚š' => 'ã½', - 'ã†ã‚™' => 'ã‚”', - 'ã‚ã‚™' => 'ã‚ž', - 'ã‚«ã‚™' => 'ガ', - 'ã‚­ã‚™' => 'ã‚®', - 'グ' => 'ã‚°', - 'ゲ' => 'ゲ', - 'ゴ' => 'ã‚´', - 'ザ' => 'ザ', - 'ã‚·ã‚™' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ã‚¿ã‚™' => 'ダ', - 'ãƒã‚™' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'ãƒã‚™' => 'ãƒ', - 'ãƒã‚š' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ãƒ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '𑂚' => 'ð‘‚š', - '𑂜' => 'ð‘‚œ', - '𑂫' => 'ð‘‚«', - '𑄮' => 'ð‘„®', - '𑄯' => '𑄯', - 'ð‘‡ð‘Œ¾' => 'ð‘‹', - 'ð‘‡ð‘—' => 'ð‘Œ', - '𑒻' => 'ð‘’»', - '𑒼' => 'ð‘’¼', - '𑒾' => 'ð‘’¾', - '𑖺' => 'ð‘–º', - '𑖻' => 'ð‘–»', - '𑤸' => '𑤸', -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php deleted file mode 100644 index 5a3e8e0969d..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php +++ /dev/null @@ -1,2065 +0,0 @@ - 'AÌ€', - 'Ã' => 'AÌ', - 'Â' => 'AÌ‚', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Ã…' => 'AÌŠ', - 'Ç' => 'Ç', - 'È' => 'EÌ€', - 'É' => 'EÌ', - 'Ê' => 'EÌ‚', - 'Ë' => 'Ë', - 'ÃŒ' => 'IÌ€', - 'Ã' => 'IÌ', - 'ÃŽ' => 'IÌ‚', - 'Ã' => 'Ï', - 'Ñ' => 'Ñ', - 'Ã’' => 'OÌ€', - 'Ó' => 'OÌ', - 'Ô' => 'OÌ‚', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'UÌ€', - 'Ú' => 'UÌ', - 'Û' => 'UÌ‚', - 'Ãœ' => 'Ü', - 'Ã' => 'YÌ', - 'à' => 'aÌ€', - 'á' => 'aÌ', - 'â' => 'aÌ‚', - 'ã' => 'ã', - 'ä' => 'ä', - 'Ã¥' => 'aÌŠ', - 'ç' => 'ç', - 'è' => 'eÌ€', - 'é' => 'eÌ', - 'ê' => 'eÌ‚', - 'ë' => 'ë', - 'ì' => 'iÌ€', - 'í' => 'iÌ', - 'î' => 'iÌ‚', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'oÌ€', - 'ó' => 'oÌ', - 'ô' => 'oÌ‚', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'uÌ€', - 'ú' => 'uÌ', - 'û' => 'uÌ‚', - 'ü' => 'ü', - 'ý' => 'yÌ', - 'ÿ' => 'ÿ', - 'Ä€' => 'AÌ„', - 'Ä' => 'aÌ„', - 'Ä‚' => 'Ă', - 'ă' => 'ă', - 'Ä„' => 'Ą', - 'Ä…' => 'ą', - 'Ć' => 'CÌ', - 'ć' => 'cÌ', - 'Ĉ' => 'CÌ‚', - 'ĉ' => 'cÌ‚', - 'ÄŠ' => 'Ċ', - 'Ä‹' => 'ċ', - 'ÄŒ' => 'CÌŒ', - 'Ä' => 'cÌŒ', - 'ÄŽ' => 'DÌŒ', - 'Ä' => 'dÌŒ', - 'Ä’' => 'EÌ„', - 'Ä“' => 'eÌ„', - 'Ä”' => 'Ĕ', - 'Ä•' => 'ĕ', - 'Ä–' => 'Ė', - 'Ä—' => 'ė', - 'Ę' => 'Ę', - 'Ä™' => 'ę', - 'Äš' => 'EÌŒ', - 'Ä›' => 'eÌŒ', - 'Äœ' => 'GÌ‚', - 'Ä' => 'gÌ‚', - 'Äž' => 'Ğ', - 'ÄŸ' => 'ğ', - 'Ä ' => 'Ġ', - 'Ä¡' => 'ġ', - 'Ä¢' => 'Ģ', - 'Ä£' => 'ģ', - 'Ĥ' => 'HÌ‚', - 'Ä¥' => 'hÌ‚', - 'Ĩ' => 'Ĩ', - 'Ä©' => 'ĩ', - 'Ī' => 'IÌ„', - 'Ä«' => 'iÌ„', - 'Ĭ' => 'Ĭ', - 'Ä­' => 'ĭ', - 'Ä®' => 'Į', - 'į' => 'į', - 'Ä°' => 'İ', - 'Ä´' => 'JÌ‚', - 'ĵ' => 'jÌ‚', - 'Ķ' => 'Ķ', - 'Ä·' => 'ķ', - 'Ĺ' => 'LÌ', - 'ĺ' => 'lÌ', - 'Ä»' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'LÌŒ', - 'ľ' => 'lÌŒ', - 'Ń' => 'NÌ', - 'Å„' => 'nÌ', - 'Å…' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'NÌŒ', - 'ň' => 'nÌŒ', - 'ÅŒ' => 'OÌ„', - 'Å' => 'oÌ„', - 'ÅŽ' => 'Ŏ', - 'Å' => 'ŏ', - 'Å' => 'OÌ‹', - 'Å‘' => 'oÌ‹', - 'Å”' => 'RÌ', - 'Å•' => 'rÌ', - 'Å–' => 'Ŗ', - 'Å—' => 'ŗ', - 'Ř' => 'RÌŒ', - 'Å™' => 'rÌŒ', - 'Åš' => 'SÌ', - 'Å›' => 'sÌ', - 'Åœ' => 'SÌ‚', - 'Å' => 'sÌ‚', - 'Åž' => 'Ş', - 'ÅŸ' => 'ş', - 'Å ' => 'SÌŒ', - 'Å¡' => 'sÌŒ', - 'Å¢' => 'Ţ', - 'Å£' => 'ţ', - 'Ť' => 'TÌŒ', - 'Å¥' => 'tÌŒ', - 'Ũ' => 'Ũ', - 'Å©' => 'ũ', - 'Ū' => 'UÌ„', - 'Å«' => 'uÌ„', - 'Ŭ' => 'Ŭ', - 'Å­' => 'ŭ', - 'Å®' => 'UÌŠ', - 'ů' => 'uÌŠ', - 'Å°' => 'UÌ‹', - 'ű' => 'uÌ‹', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Å´' => 'WÌ‚', - 'ŵ' => 'wÌ‚', - 'Ŷ' => 'YÌ‚', - 'Å·' => 'yÌ‚', - 'Ÿ' => 'Ÿ', - 'Ź' => 'ZÌ', - 'ź' => 'zÌ', - 'Å»' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'ZÌŒ', - 'ž' => 'zÌŒ', - 'Æ ' => 'OÌ›', - 'Æ¡' => 'oÌ›', - 'Ư' => 'UÌ›', - 'Æ°' => 'uÌ›', - 'Ç' => 'AÌŒ', - 'ÇŽ' => 'aÌŒ', - 'Ç' => 'IÌŒ', - 'Ç' => 'iÌŒ', - 'Ç‘' => 'OÌŒ', - 'Ç’' => 'oÌŒ', - 'Ç“' => 'UÌŒ', - 'Ç”' => 'uÌŒ', - 'Ç•' => 'Ǖ', - 'Ç–' => 'ǖ', - 'Ç—' => 'ÜÌ', - 'ǘ' => 'üÌ', - 'Ç™' => 'Ǚ', - 'Çš' => 'ǚ', - 'Ç›' => 'Ǜ', - 'Çœ' => 'ǜ', - 'Çž' => 'Ǟ', - 'ÇŸ' => 'ǟ', - 'Ç ' => 'Ǡ', - 'Ç¡' => 'ǡ', - 'Ç¢' => 'Ǣ', - 'Ç£' => 'ǣ', - 'Ǧ' => 'GÌŒ', - 'ǧ' => 'gÌŒ', - 'Ǩ' => 'KÌŒ', - 'Ç©' => 'kÌŒ', - 'Ǫ' => 'Ǫ', - 'Ç«' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'Ç­' => 'ǭ', - 'Ç®' => 'Æ·ÌŒ', - 'ǯ' => 'Ê’ÌŒ', - 'Ç°' => 'jÌŒ', - 'Ç´' => 'GÌ', - 'ǵ' => 'gÌ', - 'Ǹ' => 'NÌ€', - 'ǹ' => 'nÌ€', - 'Ǻ' => 'AÌŠÌ', - 'Ç»' => 'aÌŠÌ', - 'Ǽ' => 'ÆÌ', - 'ǽ' => 'æÌ', - 'Ǿ' => 'ØÌ', - 'Ç¿' => 'øÌ', - 'È€' => 'AÌ', - 'È' => 'aÌ', - 'È‚' => 'AÌ‘', - 'ȃ' => 'aÌ‘', - 'È„' => 'EÌ', - 'È…' => 'eÌ', - 'Ȇ' => 'EÌ‘', - 'ȇ' => 'eÌ‘', - 'Ȉ' => 'IÌ', - 'ȉ' => 'iÌ', - 'ÈŠ' => 'IÌ‘', - 'È‹' => 'iÌ‘', - 'ÈŒ' => 'OÌ', - 'È' => 'oÌ', - 'ÈŽ' => 'OÌ‘', - 'È' => 'oÌ‘', - 'È' => 'RÌ', - 'È‘' => 'rÌ', - 'È’' => 'RÌ‘', - 'È“' => 'rÌ‘', - 'È”' => 'UÌ', - 'È•' => 'uÌ', - 'È–' => 'UÌ‘', - 'È—' => 'uÌ‘', - 'Ș' => 'Ș', - 'È™' => 'ș', - 'Èš' => 'Ț', - 'È›' => 'ț', - 'Èž' => 'HÌŒ', - 'ÈŸ' => 'hÌŒ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'È©' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'È«' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'È­' => 'ȭ', - 'È®' => 'Ȯ', - 'ȯ' => 'ȯ', - 'È°' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'YÌ„', - 'ȳ' => 'yÌ„', - 'Í€' => 'Ì€', - 'Í' => 'Ì', - '̓' => 'Ì“', - 'Í„' => '̈Ì', - 'Í´' => 'ʹ', - ';' => ';', - 'Î…' => '¨Ì', - 'Ά' => 'ΑÌ', - '·' => '·', - 'Έ' => 'ΕÌ', - 'Ή' => 'ΗÌ', - 'Ί' => 'ΙÌ', - 'ÎŒ' => 'ΟÌ', - 'ÎŽ' => 'Î¥Ì', - 'Î' => 'ΩÌ', - 'Î' => 'ϊÌ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'αÌ', - 'έ' => 'εÌ', - 'ή' => 'ηÌ', - 'ί' => 'ιÌ', - 'ΰ' => 'ϋÌ', - 'ÏŠ' => 'ϊ', - 'Ï‹' => 'ϋ', - 'ÏŒ' => 'οÌ', - 'Ï' => 'Ï…Ì', - 'ÏŽ' => 'ωÌ', - 'Ï“' => 'Ï’Ì', - 'Ï”' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ð' => 'Ё', - 'Ѓ' => 'ГÌ', - 'Ї' => 'Ї', - 'ÐŒ' => 'КÌ', - 'Ð' => 'Ѝ', - 'ÐŽ' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'Ñ' => 'ѐ', - 'Ñ‘' => 'ё', - 'Ñ“' => 'гÌ', - 'Ñ—' => 'ї', - 'Ñœ' => 'кÌ', - 'Ñ' => 'ѝ', - 'Ñž' => 'ў', - 'Ѷ' => 'Ñ´Ì', - 'Ñ·' => 'ѵÌ', - 'Ó' => 'Ӂ', - 'Ó‚' => 'ӂ', - 'Ó' => 'Ð̆', - 'Ó‘' => 'ӑ', - 'Ó’' => 'Ð̈', - 'Ó“' => 'ӓ', - 'Ó–' => 'Ӗ', - 'Ó—' => 'ӗ', - 'Óš' => 'Ӛ', - 'Ó›' => 'ӛ', - 'Óœ' => 'Ӝ', - 'Ó' => 'ӝ', - 'Óž' => 'Ӟ', - 'ÓŸ' => 'ӟ', - 'Ó¢' => 'Ӣ', - 'Ó£' => 'ӣ', - 'Ó¤' => 'Ӥ', - 'Ó¥' => 'ӥ', - 'Ó¦' => 'Ӧ', - 'Ó§' => 'ӧ', - 'Óª' => 'Ӫ', - 'Ó«' => 'ӫ', - 'Ó¬' => 'Ӭ', - 'Ó­' => 'Ñ̈', - 'Ó®' => 'Ӯ', - 'Ó¯' => 'ӯ', - 'Ó°' => 'Ӱ', - 'Ó±' => 'ӱ', - 'Ó²' => 'Ӳ', - 'Ó³' => 'ӳ', - 'Ó´' => 'Ӵ', - 'Óµ' => 'ӵ', - 'Ó¸' => 'Ӹ', - 'Ó¹' => 'ӹ', - 'Ø¢' => 'آ', - 'Ø£' => 'أ', - 'ؤ' => 'ÙˆÙ”', - 'Ø¥' => 'إ', - 'ئ' => 'ÙŠÙ”', - 'Û€' => 'Û•Ù”', - 'Û‚' => 'ÛÙ”', - 'Û“' => 'Û’Ù”', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'क़' => 'क़', - 'ख़' => 'ख़', - 'ग़' => 'ग़', - 'ज़' => 'ज़', - 'ड़' => 'ड़', - 'à¥' => 'ढ़', - 'फ़' => 'फ़', - 'य़' => 'य़', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ড়' => 'ড়', - 'à§' => 'ঢ়', - 'য়' => 'য়', - 'ਲ਼' => 'ਲ਼', - 'ਸ਼' => 'ਸ਼', - 'à©™' => 'ਖ਼', - 'à©š' => 'ਗ਼', - 'à©›' => 'ਜ਼', - 'à©ž' => 'ਫ਼', - 'à­ˆ' => 'ୈ', - 'à­‹' => 'ୋ', - 'à­Œ' => 'ୌ', - 'à­œ' => 'ଡ଼', - 'à­' => 'ଢ଼', - 'à®”' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'à³€' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'à·š' => 'ේ', - 'à·œ' => 'à·™à·', - 'à·' => 'à·™à·à·Š', - 'à·ž' => 'ෞ', - 'གྷ' => 'གྷ', - 'à½' => 'ཌྷ', - 'དྷ' => 'དྷ', - 'བྷ' => 'བྷ', - 'ཛྷ' => 'ཛྷ', - 'ཀྵ' => 'ཀྵ', - 'ཱི' => 'ཱི', - 'ཱུ' => 'ཱུ', - 'ྲྀ' => 'ྲྀ', - 'ླྀ' => 'ླྀ', - 'à¾' => 'ཱྀ', - 'ྒྷ' => 'ྒྷ', - 'à¾' => 'ྜྷ', - 'ྡྷ' => 'ྡྷ', - 'ྦྷ' => 'ྦྷ', - 'ྫྷ' => 'ྫྷ', - 'ྐྵ' => 'à¾à¾µ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'á¬á¬µ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'á­€' => 'ᭀ', - 'á­' => 'ᭁ', - 'á­ƒ' => 'ᭃ', - 'Ḁ' => 'AÌ¥', - 'á¸' => 'aÌ¥', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'BÌ£', - 'ḅ' => 'bÌ£', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'ÇÌ', - 'ḉ' => 'çÌ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'DÌ£', - 'á¸' => 'dÌ£', - 'Ḏ' => 'Ḏ', - 'á¸' => 'ḏ', - 'á¸' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'DÌ­', - 'ḓ' => 'dÌ­', - 'Ḕ' => 'EÌ„Ì€', - 'ḕ' => 'eÌ„Ì€', - 'Ḗ' => 'EÌ„Ì', - 'ḗ' => 'eÌ„Ì', - 'Ḙ' => 'EÌ­', - 'ḙ' => 'eÌ­', - 'Ḛ' => 'EÌ°', - 'ḛ' => 'eÌ°', - 'Ḝ' => 'Ḝ', - 'á¸' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'GÌ„', - 'ḡ' => 'gÌ„', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'HÌ£', - 'ḥ' => 'hÌ£', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'HÌ®', - 'ḫ' => 'hÌ®', - 'Ḭ' => 'IÌ°', - 'ḭ' => 'iÌ°', - 'Ḯ' => 'ÏÌ', - 'ḯ' => 'ïÌ', - 'Ḱ' => 'KÌ', - 'ḱ' => 'kÌ', - 'Ḳ' => 'KÌ£', - 'ḳ' => 'kÌ£', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'LÌ£', - 'ḷ' => 'lÌ£', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'LÌ­', - 'ḽ' => 'lÌ­', - 'Ḿ' => 'MÌ', - 'ḿ' => 'mÌ', - 'á¹€' => 'Ṁ', - 'á¹' => 'ṁ', - 'Ṃ' => 'MÌ£', - 'ṃ' => 'mÌ£', - 'Ṅ' => 'Ṅ', - 'á¹…' => 'ṅ', - 'Ṇ' => 'NÌ£', - 'ṇ' => 'nÌ£', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'NÌ­', - 'ṋ' => 'nÌ­', - 'Ṍ' => 'ÕÌ', - 'á¹' => 'õÌ', - 'Ṏ' => 'Ṏ', - 'á¹' => 'ṏ', - 'á¹' => 'OÌ„Ì€', - 'ṑ' => 'oÌ„Ì€', - 'á¹’' => 'OÌ„Ì', - 'ṓ' => 'oÌ„Ì', - 'á¹”' => 'PÌ', - 'ṕ' => 'pÌ', - 'á¹–' => 'Ṗ', - 'á¹—' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'á¹™' => 'ṙ', - 'Ṛ' => 'RÌ£', - 'á¹›' => 'rÌ£', - 'Ṝ' => 'Ṝ', - 'á¹' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'á¹ ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'á¹¢' => 'SÌ£', - 'á¹£' => 'sÌ£', - 'Ṥ' => 'SÌ̇', - 'á¹¥' => 'sÌ̇', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'TÌ£', - 'á¹­' => 'tÌ£', - 'á¹®' => 'Ṯ', - 'ṯ' => 'ṯ', - 'á¹°' => 'TÌ­', - 'á¹±' => 'tÌ­', - 'á¹²' => 'Ṳ', - 'á¹³' => 'ṳ', - 'á¹´' => 'UÌ°', - 'á¹µ' => 'uÌ°', - 'Ṷ' => 'UÌ­', - 'á¹·' => 'uÌ­', - 'Ṹ' => 'ŨÌ', - 'á¹¹' => 'ũÌ', - 'Ṻ' => 'Ṻ', - 'á¹»' => 'ṻ', - 'á¹¼' => 'Ṽ', - 'á¹½' => 'ṽ', - 'á¹¾' => 'VÌ£', - 'ṿ' => 'vÌ£', - 'Ẁ' => 'WÌ€', - 'áº' => 'wÌ€', - 'Ẃ' => 'WÌ', - 'ẃ' => 'wÌ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'WÌ£', - 'ẉ' => 'wÌ£', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'áº' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'áº' => 'ẏ', - 'áº' => 'ZÌ‚', - 'ẑ' => 'zÌ‚', - 'Ẓ' => 'ZÌ£', - 'ẓ' => 'zÌ£', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'wÌŠ', - 'ẙ' => 'yÌŠ', - 'ẛ' => 'ẛ', - 'Ạ' => 'AÌ£', - 'ạ' => 'aÌ£', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'AÌ‚Ì', - 'ấ' => 'aÌ‚Ì', - 'Ầ' => 'AÌ‚Ì€', - 'ầ' => 'aÌ‚Ì€', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'ĂÌ', - 'ắ' => 'ăÌ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'EÌ£', - 'ẹ' => 'eÌ£', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'EÌ‚Ì', - 'ế' => 'eÌ‚Ì', - 'Ề' => 'EÌ‚Ì€', - 'á»' => 'eÌ‚Ì€', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'á»…' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'IÌ£', - 'ị' => 'iÌ£', - 'Ọ' => 'OÌ£', - 'á»' => 'oÌ£', - 'Ỏ' => 'Ỏ', - 'á»' => 'ỏ', - 'á»' => 'OÌ‚Ì', - 'ố' => 'oÌ‚Ì', - 'á»’' => 'OÌ‚Ì€', - 'ồ' => 'oÌ‚Ì€', - 'á»”' => 'Ổ', - 'ổ' => 'ổ', - 'á»–' => 'Ỗ', - 'á»—' => 'ỗ', - 'Ộ' => 'Ộ', - 'á»™' => 'ộ', - 'Ớ' => 'OÌ›Ì', - 'á»›' => 'oÌ›Ì', - 'Ờ' => 'Ờ', - 'á»' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'á» ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'UÌ£', - 'ụ' => 'uÌ£', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'UÌ›Ì', - 'ứ' => 'uÌ›Ì', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'á»­' => 'ử', - 'á»®' => 'Ữ', - 'ữ' => 'ữ', - 'á»°' => 'Ự', - 'á»±' => 'ự', - 'Ỳ' => 'YÌ€', - 'ỳ' => 'yÌ€', - 'á»´' => 'YÌ£', - 'ỵ' => 'yÌ£', - 'Ỷ' => 'Ỷ', - 'á»·' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'á¼€' => 'ἀ', - 'á¼' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἀÌ', - 'á¼…' => 'ἁÌ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'ἈÌ', - 'á¼' => 'ἉÌ', - 'Ἆ' => 'Ἆ', - 'á¼' => 'Ἇ', - 'á¼' => 'ἐ', - 'ἑ' => 'ἑ', - 'á¼’' => 'ἒ', - 'ἓ' => 'ἓ', - 'á¼”' => 'ἐÌ', - 'ἕ' => 'ἑÌ', - 'Ἐ' => 'Ἐ', - 'á¼™' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'á¼›' => 'Ἓ', - 'Ἔ' => 'ἘÌ', - 'á¼' => 'ἙÌ', - 'á¼ ' => 'ἠ', - 'ἡ' => 'ἡ', - 'á¼¢' => 'ἢ', - 'á¼£' => 'ἣ', - 'ἤ' => 'ἠÌ', - 'á¼¥' => 'ἡÌ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'ἨÌ', - 'á¼­' => 'ἩÌ', - 'á¼®' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'á¼°' => 'ἰ', - 'á¼±' => 'ἱ', - 'á¼²' => 'ἲ', - 'á¼³' => 'ἳ', - 'á¼´' => 'ἰÌ', - 'á¼µ' => 'ἱÌ', - 'ἶ' => 'ἶ', - 'á¼·' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'á¼¹' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'á¼»' => 'Ἳ', - 'á¼¼' => 'ἸÌ', - 'á¼½' => 'ἹÌ', - 'á¼¾' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'á½€' => 'ὀ', - 'á½' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὀÌ', - 'á½…' => 'ὁÌ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'ὈÌ', - 'á½' => 'ὉÌ', - 'á½' => 'Ï…Ì“', - 'ὑ' => 'Ï…Ì”', - 'á½’' => 'Ï…Ì“Ì€', - 'ὓ' => 'ὓ', - 'á½”' => 'Ï…Ì“Ì', - 'ὕ' => 'Ï…Ì”Ì', - 'á½–' => 'Ï…Ì“Í‚', - 'á½—' => 'ὗ', - 'á½™' => 'Ὑ', - 'á½›' => 'Ὓ', - 'á½' => 'ὙÌ', - 'Ὗ' => 'Ὗ', - 'á½ ' => 'ὠ', - 'ὡ' => 'ὡ', - 'á½¢' => 'ὢ', - 'á½£' => 'ὣ', - 'ὤ' => 'ὠÌ', - 'á½¥' => 'ὡÌ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'ὨÌ', - 'á½­' => 'ὩÌ', - 'á½®' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'á½°' => 'ὰ', - 'á½±' => 'αÌ', - 'á½²' => 'ὲ', - 'á½³' => 'εÌ', - 'á½´' => 'ὴ', - 'á½µ' => 'ηÌ', - 'ὶ' => 'ὶ', - 'á½·' => 'ιÌ', - 'ὸ' => 'ὸ', - 'á½¹' => 'οÌ', - 'ὺ' => 'Ï…Ì€', - 'á½»' => 'Ï…Ì', - 'á½¼' => 'ὼ', - 'á½½' => 'ωÌ', - 'á¾€' => 'ᾀ', - 'á¾' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ἀÌÍ…', - 'á¾…' => 'ἁÌÍ…', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ἈÌÍ…', - 'á¾' => 'ἉÌÍ…', - 'ᾎ' => 'ᾎ', - 'á¾' => 'ᾏ', - 'á¾' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'á¾’' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'á¾”' => 'ἠÌÍ…', - 'ᾕ' => 'ἡÌÍ…', - 'á¾–' => 'ᾖ', - 'á¾—' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'á¾™' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'á¾›' => 'ᾛ', - 'ᾜ' => 'ἨÌÍ…', - 'á¾' => 'ἩÌÍ…', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'á¾ ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'á¾¢' => 'ᾢ', - 'á¾£' => 'ᾣ', - 'ᾤ' => 'ὠÌÍ…', - 'á¾¥' => 'ὡÌÍ…', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ὨÌÍ…', - 'á¾­' => 'ὩÌÍ…', - 'á¾®' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'á¾°' => 'ᾰ', - 'á¾±' => 'ᾱ', - 'á¾²' => 'ᾲ', - 'á¾³' => 'ᾳ', - 'á¾´' => 'αÌÍ…', - 'ᾶ' => 'ᾶ', - 'á¾·' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'á¾¹' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'á¾»' => 'ΑÌ', - 'á¾¼' => 'ᾼ', - 'á¾¾' => 'ι', - 'á¿' => '῁', - 'á¿‚' => 'ῂ', - 'ῃ' => 'ῃ', - 'á¿„' => 'ηÌÍ…', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Έ' => 'ΕÌ', - 'á¿Š' => 'Ὴ', - 'á¿‹' => 'ΗÌ', - 'á¿Œ' => 'ῌ', - 'á¿' => '῍', - 'á¿Ž' => '᾿Ì', - 'á¿' => '῏', - 'á¿' => 'ῐ', - 'á¿‘' => 'ῑ', - 'á¿’' => 'ῒ', - 'á¿“' => 'ϊÌ', - 'á¿–' => 'ῖ', - 'á¿—' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'á¿™' => 'Ῑ', - 'á¿š' => 'Ὶ', - 'á¿›' => 'ΙÌ', - 'á¿' => '῝', - 'á¿ž' => '῾Ì', - 'á¿Ÿ' => '῟', - 'á¿ ' => 'ῠ', - 'á¿¡' => 'Ï…Ì„', - 'á¿¢' => 'ῢ', - 'á¿£' => 'ϋÌ', - 'ῤ' => 'ÏÌ“', - 'á¿¥' => 'ÏÌ”', - 'ῦ' => 'Ï…Í‚', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'á¿©' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'á¿«' => 'Î¥Ì', - 'Ῥ' => 'Ῥ', - 'á¿­' => '῭', - 'á¿®' => '¨Ì', - '`' => '`', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'á¿´' => 'ωÌÍ…', - 'ῶ' => 'ῶ', - 'á¿·' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ό' => 'ΟÌ', - 'Ὼ' => 'Ὼ', - 'á¿»' => 'ΩÌ', - 'ῼ' => 'ῼ', - '´' => '´', - ' ' => ' ', - 'â€' => ' ', - 'Ω' => 'Ω', - 'K' => 'K', - 'â„«' => 'AÌŠ', - '↚' => 'â†Ì¸', - '↛' => '↛', - '↮' => '↮', - 'â‡' => 'â‡Ì¸', - '⇎' => '⇎', - 'â‡' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - 'â‰' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => 'â‰Ì¸', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - 'âŠ' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - 'â‹ ' => '⋠', - 'â‹¡' => '⋡', - 'â‹¢' => '⋢', - 'â‹£' => '⋣', - '⋪' => '⋪', - 'â‹«' => '⋫', - '⋬' => '⋬', - 'â‹­' => '⋭', - '〈' => '〈', - '〉' => '〉', - 'â«œ' => 'â«Ì¸', - 'ãŒ' => 'ã‹ã‚™', - 'ãŽ' => 'ãã‚™', - 'ã' => 'ãã‚™', - 'ã’' => 'ã‘ã‚™', - 'ã”' => 'ã“ã‚™', - 'ã–' => 'ã•ã‚™', - 'ã˜' => 'ã—ã‚™', - 'ãš' => 'ã™ã‚™', - 'ãœ' => 'ã›ã‚™', - 'ãž' => 'ãã‚™', - 'ã ' => 'ãŸã‚™', - 'ã¢' => 'ã¡ã‚™', - 'ã¥' => 'ã¤ã‚™', - 'ã§' => 'ã¦ã‚™', - 'ã©' => 'ã¨ã‚™', - 'ã°' => 'ã¯ã‚™', - 'ã±' => 'ã¯ã‚š', - 'ã³' => 'ã²ã‚™', - 'ã´' => 'ã²ã‚š', - 'ã¶' => 'ãµã‚™', - 'ã·' => 'ãµã‚š', - 'ã¹' => 'ã¸ã‚™', - 'ãº' => 'ã¸ã‚š', - 'ã¼' => 'ã»ã‚™', - 'ã½' => 'ã»ã‚š', - 'ã‚”' => 'ã†ã‚™', - 'ã‚ž' => 'ã‚ã‚™', - 'ガ' => 'ã‚«ã‚™', - 'ã‚®' => 'ã‚­ã‚™', - 'ã‚°' => 'グ', - 'ゲ' => 'ゲ', - 'ã‚´' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ã‚·ã‚™', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ã‚¿ã‚™', - 'ヂ' => 'ãƒã‚™', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'ãƒ' => 'ãƒã‚™', - 'パ' => 'ãƒã‚š', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ãƒ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '豈' => '豈', - 'ï¤' => 'æ›´', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => 'å¥', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => 'å–‡', - '奈' => '奈', - 'ï¤' => '懶', - '癩' => '癩', - 'ï¤' => 'ç¾…', - 'ï¤' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => 'é‚', - '樂' => '樂', - '洛' => 'æ´›', - '烙' => '烙', - '珞' => 'çž', - '落' => 'è½', - '酪' => 'é…ª', - '駱' => '駱', - '亂' => '亂', - '卵' => 'åµ', - 'ï¤' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => 'åµ', - '濫' => 'æ¿«', - '藍' => 'è—', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => 'è Ÿ', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => 'å‹ž', - '擄' => 'æ“„', - '櫓' => 'æ«“', - '爐' => 'çˆ', - '盧' => '盧', - '老' => 'è€', - '蘆' => '蘆', - '虜' => '虜', - '路' => 'è·¯', - '露' => '露', - '魯' => 'é­¯', - '鷺' => 'é·º', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => 'è‰', - '錄' => '錄', - '鹿' => '鹿', - 'ï¥' => 'è«–', - '壟' => '壟', - '弄' => '弄', - '籠' => 'ç± ', - '聾' => 'è¾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => 'é›·', - '壘' => '壘', - '屢' => 'å±¢', - '樓' => '樓', - 'ï¥' => 'æ·š', - '漏' => 'æ¼', - 'ï¥' => 'ç´¯', - 'ï¥' => '縷', - '陋' => '陋', - '勒' => 'å‹’', - '肋' => 'è‚‹', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => 'è±', - '陵' => '陵', - '讀' => '讀', - '拏' => 'æ‹', - '樂' => '樂', - 'ï¥' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => 'ç•°', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => 'ä¸', - '泌' => '泌', - '數' => '數', - '索' => 'ç´¢', - '參' => 'åƒ', - '塞' => 'å¡ž', - '省' => 'çœ', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => 'è¾°', - '沈' => '沈', - '拾' => '拾', - '若' => 'è‹¥', - '掠' => '掠', - '略' => 'ç•¥', - '亮' => '亮', - '兩' => 'å…©', - '凉' => '凉', - '梁' => 'æ¢', - '糧' => '糧', - '良' => '良', - '諒' => 'è«’', - '量' => 'é‡', - '勵' => '勵', - '呂' => 'å‘‚', - 'ï¦' => '女', - '廬' => '廬', - '旅' => 'æ—…', - '濾' => '濾', - '礪' => '礪', - '閭' => 'é–­', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => 'æ­·', - 'ï¦' => 'è½¢', - '年' => 'å¹´', - 'ï¦' => 'æ†', - 'ï¦' => '戀', - '撚' => 'æ’š', - '漣' => 'æ¼£', - '煉' => 'ç…‰', - '璉' => 'ç’‰', - '秊' => '秊', - '練' => 'ç·´', - '聯' => 'è¯', - '輦' => '輦', - '蓮' => 'è“®', - '連' => '連', - '鍊' => 'éŠ', - '列' => '列', - 'ï¦' => '劣', - '咽' => 'å’½', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => 'æ»', - '殮' => 'æ®®', - '簾' => 'ç°¾', - '獵' => 'çµ', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => 'ç‘©', - '羚' => '羚', - '聆' => 'è†', - '鈴' => '鈴', - '零' => '零', - '靈' => 'éˆ', - '領' => 'é ˜', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => 'å°¿', - '料' => 'æ–™', - '樂' => '樂', - '燎' => '燎', - 'ï§' => '療', - '蓼' => '蓼', - '遼' => 'é¼', - '龍' => 'é¾', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => 'æ»', - '柳' => '柳', - '流' => 'æµ', - '溜' => '溜', - '琉' => 'ç‰', - 'ï§' => 'ç•™', - '硫' => 'ç¡«', - 'ï§' => 'ç´', - 'ï§' => 'é¡ž', - '六' => 'å…­', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => 'å´™', - '淪' => 'æ·ª', - '輪' => '輪', - '律' => '律', - '慄' => 'æ…„', - '栗' => 'æ —', - '率' => '率', - '隆' => '隆', - 'ï§' => '利', - '吏' => 'å', - '履' => 'å±¥', - '易' => '易', - '李' => 'æŽ', - '梨' => '梨', - '泥' => 'æ³¥', - '理' => 'ç†', - '痢' => 'ç—¢', - '罹' => 'ç½¹', - '裏' => 'è£', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => 'å', - '燐' => 'ç‡', - '璘' => 'ç’˜', - '藺' => 'è—º', - '隣' => '隣', - '鱗' => 'é±—', - '麟' => '麟', - '林' => 'æž—', - '淋' => 'æ·‹', - '臨' => '臨', - '立' => 'ç«‹', - '笠' => '笠', - '粒' => 'ç²’', - '狀' => 'ç‹€', - '炙' => 'ç‚™', - '識' => 'è­˜', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - 'ï¨' => '度', - '拓' => 'æ‹“', - '糖' => 'ç³–', - '宅' => 'å®…', - '洞' => 'æ´ž', - '暴' => 'æš´', - '輻' => 'è¼»', - '行' => 'è¡Œ', - '降' => 'é™', - '見' => '見', - '廓' => '廓', - '兀' => 'å…€', - 'ï¨' => 'å—€', - 'ï¨' => 'å¡š', - '晴' => 'æ™´', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => 'ç¦', - '靖' => 'é–', - 'ï¨' => 'ç²¾', - '羽' => 'ç¾½', - '蘒' => '蘒', - '諸' => '諸', - '逸' => '逸', - '都' => '都', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => 'éš·', - '侮' => 'ä¾®', - '僧' => '僧', - '免' => 'å…', - '勉' => '勉', - '勤' => '勤', - '卑' => 'å‘', - '喝' => 'å–', - '嘆' => '嘆', - '器' => '器', - '塀' => 'å¡€', - '墨' => '墨', - '層' => '層', - '屮' => 'å±®', - '悔' => 'æ‚”', - '慨' => 'æ…¨', - '憎' => '憎', - 'ï©€' => '懲', - 'ï©' => 'æ•', - 'ï©‚' => 'æ—¢', - '暑' => 'æš‘', - 'ï©„' => '梅', - 'ï©…' => 'æµ·', - '渚' => '渚', - '漢' => 'æ¼¢', - '煮' => 'ç…®', - '爫' => '爫', - 'ï©Š' => 'ç¢', - 'ï©‹' => '碑', - 'ï©Œ' => '社', - 'ï©' => '祉', - 'ï©Ž' => '祈', - 'ï©' => 'ç¥', - 'ï©' => '祖', - 'ï©‘' => 'ç¥', - 'ï©’' => 'ç¦', - 'ï©“' => '禎', - 'ï©”' => 'ç©€', - 'ï©•' => 'çª', - 'ï©–' => '節', - 'ï©—' => 'ç·´', - '縉' => '縉', - 'ï©™' => 'ç¹', - 'ï©š' => 'ç½²', - 'ï©›' => '者', - 'ï©œ' => '臭', - 'ï©' => '艹', - 'ï©ž' => '艹', - 'ï©Ÿ' => 'è‘—', - 'ï© ' => 'è¤', - 'ï©¡' => '視', - 'ï©¢' => 'è¬', - 'ï©£' => '謹', - '賓' => '賓', - 'ï©¥' => 'è´ˆ', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - 'ï©©' => '響', - '頻' => 'é »', - 'ï©«' => 'æµ', - '𤋮' => '𤋮', - 'ï©­' => '舘', - 'ï©°' => '並', - '况' => '况', - '全' => 'å…¨', - '侀' => 'ä¾€', - 'ï©´' => 'å……', - '冀' => '冀', - '勇' => '勇', - 'ï©·' => '勺', - '喝' => 'å–', - '啕' => 'å••', - '喙' => 'å–™', - 'ï©»' => 'å—¢', - '塚' => 'å¡š', - '墳' => '墳', - '奄' => '奄', - 'ï©¿' => '奔', - '婢' => 'å©¢', - 'ïª' => '嬨', - '廒' => 'å»’', - '廙' => 'å»™', - '彩' => '彩', - '徭' => 'å¾­', - '惘' => '惘', - '慎' => 'æ…Ž', - '愈' => '愈', - '憎' => '憎', - '慠' => 'æ… ', - '懲' => '懲', - '戴' => '戴', - 'ïª' => 'æ„', - '搜' => 'æœ', - 'ïª' => 'æ‘’', - 'ïª' => 'æ•–', - '晴' => 'æ™´', - '朗' => '朗', - '望' => '望', - '杖' => 'æ–', - '歹' => 'æ­¹', - '殺' => '殺', - '流' => 'æµ', - '滛' => 'æ»›', - '滋' => '滋', - '漢' => 'æ¼¢', - '瀞' => '瀞', - '煮' => 'ç…®', - 'ïª' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => 'ç”»', - '瘝' => 'ç˜', - '瘟' => '瘟', - '益' => '益', - '盛' => 'ç››', - '直' => 'ç›´', - '睊' => 'çŠ', - '着' => 'ç€', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => 'ç±»', - '絛' => 'çµ›', - '練' => 'ç·´', - '缾' => 'ç¼¾', - '者' => '者', - '荒' => 'è’', - '華' => 'è¯', - '蝹' => 'è¹', - '襁' => 'è¥', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => 'è«‹', - '謁' => 'è¬', - '諾' => '諾', - '諭' => 'è«­', - '謹' => '謹', - 'ï«€' => '變', - 'ï«' => 'è´ˆ', - 'ï«‚' => '輸', - '遲' => 'é²', - 'ï«„' => '醙', - 'ï«…' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => 'é–', - '韛' => '韛', - 'ï«Š' => '響', - 'ï«‹' => 'é ‹', - 'ï«Œ' => 'é »', - 'ï«' => '鬒', - 'ï«Ž' => '龜', - 'ï«' => '𢡊', - 'ï«' => '𢡄', - 'ï«‘' => 'ð£•', - 'ï«’' => 'ã®', - 'ï«“' => '䀘', - 'ï«”' => '䀹', - 'ï«•' => '𥉉', - 'ï«–' => 'ð¥³', - 'ï«—' => '𧻓', - '齃' => '齃', - 'ï«™' => '龎', - 'ï¬' => '×™Ö´', - 'ײַ' => 'ײַ', - 'שׁ' => 'ש×', - 'שׂ' => 'שׂ', - 'שּׁ' => 'שּ×', - 'שּׂ' => 'שּׂ', - 'אַ' => '×Ö·', - 'אָ' => '×Ö¸', - 'אּ' => '×Ö¼', - 'בּ' => 'בּ', - 'גּ' => '×’Ö¼', - 'דּ' => 'דּ', - 'הּ' => '×”Ö¼', - 'וּ' => 'וּ', - 'זּ' => '×–Ö¼', - 'טּ' => 'טּ', - 'יּ' => '×™Ö¼', - 'ךּ' => 'ךּ', - 'כּ' => '×›Ö¼', - 'לּ' => 'לּ', - 'מּ' => 'מּ', - 'ï­€' => '× Ö¼', - 'ï­' => 'סּ', - 'ï­ƒ' => '×£Ö¼', - 'ï­„' => 'פּ', - 'ï­†' => 'צּ', - 'ï­‡' => 'קּ', - 'ï­ˆ' => 'רּ', - 'ï­‰' => 'שּ', - 'ï­Š' => 'תּ', - 'ï­‹' => 'וֹ', - 'ï­Œ' => 'בֿ', - 'ï­' => '×›Ö¿', - 'ï­Ž' => 'פֿ', - 'ð‘‚š' => '𑂚', - 'ð‘‚œ' => '𑂜', - 'ð‘‚«' => '𑂫', - 'ð‘„®' => '𑄮', - '𑄯' => '𑄯', - 'ð‘‹' => 'ð‘‡ð‘Œ¾', - 'ð‘Œ' => 'ð‘‡ð‘—', - 'ð‘’»' => '𑒻', - 'ð‘’¼' => '𑒼', - 'ð‘’¾' => '𑒾', - 'ð‘–º' => '𑖺', - 'ð‘–»' => '𑖻', - '𑤸' => '𑤸', - 'ð…ž' => 'ð…—ð…¥', - 'ð…Ÿ' => 'ð…˜ð…¥', - 'ð… ' => 'ð…˜ð…¥ð…®', - 'ð…¡' => 'ð…˜ð…¥ð…¯', - 'ð…¢' => 'ð…˜ð…¥ð…°', - 'ð…£' => 'ð…˜ð…¥ð…±', - 'ð…¤' => 'ð…˜ð…¥ð…²', - 'ð†»' => 'ð†¹ð…¥', - 'ð†¼' => 'ð†ºð…¥', - 'ð†½' => 'ð†¹ð…¥ð…®', - 'ð†¾' => 'ð†ºð…¥ð…®', - 'ð†¿' => 'ð†¹ð…¥ð…¯', - 'ð‡€' => 'ð†ºð…¥ð…¯', - '丽' => '丽', - 'ð¯ ' => '丸', - '乁' => 'ä¹', - '𠄢' => 'ð „¢', - '你' => 'ä½ ', - '侮' => 'ä¾®', - '侻' => 'ä¾»', - '倂' => '倂', - '偺' => 'åº', - '備' => 'å‚™', - '僧' => '僧', - '像' => 'åƒ', - '㒞' => 'ã’ž', - 'ð¯ ' => '𠘺', - '免' => 'å…', - 'ð¯ ' => 'å…”', - 'ð¯ ' => 'å…¤', - '具' => 'å…·', - '𠔜' => '𠔜', - '㒹' => 'ã’¹', - '內' => 'å…§', - '再' => 'å†', - '𠕋' => 'ð •‹', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - 'ð¯ ' => '凵', - '刃' => '刃', - '㓟' => 'ã“Ÿ', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => 'å‰', - '卑' => 'å‘', - '博' => 'åš', - '即' => 'å³', - '卽' => 'å½', - '卿' => 'å¿', - '卿' => 'å¿', - '卿' => 'å¿', - '𠨬' => '𠨬', - '灰' => 'ç°', - '及' => 'åŠ', - '叟' => 'åŸ', - '𠭣' => 'ð ­£', - '叫' => 'å«', - '叱' => 'å±', - '吆' => 'å†', - '咞' => 'å’ž', - '吸' => 'å¸', - '呈' => '呈', - '周' => '周', - '咢' => 'å’¢', - 'ð¯¡' => '哶', - '唐' => 'å”', - '啓' => 'å•“', - '啣' => 'å•£', - '善' => 'å–„', - '善' => 'å–„', - '喙' => 'å–™', - '喫' => 'å–«', - '喳' => 'å–³', - '嗂' => 'å—‚', - '圖' => '圖', - '嘆' => '嘆', - 'ð¯¡' => '圗', - '噑' => '噑', - 'ð¯¡' => 'å™´', - 'ð¯¡' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => 'å ', - '型' => 'åž‹', - '堲' => 'å ²', - '報' => 'å ±', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - 'ð¯¡' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => 'ã›®', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => 'å°†', - '当' => '当', - '尢' => 'å°¢', - '㞁' => 'ãž', - '屠' => 'å± ', - '屮' => 'å±®', - '峀' => 'å³€', - '岍' => 'å²', - '𡷤' => 'ð¡·¤', - '嵃' => '嵃', - '𡷦' => 'ð¡·¦', - '嵮' => 'åµ®', - '嵫' => '嵫', - '嵼' => 'åµ¼', - 'ð¯¢' => 'å·¡', - '巢' => 'å·¢', - '㠯' => 'ã ¯', - '巽' => 'å·½', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => 'ã¡¢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - 'ð¯¢' => '庶', - '廊' => '廊', - 'ð¯¢' => '𪎒', - 'ð¯¢' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => 'èˆ', - '弢' => 'å¼¢', - '弢' => 'å¼¢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => 'å½¢', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - 'ð¯¢' => 'å¿', - '志' => 'å¿—', - '忹' => '忹', - '悁' => 'æ‚', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => 'æ‚”', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => 'æ…ˆ', - '慌' => 'æ…Œ', - '慎' => 'æ…Ž', - '慌' => 'æ…Œ', - '慺' => 'æ…º', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => 'æˆ', - '戛' => '戛', - '扝' => 'æ‰', - '抱' => '抱', - '拔' => 'æ‹”', - '捐' => 'æ', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => 'æ¨', - '掃' => '掃', - '揤' => 'æ¤', - '𢯱' => '𢯱', - '搢' => 'æ¢', - '揅' => 'æ…', - 'ð¯£' => '掩', - '㨮' => '㨮', - '摩' => 'æ‘©', - '摾' => '摾', - '撝' => 'æ’', - '摷' => 'æ‘·', - '㩬' => '㩬', - '敏' => 'æ•', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => 'æ—£', - '書' => '書', - 'ð¯£' => '晉', - '㬙' => '㬙', - 'ð¯£' => 'æš‘', - 'ð¯£' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => 'æšœ', - '肭' => 'è‚­', - '䏙' => 'ä™', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => 'æž', - '杓' => 'æ“', - 'ð¯£' => 'ð£ƒ', - '㭉' => 'ã­‰', - '柺' => '柺', - '枅' => 'æž…', - '桒' => 'æ¡’', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => 'æ Ÿ', - '椔' => '椔', - '㮝' => 'ã®', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => 'æ«›', - '㰘' => 'ã°˜', - '次' => '次', - '𣢧' => '𣢧', - '歔' => 'æ­”', - '㱎' => '㱎', - '歲' => 'æ­²', - '殟' => '殟', - '殺' => '殺', - '殻' => 'æ®»', - '𣪍' => 'ð£ª', - '𡴋' => 'ð¡´‹', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => 'æ³', - '汧' => '汧', - '洖' => 'æ´–', - '派' => 'æ´¾', - 'ð¯¤' => 'æµ·', - '流' => 'æµ', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => 'æ´´', - '港' => '港', - '湮' => 'æ¹®', - '㴳' => 'ã´³', - '滋' => '滋', - '滇' => '滇', - 'ð¯¤' => '𣻑', - '淹' => 'æ·¹', - 'ð¯¤' => 'æ½®', - 'ð¯¤' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => 'çŠ', - '災' => 'ç½', - '灷' => 'ç·', - '炭' => 'ç‚­', - '𠔥' => '𠔥', - '煅' => 'ç……', - 'ð¯¤' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => 'ç‰', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => 'çº', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => 'ç‘œ', - '瑱' => '瑱', - '璅' => 'ç’…', - '瓊' => 'ç“Š', - '㼛' => 'ã¼›', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => 'ç•°', - '𢆟' => '𢆟', - '瘐' => 'ç˜', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => 'ð¥„', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => 'ç›´', - 'ð¯¥' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => 'çŠ', - '䀹' => '䀹', - '瞋' => 'çž‹', - '䁆' => 'ä†', - '䂖' => 'ä‚–', - 'ð¯¥' => 'ð¥', - '硎' => 'ç¡Ž', - 'ð¯¥' => '碌', - 'ð¯¥' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => 'ç¦', - '秫' => '秫', - '䄯' => '䄯', - '穀' => 'ç©€', - '穊' => 'ç©Š', - '穏' => 'ç©', - '𥥼' => '𥥼', - 'ð¯¥' => '𥪧', - '𥪧' => '𥪧', - '竮' => 'ç«®', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => 'ç³’', - '䊠' => '䊠', - '糨' => '糨', - '糣' => 'ç³£', - '紀' => 'ç´€', - '𥾆' => '𥾆', - '絣' => 'çµ£', - '䌁' => 'äŒ', - '緇' => 'ç·‡', - '縂' => '縂', - '繅' => 'ç¹…', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => 'ä™', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => 'è ', - '𦖨' => '𦖨', - '聰' => 'è°', - '𣍟' => 'ð£Ÿ', - 'ð¯¦' => 'ä•', - '育' => '育', - '脃' => '脃', - '䐋' => 'ä‹', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => 'èˆ', - '舄' => '舄', - 'ð¯¦' => '辞', - '䑫' => 'ä‘«', - 'ð¯¦' => '芑', - 'ð¯¦' => '芋', - '芝' => 'èŠ', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => 'è‹¥', - '茝' => 'èŒ', - '荣' => 'è£', - '莭' => '莭', - '茣' => '茣', - 'ð¯¦' => '莽', - '菧' => 'è§', - '著' => 'è‘—', - '荓' => 'è“', - '菊' => 'èŠ', - '菌' => 'èŒ', - '菜' => 'èœ', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => 'è”–', - '𧏊' => 'ð§Š', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => 'ä•', - '䕡' => 'ä•¡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => 'ä•«', - '虐' => 'è™', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => 'èš©', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => 'è¹', - '蜨' => '蜨', - '蝫' => 'è«', - '螆' => '螆', - '䗗' => 'ä——', - '蟡' => '蟡', - 'ð¯§' => 'è ', - '䗹' => 'ä—¹', - '衠' => 'è¡ ', - '衣' => 'è¡£', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => 'ã’»', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - 'ð¯§' => 'äš¾', - '䛇' => '䛇', - 'ð¯§' => '誠', - 'ð¯§' => 'è«­', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => 'è³', - '贛' => 'è´›', - '起' => 'èµ·', - '𧼯' => '𧼯', - '𠠄' => 'ð  „', - '跋' => 'è·‹', - '趼' => '趼', - '跰' => 'è·°', - 'ð¯§' => '𠣞', - '軔' => 'è»”', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => 'é‚”', - '郱' => '郱', - '鄑' => 'é„‘', - '𨜮' => '𨜮', - '鄛' => 'é„›', - '鈸' => '鈸', - '鋗' => 'é‹—', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => 'é¹', - '鐕' => 'é•', - '𨯺' => '𨯺', - '開' => 'é–‹', - '䦕' => '䦕', - '閷' => 'é–·', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => 'ð©……', - '𩈚' => '𩈚', - '䩮' => 'ä©®', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => 'ð©Š', - '䪲' => '䪲', - '𩒖' => 'ð©’–', - '頋' => 'é ‹', - '頋' => 'é ‹', - '頩' => 'é ©', - 'ð¯¨' => 'ð©–¶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => 'é±€', - '鳽' => 'é³½', - 'ð¯¨' => '䳎', - '䳭' => 'ä³­', - 'ð¯¨' => '鵧', - 'ð¯¨' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => 'äµ–', - '黹' => '黹', - '黾' => '黾', - '鼅' => 'é¼…', - '鼏' => 'é¼', - '鼖' => 'é¼–', - '鼻' => 'é¼»', - 'ð¯¨' => '𪘀', -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php deleted file mode 100644 index ec90f36eb65..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php +++ /dev/null @@ -1,876 +0,0 @@ - 230, - 'Ì' => 230, - 'Ì‚' => 230, - '̃' => 230, - 'Ì„' => 230, - 'Ì…' => 230, - '̆' => 230, - '̇' => 230, - '̈' => 230, - '̉' => 230, - 'ÌŠ' => 230, - 'Ì‹' => 230, - 'ÌŒ' => 230, - 'Ì' => 230, - 'ÌŽ' => 230, - 'Ì' => 230, - 'Ì' => 230, - 'Ì‘' => 230, - 'Ì’' => 230, - 'Ì“' => 230, - 'Ì”' => 230, - 'Ì•' => 232, - 'Ì–' => 220, - 'Ì—' => 220, - '̘' => 220, - 'Ì™' => 220, - 'Ìš' => 232, - 'Ì›' => 216, - 'Ìœ' => 220, - 'Ì' => 220, - 'Ìž' => 220, - 'ÌŸ' => 220, - 'Ì ' => 220, - 'Ì¡' => 202, - 'Ì¢' => 202, - 'Ì£' => 220, - '̤' => 220, - 'Ì¥' => 220, - '̦' => 220, - '̧' => 202, - '̨' => 202, - 'Ì©' => 220, - '̪' => 220, - 'Ì«' => 220, - '̬' => 220, - 'Ì­' => 220, - 'Ì®' => 220, - '̯' => 220, - 'Ì°' => 220, - '̱' => 220, - '̲' => 220, - '̳' => 220, - 'Ì´' => 1, - '̵' => 1, - '̶' => 1, - 'Ì·' => 1, - '̸' => 1, - '̹' => 220, - '̺' => 220, - 'Ì»' => 220, - '̼' => 220, - '̽' => 230, - '̾' => 230, - 'Ì¿' => 230, - 'Í€' => 230, - 'Í' => 230, - 'Í‚' => 230, - '̓' => 230, - 'Í„' => 230, - 'Í…' => 240, - '͆' => 230, - '͇' => 220, - '͈' => 220, - '͉' => 220, - 'ÍŠ' => 230, - 'Í‹' => 230, - 'ÍŒ' => 230, - 'Í' => 220, - 'ÍŽ' => 220, - 'Í' => 230, - 'Í‘' => 230, - 'Í’' => 230, - 'Í“' => 220, - 'Í”' => 220, - 'Í•' => 220, - 'Í–' => 220, - 'Í—' => 230, - '͘' => 232, - 'Í™' => 220, - 'Íš' => 220, - 'Í›' => 230, - 'Íœ' => 233, - 'Í' => 234, - 'Íž' => 234, - 'ÍŸ' => 233, - 'Í ' => 234, - 'Í¡' => 234, - 'Í¢' => 233, - 'Í£' => 230, - 'ͤ' => 230, - 'Í¥' => 230, - 'ͦ' => 230, - 'ͧ' => 230, - 'ͨ' => 230, - 'Í©' => 230, - 'ͪ' => 230, - 'Í«' => 230, - 'ͬ' => 230, - 'Í­' => 230, - 'Í®' => 230, - 'ͯ' => 230, - 'Òƒ' => 230, - 'Ò„' => 230, - 'Ò…' => 230, - 'Ò†' => 230, - 'Ò‡' => 230, - 'Ö‘' => 220, - 'Ö’' => 230, - 'Ö“' => 230, - 'Ö”' => 230, - 'Ö•' => 230, - 'Ö–' => 220, - 'Ö—' => 230, - 'Ö˜' => 230, - 'Ö™' => 230, - 'Öš' => 222, - 'Ö›' => 220, - 'Öœ' => 230, - 'Ö' => 230, - 'Öž' => 230, - 'ÖŸ' => 230, - 'Ö ' => 230, - 'Ö¡' => 230, - 'Ö¢' => 220, - 'Ö£' => 220, - 'Ö¤' => 220, - 'Ö¥' => 220, - 'Ö¦' => 220, - 'Ö§' => 220, - 'Ö¨' => 230, - 'Ö©' => 230, - 'Öª' => 220, - 'Ö«' => 230, - 'Ö¬' => 230, - 'Ö­' => 222, - 'Ö®' => 228, - 'Ö¯' => 230, - 'Ö°' => 10, - 'Ö±' => 11, - 'Ö²' => 12, - 'Ö³' => 13, - 'Ö´' => 14, - 'Öµ' => 15, - 'Ö¶' => 16, - 'Ö·' => 17, - 'Ö¸' => 18, - 'Ö¹' => 19, - 'Öº' => 19, - 'Ö»' => 20, - 'Ö¼' => 21, - 'Ö½' => 22, - 'Ö¿' => 23, - '×' => 24, - 'ׂ' => 25, - 'ׄ' => 230, - '×…' => 220, - 'ׇ' => 18, - 'Ø' => 230, - 'Ø‘' => 230, - 'Ø’' => 230, - 'Ø“' => 230, - 'Ø”' => 230, - 'Ø•' => 230, - 'Ø–' => 230, - 'Ø—' => 230, - 'ؘ' => 30, - 'Ø™' => 31, - 'Øš' => 32, - 'Ù‹' => 27, - 'ÙŒ' => 28, - 'Ù' => 29, - 'ÙŽ' => 30, - 'Ù' => 31, - 'Ù' => 32, - 'Ù‘' => 33, - 'Ù’' => 34, - 'Ù“' => 230, - 'Ù”' => 230, - 'Ù•' => 220, - 'Ù–' => 220, - 'Ù—' => 230, - 'Ù˜' => 230, - 'Ù™' => 230, - 'Ùš' => 230, - 'Ù›' => 230, - 'Ùœ' => 220, - 'Ù' => 230, - 'Ùž' => 230, - 'ÙŸ' => 220, - 'Ù°' => 35, - 'Û–' => 230, - 'Û—' => 230, - 'Û˜' => 230, - 'Û™' => 230, - 'Ûš' => 230, - 'Û›' => 230, - 'Ûœ' => 230, - 'ÛŸ' => 230, - 'Û ' => 230, - 'Û¡' => 230, - 'Û¢' => 230, - 'Û£' => 220, - 'Û¤' => 230, - 'Û§' => 230, - 'Û¨' => 230, - 'Ûª' => 220, - 'Û«' => 230, - 'Û¬' => 230, - 'Û­' => 220, - 'Ü‘' => 36, - 'Ü°' => 230, - 'ܱ' => 220, - 'ܲ' => 230, - 'ܳ' => 230, - 'Ü´' => 220, - 'ܵ' => 230, - 'ܶ' => 230, - 'Ü·' => 220, - 'ܸ' => 220, - 'ܹ' => 220, - 'ܺ' => 230, - 'Ü»' => 220, - 'ܼ' => 220, - 'ܽ' => 230, - 'ܾ' => 220, - 'Ü¿' => 230, - 'Ý€' => 230, - 'Ý' => 230, - 'Ý‚' => 220, - '݃' => 230, - 'Ý„' => 220, - 'Ý…' => 230, - '݆' => 220, - '݇' => 230, - '݈' => 220, - '݉' => 230, - 'ÝŠ' => 230, - 'ß«' => 230, - '߬' => 230, - 'ß­' => 230, - 'ß®' => 230, - '߯' => 230, - 'ß°' => 230, - 'ß±' => 230, - 'ß²' => 220, - 'ß³' => 230, - 'ß½' => 220, - 'à –' => 230, - 'à —' => 230, - 'à ˜' => 230, - 'à ™' => 230, - 'à ›' => 230, - 'à œ' => 230, - 'à ' => 230, - 'à ž' => 230, - 'à Ÿ' => 230, - 'à  ' => 230, - 'à ¡' => 230, - 'à ¢' => 230, - 'à £' => 230, - 'à ¥' => 230, - 'à ¦' => 230, - 'à §' => 230, - 'à ©' => 230, - 'à ª' => 230, - 'à «' => 230, - 'à ¬' => 230, - 'à ­' => 230, - 'à¡™' => 220, - 'à¡š' => 220, - 'à¡›' => 220, - '࣓' => 220, - 'ࣔ' => 230, - 'ࣕ' => 230, - 'ࣖ' => 230, - 'ࣗ' => 230, - 'ࣘ' => 230, - 'ࣙ' => 230, - 'ࣚ' => 230, - 'ࣛ' => 230, - 'ࣜ' => 230, - 'à£' => 230, - 'ࣞ' => 230, - 'ࣟ' => 230, - '࣠' => 230, - '࣡' => 230, - 'ࣣ' => 220, - 'ࣤ' => 230, - 'ࣥ' => 230, - 'ࣦ' => 220, - 'ࣧ' => 230, - 'ࣨ' => 230, - 'ࣩ' => 220, - '࣪' => 230, - '࣫' => 230, - '࣬' => 230, - '࣭' => 220, - '࣮' => 220, - '࣯' => 220, - 'ࣰ' => 27, - 'ࣱ' => 28, - 'ࣲ' => 29, - 'ࣳ' => 230, - 'ࣴ' => 230, - 'ࣵ' => 230, - 'ࣶ' => 220, - 'ࣷ' => 230, - 'ࣸ' => 230, - 'ࣹ' => 220, - 'ࣺ' => 220, - 'ࣻ' => 230, - 'ࣼ' => 230, - 'ࣽ' => 230, - 'ࣾ' => 230, - 'ࣿ' => 230, - '़' => 7, - 'à¥' => 9, - '॑' => 230, - '॒' => 220, - '॓' => 230, - '॔' => 230, - '়' => 7, - 'à§' => 9, - '৾' => 230, - '਼' => 7, - 'à©' => 9, - '઼' => 7, - 'à«' => 9, - '଼' => 7, - 'à­' => 9, - 'à¯' => 9, - 'à±' => 9, - 'ౕ' => 84, - 'à±–' => 91, - '಼' => 7, - 'à³' => 9, - 'à´»' => 9, - 'à´¼' => 9, - 'àµ' => 9, - 'à·Š' => 9, - 'ุ' => 103, - 'ู' => 103, - 'ฺ' => 9, - '่' => 107, - '้' => 107, - '๊' => 107, - '๋' => 107, - 'ຸ' => 118, - 'ູ' => 118, - '຺' => 9, - '່' => 122, - '້' => 122, - '໊' => 122, - '໋' => 122, - '༘' => 220, - '༙' => 220, - '༵' => 220, - '༷' => 220, - '༹' => 216, - 'ཱ' => 129, - 'ི' => 130, - 'ུ' => 132, - 'ེ' => 130, - 'ཻ' => 130, - 'ོ' => 130, - 'ཽ' => 130, - 'ྀ' => 130, - 'ྂ' => 230, - 'ྃ' => 230, - '྄' => 9, - '྆' => 230, - '྇' => 230, - '࿆' => 220, - '့' => 7, - '္' => 9, - '်' => 9, - 'á‚' => 220, - 'á' => 230, - 'áž' => 230, - 'áŸ' => 230, - '᜔' => 9, - '᜴' => 9, - '្' => 9, - 'áŸ' => 230, - 'ᢩ' => 228, - '᤹' => 222, - '᤺' => 230, - '᤻' => 220, - 'ᨗ' => 230, - 'ᨘ' => 220, - 'á© ' => 9, - '᩵' => 230, - '᩶' => 230, - 'á©·' => 230, - '᩸' => 230, - '᩹' => 230, - '᩺' => 230, - 'á©»' => 230, - '᩼' => 230, - 'á©¿' => 220, - '᪰' => 230, - '᪱' => 230, - '᪲' => 230, - '᪳' => 230, - '᪴' => 230, - '᪵' => 220, - '᪶' => 220, - '᪷' => 220, - '᪸' => 220, - '᪹' => 220, - '᪺' => 220, - '᪻' => 230, - '᪼' => 230, - '᪽' => 220, - 'ᪿ' => 220, - 'á«€' => 220, - '᬴' => 7, - 'á­„' => 9, - 'á­«' => 230, - 'á­¬' => 220, - 'á­­' => 230, - 'á­®' => 230, - 'á­¯' => 230, - 'á­°' => 230, - 'á­±' => 230, - 'á­²' => 230, - 'á­³' => 230, - '᮪' => 9, - '᮫' => 9, - '᯦' => 7, - '᯲' => 9, - '᯳' => 9, - 'á°·' => 7, - 'á³' => 230, - '᳑' => 230, - 'á³’' => 230, - 'á³”' => 1, - '᳕' => 220, - 'á³–' => 220, - 'á³—' => 220, - '᳘' => 220, - 'á³™' => 220, - '᳚' => 230, - 'á³›' => 230, - '᳜' => 220, - 'á³' => 220, - '᳞' => 220, - '᳟' => 220, - 'á³ ' => 230, - 'á³¢' => 1, - 'á³£' => 1, - '᳤' => 1, - 'á³¥' => 1, - '᳦' => 1, - '᳧' => 1, - '᳨' => 1, - 'á³­' => 220, - 'á³´' => 230, - '᳸' => 230, - 'á³¹' => 230, - 'á·€' => 230, - 'á·' => 230, - 'á·‚' => 220, - 'á·ƒ' => 230, - 'á·„' => 230, - 'á·…' => 230, - 'á·†' => 230, - 'á·‡' => 230, - 'á·ˆ' => 230, - 'á·‰' => 230, - 'á·Š' => 220, - 'á·‹' => 230, - 'á·Œ' => 230, - 'á·' => 234, - 'á·Ž' => 214, - 'á·' => 220, - 'á·' => 202, - 'á·‘' => 230, - 'á·’' => 230, - 'á·“' => 230, - 'á·”' => 230, - 'á·•' => 230, - 'á·–' => 230, - 'á·—' => 230, - 'á·˜' => 230, - 'á·™' => 230, - 'á·š' => 230, - 'á·›' => 230, - 'á·œ' => 230, - 'á·' => 230, - 'á·ž' => 230, - 'á·Ÿ' => 230, - 'á· ' => 230, - 'á·¡' => 230, - 'á·¢' => 230, - 'á·£' => 230, - 'á·¤' => 230, - 'á·¥' => 230, - 'á·¦' => 230, - 'á·§' => 230, - 'á·¨' => 230, - 'á·©' => 230, - 'á·ª' => 230, - 'á·«' => 230, - 'á·¬' => 230, - 'á·­' => 230, - 'á·®' => 230, - 'á·¯' => 230, - 'á·°' => 230, - 'á·±' => 230, - 'á·²' => 230, - 'á·³' => 230, - 'á·´' => 230, - 'á·µ' => 230, - 'á·¶' => 232, - 'á··' => 228, - 'á·¸' => 228, - 'á·¹' => 220, - 'á·»' => 230, - 'á·¼' => 233, - 'á·½' => 220, - 'á·¾' => 230, - 'á·¿' => 220, - 'âƒ' => 230, - '⃑' => 230, - '⃒' => 1, - '⃓' => 1, - '⃔' => 230, - '⃕' => 230, - '⃖' => 230, - '⃗' => 230, - '⃘' => 1, - '⃙' => 1, - '⃚' => 1, - '⃛' => 230, - '⃜' => 230, - '⃡' => 230, - '⃥' => 1, - '⃦' => 1, - '⃧' => 230, - '⃨' => 220, - '⃩' => 230, - '⃪' => 1, - '⃫' => 1, - '⃬' => 220, - '⃭' => 220, - '⃮' => 220, - '⃯' => 220, - '⃰' => 230, - '⳯' => 230, - 'â³°' => 230, - 'â³±' => 230, - '⵿' => 9, - 'â· ' => 230, - 'â·¡' => 230, - 'â·¢' => 230, - 'â·£' => 230, - 'â·¤' => 230, - 'â·¥' => 230, - 'â·¦' => 230, - 'â·§' => 230, - 'â·¨' => 230, - 'â·©' => 230, - 'â·ª' => 230, - 'â·«' => 230, - 'â·¬' => 230, - 'â·­' => 230, - 'â·®' => 230, - 'â·¯' => 230, - 'â·°' => 230, - 'â·±' => 230, - 'â·²' => 230, - 'â·³' => 230, - 'â·´' => 230, - 'â·µ' => 230, - 'â·¶' => 230, - 'â··' => 230, - 'â·¸' => 230, - 'â·¹' => 230, - 'â·º' => 230, - 'â·»' => 230, - 'â·¼' => 230, - 'â·½' => 230, - 'â·¾' => 230, - 'â·¿' => 230, - '〪' => 218, - '〫' => 228, - '〬' => 232, - '〭' => 222, - '〮' => 224, - '〯' => 224, - 'ã‚™' => 8, - 'ã‚š' => 8, - '꙯' => 230, - 'ê™´' => 230, - 'ꙵ' => 230, - 'ꙶ' => 230, - 'ê™·' => 230, - 'ꙸ' => 230, - 'ꙹ' => 230, - 'ꙺ' => 230, - 'ê™»' => 230, - '꙼' => 230, - '꙽' => 230, - 'êšž' => 230, - 'ꚟ' => 230, - 'ê›°' => 230, - 'ê›±' => 230, - 'ê †' => 9, - 'ê ¬' => 9, - '꣄' => 9, - '꣠' => 230, - '꣡' => 230, - '꣢' => 230, - '꣣' => 230, - '꣤' => 230, - '꣥' => 230, - '꣦' => 230, - '꣧' => 230, - '꣨' => 230, - '꣩' => 230, - '꣪' => 230, - '꣫' => 230, - '꣬' => 230, - '꣭' => 230, - '꣮' => 230, - '꣯' => 230, - '꣰' => 230, - '꣱' => 230, - '꤫' => 220, - '꤬' => 220, - '꤭' => 220, - '꥓' => 9, - '꦳' => 7, - '꧀' => 9, - 'ꪰ' => 230, - 'ꪲ' => 230, - 'ꪳ' => 230, - 'ꪴ' => 220, - 'ꪷ' => 230, - 'ꪸ' => 230, - 'ꪾ' => 230, - '꪿' => 230, - 'ê«' => 230, - '꫶' => 9, - '꯭' => 9, - 'ﬞ' => 26, - '︠' => 230, - '︡' => 230, - '︢' => 230, - '︣' => 230, - '︤' => 230, - '︥' => 230, - '︦' => 230, - '︧' => 220, - '︨' => 220, - '︩' => 220, - '︪' => 220, - '︫' => 220, - '︬' => 220, - '︭' => 220, - '︮' => 230, - '︯' => 230, - 'ð‡½' => 220, - 'ð‹ ' => 220, - 'ð¶' => 230, - 'ð·' => 230, - 'ð¸' => 230, - 'ð¹' => 230, - 'ðº' => 230, - 'ð¨' => 220, - 'ð¨' => 230, - 'ð¨¸' => 230, - 'ð¨¹' => 1, - 'ð¨º' => 220, - 'ð¨¿' => 9, - 'ð«¥' => 230, - 'ð«¦' => 220, - 'ð´¤' => 230, - 'ð´¥' => 230, - 'ð´¦' => 230, - 'ð´§' => 230, - 'ðº«' => 230, - 'ðº¬' => 230, - 'ð½†' => 220, - 'ð½‡' => 220, - 'ð½ˆ' => 230, - 'ð½‰' => 230, - 'ð½Š' => 230, - 'ð½‹' => 220, - 'ð½Œ' => 230, - 'ð½' => 220, - 'ð½Ž' => 220, - 'ð½' => 220, - 'ð½' => 220, - 'ð‘†' => 9, - 'ð‘¿' => 9, - 'ð‘‚¹' => 9, - '𑂺' => 7, - 'ð‘„€' => 230, - 'ð‘„' => 230, - 'ð‘„‚' => 230, - 'ð‘„³' => 9, - 'ð‘„´' => 9, - 'ð‘…³' => 7, - '𑇀' => 9, - '𑇊' => 7, - '𑈵' => 9, - '𑈶' => 7, - 'ð‘‹©' => 7, - '𑋪' => 9, - '𑌻' => 7, - '𑌼' => 7, - 'ð‘' => 9, - 'ð‘¦' => 230, - 'ð‘§' => 230, - 'ð‘¨' => 230, - 'ð‘©' => 230, - 'ð‘ª' => 230, - 'ð‘«' => 230, - 'ð‘¬' => 230, - 'ð‘°' => 230, - 'ð‘±' => 230, - 'ð‘²' => 230, - 'ð‘³' => 230, - 'ð‘´' => 230, - 'ð‘‘‚' => 9, - '𑑆' => 7, - 'ð‘‘ž' => 230, - 'ð‘“‚' => 9, - '𑓃' => 7, - 'ð‘–¿' => 9, - 'ð‘—€' => 7, - '𑘿' => 9, - '𑚶' => 9, - 'ð‘š·' => 7, - '𑜫' => 9, - 'ð‘ ¹' => 9, - 'ð‘ º' => 7, - '𑤽' => 9, - '𑤾' => 9, - '𑥃' => 7, - '𑧠' => 9, - '𑨴' => 9, - '𑩇' => 9, - '𑪙' => 9, - 'ð‘°¿' => 9, - '𑵂' => 7, - '𑵄' => 9, - '𑵅' => 9, - '𑶗' => 9, - 'ð–«°' => 1, - 'ð–«±' => 1, - 'ð–«²' => 1, - 'ð–«³' => 1, - 'ð–«´' => 1, - 'ð–¬°' => 230, - '𖬱' => 230, - '𖬲' => 230, - '𖬳' => 230, - 'ð–¬´' => 230, - '𖬵' => 230, - '𖬶' => 230, - 'ð–¿°' => 6, - 'ð–¿±' => 6, - '𛲞' => 1, - 'ð…¥' => 216, - 'ð…¦' => 216, - 'ð…§' => 1, - 'ð…¨' => 1, - 'ð…©' => 1, - 'ð…­' => 226, - 'ð…®' => 216, - 'ð…¯' => 216, - 'ð…°' => 216, - 'ð…±' => 216, - 'ð…²' => 216, - 'ð…»' => 220, - 'ð…¼' => 220, - 'ð…½' => 220, - 'ð…¾' => 220, - 'ð…¿' => 220, - 'ð†€' => 220, - 'ð†' => 220, - 'ð†‚' => 220, - 'ð†…' => 230, - 'ð††' => 230, - 'ð†‡' => 230, - 'ð†ˆ' => 230, - 'ð†‰' => 230, - 'ð†Š' => 220, - 'ð†‹' => 220, - 'ð†ª' => 230, - 'ð†«' => 230, - 'ð†¬' => 230, - 'ð†­' => 230, - 'ð‰‚' => 230, - 'ð‰ƒ' => 230, - 'ð‰„' => 230, - '𞀀' => 230, - 'ðž€' => 230, - '𞀂' => 230, - '𞀃' => 230, - '𞀄' => 230, - '𞀅' => 230, - '𞀆' => 230, - '𞀈' => 230, - '𞀉' => 230, - '𞀊' => 230, - '𞀋' => 230, - '𞀌' => 230, - 'ðž€' => 230, - '𞀎' => 230, - 'ðž€' => 230, - 'ðž€' => 230, - '𞀑' => 230, - '𞀒' => 230, - '𞀓' => 230, - '𞀔' => 230, - '𞀕' => 230, - '𞀖' => 230, - '𞀗' => 230, - '𞀘' => 230, - '𞀛' => 230, - '𞀜' => 230, - 'ðž€' => 230, - '𞀞' => 230, - '𞀟' => 230, - '𞀠' => 230, - '𞀡' => 230, - '𞀣' => 230, - '𞀤' => 230, - '𞀦' => 230, - '𞀧' => 230, - '𞀨' => 230, - '𞀩' => 230, - '𞀪' => 230, - 'ðž„°' => 230, - '𞄱' => 230, - '𞄲' => 230, - '𞄳' => 230, - 'ðž„´' => 230, - '𞄵' => 230, - '𞄶' => 230, - '𞋬' => 230, - 'ðž‹­' => 230, - 'ðž‹®' => 230, - '𞋯' => 230, - 'ðž£' => 220, - '𞣑' => 220, - '𞣒' => 220, - '𞣓' => 220, - '𞣔' => 220, - '𞣕' => 220, - '𞣖' => 220, - '𞥄' => 230, - '𞥅' => 230, - '𞥆' => 230, - '𞥇' => 230, - '𞥈' => 230, - '𞥉' => 230, - '𞥊' => 7, -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php deleted file mode 100644 index 1574902893c..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php +++ /dev/null @@ -1,3695 +0,0 @@ - ' ', - '¨' => ' ̈', - 'ª' => 'a', - '¯' => ' Ì„', - '²' => '2', - '³' => '3', - '´' => ' Ì', - 'µ' => 'μ', - '¸' => ' ̧', - '¹' => '1', - 'º' => 'o', - '¼' => '1â„4', - '½' => '1â„2', - '¾' => '3â„4', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ä¿' => 'L·', - 'Å€' => 'l·', - 'ʼn' => 'ʼn', - 'Å¿' => 's', - 'Ç„' => 'DZÌŒ', - 'Ç…' => 'DzÌŒ', - 'dž' => 'dzÌŒ', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'ÇŠ' => 'NJ', - 'Ç‹' => 'Nj', - 'ÇŒ' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'Ê°' => 'h', - 'ʱ' => 'ɦ', - 'ʲ' => 'j', - 'ʳ' => 'r', - 'Ê´' => 'ɹ', - 'ʵ' => 'É»', - 'ʶ' => 'Ê', - 'Ê·' => 'w', - 'ʸ' => 'y', - '˘' => ' ̆', - 'Ë™' => ' ̇', - 'Ëš' => ' ÌŠ', - 'Ë›' => ' ̨', - 'Ëœ' => ' ̃', - 'Ë' => ' Ì‹', - 'Ë ' => 'É£', - 'Ë¡' => 'l', - 'Ë¢' => 's', - 'Ë£' => 'x', - 'ˤ' => 'Ê•', - 'ͺ' => ' Í…', - '΄' => ' Ì', - 'Î…' => ' ̈Ì', - 'Ï' => 'β', - 'Ï‘' => 'θ', - 'Ï’' => 'Î¥', - 'Ï“' => 'Î¥Ì', - 'Ï”' => 'Ϋ', - 'Ï•' => 'φ', - 'Ï–' => 'Ï€', - 'Ï°' => 'κ', - 'ϱ' => 'Ï', - 'ϲ' => 'Ï‚', - 'Ï´' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'Ö‡' => 'Õ¥Ö‚', - 'Ùµ' => 'اٴ', - 'Ù¶' => 'وٴ', - 'Ù·' => 'Û‡Ù´', - 'Ù¸' => 'يٴ', - 'ำ' => 'à¹à¸²', - 'ຳ' => 'à»àº²', - 'ໜ' => 'ຫນ', - 'à»' => 'ຫມ', - '༌' => '་', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ჼ' => 'ნ', - 'á´¬' => 'A', - 'á´­' => 'Æ', - 'á´®' => 'B', - 'á´°' => 'D', - 'á´±' => 'E', - 'á´²' => 'ÆŽ', - 'á´³' => 'G', - 'á´´' => 'H', - 'á´µ' => 'I', - 'á´¶' => 'J', - 'á´·' => 'K', - 'á´¸' => 'L', - 'á´¹' => 'M', - 'á´º' => 'N', - 'á´¼' => 'O', - 'á´½' => 'È¢', - 'á´¾' => 'P', - 'á´¿' => 'R', - 'áµ€' => 'T', - 'áµ' => 'U', - 'ᵂ' => 'W', - 'ᵃ' => 'a', - 'ᵄ' => 'É', - 'áµ…' => 'É‘', - 'ᵆ' => 'á´‚', - 'ᵇ' => 'b', - 'ᵈ' => 'd', - 'ᵉ' => 'e', - 'ᵊ' => 'É™', - 'ᵋ' => 'É›', - 'ᵌ' => 'Éœ', - 'áµ' => 'g', - 'áµ' => 'k', - 'áµ' => 'm', - 'ᵑ' => 'Å‹', - 'áµ’' => 'o', - 'ᵓ' => 'É”', - 'áµ”' => 'á´–', - 'ᵕ' => 'á´—', - 'áµ–' => 'p', - 'áµ—' => 't', - 'ᵘ' => 'u', - 'áµ™' => 'á´', - 'ᵚ' => 'ɯ', - 'áµ›' => 'v', - 'ᵜ' => 'á´¥', - 'áµ' => 'β', - 'ᵞ' => 'γ', - 'ᵟ' => 'δ', - 'áµ ' => 'φ', - 'ᵡ' => 'χ', - 'áµ¢' => 'i', - 'áµ£' => 'r', - 'ᵤ' => 'u', - 'áµ¥' => 'v', - 'ᵦ' => 'β', - 'ᵧ' => 'γ', - 'ᵨ' => 'Ï', - 'ᵩ' => 'φ', - 'ᵪ' => 'χ', - 'ᵸ' => 'н', - 'ᶛ' => 'É’', - 'ᶜ' => 'c', - 'á¶' => 'É•', - 'ᶞ' => 'ð', - 'ᶟ' => 'Éœ', - 'ᶠ' => 'f', - 'ᶡ' => 'ÉŸ', - 'ᶢ' => 'É¡', - 'ᶣ' => 'É¥', - 'ᶤ' => 'ɨ', - 'ᶥ' => 'É©', - 'ᶦ' => 'ɪ', - 'ᶧ' => 'áµ»', - 'ᶨ' => 'Ê', - 'ᶩ' => 'É­', - 'ᶪ' => 'ᶅ', - 'ᶫ' => 'ÊŸ', - 'ᶬ' => 'ɱ', - 'ᶭ' => 'É°', - 'ᶮ' => 'ɲ', - 'ᶯ' => 'ɳ', - 'ᶰ' => 'É´', - 'ᶱ' => 'ɵ', - 'ᶲ' => 'ɸ', - 'ᶳ' => 'Ê‚', - 'ᶴ' => 'ʃ', - 'ᶵ' => 'Æ«', - 'ᶶ' => 'ʉ', - 'ᶷ' => 'ÊŠ', - 'ᶸ' => 'á´œ', - 'ᶹ' => 'Ê‹', - 'ᶺ' => 'ÊŒ', - 'ᶻ' => 'z', - 'ᶼ' => 'Ê', - 'ᶽ' => 'Ê‘', - 'ᶾ' => 'Ê’', - 'ᶿ' => 'θ', - 'ẚ' => 'aʾ', - 'ẛ' => 'ṡ', - 'á¾½' => ' Ì“', - '᾿' => ' Ì“', - 'á¿€' => ' Í‚', - 'á¿' => ' ̈͂', - 'á¿' => ' Ì“Ì€', - 'á¿Ž' => ' Ì“Ì', - 'á¿' => ' Ì“Í‚', - 'á¿' => ' ̔̀', - 'á¿ž' => ' Ì”Ì', - 'á¿Ÿ' => ' ̔͂', - 'á¿­' => ' ̈̀', - 'á¿®' => ' ̈Ì', - '´' => ' Ì', - '῾' => ' Ì”', - ' ' => ' ', - 'â€' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‑' => 'â€', - '‗' => ' ̳', - '․' => '.', - '‥' => '..', - '…' => '...', - ' ' => ' ', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '‾' => ' Ì…', - 'â‡' => '??', - 'âˆ' => '?!', - 'â‰' => '!?', - 'â—' => '′′′′', - 'âŸ' => ' ', - 'â°' => '0', - 'â±' => 'i', - 'â´' => '4', - 'âµ' => '5', - 'â¶' => '6', - 'â·' => '7', - 'â¸' => '8', - 'â¹' => '9', - 'âº' => '+', - 'â»' => '−', - 'â¼' => '=', - 'â½' => '(', - 'â¾' => ')', - 'â¿' => 'n', - 'â‚€' => '0', - 'â‚' => '1', - 'â‚‚' => '2', - '₃' => '3', - 'â‚„' => '4', - 'â‚…' => '5', - '₆' => '6', - '₇' => '7', - '₈' => '8', - '₉' => '9', - 'â‚Š' => '+', - 'â‚‹' => '−', - 'â‚Œ' => '=', - 'â‚' => '(', - 'â‚Ž' => ')', - 'â‚' => 'a', - 'â‚‘' => 'e', - 'â‚’' => 'o', - 'â‚“' => 'x', - 'â‚”' => 'É™', - 'â‚•' => 'h', - 'â‚–' => 'k', - 'â‚—' => 'l', - 'ₘ' => 'm', - 'â‚™' => 'n', - 'â‚š' => 'p', - 'â‚›' => 's', - 'â‚œ' => 't', - '₨' => 'Rs', - 'â„€' => 'a/c', - 'â„' => 'a/s', - 'â„‚' => 'C', - '℃' => '°C', - 'â„…' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Æ', - '℉' => '°F', - 'â„Š' => 'g', - 'â„‹' => 'H', - 'â„Œ' => 'H', - 'â„' => 'H', - 'â„Ž' => 'h', - 'â„' => 'ħ', - 'â„' => 'I', - 'â„‘' => 'I', - 'â„’' => 'L', - 'â„“' => 'l', - 'â„•' => 'N', - 'â„–' => 'No', - 'â„™' => 'P', - 'â„š' => 'Q', - 'â„›' => 'R', - 'â„œ' => 'R', - 'â„' => 'R', - 'â„ ' => 'SM', - 'â„¡' => 'TEL', - 'â„¢' => 'TM', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'â„­' => 'C', - 'ℯ' => 'e', - 'â„°' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'â„´' => 'o', - 'ℵ' => '×', - 'ℶ' => 'ב', - 'â„·' => '×’', - 'ℸ' => 'ד', - 'ℹ' => 'i', - 'â„»' => 'FAX', - 'ℼ' => 'Ï€', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'â„¿' => 'Π', - 'â…€' => '∑', - 'â……' => 'D', - 'â…†' => 'd', - 'â…‡' => 'e', - 'â…ˆ' => 'i', - 'â…‰' => 'j', - 'â…' => '1â„7', - 'â…‘' => '1â„9', - 'â…’' => '1â„10', - 'â…“' => '1â„3', - 'â…”' => '2â„3', - 'â…•' => '1â„5', - 'â…–' => '2â„5', - 'â…—' => '3â„5', - 'â…˜' => '4â„5', - 'â…™' => '1â„6', - 'â…š' => '5â„6', - 'â…›' => '1â„8', - 'â…œ' => '3â„8', - 'â…' => '5â„8', - 'â…ž' => '7â„8', - 'â…Ÿ' => '1â„', - 'â… ' => 'I', - 'â…¡' => 'II', - 'â…¢' => 'III', - 'â…£' => 'IV', - 'â…¤' => 'V', - 'â…¥' => 'VI', - 'â…¦' => 'VII', - 'â…§' => 'VIII', - 'â…¨' => 'IX', - 'â…©' => 'X', - 'â…ª' => 'XI', - 'â…«' => 'XII', - 'â…¬' => 'L', - 'â…­' => 'C', - 'â…®' => 'D', - 'â…¯' => 'M', - 'â…°' => 'i', - 'â…±' => 'ii', - 'â…²' => 'iii', - 'â…³' => 'iv', - 'â…´' => 'v', - 'â…µ' => 'vi', - 'â…¶' => 'vii', - 'â…·' => 'viii', - 'â…¸' => 'ix', - 'â…¹' => 'x', - 'â…º' => 'xi', - 'â…»' => 'xii', - 'â…¼' => 'l', - 'â…½' => 'c', - 'â…¾' => 'd', - 'â…¿' => 'm', - '↉' => '0â„3', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - 'â‘ ' => '1', - 'â‘¡' => '2', - 'â‘¢' => '3', - 'â‘£' => '4', - '⑤' => '5', - 'â‘¥' => '6', - '⑦' => '7', - '⑧' => '8', - '⑨' => '9', - 'â‘©' => '10', - '⑪' => '11', - 'â‘«' => '12', - '⑬' => '13', - 'â‘­' => '14', - 'â‘®' => '15', - '⑯' => '16', - 'â‘°' => '17', - '⑱' => '18', - '⑲' => '19', - '⑳' => '20', - 'â‘´' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - 'â‘·' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - 'â‘»' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - 'â‘¿' => '(12)', - 'â’€' => '(13)', - 'â’' => '(14)', - 'â’‚' => '(15)', - 'â’ƒ' => '(16)', - 'â’„' => '(17)', - 'â’…' => '(18)', - 'â’†' => '(19)', - 'â’‡' => '(20)', - 'â’ˆ' => '1.', - 'â’‰' => '2.', - 'â’Š' => '3.', - 'â’‹' => '4.', - 'â’Œ' => '5.', - 'â’' => '6.', - 'â’Ž' => '7.', - 'â’' => '8.', - 'â’' => '9.', - 'â’‘' => '10.', - 'â’’' => '11.', - 'â’“' => '12.', - 'â’”' => '13.', - 'â’•' => '14.', - 'â’–' => '15.', - 'â’—' => '16.', - 'â’˜' => '17.', - 'â’™' => '18.', - 'â’š' => '19.', - 'â’›' => '20.', - 'â’œ' => '(a)', - 'â’' => '(b)', - 'â’ž' => '(c)', - 'â’Ÿ' => '(d)', - 'â’ ' => '(e)', - 'â’¡' => '(f)', - 'â’¢' => '(g)', - 'â’£' => '(h)', - 'â’¤' => '(i)', - 'â’¥' => '(j)', - 'â’¦' => '(k)', - 'â’§' => '(l)', - 'â’¨' => '(m)', - 'â’©' => '(n)', - 'â’ª' => '(o)', - 'â’«' => '(p)', - 'â’¬' => '(q)', - 'â’­' => '(r)', - 'â’®' => '(s)', - 'â’¯' => '(t)', - 'â’°' => '(u)', - 'â’±' => '(v)', - 'â’²' => '(w)', - 'â’³' => '(x)', - 'â’´' => '(y)', - 'â’µ' => '(z)', - 'â’¶' => 'A', - 'â’·' => 'B', - 'â’¸' => 'C', - 'â’¹' => 'D', - 'â’º' => 'E', - 'â’»' => 'F', - 'â’¼' => 'G', - 'â’½' => 'H', - 'â’¾' => 'I', - 'â’¿' => 'J', - 'â“€' => 'K', - 'â“' => 'L', - 'â“‚' => 'M', - 'Ⓝ' => 'N', - 'â“„' => 'O', - 'â“…' => 'P', - 'Ⓠ' => 'Q', - 'Ⓡ' => 'R', - 'Ⓢ' => 'S', - 'Ⓣ' => 'T', - 'â“Š' => 'U', - 'â“‹' => 'V', - 'â“Œ' => 'W', - 'â“' => 'X', - 'â“Ž' => 'Y', - 'â“' => 'Z', - 'â“' => 'a', - 'â“‘' => 'b', - 'â“’' => 'c', - 'â““' => 'd', - 'â“”' => 'e', - 'â“•' => 'f', - 'â“–' => 'g', - 'â“—' => 'h', - 'ⓘ' => 'i', - 'â“™' => 'j', - 'â“š' => 'k', - 'â“›' => 'l', - 'â“œ' => 'm', - 'â“' => 'n', - 'â“ž' => 'o', - 'â“Ÿ' => 'p', - 'â“ ' => 'q', - 'â“¡' => 'r', - 'â“¢' => 's', - 'â“£' => 't', - 'ⓤ' => 'u', - 'â“¥' => 'v', - 'ⓦ' => 'w', - 'ⓧ' => 'x', - 'ⓨ' => 'y', - 'â“©' => 'z', - '⓪' => '0', - '⨌' => '∫∫∫∫', - 'â©´' => '::=', - '⩵' => '==', - '⩶' => '===', - 'â±¼' => 'j', - 'â±½' => 'V', - 'ⵯ' => 'ⵡ', - '⺟' => 'æ¯', - '⻳' => '龟', - 'â¼€' => '一', - 'â¼' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => 'ä¹™', - 'â¼…' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => 'å„¿', - '⼊' => 'å…¥', - '⼋' => 'å…«', - '⼌' => '冂', - 'â¼' => '冖', - '⼎' => '冫', - 'â¼' => '几', - 'â¼' => '凵', - '⼑' => '刀', - 'â¼’' => '力', - '⼓' => '勹', - 'â¼”' => '匕', - '⼕' => '匚', - 'â¼–' => '匸', - 'â¼—' => 'å', - '⼘' => 'åœ', - 'â¼™' => 'å©', - '⼚' => '厂', - 'â¼›' => '厶', - '⼜' => 'åˆ', - 'â¼' => 'å£', - '⼞' => 'å›—', - '⼟' => '土', - 'â¼ ' => '士', - '⼡' => '夂', - 'â¼¢' => '夊', - 'â¼£' => '夕', - '⼤' => '大', - 'â¼¥' => '女', - '⼦' => 'å­', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => 'å°', - '⼪' => 'å°¢', - '⼫' => 'å°¸', - '⼬' => 'å±®', - 'â¼­' => 'å±±', - 'â¼®' => 'å·›', - '⼯' => 'å·¥', - 'â¼°' => 'å·±', - 'â¼±' => 'å·¾', - 'â¼²' => 'å¹²', - 'â¼³' => '幺', - 'â¼´' => '广', - 'â¼µ' => 'å»´', - '⼶' => '廾', - 'â¼·' => '弋', - '⼸' => '弓', - 'â¼¹' => 'å½', - '⼺' => '彡', - 'â¼»' => 'å½³', - 'â¼¼' => '心', - 'â¼½' => '戈', - 'â¼¾' => '戶', - '⼿' => '手', - 'â½€' => '支', - 'â½' => 'æ”´', - '⽂' => 'æ–‡', - '⽃' => 'æ–—', - '⽄' => 'æ–¤', - 'â½…' => 'æ–¹', - '⽆' => 'æ— ', - '⽇' => 'æ—¥', - '⽈' => 'æ›°', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => 'æ­¢', - 'â½' => 'æ­¹', - '⽎' => '殳', - 'â½' => '毋', - 'â½' => '比', - '⽑' => '毛', - 'â½’' => 'æ°', - '⽓' => 'æ°”', - 'â½”' => 'æ°´', - '⽕' => 'ç«', - 'â½–' => '爪', - 'â½—' => '父', - '⽘' => '爻', - 'â½™' => '爿', - '⽚' => '片', - 'â½›' => '牙', - '⽜' => '牛', - 'â½' => '犬', - '⽞' => '玄', - '⽟' => '玉', - 'â½ ' => 'ç“œ', - '⽡' => '瓦', - 'â½¢' => '甘', - 'â½£' => '生', - '⽤' => '用', - 'â½¥' => 'ç”°', - '⽦' => 'ç–‹', - '⽧' => 'ç–’', - '⽨' => '癶', - '⽩' => '白', - '⽪' => 'çš®', - '⽫' => 'çš¿', - '⽬' => 'ç›®', - 'â½­' => '矛', - 'â½®' => '矢', - '⽯' => '石', - 'â½°' => '示', - 'â½±' => '禸', - 'â½²' => '禾', - 'â½³' => 'ç©´', - 'â½´' => 'ç«‹', - 'â½µ' => '竹', - '⽶' => 'ç±³', - 'â½·' => '糸', - '⽸' => '缶', - 'â½¹' => '网', - '⽺' => '羊', - 'â½»' => 'ç¾½', - 'â½¼' => 'è€', - 'â½½' => '而', - 'â½¾' => '耒', - '⽿' => '耳', - 'â¾€' => 'è¿', - 'â¾' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - 'â¾…' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => 'è™', - 'â¾' => '虫', - '⾎' => 'è¡€', - 'â¾' => 'è¡Œ', - 'â¾' => 'è¡£', - '⾑' => '襾', - 'â¾’' => '見', - '⾓' => '角', - 'â¾”' => '言', - '⾕' => 'è°·', - 'â¾–' => '豆', - 'â¾—' => '豕', - '⾘' => '豸', - 'â¾™' => 'è²', - '⾚' => '赤', - 'â¾›' => 'èµ°', - '⾜' => '足', - 'â¾' => '身', - '⾞' => '車', - '⾟' => 'è¾›', - 'â¾ ' => 'è¾°', - '⾡' => 'è¾µ', - 'â¾¢' => 'é‚‘', - 'â¾£' => 'é…‰', - '⾤' => '釆', - 'â¾¥' => '里', - '⾦' => '金', - '⾧' => 'é•·', - '⾨' => 'é–€', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => 'éš¹', - '⾬' => '雨', - 'â¾­' => 'é‘', - 'â¾®' => 'éž', - '⾯' => 'é¢', - 'â¾°' => 'é©', - 'â¾±' => '韋', - 'â¾²' => '韭', - 'â¾³' => '音', - 'â¾´' => 'é ', - 'â¾µ' => '風', - '⾶' => '飛', - 'â¾·' => '食', - '⾸' => '首', - 'â¾¹' => '香', - '⾺' => '馬', - 'â¾»' => '骨', - 'â¾¼' => '高', - 'â¾½' => 'é«Ÿ', - 'â¾¾' => '鬥', - '⾿' => '鬯', - 'â¿€' => '鬲', - 'â¿' => '鬼', - 'â¿‚' => 'é­š', - '⿃' => 'é³¥', - 'â¿„' => 'é¹µ', - 'â¿…' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => 'é»', - 'â¿Š' => '黑', - 'â¿‹' => '黹', - 'â¿Œ' => '黽', - 'â¿' => '鼎', - 'â¿Ž' => '鼓', - 'â¿' => 'é¼ ', - 'â¿' => 'é¼»', - 'â¿‘' => '齊', - 'â¿’' => 'é½’', - 'â¿“' => 'é¾', - 'â¿”' => '龜', - 'â¿•' => 'é¾ ', - ' ' => ' ', - '〶' => '〒', - '〸' => 'å', - '〹' => 'å„', - '〺' => 'å…', - 'ã‚›' => ' ã‚™', - 'ã‚œ' => ' ã‚š', - 'ã‚Ÿ' => 'より', - 'ヿ' => 'コト', - 'ㄱ' => 'á„€', - 'ㄲ' => 'á„', - 'ㄳ' => 'ᆪ', - 'ã„´' => 'á„‚', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ã„·' => 'ᄃ', - 'ㄸ' => 'á„„', - 'ㄹ' => 'á„…', - 'ㄺ' => 'ᆰ', - 'ã„»' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ã„¿' => 'ᆵ', - 'ã…€' => 'á„š', - 'ã…' => 'ᄆ', - 'ã…‚' => 'ᄇ', - 'ã…ƒ' => 'ᄈ', - 'ã…„' => 'á„¡', - 'ã……' => 'ᄉ', - 'ã…†' => 'á„Š', - 'ã…‡' => 'á„‹', - 'ã…ˆ' => 'á„Œ', - 'ã…‰' => 'á„', - 'ã…Š' => 'á„Ž', - 'ã…‹' => 'á„', - 'ã…Œ' => 'á„', - 'ã…' => 'á„‘', - 'ã…Ž' => 'á„’', - 'ã…' => 'á…¡', - 'ã…' => 'á…¢', - 'ã…‘' => 'á…£', - 'ã…’' => 'á…¤', - 'ã…“' => 'á…¥', - 'ã…”' => 'á…¦', - 'ã…•' => 'á…§', - 'ã…–' => 'á…¨', - 'ã…—' => 'á…©', - 'ã…˜' => 'á…ª', - 'ã…™' => 'á…«', - 'ã…š' => 'á…¬', - 'ã…›' => 'á…­', - 'ã…œ' => 'á…®', - 'ã…' => 'á…¯', - 'ã…ž' => 'á…°', - 'ã…Ÿ' => 'á…±', - 'ã… ' => 'á…²', - 'ã…¡' => 'á…³', - 'ã…¢' => 'á…´', - 'ã…£' => 'á…µ', - 'ã…¤' => 'á… ', - 'ã…¥' => 'á„”', - 'ã…¦' => 'á„•', - 'ã…§' => 'ᇇ', - 'ã…¨' => 'ᇈ', - 'ã…©' => 'ᇌ', - 'ã…ª' => 'ᇎ', - 'ã…«' => 'ᇓ', - 'ã…¬' => 'ᇗ', - 'ã…­' => 'ᇙ', - 'ã…®' => 'á„œ', - 'ã…¯' => 'á‡', - 'ã…°' => 'ᇟ', - 'ã…±' => 'á„', - 'ã…²' => 'á„ž', - 'ã…³' => 'á„ ', - 'ã…´' => 'á„¢', - 'ã…µ' => 'á„£', - 'ã…¶' => 'ᄧ', - 'ã…·' => 'á„©', - 'ã…¸' => 'á„«', - 'ã…¹' => 'ᄬ', - 'ã…º' => 'á„­', - 'ã…»' => 'á„®', - 'ã…¼' => 'ᄯ', - 'ã…½' => 'ᄲ', - 'ã…¾' => 'ᄶ', - 'ã…¿' => 'á…€', - 'ㆀ' => 'á…‡', - 'ã†' => 'á…Œ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'á…—', - 'ㆅ' => 'á…˜', - 'ㆆ' => 'á…™', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ã†' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㆒' => '一', - '㆓' => '二', - '㆔' => '三', - '㆕' => 'å››', - '㆖' => '上', - '㆗' => '中', - '㆘' => '下', - '㆙' => '甲', - '㆚' => 'ä¹™', - '㆛' => '丙', - '㆜' => 'ä¸', - 'ã†' => '天', - '㆞' => '地', - '㆟' => '人', - '㈀' => '(á„€)', - 'ãˆ' => '(á„‚)', - '㈂' => '(ᄃ)', - '㈃' => '(á„…)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(á„‹)', - '㈈' => '(á„Œ)', - '㈉' => '(á„Ž)', - '㈊' => '(á„)', - '㈋' => '(á„)', - '㈌' => '(á„‘)', - 'ãˆ' => '(á„’)', - '㈎' => '(가)', - 'ãˆ' => '(á„‚á…¡)', - 'ãˆ' => '(다)', - '㈑' => '(á„…á…¡)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(á„‹á…¡)', - '㈖' => '(자)', - '㈗' => '(á„Žá…¡)', - '㈘' => '(á„á…¡)', - '㈙' => '(á„á…¡)', - '㈚' => '(á„‘á…¡)', - '㈛' => '(á„’á…¡)', - '㈜' => '(주)', - 'ãˆ' => '(오전)', - '㈞' => '(á„‹á…©á„’á…®)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(å››)', - '㈤' => '(五)', - '㈥' => '(å…­)', - '㈦' => '(七)', - '㈧' => '(å…«)', - '㈨' => '(ä¹)', - '㈩' => '(å)', - '㈪' => '(月)', - '㈫' => '(ç«)', - '㈬' => '(æ°´)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(æ—¥)', - '㈱' => '(æ ª)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(å)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(ç¥)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(å­¦)', - '㈼' => '(監)', - '㈽' => '(ä¼)', - '㈾' => '(資)', - '㈿' => '(å”)', - '㉀' => '(祭)', - 'ã‰' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => 'å•', - '㉅' => 'å¹¼', - '㉆' => 'æ–‡', - '㉇' => 'ç®', - 'ã‰' => 'PTE', - '㉑' => '21', - '㉒' => '22', - '㉓' => '23', - '㉔' => '24', - '㉕' => '25', - '㉖' => '26', - '㉗' => '27', - '㉘' => '28', - '㉙' => '29', - '㉚' => '30', - '㉛' => '31', - '㉜' => '32', - 'ã‰' => '33', - '㉞' => '34', - '㉟' => '35', - '㉠' => 'á„€', - '㉡' => 'á„‚', - '㉢' => 'ᄃ', - '㉣' => 'á„…', - '㉤' => 'ᄆ', - '㉥' => 'ᄇ', - '㉦' => 'ᄉ', - '㉧' => 'á„‹', - '㉨' => 'á„Œ', - '㉩' => 'á„Ž', - '㉪' => 'á„', - '㉫' => 'á„', - '㉬' => 'á„‘', - '㉭' => 'á„’', - '㉮' => '가', - '㉯' => 'á„‚á…¡', - '㉰' => '다', - '㉱' => 'á„…á…¡', - '㉲' => '마', - '㉳' => '바', - '㉴' => '사', - '㉵' => 'á„‹á…¡', - '㉶' => '자', - '㉷' => 'á„Žá…¡', - '㉸' => 'á„á…¡', - '㉹' => 'á„á…¡', - '㉺' => 'á„‘á…¡', - '㉻' => 'á„’á…¡', - '㉼' => '참고', - '㉽' => '주의', - '㉾' => 'á„‹á…®', - '㊀' => '一', - 'ãŠ' => '二', - '㊂' => '三', - '㊃' => 'å››', - '㊄' => '五', - '㊅' => 'å…­', - '㊆' => '七', - '㊇' => 'å…«', - '㊈' => 'ä¹', - '㊉' => 'å', - '㊊' => '月', - '㊋' => 'ç«', - '㊌' => 'æ°´', - 'ãŠ' => '木', - '㊎' => '金', - 'ãŠ' => '土', - 'ãŠ' => 'æ—¥', - '㊑' => 'æ ª', - '㊒' => '有', - '㊓' => '社', - '㊔' => 'å', - '㊕' => '特', - '㊖' => '財', - '㊗' => 'ç¥', - '㊘' => '労', - '㊙' => '秘', - '㊚' => 'ç”·', - '㊛' => '女', - '㊜' => 'é©', - 'ãŠ' => '優', - '㊞' => 'å°', - '㊟' => '注', - '㊠' => 'é …', - '㊡' => '休', - '㊢' => '写', - '㊣' => 'æ­£', - '㊤' => '上', - '㊥' => '中', - '㊦' => '下', - '㊧' => 'å·¦', - '㊨' => 'å³', - '㊩' => '医', - '㊪' => 'å®—', - '㊫' => 'å­¦', - '㊬' => '監', - '㊭' => 'ä¼', - '㊮' => '資', - '㊯' => 'å”', - '㊰' => '夜', - '㊱' => '36', - '㊲' => '37', - '㊳' => '38', - '㊴' => '39', - '㊵' => '40', - '㊶' => '41', - '㊷' => '42', - '㊸' => '43', - '㊹' => '44', - '㊺' => '45', - '㊻' => '46', - '㊼' => '47', - '㊽' => '48', - '㊾' => '49', - '㊿' => '50', - 'ã‹€' => '1月', - 'ã‹' => '2月', - 'ã‹‚' => '3月', - '㋃' => '4月', - 'ã‹„' => '5月', - 'ã‹…' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - 'ã‹Š' => '11月', - 'ã‹‹' => '12月', - 'ã‹Œ' => 'Hg', - 'ã‹' => 'erg', - 'ã‹Ž' => 'eV', - 'ã‹' => 'LTD', - 'ã‹' => 'ã‚¢', - 'ã‹‘' => 'イ', - 'ã‹’' => 'ウ', - 'ã‹“' => 'エ', - 'ã‹”' => 'オ', - 'ã‹•' => 'ã‚«', - 'ã‹–' => 'ã‚­', - 'ã‹—' => 'ク', - '㋘' => 'ケ', - 'ã‹™' => 'コ', - 'ã‹š' => 'サ', - 'ã‹›' => 'ã‚·', - 'ã‹œ' => 'ス', - 'ã‹' => 'ã‚»', - 'ã‹ž' => 'ソ', - 'ã‹Ÿ' => 'ã‚¿', - 'ã‹ ' => 'ãƒ', - 'ã‹¡' => 'ツ', - 'ã‹¢' => 'テ', - 'ã‹£' => 'ト', - '㋤' => 'ナ', - 'ã‹¥' => 'ニ', - '㋦' => 'ヌ', - '㋧' => 'ãƒ', - '㋨' => 'ノ', - 'ã‹©' => 'ãƒ', - '㋪' => 'ヒ', - 'ã‹«' => 'フ', - '㋬' => 'ヘ', - 'ã‹­' => 'ホ', - 'ã‹®' => 'マ', - '㋯' => 'ミ', - 'ã‹°' => 'ム', - '㋱' => 'メ', - '㋲' => 'モ', - '㋳' => 'ヤ', - 'ã‹´' => 'ユ', - '㋵' => 'ヨ', - '㋶' => 'ラ', - 'ã‹·' => 'リ', - '㋸' => 'ル', - '㋹' => 'レ', - '㋺' => 'ロ', - 'ã‹»' => 'ワ', - '㋼' => 'ヰ', - '㋽' => 'ヱ', - '㋾' => 'ヲ', - 'ã‹¿' => '令和', - '㌀' => 'ã‚¢ãƒã‚šãƒ¼ãƒˆ', - 'ãŒ' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インãƒ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - 'ãŒ' => 'カロリー', - '㌎' => 'ガロン', - 'ãŒ' => 'ガンマ', - 'ãŒ' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローãƒ', - '㌜' => 'ケース', - 'ãŒ' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンãƒãƒ¼ãƒ ', - '㌡' => 'シリング', - '㌢' => 'センãƒ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ãƒã‚¤ãƒ„', - '㌫' => 'ãƒã‚šãƒ¼ã‚»ãƒ³ãƒˆ', - '㌬' => 'ãƒã‚šãƒ¼ãƒ„', - '㌭' => 'ãƒã‚™ãƒ¼ãƒ¬ãƒ«', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - 'ã€' => 'ポンド', - 'ã' => 'ホール', - 'ã‚' => 'ホーン', - 'ãƒ' => 'マイクロ', - 'ã„' => 'マイル', - 'ã…' => 'マッãƒ', - 'ã†' => 'マルク', - 'ã‡' => 'マンション', - 'ãˆ' => 'ミクロン', - 'ã‰' => 'ミリ', - 'ãŠ' => 'ミリãƒã‚™ãƒ¼ãƒ«', - 'ã‹' => 'メガ', - 'ãŒ' => 'メガトン', - 'ã' => 'メートル', - 'ãŽ' => 'ヤード', - 'ã' => 'ヤール', - 'ã' => 'ユアン', - 'ã‘' => 'リットル', - 'ã’' => 'リラ', - 'ã“' => 'ルピー', - 'ã”' => 'ルーブル', - 'ã•' => 'レム', - 'ã–' => 'レントゲン', - 'ã—' => 'ワット', - 'ã˜' => '0点', - 'ã™' => '1点', - 'ãš' => '2点', - 'ã›' => '3点', - 'ãœ' => '4点', - 'ã' => '5点', - 'ãž' => '6点', - 'ãŸ' => '7点', - 'ã ' => '8点', - 'ã¡' => '9点', - 'ã¢' => '10点', - 'ã£' => '11点', - 'ã¤' => '12点', - 'ã¥' => '13点', - 'ã¦' => '14点', - 'ã§' => '15点', - 'ã¨' => '16点', - 'ã©' => '17点', - 'ãª' => '18点', - 'ã«' => '19点', - 'ã¬' => '20点', - 'ã­' => '21点', - 'ã®' => '22点', - 'ã¯' => '23点', - 'ã°' => '24点', - 'ã±' => 'hPa', - 'ã²' => 'da', - 'ã³' => 'AU', - 'ã´' => 'bar', - 'ãµ' => 'oV', - 'ã¶' => 'pc', - 'ã·' => 'dm', - 'ã¸' => 'dm2', - 'ã¹' => 'dm3', - 'ãº' => 'IU', - 'ã»' => 'å¹³æˆ', - 'ã¼' => '昭和', - 'ã½' => '大正', - 'ã¾' => '明治', - 'ã¿' => 'æ ªå¼ä¼šç¤¾', - '㎀' => 'pA', - 'ãŽ' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - 'ãŽ' => 'μg', - '㎎' => 'mg', - 'ãŽ' => 'kg', - 'ãŽ' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μl', - '㎖' => 'ml', - '㎗' => 'dl', - '㎘' => 'kl', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - 'ãŽ' => 'cm', - '㎞' => 'km', - '㎟' => 'mm2', - '㎠' => 'cm2', - '㎡' => 'm2', - '㎢' => 'km2', - '㎣' => 'mm3', - '㎤' => 'cm3', - '㎥' => 'm3', - '㎦' => 'km3', - '㎧' => 'm∕s', - '㎨' => 'm∕s2', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s2', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - 'ã€' => 'kΩ', - 'ã' => 'MΩ', - 'ã‚' => 'a.m.', - 'ãƒ' => 'Bq', - 'ã„' => 'cc', - 'ã…' => 'cd', - 'ã†' => 'C∕kg', - 'ã‡' => 'Co.', - 'ãˆ' => 'dB', - 'ã‰' => 'Gy', - 'ãŠ' => 'ha', - 'ã‹' => 'HP', - 'ãŒ' => 'in', - 'ã' => 'KK', - 'ãŽ' => 'KM', - 'ã' => 'kt', - 'ã' => 'lm', - 'ã‘' => 'ln', - 'ã’' => 'log', - 'ã“' => 'lx', - 'ã”' => 'mb', - 'ã•' => 'mil', - 'ã–' => 'mol', - 'ã—' => 'PH', - 'ã˜' => 'p.m.', - 'ã™' => 'PPM', - 'ãš' => 'PR', - 'ã›' => 'sr', - 'ãœ' => 'Sv', - 'ã' => 'Wb', - 'ãž' => 'V∕m', - 'ãŸ' => 'A∕m', - 'ã ' => '1æ—¥', - 'ã¡' => '2æ—¥', - 'ã¢' => '3æ—¥', - 'ã£' => '4æ—¥', - 'ã¤' => '5æ—¥', - 'ã¥' => '6æ—¥', - 'ã¦' => '7æ—¥', - 'ã§' => '8æ—¥', - 'ã¨' => '9æ—¥', - 'ã©' => '10æ—¥', - 'ãª' => '11æ—¥', - 'ã«' => '12æ—¥', - 'ã¬' => '13æ—¥', - 'ã­' => '14æ—¥', - 'ã®' => '15æ—¥', - 'ã¯' => '16æ—¥', - 'ã°' => '17æ—¥', - 'ã±' => '18æ—¥', - 'ã²' => '19æ—¥', - 'ã³' => '20æ—¥', - 'ã´' => '21æ—¥', - 'ãµ' => '22æ—¥', - 'ã¶' => '23æ—¥', - 'ã·' => '24æ—¥', - 'ã¸' => '25æ—¥', - 'ã¹' => '26æ—¥', - 'ãº' => '27æ—¥', - 'ã»' => '28æ—¥', - 'ã¼' => '29æ—¥', - 'ã½' => '30æ—¥', - 'ã¾' => '31æ—¥', - 'ã¿' => 'gal', - 'êšœ' => 'ÑŠ', - 'êš' => 'ÑŒ', - 'ê°' => 'ê¯', - 'ꟸ' => 'Ħ', - 'ꟹ' => 'Å“', - 'ê­œ' => 'ꜧ', - 'ê­' => 'ꬷ', - 'ê­ž' => 'É«', - 'ê­Ÿ' => 'ê­’', - 'ê­©' => 'Ê', - 'ff' => 'ff', - 'ï¬' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'Õ´Õ¶', - 'ﬔ' => 'Õ´Õ¥', - 'ﬕ' => 'Õ´Õ«', - 'ﬖ' => 'Õ¾Õ¶', - 'ﬗ' => 'Õ´Õ­', - 'ﬠ' => '×¢', - 'ﬡ' => '×', - 'ﬢ' => 'ד', - 'ﬣ' => '×”', - 'ﬤ' => '×›', - 'ﬥ' => 'ל', - 'ﬦ' => '×', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ï­' => '×ל', - 'ï­' => 'Ù±', - 'ï­‘' => 'Ù±', - 'ï­’' => 'Ù»', - 'ï­“' => 'Ù»', - 'ï­”' => 'Ù»', - 'ï­•' => 'Ù»', - 'ï­–' => 'Ù¾', - 'ï­—' => 'Ù¾', - 'ï­˜' => 'Ù¾', - 'ï­™' => 'Ù¾', - 'ï­š' => 'Ú€', - 'ï­›' => 'Ú€', - 'ï­œ' => 'Ú€', - 'ï­' => 'Ú€', - 'ï­ž' => 'Ùº', - 'ï­Ÿ' => 'Ùº', - 'ï­ ' => 'Ùº', - 'ï­¡' => 'Ùº', - 'ï­¢' => 'Ù¿', - 'ï­£' => 'Ù¿', - 'ï­¤' => 'Ù¿', - 'ï­¥' => 'Ù¿', - 'ï­¦' => 'Ù¹', - 'ï­§' => 'Ù¹', - 'ï­¨' => 'Ù¹', - 'ï­©' => 'Ù¹', - 'ï­ª' => 'Ú¤', - 'ï­«' => 'Ú¤', - 'ï­¬' => 'Ú¤', - 'ï­­' => 'Ú¤', - 'ï­®' => 'Ú¦', - 'ï­¯' => 'Ú¦', - 'ï­°' => 'Ú¦', - 'ï­±' => 'Ú¦', - 'ï­²' => 'Ú„', - 'ï­³' => 'Ú„', - 'ï­´' => 'Ú„', - 'ï­µ' => 'Ú„', - 'ï­¶' => 'Úƒ', - 'ï­·' => 'Úƒ', - 'ï­¸' => 'Úƒ', - 'ï­¹' => 'Úƒ', - 'ï­º' => 'Ú†', - 'ï­»' => 'Ú†', - 'ï­¼' => 'Ú†', - 'ï­½' => 'Ú†', - 'ï­¾' => 'Ú‡', - 'ï­¿' => 'Ú‡', - 'ﮀ' => 'Ú‡', - 'ï®' => 'Ú‡', - 'ﮂ' => 'Ú', - 'ﮃ' => 'Ú', - 'ﮄ' => 'ÚŒ', - 'ï®…' => 'ÚŒ', - 'ﮆ' => 'ÚŽ', - 'ﮇ' => 'ÚŽ', - 'ﮈ' => 'Úˆ', - 'ﮉ' => 'Úˆ', - 'ﮊ' => 'Ú˜', - 'ﮋ' => 'Ú˜', - 'ﮌ' => 'Ú‘', - 'ï®' => 'Ú‘', - 'ﮎ' => 'Ú©', - 'ï®' => 'Ú©', - 'ï®' => 'Ú©', - 'ﮑ' => 'Ú©', - 'ï®’' => 'Ú¯', - 'ﮓ' => 'Ú¯', - 'ï®”' => 'Ú¯', - 'ﮕ' => 'Ú¯', - 'ï®–' => 'Ú³', - 'ï®—' => 'Ú³', - 'ﮘ' => 'Ú³', - 'ï®™' => 'Ú³', - 'ﮚ' => 'Ú±', - 'ï®›' => 'Ú±', - 'ﮜ' => 'Ú±', - 'ï®' => 'Ú±', - 'ﮞ' => 'Úº', - 'ﮟ' => 'Úº', - 'ï® ' => 'Ú»', - 'ﮡ' => 'Ú»', - 'ﮢ' => 'Ú»', - 'ﮣ' => 'Ú»', - 'ﮤ' => 'Û•Ù”', - 'ﮥ' => 'Û•Ù”', - 'ﮦ' => 'Û', - 'ﮧ' => 'Û', - 'ﮨ' => 'Û', - 'ﮩ' => 'Û', - 'ﮪ' => 'Ú¾', - 'ﮫ' => 'Ú¾', - 'ﮬ' => 'Ú¾', - 'ï®­' => 'Ú¾', - 'ï®®' => 'Û’', - 'ﮯ' => 'Û’', - 'ï®°' => 'Û’Ù”', - 'ï®±' => 'Û’Ù”', - 'ﯓ' => 'Ú­', - 'ﯔ' => 'Ú­', - 'ﯕ' => 'Ú­', - 'ﯖ' => 'Ú­', - 'ﯗ' => 'Û‡', - 'ﯘ' => 'Û‡', - 'ﯙ' => 'Û†', - 'ﯚ' => 'Û†', - 'ﯛ' => 'Ûˆ', - 'ﯜ' => 'Ûˆ', - 'ï¯' => 'Û‡Ù´', - 'ﯞ' => 'Û‹', - 'ﯟ' => 'Û‹', - 'ﯠ' => 'Û…', - 'ﯡ' => 'Û…', - 'ﯢ' => 'Û‰', - 'ﯣ' => 'Û‰', - 'ﯤ' => 'Û', - 'ﯥ' => 'Û', - 'ﯦ' => 'Û', - 'ﯧ' => 'Û', - 'ﯨ' => 'Ù‰', - 'ﯩ' => 'Ù‰', - 'ﯪ' => 'ئا', - 'ﯫ' => 'ئا', - 'ﯬ' => 'ÙŠÙ”Û•', - 'ﯭ' => 'ÙŠÙ”Û•', - 'ﯮ' => 'ÙŠÙ”Ùˆ', - 'ﯯ' => 'ÙŠÙ”Ùˆ', - 'ﯰ' => 'ÙŠÙ”Û‡', - 'ﯱ' => 'ÙŠÙ”Û‡', - 'ﯲ' => 'ÙŠÙ”Û†', - 'ﯳ' => 'ÙŠÙ”Û†', - 'ﯴ' => 'ÙŠÙ”Ûˆ', - 'ﯵ' => 'ÙŠÙ”Ûˆ', - 'ﯶ' => 'ÙŠÙ”Û', - 'ﯷ' => 'ÙŠÙ”Û', - 'ﯸ' => 'ÙŠÙ”Û', - 'ﯹ' => 'ÙŠÙ”Ù‰', - 'ﯺ' => 'ÙŠÙ”Ù‰', - 'ﯻ' => 'ÙŠÙ”Ù‰', - 'ﯼ' => 'ÛŒ', - 'ﯽ' => 'ÛŒ', - 'ﯾ' => 'ÛŒ', - 'ﯿ' => 'ÛŒ', - 'ï°€' => 'ئج', - 'ï°' => 'ئح', - 'ï°‚' => 'ÙŠÙ”Ù…', - 'ï°ƒ' => 'ÙŠÙ”Ù‰', - 'ï°„' => 'ÙŠÙ”ÙŠ', - 'ï°…' => 'بج', - 'ï°†' => 'بح', - 'ï°‡' => 'بخ', - 'ï°ˆ' => 'بم', - 'ï°‰' => 'بى', - 'ï°Š' => 'بي', - 'ï°‹' => 'تج', - 'ï°Œ' => 'تح', - 'ï°' => 'تخ', - 'ï°Ž' => 'تم', - 'ï°' => 'تى', - 'ï°' => 'تي', - 'ï°‘' => 'ثج', - 'ï°’' => 'ثم', - 'ï°“' => 'ثى', - 'ï°”' => 'ثي', - 'ï°•' => 'جح', - 'ï°–' => 'جم', - 'ï°—' => 'حج', - 'ï°˜' => 'حم', - 'ï°™' => 'خج', - 'ï°š' => 'خح', - 'ï°›' => 'خم', - 'ï°œ' => 'سج', - 'ï°' => 'سح', - 'ï°ž' => 'سخ', - 'ï°Ÿ' => 'سم', - 'ï° ' => 'صح', - 'ï°¡' => 'صم', - 'ï°¢' => 'ضج', - 'ï°£' => 'ضح', - 'ï°¤' => 'ضخ', - 'ï°¥' => 'ضم', - 'ï°¦' => 'طح', - 'ï°§' => 'طم', - 'ï°¨' => 'ظم', - 'ï°©' => 'عج', - 'ï°ª' => 'عم', - 'ï°«' => 'غج', - 'ï°¬' => 'غم', - 'ï°­' => 'Ùج', - 'ï°®' => 'ÙØ­', - 'ï°¯' => 'ÙØ®', - 'ï°°' => 'ÙÙ…', - 'ï°±' => 'ÙÙ‰', - 'ï°²' => 'ÙÙŠ', - 'ï°³' => 'قح', - 'ï°´' => 'قم', - 'ï°µ' => 'قى', - 'ï°¶' => 'قي', - 'ï°·' => 'كا', - 'ï°¸' => 'كج', - 'ï°¹' => 'كح', - 'ï°º' => 'كخ', - 'ï°»' => 'كل', - 'ï°¼' => 'كم', - 'ï°½' => 'كى', - 'ï°¾' => 'كي', - 'ï°¿' => 'لج', - 'ï±€' => 'لح', - 'ï±' => 'لخ', - 'ﱂ' => 'لم', - 'ﱃ' => 'لى', - 'ﱄ' => 'لي', - 'ï±…' => 'مج', - 'ﱆ' => 'مح', - 'ﱇ' => 'مخ', - 'ﱈ' => 'مم', - 'ﱉ' => 'مى', - 'ﱊ' => 'مي', - 'ﱋ' => 'نج', - 'ﱌ' => 'نح', - 'ï±' => 'نخ', - 'ﱎ' => 'نم', - 'ï±' => 'نى', - 'ï±' => 'ني', - 'ﱑ' => 'هج', - 'ï±’' => 'هم', - 'ﱓ' => 'هى', - 'ï±”' => 'هي', - 'ﱕ' => 'يج', - 'ï±–' => 'يح', - 'ï±—' => 'يخ', - 'ﱘ' => 'يم', - 'ï±™' => 'يى', - 'ﱚ' => 'يي', - 'ï±›' => 'ذٰ', - 'ﱜ' => 'رٰ', - 'ï±' => 'ىٰ', - 'ﱞ' => ' ٌّ', - 'ﱟ' => ' ÙÙ‘', - 'ï± ' => ' ÙŽÙ‘', - 'ﱡ' => ' ÙÙ‘', - 'ï±¢' => ' ÙÙ‘', - 'ï±£' => ' ّٰ', - 'ﱤ' => 'ئر', - 'ï±¥' => 'ئز', - 'ﱦ' => 'ÙŠÙ”Ù…', - 'ﱧ' => 'ÙŠÙ”Ù†', - 'ﱨ' => 'ÙŠÙ”Ù‰', - 'ﱩ' => 'ÙŠÙ”ÙŠ', - 'ﱪ' => 'بر', - 'ﱫ' => 'بز', - 'ﱬ' => 'بم', - 'ï±­' => 'بن', - 'ï±®' => 'بى', - 'ﱯ' => 'بي', - 'ï±°' => 'تر', - 'ï±±' => 'تز', - 'ï±²' => 'تم', - 'ï±³' => 'تن', - 'ï±´' => 'تى', - 'ï±µ' => 'تي', - 'ﱶ' => 'ثر', - 'ï±·' => 'ثز', - 'ﱸ' => 'ثم', - 'ï±¹' => 'ثن', - 'ﱺ' => 'ثى', - 'ï±»' => 'ثي', - 'ï±¼' => 'ÙÙ‰', - 'ï±½' => 'ÙÙŠ', - 'ï±¾' => 'قى', - 'ﱿ' => 'قي', - 'ï²€' => 'كا', - 'ï²' => 'كل', - 'ﲂ' => 'كم', - 'ﲃ' => 'كى', - 'ﲄ' => 'كي', - 'ï²…' => 'لم', - 'ﲆ' => 'لى', - 'ﲇ' => 'لي', - 'ﲈ' => 'ما', - 'ﲉ' => 'مم', - 'ﲊ' => 'نر', - 'ﲋ' => 'نز', - 'ﲌ' => 'نم', - 'ï²' => 'نن', - 'ﲎ' => 'نى', - 'ï²' => 'ني', - 'ï²' => 'ىٰ', - 'ﲑ' => 'ير', - 'ï²’' => 'يز', - 'ﲓ' => 'يم', - 'ï²”' => 'ين', - 'ﲕ' => 'يى', - 'ï²–' => 'يي', - 'ï²—' => 'ئج', - 'ﲘ' => 'ئح', - 'ï²™' => 'ئخ', - 'ﲚ' => 'ÙŠÙ”Ù…', - 'ï²›' => 'ÙŠÙ”Ù‡', - 'ﲜ' => 'بج', - 'ï²' => 'بح', - 'ﲞ' => 'بخ', - 'ﲟ' => 'بم', - 'ï² ' => 'به', - 'ﲡ' => 'تج', - 'ï²¢' => 'تح', - 'ï²£' => 'تخ', - 'ﲤ' => 'تم', - 'ï²¥' => 'ته', - 'ﲦ' => 'ثم', - 'ﲧ' => 'جح', - 'ﲨ' => 'جم', - 'ﲩ' => 'حج', - 'ﲪ' => 'حم', - 'ﲫ' => 'خج', - 'ﲬ' => 'خم', - 'ï²­' => 'سج', - 'ï²®' => 'سح', - 'ﲯ' => 'سخ', - 'ï²°' => 'سم', - 'ï²±' => 'صح', - 'ï²²' => 'صخ', - 'ï²³' => 'صم', - 'ï²´' => 'ضج', - 'ï²µ' => 'ضح', - 'ﲶ' => 'ضخ', - 'ï²·' => 'ضم', - 'ﲸ' => 'طح', - 'ï²¹' => 'ظم', - 'ﲺ' => 'عج', - 'ï²»' => 'عم', - 'ï²¼' => 'غج', - 'ï²½' => 'غم', - 'ï²¾' => 'Ùج', - 'ﲿ' => 'ÙØ­', - 'ï³€' => 'ÙØ®', - 'ï³' => 'ÙÙ…', - 'ﳂ' => 'قح', - 'ﳃ' => 'قم', - 'ﳄ' => 'كج', - 'ï³…' => 'كح', - 'ﳆ' => 'كخ', - 'ﳇ' => 'كل', - 'ﳈ' => 'كم', - 'ﳉ' => 'لج', - 'ﳊ' => 'لح', - 'ﳋ' => 'لخ', - 'ﳌ' => 'لم', - 'ï³' => 'له', - 'ﳎ' => 'مج', - 'ï³' => 'مح', - 'ï³' => 'مخ', - 'ﳑ' => 'مم', - 'ï³’' => 'نج', - 'ﳓ' => 'نح', - 'ï³”' => 'نخ', - 'ﳕ' => 'نم', - 'ï³–' => 'نه', - 'ï³—' => 'هج', - 'ﳘ' => 'هم', - 'ï³™' => 'هٰ', - 'ﳚ' => 'يج', - 'ï³›' => 'يح', - 'ﳜ' => 'يخ', - 'ï³' => 'يم', - 'ﳞ' => 'يه', - 'ﳟ' => 'ÙŠÙ”Ù…', - 'ï³ ' => 'ÙŠÙ”Ù‡', - 'ﳡ' => 'بم', - 'ï³¢' => 'به', - 'ï³£' => 'تم', - 'ﳤ' => 'ته', - 'ï³¥' => 'ثم', - 'ﳦ' => 'ثه', - 'ﳧ' => 'سم', - 'ﳨ' => 'سه', - 'ﳩ' => 'شم', - 'ﳪ' => 'شه', - 'ﳫ' => 'كل', - 'ﳬ' => 'كم', - 'ï³­' => 'لم', - 'ï³®' => 'نم', - 'ﳯ' => 'نه', - 'ï³°' => 'يم', - 'ï³±' => 'يه', - 'ï³²' => 'Ù€ÙŽÙ‘', - 'ï³³' => 'Ù€ÙÙ‘', - 'ï³´' => 'Ù€ÙÙ‘', - 'ï³µ' => 'طى', - 'ﳶ' => 'طي', - 'ï³·' => 'عى', - 'ﳸ' => 'عي', - 'ï³¹' => 'غى', - 'ﳺ' => 'غي', - 'ï³»' => 'سى', - 'ï³¼' => 'سي', - 'ï³½' => 'شى', - 'ï³¾' => 'شي', - 'ﳿ' => 'حى', - 'ï´€' => 'حي', - 'ï´' => 'جى', - 'ï´‚' => 'جي', - 'ï´ƒ' => 'خى', - 'ï´„' => 'خي', - 'ï´…' => 'صى', - 'ï´†' => 'صي', - 'ï´‡' => 'ضى', - 'ï´ˆ' => 'ضي', - 'ï´‰' => 'شج', - 'ï´Š' => 'شح', - 'ï´‹' => 'شخ', - 'ï´Œ' => 'شم', - 'ï´' => 'شر', - 'ï´Ž' => 'سر', - 'ï´' => 'صر', - 'ï´' => 'ضر', - 'ï´‘' => 'طى', - 'ï´’' => 'طي', - 'ï´“' => 'عى', - 'ï´”' => 'عي', - 'ï´•' => 'غى', - 'ï´–' => 'غي', - 'ï´—' => 'سى', - 'ï´˜' => 'سي', - 'ï´™' => 'شى', - 'ï´š' => 'شي', - 'ï´›' => 'حى', - 'ï´œ' => 'حي', - 'ï´' => 'جى', - 'ï´ž' => 'جي', - 'ï´Ÿ' => 'خى', - 'ï´ ' => 'خي', - 'ï´¡' => 'صى', - 'ï´¢' => 'صي', - 'ï´£' => 'ضى', - 'ï´¤' => 'ضي', - 'ï´¥' => 'شج', - 'ï´¦' => 'شح', - 'ï´§' => 'شخ', - 'ï´¨' => 'شم', - 'ï´©' => 'شر', - 'ï´ª' => 'سر', - 'ï´«' => 'صر', - 'ï´¬' => 'ضر', - 'ï´­' => 'شج', - 'ï´®' => 'شح', - 'ï´¯' => 'شخ', - 'ï´°' => 'شم', - 'ï´±' => 'سه', - 'ï´²' => 'شه', - 'ï´³' => 'طم', - 'ï´´' => 'سج', - 'ï´µ' => 'سح', - 'ï´¶' => 'سخ', - 'ï´·' => 'شج', - 'ï´¸' => 'شح', - 'ï´¹' => 'شخ', - 'ï´º' => 'طم', - 'ï´»' => 'ظم', - 'ï´¼' => 'اً', - 'ï´½' => 'اً', - 'ïµ' => 'تجم', - 'ﵑ' => 'تحج', - 'ïµ’' => 'تحج', - 'ﵓ' => 'تحم', - 'ïµ”' => 'تخم', - 'ﵕ' => 'تمج', - 'ïµ–' => 'تمح', - 'ïµ—' => 'تمخ', - 'ﵘ' => 'جمح', - 'ïµ™' => 'جمح', - 'ﵚ' => 'حمي', - 'ïµ›' => 'حمى', - 'ﵜ' => 'سحج', - 'ïµ' => 'سجح', - 'ﵞ' => 'سجى', - 'ﵟ' => 'سمح', - 'ïµ ' => 'سمح', - 'ﵡ' => 'سمج', - 'ïµ¢' => 'سمم', - 'ïµ£' => 'سمم', - 'ﵤ' => 'صحح', - 'ïµ¥' => 'صحح', - 'ﵦ' => 'صمم', - 'ﵧ' => 'شحم', - 'ﵨ' => 'شحم', - 'ﵩ' => 'شجي', - 'ﵪ' => 'شمخ', - 'ﵫ' => 'شمخ', - 'ﵬ' => 'شمم', - 'ïµ­' => 'شمم', - 'ïµ®' => 'ضحى', - 'ﵯ' => 'ضخم', - 'ïµ°' => 'ضخم', - 'ïµ±' => 'طمح', - 'ïµ²' => 'طمح', - 'ïµ³' => 'طمم', - 'ïµ´' => 'طمي', - 'ïµµ' => 'عجم', - 'ﵶ' => 'عمم', - 'ïµ·' => 'عمم', - 'ﵸ' => 'عمى', - 'ïµ¹' => 'غمم', - 'ﵺ' => 'غمي', - 'ïµ»' => 'غمى', - 'ïµ¼' => 'Ùخم', - 'ïµ½' => 'Ùخم', - 'ïµ¾' => 'قمح', - 'ﵿ' => 'قمم', - 'ﶀ' => 'لحم', - 'ï¶' => 'لحي', - 'ﶂ' => 'لحى', - 'ﶃ' => 'لجج', - 'ﶄ' => 'لجج', - 'ﶅ' => 'لخم', - 'ﶆ' => 'لخم', - 'ﶇ' => 'لمح', - 'ﶈ' => 'لمح', - 'ﶉ' => 'محج', - 'ﶊ' => 'محم', - 'ﶋ' => 'محي', - 'ﶌ' => 'مجح', - 'ï¶' => 'مجم', - 'ﶎ' => 'مخج', - 'ï¶' => 'مخم', - 'ﶒ' => 'مجخ', - 'ﶓ' => 'همج', - 'ﶔ' => 'همم', - 'ﶕ' => 'نحم', - 'ﶖ' => 'نحى', - 'ﶗ' => 'نجم', - 'ﶘ' => 'نجم', - 'ﶙ' => 'نجى', - 'ﶚ' => 'نمي', - 'ﶛ' => 'نمى', - 'ﶜ' => 'يمم', - 'ï¶' => 'يمم', - 'ﶞ' => 'بخي', - 'ﶟ' => 'تجي', - 'ﶠ' => 'تجى', - 'ﶡ' => 'تخي', - 'ﶢ' => 'تخى', - 'ﶣ' => 'تمي', - 'ﶤ' => 'تمى', - 'ﶥ' => 'جمي', - 'ﶦ' => 'جحى', - 'ﶧ' => 'جمى', - 'ﶨ' => 'سخى', - 'ﶩ' => 'صحي', - 'ﶪ' => 'شحي', - 'ﶫ' => 'ضحي', - 'ﶬ' => 'لجي', - 'ﶭ' => 'لمي', - 'ﶮ' => 'يحي', - 'ﶯ' => 'يجي', - 'ﶰ' => 'يمي', - 'ﶱ' => 'ممي', - 'ﶲ' => 'قمي', - 'ﶳ' => 'نحي', - 'ﶴ' => 'قمح', - 'ﶵ' => 'لحم', - 'ﶶ' => 'عمي', - 'ﶷ' => 'كمي', - 'ﶸ' => 'نجح', - 'ﶹ' => 'مخي', - 'ﶺ' => 'لجم', - 'ﶻ' => 'كمم', - 'ﶼ' => 'لجم', - 'ﶽ' => 'نجح', - 'ﶾ' => 'جحي', - 'ﶿ' => 'حجي', - 'ï·€' => 'مجي', - 'ï·' => 'Ùمي', - 'ï·‚' => 'بحي', - 'ï·ƒ' => 'كمم', - 'ï·„' => 'عجم', - 'ï·…' => 'صمم', - 'ï·†' => 'سخي', - 'ï·‡' => 'نجي', - 'ï·°' => 'صلے', - 'ï·±' => 'قلے', - 'ï·²' => 'الله', - 'ï·³' => 'اكبر', - 'ï·´' => 'محمد', - 'ï·µ' => 'صلعم', - 'ï·¶' => 'رسول', - 'ï··' => 'عليه', - 'ï·¸' => 'وسلم', - 'ï·¹' => 'صلى', - 'ï·º' => 'صلى الله عليه وسلم', - 'ï·»' => 'جل جلاله', - 'ï·¼' => 'ریال', - 'ï¸' => ',', - '︑' => 'ã€', - '︒' => '。', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︗' => '〖', - '︘' => '〗', - '︙' => '...', - '︰' => '..', - '︱' => '—', - '︲' => '–', - '︳' => '_', - '︴' => '_', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '〔', - '︺' => '〕', - '︻' => 'ã€', - '︼' => '】', - '︽' => '《', - '︾' => '》', - '︿' => '〈', - 'ï¹€' => '〉', - 'ï¹' => '「', - '﹂' => 'ã€', - '﹃' => '『', - '﹄' => 'ã€', - '﹇' => '[', - '﹈' => ']', - '﹉' => ' Ì…', - '﹊' => ' Ì…', - '﹋' => ' Ì…', - '﹌' => ' Ì…', - 'ï¹' => '_', - '﹎' => '_', - 'ï¹' => '_', - 'ï¹' => ',', - '﹑' => 'ã€', - 'ï¹’' => '.', - 'ï¹”' => ';', - '﹕' => ':', - 'ï¹–' => '?', - 'ï¹—' => '!', - '﹘' => '—', - 'ï¹™' => '(', - '﹚' => ')', - 'ï¹›' => '{', - '﹜' => '}', - 'ï¹' => '〔', - '﹞' => '〕', - '﹟' => '#', - 'ï¹ ' => '&', - '﹡' => '*', - 'ï¹¢' => '+', - 'ï¹£' => '-', - '﹤' => '<', - 'ï¹¥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - 'ï¹°' => ' Ù‹', - 'ï¹±' => 'ـً', - 'ï¹²' => ' ÙŒ', - 'ï¹´' => ' Ù', - 'ﹶ' => ' ÙŽ', - 'ï¹·' => 'Ù€ÙŽ', - 'ﹸ' => ' Ù', - 'ï¹¹' => 'Ù€Ù', - 'ﹺ' => ' Ù', - 'ï¹»' => 'Ù€Ù', - 'ï¹¼' => ' Ù‘', - 'ï¹½' => 'ـّ', - 'ï¹¾' => ' Ù’', - 'ﹿ' => 'ـْ', - 'ﺀ' => 'Ø¡', - 'ïº' => 'آ', - 'ﺂ' => 'آ', - 'ﺃ' => 'أ', - 'ﺄ' => 'أ', - 'ﺅ' => 'ÙˆÙ”', - 'ﺆ' => 'ÙˆÙ”', - 'ﺇ' => 'إ', - 'ﺈ' => 'إ', - 'ﺉ' => 'ÙŠÙ”', - 'ﺊ' => 'ÙŠÙ”', - 'ﺋ' => 'ÙŠÙ”', - 'ﺌ' => 'ÙŠÙ”', - 'ïº' => 'ا', - 'ﺎ' => 'ا', - 'ïº' => 'ب', - 'ïº' => 'ب', - 'ﺑ' => 'ب', - 'ﺒ' => 'ب', - 'ﺓ' => 'Ø©', - 'ﺔ' => 'Ø©', - 'ﺕ' => 'ت', - 'ﺖ' => 'ت', - 'ﺗ' => 'ت', - 'ﺘ' => 'ت', - 'ﺙ' => 'Ø«', - 'ﺚ' => 'Ø«', - 'ﺛ' => 'Ø«', - 'ﺜ' => 'Ø«', - 'ïº' => 'ج', - 'ﺞ' => 'ج', - 'ﺟ' => 'ج', - 'ﺠ' => 'ج', - 'ﺡ' => 'Ø­', - 'ﺢ' => 'Ø­', - 'ﺣ' => 'Ø­', - 'ﺤ' => 'Ø­', - 'ﺥ' => 'Ø®', - 'ﺦ' => 'Ø®', - 'ﺧ' => 'Ø®', - 'ﺨ' => 'Ø®', - 'ﺩ' => 'د', - 'ﺪ' => 'د', - 'ﺫ' => 'Ø°', - 'ﺬ' => 'Ø°', - 'ﺭ' => 'ر', - 'ﺮ' => 'ر', - 'ﺯ' => 'ز', - 'ﺰ' => 'ز', - 'ﺱ' => 'س', - 'ﺲ' => 'س', - 'ﺳ' => 'س', - 'ﺴ' => 'س', - 'ﺵ' => 'Ø´', - 'ﺶ' => 'Ø´', - 'ﺷ' => 'Ø´', - 'ﺸ' => 'Ø´', - 'ﺹ' => 'ص', - 'ﺺ' => 'ص', - 'ﺻ' => 'ص', - 'ﺼ' => 'ص', - 'ﺽ' => 'ض', - 'ﺾ' => 'ض', - 'ﺿ' => 'ض', - 'ﻀ' => 'ض', - 'ï»' => 'Ø·', - 'ﻂ' => 'Ø·', - 'ﻃ' => 'Ø·', - 'ﻄ' => 'Ø·', - 'ï»…' => 'ظ', - 'ﻆ' => 'ظ', - 'ﻇ' => 'ظ', - 'ﻈ' => 'ظ', - 'ﻉ' => 'ع', - 'ﻊ' => 'ع', - 'ﻋ' => 'ع', - 'ﻌ' => 'ع', - 'ï»' => 'غ', - 'ﻎ' => 'غ', - 'ï»' => 'غ', - 'ï»' => 'غ', - 'ﻑ' => 'Ù', - 'ï»’' => 'Ù', - 'ﻓ' => 'Ù', - 'ï»”' => 'Ù', - 'ﻕ' => 'Ù‚', - 'ï»–' => 'Ù‚', - 'ï»—' => 'Ù‚', - 'ﻘ' => 'Ù‚', - 'ï»™' => 'Ùƒ', - 'ﻚ' => 'Ùƒ', - 'ï»›' => 'Ùƒ', - 'ﻜ' => 'Ùƒ', - 'ï»' => 'Ù„', - 'ﻞ' => 'Ù„', - 'ﻟ' => 'Ù„', - 'ï» ' => 'Ù„', - 'ﻡ' => 'Ù…', - 'ﻢ' => 'Ù…', - 'ﻣ' => 'Ù…', - 'ﻤ' => 'Ù…', - 'ﻥ' => 'Ù†', - 'ﻦ' => 'Ù†', - 'ﻧ' => 'Ù†', - 'ﻨ' => 'Ù†', - 'ﻩ' => 'Ù‡', - 'ﻪ' => 'Ù‡', - 'ﻫ' => 'Ù‡', - 'ﻬ' => 'Ù‡', - 'ï»­' => 'Ùˆ', - 'ï»®' => 'Ùˆ', - 'ﻯ' => 'Ù‰', - 'ï»°' => 'Ù‰', - 'ï»±' => 'ÙŠ', - 'ﻲ' => 'ÙŠ', - 'ﻳ' => 'ÙŠ', - 'ï»´' => 'ÙŠ', - 'ﻵ' => 'لآ', - 'ﻶ' => 'لآ', - 'ï»·' => 'لأ', - 'ﻸ' => 'لأ', - 'ﻹ' => 'لإ', - 'ﻺ' => 'لإ', - 'ï»»' => 'لا', - 'ﻼ' => 'لا', - 'ï¼' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - 'ï¼…' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - 'ï¼' => '-', - '.' => '.', - 'ï¼' => '/', - 'ï¼' => '0', - '1' => '1', - 'ï¼’' => '2', - '3' => '3', - 'ï¼”' => '4', - '5' => '5', - 'ï¼–' => '6', - 'ï¼—' => '7', - '8' => '8', - 'ï¼™' => '9', - ':' => ':', - 'ï¼›' => ';', - '<' => '<', - 'ï¼' => '=', - '>' => '>', - '?' => '?', - 'ï¼ ' => '@', - 'A' => 'A', - 'ï¼¢' => 'B', - 'ï¼£' => 'C', - 'D' => 'D', - 'ï¼¥' => 'E', - 'F' => 'F', - 'G' => 'G', - 'H' => 'H', - 'I' => 'I', - 'J' => 'J', - 'K' => 'K', - 'L' => 'L', - 'ï¼­' => 'M', - 'ï¼®' => 'N', - 'O' => 'O', - 'ï¼°' => 'P', - 'ï¼±' => 'Q', - 'ï¼²' => 'R', - 'ï¼³' => 'S', - 'ï¼´' => 'T', - 'ï¼µ' => 'U', - 'V' => 'V', - 'ï¼·' => 'W', - 'X' => 'X', - 'ï¼¹' => 'Y', - 'Z' => 'Z', - 'ï¼»' => '[', - 'ï¼¼' => '\\', - 'ï¼½' => ']', - 'ï¼¾' => '^', - '_' => '_', - 'ï½€' => '`', - 'ï½' => 'a', - 'b' => 'b', - 'c' => 'c', - 'd' => 'd', - 'ï½…' => 'e', - 'f' => 'f', - 'g' => 'g', - 'h' => 'h', - 'i' => 'i', - 'j' => 'j', - 'k' => 'k', - 'l' => 'l', - 'ï½' => 'm', - 'n' => 'n', - 'ï½' => 'o', - 'ï½' => 'p', - 'q' => 'q', - 'ï½’' => 'r', - 's' => 's', - 'ï½”' => 't', - 'u' => 'u', - 'ï½–' => 'v', - 'ï½—' => 'w', - 'x' => 'x', - 'ï½™' => 'y', - 'z' => 'z', - 'ï½›' => '{', - '|' => '|', - 'ï½' => '}', - '~' => '~', - '⦅' => '⦅', - 'ï½ ' => '⦆', - '。' => '。', - 'ï½¢' => '「', - 'ï½£' => 'ã€', - '、' => 'ã€', - 'ï½¥' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ã‚¡', - 'ィ' => 'ã‚£', - 'ゥ' => 'ã‚¥', - 'ェ' => 'ェ', - 'ォ' => 'ã‚©', - 'ャ' => 'ャ', - 'ï½­' => 'ュ', - 'ï½®' => 'ョ', - 'ッ' => 'ッ', - 'ï½°' => 'ー', - 'ï½±' => 'ã‚¢', - 'ï½²' => 'イ', - 'ï½³' => 'ウ', - 'ï½´' => 'エ', - 'ï½µ' => 'オ', - 'カ' => 'ã‚«', - 'ï½·' => 'ã‚­', - 'ク' => 'ク', - 'ï½¹' => 'ケ', - 'コ' => 'コ', - 'ï½»' => 'サ', - 'ï½¼' => 'ã‚·', - 'ï½½' => 'ス', - 'ï½¾' => 'ã‚»', - 'ソ' => 'ソ', - 'ï¾€' => 'ã‚¿', - 'ï¾' => 'ãƒ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ï¾…' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ãƒ', - 'ノ' => 'ノ', - 'ハ' => 'ãƒ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ï¾' => 'ヘ', - 'ホ' => 'ホ', - 'ï¾' => 'マ', - 'ï¾' => 'ミ', - 'ム' => 'ム', - 'ï¾’' => 'メ', - 'モ' => 'モ', - 'ï¾”' => 'ヤ', - 'ユ' => 'ユ', - 'ï¾–' => 'ヨ', - 'ï¾—' => 'ラ', - 'リ' => 'リ', - 'ï¾™' => 'ル', - 'レ' => 'レ', - 'ï¾›' => 'ロ', - 'ワ' => 'ワ', - 'ï¾' => 'ン', - '゙' => 'ã‚™', - '゚' => 'ã‚š', - 'ï¾ ' => 'á… ', - 'ᄀ' => 'á„€', - 'ï¾¢' => 'á„', - 'ï¾£' => 'ᆪ', - 'ᄂ' => 'á„‚', - 'ï¾¥' => 'ᆬ', - 'ᆭ' => 'ᆭ', - 'ᄃ' => 'ᄃ', - 'ᄄ' => 'á„„', - 'ᄅ' => 'á„…', - 'ᆰ' => 'ᆰ', - 'ᆱ' => 'ᆱ', - 'ᆲ' => 'ᆲ', - 'ï¾­' => 'ᆳ', - 'ï¾®' => 'ᆴ', - 'ᆵ' => 'ᆵ', - 'ï¾°' => 'á„š', - 'ï¾±' => 'ᄆ', - 'ï¾²' => 'ᄇ', - 'ï¾³' => 'ᄈ', - 'ï¾´' => 'á„¡', - 'ï¾µ' => 'ᄉ', - 'ᄊ' => 'á„Š', - 'ï¾·' => 'á„‹', - 'ᄌ' => 'á„Œ', - 'ï¾¹' => 'á„', - 'ᄎ' => 'á„Ž', - 'ï¾»' => 'á„', - 'ï¾¼' => 'á„', - 'ï¾½' => 'á„‘', - 'ï¾¾' => 'á„’', - 'ï¿‚' => 'á…¡', - 'ᅢ' => 'á…¢', - 'ï¿„' => 'á…£', - 'ï¿…' => 'á…¤', - 'ᅥ' => 'á…¥', - 'ᅦ' => 'á…¦', - 'ï¿Š' => 'á…§', - 'ï¿‹' => 'á…¨', - 'ï¿Œ' => 'á…©', - 'ï¿' => 'á…ª', - 'ï¿Ž' => 'á…«', - 'ï¿' => 'á…¬', - 'ï¿’' => 'á…­', - 'ï¿“' => 'á…®', - 'ï¿”' => 'á…¯', - 'ï¿•' => 'á…°', - 'ï¿–' => 'á…±', - 'ï¿—' => 'á…²', - 'ï¿š' => 'á…³', - 'ï¿›' => 'á…´', - 'ï¿œ' => 'á…µ', - 'ï¿ ' => '¢', - 'ï¿¡' => '£', - 'ï¿¢' => '¬', - 'ï¿£' => ' Ì„', - '¦' => '¦', - 'ï¿¥' => 'Â¥', - '₩' => 'â‚©', - '│' => '│', - 'ï¿©' => 'â†', - '↑' => '↑', - 'ï¿«' => '→', - '↓' => '↓', - 'ï¿­' => 'â– ', - 'ï¿®' => 'â—‹', - 'ð€' => 'A', - 'ð' => 'B', - 'ð‚' => 'C', - 'ðƒ' => 'D', - 'ð„' => 'E', - 'ð…' => 'F', - 'ð†' => 'G', - 'ð‡' => 'H', - 'ðˆ' => 'I', - 'ð‰' => 'J', - 'ðŠ' => 'K', - 'ð‹' => 'L', - 'ðŒ' => 'M', - 'ð' => 'N', - 'ðŽ' => 'O', - 'ð' => 'P', - 'ð' => 'Q', - 'ð‘' => 'R', - 'ð’' => 'S', - 'ð“' => 'T', - 'ð”' => 'U', - 'ð•' => 'V', - 'ð–' => 'W', - 'ð—' => 'X', - 'ð˜' => 'Y', - 'ð™' => 'Z', - 'ðš' => 'a', - 'ð›' => 'b', - 'ðœ' => 'c', - 'ð' => 'd', - 'ðž' => 'e', - 'ðŸ' => 'f', - 'ð ' => 'g', - 'ð¡' => 'h', - 'ð¢' => 'i', - 'ð£' => 'j', - 'ð¤' => 'k', - 'ð¥' => 'l', - 'ð¦' => 'm', - 'ð§' => 'n', - 'ð¨' => 'o', - 'ð©' => 'p', - 'ðª' => 'q', - 'ð«' => 'r', - 'ð¬' => 's', - 'ð­' => 't', - 'ð®' => 'u', - 'ð¯' => 'v', - 'ð°' => 'w', - 'ð±' => 'x', - 'ð²' => 'y', - 'ð³' => 'z', - 'ð´' => 'A', - 'ðµ' => 'B', - 'ð¶' => 'C', - 'ð·' => 'D', - 'ð¸' => 'E', - 'ð¹' => 'F', - 'ðº' => 'G', - 'ð»' => 'H', - 'ð¼' => 'I', - 'ð½' => 'J', - 'ð¾' => 'K', - 'ð¿' => 'L', - 'ð‘€' => 'M', - 'ð‘' => 'N', - 'ð‘‚' => 'O', - 'ð‘ƒ' => 'P', - 'ð‘„' => 'Q', - 'ð‘…' => 'R', - 'ð‘†' => 'S', - 'ð‘‡' => 'T', - 'ð‘ˆ' => 'U', - 'ð‘‰' => 'V', - 'ð‘Š' => 'W', - 'ð‘‹' => 'X', - 'ð‘Œ' => 'Y', - 'ð‘' => 'Z', - 'ð‘Ž' => 'a', - 'ð‘' => 'b', - 'ð‘' => 'c', - 'ð‘‘' => 'd', - 'ð‘’' => 'e', - 'ð‘“' => 'f', - 'ð‘”' => 'g', - 'ð‘–' => 'i', - 'ð‘—' => 'j', - 'ð‘˜' => 'k', - 'ð‘™' => 'l', - 'ð‘š' => 'm', - 'ð‘›' => 'n', - 'ð‘œ' => 'o', - 'ð‘' => 'p', - 'ð‘ž' => 'q', - 'ð‘Ÿ' => 'r', - 'ð‘ ' => 's', - 'ð‘¡' => 't', - 'ð‘¢' => 'u', - 'ð‘£' => 'v', - 'ð‘¤' => 'w', - 'ð‘¥' => 'x', - 'ð‘¦' => 'y', - 'ð‘§' => 'z', - 'ð‘¨' => 'A', - 'ð‘©' => 'B', - 'ð‘ª' => 'C', - 'ð‘«' => 'D', - 'ð‘¬' => 'E', - 'ð‘­' => 'F', - 'ð‘®' => 'G', - 'ð‘¯' => 'H', - 'ð‘°' => 'I', - 'ð‘±' => 'J', - 'ð‘²' => 'K', - 'ð‘³' => 'L', - 'ð‘´' => 'M', - 'ð‘µ' => 'N', - 'ð‘¶' => 'O', - 'ð‘·' => 'P', - 'ð‘¸' => 'Q', - 'ð‘¹' => 'R', - 'ð‘º' => 'S', - 'ð‘»' => 'T', - 'ð‘¼' => 'U', - 'ð‘½' => 'V', - 'ð‘¾' => 'W', - 'ð‘¿' => 'X', - 'ð’€' => 'Y', - 'ð’' => 'Z', - 'ð’‚' => 'a', - 'ð’ƒ' => 'b', - 'ð’„' => 'c', - 'ð’…' => 'd', - 'ð’†' => 'e', - 'ð’‡' => 'f', - 'ð’ˆ' => 'g', - 'ð’‰' => 'h', - 'ð’Š' => 'i', - 'ð’‹' => 'j', - 'ð’Œ' => 'k', - 'ð’' => 'l', - 'ð’Ž' => 'm', - 'ð’' => 'n', - 'ð’' => 'o', - 'ð’‘' => 'p', - 'ð’’' => 'q', - 'ð’“' => 'r', - 'ð’”' => 's', - 'ð’•' => 't', - 'ð’–' => 'u', - 'ð’—' => 'v', - 'ð’˜' => 'w', - 'ð’™' => 'x', - 'ð’š' => 'y', - 'ð’›' => 'z', - 'ð’œ' => 'A', - 'ð’ž' => 'C', - 'ð’Ÿ' => 'D', - 'ð’¢' => 'G', - 'ð’¥' => 'J', - 'ð’¦' => 'K', - 'ð’©' => 'N', - 'ð’ª' => 'O', - 'ð’«' => 'P', - 'ð’¬' => 'Q', - 'ð’®' => 'S', - 'ð’¯' => 'T', - 'ð’°' => 'U', - 'ð’±' => 'V', - 'ð’²' => 'W', - 'ð’³' => 'X', - 'ð’´' => 'Y', - 'ð’µ' => 'Z', - 'ð’¶' => 'a', - 'ð’·' => 'b', - 'ð’¸' => 'c', - 'ð’¹' => 'd', - 'ð’»' => 'f', - 'ð’½' => 'h', - 'ð’¾' => 'i', - 'ð’¿' => 'j', - 'ð“€' => 'k', - 'ð“' => 'l', - 'ð“‚' => 'm', - 'ð“ƒ' => 'n', - 'ð“…' => 'p', - 'ð“†' => 'q', - 'ð“‡' => 'r', - 'ð“ˆ' => 's', - 'ð“‰' => 't', - 'ð“Š' => 'u', - 'ð“‹' => 'v', - 'ð“Œ' => 'w', - 'ð“' => 'x', - 'ð“Ž' => 'y', - 'ð“' => 'z', - 'ð“' => 'A', - 'ð“‘' => 'B', - 'ð“’' => 'C', - 'ð““' => 'D', - 'ð“”' => 'E', - 'ð“•' => 'F', - 'ð“–' => 'G', - 'ð“—' => 'H', - 'ð“˜' => 'I', - 'ð“™' => 'J', - 'ð“š' => 'K', - 'ð“›' => 'L', - 'ð“œ' => 'M', - 'ð“' => 'N', - 'ð“ž' => 'O', - 'ð“Ÿ' => 'P', - 'ð“ ' => 'Q', - 'ð“¡' => 'R', - 'ð“¢' => 'S', - 'ð“£' => 'T', - 'ð“¤' => 'U', - 'ð“¥' => 'V', - 'ð“¦' => 'W', - 'ð“§' => 'X', - 'ð“¨' => 'Y', - 'ð“©' => 'Z', - 'ð“ª' => 'a', - 'ð“«' => 'b', - 'ð“¬' => 'c', - 'ð“­' => 'd', - 'ð“®' => 'e', - 'ð“¯' => 'f', - 'ð“°' => 'g', - 'ð“±' => 'h', - 'ð“²' => 'i', - 'ð“³' => 'j', - 'ð“´' => 'k', - 'ð“µ' => 'l', - 'ð“¶' => 'm', - 'ð“·' => 'n', - 'ð“¸' => 'o', - 'ð“¹' => 'p', - 'ð“º' => 'q', - 'ð“»' => 'r', - 'ð“¼' => 's', - 'ð“½' => 't', - 'ð“¾' => 'u', - 'ð“¿' => 'v', - 'ð”€' => 'w', - 'ð”' => 'x', - 'ð”‚' => 'y', - 'ð”ƒ' => 'z', - 'ð”„' => 'A', - 'ð”…' => 'B', - 'ð”‡' => 'D', - 'ð”ˆ' => 'E', - 'ð”‰' => 'F', - 'ð”Š' => 'G', - 'ð”' => 'J', - 'ð”Ž' => 'K', - 'ð”' => 'L', - 'ð”' => 'M', - 'ð”‘' => 'N', - 'ð”’' => 'O', - 'ð”“' => 'P', - 'ð””' => 'Q', - 'ð”–' => 'S', - 'ð”—' => 'T', - 'ð”˜' => 'U', - 'ð”™' => 'V', - 'ð”š' => 'W', - 'ð”›' => 'X', - 'ð”œ' => 'Y', - 'ð”ž' => 'a', - 'ð”Ÿ' => 'b', - 'ð” ' => 'c', - 'ð”¡' => 'd', - 'ð”¢' => 'e', - 'ð”£' => 'f', - 'ð”¤' => 'g', - 'ð”¥' => 'h', - 'ð”¦' => 'i', - 'ð”§' => 'j', - 'ð”¨' => 'k', - 'ð”©' => 'l', - 'ð”ª' => 'm', - 'ð”«' => 'n', - 'ð”¬' => 'o', - 'ð”­' => 'p', - 'ð”®' => 'q', - 'ð”¯' => 'r', - 'ð”°' => 's', - 'ð”±' => 't', - 'ð”²' => 'u', - 'ð”³' => 'v', - 'ð”´' => 'w', - 'ð”µ' => 'x', - 'ð”¶' => 'y', - 'ð”·' => 'z', - 'ð”¸' => 'A', - 'ð”¹' => 'B', - 'ð”»' => 'D', - 'ð”¼' => 'E', - 'ð”½' => 'F', - 'ð”¾' => 'G', - 'ð•€' => 'I', - 'ð•' => 'J', - 'ð•‚' => 'K', - 'ð•ƒ' => 'L', - 'ð•„' => 'M', - 'ð•†' => 'O', - 'ð•Š' => 'S', - 'ð•‹' => 'T', - 'ð•Œ' => 'U', - 'ð•' => 'V', - 'ð•Ž' => 'W', - 'ð•' => 'X', - 'ð•' => 'Y', - 'ð•’' => 'a', - 'ð•“' => 'b', - 'ð•”' => 'c', - 'ð••' => 'd', - 'ð•–' => 'e', - 'ð•—' => 'f', - 'ð•˜' => 'g', - 'ð•™' => 'h', - 'ð•š' => 'i', - 'ð•›' => 'j', - 'ð•œ' => 'k', - 'ð•' => 'l', - 'ð•ž' => 'm', - 'ð•Ÿ' => 'n', - 'ð• ' => 'o', - 'ð•¡' => 'p', - 'ð•¢' => 'q', - 'ð•£' => 'r', - 'ð•¤' => 's', - 'ð•¥' => 't', - 'ð•¦' => 'u', - 'ð•§' => 'v', - 'ð•¨' => 'w', - 'ð•©' => 'x', - 'ð•ª' => 'y', - 'ð•«' => 'z', - 'ð•¬' => 'A', - 'ð•­' => 'B', - 'ð•®' => 'C', - 'ð•¯' => 'D', - 'ð•°' => 'E', - 'ð•±' => 'F', - 'ð•²' => 'G', - 'ð•³' => 'H', - 'ð•´' => 'I', - 'ð•µ' => 'J', - 'ð•¶' => 'K', - 'ð•·' => 'L', - 'ð•¸' => 'M', - 'ð•¹' => 'N', - 'ð•º' => 'O', - 'ð•»' => 'P', - 'ð•¼' => 'Q', - 'ð•½' => 'R', - 'ð•¾' => 'S', - 'ð•¿' => 'T', - 'ð–€' => 'U', - 'ð–' => 'V', - 'ð–‚' => 'W', - 'ð–ƒ' => 'X', - 'ð–„' => 'Y', - 'ð–…' => 'Z', - 'ð–†' => 'a', - 'ð–‡' => 'b', - 'ð–ˆ' => 'c', - 'ð–‰' => 'd', - 'ð–Š' => 'e', - 'ð–‹' => 'f', - 'ð–Œ' => 'g', - 'ð–' => 'h', - 'ð–Ž' => 'i', - 'ð–' => 'j', - 'ð–' => 'k', - 'ð–‘' => 'l', - 'ð–’' => 'm', - 'ð–“' => 'n', - 'ð–”' => 'o', - 'ð–•' => 'p', - 'ð––' => 'q', - 'ð–—' => 'r', - 'ð–˜' => 's', - 'ð–™' => 't', - 'ð–š' => 'u', - 'ð–›' => 'v', - 'ð–œ' => 'w', - 'ð–' => 'x', - 'ð–ž' => 'y', - 'ð–Ÿ' => 'z', - 'ð– ' => 'A', - 'ð–¡' => 'B', - 'ð–¢' => 'C', - 'ð–£' => 'D', - 'ð–¤' => 'E', - 'ð–¥' => 'F', - 'ð–¦' => 'G', - 'ð–§' => 'H', - 'ð–¨' => 'I', - 'ð–©' => 'J', - 'ð–ª' => 'K', - 'ð–«' => 'L', - 'ð–¬' => 'M', - 'ð–­' => 'N', - 'ð–®' => 'O', - 'ð–¯' => 'P', - 'ð–°' => 'Q', - 'ð–±' => 'R', - 'ð–²' => 'S', - 'ð–³' => 'T', - 'ð–´' => 'U', - 'ð–µ' => 'V', - 'ð–¶' => 'W', - 'ð–·' => 'X', - 'ð–¸' => 'Y', - 'ð–¹' => 'Z', - 'ð–º' => 'a', - 'ð–»' => 'b', - 'ð–¼' => 'c', - 'ð–½' => 'd', - 'ð–¾' => 'e', - 'ð–¿' => 'f', - 'ð—€' => 'g', - 'ð—' => 'h', - 'ð—‚' => 'i', - 'ð—ƒ' => 'j', - 'ð—„' => 'k', - 'ð—…' => 'l', - 'ð—†' => 'm', - 'ð—‡' => 'n', - 'ð—ˆ' => 'o', - 'ð—‰' => 'p', - 'ð—Š' => 'q', - 'ð—‹' => 'r', - 'ð—Œ' => 's', - 'ð—' => 't', - 'ð—Ž' => 'u', - 'ð—' => 'v', - 'ð—' => 'w', - 'ð—‘' => 'x', - 'ð—’' => 'y', - 'ð—“' => 'z', - 'ð—”' => 'A', - 'ð—•' => 'B', - 'ð—–' => 'C', - 'ð——' => 'D', - 'ð—˜' => 'E', - 'ð—™' => 'F', - 'ð—š' => 'G', - 'ð—›' => 'H', - 'ð—œ' => 'I', - 'ð—' => 'J', - 'ð—ž' => 'K', - 'ð—Ÿ' => 'L', - 'ð— ' => 'M', - 'ð—¡' => 'N', - 'ð—¢' => 'O', - 'ð—£' => 'P', - 'ð—¤' => 'Q', - 'ð—¥' => 'R', - 'ð—¦' => 'S', - 'ð—§' => 'T', - 'ð—¨' => 'U', - 'ð—©' => 'V', - 'ð—ª' => 'W', - 'ð—«' => 'X', - 'ð—¬' => 'Y', - 'ð—­' => 'Z', - 'ð—®' => 'a', - 'ð—¯' => 'b', - 'ð—°' => 'c', - 'ð—±' => 'd', - 'ð—²' => 'e', - 'ð—³' => 'f', - 'ð—´' => 'g', - 'ð—µ' => 'h', - 'ð—¶' => 'i', - 'ð—·' => 'j', - 'ð—¸' => 'k', - 'ð—¹' => 'l', - 'ð—º' => 'm', - 'ð—»' => 'n', - 'ð—¼' => 'o', - 'ð—½' => 'p', - 'ð—¾' => 'q', - 'ð—¿' => 'r', - 'ð˜€' => 's', - 'ð˜' => 't', - 'ð˜‚' => 'u', - 'ð˜ƒ' => 'v', - 'ð˜„' => 'w', - 'ð˜…' => 'x', - 'ð˜†' => 'y', - 'ð˜‡' => 'z', - 'ð˜ˆ' => 'A', - 'ð˜‰' => 'B', - 'ð˜Š' => 'C', - 'ð˜‹' => 'D', - 'ð˜Œ' => 'E', - 'ð˜' => 'F', - 'ð˜Ž' => 'G', - 'ð˜' => 'H', - 'ð˜' => 'I', - 'ð˜‘' => 'J', - 'ð˜’' => 'K', - 'ð˜“' => 'L', - 'ð˜”' => 'M', - 'ð˜•' => 'N', - 'ð˜–' => 'O', - 'ð˜—' => 'P', - 'ð˜˜' => 'Q', - 'ð˜™' => 'R', - 'ð˜š' => 'S', - 'ð˜›' => 'T', - 'ð˜œ' => 'U', - 'ð˜' => 'V', - 'ð˜ž' => 'W', - 'ð˜Ÿ' => 'X', - 'ð˜ ' => 'Y', - 'ð˜¡' => 'Z', - 'ð˜¢' => 'a', - 'ð˜£' => 'b', - 'ð˜¤' => 'c', - 'ð˜¥' => 'd', - 'ð˜¦' => 'e', - 'ð˜§' => 'f', - 'ð˜¨' => 'g', - 'ð˜©' => 'h', - 'ð˜ª' => 'i', - 'ð˜«' => 'j', - 'ð˜¬' => 'k', - 'ð˜­' => 'l', - 'ð˜®' => 'm', - 'ð˜¯' => 'n', - 'ð˜°' => 'o', - 'ð˜±' => 'p', - 'ð˜²' => 'q', - 'ð˜³' => 'r', - 'ð˜´' => 's', - 'ð˜µ' => 't', - 'ð˜¶' => 'u', - 'ð˜·' => 'v', - 'ð˜¸' => 'w', - 'ð˜¹' => 'x', - 'ð˜º' => 'y', - 'ð˜»' => 'z', - 'ð˜¼' => 'A', - 'ð˜½' => 'B', - 'ð˜¾' => 'C', - 'ð˜¿' => 'D', - 'ð™€' => 'E', - 'ð™' => 'F', - 'ð™‚' => 'G', - 'ð™ƒ' => 'H', - 'ð™„' => 'I', - 'ð™…' => 'J', - 'ð™†' => 'K', - 'ð™‡' => 'L', - 'ð™ˆ' => 'M', - 'ð™‰' => 'N', - 'ð™Š' => 'O', - 'ð™‹' => 'P', - 'ð™Œ' => 'Q', - 'ð™' => 'R', - 'ð™Ž' => 'S', - 'ð™' => 'T', - 'ð™' => 'U', - 'ð™‘' => 'V', - 'ð™’' => 'W', - 'ð™“' => 'X', - 'ð™”' => 'Y', - 'ð™•' => 'Z', - 'ð™–' => 'a', - 'ð™—' => 'b', - 'ð™˜' => 'c', - 'ð™™' => 'd', - 'ð™š' => 'e', - 'ð™›' => 'f', - 'ð™œ' => 'g', - 'ð™' => 'h', - 'ð™ž' => 'i', - 'ð™Ÿ' => 'j', - 'ð™ ' => 'k', - 'ð™¡' => 'l', - 'ð™¢' => 'm', - 'ð™£' => 'n', - 'ð™¤' => 'o', - 'ð™¥' => 'p', - 'ð™¦' => 'q', - 'ð™§' => 'r', - 'ð™¨' => 's', - 'ð™©' => 't', - 'ð™ª' => 'u', - 'ð™«' => 'v', - 'ð™¬' => 'w', - 'ð™­' => 'x', - 'ð™®' => 'y', - 'ð™¯' => 'z', - 'ð™°' => 'A', - 'ð™±' => 'B', - 'ð™²' => 'C', - 'ð™³' => 'D', - 'ð™´' => 'E', - 'ð™µ' => 'F', - 'ð™¶' => 'G', - 'ð™·' => 'H', - 'ð™¸' => 'I', - 'ð™¹' => 'J', - 'ð™º' => 'K', - 'ð™»' => 'L', - 'ð™¼' => 'M', - 'ð™½' => 'N', - 'ð™¾' => 'O', - 'ð™¿' => 'P', - 'ðš€' => 'Q', - 'ðš' => 'R', - 'ðš‚' => 'S', - 'ðšƒ' => 'T', - 'ðš„' => 'U', - 'ðš…' => 'V', - 'ðš†' => 'W', - 'ðš‡' => 'X', - 'ðšˆ' => 'Y', - 'ðš‰' => 'Z', - 'ðšŠ' => 'a', - 'ðš‹' => 'b', - 'ðšŒ' => 'c', - 'ðš' => 'd', - 'ðšŽ' => 'e', - 'ðš' => 'f', - 'ðš' => 'g', - 'ðš‘' => 'h', - 'ðš’' => 'i', - 'ðš“' => 'j', - 'ðš”' => 'k', - 'ðš•' => 'l', - 'ðš–' => 'm', - 'ðš—' => 'n', - 'ðš˜' => 'o', - 'ðš™' => 'p', - 'ðšš' => 'q', - 'ðš›' => 'r', - 'ðšœ' => 's', - 'ðš' => 't', - 'ðšž' => 'u', - 'ðšŸ' => 'v', - 'ðš ' => 'w', - 'ðš¡' => 'x', - 'ðš¢' => 'y', - 'ðš£' => 'z', - 'ðš¤' => 'ı', - 'ðš¥' => 'È·', - 'ðš¨' => 'Α', - 'ðš©' => 'Î’', - 'ðšª' => 'Γ', - 'ðš«' => 'Δ', - 'ðš¬' => 'Ε', - 'ðš­' => 'Ζ', - 'ðš®' => 'Η', - 'ðš¯' => 'Θ', - 'ðš°' => 'Ι', - 'ðš±' => 'Κ', - 'ðš²' => 'Λ', - 'ðš³' => 'Îœ', - 'ðš´' => 'Î', - 'ðšµ' => 'Ξ', - 'ðš¶' => 'Ο', - 'ðš·' => 'Π', - 'ðš¸' => 'Ρ', - 'ðš¹' => 'Θ', - 'ðšº' => 'Σ', - 'ðš»' => 'Τ', - 'ðš¼' => 'Î¥', - 'ðš½' => 'Φ', - 'ðš¾' => 'Χ', - 'ðš¿' => 'Ψ', - 'ð›€' => 'Ω', - 'ð›' => '∇', - 'ð›‚' => 'α', - 'ð›ƒ' => 'β', - 'ð›„' => 'γ', - 'ð›…' => 'δ', - 'ð›†' => 'ε', - 'ð›‡' => 'ζ', - 'ð›ˆ' => 'η', - 'ð›‰' => 'θ', - 'ð›Š' => 'ι', - 'ð›‹' => 'κ', - 'ð›Œ' => 'λ', - 'ð›' => 'μ', - 'ð›Ž' => 'ν', - 'ð›' => 'ξ', - 'ð›' => 'ο', - 'ð›‘' => 'Ï€', - 'ð›’' => 'Ï', - 'ð›“' => 'Ï‚', - 'ð›”' => 'σ', - 'ð›•' => 'Ï„', - 'ð›–' => 'Ï…', - 'ð›—' => 'φ', - 'ð›˜' => 'χ', - 'ð›™' => 'ψ', - 'ð›š' => 'ω', - 'ð››' => '∂', - 'ð›œ' => 'ε', - 'ð›' => 'θ', - 'ð›ž' => 'κ', - 'ð›Ÿ' => 'φ', - 'ð› ' => 'Ï', - 'ð›¡' => 'Ï€', - 'ð›¢' => 'Α', - 'ð›£' => 'Î’', - 'ð›¤' => 'Γ', - 'ð›¥' => 'Δ', - 'ð›¦' => 'Ε', - 'ð›§' => 'Ζ', - 'ð›¨' => 'Η', - 'ð›©' => 'Θ', - 'ð›ª' => 'Ι', - 'ð›«' => 'Κ', - 'ð›¬' => 'Λ', - 'ð›­' => 'Îœ', - 'ð›®' => 'Î', - 'ð›¯' => 'Ξ', - 'ð›°' => 'Ο', - 'ð›±' => 'Π', - 'ð›²' => 'Ρ', - 'ð›³' => 'Θ', - 'ð›´' => 'Σ', - 'ð›µ' => 'Τ', - 'ð›¶' => 'Î¥', - 'ð›·' => 'Φ', - 'ð›¸' => 'Χ', - 'ð›¹' => 'Ψ', - 'ð›º' => 'Ω', - 'ð›»' => '∇', - 'ð›¼' => 'α', - 'ð›½' => 'β', - 'ð›¾' => 'γ', - 'ð›¿' => 'δ', - 'ðœ€' => 'ε', - 'ðœ' => 'ζ', - 'ðœ‚' => 'η', - 'ðœƒ' => 'θ', - 'ðœ„' => 'ι', - 'ðœ…' => 'κ', - 'ðœ†' => 'λ', - 'ðœ‡' => 'μ', - 'ðœˆ' => 'ν', - 'ðœ‰' => 'ξ', - 'ðœŠ' => 'ο', - 'ðœ‹' => 'Ï€', - 'ðœŒ' => 'Ï', - 'ðœ' => 'Ï‚', - 'ðœŽ' => 'σ', - 'ðœ' => 'Ï„', - 'ðœ' => 'Ï…', - 'ðœ‘' => 'φ', - 'ðœ’' => 'χ', - 'ðœ“' => 'ψ', - 'ðœ”' => 'ω', - 'ðœ•' => '∂', - 'ðœ–' => 'ε', - 'ðœ—' => 'θ', - 'ðœ˜' => 'κ', - 'ðœ™' => 'φ', - 'ðœš' => 'Ï', - 'ðœ›' => 'Ï€', - 'ðœœ' => 'Α', - 'ðœ' => 'Î’', - 'ðœž' => 'Γ', - 'ðœŸ' => 'Δ', - 'ðœ ' => 'Ε', - 'ðœ¡' => 'Ζ', - 'ðœ¢' => 'Η', - 'ðœ£' => 'Θ', - 'ðœ¤' => 'Ι', - 'ðœ¥' => 'Κ', - 'ðœ¦' => 'Λ', - 'ðœ§' => 'Îœ', - 'ðœ¨' => 'Î', - 'ðœ©' => 'Ξ', - 'ðœª' => 'Ο', - 'ðœ«' => 'Π', - 'ðœ¬' => 'Ρ', - 'ðœ­' => 'Θ', - 'ðœ®' => 'Σ', - 'ðœ¯' => 'Τ', - 'ðœ°' => 'Î¥', - 'ðœ±' => 'Φ', - 'ðœ²' => 'Χ', - 'ðœ³' => 'Ψ', - 'ðœ´' => 'Ω', - 'ðœµ' => '∇', - 'ðœ¶' => 'α', - 'ðœ·' => 'β', - 'ðœ¸' => 'γ', - 'ðœ¹' => 'δ', - 'ðœº' => 'ε', - 'ðœ»' => 'ζ', - 'ðœ¼' => 'η', - 'ðœ½' => 'θ', - 'ðœ¾' => 'ι', - 'ðœ¿' => 'κ', - 'ð€' => 'λ', - 'ð' => 'μ', - 'ð‚' => 'ν', - 'ðƒ' => 'ξ', - 'ð„' => 'ο', - 'ð…' => 'Ï€', - 'ð†' => 'Ï', - 'ð‡' => 'Ï‚', - 'ðˆ' => 'σ', - 'ð‰' => 'Ï„', - 'ðŠ' => 'Ï…', - 'ð‹' => 'φ', - 'ðŒ' => 'χ', - 'ð' => 'ψ', - 'ðŽ' => 'ω', - 'ð' => '∂', - 'ð' => 'ε', - 'ð‘' => 'θ', - 'ð’' => 'κ', - 'ð“' => 'φ', - 'ð”' => 'Ï', - 'ð•' => 'Ï€', - 'ð–' => 'Α', - 'ð—' => 'Î’', - 'ð˜' => 'Γ', - 'ð™' => 'Δ', - 'ðš' => 'Ε', - 'ð›' => 'Ζ', - 'ðœ' => 'Η', - 'ð' => 'Θ', - 'ðž' => 'Ι', - 'ðŸ' => 'Κ', - 'ð ' => 'Λ', - 'ð¡' => 'Îœ', - 'ð¢' => 'Î', - 'ð£' => 'Ξ', - 'ð¤' => 'Ο', - 'ð¥' => 'Π', - 'ð¦' => 'Ρ', - 'ð§' => 'Θ', - 'ð¨' => 'Σ', - 'ð©' => 'Τ', - 'ðª' => 'Î¥', - 'ð«' => 'Φ', - 'ð¬' => 'Χ', - 'ð­' => 'Ψ', - 'ð®' => 'Ω', - 'ð¯' => '∇', - 'ð°' => 'α', - 'ð±' => 'β', - 'ð²' => 'γ', - 'ð³' => 'δ', - 'ð´' => 'ε', - 'ðµ' => 'ζ', - 'ð¶' => 'η', - 'ð·' => 'θ', - 'ð¸' => 'ι', - 'ð¹' => 'κ', - 'ðº' => 'λ', - 'ð»' => 'μ', - 'ð¼' => 'ν', - 'ð½' => 'ξ', - 'ð¾' => 'ο', - 'ð¿' => 'Ï€', - 'ðž€' => 'Ï', - 'ðž' => 'Ï‚', - 'ðž‚' => 'σ', - 'ðžƒ' => 'Ï„', - 'ðž„' => 'Ï…', - 'ðž…' => 'φ', - 'ðž†' => 'χ', - 'ðž‡' => 'ψ', - 'ðžˆ' => 'ω', - 'ðž‰' => '∂', - 'ðžŠ' => 'ε', - 'ðž‹' => 'θ', - 'ðžŒ' => 'κ', - 'ðž' => 'φ', - 'ðžŽ' => 'Ï', - 'ðž' => 'Ï€', - 'ðž' => 'Α', - 'ðž‘' => 'Î’', - 'ðž’' => 'Γ', - 'ðž“' => 'Δ', - 'ðž”' => 'Ε', - 'ðž•' => 'Ζ', - 'ðž–' => 'Η', - 'ðž—' => 'Θ', - 'ðž˜' => 'Ι', - 'ðž™' => 'Κ', - 'ðžš' => 'Λ', - 'ðž›' => 'Îœ', - 'ðžœ' => 'Î', - 'ðž' => 'Ξ', - 'ðžž' => 'Ο', - 'ðžŸ' => 'Π', - 'ðž ' => 'Ρ', - 'ðž¡' => 'Θ', - 'ðž¢' => 'Σ', - 'ðž£' => 'Τ', - 'ðž¤' => 'Î¥', - 'ðž¥' => 'Φ', - 'ðž¦' => 'Χ', - 'ðž§' => 'Ψ', - 'ðž¨' => 'Ω', - 'ðž©' => '∇', - 'ðžª' => 'α', - 'ðž«' => 'β', - 'ðž¬' => 'γ', - 'ðž­' => 'δ', - 'ðž®' => 'ε', - 'ðž¯' => 'ζ', - 'ðž°' => 'η', - 'ðž±' => 'θ', - 'ðž²' => 'ι', - 'ðž³' => 'κ', - 'ðž´' => 'λ', - 'ðžµ' => 'μ', - 'ðž¶' => 'ν', - 'ðž·' => 'ξ', - 'ðž¸' => 'ο', - 'ðž¹' => 'Ï€', - 'ðžº' => 'Ï', - 'ðž»' => 'Ï‚', - 'ðž¼' => 'σ', - 'ðž½' => 'Ï„', - 'ðž¾' => 'Ï…', - 'ðž¿' => 'φ', - 'ðŸ€' => 'χ', - 'ðŸ' => 'ψ', - 'ðŸ‚' => 'ω', - 'ðŸƒ' => '∂', - 'ðŸ„' => 'ε', - 'ðŸ…' => 'θ', - 'ðŸ†' => 'κ', - 'ðŸ‡' => 'φ', - 'ðŸˆ' => 'Ï', - 'ðŸ‰' => 'Ï€', - 'ðŸŠ' => 'Ïœ', - 'ðŸ‹' => 'Ï', - 'ðŸŽ' => '0', - 'ðŸ' => '1', - 'ðŸ' => '2', - 'ðŸ‘' => '3', - 'ðŸ’' => '4', - 'ðŸ“' => '5', - 'ðŸ”' => '6', - 'ðŸ•' => '7', - 'ðŸ–' => '8', - 'ðŸ—' => '9', - 'ðŸ˜' => '0', - 'ðŸ™' => '1', - 'ðŸš' => '2', - 'ðŸ›' => '3', - 'ðŸœ' => '4', - 'ðŸ' => '5', - 'ðŸž' => '6', - 'ðŸŸ' => '7', - 'ðŸ ' => '8', - 'ðŸ¡' => '9', - 'ðŸ¢' => '0', - 'ðŸ£' => '1', - 'ðŸ¤' => '2', - 'ðŸ¥' => '3', - 'ðŸ¦' => '4', - 'ðŸ§' => '5', - 'ðŸ¨' => '6', - 'ðŸ©' => '7', - 'ðŸª' => '8', - 'ðŸ«' => '9', - 'ðŸ¬' => '0', - 'ðŸ­' => '1', - 'ðŸ®' => '2', - 'ðŸ¯' => '3', - 'ðŸ°' => '4', - 'ðŸ±' => '5', - 'ðŸ²' => '6', - 'ðŸ³' => '7', - 'ðŸ´' => '8', - 'ðŸµ' => '9', - 'ðŸ¶' => '0', - 'ðŸ·' => '1', - 'ðŸ¸' => '2', - 'ðŸ¹' => '3', - 'ðŸº' => '4', - 'ðŸ»' => '5', - 'ðŸ¼' => '6', - 'ðŸ½' => '7', - 'ðŸ¾' => '8', - 'ðŸ¿' => '9', - '𞸀' => 'ا', - 'ðž¸' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'Ùˆ', - '𞸆' => 'ز', - '𞸇' => 'Ø­', - '𞸈' => 'Ø·', - '𞸉' => 'ÙŠ', - '𞸊' => 'Ùƒ', - '𞸋' => 'Ù„', - '𞸌' => 'Ù…', - 'ðž¸' => 'Ù†', - '𞸎' => 'س', - 'ðž¸' => 'ع', - 'ðž¸' => 'Ù', - '𞸑' => 'ص', - '𞸒' => 'Ù‚', - '𞸓' => 'ر', - '𞸔' => 'Ø´', - '𞸕' => 'ت', - '𞸖' => 'Ø«', - '𞸗' => 'Ø®', - '𞸘' => 'Ø°', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'Ù®', - 'ðž¸' => 'Úº', - '𞸞' => 'Ú¡', - '𞸟' => 'Ù¯', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'Ù‡', - '𞸧' => 'Ø­', - '𞸩' => 'ÙŠ', - '𞸪' => 'Ùƒ', - '𞸫' => 'Ù„', - '𞸬' => 'Ù…', - '𞸭' => 'Ù†', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'Ù', - '𞸱' => 'ص', - '𞸲' => 'Ù‚', - '𞸴' => 'Ø´', - '𞸵' => 'ت', - '𞸶' => 'Ø«', - '𞸷' => 'Ø®', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'Ø­', - '𞹉' => 'ÙŠ', - '𞹋' => 'Ù„', - 'ðž¹' => 'Ù†', - '𞹎' => 'س', - 'ðž¹' => 'ع', - '𞹑' => 'ص', - 'ðž¹’' => 'Ù‚', - 'ðž¹”' => 'Ø´', - 'ðž¹—' => 'Ø®', - 'ðž¹™' => 'ض', - 'ðž¹›' => 'غ', - 'ðž¹' => 'Úº', - '𞹟' => 'Ù¯', - '𞹡' => 'ب', - 'ðž¹¢' => 'ج', - '𞹤' => 'Ù‡', - '𞹧' => 'Ø­', - '𞹨' => 'Ø·', - '𞹩' => 'ÙŠ', - '𞹪' => 'Ùƒ', - '𞹬' => 'Ù…', - 'ðž¹­' => 'Ù†', - 'ðž¹®' => 'س', - '𞹯' => 'ع', - 'ðž¹°' => 'Ù', - 'ðž¹±' => 'ص', - 'ðž¹²' => 'Ù‚', - 'ðž¹´' => 'Ø´', - 'ðž¹µ' => 'ت', - '𞹶' => 'Ø«', - 'ðž¹·' => 'Ø®', - 'ðž¹¹' => 'ض', - '𞹺' => 'ظ', - 'ðž¹»' => 'غ', - 'ðž¹¼' => 'Ù®', - 'ðž¹¾' => 'Ú¡', - '𞺀' => 'ا', - 'ðžº' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'Ù‡', - '𞺅' => 'Ùˆ', - '𞺆' => 'ز', - '𞺇' => 'Ø­', - '𞺈' => 'Ø·', - '𞺉' => 'ÙŠ', - '𞺋' => 'Ù„', - '𞺌' => 'Ù…', - 'ðžº' => 'Ù†', - '𞺎' => 'س', - 'ðžº' => 'ع', - 'ðžº' => 'Ù', - '𞺑' => 'ص', - '𞺒' => 'Ù‚', - '𞺓' => 'ر', - '𞺔' => 'Ø´', - '𞺕' => 'ت', - '𞺖' => 'Ø«', - '𞺗' => 'Ø®', - '𞺘' => 'Ø°', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'Ùˆ', - '𞺦' => 'ز', - '𞺧' => 'Ø­', - '𞺨' => 'Ø·', - '𞺩' => 'ÙŠ', - '𞺫' => 'Ù„', - '𞺬' => 'Ù…', - '𞺭' => 'Ù†', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'Ù', - '𞺱' => 'ص', - '𞺲' => 'Ù‚', - '𞺳' => 'ر', - '𞺴' => 'Ø´', - '𞺵' => 'ت', - '𞺶' => 'Ø«', - '𞺷' => 'Ø®', - '𞺸' => 'Ø°', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - 'ðŸ„' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - 'ðŸ„' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - 'ðŸ„' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => 'C', - '🄬' => 'R', - '🄭' => 'CD', - '🄮' => 'WZ', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - 'ðŸ…' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - 'ðŸ…' => 'SS', - '🅎' => 'PPV', - 'ðŸ…' => 'WC', - '🅪' => 'MC', - '🅫' => 'MD', - '🅬' => 'MR', - 'ðŸ†' => 'DJ', - '🈀' => 'ã»ã‹', - 'ðŸˆ' => 'ココ', - '🈂' => 'サ', - 'ðŸˆ' => '手', - '🈑' => 'å­—', - '🈒' => 'åŒ', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => 'ç„¡', - '🈛' => 'æ–™', - '🈜' => 'å‰', - 'ðŸˆ' => '後', - '🈞' => 'å†', - '🈟' => 'æ–°', - '🈠' => 'åˆ', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => 'å¹', - '🈦' => 'æ¼”', - '🈧' => '投', - '🈨' => 'æ•', - '🈩' => '一', - '🈪' => '三', - '🈫' => 'éŠ', - '🈬' => 'å·¦', - '🈭' => '中', - '🈮' => 'å³', - '🈯' => '指', - '🈰' => 'èµ°', - '🈱' => '打', - '🈲' => 'ç¦', - '🈳' => '空', - '🈴' => 'åˆ', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => 'å–¶', - '🈻' => 'é…', - '🉀' => '〔本〕', - 'ðŸ‰' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔å‹ã€•', - '🉈' => '〔敗〕', - 'ðŸ‰' => 'å¾—', - '🉑' => 'å¯', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', -); diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php deleted file mode 100644 index 3608e5c05d6..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php deleted file mode 100644 index e36d1a94770..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json b/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json deleted file mode 100644 index 393edf701a6..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-intl-normalizer/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "symfony/polyfill-intl-normalizer", - "type": "library", - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php index b65c54a6b56..15503bc9dd3 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -67,20 +67,19 @@ */ final class Mbstring { - public const MB_CASE_FOLD = \PHP_INT_MAX; + const MB_CASE_FOLD = PHP_INT_MAX; - private const 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", 'ι'], - ]; - - private static $encodingList = ['ASCII', 'UTF-8']; + private static $encodingList = array('ASCII', 'UTF-8'); private static $language = 'neutral'; private static $internalEncoding = 'UTF-8'; + private static $caseFold = array( + array('µ', 'Å¿', "\xCD\x85", 'Ï‚', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), + array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'Ï€', 'κ', 'Ï', 'ε', "\xE1\xB9\xA1", 'ι'), + ); public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { + if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -102,25 +101,27 @@ 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); + return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s); } if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); + $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); $fromEncoding = 'UTF-8'; } - return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); } - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) + public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { + $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); + $ok = true; array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { $ok = false; } }); @@ -130,28 +131,28 @@ 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) { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); } public static function mb_decode_numericentity($s, $convmap, $encoding = null) { - 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); + 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; } - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + if (!\is_array($convmap) || !$convmap) { return false; } - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + 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 +167,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; @@ -184,7 +185,7 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; for ($i = 0; $i < $cnt; $i += 4) { if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); + return Mbstring::mb_chr($c - $convmap[$i + 2]); } } @@ -195,29 +196,29 @@ 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'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + 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; } - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + if (!\is_array($convmap) || !$convmap) { return false; } - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + 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)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); + 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,13 +233,13 @@ 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]; + static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); $cnt = floor(\count($convmap) / 4) * 4; $i = 0; @@ -265,7 +266,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,20 +281,20 @@ 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) { + if (MB_CASE_TITLE == $mode) { static $titleRegexp = null; if (null === $titleRegexp) { $titleRegexp = self::getData('titleCaseRegexp'); } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); + $s = preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s); } else { - if (\MB_CASE_UPPER == $mode) { + if (MB_CASE_UPPER == $mode) { static $upper = null; if (null === $upper) { $upper = self::getData('upperCase'); @@ -301,7 +302,7 @@ 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); + $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); } static $lower = null; @@ -311,7 +312,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $lower; } - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); $i = 0; $len = \strlen($s); @@ -343,7 +344,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) @@ -352,19 +353,15 @@ public static function mb_internal_encoding($encoding = null) return self::$internalEncoding; } - $normalizedEncoding = self::getEncoding($encoding); + $encoding = self::getEncoding($encoding); - if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; + if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) { + self::$internalEncoding = $encoding; return true; } - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); + return false; } public static function mb_language($lang = null) @@ -373,24 +370,20 @@ public static function mb_language($lang = null) return self::$language; } - switch ($normalizedLang = strtolower($lang)) { + switch ($lang = strtolower($lang)) { case 'uni': case 'neutral': - self::$language = $normalizedLang; + self::$language = $lang; return true; } - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); + return false; } public static function mb_list_encodings() { - return ['UTF-8']; + return array('UTF-8'); } public static function mb_encoding_aliases($encoding) @@ -398,7 +391,7 @@ public static function mb_encoding_aliases($encoding) switch (strtoupper($encoding)) { case 'UTF8': case 'UTF-8': - return ['utf8']; + return array('utf8'); } return false; @@ -413,7 +406,7 @@ 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); + return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var); } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -488,7 +481,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) @@ -500,16 +493,12 @@ public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = nu $needle = (string) $needle; if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); + trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); - return false; - } - - return 0; + return false; } - 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) @@ -532,28 +521,23 @@ public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = n } } - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? \iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); return false !== $pos ? $offset + $pos : false; } 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'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); + 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; } 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; - } + trigger_error('The length of each segment must be greater than zero', E_USER_WARNING); - throw new \ValueError('Argument #2 ($length) must be greater than 0'); + return false; } if (null === $encoding) { @@ -568,10 +552,10 @@ 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, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); } - $result = []; + $result = array(); $length = mb_strlen($string, $encoding); for ($i = 0; $i < $length; $i += $split_length) { @@ -583,30 +567,21 @@ public static function mb_str_split($string, $split_length = 1, $encoding = null public static function mb_strtolower($s, $encoding = null) { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); + return self::mb_convert_case($s, MB_CASE_LOWER, $encoding); } public static function mb_strtoupper($s, $encoding = null) { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); + return self::mb_convert_case($s, MB_CASE_UPPER, $encoding); } public static function mb_substitute_character($c = null) { - if (null === $c) { - return 'none'; - } if (0 === strcasecmp($c, 'none')) { return true; } - if (80000 > \PHP_VERSION_ID) { - return false; - } - if (\is_int($c) || 'long' === $c || 'entity' === $c) { - return false; - } - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); + return null !== $c ? false : 'none'; } public static function mb_substr($s, $start, $length = null, $encoding = null) @@ -617,7 +592,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,13 +601,13 @@ 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) @@ -654,11 +629,10 @@ public static function mb_strrchr($haystack, $needle, $part = false, $encoding = { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = \iconv_strrpos($haystack, $needle, $encoding); + return strrchr($haystack, $needle, $part); } + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); return self::getSubpart($pos, $part, $haystack, $encoding); } @@ -694,7 +668,7 @@ public static function mb_strstr($haystack, $needle, $part = false, $encoding = public static function mb_get_info($type = 'all') { - $info = [ + $info = array( 'internal_encoding' => self::$internalEncoding, 'http_output' => 'pass', 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', @@ -709,7 +683,7 @@ public static function mb_get_info($type = 'all') 'detect_order' => self::$encodingList, 'substitute_character' => 'none', 'strict_detection' => 'Off', - ]; + ); if ('all' === $type) { return $info; @@ -736,12 +710,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) @@ -813,7 +787,7 @@ private static function html_encoding_callback(array $m) { $i = 1; $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); + $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8')); while (isset($m[$i])) { if (0x80 > $m[$i]) { @@ -836,7 +810,7 @@ private static function html_encoding_callback(array $m) private static function title_case(array $s) { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); + return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8'); } private static function getData($file) diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php index fac60b081a1..a22eca57bd9 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -81,7 +81,7 @@ 'Ī' => 'Ä«', 'Ĭ' => 'Ä­', 'Ä®' => 'į', - 'Ä°' => 'i̇', + 'Ä°' => 'i', 'IJ' => 'ij', 'Ä´' => 'ĵ', 'Ķ' => 'Ä·', diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php index 56b9cb85207..ecbc15895eb 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php @@ -746,41 +746,41 @@ 'á½»' => 'á¿«', 'á½¼' => 'Ὼ', 'á½½' => 'á¿»', - 'á¾€' => 'ἈΙ', - 'á¾' => 'ἉΙ', - 'ᾂ' => 'ἊΙ', - 'ᾃ' => 'ἋΙ', - 'ᾄ' => 'ἌΙ', - 'á¾…' => 'á¼Î™', - 'ᾆ' => 'ἎΙ', - 'ᾇ' => 'á¼Î™', - 'á¾' => 'ἨΙ', - 'ᾑ' => 'ἩΙ', - 'á¾’' => 'ἪΙ', - 'ᾓ' => 'ἫΙ', - 'á¾”' => 'ἬΙ', - 'ᾕ' => 'ἭΙ', - 'á¾–' => 'ἮΙ', - 'á¾—' => 'ἯΙ', - 'á¾ ' => 'ὨΙ', - 'ᾡ' => 'ὩΙ', - 'á¾¢' => 'ὪΙ', - 'á¾£' => 'ὫΙ', - 'ᾤ' => 'ὬΙ', - 'á¾¥' => 'ὭΙ', - 'ᾦ' => 'ὮΙ', - 'ᾧ' => 'ὯΙ', + 'á¾€' => 'ᾈ', + 'á¾' => 'ᾉ', + 'ᾂ' => 'ᾊ', + 'ᾃ' => 'ᾋ', + 'ᾄ' => 'ᾌ', + 'á¾…' => 'á¾', + 'ᾆ' => 'ᾎ', + 'ᾇ' => 'á¾', + 'á¾' => 'ᾘ', + 'ᾑ' => 'á¾™', + 'á¾’' => 'ᾚ', + 'ᾓ' => 'á¾›', + 'á¾”' => 'ᾜ', + 'ᾕ' => 'á¾', + 'á¾–' => 'ᾞ', + 'á¾—' => 'ᾟ', + 'á¾ ' => 'ᾨ', + 'ᾡ' => 'ᾩ', + 'á¾¢' => 'ᾪ', + 'á¾£' => 'ᾫ', + 'ᾤ' => 'ᾬ', + 'á¾¥' => 'á¾­', + 'ᾦ' => 'á¾®', + 'ᾧ' => 'ᾯ', 'á¾°' => 'Ᾰ', 'á¾±' => 'á¾¹', - 'á¾³' => 'ΑΙ', + 'á¾³' => 'á¾¼', 'á¾¾' => 'Ι', - 'ῃ' => 'ΗΙ', + 'ῃ' => 'á¿Œ', 'á¿' => 'Ῐ', 'á¿‘' => 'á¿™', 'á¿ ' => 'Ῠ', 'á¿¡' => 'á¿©', 'á¿¥' => 'Ῥ', - 'ῳ' => 'ΩΙ', + 'ῳ' => 'ῼ', 'â…Ž' => 'Ⅎ', 'â…°' => 'â… ', 'â…±' => 'â…¡', @@ -1411,79 +1411,4 @@ 'ðž¥' => '𞤟', '𞥂' => '𞤠', '𞥃' => '𞤡', - 'ß' => 'SS', - 'ff' => 'FF', - 'ï¬' => 'FI', - 'fl' => 'FL', - 'ffi' => 'FFI', - 'ffl' => 'FFL', - 'ſt' => 'ST', - 'st' => 'ST', - 'Ö‡' => 'ÔµÕ’', - 'ﬓ' => 'Õ„Õ†', - 'ﬔ' => 'Õ„Ôµ', - 'ﬕ' => 'Õ„Ô»', - 'ﬖ' => 'ÕŽÕ†', - 'ﬗ' => 'Õ„Ô½', - 'ʼn' => 'ʼN', - 'Î' => 'ΪÌ', - 'ΰ' => 'ΫÌ', - 'Ç°' => 'JÌŒ', - 'ẖ' => 'H̱', - 'ẗ' => 'T̈', - 'ẘ' => 'WÌŠ', - 'ẙ' => 'YÌŠ', - 'ẚ' => 'Aʾ', - 'á½' => 'Υ̓', - 'á½’' => 'Υ̓̀', - 'á½”' => 'Υ̓Ì', - 'á½–' => 'Υ̓͂', - 'ᾶ' => 'Α͂', - 'ῆ' => 'Η͂', - 'á¿’' => 'Ϊ̀', - 'á¿“' => 'ΪÌ', - 'á¿–' => 'Ι͂', - 'á¿—' => 'Ϊ͂', - 'á¿¢' => 'Ϋ̀', - 'á¿£' => 'ΫÌ', - 'ῤ' => 'Ρ̓', - 'ῦ' => 'Υ͂', - 'ῧ' => 'Ϋ͂', - 'ῶ' => 'Ω͂', - 'ᾈ' => 'ἈΙ', - 'ᾉ' => 'ἉΙ', - 'ᾊ' => 'ἊΙ', - 'ᾋ' => 'ἋΙ', - 'ᾌ' => 'ἌΙ', - 'á¾' => 'á¼Î™', - 'ᾎ' => 'ἎΙ', - 'á¾' => 'á¼Î™', - 'ᾘ' => 'ἨΙ', - 'á¾™' => 'ἩΙ', - 'ᾚ' => 'ἪΙ', - 'á¾›' => 'ἫΙ', - 'ᾜ' => 'ἬΙ', - 'á¾' => 'ἭΙ', - 'ᾞ' => 'ἮΙ', - 'ᾟ' => 'ἯΙ', - 'ᾨ' => 'ὨΙ', - 'ᾩ' => 'ὩΙ', - 'ᾪ' => 'ὪΙ', - 'ᾫ' => 'ὫΙ', - 'ᾬ' => 'ὬΙ', - 'á¾­' => 'ὭΙ', - 'á¾®' => 'ὮΙ', - 'ᾯ' => 'ὯΙ', - 'á¾¼' => 'ΑΙ', - 'á¿Œ' => 'ΗΙ', - 'ῼ' => 'ΩΙ', - 'á¾²' => 'ᾺΙ', - 'á¾´' => 'ΆΙ', - 'á¿‚' => 'ῊΙ', - 'á¿„' => 'ΉΙ', - 'ῲ' => 'ῺΙ', - 'á¿´' => 'ÎΙ', - 'á¾·' => 'Α͂Ι', - 'ῇ' => 'Η͂Ι', - 'á¿·' => 'Ω͂Ι', ); diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php index 1fedd1f7c84..b36a0926f20 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -11,33 +11,29 @@ use Symfony\Polyfill\Mbstring as p; -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } + function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } } if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } + function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } } if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } + function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } } if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } + function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } } if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } + function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } } if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } + function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } } if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } + function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } } if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } + function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } } if (!function_exists('mb_list_encodings')) { function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } @@ -46,90 +42,88 @@ function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } } if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } + function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } } if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } + function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } } if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } + function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } } if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } + function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } } if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } + function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } } if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } + function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } } if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } + function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } } if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } + function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } } if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } + function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } } if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } + function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } } if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } + function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } } if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } + function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } } if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } + function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } } if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } + function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } } if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } + function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } } if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } + function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } } if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } + function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } } if (!function_exists('mb_get_info')) { function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } } if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } + function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } } if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } + function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } } if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } + function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } } if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } + function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } } if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } + function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } } - if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } + function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } } - if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } + function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } } if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } + function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } } if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } + function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } } if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } + function mb_str_split($string, $split_length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $split_length, $encoding); } } if (extension_loaded('mbstring')) { diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php b/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index 82f5ac4d0f1..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - 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 (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json b/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json index 1fa21ca16cf..06e6b31a20f 100644 --- a/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json +++ b/upload/system/storage/vendor/symfony/polyfill-mbstring/composer.json @@ -16,10 +16,7 @@ } ], "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" + "php": ">=5.3.3" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, @@ -31,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE deleted file mode 100644 index 4cd8bdd3007..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php72/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/Php72.php b/upload/system/storage/vendor/symfony/polyfill-php72/Php72.php deleted file mode 100644 index 5e20d5bf8f1..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php72/Php72.php +++ /dev/null @@ -1,217 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php72; - -/** - * @author Nicolas Grekas - * @author Dariusz RumiÅ„ski - * - * @internal - */ -final class Php72 -{ - private static $hashMask; - - public static function utf8_encode($s) - { - $s .= $s; - $len = \strlen($s); - - for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) { - switch (true) { - case $s[$i] < "\x80": $s[$j] = $s[$i]; break; - case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; - default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break; - } - } - - return substr($s, 0, $j); - } - - public static function utf8_decode($s) - { - $s = (string) $s; - $len = \strlen($s); - - for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) { - switch ($s[$i] & "\xF0") { - case "\xC0": - case "\xD0": - $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F"); - $s[$j] = $c < 256 ? \chr($c) : '?'; - break; - - case "\xF0": - ++$i; - // no break - - case "\xE0": - $s[$j] = '?'; - $i += 2; - break; - - default: - $s[$j] = $s[$i]; - } - } - - return substr($s, 0, $j); - } - - public static function php_os_family() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return 'Windows'; - } - - $map = [ - 'Darwin' => 'Darwin', - 'DragonFly' => 'BSD', - 'FreeBSD' => 'BSD', - 'NetBSD' => 'BSD', - 'OpenBSD' => 'BSD', - 'Linux' => 'Linux', - 'SunOS' => 'Solaris', - ]; - - return isset($map[\PHP_OS]) ? $map[\PHP_OS] : 'Unknown'; - } - - public static function spl_object_id($object) - { - if (null === self::$hashMask) { - self::initHashMask(); - } - if (null === $hash = spl_object_hash($object)) { - return; - } - - // On 32-bit systems, PHP_INT_SIZE is 4, - return self::$hashMask ^ hexdec(substr($hash, 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); - } - - public static function sapi_windows_vt100_support($stream, $enable = null) - { - if (!\is_resource($stream)) { - trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); - - return false; - } - - $meta = stream_get_meta_data($stream); - - if ('STDIO' !== $meta['stream_type']) { - trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', \E_USER_WARNING); - - return false; - } - - // We cannot actually disable vt100 support if it is set - if (false === $enable || !self::stream_isatty($stream)) { - return false; - } - - // The native function does not apply to stdin - $meta = array_map('strtolower', $meta); - $stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri']; - - return !$stdin - && (false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM')); - } - - public static function stream_isatty($stream) - { - if (!\is_resource($stream)) { - trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $stat = @fstat($stream); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - return \function_exists('posix_isatty') && @posix_isatty($stream); - } - - private static function initHashMask() - { - $obj = (object) []; - self::$hashMask = -1; - - // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below - $obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush']; - foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? \DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { - if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) { - $frame['line'] = 0; - break; - } - } - if (!empty($frame['line'])) { - ob_start(); - debug_zval_dump($obj); - self::$hashMask = (int) substr(ob_get_clean(), 17); - } - - self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - (\PHP_INT_SIZE * 2 - 1), (\PHP_INT_SIZE * 2 - 1))); - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = $encoding ?? mb_internal_encoding()) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if (null === $encoding) { - $s = mb_convert_encoding($s, 'UTF-8'); - } elseif ('UTF-8' !== $encoding) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/README.md b/upload/system/storage/vendor/symfony/polyfill-php72/README.md deleted file mode 100644 index 59dec8a237f..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php72/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Symfony Polyfill / Php72 -======================== - -This component provides functions added to PHP 7.2 core: - -- [`spl_object_id`](https://php.net/spl_object_id) -- [`stream_isatty`](https://php.net/stream_isatty) - -On Windows only: - -- [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support) - -Moved to core since 7.2 (was in the optional XML extension earlier): - -- [`utf8_encode`](https://php.net/utf8_encode) -- [`utf8_decode`](https://php.net/utf8_decode) - -Also, it provides constants added to PHP 7.2: -- [`PHP_FLOAT_*`](https://php.net/reserved.constants#constant.php-float-dig) -- [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php deleted file mode 100644 index b5c92d4c7c7..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php72/bootstrap.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php72 as p; - -if (\PHP_VERSION_ID >= 70200) { - return; -} - -if (!defined('PHP_FLOAT_DIG')) { - define('PHP_FLOAT_DIG', 15); -} -if (!defined('PHP_FLOAT_EPSILON')) { - define('PHP_FLOAT_EPSILON', 2.2204460492503E-16); -} -if (!defined('PHP_FLOAT_MIN')) { - define('PHP_FLOAT_MIN', 2.2250738585072E-308); -} -if (!defined('PHP_FLOAT_MAX')) { - define('PHP_FLOAT_MAX', 1.7976931348623157E+308); -} -if (!defined('PHP_OS_FAMILY')) { - define('PHP_OS_FAMILY', p\Php72::php_os_family()); -} - -if ('\\' === \DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) { - function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); } -} -if (!function_exists('stream_isatty')) { - function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } -} -if (!function_exists('utf8_encode')) { - function utf8_encode($string) { return p\Php72::utf8_encode($string); } -} -if (!function_exists('utf8_decode')) { - function utf8_decode($string) { return p\Php72::utf8_decode($string); } -} -if (!function_exists('spl_object_id')) { - function spl_object_id($object) { return p\Php72::spl_object_id($object); } -} -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php72/composer.json b/upload/system/storage/vendor/symfony/polyfill-php72/composer.json deleted file mode 100644 index c96c8447782..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php72/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/polyfill-php72", - "type": "library", - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, - "files": [ "bootstrap.php" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php73/LICENSE deleted file mode 100644 index 3f853aaf35f..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php73/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/Php73.php b/upload/system/storage/vendor/symfony/polyfill-php73/Php73.php deleted file mode 100644 index 65c35a6a115..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php73/Php73.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php73; - -/** - * @author Gabriel Caruso - * @author Ion Bazan - * - * @internal - */ -final class Php73 -{ - public static $startAt = 1533462603; - - /** - * @param bool $asNum - * - * @return array|float|int - */ - public static function hrtime($asNum = false) - { - $ns = microtime(false); - $s = substr($ns, 11) - self::$startAt; - $ns = 1E9 * (float) $ns; - - if ($asNum) { - $ns += $s * 1E9; - - return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; - } - - return [$s, (int) $ns]; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/README.md b/upload/system/storage/vendor/symfony/polyfill-php73/README.md deleted file mode 100644 index b3ebbce511b..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php73/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Symfony Polyfill / Php73 -======================== - -This component provides functions added to PHP 7.3 core: - -- [`array_key_first`](https://php.net/array_key_first) -- [`array_key_last`](https://php.net/array_key_last) -- [`hrtime`](https://php.net/function.hrtime) -- [`is_countable`](https://php.net/is_countable) -- [`JsonException`](https://php.net/JsonException) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php deleted file mode 100644 index f06d6c2694c..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 70300) { - class JsonException extends Exception - { - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php b/upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php deleted file mode 100644 index d6b21538235..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php73/bootstrap.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php73 as p; - -if (\PHP_VERSION_ID >= 70300) { - return; -} - -if (!function_exists('is_countable')) { - function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } -} -if (!function_exists('hrtime')) { - require_once __DIR__.'/Php73.php'; - p\Php73::$startAt = (int) microtime(true); - function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } -} -if (!function_exists('array_key_first')) { - function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } -} -if (!function_exists('array_key_last')) { - function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php73/composer.json b/upload/system/storage/vendor/symfony/polyfill-php73/composer.json deleted file mode 100644 index a7fe4787528..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php73/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-php73", - "type": "library", - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 5593b1d84f7..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/Php80.php b/upload/system/storage/vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 362dd1a9596..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php b/upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php deleted file mode 100644 index fe6e6910562..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class PhpToken implements \Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/README.md b/upload/system/storage/vendor/symfony/polyfill-php80/README.md deleted file mode 100644 index 10b8ee49a87..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,24 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- `Stringable` interface -- [`fdiv`](https://php.net/fdiv) -- `ValueError` class -- `UnhandledMatchError` class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`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) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 7ea6d2772dc..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,22 +0,0 @@ -flags = $flags; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php deleted file mode 100644 index 72f10812b36..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ /dev/null @@ -1,7 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php80/composer.json b/upload/system/storage/vendor/symfony/polyfill-php80/composer.json deleted file mode 100644 index 5fe679db392..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/LICENSE b/upload/system/storage/vendor/symfony/polyfill-php81/LICENSE deleted file mode 100644 index efb17f98e7d..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php81/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2021 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/Php81.php b/upload/system/storage/vendor/symfony/polyfill-php81/Php81.php deleted file mode 100644 index f0507b765c2..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php81/Php81.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php81; - -/** - * @author Nicolas Grekas - * - * @internal - */ -final class Php81 -{ - public static function array_is_list(array $array): bool - { - if ([] === $array || $array === array_values($array)) { - return true; - } - - $nextKey = -1; - - foreach ($array as $k => $v) { - if ($k !== ++$nextKey) { - return false; - } - } - - return true; - } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/README.md b/upload/system/storage/vendor/symfony/polyfill-php81/README.md deleted file mode 100644 index 5ef61be6a86..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php81/README.md +++ /dev/null @@ -1,16 +0,0 @@ -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 -- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php deleted file mode 100644 index f4cad34f646..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php +++ /dev/null @@ -1,11 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php81 as p; - -if (\PHP_VERSION_ID >= 80100) { - return; -} - -if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { - define('MYSQLI_REFRESH_REPLICA', 64); -} - -if (!function_exists('array_is_list')) { - function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } -} - -if (!function_exists('enum_exists')) { - function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } -} diff --git a/upload/system/storage/vendor/symfony/polyfill-php81/composer.json b/upload/system/storage/vendor/symfony/polyfill-php81/composer.json deleted file mode 100644 index c39ccf47785..00000000000 --- a/upload/system/storage/vendor/symfony/polyfill-php81/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-php81", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/.gitignore b/upload/system/storage/vendor/symfony/translation-contracts/.gitignore deleted file mode 100644 index c49a5d8df5c..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md b/upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26132d..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/upload/system/storage/vendor/symfony/translation-contracts/LICENSE b/upload/system/storage/vendor/symfony/translation-contracts/LICENSE deleted file mode 100644 index 2358414536d..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2021 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php deleted file mode 100644 index 6923b977e45..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/LocaleAwareInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation; - -interface LocaleAwareInterface -{ - /** - * Sets the current locale. - * - * @throws \InvalidArgumentException If the locale contains invalid characters - */ - public function setLocale(string $locale); - - /** - * Returns the current locale. - */ - public function getLocale(): string; -} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/README.md b/upload/system/storage/vendor/symfony/translation-contracts/README.md deleted file mode 100644 index 42e5c51754e..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony Translation Contracts -============================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful - and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php deleted file mode 100644 index c2c30a91729..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ /dev/null @@ -1,384 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation\Test; - -use PHPUnit\Framework\TestCase; -use Symfony\Contracts\Translation\TranslatorInterface; -use Symfony\Contracts\Translation\TranslatorTrait; - -/** - * Test should cover all languages mentioned on http://translate.sourceforge.net/wiki/l10n/pluralforms - * and Plural forms mentioned on http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms. - * - * See also https://developer.mozilla.org/en/Localization_and_Plurals which mentions 15 rules having a maximum of 6 forms. - * The mozilla code is also interesting to check for. - * - * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199 - * - * The goal to cover all languages is to far fetched so this test case is smaller. - * - * @author Clemens Tolboom clemens@build2be.nl - */ -class TranslatorTest extends TestCase -{ - private $defaultLocale; - - protected function setUp(): void - { - $this->defaultLocale = \Locale::getDefault(); - \Locale::setDefault('en'); - } - - protected function tearDown(): void - { - \Locale::setDefault($this->defaultLocale); - } - - public function getTranslator(): TranslatorInterface - { - return new class() implements TranslatorInterface { - use TranslatorTrait; - }; - } - - /** - * @dataProvider getTransTests - */ - public function testTrans($expected, $id, $parameters) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, $parameters)); - } - - /** - * @dataProvider getTransChoiceTests - */ - public function testTransChoiceWithExplicitLocale($expected, $id, $number) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); - } - - /** - * @requires extension intl - * - * @dataProvider getTransChoiceTests - */ - public function testTransChoiceWithDefaultLocale($expected, $id, $number) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); - } - - /** - * @dataProvider getTransChoiceTests - */ - public function testTransChoiceWithEnUsPosix($expected, $id, $number) - { - $translator = $this->getTranslator(); - $translator->setLocale('en_US_POSIX'); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); - } - - public function testGetSetLocale() - { - $translator = $this->getTranslator(); - - $this->assertEquals('en', $translator->getLocale()); - } - - /** - * @requires extension intl - */ - public function testGetLocaleReturnsDefaultLocaleIfNotSet() - { - $translator = $this->getTranslator(); - - \Locale::setDefault('pt_BR'); - $this->assertEquals('pt_BR', $translator->getLocale()); - - \Locale::setDefault('en'); - $this->assertEquals('en', $translator->getLocale()); - } - - public function getTransTests() - { - return [ - ['Symfony is great!', 'Symfony is great!', []], - ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']], - ]; - } - - public function getTransChoiceTests() - { - return [ - ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], - ['There are 0 apples', 'There is 1 apple|There are %count% apples', 0], - ['There is 1 apple', 'There is 1 apple|There are %count% apples', 1], - ['There are 10 apples', 'There is 1 apple|There are %count% apples', 10], - // custom validation messages may be coded with a fixed value - ['There are 2 apples', 'There are 2 apples', 2], - ]; - } - - /** - * @dataProvider getInternal - */ - public function testInterval($expected, $number, $interval) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number])); - } - - public function getInternal() - { - return [ - ['foo', 3, '{1,2, 3 ,4}'], - ['bar', 10, '{1,2, 3 ,4}'], - ['bar', 3, '[1,2]'], - ['foo', 1, '[1,2]'], - ['foo', 2, '[1,2]'], - ['bar', 1, ']1,2['], - ['bar', 2, ']1,2['], - ['foo', log(0), '[-Inf,2['], - ['foo', -log(0), '[-2,+Inf]'], - ]; - } - - /** - * @dataProvider getChooseTests - */ - public function testChoose($expected, $id, $number, $locale = null) - { - $translator = $this->getTranslator(); - - $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number], null, $locale)); - } - - public function testReturnMessageIfExactlyOneStandardRuleIsGiven() - { - $translator = $this->getTranslator(); - - $this->assertEquals('There are two apples', $translator->trans('There are two apples', ['%count%' => 2])); - } - - /** - * @dataProvider getNonMatchingMessages - */ - public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) - { - $this->expectException(\InvalidArgumentException::class); - $translator = $this->getTranslator(); - - $translator->trans($id, ['%count%' => $number]); - } - - public function getNonMatchingMessages() - { - return [ - ['{0} There are no apples|{1} There is one apple', 2], - ['{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['{1} There is one apple|]2,Inf] There are %count% apples', 2], - ['{0} There are no apples|There is one apple', 2], - ]; - } - - public function getChooseTests() - { - return [ - ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['There are no apples', '{0}There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], - - ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], - - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf]There are %count% apples', 10], - ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], - - ['There are 0 apples', 'There is one apple|There are %count% apples', 0], - ['There is one apple', 'There is one apple|There are %count% apples', 1], - ['There are 10 apples', 'There is one apple|There are %count% apples', 10], - - ['There are 0 apples', 'one: There is one apple|more: There are %count% apples', 0], - ['There is one apple', 'one: There is one apple|more: There are %count% apples', 1], - ['There are 10 apples', 'one: There is one apple|more: There are %count% apples', 10], - - ['There are no apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 0], - ['There is one apple', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 1], - ['There are 10 apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 10], - - ['', '{0}|{1} There is one apple|]1,Inf] There are %count% apples', 0], - ['', '{0} There are no apples|{1}|]1,Inf] There are %count% apples', 1], - - // Indexed only tests which are Gettext PoFile* compatible strings. - ['There are 0 apples', 'There is one apple|There are %count% apples', 0], - ['There is one apple', 'There is one apple|There are %count% apples', 1], - ['There are 2 apples', 'There is one apple|There are %count% apples', 2], - - // Tests for float numbers - ['There is almost one apple', '{0} There are no apples|]0,1[ There is almost one apple|{1} There is one apple|[1,Inf] There is more than one apple', 0.7], - ['There is one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1], - ['There is more than one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1.7], - ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], - ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0.0], - ['There are no apples', '{0.0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], - - // Test texts with new-lines - // with double-quotes and \n in id & double-quotes and actual newlines in text - ["This is a text with a\n new-line in it. Selector = 0.", '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 0], - // with double-quotes and \n in id and single-quotes and actual newlines in text - ["This is a text with a\n new-line in it. Selector = 1.", '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 1], - ["This is a text with a\n new-line in it. Selector > 1.", '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 5], - // with double-quotes and id split accros lines - ['This is a text with a - new-line in it. Selector = 1.', '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 1], - // with single-quotes and id split accros lines - ['This is a text with a - new-line in it. Selector > 1.', '{0}This is a text with a - new-line in it. Selector = 0.|{1}This is a text with a - new-line in it. Selector = 1.|[1,Inf]This is a text with a - new-line in it. Selector > 1.', 5], - // with single-quotes and \n in text - ['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0], - // with double-quotes and id split accros lines - ["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1], - // esacape pipe - ['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0], - // Empty plural set (2 plural forms) from a .PO file - ['', '|', 1], - // Empty plural set (3 plural forms) from a .PO file - ['', '||', 1], - - // Floating values - ['1.5 liters', '%count% liter|%count% liters', 1.5], - ['1.5 litre', '%count% litre|%count% litres', 1.5, 'fr'], - - // Negative values - ['-1 degree', '%count% degree|%count% degrees', -1], - ['-1 degré', '%count% degré|%count% degrés', -1], - ['-1.5 degrees', '%count% degree|%count% degrees', -1.5], - ['-1.5 degré', '%count% degré|%count% degrés', -1.5, 'fr'], - ['-2 degrees', '%count% degree|%count% degrees', -2], - ['-2 degrés', '%count% degré|%count% degrés', -2], - ]; - } - - /** - * @dataProvider failingLangcodes - */ - public function testFailedLangcodes($nplural, $langCodes) - { - $matrix = $this->generateTestData($langCodes); - $this->validateMatrix($nplural, $matrix, false); - } - - /** - * @dataProvider successLangcodes - */ - public function testLangcodes($nplural, $langCodes) - { - $matrix = $this->generateTestData($langCodes); - $this->validateMatrix($nplural, $matrix); - } - - /** - * This array should contain all currently known langcodes. - * - * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. - */ - public function successLangcodes(): array - { - return [ - ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], - ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']], - ['3', ['be', 'bs', 'cs', 'hr']], - ['4', ['cy', 'mt', 'sl']], - ['6', ['ar']], - ]; - } - - /** - * This array should be at least empty within the near future. - * - * This both depends on a complete list trying to add above as understanding - * the plural rules of the current failing languages. - * - * @return array with nplural together with langcodes - */ - public function failingLangcodes(): array - { - return [ - ['1', ['fa']], - ['2', ['jbo']], - ['3', ['cbs']], - ['4', ['gd', 'kw']], - ['5', ['ga']], - ]; - } - - /** - * We validate only on the plural coverage. Thus the real rules is not tested. - * - * @param string $nplural Plural expected - * @param array $matrix Containing langcodes and their plural index values - */ - protected function validateMatrix(string $nplural, array $matrix, bool $expectSuccess = true) - { - foreach ($matrix as $langCode => $data) { - $indexes = array_flip($data); - if ($expectSuccess) { - $this->assertEquals($nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); - } else { - $this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); - } - } - } - - protected function generateTestData($langCodes) - { - $translator = new class() { - use TranslatorTrait { - getPluralizationRule as public; - } - }; - - $matrix = []; - foreach ($langCodes as $langCode) { - for ($count = 0; $count < 200; ++$count) { - $plural = $translator->getPluralizationRule($count, $langCode); - $matrix[$langCode][$count] = $plural; - } - } - - return $matrix; - } -} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php deleted file mode 100644 index 47fd6fa029f..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/TranslatableInterface.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation; - -/** - * @author Nicolas Grekas - */ -interface TranslatableInterface -{ - public function trans(TranslatorInterface $translator, string $locale = null): string; -} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php deleted file mode 100644 index 018db07ebf4..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorInterface.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation; - -/** - * @author Fabien Potencier - */ -interface TranslatorInterface -{ - /** - * Translates the given message. - * - * When a number is provided as a parameter named "%count%", the message is parsed for plural - * forms and a translation is chosen according to this number using the following rules: - * - * Given a message with different plural translations separated by a - * pipe (|), this method returns the correct portion of the message based - * on the given number, locale and the pluralization rules in the message - * itself. - * - * The message supports two different types of pluralization rules: - * - * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples - * indexed: There is one apple|There are %count% apples - * - * The indexed solution can also contain labels (e.g. one: There is one apple). - * This is purely for making the translations more clear - it does not - * affect the functionality. - * - * The two methods can also be mixed: - * {0} There are no apples|one: There is one apple|more: There are %count% apples - * - * An interval can represent a finite set of numbers: - * {1,2,3,4} - * - * An interval can represent numbers between two numbers: - * [1, +Inf] - * ]-1,2[ - * - * The left delimiter can be [ (inclusive) or ] (exclusive). - * The right delimiter can be [ (exclusive) or ] (inclusive). - * Beside numbers, you can use -Inf and +Inf for the infinite. - * - * @see https://en.wikipedia.org/wiki/ISO_31-11 - * - * @param string $id The message id (may also be an object that can be cast to string) - * @param array $parameters An array of parameters for the message - * @param string|null $domain The domain for the message or null to use the default - * @param string|null $locale The locale or null to use the default - * - * @throws \InvalidArgumentException If the locale contains invalid characters - */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string; - - /** - * Returns the default locale. - */ - public function getLocale(): string; -} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php b/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php deleted file mode 100644 index 9c264bd293f..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/TranslatorTrait.php +++ /dev/null @@ -1,260 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Translation; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * A trait to help implement TranslatorInterface and LocaleAwareInterface. - * - * @author Fabien Potencier - */ -trait TranslatorTrait -{ - private ?string $locale = null; - - /** - * {@inheritdoc} - */ - public function setLocale(string $locale) - { - $this->locale = $locale; - } - - /** - * {@inheritdoc} - */ - public function getLocale(): string - { - return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); - } - - /** - * {@inheritdoc} - */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string - { - if (null === $id || '' === $id) { - return ''; - } - - if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) { - return strtr($id, $parameters); - } - - $number = (float) $parameters['%count%']; - $locale = $locale ?: $this->getLocale(); - - $parts = []; - if (preg_match('/^\|++$/', $id)) { - $parts = explode('|', $id); - } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) { - $parts = $matches[0]; - } - - $intervalRegexp = <<<'EOF' -/^(?P - ({\s* - (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) - \s*}) - - | - - (?P[\[\]]) - \s* - (?P-Inf|\-?\d+(\.\d+)?) - \s*,\s* - (?P\+?Inf|\-?\d+(\.\d+)?) - \s* - (?P[\[\]]) -)\s*(?P.*?)$/xs -EOF; - - $standardRules = []; - foreach ($parts as $part) { - $part = trim(str_replace('||', '|', $part)); - - // try to match an explicit rule, then fallback to the standard ones - if (preg_match($intervalRegexp, $part, $matches)) { - if ($matches[2]) { - foreach (explode(',', $matches[3]) as $n) { - if ($number == $n) { - return strtr($matches['message'], $parameters); - } - } - } else { - $leftNumber = '-Inf' === $matches['left'] ? -\INF : (float) $matches['left']; - $rightNumber = is_numeric($matches['right']) ? (float) $matches['right'] : \INF; - - if (('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber) - && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber) - ) { - return strtr($matches['message'], $parameters); - } - } - } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) { - $standardRules[] = $matches[1]; - } else { - $standardRules[] = $part; - } - } - - $position = $this->getPluralizationRule($number, $locale); - - if (!isset($standardRules[$position])) { - // when there's exactly one rule given, and that rule is a standard - // rule, use this rule - if (1 === \count($parts) && isset($standardRules[0])) { - return strtr($standardRules[0], $parameters); - } - - $message = sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number); - - if (class_exists(InvalidArgumentException::class)) { - throw new InvalidArgumentException($message); - } - - throw new \InvalidArgumentException($message); - } - - return strtr($standardRules[$position], $parameters); - } - - /** - * Returns the plural position to use for the given locale and number. - * - * The plural rules are derived from code of the Zend Framework (2010-09-25), - * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). - * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - */ - private function getPluralizationRule(float $number, string $locale): int - { - $number = abs($number); - - switch ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { - case 'af': - case 'bn': - case 'bg': - case 'ca': - case 'da': - case 'de': - case 'el': - case 'en': - case 'en_US_POSIX': - case 'eo': - case 'es': - case 'et': - case 'eu': - case 'fa': - case 'fi': - case 'fo': - case 'fur': - case 'fy': - case 'gl': - case 'gu': - case 'ha': - case 'he': - case 'hu': - case 'is': - case 'it': - case 'ku': - case 'lb': - case 'ml': - case 'mn': - case 'mr': - case 'nah': - case 'nb': - case 'ne': - case 'nl': - case 'nn': - case 'no': - case 'oc': - case 'om': - case 'or': - case 'pa': - case 'pap': - case 'ps': - case 'pt': - case 'so': - case 'sq': - case 'sv': - case 'sw': - case 'ta': - case 'te': - case 'tk': - case 'ur': - case 'zu': - return (1 == $number) ? 0 : 1; - - case 'am': - case 'bh': - case 'fil': - case 'fr': - case 'gun': - case 'hi': - case 'hy': - case 'ln': - case 'mg': - case 'nso': - case 'pt_BR': - case 'ti': - case 'wa': - return ($number < 2) ? 0 : 1; - - case 'be': - case 'bs': - case 'hr': - case 'ru': - case 'sh': - case 'sr': - case 'uk': - return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - - case 'cs': - case 'sk': - return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); - - case 'ga': - return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2); - - case 'lt': - return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - - case 'sl': - return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3)); - - case 'mk': - return (1 == $number % 10) ? 0 : 1; - - case 'mt': - return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); - - case 'lv': - return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2); - - case 'pl': - return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); - - case 'cy': - return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3)); - - case 'ro': - return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); - - case 'ar': - return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))); - - default: - return 0; - } - } -} diff --git a/upload/system/storage/vendor/symfony/translation-contracts/composer.json b/upload/system/storage/vendor/symfony/translation-contracts/composer.json deleted file mode 100644 index 875242f6d9a..00000000000 --- a/upload/system/storage/vendor/symfony/translation-contracts/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "symfony/translation-contracts", - "type": "library", - "description": "Generic abstractions related to translation", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.0.2" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\Translation\\": "" } - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/CHANGELOG.md b/upload/system/storage/vendor/symfony/validator/CHANGELOG.md index 35f7a3e0e1a..0ff667b7706 100644 --- a/upload/system/storage/vendor/symfony/validator/CHANGELOG.md +++ b/upload/system/storage/vendor/symfony/validator/CHANGELOG.md @@ -1,186 +1,6 @@ CHANGELOG ========= -5.4 ---- - - * Add a `Cidr` constraint to validate CIDR notations - * Add a `CssColor` constraint to validate CSS colors - * Add support for `ConstraintViolationList::createFromMessage()` - * Add error's uid to `Count` and `Length` constraints with "exactly" option enabled - -5.3 ---- - - * Add the `normalizer` option to the `Unique` constraint - * Add `Validation::createIsValidCallable()` that returns true/false instead of throwing exceptions - -5.2.0 ------ - - * added a `Cascade` constraint to ease validating nested typed object properties - * deprecated the `allowEmptyString` option of the `Length` constraint - - Before: - - ```php - use Symfony\Component\Validator\Constraints as Assert; - - /** - * @Assert\Length(min=5, allowEmptyString=true) - */ - ``` - - After: - - ```php - use Symfony\Component\Validator\Constraints as Assert; - - /** - * @Assert\AtLeastOneOf({ - * @Assert\Blank(), - * @Assert\Length(min=5) - * }) - */ - ``` - * added the `Isin` constraint and validator - * added the `ULID` constraint and validator - * added support for UUIDv6 in `Uuid` constraint - * enabled the validator to load constraints from PHP attributes - * deprecated the `NumberConstraintTrait` trait - * deprecated setting or creating a Doctrine annotation reader via `ValidatorBuilder::enableAnnotationMapping()`, pass `true` as first parameter and additionally call `setDoctrineAnnotationReader()` or `addDefaultDoctrineAnnotationReader()` to set up the annotation reader - -5.1.0 ------ - - * added the `Hostname` constraint and validator - * added the `alpha3` option to the `Country` and `Language` constraints - * allow to define a reusable set of constraints by extending the `Compound` constraint - * added `Sequentially` constraint, to sequentially validate a set of constraints (any violation raised will prevent further validation of the nested constraints) - * added the `divisibleBy` option to the `Count` constraint - * added the `ExpressionLanguageSyntax` constraint - -5.0.0 ------ - - * an `ExpressionLanguage` instance or null must be passed as the first argument of `ExpressionValidator::__construct()` - * removed the `checkDNS` and `dnsMessage` options of the `Url` constraint - * removed the `checkMX`, `checkHost` and `strict` options of the `Email` constraint - * removed support for validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator` - * removed support for using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl` - * removed support for using the `Email` constraint without `egulias/email-validator` - * removed support for using the `Expression` constraint without `symfony/expression-language` - * changed default value of `canonicalize` option of `Locale` constraint to `true` - * removed `ValidatorBuilderInterface` - * passing a null message when instantiating a `ConstraintViolation` is not allowed - * changed the default value of `Length::$allowEmptyString` to `false` and made it optional - * removed `Symfony\Component\Validator\Mapping\Cache\CacheInterface` in favor of PSR-6. - * removed `ValidatorBuilder::setMetadataCache`, use `ValidatorBuilder::setMappingCache` instead. - -4.4.0 ------ - - * [BC BREAK] using null as `$classValidatorRegexp` value in `PropertyInfoLoader::__construct` will not enable auto-mapping for all classes anymore, use `'{.*}'` instead. - * added `EnableAutoMapping` and `DisableAutoMapping` constraints to enable or disable auto mapping for class or a property - * using anything else than a `string` as the code of a `ConstraintViolation` is deprecated, a `string` type-hint will - be added to the constructor of the `ConstraintViolation` class and to the `ConstraintViolationBuilder::setCode()` - method in 5.0 - * deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`. Pass it as the first argument instead. - * added the `compared_value_path` parameter in violations when using any - comparison constraint with the `propertyPath` option. - * added support for checking an array of types in `TypeValidator` - * added a new `allowEmptyString` option to the `Length` constraint to allow rejecting empty strings when `min` is set, by setting it to `false`. - * Added new `minPropertyPath` and `maxPropertyPath` options - to `Range` constraint in order to get the value to compare - from an array or object - * added the `min_limit_path` and `max_limit_path` parameters in violations when using - `Range` constraint with respectively the `minPropertyPath` and - `maxPropertyPath` options - * added a new `notInRangeMessage` option to the `Range` constraint that will - be used in the violation builder when both `min` and `max` are not null - * added ability to use stringable objects as violation messages - * Overriding the methods `ConstraintValidatorTestCase::setUp()` and `ConstraintValidatorTestCase::tearDown()` without the `void` return-type is deprecated. - * deprecated `Symfony\Component\Validator\Mapping\Cache\CacheInterface` in favor of PSR-6. - * deprecated `ValidatorBuilder::setMetadataCache`, use `ValidatorBuilder::setMappingCache` instead. - * Marked the `ValidatorDataCollector` class as `@final`. - -4.3.0 ------ - - * added `Timezone` constraint - * added `NotCompromisedPassword` constraint - * added options `iban` and `ibanPropertyPath` to Bic constraint - * added UATP cards support to `CardSchemeValidator` - * added option `allowNull` to NotBlank constraint - * added `Json` constraint - * added `Unique` constraint - * added a new `normalizer` option to the string constraints and to the `NotBlank` constraint - * added `Positive` constraint - * added `PositiveOrZero` constraint - * added `Negative` constraint - * added `NegativeOrZero` constraint - -4.2.0 ------ - - * added a new `UnexpectedValueException` that can be thrown by constraint validators, these exceptions are caught by - the validator and are converted into constraint violations - * added `DivisibleBy` constraint - * decoupled from `symfony/translation` by using `Symfony\Contracts\Translation\TranslatorInterface` - * deprecated `ValidatorBuilderInterface` - * made `ValidatorBuilder::setTranslator()` final - * marked `format` the default option in `DateTime` constraint - * deprecated validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator`. - * deprecated using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl` - * deprecated using the `Email` constraint without `egulias/email-validator` - * deprecated using the `Expression` constraint without `symfony/expression-language` - -4.1.0 ------ - - * Deprecated the `checkDNS` and `dnsMessage` options of the `Url` constraint. - * added a `values` option to the `Expression` constraint - * Deprecated use of `Locale` constraint without setting `true` at "canonicalize" option, which will be the default value in 5.0 - -4.0.0 ------ - - * Setting the `strict` option of the `Choice` constraint to anything but `true` - is not supported anymore. - * removed the `DateTimeValidator::PATTERN` constant - * removed the `AbstractConstraintValidatorTest` class - * removed support for setting the `checkDNS` option of the `Url` constraint to `true` - -3.4.0 ------ - - * added support for validation groups to the `Valid` constraint - * not setting the `strict` option of the `Choice` constraint to `true` is - deprecated and will throw an exception in Symfony 4.0 - * setting the `checkDNS` option of the `Url` constraint to `true` is deprecated in favor of - the `Url::CHECK_DNS_TYPE_*` constants values and will throw an exception in Symfony 4.0 - * added min/max amount of pixels check to `Image` constraint via `minPixels` and `maxPixels` - * added a new "propertyPath" option to comparison constraints in order to get the value to compare from an array or object - -3.3.0 ------ - - * added `AddValidatorInitializersPass` - * added `AddConstraintValidatorsPass` - * added `ContainerConstraintValidatorFactory` - -3.2.0 ------ - - * deprecated `Tests\Constraints\AbstractConstraintValidatorTest` in favor of `Test\ConstraintValidatorTestCase` - * added support for PHP constants in YAML configuration files - -3.1.0 ------ - - * deprecated `DateTimeValidator::PATTERN` constant - * added a `format` option to the `DateTime` constraint - 2.8.0 ----- diff --git a/upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php b/upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php deleted file mode 100644 index ad0ebba0213..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Command/DebugCommand.php +++ /dev/null @@ -1,203 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Command; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Dumper; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Finder; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Mapping\ClassMetadataInterface; -use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; - -/** - * A console command to debug Validators information. - * - * @author Loïc Frémont - */ -class DebugCommand extends Command -{ - protected static $defaultName = 'debug:validator'; - protected static $defaultDescription = 'Display validation constraints for classes'; - - private $validator; - - public function __construct(MetadataFactoryInterface $validator) - { - parent::__construct(); - - $this->validator = $validator; - } - - protected function configure() - { - $this - ->addArgument('class', InputArgument::REQUIRED, 'A fully qualified class name or a path') - ->addOption('show-all', null, InputOption::VALUE_NONE, 'Show all classes even if they have no validation constraints') - ->setDescription(self::$defaultDescription) - ->setHelp(<<<'EOF' -The %command.name% 'App\Entity\Dummy' command dumps the validators for the dummy class. - -The %command.name% src/ command dumps the validators for the `src` directory. -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $class = $input->getArgument('class'); - - if (class_exists($class)) { - $this->dumpValidatorsForClass($input, $output, $class); - - return 0; - } - - try { - foreach ($this->getResourcesByPath($class) as $class) { - $this->dumpValidatorsForClass($input, $output, $class); - } - } catch (DirectoryNotFoundException $exception) { - $io = new SymfonyStyle($input, $output); - $io->error(sprintf('Neither class nor path were found with "%s" argument.', $input->getArgument('class'))); - - return 1; - } - - return 0; - } - - private function dumpValidatorsForClass(InputInterface $input, OutputInterface $output, string $class): void - { - $io = new SymfonyStyle($input, $output); - $title = sprintf('%s', $class); - $rows = []; - $dump = new Dumper($output); - - foreach ($this->getConstrainedPropertiesData($class) as $propertyName => $constraintsData) { - foreach ($constraintsData as $data) { - $rows[] = [ - $propertyName, - $data['class'], - implode(', ', $data['groups']), - $dump($data['options']), - ]; - } - } - - if (!$rows) { - if (false === $input->getOption('show-all')) { - return; - } - - $io->section($title); - $io->text('No validators were found for this class.'); - - return; - } - - $io->section($title); - - $table = new Table($output); - $table->setHeaders(['Property', 'Name', 'Groups', 'Options']); - $table->setRows($rows); - $table->setColumnMaxWidth(3, 80); - $table->render(); - } - - private function getConstrainedPropertiesData(string $class): array - { - $data = []; - - /** @var ClassMetadataInterface $classMetadata */ - $classMetadata = $this->validator->getMetadataFor($class); - - foreach ($classMetadata->getConstrainedProperties() as $constrainedProperty) { - $data[$constrainedProperty] = $this->getPropertyData($classMetadata, $constrainedProperty); - } - - return $data; - } - - private function getPropertyData(ClassMetadataInterface $classMetadata, string $constrainedProperty): array - { - $data = []; - - $propertyMetadata = $classMetadata->getPropertyMetadata($constrainedProperty); - foreach ($propertyMetadata as $metadata) { - foreach ($metadata->getConstraints() as $constraint) { - $data[] = [ - 'class' => \get_class($constraint), - 'groups' => $constraint->groups, - 'options' => $this->getConstraintOptions($constraint), - ]; - } - } - - return $data; - } - - private function getConstraintOptions(Constraint $constraint): array - { - $options = []; - - foreach (array_keys(get_object_vars($constraint)) as $propertyName) { - // Groups are dumped on a specific column. - if ('groups' === $propertyName) { - continue; - } - - $options[$propertyName] = $constraint->$propertyName; - } - - ksort($options); - - return $options; - } - - private function getResourcesByPath(string $path): array - { - $finder = new Finder(); - $finder->files()->in($path)->name('*.php')->sortByName(true); - $classes = []; - - foreach ($finder as $file) { - $fileContent = file_get_contents($file->getRealPath()); - - preg_match('/namespace (.+);/', $fileContent, $matches); - - $namespace = $matches[1] ?? null; - - if (!preg_match('/class +([^{ ]+)/', $fileContent, $matches)) { - // no class found - continue; - } - - $className = trim($matches[1]); - - if (null !== $namespace) { - $classes[] = $namespace.'\\'.$className; - } else { - $classes[] = $className; - } - } - - return $classes; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraint.php b/upload/system/storage/vendor/symfony/validator/Constraint.php index 27ddcb88913..45d4bcf41a4 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraint.php +++ b/upload/system/storage/vendor/symfony/validator/Constraint.php @@ -25,6 +25,8 @@ * * Constraint instances are immutable and serializable. * + * @property array $groups The groups that the constraint belongs to + * * @author Bernhard Schussek */ abstract class Constraint @@ -32,22 +34,22 @@ abstract class Constraint /** * The name of the group given to all constraints with no explicit group. */ - public const DEFAULT_GROUP = 'Default'; + const DEFAULT_GROUP = 'Default'; /** * Marks a constraint that can be put onto classes. */ - public const CLASS_CONSTRAINT = 'class'; + const CLASS_CONSTRAINT = 'class'; /** * Marks a constraint that can be put onto properties. */ - public const PROPERTY_CONSTRAINT = 'property'; + const PROPERTY_CONSTRAINT = 'property'; /** * Maps error codes to the names of their constants. */ - protected static $errorNames = []; + protected static $errorNames = array(); /** * Domain-specific data attached to a constraint. @@ -56,24 +58,19 @@ abstract class Constraint */ public $payload; - /** - * The groups that the constraint belongs to. - * - * @var string[] - */ - public $groups; - /** * Returns the name of the given error code. * - * @return string + * @param string $errorCode The error code + * + * @return string The name of the error code * * @throws InvalidArgumentException If the error code does not exist */ - public static function getErrorName(string $errorCode) + public static function getErrorName($errorCode) { if (!isset(static::$errorNames[$errorCode])) { - throw new InvalidArgumentException(sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, static::class)); + throw new InvalidArgumentException(sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, \get_called_class())); } return static::$errorNames[$errorCode]; @@ -94,11 +91,9 @@ public static function getErrorName(string $errorCode) * getRequiredOptions() to return the names of these options. If any * option is not set here, an exception is thrown. * - * @param mixed $options The options (as associative array) - * or the value for the default - * option (any other type) - * @param string[] $groups An array of validation groups - * @param mixed $payload Domain-specific data attached to a constraint + * @param mixed $options The options (as associative array) + * or the value for the default + * option (any other type) * * @throws InvalidOptionsException When you pass the names of non-existing * options @@ -108,72 +103,54 @@ public static function getErrorName(string $errorCode) * array, but getDefaultOption() returns * null */ - public function __construct($options = null, array $groups = null, $payload = null) + public function __construct($options = null) { - unset($this->groups); // enable lazy initialization - - $options = $this->normalizeOptions($options); - if (null !== $groups) { - $options['groups'] = $groups; - } - $options['payload'] = $payload ?? $options['payload'] ?? null; - - foreach ($options as $name => $value) { - $this->$name = $value; - } - } - - protected function normalizeOptions($options): array - { - $normalizedOptions = []; - $defaultOption = $this->getDefaultOption(); - $invalidOptions = []; + $invalidOptions = array(); $missingOptions = array_flip((array) $this->getRequiredOptions()); - $knownOptions = get_class_vars(static::class); + $knownOptions = get_object_vars($this); - if (\is_array($options) && isset($options['value']) && !property_exists($this, 'value')) { - if (null === $defaultOption) { - throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', static::class)); - } + // The "groups" option is added to the object lazily + $knownOptions['groups'] = true; - $options[$defaultOption] = $options['value']; + if (\is_array($options) && \count($options) >= 1 && isset($options['value']) && !property_exists($this, 'value')) { + $options[$this->getDefaultOption()] = $options['value']; unset($options['value']); } if (\is_array($options)) { reset($options); } - if ($options && \is_array($options) && \is_string(key($options))) { + if (\is_array($options) && \count($options) > 0 && \is_string(key($options))) { foreach ($options as $option => $value) { - if (\array_key_exists($option, $knownOptions)) { - $normalizedOptions[$option] = $value; + if (array_key_exists($option, $knownOptions)) { + $this->$option = $value; unset($missingOptions[$option]); } else { $invalidOptions[] = $option; } } } elseif (null !== $options && !(\is_array($options) && 0 === \count($options))) { - if (null === $defaultOption) { - throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint "%s".', static::class)); + $option = $this->getDefaultOption(); + + if (null === $option) { + throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint %s', \get_class($this))); } - if (\array_key_exists($defaultOption, $knownOptions)) { - $normalizedOptions[$defaultOption] = $options; - unset($missingOptions[$defaultOption]); + if (array_key_exists($option, $knownOptions)) { + $this->$option = $options; + unset($missingOptions[$option]); } else { - $invalidOptions[] = $defaultOption; + $invalidOptions[] = $option; } } if (\count($invalidOptions) > 0) { - throw new InvalidOptionsException(sprintf('The options "%s" do not exist in constraint "%s".', implode('", "', $invalidOptions), static::class), $invalidOptions); + throw new InvalidOptionsException(sprintf('The options "%s" do not exist in constraint %s', implode('", "', $invalidOptions), \get_class($this)), $invalidOptions); } if (\count($missingOptions) > 0) { - throw new MissingOptionsException(sprintf('The options "%s" must be set for constraint "%s".', implode('", "', array_keys($missingOptions)), static::class), array_keys($missingOptions)); + throw new MissingOptionsException(sprintf('The options "%s" must be set for constraint %s', implode('", "', array_keys($missingOptions)), \get_class($this)), array_keys($missingOptions)); } - - return $normalizedOptions; } /** @@ -183,11 +160,12 @@ protected function normalizeOptions($options): array * this method will be called at most once per constraint instance and * option name. * - * @param mixed $value The value to set + * @param string $option The option name + * @param mixed $value The value to set * * @throws InvalidOptionsException If an invalid option name is given */ - public function __set(string $option, $value) + public function __set($option, $value) { if ('groups' === $option) { $this->groups = (array) $value; @@ -195,7 +173,7 @@ public function __set(string $option, $value) return; } - throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]); + throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), array($option)); } /** @@ -205,38 +183,42 @@ public function __set(string $option, $value) * this method will be called at most once per constraint instance and * option name. * - * @return mixed + * @param string $option The option name + * + * @return mixed The value of the option * * @throws InvalidOptionsException If an invalid option name is given + * + * @internal this method should not be used or overwritten in userland code */ - public function __get(string $option) + public function __get($option) { if ('groups' === $option) { - $this->groups = [self::DEFAULT_GROUP]; + $this->groups = array(self::DEFAULT_GROUP); return $this->groups; } - throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [$option]); + throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, \get_class($this)), array($option)); } /** + * @param string $option The option name + * * @return bool */ - public function __isset(string $option) + public function __isset($option) { return 'groups' === $option; } /** * Adds the given group if this constraint is in the Default group. + * + * @param string $group */ - public function addImplicitGroupName(string $group) + public function addImplicitGroupName($group) { - if (null === $this->groups && \array_key_exists('groups', (array) $this)) { - throw new \LogicException(sprintf('"%s::$groups" is set to null. Did you forget to call "%s::__construct()"?', static::class, self::class)); - } - if (\in_array(self::DEFAULT_GROUP, $this->groups) && !\in_array($group, $this->groups)) { $this->groups[] = $group; } @@ -247,13 +229,12 @@ public function addImplicitGroupName(string $group) * * Override this method to define a default option. * - * @return string|null + * @return string * * @see __construct() */ public function getDefaultOption() { - return null; } /** @@ -261,13 +242,13 @@ public function getDefaultOption() * * Override this method if you want to define required options. * - * @return string[] + * @return array * * @see __construct() */ public function getRequiredOptions() { - return []; + return array(); } /** @@ -275,13 +256,13 @@ public function getRequiredOptions() * * By default, this is the fully qualified name of the constraint class * suffixed with "Validator". You can override this method to change that - * behavior. + * behaviour. * * @return string */ public function validatedBy() { - return static::class.'Validator'; + return \get_class($this).'Validator'; } /** @@ -291,7 +272,7 @@ public function validatedBy() * This method should return one or more of the constants * Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT. * - * @return string|string[] One or more constant values + * @return string|array One or more constant values */ public function getTargets() { @@ -301,9 +282,13 @@ public function getTargets() /** * Optimizes the serialized value to minimize storage space. * - * @internal + * @return array The properties to serialize + * + * @internal This method may be replaced by an implementation of + * {@link \Serializable} in the future. Please don't use or + * overwrite it. */ - public function __sleep(): array + public function __sleep() { // Initialize "groups" option if it is not set $this->groups; diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintValidator.php b/upload/system/storage/vendor/symfony/validator/ConstraintValidator.php index 1473c69353e..6f8c05a2c45 100644 --- a/upload/system/storage/vendor/symfony/validator/ConstraintValidator.php +++ b/upload/system/storage/vendor/symfony/validator/ConstraintValidator.php @@ -11,7 +11,9 @@ namespace Symfony\Component\Validator; -use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Context\ExecutionContextInterface as ExecutionContextInterface2Dot5; +use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; +use Symfony\Component\Validator\Violation\LegacyConstraintViolationBuilder; /** * Base class for constraint validators. @@ -21,18 +23,18 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface { /** - * Whether to format {@link \DateTime} objects, either with the {@link \IntlDateFormatter} - * (if it is available) or as RFC-3339 dates ("Y-m-d H:i:s"). + * Whether to format {@link \DateTime} objects as RFC-3339 dates + * ("Y-m-d H:i:s"). */ - public const PRETTY_DATE = 1; + const PRETTY_DATE = 1; /** * Whether to cast objects with a "__toString()" method to strings. */ - public const OBJECT_TO_STRING = 2; + const OBJECT_TO_STRING = 2; /** - * @var ExecutionContextInterface + * @var ExecutionContextInterface2Dot5 */ protected $context; @@ -44,6 +46,51 @@ public function initialize(ExecutionContextInterface $context) $this->context = $context; } + /** + * Wrapper for {@link ExecutionContextInterface::buildViolation} that + * supports the 2.4 context API. + * + * @param string $message The violation message + * @param array $parameters The message parameters + * + * @return ConstraintViolationBuilderInterface The violation builder + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + protected function buildViolation($message, array $parameters = array()) + { + @trigger_error('The '.__METHOD__.' is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + if ($this->context instanceof ExecutionContextInterface2Dot5) { + return $this->context->buildViolation($message, $parameters); + } + + return new LegacyConstraintViolationBuilder($this->context, $message, $parameters); + } + + /** + * Wrapper for {@link ExecutionContextInterface::buildViolation} that + * supports the 2.4 context API. + * + * @param ExecutionContextInterface $context The context to use + * @param string $message The violation message + * @param array $parameters The message parameters + * + * @return ConstraintViolationBuilderInterface The violation builder + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + protected function buildViolationInContext(ExecutionContextInterface $context, $message, array $parameters = array()) + { + @trigger_error('The '.__METHOD__.' is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + if ($context instanceof ExecutionContextInterface2Dot5) { + return $context->buildViolation($message, $parameters); + } + + return new LegacyConstraintViolationBuilder($context, $message, $parameters); + } + /** * Returns a string representation of the type of the value. * @@ -54,11 +101,11 @@ public function initialize(ExecutionContextInterface $context) * * @param mixed $value The value to return the type of * - * @return string + * @return string The type of the value */ protected function formatTypeOf($value) { - return get_debug_type($value); + return \is_object($value) ? \get_class($value) : \gettype($value); } /** @@ -69,8 +116,7 @@ protected function formatTypeOf($value) * in double quotes ("). Objects, arrays and resources are formatted as * "object", "array" and "resource". If the $format bitmask contains * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted - * with the {@link \IntlDateFormatter}. If it is not available, they will be - * formatted as RFC-3339 dates ("Y-m-d H:i:s"). + * as RFC-3339 dates ("Y-m-d H:i:s"). * * Be careful when passing message parameters to a constraint violation * that (may) contain objects, arrays or resources. These parameters @@ -82,18 +128,27 @@ protected function formatTypeOf($value) * @param int $format A bitwise combination of the format * constants in this class * - * @return string + * @return string The string representation of the passed value */ - protected function formatValue($value, int $format = 0) + protected function formatValue($value, $format = 0) { - if (($format & self::PRETTY_DATE) && $value instanceof \DateTimeInterface) { - if (class_exists(\IntlDateFormatter::class)) { - $formatter = new \IntlDateFormatter(\Locale::getDefault(), \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT, 'UTC'); - - return $formatter->format(new \DateTime( - $value->format('Y-m-d H:i:s.u'), - new \DateTimeZone('UTC') - )); + $isDateTime = $value instanceof \DateTime || $value instanceof \DateTimeInterface; + + if (($format & self::PRETTY_DATE) && $isDateTime) { + if (class_exists('IntlDateFormatter')) { + $locale = \Locale::getDefault(); + $formatter = new \IntlDateFormatter($locale, \IntlDateFormatter::MEDIUM, \IntlDateFormatter::SHORT); + + // neither the native nor the stub IntlDateFormatter support + // DateTimeImmutable as of yet + if (!$value instanceof \DateTime) { + $value = new \DateTime( + $value->format('Y-m-d H:i:s.u e'), + $value->getTimezone() + ); + } + + return $formatter->format($value); } return $value->format('Y-m-d H:i:s'); @@ -144,11 +199,11 @@ protected function formatValue($value, int $format = 0) * @param int $format A bitwise combination of the format * constants in this class * - * @return string + * @return string The string representation of the value list * * @see formatValue() */ - protected function formatValues(array $values, int $format = 0) + protected function formatValues(array $values, $format = 0) { foreach ($values as $key => $value) { $values[$key] = $this->formatValue($value, $format); diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php index 45f3ca94e8e..cc6981b9461 100644 --- a/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php +++ b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorFactory.php @@ -24,10 +24,13 @@ */ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface { - protected $validators = []; + protected $validators = array(); - public function __construct() + private $propertyAccessor; + + public function __construct($propertyAccessor = null) { + $this->propertyAccessor = $propertyAccessor; } /** @@ -39,7 +42,7 @@ public function getInstance(Constraint $constraint) if (!isset($this->validators[$className])) { $this->validators[$className] = 'validator.expression' === $className - ? new ExpressionValidator() + ? new ExpressionValidator($this->propertyAccessor) : new $className(); } diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php index 308c1e61913..85fd451ac4a 100644 --- a/upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php +++ b/upload/system/storage/vendor/symfony/validator/ConstraintValidatorInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator; -use Symfony\Component\Validator\Context\ExecutionContextInterface; - /** * @author Bernhard Schussek */ @@ -20,13 +18,16 @@ interface ConstraintValidatorInterface { /** * Initializes the constraint validator. + * + * @param ExecutionContextInterface $context The current validation context */ public function initialize(ExecutionContextInterface $context); /** * Checks if the passed value is valid. * - * @param mixed $value The value that should be validated + * @param mixed $value The value that should be validated + * @param Constraint $constraint The constraint for the validation */ public function validate($value, Constraint $constraint); } diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolation.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolation.php index 33aa42a1be3..804aa2cbe10 100644 --- a/upload/system/storage/vendor/symfony/validator/ConstraintViolation.php +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolation.php @@ -32,29 +32,25 @@ class ConstraintViolation implements ConstraintViolationInterface /** * Creates a new constraint violation. * - * @param string|\Stringable $message The violation message as a string or a stringable object - * @param string|null $messageTemplate The raw violation message - * @param array $parameters The parameters to substitute in the - * raw violation message - * @param mixed $root The value originally passed to the - * validator - * @param string|null $propertyPath The property path from the root - * value to the invalid value - * @param mixed $invalidValue The invalid value that caused this - * violation - * @param int|null $plural The number for determining the plural - * form when translating the message - * @param string|null $code The error code of the violation - * @param Constraint|null $constraint The constraint whose validation - * caused the violation - * @param mixed $cause The cause of the violation + * @param string $message The violation message + * @param string $messageTemplate The raw violation message + * @param array $parameters The parameters to substitute in the + * raw violation message + * @param mixed $root The value originally passed to the + * validator + * @param string $propertyPath The property path from the root + * value to the invalid value + * @param mixed $invalidValue The invalid value that caused this + * violation + * @param int|null $plural The number for determining the plural + * form when translating the message + * @param mixed $code The error code of the violation + * @param Constraint|null $constraint The constraint whose validation + * caused the violation + * @param mixed $cause The cause of the violation */ - public function __construct($message, ?string $messageTemplate, array $parameters, $root, ?string $propertyPath, $invalidValue, int $plural = null, string $code = null, Constraint $constraint = null, $cause = null) + public function __construct($message, $messageTemplate, array $parameters, $root, $propertyPath, $invalidValue, $plural = null, $code = null, Constraint $constraint = null, $cause = null) { - if (!\is_string($message) && !(\is_object($message) && method_exists($message, '__toString'))) { - throw new \TypeError('Constraint violation message should be a string or an object which implements the __toString() method.'); - } - $this->message = $message; $this->messageTemplate = $messageTemplate; $this->parameters = $parameters; @@ -70,7 +66,7 @@ public function __construct($message, ?string $messageTemplate, array $parameter /** * Converts the violation into a string for debugging purposes. * - * @return string + * @return string The violation as string */ public function __toString() { @@ -83,12 +79,13 @@ public function __toString() } $propertyPath = (string) $this->propertyPath; + $code = $this->code; if ('' !== $propertyPath && '[' !== $propertyPath[0] && '' !== $class) { $class .= '.'; } - if (null !== ($code = $this->code) && '' !== $code) { + if (!empty($code)) { $code = ' (code '.$code.')'; } @@ -100,11 +97,24 @@ public function __toString() */ public function getMessageTemplate() { - return (string) $this->messageTemplate; + return $this->messageTemplate; } /** * {@inheritdoc} + * + * @deprecated since version 2.7, to be removed in 3.0. + * Use getParameters() instead + */ + public function getMessageParameters() + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.7, to be removed in 3.0. Use the ConstraintViolation::getParameters() method instead.', E_USER_DEPRECATED); + + return $this->parameters; + } + + /** + * Alias of {@link getMessageParameters()}. */ public function getParameters() { @@ -113,6 +123,19 @@ public function getParameters() /** * {@inheritdoc} + * + * @deprecated since version 2.7, to be removed in 3.0. + * Use getPlural() instead + */ + public function getMessagePluralization() + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.7, to be removed in 3.0. Use the ConstraintViolation::getPlural() method instead.', E_USER_DEPRECATED); + + return $this->plural; + } + + /** + * Alias of {@link getMessagePluralization()}. */ public function getPlural() { @@ -140,7 +163,7 @@ public function getRoot() */ public function getPropertyPath() { - return (string) $this->propertyPath; + return $this->propertyPath; } /** @@ -154,7 +177,7 @@ public function getInvalidValue() /** * Returns the constraint whose validation caused the violation. * - * @return Constraint|null + * @return Constraint|null The constraint or null if it is not known */ public function getConstraint() { diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php index fd7d414d7cd..0ab53b0fef6 100644 --- a/upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolationInterface.php @@ -36,7 +36,7 @@ interface ConstraintViolationInterface /** * Returns the violation message. * - * @return string|\Stringable + * @return string The violation message */ public function getMessage(); @@ -44,7 +44,7 @@ public function getMessage(); * Returns the raw violation message. * * The raw violation message contains placeholders for the parameters - * returned by {@link getParameters}. Typically you'll pass the + * returned by {@link getMessageParameters}. Typically you'll pass the * message template and parameters to a translation engine. * * @return string The raw violation message @@ -58,8 +58,9 @@ public function getMessageTemplate(); * that appear in the message template * * @see getMessageTemplate() + * @deprecated since version 2.7, to be replaced by getParameters() in 3.0. */ - public function getParameters(); + public function getMessageParameters(); /** * Returns a number for pluralizing the violation message. @@ -76,8 +77,10 @@ public function getParameters(); * pluralization form (in this case "choices"). * * @return int|null The number to use to pluralize of the message + * + * @deprecated since version 2.7, to be replaced by getPlural() in 3.0. */ - public function getPlural(); + public function getMessagePluralization(); /** * Returns the root element of the validation. @@ -114,7 +117,7 @@ public function getInvalidValue(); /** * Returns a machine-digestible error code for the violation. * - * @return string|null + * @return string|null The error code */ public function getCode(); } diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php index 3d459b2c18c..feb17327201 100644 --- a/upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolationList.php @@ -15,40 +15,30 @@ * Default implementation of {@ConstraintViolationListInterface}. * * @author Bernhard Schussek - * - * @implements \IteratorAggregate */ class ConstraintViolationList implements \IteratorAggregate, ConstraintViolationListInterface { /** - * @var list + * @var ConstraintViolationInterface[] */ - private $violations = []; + private $violations = array(); /** * Creates a new constraint violation list. * - * @param iterable $violations The constraint violations to add to the list + * @param ConstraintViolationInterface[] $violations The constraint violations to add to the list */ - public function __construct(iterable $violations = []) + public function __construct(array $violations = array()) { foreach ($violations as $violation) { $this->add($violation); } } - public static function createFromMessage(string $message): self - { - $self = new self(); - $self->add(new ConstraintViolation($message, '', [], null, '', null)); - - return $self; - } - /** * Converts the violation into a string for debugging purposes. * - * @return string + * @return string The violation as string */ public function __toString() { @@ -82,7 +72,7 @@ public function addAll(ConstraintViolationListInterface $otherList) /** * {@inheritdoc} */ - public function get(int $offset) + public function get($offset) { if (!isset($this->violations[$offset])) { throw new \OutOfBoundsException(sprintf('The offset "%s" does not exist.', $offset)); @@ -94,7 +84,7 @@ public function get(int $offset) /** * {@inheritdoc} */ - public function has(int $offset) + public function has($offset) { return isset($this->violations[$offset]); } @@ -102,7 +92,7 @@ public function has(int $offset) /** * {@inheritdoc} */ - public function set(int $offset, ConstraintViolationInterface $violation) + public function set($offset, ConstraintViolationInterface $violation) { $this->violations[$offset] = $violation; } @@ -110,7 +100,7 @@ public function set(int $offset, ConstraintViolationInterface $violation) /** * {@inheritdoc} */ - public function remove(int $offset) + public function remove($offset) { unset($this->violations[$offset]); } @@ -118,27 +108,24 @@ public function remove(int $offset) /** * {@inheritdoc} * - * @return \ArrayIterator + * @return \ArrayIterator|ConstraintViolationInterface[] */ - #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->violations); } /** - * @return int + * {@inheritdoc} */ - #[\ReturnTypeWillChange] public function count() { return \count($this->violations); } /** - * @return bool + * {@inheritdoc} */ - #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->has($offset); @@ -146,10 +133,7 @@ public function offsetExists($offset) /** * {@inheritdoc} - * - * @return ConstraintViolationInterface */ - #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->get($offset); @@ -157,10 +141,7 @@ public function offsetGet($offset) /** * {@inheritdoc} - * - * @return void */ - #[\ReturnTypeWillChange] public function offsetSet($offset, $violation) { if (null === $offset) { @@ -172,32 +153,9 @@ public function offsetSet($offset, $violation) /** * {@inheritdoc} - * - * @return void */ - #[\ReturnTypeWillChange] public function offsetUnset($offset) { $this->remove($offset); } - - /** - * Creates iterator for errors with specific codes. - * - * @param string|string[] $codes The codes to find - * - * @return static - */ - public function findByCodes($codes) - { - $codes = (array) $codes; - $violations = []; - foreach ($this as $violation) { - if (\in_array($violation->getCode(), $codes, true)) { - $violations[] = $violation; - } - } - - return new static($violations); - } } diff --git a/upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php b/upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php index f994668caa6..0489ab500a1 100644 --- a/upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php +++ b/upload/system/storage/vendor/symfony/validator/ConstraintViolationListInterface.php @@ -15,9 +15,6 @@ * A list of constraint violations. * * @author Bernhard Schussek - * - * @extends \ArrayAccess - * @extends \Traversable */ interface ConstraintViolationListInterface extends \Traversable, \Countable, \ArrayAccess { @@ -29,39 +26,40 @@ public function add(ConstraintViolationInterface $violation); /** * Merges an existing violation list into this list. */ - public function addAll(self $otherList); + public function addAll(ConstraintViolationListInterface $otherList); /** * Returns the violation at a given offset. * * @param int $offset The offset of the violation * - * @return ConstraintViolationInterface + * @return ConstraintViolationInterface The violation * * @throws \OutOfBoundsException if the offset does not exist */ - public function get(int $offset); + public function get($offset); /** * Returns whether the given offset exists. * * @param int $offset The violation offset * - * @return bool + * @return bool Whether the offset exists */ - public function has(int $offset); + public function has($offset); /** * Sets a violation at a given offset. * - * @param int $offset The violation offset + * @param int $offset The violation offset + * @param ConstraintViolationInterface $violation The violation */ - public function set(int $offset, ConstraintViolationInterface $violation); + public function set($offset, ConstraintViolationInterface $violation); /** * Removes a violation at a given offset. * * @param int $offset The offset to remove */ - public function remove(int $offset); + public function remove($offset); } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php index d492655d931..15afebb0bc4 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparison.php @@ -11,10 +11,8 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\Exception\LogicException; /** * Used for the comparison of values. @@ -26,37 +24,21 @@ abstract class AbstractComparison extends Constraint { public $message; public $value; - public $propertyPath; /** * {@inheritdoc} - * - * @param mixed $value the value to compare or a set of options */ - public function __construct($value = null, $propertyPath = null, string $message = null, array $groups = null, $payload = null, array $options = []) + public function __construct($options = null) { - if (\is_array($value)) { - $options = array_merge($value, $options); - } elseif (null !== $value) { - $options['value'] = $value; + if (null === $options) { + $options = array(); } - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->propertyPath = $propertyPath ?? $this->propertyPath; - - if (null === $this->value && null === $this->propertyPath) { - throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires either the "value" or "propertyPath" option to be set.', static::class)); + if (\is_array($options) && !isset($options['value'])) { + throw new ConstraintDefinitionException(sprintf('The %s constraint requires the "value" option to be set.', \get_class($this))); } - if (null !== $this->value && null !== $this->propertyPath) { - throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "value" or "propertyPath" options to be set, not both.', static::class)); - } - - if (null !== $this->propertyPath && !class_exists(PropertyAccess::class)) { - throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "propertyPath" option.', static::class)); - } + parent::__construct($options); } /** diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php index c3a117d2cff..9620ead2d63 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AbstractComparisonValidator.php @@ -11,12 +11,9 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; -use Symfony\Component\PropertyAccess\PropertyAccess; -use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -27,77 +24,53 @@ */ abstract class AbstractComparisonValidator extends ConstraintValidator { - private $propertyAccessor; - - public function __construct(PropertyAccessorInterface $propertyAccessor = null) - { - $this->propertyAccessor = $propertyAccessor; - } - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof AbstractComparison) { - throw new UnexpectedTypeException($constraint, AbstractComparison::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\AbstractComparison'); } if (null === $value) { return; } - if ($path = $constraint->propertyPath) { - if (null === $object = $this->context->getObject()) { - return; - } - - try { - $comparedValue = $this->getPropertyAccessor()->getValue($object, $path); - } catch (NoSuchPropertyException $e) { - throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); - } - } else { - $comparedValue = $constraint->value; - } + $comparedValue = $constraint->value; // Convert strings to DateTimes if comparing another DateTime // This allows to compare with any date/time value supported by // the DateTime constructor: - // https://php.net/datetime.formats - if (\is_string($comparedValue) && $value instanceof \DateTimeInterface) { - // If $value is immutable, convert the compared value to a DateTimeImmutable too, otherwise use DateTime - $dateTimeClass = $value instanceof \DateTimeImmutable ? \DateTimeImmutable::class : \DateTime::class; - - try { - $comparedValue = new $dateTimeClass($comparedValue); - } catch (\Exception $e) { - throw new ConstraintDefinitionException(sprintf('The compared value "%s" could not be converted to a "%s" instance in the "%s" constraint.', $comparedValue, $dateTimeClass, get_debug_type($constraint))); + // http://php.net/manual/en/datetime.formats.php + if (\is_string($comparedValue)) { + if ($value instanceof \DateTimeImmutable) { + // If $value is immutable, convert the compared value to a + // DateTimeImmutable too + $comparedValue = new \DateTimeImmutable($comparedValue); + } elseif ($value instanceof \DateTime || $value instanceof \DateTimeInterface) { + // Otherwise use DateTime + $comparedValue = new \DateTime($comparedValue); } } if (!$this->compareValues($value, $comparedValue)) { - $violationBuilder = $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE)) - ->setParameter('{{ compared_value }}', $this->formatValue($comparedValue, self::OBJECT_TO_STRING | self::PRETTY_DATE)) - ->setParameter('{{ compared_value_type }}', $this->formatTypeOf($comparedValue)) - ->setCode($this->getErrorCode()); - - if (null !== $path) { - $violationBuilder->setParameter('{{ compared_value_path }}', $path); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE)) + ->setParameter('{{ compared_value }}', $this->formatValue($comparedValue, self::OBJECT_TO_STRING | self::PRETTY_DATE)) + ->setParameter('{{ compared_value_type }}', $this->formatTypeOf($comparedValue)) + ->setCode($this->getErrorCode()) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE)) + ->setParameter('{{ compared_value }}', $this->formatValue($comparedValue, self::OBJECT_TO_STRING | self::PRETTY_DATE)) + ->setParameter('{{ compared_value_type }}', $this->formatTypeOf($comparedValue)) + ->setCode($this->getErrorCode()) + ->addViolation(); } - - $violationBuilder->addViolation(); - } - } - - private function getPropertyAccessor(): PropertyAccessorInterface - { - if (null === $this->propertyAccessor) { - $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); } - - return $this->propertyAccessor; } /** @@ -106,17 +79,16 @@ private function getPropertyAccessor(): PropertyAccessorInterface * @param mixed $value1 The first value to compare * @param mixed $value2 The second value to compare * - * @return bool + * @return bool true if the relationship is valid, false otherwise */ abstract protected function compareValues($value1, $value2); /** * Returns the error code used if the comparison fails. * - * @return string|null + * @return string|null The error code or `null` if no code should be set */ protected function getErrorCode() { - return null; } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/All.php b/upload/system/storage/vendor/symfony/validator/Constraints/All.php index 5b4297647da..b531a1d645a 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/All.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/All.php @@ -17,15 +17,9 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class All extends Composite { - public $constraints = []; - - public function __construct($constraints = null, array $groups = null, $payload = null) - { - parent::__construct($constraints ?? [], $groups, $payload); - } + public $constraints = array(); public function getDefaultOption() { @@ -34,7 +28,7 @@ public function getDefaultOption() public function getRequiredOptions() { - return ['constraints']; + return array('constraints'); } protected function getCompositeOption() diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php index 611ac8deae3..fa763c5f910 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/AllValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek @@ -27,7 +27,7 @@ class AllValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof All) { - throw new UnexpectedTypeException($constraint, All::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\All'); } if (null === $value) { @@ -35,15 +35,22 @@ public function validate($value, Constraint $constraint) } if (!\is_array($value) && !$value instanceof \Traversable) { - throw new UnexpectedValueException($value, 'iterable'); + throw new UnexpectedTypeException($value, 'array or Traversable'); } $context = $this->context; - $validator = $context->getValidator()->inContext($context); - - foreach ($value as $key => $element) { - $validator->atPath('['.$key.']')->validate($element, $constraint->constraints); + if ($context instanceof ExecutionContextInterface) { + $validator = $context->getValidator()->inContext($context); + + foreach ($value as $key => $element) { + $validator->atPath('['.$key.']')->validate($element, $constraint->constraints); + } + } else { + // 2.4 API + foreach ($value as $key => $element) { + $context->validateValue($element, $constraint->constraints, '['.$key.']'); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php b/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php deleted file mode 100644 index f01ed9cf4cf..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOf.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author PrzemysÅ‚aw Bogusz - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class AtLeastOneOf extends Composite -{ - public const AT_LEAST_ONE_OF_ERROR = 'f27e6d6c-261a-4056-b391-6673a623531c'; - - protected static $errorNames = [ - self::AT_LEAST_ONE_OF_ERROR => 'AT_LEAST_ONE_OF_ERROR', - ]; - - public $constraints = []; - public $message = 'This value should satisfy at least one of the following constraints:'; - public $messageCollection = 'Each element of this collection should satisfy its own set of constraints.'; - public $includeInternalMessages = true; - - public function __construct($constraints = null, array $groups = null, $payload = null, string $message = null, string $messageCollection = null, bool $includeInternalMessages = null) - { - parent::__construct($constraints ?? [], $groups, $payload); - - $this->message = $message ?? $this->message; - $this->messageCollection = $messageCollection ?? $this->messageCollection; - $this->includeInternalMessages = $includeInternalMessages ?? $this->includeInternalMessages; - } - - public function getDefaultOption() - { - return 'constraints'; - } - - public function getRequiredOptions() - { - return ['constraints']; - } - - protected function getCompositeOption() - { - return 'constraints'; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php deleted file mode 100644 index 95558519d85..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/AtLeastOneOfValidator.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; - -/** - * @author PrzemysÅ‚aw Bogusz - */ -class AtLeastOneOfValidator extends ConstraintValidator -{ - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof AtLeastOneOf) { - throw new UnexpectedTypeException($constraint, AtLeastOneOf::class); - } - - $validator = $this->context->getValidator(); - - $messages = [$constraint->message]; - - foreach ($constraint->constraints as $key => $item) { - $executionContext = clone $this->context; - $executionContext->setNode($value, $this->context->getObject(), $this->context->getMetadata(), $this->context->getPropertyPath()); - $violations = $validator->inContext($executionContext)->validate($value, $item, $this->context->getGroup())->getViolations(); - - if (\count($this->context->getViolations()) === \count($violations)) { - return; - } - - if ($constraint->includeInternalMessages) { - $message = ' ['.($key + 1).'] '; - - if ($item instanceof All || $item instanceof Collection) { - $message .= $constraint->messageCollection; - } else { - $message .= $violations->get(\count($violations) - 1)->getMessage(); - } - - $messages[] = $message; - } - } - - $this->context->buildViolation(implode('', $messages)) - ->setCode(AtLeastOneOf::AT_LEAST_ONE_OF_ERROR) - ->addViolation() - ; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Bic.php b/upload/system/storage/vendor/symfony/validator/Constraints/Bic.php index 1cd98b41d26..dee5d526938 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Bic.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Bic.php @@ -11,12 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Countries; -use Symfony\Component\PropertyAccess\PropertyAccess; -use Symfony\Component\PropertyAccess\PropertyPathInterface; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\Exception\LogicException; /** * @Annotation @@ -24,56 +19,21 @@ * * @author Michael Hirschler */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Bic extends Constraint { - public const INVALID_LENGTH_ERROR = '66dad313-af0b-4214-8566-6c799be9789c'; - public const INVALID_CHARACTERS_ERROR = 'f424c529-7add-4417-8f2d-4b656e4833e2'; - public const INVALID_BANK_CODE_ERROR = '00559357-6170-4f29-aebd-d19330aa19cf'; - public const INVALID_COUNTRY_CODE_ERROR = '1ce76f8d-3c1f-451c-9e62-fe9c3ed486ae'; - public const INVALID_CASE_ERROR = '11884038-3312-4ae5-9d04-699f782130c7'; - public const INVALID_IBAN_COUNTRY_CODE_ERROR = '29a2c3bb-587b-4996-b6f5-53081364cea5'; + const INVALID_LENGTH_ERROR = '66dad313-af0b-4214-8566-6c799be9789c'; + const INVALID_CHARACTERS_ERROR = 'f424c529-7add-4417-8f2d-4b656e4833e2'; + const INVALID_BANK_CODE_ERROR = '00559357-6170-4f29-aebd-d19330aa19cf'; + const INVALID_COUNTRY_CODE_ERROR = '1ce76f8d-3c1f-451c-9e62-fe9c3ed486ae'; + const INVALID_CASE_ERROR = '11884038-3312-4ae5-9d04-699f782130c7'; - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_LENGTH_ERROR => 'INVALID_LENGTH_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', self::INVALID_BANK_CODE_ERROR => 'INVALID_BANK_CODE_ERROR', self::INVALID_COUNTRY_CODE_ERROR => 'INVALID_COUNTRY_CODE_ERROR', self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR', - ]; + ); public $message = 'This is not a valid Business Identifier Code (BIC).'; - public $ibanMessage = 'This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.'; - public $iban; - public $ibanPropertyPath; - - /** - * {@inheritdoc} - * - * @param string|PropertyPathInterface|null $ibanPropertyPath - */ - public function __construct(array $options = null, string $message = null, string $iban = null, $ibanPropertyPath = null, string $ibanMessage = null, array $groups = null, $payload = null) - { - if (!class_exists(Countries::class)) { - throw new LogicException('The Intl component is required to use the Bic constraint. Try running "composer require symfony/intl".'); - } - if (null !== $ibanPropertyPath && !\is_string($ibanPropertyPath) && !$ibanPropertyPath instanceof PropertyPathInterface) { - throw new \TypeError(sprintf('"%s": Expected argument $ibanPropertyPath to be either null, a string or an instance of "%s", got "%s".', __METHOD__, PropertyPathInterface::class, get_debug_type($ibanPropertyPath))); - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->ibanMessage = $ibanMessage ?? $this->ibanMessage; - $this->iban = $iban ?? $this->iban; - $this->ibanPropertyPath = $ibanPropertyPath ?? $this->ibanPropertyPath; - - if (null !== $this->iban && null !== $this->ibanPropertyPath) { - throw new ConstraintDefinitionException('The "iban" and "ibanPropertyPath" options of the Iban constraint cannot be used at the same time.'); - } - - if (null !== $this->ibanPropertyPath && !class_exists(PropertyAccess::class)) { - throw new LogicException(sprintf('The "symfony/property-access" component is required to use the "%s" constraint with the "ibanPropertyPath" option.', self::class)); - } - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php index ff87b6e0e69..2a27beff9bf 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/BicValidator.php @@ -11,16 +11,9 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Countries; -use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; -use Symfony\Component\PropertyAccess\PropertyAccess; -use Symfony\Component\PropertyAccess\PropertyAccessor; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\Exception\LogicException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Michael Hirschler @@ -29,53 +22,23 @@ */ class BicValidator extends ConstraintValidator { - private const BIC_COUNTRY_TO_IBAN_COUNTRY_MAP = [ - // Reference: https://www.ecbs.org/iban/france-bank-account-number.html - 'GF' => 'FR', // French Guiana - 'PF' => 'FR', // French Polynesia - 'TF' => 'FR', // French Southern Territories - 'GP' => 'FR', // Guadeloupe - 'MQ' => 'FR', // Martinique - 'YT' => 'FR', // Mayotte - 'NC' => 'FR', // New Caledonia - 'RE' => 'FR', // Reunion - 'PM' => 'FR', // Saint Pierre and Miquelon - 'WF' => 'FR', // Wallis and Futuna Islands - // Reference: https://www.ecbs.org/iban/united-kingdom-uk-bank-account-number.html - 'JE' => 'GB', // Jersey - 'IM' => 'GB', // Isle of Man - 'GG' => 'GB', // Guernsey - 'VG' => 'GB', // British Virgin Islands - ]; - - private $propertyAccessor; - - public function __construct(PropertyAccessor $propertyAccessor = null) - { - $this->propertyAccessor = $propertyAccessor; - } - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof Bic) { - throw new UnexpectedTypeException($constraint, Bic::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Bic'); } if (null === $value || '' === $value) { return; } - if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); - } - $canonicalize = str_replace(' ', '', $value); // the bic must be either 8 or 11 characters long - if (!\in_array(\strlen($canonicalize), [8, 11])) { + if (!\in_array(\strlen($canonicalize), array(8, 11))) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Bic::INVALID_LENGTH_ERROR) @@ -104,7 +67,8 @@ public function validate($value, Constraint $constraint) return; } - if (!Countries::exists(substr($canonicalize, 4, 2))) { + // next 2 letters must be alphabetic (country code) + if (!ctype_alpha(substr($canonicalize, 4, 2))) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Bic::INVALID_COUNTRY_CODE_ERROR) @@ -122,44 +86,5 @@ public function validate($value, Constraint $constraint) return; } - - // check against an IBAN - $iban = $constraint->iban; - $path = $constraint->ibanPropertyPath; - if ($path && null !== $object = $this->context->getObject()) { - try { - $iban = $this->getPropertyAccessor()->getValue($object, $path); - } catch (NoSuchPropertyException $e) { - throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $path, get_debug_type($constraint)).$e->getMessage(), 0, $e); - } - } - if (!$iban) { - return; - } - $ibanCountryCode = substr($iban, 0, 2); - if (ctype_alpha($ibanCountryCode) && !$this->bicAndIbanCountriesMatch(substr($canonicalize, 4, 2), $ibanCountryCode)) { - $this->context->buildViolation($constraint->ibanMessage) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setParameter('{{ iban }}', $iban) - ->setCode(Bic::INVALID_IBAN_COUNTRY_CODE_ERROR) - ->addViolation(); - } - } - - private function getPropertyAccessor(): PropertyAccessor - { - if (null === $this->propertyAccessor) { - if (!class_exists(PropertyAccess::class)) { - throw new LogicException('Unable to use property path as the Symfony PropertyAccess component is not installed.'); - } - $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); - } - - return $this->propertyAccessor; - } - - private function bicAndIbanCountriesMatch(string $bicCountryCode, string $ibanCountryCode): bool - { - return $ibanCountryCode === $bicCountryCode || $ibanCountryCode === (self::BIC_COUNTRY_TO_IBAN_COUNTRY_MAP[$bicCountryCode] ?? null); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Blank.php b/upload/system/storage/vendor/symfony/validator/Constraints/Blank.php index a9ee5259a18..030b21f959d 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Blank.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Blank.php @@ -19,21 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Blank extends Constraint { - public const NOT_BLANK_ERROR = '183ad2de-533d-4796-a439-6d3c3852b549'; + const NOT_BLANK_ERROR = '183ad2de-533d-4796-a439-6d3c3852b549'; - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_BLANK_ERROR => 'NOT_BLANK_ERROR', - ]; + ); public $message = 'This value should be blank.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options ?? [], $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php index 3fd7fcc9fe1..7e4d7385579 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/BlankValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -26,14 +27,21 @@ class BlankValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Blank) { - throw new UnexpectedTypeException($constraint, Blank::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Blank'); } if ('' !== $value && null !== $value) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Blank::NOT_BLANK_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Blank::NOT_BLANK_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Blank::NOT_BLANK_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Callback.php b/upload/system/storage/vendor/symfony/validator/Constraints/Callback.php index 7b9c3c37c83..592ae00ba4f 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Callback.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Callback.php @@ -19,7 +19,6 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Callback extends Constraint { /** @@ -28,24 +27,36 @@ class Callback extends Constraint public $callback; /** - * {@inheritdoc} + * @var array * - * @param array|string|callable $callback The callback or a set of options + * @deprecated since version 2.4, to be removed in 3.0. */ - public function __construct($callback = null, array $groups = null, $payload = null, array $options = []) + public $methods; + + /** + * {@inheritdoc} + */ + public function __construct($options = null) { // Invocation through annotations with an array parameter only - if (\is_array($callback) && 1 === \count($callback) && isset($callback['value'])) { - $callback = $callback['value']; + if (\is_array($options) && 1 === \count($options) && isset($options['value'])) { + $options = $options['value']; + } + + if (\is_array($options) && isset($options['methods'])) { + @trigger_error('The "methods" option of the '.__CLASS__.' class is deprecated since Symfony 2.4 and will be removed in 3.0. Use the "callback" option instead.', E_USER_DEPRECATED); } - if (!\is_array($callback) || (!isset($callback['callback']) && !isset($callback['groups']) && !isset($callback['payload']))) { - $options['callback'] = $callback; - } else { - $options = array_merge($callback, $options); + if (\is_array($options) && !isset($options['callback']) && !isset($options['methods']) && !isset($options['groups']) && !isset($options['payload'])) { + if (\is_callable($options) || !$options) { + $options = array('callback' => $options); + } else { + // @deprecated, to be removed in 3.0 + $options = array('methods' => $options); + } } - parent::__construct($options, $groups, $payload); + parent::__construct($options); } /** @@ -61,6 +72,6 @@ public function getDefaultOption() */ public function getTargets() { - return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT]; + return array(self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php index 71cff2a7668..d4b440f197a 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CallbackValidator.php @@ -29,32 +29,45 @@ class CallbackValidator extends ConstraintValidator public function validate($object, Constraint $constraint) { if (!$constraint instanceof Callback) { - throw new UnexpectedTypeException($constraint, Callback::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Callback'); } - $method = $constraint->callback; - if ($method instanceof \Closure) { - $method($object, $this->context, $constraint->payload); - } elseif (\is_array($method)) { - if (!\is_callable($method)) { - if (isset($method[0]) && \is_object($method[0])) { - $method[0] = \get_class($method[0]); + if (null !== $constraint->callback && null !== $constraint->methods) { + throw new ConstraintDefinitionException('The Callback constraint supports either the option "callback" or "methods", but not both at the same time.'); + } + + // has to be an array so that we can differentiate between callables + // and method names + if (null !== $constraint->methods && !\is_array($constraint->methods)) { + throw new UnexpectedTypeException($constraint->methods, 'array'); + } + + $methods = $constraint->methods ?: array($constraint->callback); + + foreach ($methods as $method) { + if ($method instanceof \Closure) { + $method($object, $this->context); + } elseif (\is_array($method)) { + if (!\is_callable($method)) { + if (isset($method[0]) && \is_object($method[0])) { + $method[0] = \get_class($method[0]); + } + throw new ConstraintDefinitionException(sprintf('%s targeted by Callback constraint is not a valid callable', json_encode($method))); } - throw new ConstraintDefinitionException(json_encode($method).' targeted by Callback constraint is not a valid callable.'); - } - $method($object, $this->context, $constraint->payload); - } elseif (null !== $object) { - if (!method_exists($object, $method)) { - throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist in class "%s".', $method, get_debug_type($object))); - } + \call_user_func($method, $object, $this->context); + } elseif (null !== $object) { + if (!method_exists($object, $method)) { + throw new ConstraintDefinitionException(sprintf('Method "%s" targeted by Callback constraint does not exist in class %s', $method, \get_class($object))); + } - $reflMethod = new \ReflectionMethod($object, $method); + $reflMethod = new \ReflectionMethod($object, $method); - if ($reflMethod->isStatic()) { - $reflMethod->invoke(null, $object, $this->context, $constraint->payload); - } else { - $reflMethod->invoke($object, $this->context, $constraint->payload); + if ($reflMethod->isStatic()) { + $reflMethod->invoke(null, $object, $this->context); + } else { + $reflMethod->invoke($object, $this->context); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php b/upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php index e9d66b9bbe5..40c32e879e8 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CardScheme.php @@ -22,51 +22,19 @@ * @author Tim Nagel * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class CardScheme extends Constraint { - public const AMEX = 'AMEX'; - public const CHINA_UNIONPAY = 'CHINA_UNIONPAY'; - public const DINERS = 'DINERS'; - public const DISCOVER = 'DISCOVER'; - public const INSTAPAYMENT = 'INSTAPAYMENT'; - public const JCB = 'JCB'; - public const LASER = 'LASER'; - public const MAESTRO = 'MAESTRO'; - public const MASTERCARD = 'MASTERCARD'; - public const MIR = 'MIR'; - public const UATP = 'UATP'; - public const VISA = 'VISA'; + const NOT_NUMERIC_ERROR = 'a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e'; + const INVALID_FORMAT_ERROR = 'a8faedbf-1c2f-4695-8d22-55783be8efed'; - public const NOT_NUMERIC_ERROR = 'a2ad9231-e827-485f-8a1e-ef4d9a6d5c2e'; - public const INVALID_FORMAT_ERROR = 'a8faedbf-1c2f-4695-8d22-55783be8efed'; - - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_NUMERIC_ERROR => 'NOT_NUMERIC_ERROR', self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', - ]; + ); public $message = 'Unsupported card type or invalid card number.'; public $schemes; - /** - * {@inheritdoc} - * - * @param array|string $schemes The schemes to validate against or a set of options - */ - public function __construct($schemes, string $message = null, array $groups = null, $payload = null, array $options = []) - { - if (\is_array($schemes) && \is_string(key($schemes))) { - $options = array_merge($schemes, $options); - } else { - $options['value'] = $schemes; - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } - public function getDefaultOption() { return 'schemes'; @@ -74,6 +42,6 @@ public function getDefaultOption() public function getRequiredOptions() { - return ['schemes']; + return array('schemes'); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php index faef7ec5ba5..f667bde8d61 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CardSchemeValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -21,85 +22,79 @@ * @author Tim Nagel * @author Bernhard Schussek * - * @see https://en.wikipedia.org/wiki/Payment_card_number - * @see https://www.regular-expressions.info/creditcard.html + * @see http://en.wikipedia.org/wiki/Bank_card_number + * @see http://www.regular-expressions.info/creditcard.html + * @see http://www.barclaycard.co.uk/business/files/Ranges_and_Rules_September_2014.pdf */ class CardSchemeValidator extends ConstraintValidator { - protected $schemes = [ + protected $schemes = array( // American Express card numbers start with 34 or 37 and have 15 digits. - CardScheme::AMEX => [ + 'AMEX' => array( '/^3[47][0-9]{13}$/', - ], + ), // China UnionPay cards start with 62 and have between 16 and 19 digits. // Please note that these cards do not follow Luhn Algorithm as a checksum. - CardScheme::CHINA_UNIONPAY => [ + 'CHINA_UNIONPAY' => array( '/^62[0-9]{14,17}$/', - ], + ), // Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. // There are Diners Club cards that begin with 5 and have 16 digits. // These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard. - CardScheme::DINERS => [ + 'DINERS' => array( '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/', - ], + ), // Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65. // All have 16 digits. - CardScheme::DISCOVER => [ + 'DISCOVER' => array( '/^6011[0-9]{12}$/', '/^64[4-9][0-9]{13}$/', '/^65[0-9]{14}$/', '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/', - ], + ), // InstaPayment cards begin with 637 through 639 and have 16 digits. - CardScheme::INSTAPAYMENT => [ + 'INSTAPAYMENT' => array( '/^63[7-9][0-9]{13}$/', - ], + ), // JCB cards beginning with 2131 or 1800 have 15 digits. // JCB cards beginning with 35 have 16 digits. - CardScheme::JCB => [ + 'JCB' => array( '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/', - ], + ), // Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits. - CardScheme::LASER => [ + 'LASER' => array( '/^(6304|670[69]|6771)[0-9]{12,15}$/', - ], + ), // Maestro international cards begin with 675900..675999 and have between 12 and 19 digits. // Maestro UK cards begin with either 500000..509999 or 560000..699999 and have between 12 and 19 digits. - CardScheme::MAESTRO => [ + 'MAESTRO' => array( '/^(6759[0-9]{2})[0-9]{6,13}$/', '/^(50[0-9]{4})[0-9]{6,13}$/', '/^5[6-9][0-9]{10,17}$/', '/^6[0-9]{11,18}$/', - ], + ), // All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. // October 2016 MasterCard numbers can also start with 222100 through 272099. - CardScheme::MASTERCARD => [ + 'MASTERCARD' => array( '/^5[1-5][0-9]{14}$/', '/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/', - ], - // Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then between 12 and 15 digits - CardScheme::MIR => [ - '/^220[0-4][0-9]{12,15}$/', - ], - // All UATP card numbers start with a 1 and have a length of 15 digits. - CardScheme::UATP => [ - '/^1[0-9]{14}$/', - ], + ), // All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits. - CardScheme::VISA => [ + 'VISA' => array( '/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/', - ], - ]; + ), + ); /** * Validates a creditcard belongs to a specified scheme. * - * @param mixed $value + * @param mixed $value + * @param Constraint $constraint */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof CardScheme) { - throw new UnexpectedTypeException($constraint, CardScheme::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\CardScheme'); } if (null === $value || '' === $value) { @@ -107,10 +102,17 @@ public function validate($value, Constraint $constraint) } if (!is_numeric($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(CardScheme::NOT_NUMERIC_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(CardScheme::NOT_NUMERIC_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(CardScheme::NOT_NUMERIC_ERROR) + ->addViolation(); + } return; } @@ -126,9 +128,16 @@ public function validate($value, Constraint $constraint) } } - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(CardScheme::INVALID_FORMAT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(CardScheme::INVALID_FORMAT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(CardScheme::INVALID_FORMAT_ERROR) + ->addViolation(); + } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php b/upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php deleted file mode 100644 index 2458d5c3164..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Cascade.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -/** - * @Annotation - * @Target({"CLASS"}) - * - * @author Jules Pietri - */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class Cascade extends Constraint -{ - public function __construct(array $options = null) - { - if (\is_array($options) && \array_key_exists('groups', $options)) { - throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); - } - - parent::__construct($options); - } - - /** - * {@inheritdoc} - */ - public function getTargets() - { - return self::CLASS_CONSTRAINT; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Choice.php b/upload/system/storage/vendor/symfony/validator/Constraints/Choice.php index b5bcc6d3d98..4b93c70e4a5 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Choice.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Choice.php @@ -19,23 +19,22 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Choice extends Constraint { - public const NO_SUCH_CHOICE_ERROR = '8e179f1b-97aa-4560-a02f-2a8b42e49df7'; - public const TOO_FEW_ERROR = '11edd7eb-5872-4b6e-9f12-89923999fd0e'; - public const TOO_MANY_ERROR = '9bd98e49-211c-433f-8630-fd1c2d0f08c3'; + const NO_SUCH_CHOICE_ERROR = '8e179f1b-97aa-4560-a02f-2a8b42e49df7'; + const TOO_FEW_ERROR = '11edd7eb-5872-4b6e-9f12-89923999fd0e'; + const TOO_MANY_ERROR = '9bd98e49-211c-433f-8630-fd1c2d0f08c3'; - protected static $errorNames = [ + protected static $errorNames = array( self::NO_SUCH_CHOICE_ERROR => 'NO_SUCH_CHOICE_ERROR', self::TOO_FEW_ERROR => 'TOO_FEW_ERROR', self::TOO_MANY_ERROR => 'TOO_MANY_ERROR', - ]; + ); public $choices; public $callback; public $multiple = false; - public $strict = true; + public $strict = false; public $min; public $max; public $message = 'The value you selected is not a valid choice.'; @@ -50,40 +49,4 @@ public function getDefaultOption() { return 'choices'; } - - public function __construct( - $options = [], - array $choices = null, - $callback = null, - bool $multiple = null, - bool $strict = null, - int $min = null, - int $max = null, - string $message = null, - string $multipleMessage = null, - string $minMessage = null, - string $maxMessage = null, - $groups = null, - $payload = null - ) { - if (\is_array($options) && $options && array_is_list($options)) { - $choices = $choices ?? $options; - $options = []; - } - if (null !== $choices) { - $options['value'] = $choices; - } - - parent::__construct($options, $groups, $payload); - - $this->callback = $callback ?? $this->callback; - $this->multiple = $multiple ?? $this->multiple; - $this->strict = $strict ?? $this->strict; - $this->min = $min ?? $this->min; - $this->max = $max ?? $this->max; - $this->message = $message ?? $this->message; - $this->multipleMessage = $multipleMessage ?? $this->multipleMessage; - $this->minMessage = $minMessage ?? $this->minMessage; - $this->maxMessage = $maxMessage ?? $this->maxMessage; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php index a1c47a6bb22..b92ba614a24 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ChoiceValidator.php @@ -13,9 +13,9 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * ChoiceValidator validates that the value is one of the expected values. @@ -32,11 +32,11 @@ class ChoiceValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Choice) { - throw new UnexpectedTypeException($constraint, Choice::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Choice'); } if (!\is_array($constraint->choices) && !$constraint->callback) { - throw new ConstraintDefinitionException('Either "choices" or "callback" must be specified on constraint Choice.'); + throw new ConstraintDefinitionException('Either "choices" or "callback" must be specified on constraint Choice'); } if (null === $value) { @@ -44,34 +44,36 @@ public function validate($value, Constraint $constraint) } if ($constraint->multiple && !\is_array($value)) { - throw new UnexpectedValueException($value, 'array'); + throw new UnexpectedTypeException($value, 'array'); } if ($constraint->callback) { - if (!\is_callable($choices = [$this->context->getObject(), $constraint->callback]) - && !\is_callable($choices = [$this->context->getClassName(), $constraint->callback]) + if (!\is_callable($choices = array($this->context->getClassName(), $constraint->callback)) && !\is_callable($choices = $constraint->callback) ) { - throw new ConstraintDefinitionException('The Choice constraint expects a valid callback.'); + throw new ConstraintDefinitionException('The Choice constraint expects a valid callback'); } - $choices = $choices(); + $choices = \call_user_func($choices); } else { $choices = $constraint->choices; } - if (true !== $constraint->strict) { - throw new \RuntimeException('The "strict" option of the Choice constraint should not be used.'); - } - if ($constraint->multiple) { foreach ($value as $_value) { - if (!\in_array($_value, $choices, true)) { - $this->context->buildViolation($constraint->multipleMessage) - ->setParameter('{{ value }}', $this->formatValue($_value)) - ->setParameter('{{ choices }}', $this->formatValues($choices)) - ->setCode(Choice::NO_SUCH_CHOICE_ERROR) - ->setInvalidValue($_value) - ->addViolation(); + if (!\in_array($_value, $choices, $constraint->strict)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->multipleMessage) + ->setParameter('{{ value }}', $this->formatValue($_value)) + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->setInvalidValue($_value) + ->addViolation(); + } else { + $this->buildViolation($constraint->multipleMessage) + ->setParameter('{{ value }}', $this->formatValue($_value)) + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->setInvalidValue($_value) + ->addViolation(); + } return; } @@ -80,30 +82,52 @@ public function validate($value, Constraint $constraint) $count = \count($value); if (null !== $constraint->min && $count < $constraint->min) { - $this->context->buildViolation($constraint->minMessage) - ->setParameter('{{ limit }}', $constraint->min) - ->setPlural((int) $constraint->min) - ->setCode(Choice::TOO_FEW_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->minMessage) + ->setParameter('{{ limit }}', $constraint->min) + ->setPlural((int) $constraint->min) + ->setCode(Choice::TOO_FEW_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->minMessage) + ->setParameter('{{ limit }}', $constraint->min) + ->setPlural((int) $constraint->min) + ->setCode(Choice::TOO_FEW_ERROR) + ->addViolation(); + } return; } if (null !== $constraint->max && $count > $constraint->max) { - $this->context->buildViolation($constraint->maxMessage) - ->setParameter('{{ limit }}', $constraint->max) - ->setPlural((int) $constraint->max) - ->setCode(Choice::TOO_MANY_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->maxMessage) + ->setParameter('{{ limit }}', $constraint->max) + ->setPlural((int) $constraint->max) + ->setCode(Choice::TOO_MANY_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->maxMessage) + ->setParameter('{{ limit }}', $constraint->max) + ->setPlural((int) $constraint->max) + ->setCode(Choice::TOO_MANY_ERROR) + ->addViolation(); + } return; } - } elseif (!\in_array($value, $choices, true)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setParameter('{{ choices }}', $this->formatValues($choices)) - ->setCode(Choice::NO_SUCH_CHOICE_ERROR) - ->addViolation(); + } elseif (!\in_array($value, $choices, $constraint->strict)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php b/upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php deleted file mode 100644 index 387c5996a05..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Cidr.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -/** - * Validates that a value is a valid CIDR notation. - * - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Sorin Pop - * @author Calin Bolea - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Cidr extends Constraint -{ - public const INVALID_CIDR_ERROR = '5649e53a-5afb-47c5-a360-ffbab3be8567'; - public const OUT_OF_RANGE_ERROR = 'b9f14a51-acbd-401a-a078-8c6b204ab32f'; - - protected static $errorNames = [ - self::INVALID_CIDR_ERROR => 'INVALID_CIDR_ERROR', - self::OUT_OF_RANGE_ERROR => 'OUT_OF_RANGE_VIOLATION', - ]; - - private const NET_MAXES = [ - Ip::ALL => 128, - Ip::V4 => 32, - Ip::V6 => 128, - ]; - - public $version = Ip::ALL; - - public $message = 'This value is not a valid CIDR notation.'; - - public $netmaskRangeViolationMessage = 'The value of the netmask should be between {{ min }} and {{ max }}.'; - - public $netmaskMin = 0; - - public $netmaskMax; - - public function __construct( - array $options = null, - string $version = null, - int $netmaskMin = null, - int $netmaskMax = null, - string $message = null, - array $groups = null, - $payload = null - ) { - $this->version = $version ?? $options['version'] ?? $this->version; - - if (!\in_array($this->version, array_keys(self::NET_MAXES))) { - throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s".', implode('", "', array_keys(self::NET_MAXES)))); - } - - $this->netmaskMin = $netmaskMin ?? $options['netmaskMin'] ?? $this->netmaskMin; - $this->netmaskMax = $netmaskMax ?? $options['netmaskMax'] ?? self::NET_MAXES[$this->version]; - $this->message = $message ?? $this->message; - - unset($options['netmaskMin'], $options['netmaskMax'], $options['version']); - - if ($this->netmaskMin < 0 || $this->netmaskMax > self::NET_MAXES[$this->version] || $this->netmaskMin > $this->netmaskMax) { - throw new ConstraintDefinitionException(sprintf('The netmask range must be between 0 and %d.', self::NET_MAXES[$this->version])); - } - - parent::__construct($options, $groups, $payload); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php deleted file mode 100644 index c90ebcfae35..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CidrValidator.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -class CidrValidator extends ConstraintValidator -{ - public function validate($value, Constraint $constraint): void - { - if (!$constraint instanceof Cidr) { - throw new UnexpectedTypeException($constraint, Cidr::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!\is_string($value)) { - throw new UnexpectedValueException($value, 'string'); - } - - $cidrParts = explode('/', $value, 2); - - if (!isset($cidrParts[1]) - || !ctype_digit($cidrParts[1]) - || '' === $cidrParts[0] - ) { - $this->context - ->buildViolation($constraint->message) - ->setCode(Cidr::INVALID_CIDR_ERROR) - ->addViolation(); - - return; - } - - $ipAddress = $cidrParts[0]; - $netmask = (int) $cidrParts[1]; - - $validV4 = Ip::V6 !== $constraint->version - && filter_var($ipAddress, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4) - && $netmask <= 32; - - $validV6 = Ip::V4 !== $constraint->version - && filter_var($ipAddress, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6); - - if (!$validV4 && !$validV6) { - $this->context - ->buildViolation($constraint->message) - ->setCode(Cidr::INVALID_CIDR_ERROR) - ->addViolation(); - - return; - } - - if ($netmask < $constraint->netmaskMin || $netmask > $constraint->netmaskMax) { - $this->context - ->buildViolation($constraint->netmaskRangeViolationMessage) - ->setParameter('{{ min }}', $constraint->netmaskMin) - ->setParameter('{{ max }}', $constraint->netmaskMax) - ->setCode(Cidr::OUT_OF_RANGE_ERROR) - ->addViolation(); - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Collection.php b/upload/system/storage/vendor/symfony/validator/Constraints/Collection.php index 3f4adb5ac52..2b5679b22d0 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Collection.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Collection.php @@ -19,18 +19,17 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Collection extends Composite { - public const MISSING_FIELD_ERROR = '2fa2158c-2a7f-484b-98aa-975522539ff8'; - public const NO_SUCH_FIELD_ERROR = '7703c766-b5d5-4cef-ace7-ae0dd82304e9'; + const MISSING_FIELD_ERROR = '2fa2158c-2a7f-484b-98aa-975522539ff8'; + const NO_SUCH_FIELD_ERROR = '7703c766-b5d5-4cef-ace7-ae0dd82304e9'; - protected static $errorNames = [ + protected static $errorNames = array( self::MISSING_FIELD_ERROR => 'MISSING_FIELD_ERROR', self::NO_SUCH_FIELD_ERROR => 'NO_SUCH_FIELD_ERROR', - ]; + ); - public $fields = []; + public $fields = array(); public $allowExtraFields = false; public $allowMissingFields = false; public $extraFieldsMessage = 'This field was not expected.'; @@ -39,20 +38,15 @@ class Collection extends Composite /** * {@inheritdoc} */ - public function __construct($fields = null, array $groups = null, $payload = null, bool $allowExtraFields = null, bool $allowMissingFields = null, string $extraFieldsMessage = null, string $missingFieldsMessage = null) + public function __construct($options = null) { - // no known options set? $fields is the fields array - if (\is_array($fields) - && !array_intersect(array_keys($fields), ['groups', 'fields', 'allowExtraFields', 'allowMissingFields', 'extraFieldsMessage', 'missingFieldsMessage'])) { - $fields = ['fields' => $fields]; + // no known options set? $options is the fields array + if (\is_array($options) + && !array_intersect(array_keys($options), array('groups', 'fields', 'allowExtraFields', 'allowMissingFields', 'extraFieldsMessage', 'missingFieldsMessage'))) { + $options = array('fields' => $options); } - parent::__construct($fields, $groups, $payload); - - $this->allowExtraFields = $allowExtraFields ?? $this->allowExtraFields; - $this->allowMissingFields = $allowMissingFields ?? $this->allowMissingFields; - $this->extraFieldsMessage = $extraFieldsMessage ?? $this->extraFieldsMessage; - $this->missingFieldsMessage = $missingFieldsMessage ?? $this->missingFieldsMessage; + parent::__construct($options); } /** @@ -63,7 +57,7 @@ protected function initializeNestedConstraints() parent::initializeNestedConstraints(); if (!\is_array($this->fields)) { - throw new ConstraintDefinitionException(sprintf('The option "fields" is expected to be an array in constraint "%s".', __CLASS__)); + throw new ConstraintDefinitionException(sprintf('The option "fields" is expected to be an array in constraint %s', __CLASS__)); } foreach ($this->fields as $fieldName => $field) { @@ -74,14 +68,14 @@ protected function initializeNestedConstraints() } if (!$field instanceof Optional && !$field instanceof Required) { - $this->fields[$fieldName] = new Required($field); + $this->fields[$fieldName] = $field = new Required($field); } } } public function getRequiredOptions() { - return ['fields']; + return array('fields'); } protected function getCompositeOption() diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php index 7cea7d01df9..c2aae3a0236 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CollectionValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek @@ -27,7 +27,7 @@ class CollectionValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Collection) { - throw new UnexpectedTypeException($constraint, Collection::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Collection'); } if (null === $value) { @@ -35,7 +35,7 @@ public function validate($value, Constraint $constraint) } if (!\is_array($value) && !($value instanceof \Traversable && $value instanceof \ArrayAccess)) { - throw new UnexpectedValueException($value, 'array|(Traversable&ArrayAccess)'); + throw new UnexpectedTypeException($value, 'array or Traversable and ArrayAccess'); } // We need to keep the initialized context when CollectionValidator @@ -51,35 +51,58 @@ public function validate($value, Constraint $constraint) foreach ($constraint->fields as $field => $fieldConstraint) { // bug fix issue #2779 - $existsInArray = \is_array($value) && \array_key_exists($field, $value); + $existsInArray = \is_array($value) && array_key_exists($field, $value); $existsInArrayAccess = $value instanceof \ArrayAccess && $value->offsetExists($field); if ($existsInArray || $existsInArrayAccess) { if (\count($fieldConstraint->constraints) > 0) { - $context->getValidator() - ->inContext($context) - ->atPath('['.$field.']') - ->validate($value[$field], $fieldConstraint->constraints); + if ($context instanceof ExecutionContextInterface) { + $context->getValidator() + ->inContext($context) + ->atPath('['.$field.']') + ->validate($value[$field], $fieldConstraint->constraints); + } else { + // 2.4 API + $context->validateValue($value[$field], $fieldConstraint->constraints, '['.$field.']'); + } } } elseif (!$fieldConstraint instanceof Optional && !$constraint->allowMissingFields) { - $context->buildViolation($constraint->missingFieldsMessage) - ->atPath('['.$field.']') - ->setParameter('{{ field }}', $this->formatValue($field)) - ->setInvalidValue(null) - ->setCode(Collection::MISSING_FIELD_ERROR) - ->addViolation(); + if ($context instanceof ExecutionContextInterface) { + $context->buildViolation($constraint->missingFieldsMessage) + ->atPath('['.$field.']') + ->setParameter('{{ field }}', $this->formatValue($field)) + ->setInvalidValue(null) + ->setCode(Collection::MISSING_FIELD_ERROR) + ->addViolation(); + } else { + $this->buildViolationInContext($context, $constraint->missingFieldsMessage) + ->atPath('['.$field.']') + ->setParameter('{{ field }}', $this->formatValue($field)) + ->setInvalidValue(null) + ->setCode(Collection::MISSING_FIELD_ERROR) + ->addViolation(); + } } } if (!$constraint->allowExtraFields) { foreach ($value as $field => $fieldValue) { if (!isset($constraint->fields[$field])) { - $context->buildViolation($constraint->extraFieldsMessage) - ->atPath('['.$field.']') - ->setParameter('{{ field }}', $this->formatValue($field)) - ->setInvalidValue($fieldValue) - ->setCode(Collection::NO_SUCH_FIELD_ERROR) - ->addViolation(); + if ($context instanceof ExecutionContextInterface) { + $context->buildViolation($constraint->extraFieldsMessage) + ->atPath('['.$field.']') + ->setParameter('{{ field }}', $this->formatValue($field)) + ->setInvalidValue($fieldValue) + ->setCode(Collection::NO_SUCH_FIELD_ERROR) + ->addViolation(); + } else { + $this->buildViolationInContext($context, $constraint->extraFieldsMessage) + ->atPath('['.$field.']') + ->setParameter('{{ field }}', $this->formatValue($field)) + ->setInvalidValue($fieldValue) + ->setCode(Collection::NO_SUCH_FIELD_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Composite.php b/upload/system/storage/vendor/symfony/validator/Constraints/Composite.php index 2f6eadffdd5..d233f06335e 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Composite.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Composite.php @@ -51,9 +51,9 @@ abstract class Composite extends Constraint * cached. When constraints are loaded from the cache, no more group * checks need to be done. */ - public function __construct($options = null, array $groups = null, $payload = null) + public function __construct($options = null) { - parent::__construct($options, $groups, $payload); + parent::__construct($options); $this->initializeNestedConstraints(); @@ -62,7 +62,7 @@ public function __construct($options = null, array $groups = null, $payload = nu $nestedConstraints = $this->$compositeOption; if (!\is_array($nestedConstraints)) { - $nestedConstraints = [$nestedConstraints]; + $nestedConstraints = array($nestedConstraints); } foreach ($nestedConstraints as $constraint) { @@ -71,16 +71,16 @@ public function __construct($options = null, array $groups = null, $payload = nu $constraint = \get_class($constraint); } - throw new ConstraintDefinitionException(sprintf('The value "%s" is not an instance of Constraint in constraint "%s".', $constraint, static::class)); + throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, \get_class($this))); } if ($constraint instanceof Valid) { - throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint "%s". You can only declare the Valid constraint directly on a field or method.', static::class)); + throw new ConstraintDefinitionException(sprintf('The constraint Valid cannot be nested inside constraint %s. You can only declare the Valid constraint directly on a field or method.', \get_class($this))); } } - if (!isset(((array) $this)['groups'])) { - $mergedGroups = []; + if (!property_exists($this, 'groups')) { + $mergedGroups = array(); foreach ($nestedConstraints as $constraint) { foreach ($constraint->groups as $group) { @@ -88,19 +88,18 @@ public function __construct($options = null, array $groups = null, $payload = nu } } - // prevent empty composite constraint to have empty groups - $this->groups = array_keys($mergedGroups) ?: [self::DEFAULT_GROUP]; + $this->groups = array_keys($mergedGroups); $this->$compositeOption = $nestedConstraints; return; } foreach ($nestedConstraints as $constraint) { - if (isset(((array) $constraint)['groups'])) { + if (property_exists($constraint, 'groups')) { $excessGroups = array_diff($constraint->groups, $this->groups); if (\count($excessGroups) > 0) { - throw new ConstraintDefinitionException(sprintf('The group(s) "%s" passed to the constraint "%s" should also be passed to its containing constraint "%s".', implode('", "', $excessGroups), get_debug_type($constraint), static::class)); + throw new ConstraintDefinitionException(sprintf('The group(s) "%s" passed to the constraint %s should also be passed to its containing constraint %s', implode('", "', $excessGroups), \get_class($constraint), \get_class($this))); } } else { $constraint->groups = $this->groups; @@ -114,8 +113,10 @@ public function __construct($options = null, array $groups = null, $payload = nu * {@inheritdoc} * * Implicit group names are forwarded to nested constraints. + * + * @param string $group */ - public function addImplicitGroupName(string $group) + public function addImplicitGroupName($group) { parent::addImplicitGroupName($group); @@ -130,21 +131,10 @@ public function addImplicitGroupName(string $group) /** * Returns the name of the property that contains the nested constraints. * - * @return string + * @return string The property name */ abstract protected function getCompositeOption(); - /** - * @internal Used by metadata - * - * @return Constraint[] - */ - public function getNestedConstraints() - { - /* @var Constraint[] $nestedConstraints */ - return $this->{$this->getCompositeOption()}; - } - /** * Initializes the nested constraints. * diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Compound.php b/upload/system/storage/vendor/symfony/validator/Constraints/Compound.php deleted file mode 100644 index 54dcd6c86f9..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Compound.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -/** - * Extend this class to create a reusable set of constraints. - * - * @author Maxime Steinhausser - */ -abstract class Compound extends Composite -{ - /** @var Constraint[] */ - public $constraints = []; - - public function __construct($options = null) - { - if (isset($options[$this->getCompositeOption()])) { - throw new ConstraintDefinitionException(sprintf('You can\'t redefine the "%s" option. Use the "%s::getConstraints()" method instead.', $this->getCompositeOption(), __CLASS__)); - } - - $this->constraints = $this->getConstraints($this->normalizeOptions($options)); - - parent::__construct($options); - } - - final protected function getCompositeOption(): string - { - return 'constraints'; - } - - final public function validatedBy(): string - { - return CompoundValidator::class; - } - - /** - * @return Constraint[] - */ - abstract protected function getConstraints(array $options): array; -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php deleted file mode 100644 index 2ba993f31b4..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CompoundValidator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; - -/** - * @author Maxime Steinhausser - */ -class CompoundValidator extends ConstraintValidator -{ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Compound) { - throw new UnexpectedTypeException($constraint, Compound::class); - } - - $context = $this->context; - - $validator = $context->getValidator()->inContext($context); - - $validator->validate($value, $constraint->constraints); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Count.php b/upload/system/storage/vendor/symfony/validator/Constraints/Count.php index 0d759031079..0a54ee78db7 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Count.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Count.php @@ -20,73 +20,35 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Count extends Constraint { - public const TOO_FEW_ERROR = 'bef8e338-6ae5-4caf-b8e2-50e7b0579e69'; - public const TOO_MANY_ERROR = '756b1212-697c-468d-a9ad-50dd783bb169'; - public const NOT_EQUAL_COUNT_ERROR = '9fe5d43f-3784-4ece-a0e1-473fc02dadbc'; - public const NOT_DIVISIBLE_BY_ERROR = DivisibleBy::NOT_DIVISIBLE_BY; + const TOO_FEW_ERROR = 'bef8e338-6ae5-4caf-b8e2-50e7b0579e69'; + const TOO_MANY_ERROR = '756b1212-697c-468d-a9ad-50dd783bb169'; - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_FEW_ERROR => 'TOO_FEW_ERROR', self::TOO_MANY_ERROR => 'TOO_MANY_ERROR', - self::NOT_EQUAL_COUNT_ERROR => 'NOT_EQUAL_COUNT_ERROR', - self::NOT_DIVISIBLE_BY_ERROR => 'NOT_DIVISIBLE_BY_ERROR', - ]; + ); public $minMessage = 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.'; public $maxMessage = 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.'; public $exactMessage = 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.'; - public $divisibleByMessage = 'The number of elements in this collection should be a multiple of {{ compared_value }}.'; public $min; public $max; - public $divisibleBy; - /** - * {@inheritdoc} - * - * @param int|array|null $exactly The expected exact count or a set of options - */ - public function __construct( - $exactly = null, - int $min = null, - int $max = null, - int $divisibleBy = null, - string $exactMessage = null, - string $minMessage = null, - string $maxMessage = null, - string $divisibleByMessage = null, - array $groups = null, - $payload = null, - array $options = [] - ) { - if (\is_array($exactly)) { - $options = array_merge($exactly, $options); - $exactly = $options['value'] ?? null; + public function __construct($options = null) + { + if (null !== $options && !\is_array($options)) { + $options = array( + 'min' => $options, + 'max' => $options, + ); } - $min = $min ?? $options['min'] ?? null; - $max = $max ?? $options['max'] ?? null; + parent::__construct($options); - unset($options['value'], $options['min'], $options['max']); - - if (null !== $exactly && null === $min && null === $max) { - $min = $max = $exactly; - } - - parent::__construct($options, $groups, $payload); - - $this->min = $min; - $this->max = $max; - $this->divisibleBy = $divisibleBy ?? $this->divisibleBy; - $this->exactMessage = $exactMessage ?? $this->exactMessage; - $this->minMessage = $minMessage ?? $this->minMessage; - $this->maxMessage = $maxMessage ?? $this->maxMessage; - $this->divisibleByMessage = $divisibleByMessage ?? $this->divisibleByMessage; - - if (null === $this->min && null === $this->max && null === $this->divisibleBy) { - throw new MissingOptionsException(sprintf('Either option "min", "max" or "divisibleBy" must be given for constraint "%s".', __CLASS__), ['min', 'max', 'divisibleBy']); + if (null === $this->min && null === $this->max) { + throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint %s', __CLASS__), array('min', 'max')); } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php index ff991ac2b46..45be99678bf 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CountValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek @@ -27,7 +27,7 @@ class CountValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Count) { - throw new UnexpectedTypeException($constraint, Count::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Count'); } if (null === $value) { @@ -35,49 +35,51 @@ public function validate($value, Constraint $constraint) } if (!\is_array($value) && !$value instanceof \Countable) { - throw new UnexpectedValueException($value, 'array|\Countable'); + throw new UnexpectedTypeException($value, 'array or \Countable'); } $count = \count($value); if (null !== $constraint->max && $count > $constraint->max) { - $exactlyOptionEnabled = $constraint->min == $constraint->max; - - $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->maxMessage) - ->setParameter('{{ count }}', $count) - ->setParameter('{{ limit }}', $constraint->max) - ->setInvalidValue($value) - ->setPlural((int) $constraint->max) - ->setCode($exactlyOptionEnabled ? Count::NOT_EQUAL_COUNT_ERROR : Count::TOO_MANY_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->maxMessage) + ->setParameter('{{ count }}', $count) + ->setParameter('{{ limit }}', $constraint->max) + ->setInvalidValue($value) + ->setPlural((int) $constraint->max) + ->setCode(Count::TOO_MANY_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->maxMessage) + ->setParameter('{{ count }}', $count) + ->setParameter('{{ limit }}', $constraint->max) + ->setInvalidValue($value) + ->setPlural((int) $constraint->max) + ->setCode(Count::TOO_MANY_ERROR) + ->addViolation(); + } return; } if (null !== $constraint->min && $count < $constraint->min) { - $exactlyOptionEnabled = $constraint->min == $constraint->max; - - $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->minMessage) - ->setParameter('{{ count }}', $count) - ->setParameter('{{ limit }}', $constraint->min) - ->setInvalidValue($value) - ->setPlural((int) $constraint->min) - ->setCode($exactlyOptionEnabled ? Count::NOT_EQUAL_COUNT_ERROR : Count::TOO_FEW_ERROR) - ->addViolation(); - - return; - } - - if (null !== $constraint->divisibleBy) { - $this->context - ->getValidator() - ->inContext($this->context) - ->validate($count, [ - new DivisibleBy([ - 'value' => $constraint->divisibleBy, - 'message' => $constraint->divisibleByMessage, - ]), - ], $this->context->getGroup()); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->minMessage) + ->setParameter('{{ count }}', $count) + ->setParameter('{{ limit }}', $constraint->min) + ->setInvalidValue($value) + ->setPlural((int) $constraint->min) + ->setCode(Count::TOO_FEW_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->minMessage) + ->setParameter('{{ count }}', $count) + ->setParameter('{{ limit }}', $constraint->min) + ->setInvalidValue($value) + ->setPlural((int) $constraint->min) + ->setCode(Count::TOO_FEW_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Country.php b/upload/system/storage/vendor/symfony/validator/Constraints/Country.php index ccd815cfe57..1b76570a8c5 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Country.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Country.php @@ -11,9 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Countries; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\LogicException; /** * @Annotation @@ -21,32 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Country extends Constraint { - public const NO_SUCH_COUNTRY_ERROR = '8f900c12-61bd-455d-9398-996cd040f7f0'; + const NO_SUCH_COUNTRY_ERROR = '8f900c12-61bd-455d-9398-996cd040f7f0'; - protected static $errorNames = [ + protected static $errorNames = array( self::NO_SUCH_COUNTRY_ERROR => 'NO_SUCH_COUNTRY_ERROR', - ]; + ); public $message = 'This value is not a valid country.'; - public $alpha3 = false; - - public function __construct( - array $options = null, - string $message = null, - bool $alpha3 = null, - array $groups = null, - $payload = null - ) { - if (!class_exists(Countries::class)) { - throw new LogicException('The Intl component is required to use the Country constraint. Try running "composer require symfony/intl".'); - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->alpha3 = $alpha3 ?? $this->alpha3; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php index 895cca3df1f..437b3d69423 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CountryValidator.php @@ -11,11 +11,11 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Countries; +use Symfony\Component\Intl\Intl; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether a value is a valid country code. @@ -30,7 +30,7 @@ class CountryValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Country) { - throw new UnexpectedTypeException($constraint, Country::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Country'); } if (null === $value || '' === $value) { @@ -38,16 +38,24 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - - if ($constraint->alpha3 ? !Countries::alpha3CodeExists($value) : !Countries::exists($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Country::NO_SUCH_COUNTRY_ERROR) - ->addViolation(); + $countries = Intl::getRegionBundle()->getCountryNames(); + + if (!isset($countries[$value])) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Country::NO_SUCH_COUNTRY_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Country::NO_SUCH_COUNTRY_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php b/upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php deleted file mode 100644 index e1510dafe38..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CssColor.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Mathieu Santostefano - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class CssColor extends Constraint -{ - public const HEX_LONG = 'hex_long'; - public const HEX_LONG_WITH_ALPHA = 'hex_long_with_alpha'; - public const HEX_SHORT = 'hex_short'; - public const HEX_SHORT_WITH_ALPHA = 'hex_short_with_alpha'; - public const BASIC_NAMED_COLORS = 'basic_named_colors'; - public const EXTENDED_NAMED_COLORS = 'extended_named_colors'; - public const SYSTEM_COLORS = 'system_colors'; - public const KEYWORDS = 'keywords'; - public const RGB = 'rgb'; - public const RGBA = 'rgba'; - public const HSL = 'hsl'; - public const HSLA = 'hsla'; - public const INVALID_FORMAT_ERROR = '454ab47b-aacf-4059-8f26-184b2dc9d48d'; - - protected static $errorNames = [ - self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', - ]; - - /** - * @var string[] - */ - private static $validationModes = [ - self::HEX_LONG, - self::HEX_LONG_WITH_ALPHA, - self::HEX_SHORT, - self::HEX_SHORT_WITH_ALPHA, - self::BASIC_NAMED_COLORS, - self::EXTENDED_NAMED_COLORS, - self::SYSTEM_COLORS, - self::KEYWORDS, - self::RGB, - self::RGBA, - self::HSL, - self::HSLA, - ]; - - public $message = 'This value is not a valid CSS color.'; - public $formats; - - /** - * @param array|string $formats The types of CSS colors allowed (e.g. hexadecimal only, RGB and HSL only, etc.). - */ - public function __construct($formats = [], string $message = null, array $groups = null, $payload = null, array $options = null) - { - $validationModesAsString = implode(', ', self::$validationModes); - - if (!$formats) { - $options['value'] = self::$validationModes; - } elseif (\is_array($formats) && \is_string(key($formats))) { - $options = array_merge($formats, $options ?? []); - } elseif (\is_array($formats)) { - if ([] === array_intersect(self::$validationModes, $formats)) { - throw new InvalidArgumentException(sprintf('The "formats" parameter value is not valid. It must contain one or more of the following values: "%s".', $validationModesAsString)); - } - - $options['value'] = $formats; - } elseif (\is_string($formats)) { - if (!\in_array($formats, self::$validationModes)) { - throw new InvalidArgumentException(sprintf('The "formats" parameter value is not valid. It must contain one or more of the following values: "%s".', $validationModesAsString)); - } - - $options['value'] = [$formats]; - } else { - throw new InvalidArgumentException('The "formats" parameter type is not valid. It should be a string or an array.'); - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } - - public function getDefaultOption(): string - { - return 'formats'; - } - - public function getRequiredOptions(): array - { - return ['formats']; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php deleted file mode 100644 index b34ef9303fc..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CssColorValidator.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * @author Mathieu Santostefano - */ -class CssColorValidator extends ConstraintValidator -{ - private const PATTERN_HEX_LONG = '/^#[0-9a-f]{6}$/i'; - private const PATTERN_HEX_LONG_WITH_ALPHA = '/^#[0-9a-f]{8}$/i'; - private const PATTERN_HEX_SHORT = '/^#[0-9a-f]{3}$/i'; - private const PATTERN_HEX_SHORT_WITH_ALPHA = '/^#[0-9a-f]{4}$/i'; - // List comes from https://www.w3.org/wiki/CSS/Properties/color/keywords#Basic_Colors - private const PATTERN_BASIC_NAMED_COLORS = '/^(black|silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|aqua)$/i'; - // List comes from https://www.w3.org/wiki/CSS/Properties/color/keywords#Extended_colors - private const PATTERN_EXTENDED_NAMED_COLORS = '/^(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)$/i'; - // List comes from https://drafts.csswg.org/css-color/#css-system-colors - private const PATTERN_SYSTEM_COLORS = '/^(Canvas|CanvasText|LinkText|VisitedText|ActiveText|ButtonFace|ButtonText|ButtonBorder|Field|FieldText|Highlight|HighlightText|SelectedItem|SelectedItemText|Mark|MarkText|GrayText)$/i'; - private const PATTERN_KEYWORDS = '/^(transparent|currentColor)$/i'; - private const PATTERN_RGB = '/^rgb\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d)\s*\)$/i'; - private const PATTERN_RGBA = '/^rgba\(\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),\s*(0|0?\.\d+|1(\.0)?)\s*\)$/i'; - private const PATTERN_HSL = '/^hsl\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%\s*\)$/i'; - private const PATTERN_HSLA = '/^hsla\(\s*(0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),\s*(0|100|\d{1,2})%,\s*(0|100|\d{1,2})%,\s*(0|0?\.\d+|1(\.0)?)\s*\)$/i'; - - private const COLOR_PATTERNS = [ - CssColor::HEX_LONG => self::PATTERN_HEX_LONG, - CssColor::HEX_LONG_WITH_ALPHA => self::PATTERN_HEX_LONG_WITH_ALPHA, - CssColor::HEX_SHORT => self::PATTERN_HEX_SHORT, - CssColor::HEX_SHORT_WITH_ALPHA => self::PATTERN_HEX_SHORT_WITH_ALPHA, - CssColor::BASIC_NAMED_COLORS => self::PATTERN_BASIC_NAMED_COLORS, - CssColor::EXTENDED_NAMED_COLORS => self::PATTERN_EXTENDED_NAMED_COLORS, - CssColor::SYSTEM_COLORS => self::PATTERN_SYSTEM_COLORS, - CssColor::KEYWORDS => self::PATTERN_KEYWORDS, - CssColor::RGB => self::PATTERN_RGB, - CssColor::RGBA => self::PATTERN_RGBA, - CssColor::HSL => self::PATTERN_HSL, - CssColor::HSLA => self::PATTERN_HSLA, - ]; - - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint): void - { - if (!$constraint instanceof CssColor) { - throw new UnexpectedTypeException($constraint, CssColor::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!\is_string($value)) { - throw new UnexpectedValueException($value, 'string'); - } - - $formats = array_flip((array) $constraint->formats); - $formatRegexes = array_intersect_key(self::COLOR_PATTERNS, $formats); - - foreach ($formatRegexes as $regex) { - if (preg_match($regex, (string) $value)) { - return; - } - } - - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(CssColor::INVALID_FORMAT_ERROR) - ->addViolation(); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Currency.php b/upload/system/storage/vendor/symfony/validator/Constraints/Currency.php index cac2dfffc88..d28f94cb66a 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Currency.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Currency.php @@ -11,9 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Currencies; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\LogicException; /** * @Annotation @@ -22,25 +20,13 @@ * @author Miha Vrhovnik * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Currency extends Constraint { - public const NO_SUCH_CURRENCY_ERROR = '69945ac1-2db4-405f-bec7-d2772f73df52'; + const NO_SUCH_CURRENCY_ERROR = '69945ac1-2db4-405f-bec7-d2772f73df52'; - protected static $errorNames = [ + protected static $errorNames = array( self::NO_SUCH_CURRENCY_ERROR => 'NO_SUCH_CURRENCY_ERROR', - ]; + ); public $message = 'This value is not a valid currency.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - if (!class_exists(Currencies::class)) { - throw new LogicException('The Intl component is required to use the Currency constraint. Try running "composer require symfony/intl".'); - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php index 4f294e42bf7..40e7920c545 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/CurrencyValidator.php @@ -11,11 +11,11 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Currencies; +use Symfony\Component\Intl\Intl; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether a value is a valid currency. @@ -31,7 +31,7 @@ class CurrencyValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Currency) { - throw new UnexpectedTypeException($constraint, Currency::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Currency'); } if (null === $value || '' === $value) { @@ -39,16 +39,24 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - - if (!Currencies::exists($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Currency::NO_SUCH_CURRENCY_ERROR) - ->addViolation(); + $currencies = Intl::getCurrencyBundle()->getCurrencyNames(); + + if (!isset($currencies[$value])) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Currency::NO_SUCH_CURRENCY_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Currency::NO_SUCH_CURRENCY_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Date.php b/upload/system/storage/vendor/symfony/validator/Constraints/Date.php index 7c9666f7caa..25634131224 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Date.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Date.php @@ -19,23 +19,15 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Date extends Constraint { - public const INVALID_FORMAT_ERROR = '69819696-02ac-4a99-9ff0-14e127c4d1bc'; - public const INVALID_DATE_ERROR = '3c184ce5-b31d-4de7-8b76-326da7b2be93'; + const INVALID_FORMAT_ERROR = '69819696-02ac-4a99-9ff0-14e127c4d1bc'; + const INVALID_DATE_ERROR = '3c184ce5-b31d-4de7-8b76-326da7b2be93'; - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', self::INVALID_DATE_ERROR => 'INVALID_DATE_ERROR', - ]; + ); public $message = 'This value is not a valid date.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php b/upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php index 94c3dd6adcf..35e29345d09 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DateTime.php @@ -19,42 +19,17 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class DateTime extends Constraint { - public const INVALID_FORMAT_ERROR = '1a9da513-2640-4f84-9b6a-4d99dcddc628'; - public const INVALID_DATE_ERROR = 'd52afa47-620d-4d99-9f08-f4d85b36e33c'; - public const INVALID_TIME_ERROR = '5e797c9d-74f7-4098-baa3-94390c447b27'; + const INVALID_FORMAT_ERROR = '1a9da513-2640-4f84-9b6a-4d99dcddc628'; + const INVALID_DATE_ERROR = 'd52afa47-620d-4d99-9f08-f4d85b36e33c'; + const INVALID_TIME_ERROR = '5e797c9d-74f7-4098-baa3-94390c447b27'; - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', self::INVALID_DATE_ERROR => 'INVALID_DATE_ERROR', self::INVALID_TIME_ERROR => 'INVALID_TIME_ERROR', - ]; + ); - public $format = 'Y-m-d H:i:s'; public $message = 'This value is not a valid datetime.'; - - /** - * {@inheritdoc} - * - * @param string|array|null $format - */ - public function __construct($format = null, string $message = null, array $groups = null, $payload = null, array $options = []) - { - if (\is_array($format)) { - $options = array_merge($format, $options); - } elseif (null !== $format) { - $options['value'] = $format; - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } - - public function getDefaultOption() - { - return 'format'; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php index e93f795e86e..3296935f5f7 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DateTimeValidator.php @@ -12,68 +12,75 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek - * @author Diego Saint Esteben */ class DateTimeValidator extends DateValidator { + const PATTERN = '/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/'; + /** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof DateTime) { - throw new UnexpectedTypeException($constraint, DateTime::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\DateTime'); } - if (null === $value || '' === $value) { + if (null === $value || '' === $value || $value instanceof \DateTime) { return; } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - \DateTime::createFromFormat($constraint->format, $value); - - $errors = \DateTime::getLastErrors(); - - if (0 < $errors['error_count']) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(DateTime::INVALID_FORMAT_ERROR) - ->addViolation(); + if (!preg_match(static::PATTERN, $value, $matches)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(DateTime::INVALID_FORMAT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(DateTime::INVALID_FORMAT_ERROR) + ->addViolation(); + } return; } - if (str_ends_with($constraint->format, '+')) { - $errors['warnings'] = array_filter($errors['warnings'], function ($warning) { - return 'Trailing data' !== $warning; - }); - } - - foreach ($errors['warnings'] as $warning) { - if ('The parsed date was invalid' === $warning) { + if (!DateValidator::checkDate($matches[1], $matches[2], $matches[3])) { + if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(DateTime::INVALID_DATE_ERROR) ->addViolation(); - } elseif ('The parsed time was invalid' === $warning) { + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(DateTime::INVALID_DATE_ERROR) + ->addViolation(); + } + } + + if (!TimeValidator::checkTime($matches[4], $matches[5], $matches[6])) { + if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(DateTime::INVALID_TIME_ERROR) ->addViolation(); } else { - $this->context->buildViolation($constraint->message) + $this->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(DateTime::INVALID_FORMAT_ERROR) + ->setCode(DateTime::INVALID_TIME_ERROR) ->addViolation(); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php index 3f18cac7c1f..a4c95dc248e 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/DateValidator.php @@ -13,22 +13,28 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek */ class DateValidator extends ConstraintValidator { - public const PATTERN = '/^(?\d{4})-(?\d{2})-(?\d{2})$/'; + const PATTERN = '/^(\d{4})-(\d{2})-(\d{2})$/'; /** * Checks whether a date is valid. * + * @param int $year The year + * @param int $month The month + * @param int $day The day + * + * @return bool Whether the date is valid + * * @internal */ - public static function checkDate(int $year, int $month, int $day): bool + public static function checkDate($year, $month, $day) { return checkdate($month, $day, $year); } @@ -39,37 +45,47 @@ public static function checkDate(int $year, int $month, int $day): bool public function validate($value, Constraint $constraint) { if (!$constraint instanceof Date) { - throw new UnexpectedTypeException($constraint, Date::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Date'); } - if (null === $value || '' === $value) { + if (null === $value || '' === $value || $value instanceof \DateTime) { return; } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; if (!preg_match(static::PATTERN, $value, $matches)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Date::INVALID_FORMAT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Date::INVALID_FORMAT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Date::INVALID_FORMAT_ERROR) + ->addViolation(); + } return; } - if (!self::checkDate( - $matches['year'] ?? $matches[1], - $matches['month'] ?? $matches[2], - $matches['day'] ?? $matches[3] - )) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Date::INVALID_DATE_ERROR) - ->addViolation(); + if (!self::checkDate($matches[1], $matches[2], $matches[3])) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Date::INVALID_DATE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Date::INVALID_DATE_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php b/upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php deleted file mode 100644 index 9a91f009c8b..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/DisableAutoMapping.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -/** - * Disables auto mapping. - * - * Using the annotations on a property has higher precedence than using it on a class, - * which has higher precedence than any configuration that might be defined outside the class. - * - * @Annotation - * - * @author Kévin Dunglas - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)] -class DisableAutoMapping extends Constraint -{ - public function __construct(array $options = null) - { - if (\is_array($options) && \array_key_exists('groups', $options)) { - throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); - } - - parent::__construct($options); - } - - /** - * {@inheritdoc} - */ - public function getTargets() - { - return [self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT]; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php b/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php deleted file mode 100644 index d3f5cd713ad..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleBy.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Colin O'Dell - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class DivisibleBy extends AbstractComparison -{ - public const NOT_DIVISIBLE_BY = '6d99d6c3-1464-4ccf-bdc7-14d083cf455c'; - - protected static $errorNames = [ - self::NOT_DIVISIBLE_BY => 'NOT_DIVISIBLE_BY', - ]; - - public $message = 'This value should be a multiple of {{ compared_value }}.'; -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php deleted file mode 100644 index 53b8d38930c..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/DivisibleByValidator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * Validates that values are a multiple of the given number. - * - * @author Colin O'Dell - */ -class DivisibleByValidator extends AbstractComparisonValidator -{ - /** - * {@inheritdoc} - */ - protected function compareValues($value1, $value2) - { - if (!is_numeric($value1)) { - throw new UnexpectedValueException($value1, 'numeric'); - } - - if (!is_numeric($value2)) { - throw new UnexpectedValueException($value2, 'numeric'); - } - - if (!$value2 = abs($value2)) { - return false; - } - if (\is_int($value1 = abs($value1)) && \is_int($value2)) { - return 0 === ($value1 % $value2); - } - if (!$remainder = fmod($value1, $value2)) { - return true; - } - - return sprintf('%.12e', $value2) === sprintf('%.12e', $remainder); - } - - /** - * {@inheritdoc} - */ - protected function getErrorCode() - { - return DivisibleBy::NOT_DIVISIBLE_BY; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Email.php b/upload/system/storage/vendor/symfony/validator/Constraints/Email.php index 7976cc4ee38..a9d9ab15391 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Email.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Email.php @@ -11,10 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Egulias\EmailValidator\EmailValidator as StrictEmailValidator; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; -use Symfony\Component\Validator\Exception\LogicException; /** * @Annotation @@ -22,58 +19,20 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Email extends Constraint { - public const VALIDATION_MODE_HTML5 = 'html5'; - public const VALIDATION_MODE_STRICT = 'strict'; - public const VALIDATION_MODE_LOOSE = 'loose'; + const INVALID_FORMAT_ERROR = 'bd79c0ab-ddba-46cc-a703-a7a4b08de310'; + const MX_CHECK_FAILED_ERROR = 'bf447c1c-0266-4e10-9c6c-573df282e413'; + const HOST_CHECK_FAILED_ERROR = '7da53a8b-56f3-4288-bb3e-ee9ede4ef9a1'; - public const INVALID_FORMAT_ERROR = 'bd79c0ab-ddba-46cc-a703-a7a4b08de310'; - - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_FORMAT_ERROR => 'STRICT_CHECK_FAILED_ERROR', - ]; - - /** - * @var string[] - * - * @internal - */ - public static $validationModes = [ - self::VALIDATION_MODE_HTML5, - self::VALIDATION_MODE_STRICT, - self::VALIDATION_MODE_LOOSE, - ]; + self::MX_CHECK_FAILED_ERROR => 'MX_CHECK_FAILED_ERROR', + self::HOST_CHECK_FAILED_ERROR => 'HOST_CHECK_FAILED_ERROR', + ); public $message = 'This value is not a valid email address.'; - public $mode; - public $normalizer; - - public function __construct( - array $options = null, - string $message = null, - string $mode = null, - callable $normalizer = null, - array $groups = null, - $payload = null - ) { - if (\is_array($options) && \array_key_exists('mode', $options) && !\in_array($options['mode'], self::$validationModes, true)) { - throw new InvalidArgumentException('The "mode" parameter value is not valid.'); - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->mode = $mode ?? $this->mode; - $this->normalizer = $normalizer ?? $this->normalizer; - - if (self::VALIDATION_MODE_STRICT === $this->mode && !class_exists(StrictEmailValidator::class)) { - throw new LogicException(sprintf('The "egulias/email-validator" component is required to use the "%s" constraint in strict mode.', __CLASS__)); - } - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); - } - } + public $checkMX = false; + public $checkHost = false; + public $strict; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php index c879ee466e3..2f0d25aa301 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/EmailValidator.php @@ -11,36 +11,25 @@ namespace Symfony\Component\Validator\Constraints; -use Egulias\EmailValidator\EmailValidator as EguliasEmailValidator; -use Egulias\EmailValidator\Validation\EmailValidation; -use Egulias\EmailValidator\Validation\NoRFCWarningsValidation; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Exception\RuntimeException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek */ class EmailValidator extends ConstraintValidator { - private const PATTERN_HTML5 = '/^[a-zA-Z0-9.!#$%&\'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/'; - private const PATTERN_LOOSE = '/^.+\@\S+\.\S+$/'; + private $isStrict; - private const EMAIL_PATTERNS = [ - Email::VALIDATION_MODE_LOOSE => self::PATTERN_LOOSE, - Email::VALIDATION_MODE_HTML5 => self::PATTERN_HTML5, - ]; - - private $defaultMode; - - public function __construct(string $defaultMode = Email::VALIDATION_MODE_LOOSE) + /** + * @param bool $strict + */ + public function __construct($strict = false) { - if (!\in_array($defaultMode, Email::$validationModes, true)) { - throw new \InvalidArgumentException('The "defaultMode" parameter value is not valid.'); - } - - $this->defaultMode = $defaultMode; + $this->isStrict = $strict; } /** @@ -49,7 +38,7 @@ public function __construct(string $defaultMode = Email::VALIDATION_MODE_LOOSE) public function validate($value, Constraint $constraint) { if (!$constraint instanceof Email) { - throw new UnexpectedTypeException($constraint, Email::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Email'); } if (null === $value || '' === $value) { @@ -57,51 +46,110 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - if ('' === $value) { - return; - } - - if (null !== $constraint->normalizer) { - $value = ($constraint->normalizer)($value); - } - if (null === $constraint->mode) { - $constraint->mode = $this->defaultMode; + if (null === $constraint->strict) { + $constraint->strict = $this->isStrict; } - if (!\in_array($constraint->mode, Email::$validationModes, true)) { - throw new \InvalidArgumentException(sprintf('The "%s::$mode" parameter value is not valid.', get_debug_type($constraint))); - } + if ($constraint->strict) { + if (!class_exists('\Egulias\EmailValidator\EmailValidator') || interface_exists('\Egulias\EmailValidator\Validation\EmailValidation')) { + throw new RuntimeException('Strict email validation requires egulias/email-validator:~1.2'); + } - if (Email::VALIDATION_MODE_STRICT === $constraint->mode) { - $strictValidator = new EguliasEmailValidator(); + $strictValidator = new \Egulias\EmailValidator\EmailValidator(); + + if (!$strictValidator->isValid($value, false, true)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::INVALID_FORMAT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::INVALID_FORMAT_ERROR) + ->addViolation(); + } - if (interface_exists(EmailValidation::class) && !$strictValidator->isValid($value, new NoRFCWarningsValidation())) { + return; + } + } elseif (!preg_match('/^.+\@\S+\.\S+$/', $value)) { + if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Email::INVALID_FORMAT_ERROR) ->addViolation(); - - return; - } elseif (!interface_exists(EmailValidation::class) && !$strictValidator->isValid($value, false, true)) { - $this->context->buildViolation($constraint->message) + } else { + $this->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Email::INVALID_FORMAT_ERROR) ->addViolation(); + } - return; + return; + } + + $host = (string) substr($value, strrpos($value, '@') + 1); + + // Check for host DNS resource records + if ($constraint->checkMX) { + if (!$this->checkMX($host)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::MX_CHECK_FAILED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::MX_CHECK_FAILED_ERROR) + ->addViolation(); + } } - } elseif (!preg_match(self::EMAIL_PATTERNS[$constraint->mode], $value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Email::INVALID_FORMAT_ERROR) - ->addViolation(); return; } + + if ($constraint->checkHost && !$this->checkHost($host)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::HOST_CHECK_FAILED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Email::HOST_CHECK_FAILED_ERROR) + ->addViolation(); + } + } + } + + /** + * Check DNS Records for MX type. + * + * @param string $host Host + * + * @return bool + */ + private function checkMX($host) + { + return '' !== $host && checkdnsrr($host, 'MX'); + } + + /** + * Check if one of MX, A or AAAA DNS RR exists. + * + * @param string $host Host + * + * @return bool + */ + private function checkHost($host) + { + return '' !== $host && ($this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA'))); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php b/upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php deleted file mode 100644 index 3136fd3ed7a..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/EnableAutoMapping.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -/** - * Enables auto mapping. - * - * Using the annotations on a property has higher precedence than using it on a class, - * which has higher precedence than any configuration that might be defined outside the class. - * - * @Annotation - * - * @author Kévin Dunglas - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)] -class EnableAutoMapping extends Constraint -{ - public function __construct(array $options = null) - { - if (\is_array($options) && \array_key_exists('groups', $options)) { - throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); - } - - parent::__construct($options); - } - - /** - * {@inheritdoc} - */ - public function getTargets() - { - return [self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT]; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php index 09ab4f0f52d..4b22c6dcca3 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/EqualTo.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class EqualTo extends AbstractComparison { - public const NOT_EQUAL_ERROR = '478618a7-95ba-473d-9101-cabd45e49115'; + const NOT_EQUAL_ERROR = '478618a7-95ba-473d-9101-cabd45e49115'; - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_EQUAL_ERROR => 'NOT_EQUAL_ERROR', - ]; + ); public $message = 'This value should be equal to {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Existence.php b/upload/system/storage/vendor/symfony/validator/Constraints/Existence.php index 903cf63913c..5ea6ffe643e 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Existence.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Existence.php @@ -16,7 +16,7 @@ */ abstract class Existence extends Composite { - public $constraints = []; + public $constraints = array(); public function getDefaultOption() { diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Expression.php b/upload/system/storage/vendor/symfony/validator/Constraints/Expression.php index 01cf429b287..3329bd24940 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Expression.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Expression.php @@ -11,10 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\ExpressionLanguage\Expression as ExpressionObject; -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\LogicException; /** * @Annotation @@ -23,49 +20,16 @@ * @author Fabien Potencier * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class Expression extends Constraint { - public const EXPRESSION_FAILED_ERROR = '6b3befbc-2f01-4ddf-be21-b57898905284'; + const EXPRESSION_FAILED_ERROR = '6b3befbc-2f01-4ddf-be21-b57898905284'; - protected static $errorNames = [ + protected static $errorNames = array( self::EXPRESSION_FAILED_ERROR => 'EXPRESSION_FAILED_ERROR', - ]; + ); public $message = 'This value is not valid.'; public $expression; - public $values = []; - - /** - * {@inheritdoc} - * - * @param string|ExpressionObject|array $expression The expression to evaluate or an array of options - */ - public function __construct( - $expression, - string $message = null, - array $values = null, - array $groups = null, - $payload = null, - array $options = [] - ) { - if (!class_exists(ExpressionLanguage::class)) { - throw new LogicException(sprintf('The "symfony/expression-language" component is required to use the "%s" constraint.', __CLASS__)); - } - - if (\is_array($expression)) { - $options = array_merge($expression, $options); - } elseif (!\is_string($expression) && !$expression instanceof ExpressionObject) { - throw new \TypeError(sprintf('"%s": Expected argument $expression to be either a string, an instance of "%s" or an array, got "%s".', __METHOD__, ExpressionObject::class, get_debug_type($expression))); - } else { - $options['value'] = $expression; - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->values = $values ?? $this->values; - } /** * {@inheritdoc} @@ -80,7 +44,7 @@ public function getDefaultOption() */ public function getRequiredOptions() { - return ['expression']; + return array('expression'); } /** @@ -88,7 +52,7 @@ public function getRequiredOptions() */ public function getTargets() { - return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT]; + return array(self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT); } /** diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php deleted file mode 100644 index d5c1f6f9fc2..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntax.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Andrey Sevastianov - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class ExpressionLanguageSyntax extends Constraint -{ - public const EXPRESSION_LANGUAGE_SYNTAX_ERROR = '1766a3f3-ff03-40eb-b053-ab7aa23d988a'; - - protected static $errorNames = [ - self::EXPRESSION_LANGUAGE_SYNTAX_ERROR => 'EXPRESSION_LANGUAGE_SYNTAX_ERROR', - ]; - - public $message = 'This value should be a valid expression.'; - public $service; - public $allowedVariables; - - public function __construct(array $options = null, string $message = null, string $service = null, array $allowedVariables = null, array $groups = null, $payload = null) - { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->service = $service ?? $this->service; - $this->allowedVariables = $allowedVariables ?? $this->allowedVariables; - } - - /** - * {@inheritdoc} - */ - public function validatedBy() - { - return $this->service ?? static::class.'Validator'; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php deleted file mode 100644 index 4b67da2c2be..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionLanguageSyntaxValidator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use Symfony\Component\ExpressionLanguage\SyntaxError; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * @author Andrey Sevastianov - */ -class ExpressionLanguageSyntaxValidator extends ConstraintValidator -{ - private $expressionLanguage; - - public function __construct(ExpressionLanguage $expressionLanguage = null) - { - $this->expressionLanguage = $expressionLanguage; - } - - /** - * {@inheritdoc} - */ - public function validate($expression, Constraint $constraint): void - { - if (!$constraint instanceof ExpressionLanguageSyntax) { - throw new UnexpectedTypeException($constraint, ExpressionLanguageSyntax::class); - } - - if (!\is_string($expression)) { - throw new UnexpectedValueException($expression, 'string'); - } - - if (null === $this->expressionLanguage) { - $this->expressionLanguage = new ExpressionLanguage(); - } - - try { - $this->expressionLanguage->lint($expression, $constraint->allowedVariables); - } catch (SyntaxError $exception) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ syntax_error }}', $this->formatValue($exception->getMessage())) - ->setInvalidValue((string) $expression) - ->setCode(ExpressionLanguageSyntax::EXPRESSION_LANGUAGE_SYNTAX_ERROR) - ->addViolation(); - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php index 3ae47f48023..85fc4664e5a 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ExpressionValidator.php @@ -12,8 +12,13 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\PropertyAccess\PropertyAccessorInterface; +use Symfony\Component\PropertyAccess\PropertyPath; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Exception\RuntimeException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -22,10 +27,12 @@ */ class ExpressionValidator extends ConstraintValidator { + private $propertyAccessor; private $expressionLanguage; - public function __construct(ExpressionLanguage $expressionLanguage = null) + public function __construct(PropertyAccessorInterface $propertyAccessor = null, ExpressionLanguage $expressionLanguage = null) { + $this->propertyAccessor = $propertyAccessor; $this->expressionLanguage = $expressionLanguage; } @@ -35,27 +42,69 @@ public function __construct(ExpressionLanguage $expressionLanguage = null) public function validate($value, Constraint $constraint) { if (!$constraint instanceof Expression) { - throw new UnexpectedTypeException($constraint, Expression::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Expression'); } - $variables = $constraint->values; - $variables['value'] = $value; - $variables['this'] = $this->context->getObject(); + $variables = array(); + + // Symfony 2.5+ + if ($this->context instanceof ExecutionContextInterface) { + $variables['value'] = $value; + $variables['this'] = $this->context->getObject(); + } elseif (null === $this->context->getPropertyName()) { + $variables['value'] = $value; + $variables['this'] = $value; + } else { + $root = $this->context->getRoot(); + $variables['value'] = $value; + + if (\is_object($root)) { + // Extract the object that the property belongs to from the object + // graph + $path = new PropertyPath($this->context->getPropertyPath()); + $parentPath = $path->getParent(); + $variables['this'] = $parentPath ? $this->getPropertyAccessor()->getValue($root, $parentPath) : $root; + } else { + $variables['this'] = null; + } + } if (!$this->getExpressionLanguage()->evaluate($constraint->expression, $variables)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING)) - ->setCode(Expression::EXPRESSION_FAILED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING)) + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value, self::OBJECT_TO_STRING)) + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->addViolation(); + } } } - private function getExpressionLanguage(): ExpressionLanguage + private function getExpressionLanguage() { if (null === $this->expressionLanguage) { + if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) { + throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); + } $this->expressionLanguage = new ExpressionLanguage(); } return $this->expressionLanguage; } + + private function getPropertyAccessor() + { + if (null === $this->propertyAccessor) { + if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccess')) { + throw new RuntimeException('Unable to use expressions as the Symfony PropertyAccess component is not installed.'); + } + $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); + } + + return $this->propertyAccessor; + } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/File.php b/upload/system/storage/vendor/symfony/validator/Constraints/File.php index e28473ac846..c00ece3e3d2 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/File.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/File.php @@ -22,27 +22,26 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class File extends Constraint { // Check the Image constraint for clashes if adding new constants here - public const NOT_FOUND_ERROR = 'd2a3fb6e-7ddc-4210-8fbf-2ab345ce1998'; - public const NOT_READABLE_ERROR = 'c20c92a4-5bfa-4202-9477-28e800e0f6ff'; - public const EMPTY_ERROR = '5d743385-9775-4aa5-8ff5-495fb1e60137'; - public const TOO_LARGE_ERROR = 'df8637af-d466-48c6-a59d-e7126250a654'; - public const INVALID_MIME_TYPE_ERROR = '744f00bc-4389-4c74-92de-9a43cde55534'; + const NOT_FOUND_ERROR = 'd2a3fb6e-7ddc-4210-8fbf-2ab345ce1998'; + const NOT_READABLE_ERROR = 'c20c92a4-5bfa-4202-9477-28e800e0f6ff'; + const EMPTY_ERROR = '5d743385-9775-4aa5-8ff5-495fb1e60137'; + const TOO_LARGE_ERROR = 'df8637af-d466-48c6-a59d-e7126250a654'; + const INVALID_MIME_TYPE_ERROR = '744f00bc-4389-4c74-92de-9a43cde55534'; - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_FOUND_ERROR => 'NOT_FOUND_ERROR', self::NOT_READABLE_ERROR => 'NOT_READABLE_ERROR', self::EMPTY_ERROR => 'EMPTY_ERROR', self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', self::INVALID_MIME_TYPE_ERROR => 'INVALID_MIME_TYPE_ERROR', - ]; + ); public $binaryFormat; - public $mimeTypes = []; + public $mimeTypes = array(); public $notFoundMessage = 'The file could not be found.'; public $notReadableMessage = 'The file is not readable.'; public $maxSizeMessage = 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.'; @@ -60,66 +59,16 @@ class File extends Constraint protected $maxSize; - /** - * {@inheritdoc} - * - * @param int|string|null $maxSize - * @param string[]|string|null $mimeTypes - */ - public function __construct( - array $options = null, - $maxSize = null, - bool $binaryFormat = null, - $mimeTypes = null, - string $notFoundMessage = null, - string $notReadableMessage = null, - string $maxSizeMessage = null, - string $mimeTypesMessage = null, - string $disallowEmptyMessage = null, - - string $uploadIniSizeErrorMessage = null, - string $uploadFormSizeErrorMessage = null, - string $uploadPartialErrorMessage = null, - string $uploadNoFileErrorMessage = null, - string $uploadNoTmpDirErrorMessage = null, - string $uploadCantWriteErrorMessage = null, - string $uploadExtensionErrorMessage = null, - string $uploadErrorMessage = null, - array $groups = null, - $payload = null - ) { - if (null !== $maxSize && !\is_int($maxSize) && !\is_string($maxSize)) { - throw new \TypeError(sprintf('"%s": Expected argument $maxSize to be either null, an integer or a string, got "%s".', __METHOD__, get_debug_type($maxSize))); - } - if (null !== $mimeTypes && !\is_array($mimeTypes) && !\is_string($mimeTypes)) { - throw new \TypeError(sprintf('"%s": Expected argument $mimeTypes to be either null, an array or a string, got "%s".', __METHOD__, get_debug_type($mimeTypes))); - } - - parent::__construct($options, $groups, $payload); - - $this->maxSize = $maxSize ?? $this->maxSize; - $this->binaryFormat = $binaryFormat ?? $this->binaryFormat; - $this->mimeTypes = $mimeTypes ?? $this->mimeTypes; - $this->notFoundMessage = $notFoundMessage ?? $this->notFoundMessage; - $this->notReadableMessage = $notReadableMessage ?? $this->notReadableMessage; - $this->maxSizeMessage = $maxSizeMessage ?? $this->maxSizeMessage; - $this->mimeTypesMessage = $mimeTypesMessage ?? $this->mimeTypesMessage; - $this->disallowEmptyMessage = $disallowEmptyMessage ?? $this->disallowEmptyMessage; - $this->uploadIniSizeErrorMessage = $uploadIniSizeErrorMessage ?? $this->uploadIniSizeErrorMessage; - $this->uploadFormSizeErrorMessage = $uploadFormSizeErrorMessage ?? $this->uploadFormSizeErrorMessage; - $this->uploadPartialErrorMessage = $uploadPartialErrorMessage ?? $this->uploadPartialErrorMessage; - $this->uploadNoFileErrorMessage = $uploadNoFileErrorMessage ?? $this->uploadNoFileErrorMessage; - $this->uploadNoTmpDirErrorMessage = $uploadNoTmpDirErrorMessage ?? $this->uploadNoTmpDirErrorMessage; - $this->uploadCantWriteErrorMessage = $uploadCantWriteErrorMessage ?? $this->uploadCantWriteErrorMessage; - $this->uploadExtensionErrorMessage = $uploadExtensionErrorMessage ?? $this->uploadExtensionErrorMessage; - $this->uploadErrorMessage = $uploadErrorMessage ?? $this->uploadErrorMessage; + public function __construct($options = null) + { + parent::__construct($options); if (null !== $this->maxSize) { $this->normalizeBinaryFormat($this->maxSize); } } - public function __set(string $option, $value) + public function __set($option, $value) { if ('maxSize' === $option) { $this->normalizeBinaryFormat($value); @@ -130,7 +79,7 @@ public function __set(string $option, $value) parent::__set($option, $value); } - public function __get(string $option) + public function __get($option) { if ('maxSize' === $option) { return $this->maxSize; @@ -139,7 +88,7 @@ public function __get(string $option) return parent::__get($option); } - public function __isset(string $option) + public function __isset($option) { if ('maxSize' === $option) { return true; @@ -148,27 +97,27 @@ public function __isset(string $option) return parent::__isset($option); } - /** - * @param int|string $maxSize - */ private function normalizeBinaryFormat($maxSize) { - $factors = [ - 'k' => 1000, - 'ki' => 1 << 10, - 'm' => 1000 * 1000, - 'mi' => 1 << 20, - 'g' => 1000 * 1000 * 1000, - 'gi' => 1 << 30, - ]; + $sizeInt = (int) $maxSize; + if (ctype_digit((string) $maxSize)) { - $this->maxSize = (int) $maxSize; - $this->binaryFormat = $this->binaryFormat ?? false; - } elseif (preg_match('/^(\d++)('.implode('|', array_keys($factors)).')$/i', $maxSize, $matches)) { - $this->maxSize = $matches[1] * $factors[$unit = strtolower($matches[2])]; - $this->binaryFormat = $this->binaryFormat ?? (2 === \strlen($unit)); + $this->maxSize = $sizeInt; + $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; + } elseif (preg_match('/^\d++k$/i', $maxSize)) { + $this->maxSize = $sizeInt * 1000; + $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; + } elseif (preg_match('/^\d++M$/i', $maxSize)) { + $this->maxSize = $sizeInt * 1000000; + $this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat; + } elseif (preg_match('/^\d++Ki$/i', $maxSize)) { + $this->maxSize = $sizeInt << 10; + $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat; + } elseif (preg_match('/^\d++Mi$/i', $maxSize)) { + $this->maxSize = $sizeInt << 20; + $this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat; } else { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size.', $this->maxSize)); + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize)); } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php index cebb6eda296..33c784b68cd 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/FileValidator.php @@ -13,30 +13,28 @@ use Symfony\Component\HttpFoundation\File\File as FileObject; use Symfony\Component\HttpFoundation\File\UploadedFile; -use Symfony\Component\Mime\MimeTypes; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\LogicException; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek */ class FileValidator extends ConstraintValidator { - public const KB_BYTES = 1000; - public const MB_BYTES = 1000000; - public const KIB_BYTES = 1024; - public const MIB_BYTES = 1048576; + const KB_BYTES = 1000; + const MB_BYTES = 1000000; + const KIB_BYTES = 1024; + const MIB_BYTES = 1048576; - private const SUFFICES = [ + private static $suffices = array( 1 => 'bytes', self::KB_BYTES => 'kB', self::MB_BYTES => 'MB', self::KIB_BYTES => 'KiB', self::MIB_BYTES => 'MiB', - ]; + ); /** * {@inheritdoc} @@ -44,7 +42,7 @@ class FileValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof File) { - throw new UnexpectedTypeException($constraint, File::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\File'); } if (null === $value || '' === $value) { @@ -53,102 +51,171 @@ public function validate($value, Constraint $constraint) if ($value instanceof UploadedFile && !$value->isValid()) { switch ($value->getError()) { - case \UPLOAD_ERR_INI_SIZE: + case UPLOAD_ERR_INI_SIZE: $iniLimitSize = UploadedFile::getMaxFilesize(); if ($constraint->maxSize && $constraint->maxSize < $iniLimitSize) { $limitInBytes = $constraint->maxSize; $binaryFormat = $constraint->binaryFormat; } else { $limitInBytes = $iniLimitSize; - $binaryFormat = $constraint->binaryFormat ?? true; + $binaryFormat = null === $constraint->binaryFormat ? true : $constraint->binaryFormat; } - [, $limitAsString, $suffix] = $this->factorizeSizes(0, $limitInBytes, $binaryFormat); - $this->context->buildViolation($constraint->uploadIniSizeErrorMessage) - ->setParameter('{{ limit }}', $limitAsString) - ->setParameter('{{ suffix }}', $suffix) - ->setCode((string) \UPLOAD_ERR_INI_SIZE) - ->addViolation(); + list($sizeAsString, $limitAsString, $suffix) = $this->factorizeSizes(0, $limitInBytes, $binaryFormat); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadIniSizeErrorMessage) + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setCode(UPLOAD_ERR_INI_SIZE) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadIniSizeErrorMessage) + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setCode(UPLOAD_ERR_INI_SIZE) + ->addViolation(); + } return; - case \UPLOAD_ERR_FORM_SIZE: - $this->context->buildViolation($constraint->uploadFormSizeErrorMessage) - ->setCode((string) \UPLOAD_ERR_FORM_SIZE) - ->addViolation(); + case UPLOAD_ERR_FORM_SIZE: + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadFormSizeErrorMessage) + ->setCode(UPLOAD_ERR_FORM_SIZE) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadFormSizeErrorMessage) + ->setCode(UPLOAD_ERR_FORM_SIZE) + ->addViolation(); + } return; - case \UPLOAD_ERR_PARTIAL: - $this->context->buildViolation($constraint->uploadPartialErrorMessage) - ->setCode((string) \UPLOAD_ERR_PARTIAL) - ->addViolation(); + case UPLOAD_ERR_PARTIAL: + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadPartialErrorMessage) + ->setCode(UPLOAD_ERR_PARTIAL) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadPartialErrorMessage) + ->setCode(UPLOAD_ERR_PARTIAL) + ->addViolation(); + } return; - case \UPLOAD_ERR_NO_FILE: - $this->context->buildViolation($constraint->uploadNoFileErrorMessage) - ->setCode((string) \UPLOAD_ERR_NO_FILE) - ->addViolation(); + case UPLOAD_ERR_NO_FILE: + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadNoFileErrorMessage) + ->setCode(UPLOAD_ERR_NO_FILE) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadNoFileErrorMessage) + ->setCode(UPLOAD_ERR_NO_FILE) + ->addViolation(); + } return; - case \UPLOAD_ERR_NO_TMP_DIR: - $this->context->buildViolation($constraint->uploadNoTmpDirErrorMessage) - ->setCode((string) \UPLOAD_ERR_NO_TMP_DIR) - ->addViolation(); + case UPLOAD_ERR_NO_TMP_DIR: + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadNoTmpDirErrorMessage) + ->setCode(UPLOAD_ERR_NO_TMP_DIR) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadNoTmpDirErrorMessage) + ->setCode(UPLOAD_ERR_NO_TMP_DIR) + ->addViolation(); + } return; - case \UPLOAD_ERR_CANT_WRITE: - $this->context->buildViolation($constraint->uploadCantWriteErrorMessage) - ->setCode((string) \UPLOAD_ERR_CANT_WRITE) - ->addViolation(); + case UPLOAD_ERR_CANT_WRITE: + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadCantWriteErrorMessage) + ->setCode(UPLOAD_ERR_CANT_WRITE) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadCantWriteErrorMessage) + ->setCode(UPLOAD_ERR_CANT_WRITE) + ->addViolation(); + } return; - case \UPLOAD_ERR_EXTENSION: - $this->context->buildViolation($constraint->uploadExtensionErrorMessage) - ->setCode((string) \UPLOAD_ERR_EXTENSION) - ->addViolation(); + case UPLOAD_ERR_EXTENSION: + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadExtensionErrorMessage) + ->setCode(UPLOAD_ERR_EXTENSION) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadExtensionErrorMessage) + ->setCode(UPLOAD_ERR_EXTENSION) + ->addViolation(); + } return; default: - $this->context->buildViolation($constraint->uploadErrorMessage) - ->setCode((string) $value->getError()) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->uploadErrorMessage) + ->setCode($value->getError()) + ->addViolation(); + } else { + $this->buildViolation($constraint->uploadErrorMessage) + ->setCode($value->getError()) + ->addViolation(); + } return; } } if (!is_scalar($value) && !$value instanceof FileObject && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $path = $value instanceof FileObject ? $value->getPathname() : (string) $value; if (!is_file($path)) { - $this->context->buildViolation($constraint->notFoundMessage) - ->setParameter('{{ file }}', $this->formatValue($path)) - ->setCode(File::NOT_FOUND_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->notFoundMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::NOT_FOUND_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->notFoundMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::NOT_FOUND_ERROR) + ->addViolation(); + } return; } if (!is_readable($path)) { - $this->context->buildViolation($constraint->notReadableMessage) - ->setParameter('{{ file }}', $this->formatValue($path)) - ->setCode(File::NOT_READABLE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->notReadableMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::NOT_READABLE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->notReadableMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::NOT_READABLE_ERROR) + ->addViolation(); + } return; } $sizeInBytes = filesize($path); - $basename = $value instanceof UploadedFile ? $value->getClientOriginalName() : basename($path); if (0 === $sizeInBytes) { - $this->context->buildViolation($constraint->disallowEmptyMessage) - ->setParameter('{{ file }}', $this->formatValue($path)) - ->setParameter('{{ name }}', $this->formatValue($basename)) - ->setCode(File::EMPTY_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->disallowEmptyMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::EMPTY_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->disallowEmptyMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setCode(File::EMPTY_ERROR) + ->addViolation(); + } return; } @@ -157,32 +224,36 @@ public function validate($value, Constraint $constraint) $limitInBytes = $constraint->maxSize; if ($sizeInBytes > $limitInBytes) { - [$sizeAsString, $limitAsString, $suffix] = $this->factorizeSizes($sizeInBytes, $limitInBytes, $constraint->binaryFormat); - $this->context->buildViolation($constraint->maxSizeMessage) - ->setParameter('{{ file }}', $this->formatValue($path)) - ->setParameter('{{ size }}', $sizeAsString) - ->setParameter('{{ limit }}', $limitAsString) - ->setParameter('{{ suffix }}', $suffix) - ->setParameter('{{ name }}', $this->formatValue($basename)) - ->setCode(File::TOO_LARGE_ERROR) - ->addViolation(); + list($sizeAsString, $limitAsString, $suffix) = $this->factorizeSizes($sizeInBytes, $limitInBytes, $constraint->binaryFormat); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->maxSizeMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setParameter('{{ size }}', $sizeAsString) + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setCode(File::TOO_LARGE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->maxSizeMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setParameter('{{ size }}', $sizeAsString) + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setCode(File::TOO_LARGE_ERROR) + ->addViolation(); + } return; } } if ($constraint->mimeTypes) { - if ($value instanceof FileObject) { - $mime = $value->getMimeType(); - } elseif (class_exists(MimeTypes::class)) { - $mime = MimeTypes::getDefault()->guessMimeType($path); - } elseif (!class_exists(FileObject::class)) { - throw new LogicException('You cannot validate the mime-type of files as the Mime component is not installed. Try running "composer require symfony/mime".'); - } else { - $mime = (new FileObject($value))->getMimeType(); + if (!$value instanceof FileObject) { + $value = new FileObject($value); } $mimeTypes = (array) $constraint->mimeTypes; + $mime = $value->getMimeType(); foreach ($mimeTypes as $mimeType) { if ($mimeType === $mime) { @@ -196,28 +267,34 @@ public function validate($value, Constraint $constraint) } } - $this->context->buildViolation($constraint->mimeTypesMessage) - ->setParameter('{{ file }}', $this->formatValue($path)) - ->setParameter('{{ type }}', $this->formatValue($mime)) - ->setParameter('{{ types }}', $this->formatValues($mimeTypes)) - ->setParameter('{{ name }}', $this->formatValue($basename)) - ->setCode(File::INVALID_MIME_TYPE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->mimeTypesMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setParameter('{{ type }}', $this->formatValue($mime)) + ->setParameter('{{ types }}', $this->formatValues($mimeTypes)) + ->setCode(File::INVALID_MIME_TYPE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->mimeTypesMessage) + ->setParameter('{{ file }}', $this->formatValue($path)) + ->setParameter('{{ type }}', $this->formatValue($mime)) + ->setParameter('{{ types }}', $this->formatValues($mimeTypes)) + ->setCode(File::INVALID_MIME_TYPE_ERROR) + ->addViolation(); + } } } - private static function moreDecimalsThan(string $double, int $numberOfDecimals): bool + private static function moreDecimalsThan($double, $numberOfDecimals) { - return \strlen($double) > \strlen(round($double, $numberOfDecimals)); + return \strlen((string) $double) > \strlen(round($double, $numberOfDecimals)); } /** * Convert the limit to the smallest possible number * (i.e. try "MB", then "kB", then "bytes"). - * - * @param int|float $limit */ - private function factorizeSizes(int $size, $limit, bool $binaryFormat): array + private function factorizeSizes($size, $limit, $binaryFormat) { if ($binaryFormat) { $coef = self::MIB_BYTES; @@ -247,6 +324,6 @@ private function factorizeSizes(int $size, $limit, bool $binaryFormat): array $sizeAsString = (string) round($size / $coef, 2); } - return [$sizeAsString, $limitAsString, self::SUFFICES[$coef]]; + return array($sizeAsString, $limitAsString, self::$suffices[$coef]); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php index 41648752a2f..c2ca2dcb82f 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThan.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class GreaterThan extends AbstractComparison { - public const TOO_LOW_ERROR = '778b7ae0-84d3-481a-9dec-35fdb64b1d78'; + const TOO_LOW_ERROR = '778b7ae0-84d3-481a-9dec-35fdb64b1d78'; - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', - ]; + ); public $message = 'This value should be greater than {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php index 86ff44e8c34..9b3743d0732 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqual.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class GreaterThanOrEqual extends AbstractComparison { - public const TOO_LOW_ERROR = 'ea4e51d1-3342-48bd-87f1-9e672cd90cad'; + const TOO_LOW_ERROR = 'ea4e51d1-3342-48bd-87f1-9e672cd90cad'; - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', - ]; + ); public $message = 'This value should be greater than or equal to {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php index 290408ac0cc..e196e688f34 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanOrEqualValidator.php @@ -24,7 +24,7 @@ class GreaterThanOrEqualValidator extends AbstractComparisonValidator */ protected function compareValues($value1, $value2) { - return null === $value2 || $value1 >= $value2; + return $value1 >= $value2; } /** diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php index 062503ab3f4..9029e8fc46a 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GreaterThanValidator.php @@ -24,7 +24,7 @@ class GreaterThanValidator extends AbstractComparisonValidator */ protected function compareValues($value1, $value2) { - return null === $value2 || $value1 > $value2; + return $value1 > $value2; } /** diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php index 522c5fdf59d..d2c4d4ab1f3 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequence.php @@ -11,13 +11,15 @@ namespace Symfony\Component\Validator\Constraints; +use Symfony\Component\Validator\Exception\OutOfBoundsException; + /** * A sequence of validation groups. * * When validating a group sequence, each group will only be validated if all * of the previous groups in the sequence succeeded. For example: * - * $validator->validate($address, null, new GroupSequence(['Basic', 'Strict'])); + * $validator->validate($address, null, new GroupSequence(array('Basic', 'Strict'))); * * In the first step, all constraints that belong to the group "Basic" will be * validated. If none of the constraints fail, the validator will then validate @@ -28,6 +30,7 @@ * * When adding metadata to a class, you can override the "Default" group of * that class with a group sequence: + * * /** * * @GroupSequence({"Address", "Strict"}) * *\/ @@ -50,14 +53,15 @@ * @Target({"CLASS", "ANNOTATION"}) * * @author Bernhard Schussek + * + * Implementing \ArrayAccess, \IteratorAggregate and \Countable is @deprecated since 2.5 and will be removed in 3.0. */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class GroupSequence +class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable { /** * The groups in the sequence. * - * @var array + * @var string[]|GroupSequence[] */ public $groups; @@ -80,11 +84,125 @@ class GroupSequence /** * Creates a new group sequence. * - * @param array $groups The groups in the sequence + * @param string[] $groups The groups in the sequence */ public function __construct(array $groups) { // Support for Doctrine annotations - $this->groups = $groups['value'] ?? $groups; + $this->groups = isset($groups['value']) ? $groups['value'] : $groups; + } + + /** + * Returns an iterator for this group. + * + * Implemented for backwards compatibility with Symfony < 2.5. + * + * @return \Traversable The iterator + * + * @see \IteratorAggregate::getIterator() + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function getIterator() + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + return new \ArrayIterator($this->groups); + } + + /** + * Returns whether the given offset exists in the sequence. + * + * Implemented for backwards compatibility with Symfony < 2.5. + * + * @param int $offset The offset + * + * @return bool Whether the offset exists + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function offsetExists($offset) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + return isset($this->groups[$offset]); + } + + /** + * Returns the group at the given offset. + * + * Implemented for backwards compatibility with Symfony < 2.5. + * + * @param int $offset The offset + * + * @return string The group a the given offset + * + * @throws OutOfBoundsException If the object does not exist + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function offsetGet($offset) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + if (!isset($this->groups[$offset])) { + throw new OutOfBoundsException(sprintf('The offset "%s" does not exist.', $offset)); + } + + return $this->groups[$offset]; + } + + /** + * Sets the group at the given offset. + * + * Implemented for backwards compatibility with Symfony < 2.5. + * + * @param int $offset The offset + * @param string $value The group name + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function offsetSet($offset, $value) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + if (null !== $offset) { + $this->groups[$offset] = $value; + + return; + } + + $this->groups[] = $value; + } + + /** + * Removes the group at the given offset. + * + * Implemented for backwards compatibility with Symfony < 2.5. + * + * @param int $offset The offset + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function offsetUnset($offset) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + unset($this->groups[$offset]); + } + + /** + * Returns the number of groups in the sequence. + * + * Implemented for backwards compatibility with Symfony < 2.5. + * + * @return int The number of groups + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function count() + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + return \count($this->groups); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php index 489a449e838..8a3fe6300f6 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/GroupSequenceProvider.php @@ -19,7 +19,6 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_CLASS)] class GroupSequenceProvider { } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php b/upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php deleted file mode 100644 index d0d02d1f565..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Hostname.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Dmitrii Poddubnyi - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Hostname extends Constraint -{ - public const INVALID_HOSTNAME_ERROR = '7057ffdb-0af4-4f7e-bd5e-e9acfa6d7a2d'; - - protected static $errorNames = [ - self::INVALID_HOSTNAME_ERROR => 'INVALID_HOSTNAME_ERROR', - ]; - - public $message = 'This value is not a valid hostname.'; - public $requireTld = true; - - public function __construct( - array $options = null, - string $message = null, - bool $requireTld = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->requireTld = $requireTld ?? $this->requireTld; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php deleted file mode 100644 index 144d57e37dd..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/HostnameValidator.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * @author Dmitrii Poddubnyi - */ -class HostnameValidator extends ConstraintValidator -{ - /** - * https://tools.ietf.org/html/rfc2606. - */ - private const RESERVED_TLDS = [ - 'example', - 'invalid', - 'localhost', - 'test', - ]; - - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Hostname) { - throw new UnexpectedTypeException($constraint, Hostname::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); - } - - $value = (string) $value; - if ('' === $value) { - return; - } - if (!$this->isValid($value) || ($constraint->requireTld && !$this->hasValidTld($value))) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Hostname::INVALID_HOSTNAME_ERROR) - ->addViolation(); - } - } - - private function isValid(string $domain): bool - { - return false !== filter_var($domain, \FILTER_VALIDATE_DOMAIN, \FILTER_FLAG_HOSTNAME); - } - - private function hasValidTld(string $domain): bool - { - return false !== strpos($domain, '.') && !\in_array(substr($domain, strrpos($domain, '.') + 1), self::RESERVED_TLDS, true); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Iban.php b/upload/system/storage/vendor/symfony/validator/Constraints/Iban.php index 2f7a61e982f..9c4d3838fa0 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Iban.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Iban.php @@ -21,29 +21,27 @@ * @author Michael Schummel * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Iban extends Constraint { - public const INVALID_COUNTRY_CODE_ERROR = 'de78ee2c-bd50-44e2-aec8-3d8228aeadb9'; - public const INVALID_CHARACTERS_ERROR = '8d3d85e4-784f-4719-a5bc-d9e40d45a3a5'; - public const CHECKSUM_FAILED_ERROR = 'b9401321-f9bf-4dcb-83c1-f31094440795'; - public const INVALID_FORMAT_ERROR = 'c8d318f1-2ecc-41ba-b983-df70d225cf5a'; - public const NOT_SUPPORTED_COUNTRY_CODE_ERROR = 'e2c259f3-4b46-48e6-b72e-891658158ec8'; - - protected static $errorNames = [ + /** @deprecated, to be removed in 3.0. */ + const TOO_SHORT_ERROR = '88e5e319-0aeb-4979-a27e-3d9ce0c16166'; + const INVALID_COUNTRY_CODE_ERROR = 'de78ee2c-bd50-44e2-aec8-3d8228aeadb9'; + const INVALID_CHARACTERS_ERROR = '8d3d85e4-784f-4719-a5bc-d9e40d45a3a5'; + /** @deprecated, to be removed in 3.0. */ + const INVALID_CASE_ERROR = 'f4bf62fe-03ec-42af-a53b-68e21b1e7274'; + const CHECKSUM_FAILED_ERROR = 'b9401321-f9bf-4dcb-83c1-f31094440795'; + const INVALID_FORMAT_ERROR = 'c8d318f1-2ecc-41ba-b983-df70d225cf5a'; + const NOT_SUPPORTED_COUNTRY_CODE_ERROR = 'e2c259f3-4b46-48e6-b72e-891658158ec8'; + + protected static $errorNames = array( + self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', self::INVALID_COUNTRY_CODE_ERROR => 'INVALID_COUNTRY_CODE_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR', self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', self::NOT_SUPPORTED_COUNTRY_CODE_ERROR => 'NOT_SUPPORTED_COUNTRY_CODE_ERROR', - ]; + ); public $message = 'This is not a valid International Bank Account Number (IBAN).'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php index 0f39a3a9cea..d4753329c83 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Manuel Reinhard @@ -36,7 +36,7 @@ class IbanValidator extends ConstraintValidator * * @see https://www.swift.com/sites/default/files/resources/iban_registry.pdf */ - private const FORMATS = [ + private static $formats = array( 'AD' => 'AD\d{2}\d{4}\d{4}[\dA-Z]{12}', // Andorra 'AE' => 'AE\d{2}\d{3}\d{16}', // United Arab Emirates 'AL' => 'AL\d{2}\d{8}[\dA-Z]{16}', // Albania @@ -130,12 +130,11 @@ class IbanValidator extends ConstraintValidator 'TN' => 'TN59\d{2}\d{3}\d{13}\d{2}', // Tunisia 'TR' => 'TR\d{2}\d{5}[\dA-Z]{1}[\dA-Z]{16}', // Turkey 'UA' => 'UA\d{2}\d{6}[\dA-Z]{19}', // Ukraine - 'VA' => 'VA\d{2}\d{3}\d{15}', // Vatican City State 'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands, British 'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Wallis and Futuna Islands 'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Republic of Kosovo 'YT' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Mayotte - ]; + ); /** * {@inheritdoc} @@ -143,7 +142,7 @@ class IbanValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Iban) { - throw new UnexpectedTypeException($constraint, Iban::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Iban'); } if (null === $value || '' === $value) { @@ -151,7 +150,7 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; @@ -161,10 +160,17 @@ public function validate($value, Constraint $constraint) // The IBAN must contain only digits and characters... if (!ctype_alnum($canonicalized)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Iban::INVALID_CHARACTERS_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } return; } @@ -173,31 +179,52 @@ public function validate($value, Constraint $constraint) $countryCode = substr($canonicalized, 0, 2); if (!ctype_alpha($countryCode)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Iban::INVALID_COUNTRY_CODE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_COUNTRY_CODE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_COUNTRY_CODE_ERROR) + ->addViolation(); + } return; } // ...have a format available - if (!\array_key_exists($countryCode, self::FORMATS)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Iban::NOT_SUPPORTED_COUNTRY_CODE_ERROR) - ->addViolation(); + if (!array_key_exists($countryCode, self::$formats)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::NOT_SUPPORTED_COUNTRY_CODE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::NOT_SUPPORTED_COUNTRY_CODE_ERROR) + ->addViolation(); + } return; } // ...and have a valid format - if (!preg_match('/^'.self::FORMATS[$countryCode].'$/', $canonicalized) + if (!preg_match('/^'.self::$formats[$countryCode].'$/', $canonicalized) ) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Iban::INVALID_FORMAT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_FORMAT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::INVALID_FORMAT_ERROR) + ->addViolation(); + } return; } @@ -218,14 +245,21 @@ public function validate($value, Constraint $constraint) // We cannot use PHP's modulo operator, so we calculate the // modulo step-wisely instead if (1 !== self::bigModulo97($checkSum)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Iban::CHECKSUM_FAILED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } } } - private static function toBigInt(string $string): string + private static function toBigInt($string) { $chars = str_split($string); $bigInt = ''; @@ -245,7 +279,7 @@ private static function toBigInt(string $string): string return $bigInt; } - private static function bigModulo97(string $bigInt): int + private static function bigModulo97($bigInt) { $parts = str_split($bigInt, 7); $rest = 0; diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php index b3d6b92cba7..a7dadff833c 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IdenticalTo.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IdenticalTo extends AbstractComparison { - public const NOT_IDENTICAL_ERROR = '2a8cc50f-58a2-4536-875e-060a2ce69ed5'; + const NOT_IDENTICAL_ERROR = '2a8cc50f-58a2-4536-875e-060a2ce69ed5'; - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_IDENTICAL_ERROR => 'NOT_IDENTICAL_ERROR', - ]; + ); public $message = 'This value should be identical to {{ compared_value_type }} {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Image.php b/upload/system/storage/vendor/symfony/validator/Constraints/Image.php index 83fc9f9dd24..28803c43292 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Image.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Image.php @@ -18,26 +18,22 @@ * @author Benjamin Dulau * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Image extends File { - public const SIZE_NOT_DETECTED_ERROR = '6d55c3f4-e58e-4fe3-91ee-74b492199956'; - public const TOO_WIDE_ERROR = '7f87163d-878f-47f5-99ba-a8eb723a1ab2'; - public const TOO_NARROW_ERROR = '9afbd561-4f90-4a27-be62-1780fc43604a'; - public const TOO_HIGH_ERROR = '7efae81c-4877-47ba-aa65-d01ccb0d4645'; - public const TOO_LOW_ERROR = 'aef0cb6a-c07f-4894-bc08-1781420d7b4c'; - public const TOO_FEW_PIXEL_ERROR = '1b06b97d-ae48-474e-978f-038a74854c43'; - public const TOO_MANY_PIXEL_ERROR = 'ee0804e8-44db-4eac-9775-be91aaf72ce1'; - public const RATIO_TOO_BIG_ERROR = '70cafca6-168f-41c9-8c8c-4e47a52be643'; - public const RATIO_TOO_SMALL_ERROR = '59b8c6ef-bcf2-4ceb-afff-4642ed92f12e'; - public const SQUARE_NOT_ALLOWED_ERROR = '5d41425b-facb-47f7-a55a-de9fbe45cb46'; - public const LANDSCAPE_NOT_ALLOWED_ERROR = '6f895685-7cf2-4d65-b3da-9029c5581d88'; - public const PORTRAIT_NOT_ALLOWED_ERROR = '65608156-77da-4c79-a88c-02ef6d18c782'; - public const CORRUPTED_IMAGE_ERROR = '5d4163f3-648f-4e39-87fd-cc5ea7aad2d1'; + const SIZE_NOT_DETECTED_ERROR = '6d55c3f4-e58e-4fe3-91ee-74b492199956'; + const TOO_WIDE_ERROR = '7f87163d-878f-47f5-99ba-a8eb723a1ab2'; + const TOO_NARROW_ERROR = '9afbd561-4f90-4a27-be62-1780fc43604a'; + const TOO_HIGH_ERROR = '7efae81c-4877-47ba-aa65-d01ccb0d4645'; + const TOO_LOW_ERROR = 'aef0cb6a-c07f-4894-bc08-1781420d7b4c'; + const RATIO_TOO_BIG_ERROR = '70cafca6-168f-41c9-8c8c-4e47a52be643'; + const RATIO_TOO_SMALL_ERROR = '59b8c6ef-bcf2-4ceb-afff-4642ed92f12e'; + const SQUARE_NOT_ALLOWED_ERROR = '5d41425b-facb-47f7-a55a-de9fbe45cb46'; + const LANDSCAPE_NOT_ALLOWED_ERROR = '6f895685-7cf2-4d65-b3da-9029c5581d88'; + const PORTRAIT_NOT_ALLOWED_ERROR = '65608156-77da-4c79-a88c-02ef6d18c782'; // Include the mapping from the base class - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_FOUND_ERROR => 'NOT_FOUND_ERROR', self::NOT_READABLE_ERROR => 'NOT_READABLE_ERROR', self::EMPTY_ERROR => 'EMPTY_ERROR', @@ -48,15 +44,12 @@ class Image extends File self::TOO_NARROW_ERROR => 'TOO_NARROW_ERROR', self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', - self::TOO_FEW_PIXEL_ERROR => 'TOO_FEW_PIXEL_ERROR', - self::TOO_MANY_PIXEL_ERROR => 'TOO_MANY_PIXEL_ERROR', self::RATIO_TOO_BIG_ERROR => 'RATIO_TOO_BIG_ERROR', self::RATIO_TOO_SMALL_ERROR => 'RATIO_TOO_SMALL_ERROR', self::SQUARE_NOT_ALLOWED_ERROR => 'SQUARE_NOT_ALLOWED_ERROR', self::LANDSCAPE_NOT_ALLOWED_ERROR => 'LANDSCAPE_NOT_ALLOWED_ERROR', self::PORTRAIT_NOT_ALLOWED_ERROR => 'PORTRAIT_NOT_ALLOWED_ERROR', - self::CORRUPTED_IMAGE_ERROR => 'CORRUPTED_IMAGE_ERROR', - ]; + ); public $mimeTypes = 'image/*'; public $minWidth; @@ -65,12 +58,9 @@ class Image extends File public $minHeight; public $maxRatio; public $minRatio; - public $minPixels; - public $maxPixels; public $allowSquare = true; public $allowLandscape = true; public $allowPortrait = true; - public $detectCorrupted = false; // The constant for a wrong MIME type is taken from the parent class. public $mimeTypesMessage = 'This file is not a valid image.'; @@ -79,115 +69,9 @@ class Image extends File public $minWidthMessage = 'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.'; public $maxHeightMessage = 'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.'; public $minHeightMessage = 'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.'; - public $minPixelsMessage = 'The image has too few pixels ({{ pixels }} pixels). Minimum amount expected is {{ min_pixels }} pixels.'; - public $maxPixelsMessage = 'The image has too many pixels ({{ pixels }} pixels). Maximum amount expected is {{ max_pixels }} pixels.'; public $maxRatioMessage = 'The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.'; public $minRatioMessage = 'The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.'; public $allowSquareMessage = 'The image is square ({{ width }}x{{ height }}px). Square images are not allowed.'; public $allowLandscapeMessage = 'The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.'; public $allowPortraitMessage = 'The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.'; - public $corruptedMessage = 'The image file is corrupted.'; - - /** - * {@inheritdoc} - * - * @param int|float $maxRatio - * @param int|float $minRatio - * @param int|float $minPixels - * @param int|float $maxPixels - */ - public function __construct( - array $options = null, - $maxSize = null, - bool $binaryFormat = null, - array $mimeTypes = null, - int $minWidth = null, - int $maxWidth = null, - int $maxHeight = null, - int $minHeight = null, - $maxRatio = null, - $minRatio = null, - $minPixels = null, - $maxPixels = null, - bool $allowSquare = null, - bool $allowLandscape = null, - bool $allowPortrait = null, - bool $detectCorrupted = null, - string $notFoundMessage = null, - string $notReadableMessage = null, - string $maxSizeMessage = null, - string $mimeTypesMessage = null, - string $disallowEmptyMessage = null, - string $uploadIniSizeErrorMessage = null, - string $uploadFormSizeErrorMessage = null, - string $uploadPartialErrorMessage = null, - string $uploadNoFileErrorMessage = null, - string $uploadNoTmpDirErrorMessage = null, - string $uploadCantWriteErrorMessage = null, - string $uploadExtensionErrorMessage = null, - string $uploadErrorMessage = null, - string $sizeNotDetectedMessage = null, - string $maxWidthMessage = null, - string $minWidthMessage = null, - string $maxHeightMessage = null, - string $minHeightMessage = null, - string $minPixelsMessage = null, - string $maxPixelsMessage = null, - string $maxRatioMessage = null, - string $minRatioMessage = null, - string $allowSquareMessage = null, - string $allowLandscapeMessage = null, - string $allowPortraitMessage = null, - string $corruptedMessage = null, - array $groups = null, - $payload = null - ) { - parent::__construct( - $options, - $maxSize, - $binaryFormat, - $mimeTypes, - $notFoundMessage, - $notReadableMessage, - $maxSizeMessage, - $mimeTypesMessage, - $disallowEmptyMessage, - $uploadIniSizeErrorMessage, - $uploadFormSizeErrorMessage, - $uploadPartialErrorMessage, - $uploadNoFileErrorMessage, - $uploadNoTmpDirErrorMessage, - $uploadCantWriteErrorMessage, - $uploadExtensionErrorMessage, - $uploadErrorMessage, - $groups, - $payload - ); - - $this->minWidth = $minWidth ?? $this->minWidth; - $this->maxWidth = $maxWidth ?? $this->maxWidth; - $this->maxHeight = $maxHeight ?? $this->maxHeight; - $this->minHeight = $minHeight ?? $this->minHeight; - $this->maxRatio = $maxRatio ?? $this->maxRatio; - $this->minRatio = $minRatio ?? $this->minRatio; - $this->minPixels = $minPixels ?? $this->minPixels; - $this->maxPixels = $maxPixels ?? $this->maxPixels; - $this->allowSquare = $allowSquare ?? $this->allowSquare; - $this->allowLandscape = $allowLandscape ?? $this->allowLandscape; - $this->allowPortrait = $allowPortrait ?? $this->allowPortrait; - $this->detectCorrupted = $detectCorrupted ?? $this->detectCorrupted; - $this->sizeNotDetectedMessage = $sizeNotDetectedMessage ?? $this->sizeNotDetectedMessage; - $this->maxWidthMessage = $maxWidthMessage ?? $this->maxWidthMessage; - $this->minWidthMessage = $minWidthMessage ?? $this->minWidthMessage; - $this->maxHeightMessage = $maxHeightMessage ?? $this->maxHeightMessage; - $this->minHeightMessage = $minHeightMessage ?? $this->minHeightMessage; - $this->minPixelsMessage = $minPixelsMessage ?? $this->minPixelsMessage; - $this->maxPixelsMessage = $maxPixelsMessage ?? $this->maxPixelsMessage; - $this->maxRatioMessage = $maxRatioMessage ?? $this->maxRatioMessage; - $this->minRatioMessage = $minRatioMessage ?? $this->minRatioMessage; - $this->allowSquareMessage = $allowSquareMessage ?? $this->allowSquareMessage; - $this->allowLandscapeMessage = $allowLandscapeMessage ?? $this->allowLandscapeMessage; - $this->allowPortraitMessage = $allowPortraitMessage ?? $this->allowPortraitMessage; - $this->corruptedMessage = $corruptedMessage ?? $this->corruptedMessage; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php index f199f1d177d..35ff408b973 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/ImageValidator.php @@ -12,8 +12,8 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\Exception\LogicException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -31,7 +31,7 @@ class ImageValidator extends FileValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Image) { - throw new UnexpectedTypeException($constraint, Image::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Image'); } $violations = \count($this->context->getViolations()); @@ -46,19 +46,23 @@ public function validate($value, Constraint $constraint) if (null === $constraint->minWidth && null === $constraint->maxWidth && null === $constraint->minHeight && null === $constraint->maxHeight - && null === $constraint->minPixels && null === $constraint->maxPixels && null === $constraint->minRatio && null === $constraint->maxRatio - && $constraint->allowSquare && $constraint->allowLandscape && $constraint->allowPortrait - && !$constraint->detectCorrupted) { + && $constraint->allowSquare && $constraint->allowLandscape && $constraint->allowPortrait) { return; } $size = @getimagesize($value); if (empty($size) || (0 === $size[0]) || (0 === $size[1])) { - $this->context->buildViolation($constraint->sizeNotDetectedMessage) - ->setCode(Image::SIZE_NOT_DETECTED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->sizeNotDetectedMessage) + ->setCode(Image::SIZE_NOT_DETECTED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->sizeNotDetectedMessage) + ->setCode(Image::SIZE_NOT_DETECTED_ERROR) + ->addViolation(); + } return; } @@ -68,15 +72,23 @@ public function validate($value, Constraint $constraint) if ($constraint->minWidth) { if (!ctype_digit((string) $constraint->minWidth)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum width.', $constraint->minWidth)); + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum width', $constraint->minWidth)); } if ($width < $constraint->minWidth) { - $this->context->buildViolation($constraint->minWidthMessage) - ->setParameter('{{ width }}', $width) - ->setParameter('{{ min_width }}', $constraint->minWidth) - ->setCode(Image::TOO_NARROW_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->minWidthMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ min_width }}', $constraint->minWidth) + ->setCode(Image::TOO_NARROW_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->minWidthMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ min_width }}', $constraint->minWidth) + ->setCode(Image::TOO_NARROW_ERROR) + ->addViolation(); + } return; } @@ -84,15 +96,23 @@ public function validate($value, Constraint $constraint) if ($constraint->maxWidth) { if (!ctype_digit((string) $constraint->maxWidth)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum width.', $constraint->maxWidth)); + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum width', $constraint->maxWidth)); } if ($width > $constraint->maxWidth) { - $this->context->buildViolation($constraint->maxWidthMessage) - ->setParameter('{{ width }}', $width) - ->setParameter('{{ max_width }}', $constraint->maxWidth) - ->setCode(Image::TOO_WIDE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->maxWidthMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ max_width }}', $constraint->maxWidth) + ->setCode(Image::TOO_WIDE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->maxWidthMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ max_width }}', $constraint->maxWidth) + ->setCode(Image::TOO_WIDE_ERROR) + ->addViolation(); + } return; } @@ -100,15 +120,23 @@ public function validate($value, Constraint $constraint) if ($constraint->minHeight) { if (!ctype_digit((string) $constraint->minHeight)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum height.', $constraint->minHeight)); + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum height', $constraint->minHeight)); } if ($height < $constraint->minHeight) { - $this->context->buildViolation($constraint->minHeightMessage) - ->setParameter('{{ height }}', $height) - ->setParameter('{{ min_height }}', $constraint->minHeight) - ->setCode(Image::TOO_LOW_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->minHeightMessage) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ min_height }}', $constraint->minHeight) + ->setCode(Image::TOO_LOW_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->minHeightMessage) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ min_height }}', $constraint->minHeight) + ->setCode(Image::TOO_LOW_ERROR) + ->addViolation(); + } return; } @@ -116,49 +144,23 @@ public function validate($value, Constraint $constraint) if ($constraint->maxHeight) { if (!ctype_digit((string) $constraint->maxHeight)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum height.', $constraint->maxHeight)); + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum height', $constraint->maxHeight)); } if ($height > $constraint->maxHeight) { - $this->context->buildViolation($constraint->maxHeightMessage) - ->setParameter('{{ height }}', $height) - ->setParameter('{{ max_height }}', $constraint->maxHeight) - ->setCode(Image::TOO_HIGH_ERROR) - ->addViolation(); - } - } - - $pixels = $width * $height; - - if (null !== $constraint->minPixels) { - if (!ctype_digit((string) $constraint->minPixels)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum amount of pixels.', $constraint->minPixels)); - } - - if ($pixels < $constraint->minPixels) { - $this->context->buildViolation($constraint->minPixelsMessage) - ->setParameter('{{ pixels }}', $pixels) - ->setParameter('{{ min_pixels }}', $constraint->minPixels) - ->setParameter('{{ height }}', $height) - ->setParameter('{{ width }}', $width) - ->setCode(Image::TOO_FEW_PIXEL_ERROR) - ->addViolation(); - } - } - - if (null !== $constraint->maxPixels) { - if (!ctype_digit((string) $constraint->maxPixels)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum amount of pixels.', $constraint->maxPixels)); - } - - if ($pixels > $constraint->maxPixels) { - $this->context->buildViolation($constraint->maxPixelsMessage) - ->setParameter('{{ pixels }}', $pixels) - ->setParameter('{{ max_pixels }}', $constraint->maxPixels) - ->setParameter('{{ height }}', $height) - ->setParameter('{{ width }}', $width) - ->setCode(Image::TOO_MANY_PIXEL_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->maxHeightMessage) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ max_height }}', $constraint->maxHeight) + ->setCode(Image::TOO_HIGH_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->maxHeightMessage) + ->setParameter('{{ height }}', $height) + ->setParameter('{{ max_height }}', $constraint->maxHeight) + ->setCode(Image::TOO_HIGH_ERROR) + ->addViolation(); + } } } @@ -166,72 +168,94 @@ public function validate($value, Constraint $constraint) if (null !== $constraint->minRatio) { if (!is_numeric((string) $constraint->minRatio)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum ratio.', $constraint->minRatio)); + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid minimum ratio', $constraint->minRatio)); } - if ($ratio < round($constraint->minRatio, 2)) { - $this->context->buildViolation($constraint->minRatioMessage) - ->setParameter('{{ ratio }}', $ratio) - ->setParameter('{{ min_ratio }}', round($constraint->minRatio, 2)) - ->setCode(Image::RATIO_TOO_SMALL_ERROR) - ->addViolation(); + if ($ratio < $constraint->minRatio) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->minRatioMessage) + ->setParameter('{{ ratio }}', $ratio) + ->setParameter('{{ min_ratio }}', $constraint->minRatio) + ->setCode(Image::RATIO_TOO_SMALL_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->minRatioMessage) + ->setParameter('{{ ratio }}', $ratio) + ->setParameter('{{ min_ratio }}', $constraint->minRatio) + ->setCode(Image::RATIO_TOO_SMALL_ERROR) + ->addViolation(); + } } } if (null !== $constraint->maxRatio) { if (!is_numeric((string) $constraint->maxRatio)) { - throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum ratio.', $constraint->maxRatio)); + throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum ratio', $constraint->maxRatio)); } - if ($ratio > round($constraint->maxRatio, 2)) { - $this->context->buildViolation($constraint->maxRatioMessage) - ->setParameter('{{ ratio }}', $ratio) - ->setParameter('{{ max_ratio }}', round($constraint->maxRatio, 2)) - ->setCode(Image::RATIO_TOO_BIG_ERROR) - ->addViolation(); + if ($ratio > $constraint->maxRatio) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->maxRatioMessage) + ->setParameter('{{ ratio }}', $ratio) + ->setParameter('{{ max_ratio }}', $constraint->maxRatio) + ->setCode(Image::RATIO_TOO_BIG_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->maxRatioMessage) + ->setParameter('{{ ratio }}', $ratio) + ->setParameter('{{ max_ratio }}', $constraint->maxRatio) + ->setCode(Image::RATIO_TOO_BIG_ERROR) + ->addViolation(); + } } } if (!$constraint->allowSquare && $width == $height) { - $this->context->buildViolation($constraint->allowSquareMessage) - ->setParameter('{{ width }}', $width) - ->setParameter('{{ height }}', $height) - ->setCode(Image::SQUARE_NOT_ALLOWED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->allowSquareMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::SQUARE_NOT_ALLOWED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->allowSquareMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::SQUARE_NOT_ALLOWED_ERROR) + ->addViolation(); + } } if (!$constraint->allowLandscape && $width > $height) { - $this->context->buildViolation($constraint->allowLandscapeMessage) - ->setParameter('{{ width }}', $width) - ->setParameter('{{ height }}', $height) - ->setCode(Image::LANDSCAPE_NOT_ALLOWED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->allowLandscapeMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::LANDSCAPE_NOT_ALLOWED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->allowLandscapeMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::LANDSCAPE_NOT_ALLOWED_ERROR) + ->addViolation(); + } } if (!$constraint->allowPortrait && $width < $height) { - $this->context->buildViolation($constraint->allowPortraitMessage) - ->setParameter('{{ width }}', $width) - ->setParameter('{{ height }}', $height) - ->setCode(Image::PORTRAIT_NOT_ALLOWED_ERROR) - ->addViolation(); - } - - if ($constraint->detectCorrupted) { - if (!\function_exists('imagecreatefromstring')) { - throw new LogicException('Corrupted images detection requires installed and enabled GD extension.'); - } - - $resource = @imagecreatefromstring(file_get_contents($value)); - - if (false === $resource) { - $this->context->buildViolation($constraint->corruptedMessage) - ->setCode(Image::CORRUPTED_IMAGE_ERROR) + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->allowPortraitMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::PORTRAIT_NOT_ALLOWED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->allowPortraitMessage) + ->setParameter('{{ width }}', $width) + ->setParameter('{{ height }}', $height) + ->setCode(Image::PORTRAIT_NOT_ALLOWED_ERROR) ->addViolation(); - - return; } - - imagedestroy($resource); } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Ip.php b/upload/system/storage/vendor/symfony/validator/Constraints/Ip.php index 0e4124074fd..f45c4cacebc 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Ip.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Ip.php @@ -13,7 +13,6 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * Validates that a value is a valid IP address. @@ -24,31 +23,30 @@ * @author Bernhard Schussek * @author Joseph Bielawski */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Ip extends Constraint { - public const V4 = '4'; - public const V6 = '6'; - public const ALL = 'all'; + const V4 = '4'; + const V6 = '6'; + const ALL = 'all'; // adds FILTER_FLAG_NO_PRIV_RANGE flag (skip private ranges) - public const V4_NO_PRIV = '4_no_priv'; - public const V6_NO_PRIV = '6_no_priv'; - public const ALL_NO_PRIV = 'all_no_priv'; + const V4_NO_PRIV = '4_no_priv'; + const V6_NO_PRIV = '6_no_priv'; + const ALL_NO_PRIV = 'all_no_priv'; // adds FILTER_FLAG_NO_RES_RANGE flag (skip reserved ranges) - public const V4_NO_RES = '4_no_res'; - public const V6_NO_RES = '6_no_res'; - public const ALL_NO_RES = 'all_no_res'; + const V4_NO_RES = '4_no_res'; + const V6_NO_RES = '6_no_res'; + const ALL_NO_RES = 'all_no_res'; // adds FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE flags (skip both) - public const V4_ONLY_PUBLIC = '4_public'; - public const V6_ONLY_PUBLIC = '6_public'; - public const ALL_ONLY_PUBLIC = 'all_public'; + const V4_ONLY_PUBLIC = '4_public'; + const V6_ONLY_PUBLIC = '6_public'; + const ALL_ONLY_PUBLIC = 'all_public'; - public const INVALID_IP_ERROR = 'b1b427ae-9f6f-41b0-aa9b-84511fbb3c5b'; + const INVALID_IP_ERROR = 'b1b427ae-9f6f-41b0-aa9b-84511fbb3c5b'; - protected static $versions = [ + protected static $versions = array( self::V4, self::V6, self::ALL, @@ -64,41 +62,25 @@ class Ip extends Constraint self::V4_ONLY_PUBLIC, self::V6_ONLY_PUBLIC, self::ALL_ONLY_PUBLIC, - ]; + ); - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_IP_ERROR => 'INVALID_IP_ERROR', - ]; + ); public $version = self::V4; public $message = 'This is not a valid IP address.'; - public $normalizer; - /** * {@inheritdoc} */ - public function __construct( - array $options = null, - string $version = null, - string $message = null, - callable $normalizer = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->version = $version ?? $this->version; - $this->message = $message ?? $this->message; - $this->normalizer = $normalizer ?? $this->normalizer; + public function __construct($options = null) + { + parent::__construct($options); if (!\in_array($this->version, self::$versions)) { - throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s".', implode('", "', self::$versions))); - } - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); + throw new ConstraintDefinitionException(sprintf('The option "version" must be one of "%s"', implode('", "', self::$versions))); } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php index e48d41e6d4b..a27d0e04e50 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IpValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether a value is a valid IP address. @@ -30,7 +30,7 @@ class IpValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Ip) { - throw new UnexpectedTypeException($constraint, Ip::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Ip'); } if (null === $value || '' === $value) { @@ -38,70 +38,73 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - if (null !== $constraint->normalizer) { - $value = ($constraint->normalizer)($value); - } - switch ($constraint->version) { case Ip::V4: - $flag = \FILTER_FLAG_IPV4; + $flag = FILTER_FLAG_IPV4; break; case Ip::V6: - $flag = \FILTER_FLAG_IPV6; + $flag = FILTER_FLAG_IPV6; break; case Ip::V4_NO_PRIV: - $flag = \FILTER_FLAG_IPV4 | \FILTER_FLAG_NO_PRIV_RANGE; + $flag = FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE; break; case Ip::V6_NO_PRIV: - $flag = \FILTER_FLAG_IPV6 | \FILTER_FLAG_NO_PRIV_RANGE; + $flag = FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE; break; case Ip::ALL_NO_PRIV: - $flag = \FILTER_FLAG_NO_PRIV_RANGE; + $flag = FILTER_FLAG_NO_PRIV_RANGE; break; case Ip::V4_NO_RES: - $flag = \FILTER_FLAG_IPV4 | \FILTER_FLAG_NO_RES_RANGE; + $flag = FILTER_FLAG_IPV4 | FILTER_FLAG_NO_RES_RANGE; break; case Ip::V6_NO_RES: - $flag = \FILTER_FLAG_IPV6 | \FILTER_FLAG_NO_RES_RANGE; + $flag = FILTER_FLAG_IPV6 | FILTER_FLAG_NO_RES_RANGE; break; case Ip::ALL_NO_RES: - $flag = \FILTER_FLAG_NO_RES_RANGE; + $flag = FILTER_FLAG_NO_RES_RANGE; break; case Ip::V4_ONLY_PUBLIC: - $flag = \FILTER_FLAG_IPV4 | \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE; + $flag = FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE; break; case Ip::V6_ONLY_PUBLIC: - $flag = \FILTER_FLAG_IPV6 | \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE; + $flag = FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE; break; case Ip::ALL_ONLY_PUBLIC: - $flag = \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE; + $flag = FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE; break; default: - $flag = 0; + $flag = null; break; } - if (!filter_var($value, \FILTER_VALIDATE_IP, $flag)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Ip::INVALID_IP_ERROR) - ->addViolation(); + if (!filter_var($value, FILTER_VALIDATE_IP, $flag)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Ip::INVALID_IP_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Ip::INVALID_IP_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php index 460aafc6d97..8332e1874f5 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalse.php @@ -19,21 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsFalse extends Constraint { - public const NOT_FALSE_ERROR = 'd53a91b0-def3-426a-83d7-269da7ab4200'; + const NOT_FALSE_ERROR = 'd53a91b0-def3-426a-83d7-269da7ab4200'; - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_FALSE_ERROR => 'NOT_FALSE_ERROR', - ]; + ); public $message = 'This value should be false.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options ?? [], $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php index 79c42348fec..ff8e17eebf0 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsFalseValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -26,16 +27,23 @@ class IsFalseValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof IsFalse) { - throw new UnexpectedTypeException($constraint, IsFalse::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\IsFalse'); } if (null === $value || false === $value || 0 === $value || '0' === $value) { return; } - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(IsFalse::NOT_FALSE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsFalse::NOT_FALSE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsFalse::NOT_FALSE_ERROR) + ->addViolation(); + } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php index 2a8439f429b..fdd2930916e 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsNull.php @@ -19,21 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsNull extends Constraint { - public const NOT_NULL_ERROR = '60d2f30b-8cfa-4372-b155-9656634de120'; + const NOT_NULL_ERROR = '60d2f30b-8cfa-4372-b155-9656634de120'; - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_NULL_ERROR => 'NOT_NULL_ERROR', - ]; + ); public $message = 'This value should be null.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options ?? [], $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php index b6e78170f92..6e132c23620 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsNullValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -26,14 +27,21 @@ class IsNullValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof IsNull) { - throw new UnexpectedTypeException($constraint, IsNull::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\IsNull'); } if (null !== $value) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(IsNull::NOT_NULL_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsNull::NOT_NULL_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsNull::NOT_NULL_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php index 7b95475e381..405a96a422d 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrue.php @@ -19,21 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class IsTrue extends Constraint { - public const NOT_TRUE_ERROR = '2beabf1c-54c0-4882-a928-05249b26e23b'; + const NOT_TRUE_ERROR = '2beabf1c-54c0-4882-a928-05249b26e23b'; - protected static $errorNames = [ + protected static $errorNames = array( self::NOT_TRUE_ERROR => 'NOT_TRUE_ERROR', - ]; + ); public $message = 'This value should be true.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options ?? [], $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php index 6088f6d7a7a..5fd5793224d 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsTrueValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -26,7 +27,7 @@ class IsTrueValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof IsTrue) { - throw new UnexpectedTypeException($constraint, IsTrue::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\IsTrue'); } if (null === $value) { @@ -34,10 +35,17 @@ public function validate($value, Constraint $constraint) } if (true !== $value && 1 !== $value && '1' !== $value) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(IsTrue::NOT_TRUE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsTrue::NOT_TRUE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(IsTrue::NOT_TRUE_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php b/upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php index b95dfebca99..f1e83b99ea0 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Isbn.php @@ -21,25 +21,21 @@ * @author Manuel Reinhard * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Isbn extends Constraint { - public const ISBN_10 = 'isbn10'; - public const ISBN_13 = 'isbn13'; + const TOO_SHORT_ERROR = '949acbb0-8ef5-43ed-a0e9-032dfd08ae45'; + const TOO_LONG_ERROR = '3171387d-f80a-47b3-bd6e-60598545316a'; + const INVALID_CHARACTERS_ERROR = '23d21cea-da99-453d-98b1-a7d916fbb339'; + const CHECKSUM_FAILED_ERROR = '2881c032-660f-46b6-8153-d352d9706640'; + const TYPE_NOT_RECOGNIZED_ERROR = 'fa54a457-f042-441f-89c4-066ee5bdd3e1'; - public const TOO_SHORT_ERROR = '949acbb0-8ef5-43ed-a0e9-032dfd08ae45'; - public const TOO_LONG_ERROR = '3171387d-f80a-47b3-bd6e-60598545316a'; - public const INVALID_CHARACTERS_ERROR = '23d21cea-da99-453d-98b1-a7d916fbb339'; - public const CHECKSUM_FAILED_ERROR = '2881c032-660f-46b6-8153-d352d9706640'; - public const TYPE_NOT_RECOGNIZED_ERROR = 'fa54a457-f042-441f-89c4-066ee5bdd3e1'; - - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', self::TYPE_NOT_RECOGNIZED_ERROR => 'TYPE_NOT_RECOGNIZED_ERROR', - ]; + ); public $isbn10Message = 'This value is not a valid ISBN-10.'; public $isbn13Message = 'This value is not a valid ISBN-13.'; @@ -48,33 +44,18 @@ class Isbn extends Constraint public $message; /** - * {@inheritdoc} + * @deprecated since version 2.5, to be removed in 3.0. Use option "type" instead. * - * @param string|array|null $type The ISBN standard to validate or a set of options + * @var bool */ - public function __construct( - $type = null, - string $message = null, - string $isbn10Message = null, - string $isbn13Message = null, - string $bothIsbnMessage = null, - array $groups = null, - $payload = null, - array $options = [] - ) { - if (\is_array($type)) { - $options = array_merge($type, $options); - } elseif (null !== $type) { - $options['value'] = $type; - } + public $isbn10 = false; - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->isbn10Message = $isbn10Message ?? $this->isbn10Message; - $this->isbn13Message = $isbn13Message ?? $this->isbn13Message; - $this->bothIsbnMessage = $bothIsbnMessage ?? $this->bothIsbnMessage; - } + /** + * @deprecated since version 2.5, to be removed in 3.0. Use option "type" instead. + * + * @var bool + */ + public $isbn13 = false; /** * {@inheritdoc} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php index d015a1df7af..838f672a31e 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IsbnValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether the value is a valid ISBN-10 or ISBN-13. @@ -33,7 +33,7 @@ class IsbnValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Isbn) { - throw new UnexpectedTypeException($constraint, Isbn::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Isbn'); } if (null === $value || '' === $value) { @@ -41,31 +41,55 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; $canonical = str_replace('-', '', $value); + if (null === $constraint->type) { + if ($constraint->isbn10 && !$constraint->isbn13) { + @trigger_error('The "isbn10" option of the Isbn constraint is deprecated since Symfony 2.5 and will be removed in 3.0. Use the "type" option instead.', E_USER_DEPRECATED); + $constraint->type = 'isbn10'; + } elseif ($constraint->isbn13 && !$constraint->isbn10) { + @trigger_error('The "isbn13" option of the Isbn constraint is deprecated since Symfony 2.5 and will be removed in 3.0. Use the "type" option instead.', E_USER_DEPRECATED); + $constraint->type = 'isbn13'; + } + } + // Explicitly validate against ISBN-10 - if (Isbn::ISBN_10 === $constraint->type) { + if ('isbn10' === $constraint->type) { if (true !== ($code = $this->validateIsbn10($canonical))) { - $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode($code) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } else { + $this->buildViolation($this->getMessage($constraint, $constraint->type)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } } return; } // Explicitly validate against ISBN-13 - if (Isbn::ISBN_13 === $constraint->type) { + if ('isbn13' === $constraint->type) { if (true !== ($code = $this->validateIsbn13($canonical))) { - $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode($code) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($this->getMessage($constraint, $constraint->type)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } else { + $this->buildViolation($this->getMessage($constraint, $constraint->type)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } } return; @@ -88,14 +112,21 @@ public function validate($value, Constraint $constraint) } if (true !== $code) { - $this->context->buildViolation($this->getMessage($constraint)) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode($code) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($this->getMessage($constraint)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } else { + $this->buildViolation($this->getMessage($constraint)) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode($code) + ->addViolation(); + } } } - protected function validateIsbn10(string $isbn) + protected function validateIsbn10($isbn) { // Choose an algorithm so that ERROR_INVALID_CHARACTERS is preferred // over ERROR_TOO_SHORT/ERROR_TOO_LONG @@ -135,7 +166,7 @@ protected function validateIsbn10(string $isbn) return 0 === $checkSum % 11 ? true : Isbn::CHECKSUM_FAILED_ERROR; } - protected function validateIsbn13(string $isbn) + protected function validateIsbn13($isbn) { // Error priority: // 1. ERROR_INVALID_CHARACTERS @@ -163,19 +194,20 @@ protected function validateIsbn13(string $isbn) } for ($i = 1; $i < 12; $i += 2) { - $checkSum += $isbn[$i] * 3; + $checkSum += $isbn[$i] + * 3; } return 0 === $checkSum % 10 ? true : Isbn::CHECKSUM_FAILED_ERROR; } - protected function getMessage(Isbn $constraint, string $type = null) + protected function getMessage($constraint, $type = null) { if (null !== $constraint->message) { return $constraint->message; - } elseif (Isbn::ISBN_10 === $type) { + } elseif ('isbn10' === $type) { return $constraint->isbn10Message; - } elseif (Isbn::ISBN_13 === $type) { + } elseif ('isbn13' === $type) { return $constraint->isbn13Message; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Isin.php b/upload/system/storage/vendor/symfony/validator/Constraints/Isin.php deleted file mode 100644 index 08fa60d41b9..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Isin.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Laurent Masforné - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Isin extends Constraint -{ - public const VALIDATION_LENGTH = 12; - public const VALIDATION_PATTERN = '/[A-Z]{2}[A-Z0-9]{9}[0-9]{1}/'; - - public const INVALID_LENGTH_ERROR = '88738dfc-9ed5-ba1e-aebe-402a2a9bf58e'; - public const INVALID_PATTERN_ERROR = '3d08ce0-ded9-a93d-9216-17ac21265b65e'; - public const INVALID_CHECKSUM_ERROR = '32089b-0ee1-93ba-399e-aa232e62f2d29d'; - - protected static $errorNames = [ - self::INVALID_LENGTH_ERROR => 'INVALID_LENGTH_ERROR', - self::INVALID_PATTERN_ERROR => 'INVALID_PATTERN_ERROR', - self::INVALID_CHECKSUM_ERROR => 'INVALID_CHECKSUM_ERROR', - ]; - - public $message = 'This value is not a valid International Securities Identification Number (ISIN).'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php deleted file mode 100644 index d5e4d9dbc97..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IsinValidator.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * @author Laurent Masforné - * - * @see https://en.wikipedia.org/wiki/International_Securities_Identification_Number - */ -class IsinValidator extends ConstraintValidator -{ - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Isin) { - throw new UnexpectedTypeException($constraint, Isin::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); - } - - $value = strtoupper($value); - - if (Isin::VALIDATION_LENGTH !== \strlen($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Isin::INVALID_LENGTH_ERROR) - ->addViolation(); - - return; - } - - if (!preg_match(Isin::VALIDATION_PATTERN, $value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Isin::INVALID_PATTERN_ERROR) - ->addViolation(); - - return; - } - - if (!$this->isCorrectChecksum($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Isin::INVALID_CHECKSUM_ERROR) - ->addViolation(); - } - } - - private function isCorrectChecksum(string $input): bool - { - $characters = str_split($input); - foreach ($characters as $i => $char) { - $characters[$i] = \intval($char, 36); - } - $number = implode('', $characters); - - return 0 === $this->context->getValidator()->validate($number, new Luhn())->count(); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Issn.php b/upload/system/storage/vendor/symfony/validator/Constraints/Issn.php index b3b7b21f6c9..a2fecdd35c3 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Issn.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Issn.php @@ -20,41 +20,25 @@ * @author Antonio J. García Lagar * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Issn extends Constraint { - public const TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb'; - public const TOO_LONG_ERROR = '37cef893-5871-464e-8b12-7fb79324833c'; - public const MISSING_HYPHEN_ERROR = '2983286f-8134-4693-957a-1ec4ef887b15'; - public const INVALID_CHARACTERS_ERROR = 'a663d266-37c2-4ece-a914-ae891940c588'; - public const INVALID_CASE_ERROR = '7b6dd393-7523-4a6c-b84d-72b91bba5e1a'; - public const CHECKSUM_FAILED_ERROR = 'b0f92dbc-667c-48de-b526-ad9586d43e85'; - - protected static $errorNames = [ + const TOO_SHORT_ERROR = '6a20dd3d-f463-4460-8e7b-18a1b98abbfb'; + const TOO_LONG_ERROR = '37cef893-5871-464e-8b12-7fb79324833c'; + const MISSING_HYPHEN_ERROR = '2983286f-8134-4693-957a-1ec4ef887b15'; + const INVALID_CHARACTERS_ERROR = 'a663d266-37c2-4ece-a914-ae891940c588'; + const INVALID_CASE_ERROR = '7b6dd393-7523-4a6c-b84d-72b91bba5e1a'; + const CHECKSUM_FAILED_ERROR = 'b0f92dbc-667c-48de-b526-ad9586d43e85'; + + protected static $errorNames = array( self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', self::MISSING_HYPHEN_ERROR => 'MISSING_HYPHEN_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', self::INVALID_CASE_ERROR => 'INVALID_CASE_ERROR', self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', - ]; + ); public $message = 'This value is not a valid ISSN.'; public $caseSensitive = false; public $requireHyphen = false; - - public function __construct( - array $options = null, - string $message = null, - bool $caseSensitive = null, - bool $requireHyphen = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->caseSensitive = $caseSensitive ?? $this->caseSensitive; - $this->requireHyphen = $requireHyphen ?? $this->requireHyphen; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php index aa83201cdab..4413f454f07 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IssnValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether the value is a valid ISSN. @@ -32,7 +32,7 @@ class IssnValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Issn) { - throw new UnexpectedTypeException($constraint, Issn::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Issn'); } if (null === $value || '' === $value) { @@ -40,7 +40,7 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; @@ -52,10 +52,17 @@ public function validate($value, Constraint $constraint) // remove hyphen $canonical = substr($canonical, 0, 4).substr($canonical, 5); } elseif ($constraint->requireHyphen) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Issn::MISSING_HYPHEN_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::MISSING_HYPHEN_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::MISSING_HYPHEN_ERROR) + ->addViolation(); + } return; } @@ -63,19 +70,33 @@ public function validate($value, Constraint $constraint) $length = \strlen($canonical); if ($length < 8) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Issn::TOO_SHORT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::TOO_SHORT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::TOO_SHORT_ERROR) + ->addViolation(); + } return; } if ($length > 8) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Issn::TOO_LONG_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::TOO_LONG_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::TOO_LONG_ERROR) + ->addViolation(); + } return; } @@ -83,10 +104,17 @@ public function validate($value, Constraint $constraint) // 1234567X // ^^^^^^^ digits only if (!ctype_digit(substr($canonical, 0, 7))) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Issn::INVALID_CHARACTERS_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } return; } @@ -94,10 +122,17 @@ public function validate($value, Constraint $constraint) // 1234567X // ^ digit, x or X if (!ctype_digit($canonical[7]) && 'x' !== $canonical[7] && 'X' !== $canonical[7]) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Issn::INVALID_CHARACTERS_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } return; } @@ -105,27 +140,44 @@ public function validate($value, Constraint $constraint) // 1234567X // ^ case-sensitive? if ($constraint->caseSensitive && 'x' === $canonical[7]) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Issn::INVALID_CASE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CASE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::INVALID_CASE_ERROR) + ->addViolation(); + } return; } // Calculate a checksum. "X" equals 10. - $checkSum = 'X' === $canonical[7] || 'x' === $canonical[7] ? 10 : $canonical[7]; + $checkSum = 'X' === $canonical[7] + || 'x' === $canonical[7] + ? 10 + : $canonical[7]; for ($i = 0; $i < 7; ++$i) { // Multiply the first digit by 8, the second by 7, etc. - $checkSum += (8 - $i) * (int) $canonical[$i]; + $checkSum += (8 - $i) * $canonical[$i]; } if (0 !== $checkSum % 11) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Issn::CHECKSUM_FAILED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Issn::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Json.php b/upload/system/storage/vendor/symfony/validator/Constraints/Json.php deleted file mode 100644 index 4388858540b..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Json.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Imad ZAIRIG - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Json extends Constraint -{ - public const INVALID_JSON_ERROR = '0789c8ad-2d2b-49a4-8356-e2ce63998504'; - - protected static $errorNames = [ - self::INVALID_JSON_ERROR => 'INVALID_JSON_ERROR', - ]; - - public $message = 'This value should be valid JSON.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php deleted file mode 100644 index e553ae359b1..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/JsonValidator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; - -/** - * @author Imad ZAIRIG - */ -class JsonValidator extends ConstraintValidator -{ - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Json) { - throw new UnexpectedTypeException($constraint, Json::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedTypeException($value, 'string'); - } - - $value = (string) $value; - - json_decode($value); - - if (\JSON_ERROR_NONE !== json_last_error()) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Json::INVALID_JSON_ERROR) - ->addViolation(); - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Language.php b/upload/system/storage/vendor/symfony/validator/Constraints/Language.php index a8204da718a..0e676b7aabc 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Language.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Language.php @@ -11,9 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Languages; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\LogicException; /** * @Annotation @@ -21,32 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Language extends Constraint { - public const NO_SUCH_LANGUAGE_ERROR = 'ee65fec4-9a20-4202-9f39-ca558cd7bdf7'; + const NO_SUCH_LANGUAGE_ERROR = 'ee65fec4-9a20-4202-9f39-ca558cd7bdf7'; - protected static $errorNames = [ + protected static $errorNames = array( self::NO_SUCH_LANGUAGE_ERROR => 'NO_SUCH_LANGUAGE_ERROR', - ]; + ); public $message = 'This value is not a valid language.'; - public $alpha3 = false; - - public function __construct( - array $options = null, - string $message = null, - bool $alpha3 = null, - array $groups = null, - $payload = null - ) { - if (!class_exists(Languages::class)) { - throw new LogicException('The Intl component is required to use the Language constraint. Try running "composer require symfony/intl".'); - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->alpha3 = $alpha3 ?? $this->alpha3; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php index 911a7133148..fa064385abf 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LanguageValidator.php @@ -11,11 +11,11 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Languages; +use Symfony\Component\Intl\Intl; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether a value is a valid language code. @@ -30,7 +30,7 @@ class LanguageValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Language) { - throw new UnexpectedTypeException($constraint, Language::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Language'); } if (null === $value || '' === $value) { @@ -38,16 +38,24 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - - if ($constraint->alpha3 ? !Languages::alpha3CodeExists($value) : !Languages::exists($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Language::NO_SUCH_LANGUAGE_ERROR) - ->addViolation(); + $languages = Intl::getLanguageBundle()->getLanguageNames(); + + if (!isset($languages[$value])) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Language::NO_SUCH_LANGUAGE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Language::NO_SUCH_LANGUAGE_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Length.php b/upload/system/storage/vendor/symfony/validator/Constraints/Length.php index 29a89a3f3d3..20a17fabca5 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Length.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Length.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Validator\Exception\MissingOptionsException; /** @@ -21,20 +20,17 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Length extends Constraint { - public const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45'; - public const TOO_LONG_ERROR = 'd94b19cc-114f-4f44-9cc4-4138e80a87b9'; - public const NOT_EQUAL_LENGTH_ERROR = '4b6f5c76-22b4-409d-af16-fbe823ba9332'; - public const INVALID_CHARACTERS_ERROR = '35e6a710-aa2e-4719-b58e-24b35749b767'; + const TOO_SHORT_ERROR = '9ff3fdc4-b214-49db-8718-39c315e33d45'; + const TOO_LONG_ERROR = 'd94b19cc-114f-4f44-9cc4-4138e80a87b9'; + const INVALID_CHARACTERS_ERROR = '35e6a710-aa2e-4719-b58e-24b35749b767'; - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', - self::NOT_EQUAL_LENGTH_ERROR => 'NOT_EQUAL_LENGTH_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', - ]; + ); public $maxMessage = 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.'; public $minMessage = 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.'; @@ -43,63 +39,20 @@ class Length extends Constraint public $max; public $min; public $charset = 'UTF-8'; - public $normalizer; - public $allowEmptyString = false; - /** - * {@inheritdoc} - * - * @param int|array|null $exactly The expected exact length or a set of options - */ - public function __construct( - $exactly = null, - int $min = null, - int $max = null, - string $charset = null, - callable $normalizer = null, - string $exactMessage = null, - string $minMessage = null, - string $maxMessage = null, - string $charsetMessage = null, - array $groups = null, - $payload = null, - array $options = [] - ) { - if (\is_array($exactly)) { - $options = array_merge($exactly, $options); - $exactly = $options['value'] ?? null; + public function __construct($options = null) + { + if (null !== $options && !\is_array($options)) { + $options = array( + 'min' => $options, + 'max' => $options, + ); } - $min = $min ?? $options['min'] ?? null; - $max = $max ?? $options['max'] ?? null; - - unset($options['value'], $options['min'], $options['max']); - - if (null !== $exactly && null === $min && null === $max) { - $min = $max = $exactly; - } - - parent::__construct($options, $groups, $payload); - - $this->min = $min; - $this->max = $max; - $this->charset = $charset ?? $this->charset; - $this->normalizer = $normalizer ?? $this->normalizer; - $this->exactMessage = $exactMessage ?? $this->exactMessage; - $this->minMessage = $minMessage ?? $this->minMessage; - $this->maxMessage = $maxMessage ?? $this->maxMessage; - $this->charsetMessage = $charsetMessage ?? $this->charsetMessage; + parent::__construct($options); if (null === $this->min && null === $this->max) { - throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint "%s".', __CLASS__), ['min', 'max']); - } - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); - } - - if (isset($options['allowEmptyString'])) { - trigger_deprecation('symfony/validator', '5.2', sprintf('The "allowEmptyString" option of the "%s" constraint is deprecated.', self::class)); + throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint %s', __CLASS__), array('min', 'max')); } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php index c4bbffeb275..68e94283378 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LengthValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek @@ -27,70 +27,83 @@ class LengthValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Length) { - throw new UnexpectedTypeException($constraint, Length::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Length'); } - if (null === $value || ('' === $value && $constraint->allowEmptyString)) { + if (null === $value || '' === $value) { return; } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $stringValue = (string) $value; - if (null !== $constraint->normalizer) { - $stringValue = ($constraint->normalizer)($stringValue); - } - - try { - $invalidCharset = !@mb_check_encoding($stringValue, $constraint->charset); - } catch (\ValueError $e) { - if (!str_starts_with($e->getMessage(), 'mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding')) { - throw $e; - } - - $invalidCharset = true; + if (!$invalidCharset = !@mb_check_encoding($stringValue, $constraint->charset)) { + $length = mb_strlen($stringValue, $constraint->charset); } if ($invalidCharset) { - $this->context->buildViolation($constraint->charsetMessage) - ->setParameter('{{ value }}', $this->formatValue($stringValue)) - ->setParameter('{{ charset }}', $constraint->charset) - ->setInvalidValue($value) - ->setCode(Length::INVALID_CHARACTERS_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->charsetMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ charset }}', $constraint->charset) + ->setInvalidValue($value) + ->setCode(Length::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->charsetMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ charset }}', $constraint->charset) + ->setInvalidValue($value) + ->setCode(Length::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } return; } - $length = mb_strlen($stringValue, $constraint->charset); - if (null !== $constraint->max && $length > $constraint->max) { - $exactlyOptionEnabled = $constraint->min == $constraint->max; - - $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->maxMessage) - ->setParameter('{{ value }}', $this->formatValue($stringValue)) - ->setParameter('{{ limit }}', $constraint->max) - ->setInvalidValue($value) - ->setPlural((int) $constraint->max) - ->setCode($exactlyOptionEnabled ? Length::NOT_EQUAL_LENGTH_ERROR : Length::TOO_LONG_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->maxMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ limit }}', $constraint->max) + ->setInvalidValue($value) + ->setPlural((int) $constraint->max) + ->setCode(Length::TOO_LONG_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->maxMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ limit }}', $constraint->max) + ->setInvalidValue($value) + ->setPlural((int) $constraint->max) + ->setCode(Length::TOO_LONG_ERROR) + ->addViolation(); + } return; } if (null !== $constraint->min && $length < $constraint->min) { - $exactlyOptionEnabled = $constraint->min == $constraint->max; - - $this->context->buildViolation($exactlyOptionEnabled ? $constraint->exactMessage : $constraint->minMessage) - ->setParameter('{{ value }}', $this->formatValue($stringValue)) - ->setParameter('{{ limit }}', $constraint->min) - ->setInvalidValue($value) - ->setPlural((int) $constraint->min) - ->setCode($exactlyOptionEnabled ? Length::NOT_EQUAL_LENGTH_ERROR : Length::TOO_SHORT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->minMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ limit }}', $constraint->min) + ->setInvalidValue($value) + ->setPlural((int) $constraint->min) + ->setCode(Length::TOO_SHORT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->min == $constraint->max ? $constraint->exactMessage : $constraint->minMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ limit }}', $constraint->min) + ->setInvalidValue($value) + ->setPlural((int) $constraint->min) + ->setCode(Length::TOO_SHORT_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php index acd6c9e66ff..1bbb50878b1 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThan.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class LessThan extends AbstractComparison { - public const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2'; + const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2'; - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', - ]; + ); public $message = 'This value should be less than {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php index 6f728459407..d118942385c 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqual.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class LessThanOrEqual extends AbstractComparison { - public const TOO_HIGH_ERROR = '30fbb013-d015-4232-8b3b-8f3be97a7e14'; + const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2'; - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', - ]; + ); public $message = 'This value should be less than or equal to {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php index f7f4c8be5f3..54281eef5a6 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanOrEqualValidator.php @@ -24,7 +24,7 @@ class LessThanOrEqualValidator extends AbstractComparisonValidator */ protected function compareValues($value1, $value2) { - return null === $value2 || $value1 <= $value2; + return $value1 <= $value2; } /** diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php index 64e107547ac..ef7535fc991 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LessThanValidator.php @@ -24,7 +24,7 @@ class LessThanValidator extends AbstractComparisonValidator */ protected function compareValues($value1, $value2) { - return null === $value2 || $value1 < $value2; + return $value1 < $value2; } /** diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Locale.php b/upload/system/storage/vendor/symfony/validator/Constraints/Locale.php index 43c46cc7b17..5aa7070402e 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Locale.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Locale.php @@ -11,9 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Locales; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\LogicException; /** * @Annotation @@ -21,32 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Locale extends Constraint { - public const NO_SUCH_LOCALE_ERROR = 'a0af4293-1f1a-4a1c-a328-979cba6182a2'; + const NO_SUCH_LOCALE_ERROR = 'a0af4293-1f1a-4a1c-a328-979cba6182a2'; - protected static $errorNames = [ + protected static $errorNames = array( self::NO_SUCH_LOCALE_ERROR => 'NO_SUCH_LOCALE_ERROR', - ]; + ); public $message = 'This value is not a valid locale.'; - public $canonicalize = true; - - public function __construct( - array $options = null, - string $message = null, - bool $canonicalize = null, - array $groups = null, - $payload = null - ) { - if (!class_exists(Locales::class)) { - throw new LogicException('The Intl component is required to use the Locale constraint. Try running "composer require symfony/intl".'); - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->canonicalize = $canonicalize ?? $this->canonicalize; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php index 860273d4f7e..c9763a59117 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LocaleValidator.php @@ -11,11 +11,11 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\Intl\Locales; +use Symfony\Component\Intl\Intl; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether a value is a valid locale code. @@ -30,7 +30,7 @@ class LocaleValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Locale) { - throw new UnexpectedTypeException($constraint, Locale::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Locale'); } if (null === $value || '' === $value) { @@ -38,20 +38,25 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } - $inputValue = (string) $value; - $value = $inputValue; - if ($constraint->canonicalize) { - $value = \Locale::canonicalize($value); - } - - if (!Locales::exists($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($inputValue)) - ->setCode(Locale::NO_SUCH_LOCALE_ERROR) - ->addViolation(); + $value = (string) $value; + $locales = Intl::getLocaleBundle()->getLocaleNames(); + $aliases = Intl::getLocaleBundle()->getAliases(); + + if (!isset($locales[$value]) && !\in_array($value, $aliases)) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Locale::NO_SUCH_LOCALE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Locale::NO_SUCH_LOCALE_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php b/upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php index b2d2c297948..67f152d29dc 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Luhn.php @@ -23,27 +23,15 @@ * @author Greg Knapp http://gregk.me/2011/php-implementation-of-bank-card-luhn-algorithm/ * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Luhn extends Constraint { - public const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e'; - public const CHECKSUM_FAILED_ERROR = '4d760774-3f50-4cd5-a6d5-b10a3299d8d3'; + const INVALID_CHARACTERS_ERROR = 'dfad6d23-1b74-4374-929b-5cbb56fc0d9e'; + const CHECKSUM_FAILED_ERROR = '4d760774-3f50-4cd5-a6d5-b10a3299d8d3'; - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', self::CHECKSUM_FAILED_ERROR => 'CHECKSUM_FAILED_ERROR', - ]; + ); public $message = 'Invalid card number.'; - - public function __construct( - array $options = null, - string $message = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php index 0f568fa6e49..c3fb93d5b95 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/LuhnValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates a PAN using the LUHN Algorithm. @@ -33,14 +33,15 @@ class LuhnValidator extends ConstraintValidator /** * Validates a credit card number with the Luhn algorithm. * - * @param mixed $value + * @param mixed $value + * @param Constraint $constraint * * @throws UnexpectedTypeException when the given credit card number is no string */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof Luhn) { - throw new UnexpectedTypeException($constraint, Luhn::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Luhn'); } if (null === $value || '' === $value) { @@ -50,16 +51,23 @@ public function validate($value, Constraint $constraint) // Work with strings only, because long numbers are represented as floats // internally and don't work with strlen() if (!\is_string($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; if (!ctype_digit($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Luhn::INVALID_CHARACTERS_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Luhn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Luhn::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } return; } @@ -83,14 +91,21 @@ public function validate($value, Constraint $constraint) // ^ ^ ^ ^ ^ // = 1+8 + 4 + 6 + 1+6 + 2 for ($i = $length - 2; $i >= 0; $i -= 2) { - $checkSum += array_sum(str_split((int) $value[$i] * 2)); + $checkSum += array_sum(str_split($value[$i] * 2)); } if (0 === $checkSum || 0 !== $checkSum % 10) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Luhn::CHECKSUM_FAILED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Luhn::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Luhn::CHECKSUM_FAILED_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Negative.php b/upload/system/storage/vendor/symfony/validator/Constraints/Negative.php deleted file mode 100644 index c13ebcb4a8b..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Negative.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Jan Schädlich - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Negative extends LessThan -{ - use ZeroComparisonConstraintTrait; - - public $message = 'This value should be negative.'; -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php b/upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php deleted file mode 100644 index 5be735c312d..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NegativeOrZero.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Jan Schädlich - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class NegativeOrZero extends LessThanOrEqual -{ - use ZeroComparisonConstraintTrait; - - public $message = 'This value should be either negative or zero.'; -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php index 6f98d5a6179..e059f1028a2 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlank.php @@ -12,38 +12,20 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * @Annotation * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) * * @author Bernhard Schussek - * @author Kévin Dunglas */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotBlank extends Constraint { - public const IS_BLANK_ERROR = 'c1051bb4-d103-4f74-8988-acbcafc7fdc3'; + const IS_BLANK_ERROR = 'c1051bb4-d103-4f74-8988-acbcafc7fdc3'; - protected static $errorNames = [ + protected static $errorNames = array( self::IS_BLANK_ERROR => 'IS_BLANK_ERROR', - ]; + ); public $message = 'This value should not be blank.'; - public $allowNull = false; - public $normalizer; - - public function __construct(array $options = null, string $message = null, bool $allowNull = null, callable $normalizer = null, array $groups = null, $payload = null) - { - parent::__construct($options ?? [], $groups, $payload); - - $this->message = $message ?? $this->message; - $this->allowNull = $allowNull ?? $this->allowNull; - $this->normalizer = $normalizer ?? $this->normalizer; - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); - } - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php index 86af06123d7..66550122c35 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotBlankValidator.php @@ -13,11 +13,11 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** * @author Bernhard Schussek - * @author Kévin Dunglas */ class NotBlankValidator extends ConstraintValidator { @@ -27,22 +27,21 @@ class NotBlankValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof NotBlank) { - throw new UnexpectedTypeException($constraint, NotBlank::class); - } - - if ($constraint->allowNull && null === $value) { - return; - } - - if (\is_string($value) && null !== $constraint->normalizer) { - $value = ($constraint->normalizer)($value); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\NotBlank'); } if (false === $value || (empty($value) && '0' != $value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(NotBlank::IS_BLANK_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(NotBlank::IS_BLANK_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(NotBlank::IS_BLANK_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php deleted file mode 100644 index 213bde2f8d4..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPassword.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; - -/** - * Checks if a password has been leaked in a data breach. - * - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Kévin Dunglas - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class NotCompromisedPassword extends Constraint -{ - public const COMPROMISED_PASSWORD_ERROR = 'd9bcdbfe-a9d6-4bfa-a8ff-da5fd93e0f6d'; - - protected static $errorNames = [self::COMPROMISED_PASSWORD_ERROR => 'COMPROMISED_PASSWORD_ERROR']; - - public $message = 'This password has been leaked in a data breach, it must not be used. Please use another password.'; - public $threshold = 1; - public $skipOnError = false; - - public function __construct( - array $options = null, - string $message = null, - int $threshold = null, - bool $skipOnError = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->threshold = $threshold ?? $this->threshold; - $this->skipOnError = $skipOnError ?? $this->skipOnError; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php deleted file mode 100644 index adcdb7a59ff..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotCompromisedPasswordValidator.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\HttpClient\HttpClient; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; -use Symfony\Contracts\HttpClient\Exception\ExceptionInterface; -use Symfony\Contracts\HttpClient\HttpClientInterface; - -/** - * Checks if a password has been leaked in a data breach using haveibeenpwned.com's API. - * Use a k-anonymity model to protect the password being searched for. - * - * @see https://haveibeenpwned.com/API/v2#SearchingPwnedPasswordsByRange - * - * @author Kévin Dunglas - */ -class NotCompromisedPasswordValidator extends ConstraintValidator -{ - private const DEFAULT_API_ENDPOINT = 'https://api.pwnedpasswords.com/range/%s'; - - private $httpClient; - private $charset; - private $enabled; - private $endpoint; - - public function __construct(HttpClientInterface $httpClient = null, string $charset = 'UTF-8', bool $enabled = true, string $endpoint = null) - { - if (null === $httpClient && !class_exists(HttpClient::class)) { - throw new \LogicException(sprintf('The "%s" class requires the "HttpClient" component. Try running "composer require symfony/http-client".', self::class)); - } - - $this->httpClient = $httpClient ?? HttpClient::create(); - $this->charset = $charset; - $this->enabled = $enabled; - $this->endpoint = $endpoint ?? self::DEFAULT_API_ENDPOINT; - } - - /** - * {@inheritdoc} - * - * @throws ExceptionInterface - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof NotCompromisedPassword) { - throw new UnexpectedTypeException($constraint, NotCompromisedPassword::class); - } - - if (!$this->enabled) { - return; - } - - if (null !== $value && !is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); - } - - $value = (string) $value; - if ('' === $value) { - return; - } - - if ('UTF-8' !== $this->charset) { - $value = mb_convert_encoding($value, 'UTF-8', $this->charset); - } - - $hash = strtoupper(sha1($value)); - $hashPrefix = substr($hash, 0, 5); - $url = sprintf($this->endpoint, $hashPrefix); - - try { - $result = $this->httpClient->request('GET', $url)->getContent(); - } catch (ExceptionInterface $e) { - if ($constraint->skipOnError) { - return; - } - - throw $e; - } - - foreach (explode("\r\n", $result) as $line) { - [$hashSuffix, $count] = explode(':', $line); - - if ($hashPrefix.$hashSuffix === $hash && $constraint->threshold <= (int) $count) { - $this->context->buildViolation($constraint->message) - ->setCode(NotCompromisedPassword::COMPROMISED_PASSWORD_ERROR) - ->addViolation(); - - return; - } - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php index 4b2accdf752..8c5abddaee4 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotEqualTo.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotEqualTo extends AbstractComparison { - public const IS_EQUAL_ERROR = 'aa2e33da-25c8-4d76-8c6c-812f02ea89dd'; + const IS_EQUAL_ERROR = 'aa2e33da-25c8-4d76-8c6c-812f02ea89dd'; - protected static $errorNames = [ + protected static $errorNames = array( self::IS_EQUAL_ERROR => 'IS_EQUAL_ERROR', - ]; + ); public $message = 'This value should not be equal to {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php index 82ee014eb6f..4c9c63ea61e 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotIdenticalTo.php @@ -18,14 +18,13 @@ * @author Daniel Holmes * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotIdenticalTo extends AbstractComparison { - public const IS_IDENTICAL_ERROR = '4aaac518-0dda-4129-a6d9-e216b9b454a0'; + const IS_IDENTICAL_ERROR = '4aaac518-0dda-4129-a6d9-e216b9b454a0'; - protected static $errorNames = [ + protected static $errorNames = array( self::IS_IDENTICAL_ERROR => 'IS_IDENTICAL_ERROR', - ]; + ); public $message = 'This value should not be identical to {{ compared_value_type }} {{ compared_value }}.'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php index 85783c70816..1cfc1c80ecc 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotNull.php @@ -19,21 +19,13 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class NotNull extends Constraint { - public const IS_NULL_ERROR = 'ad32d13f-c3d4-423b-909a-857b961eb720'; + const IS_NULL_ERROR = 'ad32d13f-c3d4-423b-909a-857b961eb720'; - protected static $errorNames = [ + protected static $errorNames = array( self::IS_NULL_ERROR => 'IS_NULL_ERROR', - ]; + ); public $message = 'This value should not be null.'; - - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - parent::__construct($options ?? [], $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php index d02fcc43988..0402b3d690f 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NotNullValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -26,14 +27,21 @@ class NotNullValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof NotNull) { - throw new UnexpectedTypeException($constraint, NotNull::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\NotNull'); } if (null === $value) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(NotNull::IS_NULL_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(NotNull::IS_NULL_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(NotNull::IS_NULL_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php b/upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php deleted file mode 100644 index 3229871fff3..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/NumberConstraintTrait.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -trigger_deprecation('symfony/validator', '5.2', '%s is deprecated.', NumberConstraintTrait::class); - -/** - * @author Jan Schädlich - * - * @deprecated since Symfony 5.2 - */ -trait NumberConstraintTrait -{ - private function configureNumberConstraintOptions($options): array - { - if (null === $options) { - $options = []; - } elseif (!\is_array($options)) { - $options = [$this->getDefaultOption() => $options]; - } - - if (isset($options['propertyPath'])) { - throw new ConstraintDefinitionException(sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class)); - } - - if (isset($options['value'])) { - throw new ConstraintDefinitionException(sprintf('The "value" option of the "%s" constraint cannot be set.', static::class)); - } - - $options['value'] = 0; - - return $options; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Positive.php b/upload/system/storage/vendor/symfony/validator/Constraints/Positive.php deleted file mode 100644 index 951e944c9a7..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Positive.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Jan Schädlich - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Positive extends GreaterThan -{ - use ZeroComparisonConstraintTrait; - - public $message = 'This value should be positive.'; -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php b/upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php deleted file mode 100644 index a7669c61070..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/PositiveOrZero.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Jan Schädlich - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class PositiveOrZero extends GreaterThanOrEqual -{ - use ZeroComparisonConstraintTrait; - - public $message = 'This value should be either positive or zero.'; -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Range.php b/upload/system/storage/vendor/symfony/validator/Constraints/Range.php index 906057ebaae..bf050ac58dd 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Range.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Range.php @@ -11,11 +11,7 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\PropertyAccess\PropertyAccess; -use Symfony\Component\PropertyAccess\PropertyPathInterface; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; -use Symfony\Component\Validator\Exception\LogicException; use Symfony\Component\Validator\Exception\MissingOptionsException; /** @@ -24,97 +20,48 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Range extends Constraint { - public const INVALID_CHARACTERS_ERROR = 'ad9a9798-7a99-4df7-8ce9-46e416a1e60b'; - public const NOT_IN_RANGE_ERROR = '04b91c99-a946-4221-afc5-e65ebac401eb'; - public const TOO_HIGH_ERROR = '2d28afcb-e32e-45fb-a815-01c431a86a69'; - public const TOO_LOW_ERROR = '76454e69-502c-46c5-9643-f447d837c4d5'; - - protected static $errorNames = [ - self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', - self::NOT_IN_RANGE_ERROR => 'NOT_IN_RANGE_ERROR', - self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', - self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', - ]; - - public $notInRangeMessage = 'This value should be between {{ min }} and {{ max }}.'; - public $minMessage = 'This value should be {{ limit }} or more.'; - public $maxMessage = 'This value should be {{ limit }} or less.'; - public $invalidMessage = 'This value should be a valid number.'; - public $invalidDateTimeMessage = 'This value should be a valid datetime.'; - public $min; - public $minPropertyPath; - public $max; - public $maxPropertyPath; + const INVALID_CHARACTERS_ERROR = 'ad9a9798-7a99-4df7-8ce9-46e416a1e60b'; + const TOO_HIGH_ERROR = '2d28afcb-e32e-45fb-a815-01c431a86a69'; + const TOO_LOW_ERROR = '76454e69-502c-46c5-9643-f447d837c4d5'; /** - * @internal + * @deprecated Deprecated since version 2.8, to be removed in 3.0. Use + * {@link INVALID_CHARACTERS_ERROR} instead. */ - public $deprecatedMinMessageSet = false; + const INVALID_VALUE_ERROR = self::INVALID_CHARACTERS_ERROR; /** - * @internal + * @deprecated Deprecated since version 2.8, to be removed in 3.0. Use + * {@link TOO_HIGH_ERROR} instead. */ - public $deprecatedMaxMessageSet = false; + const BEYOND_RANGE_ERROR = self::TOO_HIGH_ERROR; /** - * {@inheritdoc} - * - * @param string|PropertyPathInterface|null $minPropertyPath - * @param string|PropertyPathInterface|null $maxPropertyPath + * @deprecated Deprecated since version 2.8, to be removed in 3.0. Use + * {@link TOO_LOW_ERROR} instead. */ - public function __construct( - array $options = null, - string $notInRangeMessage = null, - string $minMessage = null, - string $maxMessage = null, - string $invalidMessage = null, - string $invalidDateTimeMessage = null, - $min = null, - $minPropertyPath = null, - $max = null, - $maxPropertyPath = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->notInRangeMessage = $notInRangeMessage ?? $this->notInRangeMessage; - $this->minMessage = $minMessage ?? $this->minMessage; - $this->maxMessage = $maxMessage ?? $this->maxMessage; - $this->invalidMessage = $invalidMessage ?? $this->invalidMessage; - $this->invalidDateTimeMessage = $invalidDateTimeMessage ?? $this->invalidDateTimeMessage; - $this->min = $min ?? $this->min; - $this->minPropertyPath = $minPropertyPath ?? $this->minPropertyPath; - $this->max = $max ?? $this->max; - $this->maxPropertyPath = $maxPropertyPath ?? $this->maxPropertyPath; - - if (null === $this->min && null === $this->minPropertyPath && null === $this->max && null === $this->maxPropertyPath) { - throw new MissingOptionsException(sprintf('Either option "min", "minPropertyPath", "max" or "maxPropertyPath" must be given for constraint "%s".', __CLASS__), ['min', 'minPropertyPath', 'max', 'maxPropertyPath']); - } + const BELOW_RANGE_ERROR = self::TOO_LOW_ERROR; - if (null !== $this->min && null !== $this->minPropertyPath) { - throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "min" or "minPropertyPath" options to be set, not both.', static::class)); - } - - if (null !== $this->max && null !== $this->maxPropertyPath) { - throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "max" or "maxPropertyPath" options to be set, not both.', static::class)); - } + protected static $errorNames = array( + self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', + self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR', + self::TOO_LOW_ERROR => 'TOO_LOW_ERROR', + ); - if ((null !== $this->minPropertyPath || null !== $this->maxPropertyPath) && !class_exists(PropertyAccess::class)) { - throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option.', static::class)); - } + public $minMessage = 'This value should be {{ limit }} or more.'; + public $maxMessage = 'This value should be {{ limit }} or less.'; + public $invalidMessage = 'This value should be a valid number.'; + public $min; + public $max; - if (null !== $this->min && null !== $this->max) { - $this->deprecatedMinMessageSet = isset($options['minMessage']) || null !== $minMessage; - $this->deprecatedMaxMessageSet = isset($options['maxMessage']) || null !== $maxMessage; + public function __construct($options = null) + { + parent::__construct($options); - // BC layer, should throw a ConstraintDefinitionException in 6.0 - if ($this->deprecatedMinMessageSet || $this->deprecatedMaxMessageSet) { - trigger_deprecation('symfony/validator', '4.4', '"minMessage" and "maxMessage" are deprecated when the "min" and "max" options are both set. Use "notInRangeMessage" instead.'); - } + if (null === $this->min && null === $this->max) { + throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint %s', __CLASS__), array('min', 'max')); } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php index e24cd8746e6..924550aea09 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/RangeValidator.php @@ -11,12 +11,9 @@ namespace Symfony\Component\Validator\Constraints; -use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; -use Symfony\Component\PropertyAccess\PropertyAccess; -use Symfony\Component\PropertyAccess\PropertyAccessorInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -24,37 +21,27 @@ */ class RangeValidator extends ConstraintValidator { - private $propertyAccessor; - - public function __construct(PropertyAccessorInterface $propertyAccessor = null) - { - $this->propertyAccessor = $propertyAccessor; - } - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof Range) { - throw new UnexpectedTypeException($constraint, Range::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Range'); } if (null === $value) { return; } - $min = $this->getLimit($constraint->minPropertyPath, $constraint->min, $constraint); - $max = $this->getLimit($constraint->maxPropertyPath, $constraint->max, $constraint); - - if (!is_numeric($value) && !$value instanceof \DateTimeInterface) { - if ($this->isParsableDatetimeString($min) && $this->isParsableDatetimeString($max)) { - $this->context->buildViolation($constraint->invalidDateTimeMessage) + if (!is_numeric($value) && !$value instanceof \DateTime && !$value instanceof \DateTimeInterface) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->invalidMessage) ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) ->setCode(Range::INVALID_CHARACTERS_ERROR) ->addViolation(); } else { - $this->context->buildViolation($constraint->invalidMessage) + $this->buildViolation($constraint->invalidMessage) ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) ->setCode(Range::INVALID_CHARACTERS_ERROR) ->addViolation(); @@ -63,149 +50,55 @@ public function validate($value, Constraint $constraint) return; } + $min = $constraint->min; + $max = $constraint->max; + // Convert strings to DateTimes if comparing another DateTime // This allows to compare with any date/time value supported by // the DateTime constructor: - // https://php.net/datetime.formats - if ($value instanceof \DateTimeInterface) { - $dateTimeClass = null; - + // http://php.net/manual/en/datetime.formats.php + if ($value instanceof \DateTime || $value instanceof \DateTimeInterface) { if (\is_string($min)) { - $dateTimeClass = $value instanceof \DateTimeImmutable ? \DateTimeImmutable::class : \DateTime::class; - - try { - $min = new $dateTimeClass($min); - } catch (\Exception $e) { - throw new ConstraintDefinitionException(sprintf('The min value "%s" could not be converted to a "%s" instance in the "%s" constraint.', $min, $dateTimeClass, get_debug_type($constraint))); - } + $min = new \DateTime($min); } if (\is_string($max)) { - $dateTimeClass = $dateTimeClass ?: ($value instanceof \DateTimeImmutable ? \DateTimeImmutable::class : \DateTime::class); - - try { - $max = new $dateTimeClass($max); - } catch (\Exception $e) { - throw new ConstraintDefinitionException(sprintf('The max value "%s" could not be converted to a "%s" instance in the "%s" constraint.', $max, $dateTimeClass, get_debug_type($constraint))); - } + $max = new \DateTime($max); } } - $hasLowerLimit = null !== $min; - $hasUpperLimit = null !== $max; - - if ($hasLowerLimit && $hasUpperLimit && ($value < $min || $value > $max)) { - $message = $constraint->notInRangeMessage; - $code = Range::NOT_IN_RANGE_ERROR; - - if ($value < $min && $constraint->deprecatedMinMessageSet) { - $message = $constraint->minMessage; - $code = Range::TOO_LOW_ERROR; - } - - if ($value > $max && $constraint->deprecatedMaxMessageSet) { - $message = $constraint->maxMessage; - $code = Range::TOO_HIGH_ERROR; - } - - $violationBuilder = $this->context->buildViolation($message) - ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) - ->setParameter('{{ min }}', $this->formatValue($min, self::PRETTY_DATE)) - ->setParameter('{{ max }}', $this->formatValue($max, self::PRETTY_DATE)) - ->setCode($code); - - if (null !== $constraint->maxPropertyPath) { - $violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath); - } - - if (null !== $constraint->minPropertyPath) { - $violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath); - } - - $violationBuilder->addViolation(); - - return; - } - - if ($hasUpperLimit && $value > $max) { - $violationBuilder = $this->context->buildViolation($constraint->maxMessage) - ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) - ->setParameter('{{ limit }}', $this->formatValue($max, self::PRETTY_DATE)) - ->setCode(Range::TOO_HIGH_ERROR); - - if (null !== $constraint->maxPropertyPath) { - $violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath); - } - - if (null !== $constraint->minPropertyPath) { - $violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath); + if (null !== $constraint->max && $value > $max) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->maxMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setParameter('{{ limit }}', $this->formatValue($max, self::PRETTY_DATE)) + ->setCode(Range::TOO_HIGH_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->maxMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setParameter('{{ limit }}', $this->formatValue($max, self::PRETTY_DATE)) + ->setCode(Range::TOO_HIGH_ERROR) + ->addViolation(); } - $violationBuilder->addViolation(); - return; } - if ($hasLowerLimit && $value < $min) { - $violationBuilder = $this->context->buildViolation($constraint->minMessage) - ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) - ->setParameter('{{ limit }}', $this->formatValue($min, self::PRETTY_DATE)) - ->setCode(Range::TOO_LOW_ERROR); - - if (null !== $constraint->maxPropertyPath) { - $violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath); - } - - if (null !== $constraint->minPropertyPath) { - $violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath); + if (null !== $constraint->min && $value < $min) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->minMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setParameter('{{ limit }}', $this->formatValue($min, self::PRETTY_DATE)) + ->setCode(Range::TOO_LOW_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->minMessage) + ->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE)) + ->setParameter('{{ limit }}', $this->formatValue($min, self::PRETTY_DATE)) + ->setCode(Range::TOO_LOW_ERROR) + ->addViolation(); } - - $violationBuilder->addViolation(); - } - } - - private function getLimit(?string $propertyPath, $default, Constraint $constraint) - { - if (null === $propertyPath) { - return $default; - } - - if (null === $object = $this->context->getObject()) { - return $default; } - - try { - return $this->getPropertyAccessor()->getValue($object, $propertyPath); - } catch (NoSuchPropertyException $e) { - throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: ', $propertyPath, get_debug_type($constraint)).$e->getMessage(), 0, $e); - } - } - - private function getPropertyAccessor(): PropertyAccessorInterface - { - if (null === $this->propertyAccessor) { - $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); - } - - return $this->propertyAccessor; - } - - private function isParsableDatetimeString($boundary): bool - { - if (null === $boundary) { - return true; - } - - if (!\is_string($boundary)) { - return false; - } - - try { - new \DateTime($boundary); - } catch (\Exception $e) { - return false; - } - - return true; } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Regex.php b/upload/system/storage/vendor/symfony/validator/Constraints/Regex.php index 63bbd8d4c1f..cb122102259 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Regex.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Regex.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * @Annotation @@ -20,53 +19,18 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Regex extends Constraint { - public const REGEX_FAILED_ERROR = 'de1e3db3-5ed4-4941-aae4-59f3667cc3a3'; + const REGEX_FAILED_ERROR = 'de1e3db3-5ed4-4941-aae4-59f3667cc3a3'; - protected static $errorNames = [ + protected static $errorNames = array( self::REGEX_FAILED_ERROR => 'REGEX_FAILED_ERROR', - ]; + ); public $message = 'This value is not valid.'; public $pattern; public $htmlPattern; public $match = true; - public $normalizer; - - /** - * {@inheritdoc} - * - * @param string|array $pattern The pattern to evaluate or an array of options - */ - public function __construct( - $pattern, - string $message = null, - string $htmlPattern = null, - bool $match = null, - callable $normalizer = null, - array $groups = null, - $payload = null, - array $options = [] - ) { - if (\is_array($pattern)) { - $options = array_merge($pattern, $options); - } elseif (null !== $pattern) { - $options['value'] = $pattern; - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->htmlPattern = $htmlPattern ?? $this->htmlPattern; - $this->match = $match ?? $this->match; - $this->normalizer = $normalizer ?? $this->normalizer; - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); - } - } /** * {@inheritdoc} @@ -81,7 +45,7 @@ public function getDefaultOption() */ public function getRequiredOptions() { - return ['pattern']; + return array('pattern'); } /** @@ -89,6 +53,9 @@ public function getRequiredOptions() * Example: /^[a-z]+$/ would be converted to [a-z]+ * However, if options are specified, it cannot be converted. * + * Pattern is also ignored if match=false since the pattern should + * then be reversed before application. + * * @see http://dev.w3.org/html5/spec/single-page.html#the-pattern-attribute * * @return string|null @@ -104,7 +71,7 @@ public function getHtmlPattern() // Quit if delimiters not at very beginning/end (e.g. when options are passed) if ($this->pattern[0] !== $this->pattern[\strlen($this->pattern) - 1]) { - return null; + return; } $delimiter = $this->pattern[0]; @@ -112,7 +79,7 @@ public function getHtmlPattern() // Unescape the delimiter $pattern = str_replace('\\'.$delimiter, $delimiter, substr($this->pattern, 1, -1)); - // If the pattern is inverted, we can wrap it in + // If the pattern is inverted, we can simply wrap it in // ((?!pattern).)* if (!$this->match) { return '((?!'.$pattern.').)*'; @@ -120,7 +87,7 @@ public function getHtmlPattern() // If the pattern contains an or statement, wrap the pattern in // .*(pattern).* and quit. Otherwise we'd need to parse the pattern - if (str_contains($pattern, '|')) { + if (false !== strpos($pattern, '|')) { return '.*('.$pattern.').*'; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php index 7fadf7682b0..07f1c5aa041 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/RegexValidator.php @@ -13,8 +13,8 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether a value match or not given regexp pattern. @@ -30,7 +30,7 @@ class RegexValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Regex) { - throw new UnexpectedTypeException($constraint, Regex::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Regex'); } if (null === $value || '' === $value) { @@ -38,20 +38,23 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - if (null !== $constraint->normalizer) { - $value = ($constraint->normalizer)($value); - } - if ($constraint->match xor preg_match($constraint->pattern, $value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Regex::REGEX_FAILED_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Regex::REGEX_FAILED_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Regex::REGEX_FAILED_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php b/upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php deleted file mode 100644 index 36a801a4e28..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Sequentially.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -/** - * Use this constraint to sequentially validate nested constraints. - * Validation for the nested constraints collection will stop at first violation. - * - * @Annotation - * @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Maxime Steinhausser - */ -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Sequentially extends Composite -{ - public $constraints = []; - - public function __construct($constraints = null, array $groups = null, $payload = null) - { - parent::__construct($constraints ?? [], $groups, $payload); - } - - public function getDefaultOption() - { - return 'constraints'; - } - - public function getRequiredOptions() - { - return ['constraints']; - } - - protected function getCompositeOption() - { - return 'constraints'; - } - - public function getTargets() - { - return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT]; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php deleted file mode 100644 index 434d2aba22f..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/SequentiallyValidator.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; - -/** - * @author Maxime Steinhausser - */ -class SequentiallyValidator extends ConstraintValidator -{ - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Sequentially) { - throw new UnexpectedTypeException($constraint, Sequentially::class); - } - - $context = $this->context; - - $validator = $context->getValidator()->inContext($context); - - $originalCount = $validator->getViolations()->count(); - - foreach ($constraint->constraints as $c) { - if ($originalCount !== $validator->validate($value, $c)->getViolations()->count()) { - break; - } - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Time.php b/upload/system/storage/vendor/symfony/validator/Constraints/Time.php index 366d6237666..6bd8dbda2e2 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Time.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Time.php @@ -19,27 +19,15 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Time extends Constraint { - public const INVALID_FORMAT_ERROR = '9d27b2bb-f755-4fbf-b725-39b1edbdebdf'; - public const INVALID_TIME_ERROR = '8532f9e1-84b2-4d67-8989-0818bc38533b'; + const INVALID_FORMAT_ERROR = '9d27b2bb-f755-4fbf-b725-39b1edbdebdf'; + const INVALID_TIME_ERROR = '8532f9e1-84b2-4d67-8989-0818bc38533b'; - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_FORMAT_ERROR => 'INVALID_FORMAT_ERROR', self::INVALID_TIME_ERROR => 'INVALID_TIME_ERROR', - ]; + ); public $message = 'This value is not a valid time.'; - - public function __construct( - array $options = null, - string $message = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php index 5a71e4439c7..97f188dfc08 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/TimeValidator.php @@ -13,22 +13,28 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek */ class TimeValidator extends ConstraintValidator { - public const PATTERN = '/^(\d{2}):(\d{2}):(\d{2})$/'; + const PATTERN = '/^(\d{2}):(\d{2}):(\d{2})$/'; /** * Checks whether a time is valid. * + * @param int $hour The hour + * @param int $minute The minute + * @param int $second The second + * + * @return bool Whether the time is valid + * * @internal */ - public static function checkTime(int $hour, int $minute, float $second): bool + public static function checkTime($hour, $minute, $second) { return $hour >= 0 && $hour < 24 && $minute >= 0 && $minute < 60 && $second >= 0 && $second < 60; } @@ -39,33 +45,47 @@ public static function checkTime(int $hour, int $minute, float $second): bool public function validate($value, Constraint $constraint) { if (!$constraint instanceof Time) { - throw new UnexpectedTypeException($constraint, Time::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Time'); } - if (null === $value || '' === $value) { + if (null === $value || '' === $value || $value instanceof \DateTime) { return; } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; if (!preg_match(static::PATTERN, $value, $matches)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Time::INVALID_FORMAT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Time::INVALID_FORMAT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Time::INVALID_FORMAT_ERROR) + ->addViolation(); + } return; } if (!self::checkTime($matches[1], $matches[2], $matches[3])) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Time::INVALID_TIME_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Time::INVALID_TIME_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Time::INVALID_TIME_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php b/upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php deleted file mode 100644 index 409fbc1d12b..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Timezone.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Javier Spagnoletti - * @author Hugo Hamon - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Timezone extends Constraint -{ - public const TIMEZONE_IDENTIFIER_ERROR = '5ce113e6-5e64-4ea2-90fe-d2233956db13'; - public const TIMEZONE_IDENTIFIER_IN_ZONE_ERROR = 'b57767b1-36c0-40ac-a3d7-629420c775b8'; - public const TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR = 'c4a22222-dc92-4fc0-abb0-d95b268c7d0b'; - public const TIMEZONE_IDENTIFIER_INTL_ERROR = '45863c26-88dc-41ba-bf53-c73bd1f7e90d'; - - public $zone = \DateTimeZone::ALL; - public $countryCode; - public $intlCompatible = false; - public $message = 'This value is not a valid timezone.'; - - protected static $errorNames = [ - self::TIMEZONE_IDENTIFIER_ERROR => 'TIMEZONE_IDENTIFIER_ERROR', - self::TIMEZONE_IDENTIFIER_IN_ZONE_ERROR => 'TIMEZONE_IDENTIFIER_IN_ZONE_ERROR', - self::TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR => 'TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR', - self::TIMEZONE_IDENTIFIER_INTL_ERROR => 'TIMEZONE_IDENTIFIER_INTL_ERROR', - ]; - - /** - * {@inheritdoc} - * - * @param int|array|null $zone A combination of {@see \DateTimeZone} class constants or a set of options - */ - public function __construct( - $zone = null, - string $message = null, - string $countryCode = null, - bool $intlCompatible = null, - array $groups = null, - $payload = null, - array $options = [] - ) { - if (\is_array($zone)) { - $options = array_merge($zone, $options); - } elseif (null !== $zone) { - $options['value'] = $zone; - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->countryCode = $countryCode ?? $this->countryCode; - $this->intlCompatible = $intlCompatible ?? $this->intlCompatible; - - if (null === $this->countryCode) { - if (0 >= $this->zone || \DateTimeZone::ALL_WITH_BC < $this->zone) { - throw new ConstraintDefinitionException('The option "zone" must be a valid range of "\DateTimeZone" constants.'); - } - } elseif (\DateTimeZone::PER_COUNTRY !== (\DateTimeZone::PER_COUNTRY & $this->zone)) { - throw new ConstraintDefinitionException('The option "countryCode" can only be used when the "zone" option is configured with "\DateTimeZone::PER_COUNTRY".'); - } - if ($this->intlCompatible && !class_exists(\IntlTimeZone::class)) { - throw new ConstraintDefinitionException('The option "intlCompatible" can only be used when the PHP intl extension is available.'); - } - } - - /** - * {@inheritdoc} - */ - public function getDefaultOption() - { - return 'zone'; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php deleted file mode 100644 index ab6b4eed626..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/TimezoneValidator.php +++ /dev/null @@ -1,124 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Intl\Exception\MissingResourceException; -use Symfony\Component\Intl\Timezones; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * Validates whether a value is a valid timezone identifier. - * - * @author Javier Spagnoletti - * @author Hugo Hamon - */ -class TimezoneValidator extends ConstraintValidator -{ - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Timezone) { - throw new UnexpectedTypeException($constraint, Timezone::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); - } - - $value = (string) $value; - - if ($constraint->intlCompatible && 'Etc/Unknown' === \IntlTimeZone::createTimeZone($value)->getID()) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Timezone::TIMEZONE_IDENTIFIER_INTL_ERROR) - ->addViolation(); - - return; - } - - if ( - \in_array($value, self::getPhpTimezones($constraint->zone, $constraint->countryCode), true) || - \in_array($value, self::getIntlTimezones($constraint->zone, $constraint->countryCode), true) - ) { - return; - } - - if ($constraint->countryCode) { - $code = Timezone::TIMEZONE_IDENTIFIER_IN_COUNTRY_ERROR; - } elseif (\DateTimeZone::ALL !== $constraint->zone) { - $code = Timezone::TIMEZONE_IDENTIFIER_IN_ZONE_ERROR; - } else { - $code = Timezone::TIMEZONE_IDENTIFIER_ERROR; - } - - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode($code) - ->addViolation(); - } - - private static function getPhpTimezones(int $zone, string $countryCode = null): array - { - if (null !== $countryCode) { - try { - return @\DateTimeZone::listIdentifiers($zone, $countryCode) ?: []; - } catch (\ValueError $e) { - return []; - } - } - - return \DateTimeZone::listIdentifiers($zone); - } - - private static function getIntlTimezones(int $zone, string $countryCode = null): array - { - if (!class_exists(Timezones::class)) { - return []; - } - - if (null !== $countryCode) { - try { - return Timezones::forCountryCode($countryCode); - } catch (MissingResourceException $e) { - return []; - } - } - - $timezones = Timezones::getIds(); - - if (\DateTimeZone::ALL === (\DateTimeZone::ALL & $zone)) { - return $timezones; - } - - $filtered = []; - foreach ((new \ReflectionClass(\DateTimeZone::class))->getConstants() as $const => $flag) { - if ($flag !== ($flag & $zone)) { - continue; - } - - $filtered[] = array_filter($timezones, static function ($id) use ($const) { - return 0 === stripos($id, $const.'/'); - }); - } - - return $filtered ? array_merge(...$filtered) : []; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php b/upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php index fe6527dae3a..4572c9b2193 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Traverse.php @@ -19,21 +19,17 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_CLASS)] class Traverse extends Constraint { public $traverse = true; - /** - * @param bool|array|null $traverse - */ - public function __construct($traverse = null) + public function __construct($options = null) { - if (\is_array($traverse) && \array_key_exists('groups', $traverse)) { - throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint "%s".', __CLASS__)); + if (\is_array($options) && array_key_exists('groups', $options)) { + throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint %s', __CLASS__)); } - parent::__construct($traverse); + parent::__construct($options); } /** diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Type.php b/upload/system/storage/vendor/symfony/validator/Constraints/Type.php index 220c2191a3c..e40b47820d6 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Type.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Type.php @@ -19,36 +19,17 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Type extends Constraint { - public const INVALID_TYPE_ERROR = 'ba785a8c-82cb-4283-967c-3cf342181b40'; + const INVALID_TYPE_ERROR = 'ba785a8c-82cb-4283-967c-3cf342181b40'; - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_TYPE_ERROR => 'INVALID_TYPE_ERROR', - ]; + ); public $message = 'This value should be of type {{ type }}.'; public $type; - /** - * {@inheritdoc} - * - * @param string|array $type One ore multiple types to validate against or a set of options - */ - public function __construct($type, string $message = null, array $groups = null, $payload = null, array $options = []) - { - if (\is_array($type) && \is_string(key($type))) { - $options = array_merge($type, $options); - } elseif (null !== $type) { - $options['value'] = $type; - } - - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } - /** * {@inheritdoc} */ @@ -62,6 +43,6 @@ public function getDefaultOption() */ public function getRequiredOptions() { - return ['type']; + return array('type'); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php index 0a938c6d95a..d69c5d394b7 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/TypeValidator.php @@ -13,6 +13,7 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -20,68 +21,44 @@ */ class TypeValidator extends ConstraintValidator { - private const VALIDATION_FUNCTIONS = [ - 'bool' => 'is_bool', - 'boolean' => 'is_bool', - 'int' => 'is_int', - 'integer' => 'is_int', - 'long' => 'is_int', - 'float' => 'is_float', - 'double' => 'is_float', - 'real' => 'is_float', - 'numeric' => 'is_numeric', - 'string' => 'is_string', - 'scalar' => 'is_scalar', - 'array' => 'is_array', - 'iterable' => 'is_iterable', - 'countable' => 'is_countable', - 'callable' => 'is_callable', - 'object' => 'is_object', - 'resource' => 'is_resource', - 'null' => 'is_null', - 'alnum' => 'ctype_alnum', - 'alpha' => 'ctype_alpha', - 'cntrl' => 'ctype_cntrl', - 'digit' => 'ctype_digit', - 'graph' => 'ctype_graph', - 'lower' => 'ctype_lower', - 'print' => 'ctype_print', - 'punct' => 'ctype_punct', - 'space' => 'ctype_space', - 'upper' => 'ctype_upper', - 'xdigit' => 'ctype_xdigit', - ]; - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof Type) { - throw new UnexpectedTypeException($constraint, Type::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Type'); } if (null === $value) { return; } - $types = (array) $constraint->type; - - foreach ($types as $type) { - $type = strtolower($type); - if (isset(self::VALIDATION_FUNCTIONS[$type]) && self::VALIDATION_FUNCTIONS[$type]($value)) { - return; - } + $type = strtolower($constraint->type); + $type = 'boolean' == $type ? 'bool' : $constraint->type; + $isFunction = 'is_'.$type; + $ctypeFunction = 'ctype_'.$type; - if ($value instanceof $type) { - return; - } + if (\function_exists($isFunction) && $isFunction($value)) { + return; + } elseif (\function_exists($ctypeFunction) && $ctypeFunction($value)) { + return; + } elseif ($value instanceof $constraint->type) { + return; } - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setParameter('{{ type }}', implode('|', $types)) - ->setCode(Type::INVALID_TYPE_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ type }}', $constraint->type) + ->setCode(Type::INVALID_TYPE_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setParameter('{{ type }}', $constraint->type) + ->setCode(Type::INVALID_TYPE_ERROR) + ->addViolation(); + } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php b/upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php deleted file mode 100644 index d1644b8b34b..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Ulid.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; - -/** - * @Annotation - * - * @author Laurent Clouet - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Ulid extends Constraint -{ - public const TOO_SHORT_ERROR = '7b44804e-37d5-4df4-9bdd-b738d4a45bb4'; - public const TOO_LONG_ERROR = '9608249f-6da1-4d53-889e-9864b58c4d37'; - public const INVALID_CHARACTERS_ERROR = 'e4155739-5135-4258-9c81-ae7b44b5311e'; - public const TOO_LARGE_ERROR = 'df8cfb9a-ce6d-4a69-ae5a-eea7ab6f278b'; - - protected static $errorNames = [ - self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', - self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', - self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', - self::TOO_LARGE_ERROR => 'TOO_LARGE_ERROR', - ]; - - public $message = 'This is not a valid ULID.'; - - public function __construct( - array $options = null, - string $message = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php deleted file mode 100644 index 45f85b852d2..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/UlidValidator.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * Validates whether the value is a valid ULID (Universally Unique Lexicographically Sortable Identifier). - * Cf https://github.com/ulid/spec for ULID specifications. - * - * @author Laurent Clouet - */ -class UlidValidator extends ConstraintValidator -{ - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Ulid) { - throw new UnexpectedTypeException($constraint, Ulid::class); - } - - if (null === $value || '' === $value) { - return; - } - - if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); - } - - $value = (string) $value; - - if (26 !== \strlen($value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(26 > \strlen($value) ? Ulid::TOO_SHORT_ERROR : Ulid::TOO_LONG_ERROR) - ->addViolation(); - } - - if (\strlen($value) !== strspn($value, '0123456789ABCDEFGHJKMNPQRSTVWXYZabcdefghjkmnpqrstvwxyz')) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Ulid::INVALID_CHARACTERS_ERROR) - ->addViolation(); - } - - // Largest valid ULID is '7ZZZZZZZZZZZZZZZZZZZZZZZZZ' - // Cf https://github.com/ulid/spec#overflow-errors-when-parsing-base32-strings - if ($value[0] > '7') { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Ulid::TOO_LARGE_ERROR) - ->addViolation(); - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Unique.php b/upload/system/storage/vendor/symfony/validator/Constraints/Unique.php deleted file mode 100644 index 6280e9771fd..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Unique.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; - -/** - * @Annotation - * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) - * - * @author Yevgeniy Zholkevskiy - */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] -class Unique extends Constraint -{ - public const IS_NOT_UNIQUE = '7911c98d-b845-4da0-94b7-a8dac36bc55a'; - - protected static $errorNames = [ - self::IS_NOT_UNIQUE => 'IS_NOT_UNIQUE', - ]; - - public $message = 'This collection should contain only unique elements.'; - public $normalizer; - - public function __construct( - array $options = null, - string $message = null, - callable $normalizer = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->normalizer = $normalizer ?? $this->normalizer; - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php deleted file mode 100644 index 2758a3faa11..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/UniqueValidator.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; - -/** - * @author Yevgeniy Zholkevskiy - */ -class UniqueValidator extends ConstraintValidator -{ - /** - * {@inheritdoc} - */ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Unique) { - throw new UnexpectedTypeException($constraint, Unique::class); - } - - if (null === $value) { - return; - } - - if (!\is_array($value) && !$value instanceof \IteratorAggregate) { - throw new UnexpectedValueException($value, 'array|IteratorAggregate'); - } - - $collectionElements = []; - $normalizer = $this->getNormalizer($constraint); - foreach ($value as $element) { - $element = $normalizer($element); - - if (\in_array($element, $collectionElements, true)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Unique::IS_NOT_UNIQUE) - ->addViolation(); - - return; - } - $collectionElements[] = $element; - } - } - - private function getNormalizer(Unique $unique): callable - { - if (null === $unique->normalizer) { - return static function ($value) { - return $value; - }; - } - - return $unique->normalizer; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Url.php b/upload/system/storage/vendor/symfony/validator/Constraints/Url.php index 23cd77cad60..8453a902081 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Url.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Url.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * @Annotation @@ -20,38 +19,16 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Url extends Constraint { - public const INVALID_URL_ERROR = '57c2f299-1154-4870-89bb-ef3b1f5ad229'; + const INVALID_URL_ERROR = '57c2f299-1154-4870-89bb-ef3b1f5ad229'; - protected static $errorNames = [ + protected static $errorNames = array( self::INVALID_URL_ERROR => 'INVALID_URL_ERROR', - ]; + ); public $message = 'This value is not a valid URL.'; - public $protocols = ['http', 'https']; - public $relativeProtocol = false; - public $normalizer; - - public function __construct( - array $options = null, - string $message = null, - array $protocols = null, - bool $relativeProtocol = null, - callable $normalizer = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->protocols = $protocols ?? $this->protocols; - $this->relativeProtocol = $relativeProtocol ?? $this->relativeProtocol; - $this->normalizer = $normalizer ?? $this->normalizer; - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); - } - } + public $dnsMessage = 'The host could not be resolved.'; + public $protocols = array('http', 'https'); + public $checkDNS = false; } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php index a72eac6aae2..4527ab2d6b5 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/UrlValidator.php @@ -13,25 +13,19 @@ use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * @author Bernhard Schussek */ class UrlValidator extends ConstraintValidator { - public const PATTERN = '~^ + const PATTERN = '~^ (%s):// # protocol - (((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%%[0-9A-Fa-f]{2})+)@)? # basic auth + (([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth ( - (?: - (?:xn--[a-z0-9-]++\.)*+xn--[a-z0-9-]++ # a domain name using punycode - | - (?:[\pL\pN\pS\pM\-\_]++\.)+[\pL\pN\pM]++ # a multi-level domain name - | - [a-z0-9\-\_]++ # a single-level domain name - )\.? + ([\pL\pN\pS\-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name | # or \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address | # or @@ -40,9 +34,9 @@ class UrlValidator extends ConstraintValidator \] # an IPv6 address ) (:[0-9]+)? # a port (optional) - (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path - (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional) - (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional) + (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path + (?:\? (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional) + (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional) $~ixu'; /** @@ -51,7 +45,7 @@ class UrlValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Url) { - throw new UnexpectedTypeException($constraint, Url::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url'); } if (null === $value || '' === $value) { @@ -59,7 +53,7 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; @@ -67,20 +61,40 @@ public function validate($value, Constraint $constraint) return; } - if (null !== $constraint->normalizer) { - $value = ($constraint->normalizer)($value); - } - - $pattern = $constraint->relativeProtocol ? str_replace('(%s):', '(?:(%s):)?', static::PATTERN) : static::PATTERN; - $pattern = sprintf($pattern, implode('|', $constraint->protocols)); + $pattern = sprintf(static::PATTERN, implode('|', $constraint->protocols)); if (!preg_match($pattern, $value)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Url::INVALID_URL_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Url::INVALID_URL_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Url::INVALID_URL_ERROR) + ->addViolation(); + } return; } + + if ($constraint->checkDNS) { + $host = parse_url($value, PHP_URL_HOST); + + if (!\is_string($host) || !checkdnsrr($host, 'ANY')) { + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->dnsMessage) + ->setParameter('{{ value }}', $this->formatValue($host)) + ->setCode(Url::INVALID_URL_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->dnsMessage) + ->setParameter('{{ value }}', $this->formatValue($host)) + ->setCode(Url::INVALID_URL_ERROR) + ->addViolation(); + } + } + } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php b/upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php index 84f83f896fc..2deecbadd61 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Uuid.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Exception\InvalidArgumentException; /** * @Annotation @@ -20,41 +19,30 @@ * @author Colin O'Dell * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Uuid extends Constraint { - public const TOO_SHORT_ERROR = 'aa314679-dac9-4f54-bf97-b2049df8f2a3'; - public const TOO_LONG_ERROR = '494897dd-36f8-4d31-8923-71a8d5f3000d'; - public const INVALID_CHARACTERS_ERROR = '51120b12-a2bc-41bf-aa53-cd73daf330d0'; - public const INVALID_HYPHEN_PLACEMENT_ERROR = '98469c83-0309-4f5d-bf95-a496dcaa869c'; - public const INVALID_VERSION_ERROR = '21ba13b4-b185-4882-ac6f-d147355987eb'; - public const INVALID_VARIANT_ERROR = '164ef693-2b9d-46de-ad7f-836201f0c2db'; + const TOO_SHORT_ERROR = 'aa314679-dac9-4f54-bf97-b2049df8f2a3'; + const TOO_LONG_ERROR = '494897dd-36f8-4d31-8923-71a8d5f3000d'; + const INVALID_CHARACTERS_ERROR = '51120b12-a2bc-41bf-aa53-cd73daf330d0'; + const INVALID_HYPHEN_PLACEMENT_ERROR = '98469c83-0309-4f5d-bf95-a496dcaa869c'; + const INVALID_VERSION_ERROR = '21ba13b4-b185-4882-ac6f-d147355987eb'; + const INVALID_VARIANT_ERROR = '164ef693-2b9d-46de-ad7f-836201f0c2db'; - protected static $errorNames = [ + protected static $errorNames = array( self::TOO_SHORT_ERROR => 'TOO_SHORT_ERROR', self::TOO_LONG_ERROR => 'TOO_LONG_ERROR', self::INVALID_CHARACTERS_ERROR => 'INVALID_CHARACTERS_ERROR', self::INVALID_HYPHEN_PLACEMENT_ERROR => 'INVALID_HYPHEN_PLACEMENT_ERROR', self::INVALID_VERSION_ERROR => 'INVALID_VERSION_ERROR', self::INVALID_VARIANT_ERROR => 'INVALID_VARIANT_ERROR', - ]; + ); // Possible versions defined by RFC 4122 - public const V1_MAC = 1; - public const V2_DCE = 2; - public const V3_MD5 = 3; - public const V4_RANDOM = 4; - public const V5_SHA1 = 5; - public const V6_SORTABLE = 6; - - public const ALL_VERSIONS = [ - self::V1_MAC, - self::V2_DCE, - self::V3_MD5, - self::V4_RANDOM, - self::V5_SHA1, - self::V6_SORTABLE, - ]; + const V1_MAC = 1; + const V2_DCE = 2; + const V3_MD5 = 3; + const V4_RANDOM = 4; + const V5_SHA1 = 5; /** * Message to display when validation fails. @@ -79,33 +67,11 @@ class Uuid extends Constraint * * @var int[] */ - public $versions = self::ALL_VERSIONS; - - public $normalizer; - - /** - * {@inheritdoc} - * - * @param int[]|null $versions - */ - public function __construct( - array $options = null, - string $message = null, - array $versions = null, - bool $strict = null, - callable $normalizer = null, - array $groups = null, - $payload = null - ) { - parent::__construct($options, $groups, $payload); - - $this->message = $message ?? $this->message; - $this->versions = $versions ?? $this->versions; - $this->strict = $strict ?? $this->strict; - $this->normalizer = $normalizer ?? $this->normalizer; - - if (null !== $this->normalizer && !\is_callable($this->normalizer)) { - throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer))); - } - } + public $versions = array( + self::V1_MAC, + self::V2_DCE, + self::V3_MD5, + self::V4_RANDOM, + self::V5_SHA1, + ); } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php index 06629667848..8e2e5da3347 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/UuidValidator.php @@ -12,9 +12,10 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Deprecated\UuidValidator as Deprecated; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; /** * Validates whether the value is a valid UUID (also known as GUID). @@ -22,11 +23,14 @@ * Strict validation will allow a UUID as specified per RFC 4122. * Loose validation will allow any type of UUID. * + * For better compatibility, both loose and strict, you should consider using a specialized UUID library like "ramsey/uuid" instead. + * * @author Colin O'Dell * @author Bernhard Schussek * * @see http://tools.ietf.org/html/rfc4122 * @see https://en.wikipedia.org/wiki/Universally_unique_identifier + * @see https://github.com/ramsey/uuid */ class UuidValidator extends ConstraintValidator { @@ -35,14 +39,14 @@ class UuidValidator extends ConstraintValidator // Roughly speaking: // x = any hexadecimal character - // M = any allowed version {1..6} + // M = any allowed version {1..5} // N = any allowed variant {8, 9, a, b} - public const STRICT_LENGTH = 36; - public const STRICT_FIRST_HYPHEN_POSITION = 8; - public const STRICT_LAST_HYPHEN_POSITION = 23; - public const STRICT_VERSION_POSITION = 14; - public const STRICT_VARIANT_POSITION = 19; + const STRICT_LENGTH = 36; + const STRICT_FIRST_HYPHEN_POSITION = 8; + const STRICT_LAST_HYPHEN_POSITION = 23; + const STRICT_VERSION_POSITION = 14; + const STRICT_VARIANT_POSITION = 19; // The loose pattern validates similar yet non-compliant UUIDs. // Hyphens are completely optional. If present, they should only appear @@ -56,8 +60,23 @@ class UuidValidator extends ConstraintValidator // Neither the version nor the variant is validated by this pattern. - public const LOOSE_MAX_LENGTH = 39; - public const LOOSE_FIRST_HYPHEN_POSITION = 4; + const LOOSE_MAX_LENGTH = 39; + const LOOSE_FIRST_HYPHEN_POSITION = 4; + + /** + * @deprecated since version 2.6, to be removed in 3.0 + */ + const STRICT_PATTERN = '/^[a-f0-9]{8}-[a-f0-9]{4}-[%s][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/i'; + + /** + * @deprecated since version 2.6, to be removed in 3.0 + */ + const LOOSE_PATTERN = '/^[a-f0-9]{4}(?:-?[a-f0-9]{4}){7}$/i'; + + /** + * @deprecated since version 2.6, to be removed in 3.0 + */ + const STRICT_UUID_LENGTH = 36; /** * {@inheritdoc} @@ -65,7 +84,7 @@ class UuidValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { if (!$constraint instanceof Uuid) { - throw new UnexpectedTypeException($constraint, Uuid::class); + throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Uuid'); } if (null === $value || '' === $value) { @@ -73,15 +92,11 @@ public function validate($value, Constraint $constraint) } if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) { - throw new UnexpectedValueException($value, 'string'); + throw new UnexpectedTypeException($value, 'string'); } $value = (string) $value; - if (null !== $constraint->normalizer) { - $value = ($constraint->normalizer)($value); - } - if ($constraint->strict) { $this->validateStrict($value, $constraint); @@ -91,7 +106,7 @@ public function validate($value, Constraint $constraint) $this->validateLoose($value, $constraint); } - private function validateLoose(string $value, Uuid $constraint) + private function validateLoose($value, Uuid $constraint) { // Error priority: // 1. ERROR_INVALID_CHARACTERS @@ -110,10 +125,17 @@ private function validateLoose(string $value, Uuid $constraint) for ($i = 0; $i < $l; ++$i) { // Check length if (!isset($trimmed[$i])) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::TOO_SHORT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_SHORT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_SHORT_ERROR) + ->addViolation(); + } return; } @@ -123,10 +145,17 @@ private function validateLoose(string $value, Uuid $constraint) // ^ ^ ^ ^ ^ ^ ^ if ('-' === $trimmed[$i]) { if ($i !== $h) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + } return; } @@ -144,10 +173,17 @@ private function validateLoose(string $value, Uuid $constraint) // Check characters if (!ctype_xdigit($trimmed[$i])) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::INVALID_CHARACTERS_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } return; } @@ -155,14 +191,21 @@ private function validateLoose(string $value, Uuid $constraint) // Check length again if (isset($trimmed[$i])) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::TOO_LONG_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_LONG_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_LONG_ERROR) + ->addViolation(); + } } } - private function validateStrict(string $value, Uuid $constraint) + private function validateStrict($value, Uuid $constraint) { // Error priority: // 1. ERROR_INVALID_CHARACTERS @@ -177,10 +220,17 @@ private function validateStrict(string $value, Uuid $constraint) for ($i = 0; $i < self::STRICT_LENGTH; ++$i) { // Check length if (!isset($value[$i])) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::TOO_SHORT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_SHORT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_SHORT_ERROR) + ->addViolation(); + } return; } @@ -190,10 +240,17 @@ private function validateStrict(string $value, Uuid $constraint) // ^ ^ ^ ^ if ('-' === $value[$i]) { if ($i !== $h) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + } return; } @@ -209,20 +266,34 @@ private function validateStrict(string $value, Uuid $constraint) // Check characters if (!ctype_xdigit($value[$i])) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::INVALID_CHARACTERS_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_CHARACTERS_ERROR) + ->addViolation(); + } return; } // Missing hyphen if ($i === $h) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR) + ->addViolation(); + } return; } @@ -230,18 +301,32 @@ private function validateStrict(string $value, Uuid $constraint) // Check length again if (isset($value[$i])) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::TOO_LONG_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_LONG_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::TOO_LONG_ERROR) + ->addViolation(); + } } // Check version if (!\in_array($value[self::STRICT_VERSION_POSITION], $constraint->versions)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::INVALID_VERSION_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_VERSION_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_VERSION_ERROR) + ->addViolation(); + } } // Check variant - first two bits must equal "10" @@ -249,10 +334,17 @@ private function validateStrict(string $value, Uuid $constraint) // & 0b1100 (12) // = 0b1000 (8) if (8 !== (hexdec($value[self::STRICT_VARIANT_POSITION]) & 12)) { - $this->context->buildViolation($constraint->message) - ->setParameter('{{ value }}', $this->formatValue($value)) - ->setCode(Uuid::INVALID_VARIANT_ERROR) - ->addViolation(); + if ($this->context instanceof ExecutionContextInterface) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_VARIANT_ERROR) + ->addViolation(); + } else { + $this->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Uuid::INVALID_VARIANT_ERROR) + ->addViolation(); + } } } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Valid.php b/upload/system/storage/vendor/symfony/validator/Constraints/Valid.php index 9ee69fdd47b..35a8edcc0e5 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/Valid.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Valid.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; /** * @Annotation @@ -19,28 +20,25 @@ * * @author Bernhard Schussek */ -#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Valid extends Constraint { public $traverse = true; - public function __get(string $option) - { - if ('groups' === $option) { - // when this is reached, no groups have been configured - return null; - } - - return parent::__get($option); - } - /** - * {@inheritdoc} + * @deprecated since version 2.5, to be removed in Symfony 3.0. */ - public function addImplicitGroupName(string $group) + public $deep = true; + + public function __construct($options = null) { - if (null !== $this->groups) { - parent::addImplicitGroupName($group); + if (\is_array($options) && array_key_exists('groups', $options)) { + throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint %s', __CLASS__)); + } + + if (\is_array($options) && array_key_exists('deep', $options)) { + @trigger_error('The "deep" option for the Valid constraint is deprecated since Symfony 2.5 and will be removed in 3.0. When traversing arrays, nested arrays are always traversed. When traversing nested objects, their traversal strategy is used.', E_USER_DEPRECATED); } + + parent::__construct($options); } } diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php deleted file mode 100644 index 85eabb80ae8..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/ValidValidator.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintValidator; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; - -/** - * @author Christian Flothmann - */ -class ValidValidator extends ConstraintValidator -{ - public function validate($value, Constraint $constraint) - { - if (!$constraint instanceof Valid) { - throw new UnexpectedTypeException($constraint, Valid::class); - } - - if (null === $value) { - return; - } - - $this->context - ->getValidator() - ->inContext($this->context) - ->validate($value, null, $this->context->getGroup()); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php b/upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php deleted file mode 100644 index b65fcf206a6..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Constraints/ZeroComparisonConstraintTrait.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Constraints; - -use Symfony\Component\Validator\Exception\ConstraintDefinitionException; - -/** - * @internal - * - * @author Jan Schädlich - * @author Alexander M. Turek - */ -trait ZeroComparisonConstraintTrait -{ - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) - { - if (null === $options) { - $options = []; - } - - if (isset($options['propertyPath'])) { - throw new ConstraintDefinitionException(sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class)); - } - - if (isset($options['value'])) { - throw new ConstraintDefinitionException(sprintf('The "value" option of the "%s" constraint cannot be set.', static::class)); - } - - parent::__construct(0, null, $message, $groups, $payload, $options); - } - - public function validatedBy(): string - { - return parent::class.'Validator'; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php b/upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php deleted file mode 100644 index 0b5baed4b9a..00000000000 --- a/upload/system/storage/vendor/symfony/validator/ContainerConstraintValidatorFactory.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator; - -use Psr\Container\ContainerInterface; -use Symfony\Component\Validator\Exception\UnexpectedTypeException; -use Symfony\Component\Validator\Exception\ValidatorException; - -/** - * Uses a service container to create constraint validators. - * - * @author Kris Wallsmith - */ -class ContainerConstraintValidatorFactory implements ConstraintValidatorFactoryInterface -{ - private $container; - private $validators; - - public function __construct(ContainerInterface $container) - { - $this->container = $container; - $this->validators = []; - } - - /** - * {@inheritdoc} - * - * @throws ValidatorException When the validator class does not exist - * @throws UnexpectedTypeException When the validator is not an instance of ConstraintValidatorInterface - */ - public function getInstance(Constraint $constraint) - { - $name = $constraint->validatedBy(); - - if (!isset($this->validators[$name])) { - if ($this->container->has($name)) { - $this->validators[$name] = $this->container->get($name); - } else { - if (!class_exists($name)) { - throw new ValidatorException(sprintf('Constraint validator "%s" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "%s".', $name, get_debug_type($constraint))); - } - - $this->validators[$name] = new $name(); - } - } - - if (!$this->validators[$name] instanceof ConstraintValidatorInterface) { - throw new UnexpectedTypeException($this->validators[$name], ConstraintValidatorInterface::class); - } - - return $this->validators[$name]; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php index c640da36320..165c5725b40 100644 --- a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContext.php @@ -11,20 +11,18 @@ namespace Symfony\Component\Validator\Context; +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\ClassBasedInterface; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; -use Symfony\Component\Validator\ConstraintViolationListInterface; -use Symfony\Component\Validator\Mapping\ClassMetadataInterface; -use Symfony\Component\Validator\Mapping\MemberMetadata; use Symfony\Component\Validator\Mapping\MetadataInterface; use Symfony\Component\Validator\Mapping\PropertyMetadataInterface; use Symfony\Component\Validator\Util\PropertyPath; -use Symfony\Component\Validator\Validator\LazyProperty; use Symfony\Component\Validator\Validator\ValidatorInterface; +use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface; use Symfony\Component\Validator\Violation\ConstraintViolationBuilder; -use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; -use Symfony\Contracts\Translation\TranslatorInterface; /** * The context used and created by {@link ExecutionContextFactory}. @@ -33,7 +31,8 @@ * * @see ExecutionContextInterface * - * @internal since version 2.5. Code against ExecutionContextInterface instead. + * @internal You should not instantiate or use this class. Code against + * {@link ExecutionContextInterface} instead. */ class ExecutionContext implements ExecutionContextInterface { @@ -55,7 +54,7 @@ class ExecutionContext implements ExecutionContextInterface private $translator; /** - * @var string|null + * @var string */ private $translationDomain; @@ -111,59 +110,62 @@ class ExecutionContext implements ExecutionContextInterface /** * Stores which objects have been validated in which group. * - * @var bool[][] + * @var array */ - private $validatedObjects = []; + private $validatedObjects = array(); /** * Stores which class constraint has been validated for which object. * - * @var bool[] + * @var array */ - private $validatedConstraints = []; + private $validatedConstraints = array(); /** * Stores which objects have been initialized. * - * @var bool[] + * @var array */ private $initializedObjects; /** - * @var \SplObjectStorage - */ - private $cachedObjectsRefs; - - /** - * @param mixed $root The root value of the validated object graph + * Creates a new execution context. + * + * @param ValidatorInterface $validator The validator + * @param mixed $root The root value of the + * validated object graph + * @param TranslatorInterface $translator The translator + * @param string|null $translationDomain The translation domain to + * use for translating + * violation messages * - * @internal Called by {@link ExecutionContextFactory}. Should not be used in user code. + * @internal Called by {@link ExecutionContextFactory}. Should not be used + * in user code. */ - public function __construct(ValidatorInterface $validator, $root, TranslatorInterface $translator, string $translationDomain = null) + public function __construct(ValidatorInterface $validator, $root, TranslatorInterface $translator, $translationDomain = null) { $this->validator = $validator; $this->root = $root; $this->translator = $translator; $this->translationDomain = $translationDomain; $this->violations = new ConstraintViolationList(); - $this->cachedObjectsRefs = new \SplObjectStorage(); } /** * {@inheritdoc} */ - public function setNode($value, ?object $object, MetadataInterface $metadata = null, string $propertyPath) + public function setNode($value, $object, MetadataInterface $metadata = null, $propertyPath) { $this->value = $value; $this->object = $object; $this->metadata = $metadata; - $this->propertyPath = $propertyPath; + $this->propertyPath = (string) $propertyPath; } /** * {@inheritdoc} */ - public function setGroup(?string $group) + public function setGroup($group) { $this->group = $group; } @@ -179,15 +181,32 @@ public function setConstraint(Constraint $constraint) /** * {@inheritdoc} */ - public function addViolation(string $message, array $parameters = []) + public function addViolation($message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null) { + // The parameters $invalidValue and following are ignored by the new + // API, as they are not present in the new interface anymore. + // You should use buildViolation() instead. + if (\func_num_args() > 2) { + @trigger_error('The parameters $invalidValue, $plural and $code in method '.__METHOD__.' are deprecated since Symfony 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::buildViolation method instead.', E_USER_DEPRECATED); + + $this + ->buildViolation($message, $parameters) + ->setInvalidValue($invalidValue) + ->setPlural($plural) + ->setCode($code) + ->addViolation() + ; + + return; + } + $this->violations->add(new ConstraintViolation( $this->translator->trans($message, $parameters, $this->translationDomain), $message, $parameters, $this->root, $this->propertyPath, - $this->getValue(), + $this->value, null, null, $this->constraint @@ -197,7 +216,7 @@ public function addViolation(string $message, array $parameters = []) /** * {@inheritdoc} */ - public function buildViolation(string $message, array $parameters = []): ConstraintViolationBuilderInterface + public function buildViolation($message, array $parameters = array()) { return new ConstraintViolationBuilder( $this->violations, @@ -206,7 +225,7 @@ public function buildViolation(string $message, array $parameters = []): Constra $parameters, $this->root, $this->propertyPath, - $this->getValue(), + $this->value, $this->translator, $this->translationDomain ); @@ -215,7 +234,7 @@ public function buildViolation(string $message, array $parameters = []): Constra /** * {@inheritdoc} */ - public function getViolations(): ConstraintViolationListInterface + public function getViolations() { return $this->violations; } @@ -223,7 +242,7 @@ public function getViolations(): ConstraintViolationListInterface /** * {@inheritdoc} */ - public function getValidator(): ValidatorInterface + public function getValidator() { return $this->validator; } @@ -241,10 +260,6 @@ public function getRoot() */ public function getValue() { - if ($this->value instanceof LazyProperty) { - return $this->value->getPropertyValue(); - } - return $this->value; } @@ -259,7 +274,7 @@ public function getObject() /** * {@inheritdoc} */ - public function getMetadata(): ?MetadataInterface + public function getMetadata() { return $this->metadata; } @@ -267,12 +282,12 @@ public function getMetadata(): ?MetadataInterface /** * {@inheritdoc} */ - public function getGroup(): ?string + public function getGroup() { return $this->group; } - public function getConstraint(): ?Constraint + public function getConstraint() { return $this->constraint; } @@ -280,15 +295,15 @@ public function getConstraint(): ?Constraint /** * {@inheritdoc} */ - public function getClassName(): ?string + public function getClassName() { - return $this->metadata instanceof MemberMetadata || $this->metadata instanceof ClassMetadataInterface ? $this->metadata->getClassName() : null; + return $this->metadata instanceof ClassBasedInterface ? $this->metadata->getClassName() : null; } /** * {@inheritdoc} */ - public function getPropertyName(): ?string + public function getPropertyName() { return $this->metadata instanceof PropertyMetadataInterface ? $this->metadata->getPropertyName() : null; } @@ -296,7 +311,7 @@ public function getPropertyName(): ?string /** * {@inheritdoc} */ - public function getPropertyPath(string $subPath = ''): string + public function getPropertyPath($subPath = '') { return PropertyPath::append($this->propertyPath, $subPath); } @@ -304,69 +319,149 @@ public function getPropertyPath(string $subPath = ''): string /** * {@inheritdoc} */ - public function markGroupAsValidated(string $cacheKey, string $groupHash) + public function addViolationAt($subPath, $message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null) { - if (!isset($this->validatedObjects[$cacheKey])) { - $this->validatedObjects[$cacheKey] = []; + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::buildViolation method instead.', E_USER_DEPRECATED); + + if (\func_num_args() > 2) { + $this + ->buildViolation($message, $parameters) + ->atPath($subPath) + ->setInvalidValue($invalidValue) + ->setPlural($plural) + ->setCode($code) + ->addViolation() + ; + + return; } - $this->validatedObjects[$cacheKey][$groupHash] = true; + $this + ->buildViolation($message, $parameters) + ->atPath($subPath) + ->addViolation() + ; } /** * {@inheritdoc} */ - public function isGroupValidated(string $cacheKey, string $groupHash): bool + public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false) { - return isset($this->validatedObjects[$cacheKey][$groupHash]); + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator() method instead.', E_USER_DEPRECATED); + + if (\is_array($value)) { + // The $traverse flag is ignored for arrays + $constraint = new Valid(array('traverse' => true, 'deep' => $deep)); + + return $this + ->getValidator() + ->inContext($this) + ->atPath($subPath) + ->validate($value, $constraint, $groups) + ; + } + + if ($traverse && $value instanceof \Traversable) { + $constraint = new Valid(array('traverse' => true, 'deep' => $deep)); + + return $this + ->getValidator() + ->inContext($this) + ->atPath($subPath) + ->validate($value, $constraint, $groups) + ; + } + + return $this + ->getValidator() + ->inContext($this) + ->atPath($subPath) + ->validate($value, null, $groups) + ; } /** * {@inheritdoc} */ - public function markConstraintAsValidated(string $cacheKey, string $constraintHash) + public function validateValue($value, $constraints, $subPath = '', $groups = null) { - $this->validatedConstraints[$cacheKey.':'.$constraintHash] = true; + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator() method instead.', E_USER_DEPRECATED); + + return $this + ->getValidator() + ->inContext($this) + ->atPath($subPath) + ->validate($value, $constraints, $groups) + ; } /** * {@inheritdoc} */ - public function isConstraintValidated(string $cacheKey, string $constraintHash): bool + public function getMetadataFactory() { - return isset($this->validatedConstraints[$cacheKey.':'.$constraintHash]); + @trigger_error('The '.__METHOD__.' is deprecated since Symfony 2.5 and will be removed in 3.0. Use the new Symfony\Component\Validator\Context\ExecutionContext::getValidator method in combination with Symfony\Component\Validator\Validator\ValidatorInterface::getMetadataFor or Symfony\Component\Validator\Validator\ValidatorInterface::hasMetadataFor method instead.', E_USER_DEPRECATED); + + $validator = $this->getValidator(); + + if ($validator instanceof LegacyValidatorInterface) { + return $validator->getMetadataFactory(); + } + + // The ValidatorInterface extends from the deprecated MetadataFactoryInterface, so return it when we don't have the factory instance itself + return $validator; } /** * {@inheritdoc} */ - public function markObjectAsInitialized(string $cacheKey) + public function markGroupAsValidated($cacheKey, $groupHash) { - $this->initializedObjects[$cacheKey] = true; + if (!isset($this->validatedObjects[$cacheKey])) { + $this->validatedObjects[$cacheKey] = array(); + } + + $this->validatedObjects[$cacheKey][$groupHash] = true; } /** * {@inheritdoc} */ - public function isObjectInitialized(string $cacheKey): bool + public function isGroupValidated($cacheKey, $groupHash) { - return isset($this->initializedObjects[$cacheKey]); + return isset($this->validatedObjects[$cacheKey][$groupHash]); } /** - * @internal + * {@inheritdoc} */ - public function generateCacheKey(object $object): string + public function markConstraintAsValidated($cacheKey, $constraintHash) { - if (!isset($this->cachedObjectsRefs[$object])) { - $this->cachedObjectsRefs[$object] = spl_object_hash($object); - } + $this->validatedConstraints[$cacheKey.':'.$constraintHash] = true; + } - return $this->cachedObjectsRefs[$object]; + /** + * {@inheritdoc} + */ + public function isConstraintValidated($cacheKey, $constraintHash) + { + return isset($this->validatedConstraints[$cacheKey.':'.$constraintHash]); + } + + /** + * {@inheritdoc} + */ + public function markObjectAsInitialized($cacheKey) + { + $this->initializedObjects[$cacheKey] = true; } - public function __clone() + /** + * {@inheritdoc} + */ + public function isObjectInitialized($cacheKey) { - $this->violations = clone $this->violations; + return isset($this->initializedObjects[$cacheKey]); } } diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php index 623bd16eedf..cbd99354432 100644 --- a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactory.php @@ -11,22 +11,31 @@ namespace Symfony\Component\Validator\Context; +use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; -use Symfony\Contracts\Translation\TranslatorInterface; /** * Creates new {@link ExecutionContext} instances. * * @author Bernhard Schussek * - * @internal version 2.5. Code against ExecutionContextFactoryInterface instead. + * @internal You should not instantiate or use this class. Code against + * {@link ExecutionContextFactoryInterface} instead. */ class ExecutionContextFactory implements ExecutionContextFactoryInterface { private $translator; private $translationDomain; - public function __construct(TranslatorInterface $translator, string $translationDomain = null) + /** + * Creates a new context factory. + * + * @param TranslatorInterface $translator The translator + * @param string|null $translationDomain The translation domain to + * use for translating + * violation messages + */ + public function __construct(TranslatorInterface $translator, $translationDomain = null) { $this->translator = $translator; $this->translationDomain = $translationDomain; diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php index a300086ce6b..f3ab3dd68a7 100644 --- a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextFactoryInterface.php @@ -26,10 +26,11 @@ interface ExecutionContextFactoryInterface /** * Creates a new execution context. * - * @param mixed $root The root value of the validated - * object graph + * @param ValidatorInterface $validator The validator + * @param mixed $root The root value of the validated + * object graph * - * @return ExecutionContextInterface + * @return ExecutionContextInterface The new execution context */ public function createContext(ValidatorInterface $validator, $root); } diff --git a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php index 093aa71740a..548a4db1c15 100644 --- a/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Context/ExecutionContextInterface.php @@ -12,8 +12,7 @@ namespace Symfony\Component\Validator\Context; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\ConstraintViolationListInterface; -use Symfony\Component\Validator\Mapping; +use Symfony\Component\Validator\ExecutionContextInterface as LegacyExecutionContextInterface; use Symfony\Component\Validator\Mapping\MetadataInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface; @@ -59,16 +58,8 @@ * * @author Bernhard Schussek */ -interface ExecutionContextInterface +interface ExecutionContextInterface extends LegacyExecutionContextInterface { - /** - * Adds a violation at the current node of the validation graph. - * - * @param string|\Stringable $message The error message as a string or a stringable object - * @param array $params The parameters substituted in the error message - */ - public function addViolation(string $message, array $params = []); - /** * Returns a builder for adding a violation with extended information. * @@ -76,17 +67,17 @@ public function addViolation(string $message, array $params = []); * add the violation when you're done with the configuration: * * $context->buildViolation('Please enter a number between %min% and %max%.') - * ->setParameter('%min%', '3') - * ->setParameter('%max%', '10') + * ->setParameter('%min%', 3) + * ->setParameter('%max%', 10) * ->setTranslationDomain('number_validation') * ->addViolation(); * - * @param string|\Stringable $message The error message as a string or a stringable object - * @param array $parameters The parameters substituted in the error message + * @param string $message The error message + * @param array $parameters The parameters substituted in the error message * - * @return ConstraintViolationBuilderInterface + * @return ConstraintViolationBuilderInterface The violation builder */ - public function buildViolation(string $message, array $parameters = []); + public function buildViolation($message, array $parameters = array()); /** * Returns the validator. @@ -97,7 +88,7 @@ public function buildViolation(string $message, array $parameters = []); * { * $validator = $this->context->getValidator(); * - * $violations = $validator->validate($value, new Length(['min' => 3])); + * $violations = $validator->validate($value, new Length(array('min' => 3))); * * if (count($violations) > 0) { * // ... @@ -112,27 +103,28 @@ public function getValidator(); * Returns the currently validated object. * * If the validator is currently validating a class constraint, the - * object of that class is returned. If it is validating a property or + * object of that class is returned. If it is a validating a property or * getter constraint, the object that the property/getter belongs to is * returned. * * In other cases, null is returned. * - * @return object|null + * @return object|null The currently validated object or null */ public function getObject(); /** * Sets the currently validated value. * - * @param mixed $value The validated value - * @param object|null $object The currently validated object - * @param string $propertyPath The property path to the current value + * @param mixed $value The validated value + * @param object|null $object The currently validated object + * @param MetadataInterface|null $metadata The validation metadata + * @param string $propertyPath The property path to the current value * * @internal Used by the validator engine. Should not be called by user * code. */ - public function setNode($value, ?object $object, MetadataInterface $metadata = null, string $propertyPath); + public function setNode($value, $object, MetadataInterface $metadata = null, $propertyPath); /** * Sets the currently validated group. @@ -142,11 +134,13 @@ public function setNode($value, ?object $object, MetadataInterface $metadata = n * @internal Used by the validator engine. Should not be called by user * code. */ - public function setGroup(?string $group); + public function setGroup($group); /** * Sets the currently validated constraint. * + * @param Constraint $constraint The validated constraint + * * @internal Used by the validator engine. Should not be called by user * code. */ @@ -162,7 +156,7 @@ public function setConstraint(Constraint $constraint); * @internal Used by the validator engine. Should not be called by user * code. */ - public function markGroupAsValidated(string $cacheKey, string $groupHash); + public function markGroupAsValidated($cacheKey, $groupHash); /** * Returns whether an object was validated in a specific validation group. @@ -171,12 +165,13 @@ public function markGroupAsValidated(string $cacheKey, string $groupHash); * @param string $groupHash The group's name or hash, if it is group * sequence * - * @return bool + * @return bool Whether the object was already validated for that + * group * * @internal Used by the validator engine. Should not be called by user * code. */ - public function isGroupValidated(string $cacheKey, string $groupHash); + public function isGroupValidated($cacheKey, $groupHash); /** * Marks a constraint as validated for an object. @@ -187,7 +182,7 @@ public function isGroupValidated(string $cacheKey, string $groupHash); * @internal Used by the validator engine. Should not be called by user * code. */ - public function markConstraintAsValidated(string $cacheKey, string $constraintHash); + public function markConstraintAsValidated($cacheKey, $constraintHash); /** * Returns whether a constraint was validated for an object. @@ -195,12 +190,12 @@ public function markConstraintAsValidated(string $cacheKey, string $constraintHa * @param string $cacheKey The hash of the object * @param string $constraintHash The hash of the constraint * - * @return bool + * @return bool Whether the constraint was already validated * * @internal Used by the validator engine. Should not be called by user * code. */ - public function isConstraintValidated(string $cacheKey, string $constraintHash); + public function isConstraintValidated($cacheKey, $constraintHash); /** * Marks that an object was initialized. @@ -212,128 +207,19 @@ public function isConstraintValidated(string $cacheKey, string $constraintHash); * * @see ObjectInitializerInterface */ - public function markObjectAsInitialized(string $cacheKey); + public function markObjectAsInitialized($cacheKey); /** * Returns whether an object was initialized. * * @param string $cacheKey The hash of the object * - * @return bool + * @return bool Whether the object was already initialized * * @internal Used by the validator engine. Should not be called by user * code. * * @see ObjectInitializerInterface */ - public function isObjectInitialized(string $cacheKey); - - /** - * Returns the violations generated by the validator so far. - * - * @return ConstraintViolationListInterface - */ - public function getViolations(); - - /** - * Returns the value at which validation was started in the object graph. - * - * The validator, when given an object, traverses the properties and - * related objects and their properties. The root of the validation is the - * object from which the traversal started. - * - * The current value is returned by {@link getValue}. - * - * @return mixed - */ - public function getRoot(); - - /** - * Returns the value that the validator is currently validating. - * - * If you want to retrieve the object that was originally passed to the - * validator, use {@link getRoot}. - * - * @return mixed - */ - public function getValue(); - - /** - * Returns the metadata for the currently validated value. - * - * With the core implementation, this method returns a - * {@link Mapping\ClassMetadataInterface} instance if the current value is an object, - * a {@link Mapping\PropertyMetadata} instance if the current value is - * the value of a property and a {@link Mapping\GetterMetadata} instance if - * the validated value is the result of a getter method. - * - * If the validated value is neither of these, for example if the validator - * has been called with a plain value and constraint, this method returns - * null. - * - * @return MetadataInterface|null - */ - public function getMetadata(); - - /** - * Returns the validation group that is currently being validated. - * - * @return string|null - */ - public function getGroup(); - - /** - * Returns the class name of the current node. - * - * If the metadata of the current node does not implement - * {@link Mapping\ClassMetadataInterface} or if no metadata is available for the - * current node, this method returns null. - * - * @return string|null - */ - public function getClassName(); - - /** - * Returns the property name of the current node. - * - * If the metadata of the current node does not implement - * {@link PropertyMetadataInterface} or if no metadata is available for the - * current node, this method returns null. - * - * @return string|null - */ - public function getPropertyName(); - - /** - * Returns the property path to the value that the validator is currently - * validating. - * - * For example, take the following object graph: - * - *
    -     * (Person)---($address: Address)---($street: string)
    -     * 
    - * - * When the Person instance is passed to the validator, the - * property path is initially empty. When the $address property - * of that person is validated, the property path is "address". When - * the $street property of the related Address instance - * is validated, the property path is "address.street". - * - * Properties of objects are prefixed with a dot in the property path. - * Indices of arrays or objects implementing the {@link \ArrayAccess} - * interface are enclosed in brackets. For example, if the property in - * the previous example is $addresses and contains an array - * of Address instance, the property path generated for the - * $street property of one of these addresses is for example - * "addresses[0].street". - * - * @param string $subPath Optional. The suffix appended to the current - * property path. - * - * @return string The current property path. The result may be an empty - * string if the validator is currently validating the - * root value of the validation graph. - */ - public function getPropertyPath(string $subPath = ''); + public function isObjectInitialized($cacheKey); } diff --git a/upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php b/upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php deleted file mode 100644 index 2b36267fbec..00000000000 --- a/upload/system/storage/vendor/symfony/validator/DataCollector/ValidatorDataCollector.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\DataCollector; - -use Symfony\Component\Form\FormInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; -use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; -use Symfony\Component\Validator\Validator\TraceableValidator; -use Symfony\Component\VarDumper\Caster\Caster; -use Symfony\Component\VarDumper\Caster\ClassStub; -use Symfony\Component\VarDumper\Cloner\Data; -use Symfony\Component\VarDumper\Cloner\Stub; - -/** - * @author Maxime Steinhausser - * - * @final - */ -class ValidatorDataCollector extends DataCollector implements LateDataCollectorInterface -{ - private $validator; - - public function __construct(TraceableValidator $validator) - { - $this->validator = $validator; - $this->reset(); - } - - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - // Everything is collected once, on kernel terminate. - } - - public function reset() - { - $this->data = [ - 'calls' => $this->cloneVar([]), - 'violations_count' => 0, - ]; - } - - /** - * {@inheritdoc} - */ - public function lateCollect() - { - $collected = $this->validator->getCollectedData(); - $this->data['calls'] = $this->cloneVar($collected); - $this->data['violations_count'] = array_reduce($collected, function ($previous, $item) { - return $previous + \count($item['violations']); - }, 0); - } - - public function getCalls(): Data - { - return $this->data['calls']; - } - - public function getViolationsCount(): int - { - return $this->data['violations_count']; - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return 'validator'; - } - - protected function getCasters(): array - { - return parent::getCasters() + [ - \Exception::class => function (\Exception $e, array $a, Stub $s) { - foreach (["\0Exception\0previous", "\0Exception\0trace"] as $k) { - if (isset($a[$k])) { - unset($a[$k]); - ++$s->cut; - } - } - - return $a; - }, - FormInterface::class => function (FormInterface $f, array $a) { - return [ - Caster::PREFIX_VIRTUAL.'name' => $f->getName(), - Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(\get_class($f->getConfig()->getType()->getInnerType())), - Caster::PREFIX_VIRTUAL.'data' => $f->getData(), - ]; - }, - ]; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php deleted file mode 100644 index dca06ee1b43..00000000000 --- a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddAutoMappingConfigurationPass.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Injects the automapping configuration as last argument of loaders tagged with the "validator.auto_mapper" tag. - * - * @author Kévin Dunglas - */ -class AddAutoMappingConfigurationPass implements CompilerPassInterface -{ - private $validatorBuilderService; - private $tag; - - public function __construct(string $validatorBuilderService = 'validator.builder', string $tag = 'validator.auto_mapper') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/validator', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->validatorBuilderService = $validatorBuilderService; - $this->tag = $tag; - } - - /** - * {@inheritdoc} - */ - public function process(ContainerBuilder $container) - { - if (!$container->hasParameter('validator.auto_mapping') || !$container->hasDefinition($this->validatorBuilderService)) { - return; - } - - $config = $container->getParameter('validator.auto_mapping'); - - $globalNamespaces = []; - $servicesToNamespaces = []; - foreach ($config as $namespace => $value) { - if ([] === $value['services']) { - $globalNamespaces[] = $namespace; - - continue; - } - - foreach ($value['services'] as $service) { - $servicesToNamespaces[$service][] = $namespace; - } - } - - $validatorBuilder = $container->getDefinition($this->validatorBuilderService); - foreach ($container->findTaggedServiceIds($this->tag) as $id => $tags) { - $regexp = $this->getRegexp(array_merge($globalNamespaces, $servicesToNamespaces[$id] ?? [])); - $validatorBuilder->addMethodCall('addLoader', [new Reference($id)]); - $container->getDefinition($id)->setArgument('$classValidatorRegexp', $regexp); - } - - $container->getParameterBag()->remove('validator.auto_mapping'); - } - - /** - * Builds a regexp to check if a class is auto-mapped. - */ - private function getRegexp(array $patterns): ?string - { - if (!$patterns) { - return null; - } - - $regexps = []; - foreach ($patterns as $pattern) { - // Escape namespace - $regex = preg_quote(ltrim($pattern, '\\')); - - // Wildcards * and ** - $regex = strtr($regex, ['\\*\\*' => '.*?', '\\*' => '[^\\\\]*?']); - - // If this class does not end by a slash, anchor the end - if (!str_ends_with($regex, '\\')) { - $regex .= '$'; - } - - $regexps[] = '^'.$regex; - } - - return sprintf('{%s}', implode('|', $regexps)); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php deleted file mode 100644 index a3c65598929..00000000000 --- a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddConstraintValidatorsPass.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * @author Johannes M. Schmitt - * @author Robin Chalas - */ -class AddConstraintValidatorsPass implements CompilerPassInterface -{ - private $validatorFactoryServiceId; - private $constraintValidatorTag; - - public function __construct(string $validatorFactoryServiceId = 'validator.validator_factory', string $constraintValidatorTag = 'validator.constraint_validator') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/validator', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->validatorFactoryServiceId = $validatorFactoryServiceId; - $this->constraintValidatorTag = $constraintValidatorTag; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition($this->validatorFactoryServiceId)) { - return; - } - - $validators = []; - foreach ($container->findTaggedServiceIds($this->constraintValidatorTag, true) as $id => $attributes) { - $definition = $container->getDefinition($id); - - if (isset($attributes[0]['alias'])) { - $validators[$attributes[0]['alias']] = new Reference($id); - } - - $validators[$definition->getClass()] = new Reference($id); - } - - $container - ->getDefinition($this->validatorFactoryServiceId) - ->replaceArgument(0, ServiceLocatorTagPass::register($container, $validators)) - ; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php b/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php deleted file mode 100644 index 0ea8eef7157..00000000000 --- a/upload/system/storage/vendor/symfony/validator/DependencyInjection/AddValidatorInitializersPass.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * @author Fabien Potencier - * @author Robin Chalas - */ -class AddValidatorInitializersPass implements CompilerPassInterface -{ - private $builderService; - private $initializerTag; - - public function __construct(string $builderService = 'validator.builder', string $initializerTag = 'validator.initializer') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/validator', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->builderService = $builderService; - $this->initializerTag = $initializerTag; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition($this->builderService)) { - return; - } - - $initializers = []; - foreach ($container->findTaggedServiceIds($this->initializerTag, true) as $id => $attributes) { - $initializers[] = new Reference($id); - } - - $container->getDefinition($this->builderService)->addMethodCall('addObjectInitializers', [$initializers]); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php b/upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php index 390e8c053fe..77d09b9029c 100644 --- a/upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Exception/ExceptionInterface.php @@ -16,6 +16,6 @@ * * @author Bernhard Schussek */ -interface ExceptionInterface extends \Throwable +interface ExceptionInterface { } diff --git a/upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php b/upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php index 79d064f5377..ce87c42ef49 100644 --- a/upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php +++ b/upload/system/storage/vendor/symfony/validator/Exception/InvalidOptionsException.php @@ -15,7 +15,7 @@ class InvalidOptionsException extends ValidatorException { private $options; - public function __construct(string $message, array $options) + public function __construct($message, array $options) { parent::__construct($message); diff --git a/upload/system/storage/vendor/symfony/validator/Exception/LogicException.php b/upload/system/storage/vendor/symfony/validator/Exception/LogicException.php deleted file mode 100644 index 41d0975c388..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Exception/LogicException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Exception; - -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php b/upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php index 61de56755de..07c5d9ecda2 100644 --- a/upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php +++ b/upload/system/storage/vendor/symfony/validator/Exception/MissingOptionsException.php @@ -15,7 +15,7 @@ class MissingOptionsException extends ValidatorException { private $options; - public function __construct(string $message, array $options) + public function __construct($message, array $options) { parent::__construct($message); diff --git a/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php b/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php index 86a7c03211a..485dbca051d 100644 --- a/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php +++ b/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedTypeException.php @@ -13,8 +13,8 @@ class UnexpectedTypeException extends ValidatorException { - public function __construct($value, string $expectedType) + public function __construct($value, $expectedType) { - parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, get_debug_type($value))); + parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, \is_object($value) ? \get_class($value) : \gettype($value))); } } diff --git a/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php b/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php deleted file mode 100644 index 7a7f7f7bf29..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Exception; - -/** - * @author Christian Flothmann - */ -class UnexpectedValueException extends UnexpectedTypeException -{ - private $expectedType; - - public function __construct($value, string $expectedType) - { - parent::__construct($value, $expectedType); - - $this->expectedType = $expectedType; - } - - public function getExpectedType(): string - { - return $this->expectedType; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php b/upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php deleted file mode 100644 index ca0314cf6e7..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Exception/ValidationFailedException.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Exception; - -use Symfony\Component\Validator\ConstraintViolationListInterface; - -/** - * @author Jan Vernieuwe - */ -class ValidationFailedException extends RuntimeException -{ - private $violations; - private $value; - - public function __construct($value, ConstraintViolationListInterface $violations) - { - $this->violations = $violations; - $this->value = $value; - parent::__construct($violations); - } - - public function getValue() - { - return $this->value; - } - - public function getViolations(): ConstraintViolationListInterface - { - return $this->violations; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php b/upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php index 0374a8b3eed..5894397da4d 100644 --- a/upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php +++ b/upload/system/storage/vendor/symfony/validator/GroupSequenceProviderInterface.php @@ -22,7 +22,7 @@ interface GroupSequenceProviderInterface * Returns which validation groups should be used for a certain state * of the object. * - * @return string[]|string[][]|GroupSequence + * @return string[]|GroupSequence An array of validation groups */ public function getGroupSequence(); } diff --git a/upload/system/storage/vendor/symfony/validator/LICENSE b/upload/system/storage/vendor/symfony/validator/LICENSE index 88bf75bb4d6..21d7fb9e2f2 100644 --- a/upload/system/storage/vendor/symfony/validator/LICENSE +++ b/upload/system/storage/vendor/symfony/validator/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-2018 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/upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php b/upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php deleted file mode 100644 index 4012ddcff9c..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Mapping/AutoMappingStrategy.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Mapping; - -/** - * Specifies how the auto-mapping feature should behave. - * - * @author Maxime Steinhausser - */ -final class AutoMappingStrategy -{ - /** - * Nothing explicitly set, rely on auto-mapping configured regex. - */ - public const NONE = 0; - - /** - * Explicitly enabled. - */ - public const ENABLED = 1; - - /** - * Explicitly disabled. - */ - public const DISABLED = 2; - - /** - * Not instantiable. - */ - private function __construct() - { - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php b/upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php index 6bab8ac4e69..c78fb42ad46 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/CascadingStrategy.php @@ -36,12 +36,12 @@ class CascadingStrategy /** * Specifies that a node should not be cascaded. */ - public const NONE = 1; + const NONE = 1; /** * Specifies that a node should be cascaded. */ - public const CASCADE = 2; + const CASCADE = 2; /** * Not instantiable. diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php index 31f54848e23..c3a6544ed47 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php @@ -12,13 +12,12 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Constraints\Cascade; -use Symfony\Component\Validator\Constraints\Composite; use Symfony\Component\Validator\Constraints\GroupSequence; use Symfony\Component\Validator\Constraints\Traverse; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\GroupDefinitionException; +use Symfony\Component\Validator\ValidationVisitorInterface; /** * Default implementation of {@link ClassMetadataInterface}. @@ -28,7 +27,7 @@ * @author Bernhard Schussek * @author Fabien Potencier */ -class ClassMetadata extends GenericMetadata implements ClassMetadataInterface +class ClassMetadata extends ElementMetadata implements ClassMetadataInterface { /** * @var string @@ -55,7 +54,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface * class' serialized representation. Do not access it. Use * {@link getPropertyMetadata()} instead. */ - public $members = []; + public $members = array(); /** * @var PropertyMetadata[] @@ -64,7 +63,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface * class' serialized representation. Do not access it. Use * {@link getPropertyMetadata()} instead. */ - public $properties = []; + public $properties = array(); /** * @var GetterMetadata[] @@ -73,7 +72,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface * class' serialized representation. Do not access it. Use * {@link getPropertyMetadata()} instead. */ - public $getters = []; + public $getters = array(); /** * @var array @@ -82,7 +81,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface * class' serialized representation. Do not access it. Use * {@link getGroupSequence()} instead. */ - public $groupSequence = []; + public $groupSequence = array(); /** * @var bool @@ -111,7 +110,12 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface */ private $reflClass; - public function __construct(string $class) + /** + * Constructs a metadata for the given class. + * + * @param string $class + */ + public function __construct($class) { $this->name = $class; // class name without namespace @@ -122,6 +126,47 @@ public function __construct(string $class) } } + /** + * {@inheritdoc} + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + if (null === $propagatedGroup && Constraint::DEFAULT_GROUP === $group + && ($this->hasGroupSequence() || $this->isGroupSequenceProvider())) { + if ($this->hasGroupSequence()) { + $groups = $this->getGroupSequence()->groups; + } else { + $groups = $value->getGroupSequence(); + } + + foreach ($groups as $group) { + $this->accept($visitor, $value, $group, $propertyPath, Constraint::DEFAULT_GROUP); + + if (\count($visitor->getViolations()) > 0) { + break; + } + } + + return; + } + + $visitor->visit($this, $value, $group, $propertyPath); + + if (null !== $value) { + $pathPrefix = empty($propertyPath) ? '' : $propertyPath.'.'; + + foreach ($this->getConstrainedProperties() as $property) { + foreach ($this->getPropertyMetadata($property) as $member) { + $member->accept($visitor, $member->getPropertyValue($value), $group, $pathPrefix.$property, $propagatedGroup); + } + } + } + } + /** * {@inheritdoc} */ @@ -132,7 +177,7 @@ public function __sleep() // Don't store the cascading strategy. Classes never cascade. unset($parentProperties[array_search('cascadingStrategy', $parentProperties)]); - return array_merge($parentProperties, [ + return array_merge($parentProperties, array( 'getters', 'groupSequence', 'groupSequenceProvider', @@ -140,7 +185,7 @@ public function __sleep() 'name', 'properties', 'defaultGroup', - ]); + )); } /** @@ -164,7 +209,7 @@ public function getClassName() * will validate the group sequence. The constraints assigned to "Default" * can still be validated by validating the class in "". * - * @return string + * @return string The name of the default group */ public function getDefaultGroup() { @@ -173,21 +218,16 @@ public function getDefaultGroup() /** * {@inheritdoc} - * - * If the constraint {@link Cascade} is added, the cascading strategy will be - * changed to {@link CascadingStrategy::CASCADE}. - * - * If the constraint {@link Traverse} is added, the traversal strategy will be - * changed. Depending on the $traverse property of that constraint, - * the traversal strategy will be set to one of the following: - * - * - {@link TraversalStrategy::IMPLICIT} by default - * - {@link TraversalStrategy::NONE} if $traverse is disabled - * - {@link TraversalStrategy::TRAVERSE} if $traverse is enabled */ public function addConstraint(Constraint $constraint) { - $this->checkConstraint($constraint); + if (!\in_array(Constraint::CLASS_CONSTRAINT, (array) $constraint->getTargets())) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', \get_class($constraint))); + } + + if ($constraint instanceof Valid) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', \get_class($constraint))); + } if ($constraint instanceof Traverse) { if ($constraint->traverse) { @@ -202,23 +242,6 @@ public function addConstraint(Constraint $constraint) return $this; } - if ($constraint instanceof Cascade) { - if (\PHP_VERSION_ID < 70400) { - throw new ConstraintDefinitionException(sprintf('The constraint "%s" requires PHP 7.4.', Cascade::class)); - } - - $this->cascadingStrategy = CascadingStrategy::CASCADE; - - foreach ($this->getReflectionClass()->getProperties() as $property) { - if ($property->hasType() && (('array' === $type = $property->getType()->getName()) || class_exists(($type)))) { - $this->addPropertyConstraint($property->getName(), new Valid()); - } - } - - // The constraint is not added - return $this; - } - $constraint->addImplicitGroupName($this->getDefaultGroup()); parent::addConstraint($constraint); @@ -229,9 +252,12 @@ public function addConstraint(Constraint $constraint) /** * Adds a constraint to the given property. * + * @param string $property The name of the property + * @param Constraint $constraint The constraint + * * @return $this */ - public function addPropertyConstraint(string $property, Constraint $constraint) + public function addPropertyConstraint($property, Constraint $constraint) { if (!isset($this->properties[$property])) { $this->properties[$property] = new PropertyMetadata($this->getClassName(), $property); @@ -247,11 +273,12 @@ public function addPropertyConstraint(string $property, Constraint $constraint) } /** + * @param string $property * @param Constraint[] $constraints * * @return $this */ - public function addPropertyConstraints(string $property, array $constraints) + public function addPropertyConstraints($property, array $constraints) { foreach ($constraints as $constraint) { $this->addPropertyConstraint($property, $constraint); @@ -264,11 +291,14 @@ public function addPropertyConstraints(string $property, array $constraints) * Adds a constraint to the getter of the given property. * * The name of the getter is assumed to be the name of the property with an - * uppercased first letter and the prefix "get", "is" or "has". + * uppercased first letter and either the prefix "get" or "is". + * + * @param string $property The name of the property + * @param Constraint $constraint The constraint * * @return $this */ - public function addGetterConstraint(string $property, Constraint $constraint) + public function addGetterConstraint($property, Constraint $constraint) { if (!isset($this->getters[$property])) { $this->getters[$property] = new GetterMetadata($this->getClassName(), $property); @@ -286,9 +316,13 @@ public function addGetterConstraint(string $property, Constraint $constraint) /** * Adds a constraint to the getter of the given property. * + * @param string $property The name of the property + * @param string $method The name of the getter method + * @param Constraint $constraint The constraint + * * @return $this */ - public function addGetterMethodConstraint(string $property, string $method, Constraint $constraint) + public function addGetterMethodConstraint($property, $method, Constraint $constraint) { if (!isset($this->getters[$property])) { $this->getters[$property] = new GetterMetadata($this->getClassName(), $property, $method); @@ -304,11 +338,12 @@ public function addGetterMethodConstraint(string $property, string $method, Cons } /** + * @param string $property * @param Constraint[] $constraints * * @return $this */ - public function addGetterConstraints(string $property, array $constraints) + public function addGetterConstraints($property, array $constraints) { foreach ($constraints as $constraint) { $this->addGetterConstraint($property, $constraint); @@ -318,11 +353,13 @@ public function addGetterConstraints(string $property, array $constraints) } /** + * @param string $property + * @param string $method * @param Constraint[] $constraints * * @return $this */ - public function addGetterMethodConstraints(string $property, string $method, array $constraints) + public function addGetterMethodConstraints($property, $method, array $constraints) { foreach ($constraints as $constraint) { $this->addGetterMethodConstraint($property, $method, $constraint); @@ -334,7 +371,7 @@ public function addGetterMethodConstraints(string $property, string $method, arr /** * Merges the constraints of the given metadata into this object. */ - public function mergeConstraints(self $source) + public function mergeConstraints(ClassMetadata $source) { if ($source->isGroupSequenceProvider()) { $this->setGroupSequenceProvider(true); @@ -371,20 +408,70 @@ public function mergeConstraints(self $source) } } + /** + * Adds a member metadata. + * + * @param MemberMetadata $metadata + * + * @deprecated since version 2.6, to be removed in 3.0. + */ + protected function addMemberMetadata(MemberMetadata $metadata) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the addPropertyMetadata() method instead.', E_USER_DEPRECATED); + + $this->addPropertyMetadata($metadata); + } + + /** + * Returns true if metadatas of members is present for the given property. + * + * @param string $property The name of the property + * + * @return bool + * + * @deprecated since version 2.6, to be removed in 3.0. Use {@link hasPropertyMetadata} instead. + */ + public function hasMemberMetadatas($property) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the hasPropertyMetadata() method instead.', E_USER_DEPRECATED); + + return $this->hasPropertyMetadata($property); + } + + /** + * Returns all metadatas of members describing the given property. + * + * @param string $property The name of the property + * + * @return MemberMetadata[] An array of MemberMetadata + * + * @deprecated since version 2.6, to be removed in 3.0. Use {@link getPropertyMetadata} instead. + */ + public function getMemberMetadatas($property) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the getPropertyMetadata() method instead.', E_USER_DEPRECATED); + + return $this->getPropertyMetadata($property); + } + /** * {@inheritdoc} */ - public function hasPropertyMetadata(string $property) + public function hasPropertyMetadata($property) { - return \array_key_exists($property, $this->members); + return array_key_exists($property, $this->members); } /** * {@inheritdoc} */ - public function getPropertyMetadata(string $property) + public function getPropertyMetadata($property) { - return $this->members[$property] ?? []; + if (!isset($this->members[$property])) { + return array(); + } + + return $this->members[$property]; } /** @@ -407,7 +494,7 @@ public function getConstrainedProperties() public function setGroupSequence($groupSequence) { if ($this->isGroupSequenceProvider()) { - throw new GroupDefinitionException('Defining a static group sequence is not allowed with a group sequence provider.'); + throw new GroupDefinitionException('Defining a static group sequence is not allowed with a group sequence provider'); } if (\is_array($groupSequence)) { @@ -415,11 +502,11 @@ public function setGroupSequence($groupSequence) } if (\in_array(Constraint::DEFAULT_GROUP, $groupSequence->groups, true)) { - throw new GroupDefinitionException(sprintf('The group "%s" is not allowed in group sequences.', Constraint::DEFAULT_GROUP)); + throw new GroupDefinitionException(sprintf('The group "%s" is not allowed in group sequences', Constraint::DEFAULT_GROUP)); } if (!\in_array($this->getDefaultGroup(), $groupSequence->groups, true)) { - throw new GroupDefinitionException(sprintf('The group "%s" is missing in the group sequence.', $this->getDefaultGroup())); + throw new GroupDefinitionException(sprintf('The group "%s" is missing in the group sequence', $this->getDefaultGroup())); } $this->groupSequence = $groupSequence; @@ -460,16 +547,18 @@ public function getReflectionClass() /** * Sets whether a group sequence provider should be used. * + * @param bool $active + * * @throws GroupDefinitionException */ - public function setGroupSequenceProvider(bool $active) + public function setGroupSequenceProvider($active) { if ($this->hasGroupSequence()) { - throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence.'); + throw new GroupDefinitionException('Defining a group sequence provider is not allowed with a static group sequence'); } if (!$this->getReflectionClass()->implementsInterface('Symfony\Component\Validator\GroupSequenceProviderInterface')) { - throw new GroupDefinitionException(sprintf('Class "%s" must implement GroupSequenceProviderInterface.', $this->name)); + throw new GroupDefinitionException(sprintf('Class "%s" must implement GroupSequenceProviderInterface', $this->name)); } $this->groupSequenceProvider = $active; @@ -484,11 +573,13 @@ public function isGroupSequenceProvider() } /** + * Class nodes are never cascaded. + * * {@inheritdoc} */ public function getCascadingStrategy() { - return $this->cascadingStrategy; + return CascadingStrategy::NONE; } private function addPropertyMetadata(PropertyMetadataInterface $metadata) @@ -497,17 +588,4 @@ private function addPropertyMetadata(PropertyMetadataInterface $metadata) $this->members[$property][] = $metadata; } - - private function checkConstraint(Constraint $constraint) - { - if (!\in_array(Constraint::CLASS_CONSTRAINT, (array) $constraint->getTargets(), true)) { - throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on classes.', get_debug_type($constraint))); - } - - if ($constraint instanceof Composite) { - foreach ($constraint->getNestedConstraints() as $nestedConstraint) { - $this->checkConstraint($nestedConstraint); - } - } - } } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php index 99764c53464..d8c3d843bd4 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataInterface.php @@ -11,8 +11,8 @@ namespace Symfony\Component\Validator\Mapping; -use Symfony\Component\Validator\Constraints\GroupSequence; -use Symfony\Component\Validator\GroupSequenceProviderInterface; +use Symfony\Component\Validator\ClassBasedInterface; +use Symfony\Component\Validator\PropertyMetadataContainerInterface as LegacyPropertyMetadataContainerInterface; /** * Stores all metadata needed for validating objects of specific class. @@ -27,16 +27,16 @@ * @author Bernhard Schussek * * @see MetadataInterface - * @see GroupSequence - * @see GroupSequenceProviderInterface + * @see \Symfony\Component\Validator\Constraints\GroupSequence + * @see \Symfony\Component\Validator\GroupSequenceProviderInterface * @see TraversalStrategy */ -interface ClassMetadataInterface extends MetadataInterface +interface ClassMetadataInterface extends MetadataInterface, LegacyPropertyMetadataContainerInterface, ClassBasedInterface { /** * Returns the names of all constrained properties. * - * @return string[] + * @return string[] A list of property names */ public function getConstrainedProperties(); @@ -45,7 +45,9 @@ public function getConstrainedProperties(); * * If it is, you can access the group sequence with {@link getGroupSequence()}. * - * @return bool + * @return bool Returns true if the "Default" group is overridden + * + * @see \Symfony\Component\Validator\Constraints\GroupSequence */ public function hasGroupSequence(); @@ -53,7 +55,9 @@ public function hasGroupSequence(); * Returns the group sequence that overrides the "Default" group for this * class. * - * @return GroupSequence|null + * @return \Symfony\Component\Validator\Constraints\GroupSequence|null The group sequence or null + * + * @see \Symfony\Component\Validator\Constraints\GroupSequence */ public function getGroupSequence(); @@ -62,39 +66,14 @@ public function getGroupSequence(); * sequence obtained by the validated objects. * * If this method returns true, the class must implement - * {@link GroupSequenceProviderInterface}. + * {@link \Symfony\Component\Validator\GroupSequenceProviderInterface}. * This interface will be used to obtain the group sequence when an object * of this class is validated. * - * @return bool - */ - public function isGroupSequenceProvider(); - - /** - * Check if there's any metadata attached to the given named property. - * - * @param string $property The property name - * - * @return bool - */ - public function hasPropertyMetadata(string $property); - - /** - * Returns all metadata instances for the given named property. - * - * If your implementation does not support properties, throw an exception - * in this method (for example a BadMethodCallException). + * @return bool Returns true if the "Default" group is overridden by + * a dynamic group sequence * - * @param string $property The property name - * - * @return PropertyMetadataInterface[] + * @see \Symfony\Component\Validator\GroupSequenceProviderInterface */ - public function getPropertyMetadata(string $property); - - /** - * Returns the name of the backing PHP class. - * - * @return string - */ - public function getClassName(); + public function isGroupSequenceProvider(); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php index ec21d54a6ef..5b38d0c98a7 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/BlackHoleMetadataFactory.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator\Mapping\Factory; -use Symfony\Component\Validator\Exception\LogicException; - /** * Metadata factory that does not store metadata. * @@ -29,7 +27,7 @@ class BlackHoleMetadataFactory implements MetadataFactoryInterface */ public function getMetadataFor($value) { - throw new LogicException('This class does not support metadata.'); + throw new \LogicException('This class does not support metadata.'); } /** diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php index 42ed0508d80..fc1236ecf77 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/LazyLoadingMetadataFactory.php @@ -11,9 +11,11 @@ namespace Symfony\Component\Validator\Mapping\Factory; -use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Validator\Exception\NoSuchMetadataException; +use Symfony\Component\Validator\Mapping\Cache\CacheInterface; use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\ClassMetadataInterface; +use Symfony\Component\Validator\Mapping\Loader\LoaderChain; use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; /** @@ -46,9 +48,16 @@ class LazyLoadingMetadataFactory implements MetadataFactoryInterface * * @var ClassMetadata[] */ - protected $loadedClasses = []; + protected $loadedClasses = array(); - public function __construct(LoaderInterface $loader = null, CacheItemPoolInterface $cache = null) + /** + * Creates a new metadata factory. + * + * @param LoaderInterface|null $loader The loader for configuring new metadata + * @param CacheInterface|null $cache The cache for persisting metadata + * between multiple PHP requests + */ + public function __construct(LoaderInterface $loader = null, CacheInterface $cache = null) { $this->loader = $loader; $this->cache = $cache; @@ -72,7 +81,7 @@ public function __construct(LoaderInterface $loader = null, CacheItemPoolInterfa public function getMetadataFor($value) { if (!\is_object($value) && !\is_string($value)) { - throw new NoSuchMetadataException(sprintf('Cannot create metadata for non-objects. Got: "%s".', get_debug_type($value))); + throw new NoSuchMetadataException(sprintf('Cannot create metadata for non-objects. Got: %s', \gettype($value))); } $class = ltrim(\is_object($value) ? \get_class($value) : $value, '\\'); @@ -85,10 +94,7 @@ public function getMetadataFor($value) throw new NoSuchMetadataException(sprintf('The class or interface "%s" does not exist.', $class)); } - $cacheItem = null === $this->cache ? null : $this->cache->getItem($this->escapeClassName($class)); - if ($cacheItem && $cacheItem->isHit()) { - $metadata = $cacheItem->get(); - + if (null !== $this->cache && false !== ($metadata = $this->cache->read($class))) { // Include constraints from the parent class $this->mergeConstraints($metadata); @@ -101,8 +107,8 @@ public function getMetadataFor($value) $this->loader->loadClassMetadata($metadata); } - if (null !== $cacheItem) { - $this->cache->save($cacheItem->set($metadata)); + if (null !== $this->cache) { + $this->cache->write($metadata); } // Include constraints from the parent class @@ -113,25 +119,34 @@ public function getMetadataFor($value) private function mergeConstraints(ClassMetadata $metadata) { - if ($metadata->getReflectionClass()->isInterface()) { - return; - } - // Include constraints from the parent class if ($parent = $metadata->getReflectionClass()->getParentClass()) { $metadata->mergeConstraints($this->getMetadataFor($parent->name)); } - // Include constraints from all directly implemented interfaces - foreach ($metadata->getReflectionClass()->getInterfaces() as $interface) { - if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->name) { - continue; + $interfaces = $metadata->getReflectionClass()->getInterfaces(); + + $interfaces = array_filter($interfaces, function ($interface) use ($parent, $interfaces) { + $interfaceName = $interface->getName(); + + if ($parent && $parent->implementsInterface($interfaceName)) { + return false; } - if ($parent && \in_array($interface->getName(), $parent->getInterfaceNames(), true)) { - continue; + foreach ($interfaces as $i) { + if ($i !== $interface && $i->implementsInterface($interfaceName)) { + return false; + } } + return true; + }); + + // Include constraints from all directly implemented interfaces + foreach ($interfaces as $interface) { + if ('Symfony\Component\Validator\GroupSequenceProviderInterface' === $interface->name) { + continue; + } $metadata->mergeConstraints($this->getMetadataFor($interface->name)); } } @@ -149,17 +164,4 @@ public function hasMetadataFor($value) return class_exists($class) || interface_exists($class, false); } - - /** - * Replaces backslashes by dots in a class name. - */ - private function escapeClassName(string $class): string - { - if (str_contains($class, '@')) { - // anonymous class: replace all PSR6-reserved characters - return str_replace(["\0", '\\', '/', '@', ':', '{', '}', '(', ')'], '.', $class); - } - - return str_replace('\\', '.', $class); - } } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php index d3517c52e18..438ef9871c2 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Factory/MetadataFactoryInterface.php @@ -11,33 +11,13 @@ namespace Symfony\Component\Validator\Mapping\Factory; -use Symfony\Component\Validator\Exception\NoSuchMetadataException; -use Symfony\Component\Validator\Mapping\MetadataInterface; +use Symfony\Component\Validator\MetadataFactoryInterface as LegacyMetadataFactoryInterface; /** * Returns {@link \Symfony\Component\Validator\Mapping\MetadataInterface} instances for values. * * @author Bernhard Schussek */ -interface MetadataFactoryInterface +interface MetadataFactoryInterface extends LegacyMetadataFactoryInterface { - /** - * Returns the metadata for the given value. - * - * @param mixed $value Some value - * - * @return MetadataInterface - * - * @throws NoSuchMetadataException If no metadata exists for the given value - */ - public function getMetadataFor($value); - - /** - * Returns whether the class is able to return metadata for the given value. - * - * @param mixed $value Some value - * - * @return bool - */ - public function hasMetadataFor($value); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php index 06971e8f925..2e4330fcf62 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/GenericMetadata.php @@ -12,12 +12,11 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Constraints\Cascade; -use Symfony\Component\Validator\Constraints\DisableAutoMapping; -use Symfony\Component\Validator\Constraints\EnableAutoMapping; use Symfony\Component\Validator\Constraints\Traverse; use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Exception\BadMethodCallException; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\ValidationVisitorInterface; /** * A generic container of {@link Constraint} objects. @@ -35,7 +34,7 @@ class GenericMetadata implements MetadataInterface * class' serialized representation. Do not access it. Use * {@link getConstraints()} and {@link findConstraints()} instead. */ - public $constraints = []; + public $constraints = array(); /** * @var array @@ -44,7 +43,7 @@ class GenericMetadata implements MetadataInterface * class' serialized representation. Do not access it. Use * {@link findConstraints()} instead. */ - public $constraintsByGroup = []; + public $constraintsByGroup = array(); /** * The strategy for cascading objects. @@ -76,19 +75,6 @@ class GenericMetadata implements MetadataInterface */ public $traversalStrategy = TraversalStrategy::NONE; - /** - * Is auto-mapping enabled? - * - * @var int - * - * @see AutoMappingStrategy - * - * @internal This property is public in order to reduce the size of the - * class' serialized representation. Do not access it. Use - * {@link getAutoMappingStrategy()} instead. - */ - public $autoMappingStrategy = AutoMappingStrategy::NONE; - /** * Returns the names of the properties that should be serialized. * @@ -96,13 +82,12 @@ class GenericMetadata implements MetadataInterface */ public function __sleep() { - return [ + return array( 'constraints', 'constraintsByGroup', 'cascadingStrategy', 'traversalStrategy', - 'autoMappingStrategy', - ]; + ); } /** @@ -112,8 +97,8 @@ public function __clone() { $constraints = $this->constraints; - $this->constraints = []; - $this->constraintsByGroup = []; + $this->constraints = array(); + $this->constraintsByGroup = array(); foreach ($constraints as $constraint) { $this->addConstraint(clone $constraint); @@ -125,28 +110,36 @@ public function __clone() * * If the constraint {@link Valid} is added, the cascading strategy will be * changed to {@link CascadingStrategy::CASCADE}. Depending on the - * $traverse property of that constraint, the traversal strategy + * properties $traverse and $deep of that constraint, the traversal strategy * will be set to one of the following: * - * - {@link TraversalStrategy::IMPLICIT} if $traverse is enabled + * - {@link TraversalStrategy::IMPLICIT} if $traverse is enabled and $deep + * is enabled + * - {@link TraversalStrategy::IMPLICIT} | {@link TraversalStrategy::STOP_RECURSION} + * if $traverse is enabled, but $deep is disabled * - {@link TraversalStrategy::NONE} if $traverse is disabled * * @return $this * - * @throws ConstraintDefinitionException When trying to add the {@link Cascade} - * or {@link Traverse} constraint + * @throws ConstraintDefinitionException When trying to add the + * {@link Traverse} constraint */ public function addConstraint(Constraint $constraint) { - if ($constraint instanceof Traverse || $constraint instanceof Cascade) { - throw new ConstraintDefinitionException(sprintf('The constraint "%s" can only be put on classes. Please use "Symfony\Component\Validator\Constraints\Valid" instead.', get_debug_type($constraint))); + if ($constraint instanceof Traverse) { + throw new ConstraintDefinitionException(sprintf('The constraint "%s" can only be put on classes. Please use "Symfony\Component\Validator\Constraints\Valid" instead.', \get_class($constraint))); } - if ($constraint instanceof Valid && null === $constraint->groups) { + if ($constraint instanceof Valid) { $this->cascadingStrategy = CascadingStrategy::CASCADE; if ($constraint->traverse) { + // Traverse unless the value is not traversable $this->traversalStrategy = TraversalStrategy::IMPLICIT; + + if (!$constraint->deep) { + $this->traversalStrategy |= TraversalStrategy::STOP_RECURSION; + } } else { $this->traversalStrategy = TraversalStrategy::NONE; } @@ -154,13 +147,6 @@ public function addConstraint(Constraint $constraint) return $this; } - if ($constraint instanceof DisableAutoMapping || $constraint instanceof EnableAutoMapping) { - $this->autoMappingStrategy = $constraint instanceof EnableAutoMapping ? AutoMappingStrategy::ENABLED : AutoMappingStrategy::DISABLED; - - // The constraint is not added - return $this; - } - $this->constraints[] = $constraint; foreach ($constraint->groups as $group) { @@ -209,9 +195,11 @@ public function hasConstraints() * * Aware of the global group (* group). */ - public function findConstraints(string $group) + public function findConstraints($group) { - return $this->constraintsByGroup[$group] ?? []; + return isset($this->constraintsByGroup[$group]) + ? $this->constraintsByGroup[$group] + : array(); } /** @@ -231,10 +219,19 @@ public function getTraversalStrategy() } /** - * @see AutoMappingStrategy + * Exists for compatibility with the deprecated + * {@link Symfony\Component\Validator\MetadataInterface}. + * + * Should not be used. + * + * Implemented for backward compatibility with Symfony < 2.5. + * + * @throws BadMethodCallException + * + * @deprecated since version 2.5, to be removed in 3.0. */ - public function getAutoMappingStrategy(): int + public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath) { - return $this->autoMappingStrategy; + throw new BadMethodCallException('Not supported.'); } } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php index 0be3329342b..5a72bd84b74 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/GetterMetadata.php @@ -18,7 +18,7 @@ * method. * * A property getter is any method that is equal to the property's name, - * prefixed with "get", "is" or "has". That method will be used to access the + * prefixed with either "get" or "is". That method will be used to access the * property's value. * * The getter will be invoked by reflection, so the access of private and @@ -39,7 +39,7 @@ class GetterMetadata extends MemberMetadata * * @throws ValidatorException */ - public function __construct(string $class, string $property, string $method = null) + public function __construct($class, $property, $method = null) { if (null === $method) { $getMethod = 'get'.ucfirst($property); @@ -53,10 +53,10 @@ public function __construct(string $class, string $property, string $method = nu } elseif (method_exists($class, $hasMethod)) { $method = $hasMethod; } else { - throw new ValidatorException(sprintf('Neither of these methods exist in class "%s": "%s", "%s", "%s".', $class, $getMethod, $isMethod, $hasMethod)); + throw new ValidatorException(sprintf('Neither of these methods exist in class %s: %s, %s, %s', $class, $getMethod, $isMethod, $hasMethod)); } } elseif (!method_exists($class, $method)) { - throw new ValidatorException(sprintf('The "%s()" method does not exist in class "%s".', $method, $class)); + throw new ValidatorException(sprintf('The %s() method does not exist in class %s.', $method, $class)); } parent::__construct($class, $method, $property); diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php index 9f6667f836f..9d92de348ae 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php @@ -30,9 +30,9 @@ abstract class AbstractLoader implements LoaderInterface /** * The namespace to load constraints from by default. */ - public const DEFAULT_NAMESPACE = '\\Symfony\\Component\\Validator\\Constraints\\'; + const DEFAULT_NAMESPACE = '\\Symfony\\Component\\Validator\\Constraints\\'; - protected $namespaces = []; + protected $namespaces = array(); /** * Adds a namespace alias. @@ -43,8 +43,11 @@ abstract class AbstractLoader implements LoaderInterface * $this->addNamespaceAlias('mynamespace', '\\Acme\\Package\\Constraints\\'); * * $constraint = $this->newConstraint('mynamespace:NotNull'); + * + * @param string $alias The alias + * @param string $namespace The PHP namespace */ - protected function addNamespaceAlias(string $alias, string $namespace) + protected function addNamespaceAlias($alias, $namespace) { $this->namespaces[$alias] = $namespace; } @@ -64,15 +67,15 @@ protected function addNamespaceAlias(string $alias, string $namespace) * * @throws MappingException If the namespace prefix is undefined */ - protected function newConstraint(string $name, $options = null) + protected function newConstraint($name, $options = null) { - if (str_contains($name, '\\') && class_exists($name)) { - $className = $name; - } elseif (str_contains($name, ':')) { - [$prefix, $className] = explode(':', $name, 2); + if (false !== strpos($name, '\\') && class_exists($name)) { + $className = (string) $name; + } elseif (false !== strpos($name, ':')) { + list($prefix, $className) = explode(':', $name, 2); if (!isset($this->namespaces[$prefix])) { - throw new MappingException(sprintf('Undefined namespace prefix "%s".', $prefix)); + throw new MappingException(sprintf('Undefined namespace prefix "%s"', $prefix)); } $className = $this->namespaces[$prefix].$className; diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php index 6968927e3d6..c2d1bdf1cdb 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AnnotationLoader.php @@ -20,16 +20,15 @@ use Symfony\Component\Validator\Mapping\ClassMetadata; /** - * Loads validation metadata using a Doctrine annotation {@link Reader} or using PHP 8 attributes. + * Loads validation metadata using a Doctrine annotation {@link Reader}. * * @author Bernhard Schussek - * @author Alexander M. Turek */ class AnnotationLoader implements LoaderInterface { protected $reader; - public function __construct(Reader $reader = null) + public function __construct(Reader $reader) { $this->reader = $reader; } @@ -43,7 +42,7 @@ public function loadClassMetadata(ClassMetadata $metadata) $className = $reflClass->name; $success = false; - foreach ($this->getAnnotations($reflClass) as $constraint) { + foreach ($this->reader->getClassAnnotations($reflClass) as $constraint) { if ($constraint instanceof GroupSequence) { $metadata->setGroupSequence($constraint->groups); } elseif ($constraint instanceof GroupSequenceProvider) { @@ -57,7 +56,7 @@ public function loadClassMetadata(ClassMetadata $metadata) foreach ($reflClass->getProperties() as $property) { if ($property->getDeclaringClass()->name === $className) { - foreach ($this->getAnnotations($property) as $constraint) { + foreach ($this->reader->getPropertyAnnotations($property) as $constraint) { if ($constraint instanceof Constraint) { $metadata->addPropertyConstraint($property->name, $constraint); } @@ -69,16 +68,17 @@ public function loadClassMetadata(ClassMetadata $metadata) foreach ($reflClass->getMethods() as $method) { if ($method->getDeclaringClass()->name === $className) { - foreach ($this->getAnnotations($method) as $constraint) { + foreach ($this->reader->getMethodAnnotations($method) as $constraint) { if ($constraint instanceof Callback) { $constraint->callback = $method->getName(); + $constraint->methods = null; $metadata->addConstraint($constraint); } elseif ($constraint instanceof Constraint) { if (preg_match('/^(get|is|has)(.+)$/i', $method->name, $matches)) { $metadata->addGetterMethodConstraint(lcfirst($matches[2]), $matches[0], $constraint); } else { - throw new MappingException(sprintf('The constraint on "%s::%s()" cannot be added. Constraints can only be added on methods beginning with "get", "is" or "has".', $className, $method->name)); + throw new MappingException(sprintf('The constraint on "%s::%s" cannot be added. Constraints can only be added on methods beginning with "get", "is" or "has".', $className, $method->name)); } } @@ -89,35 +89,4 @@ public function loadClassMetadata(ClassMetadata $metadata) return $success; } - - /** - * @param \ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflection - */ - private function getAnnotations(object $reflection): iterable - { - if (\PHP_VERSION_ID >= 80000) { - foreach ($reflection->getAttributes(GroupSequence::class) as $attribute) { - yield $attribute->newInstance(); - } - foreach ($reflection->getAttributes(GroupSequenceProvider::class) as $attribute) { - yield $attribute->newInstance(); - } - foreach ($reflection->getAttributes(Constraint::class, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) { - yield $attribute->newInstance(); - } - } - if (!$this->reader) { - return; - } - - if ($reflection instanceof \ReflectionClass) { - yield from $this->reader->getClassAnnotations($reflection); - } - if ($reflection instanceof \ReflectionMethod) { - yield from $this->reader->getMethodAnnotations($reflection); - } - if ($reflection instanceof \ReflectionProperty) { - yield from $this->reader->getPropertyAnnotations($reflection); - } - } } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php deleted file mode 100644 index f76442f06c0..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AutoMappingTrait.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Mapping\Loader; - -use Symfony\Component\Validator\Mapping\AutoMappingStrategy; -use Symfony\Component\Validator\Mapping\ClassMetadata; - -/** - * Utility methods to create auto mapping loaders. - * - * @author Kévin Dunglas - */ -trait AutoMappingTrait -{ - private function isAutoMappingEnabledForClass(ClassMetadata $metadata, string $classValidatorRegexp = null): bool - { - // Check if AutoMapping constraint is set first - if (AutoMappingStrategy::NONE !== $strategy = $metadata->getAutoMappingStrategy()) { - return AutoMappingStrategy::ENABLED === $strategy; - } - - // Fallback on the config - return null !== $classValidatorRegexp && preg_match($classValidatorRegexp, $metadata->getClassName()); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php index 0fc01729884..b8f9490379a 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FileLoader.php @@ -32,18 +32,18 @@ abstract class FileLoader extends AbstractLoader * * @throws MappingException If the file does not exist or is not readable */ - public function __construct(string $file) + public function __construct($file) { if (!is_file($file)) { - throw new MappingException(sprintf('The mapping file "%s" does not exist.', $file)); + throw new MappingException(sprintf('The mapping file "%s" does not exist', $file)); } if (!is_readable($file)) { - throw new MappingException(sprintf('The mapping file "%s" is not readable.', $file)); + throw new MappingException(sprintf('The mapping file "%s" is not readable', $file)); } if (!stream_is_local($this->file)) { - throw new MappingException(sprintf('The mapping file "%s" is not a local file.', $file)); + throw new MappingException(sprintf('The mapping file "%s" is not a local file', $file)); } $this->file = $file; diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php index f6574f4664b..571c7e7abb2 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/FilesLoader.php @@ -35,11 +35,13 @@ public function __construct(array $paths) /** * Returns an array of file loaders for the given file paths. * - * @return LoaderInterface[] + * @param array $paths An array of file paths + * + * @return LoaderInterface[] The metadata loaders */ - protected function getFileLoaders(array $paths) + protected function getFileLoaders($paths) { - $loaders = []; + $loaders = array(); foreach ($paths as $path) { $loaders[] = $this->getFileLoaderInstance($path); @@ -51,7 +53,9 @@ protected function getFileLoaders(array $paths) /** * Creates a loader for the given file path. * - * @return LoaderInterface + * @param string $path The file path + * + * @return LoaderInterface The created loader */ - abstract protected function getFileLoaderInstance(string $path); + abstract protected function getFileLoaderInstance($path); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php index b3d61846527..2c5108fd8dc 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderChain.php @@ -36,7 +36,7 @@ public function __construct(array $loaders) { foreach ($loaders as $loader) { if (!$loader instanceof LoaderInterface) { - throw new MappingException(sprintf('Class "%s" is expected to implement LoaderInterface.', get_debug_type($loader))); + throw new MappingException(sprintf('Class %s is expected to implement LoaderInterface', \get_class($loader))); } } @@ -56,12 +56,4 @@ public function loadClassMetadata(ClassMetadata $metadata) return $success; } - - /** - * @return LoaderInterface[] - */ - public function getLoaders() - { - return $this->loaders; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php index 974214c4fc3..d988309f811 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/LoaderInterface.php @@ -23,7 +23,7 @@ interface LoaderInterface /** * Loads validation metadata into a {@link ClassMetadata} instance. * - * @return bool + * @return bool Whether the loader succeeded */ public function loadClassMetadata(ClassMetadata $metadata); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php deleted file mode 100644 index 118c1594452..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/PropertyInfoLoader.php +++ /dev/null @@ -1,179 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Mapping\Loader; - -use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface; -use Symfony\Component\PropertyInfo\PropertyListExtractorInterface; -use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; -use Symfony\Component\PropertyInfo\Type as PropertyInfoType; -use Symfony\Component\Validator\Constraints\All; -use Symfony\Component\Validator\Constraints\NotBlank; -use Symfony\Component\Validator\Constraints\NotNull; -use Symfony\Component\Validator\Constraints\Type; -use Symfony\Component\Validator\Mapping\AutoMappingStrategy; -use Symfony\Component\Validator\Mapping\ClassMetadata; - -/** - * Guesses and loads the appropriate constraints using PropertyInfo. - * - * @author Kévin Dunglas - */ -final class PropertyInfoLoader implements LoaderInterface -{ - use AutoMappingTrait; - - private $listExtractor; - private $typeExtractor; - private $accessExtractor; - private $classValidatorRegexp; - - public function __construct(PropertyListExtractorInterface $listExtractor, PropertyTypeExtractorInterface $typeExtractor, PropertyAccessExtractorInterface $accessExtractor, string $classValidatorRegexp = null) - { - $this->listExtractor = $listExtractor; - $this->typeExtractor = $typeExtractor; - $this->accessExtractor = $accessExtractor; - $this->classValidatorRegexp = $classValidatorRegexp; - } - - /** - * {@inheritdoc} - */ - public function loadClassMetadata(ClassMetadata $metadata): bool - { - $className = $metadata->getClassName(); - if (!$properties = $this->listExtractor->getProperties($className)) { - return false; - } - - $loaded = false; - $enabledForClass = $this->isAutoMappingEnabledForClass($metadata, $this->classValidatorRegexp); - foreach ($properties as $property) { - if (false === $this->accessExtractor->isWritable($className, $property)) { - continue; - } - - if (!property_exists($className, $property)) { - continue; - } - - $types = $this->typeExtractor->getTypes($className, $property); - if (null === $types) { - continue; - } - - $enabledForProperty = $enabledForClass; - $hasTypeConstraint = false; - $hasNotNullConstraint = false; - $hasNotBlankConstraint = false; - $allConstraint = null; - foreach ($metadata->getPropertyMetadata($property) as $propertyMetadata) { - // Enabling or disabling auto-mapping explicitly always takes precedence - if (AutoMappingStrategy::DISABLED === $propertyMetadata->getAutoMappingStrategy()) { - continue 2; - } - - if (AutoMappingStrategy::ENABLED === $propertyMetadata->getAutoMappingStrategy()) { - $enabledForProperty = true; - } - - foreach ($propertyMetadata->getConstraints() as $constraint) { - if ($constraint instanceof Type) { - $hasTypeConstraint = true; - } elseif ($constraint instanceof NotNull) { - $hasNotNullConstraint = true; - } elseif ($constraint instanceof NotBlank) { - $hasNotBlankConstraint = true; - } elseif ($constraint instanceof All) { - $allConstraint = $constraint; - } - } - } - - if (!$enabledForProperty) { - continue; - } - - $loaded = true; - $builtinTypes = []; - $nullable = false; - $scalar = true; - foreach ($types as $type) { - $builtinTypes[] = $type->getBuiltinType(); - - if ($scalar && !\in_array($type->getBuiltinType(), [PropertyInfoType::BUILTIN_TYPE_INT, PropertyInfoType::BUILTIN_TYPE_FLOAT, PropertyInfoType::BUILTIN_TYPE_STRING, PropertyInfoType::BUILTIN_TYPE_BOOL], true)) { - $scalar = false; - } - - if (!$nullable && $type->isNullable()) { - $nullable = true; - } - } - if (!$hasTypeConstraint) { - if (1 === \count($builtinTypes)) { - if ($types[0]->isCollection() && \count($collectionValueType = $types[0]->getCollectionValueTypes()) > 0) { - [$collectionValueType] = $collectionValueType; - $this->handleAllConstraint($property, $allConstraint, $collectionValueType, $metadata); - } - - $metadata->addPropertyConstraint($property, $this->getTypeConstraint($builtinTypes[0], $types[0])); - } elseif ($scalar) { - $metadata->addPropertyConstraint($property, new Type(['type' => 'scalar'])); - } - } - - if (!$nullable && !$hasNotBlankConstraint && !$hasNotNullConstraint) { - $metadata->addPropertyConstraint($property, new NotNull()); - } - } - - return $loaded; - } - - private function getTypeConstraint(string $builtinType, PropertyInfoType $type): Type - { - if (PropertyInfoType::BUILTIN_TYPE_OBJECT === $builtinType && null !== $className = $type->getClassName()) { - return new Type(['type' => $className]); - } - - return new Type(['type' => $builtinType]); - } - - private function handleAllConstraint(string $property, ?All $allConstraint, PropertyInfoType $propertyInfoType, ClassMetadata $metadata) - { - $containsTypeConstraint = false; - $containsNotNullConstraint = false; - if (null !== $allConstraint) { - foreach ($allConstraint->constraints as $constraint) { - if ($constraint instanceof Type) { - $containsTypeConstraint = true; - } elseif ($constraint instanceof NotNull) { - $containsNotNullConstraint = true; - } - } - } - - $constraints = []; - if (!$containsNotNullConstraint && !$propertyInfoType->isNullable()) { - $constraints[] = new NotNull(); - } - - if (!$containsTypeConstraint) { - $constraints[] = $this->getTypeConstraint($propertyInfoType->getBuiltinType(), $propertyInfoType); - } - - if (null === $allConstraint) { - $metadata->addPropertyConstraint($property, new All(['constraints' => $constraints])); - } else { - $allConstraint->constraints = array_merge($allConstraint->constraints, $constraints); - } - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php index 256700e1ef6..95fc578eb4b 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/StaticMethodLoader.php @@ -28,7 +28,7 @@ class StaticMethodLoader implements LoaderInterface * * @param string $methodName The name of the static method to call */ - public function __construct(string $methodName = 'loadValidatorMetadata') + public function __construct($methodName = 'loadValidatorMetadata') { $this->methodName = $methodName; } @@ -49,7 +49,7 @@ public function loadClassMetadata(ClassMetadata $metadata) } if (!$reflMethod->isStatic()) { - throw new MappingException(sprintf('The method "%s::%s()" should be static.', $reflClass->name, $this->methodName)); + throw new MappingException(sprintf('The method %s::%s should be static', $reflClass->name, $this->methodName)); } if ($reflMethod->getDeclaringClass()->name != $reflClass->name) { diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php index 66cfe8ff6f4..0c6c19b7f6f 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php @@ -12,7 +12,6 @@ namespace Symfony\Component\Validator\Mapping\Loader; use Symfony\Component\Config\Util\XmlUtils; -use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Exception\MappingException; use Symfony\Component\Validator\Mapping\ClassMetadata; @@ -36,7 +35,19 @@ class XmlFileLoader extends FileLoader public function loadClassMetadata(ClassMetadata $metadata) { if (null === $this->classes) { - $this->loadClassesFromXml(); + // This method may throw an exception. Do not modify the class' + // state before it completes + $xml = $this->parseFile($this->file); + + $this->classes = array(); + + foreach ($xml->namespace as $namespace) { + $this->addNamespaceAlias((string) $namespace['prefix'], trim((string) $namespace)); + } + + foreach ($xml->class as $class) { + $this->classes[(string) $class['name']] = $class; + } } if (isset($this->classes[$metadata->getClassName()])) { @@ -50,30 +61,16 @@ public function loadClassMetadata(ClassMetadata $metadata) return false; } - /** - * Return the names of the classes mapped in this file. - * - * @return string[] - */ - public function getMappedClasses() - { - if (null === $this->classes) { - $this->loadClassesFromXml(); - } - - return array_keys($this->classes); - } - /** * Parses a collection of "constraint" XML nodes. * * @param \SimpleXMLElement $nodes The XML nodes * - * @return Constraint[] + * @return array The Constraint instances */ protected function parseConstraints(\SimpleXMLElement $nodes) { - $constraints = []; + $constraints = array(); foreach ($nodes as $node) { if (\count($node) > 0) { @@ -84,9 +81,9 @@ protected function parseConstraints(\SimpleXMLElement $nodes) } elseif (\count($node->option) > 0) { $options = $this->parseOptions($node->option); } else { - $options = []; + $options = array(); } - } elseif ('' !== (string) $node) { + } elseif (\strlen((string) $node) > 0) { $options = XmlUtils::phpize(trim($node)); } else { $options = null; @@ -103,11 +100,11 @@ protected function parseConstraints(\SimpleXMLElement $nodes) * * @param \SimpleXMLElement $nodes The XML nodes * - * @return array + * @return array The values */ protected function parseValues(\SimpleXMLElement $nodes) { - $values = []; + $values = array(); foreach ($nodes as $node) { if (\count($node) > 0) { @@ -116,7 +113,7 @@ protected function parseValues(\SimpleXMLElement $nodes) } elseif (\count($node->constraint) > 0) { $value = $this->parseConstraints($node->constraint); } else { - $value = []; + $value = array(); } } else { $value = trim($node); @@ -137,11 +134,11 @@ protected function parseValues(\SimpleXMLElement $nodes) * * @param \SimpleXMLElement $nodes The XML nodes * - * @return array + * @return array The options */ protected function parseOptions(\SimpleXMLElement $nodes) { - $options = []; + $options = array(); foreach ($nodes as $node) { if (\count($node) > 0) { @@ -150,7 +147,7 @@ protected function parseOptions(\SimpleXMLElement $nodes) } elseif (\count($node->constraint) > 0) { $value = $this->parseConstraints($node->constraint); } else { - $value = []; + $value = array(); } } else { $value = XmlUtils::phpize($node); @@ -168,11 +165,13 @@ protected function parseOptions(\SimpleXMLElement $nodes) /** * Loads the XML class descriptions from the given file. * - * @return \SimpleXMLElement + * @param string $path The path of the XML file + * + * @return \SimpleXMLElement The class descriptions * * @throws MappingException If the file could not be loaded */ - protected function parseFile(string $path) + protected function parseFile($path) { try { $dom = XmlUtils::loadFile($path, __DIR__.'/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd'); @@ -183,23 +182,6 @@ protected function parseFile(string $path) return simplexml_import_dom($dom); } - private function loadClassesFromXml() - { - // This method may throw an exception. Do not modify the class' - // state before it completes - $xml = $this->parseFile($this->file); - - $this->classes = []; - - foreach ($xml->namespace as $namespace) { - $this->addNamespaceAlias((string) $namespace['prefix'], trim((string) $namespace)); - } - - foreach ($xml->class as $class) { - $this->classes[(string) $class['name']] = $class; - } - } - private function loadClassMetadataFromXml(ClassMetadata $metadata, \SimpleXMLElement $classDescription) { if (\count($classDescription->{'group-sequence-provider'}) > 0) { diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php index 5a242b02567..6017c3f44d2 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFilesLoader.php @@ -24,7 +24,7 @@ class XmlFilesLoader extends FilesLoader /** * {@inheritdoc} */ - public function getFileLoaderInstance(string $file) + public function getFileLoaderInstance($file) { return new XmlFileLoader($file); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php index 8d44ad60eaa..d1ec7f037d5 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php @@ -11,11 +11,9 @@ namespace Symfony\Component\Validator\Mapping\Loader; -use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser as YamlParser; -use Symfony\Component\Yaml\Yaml; /** * Loads validation metadata from a YAML file. @@ -44,7 +42,19 @@ class YamlFileLoader extends FileLoader public function loadClassMetadata(ClassMetadata $metadata) { if (null === $this->classes) { - $this->loadClassesFromYaml(); + if (null === $this->yamlParser) { + $this->yamlParser = new YamlParser(); + } + + $this->classes = $this->parseFile($this->file); + + if (isset($this->classes['namespaces'])) { + foreach ($this->classes['namespaces'] as $alias => $namespace) { + $this->addNamespaceAlias($alias, $namespace); + } + + unset($this->classes['namespaces']); + } } if (isset($this->classes[$metadata->getClassName()])) { @@ -58,30 +68,16 @@ public function loadClassMetadata(ClassMetadata $metadata) return false; } - /** - * Return the names of the classes mapped in this file. - * - * @return string[] - */ - public function getMappedClasses() - { - if (null === $this->classes) { - $this->loadClassesFromYaml(); - } - - return array_keys($this->classes); - } - /** * Parses a collection of YAML nodes. * * @param array $nodes The YAML nodes * - * @return array + * @return array An array of values or Constraint instances */ protected function parseNodes(array $nodes) { - $values = []; + $values = array(); foreach ($nodes as $name => $childNodes) { if (is_numeric($name) && \is_array($childNodes) && 1 === \count($childNodes)) { @@ -107,20 +103,24 @@ protected function parseNodes(array $nodes) /** * Loads the YAML class descriptions from the given file. * + * @param string $path The path of the YAML file + * + * @return array The class descriptions + * * @throws \InvalidArgumentException If the file could not be loaded or did * not contain a YAML array */ - private function parseFile(string $path): array + private function parseFile($path) { try { - $classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT); + $classes = $this->yamlParser->parse(file_get_contents($path)); } catch (ParseException $e) { - throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: ', $path).$e->getMessage(), 0, $e); + throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e); } // empty file if (null === $classes) { - return []; + return array(); } // not an array @@ -131,23 +131,12 @@ private function parseFile(string $path): array return $classes; } - private function loadClassesFromYaml() - { - if (null === $this->yamlParser) { - $this->yamlParser = new YamlParser(); - } - - $this->classes = $this->parseFile($this->file); - - if (isset($this->classes['namespaces'])) { - foreach ($this->classes['namespaces'] as $alias => $namespace) { - $this->addNamespaceAlias($alias, $namespace); - } - - unset($this->classes['namespaces']); - } - } - + /** + * Loads the validation metadata from the given YAML class description. + * + * @param ClassMetadata $metadata The metadata to load + * @param array $classDescription The YAML class description + */ private function loadClassMetadataFromYaml(ClassMetadata $metadata, array $classDescription) { if (isset($classDescription['group_sequence_provider'])) { diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php index f32c67c74d9..235856f5b98 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFilesLoader.php @@ -24,7 +24,7 @@ class YamlFilesLoader extends FilesLoader /** * {@inheritdoc} */ - public function getFileLoaderInstance(string $file) + public function getFileLoaderInstance($file) { return new YamlFileLoader($file); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php index 33934c62836..565f2f4d407 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/MemberMetadata.php @@ -12,8 +12,8 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Constraints\Composite; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; +use Symfony\Component\Validator\ValidationVisitorInterface; /** * Stores all metadata needed for validating a class property. @@ -27,7 +27,7 @@ * * @see PropertyMetadataInterface */ -abstract class MemberMetadata extends GenericMetadata implements PropertyMetadataInterface +abstract class MemberMetadata extends ElementMetadata implements PropertyMetadataInterface { /** * @internal This property is public in order to reduce the size of the @@ -53,26 +53,44 @@ abstract class MemberMetadata extends GenericMetadata implements PropertyMetadat /** * @var \ReflectionMethod[]|\ReflectionProperty[] */ - private $reflMember = []; + private $reflMember = array(); /** * @param string $class The name of the class this member is defined on * @param string $name The name of the member * @param string $property The property the member belongs to */ - public function __construct(string $class, string $name, string $property) + public function __construct($class, $name, $property) { $this->class = $class; $this->name = $name; $this->property = $property; } + /** + * {@inheritdoc} + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + + $visitor->visit($this, $value, $group, $propertyPath); + + if ($this->isCascaded()) { + $visitor->validate($value, $propagatedGroup ?: $group, $propertyPath, $this->isCollectionCascaded(), $this->isCollectionCascadedDeeply()); + } + } + /** * {@inheritdoc} */ public function addConstraint(Constraint $constraint) { - $this->checkConstraint($constraint); + if (!\in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets())) { + throw new ConstraintDefinitionException(sprintf('The constraint %s cannot be put on properties or getters', \get_class($constraint))); + } parent::addConstraint($constraint); @@ -84,11 +102,11 @@ public function addConstraint(Constraint $constraint) */ public function __sleep() { - return array_merge(parent::__sleep(), [ + return array_merge(parent::__sleep(), array( 'class', 'name', 'property', - ]); + )); } /** @@ -153,12 +171,59 @@ public function isPrivate($objectOrClassName) return $this->getReflectionMember($objectOrClassName)->isPrivate(); } + /** + * Returns whether objects stored in this member should be validated. + * + * @return bool + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link getCascadingStrategy()} instead. + */ + public function isCascaded() + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the getCascadingStrategy() method instead.', E_USER_DEPRECATED); + + return (bool) ($this->cascadingStrategy & CascadingStrategy::CASCADE); + } + + /** + * Returns whether arrays or traversable objects stored in this member + * should be traversed and validated in each entry. + * + * @return bool + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link getTraversalStrategy()} instead. + */ + public function isCollectionCascaded() + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED); + + return (bool) ($this->traversalStrategy & (TraversalStrategy::IMPLICIT | TraversalStrategy::TRAVERSE)); + } + + /** + * Returns whether arrays or traversable objects stored in this member + * should be traversed recursively for inner arrays/traversable objects. + * + * @return bool + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link getTraversalStrategy()} instead. + */ + public function isCollectionCascadedDeeply() + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED); + + return !($this->traversalStrategy & TraversalStrategy::STOP_RECURSION); + } + /** * Returns the reflection instance for accessing the member's value. * * @param object|string $objectOrClassName The object or the class name * - * @return \ReflectionMethod|\ReflectionProperty + * @return \ReflectionMethod|\ReflectionProperty The reflection instance */ public function getReflectionMember($objectOrClassName) { @@ -173,22 +238,11 @@ public function getReflectionMember($objectOrClassName) /** * Creates a new reflection instance for accessing the member's value. * + * Must be implemented by subclasses. + * * @param object|string $objectOrClassName The object or the class name * - * @return \ReflectionMethod|\ReflectionProperty + * @return \ReflectionMethod|\ReflectionProperty The reflection instance */ abstract protected function newReflectionMember($objectOrClassName); - - private function checkConstraint(Constraint $constraint) - { - if (!\in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets(), true)) { - throw new ConstraintDefinitionException(sprintf('The constraint "%s" cannot be put on properties or getters.', get_debug_type($constraint))); - } - - if ($constraint instanceof Composite) { - foreach ($constraint->getNestedConstraints() as $nestedConstraint) { - $this->checkConstraint($nestedConstraint); - } - } - } } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php index efb32ce7267..1e9d3c8929b 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/MetadataInterface.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Validator\Mapping; use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\MetadataInterface as LegacyMetadataInterface; /** * A container for validation metadata. @@ -28,12 +29,12 @@ * @see CascadingStrategy * @see TraversalStrategy */ -interface MetadataInterface +interface MetadataInterface extends LegacyMetadataInterface { /** * Returns the strategy for cascading objects. * - * @return int + * @return int The cascading strategy * * @see CascadingStrategy */ @@ -42,7 +43,7 @@ public function getCascadingStrategy(); /** * Returns the strategy for traversing traversable objects. * - * @return int + * @return int The traversal strategy * * @see TraversalStrategy */ @@ -51,16 +52,7 @@ public function getTraversalStrategy(); /** * Returns all constraints of this element. * - * @return Constraint[] + * @return Constraint[] A list of Constraint instances */ public function getConstraints(); - - /** - * Returns all constraints for a given validation group. - * - * @param string $group The validation group - * - * @return Constraint[] - */ - public function findConstraints(string $group); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php index 8c18e5dcd9c..b03a059f843 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadata.php @@ -34,10 +34,10 @@ class PropertyMetadata extends MemberMetadata * * @throws ValidatorException */ - public function __construct(string $class, string $name) + public function __construct($class, $name) { if (!property_exists($class, $name)) { - throw new ValidatorException(sprintf('Property "%s" does not exist in class "%s".', $name, $class)); + throw new ValidatorException(sprintf('Property "%s" does not exist in class "%s"', $name, $class)); } parent::__construct($class, $name, $name); @@ -48,26 +48,7 @@ public function __construct(string $class, string $name) */ public function getPropertyValue($object) { - $reflProperty = $this->getReflectionMember($object); - - if (\PHP_VERSION_ID >= 70400 && $reflProperty->hasType() && !$reflProperty->isInitialized($object)) { - // There is no way to check if a property has been unset or if it is uninitialized. - // When trying to access an uninitialized property, __get method is triggered. - - // If __get method is not present, no fallback is possible - // Otherwise we need to catch an Error in case we are trying to access an uninitialized but set property. - if (!method_exists($object, '__get')) { - return null; - } - - try { - return $reflProperty->getValue($object); - } catch (\Error $e) { - return null; - } - } - - return $reflProperty->getValue($object); + return $this->getReflectionMember($object)->getValue($object); } /** diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php index f4bbbb907df..d7a4114d44f 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/PropertyMetadataInterface.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Validator\Mapping; +use Symfony\Component\Validator\ClassBasedInterface; +use Symfony\Component\Validator\PropertyMetadataInterface as LegacyPropertyMetadataInterface; + /** * Stores all metadata needed for validating the value of a class property. * @@ -27,21 +30,6 @@ * @see CascadingStrategy * @see TraversalStrategy */ -interface PropertyMetadataInterface extends MetadataInterface +interface PropertyMetadataInterface extends MetadataInterface, LegacyPropertyMetadataInterface, ClassBasedInterface { - /** - * Returns the name of the property. - * - * @return string - */ - public function getPropertyName(); - - /** - * Extracts the value of the property from the given container. - * - * @param mixed $containingValue The container to extract the property value from - * - * @return mixed - */ - public function getPropertyValue($containingValue); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php b/upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php index 0df5a7ee8a9..164992b2eab 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/TraversalStrategy.php @@ -33,18 +33,28 @@ class TraversalStrategy * Specifies that a node's value should be iterated only if it is an * instance of {@link \Traversable}. */ - public const IMPLICIT = 1; + const IMPLICIT = 1; /** * Specifies that a node's value should never be iterated. */ - public const NONE = 2; + const NONE = 2; /** * Specifies that a node's value should always be iterated. If the value is * not an instance of {@link \Traversable}, an exception should be thrown. */ - public const TRAVERSE = 4; + const TRAVERSE = 4; + + /** + * Specifies that nested instances of {@link \Traversable} should never be + * iterated. Can be combined with {@link IMPLICIT} or {@link TRAVERSE}. + * + * @deprecated since version 2.5, to be removed in 3.0. This constant was added for backwards compatibility only. + * + * @internal + */ + const STOP_RECURSION = 8; /** * Not instantiable. diff --git a/upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php b/upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php index 6f3ac5e2f6b..5f9cdad8796 100644 --- a/upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php +++ b/upload/system/storage/vendor/symfony/validator/ObjectInitializerInterface.php @@ -14,13 +14,18 @@ /** * Prepares an object for validation. * - * Concrete implementations of this interface are used by {@link Validator\ContextualValidatorInterface} - * to initialize objects just before validating them. + * Concrete implementations of this interface are used by {@link ValidationVisitorInterface} + * and {@link Validator\ContextualValidatorInterface} to initialize objects just before validating them. * * @author Fabien Potencier * @author Bernhard Schussek */ interface ObjectInitializerInterface { - public function initialize(object $object); + /** + * Initializes an object just before validation. + * + * @param object $object The object to validate + */ + public function initialize($object); } diff --git a/upload/system/storage/vendor/symfony/validator/README.md b/upload/system/storage/vendor/symfony/validator/README.md index 8f3fd0efb25..3ccb2901ade 100644 --- a/upload/system/storage/vendor/symfony/validator/README.md +++ b/upload/system/storage/vendor/symfony/validator/README.md @@ -7,10 +7,10 @@ The Validator component provides tools to validate values following the Resources --------- - * [Documentation](https://symfony.com/doc/current/components/validator.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/validator.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) -[1]: https://jcp.org/en/jsr/detail?id=303 +[1]: http://jcp.org/en/jsr/detail?id=303 diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf index 61b9eac232c..177bb0038f5 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.af.xlf @@ -222,166 +222,6 @@ Unsupported card type or invalid card number. Nie-ondersteunde tipe kaart of ongeldige kredietkaart nommer. - - This is not a valid International Bank Account Number (IBAN). - Hierdie is nie 'n geldige Internationale Bank Rekening Nommer (IBAN) nie. - - - This value is not a valid ISBN-10. - Hierdie waarde is nie 'n geldige ISBN-10 nie. - - - This value is not a valid ISBN-13. - Hierdie waarde is nie 'n geldige ISBN-13 nie. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Hierdie waarde is nie 'n geldige ISBN-10 of ISBN-13 nie. - - - This value is not a valid ISSN. - Hierdie waarde is nie 'n geldige ISSN nie. - - - This value is not a valid currency. - Hierdie waarde is nie 'n geldige geldeenheid nie. - - - This value should be equal to {{ compared_value }}. - Hierdie waarde moet gelyk aan {{ compared_value }} wees. - - - This value should be greater than {{ compared_value }}. - Hierdie waarde moet meer as {{ compared_value }} wees. - - - This value should be greater than or equal to {{ compared_value }}. - Hierdie waarde moet meer of gelyk aan {{ compared_value }} wees. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Hierdie waarde moet identies aan {{ compared_value_type }} {{ compared_value }} wees. - - - This value should be less than {{ compared_value }}. - Hierdie waarde moet minder as {{ compared_value }} wees. - - - This value should be less than or equal to {{ compared_value }}. - Hierdie waarde moet minder of gelyk aan {{ compared_value }} wees. - - - This value should not be equal to {{ compared_value }}. - Hierdie waarde moet nie dieselfde as {{ compared_value }} wees nie. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Hierdie waarde moet nie identies as {{ compared_value_type }} {{ compared_value }} wees nie. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Die beeld aspek is te groot ({{ ratio }}). Die maksimum toegelate aspek is {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Die beeld aspek is te klein ({{ ratio }}). Die minimum toegelate aspek is {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Die beeld is vierkantig ({{ width }}x{{ height }}px). Vierkantige beelde word nie toegelaat nie. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Die beeld is landskap georiënteerd ({{ width }}x{{ height }}px). Landskap georiënteerde beelde word nie toegelaat nie. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Die beeld dis portret georiënteerd ({{ width }}x{{ height }}px). Portret georiënteerde beelde word nie toegelaat nie. - - - An empty file is not allowed. - 'n Leë lêer word nie toegelaat nie. - - - The host could not be resolved. - Die gasheer kon nie opgelos word nie. - - - This value does not match the expected {{ charset }} charset. - Die waarde stem nie ooreen met die verwagte {{ charset }} karakterstel nie. - - - This is not a valid Business Identifier Code (BIC). - Hierdie is nie 'n geldige Besigheids Identifikasie Kode (BIC) nie. - - - Error - Fout - - - This is not a valid UUID. - Hierdie is nie 'n geldige UUID nie. - - - This value should be a multiple of {{ compared_value }}. - Hierdie waarde moet 'n veelvoud van {{ compared_value }} wees. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Hierdie Besigheids Identifikasie Kode (BIK) is nie geassosieer met IBAN {{ iban }} nie. - - - This value should be valid JSON. - Hierdie waarde moet geldige JSON wees. - - - This collection should contain only unique elements. - Hierdie versameling moet net unieke elemente bevat. - - - This value should be positive. - Hierdie waarde moet positief wees. - - - This value should be either positive or zero. - Hierdie waarde moet positief of nul wees. - - - This value should be negative. - Hierdie waarde moet negatief wees. - - - This value should be either negative or zero. - Hierdie waarde moet negatief of nul wees. - - - This value is not a valid timezone. - Hierdie waarde is nie 'n geldige tydsone nie. - - - This value should be between {{ min }} and {{ max }}. - Hierdie waarde moet tussen {{ min }} en {{ max }} wees. - - - This value is not a valid hostname. - Hierdie waarde is nie 'n geldige gasheernaam nie. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Die hoeveelheid elemente in hierdie versameling moet 'n meelvoud van {{ compared_value }} wees. - - - This value should satisfy at least one of the following constraints: - Hierdie waarde moet voldoen aan ten minste een van hierdie beperkings: - - - Each element of this collection should satisfy its own set of constraints. - Elke element van hierdie versameling moet voldoen aan hulle eie beperkings. - - - This value is not a valid International Securities Identification Number (ISIN). - Hierdie waarde is nie 'n geldige Internasionale veiligheidsidentifikasienommer (ISIN) nie. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf index 6aa0d594843..4950e0ccd11 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ar.xlf @@ -310,98 +310,6 @@ This value does not match the expected {{ charset }} charset. هذه القيمة غير متطابقة مع صيغة التحويل {{ charset }}. - - This is not a valid Business Identifier Code (BIC). - هذه القيمة ليست رمز معرّ٠نشاط تجاري صالح (BIC). - - - Error - خطأ - - - This is not a valid UUID. - هذا ليس UUID صالح. - - - This value should be a multiple of {{ compared_value }}. - هذه القيمة يجب أن تكون مضاع٠ل {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - رمز المعرّ٠نشاط تجاري (BIC) هذا لا يرتبط مع IBAN {{ iban }}. - - - This value should be valid JSON. - هذه القيمة يجب أن تكون صالحة Ù„ JSON. - - - This collection should contain only unique elements. - يجب أن تحتوي هذه المجموعة علي عناصر Ùريدة Ùقط. - - - This value should be positive. - يجب أن تكون هذه القيمة موجبة. - - - This value should be either positive or zero. - يجب أن تكون هذه القيمة إما موجبة او صÙر. - - - This value should be negative. - يجب أن تكون هذه القيمة سالبة. - - - This value should be either negative or zero. - يجب أن تكون هذه القيمة إما سالبة او صÙر. - - - This value is not a valid timezone. - هذه القيمة ليست منطقة زمنية صحيحة. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - تم تسريب كلمة المرور هذه ÙÙŠ خرق للبيانات، ويجب عدم استخدامها. يرجي استخدام كلمة مرور أخري. - - - This value should be between {{ min }} and {{ max }}. - يجب أن تكون هذه القيمة بين {{ min }} Ùˆ {{ max }}. - - - This value is not a valid hostname. - هذه القيمة ليست اسم مضي٠صالح. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - يجب أن يكون عدد العناصر ÙÙŠ هذه المجموعة مضاع٠{{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - يجب أن تستوÙÙŠ هذه القيمة واحدة من القيود التالية: - - - Each element of this collection should satisfy its own set of constraints. - يجب أن ÙŠÙÙŠ كل عنصر من عناصر هذه المجموعة بمجموعة القيود الخاصة به. - - - This value is not a valid International Securities Identification Number (ISIN). - صالح (ISIN) هذه القيمة ليست رقم تعري٠الأوراق المالية الدولي. - - - This value should be a valid expression. - يجب أن تكون هذه القيمة تعبيرًا صالحًا. - - - This value is not a valid CSS color. - هذه القيمة ليست لون CSS صالحًا. - - - This value is not a valid CIDR notation. - هذه القيمة ليست تدوين CIDR صالحًا. - - - The value of the netmask should be between {{ min }} and {{ max }}. - يجب أن تكون قيمة netmask بين {{ min }} Ùˆ {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf index 59480874fd3..add868cd42b 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.az.xlf @@ -222,170 +222,6 @@ Unsupported card type or invalid card number. DÉ™stÉ™klÉ™nmÉ™yÉ™n kart tipi vÉ™ ya yanlış kart nömrÉ™si. - - This is not a valid International Bank Account Number (IBAN). - Bu dÉ™yÉ™r doÄŸru bir BeynÉ™lxalq Bank Hesap NömrÉ™si (IBAN) deyil. - - - This value is not a valid ISBN-10. - Bu dÉ™yÉ™r doÄŸru bir ISBN-10 deyil. - - - This value is not a valid ISBN-13. - Bu dÉ™yÉ™r doÄŸru bir ISBN-13 deyil. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Bu dÉ™yÉ™r doÄŸru bir ISBN-10 vÉ™ ya ISBN-13 deyil. - - - This value is not a valid ISSN. - Bu dÉ™yÉ™r doÄŸru bir ISSN deyil. - - - This value is not a valid currency. - Bu dÉ™yÉ™r doÄŸru bir valyuta deyil. - - - This value should be equal to {{ compared_value }}. - Bu dÉ™yÉ™r {{ compared_value }} ilÉ™ bÉ™rabÉ™r olmalıdır. - - - This value should be greater than {{ compared_value }}. - Bu dÉ™yÉ™r {{ compared_value }} dÉ™yÉ™rindÉ™n büyük olmalıdır. - - - This value should be greater than or equal to {{ compared_value }}. - Bu dÉ™yÉ™r {{ compared_value }} ilÉ™ bÉ™rabÉ™r vÉ™ ya daha böyük olmaldır. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Bu dÉ™yÉ™r {{ compared_value_type }} {{ compared_value }} ilÉ™ eyni olmalıdır. - - - This value should be less than {{ compared_value }}. - Bu dÉ™yÉ™r {{ compared_value }} dÉ™yÉ™rindÉ™n kiçik olmalıdır. - - - This value should be less than or equal to {{ compared_value }}. - Bu dÉ™yÉ™r {{ compared_value }} dÉ™yÉ™rindÉ™n kiçik vÉ™ ya bÉ™rabÉ™r olmalıdır. - - - This value should not be equal to {{ compared_value }}. - Bu deÄŸer {{ compared_value }} ile eÅŸit olmamalıdır. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Bu dÉ™yÉ™r {{ compared_value_type }} {{ compared_value }} ilÉ™ eyni olmamalıdır. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Şəkil nisbÉ™ti çox büyükdür ({{ ratio }}). Ä°cazÉ™ verilÉ™n maksimum nisbÉ™t: {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Şəkil nisbÉ™ti çox balacadır ({{ ratio }}). Ä°cazÉ™ verilÉ™n minimum nisbÉ™t: {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Şəkil kvadratdır ({{ width }}x{{ height }}px). Kvadrat ÅŸÉ™killÉ™rÉ™ icazÉ™ verilmir. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Şəkil albom rejimindÉ™dir ({{ width }}x{{ height }}px). Albom rejimli ÅŸÉ™killÉ™rÉ™ icazÉ™ verilmir. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Şəkil portret rejimindÉ™dir ({{ width }}x{{ height }}px). Portret rejimli ÅŸÉ™killÉ™rÉ™ icazÉ™ verilmir. - - - An empty file is not allowed. - BoÅŸ fayla icazÉ™ verilmir. - - - The host could not be resolved. - Ãœnvan tapılmadı. - - - This value does not match the expected {{ charset }} charset. - Bu dÉ™yÉ™r gözlÉ™nilÉ™n {{ charset }} simvol cÉ™dvÉ™li ilÉ™ uyÄŸun gÉ™lmir. - - - This is not a valid Business Identifier Code (BIC). - Bu dÉ™yÉ™r doÄŸru bir Biznes TÉ™yinedici Kodu (BIC) deyil. - - - Error - XÉ™ta - - - This is not a valid UUID. - Bu dÉ™yÉ™r doÄŸru bir UUID deyil. - - - This value should be a multiple of {{ compared_value }}. - Bu dÉ™yÉ™r {{ compare_value }} dÉ™yÉ™rinin bölÉ™nlÉ™rindÉ™n biri olmalıdır. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Bu Biznes TÉ™yinedici Kodu (BIC) {{ iban }} IBAN kodu ilÉ™ É™laqÉ™li deyil. - - - This value should be valid JSON. - Bu dÉ™yÉ™r doÄŸru bir JSON olmalıdır. - - - This collection should contain only unique elements. - Bu kolleksiyada sadÉ™cÉ™ unikal elementlÉ™r olmalıdır. - - - This value should be positive. - Bu dÉ™yÉ™r müsbÉ™t olmalıdır. - - - This value should be either positive or zero. - Bu dÉ™yÉ™r müsbÉ™t vÉ™ ya sıfır olmalıdır. - - - This value should be negative. - Bu dÉ™yÉ™r mÉ™nfi olmaldır. - - - This value should be either negative or zero. - Bu dÉ™yÉ™r mÉ™nfi vÉ™ ya sıfır olmaldır. - - - This value is not a valid timezone. - Bu dÉ™yÉ™r doÄŸru bir zaman zolağı deyil. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Bu parol data oÄŸurluÄŸunda tapıldığı üçün iÅŸlÉ™dilmÉ™mÉ™lidir. ZÉ™hmÉ™t olmasa, baÅŸqa parol seçin. - - - This value should be between {{ min }} and {{ max }}. - Bu dÉ™yÉ™r {{ min }} vÉ™ {{ max }} arasında olmaldır. - - - This value is not a valid hostname. - Bu dÉ™yÉ™r doÄŸru bir host adı deyil. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Bu kolleksiyadakı elementlerin sayı {{ compared_value }} tam bölünÉ™ni olmalıdır. - - - This value should satisfy at least one of the following constraints: - Bu dÉ™yÉ™r aÅŸağıdakı mÉ™cburiyyÉ™tlÉ™rdÉ™n birini qarşılamalıdır: - - - Each element of this collection should satisfy its own set of constraints. - Bu kolleksiyadakı hÉ™r element öz mÉ™cburiyyÉ™tlÉ™rini qarşılamalıdır. - - - This value is not a valid International Securities Identification Number (ISIN). - Bu dÉ™yÉ™r doÄŸru bir QiymÉ™tli Kağızın BeynÉ™lxalq Ä°dentifikasiya Kodu (ISIN) deyil. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf deleted file mode 100644 index 648955684ba..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.be.xlf +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - This value should be false. - ЗначÑнне павінна быць Ðе. - - - This value should be true. - ЗначÑнне павінна быць Так. - - - This value should be of type {{ type }}. - Тып значÑÐ½Ð½Ñ Ð¿Ð°Ð²Ñ–Ð½ÐµÐ½ быць {{ type }}. - - - This value should be blank. - ЗначÑнне павінна быць пуÑтым. - - - The value you selected is not a valid choice. - Ðбранае вамі значÑнне не Ñапраўднае. - - - You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - Ð’Ñ‹ павінны выбраць Ñ…Ð°Ñ†Ñ Ð± {{ limit }} варыÑнт.|Ð’Ñ‹ павінны выбраць Ñ…Ð°Ñ†Ñ Ð± {{ limit }} варыÑнтаў. - - - You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - Ð’Ñ‹ павінны выбраць не больш за {{ limit }} варыÑнт.|Ð’Ñ‹ павінны выбраць не больш за {{ limit }} варыÑнтаў. - - - One or more of the given values is invalid. - Ðдзін або некалькі пазначаных значÑннÑÑž з'ÑўлÑецца неÑапраўдным. - - - This field was not expected. - ГÑта поле не чакаецца. - - - This field is missing. - ГÑта поле адÑутнічае. - - - This value is not a valid date. - ГÑта значÑнне не з'ÑўлÑецца карÑктнай датай. - - - This value is not a valid datetime. - ГÑта значÑнне не з'ÑўлÑецца карÑктнай датай i чаÑом. - - - This value is not a valid email address. - ГÑта значÑнне не з'ÑўлÑецца карÑктным адраÑам Ñлектроннай пошты. - - - The file could not be found. - Файл не знойдзен. - - - The file is not readable. - Файл не чытаецца. - - - The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Файл занадта вÑлікі ({{ size }} {{ suffix }}). МакÑімальна дазволены памер {{ limit }} {{ suffix }}. - - - The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - MIME-тып файлу некарÑкты ({{ type }}). Ð”Ð°Ð·Ð²Ð¾Ð»ÐµÐ½Ñ‹Ñ MIME-тыпы файлу {{ types }}. - - - This value should be {{ limit }} or less. - ЗначÑнне павінна быць {{ limit }} або менш. - - - This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - ЗначÑнне занадта доўгае. Яно павінна мець {{ limit }} Ñімвал або менш.|ЗначÑнне занадта доўгае. Яно павінна мець {{ limit }} Ñімвалаў або менш. - - - This value should be {{ limit }} or more. - ЗначÑнне павінна быць {{ limit }} або больш. - - - This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - ЗначÑнне занадта кароткае. Яно павінна мець прынамÑÑ– {{ limit }} Ñімвал.|ЗначÑнне занадта кароткае. Яно павінна мець прынамÑÑ– {{ limit }} Ñімвалаў. - - - This value should not be blank. - ЗначÑнне не павінна быць пуÑтым. - - - This value should not be null. - ЗначÑнне не павінна быць null. - - - This value should be null. - ЗначÑнне павінна быць null. - - - This value is not valid. - ЗначÑнне з'ÑўлÑецца не Ñапраўдным. - - - This value is not a valid time. - ЗначÑнне не з'ÑўлÑецца Ñапраўдным чаÑам. - - - This value is not a valid URL. - ЗначÑнне не з'ÑўлÑецца Ñапраўдным URL-адраÑам. - - - The two values should be equal. - Ðбодва значÑнні павінны быць аднолькавымі. - - - The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Файл занадта вÑлікі. МакÑімальна дазволены памер {{ limit }} {{ suffix }}. - - - The file is too large. - Файл занадта вÑлікі. - - - The file could not be uploaded. - Ðемагчыма запампаваць файл. - - - This value should be a valid number. - ЗначÑнне павінна быць лікам. - - - This file is not a valid image. - ГÑÑ‚Ñ‹ файл не з'ÑўлÑецца Ñапраўднай выÑвай. - - - This is not a valid IP address. - ЗначÑнне не з'ÑўлÑецца Ñапраўдным IP-адраÑам. - - - This value is not a valid language. - ЗначÑнне не з'ÑўлÑецца Ñапраўдным мовай. - - - This value is not a valid locale. - ЗначÑнне не з'ÑўлÑецца Ñапраўднай лакаллю. - - - This value is not a valid country. - ЗначÑнне не з'ÑўлÑецца Ñапраўднай краінай. - - - This value is already used. - ГÑта значÑнне ўжо выкарыÑтоўваецца. - - - The size of the image could not be detected. - Ðемагчыма вызначыць памер выÑвы. - - - The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - ГÑта выÑва занадта вÑÐ»Ñ–ÐºÐ°Ñ ({{ width }}px). ДазвалÑецца макÑÑ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ ÑˆÑ‹Ñ€Ñ‹Ð½Ñ {{ max_width }}px. - - - The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - ГÑта выÑва занадта Ð¼Ð°Ð»ÐµÐ½ÑŒÐºÐ°Ñ ({{ width }}px). ДазвалÑецца Ð¼Ñ–Ð½Ñ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ ÑˆÑ‹Ñ€Ñ‹Ð½Ñ {{ min_width }}px. - - - The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - ГÑÑ‚Ñ‹ выÑва занадта вÑÐ»Ñ–ÐºÐ°Ñ ({{ width }}px). ДазвалÑецца макÑÑ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð²Ñ‹ÑˆÑ‹Ð½Ñ {{ max_width }}px. - - - The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - ГÑта выÑва занадта Ð¼Ð°Ð»ÐµÐ½ÑŒÐºÐ°Ñ ({{ width }}px). ДазвалÑецца Ð¼Ñ–Ð½Ñ–Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð²Ñ‹ÑˆÑ‹Ð½Ñ {{ min_width }}px. - - - This value should be the user's current password. - ЗначÑнне павінна быць цÑперашнім паролем карыÑтальніка. - - - This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - ЗначÑнне павінна мець {{ limit }} Ñімвал.|ЗначÑнне павінна мець {{ limit }} Ñімвалаў. - - - The file was only partially uploaded. - Файл быў запампаваны толькі чаÑткова. - - - No file was uploaded. - Файл не быў запампаваны. - - - No temporary folder was configured in php.ini. - У php.ini не была налажана чаÑÐ¾Ð²Ð°Ñ Ð¿Ð°Ð¿ÐºÐ°, або чаÑÐ¾Ð²Ð°Ñ Ð¿Ð°Ð¿ÐºÐ° не Ñ–Ñнуе. - - - Cannot write temporary file to disk. - Ðемагчыма запіÑаць чаÑовы файл на дыÑк. - - - A PHP extension caused the upload to fail. - ПашырÑнне PHP выклікала памылку загрузкі. - - - This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць прынамÑÑ– {{ limit }} Ñлемент.|ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць прынамÑÑ– {{ limit }} Ñлементаў. - - - This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць {{ limit }} або менш Ñлемент.|ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць {{ limit }} або менш Ñлементаў. - - - This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць роўна {{ limit }} Ñлемент.|ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць роўна {{ limit }} Ñлементаў. - - - Invalid card number. - ÐеÑапраўдны нумар карты. - - - Unsupported card type or invalid card number. - Тып карты не падтрымліваецца або неÑапраўдны нумар карты. - - - This is not a valid International Bank Account Number (IBAN). - ÐеÑапраўдны міжнародны нумар банкаўÑкага рахунку (IBAN). - - - This value is not a valid ISBN-10. - ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISBN-10. - - - This value is not a valid ISBN-13. - ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISBN-13. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISBN-10 або ISBN-13. - - - This value is not a valid ISSN. - ГÑта значÑнне не з'ÑўлÑецца Ñапраўдным ISSN. - - - This value is not a valid currency. - ГÑта значÑнне не з'ÑўлÑецца Ñапраўднай валютай. - - - This value should be equal to {{ compared_value }}. - ЗначÑнне павінна раўнÑцца {{ compared_value }}. - - - This value should be greater than {{ compared_value }}. - ЗначÑнне павінна быць больш чым {{ compared_value }}. - - - This value should be greater than or equal to {{ compared_value }}. - ЗначÑнне павінна быць больш чым або раўнÑцца {{ compared_value }}. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - ЗначÑнне павінна быць ідÑнтычным {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - ЗначÑнне павінна быць менш чым {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - ЗначÑнне павінна быць менш чым або раўнÑцца {{ compared_value }}. - - - This value should not be equal to {{ compared_value }}. - ЗначÑнне не павінна раўнÑцца {{ compared_value }}. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - ЗначÑнне не павінна быць ідÑнтычным {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - СуадноÑіны бакоў выÑвы з'ÑўлÑецца занадта вÑлікім ({{ ratio }}). ДазвалÑецца макÑÑ–Ð¼Ð°Ð»ÑŒÐ½Ñ‹Ñ ÑуадноÑіны {{max_ratio}} . - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - СуадноÑіны бакоў выÑвы з'ÑўлÑецца занадта маленькімі ({{ ratio }}). ДазвалÑецца Ð¼Ñ–Ð½Ñ–Ð¼Ð°Ð»ÑŒÐ½Ñ‹Ñ ÑуадноÑіны {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Ð’Ñ‹Ñва ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ð°Ñ ({{width}}x{{height}}px). ÐšÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ñ‹Ñ Ð²Ñ‹Ñвы не дазволены. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Ð’Ñ‹Ñва Ñž альбомнай арыентацыі ({{ width }}x{{ height }}px). Ð’Ñ‹Ñвы Ñž альбомнай арыентацыі не дазволены. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Ð’Ñ‹Ñва Ñž партрÑтнай арыентацыі ({{ width }}x{{ height }}px). Ð’Ñ‹Ñвы Ñž партрÑтнай арыентацыі не дазволены. - - - An empty file is not allowed. - ПуÑÑ‚Ñ‹ файл не дазволены. - - - The host could not be resolved. - Ðе магчыма знайÑці Ñ–Ð¼Ñ Ñ…Ð¾Ñта. - - - This value does not match the expected {{ charset }} charset. - ГÑта значÑнне не Ñупадае з чаканай {{ charset }} кадыроўкай. - - - This is not a valid Business Identifier Code (BIC). - ÐеÑапраўдны банкаўÑкі ідÑнтыфікацыйны код (BIC). - - - Error - Памылка - - - This is not a valid UUID. - ГÑта неÑапраўдны UUID. - - - This value should be a multiple of {{ compared_value }}. - ЗначÑнне павінна быць кратным {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - БанкаўÑкі ідÑнтыфікацыйны код (BIC) не звÑзан з IBAN {{ iban }}. - - - This value should be valid JSON. - ГÑта значÑнне павінна быць у фармаце JSON. - - - This collection should contain only unique elements. - ÐšÐ°Ð»ÐµÐºÑ†Ñ‹Ñ Ð¿Ð°Ð²Ñ–Ð½Ð½Ð° змÑшчаць толькі ÑžÐ½Ñ–ÐºÐ°Ð»ÑŒÐ½Ñ‹Ñ Ñлементы. - - - This value should be positive. - ЗначÑнне павінна быць дадатным. - - - This value should be either positive or zero. - ЗначÑнне павінна быць дадатным ці нуль. - - - This value should be negative. - ЗначÑнне павінна быць адмоўным. - - - This value should be either negative or zero. - ЗначÑнне павінна быць адмоўным ці нуль. - - - This value is not a valid timezone. - ЗначÑнне не з'ÑўлÑецца Ñапраўдным гадзінным поÑÑам. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - ГÑÑ‚Ñ‹ пароль быў выкрадзены Ñž выніку ўзлому дадзеных, таму Ñго нельга выкарыÑтоўваць. Калі лаÑка, выкарыÑтоўвайце іншы пароль. - - - This value should be between {{ min }} and {{ max }}. - ЗначÑнне павінна быць паміж {{min}} Ñ– {{max}}. - - - This value is not a valid hostname. - ЗначÑнне не з'ÑўлÑецца карÑктным імем хаÑта. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - КолькаÑць Ñлементаў у гÑтай калекцыі павінна быць кратным {{compared_value}}. - - - This value should satisfy at least one of the following constraints: - ЗначÑнне павінна задавальнÑць Ñк мінімум аднаму з наÑтупных абмежаваннÑÑž: - - - Each element of this collection should satisfy its own set of constraints. - Кожны Ñлемент гÑтай калекцыі павінен задавальнÑць Ñвайму ўлаÑнаму набору абмежаваннÑÑž. - - - This value is not a valid International Securities Identification Number (ISIN). - ЗначÑнне не з'ÑўлÑецца карÑктным міжнародным ідÑнтыфікацыйным нумарам каштоўных папер (ISIN). - - - This value should be a valid expression. - ЗначÑнне не з'ÑўлÑецца Ñапраўдным выразам. - - - This value is not a valid CSS color. - ЗначÑнне не з'ÑўлÑецца дапушчальным колерам CSS. - - - This value is not a valid CIDR notation. - ЗначÑнне не з'ÑўлÑецца Ñапраўднай натацыÑй CIDR. - - - The value of the netmask should be between {{ min }} and {{ max }}. - ЗначÑнне Ñеткавай маÑкі павінна быць ад {{min}} да {{max}}. - - - - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf index 455ff81679a..dc6f95ff130 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bg.xlf @@ -36,23 +36,23 @@ This field was not expected. - Полето не Ñе е очаквало. + Това поле не Ñе е очаквало. This field is missing. - Полето липÑва. + Това поле липÑва. This value is not a valid date. - СтойноÑтта не е валидна дата. + СтойноÑтта не е валидна дата (date). This value is not a valid datetime. - СтойноÑтта не е валидна дата и чаÑ. + СтойноÑтта не е валидна дата (datetime). This value is not a valid email address. - СтойноÑтта не е валиден имейл адреÑ. + СтойноÑтта не е валиден email адреÑ. The file could not be found. @@ -68,7 +68,7 @@ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Mime типа на файла е невалиден ({{ type }}). Разрешени mime типове Ñа {{ types }}. + Майм типа на файла е невалиден ({{ type }}). Разрешени майм типове Ñа {{ types }}. This value should be {{ limit }} or less. @@ -104,7 +104,7 @@ This value is not a valid time. - СтойноÑтта не е валидно време. + СтойноÑтта не е валидно време (time). This value is not a valid URL. @@ -216,35 +216,35 @@ Invalid card number. - Ðевалиден номер на карта. + Ðевалиден номер на картата. Unsupported card type or invalid card number. - Ðеподдържан тип карта или невалиден номер на карта. + Ðеподдържан тип карта или невалиден номер на картата. This is not a valid International Bank Account Number (IBAN). - Това не е валиден Международен номер на банкова Ñметка (IBAN). + Ðевалиден Международен номер на банкова Ñметка (IBAN). This value is not a valid ISBN-10. - СтойноÑтта не е валиден ISBN-10. + Ðевалиден ISBN-10. This value is not a valid ISBN-13. - СтойноÑтта не е валиден ISBN-13. + Ðевалиден ISBN-13. This value is neither a valid ISBN-10 nor a valid ISBN-13. - СтойноÑтта не е нито валиден ISBN-10, нито валиден ISBN-13. + Ðевалидна ÑтойноÑÑ‚ както за ISBN-10, така и за ISBN-13 . This value is not a valid ISSN. - СтойноÑтта не е валиден ISSN. + Ðевалиден Международен Ñтандартен Ñериен номер (ISSN). This value is not a valid currency. - СтойноÑтта не е валидна валута. + Ðевалидна валута. This value should be equal to {{ compared_value }}. @@ -308,100 +308,16 @@ This value does not match the expected {{ charset }} charset. - СтойноÑтта не Ñъвпада Ñ Ð¾Ñ‡Ð°ÐºÐ²Ð°Ð½Ð°Ñ‚Ð° {{ charset }} кодировка. + СтойноÑтта не Ñъвпада Ñ {{ charset }}. This is not a valid Business Identifier Code (BIC). - Това не е валиден Ð‘Ð¸Ð·Ð½ÐµÑ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ð¾Ð½ÐµÐ½ код (BIC). + Ðевалиден Ð±Ð¸Ð·Ð½ÐµÑ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ð¾Ð½ÐµÐ½ код (BIC). Error Грешка - - This is not a valid UUID. - Това не е валиден UUID. - - - This value should be a multiple of {{ compared_value }}. - СтойноÑтта Ñ‚Ñ€Ñбва да бъде кратно чиÑло на {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ð‘Ð¸Ð·Ð½ÐµÑ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ð¾Ð½Ð½Ð¸Ñ ÐºÐ¾Ð´ (BIC) не е Ñвързан Ñ IBAN {{ iban }}. - - - This value should be valid JSON. - СтойноÑтта Ñ‚Ñ€Ñбва да е валиден JSON. - - - This collection should contain only unique elements. - КолекциÑта Ñ‚Ñ€Ñбва да Ñъдържа Ñамо уникални елементи. - - - This value should be positive. - СтойноÑтта Ñ‚Ñ€Ñбва да бъде положително чиÑло. - - - This value should be either positive or zero. - СтойноÑтта Ñ‚Ñ€Ñбва бъде положително чиÑло или нула. - - - This value should be negative. - СтойноÑтта Ñ‚Ñ€Ñбва да бъде отрицателно чиÑло. - - - This value should be either negative or zero. - СтойноÑтта Ñ‚Ñ€Ñбва да бъде отрицателно чиÑло или нула. - - - This value is not a valid timezone. - СтойноÑтта не е валидна чаÑова зона. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Тази парола е компрометирана, не Ñ‚Ñ€Ñбва да бъде използвана. ÐœÐ¾Ð»Ñ Ð¸Ð·Ð¿Ð¾Ð»Ð·Ð²Ð°Ð¹Ñ‚Ðµ друга парола. - - - This value should be between {{ min }} and {{ max }}. - СтойноÑтта Ñ‚Ñ€Ñбва да бъде между {{ min }} и {{ max }}. - - - This value is not a valid hostname. - СтойноÑтта не е валиден hostname. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - БроÑÑ‚ на елементите в тази ÐºÐ¾Ð»ÐµÐºÑ†Ð¸Ñ Ñ‚Ñ€Ñбва да бъде кратен на {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - СтойноÑтта Ñ‚Ñ€Ñбва да Ð¾Ñ‚Ð³Ð¾Ð²Ð°Ñ€Ñ Ð½Ð° поне едно от Ñледните ограничениÑ: - - - Each element of this collection should satisfy its own set of constraints. - Ð’Ñеки елемент от тази ÐºÐ¾Ð»ÐµÐºÑ†Ð¸Ñ Ñ‚Ñ€Ñбва да Ð¾Ñ‚Ð³Ð¾Ð²Ð°Ñ€Ñ Ð½Ð° ÑобÑÑ‚Ð²ÐµÐ½Ð¸Ñ Ñи набор от ограничениÑ. - - - This value is not a valid International Securities Identification Number (ISIN). - СтойноÑтта не е валиден Международен идентификационен номер на ценни книжа (ISIN). - - - This value should be a valid expression. - СтойноÑтта Ñ‚Ñ€Ñбва да бъде валиден израз. - - - This value is not a valid CSS color. - СтойноÑтта не е валиден CSS цвÑÑ‚. - - - This value is not a valid CIDR notation. - СтойноÑтта не е валидна CIDR нотациÑ. - - - The value of the netmask should be between {{ min }} and {{ max }}. - СтойноÑтта на мрежовата маÑка Ñ‚Ñ€Ñбва да бъде между {{ min }} и {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf deleted file mode 100644 index 43102cca2c0..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.bs.xlf +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - This value should be false. - Ova vrijednost bi trebalo da bude "netaÄno" (false). - - - This value should be true. - Ova vrijednost bi trebalo da bude "taÄno" (true). - - - This value should be of type {{ type }}. - Ova vrijednost bi trebalo da bude tipa {{ type }}. - - - This value should be blank. - Ova vrijednost bi trebalo da bude prazna. - - - The value you selected is not a valid choice. - Odabrana vrijednost nije validan izbor. - - - You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - Morate odabrati barem {{ limit }} mogućnost.|Morate odabrati barem {{ limit }} mogućnosti.|Morate odabrati barem {{ limit }} mogućnosti. - - - You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - Morate odabrati najviÅ¡e {{ limit }} mogućnost.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti. - - - One or more of the given values is invalid. - Jedna ili viÅ¡e datih vrijednosti nisu validne. - - - This field was not expected. - Ovo polje nije oÄekivano. - - - This field is missing. - Ovo polje nedostaje. - - - This value is not a valid date. - Ova vrijednost nije ispravan datum. - - - This value is not a valid datetime. - Ova vrijednost nije ispravnog datum-vrijeme (datetime) formata. - - - This value is not a valid email address. - Ova vrijednost nije ispravna e-mail adresa. - - - The file could not be found. - Ova datoteka ne može biti pronaÄ‘ena. - - - The file is not readable. - Ova datoteka nije Äitljiva. - - - The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Ova datoteka je prevelika ({{ size }} {{ suffix }}). Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. - - - The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Mime tip datoteke nije ispravan ({{ type }}). Dozvoljeni mime tipovi su {{ types }}. - - - This value should be {{ limit }} or less. - Ova vrijednost bi trebalo da bude {{ limit }} ili manje. - - - This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Ova vrijednost je predugaÄka. Trebalo bi da ima {{ limit }} karakter ili manje.|Ova vrijednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje.|Ova vrijednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje. - - - This value should be {{ limit }} or more. - Ova vrijednost bi trebalo da bude {{ limit }} ili viÅ¡e. - - - This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Ova vrijednost je prekratka. Trebalo bi da ima {{ limit }} karakter ili viÅ¡e.|Ova vrijednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e.|Ova vrijednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e. - - - This value should not be blank. - Ova vrijednost ne bi trebalo da bude prazna. - - - This value should not be null. - Ova vrijednost ne bi trebalo da bude null. - - - This value should be null. - Ova vrijednost bi trebalo da bude null. - - - This value is not valid. - Ova vrijednost nije ispravna. - - - This value is not a valid time. - Ova vrijednost nije ispravno vrijeme. - - - This value is not a valid URL. - Ova vrijednost nije ispravan URL. - - - The two values should be equal. - Obje vrijednosti bi trebalo da budu jednake. - - - The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Ova datoteka je prevelika. Najveća dozvoljena veliÄina je {{ limit }} {{ suffix }}. - - - The file is too large. - Ova datoteka je prevelika. - - - The file could not be uploaded. - Ova datoteka ne može biti prenijeta (uploaded). - - - This value should be a valid number. - Ova vrijednost bi trebalo da bude ispravan broj. - - - This file is not a valid image. - Ova datoteka nije validna slika. - - - This is not a valid IP address. - Ovo nije ispravna IP adresa. - - - This value is not a valid language. - Ova vrijednost nije validan jezik. - - - This value is not a valid locale. - Ova vrijednost nije validna regionalna oznaka. - - - This value is not a valid country. - Ova vrijednost nije validna država. - - - This value is already used. - Ova vrijednost je već upotrebljena. - - - The size of the image could not be detected. - Nije moguće otkriti veliÄinu ove slike. - - - The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Å irina slike je prevelika ({{ width }}px). Najveća dozvoljena Å¡irina je {{ max_width }}px. - - - The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Å irina slike je premala ({{ width }}px). Najmanja dozvoljena Å¡irina je {{ min_width }}px. - - - The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Dužina slike je prevelika ({{ height }}px). Najveća dozvoljena dužina je {{ max_height }}px. - - - The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Dužina slike je premala ({{ height }}px). Najmanja dozvoljena dužina je {{ min_height }}px. - - - This value should be the user's current password. - Ova vrijednost bi trebalo da bude trenutna korisniÄka lozinka. - - - This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Ova vrijednost bi trebalo da ima taÄno {{ limit }} karakter.|Ova vrijednost bi trebalo da ima taÄno {{ limit }} karaktera. - - - The file was only partially uploaded. - Datoteka je samo djelimiÄno prenijeta (uploaded). - - - No file was uploaded. - Nijedna datoteka nije prenijeta (uploaded). - - - No temporary folder was configured in php.ini. - Privremeni direktorijum nije konfigurisan u datoteci php.ini. - - - Cannot write temporary file to disk. - Privremenu datoteku nije moguće upisati na disk. - - - A PHP extension caused the upload to fail. - Prenos datoteke nije uspio zbog PHP ekstenzije. - - - This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata. - - - This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata. - - - This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} element.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elementa.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elemenata. - - - Invalid card number. - Broj kartice je neispravan. - - - Unsupported card type or invalid card number. - Tip kartice nije podržan ili je broj kartice neispravan. - - - This is not a valid International Bank Account Number (IBAN). - Ova vrijednost nije ispravan meÄ‘unarodni broj bankovnog raÄuna (IBAN). - - - This value is not a valid ISBN-10. - Ova vrijednost nije ispravan ISBN-10. - - - This value is not a valid ISBN-13. - Ova vrijednost nije ispravan ISBN-13. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Ova vrijednost nije ispravan ISBN-10 niti ISBN-13. - - - This value is not a valid ISSN. - Ova vrijednost nije ispravan ISSN. - - - This value is not a valid currency. - Ova vrijednost nije ispravna valuta. - - - This value should be equal to {{ compared_value }}. - Ova vrijednost bi trebalo da bude jednaka {{ compared_value }}. - - - This value should be greater than {{ compared_value }}. - Ova vrijednost bi trebalo da bude veća od {{ compared_value }}. - - - This value should be greater than or equal to {{ compared_value }}. - Ova vrijednost bi trebalo da bude jednaka ili veća od {{ compared_value }}. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Ova vrijednost bi trebalo da bude identiÄna {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - Ova vrijednost bi trebalo da bude manja od {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - Ova vrijednost bi trebalo da bude jednaka ili manja od {{ compared_value }}. - - - This value should not be equal to {{ compared_value }}. - Ova vrijednost bi trebalo da bude razliÄita od {{ compared_value }}. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Ova vrijednost bi trebalo da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Razmjera ove slike je prevelika ({{ ratio }}). Maksimalna dozvoljena razmjera je {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Razmjera ove slike je premala ({{ ratio }}). Minimalna oÄekivana razmjera je {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Ova slika je kvadratnog oblika ({{ width }}x{{ height }}px). Kvadratne slike nisu dozvoljene. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Ova slika je orijentisana horizontalno (landscape) ({{ width }}x{{ height }}px). Horizontalno orijentisane slike nisu dozvoljene. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Ova slika je orijentisana vertikalno (portrait) ({{ width }}x{{ height }}px). Vertikalno orijentisane slike nisu dozvoljene. - - - An empty file is not allowed. - Prazna datoteka nije dozvoljena. - - - The host could not be resolved. - Nije moguće odrediti poslužitelja (host). - - - This value does not match the expected {{ charset }} charset. - Ova vrijednost ne odgovara oÄekivanom {{ charset }} setu karaktera (charset). - - - This is not a valid Business Identifier Code (BIC). - Ovo nije validan poslovni identifikacioni kod (BIC). - - - Error - GreÅ¡ka - - - This is not a valid UUID. - Ovo nije validan UUID. - - - This value should be a multiple of {{ compared_value }}. - Ova vrijednost bi trebalo da bude djeljiva sa {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ovaj poslovni identifikacioni kod (BIC) nije povezan sa IBAN-om {{ iban }}. - - - This value should be valid JSON. - Ova vrijednost bi trebalo da bude validan JSON. - - - This collection should contain only unique elements. - Ova kolekcija bi trebala da sadrži samo jedinstvene elemente. - - - This value should be positive. - Ova vrijednost bi trebalo da bude pozitivna. - - - This value should be either positive or zero. - Ova vrijednost bi trebalo da bude pozitivna ili jednaka nuli. - - - This value should be negative. - Ova vrijednost bi trebalo da bude negativna. - - - This value should be either negative or zero. - Ova vrijednost bi trebalo da bude negativna ili jednaka nuli. - - - This value is not a valid timezone. - Ova vrijednost nije validna vremenska zona. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ova lozinka je procurila u nekom od sluÄajeva kompromitovanja podataka, nemojte je koristiti. Koristite drugu lozinku. - - - This value should be between {{ min }} and {{ max }}. - Ova vrijednosti bi trebala biti izmeÄ‘u {{ min }} i {{ max }}. - - - This value is not a valid hostname. - Ova vrijednost nije ispravno ime poslužitelja (hostname). - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Broj elemenata u ovoj kolekciji bi trebalo da bude djeljiv sa {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ova vrijednost bi trebalo da zadovoljava namjanje jedno od narednih ograniÄenja: - - - Each element of this collection should satisfy its own set of constraints. - Svaki element ove kolekcije bi trebalo da zadovolji sopstveni skup ograniÄenja. - - - This value is not a valid International Securities Identification Number (ISIN). - Ova vrijednost nije ispravna meÄ‘unarodna identifikaciona oznaka hartija od vrijednosti (ISIN). - - - This value should be a valid expression. - Ova vrijednost bi trebala biti važeći izraz. - - - This value is not a valid CSS color. - Ova vrijednost nije važeća CSS boja. - - - This value is not a valid CIDR notation. - Ova vrijednost nije važeća CIDR notacija. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Vrijednost NetMask bi trebala biti izmeÄ‘u {{min}} i {{max}}. - - - - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf index 04f3e9abf21..078a25d052d 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ca.xlf @@ -301,107 +301,11 @@ An empty file is not allowed. No està permès un fixter buit. - - - The host could not be resolved. - No s'ha pogut resoldre l'amfitrió. - - - This value does not match the expected {{ charset }} charset. - Aquest valor no coincideix amb l'esperat {{ charset }} joc de caràcters. - - - This is not a valid Business Identifier Code (BIC). - Aquest no és un codi d'identificació bancari (BIC) vàlid. - - - Error - Error This is not a valid UUID. Aquest valor no és un UUID vàlid. - - This value should be a multiple of {{ compared_value }}. - Aquest valor ha de ser múltiple de {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Aquest Codi d'identificació bancari (BIC) no està associat amb l'IBAN {{ iban }}. - - - This value should be valid JSON. - Aquest valor hauria de ser un JSON vàlid. - - - This collection should contain only unique elements. - Aquesta col·lecció només hauria de contenir elements únics. - - - This value should be positive. - Aquest valor hauria de ser positiu. - - - This value should be either positive or zero. - Aquest valor ha de ser positiu o zero. - - - This value should be negative. - Aquest valor ha de ser negatiu. - - - This value should be either negative or zero. - Aquest valor ha de ser negatiu o zero. - - - This value is not a valid timezone. - Aquest valor no és una zona horària vàlida. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Aquesta contrasenya s'ha filtrat en cas de violació de dades, no s'ha d'utilitzar. Utilitzeu una altra contrasenya. - - - This value should be between {{ min }} and {{ max }}. - Aquest valor ha d'estar entre {{ min }} i {{ max }}. - - - This value is not a valid hostname. - Aquest valor no és un nom d'amfitrió vàlid. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - El nombre d'elements d'aquesta col·lecció ha de ser múltiple de {{compared_value}}. - - - This value should satisfy at least one of the following constraints: - Aquest valor ha de satisfer almenys una de les restriccions següents: - - - Each element of this collection should satisfy its own set of constraints. - Cada element d'aquesta col·lecció hauria de satisfer el seu propi conjunt de restriccions. - - - This value is not a valid International Securities Identification Number (ISIN). - Aquest valor no és un número d'identificació de valors internacionals (ISIN) vàlid. - - - This value should be a valid expression. - Aquest valor hauria de ser una expressió vàlida. - - - This value is not a valid CSS color. - Aquest valor no és un color CSS vàlid. - - - This value is not a valid CIDR notation. - Aquest valor no és una notació CIDR vàlida. - - - The value of the netmask should be between {{ min }} and {{ max }}. - El valor de la màscara de xarxa hauria d'estar entre {{ min }} i {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf index 75410192190..4b966698f77 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cs.xlf @@ -318,90 +318,6 @@ Error Chyba - - This is not a valid UUID. - Tato hodnota není platné UUID. - - - This value should be a multiple of {{ compared_value }}. - Tato hodnota musí být násobek hodnoty {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Bankovní identifikaÄní kód (BIC) neodpovídá mezinárodnímu Äíslu úÄtu (IBAN) {{ iban }}. - - - This value should be valid JSON. - Tato hodnota musí být validní JSON. - - - This collection should contain only unique elements. - Tato kolekce musí obsahovat pouze unikátní prvky. - - - This value should be positive. - Tato hodnota musí být kladná. - - - This value should be either positive or zero. - Tato hodnota musí být buÄ kladná nebo nula. - - - This value should be negative. - Tato hodnota musí být záporná. - - - This value should be either negative or zero. - Tato hodnota musí být buÄ záporná nebo nula. - - - This value is not a valid timezone. - Tato Äasová zóna neexistuje. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Zadané heslo bylo souÄástí úniku dat, takže ho není možné použít. Použijte prosím jiné heslo. - - - This value should be between {{ min }} and {{ max }}. - Hodnota musí být mezi {{ min }} a {{ max }}. - - - This value is not a valid hostname. - Tato hodnota není platný hostname. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - PoÄet prvků v této kolekci musí být násobek {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Tato hodnota musí splňovat alespoň jedno z následujících omezení: - - - Each element of this collection should satisfy its own set of constraints. - Každý prvek v této kolekci musí splňovat svá vlastní omezení. - - - This value is not a valid International Securities Identification Number (ISIN). - Tato hodnota není platné mezinárodní identifikaÄní Äíslo cenného papíru (ISIN). - - - This value should be a valid expression. - Tato hodnota musí být platný výraz. - - - This value is not a valid CSS color. - Tato hodnota není platná barva CSS. - - - This value is not a valid CIDR notation. - Tato hodnota není platná notace CIDR. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Hodnota masky sítÄ› musí být mezi {{ min }} a {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf index 752b6c2ae51..da7cb9aab29 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.cy.xlf @@ -222,114 +222,6 @@ Unsupported card type or invalid card number. Unai ni dderbynir y math yna o gerdyn, neu nid yw rhif y cerdyn yn ddilys. - - This is not a valid International Bank Account Number (IBAN). - Nid yw hwn yn Rhif Cyfrif Banc Rhyngwladol (IBAN) dilys. - - - This value is not a valid ISBN-10. - Nid yw'r gwerth hwn yn ISBN-10 dilys. - - - This value is not a valid ISBN-13. - Nid yw'r gwerth hwn yn ISBN-13 dilys. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Nid yw'r gwerth hwn yn Rhif ISBN-10 dilys nac yn ISBN-13 dilys. - - - This value is not a valid ISSN. - Nid yw'r gwerth hwn yn ISSN dilys. - - - This value is not a valid currency. - Nid yw'r gwerth hwn yn arian dilys. - - - This value should be equal to {{ compared_value }}. - Dylai'r gwerth hwn fod yn gyfartal â {{ compared_value }}. - - - This value should be greater than {{ compared_value }}. - Dylai'r gwerth hwn fod yn fwy na {{ compared_value }}. - - - This value should be greater than or equal to {{ compared_value }}. - Dylai'r gwerth hwn fod yn fwy na neu'n hafal i {{ compared_value }}. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Dylai'r gwerth hwn fod yn union yr un fath â {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - Dylai'r gwerth hwn fod yn llai na {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - Dylai'r gwerth hwn fod yn llai na neu'n hafal i {{ compared_value }}. - - - This value should not be equal to {{ compared_value }}. - Ni ddylai'r gwerth hwn fod yn hafal i {{ compared_value }}. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Ni ddylai'r gwerth hwn fod yn union yr un fath â {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Mae'r gymhareb delwedd yn rhy fawr ({{ ratio }}). Y gymhareb uchaf a ganiateir yw {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Mae'r gymhareb delwedd yn rhy fach ({{ ratio }}). Y gymhareb isaf a ddisgwylir yw {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Mae'r ddelwedd yn sgwâr ({{ width }}x{{ height }}px). Ni chaniateir delweddau sgwâr. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Mae'r ddelwedd mewn fformat tirlun ({{ width }}x{{ height }}px). Ni chaniateir delweddau mewn fformat tirlun. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Mae'r ddelwedd mewn fformat portread ({{ width }}x{{ height }}px). Ni chaniateir delweddau mewn fformat portread. - - - An empty file is not allowed. - Ni chaniateir ffeil wag. - - - The host could not be resolved. - Ni fu modd datrys y gwesteiwr. - - - This value does not match the expected {{ charset }} charset. - Nid yw'r gwerth hwn yn cyfateb â'r {{ charset }} set nodau ddisgwyliedig. - - - This is not a valid Business Identifier Code (BIC). - Nid yw hwn yn God Adnabod Busnes (BIC) dilys. - - - Error - Gwall - - - This is not a valid UUID. - Nid yw hyn yn UUID dilys. - - - This value should be a multiple of {{ compared_value }}. - Dylai'r gwerth hwn fod yn luosrif o {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Nid yw'r Cod Adnabod Busnes (BIC) hwn yn gysylltiedig ag IBAN {{ iban }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf index b76624e7934..3a545c80b64 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.da.xlf @@ -124,7 +124,7 @@ The file could not be uploaded. - Filen kunne ikke uploades. + Filen kunne ikke blive uploadet. This value should be a valid number. @@ -242,166 +242,10 @@ This value is not a valid ISSN. Værdien er ikke en gyldig ISSN. - - This value is not a valid currency. - Denne værdi er ikke en gyldig valuta. - - - This value should be equal to {{ compared_value }}. - Denne værdi skal være lig med {{ compared_value }}. - - - This value should be greater than {{ compared_value }}. - Denne værdi skal være større end {{ compared_value }}. - - - This value should be greater than or equal to {{ compared_value }}. - Denne værdi skal være større end eller lig med {{ compared_value }}. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Denne værdi skal være identisk med {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - Denne værdi skal være mindre end {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - Denne værdi skal være mindre end eller lig med {{ compared_value }}. - - - This value should not be equal to {{ compared_value }}. - Denne værdi bør ikke være lig med {{ compared_value }}. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Denne værdi bør ikke være identisk med {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Billedforholdet er for stort ({{ratio}}). Tilladt maksimumsforhold er {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Billedforholdet er for lille ({{ ratio }}). Minimumsforventet forventet er {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Billedet er firkantet ({{ width }} x {{ height }} px). Firkantede billeder er ikke tilladt. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Billedet er landskabsorienteret ({{width}} x {{height}} px). Landskabsorienterede billeder er ikke tilladt - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Billedet er portrætorienteret ({{ width }}x{{ height }}px). Portrætorienterede billeder er ikke tilladt. - - - An empty file is not allowed. - En tom fil er ikke tilladt. - - - The host could not be resolved. - Værten kunne ikke løses. - - - This value does not match the expected {{ charset }} charset. - Denne værdi stemmer ikke overens med den forventede {{ charset }} charset. - - - This is not a valid Business Identifier Code (BIC). - Dette er ikke en gyldig Business Identifier Code (BIC).a - Error Fejl - - This is not a valid UUID. - Dette er ikke en gyldig UUID. - - - This value should be a multiple of {{ compared_value }}. - Denne værdi skal være et multiplikation af {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Denne Business Identifier Code (BIC) er ikke forbundet med IBAN {{ iban }}. - - - This value should be valid JSON. - Denne værdi skal være gyldig JSON. - - - This collection should contain only unique elements. - Denne samling bør kun indeholde unikke elementer. - - - This value should be positive. - Denne værdi skal være positiv. - - - This value should be either positive or zero. - Denne værdi skal være enten positiv eller nul. - - - This value should be negative. - Denne værdi skal være negativ. - - - This value should be either negative or zero. - Denne værdi skal være enten negativ eller nul. - - - This value is not a valid timezone. - Denne værdi er ikke en gyldig tidszone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Denne adgangskode er blevet lækket i et databrud, det mÃ¥ ikke bruges. Brug venligst en anden adgangskode. - - - This value should be between {{ min }} and {{ max }}. - Værdien skal være mellem {{ min }} og {{ max }}. - - - This value is not a valid hostname. - Værdien er ikke et gyldigt værtsnavn. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Antallet af elementer i denne samling skal være en multiplikation af {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Værdien skal overholde mindst én af følgende krav: - - - Each element of this collection should satisfy its own set of constraints. - Hvert element i denne samling skal overholde dens egne krav. - - - This value is not a valid International Securities Identification Number (ISIN). - Værdien er ikke et gyldig International Securities Identification Number (ISIN). - - - This value should be a valid expression. - Værdien skal være et gyldigt udtryk. - - - This value is not a valid CSS color. - Værdien skal være en gyldig CSS farve. - - - This value is not a valid CIDR notation. - Værdien er ikke en gyldig CIDR notation. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Værdien af netmasken skal være mellem {{ min }} og {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf index 00be24fb8ac..3e44e1e284b 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.de.xlf @@ -322,86 +322,6 @@ This is not a valid UUID. Dies ist keine gültige UUID. - - This value should be a multiple of {{ compared_value }}. - Dieser Wert sollte ein Vielfaches von {{ compared_value }} sein. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Diese internationale Bankleitzahl (BIC) ist nicht mit der IBAN {{ iban }} assoziiert. - - - This value should be valid JSON. - Dieser Wert sollte gültiges JSON sein. - - - This collection should contain only unique elements. - Diese Sammlung darf keine doppelten Elemente enthalten. - - - This value should be positive. - Diese Zahl sollte positiv sein. - - - This value should be either positive or zero. - Diese Zahl sollte entweder positiv oder 0 sein. - - - This value should be negative. - Diese Zahl sollte negativ sein. - - - This value should be either negative or zero. - Diese Zahl sollte entweder negativ oder 0 sein. - - - This value is not a valid timezone. - Dieser Wert ist keine gültige Zeitzone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Dieses Passwort ist Teil eines Datenlecks, es darf nicht verwendet werden. - - - This value should be between {{ min }} and {{ max }}. - Dieser Wert sollte zwischen {{ min }} und {{ max }} sein. - - - This value is not a valid hostname. - Dieser Wert ist kein gültiger Hostname. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Die Anzahl an Elementen in dieser Sammlung sollte ein Vielfaches von {{ compared_value }} sein. - - - This value should satisfy at least one of the following constraints: - Dieser Wert sollte eine der folgenden Bedingungen erfüllen: - - - Each element of this collection should satisfy its own set of constraints. - Jedes Element dieser Sammlung sollte seine eigene Menge an Bedingungen erfüllen. - - - This value is not a valid International Securities Identification Number (ISIN). - Dieser Wert ist keine gültige Internationale Wertpapierkennnummer (ISIN). - - - This value should be a valid expression. - Dieser Wert sollte eine gültige Expression sein. - - - This value is not a valid CSS color. - Dieser Wert ist keine gültige CSS-Farbe. - - - This value is not a valid CIDR notation. - Dieser Wert entspricht nicht der CIDR-Notation. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Der Wert der Subnetzmaske sollte zwischen {{ min }} und {{ max }} liegen. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf index 768986d537b..a3199bcc9d7 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.el.xlf @@ -24,11 +24,11 @@ You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - ΠÏέπει να επιλέξτε τουλάχιστον {{ limit }} επιλογή.|ΠÏέπει να επιλέξτε τουλάχιστον {{ limit }} επιλογές. + ΠÏέπει να επιλέξετε τουλάχιστον {{ limit }} επιλογή.|ΠÏέπει να επιλέξετε τουλάχιστον {{ limit }} επιλογές. You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - ΠÏέπει να επιλέξτε το Ï€Î¿Î»Ï {{ limit }} επιλογή.|ΠÏέπει να επιλέξτε το Ï€Î¿Î»Ï {{ limit }} επιλογές. + ΠÏέπει να επιλέξετε το Ï€Î¿Î»Ï {{ limit }} επιλογή.|ΠÏέπει να επιλέξετε το Ï€Î¿Î»Ï {{ limit }} επιλογές. One or more of the given values is invalid. @@ -68,7 +68,7 @@ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Ο Ï„Ïπος mime του αÏχείου δεν είναι έγκυÏος ({{ type }}). Οι έγκυÏοι Ï„Ïποι mime είναι {{ types }}. + Ο Ï„Ïπος mime του αÏχείου δεν είναι έγκυÏος ({{ type }}). Οι έγκÏυοι Ï„Ïποι mime είναι {{ types }}. This value should be {{ limit }} or less. @@ -144,7 +144,7 @@ This value is not a valid locale. - Αυτή η τιμή δεν αντιστοιχεί σε έγκυÏο κωδικό τοποθεσίας. + Αυτή η τιμή δεν αντιστοιχεί σε έκγυÏο κωδικό τοποθεσίας. This value is not a valid country. @@ -224,7 +224,7 @@ This is not a valid International Bank Account Number (IBAN). - Αυτό δεν αντιστοιχεί σε έγκυÏο διεθνή αÏιθμό Ï„ÏÎ±Ï€ÎµÎ¶Î¹ÎºÎ¿Ï Î»Î¿Î³Î±ÏÎ¹Î±ÏƒÎ¼Î¿Ï (IBAN). + Αυτό δεν αντιστοιχεί σε έκγυÏο διεθνή αÏιθμό Ï„ÏÎ±Ï€ÎµÎ¶Î¹ÎºÎ¿Ï Î»Î¿Î³Î±ÏÎ¹Î±ÏƒÎ¼Î¿Ï (IBAN). This value is not a valid ISBN-10. @@ -278,130 +278,6 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Αυτή η τιμή δεν Ï€Ïέπει να είναι πανομοιότυπη με {{ compared_value_type }} {{ compared_value }}. - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Η αναλογία πλάτους-Ïψους της εικόνας είναι Ï€Î¿Î»Ï Î¼ÎµÎ³Î¬Î»Î· ({{ ratio }}). Μέγιστη επιτÏεπτή αναλογία {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Η αναλογία πλάτους-Ïψους της εικόνας είναι Ï€Î¿Î»Ï Î¼Î¹ÎºÏή ({{ ratio }}). Ελάχιστη επιτÏεπτή αναλογία {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Η εικόνα είναι τετÏάγωνη ({{ width }}x{{ height }}px). Δεν επιτÏέπονται τετÏάγωνες εικόνες. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Η εικόνα έχει οÏιζόντιο Ï€Ïοσανατολισμό ({{ width }}x{{ height }}px). Δεν επιτÏέπονται εικόνες με οÏιζόντιο Ï€Ïοσανατολισμό. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Η εικόνα έχει κάθετο Ï€Ïοσανατολισμό ({{ width }}x{{ height }}px). Δεν επιτÏέπονται εικόνες με κάθετο Ï€Ïοσανατολισμό. - - - An empty file is not allowed. - Δεν επιτÏέπεται κενό αÏχείο. - - - The host could not be resolved. - Η διεÏθυνση δεν μπόÏεσε να επιλυθεί. - - - This value does not match the expected {{ charset }} charset. - Αυτή η τιμή δεν ταιÏιάζει στο αναμενόμενο {{ charset }} σÏνολο χαÏακτήÏων. - - - This is not a valid Business Identifier Code (BIC). - Αυτός δεν είναι ένας έγκυÏος κωδικός BIC. - - - Error - Σφάλμα - - - This is not a valid UUID. - Αυτό δεν είναι ένα έγκυÏο UUID. - - - This value should be a multiple of {{ compared_value }}. - Αυτή η τιμή θα έπÏεπε να είναι πολλαπλάσιο του {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Αυτός ο κωδικός BIC δεν σχετίζεται με το IBAN {{ iban }}. - - - This value should be valid JSON. - Αυτή η τιμή θα Ï€Ïέπει να είναι έγκυÏο JSON. - - - This collection should contain only unique elements. - Αυτή η συλλογή θα Ï€Ïέπει να πεÏιέχει μόνο μοναδικά στοιχεία. - - - This value should be positive. - Αυτή η τιμή θα Ï€Ïέπει να είναι θετική. - - - This value should be either positive or zero. - Αυτή η τιμή θα Ï€Ïέπει να είναι θετική ή μηδενική. - - - This value should be negative. - Αυτή η τιμή θα Ï€Ïέπει να είναι αÏνητική. - - - This value should be either negative or zero. - Αυτή η τιμή θα Ï€Ïέπει να είναι αÏνητική ή μηδενική. - - - This value is not a valid timezone. - Αυτή η τιμή θα δεν είναι έγκυÏη ζώνη ÏŽÏας. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Αυτός ο κωδικός Ï€Ïόσβασης έχει διαÏÏεÏσει σε παÏαβίαση δεδομένων. ΠαÏακαλοÏμε να χÏησιμοποιήσετε έναν άλλο κωδικό. - - - This value should be between {{ min }} and {{ max }}. - Αυτή η τιμή θα Ï€Ïέπει να είναι Î¼ÎµÏ„Î±Î¾Ï {{ min }} και {{ max }}. - - - This value is not a valid hostname. - Αυτή η τιμή δεν είναι έγκυÏο όνομα υποδοχής. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Το νοÏμεÏο των στοιχείων σε αυτή τη συλλογή θα Ï€Ïέπει να είναι πολλαπλάσιο του {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Αυτή η τιμή θα Ï€Ïέπει να ικανοποιεί τουλάχιστον έναν από τους παÏακάτω πεÏιοÏισμοÏÏ‚: - - - Each element of this collection should satisfy its own set of constraints. - Κάθε στοιχείο σε αυτή τη συλλογή θα Ï€Ïέπει να ικανοποιεί το δικό του σÏνολο πεÏιοÏισμών. - - - This value is not a valid International Securities Identification Number (ISIN). - Αυτή η τιμή δεν είναι έγκυÏο International Securities Identification Number (ISIN). - - - This value should be a valid expression. - Αυτή η τιμή θα Ï€Ïέπει να είναι μία έγκυÏη έκφÏαση. - - - This value is not a valid CSS color. - Αυτή η τιμή δεν είναι έγκυÏο χÏώμα CSS. - - - This value is not a valid CIDR notation. - Αυτή η τιμή δεν είναι έγκυÏη CIDR σημειογÏαφία. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Η τιμή του netmask Ï€Ïέπει να είναι ανάμεσα σε {{ min }} και {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf index 34c54212d84..4bb2760b418 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.en.xlf @@ -326,82 +326,6 @@ This value should be a multiple of {{ compared_value }}. This value should be a multiple of {{ compared_value }}. - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - - - This value should be valid JSON. - This value should be valid JSON. - - - This collection should contain only unique elements. - This collection should contain only unique elements. - - - This value should be positive. - This value should be positive. - - - This value should be either positive or zero. - This value should be either positive or zero. - - - This value should be negative. - This value should be negative. - - - This value should be either negative or zero. - This value should be either negative or zero. - - - This value is not a valid timezone. - This value is not a valid timezone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - This password has been leaked in a data breach, it must not be used. Please use another password. - - - This value should be between {{ min }} and {{ max }}. - This value should be between {{ min }} and {{ max }}. - - - This value is not a valid hostname. - This value is not a valid hostname. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - The number of elements in this collection should be a multiple of {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - This value should satisfy at least one of the following constraints: - - - Each element of this collection should satisfy its own set of constraints. - Each element of this collection should satisfy its own set of constraints. - - - This value is not a valid International Securities Identification Number (ISIN). - This value is not a valid International Securities Identification Number (ISIN). - - - This value should be a valid expression. - This value should be a valid expression. - - - This value is not a valid CSS color. - This value is not a valid CSS color. - - - This value is not a valid CIDR notation. - This value is not a valid CIDR notation. - - - The value of the netmask should be between {{ min }} and {{ max }}. - The value of the netmask should be between {{ min }} and {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf index 897d0a45d74..25d5b8a5d33 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.es.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - Ninguna carpeta temporal fue configurada en php.ini o la carpeta configurada no existe. + Ninguna carpeta temporal fue configurada en php.ini. Cannot write temporary file to disk. @@ -322,86 +322,6 @@ This is not a valid UUID. Este valor no es un UUID válido. - - This value should be a multiple of {{ compared_value }}. - Este valor debería ser múltiplo de {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Este Código de Identificación Bancaria (BIC) no está asociado con el IBAN {{ iban }}. - - - This value should be valid JSON. - Este valor debería ser un JSON válido. - - - This collection should contain only unique elements. - Esta colección debería tener exclusivamente elementos únicos. - - - This value should be positive. - Este valor debería ser positivo. - - - This value should be either positive or zero. - Este valor debería ser positivo o igual a cero. - - - This value should be negative. - Este valor debería ser negativo. - - - This value should be either negative or zero. - Este valor debería ser negativo o igual a cero. - - - This value is not a valid timezone. - Este valor no es una zona horaria válida. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Esta contraseña no se puede utilizar porque está incluida en un listado de contraseñas públicas obtenido gracias a fallos de seguridad de otros sitios y aplicaciones. Por favor utilice otra contraseña. - - - This value should be between {{ min }} and {{ max }}. - Este valor debería estar entre {{ min }} y {{ max }}. - - - This value is not a valid hostname. - Este valor no es un nombre de host válido. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - El número de elementos en esta colección debería ser múltiplo de {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Este valor debería satisfacer al menos una de las siguientes restricciones: - - - Each element of this collection should satisfy its own set of constraints. - Cada elemento de esta colección debería satisfacer su propio conjunto de restricciones. - - - This value is not a valid International Securities Identification Number (ISIN). - Este valor no es un número de identificación internacional de valores (ISIN) válido. - - - This value should be a valid expression. - Este valor debería ser una expresión válida. - - - This value is not a valid CSS color. - Este valor no es un color CSS válido. - - - This value is not a valid CIDR notation. - Este valor no es una notación CIDR válida. - - - The value of the netmask should be between {{ min }} and {{ max }}. - El valor de la máscara de red debería estar entre {{ min }} y {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf index b323dcd9616..d047c8bb9ef 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.et.xlf @@ -32,11 +32,11 @@ One or more of the given values is invalid. - Ãœks või rohkem väärtustest on vigane. + One or more of the given values is invalid. This field was not expected. - See väli ei olnud oodatud. + See väli ei oodatud. This field is missing. @@ -179,7 +179,7 @@ Väärtus peaks olema kasutaja kehtiv salasõna. - This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} characters. Väärtus peaks olema täpselt {{ limit }} tähemärk pikk.|Väärtus peaks olema täpselt {{ limit }} tähemärki pikk. @@ -203,15 +203,15 @@ PHP laiendi tõttu ebaõnnestus faili üleslaadimine. - This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} elements or more. Kogumikus peaks olema vähemalt {{ limit }} element.|Kogumikus peaks olema vähemalt {{ limit }} elementi. - This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} elements or less. Kogumikus peaks olema ülimalt {{ limit }} element.|Kogumikus peaks olema ülimalt {{ limit }} elementi. - This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} elements. Kogumikus peaks olema täpselt {{ limit }} element.|Kogumikus peaks olema täpselt {{ limit }}|elementi. @@ -278,130 +278,6 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Väärtus ei tohiks olla identne väärtusega {{ compared_value_type }} {{ compared_value }}. - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Kuvasuhe on liiga suur ({{ ratio }}). Lubatud maksimaalne suhe on {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Kuvasuhe on liiga väike ({{ ratio }}). Oodatav minimaalne suhe on {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Pilt on ruudukujuline ({{ width }}x{{ height }}px). Ruudukujulised pildid pole lubatud. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Pilt on horisontaalselt orienteeritud ({{ width }}x{{ height }}px). Maastikulised pildid pole lubatud. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Pilt on vertikaalselt orienteeritud ({{ width }}x{{ height }}px). Portreepildid pole lubatud. - - - An empty file is not allowed. - Tühi fail pole lubatud. - - - The host could not be resolved. - Sellist domeeni ei õnnestunud leida. - - - This value does not match the expected {{ charset }} charset. - See väärtus ei ühti eeldatava tähemärgiga {{ charset }}. - - - This is not a valid Business Identifier Code (BIC). - See ei ole kehtiv ettevõtte identifitseerimiskood (BIC). - - - Error - Viga - - - This is not a valid UUID. - See pole kehtiv UUID. - - - This value should be a multiple of {{ compared_value }}. - See väärtus peaks olema väärtuse {{ compared_value }} kordne. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - See ettevõtte identifitseerimiskood (BIC) ei ole seotud IBAN-iga {{ iban }}. - - - This value should be valid JSON. - See väärtus peaks olema kehtiv JSON. - - - This collection should contain only unique elements. - See kogu peaks sisaldama ainult unikaalseid elemente. - - - This value should be positive. - See väärtus peaks olema positiivne. - - - This value should be either positive or zero. - See väärtus peaks olema kas positiivne või null. - - - This value should be negative. - See väärtus peaks olema negatiivne. - - - This value should be either negative or zero. - See väärtus peaks olema kas negatiivne või null. - - - This value is not a valid timezone. - See väärtus pole kehtiv ajavöönd. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - See parool on lekkinud andmerikkumise korral, seda ei tohi kasutada. Palun kasutage muud parooli. - - - This value should be between {{ min }} and {{ max }}. - See väärtus peaks olema vahemikus {{ min }} kuni {{ max }}. - - - This value is not a valid hostname. - See väärtus pole korrektne domeeninimi. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Selles kogus olevate elementide arv peab olema arvu {{ compared_value }} kordne. - - - This value should satisfy at least one of the following constraints: - See väärtus peab vastama vähemalt ühele järgmistest tingimustest: - - - Each element of this collection should satisfy its own set of constraints. - Kõik väärtused selles kogus peavad vastama oma tingimustele. - - - This value is not a valid International Securities Identification Number (ISIN). - See väärtus pole korrektne ISIN-kood. - - - This value should be a valid expression. - See väärtus pole korrektne avaldis. - - - This value is not a valid CSS color. - See väärtus pole korrektne CSS-i värv. - - - This value is not a valid CIDR notation. - See väärtus pole korrektne CIDR võrguaadress. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Võrgumaski väärtus peaks olema vahemikus {{ min }} kuni {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf index ec58c60369b..d311dedb5e6 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.eu.xlf @@ -278,42 +278,6 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar. - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Irudiaren proportzioa oso handia da ({{ ratio }}). Onartutako proportzio handienda {{ max_ratio }} da. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Irudiaren proportzioa oso txikia da ({{ ratio }}). Onartutako proportzio txikiena {{ min_ratio }} da. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Irudia karratua da ({{ width }}x{{ height }}px). Karratuak diren irudiak ez dira onartzen. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Irudia horizontalki bideratua dago ({{ width }}x{{ height }}px). Horizontalki bideratutako irudiak ez dira onartzen. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Irudia bertikalki bideratua dago ({{ width }}x{{ height }}px). Bertikalki bideratutako irudiak ez dira onartzen. - - - An empty file is not allowed. - Hutsik dagoen fitxategia ez da onartzen. - - - The host could not be resolved. - Host-a ezin da ebatzi. - - - This value does not match the expected {{ charset }} charset. - Balio honen karaktere kodea ez da esperotakoa {{ charset }}. - - - This is not a valid Business Identifier Code (BIC). - Ez da balizko Banku Identifikazioko Kodea (BIC). - Error Errore @@ -322,74 +286,6 @@ This is not a valid UUID. Balio hau ez da onartutako UUID bat. - - This value should be a multiple of {{ compared_value }}. - Balio honek {{ compared_value }}-ren multiploa izan beharko luke. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Banku Identifikazioko Kode hau ez dago lotuta {{ IBAN }} IBAN-rekin. - - - This value should be valid JSON. - Balio honek baliozko JSON bat izan behar luke. - - - This collection should contain only unique elements. - Bilduma honek elementu bakarrak soilik izan beharko lituzke. - - - This value should be positive. - Balio honek positiboa izan beharko luke. - - - This value should be either positive or zero. - Balio honek positiboa edo zero izan behar luke. - - - This value should be negative. - Balio honek negatiboa izan behar luke. - - - This value should be either negative or zero. - Balio honek negatiboa edo zero izan behar luke. - - - This value is not a valid timezone. - Balio hori ez da baliozko ordu-eremua. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Pasahitz hori ezin da erabili, beste gune eta aplikazio batzuetako segurtasun-akatsei esker lortutako pasahitz publikoen zerrendan sartuta dagoelako. Mesedez, erabili beste pasahitz bat. - - - This value should be between {{ min }} and {{ max }}. - Balio honek {{ min }} eta {{ max }} artean egon behar luke. - - - This value is not a valid hostname. - Balio hori ez da ostalari-izen onargarria. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Bilduma honetako elementu-kopuruak {{ compared_value }}-ren multiploa izan behar luke. - - - This value should satisfy at least one of the following constraints: - Balio honek, gutxienez, murrizketa hauetako bat bete behar du: - - - Each element of this collection should satisfy its own set of constraints. - Bilduma honetako elementu bakoitzak bere murriztapen-multzoa bete behar du. - - - This value is not a valid International Securities Identification Number (ISIN). - Balio hori ez da baliozko baloreen nazioarteko identifikazio-zenbaki bat (ISIN). - - - This value should be a valid expression. - Balio hori baliozko adierazpena izan beharko litzateke. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf index b72bc6e03e9..98b4bd66f08 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fa.xlf @@ -4,11 +4,11 @@ This value should be false. - این مقدار باید نادرست (False) باشد. + این مقدار باید نادرست(False) باشد. This value should be true. - این مقدار باید درست (True) باشد. + این مقدار باید درست(True) باشد. This value should be of type {{ type }}. @@ -16,107 +16,107 @@ This value should be blank. - این مقدار باید خالی باشد. + این Ùیلد باید خالی باشد. The value you selected is not a valid choice. - مقدار انتخاب شده یک گزینه معتبر نمی‌باشد. + گزینه انتخابی معتبر نیست. You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - شما باید حداقل {{ limit }} گزینه انتخاب نمایید.|شما باید حداقل {{ limit }} گزینه انتخاب نمایید. + باید حداقل {{ limit }} گزینه انتخاب کنید.|باید حداقل {{ limit }} گزینه انتخاب کنید. You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - شما باید حداکثر {{ limit }} گزینه انتخاب نمایید.|شما باید حداکثر {{ limit }} گزینه انتخاب نمایید. + حداکثر {{ limit }} گزینه Ù…ÛŒ توانید انتخاب کنید.|حداکثر {{ limit }} گزینه Ù…ÛŒ توانید انتخاب کنید. One or more of the given values is invalid. - یک یا چند مقدار داده شده نامعتبر است. + یک یا چند مقدار نامعتبر وجود دارد. The fields {{ fields }} were not expected. - Ùیلدهای {{ fields }} مورد انتظار نبود. + Ùیلدهای {{ fields }} اضاÙÛŒ هستند. The fields {{ fields }} are missing. - Ùیلدهای {{ fields }} Ù…Ùقود شده اند. + Ùیلدهای {{ fields }} Ú©Ù… هستند. This value is not a valid date. - این مقدار یک تاریخ معتبر نمی‌باشد. + این مقدار یک تاریخ معتبر نیست. This value is not a valid datetime. - این مقدار یک تاریخ Ùˆ زمان معتبر نمی‌باشد. + این مقدار یک تاریخ Ùˆ زمان معتبر نیست. This value is not a valid email address. - این یک آدرس رایانامه (ایمیل) معتبر نمی‌باشد. + این یک رایانامه معتبر نیست. The file could not be found. - Ùایل یاÙت نشد. + Ùایل پیدا نشد. The file is not readable. - Ùایل قابل خواندن نیست. + Ùایل قابلیت خواندن ندارد. The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Ùایل بیش از اندازه بزرگ است({{ size }} {{ suffix }}). بیشینه (حداکثر) اندازه مجاز برابر با {{ limit }} {{ suffix }} می‌باشد. + Ùایل بیش از اندازه بزرگ است({{ size }} {{ suffix }}). حداکثر اندازه مجاز برابر {{ limit }} {{ suffix }} است. The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - نوع mime این Ùایل نامعتبر است({{ type }}). انواع mime مجاز {{ types }} هستند. + این نوع Ùایل مجاز نیست({{ type }}). نوع های مجاز {{ types }} هستند. This value should be {{ limit }} or less. - این مقدار باید کوچکتر Ùˆ یا مساوی {{ limit }} باشد. + این مقدار باید کوچکتر یا مساوی {{ limit }} باشد. This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - این مقدار بسیار طولانی است. باید دارای {{limit}} کاراکتر یا کمتر باشد. | این مقدار بسیار طولانی است. باید دارای {{limit}} کاراکتر یا کمتر باشد. + بسیار طولانی است.حداکثر تعداد حرو٠مجاز برابر {{ limit }} است.|بسیار طولانی است.حداکثر تعداد حرو٠مجاز برابر {{ limit }} است. This value should be {{ limit }} or more. - این مقدار باید بزرگتر Ùˆ یا مساوی {{ limit }} باشد. + این مقدار باید برابر Ùˆ یا بیشتر از {{ limit }} باشد. This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - این مقدار بیش از اندازه کوتاه است. باید {{ limit }} کاراکتر یا بیشتر داشته باشد.|این مقدار بیش از اندازه کوتاه است. باید {{ limit }} کاراکتر یا بیشتر داشته باشد. + بسیار کوتاه است.تعداد حرو٠باید حداقل {{ limit }} باشد.|بسیار کوتاه است.تعداد حرو٠باید حداقل {{ limit }} باشد. This value should not be blank. - این مقدار نباید خالی باشد. + این مقدار نباید تهی باشد. This value should not be null. - این مقدار نباید خالی باشد. + باید مقداری داشته باشد.. This value should be null. - این مقدار باید خالی باشد. + نباید مقداری داشته باشد. This value is not valid. - این مقدار معتبر نمی‌باشد. + این مقدار معتبر نیست. This value is not a valid time. - این مقدار یک زمان معتبر نمی‌باشد. + این مقدار یک زمان صحیح نیست. This value is not a valid URL. - این مقدار شامل یک URL معتبر نمی‌باشد. + این یک URL معتبر نیست. The two values should be equal. - دو مقدار باید با یکدیگر برابر باشند. + دو مقدار باید برابر باشند. The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Ùایل بیش از اندازه بزرگ است. بیشینه (حداکثر) اندازه مجاز {{ limit }} {{ suffix }} است. + Ùایل بیش از اندازه بزرگ است. حداکثر اندازه مجاز برابر {{ limit }} {{ suffix }} است. The file is too large. @@ -124,7 +124,7 @@ The file could not be uploaded. - بارگذاری Ùایل با شکست مواجه گردید. + بارگذاری Ùایل با شکست مواجه شد. This value should be a valid number. @@ -132,59 +132,59 @@ This file is not a valid image. - این Ùایل یک تصویر معتبر نمی‌باشد. + این Ùایل یک تصویر نیست. This is not a valid IP address. - این آدرس IP معتبر نیست. + این مقدار یک IP معتبر نیست. This value is not a valid language. - این مقدار یک زبان معتبر نمی‌باشد. + این مقدار یک زبان صحیح نیست. This value is not a valid locale. - این مقدار یک محل (locale) معتبر نمی‌باشد. + این مقدار یک محل صحیح نیست. This value is not a valid country. - این مقدار یک کشور معتبر نمی‌باشد. + این مقدار یک کشور صحیح نیست. This value is already used. - این مقدار قبلاً استÙاده شده است. + این مقدار قبلا مورد استÙاده قرار گرÙته است. The size of the image could not be detected. - اندازه تصویر قابل شناسایی نمی‌باشد. + اندازه تصویر قابل شناسایی نیست. The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - عرض تصویر بسیار بزرگ است({{ width }}px). بیشینه (حداکثر) عرض مجاز {{ max_width }}px می‌باشد. + طول تصویر بسیار بزرگ است ({{ width }}px). بشینه طول مجاز {{ max_width }}px است. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - عرض تصویر بسیار Ú©ÙˆÚ†Ú© است({{ width }}px). کمینه (حداقل) عرض مورد انتظار {{ min_width }}px می‌باشد. + طول تصویر بسیار Ú©ÙˆÚ†Ú© است ({{ width }}px). کمینه طول موردنظر {{ min_width }}px است. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - ارتÙاع تصویر بسیار بزرگ است({{ height }}px). بیشینه (حداکثر) ارتÙاع مجاز {{ max_height }}px می‌باشد. + ارتÙاع تصویر بسیار بزرگ است ({{ height }}px). بشینه ارتÙاع مجاز {{ max_height }}px است. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - ارتÙاع تصویر بسیار Ú©ÙˆÚ†Ú© است({{ height }}px). کمینه (حداقل) ارتÙاع مورد انتظار {{ min_height }}px می‌باشد. + ارتÙاع تصویر بسیار Ú©ÙˆÚ†Ú© است ({{ height }}px). کمینه ارتÙاع موردنظر {{ min_height }}px است. This value should be the user's current password. - این مقدار باید رمزعبور Ùعلی کاربر باشد. + این مقدار Ù…ÛŒ بایست کلمه عبور کنونی کاربر باشد. This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - این مقدار باید دقیقا {{ limit }} کاراکتر داشته باشد.| این مقدار باید دقیقا {{ limit }} کاراکتر داشته باشد. + این مقدار Ù…ÛŒ بایست دقیقا {{ limit }} کاراکتر داشته باشد.| این مقدار Ù…ÛŒ بایست دقیقا {{ limit }} کاراکتر داشته باشد. The file was only partially uploaded. - Ùایل به صورت جزئی بارگذاری گردیده است. + Ùایل به صورت جزیی بارگذاری شده است. No file was uploaded. @@ -192,27 +192,27 @@ No temporary folder was configured in php.ini. - پوشه موقتی در php.ini پیکربندی نگردیده است. + Ùولدر موقت در php.ini پیکربندی نشده است. Cannot write temporary file to disk. - Ùایل موقتی را نمی‌توان در دیسک نوشت. + Ùایل موقت را نمی توان در دیسک نوشت. A PHP extension caused the upload to fail. - یک اÙزونه PHP باعث شد بارگذاری ناموÙÙ‚ باشد. + اکستنشن PHP موجب شد Ú©Ù‡ بارگذاری Ùایل با شکست مواجه شود. This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - این مجموعه باید حاوی {{ limit }} عنصر یا بیشتر باشد.|این مجموعه باید حاوی {{ limit }} عنصر یا بیشتر باشد. + این مجموعه Ù…ÛŒ بایست دارای {{ limit }} عنصر یا بیشتر باشد.|این مجموعه Ù…ÛŒ بایست دارای {{ limit }} عنصر یا بیشتر باشد. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - این مجموعه باید حاوی {{ limit }} عنصر یا کمتر باشد.|این مجموعه باید حاوی {{ limit }} عنصر یا کمتر باشد. + این مجموعه Ù…ÛŒ بایست دارای حداقل {{ limit }} عنصر یا کمتر باشد.|این مجموعه Ù…ÛŒ بایست دارای {{ limit }} عنصر یا کمتر باشد. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - این مجموعه باید دقیقا حاوی {{ limit }} عنصر باشد.|این مجموعه باید دقیقا حاوی {{ limit }} عنصر باشد. + این مجموعه Ù…ÛŒ بایست به طور دقیق دارا {{ limit }} عنصر باشد.|این مجموعه Ù…ÛŒ بایست به طور دقیق دارای {{ limit }} قلم باشد. Invalid card number. @@ -220,31 +220,31 @@ Unsupported card type or invalid card number. - نوع کارت پشتیبانی نمی‌شود Ùˆ یا شماره کارت نامعتبر می‌باشد. + نوع کارت پشتیبانی نمی شود یا شماره کارت نامعتبر است. This is not a valid International Bank Account Number (IBAN). - این یک شماره حساب بانک بین المللی معتبر نمی‌باشد(IBAN). + این یک شماره حساب بین المللی بانک (IBAN) درست نیست. This value is not a valid ISBN-10. - این مقدار یک ISBN-10 معتبر نمی‌باشد. + این مقدار یک ISBN-10 درست نیست. This value is not a valid ISBN-13. - این مقدار یک ISBN-13 معتبر نمی‌باشد. + این مقدار یک ISBN-13 درست نیست. This value is neither a valid ISBN-10 nor a valid ISBN-13. - این مقدار یک ISBN-10 معتبر Ùˆ یا ISBN-13 معتبر نمی‌باشد. + این مقدار یک ISBN-10 درست یا ISBN-13 درست نیست. This value is not a valid ISSN. - این مقدار یک ISSN معتبر نمی‌باشد. + این مقدار یک ISSN درست نیست. This value is not a valid currency. - این مقدار یک واحد پول معتبر نمی‌باشد. + این مقدار یک یکای پول درست نیست. This value should be equal to {{ compared_value }}. @@ -256,11 +256,11 @@ This value should be greater than or equal to {{ compared_value }}. - این مقدار باید بزرگتر Ùˆ یا مساوی با {{ compared_value }} باشد. + این مقدار باید بزرگتر یا مساوی با {{ compared_value }} باشد. This value should be identical to {{ compared_value_type }} {{ compared_value }}. - این مقدار باید برابر {{ compared_value_type }} {{ compared_value }} باشد. + این مقدار باید با {{ compared_value_type }} {{ compared_value }} یکی باشد. This value should be less than {{ compared_value }}. @@ -268,7 +268,7 @@ This value should be less than or equal to {{ compared_value }}. - این مقدار باید کمتر Ùˆ یا مساوی با {{ compared_value }} باشد. + این مقدار باید کمتر یا مساوی با {{ compared_value }} باشد. This value should not be equal to {{ compared_value }}. @@ -276,131 +276,7 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - این مقدار نباید برابر {{ compared_value_type }} {{ compared_value }} باشد. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - ابعاد ({{ ratio }}) عکس بیش از حد بزرگ است. بیشینه (حداکثر) ابعاد مجاز {{ max_ratio }} می‌باشد. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - ابعاد ({{ ratio }}) عکس بیش از حد Ú©ÙˆÚ†Ú© است. کمینه (حداقل) ابعاد مورد انتظار {{ min_ratio }} می‌باشد. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - این تصویر یک مربع ({{ width }}x{{ height }}px) می‌باشد. تصاویر مربع Ø´Ú©Ù„ مجاز نمی‌باشند. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - این تصویر اÙÙ‚ÛŒ ({{ width }}x{{ height }}px) می‌باشد. تصاویر اÙÙ‚ÛŒ مجاز نمی‌باشند. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - این تصویر عمودی ({{ width }}x{{ height }}px) می‌باشد. تصاویر عمودی مجاز نمی‌باشند. - - - An empty file is not allowed. - Ùایل خالی مجاز نمی‌باشد. - - - The host could not be resolved. - میزبان (Host) شناسایی نشد. - - - This value does not match the expected {{ charset }} charset. - این مقدار مطابق charset مورد انتظار {{ charset }} نمی باشد. - - - This is not a valid Business Identifier Code (BIC). - این مقدار یک کد شناسایی کسب‌و‌کار معتبر (BIC) نیست. - - - Error - خطا - - - This is not a valid UUID. - این مقدار یک UUID معتبر نمی‌باشد. - - - This value should be a multiple of {{ compared_value }}. - این مقدار باید چند برابر {{ compared_value }} باشد. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - این کد شناسایی کسب‌و‌کار (BIC) با شماره حساب بانکی بین‌المللی (IBAN) {{ iban }} مرتبط نیست. - - - This value should be valid JSON. - این مقدار باید یک JSON معتبر باشد. - - - This collection should contain only unique elements. - این مجموعه باید Ùقط حاوی عناصر یکتا باشد. - - - This value should be positive. - این مقدار باید مثبت باشد. - - - This value should be either positive or zero. - این مقدار باید مثبت یا صÙر باشد. - - - This value should be negative. - این مقدار باید منÙÛŒ باشد. - - - This value should be either negative or zero. - این مقدار باید منÙÛŒ یا صÙر باشد. - - - This value is not a valid timezone. - این مقدار یک منطقه‌زمانی (timezone) معتبر نیست. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - این رمزعبور در یک رخنه‌ی اطلاعاتی نشت کرده است. لطÙاً از یک رمزعبور دیگر استÙاده کنید. - - - This value should be between {{ min }} and {{ max }}. - این مقدار باید بین {{ min }} Ùˆ {{ max }} باشد - - - This value is not a valid hostname. - این مقدار یک hostname معتبر نیست. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - تعداد عناصر این مجموعه باید ضریبی از {{ compared_value }} باشد. - - - This value should satisfy at least one of the following constraints: - این مقدار باید حداقل یکی از محدودیت‌های زیر را ارضا کند: - - - Each element of this collection should satisfy its own set of constraints. - هر یک از عناصر این مجموعه باید دسته محدودیت‌های خودش را ارضا کند. - - - This value is not a valid International Securities Identification Number (ISIN). - این مقدار یک شماره شناسایی بین‌المللی اوراق بهادار (ISIN) معتبر نیست. - - - This value should be a valid expression. - این مقدار باید یک عبارت معتبر باشد. - - - This value is not a valid CSS color. - این مقدار یک رنگ معتبر در CSS نیست. - - - This value is not a valid CIDR notation. - این مقدار یک نماد معتبر در CIDR نیست. - - - The value of the netmask should be between {{ min }} and {{ max }}. - مقدار ماسک شبکه (NetMask) باید بین {{ min }} Ùˆ {{ max }} باشد. + این مقدار نباید {{ compared_value_type }} {{ compared_value }} یکی باشد. diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf index 9a6bfe4b6a6..e4390981dfd 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fi.xlf @@ -222,186 +222,10 @@ Unsupported card type or invalid card number. Tätä korttityyppiä ei tueta tai korttinumero on virheellinen. - - This is not a valid International Bank Account Number (IBAN). - Arvo ei ole kelvollinen kansainvälinen pankkitilinumero (IBAN). - - - This value is not a valid ISBN-10. - Arvo ei ole kelvollinen ISBN-10. - - - This value is not a valid ISBN-13. - Arvo ei ole kelvollinen ISBN-13. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Arvo ei ole kelvollinen ISBN-10 tai kelvollinen ISBN-13. - - - This value is not a valid ISSN. - Arvo ei ole kelvollinen ISSN. - - - This value is not a valid currency. - Arvo ei ole kelvollinen valuutta. - - - This value should be equal to {{ compared_value }}. - Arvo ei ole sama kuin {{ compared_value }}. - - - This value should be greater than {{ compared_value }}. - Arvon tulee olla suurempi kuin {{ compared_value }}. - - - This value should be greater than or equal to {{ compared_value }}. - Arvon tulee olla suurempi tai yhtä suuri kuin {{ compared_value }}. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Tämä arvo tulee olla sama kuin {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - Arvon tulee olla pienempi kuin {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - Arvon tulee olla pienempi tai yhtä suuri {{ compared_value }}. - - - This value should not be equal to {{ compared_value }}. - Arvon ei tule olla sama kuin {{ compared_value }}. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Tämä arvo ei tule olla sama kuin {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Kuvasuhde on liian suuri ({{ ratio }}). Suurin sallittu suhde on {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Kuvasuhde on liian pieni ({{ ratio }}). Pienin sallittu arvo on {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Kuva on neliä ({{ width }}x{{ height }}px). Neliöt kuvat eivät ole sallittuja. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Kuva on vaakasuuntainen ({{ width }}x{{ height }}px). Vaakasuuntaiset kuvat eivät ole sallittuja. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Kuva on pystysuuntainen ({{ width }}x{{ height }}px). Pystysuuntaiset kuvat eivät ole sallittuja. - - - An empty file is not allowed. - Tyhjä tiedosto ei ole sallittu. - - - The host could not be resolved. - Palvelimeen ei saatu yhteyttä. - - - This value does not match the expected {{ charset }} charset. - Arvo ei vastaa odotettua merkistöä {{ charset }}. - - - This is not a valid Business Identifier Code (BIC). - Arvo ei ole kelvollinen yritystunnus (BIC). - Error Virhe - - This is not a valid UUID. - Arvo ei ole kelvollinen UUID. - - - This value should be a multiple of {{ compared_value }}. - Tämän arvon tulisi olla kerrannainen {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Tämä yritystunnus (BIC) ei ole liitetty IBAN {{ iban }}. - - - This value should be valid JSON. - Arvon tulee olla kelvollinen JSON. - - - This collection should contain only unique elements. - Tämän ryhmän tulisi sisältää vain yksilöllisiä arvoja. - - - This value should be positive. - Arvon tulisi olla positiivinen. - - - This value should be either positive or zero. - Arvon tulisi olla joko positiivinen tai nolla. - - - This value should be negative. - Arvon tulisi olla negatiivinen. - - - This value should be either negative or zero. - Arvon tulisi olla joko negatiivinen tai nolla. - - - This value is not a valid timezone. - Arvo ei ole kelvollinen aikavyöhyke. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Tämä salasana on vuotanut tietomurrossa, sitä ei saa käyttää. Käytä toista salasanaa. - - - This value should be between {{ min }} and {{ max }}. - Arvon tulisi olla välillä {{ min }} - {{ max }}. - - - This value is not a valid hostname. - Arvo ei ole kelvollinen laitenimi (hostname). - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Ryhmässä olevien elementtien määrän pitää olla monikerta luvulle {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Tämän arvon tulee läpäistä vähintään yksi seuraavista tarkistuksista: - - - Each element of this collection should satisfy its own set of constraints. - Ryhmän jokaisen elementin tulee läpäistä omat tarkistuksensa. - - - This value is not a valid International Securities Identification Number (ISIN). - Tämä arvo ei ole kelvollinen ISIN-koodi (International Securities Identification Number). - - - This value should be a valid expression. - Tämän arvon on oltava kelvollinen lauseke. - - - This value is not a valid CSS color. - Tämä arvo ei ole kelvollinen CSS-värimääritys. - - - This value is not a valid CIDR notation. - Tämä arvo ei ole kelvollinen CIDR-merkintä. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Verkkomaskille annetun arvon tulisi olla {{ min }} ja {{ max }} välillä. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf index 92127773178..382acb975ce 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.fr.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - Aucun répertoire temporaire n'a été configuré dans le php.ini, ou le répertoire configuré n'existe pas. + Aucun répertoire temporaire n'a été configuré dans le php.ini. Cannot write temporary file to disk. @@ -322,86 +322,6 @@ This is not a valid UUID. Ceci n'est pas un UUID valide. - - This value should be a multiple of {{ compared_value }}. - Cette valeur doit être un multiple de {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ce code d'identification d'entreprise (BIC) n'est pas associé à l'IBAN {{ iban }}. - - - This value should be valid JSON. - Cette valeur doit être un JSON valide. - - - This collection should contain only unique elements. - Cette collection ne doit pas comporter de doublons. - - - This value should be positive. - Cette valeur doit être strictement positive. - - - This value should be either positive or zero. - Cette valeur doit être supérieure ou égale à zéro. - - - This value should be negative. - Cette valeur doit être strictement négative. - - - This value should be either negative or zero. - Cette valeur doit être inférieure ou égale à zéro. - - - This value is not a valid timezone. - Cette valeur n'est pas un fuseau horaire valide. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ce mot de passe a été divulgué lors d'une fuite de données, il ne doit plus être utilisé. Veuillez utiliser un autre mot de passe. - - - This value should be between {{ min }} and {{ max }}. - Cette valeur doit être comprise entre {{ min }} et {{ max }}. - - - This value is not a valid hostname. - Cette valeur n'est pas un nom d'hôte valide. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Le nombre d'éléments de cette collection doit être un multiple de {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Cette valeur doit satisfaire à au moins une des contraintes suivantes : - - - Each element of this collection should satisfy its own set of constraints. - Chaque élément de cette collection doit satisfaire à son propre jeu de contraintes. - - - This value is not a valid International Securities Identification Number (ISIN). - Cette valeur n'est pas un code international de sécurité valide (ISIN). - - - This value should be a valid expression. - Cette valeur doit être une expression valide. - - - This value is not a valid CSS color. - Cette valeur n'est pas une couleur CSS valide. - - - This value is not a valid CIDR notation. - Cette valeur n'est pas une notation CIDR valide. - - - The value of the netmask should be between {{ min }} and {{ max }}. - La valeur du masque de réseau doit être comprise entre {{ min }} et {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf index f8c5c0493f7..ecb7155cac8 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.gl.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - Ningunha carpeta temporal foi configurada en php.ini, ou a carpeta non existe. + Ningunha carpeta temporal foi configurada en php.ini. Cannot write temporary file to disk. @@ -314,94 +314,6 @@ This is not a valid Business Identifier Code (BIC). Non é un Código de Identificación Bancaria (BIC) válido. - - Error - Erro - - - This is not a valid UUID. - Isto non é un UUID válido. - - - This value should be a multiple of {{ compared_value }}. - Este valor debería ser multiplo de {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Este Código de identificación bancaria (BIC) non está asociado co IBAN {{ iban }}. - - - This value should be valid JSON. - Este valor debería ser un JSON válido. - - - This collection should contain only unique elements. - Esta colección só debería ter elementos únicos. - - - This value should be positive. - Este valor debería ser positivo. - - - This value should be either positive or zero. - Este valor debe ser positivo ou igual a cero. - - - This value should be negative. - Este valor debe ser negativo. - - - This value should be either negative or zero. - Este valor debe ser negativo ou igual a cero. - - - This value is not a valid timezone. - Este valor non é unha zona horaria válida. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Este contrasinal non se pode usar porque está incluído nunha lista de contrasinais públicos obtidos grazas a fallos de seguridade noutros sitios e aplicacións. Utiliza outro contrasinal. - - - This value should be between {{ min }} and {{ max }}. - Este valor debe estar comprendido entre {{ min }} e {{ max }}. - - - This value is not a valid hostname. - Este valor non é un nome de host válido. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - O número de elementos desta colección debería ser múltiplo de {{compare_value}}. - - - This value should satisfy at least one of the following constraints: - Este valor debe cumprir polo menos unha das seguintes restricións: - - - Each element of this collection should satisfy its own set of constraints. - Cada elemento desta colección debe satisfacer o seu propio conxunto de restricións. - - - This value is not a valid International Securities Identification Number (ISIN). - Este valor non é un número de identificación de valores internacionais (ISIN) válido. - - - This value should be a valid expression. - Este valor debe ser unha expresión válida. - - - This value is not a valid CSS color. - Este valor non é unha cor CSS válida. - - - This value is not a valid CIDR notation. - Este valor non ten unha notación CIDR válida. - - - The value of the netmask should be between {{ min }} and {{ max }}. - O valor da máscara de rede debería estar entre {{ min }} e {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf index 4c10d6462be..65105149005 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.he.xlf @@ -72,7 +72,7 @@ This value should be {{ limit }} or less. - הערך צריך להכיל {{ limit }} ×ª×•×•×™× ×œ×›×œ היותר. + הערך צריל להכיל {{ limit }} ×ª×•×•×™× ×œ×›×œ היותר. This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. @@ -84,7 +84,7 @@ This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - הערך קצר מידי. ×”×•× ×¦×¨×™×š להכיל {{ limit }} ×ª×•×•×™× ×œ×¤×—×•×ª.|הערך קצר מידי. הערך צריך להכיל {{ limit }} ×ª×•×•×™× ×œ×¤×—×•×ª. + הערך קצר מידיץ ×”×•× ×¦×¨×™×š להכיל {{ limit }} ×ª×•×•×™× ×œ×¤×—×•×ª.|הערך קצר מידיץ ×”×•× ×¦×¨×™×š להכיל {{ limit }} ×ª×•×•×™× ×œ×¤×—×•×ª. This value should not be blank. @@ -224,167 +224,83 @@ This is not a valid International Bank Account Number (IBAN). - מספר חשבון בנק בינל×ומי ×ינו חוקי (IBAN). + This is not a valid International Bank Account Number (IBAN). This value is not a valid ISBN-10. - הערך ×ינו ערך ISBN-10 חוקי. + This value is not a valid ISBN-10. This value is not a valid ISBN-13. - הערך ×ינו ערך ISBN-13 חוקי. + This value is not a valid ISBN-13. This value is neither a valid ISBN-10 nor a valid ISBN-13. - הערך ×ינו ערך ISBN-10 חוקי ×ו ערך ISBN-13 חוקי. + This value is neither a valid ISBN-10 nor a valid ISBN-13. This value is not a valid ISSN. - הערך ×ינו ערך ISSN חוקי. + This value is not a valid ISSN. This value is not a valid currency. - הערך ×ינו ערך מטבע חוקי. + This value is not a valid currency. This value should be equal to {{ compared_value }}. - הערך חייב להיות שווה ל {{ compared_value }}. + This value should be equal to {{ compared_value }}. This value should be greater than {{ compared_value }}. - הערך חייב להיות גדול מ {{ compared_value }}. + This value should be greater than {{ compared_value }}. This value should be greater than or equal to {{ compared_value }}. - הערך חייב להיות גדול ×ו שווה ל {{ compared_value }}. + This value should be greater than or equal to {{ compared_value }}. This value should be identical to {{ compared_value_type }} {{ compared_value }}. - הערך חייב להיות ×–×”×” ל {{ compared_value_type }} {{ compared_value }}. + This value should be identical to {{ compared_value_type }} {{ compared_value }}. This value should be less than {{ compared_value }}. - הערך חייב להיות קטן מ {{ compared_value }}. + This value should be less than {{ compared_value }}. This value should be less than or equal to {{ compared_value }}. - הערך חייב להיות קטן ×ו שווה ל {{ compared_value }}. + This value should be less than or equal to {{ compared_value }}. This value should not be equal to {{ compared_value }}. - הערך חייב להיות ×œ× ×©×•×•×” ל {{ compared_value }}. + This value should not be equal to {{ compared_value }}. This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - הערך חייב להיות ×œ× ×–×”×” ל {{ compared_value_type }} {{ compared_value }}. + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - היחס של התמונה ×”×•× ×’×“×•×œ מדי ({{ ratio }}). היחס המקסימלי ×”×פשרי ×”×•× {{ max_ratio }}. + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - היחס של התמונה ×”×•× ×§×˜×Ÿ מדי ({{ ratio }}). היחס המינימלי ×”×פשרי ×”×•× {{ min_ratio }}. + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - התמונה מרובעת ({{ width }}x{{ height }}px). ×סורות תמונות מרובעות. + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - התמונה ×”×™× ×œ×¨×•×—×‘ ({{ width }}x{{ height }}px). ×סורות תמונות לרוחב. + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - התמונה ×”×™× ×œ×ורך ({{ width }}x{{ height }}px). ×סורות תמונות ל×ורך. + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. An empty file is not allowed. - ×סור קובץ ריק. - - - The host could not be resolved. - ×œ× ×”×™×™×ª×” ×פשרות לזהות ×ת המ×רח. - - - This value does not match the expected {{ charset }} charset. - הערך ×ינו תו×× ×œ×ž×¢×¨×š ×”×ª×•×•×™× {{ charset }} הצפוי. - - - This is not a valid Business Identifier Code (BIC). - קוד זיהוי עסקי ×ינו חוקי (BIC). - - - Error - שגי××” - - - This is not a valid UUID. - הערך ×ינו ערך UUID חוקי. - - - This value should be a multiple of {{ compared_value }}. - הערך חייב להיות כפולה של {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - הקוד זיהוי עסקי (BIC) ×ינו משוייך ל IBAN {{ iban }}. - - - This value should be valid JSON. - הערך ×ינו ערך JSON תקין. - - - This collection should contain only unique elements. - ×”×וסף חייב להכיל רק ××œ×ž× ×˜×™× ×™×™×—×•×“×™×™×. - - - This value should be positive. - הערך חייב להיות חיובי. - - - This value should be either positive or zero. - הערך חייב להיות חיובי ×ו ×פס. - - - This value should be negative. - הערך חייב להיות שלילי. - - - This value should be either negative or zero. - הערך חייב להיות שלילי ×ו ×פס. - - - This value is not a valid timezone. - הערך ×ינו ×זור זמן תקין. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - ×¡×™×¡×ž× ×–×• הודלפה בהדלפת מידע, ×סור להשתמש בה. ×× × ×”×©×ª×ž×© בסיסמה ×חרת. - - - This value should be between {{ min }} and {{ max }}. - הערך חייב להיות בין {{ min }} ו- {{ max }}. - - - This value is not a valid hostname. - ערך ×–×” ×ינו ×©× ×ž×רח חוקי. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - מספר ×”××œ×ž× ×˜×™× ×‘×וסף ×–×” צריך להיות מכפיל של {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - ערך ×–×” ×מור לעמוד לפחות ב×חד התנ××™× ×”×‘××™×: - - - Each element of this collection should satisfy its own set of constraints. - כל ×למנט ב×וסף ×–×” ×מור לעמוד בקבוצת התנ××™× ×©×œ×•. - - - This value is not a valid International Securities Identification Number (ISIN). - ערך ×–×” ×ינו מספר זיהוי ניירות ערך בינל×ומי תקף (ISIN). + An empty file is not allowed. diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf index 34384b40155..126ef90332e 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hr.xlf @@ -20,7 +20,7 @@ The value you selected is not a valid choice. - Ova vrijednost nije valjan izbor. + Ova vrijednost treba biti jedna od ponuÄ‘enih. You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. @@ -36,7 +36,7 @@ This field was not expected. - Ovo polje nije oÄekivano. + Ovo polje nije oÄekivalo. This field is missing. @@ -48,7 +48,7 @@ This value is not a valid datetime. - Ova vrijednost nije ispravnog datum-vrijeme formata. + Ova vrijednost nije ispravan datum-vrijeme. This value is not a valid email address. @@ -88,11 +88,11 @@ This value should not be blank. - Ova vrijednost ne bi trebala biti prazna. + Ova vrijednost ne smije biti prazna. This value should not be null. - Ova vrijednost ne bi trebala biti null. + Ova vrijednost ne smije biti null. This value should be null. @@ -148,7 +148,7 @@ This value is not a valid country. - Ova vrijednost nije ispravna država. + Ova vrijednost nije ispravna zemlja. This value is already used. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - U php.ini datoteci nije konfiguriran privremeni direktorij. + U php.ini datoteci nije konfiguriran privremeni folder. Cannot write temporary file to disk. @@ -220,7 +220,7 @@ Unsupported card type or invalid card number. - Tip kartice nije podržan ili je broj kartice neispravan. + Neispravan broj kartice ili tip kartice nije podržan. This is not a valid International Bank Account Number (IBAN). @@ -248,35 +248,35 @@ This value should be equal to {{ compared_value }}. - Ova vrijednost treba biti jednaka {{ compared_value }}. + Ova vrijednost bi trebala biti jednaka {{ compared_value }}. This value should be greater than {{ compared_value }}. - Ova vrijednost treba biti veća od {{ compared_value }}. + Ova vrijednost bi trebala biti veća od {{ compared_value }}. This value should be greater than or equal to {{ compared_value }}. - Ova vrijednost treba biti veća od ili jednaka {{ compared_value }}. + Ova vrijednost bi trebala biti veća ili jednaka od {{ compared_value }}. This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Ova vrijednost treba biti {{ compared_value_type }} {{ compared_value }}. + Ova vrijednost bi trebala biti {{ compared_value_type }} {{ compared_value }}. This value should be less than {{ compared_value }}. - Ova vrijednost treba biti manja od {{ compared_value }}. + Ova vrijednost bi trebala biti manja od {{ compared_value }}. This value should be less than or equal to {{ compared_value }}. - Ova vrijednost treba biti manja od ili jednaka {{ compared_value }}. + Ova vrijednost bi trebala biti manja ili jednaka {{ compared_value }}. This value should not be equal to {{ compared_value }}. - Ova vrijednost treba biti razliÄita od {{ compared_value }}. + Ova vrijednost ne bi trebala biti {{ compared_value }}. This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Ova vrijednost treba biti razliÄita od {{ compared_value_type }} {{ compared_value }}. + Ova vrijednost ne bi trebala biti {{ compared_value_type }} {{ compared_value }}. The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. @@ -304,11 +304,11 @@ The host could not be resolved. - Poslužitelj ne može biti pronaÄ‘en. + Poslužitelj nije mogao biti razrijeÅ¡en. This value does not match the expected {{ charset }} charset. - Ova vrijednost ne odgovara oÄekivanom {{ charset }} znakovnom skupu. + Znakovne oznake vrijednosti ne odgovaraju oÄekivanom {{ charset }} skupu. This is not a valid Business Identifier Code (BIC). @@ -318,90 +318,6 @@ Error GreÅ¡ka - - This is not a valid UUID. - Ovo nije validan UUID. - - - This value should be a multiple of {{ compared_value }}. - Ova vrijednost treba biti viÅ¡ekratnik od {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Poslovni identifikacijski broj (BIC) nije povezan sa IBAN brojem {{ iban }}. - - - This value should be valid JSON. - Ova vrijednost treba biti validan JSON. - - - This collection should contain only unique elements. - Ova kolekcija treba sadržavati samo unikatne elemente. - - - This value should be positive. - Ova vrijednost treba biti pozitivna. - - - This value should be either positive or zero. - Ova vrijednost treba biti pozitivna ili jednaka nuli. - - - This value should be negative. - Ova vrijednost treba biti negativna. - - - This value should be either negative or zero. - Ova vrijednost treba biti negativna ili jednaka nuli. - - - This value is not a valid timezone. - Ova vrijednost nije validna vremenska zona. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ova lozinka je procurila u nekom od sigurnosnih propusta, te je potrebno koristiti drugu lozinku. - - - This value should be between {{ min }} and {{ max }}. - Ova vrijednost treba biti izmeÄ‘u {{ min }} i {{ max }}. - - - This value is not a valid hostname. - Ova vrijednost nije ispravno ime poslužitelja (engl. hostname). - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Broj elemenata u kolekciji treba biti djeljiv s {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ova vrijednost mora zadovoljiti jedan od sljedećih ograniÄenja: - - - Each element of this collection should satisfy its own set of constraints. - Svaki element ove kolekcije mora zadovoljiti vlastiti skup ograniÄenja. - - - This value is not a valid International Securities Identification Number (ISIN). - Ova vrijednost nije ispravan meÄ‘unarodni identifikacijski broj vrijednosnih papira (ISIN). - - - This value should be a valid expression. - Ova vrijednost mora biti valjani izraz. - - - This value is not a valid CSS color. - Ova vrijednost nije važeća CSS boja. - - - This value is not a valid CIDR notation. - Ova vrijednost nije valjana CIDR notacija. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Vrijednost mrežne maske trebala bi biti izmeÄ‘u {{ min }} i {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf index 30b0dbedbbf..1011d548182 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hu.xlf @@ -322,86 +322,6 @@ This is not a valid UUID. Érvénytelen egyedi azonosító (UUID). - - This value should be a multiple of {{ compared_value }}. - Ennek az értéknek oszthatónak kell lennie a következÅ‘vel: {{ compared_value }} - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ez a Bankazonosító kód (BIC) nem kapcsolódik az IBAN kódhoz ({{ iban }}). - - - This value should be valid JSON. - Ez az érték érvényes JSON kell, hogy legyen. - - - This value should be positive. - Ennek az értéknek pozitívnak kell lennie. - - - This value should be either positive or zero. - Ennek az értéknek pozitívnak vagy nullának kell lennie. - - - This value should be negative. - Ennek az értéknek negatívnak kell lennie. - - - This value should be either negative or zero. - Ennek az értéknek negatívnak vagy nullának kell lennie. - - - This collection should contain only unique elements. - Ez a gyűjtemény csak egyedi elemeket tartalmazhat. - - - This value is not a valid timezone. - Ez az érték nem egy érvényes idÅ‘zóna. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ez a jelszó korábban egy adatvédelmi incidens során illetéktelenek kezébe került, így nem használható. Kérjük, használjon másik jelszót. - - - This value should be between {{ min }} and {{ max }}. - Ennek az értéknek {{ min }} és {{ max }} között kell lennie. - - - This value is not a valid hostname. - Ez az érték nem egy érvényes állomásnév (hosztnév). - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - A gyűjteményben lévÅ‘ elemek számának oszthatónak kell lennie a következÅ‘vel: {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ennek az értéknek meg kell felelni legalább egynek a következÅ‘ feltételek közül: - - - Each element of this collection should satisfy its own set of constraints. - A gyűjtemény minden elemének meg kell felelni a saját feltételeinek. - - - This value is not a valid International Securities Identification Number (ISIN). - Ez az érték nem egy érvényes nemzetközi értékpapír-azonosító szám (ISIN). - - - This value should be a valid expression. - Ennek az értéknek érvényes kifejezésnek kell lennie. - - - This value is not a valid CSS color. - Ez az érték nem egy érvényes CSS szín. - - - This value is not a valid CIDR notation. - Ez az érték nem egy érvényes CIDR jelölés. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Ennek a netmask értéknek {{ min }} és {{ max }} között kell lennie. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf index f53df123423..bc0daced86d 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.hy.xlf @@ -4,11 +4,11 @@ This value should be false. - Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¯Õ¥Õ²Õ®Ö‰ + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ½Õ­Õ¡Õ¬Ö‰ This value should be true. - Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ«Ö€Õ¡Õ¯Õ¡Õ¶Ö‰ + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ³Õ«Õ·Õ¿Ö‰ This value should be of type {{ type }}. @@ -131,25 +131,25 @@ Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ©Õ«Õ¾Ö‰ + This value is not a valid country. + Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¥Ö€Õ¯Õ«Ö€Ö‰ + + This file is not a valid image. Õ†Õ«Õ·Ö„Õ¨ Õ¶Õ¯Õ¡Ö€Õ« Õ¾Õ¡Õ¾Õ¥Ö€ Ö†Õ¸Ö€Õ´Õ¡Õ¿ Õ¹Õ§Ö‰ - + This is not a valid IP address. Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ IP Õ°Õ¡Õ½ÖÕ¥ Õ¹Õ§Ö‰ - + This value is not a valid language. Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¬Õ¥Õ¦Õ¸Ö‚ Õ¹Õ§Ö‰ - + This value is not a valid locale. Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ« Õ°Õ¡Õ¶Õ¤Õ«Õ½Õ¡Õ¶Õ¸Ö‚Õ´ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¿Õ¥Õ²Õ¡ÕµÕ¶Õ¡ÖÕ¸Ö‚Õ´Ö‰ - - This value is not a valid country. - Ô±Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¥Ö€Õ¯Õ«Ö€Ö‰ - This value is already used. Ô±ÕµÕ¤ Õ¡Ö€ÕªÕ¥Ö„Õ¶ Õ¡Ö€Õ¤Õ¥Õ¶ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¾Õ¸Ö‚Õ´ Õ§Ö‰ @@ -204,15 +204,15 @@ This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ« Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¥Õ¬Õ¾Õ¡Õ®Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« limit }} Õ¿Õ¡Ö€Ö€ Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ«Õ¶Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Õ«Õ¶ Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ«Ö‰ + Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ« Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¥Õ¬Õ¾Õ¡Õ®Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« limit }} Õ¿Õ¡Ö€Ö€ Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ«Õ¶Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Õ«Õ¶ Õ¯Õ¡Õ´ Õ¡Õ¾Õ¥Õ¬Õ«Ö‰ This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰ + Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€ Õ¯Õ¡Õ´ Ö„Õ«Õ¹Ö‰ This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« Õ¸Ö‚Õ²Õ«Õ² {{ limit }} Õ¿Õ¡Ö€Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« Õ¸Ö‚Õ²Õ«Õ² {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰ + Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« Õ¸Ö‚Õ²Õ«Õ² {{ limit }} Õ¿Õ¡Ö€Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« Õ¸Ö‚Õ²Õ«Õ² {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰|Ô±ÕµÕ½ Õ°Õ¡Õ¾Õ¡Ö„Õ¡Õ®Õ¸Ö‚Õ¶ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Õ¸Ö‚Ö€Õ¡Õ¯Õ« {{ limit }} Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰ Invalid card number. @@ -304,92 +304,16 @@ The host could not be resolved. - Õ€Õ¸Õ½Õ©Õ« Õ¡Õ¶Õ¸Ö‚Õ¶Õ¨ Õ°Õ¶Õ¡Ö€Õ¡Õ¾Õ¸Ö€ Õ¹Õ« ÕºÕ¡Ö€Õ¦Õ¥Õ¬Ö‰ + Õ€Õ¸Õ½Õ©Õ« Õ¡Õ¶Õ¸Ö‚Õ¶Õ¨ Õ°Õ¶Õ¡Ö€Õ¡Õ¾Õ¸Ö€ Õ¹Õ« ÕºÕ¡Ö€Õ¦Õ¥Õ¬: This value does not match the expected {{ charset }} charset. - Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ« Õ°Õ¡Õ´Õ¨Õ¶Õ¯Õ¶Õ¸Ö‚Õ´ {{ charset }} Õ¯Õ¸Õ¤Õ¡Õ¾Õ¸Ö€Õ´Õ¡Õ¶ Õ°Õ¥Õ¿Ö‰ + Ô±Ö€ÕªÕ¥Ö„Õ¨ Õ¹Õ« Õ°Õ¡Õ´Õ¨Õ¶Õ¯Õ¶Õ¸Ö‚Õ´ {{ charset }} Õ¯Õ¸Õ¤Õ¡Õ¾Õ¸Ö€Õ´Õ¡Õ¶ Õ°Õ¥Õ¿: This is not a valid Business Identifier Code (BIC). ÕÕ¡ Õ¾Õ¡Õ¾Õ¥Ö€ Business Identifier Code (BIC) Õ¹Õ§Ö‰ - - Error - ÕÕ­Õ¡Õ¬ - - - This is not a valid UUID. - ÕÕ¡ Õ¾Õ¡Õ¾Õ¥Ö€ UUID Õ¹Õ§Ö‰ - - - This value should be a multiple of {{ compared_value }}. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¢Õ¡Õ¦Õ´Õ¡Õ¯Õ« {{ compared_value }}Ö‰ - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ô²Õ«Õ¦Õ¶Õ¥Õ½Õ« Õ¶Õ¸Ö‚ÕµÕ¶Õ¡Õ¯Õ¡Õ¶Õ¡ÖÕ´Õ¡Õ¶ Õ¯Õ¸Õ¤Õ¨ (BIC) Õ¯Õ¡ÕºÕ¾Õ¡Õ® Õ¹Õ§ IBAN- Õ« Õ°Õ¥Õ¿ {{ iban }}Ö‰ - - - This value should be valid JSON. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¾Õ¡Õ¾Õ¥Ö€ JSONÖ‰ - - - This collection should contain only unique elements. - Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ¸Ö‚Õ´Õ¢Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ ÕºÕ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ« Õ´Õ«Õ¡ÕµÕ¶ Õ¥Õ¦Õ¡Õ¯Õ« Õ¿Õ¡Ö€Ö€Õ¥Ö€Ö‰ - - - This value should be positive. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¤Ö€Õ¡Õ¯Õ¡Õ¶Ö‰ - - - This value should be either positive or zero. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¤Ö€Õ¡Õ¯Õ¡Õ¶ Õ¯Õ¡Õ´ Õ¦Ö€Õ¸ÕµÕ¡Õ¯Õ¡Õ¶Ö‰ - - - This value should be negative. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¢Õ¡ÖÕ¡Õ½Õ¡Õ¯Õ¡Õ¶Ö‰ - - - This value should be either negative or zero. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¢Õ¡ÖÕ¡Õ½Õ¡Õ¯Õ¡Õ¶ Õ¯Õ¡Õ´ Õ¦Ö€Õ¸ÕµÕ¡Õ¯Õ¡Õ¶Ö‰ - - - This value is not a valid timezone. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ ÕªÕ¡Õ´Õ¡ÕµÕ«Õ¶ Õ£Õ¸Õ¿Õ« Õ¹Õ§Ö‰ - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ô³Õ¡Õ²Õ¿Õ¶Õ¡Õ¢Õ¡Õ¼Õ¨ Õ£Õ¿Õ¶Õ¾Õ¥Õ¬ Õ§ Õ¿Õ¾ÕµÕ¡Õ¬Õ¶Õ¥Ö€Õ« Õ¡Ö€Õ¿Õ¡Õ°Õ¸Õ½Ö„Õ¸Ö‚Õ´. Õ¡ÕµÕ¶ Õ¹ÕºÕ¥Õ¿Ö„ Õ§ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¾Õ«: Ô½Õ¶Õ¤Ö€Õ¸Ö‚Õ´ Õ¥Õ¶Ö„ Ö…Õ£Õ¿Õ¡Õ£Õ¸Ö€Õ®Õ¥Õ¬ Õ´Õ¥Õ¯ Õ¡ÕµÕ¬ Õ£Õ¡Õ²Õ¿Õ¶Õ¡Õ¢Õ¡Õ¼Ö‰ - - - This value should be between {{ min }} and {{ max }}. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« {{ min }}-Õ« Ö‡ {{ max }}-Õ« Õ´Õ«Õ»Ö‡Ö‰ - - - This value is not a valid hostname. - Ô±ÕµÕ½ Õ°Õ¸Õ½Õ¿Õ« Õ¡Õ¶Õ¸Ö‚Õ¶Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¹Õ§Ö‰ - - - The number of elements in this collection should be a multiple of {{ compared_value }}․ - Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ´Õ¢Õ« Õ¿Õ¡Ö€Ö€Õ¥Ö€Õ« Ö„Õ¡Õ¶Õ¡Õ¯Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ°Õ¡Õ¾Õ¡Õ½Õ¡Ö€ Õ¬Õ«Õ¶Õ« {{ compared_value }}-Õ« Õ¢Õ¡Õ¦Õ´Õ¡ÕºÕ¡Õ¿Õ«Õ¯Õ¶Õ¥Ö€Õ«Õ¶Ö‰ - - - This value should satisfy at least one of the following constraints: - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¢Õ¡Õ¾Õ¡Ö€Õ¡Ö€Õ« Õ°Õ¥Õ¿Ö‡ÕµÕ¡Õ¬ Õ½Õ¡Õ°Õ´Õ¡Õ¶Õ¡ÖƒÕ¡Õ¯Õ¸Ö‚Õ´Õ¶Õ¥Ö€Õ«Ö Õ¡Õ¼Õ¶Õ¾Õ¡Õ¦Õ¶ Õ´Õ¥Õ¯Õ¨Ö‰ - - - Each element of this collection should satisfy its own set of constraints. - Ô±ÕµÕ½ Õ°Õ¡Õ´Õ¡Õ­Õ´Õ¢Õ« ÕµÕ¸Ö‚Ö€Õ¡Ö„Õ¡Õ¶Õ¹ÕµÕ¸Ö‚Ö€ Õ¿Õ¡Ö€Ö€ ÕºÕ¥Õ¿Ö„ Õ§ Õ¢Õ¡Õ¾Õ¡Ö€Õ¡Ö€Õ« Õ«Ö€ Õ½Õ¥ÖƒÕ¡Õ¯Õ¡Õ¶ Õ½Õ¡Õ°Õ´Õ¡Õ¶Õ¡ÖƒÕ¡Õ¯Õ¸Ö‚Õ´Õ¶Õ¥Ö€Õ¨Ö‰ - - - This value is not a valid International Securities Identification Number (ISIN). - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ Õ¡Ö€ÕªÕ¥Õ©Õ²Õ©Õ¥Ö€Õ« Õ¶Õ¸Ö‚ÕµÕ¶Õ¡Õ¯Õ¡Õ¶Õ¡ÖÕ´Õ¡Õ¶ Õ´Õ«Õ»Õ¡Õ¦Õ£Õ¡ÕµÕ«Õ¶ Õ°Õ¡Õ´Õ¡Ö€Õ¨ Õ¾Õ¡Õ¾Õ¥Ö€ Õ¹Õ§(ISIN)Ö‰ - - - This value should be a valid expression. - Ô±ÕµÕ½ Õ¡Ö€ÕªÕ¥Ö„Õ¨ ÕºÕ¥Õ¿Ö„ Õ§ Õ¬Õ«Õ¶Õ« Õ¾Õ¡Õ¾Õ¥Ö€ Õ¡Ö€Õ¿Õ¡Õ°Õ¡ÕµÕ¿Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶: - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf index 1687f330bc5..535bdac0823 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.id.xlf @@ -318,90 +318,6 @@ Error Galat - - This is not a valid UUID. - Ini bukan UUID yang sah. - - - This value should be a multiple of {{ compared_value }}. - Nilai ini harus kelipatan dari {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Business Identifier Code (BIC) ini tidak terkait dengan IBAN {{ iban }}. - - - This value should be valid JSON. - Nilai ini harus berisi JSON yang sah. - - - This collection should contain only unique elements. - Kumpulan ini harus mengandung elemen yang unik. - - - This value should be positive. - Nilai ini harus positif. - - - This value should be either positive or zero. - Nilai ini harus positif atau nol. - - - This value should be negative. - Nilai ini harus negatif. - - - This value should be either negative or zero. - Nilai ini harus negatif atau nol. - - - This value is not a valid timezone. - Nilai ini harus merupakan zona waktu yang sah. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Kata sandi ini telah bocor di data breach, harus tidak digunakan kembali. Silahkan gunakan kata sandi yang lain. - - - This value should be between {{ min }} and {{ max }}. - Nilai ini harus berada diantara {{ min }} dan {{ max }}. - - - This value is not a valid hostname. - Nilai ini bukan merupakan hostname yang sah. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Angka dari setiap elemen di dalam kumpulan ini harus kelipatan dari {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Nilai ini harus memenuhi setidaknya satu dari batasan berikut: - - - Each element of this collection should satisfy its own set of constraints. - Setiap elemen koleksi ini harus memenuhi batasannya sendiri. - - - This value is not a valid International Securities Identification Number (ISIN). - Nilai ini bukan merupakan International Securities Identification Number (ISIN) yang sah. - - - This value should be a valid expression. - Nilai ini harus berupa ekspresi yang sah. - - - This value is not a valid CSS color. - Nilai ini bukan merupakan warna CSS yang sah. - - - This value is not a valid CIDR notation. - Nilai ini bukan merupakan notasi CIDR yang sah. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Nilai dari netmask harus berada diantara {{ min }} dan {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf index c7cd43784ee..f19544701d6 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.it.xlf @@ -322,86 +322,6 @@ This is not a valid UUID. Questo non è un UUID valido. - - This value should be a multiple of {{ compared_value }}. - Questo valore dovrebbe essere un multiplo di {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Questo codice identificativo bancario (BIC) non è associato all'IBAN {{ iban }}. - - - This value should be valid JSON. - Questo valore dovrebbe essere un JSON valido. - - - This collection should contain only unique elements. - Questa collezione dovrebbe contenere solo elementi unici. - - - This value should be positive. - Questo valore dovrebbe essere positivo. - - - This value should be either positive or zero. - Questo valore dovrebbe essere positivo oppure zero. - - - This value should be negative. - Questo valore dovrebbe essere negativo. - - - This value should be either negative or zero. - Questo valore dovrebbe essere negativo oppure zero. - - - This value is not a valid timezone. - Questo valore non è un fuso orario valido. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Questa password è trapelata durante una compromissione di dati, non deve essere usata. Si prega di usare una password diversa. - - - This value should be between {{ min }} and {{ max }}. - Questo valore dovrebbe essere compreso tra {{ min }} e {{ max }}. - - - This value is not a valid hostname. - Questo valore non è un nome di host valido. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Il numero di elementi in questa collezione dovrebbe essere un multiplo di {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Questo valore dovrebbe soddisfare almeno uno dei vincoli seguenti: - - - Each element of this collection should satisfy its own set of constraints. - Ciascun elemento di questa collezione dovrebbe soddisfare il suo insieme di vincoli. - - - This value is not a valid International Securities Identification Number (ISIN). - Questo valore non è un codice identificativo internazionale di valori mobiliari (ISIN) valido. - - - This value should be a valid expression. - Questo valore dovrebbe essere un'espressione valida. - - - This value is not a valid CSS color. - Questo valore non è un colore CSS valido. - - - This value is not a valid CIDR notation. - Questo valore non è una notazione CIDR valida. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Il valore della netmask dovrebbe essere compreso tra {{ min }} e {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf index 9feed48d04c..0c61d15715b 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf @@ -326,82 +326,6 @@ This value should be a multiple of {{ compared_value }}. {{ compared_value }}ã®å€æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - ã“ã®SWIFTコードã¯IBANコード({{ iban }})ã«é–¢é€£ä»˜ã‘られã¦ã„ã¾ã›ã‚“。 - - - This value should be valid JSON. - JSONã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This collection should contain only unique elements. - è¦ç´ ã¯é‡è¤‡ã—ã¦ã¯ãªã‚Šã¾ã›ã‚“。 - - - This value should be positive. - æ­£ã®æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This value should be either positive or zero. - æ­£ã®æ•°ã€ã¾ãŸã¯0ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This value should be negative. - è² ã®æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This value should be either negative or zero. - è² ã®æ•°ã€ã¾ãŸã¯0ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This value is not a valid timezone. - 有効ãªã‚¿ã‚¤ãƒ ã‚¾ãƒ¼ãƒ³ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 - - - This password has been leaked in a data breach, it must not be used. Please use another password. - ã“ã®ãƒ‘スワードã¯æ¼æ´©ã—ã¦ã„る為使用ã§ãã¾ã›ã‚“。 - - - This value should be between {{ min }} and {{ max }}. - {{ min }}以上{{ max }}以下ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This value is not a valid hostname. - 有効ãªãƒ›ã‚¹ãƒˆåã§ã¯ã‚ã‚Šã¾ã›ã‚“。 - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - è¦ç´ ã®æ•°ã¯{{ compared_value }}ã®å€æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This value should satisfy at least one of the following constraints: - 以下ã®åˆ¶ç´„ã®ã†ã¡å°‘ãªãã¨ã‚‚1ã¤ã‚’満ãŸã™å¿…è¦ãŒã‚ã‚Šã¾ã™: - - - Each element of this collection should satisfy its own set of constraints. - コレクションã®å„è¦ç´ ã¯ã€ãã‚Œãžã‚Œã®åˆ¶ç´„を満ãŸã™å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ - - - This value is not a valid International Securities Identification Number (ISIN). - ã“ã®å€¤ã¯æœ‰åŠ¹ãªå›½éš›è¨¼åˆ¸è­˜åˆ¥ç•ªå·ï¼ˆISIN)ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 - - - This value should be a valid expression. - å¼ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 - - - This value is not a valid CSS color. - ã“ã®å€¤ã¯æœ‰åŠ¹ãªCSSカラーã§ã¯ã‚ã‚Šã¾ã›ã‚“。 - - - This value is not a valid CIDR notation. - ã“ã®å€¤ã¯æœ‰åŠ¹ãªCIDR表記ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 - - - The value of the netmask should be between {{ min }} and {{ max }}. - ãƒãƒƒãƒˆãƒžã‚¹ã‚¯ã®å€¤ã¯ã€{{ min }}ã‹ã‚‰{{ max }}ã®é–“ã«ã‚ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf index f27bbd4bca0..bdbc9da09c8 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lb.xlf @@ -35,12 +35,12 @@ Een oder méi vun de Wäerter ass ongëlteg. - This field was not expected. - D'Feld gouf net erwaart. + The fields {{ fields }} were not expected. + D'Felder {{ fields }} goufen net erwaart. - This field is missing. - D'Feld feelt. + The fields {{ fields }} are missing. + D'Felder {{ fields }} feelen. This value is not a valid date. @@ -322,70 +322,6 @@ This is not a valid UUID. Dëst ass keng gëlteg UUID. - - This value should be a multiple of {{ compared_value }}. - Dëse Wäert sollt e puer vun {{ compared_value }} sinn. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Dëse "Business Identifier Code" (BIC) ass net mat IBAN verbonnen {{ iban }}. - - - This value should be valid JSON. - Dëse Wäert sollt gëlteg JSON. - - - This collection should contain only unique elements. - Dës Sammlung sollt just eenzegaarteg Elementer enthalen. - - - This value should be positive. - Dëse Wäert sollt positiv sinn. - - - This value should be either positive or zero. - Dëse Wäert sollt entweeder positiv oder null sinn. - - - This value should be negative. - Dëse Wäert sollt negativ sinn. - - - This value should be either negative or zero. - Dëse Wäert sollt entweeder negativ oder null sinn. - - - This value is not a valid timezone. - Dëse Wäert ass keng gëlteg Zäitzon. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Dëst Passwuert war Deel vun engem Dateleck an dierf net benotzt ginn. Benotzt w.e.g. en anert Passwuert . - - - This value should be between {{ min }} and {{ max }}. - De Wäert sollt tëscht {{ min }} a(n) {{ max }} leien. - - - This value is not a valid hostname. - Dëse Wäert ass kee gëltegen Hostnumm. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - D'Unzuel un Elementer an dëser Sammlung sollt e multipel vu(n) {{ compared_value }} sinn. - - - This value should satisfy at least one of the following constraints: - Dëse Wäert sollt op d'mannst ee vun dësen Aschränkungen erfëllen: - - - Each element of this collection should satisfy its own set of constraints. - All Element aus dëser Sammlung sollt seng eegen Aschränkungen erfëllen. - - - This value is not a valid International Securities Identification Number (ISIN). - Dëse Wäert ass keng gëlteg International Wäertpabeiererkennnummer (ISIN). - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf index 7a2c4c521b5..60641b5e68d 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lt.xlf @@ -131,25 +131,25 @@ Å i reikÅ¡mÄ— turi bÅ«ti skaiÄius. + This value is not a valid country. + Å i reikÅ¡mÄ— nÄ—ra tinkama Å¡alis. + + This file is not a valid image. Byla nÄ—ra paveikslÄ—lis. - + This is not a valid IP address. Å i reikÅ¡mÄ— nÄ—ra tinkamas IP adresas. - + This value is not a valid language. Å i reikÅ¡mÄ— nÄ—ra tinkama kalba. - + This value is not a valid locale. Å i reikÅ¡mÄ— nÄ—ra tinkama lokalÄ—. - - This value is not a valid country. - Å i reikÅ¡mÄ— nÄ—ra tinkama Å¡alis. - This value is already used. Å i reikÅ¡mÄ— jau yra naudojama. @@ -302,106 +302,10 @@ An empty file is not allowed. Failas negali bÅ«ti tuÅ¡Äias. - - The host could not be resolved. - Serveris nepasiekiamas. - - - This value does not match the expected {{ charset }} charset. - Å i reikÅ¡mÄ— neatitinka {{ charset }} koduotÄ—s. - - - This is not a valid Business Identifier Code (BIC). - BendrovÄ—s Identifikavimo Kodas (BIC) nÄ—ra tinkamas. - Error Klaida - - This is not a valid UUID. - Å i reikÅ¡mÄ— nÄ—ra tinkamas UUID. - - - This value should be a multiple of {{ compared_value }}. - Å i reikÅ¡mÄ— turi bÅ«ti skaiÄiaus {{ compared_value }} kartotinis. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Å is bendrovÄ—s identifikavimo kodas (BIC) nesusijÄ™s su IBAN {{ iban }}. - - - This value should be valid JSON. - Å i reikÅ¡mÄ— turi bÅ«ti tinkamo JSON formato. - - - This collection should contain only unique elements. - SÄ…raÅ¡e turi bÅ«ti tik unikalios reikÅ¡mÄ—s. - - - This value should be positive. - ReikÅ¡mÄ— turi bÅ«ti teigiama. - - - This value should be either positive or zero. - ReikÅ¡mÄ— turi bÅ«ti teigiama arba lygi nuliui. - - - This value should be negative. - ReikÅ¡mÄ— turi bÅ«ti neigiama. - - - This value should be either negative or zero. - ReikÅ¡mÄ— turi bÅ«ti neigiama arba lygi nuliui. - - - This value is not a valid timezone. - ReikÅ¡mÄ— nÄ—ra tinkama laiko juosta. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Slaptažodis yra nutekÄ—jÄ™s duomenų saugumo pažeidime, jo naudoti negalima. PraÅ¡ome naudoti kitÄ… slaptažodį. - - - This value should be between {{ min }} and {{ max }}. - Å i reikÅ¡mÄ— turi bÅ«ti tarp {{ min }} ir {{ max }}. - - - This value is not a valid hostname. - Å i reikÅ¡mÄ— nÄ—ra tinkamas svetainÄ—s adresas. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Å io sÄ…raÅ¡o elementų skaiÄius turÄ—tų bÅ«ti skaiÄiaus {{ compared_value }} kartotinis. - - - This value should satisfy at least one of the following constraints: - Å i reikÅ¡mÄ— turÄ—tų atitikti bent vienÄ… iÅ¡ Å¡ių nurodymų: - - - Each element of this collection should satisfy its own set of constraints. - Kiekvienas Å¡io sÄ…raÅ¡o elementas turi atitikti savo nurodymų rinkinį. - - - This value is not a valid International Securities Identification Number (ISIN). - Å i reiÅ¡mÄ— neatitinka tarptautinio vertybinių popierių identifikavimo numerio formato (ISIN). - - - This value should be a valid expression. - Å i vertÄ— turÄ—tų bÅ«ti teisinga iÅ¡raiÅ¡ka. - - - This value is not a valid CSS color. - Å i reikÅ¡mÄ— nÄ—ra tinkama CSS spalva. - - - This value is not a valid CIDR notation. - Å i vertÄ— nÄ—ra tinkamas CIDR žymÄ—jimas. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Tinklo kaukÄ—s reikÅ¡mÄ— turi bÅ«ti nuo {{ min }} iki {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf index fc71d5f9943..2ad19cd283c 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.lv.xlf @@ -268,7 +268,7 @@ This value should be less than or equal to {{ compared_value }}. - Å ai vÄ“rtÄ«bai ir jÄbÅ«t mazÄkai vai vienÄdai ar {{ compared_value }}. + TÅ ai vÄ“rtÄ«bai ir jÄbÅ«t mazÄkai vai vienÄdai ar {{ compared_value }}. This value should not be equal to {{ compared_value }}. @@ -310,98 +310,6 @@ This value does not match the expected {{ charset }} charset. Å Ä« vÄ“rtÄ«ba neatbilst sagaidÄmajai rakstzÄ«mju kopai {{ charset }}. - - This is not a valid Business Identifier Code (BIC). - Å Ä« vÄ“rtÄ«ba nav derÄ«gs Biznesa IdentifikÄcijas Kods (BIC). - - - Error - Kļūda - - - This is not a valid UUID. - Å is nav derÄ«gs UUID. - - - This value should be a multiple of {{ compared_value }}. - Å ai vÄ“rtÄ«bai jÄbÅ«t vairÄkas reizes atkÄrtotai {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Å is Biznesa IdentifikÄcijas Kods (BIC) neatbilst {{ iban }} konta numuram (IBAN). - - - This value should be valid JSON. - Å ai vÄ“rtÄ«bai jÄbÅ«t derÄ«gam JSON. - - - This collection should contain only unique elements. - Å ai kolekcijai jÄsatur tikai unikÄli elementi. - - - This value should be positive. - Å ai vÄ“rtÄ«bai jÄbÅ«t pozitÄ«vai. - - - This value should be either positive or zero. - Å ai vÄ“rtÄ«bai jÄbÅ«t pozitÄ«vai vai vienÄdai ar nulli. - - - This value should be negative. - Å ai vÄ“rtÄ«bai jÄbÅ«t negatÄ«vai. - - - This value should be either negative or zero. - Å ai vÄ“rtÄ«bai jÄbÅ«t negatÄ«vai vai vienÄdai ar nulli. - - - This value is not a valid timezone. - Å Ä« vÄ“rtÄ«ba nav derÄ«ga laika zona. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Å Ä« parole tika publicÄ“ta datu noplÅ«dÄ“, viņu nedrÄ«kst izmantot. LÅ«dzu, izvÄ“lieties citu paroli. - - - This value should be between {{ min }} and {{ max }}. - Å ai vÄ“rtÄ«bai jÄbÅ«t starp {{ min }} un {{ max }}. - - - This value is not a valid hostname. - Å Ä« vÄ“rtÄ«ba nav derÄ«gs tÄ«mekļa servera nosaukums. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Elementu skaitam Å¡ajÄ kolekcijÄ jÄbÅ«t {{ compared_value }} reizinÄjumam. - - - This value should satisfy at least one of the following constraints: - Å ai vÄ“rtÄ«bai jÄiekļaujas vismaz vienÄ no sekojoÅ¡iem ierobežojumiem: - - - Each element of this collection should satisfy its own set of constraints. - Å Ä«s kolekcijas katram elementam jÄiekļaujas savÄ ierobežojumu kopÄ. - - - This value is not a valid International Securities Identification Number (ISIN). - Å Ä« vÄ“rtÄ«ba nav derÄ«gs starptautiskais vÄ“rtspapÄ«ru identifikÄcijas numurs (ISIN). - - - This value should be a valid expression. - Å ai vÄ“rtÄ«bai jÄbÅ«t korektai izteiksmei. - - - This value is not a valid CSS color. - Å Ä« vÄ“rtÄ«ba nav korekta CSS krÄsa. - - - This value is not a valid CIDR notation. - Å Ä« vÄ“rtÄ«ba nav korekts CIDR apzÄ«mÄ“jums. - - - The value of the netmask should be between {{ min }} and {{ max }}. - TÄ«kla maskas (netmask) vÄ“rtÄ«bai jÄbÅ«t starp {{ min }} un {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf index b767dc87c84..4be2198aa3b 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.mn.xlf @@ -131,260 +131,20 @@ Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° зөвхөн тоо байна. + This value is not a valid country. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн бодит ÑƒÐ»Ñ Ð±Ð¸Ñˆ байна. + + This file is not a valid image. Файл зураг биш байна. - + This is not a valid IP address. IP хаÑг зөв биш байна. - - This value is not a valid language. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв Ñ…Ñл биш байна. - - This value is not a valid locale. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв байршил биш байна. - - - This value is not a valid country. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн бодит ÑƒÐ»Ñ Ð±Ð¸Ñˆ байна. - - - This value is already used. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° аль Ñ…ÑдийнÑÑ Ñ…ÑÑ€ÑглÑгдÑÑн байна. - - - The size of the image could not be detected. - Зургийн Ñ…ÑмжÑÑ Ñ‚Ð¾Ð³Ñ‚Ð¾Ð¾Ð³Ð´Ð¾Ð¶ чадÑангүй. - - - The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Зургийн өргөн Ñ…ÑÑ‚Ñрхий том байна ({{ width }}px). Өргөн нь хамгийн ихдÑÑ {{ max_width }}px байх боломжтой. - - - The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Зургийн өргөн Ñ…ÑÑ‚Ñрхий жижиг байна ({{ width }}px). Өргөн нь хамгийн багадаа {{ min_width }}px байх боломжтой. - - - The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Зургийн өндөр Ñ…ÑÑ‚Ñрхий том байна ({{ height }}px). Өндөр нь хамгийн ихдÑÑ {{ max_height }}px байх боломжтой. - - - The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Зургийн өндөр Ñ…ÑÑ‚Ñрхий жижиг байна ({{ height }}px). Өндөр нь хамгийн багадаа {{ min_height }}px байх боломжтой. - - - This value should be the user's current password. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñ…ÑÑ€ÑглÑгчийн одоогийн нууц үг байх Ñ‘Ñтой. - - - This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñг {{ limit }} Ñ‚ÑмдÑгт байх Ñ‘Ñтой.|Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñг {{ limit }} Ñ‚ÑмдÑгт байх Ñ‘Ñтой. - - - The file was only partially uploaded. - Файлын зөвхөн Ñ…Ð°Ð³Ð°Ñ Ð½ÑŒ upload хийгдÑÑн. - - - No file was uploaded. - Ямар ч файл upload хийгдÑÑнгүй. - - - No temporary folder was configured in php.ini. - php.ini дÑÑÑ€ түр зуурын хавтÑыг тохируулаагүй байна, ÑÑвÑл тохируулÑан Ñ…Ð°Ð²Ñ‚Ð°Ñ Ð±Ð°Ð¹Ñ…Ð³Ò¯Ð¹ байна. - - - Cannot write temporary file to disk. - Түр зуурын файлыг диÑк руу бичиж болохгүй байна. - - - A PHP extension caused the upload to fail. - PHP extension нь upload -г амжилтгүй болгоод байна. - - - This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´ÑÑш тооны Ñлемент агуулах Ñ‘Ñтой.|Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´ÑÑш тооны Ñлемент агуулах Ñ‘Ñтой. - - - This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´Ð¾Ð¾Ñˆ тооны Ñлемент агуулах Ñ‘Ñтой.|Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† {{ limit }} ба түүнÑÑÑ Ð´Ð¾Ð¾Ñˆ тооны Ñлемент агуулах Ñ‘Ñтой. - - - This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† Ñг {{ limit }} Ñлемент агуулах Ñ‘Ñтой.|Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† Ñг {{ limit }} Ñлемент агуулах Ñ‘Ñтой. - - - Invalid card number. - Картын дугаар буруу байна. - - - Unsupported card type or invalid card number. - ДÑмжигдÑÑгүй картын төрөл ÑÑвÑл картын дугаар буруу байна. - - - This is not a valid International Bank Account Number (IBAN). - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв Олон УлÑын Банкны ДанÑны Дугаар (IBAN) биш байна. - - - This value is not a valid ISBN-10. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISBN-10 биш байна. - - - This value is not a valid ISBN-13. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISBN-13 биш байна. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISBN-10 юмуу ISBN-13 биш байна. - - - This value is not a valid ISSN. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв ISSN биш байна. - - - This value is not a valid currency. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн бодит валют биш байна. - - - This value should be equal to {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -Ñ‚aй Ñ‚Ñнцүү байх Ñ‘Ñтой. - - - This value should be greater than {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -Ñ Ð¸Ñ… байх Ñ‘Ñтой. - - - This value should be greater than or equal to {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -тай Ñ‚Ñнцүү юмуу ÑÑвÑл их байх Ñ‘Ñтой. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value_type }} {{ compared_value }} -тай Ñг ижил байх Ñ‘Ñтой. - - - This value should be less than {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -Ñ Ð±Ð°Ð³Ð° байх Ñ‘Ñтой. - - - This value should be less than or equal to {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -тай ижил юмуу ÑÑвÑл бага байх Ñ‘Ñтой. - - - This value should not be equal to {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -тай Ñ‚Ñнцүү байх Ñ‘Ñгүй. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value_type }} {{ compared_value }} -тай Ñг ижил байх Ñ‘Ñгүй. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Зургийн харьцаа Ñ…ÑÑ‚Ñрхий том байна ({{ ratio }}). Харьцаа нь хамгийн ихдÑÑ {{ max_ratio }} байна. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Зургийн харьцаа Ñ…ÑÑ‚Ñрхий жижиг байна ({{ ratio }}). Харьцаа нь хамгийн багадаа {{ min_ratio }} байна. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Зураг дөрвөлжин Ñ…ÑлбÑртÑй байна ({{ width }}x{{ height }}px). Дөрвөлжин зургууд оруулах боломжгүй. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Зураг Ñ…ÑвтÑÑ Ð±Ð°Ð¹Ñ€Ð»Ð°Ð»Ñ‚Ð°Ð¹ байна ({{ width }}x{{ height }}px). Ð¥ÑвтÑÑ Ð±Ð°Ð¹Ñ€Ð»Ð°Ð»Ñ‚Ð°Ð¹ зургууд оруулах боломжгүй. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Зургууд боÑоо байрлалтай байна ({{ width }}x{{ height }}px). БоÑоо байрлалтай зургууд оруулах боломжгүй. - - - An empty file is not allowed. - ХооÑон файл оруулах боломжгүй. - - - The host could not be resolved. - ХоÑÑ‚ зөв тохирогдоогүй байна. - - - This value does not match the expected {{ charset }} charset. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° тооцоолÑон {{ charset }} Ñ‚ÑмдÑгттÑй таарахгүй байна. - - - This is not a valid Business Identifier Code (BIC). - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв Business Identifier Code (BIC) биш байна. - - - Error - Ðлдаа - - - This is not a valid UUID. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв UUID биш байна. - - - This value should be a multiple of {{ compared_value }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ compared_value }} -н үржвÑÑ€ байх Ñ‘Ñтой. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ð­Ð½Ñ Business Identifier Code (BIC) код нь IBAN {{ iban }} -тай холбоогүй байна. - - - This value should be valid JSON. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° JSON байх Ñ‘Ñтой. - - - This collection should contain only unique elements. - Ð­Ð½Ñ ÐºÐ¾Ð»Ð»ÐµÐºÑ† зөвхөн давтагдахгүй Ñлементүүд агуулах Ñ‘Ñтой. - - - This value should be positive. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° ÑерÑг байх Ñ‘Ñтой. - - - This value should be either positive or zero. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñ‚Ñг ÑÑвÑл ÑерÑг байх Ñ‘Ñтой. - - - This value should be negative. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñөрөг байх Ñ‘Ñтой. - - - This value should be either negative or zero. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° Ñөрөг ÑÑвÑл Ñ‚Ñг байх Ñ‘Ñтой. - - - This value is not a valid timezone. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв цагийн Ð±Ò¯Ñ Ð±Ð¸Ñˆ байна. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ð­Ð½Ñ Ð½ÑƒÑƒÑ† үгийн мÑдÑÑлÑл алдагдÑан байх магадлалтай ÑƒÑ‡Ñ€Ð°Ð°Ñ Ð´Ð°Ñ…Ð¸Ð½ ашиглагдах Ñ‘Ñгүй. Ó¨Ó©Ñ€ нууц үг ашиглана уу. - - - This value should be between {{ min }} and {{ max }}. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° {{ min }} -Ñ {{ max }} хооронд байх Ñ‘Ñтой. - - - This value is not a valid hostname. - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° буруу hostname байна. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - ЭнÑÑ…Ò¯Ò¯ цуглуулган дахь ÑлемÑнтийн тоо, {{ compared_value }}-н үржвÑÑ€ байх Ñ‘Ñтой. - - - This value should satisfy at least one of the following constraints: - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° доорх болзолуудын Ñдаж нÑгийг хангах Ñ‘Ñтой: - - - Each element of this collection should satisfy its own set of constraints. - ЭнÑÑ…Ò¯Ò¯ цуглуулган дахь ÑлемÑнтүүд Ó©Ó©Ñ€ Ó©Ó©Ñ€Ñдийн болзолуудаа хангах Ñ‘Ñтой. - - - This value is not a valid International Securities Identification Number (ISIN). - Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° зөв International Securities Identification Number (ISIN) биш байна. + This value is not a valid language. + Ð­Ð½Ñ ÑƒÑ‚Ð³Ð° үнÑн зөв Ñ…Ñл биш байна . diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf deleted file mode 100644 index 7f45aaed64f..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.my.xlf +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - This value should be false. - ဤá€á€”်ဖိုးသည် false ဖြစ်ရမည်ዠ- - - This value should be true. - ဤá€á€”်ဖိုးသည် true ဖြစ်ရမည်ዠ- - - This value should be of type {{ type }}. - ဤá€á€”်ဖိုးသည် {{ type }} အမျိုးအစားဖြစ်ရမည်ዠ- - - This value should be blank. - ဤá€á€”်ဖိုးသည် ကွပ်လပ်မဖြစ်သင့်ပါዠ- - - The value you selected is not a valid choice. - သင်ရွေးá€á€»á€šá€ºá€žá€±á€¬á€á€”်ဖိုးသည် သင့်လျှော်သော် á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ - - - You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - သင်သည် အနည်းဆုံးရွေးá€á€»á€šá€ºá€™á€¾á€¯ {{ limit }} á€á€¯á€›á€½á€±á€¸á€á€»á€šá€ºá€›á€™á€Šá€ºá‹ - - - You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - သင်သည်အများဆုံး {{ limit }} á€á€¯á€žá€¬á€›á€½á€±á€¸á€á€»á€šá€ºá€á€½á€„့်ရှိသည်ዠ- - - One or more of the given values is invalid. - ပေးထားသောá€á€”်ဖိုးá€á€…်á€á€¯ (သို့မဟုá€á€º) á€á€…်á€á€¯á€‘က်ပိုáမမှန်ကန်ပါዠ- - - This field was not expected. - ဤကွက်လပ်ကိုမမျှော်လင့်ထားပါዠ- - - This field is missing. - ဤကွက်လပ်ကိုမမျှော်လင့်ထားပါዠ- - - This value is not a valid date. - ဤá€á€”်ဖိုးသည်မှန်ကန်သော်ရက်စွဲမဟုá€á€ºá€•á€«á‹ - - - This value is not a valid datetime. - ဤá€á€”်ဖိုးသည် မှန်ကန်သော် ရက်စွဲ/အá€á€»á€­á€”် မဟုá€á€ºá€•á€«á‹ - - - This value is not a valid email address. - ဤá€á€”်ဖိုးသည် မှန်ကန်သော် အီးမေးလိပ်စာ မဟုá€á€ºá€•á€«á‹ - - - The file could not be found. - ဖိုင်ရှာမá€á€½á€±á€·á€•á€«á‹ - - - The file is not readable. - ဤဖိုင်ကို ဖá€á€ºáမရပါዠ- - - The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - ဖိုင်အရွယ်အစား အလွန်ကြီးနေသည် ({{ size }} {{ suffix }}). á€á€½á€„့်ပြုထားသော အများဆုံး ဖိုင်ဆိုဒ်သည် {{ limit }} {{ suffix }} ဖြစ်သည်ዠ- - - The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - ဖိုင်á mime အမျိုးအစားမမှန်ကန်ပါ ({{ type }})á‹ á€á€½á€„့်ပြုထားသော mime အမျိုးအစားများမှာ {{ types }}. - - - This value should be {{ limit }} or less. - ဤá€á€”်ဖိုးသည် {{ limit }} (သို့မဟုá€á€º) {{ limit }} ထက်နည်းသင့်သည်ዠ- - - This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - ဤá€á€”်ဖိုးသည် အလွန်ရှည်လွန်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{ limit }} (သို့မဟုá€á€º) áŽá€„်းထက်နည်းသင့်သည်ዠ| ဤá€á€”်ဖိုးသည် အလွန်ရှည်လွန်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{limit}} á€á€¯á€”ှင့်အထက်ရှိသင့်သည်ዠ- - - This value should be {{ limit }} or more. - ဤá€á€”်ဖိုးသည် {{limit}} (သို့မဟုá€á€º) ထို့ထက်ပိုသင့်သည်ዠ- - - This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - ဤá€á€”်ဖိုးသည် အလွန်á€á€­á€¯á€œá€½á€”်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{limit}} (သို့မဟုá€á€º) ထို့ထက်ပိုရှိသင့်သည်ዠ| ဤá€á€”်ဖိုးသည်á€á€­á€¯á€œá€½á€”်းသည်ዠáŽá€„်းá€á€½á€„်အက္á€á€›á€¬ {{limit}} လုံးနှင့်အထက်ရှိသင့်သည်ዠ- - - This value should not be blank. - ဤá€á€”်ဖိုးသည်ကွက်လပ်မဖြစ်သင့်ပါዠ- - - This value should not be null. - ဤá€á€”်ဖိုးသည် null မဖြစ်သင့်ပါዠ- - - This value should be null. - ဤá€á€”်ဖိုးသည် null ဖြစ်သင့်သည်ዠ- - - This value is not valid. - ဤá€á€”်ဖိုးသည်မှန်ကန်သောá€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ - - - This value is not a valid time. - ဤá€á€”်ဖိုးသည်မှန်ကန်သော အá€á€»á€­á€”်á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ - - - This value is not a valid URL. - ဤá€á€”်ဖိုးသည်မှန်ကန်သော URL á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ - - - The two values should be equal. - á€á€”်ဖိုးနှစ်á€á€¯á€žá€Šá€º á€á€°á€Šá€®á€žá€„့်သည်ዠ- - - The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - ဤဖိုင်သည် အလွန်ကြီးသည်ዠá€á€½á€„့်ပြုထားသည့်အများဆုံးဖိုင်အရွယ်အစားသည် {{ limit }} {{ suffix }} ဖြစ်သည်ዠ- - - The file is too large. - ဤဖိုင်သည် အလွန်ကြီးသည်ዠ- - - The file could not be uploaded. - ဤဖိုင်ကိုá€á€„်áမရပါዠ- - - This value should be a valid number. - ဤá€á€”်ဖိုးသည်မှန်ကန်သောနံပါá€á€ºá€–ြစ်သင့်သည်ዠ- - - This file is not a valid image. - ဤဖိုင်သည်မှန်ကန်သော ဓါá€á€ºá€•á€¯á€¶á€™á€Ÿá€¯á€á€ºá€•á€«á‹ - - - This is not a valid IP address. - áŽá€„်းသည်á€á€›á€¬á€¸á€á€„် IP လိပ်စာမဟုá€á€ºá€•á€«á‹ - - - This value is not a valid language. - ဤá€á€”်ဖိုးသည် မှန်ကန်သောဘာသာစကားမဟုá€á€ºá€•á€«á‹ - - - This value is not a valid locale. - ဤá€á€”်ဖိုးသည်မှန်ကန်သောဘာသာပြန်မဟုá€á€ºá€•á€«á‹ - - - This value is not a valid country. - ဤá€á€”်ဖိုးသည်မှန်ကန်သောနိုင်ငံမဟုá€á€ºá€•á€«á‹ - - - This value is already used. - ဤá€á€”်ဖိုးသည် အသုံးပြုပြီးသားဖြစ်သည်ዠ- - - The size of the image could not be detected. - ဓါá€á€ºá€•á€¯á€¶á€¡á€›á€½á€šá€ºá€¡á€…ားကိုရှာမá€á€½á€±á€·á€•á€«á‹ - - - The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - ပုံáအလျားသည် ကြီးလွန်းသည် ({{ width }}px)á‹ á€á€½á€„့်ပြုထားသည့်အများဆုံးအလျားသည် {{max_width}}px ဖြစ်သည်ዠ- - - The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - ပုံáအလျားသည် သေးလွန်းသည် ({{ width }}px)á‹ á€á€½á€„့်ပြုထားသည့်အနည်းဆုံးအလျားသည် {{max_width}}px ဖြစ်သည်ዠ- - - The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - ပုံáအနံသည် ကြီးလွန်းသည် ({{ height }}px)á‹ á€á€½á€„့်ပြုထားသည့်အများဆုံးအနံသည် {{max_height}}px ဖြစ်သည်ዠ- - - The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - ပုံáအနံသည် သေးလွန်းသည် ({{ height }}px)á‹ á€á€½á€„့်ပြုထားသည့်အနည်းဆုံးအနံသည် {{min_height}}px ဖြစ်သည်ዠ- - - This value should be the user's current password. - ဤá€á€”်ဖိုးသည်အသုံးပြုသူá လက်ရှိစကားá€á€¾á€€á€ºá€–ြစ်သင့်သည်ዠ- - - This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - ဤá€á€”်ဖိုးသည်စာလုံး {{limit}} အá€á€­á€¡á€€á€»á€›á€¾á€­á€žá€„့်သည်ዠ- - - The file was only partially uploaded. - ဤဖိုင်သည်á€á€…်စိá€á€ºá€á€…်ပိုင်းသာ upload á€á€„်á€á€²á€·á€žá€Šá€ºá‹ - - - No file was uploaded. - မည်သည့် ဖိုင်မျှ upload မလုပ်á€á€²á€·á€•á€«á‹ - - - No temporary folder was configured in php.ini. - php.ini á€á€½á€„်ယာယီဖိုင်á€á€½á€²á€€á€­á€¯á€•á€¼á€„်ဆင်ထားá€á€¼á€„်းမရှိပါአ- - - Cannot write temporary file to disk. - ယာရီဖိုင်ကို disk မရေးနိုင်ပါዠ- - - A PHP extension caused the upload to fail. - PHP extension á€á€…်á€á€¯á€€á€¼á€±á€¬á€„့် upload á€á€„်áမရနိုင်ပါዠ- - - This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - ဤ collection á€á€½á€„် {{limit}} element (သို့မဟုá€á€º) ထို့ထက်မပိုသင့်ပါዠ- - - This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - ဤ collection á€á€½á€„် {{limit}} element (သို့မဟုá€á€º) áŽá€„်းထက်နည်းသင့်သည်ዠ- - - This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - ဤစုစည်းမှုá€á€½á€„် {{limit}} element အá€á€­á€¡á€€á€»á€•á€«á€žá€„့်သည်ዠ- - - Invalid card number. - ကဒ်နံပါá€á€ºá€™á€™á€¾á€”်ပါዠ- - - Unsupported card type or invalid card number. - ကဒ်အမျိုးအစားမမှန်ပါ (သို့မဟုá€á€º) ကဒ်နံပါá€á€ºá€™á€™á€¾á€”်ပါዠ- - - This is not a valid International Bank Account Number (IBAN). - ဤá€á€”်ဖိုးသည် á€á€›á€¬á€¸á€á€„်နိုင်ငံá€á€€á€¬á€˜á€á€ºá€¡á€€á€±á€¬á€„့်နံပါá€á€º (International Bank Account Number, IBAN) မဟုá€á€ºá€•á€«á‹ - - - This value is not a valid ISBN-10. - ဤá€á€”်ဖိုးသည် မှန်ကန်သော ISBN-10 á€á€”်ဖိုးမဟုá€á€ºá€•á€«áŠ - - - This value is not a valid ISBN-13. - ဤá€á€”်ဖိုးသည် မှန်ကန်သော ISBN-13 á€á€”်ဖိုးမဟုá€á€ºá€•á€«áŠ - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် ISBN-10 (သို့မဟုá€á€º) ISBN-13 á€á€”်ဖိုးမဟုá€á€ºá€•á€«áŠ - - - This value is not a valid ISSN. - ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် ISSN á€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ - - - This value is not a valid currency. - ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် ငွေကြေးá€á€”်ဖိုးမဟုá€á€ºá€•á€«á‹ - - - This value should be equal to {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value }} နှင့်ညီသင့်သည်ዠ- - - This value should be greater than {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက်ကြီးသင့်သည်ዠ- - - This value should be greater than or equal to {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက်ကြီးသင့်သည် (သို့မဟုá€á€º) ဤá€á€”်ဖိုးသည် {{ compared_value }} ညီသင့်သည်ዠ- - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value_type }} {{ compared_value }} နှင့်ထပ်á€á€°á€Šá€®á€™á€»á€¾á€žá€„့်သည်ዠ- - - This value should be less than {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက်မနဲသောá€á€²á€· á€á€”်ဖိုးဖြစ်သင့်သည်ዠ- - - This value should be less than or equal to {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value }} ထက် မနည်းသောá€á€”်ဖိုး (သို့မဟုá€á€º) ညီမျှသောá€á€”်ဖိုးဖြစ်သင့်သည်ዠ- - - This value should not be equal to {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value }} နှင့်မညီသင့်ပါዠ- - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{ compared_value_type }} {{ compared_value }} နှင့်ထပ်á€á€°á€™á€Šá€®á€™á€»á€¾á€žá€„့်သည်ዠ- - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - ဤဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€…ားသည်အလွန်ကြီးလွန်းသည်ዠ({{ ratio }})á‹ á€á€½á€„့်ပြုထားသောဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€žá€¬á€¸á€žá€Šá€º {{ max_ratio }} ဖြစ်သည်ዠ- - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - ဤဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€…ားသည်အလွန်သေးလွန်းသည်ዠ({{ ratio }})á‹ á€á€½á€„့်ပြုထားသောဓာá€á€ºá€•á€¯á€¶á€¡á€á€»á€­á€¯á€¸á€¡á€žá€¬á€¸á€žá€Šá€º {{ min_ratio }} ဖြစ်သည်ዠ- - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - ဤဓာá€á€ºá€•á€¯á€¶á€žá€Šá€º စá€á€¯á€›á€”်းဖြစ်နေသည် ({{ width }}x{{ height }}px)ዠစá€á€¯á€›á€”်းဓာá€á€ºá€•á€¯á€¶á€™á€»á€¬á€¸á€€á€­á€¯ á€á€½á€„့်မပြုပါዠ- - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - ဤဓာá€á€ºá€•á€¯á€¶á€žá€Šá€º အလျှားလိုက်ဖြစ်နေသည် ({{ width }}x{{ height }}px). အလျှားလိုက်ဓာá€á€ºá€•á€¯á€¶á€™á€»á€¬á€¸á€á€½á€„့်မပြုပါዠ- - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - ဤဓာá€á€ºá€•á€¯á€¶á€žá€Šá€º ဒေါင်လိုက်ဖြစ်နေသည် ({{ width }}x{{ height }}px). ဒေါင်လိုက်ဓာá€á€ºá€•á€¯á€¶á€™á€»á€¬á€¸á€á€½á€„့်မပြုပါዠ- - - An empty file is not allowed. - ဖိုင်အလွá€á€ºá€€á€­á€¯á€á€„်á€á€½á€„့်မပြုပါዠ- - - The host could not be resolved. - host ဖြေရှင်းáမနိုင်ပါዠ- - - This value does not match the expected {{ charset }} charset. - ဤá€á€”်ဖိုးသည် မျှော်မှန်းထားသော {{ charset }} စားလုံးနှင့် ကိုက်ညီမှုမရှိပါዠ- - - This is not a valid Business Identifier Code (BIC). - áŽá€„်းသည်မှန်ကန်သော Business Identifier Code (BIC) မဟုá€á€ºá€•á€«á‹ - - - Error - အမှား - - - This is not a valid UUID. - ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် UUID မဟုá€á€ºá€•á€«á‹ - - - This value should be a multiple of {{ compared_value }}. - ဤá€á€”်ဖိုးသည် {{compared_value}} á စá€á€°á€á€”်ဖိုးဖြစ်သင့်သည်ዠ- - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - ဤ Business Identifier Code (BIC) သည် IBAN {{ iban }} နှင့်ဆက်စပ်မှုမရှိပါዠ- - - This value should be valid JSON. - ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် JSON á€á€”်ဖိုးဖြစ်သင့်သည်ዠ- - - This collection should contain only unique elements. - ဤ collection ကိုယ်ပိုင် elements များ ပါသင့်သည်ዠ- - - This value should be positive. - ဤá€á€”်ဖိုးသည် အပေါင်းဖြစ်သင့်သည်ዠ- - - This value should be either positive or zero. - ဤá€á€”်ဖိုးသည် အပေါင်း (သို့မဟုá€á€º) သုည ဖြစ်သင့်သည်ዠ- - - This value should be negative. - ဤá€á€”်ဖိုးသည် အနုá€á€º ဖြစ်သင့်သည်ዠ- - - This value should be either negative or zero. - ဤá€á€”်ဖိုးသည် အနုá€á€º (သို့မဟုá€á€º) သုည ဖြစ်သင့်သည်ዠ- - - This value is not a valid timezone. - ဤá€á€”်ဖိုးသည် မှန်ကန်သော အá€á€»á€­á€”်ဇုန်မဟုá€á€ºá€•á€«á‹ - - - This password has been leaked in a data breach, it must not be used. Please use another password. - ဤစကားá€á€¾á€€á€º သည် ဒေá€á€¬á€•á€±á€«á€€á€ºá€€á€¼á€¬á€¸á€™á€¾á€¯á€á€…်á€á€¯á€–ြစ်á€á€²á€·á€žá€Šá€ºá‹ ဤစကားá€á€¾á€€á€ºá€€á€­á€¯á€¡á€žá€¯á€¶á€¸á€™á€•á€¼á€¯á€›á€•á€«á‹ ကျေးဇူးပြုá အá€á€¼á€¬á€¸á€…ကားá€á€¾á€€á€ºá€€á€­á€¯á€žá€¯á€¶á€¸á€•á€«á‹ - - - This value should be between {{ min }} and {{ max }}. - ဤá€á€”်ဖိုးသည် {{ min }} နှင့် {{ max }} ကြားရှိသင့်သည်ዠ- - - This value is not a valid hostname. - ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် hostname မဟုá€á€ºá€•á€«á‹ - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - ဤ collection á€á€½á€„်ပါပါá€á€„်သော elements အရေအá€á€½á€€á€ºá€žá€Šá€º {{ compared_value }} á စá€á€°á€–ြစ်သင့်သည်ዠ- - - This value should satisfy at least one of the following constraints: - ဤá€á€”်ဖိုးသည် အောက်ပါကန့်သá€á€ºá€á€»á€€á€ºá€™á€»á€¬á€¸á€¡á€”က်မှအနည်းဆုံးá€á€…်á€á€¯ ဖြည့်ဆည်းပေးသင့်သည်ዠ- - - Each element of this collection should satisfy its own set of constraints. - ဤ collection á element á€á€…်á€á€¯á€…ီသည်áŽá€„်းáကိုယ်ပိုင်ကန့်သá€á€ºá€á€»á€€á€ºá€™á€»á€¬á€¸á€€á€­á€¯á€–ြည့်ဆည်းသင့်သည်ዠ- - - This value is not a valid International Securities Identification Number (ISIN). - ဤá€á€”်ဖိုးသည် သင့်လျှော်သော် အပြည်ပြည်ဆိုင်ရာငွေá€á€»á€±á€¸á€žá€€á€ºá€žá€±á€á€¶á€”ံပါá€á€º ,International Securities Identification Number (ISIN) မဟုá€á€ºá€•á€«á‹ - - - This value should be a valid expression. - ဤá€á€”်ဖိုးသည်မှန်ကန်သောစကားရပ်ဖြစ်သင့်သည်ዠ- - - - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf index 93132ec57cd..250576531cf 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nb.xlf @@ -314,78 +314,6 @@ This is not a valid Business Identifier Code (BIC). Dette er ikke en gyldig BIC. - - Error - Feil - - - This is not a valid UUID. - Dette er ikke en gyldig UUID. - - - This value should be a multiple of {{ compared_value }}. - Verdien skal være flertall av {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Business Identifier Code (BIC) er ikke tilknyttet en IBAN {{ iban }}. - - - This value should be valid JSON. - Verdien er ikke gyldig JSON. - - - This collection should contain only unique elements. - Samlingen kan kun inneholde unike elementer. - - - This value should be positive. - Denne verdien mÃ¥ være positiv. - - - This value should be either positive or zero. - Denne verdien mÃ¥ være positiv eller null. - - - This value should be negative. - Denne verdien mÃ¥ være negativ. - - - This value should be either negative or zero. - Denne verdien mÃ¥ være negativ eller null. - - - This value is not a valid timezone. - Verdien er ikke en gyldig tidssone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Dette passordet er lekket i et datainnbrudd, det mÃ¥ ikke tas i bruk. Vennligst bruk et annet passord. - - - This value should be between {{ min }} and {{ max }}. - Verdien mÃ¥ være mellom {{ min }} og {{ max }}. - - - This value is not a valid hostname. - Denne verdien er ikke et gyldig vertsnavn. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Antall elementer i denne samlingen bør være et multiplum av {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Denne verdien skal tilfredsstille minst en av følgende begrensninger: - - - Each element of this collection should satisfy its own set of constraints. - Hvert element i denne samlingen skal tilfredsstille sitt eget sett med begrensninger. - - - This value is not a valid International Securities Identification Number (ISIN). - Denne verdien er ikke et gyldig International Securities Identification Number (ISIN). - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf index 97d1da00e9a..bee0ab3b55a 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf @@ -302,10 +302,6 @@ An empty file is not allowed. Lege bestanden zijn niet toegestaan. - - The host could not be resolved. - De hostnaam kon niet worden bepaald. - This value does not match the expected {{ charset }} charset. Deze waarde is niet in de verwachte tekencodering {{ charset }}. @@ -322,86 +318,6 @@ This is not a valid UUID. Dit is geen geldige UUID. - - This value should be a multiple of {{ compared_value }}. - Deze waarde zou een meervoud van {{ compared_value }} moeten zijn. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Deze bedrijfsidentificatiecode (BIC) is niet gekoppeld aan IBAN {{ iban }}. - - - This value should be valid JSON. - Deze waarde moet geldige JSON zijn. - - - This collection should contain only unique elements. - Deze collectie moet alleen unieke elementen bevatten. - - - This value should be positive. - Deze waarde moet positief zijn. - - - This value should be either positive or zero. - Deze waarde moet positief of gelijk aan nul zijn. - - - This value should be negative. - Deze waarde moet negatief zijn. - - - This value should be either negative or zero. - Deze waarde moet negatief of gelijk aan nul zijn. - - - This value is not a valid timezone. - Deze waarde is geen geldige tijdzone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Dit wachtwoord is gelekt vanwege een data-inbreuk, het moet niet worden gebruikt. Kies een ander wachtwoord. - - - This value should be between {{ min }} and {{ max }}. - Deze waarde moet zich tussen {{ min }} en {{ max }} bevinden. - - - This value is not a valid hostname. - Deze waarde is geen geldige hostnaam. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Het aantal elementen van deze collectie moet een veelvoud zijn van {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Deze waarde moet voldoen aan tenminste een van de volgende voorwaarden: - - - Each element of this collection should satisfy its own set of constraints. - Elk element van deze collectie moet voldoen aan zijn eigen set voorwaarden. - - - This value is not a valid International Securities Identification Number (ISIN). - Deze waarde is geen geldig International Securities Identification Number (ISIN). - - - This value should be a valid expression. - Deze waarde moet een geldige expressie zijn. - - - This value is not a valid CSS color. - Deze waarde is geen geldige CSS kleur. - - - This value is not a valid CIDR notation. - Deze waarde is geen geldige CIDR notatie. - - - The value of the netmask should be between {{ min }} and {{ max }}. - De waarde van de netmask moet zich tussen {{ min }} en {{ max }} bevinden. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf index 8963ba2d8c2..e5881330e8e 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nn.xlf @@ -36,7 +36,7 @@ This field was not expected. - Dette feltet var ikkje forventa. + Dette feltet var ikke forventa. This field is missing. @@ -222,170 +222,6 @@ Unsupported card type or invalid card number. Korttypen er ikkje støtta, eller kortnummeret er ugyldig. - - This is not a valid International Bank Account Number (IBAN). - Dette er ikkje eit gyldig internasjonalt bankkontonummer (IBAN). - - - This value is not a valid ISBN-10. - Verdien er ikkje eit gyldig ISBN-10. - - - This value is not a valid ISBN-13. - Verdien er ikkje eit gyldig ISBN-13. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Verdien er verken eit gyldig ISBN-10 eller eit gyldig ISBN-13. - - - This value is not a valid ISSN. - Verdien er ikkje eit gyldig ISSN. - - - This value is not a valid currency. - Verdien er ikkje ein gyldig valuta. - - - This value should be equal to {{ compared_value }}. - Verdien bør vera eins med {{ compared_value }}. - - - This value should be greater than {{ compared_value }}. - Verdien bør vera større enn {{ compared_value }}. - - - This value should be greater than or equal to {{ compared_value }}. - Verdien bør vera større enn eller eins med {{ compared_value }}. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Verdien bør vera eins med {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - Verdien bør vera mindre enn {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - Verdi bør vera mindre enn eller eins med {{ compared_value }}. - - - This value should not be equal to {{ compared_value }}. - Verdi bør ikkje vera eins med {{ compared_value }}. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Denne verdien bør ikkje vera eins med {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Sideforholdet til biletet er for stort ({{ ratio }}). Sideforholdet kan ikkje vere større enn {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Sideforholdet til biletet er for lite ({{ ratio }}). Sideforholdet kan ikkje vere mindre enn {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Biletet er kvadratisk ({{ width }}x{{ height }}px). Kvadratiske bilete er ikkje tillatne. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Biletet er landskapsorientert ({{ width }}x{{ height }}px). Landskapsorienterte bilete er ikkje tillatne. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Biletet er portrettorientert ({{ width }}x{{ height }}px). Portrettorienterte bilete er ikkje tillatne. - - - An empty file is not allowed. - Ei tom fil er ikkje tillate. - - - The host could not be resolved. - Verten kunne ikkje finnast. - - - This value does not match the expected {{ charset }} charset. - Verdien stemmer ikkje med forventa {{ charset }} charset. - - - This is not a valid Business Identifier Code (BIC). - Dette er ikkje ein gyldig Business Identifier Code (BIC). - - - Error - Feil - - - This is not a valid UUID. - Dette er ikkje ein gyldig UUID. - - - This value should be a multiple of {{ compared_value }}. - Verdien bør vera eit multipel av {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Denne Business Identifier Code (BIC) er ikkje kopla til IBAN {{ iban }}. - - - This value should be valid JSON. - Verdien bør vera gyldig JSON. - - - This collection should contain only unique elements. - Denne samlinga bør berre innehalda unike element. - - - This value should be positive. - Verdien bør vera positiv. - - - This value should be either positive or zero. - Verdien bør vera anten positiv eller null. - - - This value should be negative. - Verdien bør vera negativ. - - - This value should be either negative or zero. - Verdien bør vera negativ eller null. - - - This value is not a valid timezone. - Verdien er ikkje ei gyldig tidssone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Dette passordet har lekt ut ved eit datainnbrot, det fÃ¥r ikkje nyttast. Gje opp eit anna passord. - - - This value should be between {{ min }} and {{ max }}. - Denne verdien bør liggje mellom {{ min }} og {{ max }}. - - - This value is not a valid hostname. - Verdien er ikkje eit gyldig vertsnamn. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Talet pÃ¥ element i denne samlinga bør vera eit multippel av {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Verdien burde oppfylla minst ein av følgjande avgrensingar: - - - Each element of this collection should satisfy its own set of constraints. - Kvart element i denne samlinga bør oppfylla sine eigne avgrensingar. - - - This value is not a valid International Securities Identification Number (ISIN). - Verdien er ikkje eit gyldig International Securities Identification Number (ISIN). - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf index 93132ec57cd..250576531cf 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.no.xlf @@ -314,78 +314,6 @@ This is not a valid Business Identifier Code (BIC). Dette er ikke en gyldig BIC. - - Error - Feil - - - This is not a valid UUID. - Dette er ikke en gyldig UUID. - - - This value should be a multiple of {{ compared_value }}. - Verdien skal være flertall av {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Business Identifier Code (BIC) er ikke tilknyttet en IBAN {{ iban }}. - - - This value should be valid JSON. - Verdien er ikke gyldig JSON. - - - This collection should contain only unique elements. - Samlingen kan kun inneholde unike elementer. - - - This value should be positive. - Denne verdien mÃ¥ være positiv. - - - This value should be either positive or zero. - Denne verdien mÃ¥ være positiv eller null. - - - This value should be negative. - Denne verdien mÃ¥ være negativ. - - - This value should be either negative or zero. - Denne verdien mÃ¥ være negativ eller null. - - - This value is not a valid timezone. - Verdien er ikke en gyldig tidssone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Dette passordet er lekket i et datainnbrudd, det mÃ¥ ikke tas i bruk. Vennligst bruk et annet passord. - - - This value should be between {{ min }} and {{ max }}. - Verdien mÃ¥ være mellom {{ min }} og {{ max }}. - - - This value is not a valid hostname. - Denne verdien er ikke et gyldig vertsnavn. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Antall elementer i denne samlingen bør være et multiplum av {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Denne verdien skal tilfredsstille minst en av følgende begrensninger: - - - Each element of this collection should satisfy its own set of constraints. - Hvert element i denne samlingen skal tilfredsstille sitt eget sett med begrensninger. - - - This value is not a valid International Securities Identification Number (ISIN). - Denne verdien er ikke et gyldig International Securities Identification Number (ISIN). - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf index b983b2d6c87..e7ad1eca8de 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pl.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - Nie skonfigurowano folderu tymczasowego w php.ini lub skonfigurowany folder nie istnieje. + Nie skonfigurowano folderu tymczasowego w php.ini, lub skonfigurowany folder nie istnieje. Cannot write temporary file to disk. @@ -326,82 +326,6 @@ This value should be a multiple of {{ compared_value }}. Ta wartość powinna być wielokrotnoÅ›ciÄ… {{ compared_value }}. - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ten kod BIC (Business Identifier Code) nie jest powiÄ…zany z miÄ™dzynarodowym numerem rachunku bankowego (IBAN) {{ iban }}. - - - This value should be valid JSON. - Ta wartość powinna być prawidÅ‚owym formatem JSON. - - - This collection should contain only unique elements. - Ten zbiór powinien zawierać tylko unikalne elementy. - - - This value should be positive. - Ta wartość powinna być dodatnia. - - - This value should be either positive or zero. - Ta wartość powinna być dodatnia lub równa zero. - - - This value should be negative. - Ta wartość powinna być ujemna. - - - This value should be either negative or zero. - Ta wartość powinna być ujemna lub równa zero. - - - This value is not a valid timezone. - Ta wartość nie jest prawidÅ‚owÄ… strefÄ… czasowÄ…. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - To hasÅ‚o wyciekÅ‚o w wyniku naruszenia danych i nie może być użyte. ProszÄ™ użyć innego hasÅ‚a. - - - This value should be between {{ min }} and {{ max }}. - Ta wartość powinna być pomiÄ™dzy {{ min }} a {{ max }}. - - - This value is not a valid hostname. - Ta wartość nie jest prawidÅ‚owÄ… nazwÄ… hosta. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Liczba elementów w tym zbiorze powinna być wielokrotnoÅ›ciÄ… {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ta wartość powinna speÅ‚niać co najmniej jednÄ… z nastÄ™pujÄ…cych reguÅ‚: - - - Each element of this collection should satisfy its own set of constraints. - Każdy element w tym zbiorze powinien speÅ‚niać wÅ‚asny zestaw reguÅ‚. - - - This value is not a valid International Securities Identification Number (ISIN). - Ta wartość nie jest prawidÅ‚owym MiÄ™dzynarodowym Numerem Identyfikacyjnym Papierów WartoÅ›ciowych (ISIN). - - - This value should be a valid expression. - Ta wartość powinna być prawidÅ‚owym wyrażeniem. - - - This value is not a valid CSS color. - Ta wartość nie jest prawidÅ‚owym kolorem CSS. - - - This value is not a valid CIDR notation. - Ta wartość nie jest prawidÅ‚owÄ… notacjÄ… CIDR. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Wartość maski podsieci powinna być pomiÄ™dzy {{ min }} i {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf index 090add6bd34..0561c048f51 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt.xlf @@ -128,7 +128,7 @@ This value should be a valid number. - Este valor deveria ser um número válido. + Este valor deveria de ser um número válido. This file is not a valid image. @@ -176,27 +176,27 @@ This value should be the user's current password. - Este valor deveria ser a senha atual do usuário. + Este valor deveria de ser a password atual do utilizador. This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Este valor deve possuir exatamente {{ limit }} caracteres. + Este valor tem de ter exatamente {{ limit }} carateres. The file was only partially uploaded. - Só foi enviada uma parte do arquivo. + Só foi enviado parte do ficheiro. No file was uploaded. - Nenhum arquivo foi enviado. + Nenhum ficheiro foi enviado. No temporary folder was configured in php.ini. - Não existe uma pasta temporária configurada no arquivo php.ini. + Não existe nenhum directório temporária configurado no ficheiro php.ini. Cannot write temporary file to disk. - Não foi possível escrever os arquivos temporários no disco. + Não foi possível escrever ficheiros temporários no disco. A PHP extension caused the upload to fail. @@ -292,116 +292,20 @@ The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - A imagem está em orientação de paisagem ({{ width }}x{{ height }}px). Imagens orientadas em paisagem não são permitidas. + A imagem está orientada à paisagem ({{ width }}x{{ height }}px). Imagens orientadas à paisagem não são permitidas. The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - A imagem está em orientação de retrato ({{ width }}x{{ height }}px). Imagens orientadas em retrato não são permitidas. + A imagem está orientada ao retrato ({{ width }}x{{ height }}px). Imagens orientadas ao retrato não são permitidas. An empty file is not allowed. - Um arquivo vazio não é permitido. - - - The host could not be resolved. - O host não pode ser resolvido. - - - This value does not match the expected {{ charset }} charset. - O valor não corresponde ao conjunto de caracteres {{ charset }} esperado. - - - This is not a valid Business Identifier Code (BIC). - O Código de Identificação de Empresa (BIC) não é válido. + Ficheiro vazio não é permitido. Error Erro - - This is not a valid UUID. - Este valor não é um UUID válido. - - - This value should be a multiple of {{ compared_value }}. - Este valor deve ser um múltiplo de {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - O Código de Identificação de Empresa (BIC) não está associado ao IBAN {{ iban }}. - - - This value should be valid JSON. - Este valor deve ser um JSON válido. - - - This collection should contain only unique elements. - Esta coleção deve conter só elementos únicos. - - - This value should be positive. - Este valor deve ser estritamente positivo. - - - This value should be either positive or zero. - Este valor deve ser superior ou igual a zero. - - - This value should be negative. - Este valor deve ser estritamente negativo. - - - This value should be either negative or zero. - Este valor deve ser inferior ou igual a zero. - - - This value is not a valid timezone. - Este valor não é um fuso horário válido. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Esta senha foi divulgada durante uma fuga de dados, não deve ser usada de novamente. Por favor usar uma senha outra. - - - This value should be between {{ min }} and {{ max }}. - Este valor deve situar-se entre {{ min }} e {{ max }}. - - - This value is not a valid hostname. - Este valor não é um nome de host válido. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - O número de elementos desta coleção deve ser um múltiplo de {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Este valor deve satisfazer pelo menos uma das seguintes restrições : - - - Each element of this collection should satisfy its own set of constraints. - Cada elemento desta coleção deve satisfazer o seu próprio conjunto de restrições. - - - This value is not a valid International Securities Identification Number (ISIN). - Este valor não é um Número Internacional de Identificação de Segurança (ISIN) válido. - - - This value should be a valid expression. - Este valor deve ser uma expressão válida. - - - This value is not a valid CSS color. - Este valor não é uma cor de CSS válida. - - - This value is not a valid CIDR notation. - Este valor não é uma notação CIDR válida. - - - The value of the netmask should be between {{ min }} and {{ max }}. - O valor da máscara de rede deve estar entre {{ min }} e {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf index e88b81f9eaf..b6170623188 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf @@ -314,94 +314,6 @@ This is not a valid Business Identifier Code (BIC). Este não é um Código Identificador Bancário (BIC) válido. - - Error - Erro - - - This is not a valid UUID. - Este não é um UUID válido. - - - This value should be a multiple of {{ compared_value }}. - Este valor deve ser múltiplo de {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Este Código Identificador Bancário (BIC) não está associado ao IBAN {{ iban }}. - - - This value should be valid JSON. - Este valor deve ser um JSON válido. - - - This collection should contain only unique elements. - Esta coleção deve conter somente elementos únicos. - - - This value should be positive. - Este valor deve ser positivo. - - - This value should be either positive or zero. - Este valor deve ser positivo ou zero. - - - This value should be negative. - Este valor deve ser negativo. - - - This value should be either negative or zero. - Este valor deve ser negativo ou zero. - - - This value is not a valid timezone. - Este valor não representa um fuso horário válido. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Esta senha foi divulgada num vazamento de dados e não deve ser utilizada. Por favor, utilize outra senha. - - - This value should be between {{ min }} and {{ max }}. - Este valor deve estar entre {{ min }} e {{ max }}. - - - This value is not a valid hostname. - Este valor não é um nome de host válido. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - O número de elementos desta coleção deve ser um múltiplo de {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Este valor deve satisfazer pelo menos uma das seguintes restrições: - - - Each element of this collection should satisfy its own set of constraints. - Cada elemento desta coleção deve satisfazer seu próprio grupo de restrições. - - - This value is not a valid International Securities Identification Number (ISIN). - Este valor não é um Número de Identificação de Títulos Internacionais (ISIN) válido. - - - This value should be a valid expression. - Este valor deve ser uma expressão válida. - - - This value is not a valid CSS color. - Este valor não é uma cor CSS válida. - - - This value is not a valid CIDR notation. - Este valor não é uma notação CIDR válida. - - - The value of the netmask should be between {{ min }} and {{ max }}. - O valor da máscara de rede deve estar entre {{ min }} e {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf index 7fba2cd1e0e..63af47042b1 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ro.xlf @@ -278,126 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Această valoare nu trebuie să fie identică cu {{ compared_value_type }} {{ compared_value }}. - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Raportul imaginii este prea mare ({{ ratio }}). Raportul maxim permis este {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Raportul imaginii este prea mic ({{ ratio }}). Raportul minim permis este {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Imaginea este un pătrat ({{ width }}x{{ height }}px). Imaginile pătrat nu sunt permise. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Imaginea are orientarea peisaj ({{ width }}x{{ height }}px). Imaginile cu orientare peisaj nu sunt permise. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Imaginea are orientarea portret ({{ width }}x{{ height }}px). Imaginile cu orientare portret nu sunt permise. - - - An empty file is not allowed. - Nu se permite un fiÈ™ier gol. - - - The host could not be resolved. - Numele host nu a putut fi rezolvat către o adresă IP. - - - This value does not match the expected {{ charset }} charset. - Această valoare nu corespunde setului de caractere {{ charset }} aÈ™teptat. - - - This is not a valid Business Identifier Code (BIC). - Codul BIC (Business Identifier Code) nu este valid. - Error Eroare - - This is not a valid UUID. - Identificatorul universal unic (UUID) nu este valid. - - - This value should be a multiple of {{ compared_value }}. - Această valoare trebuie să fie un multiplu de {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Codul BIC (Business Identifier Code) nu este asociat cu codul IBAN {{ iban }}. - - - This value should be valid JSON. - Această valoare trebuie să fie un JSON valid. - - - This collection should contain only unique elements. - Acest set ar trebui să conÈ›ină numai elemente unice. - - - This value should be positive. - Această valoare ar trebui să fie pozitivă. - - - This value should be either positive or zero. - Această valoare trebuie să fie pozitivă sau zero. - - - This value should be negative. - Această valoare ar trebui să fie negativă. - - - This value should be either negative or zero. - Această valoare trebuie să fie negativă sau zero. - - - This value is not a valid timezone. - Această valoare nu este un fus orar valid. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Această parolă a fost compromisă È™i nu poate fi utilizată. Vă rugăm să utilizaÈ›i o altă parolă. - - - This value should be between {{ min }} and {{ max }}. - Această valoare trebuie să fie între {{ min }} È™i {{ max }}. - - - This value is not a valid hostname. - Această valoare nu este un numele gazdei valid. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Numărul de elemente din această colecÈ›ie ar trebui să fie un multiplu al {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Această valoare trebuie să îndeplinească cel puÈ›in una dintre următoarele reguli: - - - Each element of this collection should satisfy its own set of constraints. - Fiecare element din acest set ar trebui să îndeplinească propriul set de reguli. - - - This value is not a valid International Securities Identification Number (ISIN). - Această valoare nu este un număr internaÈ›ional de identificare (ISIN) valabil. - - - This value should be a valid expression. - Această valoare ar trebui să fie o expresie validă. - - - This value is not a valid CIDR notation. - Această valoare nu este o notaÈ›ie CIDR validă. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Valoarea netmask-ului trebuie sa fie intre {{ min }} si {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf index 8705cbb55d0..11bfead5e50 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ru.xlf @@ -131,25 +131,25 @@ Значение должно быть чиÑлом. + This value is not a valid country. + Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимой Ñтраной. + + This file is not a valid image. Файл не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым форматом изображениÑ. - + This is not a valid IP address. Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым IP адреÑом. - + This value is not a valid language. Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимым Ñзыком. - + This value is not a valid locale. Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимой локалью. - - This value is not a valid country. - Значение не ÑвлÑетÑÑ Ð´Ð¾Ð¿ÑƒÑтимой Ñтраной. - This value is already used. Это значение уже иÑпользуетÑÑ. @@ -310,98 +310,10 @@ This value does not match the expected {{ charset }} charset. Значение не Ñовпадает Ñ Ð¾Ð¶Ð¸Ð´Ð°ÐµÐ¼Ð¾Ð¹ {{ charset }} кодировкой. - - This is not a valid Business Identifier Code (BIC). - Значение не ÑоответÑтвует формату BIC. - Error Ошибка - - This is not a valid UUID. - Значение не ÑоответÑтвует формату UUID. - - - This value should be a multiple of {{ compared_value }}. - Значение должно быть кратно {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Данный BIC не ÑвÑзан Ñ IBAN {{ iban }}. - - - This value should be valid JSON. - Значение должно быть корректным JSON. - - - This collection should contain only unique elements. - Эта ÐºÐ¾Ð»Ð»ÐµÐºÑ†Ð¸Ñ Ð´Ð¾Ð»Ð¶Ð½Ð° Ñодержать только уникальные Ñлементы. - - - This value should be positive. - Значение должно быть положительным. - - - This value should be either positive or zero. - Значение должно быть положительным или равным нулю. - - - This value should be negative. - Значение должно быть отрицательным. - - - This value should be either negative or zero. - Значение должно быть отрицательным или равным нулю. - - - This value is not a valid timezone. - Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ чаÑовым поÑÑом. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Данный пароль был Ñкомпрометирован в результате утечки данных и не должен быть иÑпользован. ПожалуйÑта, иÑпользуйте другой пароль. - - - This value should be between {{ min }} and {{ max }}. - Значение должно быть между {{ min }} и {{ max }}. - - - This value is not a valid hostname. - Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ именем хоÑта. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - КоличеÑтво Ñлементов в Ñтой коллекции должно быть кратным {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Значение должно удовлетворÑÑ‚ÑŒ как минимум одному из Ñледующих ограничений: - - - Each element of this collection should satisfy its own set of constraints. - Каждый Ñлемент Ñтой коллекции должен удовлетворÑÑ‚ÑŒ Ñвоему ÑобÑтвенному набору ограничений. - - - This value is not a valid International Securities Identification Number (ISIN). - Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ международным идентификационным номером ценных бумаг (ISIN). - - - This value should be a valid expression. - Это значение должно быть корректным выражением. - - - This value is not a valid CSS color. - Значение не ÑвлÑетÑÑ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ñ‹Ð¼ CSS цветом. - - - This value is not a valid CIDR notation. - Значение не ÑоответÑтвует нотации CIDR. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Значение маÑки подÑети должно быть от {{ min }} до {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf index 55a811134da..8ddb66d9c0b 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sk.xlf @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini. - V php.ini nie je nastavená cesta k addressáru pre doÄasné súbory. + V php.ini nie je nastavená cesta k adresáru pre doÄasné súbory. Cannot write temporary file to disk. @@ -314,94 +314,6 @@ This is not a valid Business Identifier Code (BIC). Táto hodnota nie je platný identifikaÄný kód podniku (BIC). - - Error - Chyba - - - This is not a valid UUID. - Táto hodnota nie je platný UUID. - - - This value should be a multiple of {{ compared_value }}. - Táto hodnota by mala byÅ¥ násobkom {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Tento identifikaÄný kód podniku (BIC) nie je spojený s IBAN {{ iban }}. - - - This value should be valid JSON. - Táto hodnota by mala byÅ¥ platný JSON. - - - This collection should contain only unique elements. - Táto kolekcia by mala obsahovaÅ¥ len unikátne prkvy. - - - This value should be positive. - Táto hodnota by mala byÅ¥ kladná. - - - This value should be either positive or zero. - Táto hodnota by mala byÅ¥ kladná alebo nulová. - - - This value should be negative. - Táto hodnota by mala byÅ¥ záporná. - - - This value should be either negative or zero. - Táto hodnota by mala byÅ¥ záporná alebo nulová. - - - This value is not a valid timezone. - Táto hodnota nie je platné Äasové pásmo. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Toto heslo uniklo pri naruÅ¡ení ochrany dát, nie je možné ho použiÅ¥. Prosím, použite iné heslo. - - - This value should be between {{ min }} and {{ max }}. - Táto hodnota by mala byÅ¥ medzi {{ min }} a {{ max }}. - - - This value is not a valid hostname. - Táto hodnota nie je platný hostname. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - PoÄet prvkov v tejto kolekcii musí byÅ¥ násobok {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Táto hodnota musí spĺňaÅ¥ aspoň jedno z nasledujúcich obmedzení: - - - Each element of this collection should satisfy its own set of constraints. - Každý prvok v tejto kolekcii musí spĺňaÅ¥ svoje vlastné obmedzenia. - - - This value is not a valid International Securities Identification Number (ISIN). - Táto hodnota nie je platné medzinárodné oznaÄenie cenného papiera (ISIN). - - - This value should be a valid expression. - Táto hodnota by mala byÅ¥ platným výrazom. - - - This value is not a valid CSS color. - Táto hodnota nie je platná CSS farba. - - - This value is not a valid CIDR notation. - Táto hodnota nie je platnou notáciou CIDR. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Hodnota masky siete by mala byÅ¥ medzi {{ min }} a {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf index b956911e5a0..6f5fd98ca19 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sl.xlf @@ -318,90 +318,6 @@ Error Napaka - - This is not a valid UUID. - To ni veljaven UUID. - - - This value should be a multiple of {{ compared_value }}. - Ta vrednost bi morala biti veÄkratnik od {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ta poslovna identifikacijska koda (BIC) ni povezana z IBAN {{ iban }}. - - - This value should be valid JSON. - Ta vrednost bi morala biti veljaven JSON. - - - This collection should contain only unique elements. - Ta zbirka bi morala vsebovati samo edinstvene elemente. - - - This value should be positive. - Ta vrednost bi morala biti pozitivna. - - - This value should be either positive or zero. - Ta vrednost bi morala biti pozitivna ali enaka niÄ. - - - This value should be negative. - Ta vrednost bi morala biti negativna. - - - This value should be either negative or zero. - Ta vrednost bi morala biti negativna ali enaka niÄ. - - - This value is not a valid timezone. - Ta vrednost ni veljaven Äasovni pas. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - To geslo je uÅ¡lo pri krÅ¡itvi varnosti podatkov in ga ne smete uporabljati. Prosimo, uporabite drugo geslo. - - - This value should be between {{ min }} and {{ max }}. - Ta vrednost bi morala biti med {{ min }} in {{ max }}. - - - This value is not a valid hostname. - Ta vrednost ni veljavno ime gostitelja. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Å tevilo elementov v tej zbirki bi moralo biti mnogokratnik {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ta vrednost bi morala zadostiti vsaj eni izmed sledeÄih omejitev: - - - Each element of this collection should satisfy its own set of constraints. - Vsak element te zbirke bi moral zadostiti svojemu lastnemu naboru omejitev. - - - This value is not a valid International Securities Identification Number (ISIN). - Ta vrednost ni veljavna mednarodna identifikacijska koda vrednostnih papirjev (ISIN). - - - This value should be a valid expression. - Ta vrednost bi morala biti veljaven izraz. - - - This value is not a valid CSS color. - Ta vrednost ni veljavna barva CSS. - - - This value is not a valid CIDR notation. - Ta vrednost ni veljaven zapis CIDR. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Vrednost omrežne maske mora biti med {{ min }} in {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf index 6c0acb9fdf4..ffc8ccf2f98 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sq.xlf @@ -24,15 +24,15 @@ You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - Duhet të zgjedhni së paku {{ limit }} alternativë.|Duhet të zgjedhni së paku {{ limit }} alternativa. + Duhet të zgjedhni së paku {{ limit }} alternativa.|Duhet të zgjedhni së paku {{ limit }} alternativa. You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - Duhet të zgjedhni më së shumti {{ limit }} alternativë.|Duhet të zgjedhni më së shumti {{ limit }} alternativa. + Duhet të zgjedhni më së shumti {{ limit }} alternativa.|Duhet të zgjedhni më së shumti {{ limit }} alternativa. One or more of the given values is invalid. - Një apo më shumë nga vlerat e dhëna janë të pavlefshme. + Një apo më shumë nga vlerat e dhëna nuk janë të sakta. This field was not expected. @@ -40,7 +40,7 @@ This field is missing. - Kjo fushë mungon. + Kjo fushë është zhdukur. This value is not a valid date. @@ -52,7 +52,7 @@ This value is not a valid email address. - Kjo vlerë nuk është adresë email-i e vlefshme. + Kjo vlerë nuk është e-mail adresë e vlefshme. The file could not be found. @@ -64,11 +64,11 @@ The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - File është shumë i madh ({{ size }} {{ suffix }}). Madhësia maksimale e lejuar është {{ limit }} {{ suffix }}. + File është shumë i madh ({{ size }} {{ suffix }}). Madhësia më e madhe e lejuar është {{ limit }} {{ suffix }}. The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Lloji mime i file-it është i pavlefshëm ({{ type }}). Llojet mime të lejuara janë {{ types }}. + Lloji mime i files nuk është i vlefshëm ({{ type }}). Llojet mime të lejuara janë {{ types }}. This value should be {{ limit }} or less. @@ -76,7 +76,7 @@ This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Kjo vlerë është shumë e gjatë. Duhet të përmbaj {{ limit }} karakter ose më pak.|Kjo vlerë është shumë e gjatë. Duhet të përmbaj {{ limit }} karaktere ose më pak. + Kjo vlerë është shumë e gjatë. Duhet t'i ketë {{ limit }} ose më pak karaktere.|Kjo vlerë është shumë e gjatë. Duhet t'i ketë {{ limit }} ose më pak karaktere. This value should be {{ limit }} or more. @@ -84,7 +84,7 @@ This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Kjo vlerë është shumë e shkurtër. Duhet të përmbaj {{ limit }} karakter ose më shumë.|Kjo vlerë është shumë e shkurtër. Duhet të përmbaj {{ limit }} karaktere ose më shumë. + Kjo vlerë është shumë e shkurtër. Duhet t'i ketë {{ limit }} ose më shumë karaktere.|Kjo vlerë është shumë e shkurtër. Duhet t'i ketë {{ limit }} ose më shumë karaktere. This value should not be blank. @@ -136,7 +136,7 @@ This is not a valid IP address. - Kjo adresë IP nuk është e vlefshme. + Kjo vlerë nuk është IP adresë e vlefshme. This value is not a valid language. @@ -144,7 +144,7 @@ This value is not a valid locale. - Kjo vlerë nuk është nje locale i vlefshëm. + Kjo vlerë nuk është përcaktim rajonal i vlefshëm. This value is not a valid country. @@ -156,7 +156,7 @@ The size of the image could not be detected. - Madhësia e imazhit nuk mund të zbulohet. + Madhësia e këtij imazhi nuk mund të zbulohet. The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. @@ -180,7 +180,7 @@ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Kjo vlerë duhet të ketë saktësisht {{ limit }} karakter.|Kjo vlerë duhet të ketë saktësisht {{ limit }} karaktere. + Kjo vlerë duhet të ketë saktësisht {{ limit }} karaktere.|Kjo vlerë duhet të ketë saktësisht {{ limit }} karaktere. The file was only partially uploaded. @@ -200,191 +200,27 @@ A PHP extension caused the upload to fail. - Një ekstension i PHP-së shkaktoi dështimin e ngarkimit. + Një ekstenzion i PHP-së bëri të dështojë ngarkimi i files. This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Ky koleksion duhet të përmbajë {{ limit }} element ose më shumë.|Ky koleksion duhet të përmbajë {{ limit }} elemente ose më shumë. + Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente.|Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Ky koleksion duhet të përmbajë {{ limit }} element ose më pak.|Ky koleksion duhet të përmbajë {{ limit }} elemente ose më pak. + Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente.|Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Ky koleksion duhet të përmbajë saktësisht {{ limit }} element.|Ky koleksion duhet të përmbajë saktësisht {{ limit }} elemente. + Ky kolekcion duhet të përmbajë saktësisht {{ limit }} elemente.|Ky kolekcion duhet të përmbajë saktësisht {{ limit }} elemente. Invalid card number. - Numër karte i pavlefshëm. + Numër kartele i pavlefshëm. Unsupported card type or invalid card number. - Lloj karte i papranuar ose numër karte i pavlefshëm. - - - This is not a valid International Bank Account Number (IBAN). - Ky nuk është një numër i vlefshëm ndërkombëtar i llogarisë bankare (IBAN). - - - This value is not a valid ISBN-10. - Kjo vlerë nuk është një ISBN-10 e vlefshme. - - - This value is not a valid ISBN-13. - Kjo vlerë nuk është një ISBN-13 e vlefshme. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Kjo vlerë nuk është as ISBN-10 e vlefshme as ISBN-13 e vlefshme. - - - This value is not a valid ISSN. - Kjo vlerë nuk është një ISSN e vlefshme. - - - This value is not a valid currency. - Kjo vlerë nuk është një monedhë e vlefshme. - - - This value should be equal to {{ compared_value }}. - Kjo vlerë duhet të jetë e barabartë me {{ compared_value }}. - - - This value should be greater than {{ compared_value }}. - Kjo vlerë duhet të jetë më e madhe se {{ compared_value }}. - - - This value should be greater than or equal to {{ compared_value }}. - Kjo vlerë duhet të jetë më e madhe ose e barabartë me {{ compared_value }}. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Kjo vlerë duhet të jetë identike me {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - Kjo vlerë duhet të jetë më vogël se {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - Kjo vlerë duhet të jetë më e vogël ose e barabartë me {{ compared_value }}. - - - This value should not be equal to {{ compared_value }}. - Kjo vlerë nuk duhet të jetë e barabartë me {{ compared_value }}. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Kjo vlerë nuk duhet të jetë identike me {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Raporti i imazhit është shumë i madh ({{ ratio }}). Raporti maksimal i lejuar është {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Raporti i imazhit është shumë i vogël ({{ ratio }}). Raporti minimal pritet të jetë {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Imazhi është katror ({{ width }}x{{ height }}px). Imazhet katrore nuk janë të lejuara. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Imazhi është i orientuar horizontalisht ({{ width }}x{{ height }}px). Imazhet e orientuara horizontalisht nuk lejohen. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Imazhi është i orientuar vertikalisht ({{ width }}x{{ height }}px). Imazhet orientuara vertikalisht nuk lejohen. - - - An empty file is not allowed. - Një file i zbrazët nuk lejohet. - - - The host could not be resolved. - Host-i nuk mund te zbulohej. - - - This value does not match the expected {{ charset }} charset. - Kjo vlerë nuk përputhet me kodifikimin e karaktereve {{ charset }} që pritej. - - - This is not a valid Business Identifier Code (BIC). - Ky nuk është një Kod Identifikues i Biznesit (BIC) i vleflshem. - - - Error - Gabim - - - This is not a valid UUID. - Ky nuk është një UUID i vlefshëm. - - - This value should be a multiple of {{ compared_value }}. - Kjo vlerë duhet të jetë një shumëfish i {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ky Kod Identifikues i Biznesit (BIC) nuk është i lidhur me IBAN {{ iban }}. - - - This value should be valid JSON. - Kjo vlerë duhet të jetë JSON i vlefshëm. - - - This collection should contain only unique elements. - Ky koleksion duhet të përmbajë vetëm elementë unikë. - - - This value should be positive. - Kjo vlerë duhet të jetë pozitive. - - - This value should be either positive or zero. - Kjo vlerë duhet të jetë pozitive ose zero. - - - This value should be negative. - Kjo vlerë duhet të jetë negative. - - - This value should be either negative or zero. - Kjo vlerë duhet të jetë negative ose zero. - - - This value is not a valid timezone. - Kjo vlerë nuk është një zonë e vlefshme kohore. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ky fjalëkalim është zbuluar në një shkelje të të dhënave, nuk duhet të përdoret. Ju lutemi përdorni një fjalëkalim tjetër. - - - This value should be between {{ min }} and {{ max }}. - Kjo vlerë duhet të jetë ndërmjet {{ min }} dhe {{ max }}. - - - This value is not a valid hostname. - Kjo vlerë nuk është një emër i vlefshëm hosti. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Numri i elementeve në këtë koleksion duhet të jetë një shumëfish i {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Kjo vlerë duhet të plotësojë të paktën njërën nga kufizimet e mëposhtme: - - - Each element of this collection should satisfy its own set of constraints. - Secili element i këtij koleksioni duhet të përmbushë kufizimet e veta. - - - This value is not a valid International Securities Identification Number (ISIN). - Kjo vlerë nuk është një numër i vlefshëm identifikues ndërkombëtar i sigurisë (ISIN). + Lloj kartele i pambështetur ose numër kartele i pavlefshëm. diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf index 03ef7130303..81f5210f6fb 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf @@ -36,7 +36,7 @@ This field was not expected. - Ово поље није било очекивано. + Ово поље не очекује. This field is missing. @@ -100,7 +100,7 @@ This value is not valid. - ВредноÑÑ‚ није валидна. + ВредноÑÑ‚ је невалидна. This value is not a valid time. @@ -298,110 +298,6 @@ The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. Слика је оријантације портрета ({{ width }}x{{ height }}px). Портретна оријентација Ñлика није дозвољена. - - An empty file is not allowed. - Празна датотека није дозвољена. - - - The host could not be resolved. - Име хоÑта не може бити разрешено. - - - This value does not match the expected {{ charset }} charset. - ВредноÑÑ‚ Ñе не поклапа Ñа очекиваним {{ charset }} Ñетом карактера. - - - This is not a valid Business Identifier Code (BIC). - Ово није валидан међународни идентификацијÑки код банке (BIC). - - - Error - Грешка - - - This is not a valid UUID. - Ово није валидан универзални уникатни идентификатор (UUID). - - - This value should be a multiple of {{ compared_value }}. - Ова вредноÑÑ‚ би требало да буде дељива Ñа {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - BIC код није повезан Ñа IBAN {{ iban }}. - - - This value should be valid JSON. - Ова вредноÑÑ‚ би требало да буде валидан JSON. - - - This collection should contain only unique elements. - Ова колекција би требала да Ñадржи Ñамо јединÑтвене елементе. - - - This value should be positive. - Ова вредноÑÑ‚ би требала бити позитивна. - - - This value should be either positive or zero. - Ова вредноÑÑ‚ би требала бити позитивна или нула. - - - This value should be negative. - Ова вредноÑÑ‚ би требала бити негативна. - - - This value should be either negative or zero. - Ова вредноÑÑ‚ би требала бити позитивна или нула. - - - This value is not a valid timezone. - Ова вредноÑÑ‚ није валидна временÑка зона. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ова лозинка је компромитована приликом претходних напада, немојте је кориÑтити. КориÑтите другу лозинку. - - - This value should be between {{ min }} and {{ max }}. - Ова вредноÑÑ‚ треба да буде између {{ min }} и {{ max }}. - - - This value is not a valid hostname. - Ова вредноÑÑ‚ није иÑправно име хоÑта. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Број елемената у овој колекцији би требало да буде дељив Ñа {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ова вредноÑÑ‚ би требало да задовољава најмање једно од наредних ограничења: - - - Each element of this collection should satisfy its own set of constraints. - Сваки елемент ове колекције би требало да задовољи ÑопÑтвени Ñкуп ограничења. - - - This value is not a valid International Securities Identification Number (ISIN). - Ова вредноÑÑ‚ није иÑправна међународна идентификациона ознака хартија од вредноÑти (ISIN). - - - This value should be a valid expression. - Ова вредноÑÑ‚ треба да буде валидан израз. - - - This value is not a valid CSS color. - Ова вредноÑÑ‚ није иÑправна CSS боја. - - - This value is not a valid CIDR notation. - Ова вредноÑÑ‚ није иÑправна CIDR нотација. - - - The value of the netmask should be between {{ min }} and {{ max }}. - ВредноÑÑ‚ мрежне маÑке треба бити између {{ min }} и {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf index 86453ada231..60c093aebf7 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf @@ -4,39 +4,39 @@ This value should be false. - Vrednost bi trebalo da bude netaÄna. + Vrednost treba da bude netaÄna. This value should be true. - Vrednost bi trebalo da bude taÄna. + Vrednost treba da bude taÄna. This value should be of type {{ type }}. - Vrednost bi trebalo da bude tipa {{ type }}. + Vrednost treba da bude tipa {{ type }}. This value should be blank. - Vrednost bi trebalo da bude prazna. + Vrednost treba da bude prazna. The value you selected is not a valid choice. - Odabrana vrednost nije validan izbor. + Vrednost treba da bude jedna od ponuÄ‘enih. You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - Morate odabrati bar {{ limit }} mogućnost.|Morate odabrati bar {{ limit }} mogućnosti.|Morate odabrati bar {{ limit }} mogućnosti. + Izaberite bar {{ limit }} mogućnost.|Izaberite bar {{ limit }} mogućnosti.|Izaberite bar {{ limit }} mogućnosti. You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - Morate odabrati najviÅ¡e {{ limit }} mogućnost.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti.|Morate odabrati najviÅ¡e {{ limit }} mogućnosti. + Izaberite najviÅ¡e {{ limit }} mogućnost.|Izaberite najviÅ¡e {{ limit }} mogućnosti.|Izaberite najviÅ¡e {{ limit }} mogućnosti. One or more of the given values is invalid. - Jedna ili viÅ¡e vrednosti nisu validne. + Jedna ili viÅ¡e vrednosti je nevalidna. This field was not expected. - Ovo polje nije bilo oÄekivano. + Ovo polje ne oÄekuje. This field is missing. @@ -48,7 +48,7 @@ This value is not a valid datetime. - Vrednost nije validno vreme. + Vrednost nije validan datum-vreme. This value is not a valid email address. @@ -68,39 +68,39 @@ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - MIME tip datoteke nije validan ({{ type }}). Dozvoljeni MIME tipovi su {{ types }}. + Mime tip datoteke nije validan ({{ type }}). Dozvoljeni mime tipovi su {{ types }}. This value should be {{ limit }} or less. - Vrednost bi trebalo da bude {{ limit }} ili manje. + Vrednost treba da bude {{ limit }} ili manje. This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Vrednost je predugaÄka. Trebalo bi da ima {{ limit }} karakter ili manje.|Vrednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje.|Vrednost je predugaÄka. Trebalo bi da ima {{ limit }} karaktera ili manje. + Vrednost je predugaÄka. Treba da ima {{ limit }} karakter ili manje.|Vrednost je predugaÄka. Treba da ima {{ limit }} karaktera ili manje.|Vrednost je predugaÄka. Treba da ima {{ limit }} karaktera ili manje. This value should be {{ limit }} or more. - Vrednost bi trebalo da bude {{ limit }} ili viÅ¡e. + Vrednost treba da bude {{ limit }} ili viÅ¡e. This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Vrednost je prekratka. Trebalo bi da ima {{ limit }} karakter ili viÅ¡e.|Vrednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e.|Vrednost je prekratka. Trebalo bi da ima {{ limit }} karaktera ili viÅ¡e. + Vrednost je prekratka. Treba da ima {{ limit }} karakter ili viÅ¡e.|Vrednost je prekratka. Treba da ima {{ limit }} karaktera ili viÅ¡e.|Vrednost je prekratka. Treba da ima {{ limit }} karaktera ili viÅ¡e. This value should not be blank. - Vrednost ne bi trebalo da bude prazna. + Vrednost ne treba da bude prazna. This value should not be null. - Vrednost ne bi trebalo da bude prazna. + Vrednost ne treba da bude null. This value should be null. - Vrednost bi trebalo da bude prazna. + Vrednost treba da bude null. This value is not valid. - Vrednost nije validna. + Vrednost je nevalidna. This value is not a valid time. @@ -112,7 +112,7 @@ The two values should be equal. - Obe vrednosti bi trebalo da budu jednake. + Obe vrednosti treba da budu jednake. The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. @@ -128,7 +128,7 @@ This value should be a valid number. - Vrednost bi trebalo da bude validan broj. + Vrednost treba da bude validan broj. This file is not a valid image. @@ -144,11 +144,11 @@ This value is not a valid locale. - Vrednost nije validna meÄ‘unarodna oznaka jezika. + Vrednost nije validan lokal. This value is not a valid country. - Vrednost nije validna država. + Vrednost nije validna zemlja. This value is already used. @@ -160,27 +160,27 @@ The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Å irina slike je prevelika ({{ width }} piksela). Najveća dozvoljena Å¡irina je {{ max_width }} piksela. + Å irina slike je prevelika ({{ width }}px). Najeća dozvoljena Å¡irina je {{ max_width }}px. The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Å irina slike je premala ({{ width }} piksela). Najmanja dozvoljena Å¡irina je {{ min_width }} piksela. + Å irina slike je premala ({{ width }}px). Najmanja dozvoljena Å¡irina je {{ min_width }}px. The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Visina slike je prevelika ({{ height }} piksela). Najveća dozvoljena visina je {{ max_height }} piksela. + Visina slike je prevelika ({{ height }}px). Najeća dozvoljena visina je {{ max_height }}px. The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Visina slike je premala ({{ height }} piksela). Najmanja dozvoljena visina je {{ min_height }} piksela. + Visina slike je premala ({{ height }}px). Najmanja dozvoljena visina je {{ min_height }}px. This value should be the user's current password. - Vrednost bi trebalo da bude trenutna korisniÄka lozinka. + Vrednost treba da bude trenutna korisniÄka lozinka. This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Vrednost bi trebalo da ima taÄno {{ limit }} karakter.|Vrednost bi trebalo da ima taÄno {{ limit }} karaktera.|Vrednost bi trebalo da ima taÄno {{ limit }} karaktera. + Vrednost treba da ima taÄno {{ limit }} karakter.|Vrednost treba da ima taÄno {{ limit }} karaktera.|Vrednost treba da ima taÄno {{ limit }} karaktera. The file was only partially uploaded. @@ -204,23 +204,23 @@ This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili viÅ¡e elemenata. + Ova kolekcija treba da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili viÅ¡e elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili viÅ¡e elemenata. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija bi trebalo da sadrži {{ limit }} ili manje elemenata. + Ova kolekcija treba da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili manje elemenata.|Ova kolekcija treba da sadrži {{ limit }} ili manje elemenata. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} element.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elementa.|Ova kolekcija bi trebalo da sadrži taÄno {{ limit }} elemenata. + Ova kolekcija treba da sadrži taÄno {{ limit }} element.|Ova kolekcija treba da sadrži taÄno {{ limit }} elementa.|Ova kolekcija treba da sadrži taÄno {{ limit }} elemenata. Invalid card number. - Broj kartice nije validan. + Nevalidan broj kartice. Unsupported card type or invalid card number. - Tip kartice nije podržan ili broj kartice nije validan. + Nevalidan broj kartice ili tip kartice nije podržan. This is not a valid International Bank Account Number (IBAN). @@ -248,35 +248,35 @@ This value should be equal to {{ compared_value }}. - Ova vrednost bi trebalo da bude jednaka {{ compared_value }}. + Ova vrednost treba da bude {{ compared_value }}. This value should be greater than {{ compared_value }}. - Ova vrednost bi trebalo da bude veća od {{ compared_value }}. + Ova vrednost treba da bude veća od {{ compared_value }}. This value should be greater than or equal to {{ compared_value }}. - Ova vrednost bi trebalo da bude veća ili jednaka {{ compared_value }}. + Ova vrednost treba da bude veća ili jednaka {{ compared_value }}. This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Ova vrednost bi trebalo da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. + Ova vrednost treba da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. This value should be less than {{ compared_value }}. - Ova vrednost bi trebalo da bude manja od {{ compared_value }}. + Ova vrednost treba da bude manja od {{ compared_value }}. This value should be less than or equal to {{ compared_value }}. - Ova vrednost bi trebalo da bude manja ili jednaka {{ compared_value }}. + Ova vrednost treba da bude manja ili jednaka {{ compared_value }}. This value should not be equal to {{ compared_value }}. - Ova vrednost ne bi trebalo da bude jednaka {{ compared_value }}. + Ova vrednost ne treba da bude jednaka {{ compared_value }}. This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Ova vrednost ne bi trebalo da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. + Ova vrednost ne treba da bude identiÄna sa {{ compared_value_type }} {{ compared_value }}. The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. @@ -288,119 +288,15 @@ The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Slika je kvadratna ({{ width }}x{{ height }} piksela). Kvadratne slike nisu dozvoljene. + Slika je kvadratna ({{ width }}x{{ height }}px). Kvadratne slike nisu dozvoljene. The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Slika je pejzažno orijentisana ({{ width }}x{{ height }} piksela). Pejzažna orijentisane slike nisu dozvoljene. + Slika je orijentacije pejzaža ({{ width }}x{{ height }}px). Pejzažna orijentacija slika nije dozvoljena. The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Slika je portretno orijentisana ({{ width }}x{{ height }} piksela). Portretno orijentisane slike nisu dozvoljene. - - - An empty file is not allowed. - Prazna datoteka nije dozvoljena. - - - The host could not be resolved. - Ime hosta ne može biti razreÅ¡eno. - - - This value does not match the expected {{ charset }} charset. - Vrednost se ne poklapa sa oÄekivanim {{ charset }} setom karaktera. - - - This is not a valid Business Identifier Code (BIC). - Ovo nije validan BIC. - - - Error - GreÅ¡ka - - - This is not a valid UUID. - Ovo nije validan univerzalni unikatni identifikator (UUID). - - - This value should be a multiple of {{ compared_value }}. - Ova vrednost bi trebalo da bude deljiva sa {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - BIC kod nije povezan sa IBAN {{ iban }}. - - - This value should be valid JSON. - Ova vrednost bi trebalo da bude validan JSON. - - - This collection should contain only unique elements. - Ova kolekcija bi trebala da sadrži samo jedinstvene elemente. - - - This value should be positive. - Ova vrednost bi trebala biti pozitivna. - - - This value should be either positive or zero. - Ova vrednost bi trebala biti pozitivna ili nula. - - - This value should be negative. - Ova vrednost bi trebala biti negativna. - - - This value should be either negative or zero. - Ova vrednost bi trebala biti negativna ili nula. - - - This value is not a valid timezone. - Ova vrednost nije validna vremenska zona. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ova lozinka je kompromitovana prilikom prethodnih napada, nemojte je koristiti. Koristite drugu lozinku. - - - This value should be between {{ min }} and {{ max }}. - Ova vrednost treba da bude izmeÄ‘u {{ min }} i {{ max }}. - - - This value is not a valid hostname. - Ova vrednost nije ispravno ime poslužitelja (hostname). - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Broj elemenata u ovoj kolekciji bi trebalo da bude deljiv sa {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ova vrednost bi trebalo da zadovoljava namjanje jedno od narednih ograniÄenja: - - - Each element of this collection should satisfy its own set of constraints. - Svaki element ove kolekcije bi trebalo da zadovolji sopstveni skup ograniÄenja. - - - This value is not a valid International Securities Identification Number (ISIN). - Ova vrednost nije ispravna meÄ‘unarodna identifikaciona oznaka hartija od vrednosti (ISIN). - - - This value should be a valid expression. - Ova vrednost treba da bude validan izraz. - - - This value is not a valid CSS color. - Ova vrednost nije ispravna CSS boja. - - - This value is not a valid CIDR notation. - Ova vrednost nije ispravna CIDR notacija. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Vrednost mrežne maske treba biti izmeÄ‘u {{ min }} i {{ max }}. + Slika je orijantacije portreta ({{ width }}x{{ height }}px). Portretna orijentacija slika nije dozvoljena. diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf index fca7bdc0764..40dd63e293c 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.sv.xlf @@ -318,90 +318,6 @@ Error Fel - - This is not a valid UUID. - Detta är inte ett giltigt UUID. - - - This value should be a multiple of {{ compared_value }}. - Detta värde ska vara en multipel av {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Denna BIC-koden är inte associerad med IBAN {{ iban }}. - - - This value should be valid JSON. - Detta värde ska vara giltig JSON. - - - This collection should contain only unique elements. - Denna samling bör endast innehÃ¥lla unika element. - - - This value should be positive. - Detta värde bör vara positivt. - - - This value should be either positive or zero. - Detta värde bör vara antingen positivt eller noll. - - - This value should be negative. - Detta värde bör vara negativt. - - - This value should be either negative or zero. - Detta värde bör vara antingen negativt eller noll. - - - This value is not a valid timezone. - Detta värde är inte en giltig tidszon. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Det här lösenordet har läckt ut vid ett dataintrÃ¥ng, det fÃ¥r inte användas. Använd ett annat lösenord. - - - This value should be between {{ min }} and {{ max }}. - Detta värde bör ligga mellan {{ min }} och {{ max }}. - - - This value is not a valid hostname. - Värdet är inte ett giltigt servernamn. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Antalet element i samlingen ska vara en multipel av {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Det här värdet skall uppfylla minst ett av följande krav: - - - Each element of this collection should satisfy its own set of constraints. - Varje element i samlingen skall uppfylla sin egen uppsättning av krav. - - - This value is not a valid International Securities Identification Number (ISIN). - Det här värdet är inte ett giltigt "International Securities Identification Number" (ISIN). - - - This value should be a valid expression. - Det här värdet bör vara ett giltigt uttryck. - - - This value is not a valid CSS color. - Det här värdet är inte en giltig CSS-färg. - - - This value is not a valid CIDR notation. - Det här värdet är inte en giltig CIDR-notation. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Värdet pÃ¥ nätmasken bör vara mellan {{ min }} och {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf index 26affc5a6f3..d5b57031b9f 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.th.xlf @@ -4,19 +4,19 @@ This value should be false. - ค่านี้ควรเป็น false + ค่านี้ควรจะเป็น false This value should be true. - ค่านี้ควรเป็น true + ค่านี้ควรจะเป็น true This value should be of type {{ type }}. - ค่านี้ควรเป็น {{ type }} + ค่านี้ควรจะเป็นชนิด {{ type }} This value should be blank. - ควรเป็นค่าว่าง + ควรจะเป็นค่าว่าง The value you selected is not a valid choice. @@ -36,11 +36,11 @@ This field was not expected. - ไม่ควรมีฟิลด์นี้ + ฟิลด์นี้ที่ไม่ได้คาดหวัง This field is missing. - ฟิลด์นี้หายไป + ฟิลด์นี้จะหายไป This value is not a valid date. @@ -152,7 +152,7 @@ This value is already used. - ค่านี้ถูà¸à¹ƒà¸Šà¹‰à¸‡à¸²à¸™à¹„ปà¹à¸¥à¹‰à¸§ + Tค่านี้ถูà¸à¹ƒà¸Šà¹‰à¸‡à¸²à¸™à¹„ปà¹à¸¥à¹‰à¸§ The size of the image could not be detected. @@ -164,7 +164,7 @@ The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - ความà¸à¸§à¹‰à¸²à¸‡à¸‚องภาพต่ำเà¸à¸´à¸™à¹„ป ({{ width }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸„วามà¸à¸§à¹‰à¸²à¸‡à¹„ม่ต่ำà¸à¸§à¹ˆà¸² {{ min_width }}px + ความà¸à¸§à¹‰à¸²à¸‡à¸‚องภาพไม่ได้ขนาด ({{ width }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸ªà¸±à¹‰à¸™à¸—ี่สุด {{ min_width }}px The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. @@ -172,7 +172,7 @@ The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - ความสูงของภาพเล็à¸à¹€à¸à¸´à¸™à¹„ป ({{ height }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸„วามสูงไม่ควรต่ำà¸à¸§à¹ˆà¸² {{ min_height }}px + ความสูงของภาพไม่ได้ขนาด ({{ height }}px) อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¸ªà¸¹à¸‡à¸­à¸¢à¹ˆà¸²à¸‡à¸™à¹‰à¸­à¸¢à¸—ี่สุด {{ min_height }}px This value should be the user's current password. @@ -192,19 +192,19 @@ No temporary folder was configured in php.ini. - ไม่พบà¸à¸²à¸£à¸•à¸±à¹‰à¸‡à¸„่าโฟลเดอร์ชั่วคราว (temporary folder) ใน php.ini + ไม่พบไฟล์ temp ควรจะà¸à¸³à¸«à¸™à¸”ใน php.ini Cannot write temporary file to disk. - ไม่สามารถเขียนไฟล์ชั่วคราว (temporary file) ลงดิสà¸à¹Œà¹„ด้ + ไม่สามารถเขียน temp ไฟล์ลงดิสà¸à¹Œà¹„ด้ A PHP extension caused the upload to fail. - PHP extension ทำให้à¸à¸²à¸£à¸­à¸±à¸›à¹‚หลดมีปัà¸à¸«à¸² + PHP extension เà¸à¸µà¹ˆà¸¢à¸§à¸à¸±à¸šà¸à¸²à¸£à¸­à¸±à¸›à¹‚หลดมีปัà¸à¸«à¸² This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรจะประà¸à¸­à¸šà¹„ปด้วยอย่างน้อย {{ limit }} สมาชิภ+ คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรจะประà¸à¸­à¸šà¹„ปด้วยอ่างน้อย {{ limit }} สมาชิภThis collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. @@ -212,7 +212,7 @@ This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรจะมี {{ limit }} สมาชิà¸à¹€à¸—่านั้น + คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรจะมีสมาชิภ{{ limit }} เท่านั้น Invalid card number. @@ -224,31 +224,31 @@ This is not a valid International Bank Account Number (IBAN). - ค่านี้ไม่ใช่ International Bank Account Number (IBAN) ที่ถูà¸à¸•à¹‰à¸­à¸‡ + นี่ไม่ถูà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡ International Bank Account Number (IBAN) This value is not a valid ISBN-10. - ค่านี้ไม่ใช่ ISBN-10 ที่ถูà¸à¸•à¹‰à¸­à¸‡ + ค่านี้ไม่ถูà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡ ISBN-10 This value is not a valid ISBN-13. - ค่านี้ไม่ใช่ ISBN-13 ที่ถูà¸à¸•à¹‰à¸­à¸‡ + ค่านี้ไม่ถูà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡ ISBN-13 This value is neither a valid ISBN-10 nor a valid ISBN-13. - ค่านี้ไม่ใช่ ISBN-10 หรือ ISBN-13 ที่ถูà¸à¸•à¹‰à¸­à¸‡ + ค่านี้ไม่ถูà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡à¸—ั้ง ISBN-10 à¹à¸¥à¸° ISBN-13 This value is not a valid ISSN. - ค่านี้ไม่ใช่ ISSN ที่ถูà¸à¸•à¹‰à¸­à¸‡ + ค่านี้ไม่ถุà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡ ISSN This value is not a valid currency. - ค่านี้ไม่ใช่สà¸à¸¸à¸¥à¹€à¸‡à¸´à¸™à¸—ี่ถูà¸à¸•à¹‰à¸­à¸‡ + ค่านี้ไม่ถูà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡à¸ªà¸à¸¸à¸¥à¹€à¸‡à¸´à¸™ This value should be equal to {{ compared_value }}. - ค่านี้ควรตรงà¸à¸±à¸š {{ compared_value }} + ค่านี้ไม่ตรงà¸à¸±à¸š {{ compared_value }} This value should be greater than {{ compared_value }}. @@ -280,11 +280,11 @@ The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - สัดส่วนของภาพใหà¸à¹ˆà¹€à¸à¸´à¸™ ({{ ratio }}) สัดส่วนใหà¸à¹ˆà¸—ี่สุดที่ใช้ได้คือ {{ max_ratio }} + สัดส่วนของภาพใหà¸à¹ˆà¹€à¸à¸´à¸™ ({{ ratio }}) สามารถมีขนาดใหà¸à¹ˆà¸—ี่สุดได้ {{ max_ratio }} The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - สัดส่วนของภาพเล็à¸à¹€à¸à¸´à¸™ ({{ ratio }}) สัดส่วนเล็à¸à¸—ี่สุดที่ใช้ได้คือ {{ min_ratio }} + สัดส่วนของภาพเล็à¸à¹€à¸à¸´à¸™ ({{ ratio }}) สามารถมีขนาดเล็à¸à¸—ี่สุดได้ {{ min_ratio }} The image is square ({{ width }}x{{ height }}px). Square images are not allowed. @@ -298,110 +298,6 @@ The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. ภาพนี้เป็นà¹à¸™à¸§à¸•à¸±à¹‰à¸‡ ({{ width }}x{{ height }}px) ไม่อนุà¸à¸²à¸•à¸ à¸²à¸žà¸—ี่เป็นà¹à¸™à¸§à¸•à¸±à¹‰à¸‡ - - An empty file is not allowed. - ไม่อนุà¸à¸²à¸•à¹ƒà¸«à¹‰à¹ƒà¸Šà¹‰à¹„ฟล์ว่าง - - - The host could not be resolved. - ไม่สามารถà¹à¸à¹‰à¹„ขชื่อโฮสต์ - - - This value does not match the expected {{ charset }} charset. - ค่านี้ไม่ตรงà¸à¸±à¸šà¸à¸²à¸£à¹€à¸‚้ารหัส {{ charset }} - - - This is not a valid Business Identifier Code (BIC). - นี่ไม่ถูà¸à¸•à¹‰à¸­à¸‡à¸•à¸²à¸¡à¸£à¸«à¸±à¸ªà¸ªà¸³à¸«à¸£à¸±à¸šà¸£à¸°à¸šà¸¸à¸˜à¸¸à¸£à¸à¸´à¸ˆà¸™à¸µà¹‰ (BIC) - - - Error - เà¸à¸´à¸”ข้อผิดพลาด - - - This is not a valid UUID. - นี่ไม่ใช่ UUID ที่ถูà¸à¸•à¹‰à¸­à¸‡ - - - This value should be a multiple of {{ compared_value }}. - ค่านี้ควรเป็น {{ compared_value }} หลายตัว - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - รหัสสำหรับระบุธุรà¸à¸´à¸ˆà¸™à¸µà¹‰ (BIC) ไม่เà¸à¸µà¹ˆà¸¢à¸§à¸‚้องà¸à¸±à¸š IBAN {{ iban }} - - - This value should be valid JSON. - ค่านี้ควรอยู่ในรูปà¹à¸šà¸š JSON ที่ถูà¸à¸•à¹‰à¸­à¸‡ - - - This collection should contain only unique elements. - คอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸µà¹‰à¸„วรมีเฉพาะสมาชิà¸à¸—ี่ไม่ซ้ำà¸à¸±à¸™à¹€à¸—่านั้น - - - This value should be positive. - ค่านี้ควรเป็นค่าบวภ- - - This value should be either positive or zero. - ค่านี้ควรเป็นค่าบวà¸à¸«à¸£à¸·à¸­à¸„่าศูนย์ - - - This value should be negative. - ค่านี้ควรเป็นค่าลบ - - - This value should be either negative or zero. - ค่านี้ควรเป็นค่าลบหรือค่าศูนย์ - - - This value is not a valid timezone. - ค่าเขตเวลาไม่ถูà¸à¸•à¹‰à¸­à¸‡ - - - This password has been leaked in a data breach, it must not be used. Please use another password. - รหัสผ่านนี้ได้เคยรั่วไหลออà¸à¹„ปโดยถูà¸à¸à¸²à¸£à¸¥à¸°à¹€à¸¡à¸´à¸”ข้อมูล ซึ่งไม่ควรนำà¸à¸¥à¸±à¸šà¸¡à¸²à¹ƒà¸Šà¹‰ à¸à¸£à¸¸à¸“าใช้รหัสผ่านอื่น - - - This value should be between {{ min }} and {{ max }}. - ค่านี้ควรอยู่ระหว่าง {{ min }} ถึง {{ max }} - - - This value is not a valid hostname. - ค่าโฮสต์เนมไม่ถูà¸à¸•à¹‰à¸­à¸‡ - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - จำนวนของสมาชิà¸à¹ƒà¸™à¸„อเล็à¸à¸Šà¸±à¹ˆà¸™à¸„วรเป็นพหุคูณของ {{ compared_value }} - - - This value should satisfy at least one of the following constraints: - ค่านี้ควรเป็นไปตามข้อจำà¸à¸±à¸”อย่างน้อยหนึ่งข้อจาà¸à¸‚้อจำà¸à¸±à¸”เหล่านี้: - - - Each element of this collection should satisfy its own set of constraints. - สมาชิà¸à¹à¸•à¹ˆà¸¥à¸°à¸•à¸±à¸§à¹ƒà¸™à¸„อเล็à¸à¸Šà¸±à¹ˆà¸™à¸„วรเป็นไปตามข้อจำà¸à¸±à¸”ของคอเล็à¸à¸Šà¸±à¹ˆà¸™à¸™à¸±à¹‰à¸™à¹† - - - This value is not a valid International Securities Identification Number (ISIN). - ค่ารหัสหลัà¸à¸—รัพย์สาà¸à¸¥ (ISIN) ไม่ถูà¸à¸•à¹‰à¸­à¸‡ - - - This value should be a valid expression. - ค่านี้ควรเป็นนิพจน์ที่ถูà¸à¸•à¹‰à¸­à¸‡ - - - This value is not a valid CSS color. - ค่านี้ไม่ใช่สี CSS ที่ถูà¸à¸•à¹‰à¸­à¸‡ - - - This value is not a valid CIDR notation. - ค่านี้ไม่ใช่รูปà¹à¸šà¸š CIDR ที่ถูà¸à¸•à¹‰à¸­à¸‡ - - - The value of the netmask should be between {{ min }} and {{ max }}. - ค่าของ netmask ควรมีค่าระหว่าง {{ min }} ถึง {{ max }} - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf index 74d5ed5cfca..75dc3295897 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tl.xlf @@ -68,7 +68,7 @@ The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Ang uri ng file ng mime ay hindi balido ({{ type }}). Ang mga pinapayagang uri ng mime ay ang {{ types }}. + Ang uri ng file ng mime ay hindi balido ({{ type }}).Ang mga pinapayagang uri ng mime ay ang {{ types }}. This value should be {{ limit }} or less. @@ -76,7 +76,7 @@ This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Ang halaga nito ay masyadong mahaba. Ito ay dapat na {{ limit }} karakter o maliit pa.|Ang halaga nito ay masyadong mahaba. Ito ay dapat na {{ limit }} mga karakter o maliit pa. + Ang halaga nito ay masyadong mahaba.Ito ay dapat na {{ limit }} karakter o maliit pa.|Ang halaga nito ay masyadong mahaba. Ito ay dapat na {{ limit }} mga karakter o maliit pa. This value should be {{ limit }} or more. @@ -268,7 +268,7 @@ This value should be less than or equal to {{ compared_value }}. - Ang halagang ito ay dapat mas maliit o magkapareha sa {{ compared_value }}. + Ang halagang ito ay dapat mas mmaliit o magkapareha sa {{ compared_value }}. This value should not be equal to {{ compared_value }}. @@ -284,7 +284,7 @@ The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Ang ratio ng imahe ay masyadong maliit ({{ ratio }}). Ang pinakamaliit na ratio ay {{ min_ratio }}. + ng ratio ng imahe ay masyadong maliit ({{ ratio }}). Ang pinamaliit na ratio ay {{ min_ratio }}. The image is square ({{ width }}x{{ height }}px). Square images are not allowed. @@ -296,7 +296,7 @@ The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Ang orientasyon ng imahe ay nakaportrait ({{ width }}x{{ height }}px). Ang mga imaheng nakaportrait ang orientasyon ay hindi pwede. + Ang orientasyon ng imahe ay nakaportrait ({{ width }}x{{ height }}px). PAng mga imaheng nakaportrait ang orientasyon ay hindi pwede. An empty file is not allowed. @@ -314,86 +314,6 @@ This is not a valid Business Identifier Code (BIC). Ito ay hindi isang balidong Business Identifier Code (BIC). - - Error - Error - - - This is not a valid UUID. - Ito ay hindi wastong UUID. - - - This value should be a multiple of {{ compared_value }}. - Ang halagang ito ay dapat multiple ng {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ang Business Identifier Code (BIC) na ito ay walang kaugnayan sa IBAN {{ iban }}. - - - This value should be valid JSON. - Ang halagang ito ay dapat naka wastong JSON. - - - This collection should contain only unique elements. - Ang mga elemento ng koleksyong ito ay dapat magkakaiba. - - - This value should be positive. - Ang halagang ito ay dapat positibo. - - - This value should be either positive or zero. - Ang halagang ito ay dapat positibo o zero. - - - This value should be negative. - Ang halagang ito ay dapat negatibo. - - - This value should be either negative or zero. - Ang halagang ito ay dapat negatibo o zero. - - - This value is not a valid timezone. - Ang halagang ito ay hindi wastong timezone. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Naikalat ang password na ito sa isang data breach at hindi na dapat gamitin. Mangyaring gumamit ng ibang pang password. - - - This value should be between {{ min }} and {{ max }}. - Ang halagang ito ay dapat nasa pagitan ng {{ min }} at {{ max }}. - - - This value is not a valid hostname. - Ang halagang ito ay hindi wastong hostname. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Ang bilang ng mga elemento sa koleksyon na ito ay dapat multiple ng {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ang halagang ito ay dapat masunod ang kahit na isang sumusunod na batayan. - - - Each element of this collection should satisfy its own set of constraints. - Ang bawat elemento sa koleksyon na ito ay dapat masunod ang nararapat na batayan. - - - This value is not a valid International Securities Identification Number (ISIN). - Ang halagang ito ay hindi wastong International Securities Identification Number (ISIN). - - - This value should be a valid expression. - Ang halagang ito ay dapat wastong ekspresyon. - - - This value is not a valid CSS color. - Ang halagang ito ay hindi wastong kulay ng CSS. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf index 715137d5890..5e19e3e5a3c 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.tr.xlf @@ -84,7 +84,7 @@ This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Bu deÄŸer çok kısa. {{ limit }} karakter veya daha fazla olmalıdır. + Bu deÄŸer çok kısa. {{ limit }} karakter veya daha fazla olmaldır. This value should not be blank. @@ -222,186 +222,10 @@ Unsupported card type or invalid card number. Desteklenmeyen kart tipi veya geçersiz kart numarası. - - This is not a valid International Bank Account Number (IBAN). - Bu geçerli bir Uluslararası Banka Hesap Numarası (IBAN) deÄŸildir. - - - This value is not a valid ISBN-10. - Bu deÄŸer geçerli bir ISBN-10 deÄŸildir. - - - This value is not a valid ISBN-13. - Bu deÄŸer geçerli bir ISBN-13 deÄŸildir. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Bu deÄŸer geçerli bir ISBN-10 veya ISBN-13 deÄŸildir. - - - This value is not a valid ISSN. - Bu deÄŸer geçerli bir ISSN deÄŸildir. - - - This value is not a valid currency. - Bu deÄŸer geçerli bir para birimi deÄŸil. - - - This value should be equal to {{ compared_value }}. - Bu deÄŸer {{ compared_value }} ile eÅŸit olmalıdır. - - - This value should be greater than {{ compared_value }}. - Bu deÄŸer {{ compared_value }} deÄŸerinden büyük olmalıdır. - - - This value should be greater than or equal to {{ compared_value }}. - Bu deÄŸer {{ compared_value }} ile eÅŸit veya büyük olmalıdır. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Bu deÄŸer {{ compared_value_type }} {{ compared_value }} ile aynı olmalıdır. - - - This value should be less than {{ compared_value }}. - Bu deÄŸer {{ compared_value }} deÄŸerinden düşük olmalıdır. - - - This value should be less than or equal to {{ compared_value }}. - .Bu deÄŸer {{ compared_value }} ile eÅŸit veya düşük olmalıdır. - - - This value should not be equal to {{ compared_value }}. - Bu deÄŸer {{ compared_value }} ile eÅŸit olmamalıdır. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Bu deÄŸer {{ compared_value_type }} {{ compared_value }} ile aynı olmamalıdır. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Resim oranı çok büyük ({{ ratio }}). Ä°zin verilen maksimum oran: {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Resim oranı çok ufak ({{ ratio }}). Beklenen minimum oran {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Resim karesi ({{ width }}x{{ height }}px). Kare resimlerine izin verilmiyor. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Resim manzara odaklı ({{ width }}x{{ height }}px). Manzara odaklı resimlere izin verilmiyor. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Resim portre odaklı ({{ width }}x{{ height }}px). Portre odaklı resimlere izin verilmiyor. - - - An empty file is not allowed. - BoÅŸ bir dosyaya izin verilmiyor. - - - The host could not be resolved. - Sunucu çözülemedi. - - - This value does not match the expected {{ charset }} charset. - Bu deÄŸer beklenen {{ charset }} karakter kümesiyle eÅŸleÅŸmiyor. - - - This is not a valid Business Identifier Code (BIC). - Bu geçerli bir Ä°ÅŸletme Tanımlayıcı Kodu (BIC) deÄŸildir. - Error Hata - - This is not a valid UUID. - Bu geçerli bir UUID deÄŸildir. - - - This value should be a multiple of {{ compared_value }}. - Bu deÄŸer {{ compare_value }} deÄŸerinin katlarından biri olmalıdır. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Bu Ä°ÅŸletme Tanımlayıcı Kodu (BIC), IBAN {{ iban }} ile iliÅŸkili deÄŸildir. - - - This value should be valid JSON. - Bu deÄŸer için geçerli olmalıdır JSON. - - - This collection should contain only unique elements. - Bu grup yalnızca benzersiz öğeler içermelidir. - - - This value should be positive. - Bu deÄŸer pozitif olmalı. - - - This value should be either positive or zero. - Bu deÄŸer pozitif veya sıfır olmalıdır. - - - This value should be negative. - Bu deÄŸer negatif olmalıdır. - - - This value should be either negative or zero. - Bu deÄŸer, negatif veya sıfır olmalıdır. - - - This value is not a valid timezone. - Bu deÄŸer, geçerli bir saat dilimi deÄŸil. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Bu parola, bir veri ihlali nedeniyle sızdırılmıştır ve kullanılmamalıdır. Lütfen baÅŸka bir ÅŸifre kullanın. - - - This value should be between {{ min }} and {{ max }}. - Bu deÄŸer arasında olmalıdır {{ min }} ve {{ max }}. - - - This value is not a valid hostname. - Bu deÄŸer, geçerli bir ana bilgisayar adı deÄŸil. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Bu gruptaki öğe sayısı birden fazla olmalıdır {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Bu deÄŸer aÅŸağıdaki kısıtlamalardan birini karşılamalıdır: - - - Each element of this collection should satisfy its own set of constraints. - Bu gruptaki her öğe kendi kısıtlamalarını karşılamalıdır. - - - This value is not a valid International Securities Identification Number (ISIN). - Bu deÄŸer geçerli bir Uluslararası Menkul Kıymetler Kimlik Numarası deÄŸil (ISIN). - - - This value should be a valid expression. - Bu deÄŸer geçerli bir ifade olmalıdır. - - - This value is not a valid CSS color. - Bu deÄŸer geçerli bir CSS rengi deÄŸil. - - - This value is not a valid CIDR notation. - Bu deÄŸer geçerli bir CIDR yazımı deÄŸil. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Netmask'in deÄŸeri {{ min }} ve {{ max }} arasında olmaldır. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf index c11f851fb02..6a92801c9b4 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uk.xlf @@ -318,90 +318,6 @@ Error Помилка - - This is not a valid UUID. - Це не валідне Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ UUID. - - - This value should be a multiple of {{ compared_value }}. - Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ðµ бути кратним {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - БанківÑький код (BIC) не пов’Ñзаний із міжнародним номером банківÑького рахунку (IBAN) {{ iban }}. - - - This value should be valid JSON. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути корректним JSON. - - - This collection should contain only unique elements. - Ð¦Ñ ÐºÐ¾Ð»ÐµÐºÑ†Ñ–Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð° мати тільки унікальни значеннÑ. - - - This value should be positive. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути позитивним. - - - This value should be either positive or zero. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути позитивним або дорівнювати нулю. - - - This value should be negative. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути негативним. - - - This value should be either negative or zero. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути негативним або дорівнювати нулю. - - - This value is not a valid timezone. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним чаÑовим поÑÑом. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Цей пароль був Ñкомпрометований в результаті витоку даних та не повинен викориÑтовуватиÑÑ. Будь лаÑка, викориÑтовуйте інший пароль. - - - This value should be between {{ min }} and {{ max }}. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути між {{ min }} та {{ max }}. - - - This value is not a valid hostname. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним іменем хоÑта. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - КількіÑÑ‚ÑŒ елементів у цій колекції повинна бути кратною {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¿Ð¾Ð²Ð¸Ð½Ð½Ð¾ задовольнÑти хоча б одному з наÑтупних обмежень: - - - Each element of this collection should satisfy its own set of constraints. - Кожен елемент цієї колекції повинен задовольнÑти влаÑному набору обмежень. - - - This value is not a valid International Securities Identification Number (ISIN). - Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним міжнародним ідентифікаційним номером цінних паперів (ISIN). - - - This value should be a valid expression. - Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð¼Ð°Ñ” бути дійÑним виразом. - - - This value is not a valid CSS color. - Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑним CSS кольором. - - - This value is not a valid CIDR notation. - Це Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð½Ðµ Ñ” дійÑною CIDR нотаціею. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð² мережевій маÑці має бути між {{ min }} та {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf deleted file mode 100644 index d1ecaf1b70a..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.uz.xlf +++ /dev/null @@ -1,407 +0,0 @@ - - - - - - This value should be false. - Qiymat noto'g'ri bo'lishi kerak. - - - This value should be true. - Qiymat to'g'ri bo'lishi kerak. - - - This value should be of type {{ type }}. - Qiymat turi {{ type }} bo'lishi kerak. - - - This value should be blank. - Qiymat bo'sh bo'lishi kerak. - - - The value you selected is not a valid choice. - Tanlangan qiymat to'g'ri emas. - - - You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. - Siz hech bo'lmaganda {{ limit }} ta qiymat tanlashingiz kerak.|Siz kamida {{ limit }} ta qiymat tanlashingiz kerak. - - - You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. - Siz {{ limit }} ta qiymatni tanlashingiz kerak.|Siz {{ limit }} dan ortiq qiymat tanlashingiz kerak. - - - One or more of the given values is invalid. - Belgilangan qiymatlarning bir yoki bir nechtasi noto'g'ri. - - - This field was not expected. - Ushbu maydon kutilmagan edi. - - - This field is missing. - Bu maydon majvud emas. - - - This value is not a valid date. - Ushbu sana noto'g'ri. - - - This value is not a valid datetime. - Sana va vaqt qiymati noto'g'ri. - - - This value is not a valid email address. - Elektron pochta manzili noto'g'ri. - - - The file could not be found. - Fayl topilmadi. - - - The file is not readable. - Faylni o'qib bo'lmadi. - - - The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. - Fayl hajmi katta ({{ size }} {{ suffix }}). Maksimal ruxsat etilgan hajim {{ limit }} {{ suffix }}. - - - The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. - Faylning MIME turi noto'g'ri ({{ type }}). Ruxsat etilgan MIME turlar {{ types }}. - - - This value should be {{ limit }} or less. - Qiymat {{ limit }} ga teng yoki kam bo'lishi kerak. - - - This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. - Qiymat juda uzun. {{ limit }} ga teng yoki kam bo'lishi kerak.|Qiymat juda uzun. {{ limit }} yoki undan kam belgidan iborat bo'lishi kerak. - - - This value should be {{ limit }} or more. - Qiymat {{ limit }} yoki undan ortiq bo'lishi kerak. - - - This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. - Qiymat juda qisqa. {{ limit }} ta yoki undan ortiq belgidan iborat bo'lishi kerak.|Qiymat juda qisqa. {{ limit }} yoki undan ko'p belgidan iborat bo'lishi kerak - - - This value should not be blank. - Qiymatni bo'sh kirtish mumkin emas. - - - This value should not be null. - Qiymat null bo'lmasligi kerak. - - - This value should be null. - Qiymat null bo'lishi kerak. - - - This value is not valid. - Qiymat noto'g'ri. - - - This value is not a valid time. - Vaqt noto'g'ri. - - - This value is not a valid URL. - URL noto'g'ri - - - The two values should be equal. - Ikkala qiymat ham bir xil bo'lishi kerak. - - - The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. - Fayl hajmi katta. Maksimal ruxsat berilgan hajim {{ limit }} {{ suffix }}. - - - The file is too large. - Fayl hajmi katta. - - - The file could not be uploaded. - Faylni yuklab bo'lmadi. - - - This value should be a valid number. - Qiymat raqam bo'lishi kerak. - - - This file is not a valid image. - Fayl yaroqli rasm formati emas. - - - This is not a valid IP address. - Ip manzil noto'g'ri. - - - This value is not a valid language. - Noto'g'ri til. - - - This value is not a valid locale. - Ushbu qiymat mahalliy qiymat emas. - - - This value is not a valid country. - Mamlakat qiymati noto'g'ri. - - - This value is already used. - Ushbu qiymat allaqachon ishlatilgan. - - - The size of the image could not be detected. - Rasm o'lchamini aniqlab bo'lmadi. - - - The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. - Rasm kengligi juda katta ({{ width }}px). Maksimal ruxsat etilgan kenglik {{ max_width }}px. - - - The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. - Rasm kengligi juda kichkina ({{ width }}px). Minimal ruxsat etilgan kenglik {{ min_width }}px. - - - The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. - Rasm bo'yi juda katta ({{ height }}px). Maksimal ruxsat etilgan balandlik {{ max_height }}px. - - - The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. - Rasm bo'yi juda kichkina ({{ height }}px). Minimal ruxsat etilgan balandlik {{ min_height }}px. - - - This value should be the user's current password. - Qiymat joriy foydalanuvchi paroli bo'lishi kerak. - - - This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Qiymat {{ limit }} ta belgidan iborat bo'lishi kerak.|Qiymat {{ limit }} belgidan iborat bo'lishi kerak. - - - The file was only partially uploaded. - Fayl faqat qisman yuklangan. - - - No file was uploaded. - Fayl yuklanmagan. - - - No temporary folder was configured in php.ini. - php.ini da vaqtinchalik katalog sozlanmagan. - - - Cannot write temporary file to disk. - Diskka vaqtinchalik faylni yozib bo'lmadi. - - - A PHP extension caused the upload to fail. - PHP kengaytmasi yuklash paytida xatolik yuz berdi. - - - This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Ushbu to'plam {{ limit }} ta yoki undan ko'p narsalarni o'z ichiga olishi kerak.|Ushbu to'plam {{ limit }} yoki undan ortiq narsalarni o'z ichiga olishi kerak. - - - This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Ushbu to'plam {{ limit }} ta yoki undan kam narsalarni o'z ichiga olishi kerak.|Ushbu to'plamda {{ limit }} yoki undan kam element bo'lishi kerak. - - - This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. - Ushbu to'plam to'liq {{ limit }} narsani o'z ichiga olishi kerak.|Ushbu to'plamda to'liq {{ limit }} ta ma'lumotlar bo'lishi kerak. - - - Invalid card number. - Kata raqami noto'g'ri. - - - Unsupported card type or invalid card number. - Qo'llab-quvvatlanmaydigan karta turi yoki yaroqsiz karta raqami. - - - This is not a valid International Bank Account Number (IBAN). - Qiymat haqiqiy xalqaro hisob raqamining raqami (IBAN) emas. - - - This value is not a valid ISBN-10. - Qiymat to'g'ri ISBN-10 formatida emas. - - - This value is not a valid ISBN-13. - Qiymat to'g'ri ISBN-13 formatida emas. - - - This value is neither a valid ISBN-10 nor a valid ISBN-13. - Qiymat ISBN-10 va ISBN-13 formatlariga mos kelmaydi. - - - This value is not a valid ISSN. - Qiymat ISSN formatiga mos kelmaydi. - - - This value is not a valid currency. - Noto'g'ri valyuta formati. - - - This value should be equal to {{ compared_value }}. - Qiymat {{ compared_value }} ga teng bo'lishi shart. - - - This value should be greater than {{ compared_value }}. - Qiymat {{ compared_value }} dan katta bo'lishi shart. - - - This value should be greater than or equal to {{ compared_value }}. - Qiymat {{ compared_value }} dan katta yoki teng bo'lishi shart. - - - This value should be identical to {{ compared_value_type }} {{ compared_value }}. - Значение должно быть идентичным {{ compared_value_type }} {{ compared_value }}. - - - This value should be less than {{ compared_value }}. - Qiymat bir xil bo'lishi kerak {{ compared_value }}. - - - This value should be less than or equal to {{ compared_value }}. - Qiymat {{ compared_value }} dan kichik yoki teng bo'lishi shart. - - - This value should not be equal to {{ compared_value }}. - Qiymat {{ compared_value }} ga teng bo'lmasligi kerak. - - - This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - Qiymat bir xil bo'lishi kerak emas {{ compared_value_type }} {{ compared_value }}. - - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Rasmning tomonlari nisbati juda katta ({{ ratio }}). Maksimal tomonlar nisbati {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Rasmning format nisbati juda kichik ({{ ratio }}). Minimal tomonlar nisbati {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Rasm kvadrat shaklida ({{ width }}x{{ height }}px). Kvadrat shaklida tasvirlarga ruxsat berilmaydi. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Landshaft tasvir ({{ width }}x{{ height }}px). Landshaft rasmlarga ruxsat berilmaydi. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Portret rasm ({{ width }}x{{ height }}px). Portretlarga ruxsat berilmaydi. - - - An empty file is not allowed. - Bo'sh fayllarga ruxsat berilmagan. - - - The host could not be resolved. - Xost nomini nomiga ruxsat berilmagan. - - - This value does not match the expected {{ charset }} charset. - Qiymat kutilgan {{ charset }} kodlashiga mos kelmaydi. - - - This is not a valid Business Identifier Code (BIC). - Qiymat BIC formatida emas. - - - Error - Xatolik - - - This is not a valid UUID. - Qiymat UUID formatida emas. - - - This value should be a multiple of {{ compared_value }}. - Qiymat {{ compared_value }} ning ko'paytmasi bo'lishi kerak. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Ushbu BIC IBAN {{ iban }} bilan bog'liq emas.. - - - This value should be valid JSON. - Qiymat to'g'ri JSON bo'lishi kerak. - - - This collection should contain only unique elements. - Ushbu kolleksiyada takroriy elementlar bo'lmasligi kerak. - - - This value should be positive. - Qiymat musbat bo'lishi kerak. - - - This value should be either positive or zero. - Qiymat musbat yoki 0 ga teng bo'lishi kerak. - - - This value should be negative. - Qiymat manfiy bo'lishi kerak. - - - This value should be either negative or zero. - Qiymat manfiy yoki 0 ga teng bo'lishi kerak. - - - This value is not a valid timezone. - Qiymat to'g'ri vaqt zonasi emas. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Ushbu parol ma'lumotlarning tarqalishi tufayli buzilgan va uni ishlatmaslik kerak. Boshqa paroldan foydalaning. - - - This value should be between {{ min }} and {{ max }}. - Qiymat {{ min }} va {{ max }} oralig'ida bo'lishi shart. - - - This value is not a valid hostname. - Qiymat to'g'ri xost nomi emas. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Ushbu to'plamdagi narsalar soni {{ compared_value }} dan ko'p bo'lishi kerak. - - - This value should satisfy at least one of the following constraints: - Qiymat quyidagi cheklovlardan kamida bittasiga javob berishi kerak: - - - Each element of this collection should satisfy its own set of constraints. - Ushbu to'plamdagi har bir narsa o'ziga xos cheklovlarni qondirishi kerak. - - - This value is not a valid International Securities Identification Number (ISIN). - Qiymat Qimmatli qog'ozlarning xalqaro identifikatsiya raqami (ISIN) ga mos emas. - - - This value should be a valid expression. - Ushbu qiymat to'g'ri ifoda bo'lishi kerak. - - - This value is not a valid CSS color. - Bu qiymat haqiqiy CSS rangi emas. - - - This value is not a valid CIDR notation. - Qiymat CIDR belgisiga mos kelmaydi. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Tarmoq niqobining qiymati {{ min }} va {{ max }} oralig'ida bo'lishi kerak. - - - - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf index 00201792253..e1833c79cb4 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.vi.xlf @@ -40,7 +40,7 @@ This field is missing. - LÄ©nh vá»±c này bị thiếu. + LÄ©nh vá»±c này là mất tích. This value is not a valid date. @@ -132,7 +132,7 @@ This file is not a valid image. - Tập tin không phải là hình ảnh hợp lệ. + Tập tin không phải là hình ảnh. This is not a valid IP address. @@ -148,7 +148,7 @@ This value is not a valid country. - Giá trị không phải là quốc gia hợp lệ. + Giá trị không phải là nÆ°á»›c hợp lệ. This value is already used. @@ -180,7 +180,7 @@ This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. - Giá trị này phải có chính xác {{ limit }} kí tá»±.|Giá trị này phải có chính xác {{ limit }} kí tá»±. + Giá trị phải có chính xác {{ limit }} kí tá»±.|Giá trị phải có chính xác {{ limit }} kí tá»±. The file was only partially uploaded. @@ -204,11 +204,11 @@ This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. - Danh sách phải chứa {{ limit }} thành phần hoặc nhiá»u hÆ¡n.|Danh sách phải chứa {{ limit }} thành phần hoặc nhiá»u hÆ¡n. + Danh sách phải chứa {{ limit }} hoặc nhiá»u hÆ¡n thành phần.|Danh sách phải chứa {{ limit }} hoặc nhiá»u hÆ¡n thành phần. This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. - Danh sách phải chứa {{ limit }} thành phần hoặc ít hÆ¡n.|Danh sách phải chứa {{ limit }} thành phần hoặc ít hÆ¡n. + Danh sách phải chứa {{ limit }} hoặc ít hÆ¡n thành phần.|Danh sách phải chứa {{ limit }} hoặc ít hÆ¡n thành phần. This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. @@ -240,11 +240,11 @@ This value is not a valid ISSN. - Giá trị không phải là ISSN hợp lệ. + Giá trị không là ISSN hợp lệ. This value is not a valid currency. - Giá trị không phải là Ä‘Æ¡n vị tiá»n tệ hợp lệ. + Giá trị không phải là Ä‘Æ¡n vi tiá»n tệ hợp lệ. This value should be equal to {{ compared_value }}. @@ -268,7 +268,7 @@ This value should be less than or equal to {{ compared_value }}. - Giá trị phải nhá» hÆ¡n hoặc bằng {{ compared_value }}. + Giá trị không được phép nhá» hÆ¡n hoặc bằng {{ compared_value }}. This value should not be equal to {{ compared_value }}. @@ -278,130 +278,6 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Giá trị không được phép giống nhÆ° {{ compared_value_type }} {{ compared_value }}. - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - Tá»· lệ bức ảnh quá lá»›n ({{ ratio }}). Tá»· lệ tối Ä‘a cho phép là {{ max_ratio }}. - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - Tá»· lệ bức ảnh quá nhá» ({{ ratio }}). Tá»· lệ tối thiểu mong muốn là {{ min_ratio }}. - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - Bức ảnh là hình vuông ({{ width }}x{{ height }}px). Ảnh hình vuông không được phép. - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - Bức ảnh theo chiá»u ngang ({{ width }}x{{ height }}px). Ảnh chiá»u ngang không được phép. - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - Bức ảnh theo chiá»u dá»c ({{ width }}x{{ height }}px). Ảnh chiá»u dá»c không được phép. - - - An empty file is not allowed. - Má»™t file rá»—ng không được phép. - - - The host could not be resolved. - Máy chủ không thể được tìm thấy. - - - This value does not match the expected {{ charset }} charset. - Giá trị này không đúng định dạng bá»™ ký tá»± mong muốn {{ charset }}. - - - This is not a valid Business Identifier Code (BIC). - Giá trị này không đúng định dạng mã định danh doanh nghiệp (BIC). - - - Error - Lá»—i - - - This is not a valid UUID. - Giá trị này không đúng định dạng UUID. - - - This value should be a multiple of {{ compared_value }}. - Giá trị này nên là bá»™i số của {{ compared_value }}. - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - Mã định danh doanh nghiệp (BIC) này không liên kết vá»›i IBAN {{ iban }}. - - - This value should be valid JSON. - Giá trị này nên đúng định dạng JSON. - - - This collection should contain only unique elements. - Danh sách này chỉ nên chứa các phần tá»­ khác nhau. - - - This value should be positive. - Giá trị này có thể thá»±c hiện được. - - - This value should be either positive or zero. - Giá trị này có thể thá»±c hiện được hoặc bằng không. - - - This value should be negative. - Giá trị này nên bị từ chối. - - - This value should be either negative or zero. - Giá trị này nên bị từ chối hoặc bằng không. - - - This value is not a valid timezone. - Giá trị này không phải là múi giá» hợp lệ. - - - This password has been leaked in a data breach, it must not be used. Please use another password. - Mật khẩu này đã bị rò rỉ dữ liệu, không được sá»­ dụng nữa. Xin vui lòng sá»­ dụng mật khẩu khác. - - - This value should be between {{ min }} and {{ max }}. - Giá trị này nên thuá»™c giữa {{ min }} và {{ max }}. - - - This value is not a valid hostname. - Giá trị này không phải là tên máy chủ hợp lệ. - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - Số lượng các phần tá»­ trong bá»™ sÆ°u tập này nên là bá»™i số của {{ compared_value }}. - - - This value should satisfy at least one of the following constraints: - Giá trị này nên thá»a mãn ít nhất má»™t trong những ràng buá»™c sau: - - - Each element of this collection should satisfy its own set of constraints. - Má»—i phần tá»­ trong bá»™ sÆ°u tập này nên thá»a mãn những ràng buá»™c của nó. - - - This value is not a valid International Securities Identification Number (ISIN). - Giá trị này không phải là mã số chứng khoán quốc tế (ISIN) hÆ¡Ì£p lệ. - - - This value should be a valid expression. - Giá trị này phải là má»™t biểu thức hợp lệ. - - - This value is not a valid CSS color. - Giá trị này không phải là màu CSS hợp lệ. - - - This value is not a valid CIDR notation. - Giá trị này không phải là ký hiệu CIDR hợp lệ. - - - The value of the netmask should be between {{ min }} and {{ max }}. - Giá trị của mặt nạ mạng phải nằm trong khoảng từ {{ min }} đến {{ max }}. - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf index a7d49ba98d3..d4ed03ded19 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf @@ -131,24 +131,24 @@ 该值应该为有效的数字。 + This value is not a valid country. + 该值ä¸æ˜¯æœ‰æ•ˆçš„国家å。 + + This file is not a valid image. 该文件ä¸æ˜¯æœ‰æ•ˆçš„图片。 - - This is not a valid IP address. - 该值ä¸æ˜¯æœ‰æ•ˆçš„IP地å€ã€‚ - - - This value is not a valid language. - 该值ä¸æ˜¯æœ‰æ•ˆçš„语言å。 - + + This is not a valid IP address. + 该值ä¸æ˜¯æœ‰æ•ˆçš„IP地å€ã€‚ + - This value is not a valid locale. - 该值ä¸æ˜¯æœ‰æ•ˆçš„区域值(locale)。 + This value is not a valid language. + 该值ä¸æ˜¯æœ‰æ•ˆçš„语言å。 - This value is not a valid country. - 该值ä¸æ˜¯æœ‰æ•ˆçš„国家å。 + This value is not a valid locale. + 该值ä¸æ˜¯æœ‰æ•ˆçš„区域值(locale)。 This value is already used. @@ -310,98 +310,10 @@ This value does not match the expected {{ charset }} charset. 该值ä¸ç¬¦åˆ {{ charset }} ç¼–ç ã€‚ - - This is not a valid Business Identifier Code (BIC). - è¿™ä¸æ˜¯æœ‰æ•ˆçš„业务标识符代ç ï¼ˆBIC)。 - Error 错误 - - This is not a valid UUID. - è¿™ä¸æ˜¯æœ‰æ•ˆçš„UUID。 - - - This value should be a multiple of {{ compared_value }}. - 此值应为 {{ compared_value }} çš„å€æ•°ã€‚ - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - 此业务标识符代ç ï¼ˆBIC)与IBAN {{ iban }} 无关。 - - - This value should be valid JSON. - 该值应该是有效的JSON。 - - - This collection should contain only unique elements. - 该集åˆåº”仅包å«ç‹¬ä¸€æ— äºŒçš„元素。 - - - This value should be positive. - 数值应为正数。 - - - This value should be either positive or zero. - 数值应是正数,或为零。 - - - This value should be negative. - 数值应为负数。 - - - This value should be either negative or zero. - 数值应是负数,或为零。 - - - This value is not a valid timezone. - 无效时区。 - - - This password has been leaked in a data breach, it must not be used. Please use another password. - 此密ç å·²è¢«æ³„露,切勿使用。请更æ¢å¯†ç ã€‚ - - - This value should be between {{ min }} and {{ max }}. - 该数值应在 {{ min }} å’Œ {{ max }} 之间。 - - - This value is not a valid hostname. - 该值ä¸æ˜¯æœ‰æ•ˆçš„主机å称。 - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - 该集åˆå†…的元素数é‡å¾—是 {{ compared_value }} çš„å€æ•°ã€‚ - - - This value should satisfy at least one of the following constraints: - 该值需符åˆä»¥ä¸‹å…¶ä¸­ä¸€ä¸ªçº¦æŸï¼š - - - Each element of this collection should satisfy its own set of constraints. - 该集åˆå†…çš„æ¯ä¸ªå…ƒç´ éœ€ç¬¦åˆå…ƒç´ æœ¬èº«è§„定的约æŸã€‚ - - - This value is not a valid International Securities Identification Number (ISIN). - 该值ä¸æ˜¯æœ‰æ•ˆçš„国际è¯åˆ¸è¯†åˆ«ç  (ISIN)。 - - - This value should be a valid expression. - 该值需为一个有效的表达å¼ã€‚ - - - This value is not a valid CSS color. - 该值ä¸æ˜¯æœ‰æ•ˆçš„CSS颜色。 - - - This value is not a valid CIDR notation. - 该值ä¸æ˜¯ä¸€ä¸ªæœ‰æ•ˆçš„CIDR表示。 - - - The value of the netmask should be between {{ min }} and {{ max }}. - 网络掩ç çš„值应当在 {{ min }} å’Œ {{ max }} 之间。 - diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf index b1f7fb4a715..d9d5f2f622b 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf @@ -131,25 +131,25 @@ 該值應該為有效的數字。 + This value is not a valid country. + 該值ä¸æ˜¯æœ‰æ•ˆçš„國家å。 + + This file is not a valid image. 該檔案ä¸æ˜¯æœ‰æ•ˆçš„圖片。 - + This is not a valid IP address. 該值ä¸æ˜¯æœ‰æ•ˆçš„IP地å€ã€‚ - + This value is not a valid language. 該值ä¸æ˜¯æœ‰æ•ˆçš„語言å。 - + This value is not a valid locale. 該值ä¸æ˜¯æœ‰æ•ˆçš„å€åŸŸå€¼ï¼ˆlocale)。 - - This value is not a valid country. - 該值ä¸æ˜¯æœ‰æ•ˆçš„國家å。 - This value is already used. 該值已經被使用。 @@ -278,130 +278,6 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. 該值ä¸æ‡‰èˆ‡ {{ compared_value_type }} {{ compared_value }} 相åŒã€‚ - - The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. - 圖åƒæ ¼å¼éŽå¤§ ({{ ratio }})。 最大å…許尺寸 {{ max_ratio }}。 - - - The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. - 圖åƒæ ¼å¼éŽå° ({{ ratio }})。最å°å°ºå¯¸ {{ min_ratio }}。 - - - The image is square ({{ width }}x{{ height }}px). Square images are not allowed. - æ–¹å½¢åœ–åƒ ({{ width }}x{{ height }}px)。ä¸æŽ¥å—方形圖åƒã€‚ - - - The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. - ç´€å¿µå†Šå¸ƒå±€åœ–åƒ ({{ width }}x{{ height }}px)。 ä¸æŽ¥å—紀念冊布局圖åƒã€‚ - - - The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. - 書ç±å¸ƒå±€åœ–åƒ ({{ width }}x{{ height }}px)。ä¸æŽ¥å—圖åƒæ›¸ç±å¸ƒå±€ã€‚ - - - An empty file is not allowed. - ä¸æŽ¥å—空白文件。 - - - The host could not be resolved. - 未找到æœå‹™å™¨ã€‚ - - - This value does not match the expected {{ charset }} charset. - 該數值ä¸ç¬¦åˆé æœŸ {{ charset }} 符號編碼。 - - - This is not a valid Business Identifier Code (BIC). - 無效ä¼æ¥­è­˜åˆ¥ç¢¼ (BIC)。 - - - Error. - 錯誤。 - - - This is not a valid UUID. - 無效的通用唯壹標識符 (UUID)。 - - - This value should be a multiple of {{ compared_value }}. - 該值必須是å€æ•¸ {{ compared_value }}。 - - - This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. - 該ä¼æ¥­è­˜åˆ¥ç¢¼ (BIC) 與銀行賬戶國際編號ä¸å£¹è‡´ (IBAN) {{ iban }}。 - - - This value should be valid JSON. - 該數值必須åºåˆ—化為JSONæ ¼å¼ã€‚ - - - This collection should contain only unique elements. - 該集åˆæ‡‰åƒ…包å«å”¯å£¹å…ƒç´ ã€‚ - - - This value should be positive. - 數值應為正數。 - - - This value should be either positive or zero. - 數值應是正數,或為零。 - - - This value should be negative. - 數值應為負數。 - - - This value should be either negative or zero. - 數值應是負數,或為零。 - - - This value is not a valid timezone. - 無效時å€ã€‚ - - - This password has been leaked in a data breach, it must not be used. Please use another password. - 此密碼已被泄露,切勿使用。請更æ›å¯†ç¢¼ã€‚ - - - This value should be between {{ min }} and {{ max }}. - 該數值應在 {{ min }} å’Œ {{ max }} 之間。 - - - This value is not a valid hostname. - 該數值ä¸æ˜¯æœ‰æ•ˆçš„主機å稱。 - - - The number of elements in this collection should be a multiple of {{ compared_value }}. - 該集åˆå…§çš„元素數é‡å¾—是 {{ compared_value }} çš„å€æ•¸ã€‚ - - - This value should satisfy at least one of the following constraints: - 該數值需符åˆä»¥ä¸‹å…¶ä¸­ä¸€å€‹ç´„æŸï¼š - - - Each element of this collection should satisfy its own set of constraints. - 該集åˆå…§çš„æ¯å€‹å…ƒç´ éœ€ç¬¦åˆå…ƒç´ æœ¬èº«è¦å®šçš„ç´„æŸã€‚ - - - This value is not a valid International Securities Identification Number (ISIN). - 該數值ä¸æ˜¯æœ‰æ•ˆçš„國際證券識別碼 (ISIN)。 - - - This value should be a valid expression. - 該值需為一個有效的表é”å¼ã€‚ - - - This value is not a valid CSS color. - 該值ä¸æ˜¯æœ‰æ•ˆçš„CSSé¡è‰²ã€‚ - - - This value is not a valid CIDR notation. - 該值ä¸æ˜¯ä¸€å€‹æœ‰æ•ˆçš„CIDR表示。 - - - The value of the netmask should be between {{ min }} and {{ max }}. - 網絡掩碼的值應當在 {{ min }} å’Œ {{ max }} 之間。 - diff --git a/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php b/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php deleted file mode 100644 index bee4639b26b..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php +++ /dev/null @@ -1,584 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Test; - -use PHPUnit\Framework\Assert; -use PHPUnit\Framework\Constraint\IsIdentical; -use PHPUnit\Framework\Constraint\IsInstanceOf; -use PHPUnit\Framework\Constraint\IsNull; -use PHPUnit\Framework\Constraint\LogicalOr; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\TestCase; -use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Constraints\NotNull; -use Symfony\Component\Validator\Constraints\Valid; -use Symfony\Component\Validator\ConstraintValidatorInterface; -use Symfony\Component\Validator\ConstraintViolation; -use Symfony\Component\Validator\ConstraintViolationInterface; -use Symfony\Component\Validator\ConstraintViolationList; -use Symfony\Component\Validator\ConstraintViolationListInterface; -use Symfony\Component\Validator\Context\ExecutionContext; -use Symfony\Component\Validator\Context\ExecutionContextInterface; -use Symfony\Component\Validator\Mapping\ClassMetadata; -use Symfony\Component\Validator\Mapping\PropertyMetadata; -use Symfony\Component\Validator\Validator\ContextualValidatorInterface; -use Symfony\Component\Validator\Validator\ValidatorInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * A test case to ease testing Constraint Validators. - * - * @author Bernhard Schussek - */ -abstract class ConstraintValidatorTestCase extends TestCase -{ - /** - * @var ExecutionContextInterface - */ - protected $context; - - /** - * @var ConstraintValidatorInterface - */ - protected $validator; - - protected $group; - protected $metadata; - protected $object; - protected $value; - protected $root; - protected $propertyPath; - protected $constraint; - protected $defaultTimezone; - private $defaultLocale; - private $expectedViolations; - private $call; - - protected function setUp(): void - { - $this->group = 'MyGroup'; - $this->metadata = null; - $this->object = null; - $this->value = 'InvalidValue'; - $this->root = 'root'; - $this->propertyPath = 'property.path'; - - // Initialize the context with some constraint so that we can - // successfully build a violation. - $this->constraint = new NotNull(); - - $this->context = $this->createContext(); - $this->validator = $this->createValidator(); - $this->validator->initialize($this->context); - - $this->defaultLocale = \Locale::getDefault(); - \Locale::setDefault('en'); - - $this->expectedViolations = []; - $this->call = 0; - - $this->setDefaultTimezone('UTC'); - } - - protected function tearDown(): void - { - $this->restoreDefaultTimezone(); - - \Locale::setDefault($this->defaultLocale); - } - - protected function setDefaultTimezone(?string $defaultTimezone) - { - // Make sure this method cannot be called twice before calling - // also restoreDefaultTimezone() - if (null === $this->defaultTimezone) { - $this->defaultTimezone = date_default_timezone_get(); - date_default_timezone_set($defaultTimezone); - } - } - - protected function restoreDefaultTimezone() - { - if (null !== $this->defaultTimezone) { - date_default_timezone_set($this->defaultTimezone); - $this->defaultTimezone = null; - } - } - - protected function createContext() - { - $translator = $this->createMock(TranslatorInterface::class); - $translator->expects($this->any())->method('trans')->willReturnArgument(0); - $validator = $this->createMock(ValidatorInterface::class); - $validator->expects($this->any()) - ->method('validate') - ->willReturnCallback(function () { - return $this->expectedViolations[$this->call++] ?? new ConstraintViolationList(); - }); - - $context = new ExecutionContext($validator, $this->root, $translator); - $context->setGroup($this->group); - $context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - $context->setConstraint($this->constraint); - - $contextualValidator = $this->getMockBuilder(AssertingContextualValidator::class) - ->setConstructorArgs([$context]) - ->setMethods([ - 'atPath', - 'validate', - 'validateProperty', - 'validatePropertyValue', - 'getViolations', - ]) - ->getMock(); - $contextualValidator->expects($this->any()) - ->method('atPath') - ->willReturnCallback(function ($path) use ($contextualValidator) { - return $contextualValidator->doAtPath($path); - }); - $contextualValidator->expects($this->any()) - ->method('validate') - ->willReturnCallback(function ($value, $constraints = null, $groups = null) use ($contextualValidator) { - return $contextualValidator->doValidate($value, $constraints, $groups); - }); - $contextualValidator->expects($this->any()) - ->method('validateProperty') - ->willReturnCallback(function ($object, $propertyName, $groups = null) use ($contextualValidator) { - return $contextualValidator->validateProperty($object, $propertyName, $groups); - }); - $contextualValidator->expects($this->any()) - ->method('validatePropertyValue') - ->willReturnCallback(function ($objectOrClass, $propertyName, $value, $groups = null) use ($contextualValidator) { - return $contextualValidator->doValidatePropertyValue($objectOrClass, $propertyName, $value, $groups); - }); - $contextualValidator->expects($this->any()) - ->method('getViolations') - ->willReturnCallback(function () use ($contextualValidator) { - return $contextualValidator->doGetViolations(); - }); - $validator->expects($this->any()) - ->method('inContext') - ->with($context) - ->willReturn($contextualValidator); - - return $context; - } - - protected function setGroup(?string $group) - { - $this->group = $group; - $this->context->setGroup($group); - } - - protected function setObject($object) - { - $this->object = $object; - $this->metadata = \is_object($object) - ? new ClassMetadata(\get_class($object)) - : null; - - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - } - - protected function setProperty($object, $property) - { - $this->object = $object; - $this->metadata = \is_object($object) - ? new PropertyMetadata(\get_class($object), $property) - : null; - - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - } - - protected function setValue($value) - { - $this->value = $value; - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - } - - protected function setRoot($root) - { - $this->root = $root; - $this->context = $this->createContext(); - $this->validator->initialize($this->context); - } - - protected function setPropertyPath(string $propertyPath) - { - $this->propertyPath = $propertyPath; - $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); - } - - protected function expectNoValidate() - { - $validator = $this->context->getValidator()->inContext($this->context); - $validator->expectNoValidate(); - } - - protected function expectValidateAt(int $i, string $propertyPath, $value, $group) - { - $validator = $this->context->getValidator()->inContext($this->context); - $validator->expectValidation($i, $propertyPath, $value, $group, function ($passedConstraints) { - $expectedConstraints = new LogicalOr(); - $expectedConstraints->setConstraints([new IsNull(), new IsIdentical([]), new IsInstanceOf(Valid::class)]); - - Assert::assertThat($passedConstraints, $expectedConstraints); - }); - } - - protected function expectValidateValue(int $i, $value, array $constraints = [], $group = null) - { - $contextualValidator = $this->context->getValidator()->inContext($this->context); - $contextualValidator->expectValidation($i, null, $value, $group, function ($passedConstraints) use ($constraints) { - if (\is_array($constraints) && !\is_array($passedConstraints)) { - $passedConstraints = [$passedConstraints]; - } - - Assert::assertEquals($constraints, $passedConstraints); - }); - } - - protected function expectFailingValueValidation(int $i, $value, array $constraints, $group, ConstraintViolationInterface $violation) - { - $contextualValidator = $this->context->getValidator()->inContext($this->context); - $contextualValidator->expectValidation($i, null, $value, $group, function ($passedConstraints) use ($constraints) { - if (\is_array($constraints) && !\is_array($passedConstraints)) { - $passedConstraints = [$passedConstraints]; - } - - Assert::assertEquals($constraints, $passedConstraints); - }, $violation); - } - - protected function expectValidateValueAt(int $i, string $propertyPath, $value, $constraints, $group = null) - { - $contextualValidator = $this->context->getValidator()->inContext($this->context); - $contextualValidator->expectValidation($i, $propertyPath, $value, $group, function ($passedConstraints) use ($constraints) { - Assert::assertEquals($constraints, $passedConstraints); - }); - } - - protected function expectViolationsAt($i, $value, Constraint $constraint) - { - $context = $this->createContext(); - - $validatorClassname = $constraint->validatedBy(); - - $validator = new $validatorClassname(); - $validator->initialize($context); - $validator->validate($value, $constraint); - - $this->expectedViolations[] = $context->getViolations(); - - return $context->getViolations(); - } - - protected function assertNoViolation() - { - $this->assertSame(0, $violationsCount = \count($this->context->getViolations()), sprintf('0 violation expected. Got %u.', $violationsCount)); - } - - /** - * @return ConstraintViolationAssertion - */ - protected function buildViolation($message) - { - return new ConstraintViolationAssertion($this->context, $message, $this->constraint); - } - - abstract protected function createValidator(); -} - -final class ConstraintViolationAssertion -{ - /** - * @var ExecutionContextInterface - */ - private $context; - - /** - * @var ConstraintViolationAssertion[] - */ - private $assertions; - - private $message; - private $parameters = []; - private $invalidValue = 'InvalidValue'; - private $propertyPath = 'property.path'; - private $plural; - private $code; - private $constraint; - private $cause; - - /** - * @internal - */ - public function __construct(ExecutionContextInterface $context, string $message, Constraint $constraint = null, array $assertions = []) - { - $this->context = $context; - $this->message = $message; - $this->constraint = $constraint; - $this->assertions = $assertions; - } - - /** - * @return $this - */ - public function atPath(string $path) - { - $this->propertyPath = $path; - - return $this; - } - - /** - * @return $this - */ - public function setParameter(string $key, string $value) - { - $this->parameters[$key] = $value; - - return $this; - } - - /** - * @return $this - */ - public function setParameters(array $parameters) - { - $this->parameters = $parameters; - - return $this; - } - - /** - * @return $this - */ - public function setTranslationDomain($translationDomain) - { - // no-op for BC - - return $this; - } - - /** - * @return $this - */ - public function setInvalidValue($invalidValue) - { - $this->invalidValue = $invalidValue; - - return $this; - } - - /** - * @return $this - */ - public function setPlural(int $number) - { - $this->plural = $number; - - return $this; - } - - /** - * @return $this - */ - public function setCode(string $code) - { - $this->code = $code; - - return $this; - } - - /** - * @return $this - */ - public function setCause($cause) - { - $this->cause = $cause; - - return $this; - } - - public function buildNextViolation(string $message): self - { - $assertions = $this->assertions; - $assertions[] = $this; - - return new self($this->context, $message, $this->constraint, $assertions); - } - - public function assertRaised() - { - $expected = []; - foreach ($this->assertions as $assertion) { - $expected[] = $assertion->getViolation(); - } - $expected[] = $this->getViolation(); - - $violations = iterator_to_array($this->context->getViolations()); - - Assert::assertSame($expectedCount = \count($expected), $violationsCount = \count($violations), sprintf('%u violation(s) expected. Got %u.', $expectedCount, $violationsCount)); - - reset($violations); - - foreach ($expected as $violation) { - Assert::assertEquals($violation, current($violations)); - next($violations); - } - } - - private function getViolation(): ConstraintViolation - { - return new ConstraintViolation( - $this->message, - $this->message, - $this->parameters, - $this->context->getRoot(), - $this->propertyPath, - $this->invalidValue, - $this->plural, - $this->code, - $this->constraint, - $this->cause - ); - } -} - -/** - * @internal - */ -class AssertingContextualValidator implements ContextualValidatorInterface -{ - private $context; - private $expectNoValidate = false; - private $atPathCalls = -1; - private $expectedAtPath = []; - private $validateCalls = -1; - private $expectedValidate = []; - - public function __construct(ExecutionContextInterface $context) - { - $this->context = $context; - } - - public function __destruct() - { - if ($this->expectedAtPath) { - throw new ExpectationFailedException('Some expected validation calls for paths were not done.'); - } - - if ($this->expectedValidate) { - throw new ExpectationFailedException('Some expected validation calls for values were not done.'); - } - } - - public function atPath(string $path) - { - } - - /** - * @return $this - */ - public function doAtPath(string $path) - { - Assert::assertFalse($this->expectNoValidate, 'No validation calls have been expected.'); - - if (!isset($this->expectedAtPath[++$this->atPathCalls])) { - throw new ExpectationFailedException(sprintf('Validation for property path "%s" was not expected.', $path)); - } - - $expectedPath = $this->expectedAtPath[$this->atPathCalls]; - unset($this->expectedAtPath[$this->atPathCalls]); - - Assert::assertSame($expectedPath, $path); - - return $this; - } - - public function validate($value, $constraints = null, $groups = null) - { - } - - /** - * @return $this - */ - public function doValidate($value, $constraints = null, $groups = null) - { - Assert::assertFalse($this->expectNoValidate, 'No validation calls have been expected.'); - - if (!isset($this->expectedValidate[++$this->validateCalls])) { - return $this; - } - - [$expectedValue, $expectedGroup, $expectedConstraints, $violation] = $this->expectedValidate[$this->validateCalls]; - unset($this->expectedValidate[$this->validateCalls]); - - Assert::assertSame($expectedValue, $value); - $expectedConstraints($constraints); - Assert::assertSame($expectedGroup, $groups); - - if (null !== $violation) { - $this->context->addViolation($violation->getMessage(), $violation->getParameters()); - } - - return $this; - } - - public function validateProperty(object $object, string $propertyName, $groups = null) - { - } - - /** - * @return $this - */ - public function doValidateProperty(object $object, string $propertyName, $groups = null) - { - return $this; - } - - public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) - { - } - - /** - * @return $this - */ - public function doValidatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) - { - return $this; - } - - public function getViolations(): ConstraintViolationListInterface - { - } - - public function doGetViolations() - { - return $this->context->getViolations(); - } - - public function expectNoValidate() - { - $this->expectNoValidate = true; - } - - public function expectValidation(string $call, ?string $propertyPath, $value, $group, callable $constraints, ConstraintViolationInterface $violation = null) - { - if (null !== $propertyPath) { - $this->expectedAtPath[$call] = $propertyPath; - } - - $this->expectedValidate[$call] = [$value, $group, $constraints, $violation]; - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php b/upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php index 973b6f2cb87..4108a02c24f 100644 --- a/upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php +++ b/upload/system/storage/vendor/symfony/validator/Util/PropertyPath.php @@ -29,16 +29,19 @@ class PropertyPath * returned. Otherwise, the concatenation of the two paths is returned, * separated by a dot ("."). * - * @return string + * @param string $basePath The base path + * @param string $subPath The path to append + * + * @return string The concatenation of the two property paths */ - public static function append(string $basePath, string $subPath) + public static function append($basePath, $subPath) { - if ('' !== $subPath) { + if ('' !== (string) $subPath) { if ('[' === $subPath[0]) { return $basePath.$subPath; } - return '' !== $basePath ? $basePath.'.'.$subPath : $subPath; + return '' !== (string) $basePath ? $basePath.'.'.$subPath : $subPath; } return $basePath; diff --git a/upload/system/storage/vendor/symfony/validator/Validation.php b/upload/system/storage/vendor/symfony/validator/Validation.php index 4d08072779d..a469b47e25e 100644 --- a/upload/system/storage/vendor/symfony/validator/Validation.php +++ b/upload/system/storage/vendor/symfony/validator/Validation.php @@ -11,9 +11,6 @@ namespace Symfony\Component\Validator; -use Symfony\Component\Validator\Exception\ValidationFailedException; -use Symfony\Component\Validator\Validator\ValidatorInterface; - /** * Entry point for the Validator component. * @@ -22,67 +19,42 @@ final class Validation { /** - * Creates a callable chain of constraints. - * - * @param Constraint|ValidatorInterface|null $constraintOrValidator + * The Validator API provided by Symfony 2.4 and older. * - * @return callable($value) + * @deprecated use API_VERSION_2_5_BC instead */ - public static function createCallable($constraintOrValidator = null, Constraint ...$constraints): callable - { - $validator = self::createIsValidCallable($constraintOrValidator, ...$constraints); - - return static function ($value) use ($validator) { - if (!$validator($value, $violations)) { - throw new ValidationFailedException($value, $violations); - } - - return $value; - }; - } + const API_VERSION_2_4 = 1; /** - * Creates a callable that returns true/false instead of throwing validation exceptions. - * - * @param Constraint|ValidatorInterface|null $constraintOrValidator - * - * @return callable($value, &$violations = null): bool + * The Validator API provided by Symfony 2.5 and newer. */ - public static function createIsValidCallable($constraintOrValidator = null, Constraint ...$constraints): callable - { - $validator = $constraintOrValidator; + const API_VERSION_2_5 = 2; - if ($constraintOrValidator instanceof Constraint) { - $constraints = \func_get_args(); - $validator = null; - } elseif (null !== $constraintOrValidator && !$constraintOrValidator instanceof ValidatorInterface) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a "%s" or a "%s" object, "%s" given.', __METHOD__, Constraint::class, ValidatorInterface::class, get_debug_type($constraintOrValidator))); - } - - $validator = $validator ?? self::createValidator(); - - return static function ($value, &$violations = null) use ($constraints, $validator) { - $violations = $validator->validate($value, $constraints); - - return 0 === $violations->count(); - }; - } + /** + * The Validator API provided by Symfony 2.5 and newer with a backwards + * compatibility layer for 2.4 and older. + */ + const API_VERSION_2_5_BC = 3; /** * Creates a new validator. * * If you want to configure the validator, use * {@link createValidatorBuilder()} instead. + * + * @return ValidatorInterface The new validator */ - public static function createValidator(): ValidatorInterface + public static function createValidator() { return self::createValidatorBuilder()->getValidator(); } /** * Creates a configurable builder for validator objects. + * + * @return ValidatorBuilderInterface The new builder */ - public static function createValidatorBuilder(): ValidatorBuilder + public static function createValidatorBuilder() { return new ValidatorBuilder(); } diff --git a/upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php b/upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php index 1063a532987..c8b545b54b4 100644 --- a/upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Validator/ContextualValidatorInterface.php @@ -28,9 +28,11 @@ interface ContextualValidatorInterface * If called multiple times, the path will always be reset to the context's * original path with the given path appended to it. * + * @param string $path The path to append + * * @return $this */ - public function atPath(string $path); + public function atPath($path); /** * Validates a value against a constraint or a list of constraints. @@ -38,9 +40,9 @@ public function atPath(string $path); * If no constraint is passed, the constraint * {@link \Symfony\Component\Validator\Constraints\Valid} is assumed. * - * @param mixed $value The value to validate - * @param Constraint|Constraint[]|null $constraints The constraint(s) to validate against - * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * @param mixed $value The value to validate + * @param Constraint|Constraint[] $constraints The constraint(s) to validate against + * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed * * @return $this */ @@ -50,31 +52,32 @@ public function validate($value, $constraints = null, $groups = null); * Validates a property of an object against the constraints specified * for this property. * - * @param string $propertyName The name of the validated property - * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * @param object $object The object + * @param string $propertyName The name of the validated property + * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed * * @return $this */ - public function validateProperty(object $object, string $propertyName, $groups = null); + public function validateProperty($object, $propertyName, $groups = null); /** * Validates a value against the constraints specified for an object's * property. * - * @param object|string $objectOrClass The object or its class name - * @param string $propertyName The name of the property - * @param mixed $value The value to validate against the property's constraints - * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * @param object|string $objectOrClass The object or its class name + * @param string $propertyName The name of the property + * @param mixed $value The value to validate against the property's constraints + * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed * * @return $this */ - public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null); + public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null); /** * Returns the violations that have been generated so far in the context * of the validator. * - * @return ConstraintViolationListInterface + * @return ConstraintViolationListInterface The constraint violations */ public function getViolations(); } diff --git a/upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php b/upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php deleted file mode 100644 index a70eeed152c..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Validator/LazyProperty.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Validator; - -/** - * A wrapper for a callable initializing a property from a getter. - * - * @internal - */ -class LazyProperty -{ - private $propertyValueCallback; - - public function __construct(\Closure $propertyValueCallback) - { - $this->propertyValueCallback = $propertyValueCallback; - } - - public function getPropertyValue() - { - return ($this->propertyValueCallback)(); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php index 73801717bc9..14456d8c911 100644 --- a/upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveContextualValidator.php @@ -12,27 +12,22 @@ namespace Symfony\Component\Validator\Validator; use Symfony\Component\Validator\Constraint; -use Symfony\Component\Validator\Constraints\Composite; -use Symfony\Component\Validator\Constraints\Existence; use Symfony\Component\Validator\Constraints\GroupSequence; -use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\ConstraintValidatorFactoryInterface; use Symfony\Component\Validator\Context\ExecutionContext; use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\NoSuchMetadataException; use Symfony\Component\Validator\Exception\RuntimeException; -use Symfony\Component\Validator\Exception\UnexpectedValueException; use Symfony\Component\Validator\Exception\UnsupportedMetadataException; use Symfony\Component\Validator\Exception\ValidatorException; use Symfony\Component\Validator\Mapping\CascadingStrategy; use Symfony\Component\Validator\Mapping\ClassMetadataInterface; -use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; use Symfony\Component\Validator\Mapping\GenericMetadata; -use Symfony\Component\Validator\Mapping\GetterMetadata; use Symfony\Component\Validator\Mapping\MetadataInterface; use Symfony\Component\Validator\Mapping\PropertyMetadataInterface; use Symfony\Component\Validator\Mapping\TraversalStrategy; +use Symfony\Component\Validator\MetadataFactoryInterface; use Symfony\Component\Validator\ObjectInitializerInterface; use Symfony\Component\Validator\Util\PropertyPath; @@ -53,13 +48,19 @@ class RecursiveContextualValidator implements ContextualValidatorInterface /** * Creates a validator for the given context. * - * @param ObjectInitializerInterface[] $objectInitializers The object initializers + * @param ExecutionContextInterface $context The execution context + * @param MetadataFactoryInterface $metadataFactory The factory for + * fetching the metadata + * of validated objects + * @param ConstraintValidatorFactoryInterface $validatorFactory The factory for creating + * constraint validators + * @param ObjectInitializerInterface[] $objectInitializers The object initializers */ - public function __construct(ExecutionContextInterface $context, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = []) + public function __construct(ExecutionContextInterface $context, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = array()) { $this->context = $context; $this->defaultPropertyPath = $context->getPropertyPath(); - $this->defaultGroups = [$context->getGroup() ?: Constraint::DEFAULT_GROUP]; + $this->defaultGroups = array($context->getGroup() ?: Constraint::DEFAULT_GROUP); $this->metadataFactory = $metadataFactory; $this->validatorFactory = $validatorFactory; $this->objectInitializers = $objectInitializers; @@ -68,7 +69,7 @@ public function __construct(ExecutionContextInterface $context, MetadataFactoryI /** * {@inheritdoc} */ - public function atPath(string $path) + public function atPath($path) { $this->defaultPropertyPath = $this->context->getPropertyPath($path); @@ -99,7 +100,7 @@ public function validate($value, $constraints = null, $groups = null) // You can pass a single constraint or an array of constraints // Make sure to deal with an array in the rest of the code if (!\is_array($constraints)) { - $constraints = [$constraints]; + $constraints = array($constraints); } $metadata = new GenericMetadata(); @@ -108,7 +109,7 @@ public function validate($value, $constraints = null, $groups = null) $this->validateGenericNode( $value, $previousObject, - \is_object($value) ? $this->generateCacheKey($value) : null, + \is_object($value) ? spl_object_hash($value) : null, $metadata, $this->defaultPropertyPath, $groups, @@ -151,6 +152,7 @@ public function validate($value, $constraints = null, $groups = null) $value, $this->defaultPropertyPath, $groups, + true, $this->context ); @@ -160,23 +162,25 @@ public function validate($value, $constraints = null, $groups = null) return $this; } - throw new RuntimeException(sprintf('Cannot validate values of type "%s" automatically. Please provide a constraint.', get_debug_type($value))); + throw new RuntimeException(sprintf('Cannot validate values of type "%s" automatically. Please provide a constraint.', \gettype($value))); } /** * {@inheritdoc} */ - public function validateProperty(object $object, string $propertyName, $groups = null) + public function validateProperty($object, $propertyName, $groups = null) { $classMetadata = $this->metadataFactory->getMetadataFor($object); if (!$classMetadata instanceof ClassMetadataInterface) { - throw new ValidatorException(sprintf('The metadata factory should return instances of "\Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', get_debug_type($classMetadata))); + // Cannot be UnsupportedMetadataException because of BC with + // Symfony < 2.5 + throw new ValidatorException(sprintf('The metadata factory should return instances of "\Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', \is_object($classMetadata) ? \get_class($classMetadata) : \gettype($classMetadata))); } $propertyMetadatas = $classMetadata->getPropertyMetadata($propertyName); $groups = $groups ? $this->normalizeGroups($groups) : $this->defaultGroups; - $cacheKey = $this->generateCacheKey($object); + $cacheKey = spl_object_hash($object); $propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName); $previousValue = $this->context->getValue(); @@ -191,7 +195,7 @@ public function validateProperty(object $object, string $propertyName, $groups = $this->validateGenericNode( $propertyValue, $object, - $cacheKey.':'.\get_class($object).':'.$propertyName, + $cacheKey.':'.$propertyName, $propertyMetadata, $propertyPath, $groups, @@ -210,12 +214,14 @@ public function validateProperty(object $object, string $propertyName, $groups = /** * {@inheritdoc} */ - public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) + public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null) { $classMetadata = $this->metadataFactory->getMetadataFor($objectOrClass); if (!$classMetadata instanceof ClassMetadataInterface) { - throw new ValidatorException(sprintf('The metadata factory should return instances of "\Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', get_debug_type($classMetadata))); + // Cannot be UnsupportedMetadataException because of BC with + // Symfony < 2.5 + throw new ValidatorException(sprintf('The metadata factory should return instances of "\Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', \is_object($classMetadata) ? \get_class($classMetadata) : \gettype($classMetadata))); } $propertyMetadatas = $classMetadata->getPropertyMetadata($propertyName); @@ -223,13 +229,11 @@ public function validatePropertyValue($objectOrClass, string $propertyName, $val if (\is_object($objectOrClass)) { $object = $objectOrClass; - $class = \get_class($object); - $cacheKey = $this->generateCacheKey($objectOrClass); + $cacheKey = spl_object_hash($objectOrClass); $propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName); } else { // $objectOrClass contains a class name $object = null; - $class = $objectOrClass; $cacheKey = null; $propertyPath = $this->defaultPropertyPath; } @@ -244,7 +248,7 @@ public function validatePropertyValue($objectOrClass, string $propertyName, $val $this->validateGenericNode( $value, $object, - $cacheKey.':'.$class.':'.$propertyName, + $cacheKey.':'.$propertyName, $propertyMetadata, $propertyPath, $groups, @@ -271,9 +275,9 @@ public function getViolations() /** * Normalizes the given group or list of groups to an array. * - * @param string|GroupSequence|array $groups The groups to normalize + * @param string|GroupSequence|(string|GroupSequence)[] $groups The groups to normalize * - * @return array + * @return (string|GroupSequence)[] A group array */ protected function normalizeGroups($groups) { @@ -281,7 +285,7 @@ protected function normalizeGroups($groups) return $groups; } - return [$groups]; + return array($groups); } /** @@ -292,6 +296,13 @@ protected function normalizeGroups($groups) * traversal, the object will be iterated and each nested object will be * validated instead. * + * @param object $object The object to cascade + * @param string $propertyPath The current property path + * @param (string|GroupSequence)[] $groups The validated groups + * @param int $traversalStrategy The strategy for traversing the + * cascaded object + * @param ExecutionContextInterface $context The current execution context + * * @throws NoSuchMetadataException If the object has no associated metadata * and does not implement {@link \Traversable} * or if traversal is disabled via the @@ -300,18 +311,18 @@ protected function normalizeGroups($groups) * metadata factory does not implement * {@link ClassMetadataInterface} */ - private function validateObject(object $object, string $propertyPath, array $groups, int $traversalStrategy, ExecutionContextInterface $context) + private function validateObject($object, $propertyPath, array $groups, $traversalStrategy, ExecutionContextInterface $context) { try { $classMetadata = $this->metadataFactory->getMetadataFor($object); if (!$classMetadata instanceof ClassMetadataInterface) { - throw new UnsupportedMetadataException(sprintf('The metadata factory should return instances of "Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', get_debug_type($classMetadata))); + throw new UnsupportedMetadataException(sprintf('The metadata factory should return instances of "Symfony\Component\Validator\Mapping\ClassMetadataInterface", got: "%s".', \is_object($classMetadata) ? \get_class($classMetadata) : \gettype($classMetadata))); } $this->validateClassNode( $object, - $this->generateCacheKey($object), + spl_object_hash($object), $classMetadata, $propertyPath, $groups, @@ -334,6 +345,7 @@ private function validateObject(object $object, string $propertyPath, array $gro $object, $propertyPath, $groups, + $traversalStrategy & TraversalStrategy::STOP_RECURSION, $context ); } @@ -343,17 +355,40 @@ private function validateObject(object $object, string $propertyPath, array $gro * Validates each object in a collection against the constraints defined * for their classes. * - * Nested arrays are also iterated. + * If the parameter $recursive is set to true, nested {@link \Traversable} + * objects are iterated as well. Nested arrays are always iterated, + * regardless of the value of $recursive. + * + * @param iterable $collection The collection + * @param string $propertyPath The current property path + * @param (string|GroupSequence)[] $groups The validated groups + * @param bool $stopRecursion Whether to disable + * recursive iteration. For + * backwards compatibility + * with Symfony < 2.5. + * @param ExecutionContextInterface $context The current execution context + * + * @see ClassNode + * @see CollectionNode */ - private function validateEachObjectIn(iterable $collection, string $propertyPath, array $groups, ExecutionContextInterface $context) + private function validateEachObjectIn($collection, $propertyPath, array $groups, $stopRecursion, ExecutionContextInterface $context) { + if ($stopRecursion) { + $traversalStrategy = TraversalStrategy::NONE; + } else { + $traversalStrategy = TraversalStrategy::IMPLICIT; + } + foreach ($collection as $key => $value) { if (\is_array($value)) { - // Also traverse nested arrays + // Arrays are always cascaded, independent of the specified + // traversal strategy + // (BC with Symfony < 2.5) $this->validateEachObjectIn( $value, $propertyPath.'['.$key.']', $groups, + $stopRecursion, $context ); @@ -361,12 +396,13 @@ private function validateEachObjectIn(iterable $collection, string $propertyPath } // Scalar and null values in the collection are ignored + // (BC with Symfony < 2.5) if (\is_object($value)) { $this->validateObject( $value, $propertyPath.'['.$key.']', $groups, - TraversalStrategy::IMPLICIT, + $traversalStrategy, $context ); } @@ -398,6 +434,22 @@ private function validateEachObjectIn(iterable $collection, string $propertyPath * in the class metadata. If this is the case, the group sequence is * validated instead. * + * @param object $object The validated object + * @param string $cacheKey The key for caching + * the validated object + * @param ClassMetadataInterface $metadata The class metadata of + * the object + * @param string $propertyPath The property path leading + * to the object + * @param (string|GroupSequence)[] $groups The groups in which the + * object should be validated + * @param string[]|null $cascadedGroups The groups in which + * cascaded objects should + * be validated + * @param int $traversalStrategy The strategy used for + * traversing the object + * @param ExecutionContextInterface $context The current execution context + * * @throws UnsupportedMetadataException If a property metadata does not * implement {@link PropertyMetadataInterface} * @throws ConstraintDefinitionException If traversal was enabled but the @@ -406,7 +458,7 @@ private function validateEachObjectIn(iterable $collection, string $propertyPath * * @see TraversalStrategy */ - private function validateClassNode(object $object, ?string $cacheKey, ClassMetadataInterface $metadata, string $propertyPath, array $groups, ?array $cascadedGroups, int $traversalStrategy, ExecutionContextInterface $context) + private function validateClassNode($object, $cacheKey, ClassMetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context) { $context->setNode($object, $object, $metadata, $propertyPath); @@ -425,7 +477,7 @@ private function validateClassNode(object $object, ?string $cacheKey, ClassMetad $defaultOverridden = false; // Use the object hash for group sequences - $groupHash = \is_object($group) ? $this->generateCacheKey($group, true) : $group; + $groupHash = \is_object($group) ? spl_object_hash($group) : $group; if ($context->isGroupValidated($cacheKey, $groupHash)) { // Skip this group when validating the properties and when @@ -501,21 +553,15 @@ private function validateClassNode(object $object, ?string $cacheKey, ClassMetad // returns two metadata objects, not just one foreach ($metadata->getPropertyMetadata($propertyName) as $propertyMetadata) { if (!$propertyMetadata instanceof PropertyMetadataInterface) { - throw new UnsupportedMetadataException(sprintf('The property metadata instances should implement "Symfony\Component\Validator\Mapping\PropertyMetadataInterface", got: "%s".', get_debug_type($propertyMetadata))); + throw new UnsupportedMetadataException(sprintf('The property metadata instances should implement "Symfony\Component\Validator\Mapping\PropertyMetadataInterface", got: "%s".', \is_object($propertyMetadata) ? \get_class($propertyMetadata) : \gettype($propertyMetadata))); } - if ($propertyMetadata instanceof GetterMetadata) { - $propertyValue = new LazyProperty(static function () use ($propertyMetadata, $object) { - return $propertyMetadata->getPropertyValue($object); - }); - } else { - $propertyValue = $propertyMetadata->getPropertyValue($object); - } + $propertyValue = $propertyMetadata->getPropertyValue($object); $this->validateGenericNode( $propertyValue, $object, - $cacheKey.':'.\get_class($object).':'.$propertyName, + $cacheKey.':'.$propertyName, $propertyMetadata, PropertyPath::append($propertyPath, $propertyName), $groups, @@ -529,7 +575,9 @@ private function validateClassNode(object $object, ?string $cacheKey, ClassMetad // If no specific traversal strategy was requested when this method // was called, use the traversal strategy of the class' metadata if ($traversalStrategy & TraversalStrategy::IMPLICIT) { - $traversalStrategy = $metadata->getTraversalStrategy(); + // Keep the STOP_RECURSION flag, if it was set + $traversalStrategy = $metadata->getTraversalStrategy() + | ($traversalStrategy & TraversalStrategy::STOP_RECURSION); } // Traverse only if IMPLICIT or TRAVERSE @@ -544,13 +592,16 @@ private function validateClassNode(object $object, ?string $cacheKey, ClassMetad // If TRAVERSE, fail if we have no Traversable if (!$object instanceof \Traversable) { - throw new ConstraintDefinitionException(sprintf('Traversal was enabled for "%s", but this class does not implement "\Traversable".', get_debug_type($object))); + // Must throw a ConstraintDefinitionException for backwards + // compatibility reasons with Symfony < 2.5 + throw new ConstraintDefinitionException(sprintf('Traversal was enabled for "%s", but this class does not implement "\Traversable".', \get_class($object))); } $this->validateEachObjectIn( $object, $propertyPath, $groups, + $traversalStrategy & TraversalStrategy::STOP_RECURSION, $context ); } @@ -569,12 +620,28 @@ private function validateClassNode(object $object, ?string $cacheKey, ClassMetad * in the passed metadata object. Then, if the value is an instance of * {@link \Traversable} and the selected traversal strategy permits it, * the value is traversed and each nested object validated against its own - * constraints. If the value is an array, it is traversed regardless of - * the given strategy. + * constraints. Arrays are always traversed. + * + * @param mixed $value The validated value + * @param object|null $object The current object + * @param string $cacheKey The key for caching + * the validated value + * @param MetadataInterface $metadata The metadata of the + * value + * @param string $propertyPath The property path leading + * to the value + * @param (string|GroupSequence)[] $groups The groups in which the + * value should be validated + * @param string[]|null $cascadedGroups The groups in which + * cascaded objects should + * be validated + * @param int $traversalStrategy The strategy used for + * traversing the value + * @param ExecutionContextInterface $context The current execution context * * @see TraversalStrategy */ - private function validateGenericNode($value, ?object $object, ?string $cacheKey, ?MetadataInterface $metadata, string $propertyPath, array $groups, ?array $cascadedGroups, int $traversalStrategy, ExecutionContextInterface $context) + private function validateGenericNode($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context) { $context->setNode($value, $object, $metadata, $propertyPath); @@ -612,15 +679,17 @@ private function validateGenericNode($value, ?object $object, ?string $cacheKey, $cascadingStrategy = $metadata->getCascadingStrategy(); - // Quit unless we cascade - if (!($cascadingStrategy & CascadingStrategy::CASCADE)) { + // Quit unless we have an array or a cascaded object + if (!\is_array($value) && !($cascadingStrategy & CascadingStrategy::CASCADE)) { return; } // If no specific traversal strategy was requested when this method // was called, use the traversal strategy of the node's metadata if ($traversalStrategy & TraversalStrategy::IMPLICIT) { - $traversalStrategy = $metadata->getTraversalStrategy(); + // Keep the STOP_RECURSION flag, if it was set + $traversalStrategy = $metadata->getTraversalStrategy() + | ($traversalStrategy & TraversalStrategy::STOP_RECURSION); } // The $cascadedGroups property is set, if the "Default" group is @@ -628,31 +697,24 @@ private function validateGenericNode($value, ?object $object, ?string $cacheKey, // See validateClassNode() $cascadedGroups = null !== $cascadedGroups && \count($cascadedGroups) > 0 ? $cascadedGroups : $groups; - if ($value instanceof LazyProperty) { - $value = $value->getPropertyValue(); - - if (null === $value) { - return; - } - } - if (\is_array($value)) { // Arrays are always traversed, independent of the specified // traversal strategy + // (BC with Symfony < 2.5) $this->validateEachObjectIn( $value, $propertyPath, $cascadedGroups, + $traversalStrategy & TraversalStrategy::STOP_RECURSION, $context ); return; } - if (!\is_object($value)) { - throw new NoSuchMetadataException(sprintf('Cannot create metadata for non-objects. Got: "%s".', \gettype($value))); - } - + // If the value is a scalar, pass it anyway, because we want + // a NoSuchMetadataException to be thrown in that case + // (BC with Symfony < 2.5) $this->validateObject( $value, $propertyPath, @@ -674,14 +736,31 @@ private function validateGenericNode($value, ?object $object, ?string $cacheKey, * * If any of the constraints generates a violation, subsequent groups in the * group sequence are skipped. + * + * @param mixed $value The validated value + * @param object|null $object The current object + * @param string $cacheKey The key for caching + * the validated value + * @param MetadataInterface $metadata The metadata of the + * value + * @param string $propertyPath The property path leading + * to the value + * @param int $traversalStrategy The strategy used for + * traversing the value + * @param GroupSequence $groupSequence The group sequence + * @param string|null $cascadedGroup The group that should + * be passed to cascaded + * objects instead of + * the group sequence + * @param ExecutionContextInterface $context The execution context */ - private function stepThroughGroupSequence($value, ?object $object, ?string $cacheKey, ?MetadataInterface $metadata, string $propertyPath, int $traversalStrategy, GroupSequence $groupSequence, ?string $cascadedGroup, ExecutionContextInterface $context) + private function stepThroughGroupSequence($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, $traversalStrategy, GroupSequence $groupSequence, $cascadedGroup, ExecutionContextInterface $context) { $violationCount = \count($context->getViolations()); - $cascadedGroups = $cascadedGroup ? [$cascadedGroup] : null; + $cascadedGroups = $cascadedGroup ? array($cascadedGroup) : null; foreach ($groupSequence->groups as $groupInSequence) { - $groups = (array) $groupInSequence; + $groups = array($groupInSequence); if ($metadata instanceof ClassMetadataInterface) { $this->validateClassNode( @@ -718,26 +797,22 @@ private function stepThroughGroupSequence($value, ?object $object, ?string $cach /** * Validates a node's value against all constraints in the given group. * - * @param mixed $value The validated value + * @param mixed $value The validated value + * @param string $cacheKey The key for caching the + * validated value + * @param MetadataInterface $metadata The metadata of the value + * @param string $group The group to validate + * @param ExecutionContextInterface $context The execution context */ - private function validateInGroup($value, ?string $cacheKey, MetadataInterface $metadata, string $group, ExecutionContextInterface $context) + private function validateInGroup($value, $cacheKey, MetadataInterface $metadata, $group, ExecutionContextInterface $context) { $context->setGroup($group); foreach ($metadata->findConstraints($group) as $constraint) { - if ($constraint instanceof Existence) { - continue; - } - // Prevent duplicate validation of constraints, in the case // that constraints belong to multiple validated groups if (null !== $cacheKey) { - $constraintHash = $this->generateCacheKey($constraint, true); - // instanceof Valid: In case of using a Valid constraint with many groups - // it makes a reference object get validated by each group - if ($constraint instanceof Composite || $constraint instanceof Valid) { - $constraintHash .= $group; - } + $constraintHash = spl_object_hash($constraint); if ($context->isConstraintValidated($cacheKey, $constraintHash)) { continue; @@ -750,33 +825,7 @@ private function validateInGroup($value, ?string $cacheKey, MetadataInterface $m $validator = $this->validatorFactory->getInstance($constraint); $validator->initialize($context); - - if ($value instanceof LazyProperty) { - $value = $value->getPropertyValue(); - } - - try { - $validator->validate($value, $constraint); - } catch (UnexpectedValueException $e) { - $context->buildViolation('This value should be of type {{ type }}.') - ->setParameter('{{ type }}', $e->getExpectedType()) - ->addViolation(); - } + $validator->validate($value, $constraint); } } - - private function generateCacheKey(object $object, bool $dependsOnPropertyPath = false): string - { - if ($this->context instanceof ExecutionContext) { - $cacheKey = $this->context->generateCacheKey($object); - } else { - $cacheKey = spl_object_hash($object); - } - - if ($dependsOnPropertyPath) { - $cacheKey .= $this->context->getPropertyPath(); - } - - return $cacheKey; - } } diff --git a/upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php index d57c90847b8..bf0050d6f24 100644 --- a/upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Validator/RecursiveValidator.php @@ -11,18 +11,22 @@ namespace Symfony\Component\Validator\Validator; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\ConstraintValidatorFactoryInterface; use Symfony\Component\Validator\Context\ExecutionContextFactoryInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface; -use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; +use Symfony\Component\Validator\MetadataFactoryInterface; use Symfony\Component\Validator\ObjectInitializerInterface; +use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface; /** * Recursive implementation of {@link ValidatorInterface}. * * @author Bernhard Schussek */ -class RecursiveValidator implements ValidatorInterface +class RecursiveValidator implements ValidatorInterface, LegacyValidatorInterface { protected $contextFactory; protected $metadataFactory; @@ -32,9 +36,16 @@ class RecursiveValidator implements ValidatorInterface /** * Creates a new validator. * - * @param ObjectInitializerInterface[] $objectInitializers The object initializers + * @param ExecutionContextFactoryInterface $contextFactory The factory for + * creating new contexts + * @param MetadataFactoryInterface $metadataFactory The factory for + * fetching the metadata + * of validated objects + * @param ConstraintValidatorFactoryInterface $validatorFactory The factory for creating + * constraint validators + * @param ObjectInitializerInterface[] $objectInitializers The object initializers */ - public function __construct(ExecutionContextFactoryInterface $contextFactory, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = []) + public function __construct(ExecutionContextFactoryInterface $contextFactory, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, array $objectInitializers = array()) { $this->contextFactory = $contextFactory; $this->metadataFactory = $metadataFactory; @@ -87,8 +98,21 @@ public function hasMetadataFor($object) /** * {@inheritdoc} */ - public function validate($value, $constraints = null, $groups = null) + public function validate($value, $groups = null, $traverse = false, $deep = false) { + $numArgs = \func_num_args(); + + // Use new signature if constraints are given in the second argument + if (self::testConstraints($groups) && ($numArgs < 3 || 3 === $numArgs && self::testGroups($traverse))) { + // Rename to avoid total confusion ;) + $constraints = $groups; + $groups = $traverse; + } else { + @trigger_error('The Symfony\Component\Validator\ValidatorInterface::validate method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::validate method instead.', E_USER_DEPRECATED); + + $constraints = new Valid(array('traverse' => $traverse, 'deep' => $deep)); + } + return $this->startContext($value) ->validate($value, $constraints, $groups) ->getViolations(); @@ -97,7 +121,7 @@ public function validate($value, $constraints = null, $groups = null) /** * {@inheritdoc} */ - public function validateProperty(object $object, string $propertyName, $groups = null) + public function validateProperty($object, $propertyName, $groups = null) { return $this->startContext($object) ->validateProperty($object, $propertyName, $groups) @@ -107,11 +131,41 @@ public function validateProperty(object $object, string $propertyName, $groups = /** * {@inheritdoc} */ - public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) + public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null) { // If a class name is passed, take $value as root return $this->startContext(\is_object($objectOrClass) ? $objectOrClass : $value) ->validatePropertyValue($objectOrClass, $propertyName, $value, $groups) ->getViolations(); } + + /** + * {@inheritdoc} + */ + public function validateValue($value, $constraints, $groups = null) + { + @trigger_error('The '.__METHOD__.' method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::validate method instead.', E_USER_DEPRECATED); + + return $this->validate($value, $constraints, $groups); + } + + /** + * {@inheritdoc} + */ + public function getMetadataFactory() + { + @trigger_error('The '.__METHOD__.' method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::getMetadataFor or Symfony\Component\Validator\Validator\ValidatorInterface::hasMetadataFor method instead.', E_USER_DEPRECATED); + + return $this->metadataFactory; + } + + private static function testConstraints($constraints) + { + return null === $constraints || $constraints instanceof Constraint || (\is_array($constraints) && (0 === \count($constraints) || current($constraints) instanceof Constraint)); + } + + private static function testGroups($groups) + { + return null === $groups || \is_string($groups) || $groups instanceof GroupSequence || (\is_array($groups) && (0 === \count($groups) || \is_string(current($groups)) || current($groups) instanceof GroupSequence)); + } } diff --git a/upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php b/upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php deleted file mode 100644 index 8c1d966f2b4..00000000000 --- a/upload/system/storage/vendor/symfony/validator/Validator/TraceableValidator.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Validator\Validator; - -use Symfony\Component\Validator\Context\ExecutionContextInterface; -use Symfony\Contracts\Service\ResetInterface; - -/** - * Collects some data about validator calls. - * - * @author Maxime Steinhausser - */ -class TraceableValidator implements ValidatorInterface, ResetInterface -{ - private $validator; - private $collectedData = []; - - public function __construct(ValidatorInterface $validator) - { - $this->validator = $validator; - } - - /** - * @return array - */ - public function getCollectedData() - { - return $this->collectedData; - } - - public function reset() - { - $this->collectedData = []; - } - - /** - * {@inheritdoc} - */ - public function getMetadataFor($value) - { - return $this->validator->getMetadataFor($value); - } - - /** - * {@inheritdoc} - */ - public function hasMetadataFor($value) - { - return $this->validator->hasMetadataFor($value); - } - - /** - * {@inheritdoc} - */ - public function validate($value, $constraints = null, $groups = null) - { - $violations = $this->validator->validate($value, $constraints, $groups); - - $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 7); - - $file = $trace[0]['file']; - $line = $trace[0]['line']; - - for ($i = 1; $i < 7; ++$i) { - if (isset($trace[$i]['class'], $trace[$i]['function']) - && 'validate' === $trace[$i]['function'] - && is_a($trace[$i]['class'], ValidatorInterface::class, true) - ) { - $file = $trace[$i]['file']; - $line = $trace[$i]['line']; - - while (++$i < 7) { - if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && !str_starts_with($trace[$i]['function'], 'call_user_func')) { - $file = $trace[$i]['file']; - $line = $trace[$i]['line']; - - break; - } - } - break; - } - } - - $name = str_replace('\\', '/', $file); - $name = substr($name, strrpos($name, '/') + 1); - - $this->collectedData[] = [ - 'caller' => compact('name', 'file', 'line'), - 'context' => compact('value', 'constraints', 'groups'), - 'violations' => iterator_to_array($violations), - ]; - - return $violations; - } - - /** - * {@inheritdoc} - */ - public function validateProperty(object $object, string $propertyName, $groups = null) - { - return $this->validator->validateProperty($object, $propertyName, $groups); - } - - /** - * {@inheritdoc} - */ - public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) - { - return $this->validator->validatePropertyValue($objectOrClass, $propertyName, $value, $groups); - } - - /** - * {@inheritdoc} - */ - public function startContext() - { - return $this->validator->startContext(); - } - - /** - * {@inheritdoc} - */ - public function inContext(ExecutionContextInterface $context) - { - return $this->validator->inContext($context); - } -} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php b/upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php index e6aa7d7f7bc..78157465ab5 100644 --- a/upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Validator/ValidatorInterface.php @@ -30,9 +30,9 @@ interface ValidatorInterface extends MetadataFactoryInterface * If no constraint is passed, the constraint * {@link \Symfony\Component\Validator\Constraints\Valid} is assumed. * - * @param mixed $value The value to validate - * @param Constraint|Constraint[] $constraints The constraint(s) to validate against - * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * @param mixed $value The value to validate + * @param Constraint|Constraint[] $constraints The constraint(s) to validate against + * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed * * @return ConstraintViolationListInterface A list of constraint violations * If the list is empty, validation @@ -44,29 +44,30 @@ public function validate($value, $constraints = null, $groups = null); * Validates a property of an object against the constraints specified * for this property. * - * @param string $propertyName The name of the validated property - * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * @param object $object The object + * @param string $propertyName The name of the validated property + * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed * * @return ConstraintViolationListInterface A list of constraint violations * If the list is empty, validation * succeeded */ - public function validateProperty(object $object, string $propertyName, $groups = null); + public function validateProperty($object, $propertyName, $groups = null); /** * Validates a value against the constraints specified for an object's * property. * - * @param object|string $objectOrClass The object or its class name - * @param string $propertyName The name of the property - * @param mixed $value The value to validate against the property's constraints - * @param string|GroupSequence|array|null $groups The validation groups to validate. If none is given, "Default" is assumed + * @param object|string $objectOrClass The object or its class name + * @param string $propertyName The name of the property + * @param mixed $value The value to validate against the property's constraints + * @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed * * @return ConstraintViolationListInterface A list of constraint violations * If the list is empty, validation * succeeded */ - public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null); + public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null); /** * Starts a new validation context and returns a validator for that context. @@ -75,7 +76,7 @@ public function validatePropertyValue($objectOrClass, string $propertyName, $val * context. You can access these violations with the * {@link ContextualValidatorInterface::getViolations()} method. * - * @return ContextualValidatorInterface + * @return ContextualValidatorInterface The validator for the new context */ public function startContext(); @@ -85,7 +86,7 @@ public function startContext(); * The returned validator adds all generated violations to the given * context. * - * @return ContextualValidatorInterface + * @return ContextualValidatorInterface The validator for that context */ public function inContext(ExecutionContextInterface $context); } diff --git a/upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php b/upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php index 8df048bd670..c99de8cc790 100644 --- a/upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php +++ b/upload/system/storage/vendor/symfony/validator/ValidatorBuilder.php @@ -13,49 +13,41 @@ use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\CachedReader; -use Doctrine\Common\Annotations\PsrCachedReader; use Doctrine\Common\Annotations\Reader; use Doctrine\Common\Cache\ArrayCache; -use Psr\Cache\CacheItemPoolInterface; -use Symfony\Component\Cache\Adapter\ArrayAdapter; +use Symfony\Component\PropertyAccess\PropertyAccessorInterface; +use Symfony\Component\Translation\IdentityTranslator; +use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Context\ExecutionContextFactory; -use Symfony\Component\Validator\Exception\LogicException; +use Symfony\Component\Validator\Exception\InvalidArgumentException; use Symfony\Component\Validator\Exception\ValidatorException; +use Symfony\Component\Validator\Mapping\Cache\CacheInterface; use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; -use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface; use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader; use Symfony\Component\Validator\Mapping\Loader\LoaderChain; -use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; use Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader; use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader; +use Symfony\Component\Validator\Mapping\Loader\XmlFilesLoader; use Symfony\Component\Validator\Mapping\Loader\YamlFileLoader; +use Symfony\Component\Validator\Mapping\Loader\YamlFilesLoader; use Symfony\Component\Validator\Validator\RecursiveValidator; -use Symfony\Component\Validator\Validator\ValidatorInterface; -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatorInterface; -use Symfony\Contracts\Translation\TranslatorTrait; - -// Help opcache.preload discover always-needed symbols -class_exists(TranslatorInterface::class); -class_exists(LocaleAwareInterface::class); -class_exists(TranslatorTrait::class); /** + * The default implementation of {@link ValidatorBuilderInterface}. + * * @author Bernhard Schussek */ -class ValidatorBuilder +class ValidatorBuilder implements ValidatorBuilderInterface { - private $initializers = []; - private $loaders = []; - private $xmlMappings = []; - private $yamlMappings = []; - private $methodMappings = []; + private $initializers = array(); + private $xmlMappings = array(); + private $yamlMappings = array(); + private $methodMappings = array(); /** * @var Reader|null */ private $annotationReader; - private $enableAnnotationMapping = false; /** * @var MetadataFactoryInterface|null @@ -68,9 +60,9 @@ class ValidatorBuilder private $validatorFactory; /** - * @var CacheItemPoolInterface|null + * @var CacheInterface|null */ - private $mappingCache; + private $metadataCache; /** * @var TranslatorInterface|null @@ -83,9 +75,12 @@ class ValidatorBuilder private $translationDomain; /** - * Adds an object initializer to the validator. - * - * @return $this + * @var PropertyAccessorInterface|null + */ + private $propertyAccessor; + + /** + * {@inheritdoc} */ public function addObjectInitializer(ObjectInitializerInterface $initializer) { @@ -95,11 +90,7 @@ public function addObjectInitializer(ObjectInitializerInterface $initializer) } /** - * Adds a list of object initializers to the validator. - * - * @param ObjectInitializerInterface[] $initializers - * - * @return $this + * {@inheritdoc} */ public function addObjectInitializers(array $initializers) { @@ -109,11 +100,9 @@ public function addObjectInitializers(array $initializers) } /** - * Adds an XML constraint mapping file to the validator. - * - * @return $this + * {@inheritdoc} */ - public function addXmlMapping(string $path) + public function addXmlMapping($path) { if (null !== $this->metadataFactory) { throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); @@ -125,11 +114,7 @@ public function addXmlMapping(string $path) } /** - * Adds a list of XML constraint mapping files to the validator. - * - * @param string[] $paths The paths to the mapping files - * - * @return $this + * {@inheritdoc} */ public function addXmlMappings(array $paths) { @@ -143,13 +128,9 @@ public function addXmlMappings(array $paths) } /** - * Adds a YAML constraint mapping file to the validator. - * - * @param string $path The path to the mapping file - * - * @return $this + * {@inheritdoc} */ - public function addYamlMapping(string $path) + public function addYamlMapping($path) { if (null !== $this->metadataFactory) { throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); @@ -161,11 +142,7 @@ public function addYamlMapping(string $path) } /** - * Adds a list of YAML constraint mappings file to the validator. - * - * @param string[] $paths The paths to the mapping files - * - * @return $this + * {@inheritdoc} */ public function addYamlMappings(array $paths) { @@ -179,11 +156,9 @@ public function addYamlMappings(array $paths) } /** - * Enables constraint mapping using the given static method. - * - * @return $this + * {@inheritdoc} */ - public function addMethodMapping(string $methodName) + public function addMethodMapping($methodName) { if (null !== $this->metadataFactory) { throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.'); @@ -195,11 +170,7 @@ public function addMethodMapping(string $methodName) } /** - * Enables constraint mapping using the given static methods. - * - * @param string[] $methodNames The names of the methods - * - * @return $this + * {@inheritdoc} */ public function addMethodMappings(array $methodNames) { @@ -213,75 +184,43 @@ public function addMethodMappings(array $methodNames) } /** - * Enables annotation based constraint mapping. - * - * @param bool $skipDoctrineAnnotations - * - * @return $this + * {@inheritdoc} */ - public function enableAnnotationMapping(/* bool $skipDoctrineAnnotations = true */) + public function enableAnnotationMapping(Reader $annotationReader = null) { if (null !== $this->metadataFactory) { throw new ValidatorException('You cannot enable annotation mapping after setting a custom metadata factory. Configure your metadata factory instead.'); } - $skipDoctrineAnnotations = 1 > \func_num_args() ? false : func_get_arg(0); - if (false === $skipDoctrineAnnotations || null === $skipDoctrineAnnotations) { - trigger_deprecation('symfony/validator', '5.2', 'Not passing true as first argument to "%s" is deprecated. Pass true and call "addDefaultDoctrineAnnotationReader()" if you want to enable annotation mapping with Doctrine Annotations.', __METHOD__); - $this->addDefaultDoctrineAnnotationReader(); - } elseif ($skipDoctrineAnnotations instanceof Reader) { - trigger_deprecation('symfony/validator', '5.2', 'Passing an instance of "%s" as first argument to "%s" is deprecated. Pass true instead and call setDoctrineAnnotationReader() if you want to enable annotation mapping with Doctrine Annotations.', get_debug_type($skipDoctrineAnnotations), __METHOD__); - $this->setDoctrineAnnotationReader($skipDoctrineAnnotations); - } elseif (true !== $skipDoctrineAnnotations) { - throw new \TypeError(sprintf('"%s": Argument 1 is expected to be a boolean, "%s" given.', __METHOD__, get_debug_type($skipDoctrineAnnotations))); + if (null === $annotationReader) { + if (!class_exists('Doctrine\Common\Annotations\AnnotationReader') || !class_exists('Doctrine\Common\Cache\ArrayCache')) { + throw new \RuntimeException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and doctrine/cache to be installed.'); + } + + $annotationReader = new CachedReader(new AnnotationReader(), new ArrayCache()); } - $this->enableAnnotationMapping = true; + $this->annotationReader = $annotationReader; return $this; } /** - * Disables annotation based constraint mapping. - * - * @return $this + * {@inheritdoc} */ public function disableAnnotationMapping() { - $this->enableAnnotationMapping = false; $this->annotationReader = null; return $this; } /** - * @return $this - */ - public function setDoctrineAnnotationReader(?Reader $reader): self - { - $this->annotationReader = $reader; - - return $this; - } - - /** - * @return $this - */ - public function addDefaultDoctrineAnnotationReader(): self - { - $this->annotationReader = $this->createAnnotationReader(); - - return $this; - } - - /** - * Sets the class metadata factory used by the validator. - * - * @return $this + * {@inheritdoc} */ public function setMetadataFactory(MetadataFactoryInterface $metadataFactory) { - if (\count($this->xmlMappings) > 0 || \count($this->yamlMappings) > 0 || \count($this->methodMappings) > 0 || $this->enableAnnotationMapping) { + if (\count($this->xmlMappings) > 0 || \count($this->yamlMappings) > 0 || \count($this->methodMappings) > 0 || null !== $this->annotationReader) { throw new ValidatorException('You cannot set a custom metadata factory after adding custom mappings. You should do either of both.'); } @@ -291,37 +230,35 @@ public function setMetadataFactory(MetadataFactoryInterface $metadataFactory) } /** - * Sets the cache for caching class metadata. - * - * @return $this + * {@inheritdoc} */ - public function setMappingCache(CacheItemPoolInterface $cache) + public function setMetadataCache(CacheInterface $cache) { if (null !== $this->metadataFactory) { - throw new ValidatorException('You cannot set a custom mapping cache after setting a custom metadata factory. Configure your metadata factory instead.'); + throw new ValidatorException('You cannot set a custom metadata cache after setting a custom metadata factory. Configure your metadata factory instead.'); } - $this->mappingCache = $cache; + $this->metadataCache = $cache; return $this; } /** - * Sets the constraint validator factory used by the validator. - * - * @return $this + * {@inheritdoc} */ public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory) { + if (null !== $this->propertyAccessor) { + throw new ValidatorException('You cannot set a validator factory after setting a custom property accessor. Remove the call to setPropertyAccessor() if you want to call setConstraintValidatorFactory().'); + } + $this->validatorFactory = $validatorFactory; return $this; } /** - * Sets the translator used for translating violation messages. - * - * @return $this + * {@inheritdoc} */ public function setTranslator(TranslatorInterface $translator) { @@ -331,15 +268,9 @@ public function setTranslator(TranslatorInterface $translator) } /** - * Sets the default translation domain of violation messages. - * - * The same message can have different translations in different domains. - * Pass the domain that is used for violation messages by default to this - * method. - * - * @return $this + * {@inheritdoc} */ - public function setTranslationDomain(?string $translationDomain) + public function setTranslationDomain($translationDomain) { $this->translationDomain = $translationDomain; @@ -347,52 +278,70 @@ public function setTranslationDomain(?string $translationDomain) } /** - * @return $this + * {@inheritdoc} + * + * @deprecated since version 2.5, to be removed in 3.0. + * The validator will function without a property accessor. */ - public function addLoader(LoaderInterface $loader) + public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor) { - $this->loaders[] = $loader; + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0. The validator will function without a property accessor.', E_USER_DEPRECATED); + + if (null !== $this->validatorFactory) { + throw new ValidatorException('You cannot set a property accessor after setting a custom validator factory. Configure your validator factory instead.'); + } + + $this->propertyAccessor = $propertyAccessor; return $this; } /** - * @return LoaderInterface[] + * {@inheritdoc} + * + * @deprecated since version 2.7, to be removed in 3.0. */ - public function getLoaders() + public function setApiVersion($apiVersion) { - $loaders = []; - - foreach ($this->xmlMappings as $xmlMapping) { - $loaders[] = new XmlFileLoader($xmlMapping); - } - - foreach ($this->yamlMappings as $yamlMappings) { - $loaders[] = new YamlFileLoader($yamlMappings); - } + @trigger_error('The '.__METHOD__.' method is deprecated in version 2.7 and will be removed in version 3.0.', E_USER_DEPRECATED); - foreach ($this->methodMappings as $methodName) { - $loaders[] = new StaticMethodLoader($methodName); + if (!\in_array($apiVersion, array(Validation::API_VERSION_2_4, Validation::API_VERSION_2_5, Validation::API_VERSION_2_5_BC))) { + throw new InvalidArgumentException(sprintf('The requested API version is invalid: "%s"', $apiVersion)); } - if ($this->enableAnnotationMapping) { - $loaders[] = new AnnotationLoader($this->annotationReader); - } - - return array_merge($loaders, $this->loaders); + return $this; } /** - * Builds and returns a new validator object. - * - * @return ValidatorInterface + * {@inheritdoc} */ public function getValidator() { $metadataFactory = $this->metadataFactory; if (!$metadataFactory) { - $loaders = $this->getLoaders(); + $loaders = array(); + + if (\count($this->xmlMappings) > 1) { + $loaders[] = new XmlFilesLoader($this->xmlMappings); + } elseif (1 === \count($this->xmlMappings)) { + $loaders[] = new XmlFileLoader($this->xmlMappings[0]); + } + + if (\count($this->yamlMappings) > 1) { + $loaders[] = new YamlFilesLoader($this->yamlMappings); + } elseif (1 === \count($this->yamlMappings)) { + $loaders[] = new YamlFileLoader($this->yamlMappings[0]); + } + + foreach ($this->methodMappings as $methodName) { + $loaders[] = new StaticMethodLoader($methodName); + } + + if ($this->annotationReader) { + $loaders[] = new AnnotationLoader($this->annotationReader); + } + $loader = null; if (\count($loaders) > 1) { @@ -401,16 +350,14 @@ public function getValidator() $loader = $loaders[0]; } - $metadataFactory = new LazyLoadingMetadataFactory($loader, $this->mappingCache); + $metadataFactory = new LazyLoadingMetadataFactory($loader, $this->metadataCache); } - $validatorFactory = $this->validatorFactory ?? new ConstraintValidatorFactory(); + $validatorFactory = $this->validatorFactory ?: new ConstraintValidatorFactory($this->propertyAccessor); $translator = $this->translator; if (null === $translator) { - $translator = new class() implements TranslatorInterface, LocaleAwareInterface { - use TranslatorTrait; - }; + $translator = new IdentityTranslator(); // Force the locale to be 'en' when no translator is provided rather than relying on the Intl default locale // This avoids depending on Intl or the stub implementation being available. It also ensures that Symfony // validation messages are pluralized properly even when the default locale gets changed because they are in @@ -422,23 +369,4 @@ public function getValidator() return new RecursiveValidator($contextFactory, $metadataFactory, $validatorFactory, $this->initializers); } - - private function createAnnotationReader(): Reader - { - if (!class_exists(AnnotationReader::class)) { - throw new LogicException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and symfony/cache to be installed.'); - } - - if (class_exists(ArrayAdapter::class)) { - return new PsrCachedReader(new AnnotationReader(), new ArrayAdapter()); - } - - if (class_exists(CachedReader::class) && class_exists(ArrayCache::class)) { - trigger_deprecation('symfony/validator', '5.4', 'Enabling annotation based constraint mapping without having symfony/cache installed is deprecated.'); - - return new CachedReader(new AnnotationReader(), new ArrayCache()); - } - - throw new LogicException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and symfony/cache to be installed.'); - } } diff --git a/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php index 9e198c6da85..284841e2eb3 100644 --- a/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php +++ b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilder.php @@ -11,18 +11,19 @@ namespace Symfony\Component\Validator\Violation; +use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\Util\PropertyPath; -use Symfony\Contracts\Translation\TranslatorInterface; /** * Default implementation of {@link ConstraintViolationBuilderInterface}. * * @author Bernhard Schussek * - * @internal since version 2.5. Code against ConstraintViolationBuilderInterface instead. + * @internal You should not instantiate or use this class. Code against + * {@link ConstraintViolationBuilderInterface} instead. */ class ConstraintViolationBuilder implements ConstraintViolationBuilderInterface { @@ -43,10 +44,7 @@ class ConstraintViolationBuilder implements ConstraintViolationBuilderInterface */ private $cause; - /** - * @param string $message The error message as a string or a stringable object - */ - public function __construct(ConstraintViolationList $violations, ?Constraint $constraint, $message, array $parameters, $root, $propertyPath, $invalidValue, TranslatorInterface $translator, $translationDomain = null) + public function __construct(ConstraintViolationList $violations, Constraint $constraint, $message, array $parameters, $root, $propertyPath, $invalidValue, TranslatorInterface $translator, $translationDomain = null) { $this->violations = $violations; $this->message = $message; @@ -62,7 +60,7 @@ public function __construct(ConstraintViolationList $violations, ?Constraint $co /** * {@inheritdoc} */ - public function atPath(string $path) + public function atPath($path) { $this->propertyPath = PropertyPath::append($this->propertyPath, $path); @@ -72,7 +70,7 @@ public function atPath(string $path) /** * {@inheritdoc} */ - public function setParameter(string $key, string $value) + public function setParameter($key, $value) { $this->parameters[$key] = $value; @@ -92,7 +90,7 @@ public function setParameters(array $parameters) /** * {@inheritdoc} */ - public function setTranslationDomain(string $translationDomain) + public function setTranslationDomain($translationDomain) { $this->translationDomain = $translationDomain; @@ -112,7 +110,7 @@ public function setInvalidValue($invalidValue) /** * {@inheritdoc} */ - public function setPlural(int $number) + public function setPlural($number) { $this->plural = $number; @@ -122,7 +120,7 @@ public function setPlural(int $number) /** * {@inheritdoc} */ - public function setCode(?string $code) + public function setCode($code) { $this->code = $code; @@ -151,11 +149,20 @@ public function addViolation() $this->translationDomain ); } else { - $translatedMessage = $this->translator->trans( - $this->message, - ['%count%' => $this->plural] + $this->parameters, - $this->translationDomain - ); + try { + $translatedMessage = $this->translator->transChoice( + $this->message, + $this->plural, + $this->parameters, + $this->translationDomain + ); + } catch (\InvalidArgumentException $e) { + $translatedMessage = $this->translator->trans( + $this->message, + $this->parameters, + $this->translationDomain + ); + } } $this->violations->add(new ConstraintViolation( diff --git a/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php index 9ac1b8b4c47..811b4842e88 100644 --- a/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php +++ b/upload/system/storage/vendor/symfony/validator/Violation/ConstraintViolationBuilderInterface.php @@ -33,7 +33,7 @@ interface ConstraintViolationBuilderInterface * * @return $this */ - public function atPath(string $path); + public function atPath($path); /** * Sets a parameter to be inserted into the violation message. @@ -43,7 +43,7 @@ public function atPath(string $path); * * @return $this */ - public function setParameter(string $key, string $value); + public function setParameter($key, $value); /** * Sets all parameters to be inserted into the violation message. @@ -64,9 +64,9 @@ public function setParameters(array $parameters); * * @return $this * - * @see \Symfony\Contracts\Translation\TranslatorInterface + * @see \Symfony\Component\Translation\TranslatorInterface */ - public function setTranslationDomain(string $translationDomain); + public function setTranslationDomain($translationDomain); /** * Sets the invalid value that caused this violation. @@ -85,9 +85,9 @@ public function setInvalidValue($invalidValue); * * @return $this * - * @see \Symfony\Contracts\Translation\TranslatorInterface::trans() + * @see \Symfony\Component\Translation\TranslatorInterface::transChoice() */ - public function setPlural(int $number); + public function setPlural($number); /** * Sets the violation code. @@ -96,7 +96,7 @@ public function setPlural(int $number); * * @return $this */ - public function setCode(?string $code); + public function setCode($code); /** * Sets the cause of the violation. diff --git a/upload/system/storage/vendor/symfony/validator/composer.json b/upload/system/storage/vendor/symfony/validator/composer.json index 0ce4d0d2a43..99ccc33023d 100644 --- a/upload/system/storage/vendor/symfony/validator/composer.json +++ b/upload/system/storage/vendor/symfony/validator/composer.json @@ -1,7 +1,7 @@ { "name": "symfony/validator", "type": "library", - "description": "Provides tools to validate values", + "description": "Symfony Validator Component", "keywords": [], "homepage": "https://symfony.com", "license": "MIT", @@ -16,59 +16,32 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=5.3.9", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/translation-contracts": "^1.1|^2|^3" + "symfony/translation": "~2.4|~3.0.0" }, "require-dev": { - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^5.1|^6.0", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.0|^6.0", - "symfony/property-info": "^5.3|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "doctrine/annotations": "^1.13", - "doctrine/cache": "^1.11|^2.0", - "egulias/email-validator": "^2.1.10|^3" - }, - "conflict": { - "doctrine/annotations": "<1.13", - "doctrine/cache": "<1.11", - "doctrine/lexer": "<1.1", - "phpunit/phpunit": "<5.4.3", - "symfony/dependency-injection": "<4.4", - "symfony/expression-language": "<5.1", - "symfony/http-kernel": "<4.4", - "symfony/intl": "<4.4", - "symfony/property-info": "<5.3", - "symfony/translation": "<4.4", - "symfony/yaml": "<4.4" + "symfony/http-foundation": "~2.3|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/yaml": "^2.0.5|~3.0.0", + "symfony/config": "~2.2|~3.0.0", + "symfony/property-access": "~2.3|~3.0.0", + "symfony/expression-language": "~2.4|~3.0.0", + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.1" }, "suggest": { - "psr/cache-implementation": "For using the mapping cache.", + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", "symfony/http-foundation": "", "symfony/intl": "", - "symfony/translation": "For translating validation errors.", "symfony/yaml": "", "symfony/config": "", "egulias/email-validator": "Strict (RFC compliant) email validation", - "symfony/property-access": "For accessing properties within comparison constraints", - "symfony/property-info": "To automatically add NotNull and Type constraints", - "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints" + "symfony/property-access": "For using the 2.4 Validator API", + "symfony/expression-language": "For using the 2.4 Expression validator" }, "autoload": { "psr-4": { "Symfony\\Component\\Validator\\": "" }, @@ -76,5 +49,10 @@ "/Tests/" ] }, - "minimum-stability": "dev" + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + } } From 7be9108cc82e53f3fb12c73502fc6b6282787095 Mon Sep 17 00:00:00 2001 From: mhcwebdesign Date: Wed, 9 Mar 2022 13:58:25 +0000 Subject: [PATCH 39/39] Support for PHP 8.0 and 8.1 --- .../braintree_php/.github/ISSUE_TEMPLATE.md | 9 + .../.github/PULL_REQUEST_TEMPLATE.md | 6 + .../vendor/braintree/braintree_php/.gitignore | 7 + .../braintree_php/ACKNOWLEDGEMENTS.md | 6 + .../vendor/braintree/braintree_php/Dockerfile | 14 + .../vendor/braintree/braintree_php/Makefile | 10 + .../vendor/braintree/braintree_php/Rakefile | 81 + .../vendor/braintree/braintree_php/ci.sh | 11 + .../lib/Braintree/AmexExpressCheckoutCard.php | 80 + .../lib/Braintree/AndroidPayCard.php | 90 + .../lib/Braintree/CoinbaseAccount.php | 110 + .../lib/Braintree/EuropeBankAccount.php | 67 + .../Exception/DownForMaintenance.php | 16 + .../Braintree/Exception/ForgedQueryString.php | 20 + .../lib/Braintree/IbanBankAccount.php | 57 + .../lib/Braintree/IdealPayment.php | 92 + .../lib/Braintree/IdealPaymentGateway.php | 104 + .../lib/Braintree/MasterpassCard.php | 141 + .../AmexExpressCheckoutCardDetails.php | 43 + .../Transaction/AndroidPayCardDetails.php | 47 + .../Braintree/Transaction/CoinbaseDetails.php | 38 + .../Transaction/EuropeBankAccountDetails.php | 24 + .../Transaction/IdealPaymentDetails.php | 23 + .../lib/Braintree/Transaction/LineItem.php | 4 + .../Transaction/MasterpassCardDetails.php | 52 + .../lib/Braintree/TransparentRedirect.php | 100 + .../Braintree/TransparentRedirectGateway.php | 289 + .../braintree/braintree_php/phpunit.xml.dist | 24 + .../tests/Braintree/CreditCardDefaults.php | 8 + .../CreditCardNumbers/CardTypeIndicators.php | 15 + .../tests/Braintree/OAuthTestHelper.php | 35 + .../braintree/braintree_php/tests/Helper.php | 344 + .../braintree_php/tests/SanityTest.php | 20 + .../braintree/braintree_php/tests/Setup.php | 32 + .../braintree_php/tests/fixtures/bt_logo.png | Bin 0 -> 2443 bytes .../tests/fixtures/gif_extension_bt_logo.gif | Bin 0 -> 2443 bytes .../tests/fixtures/malformed_pdf.pdf | Bin 0 -> 150 bytes .../braintree_php/tests/fixtures/too_long.pdf | Bin 0 -> 79008 bytes .../tests/integration/AddOnsTest.php | 88 + .../tests/integration/AddressTest.php | 311 + .../tests/integration/ApplePayTest.php | 83 + .../tests/integration/ClientTokenTest.php | 189 + .../tests/integration/CreditCardTest.php | 1403 ++++ ...editCardVerificationAdvancedSearchTest.php | 259 + .../CreditCardVerificationTest.php | 136 + .../CustomerAdvancedSearchTest.php | 199 + .../tests/integration/CustomerTest.php | 1886 +++++ .../tests/integration/DisbursementTest.php | 39 + .../tests/integration/DiscountTest.php | 88 + .../tests/integration/DisputeSearchTest.php | 122 + .../tests/integration/DisputeTest.php | 412 ++ .../tests/integration/DocumentUploadTest.php | 122 + .../integration/Error/ErrorCollectionTest.php | 96 + .../Error/ValidationErrorCollectionTest.php | 75 + .../tests/integration/GraphQLTest.php | 86 + .../tests/integration/HttpClientApi.php | 105 + .../tests/integration/HttpTest.php | 164 + .../tests/integration/IdealPaymentTest.php | 93 + .../tests/integration/MasterpassCardTest.php | 128 + .../tests/integration/MerchantAccountTest.php | 631 ++ .../tests/integration/MerchantTest.php | 257 + .../integration/MultipleValueNodeTest.php | 94 + .../tests/integration/OAuthTest.php | 323 + .../tests/integration/PayPalAccountTest.php | 309 + .../integration/PaymentMethodNonceTest.php | 184 + .../tests/integration/PaymentMethodTest.php | 1881 +++++ .../PaymentMethodWithUsBankAccountTest.php | 147 + .../tests/integration/PlanTest.php | 132 + .../tests/integration/Result/ErrorTest.php | 33 + .../tests/integration/SamsungPayCardTest.php | 190 + .../SettlementBatchSummaryTest.php | 95 + .../tests/integration/SubscriptionHelper.php | 86 + .../integration/SubscriptionSearchTest.php | 479 ++ .../tests/integration/SubscriptionTest.php | 1312 ++++ .../tests/integration/TestTransactionTest.php | 101 + .../tests/integration/TextNodeTest.php | 147 + .../TransactionAdvancedSearchTest.php | 1581 +++++ .../integration/TransactionLineItemTest.php | 42 + .../tests/integration/TransactionTest.php | 6135 +++++++++++++++++ .../TransactionWithUsBankAccountTest.php | 268 + .../integration/TransparentRedirectTest.php | 354 + .../tests/integration/UsBankAccountTest.php | 104 + .../UsBankAccountVerificationTest.php | 233 + .../integration/VisaCheckoutCardTest.php | 151 + .../braintree_php/tests/unit/AddOnTest.php | 34 + .../braintree_php/tests/unit/AddressTest.php | 79 + .../unit/AuthorizationAdjustmentTest.php | 32 + .../tests/unit/BraintreeTest.php | 25 + .../tests/unit/ClientApi/ClientTokenTest.php | 22 + .../tests/unit/ConfigurationTest.php | 529 ++ .../tests/unit/CreditCardTest.php | 151 + .../tests/unit/CreditCardVerificationTest.php | 22 + .../braintree_php/tests/unit/CustomerTest.php | 61 + .../braintree_php/tests/unit/DigestTest.php | 97 + .../tests/unit/DisbursementDetailsTest.php | 29 + .../tests/unit/DisbursementTest.php | 86 + .../braintree_php/tests/unit/DiscountTest.php | 34 + .../braintree_php/tests/unit/DisputeTest.php | 428 ++ .../tests/unit/DocumentUploadTest.php | 20 + .../tests/unit/EndsWithNodeTest.php | 17 + .../braintree_php/tests/unit/GatewayTest.php | 51 + .../braintree_php/tests/unit/HttpTest.php | 60 + .../braintree_php/tests/unit/InstanceTest.php | 37 + .../tests/unit/MerchantAccountTest.php | 67 + .../tests/unit/MultipleValueNodeTest.php | 24 + .../unit/MultipleValueOrTextNodeTest.php | 52 + .../tests/unit/OAuthAccessRevocationTest.php | 19 + .../braintree_php/tests/unit/OAuthTest.php | 71 + .../tests/unit/PaginatedCollectionTest.php | 106 + .../tests/unit/PayPalAccountTest.php | 44 + .../tests/unit/PaymentMethodTest.php | 121 + .../tests/unit/RangeNodeTest.php | 38 + .../tests/unit/ResourceCollectionTest.php | 132 + .../tests/unit/Result/ErrorTest.php | 16 + .../tests/unit/Result/SuccessfulTest.php | 21 + .../braintree_php/tests/unit/SanityTest.php | 19 + .../tests/unit/SubscriptionSearchTest.php | 70 + .../tests/unit/SubscriptionTest.php | 22 + .../braintree_php/tests/unit/TextNodeTest.php | 45 + .../tests/unit/TransactionLineItemTest.php | 26 + .../tests/unit/TransactionTest.php | 120 + .../tests/unit/TransparentRedirectTest.php | 31 + .../tests/unit/UnknownPaymentMethodTest.php | 25 + .../tests/unit/UsBankAccountTest.php | 48 + .../unit/UsBankAccountVerificationTest.php | 34 + .../braintree_php/tests/unit/UtilTest.php | 452 ++ .../tests/unit/WebhookNotificationTest.php | 920 +++ .../tests/unit/Xml_GeneratorTest.php | 134 + .../tests/unit/Xml_ParserTest.php | 542 ++ .../spec/Method/Void/CreateSpec.php | 68 + .../spec/Method/Void/GetAllSpec.php | 58 + .../spec/Method/Void/GetSpec.php | 64 + .../spec/Method/Void/VoidSpec.php | 19 + .../src/Method/Void/Create.php | 56 + .../cardinity-sdk-php/src/Method/Void/Get.php | 57 + .../src/Method/Void/GetAll.php | 50 + .../src/Method/Void/Void.php | 221 + .../cardinity-sdk-php/tests/VoidTest.php | 105 + .../vendor/composer/InstalledVersions.php | 350 + .../storage/vendor/composer/installed.php | 185 + .../vendor/composer/platform_check.php | 26 + .../vendor/guzzlehttp/guzzle/.travis.yml | 52 + .../guzzlehttp/guzzle/src/BatchResults.php | 148 + .../guzzlehttp/guzzle/src/Collection.php | 236 + .../guzzle/src/Event/AbstractEvent.php | 20 + .../guzzle/src/Event/AbstractRequestEvent.php | 61 + .../src/Event/AbstractRetryableEvent.php | 40 + .../src/Event/AbstractTransferEvent.php | 63 + .../guzzle/src/Event/BeforeEvent.php | 26 + .../guzzle/src/Event/CompleteEvent.php | 14 + .../guzzlehttp/guzzle/src/Event/Emitter.php | 145 + .../guzzle/src/Event/EmitterInterface.php | 96 + .../guzzlehttp/guzzle/src/Event/EndEvent.php | 28 + .../guzzle/src/Event/ErrorEvent.php | 27 + .../guzzle/src/Event/EventInterface.php | 23 + .../guzzle/src/Event/HasEmitterInterface.php | 15 + .../guzzle/src/Event/HasEmitterTrait.php | 20 + .../src/Event/ListenerAttacherTrait.php | 88 + .../guzzle/src/Event/ProgressEvent.php | 51 + .../guzzle/src/Event/RequestEvents.php | 56 + .../guzzle/src/Event/SubscriberInterface.php | 34 + .../CouldNotRewindStreamException.php | 4 + .../guzzle/src/Exception/ParseException.php | 31 + .../guzzle/src/Exception/StateException.php | 4 + .../src/Exception/XmlParseException.php | 34 + .../guzzlehttp/guzzle/src/HasDataTrait.php | 75 + .../guzzle/src/Message/AbstractMessage.php | 253 + .../src/Message/AppliesHeadersInterface.php | 24 + .../guzzle/src/Message/FutureResponse.php | 158 + .../guzzle/src/Message/MessageFactory.php | 364 + .../src/Message/MessageFactoryInterface.php | 71 + .../guzzle/src/Message/MessageInterface.php | 136 + .../guzzle/src/Message/MessageParser.php | 171 + .../guzzlehttp/guzzle/src/Message/Request.php | 195 + .../guzzle/src/Message/RequestInterface.php | 136 + .../guzzle/src/Message/Response.php | 208 + .../guzzle/src/Message/ResponseInterface.php | 111 + .../guzzlehttp/guzzle/src/Mimetypes.php | 963 +++ .../guzzle/src/Post/MultipartBody.php | 109 + .../guzzlehttp/guzzle/src/Post/PostBody.php | 287 + .../guzzle/src/Post/PostBodyInterface.php | 109 + .../guzzlehttp/guzzle/src/Post/PostFile.php | 135 + .../guzzle/src/Post/PostFileInterface.php | 41 + .../vendor/guzzlehttp/guzzle/src/Query.php | 204 + .../guzzlehttp/guzzle/src/QueryParser.php | 163 + .../guzzlehttp/guzzle/src/RequestFsm.php | 153 + .../guzzlehttp/guzzle/src/RingBridge.php | 165 + .../guzzle/src/Subscriber/Cookie.php | 58 + .../guzzle/src/Subscriber/History.php | 172 + .../guzzle/src/Subscriber/HttpError.php | 36 + .../guzzlehttp/guzzle/src/Subscriber/Mock.php | 147 + .../guzzle/src/Subscriber/Prepare.php | 130 + .../guzzle/src/Subscriber/Redirect.php | 176 + .../guzzle/src/ToArrayInterface.php | 15 + .../guzzlehttp/guzzle/src/Transaction.php | 103 + .../vendor/guzzlehttp/guzzle/src/Url.php | 595 ++ .../guzzlehttp/log-subscriber/.gitignore | 6 + .../guzzlehttp/log-subscriber/.travis.yml | 13 + .../vendor/guzzlehttp/log-subscriber/LICENSE | 19 + .../guzzlehttp/log-subscriber/README.rst | 151 + .../guzzlehttp/log-subscriber/composer.json | 30 + .../log-subscriber/phpunit.xml.dist | 14 + .../log-subscriber/src/Formatter.php | 179 + .../log-subscriber/src/LogSubscriber.php | 89 + .../log-subscriber/src/SimpleLogger.php | 32 + .../log-subscriber/tests/FormatterTest.php | 90 + .../tests/LogSubscriberTest.php | 76 + .../log-subscriber/tests/SimpleLoggerTest.php | 41 + .../vendor/guzzlehttp/ringphp/.editorconfig | 12 + .../vendor/guzzlehttp/ringphp/.gitignore | 4 + .../vendor/guzzlehttp/ringphp/.travis.yml | 43 + .../vendor/guzzlehttp/ringphp/CHANGELOG.md | 118 + .../storage/vendor/guzzlehttp/ringphp/LICENSE | 19 + .../vendor/guzzlehttp/ringphp/Makefile | 46 + .../vendor/guzzlehttp/ringphp/README.rst | 46 + .../vendor/guzzlehttp/ringphp/composer.json | 43 + .../vendor/guzzlehttp/ringphp/docs/Makefile | 153 + .../ringphp/docs/client_handlers.rst | 173 + .../ringphp/docs/client_middleware.rst | 165 + .../vendor/guzzlehttp/ringphp/docs/conf.py | 23 + .../guzzlehttp/ringphp/docs/futures.rst | 164 + .../vendor/guzzlehttp/ringphp/docs/index.rst | 50 + .../guzzlehttp/ringphp/docs/requirements.txt | 1 + .../vendor/guzzlehttp/ringphp/docs/spec.rst | 311 + .../guzzlehttp/ringphp/docs/testing.rst | 74 + .../guzzlehttp/ringphp/phpunit.xml.dist | 14 + .../ringphp/src/Client/ClientUtils.php | 74 + .../ringphp/src/Client/CurlFactory.php | 560 ++ .../ringphp/src/Client/CurlHandler.php | 135 + .../ringphp/src/Client/CurlMultiHandler.php | 248 + .../ringphp/src/Client/Middleware.php | 58 + .../ringphp/src/Client/MockHandler.php | 52 + .../ringphp/src/Client/StreamHandler.php | 414 ++ .../vendor/guzzlehttp/ringphp/src/Core.php | 364 + .../src/Exception/CancelledException.php | 7 + .../CancelledFutureAccessException.php | 4 + .../src/Exception/ConnectException.php | 7 + .../ringphp/src/Exception/RingException.php | 4 + .../ringphp/src/Future/BaseFutureTrait.php | 125 + .../src/Future/CompletedFutureArray.php | 43 + .../src/Future/CompletedFutureValue.php | 57 + .../ringphp/src/Future/FutureArray.php | 40 + .../src/Future/FutureArrayInterface.php | 11 + .../ringphp/src/Future/FutureInterface.php | 40 + .../ringphp/src/Future/FutureValue.php | 12 + .../ringphp/src/Future/MagicFutureTrait.php | 32 + .../ringphp/tests/Client/CurlFactoryTest.php | 821 +++ .../ringphp/tests/Client/CurlHandlerTest.php | 96 + .../tests/Client/CurlMultiHandlerTest.php | 181 + .../ringphp/tests/Client/MiddlewareTest.php | 65 + .../ringphp/tests/Client/MockHandlerTest.php | 86 + .../ringphp/tests/Client/Server.php | 183 + .../tests/Client/StreamHandlerTest.php | 480 ++ .../guzzlehttp/ringphp/tests/Client/server.js | 241 + .../guzzlehttp/ringphp/tests/CoreTest.php | 336 + .../tests/Future/CompletedFutureArrayTest.php | 21 + .../tests/Future/CompletedFutureValueTest.php | 46 + .../ringphp/tests/Future/FutureArrayTest.php | 56 + .../ringphp/tests/Future/FutureValueTest.php | 109 + .../guzzlehttp/ringphp/tests/bootstrap.php | 11 + .../vendor/guzzlehttp/streams/.gitignore | 6 + .../vendor/guzzlehttp/streams/.travis.yml | 17 + .../vendor/guzzlehttp/streams/CHANGELOG.rst | 94 + .../storage/vendor/guzzlehttp/streams/LICENSE | 19 + .../vendor/guzzlehttp/streams/Makefile | 19 + .../vendor/guzzlehttp/streams/README.rst | 36 + .../vendor/guzzlehttp/streams/composer.json | 28 + .../guzzlehttp/streams/phpunit.xml.dist | 17 + .../guzzlehttp/streams/src/AppendStream.php | 220 + .../streams/src/AsyncReadStream.php | 207 + .../guzzlehttp/streams/src/BufferStream.php | 138 + .../guzzlehttp/streams/src/CachingStream.php | 122 + .../guzzlehttp/streams/src/DroppingStream.php | 42 + .../src/Exception/CannotAttachException.php | 4 + .../streams/src/Exception/SeekException.php | 27 + .../guzzlehttp/streams/src/FnStream.php | 147 + .../streams/src/GuzzleStreamWrapper.php | 117 + .../guzzlehttp/streams/src/InflateStream.php | 27 + .../guzzlehttp/streams/src/LazyOpenStream.php | 37 + .../guzzlehttp/streams/src/LimitStream.php | 161 + .../streams/src/MetadataStreamInterface.php | 11 + .../guzzlehttp/streams/src/NoSeekStream.php | 25 + .../guzzlehttp/streams/src/NullStream.php | 78 + .../guzzlehttp/streams/src/PumpStream.php | 161 + .../vendor/guzzlehttp/streams/src/Stream.php | 261 + .../streams/src/StreamDecoratorTrait.php | 143 + .../streams/src/StreamInterface.php | 159 + .../vendor/guzzlehttp/streams/src/Utils.php | 196 + .../streams/tests/AppendStreamTest.php | 178 + .../streams/tests/AsyncReadStreamTest.php | 186 + .../streams/tests/BufferStreamTest.php | 69 + .../streams/tests/CachingStreamTest.php | 136 + .../streams/tests/DroppingStreamTest.php | 26 + .../tests/Exception/SeekExceptionTest.php | 16 + .../guzzlehttp/streams/tests/FnStreamTest.php | 89 + .../streams/tests/GuzzleStreamWrapperTest.php | 99 + .../streams/tests/InflateStreamTest.php | 16 + .../streams/tests/LazyOpenStreamTest.php | 64 + .../streams/tests/LimitStreamTest.php | 133 + .../streams/tests/NoSeekStreamTest.php | 41 + .../streams/tests/NullStreamTest.php | 39 + .../streams/tests/PumpStreamTest.php | 77 + .../tests/StreamDecoratorTraitTest.php | 147 + .../guzzlehttp/streams/tests/StreamTest.php | 252 + .../guzzlehttp/streams/tests/UtilsTest.php | 155 + .../vendor/klarna/kco_rest/.coveralls.yml | 3 + .../storage/vendor/klarna/kco_rest/.gitignore | 3 + .../vendor/klarna/kco_rest/.travis.yml | 29 + .../vendor/klarna/kco_rest/composer.lock | 3569 ++++++++++ .../examples/capture/add_shipping_info.php | 34 + .../examples/capture/trigger_send_out.php | 22 + .../capture/update_customer_details.php | 27 + .../examples/checkout/create_checkout.php | 60 + .../checkout/create_checkout_attachment.php | 79 + .../docs/examples/checkout/fetch_checkout.php | 19 + .../examples/checkout/update_checkout.php | 56 + .../docs/examples/order/acknowledge_order.php | 22 + .../docs/examples/order/cancel_order.php | 21 + .../docs/examples/order/create_capture.php | 49 + .../order/extend_authorization_time.php | 19 + .../docs/examples/order/fetch_capture.php | 21 + .../docs/examples/order/fetch_order.php | 19 + .../docs/examples/order/refund_order.php | 37 + .../order/release_remaining_authorization.php | 21 + .../order/update_customer_details.php | 30 + .../order/update_merchant_references.php | 25 + .../examples/order/update_order_lines.php | 37 + .../klarna/kco_rest/git_hooks/README.md | 14 + .../klarna/kco_rest/git_hooks/coffeelint | 103 + .../git_hooks/commit-msg/message-format | 34 + .../git_hooks/commit-msg/ticket-number | 30 + .../vendor/klarna/kco_rest/git_hooks/jshint | 69 + .../git_hooks/pre-commit/check-coffee | 59 + .../kco_rest/git_hooks/pre-commit/check-js | 59 + .../kco_rest/git_hooks/pre-commit/check-php | 65 + .../git_hooks/pre-commit/check-python | 48 + .../storage/vendor/klarna/kco_rest/phpmd.xml | 32 + .../vendor/klarna/kco_rest/phpunit.xml.dist | 40 + .../tests/Component/Checkout/OrderTest.php | 135 + .../Component/OrderManagement/CaptureTest.php | 168 + .../Component/OrderManagement/OrderTest.php | 451 ++ .../tests/Component/ResourceTestCase.php | 45 + .../kco_rest/tests/Component/TestCase.php | 80 + .../Component/Transport/ConnectorTest.php | 144 + .../tests/Unit/Checkout/OrderTest.php | 418 ++ .../Unit/OrderManagement/CaptureTest.php | 512 ++ .../tests/Unit/OrderManagement/OrderTest.php | 921 +++ .../klarna/kco_rest/tests/Unit/TestCase.php | 57 + .../tests/Unit/Transport/ConnectorTest.php | 343 + .../Exception/ConnectorExceptionTest.php | 80 + .../Unit/Transport/ResponseValidatorTest.php | 249 + .../tests/Unit/Transport/UserAgentTest.php | 125 + .../klarna/kco_rest/tests/bootstrap.php | 23 + upload/system/storage/vendor/psr/log/LICENSE | 19 + .../vendor/psr/log/Psr/Log/AbstractLogger.php | 128 + .../log/Psr/Log/InvalidArgumentException.php | 7 + .../vendor/psr/log/Psr/Log/LogLevel.php | 18 + .../psr/log/Psr/Log/LoggerAwareInterface.php | 18 + .../psr/log/Psr/Log/LoggerAwareTrait.php | 26 + .../psr/log/Psr/Log/LoggerInterface.php | 125 + .../vendor/psr/log/Psr/Log/LoggerTrait.php | 142 + .../vendor/psr/log/Psr/Log/NullLogger.php | 30 + .../vendor/psr/log/Psr/Log/Test/DummyTest.php | 18 + .../log/Psr/Log/Test/LoggerInterfaceTest.php | 138 + .../psr/log/Psr/Log/Test/TestLogger.php | 147 + .../system/storage/vendor/psr/log/README.md | 58 + .../storage/vendor/psr/log/composer.json | 26 + .../vendor/symfony/translation/.gitignore | 3 + .../vendor/symfony/translation/CHANGELOG.md | 69 + .../Catalogue/AbstractOperation.php | 171 + .../translation/Catalogue/MergeOperation.php | 55 + .../Catalogue/OperationInterface.php | 77 + .../translation/Catalogue/TargetOperation.php | 69 + .../TranslationDataCollector.php | 150 + .../translation/DataCollectorTranslator.php | 152 + .../translation/Dumper/CsvFileDumper.php | 63 + .../translation/Dumper/DumperInterface.php | 31 + .../symfony/translation/Dumper/FileDumper.php | 123 + .../translation/Dumper/IcuResFileDumper.php | 106 + .../translation/Dumper/IniFileDumper.php | 45 + .../translation/Dumper/JsonFileDumper.php | 44 + .../translation/Dumper/MoFileDumper.php | 82 + .../translation/Dumper/PhpFileDumper.php | 38 + .../translation/Dumper/PoFileDumper.php | 61 + .../translation/Dumper/QtFileDumper.php | 50 + .../translation/Dumper/XliffFileDumper.php | 183 + .../translation/Dumper/YamlFileDumper.php | 54 + .../Exception/ExceptionInterface.php | 21 + .../Exception/InvalidResourceException.php | 21 + .../Exception/NotFoundResourceException.php | 21 + .../Extractor/AbstractFileExtractor.php | 83 + .../translation/Extractor/ChainExtractor.php | 60 + .../Extractor/ExtractorInterface.php | 38 + .../translation/IdentityTranslator.php | 65 + .../vendor/symfony/translation/Interval.php | 107 + .../vendor/symfony/translation/LICENSE | 19 + .../translation/Loader/ArrayLoader.php | 66 + .../translation/Loader/CsvFileLoader.php | 65 + .../symfony/translation/Loader/FileLoader.php | 65 + .../translation/Loader/IcuDatFileLoader.php | 62 + .../translation/Loader/IcuResFileLoader.php | 92 + .../translation/Loader/IniFileLoader.php | 28 + .../translation/Loader/JsonFileLoader.php | 64 + .../translation/Loader/LoaderInterface.php | 38 + .../translation/Loader/MoFileLoader.php | 154 + .../translation/Loader/PhpFileLoader.php | 28 + .../translation/Loader/PoFileLoader.php | 151 + .../translation/Loader/QtFileLoader.php | 77 + .../translation/Loader/XliffFileLoader.php | 321 + .../translation/Loader/YamlFileLoader.php | 48 + .../dic/xliff-core/xliff-core-1.2-strict.xsd | 2223 ++++++ .../schema/dic/xliff-core/xliff-core-2.0.xsd | 411 ++ .../Loader/schema/dic/xliff-core/xml.xsd | 309 + .../symfony/translation/LoggingTranslator.php | 124 + .../symfony/translation/MessageCatalogue.php | 270 + .../translation/MessageCatalogueInterface.php | 142 + .../symfony/translation/MessageSelector.php | 86 + .../translation/MetadataAwareInterface.php | 54 + .../translation/PluralizationRules.php | 209 + .../vendor/symfony/translation/README.md | 13 + .../Tests/Catalogue/AbstractOperationTest.php | 73 + .../Tests/Catalogue/MergeOperationTest.php | 83 + .../Tests/Catalogue/TargetOperationTest.php | 82 + .../TranslationDataCollectorTest.php | 148 + .../Tests/DataCollectorTranslatorTest.php | 93 + .../Tests/Dumper/CsvFileDumperTest.php | 29 + .../Tests/Dumper/FileDumperTest.php | 83 + .../Tests/Dumper/IcuResFileDumperTest.php | 28 + .../Tests/Dumper/IniFileDumperTest.php | 28 + .../Tests/Dumper/JsonFileDumperTest.php | 38 + .../Tests/Dumper/MoFileDumperTest.php | 28 + .../Tests/Dumper/PhpFileDumperTest.php | 28 + .../Tests/Dumper/PoFileDumperTest.php | 28 + .../Tests/Dumper/QtFileDumperTest.php | 28 + .../Tests/Dumper/XliffFileDumperTest.php | 89 + .../Tests/Dumper/YamlFileDumperTest.php | 46 + .../Tests/IdentityTranslatorTest.php | 95 + .../translation/Tests/IntervalTest.php | 48 + .../Tests/Loader/CsvFileLoaderTest.php | 60 + .../Tests/Loader/IcuDatFileLoaderTest.php | 64 + .../Tests/Loader/IcuResFileLoaderTest.php | 51 + .../Tests/Loader/IniFileLoaderTest.php | 50 + .../Tests/Loader/JsonFileLoaderTest.php | 61 + .../Tests/Loader/LocalizedTestCase.php | 22 + .../Tests/Loader/MoFileLoaderTest.php | 71 + .../Tests/Loader/PhpFileLoaderTest.php | 49 + .../Tests/Loader/PoFileLoaderTest.php | 108 + .../Tests/Loader/QtFileLoaderTest.php | 67 + .../Tests/Loader/XliffFileLoaderTest.php | 183 + .../Tests/Loader/YamlFileLoaderTest.php | 70 + .../Tests/LoggingTranslatorTest.php | 49 + .../Tests/MessageCatalogueTest.php | 214 + .../translation/Tests/MessageSelectorTest.php | 130 + .../Tests/PluralizationRulesTest.php | 123 + .../translation/Tests/TranslatorCacheTest.php | 299 + .../translation/Tests/TranslatorTest.php | 533 ++ .../Tests/Util/ArrayConverterTest.php | 73 + .../Tests/Writer/TranslationWriterTest.php | 65 + .../Tests/fixtures/empty-translation.mo | Bin 0 -> 49 bytes .../Tests/fixtures/empty-translation.po | 3 + .../translation/Tests/fixtures/empty.csv | 0 .../translation/Tests/fixtures/empty.ini | 0 .../translation/Tests/fixtures/empty.json | 0 .../translation/Tests/fixtures/empty.mo | 0 .../translation/Tests/fixtures/empty.po | 0 .../translation/Tests/fixtures/empty.xlf | 0 .../translation/Tests/fixtures/empty.yml | 0 .../translation/Tests/fixtures/encoding.xlf | 16 + .../Tests/fixtures/escaped-id-plurals.po | 10 + .../translation/Tests/fixtures/escaped-id.po | 8 + .../Tests/fixtures/fuzzy-translations.po | 10 + .../Tests/fixtures/invalid-xml-resources.xlf | 23 + .../translation/Tests/fixtures/malformed.json | 3 + .../translation/Tests/fixtures/messages.yml | 3 + .../Tests/fixtures/messages_linear.yml | 2 + .../translation/Tests/fixtures/non-valid.xlf | 11 + .../translation/Tests/fixtures/non-valid.yml | 1 + .../translation/Tests/fixtures/plurals.mo | Bin 0 -> 74 bytes .../translation/Tests/fixtures/plurals.po | 5 + .../translation/Tests/fixtures/resname.xlf | 19 + .../resourcebundle/corrupted/resources.dat | 1 + .../Tests/fixtures/resourcebundle/dat/en.res | Bin 0 -> 120 bytes .../Tests/fixtures/resourcebundle/dat/en.txt | 3 + .../Tests/fixtures/resourcebundle/dat/fr.res | Bin 0 -> 124 bytes .../Tests/fixtures/resourcebundle/dat/fr.txt | 3 + .../resourcebundle/dat/packagelist.txt | 2 + .../fixtures/resourcebundle/dat/resources.dat | Bin 0 -> 352 bytes .../Tests/fixtures/resourcebundle/res/en.res | Bin 0 -> 84 bytes .../Tests/fixtures/resources-2.0-clean.xlf | 23 + .../Tests/fixtures/resources-2.0.xlf | 25 + .../Tests/fixtures/resources-clean.xlf | 25 + .../fixtures/resources-target-attributes.xlf | 14 + .../Tests/fixtures/resources-tool-info.xlf | 14 + .../translation/Tests/fixtures/resources.csv | 4 + .../Tests/fixtures/resources.dump.json | 1 + .../translation/Tests/fixtures/resources.ini | 1 + .../translation/Tests/fixtures/resources.json | 3 + .../translation/Tests/fixtures/resources.mo | Bin 0 -> 52 bytes .../translation/Tests/fixtures/resources.php | 5 + .../translation/Tests/fixtures/resources.po | 8 + .../translation/Tests/fixtures/resources.ts | 10 + .../translation/Tests/fixtures/resources.xlf | 23 + .../translation/Tests/fixtures/resources.yml | 1 + .../translation/Tests/fixtures/valid.csv | 4 + .../Tests/fixtures/with-attributes.xlf | 21 + .../Tests/fixtures/withdoctype.xlf | 12 + .../translation/Tests/fixtures/withnote.xlf | 22 + .../vendor/symfony/translation/Translator.php | 441 ++ .../translation/TranslatorBagInterface.php | 31 + .../translation/TranslatorInterface.php | 65 + .../translation/Util/ArrayConverter.php | 99 + .../translation/Writer/TranslationWriter.php | 89 + .../vendor/symfony/translation/composer.json | 48 + .../symfony/translation/phpunit.xml.dist | 28 + .../vendor/symfony/validator/.gitignore | 3 + .../symfony/validator/ClassBasedInterface.php | 30 + .../Constraints/Collection/Optional.php | 29 + .../Constraints/Collection/Required.php | 29 + .../symfony/validator/Constraints/False.php | 26 + .../validator/Constraints/FalseValidator.php | 23 + .../symfony/validator/Constraints/Null.php | 26 + .../validator/Constraints/NullValidator.php | 23 + .../symfony/validator/Constraints/True.php | 26 + .../validator/Constraints/TrueValidator.php | 23 + .../Context/LegacyExecutionContext.php | 46 + .../Context/LegacyExecutionContextFactory.php | 64 + .../symfony/validator/DefaultTranslator.php | 171 + .../symfony/validator/ExecutionContext.php | 269 + .../validator/ExecutionContextInterface.php | 299 + .../GlobalExecutionContextInterface.php | 71 + .../Mapping/BlackholeMetadataFactory.php | 28 + .../validator/Mapping/Cache/ApcCache.php | 57 + .../Mapping/Cache/CacheInterface.php | 43 + .../validator/Mapping/Cache/DoctrineCache.php | 59 + .../Mapping/ClassMetadataFactory.php | 28 + .../validator/Mapping/ElementMetadata.php | 30 + .../validator/MetadataFactoryInterface.php | 43 + .../symfony/validator/MetadataInterface.php | 73 + .../PropertyMetadataContainerInterface.php | 45 + .../validator/PropertyMetadataInterface.php | 46 + .../validator/Tests/ConstraintTest.php | 245 + .../Tests/ConstraintViolationListTest.php | 135 + .../Tests/ConstraintViolationTest.php | 56 + .../AbstractComparisonValidatorTestCase.php | 192 + .../AbstractConstraintValidatorTest.php | 441 ++ .../validator/Tests/Constraints/AllTest.php | 42 + .../Tests/Constraints/AllValidatorTest.php | 93 + .../Tests/Constraints/BicValidatorTest.php | 106 + .../Tests/Constraints/BlankValidatorTest.php | 70 + .../Constraints/CallbackValidatorTest.php | 351 + .../Constraints/CardSchemeValidatorTest.php | 143 + .../Tests/Constraints/ChoiceValidatorTest.php | 304 + .../Tests/Constraints/CollectionTest.php | 113 + .../CollectionValidatorArrayObjectTest.php | 20 + .../CollectionValidatorArrayTest.php | 20 + ...llectionValidatorCustomArrayObjectTest.php | 22 + .../Constraints/CollectionValidatorTest.php | 389 ++ .../Tests/Constraints/CompositeTest.php | 148 + .../Constraints/CountValidatorArrayTest.php | 23 + .../CountValidatorCountableTest.php | 25 + .../Tests/Constraints/CountValidatorTest.php | 203 + .../Constraints/CountryValidatorTest.php | 110 + .../Constraints/CurrencyValidatorTest.php | 112 + .../Constraints/DateTimeValidatorTest.php | 110 + .../Tests/Constraints/DateValidatorTest.php | 106 + .../Tests/Constraints/EmailValidatorTest.php | 190 + .../Constraints/EqualToValidatorTest.php | 74 + .../Constraints/ExpressionValidatorTest.php | 279 + .../validator/Tests/Constraints/FileTest.php | 139 + .../Constraints/FileValidatorObjectTest.php | 22 + .../Constraints/FileValidatorPathTest.php | 36 + .../Tests/Constraints/FileValidatorTest.php | 483 ++ .../validator/Tests/Constraints/Fixtures/foo | 0 .../Tests/Constraints/Fixtures/test.gif | Bin 0 -> 801 bytes .../Tests/Constraints/Fixtures/test_4by3.gif | Bin 0 -> 57 bytes .../Constraints/Fixtures/test_landscape.gif | Bin 0 -> 43 bytes .../Constraints/Fixtures/test_portrait.gif | Bin 0 -> 43 bytes .../GreaterThanOrEqualValidatorTest.php | 76 + .../Constraints/GreaterThanValidatorTest.php | 79 + .../Tests/Constraints/GroupSequenceTest.php | 100 + .../Tests/Constraints/IbanValidatorTest.php | 450 ++ .../Constraints/IdenticalToValidatorTest.php | 94 + .../Tests/Constraints/ImageValidatorTest.php | 332 + .../Tests/Constraints/IpValidatorTest.php | 456 ++ .../Constraints/IsFalseValidatorTest.php | 57 + .../Tests/Constraints/IsNullValidatorTest.php | 67 + .../Tests/Constraints/IsTrueValidatorTest.php | 57 + .../Tests/Constraints/IsbnValidatorTest.php | 271 + .../Tests/Constraints/IssnValidatorTest.php | 187 + .../Constraints/LanguageValidatorTest.php | 110 + .../Tests/Constraints/LengthValidatorTest.php | 252 + .../LessThanOrEqualValidatorTest.php | 79 + .../Constraints/LessThanValidatorTest.php | 78 + .../Tests/Constraints/LocaleValidatorTest.php | 98 + .../Tests/Constraints/LuhnValidatorTest.php | 127 + .../Constraints/NotBlankValidatorTest.php | 106 + .../Constraints/NotEqualToValidatorTest.php | 74 + .../NotIdenticalToValidatorTest.php | 92 + .../Constraints/NotNullValidatorTest.php | 63 + .../Tests/Constraints/RangeValidatorTest.php | 403 ++ .../validator/Tests/Constraints/RegexTest.php | 88 + .../Tests/Constraints/RegexValidatorTest.php | 98 + .../Tests/Constraints/TimeValidatorTest.php | 107 + .../Tests/Constraints/TypeValidatorTest.php | 187 + .../Tests/Constraints/UrlValidatorTest.php | 242 + .../Tests/Constraints/UuidValidatorTest.php | 221 + .../validator/Tests/Constraints/ValidTest.php | 29 + .../Tests/Fixtures/CallbackClass.php | 24 + .../Tests/Fixtures/ClassConstraint.php | 22 + .../validator/Tests/Fixtures/ConstraintA.php | 31 + .../Tests/Fixtures/ConstraintAValidator.php | 37 + .../validator/Tests/Fixtures/ConstraintB.php | 23 + .../validator/Tests/Fixtures/ConstraintC.php | 30 + .../Tests/Fixtures/ConstraintWithValue.php | 31 + .../Fixtures/ConstraintWithValueAsDefault.php | 31 + .../validator/Tests/Fixtures/Countable.php | 27 + .../Tests/Fixtures/CustomArrayObject.php | 70 + .../validator/Tests/Fixtures/Entity.php | 104 + .../Tests/Fixtures/EntityInterfaceA.php | 16 + .../Tests/Fixtures/EntityInterfaceB.php | 16 + .../validator/Tests/Fixtures/EntityParent.php | 31 + .../Tests/Fixtures/EntityParentInterface.php | 16 + .../Tests/Fixtures/EntityStaticCar.php | 23 + .../Tests/Fixtures/EntityStaticCarTurbo.php | 23 + .../Tests/Fixtures/EntityStaticVehicle.php | 25 + .../Tests/Fixtures/FailingConstraint.php | 24 + .../Fixtures/FailingConstraintValidator.php | 23 + .../Tests/Fixtures/FakeClassMetadata.php | 26 + .../Tests/Fixtures/FakeMetadataFactory.php | 72 + .../validator/Tests/Fixtures/FilesLoader.php | 39 + .../GroupSequenceProviderChildEntity.php | 16 + .../Fixtures/GroupSequenceProviderEntity.php | 36 + .../Tests/Fixtures/InvalidConstraint.php | 18 + .../Fixtures/InvalidConstraintValidator.php | 16 + .../Tests/Fixtures/LegacyClassMetadata.php | 20 + .../Tests/Fixtures/PropertyConstraint.php | 22 + .../validator/Tests/Fixtures/Reference.php | 29 + .../Fixtures/StubGlobalExecutionContext.php | 68 + .../validator/Tests/Fixtures/ToString.php | 22 + .../Tests/LegacyExecutionContextTest.php | 335 + .../validator/Tests/LegacyValidatorTest.php | 42 + .../Tests/Mapping/Cache/DoctrineCacheTest.php | 85 + .../Mapping/Cache/LegacyApcCacheTest.php | 83 + .../Tests/Mapping/ClassMetadataTest.php | 323 + .../Factory/BlackHoleMetadataFactoryTest.php | 34 + .../LazyLoadingMetadataFactoryTest.php | 218 + .../Tests/Mapping/GetterMetadataTest.php | 72 + .../Mapping/LegacyElementMetadataTest.php | 79 + .../Loader/AbstractStaticMethodLoader.php | 19 + .../Mapping/Loader/AnnotationLoaderTest.php | 164 + .../Tests/Mapping/Loader/FilesLoaderTest.php | 49 + .../Tests/Mapping/Loader/LoaderChainTest.php | 85 + .../Mapping/Loader/StaticMethodLoaderTest.php | 140 + .../Mapping/Loader/XmlFileLoaderTest.php | 136 + .../Mapping/Loader/YamlFileLoaderTest.php | 139 + .../Tests/Mapping/Loader/bad-format.yml | 9 + .../Loader/constraint-mapping-non-strings.xml | 19 + .../Mapping/Loader/constraint-mapping.xml | 124 + .../Mapping/Loader/constraint-mapping.yml | 62 + .../Tests/Mapping/Loader/empty-mapping.yml | 0 .../Tests/Mapping/Loader/nonvalid-mapping.yml | 1 + .../Tests/Mapping/Loader/withdoctype.xml | 7 + .../Tests/Mapping/MemberMetadataTest.php | 120 + .../Tests/Mapping/PropertyMetadataTest.php | 56 + .../Tests/Resources/TranslationFilesTest.php | 48 + .../validator/Tests/Util/PropertyPathTest.php | 37 + .../Tests/Validator/Abstract2Dot5ApiTest.php | 742 ++ .../Tests/Validator/AbstractLegacyApiTest.php | 313 + .../Tests/Validator/AbstractValidatorTest.php | 1284 ++++ .../Validator/LegacyValidator2Dot5ApiTest.php | 35 + .../LegacyValidatorLegacyApiTest.php | 35 + .../RecursiveValidator2Dot5ApiTest.php | 57 + .../validator/Tests/ValidatorBuilderTest.php | 117 + .../symfony/validator/ValidationVisitor.php | 181 + .../validator/ValidationVisitorInterface.php | 82 + .../vendor/symfony/validator/Validator.php | 208 + .../validator/Validator/LegacyValidator.php | 27 + .../validator/ValidatorBuilderInterface.php | 181 + .../symfony/validator/ValidatorInterface.php | 103 + .../LegacyConstraintViolationBuilder.php | 166 + .../vendor/symfony/validator/phpunit.xml.dist | 31 + 681 files changed, 87358 insertions(+) create mode 100644 upload/system/storage/vendor/braintree/braintree_php/.github/ISSUE_TEMPLATE.md create mode 100644 upload/system/storage/vendor/braintree/braintree_php/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 upload/system/storage/vendor/braintree/braintree_php/.gitignore create mode 100644 upload/system/storage/vendor/braintree/braintree_php/ACKNOWLEDGEMENTS.md create mode 100644 upload/system/storage/vendor/braintree/braintree_php/Dockerfile create mode 100644 upload/system/storage/vendor/braintree/braintree_php/Makefile create mode 100644 upload/system/storage/vendor/braintree/braintree_php/Rakefile create mode 100755 upload/system/storage/vendor/braintree/braintree_php/ci.sh create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AmexExpressCheckoutCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AndroidPayCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CoinbaseAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EuropeBankAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/DownForMaintenance.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/ForgedQueryString.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IbanBankAccount.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPayment.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPaymentGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MasterpassCard.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AmexExpressCheckoutCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AndroidPayCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CoinbaseDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/EuropeBankAccountDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/IdealPaymentDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/LineItem.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/MasterpassCardDetails.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirect.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirectGateway.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/Braintree/CreditCardDefaults.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/Braintree/CreditCardNumbers/CardTypeIndicators.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/Braintree/OAuthTestHelper.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/Helper.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/SanityTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/Setup.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/bt_logo.png create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/gif_extension_bt_logo.gif create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/malformed_pdf.pdf create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/too_long.pdf create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddOnsTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddressTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/ApplePayTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/ClientTokenTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationAdvancedSearchTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerAdvancedSearchTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisbursementTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/DiscountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeSearchTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/DocumentUploadTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ErrorCollectionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ValidationErrorCollectionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/GraphQLTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpClientApi.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/IdealPaymentTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/MasterpassCardTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/MultipleValueNodeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/OAuthTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/PayPalAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodNonceTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodWithUsBankAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/PlanTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/Result/ErrorTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/SamsungPayCardTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/SettlementBatchSummaryTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionHelper.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionSearchTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/TestTransactionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/TextNodeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionAdvancedSearchTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionLineItemTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionWithUsBankAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransparentRedirectTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountVerificationTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/integration/VisaCheckoutCardTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddOnTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddressTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/AuthorizationAdjustmentTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/BraintreeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/ClientApi/ClientTokenTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/ConfigurationTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardVerificationTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/CustomerTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/DigestTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementDetailsTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/DiscountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisputeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/DocumentUploadTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/EndsWithNodeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/GatewayTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/HttpTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/InstanceTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/MerchantAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueNodeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueOrTextNodeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthAccessRevocationTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaginatedCollectionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/PayPalAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaymentMethodTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/RangeNodeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/ResourceCollectionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/ErrorTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/SuccessfulTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/SanityTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionSearchTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/TextNodeTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionLineItemTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransparentRedirectTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/UnknownPaymentMethodTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountVerificationTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/UtilTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/WebhookNotificationTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_GeneratorTest.php create mode 100644 upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_ParserTest.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/CreateSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetAllSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/VoidSpec.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Create.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Get.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/GetAll.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Void.php create mode 100644 upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidTest.php create mode 100644 upload/system/storage/vendor/composer/InstalledVersions.php create mode 100644 upload/system/storage/vendor/composer/installed.php create mode 100644 upload/system/storage/vendor/composer/platform_check.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/.travis.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/BatchResults.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Collection.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/BeforeEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/Emitter.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EmitterInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EndEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EventInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/HasEmitterInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/HasEmitterTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ProgressEvent.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/SubscriberInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/CouldNotRewindStreamException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/ParseException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/StateException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/XmlParseException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/HasDataTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/FutureResponse.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageParser.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/Request.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/RequestInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/Response.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/ResponseInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Mimetypes.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBody.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBodyInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostFile.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostFileInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Query.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/QueryParser.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestFsm.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/RingBridge.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Cookie.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/History.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Mock.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Redirect.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/ToArrayInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Transaction.php create mode 100644 upload/system/storage/vendor/guzzlehttp/guzzle/src/Url.php create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/.gitignore create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/.travis.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/LICENSE create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/README.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/composer.json create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/src/Formatter.php create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/src/LogSubscriber.php create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/src/SimpleLogger.php create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/FormatterTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/LogSubscriberTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/SimpleLoggerTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/.editorconfig create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/.gitignore create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/.travis.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/CHANGELOG.md create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/LICENSE create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/Makefile create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/README.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/composer.json create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/Makefile create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_handlers.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_middleware.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/conf.py create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/futures.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/index.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/requirements.txt create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/spec.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/docs/testing.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/ClientUtils.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlFactory.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/Middleware.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/MockHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Core.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Exception/CancelledException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Exception/CancelledFutureAccessException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Exception/ConnectException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Exception/RingException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/BaseFutureTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureValue.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/MagicFutureTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/Server.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/server.js create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/CoreTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureValueTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/ringphp/tests/bootstrap.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/.gitignore create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/.travis.yml create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/CHANGELOG.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/LICENSE create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/Makefile create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/README.rst create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/composer.json create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/AppendStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/AsyncReadStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/BufferStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/CachingStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/DroppingStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/Exception/CannotAttachException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/Exception/SeekException.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/FnStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/GuzzleStreamWrapper.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/InflateStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/LazyOpenStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/LimitStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/MetadataStreamInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/NoSeekStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/NullStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/PumpStream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/Stream.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/StreamDecoratorTrait.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/StreamInterface.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/src/Utils.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/AppendStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/AsyncReadStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/BufferStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/CachingStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/FnStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/InflateStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/LazyOpenStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/LimitStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/NullStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/PumpStreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/StreamTest.php create mode 100644 upload/system/storage/vendor/guzzlehttp/streams/tests/UtilsTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml create mode 100644 upload/system/storage/vendor/klarna/kco_rest/.gitignore create mode 100644 upload/system/storage/vendor/klarna/kco_rest/.travis.yml create mode 100644 upload/system/storage/vendor/klarna/kco_rest/composer.lock create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md create mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint create mode 100755 upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format create mode 100755 upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number create mode 100644 upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint create mode 100755 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee create mode 100755 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js create mode 100755 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php create mode 100755 upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python create mode 100644 upload/system/storage/vendor/klarna/kco_rest/phpmd.xml create mode 100644 upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/Checkout/OrderTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php create mode 100644 upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php create mode 100644 upload/system/storage/vendor/psr/log/LICENSE create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/AbstractLogger.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/InvalidArgumentException.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/LogLevel.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/LoggerAwareInterface.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/LoggerAwareTrait.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/LoggerInterface.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/LoggerTrait.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/NullLogger.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/Test/DummyTest.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php create mode 100644 upload/system/storage/vendor/psr/log/Psr/Log/Test/TestLogger.php create mode 100644 upload/system/storage/vendor/psr/log/README.md create mode 100644 upload/system/storage/vendor/psr/log/composer.json create mode 100644 upload/system/storage/vendor/symfony/translation/.gitignore create mode 100644 upload/system/storage/vendor/symfony/translation/CHANGELOG.md create mode 100644 upload/system/storage/vendor/symfony/translation/Catalogue/AbstractOperation.php create mode 100644 upload/system/storage/vendor/symfony/translation/Catalogue/MergeOperation.php create mode 100644 upload/system/storage/vendor/symfony/translation/Catalogue/OperationInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/Catalogue/TargetOperation.php create mode 100644 upload/system/storage/vendor/symfony/translation/DataCollector/TranslationDataCollector.php create mode 100644 upload/system/storage/vendor/symfony/translation/DataCollectorTranslator.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/CsvFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/DumperInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/FileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/IcuResFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/IniFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/JsonFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/MoFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/PhpFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/PoFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/QtFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/XliffFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Dumper/YamlFileDumper.php create mode 100644 upload/system/storage/vendor/symfony/translation/Exception/ExceptionInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/Exception/InvalidResourceException.php create mode 100644 upload/system/storage/vendor/symfony/translation/Exception/NotFoundResourceException.php create mode 100644 upload/system/storage/vendor/symfony/translation/Extractor/AbstractFileExtractor.php create mode 100644 upload/system/storage/vendor/symfony/translation/Extractor/ChainExtractor.php create mode 100644 upload/system/storage/vendor/symfony/translation/Extractor/ExtractorInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/IdentityTranslator.php create mode 100644 upload/system/storage/vendor/symfony/translation/Interval.php create mode 100644 upload/system/storage/vendor/symfony/translation/LICENSE create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/ArrayLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/CsvFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/FileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/IcuDatFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/IcuResFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/IniFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/JsonFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/LoaderInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/MoFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/PhpFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/PoFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/QtFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/XliffFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/YamlFileLoader.php create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd create mode 100644 upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd create mode 100644 upload/system/storage/vendor/symfony/translation/LoggingTranslator.php create mode 100644 upload/system/storage/vendor/symfony/translation/MessageCatalogue.php create mode 100644 upload/system/storage/vendor/symfony/translation/MessageCatalogueInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/MessageSelector.php create mode 100644 upload/system/storage/vendor/symfony/translation/MetadataAwareInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/PluralizationRules.php create mode 100644 upload/system/storage/vendor/symfony/translation/README.md create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Catalogue/AbstractOperationTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/DataCollector/TranslationDataCollectorTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/IcuResFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/IniFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/JsonFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/MoFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/PhpFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/PoFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/QtFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/XliffFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/IdentityTranslatorTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/IntervalTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/CsvFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuDatFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuResFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/IniFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/JsonFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/LocalizedTestCase.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/MoFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/PhpFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/PoFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/QtFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Loader/YamlFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/LoggingTranslatorTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/MessageCatalogueTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/MessageSelectorTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/PluralizationRulesTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/TranslatorCacheTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/TranslatorTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Util/ArrayConverterTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/Writer/TranslationWriterTest.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty-translation.mo create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty-translation.po create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.csv create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.ini create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.json create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.mo create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.po create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.yml create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/encoding.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id-plurals.po create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id.po create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/fuzzy-translations.po create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/invalid-xml-resources.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/malformed.json create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages.yml create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages_linear.yml create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.yml create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/plurals.mo create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/plurals.po create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resname.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/corrupted/resources.dat create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/en.res create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/en.txt create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/fr.res create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/fr.txt create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/packagelist.txt create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/resources.dat create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/res/en.res create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0-clean.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-clean.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-target-attributes.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-tool-info.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.csv create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.dump.json create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ini create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.json create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.mo create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.php create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.po create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ts create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.yml create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/valid.csv create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/with-attributes.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/withdoctype.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Tests/fixtures/withnote.xlf create mode 100644 upload/system/storage/vendor/symfony/translation/Translator.php create mode 100644 upload/system/storage/vendor/symfony/translation/TranslatorBagInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/TranslatorInterface.php create mode 100644 upload/system/storage/vendor/symfony/translation/Util/ArrayConverter.php create mode 100644 upload/system/storage/vendor/symfony/translation/Writer/TranslationWriter.php create mode 100644 upload/system/storage/vendor/symfony/translation/composer.json create mode 100644 upload/system/storage/vendor/symfony/translation/phpunit.xml.dist create mode 100644 upload/system/storage/vendor/symfony/validator/.gitignore create mode 100644 upload/system/storage/vendor/symfony/validator/ClassBasedInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Collection/Optional.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Collection/Required.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/False.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/FalseValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/Null.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/NullValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/True.php create mode 100644 upload/system/storage/vendor/symfony/validator/Constraints/TrueValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContext.php create mode 100644 upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContextFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/DefaultTranslator.php create mode 100644 upload/system/storage/vendor/symfony/validator/ExecutionContext.php create mode 100644 upload/system/storage/vendor/symfony/validator/ExecutionContextInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/GlobalExecutionContextInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/BlackholeMetadataFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Cache/ApcCache.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Cache/CacheInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/Cache/DoctrineCache.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/Mapping/ElementMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/MetadataFactoryInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/MetadataInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/PropertyMetadataContainerInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/PropertyMetadataInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/ConstraintTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationListTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/BicValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/BlankValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/ChoiceValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayObjectTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorCustomArrayObjectTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CompositeTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorArrayTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorCountableTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountryValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/CurrencyValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateTimeValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/EqualToValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorObjectTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorPathTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/foo create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test.gif create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_4by3.gif create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_landscape.gif create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_portrait.gif create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IbanValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IdenticalToValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/ImageValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IpValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsFalseValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsNullValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsTrueValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsbnValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/IssnValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/LanguageValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/LengthValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanOrEqualValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/LocaleValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/LuhnValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotBlankValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotEqualToValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotIdenticalToValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotNullValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/RangeValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/TimeValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/TypeValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/UrlValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/UuidValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Constraints/ValidTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CallbackClass.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ClassConstraint.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintA.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintAValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintB.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintC.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValue.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValueAsDefault.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Countable.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Entity.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceA.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceB.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParent.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParentInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCar.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCarTurbo.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticVehicle.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraint.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraintValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeClassMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FilesLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderChildEntity.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderEntity.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraint.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraintValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/LegacyClassMetadata.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/PropertyConstraint.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Reference.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/StubGlobalExecutionContext.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ToString.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/LegacyValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/DoctrineCacheTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/ClassMetadataTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/BlackHoleMetadataFactoryTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/GetterMetadataTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AnnotationLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/FilesLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/LoaderChainTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/XmlFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/YamlFileLoaderTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/bad-format.yml create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping-non-strings.xml create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.xml create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.yml create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/empty-mapping.yml create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/nonvalid-mapping.yml create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/withdoctype.xml create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Mapping/PropertyMetadataTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Resources/TranslationFilesTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Util/PropertyPathTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidatorLegacyApiTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/Tests/ValidatorBuilderTest.php create mode 100644 upload/system/storage/vendor/symfony/validator/ValidationVisitor.php create mode 100644 upload/system/storage/vendor/symfony/validator/ValidationVisitorInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator.php create mode 100644 upload/system/storage/vendor/symfony/validator/Validator/LegacyValidator.php create mode 100644 upload/system/storage/vendor/symfony/validator/ValidatorBuilderInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/ValidatorInterface.php create mode 100644 upload/system/storage/vendor/symfony/validator/Violation/LegacyConstraintViolationBuilder.php create mode 100644 upload/system/storage/vendor/symfony/validator/phpunit.xml.dist diff --git a/upload/system/storage/vendor/braintree/braintree_php/.github/ISSUE_TEMPLATE.md b/upload/system/storage/vendor/braintree/braintree_php/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000000..5ab02592290 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,9 @@ +### General information + +* SDK/Library version: +* Environment: +* Language, language version, and OS: + +### Issue description + + diff --git a/upload/system/storage/vendor/braintree/braintree_php/.github/PULL_REQUEST_TEMPLATE.md b/upload/system/storage/vendor/braintree/braintree_php/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..d5009f28610 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ +# Summary + +# Checklist + +- [ ] Added changelog entry +- [ ] Ran unit tests (Check the README for instructions) diff --git a/upload/system/storage/vendor/braintree/braintree_php/.gitignore b/upload/system/storage/vendor/braintree/braintree_php/.gitignore new file mode 100644 index 00000000000..97994792db3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/.gitignore @@ -0,0 +1,7 @@ +/vendor +/docs +/tags +composer.lock +composer.phar +*.tgz +tests/fixtures/large_file.png diff --git a/upload/system/storage/vendor/braintree/braintree_php/ACKNOWLEDGEMENTS.md b/upload/system/storage/vendor/braintree/braintree_php/ACKNOWLEDGEMENTS.md new file mode 100644 index 00000000000..962607dac71 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/ACKNOWLEDGEMENTS.md @@ -0,0 +1,6 @@ +Acknowledgements +---------------- + +The Braintree SDK uses code from the following libraries: + +* [phpunit](https://github.com/sebastianbergmann/phpunit), BSD-3-Clause License diff --git a/upload/system/storage/vendor/braintree/braintree_php/Dockerfile b/upload/system/storage/vendor/braintree/braintree_php/Dockerfile new file mode 100644 index 00000000000..e741bd5bfe3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/Dockerfile @@ -0,0 +1,14 @@ +FROM debian:jessie + +RUN apt-get update +RUN apt-get -y install gnupg curl + +# For installing hhvm +RUN apt-get install -y apt-transport-https software-properties-common +RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 +RUN echo deb https://dl.hhvm.com/debian jessie main > /etc/apt/sources.list.d/hhvm.list +RUN apt-get update + +RUN apt-get -y install rake php5 php5-cli php5-curl php-pear hhvm phpunit + +WORKDIR /braintree-php diff --git a/upload/system/storage/vendor/braintree/braintree_php/Makefile b/upload/system/storage/vendor/braintree/braintree_php/Makefile new file mode 100644 index 00000000000..84146364803 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/Makefile @@ -0,0 +1,10 @@ +.PHONY: console build + +console: build + docker run -it -v="$(PWD):/braintree-php" --net="host" braintree-php /bin/bash -l -c "\ + curl -sS https://getcomposer.org/installer | php -d suhosin.executor.include.whitelist=phar && \ + php -d suhosin.executor.include.whitelist=phar ./composer.phar install; \ + bash" + +build: + docker build -t braintree-php . diff --git a/upload/system/storage/vendor/braintree/braintree_php/Rakefile b/upload/system/storage/vendor/braintree/braintree_php/Rakefile new file mode 100644 index 00000000000..ccb8567fc6f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/Rakefile @@ -0,0 +1,81 @@ +task :default => :test +task :test => %w[test:unit test:integration] + +namespace :test do + task :unit => %w[test:php:unit test:hhvm:unit] + task :integration => %w[test:php:integration test:hhvm:integration] + + namespace :php do + desc "print PHP version" + task :version do + print_php_version("php") + end + + desc "run unit tests under PHP" + task :unit => :version do + run_php_test_suite("php", "unit") + end + + desc "run integration tests under PHP" + task :integration do + run_php_test_suite("php", "integration") + end + end + + namespace :hhvm do + desc "print HHVM version" + task :version do + print_php_version("hhvm") + end + + desc "run tests under HHVM" + task :test => [:unit, :integration] + + desc "run unit tests under HHVM" + task :unit => :version do + run_php_test_suite("hhvm", "unit") + end + + desc "run integration tests under HHVM" + task :integration do + run_php_test_suite("hhvm", "integration") + end + end + + desc "run tests under PHP" + task :php => %w[php:unit php:integration] + + desc "run tests under HHVM" + task :hhvm => %w[hhvm:unit hhvm:integration] + + desc "run a single test file" + task :file, :file_path do |t, args| + run_php_test_file(args[:file_path]) + end + + desc "run single test (e.g. rake test:single[GatewayTest::testConfigGetsAssertedValid])" + task :single, :test_name do |t, args| + run_php_test(args[:test_name]) + end +end + +desc "update the copyright year" +task :copyright, :from_year, :to_year do |t, args| + sh "find tests lib -type f -name '*.php' -exec sed -i 's/#{args[:from_year]} Braintree/#{args[:to_year]} Braintree/g' {} +" +end + +def print_php_version(interpreter) + sh "#{interpreter} --version" +end + +def run_php_test_suite(interpreter, test_suite) + sh "#{interpreter} ./vendor/bin/phpunit --testsuite #{test_suite}" +end + +def run_php_test_file(test_file) + sh "./vendor/bin/phpunit #{test_file}" +end + +def run_php_test(test_name) + sh "./vendor/bin/phpunit --filter #{test_name}" +end diff --git a/upload/system/storage/vendor/braintree/braintree_php/ci.sh b/upload/system/storage/vendor/braintree/braintree_php/ci.sh new file mode 100755 index 00000000000..4f3e8b78b24 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/ci.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +curl -sS https://getcomposer.org/installer | php -d suhosin.executor.include.whitelist=phar + +php -d suhosin.executor.include.whitelist=phar ./composer.phar install + +if [ "$1" == "hhvm" ]; then + rake test:hhvm --trace +else + rake test:php --trace +fi diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AmexExpressCheckoutCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AmexExpressCheckoutCard.php new file mode 100644 index 00000000000..90d48f2af54 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AmexExpressCheckoutCard.php @@ -0,0 +1,80 @@ +== More information == + * + * See {@link https://developers.braintreepayments.com/javascript+php}
    + * + * @package Braintree + * @category Resources + * + * @property-read string $bin + * @property-read string $cardMemberExpiryDate + * @property-read string $cardMemberNumber + * @property-read string $cardType + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read boolean $default + * @property-read string $expirationMonth + * @property-read string $expirationYear + * @property-read string $imageUrl + * @property-read string $token + * @property-read string $sourceDescription + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read \DateTime $updatedAt + */ +class AmexExpressCheckoutCard extends Base +{ + /* instance methods */ + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * factory method: returns an instance of AmexExpressCheckoutCard + * to the requesting method, with populated properties + * + * @ignore + * @return AmexExpressCheckoutCard + */ + public static function factory($attributes) + { + + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + /** + * sets instance properties from an array of values + * + * @access protected + * @param array $amexExpressCheckoutCardAttribs array of Amex Express Checkout card properties + * @return void + */ + protected function _initialize($amexExpressCheckoutCardAttribs) + { + // set the attributes + $this->_attributes = $amexExpressCheckoutCardAttribs; + + $subscriptionArray = []; + if (isset($amexExpressCheckoutCardAttribs['subscriptions'])) { + foreach ($amexExpressCheckoutCardAttribs['subscriptions'] AS $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + } +} +class_alias('Braintree\AmexExpressCheckoutCard', 'Braintree_AmexExpressCheckoutCard'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AndroidPayCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AndroidPayCard.php new file mode 100644 index 00000000000..4d73c4d3454 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/AndroidPayCard.php @@ -0,0 +1,90 @@ +== More information == + * + * See {@link https://developers.braintreepayments.com/javascript+php}
    + * + * @package Braintree + * @category Resources + * + * @property-read string $bin + * @property-read string $cardType + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read boolean $default + * @property-read string $expirationMonth + * @property-read string $expirationYear + * @property-read string $googleTransactionId + * @property-read string $imageUrl + * @property-read string $last4 + * @property-read string $sourceCardLast4 + * @property-read string $sourceCardType + * @property-read string $sourceDescription + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read string $token + * @property-read \DateTime $updatedAt + * @property-read string $virtualCardLast4 + * @property-read string $virtualCardType + */ +class AndroidPayCard extends Base +{ + /* instance methods */ + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * factory method: returns an instance of AndroidPayCard + * to the requesting method, with populated properties + * + * @ignore + * @return AndroidPayCard + */ + public static function factory($attributes) + { + $defaultAttributes = [ + 'expirationMonth' => '', + 'expirationYear' => '', + 'last4' => $attributes['virtualCardLast4'], + 'cardType' => $attributes['virtualCardType'], + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } + + /** + * sets instance properties from an array of values + * + * @access protected + * @param array $androidPayCardAttribs array of Android Pay card properties + * @return void + */ + protected function _initialize($androidPayCardAttribs) + { + // set the attributes + $this->_attributes = $androidPayCardAttribs; + + $subscriptionArray = []; + if (isset($androidPayCardAttribs['subscriptions'])) { + foreach ($androidPayCardAttribs['subscriptions'] AS $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + } +} +class_alias('Braintree\AndroidPayCard', 'Braintree_AndroidPayCard'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CoinbaseAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CoinbaseAccount.php new file mode 100644 index 00000000000..a93fc1ce291 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/CoinbaseAccount.php @@ -0,0 +1,110 @@ +== More information == + * + * + * @package Braintree + * @category Resources + * + * @property-read string $customerId + * @property-read string $token + * @property-read string $userId + * @property-read string $userName + * @property-read string $userEmail + */ +class CoinbaseAccount extends Base +{ + /** + * factory method: returns an instance of CoinbaseAccount + * to the requesting method, with populated properties + * + * @ignore + * @return CoinbaseAccount + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + /* instance methods */ + + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * sets instance properties from an array of values + * + * @access protected + * @param array $coinbaseAccountAttribs array of coinbaseAccount data + * @return void + */ + protected function _initialize($coinbaseAccountAttribs) + { + // set the attributes + $this->_attributes = $coinbaseAccountAttribs; + + $subscriptionArray = []; + if (isset($coinbaseAccountAttribs['subscriptions'])) { + foreach ($coinbaseAccountAttribs['subscriptions'] AS $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + } + + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) .']'; + } + + + // static methods redirecting to gateway + + public static function find($token) + { + return Configuration::gateway()->coinbaseAccount()->find($token); + } + + public static function update($token, $attributes) + { + return Configuration::gateway()->coinbaseAccount()->update($token, $attributes); + } + + public static function delete($token) + { + return Configuration::gateway()->coinbaseAccount()->delete($token); + } + + public static function sale($token, $transactionAttribs) + { + return Configuration::gateway()->coinbaseAccount()->sale($token, $transactionAttribs); + } +} +class_alias('Braintree\CoinbaseAccount', 'Braintree_CoinbaseAccount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EuropeBankAccount.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EuropeBankAccount.php new file mode 100644 index 00000000000..b661e706364 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/EuropeBankAccount.php @@ -0,0 +1,67 @@ +== More information == + * + * See {@link https://developers.braintreepayments.com/javascript+php}
    + * + * @package Braintree + * @category Resources + * + * @property-read string $account-holder-name + * @property-read string $bic + * @property-read string $customerId + * @property-read string $default + * @property-read string $image-url + * @property-read string $mandate-reference-number + * @property-read string $masked-iban + * @property-read string $token + */ +class EuropeBankAccount extends Base +{ + + /* instance methods */ + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * factory method: returns an instance of EuropeBankAccount + * to the requesting method, with populated properties + * + * @ignore + * @return EuropeBankAccount + */ + public static function factory($attributes) + { + $defaultAttributes = [ + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } + + /** + * sets instance properties from an array of values + * + * @access protected + * @param array $europeBankAccountAttribs array of EuropeBankAccount properties + * @return void + */ + protected function _initialize($europeBankAccountAttribs) + { + $this->_attributes = $europeBankAccountAttribs; + } +} +class_alias('Braintree\EuropeBankAccount', 'Braintree_EuropeBankAccount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/DownForMaintenance.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/DownForMaintenance.php new file mode 100644 index 00000000000..ab5d5a11255 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Exception/DownForMaintenance.php @@ -0,0 +1,16 @@ +_attributes) . ']'; + } + + /** + * sets instance properties from an array of values + * + * @ignore + * @access protected + * @param array $ibanAttribs array of ibanBankAccount data + * @return void + */ + protected function _initialize($ibanAttribs) + { + // set the attributes + $this->_attributes = $ibanAttribs; + } + + /** + * factory method: returns an instance of IbanBankAccount + * to the requesting method, with populated properties + * @ignore + * @return IbanBankAccount + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } +} +class_alias('Braintree\IbanBankAccount', 'Braintree_IbanBankAccount'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPayment.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPayment.php new file mode 100644 index 00000000000..2ada135bb11 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPayment.php @@ -0,0 +1,92 @@ +== More information == + * + * + * @package Braintree + * @category Resources + * + * @property-read string $id + * @property-read string $idealTransactionId + * @property-read string $currency + * @property-read string $amount + * @property-read string $status + * @property-read string $orderId + * @property-read string $issuer + * @property-read string $ibanBankAccount + */ +class IdealPayment extends Base +{ + /** + * factory method: returns an instance of IdealPayment + * to the requesting method, with populated properties + * + * @ignore + * @return IdealPayment + */ + public static function factory($attributes) + { + $instance = new self(); + $instance->_initialize($attributes); + return $instance; + } + + /* instance methods */ + + /** + * sets instance properties from an array of values + * + * @access protected + * @param array $idealPaymentAttribs array of idealPayment data + * @return void + */ + protected function _initialize($idealPaymentAttribs) + { + // set the attributes + $this->_attributes = $idealPaymentAttribs; + + $ibanBankAccount = isset($idealPaymentAttribs['ibanBankAccount']) ? + IbanBankAccount::factory($idealPaymentAttribs['ibanBankAccount']) : + null; + $this->_set('ibanBankAccount', $ibanBankAccount); + } + + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) . ']'; + } + + + // static methods redirecting to gateway + + public static function find($idealPaymentId) + { + return Configuration::gateway()->idealPayment()->find($idealPaymentId); + } + + public static function sale($idealPaymentId, $transactionAttribs) + { + $transactionAttribs['options'] = [ + 'submitForSettlement' => true + ]; + return Configuration::gateway()->idealPayment()->sale($idealPaymentId, $transactionAttribs); + } +} +class_alias('Braintree\IdealPayment', 'Braintree_IdealPayment'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPaymentGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPaymentGateway.php new file mode 100644 index 00000000000..258bc46d096 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/IdealPaymentGateway.php @@ -0,0 +1,104 @@ +== More information == + * + * + * @package Braintree + * @category Resources + */ +class IdealPaymentGateway +{ + private $_gateway; + private $_config; + private $_http; + + public function __construct($gateway) + { + $this->_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + $this->_http = new Http($gateway->config); + } + + /** + * find an IdealPayment by id + * + * @access public + * @param string $idealPaymentId + * @return IdealPayment + * @throws Exception\NotFound + */ + public function find($idealPaymentId) + { + try { + $path = $this->_config->merchantPath() . '/ideal_payments/' . $idealPaymentId; + $response = $this->_http->get($path); + return IdealPayment::factory($response['idealPayment']); + } catch (Exception\NotFound $e) { + throw new Exception\NotFound( + 'iDEAL Payment with id ' . $idealPaymentId . ' not found' + ); + } + } + + /** + * create a new sale for the current IdealPayment + * + * @param string $idealPaymentId + * @param array $transactionAttribs + * @return Result\Successful|Result\Error + * @see Transaction::sale() + */ + public function sale($idealPaymentId, $transactionAttribs) + { + return Transaction::sale( + array_merge( + $transactionAttribs, + ['paymentMethodNonce' => $idealPaymentId] + ) + ); + } + + /** + * generic method for validating incoming gateway responses + * + * creates a new IdealPayment object and encapsulates + * it inside a Result\Successful object, or + * encapsulates a Errors object inside a Result\Error + * alternatively, throws an Unexpected exception if the response is invalid. + * + * @ignore + * @param array $response gateway response values + * @return Result\Successful|Result\Error + * @throws Exception\Unexpected + */ + private function _verifyGatewayResponse($response) + { + if (isset($response['idealPayment'])) { + // return a populated instance of IdealPayment + return new Result\Successful( + IdealPayment::factory($response['idealPayment']) + ); + } else if (isset($response['apiErrorResponse'])) { + return new Result\Error($response['apiErrorResponse']); + } else { + throw new Exception\Unexpected( + 'Expected Ideal Payment or apiErrorResponse' + ); + } + } +} +class_alias('Braintree\IdealPaymentGateway', 'Braintree_IdealPaymentGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MasterpassCard.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MasterpassCard.php new file mode 100644 index 00000000000..a7fdef2564d --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/MasterpassCard.php @@ -0,0 +1,141 @@ +== More information == + * + * For more detailed information on CreditCard verifications, see {@link https://developers.braintreepayments.com/reference/response/credit-card-verification/php https://developers.braintreepayments.com/reference/response/credit-card-verification/php} + * + * @package Braintree + * @category Resources + * + * @property-read \Braintree\Address $billingAddress + * @property-read string $bin + * @property-read string $cardType + * @property-read string $cardholderName + * @property-read string $commercial + * @property-read string $countryOfIssuance + * @property-read \DateTime $createdAt + * @property-read string $customerId + * @property-read string $customerLocation + * @property-read string $debit + * @property-read boolean $default + * @property-read string $durbinRegulated + * @property-read string $expirationDate + * @property-read string $expirationMonth + * @property-read string $expirationYear + * @property-read boolean $expired + * @property-read string $healthcare + * @property-read string $imageUrl + * @property-read string $issuingBank + * @property-read string $last4 + * @property-read string $maskedNumber + * @property-read string $payroll + * @property-read string $prepaid + * @property-read string $productId + * @property-read \Braintree\Subscription[] $subscriptions + * @property-read string $token + * @property-read string $uniqueNumberIdentifier + * @property-read \DateTime $updatedAt + */ +class MasterpassCard extends Base +{ + /* instance methods */ + /** + * returns false if default is null or false + * + * @return boolean + */ + public function isDefault() + { + return $this->default; + } + + /** + * checks whether the card is expired based on the current date + * + * @return boolean + */ + public function isExpired() + { + return $this->expired; + } + + /** + * sets instance properties from an array of values + * + * @access protected + * @param array $creditCardAttribs array of creditcard data + * @return void + */ + protected function _initialize($creditCardAttribs) + { + // set the attributes + $this->_attributes = $creditCardAttribs; + + // map each address into its own object + $billingAddress = isset($creditCardAttribs['billingAddress']) ? + Address::factory($creditCardAttribs['billingAddress']) : + null; + + $subscriptionArray = []; + if (isset($creditCardAttribs['subscriptions'])) { + foreach ($creditCardAttribs['subscriptions'] AS $subscription) { + $subscriptionArray[] = Subscription::factory($subscription); + } + } + + $this->_set('subscriptions', $subscriptionArray); + $this->_set('billingAddress', $billingAddress); + $this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear); + $this->_set('maskedNumber', $this->bin . '******' . $this->last4); + } + + /** + * returns false if comparing object is not a CreditCard, + * or is a CreditCard with a different id + * + * @param object $otherCreditCard customer to compare against + * @return boolean + */ + public function isEqual($otherMasterpassCard) + { + return !($otherMasterpassCard instanceof self) ? false : $this->token === $otherMasterpassCard->token; + } + + /** + * create a printable representation of the object as: + * ClassName[property=value, property=value] + * @return string + */ + public function __toString() + { + return __CLASS__ . '[' . + Util::attributesToString($this->_attributes) .']'; + } + + /** + * factory method: returns an instance of CreditCard + * to the requesting method, with populated properties + * + * @ignore + * @return MasterpassCard + */ + public static function factory($attributes) + { + $defaultAttributes = [ + 'bin' => '', + 'expirationMonth' => '', + 'expirationYear' => '', + 'last4' => '', + ]; + + $instance = new self(); + $instance->_initialize(array_merge($defaultAttributes, $attributes)); + return $instance; + } +} +class_alias('Braintree\MasterpassCard', 'Braintree_MasterpassCard'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AmexExpressCheckoutCardDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AmexExpressCheckoutCardDetails.php new file mode 100644 index 00000000000..a5a29ac863d --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/AmexExpressCheckoutCardDetails.php @@ -0,0 +1,43 @@ +_attributes['cardType'] = $this->virtualCardType; + $this->_attributes['last4'] = $this->virtualCardLast4; + } +} +class_alias('Braintree\Transaction\AndroidPayCardDetails', 'Braintree_Transaction_AndroidPayCardDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CoinbaseDetails.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CoinbaseDetails.php new file mode 100644 index 00000000000..60c152643d2 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/Transaction/CoinbaseDetails.php @@ -0,0 +1,38 @@ +_attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear; + $this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4; + + } +} +class_alias('Braintree\Transaction\MasterpassCardDetails', 'Braintree_Transaction_MasterpassCardDetails'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirect.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirect.php new file mode 100644 index 00000000000..30f274db86c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirect.php @@ -0,0 +1,100 @@ + + * $trData = TransparentRedirect::createCustomerData(array( + * 'redirectUrl => 'http://example.com/redirect_back_to_merchant_site', + * )); + * + * + * In addition to the redirectUrl, any data that needs to be protected + * from user tampering should be included in the trData. + * For example, to prevent the user from tampering with the transaction + * amount, include the amount in the trData. + * + * + * $trData = TransparentRedirect::transactionData(array( + * 'redirectUrl' => 'http://example.com/complete_transaction', + * 'transaction' => array('amount' => '100.00'), + * )); + * + * + * + * @package Braintree + * @category Resources + */ +class TransparentRedirect +{ + // Request Kinds + const CREATE_TRANSACTION = 'create_transaction'; + const CREATE_PAYMENT_METHOD = 'create_payment_method'; + const UPDATE_PAYMENT_METHOD = 'update_payment_method'; + const CREATE_CUSTOMER = 'create_customer'; + const UPDATE_CUSTOMER = 'update_customer'; + + /** + * @ignore + * don't permit an explicit call of the constructor! + * (like $t = new TransparentRedirect()) + */ + protected function __construct() + { + + } + + + // static methods redirecting to gateway + + public static function confirm($queryString) + { + return Configuration::gateway()->transparentRedirect()->confirm($queryString); + } + + public static function createCreditCardData($params) + { + return Configuration::gateway()->transparentRedirect()->createCreditCardData($params); + } + + public static function createCustomerData($params) + { + return Configuration::gateway()->transparentRedirect()->createCustomerData($params); + } + + public static function url() + { + return Configuration::gateway()->transparentRedirect()->url(); + } + + public static function transactionData($params) + { + return Configuration::gateway()->transparentRedirect()->transactionData($params); + } + + public static function updateCreditCardData($params) + { + return Configuration::gateway()->transparentRedirect()->updateCreditCardData($params); + } + + public static function updateCustomerData($params) + { + return Configuration::gateway()->transparentRedirect()->updateCustomerData($params); + } + + public static function parseAndValidateQueryString($queryString) + { + return Configuration::gateway()->transparentRedirect()->parseAndValidateQueryString($queryString); + } +} +class_alias('Braintree\TransparentRedirect', 'Braintree_TransparentRedirect'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirectGateway.php b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirectGateway.php new file mode 100644 index 00000000000..3308af0296e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/lib/Braintree/TransparentRedirectGateway.php @@ -0,0 +1,289 @@ +_gateway = $gateway; + $this->_config = $gateway->config; + $this->_config->assertHasAccessTokenOrKeys(); + } + + /** + * + * @ignore + */ + private static $_transparentRedirectKeys = 'redirectUrl'; + private static $_createCustomerSignature; + private static $_updateCustomerSignature; + private static $_transactionSignature; + private static $_createCreditCardSignature; + private static $_updateCreditCardSignature; + + /** + * create signatures for different call types + * @ignore + */ + public static function init() + { + + self::$_createCustomerSignature = [ + self::$_transparentRedirectKeys, + ['customer' => CustomerGateway::createSignature()], + ]; + self::$_updateCustomerSignature = [ + self::$_transparentRedirectKeys, + 'customerId', + ['customer' => CustomerGateway::updateSignature()], + ]; + self::$_transactionSignature = [ + self::$_transparentRedirectKeys, + ['transaction' => TransactionGateway::createSignature()], + ]; + self::$_createCreditCardSignature = [ + self::$_transparentRedirectKeys, + ['creditCard' => CreditCardGateway::createSignature()], + ]; + self::$_updateCreditCardSignature = [ + self::$_transparentRedirectKeys, + 'paymentMethodToken', + ['creditCard' => CreditCardGateway::updateSignature()], + ]; + } + + public function confirm($queryString) + { + $params = TransparentRedirect::parseAndValidateQueryString( + $queryString + ); + $confirmationKlasses = [ + TransparentRedirect::CREATE_TRANSACTION => 'Braintree\TransactionGateway', + TransparentRedirect::CREATE_CUSTOMER => 'Braintree\CustomerGateway', + TransparentRedirect::UPDATE_CUSTOMER => 'Braintree\CustomerGateway', + TransparentRedirect::CREATE_PAYMENT_METHOD => 'Braintree\CreditCardGateway', + TransparentRedirect::UPDATE_PAYMENT_METHOD => 'Braintree\CreditCardGateway', + ]; + $confirmationGateway = new $confirmationKlasses[$params["kind"]]($this->_gateway); + return $confirmationGateway->_doCreate('/transparent_redirect_requests/' . $params['id'] . '/confirm', []); + } + + /** + * returns the trData string for creating a credit card, + * @param array $params + * @return string + */ + public function createCreditCardData($params) + { + Util::verifyKeys( + self::$_createCreditCardSignature, + $params + ); + $params["kind"] = TransparentRedirect::CREATE_PAYMENT_METHOD; + return $this->_data($params); + } + + /** + * returns the trData string for creating a customer. + * @param array $params + * @return string + */ + public function createCustomerData($params) + { + Util::verifyKeys( + self::$_createCustomerSignature, + $params + ); + $params["kind"] = TransparentRedirect::CREATE_CUSTOMER; + return $this->_data($params); + + } + + public function url() + { + return $this->_config->baseUrl() . $this->_config->merchantPath() . '/transparent_redirect_requests'; + } + + /** + * returns the trData string for creating a transaction + * @param array $params + * @return string + */ + public function transactionData($params) + { + Util::verifyKeys( + self::$_transactionSignature, + $params + ); + $params["kind"] = TransparentRedirect::CREATE_TRANSACTION; + $transactionType = isset($params['transaction']['type']) ? + $params['transaction']['type'] : + null; + if ($transactionType != Transaction::SALE && $transactionType != Transaction::CREDIT) { + throw new InvalidArgumentException( + 'expected transaction[type] of sale or credit, was: ' . + $transactionType + ); + } + + return $this->_data($params); + } + + /** + * Returns the trData string for updating a credit card. + * + * The paymentMethodToken of the credit card to update is required. + * + * + * $trData = TransparentRedirect::updateCreditCardData(array( + * 'redirectUrl' => 'http://example.com/redirect_here', + * 'paymentMethodToken' => 'token123', + * )); + * + * + * @param array $params + * @return string + */ + public function updateCreditCardData($params) + { + Util::verifyKeys( + self::$_updateCreditCardSignature, + $params + ); + if (!isset($params['paymentMethodToken'])) { + throw new InvalidArgumentException( + 'expected params to contain paymentMethodToken.' + ); + } + $params["kind"] = TransparentRedirect::UPDATE_PAYMENT_METHOD; + return $this->_data($params); + } + + /** + * Returns the trData string for updating a customer. + * + * The customerId of the customer to update is required. + * + * + * $trData = TransparentRedirect::updateCustomerData(array( + * 'redirectUrl' => 'http://example.com/redirect_here', + * 'customerId' => 'customer123', + * )); + * + * + * @param array $params + * @return string + */ + public function updateCustomerData($params) + { + Util::verifyKeys( + self::$_updateCustomerSignature, + $params + ); + if (!isset($params['customerId'])) { + throw new InvalidArgumentException( + 'expected params to contain customerId of customer to update' + ); + } + $params["kind"] = TransparentRedirect::UPDATE_CUSTOMER; + return $this->_data($params); + } + + public function parseAndValidateQueryString($queryString) + { + // parse the params into an array + parse_str($queryString, $params); + // remove the hash + $queryStringWithoutHash = null; + if (preg_match('/^(.*)&hash=[a-f0-9]+$/', $queryString, $match)) { + $queryStringWithoutHash = $match[1]; + } + + if($params['http_status'] != '200') { + $message = null; + if(array_key_exists('bt_message', $params)) { + $message = $params['bt_message']; + } + Util::throwStatusCodeException(isset($params['http_status']) ? $params['http_status'] : null, $message); + } + + // recreate the hash and compare it + if ($this->_hash($queryStringWithoutHash) == $params['hash']) { + return $params; + } else { + throw new Exception\ForgedQueryString(); + } + } + + + /** + * + * @ignore + */ + private function _data($params) + { + if (!isset($params['redirectUrl'])) { + throw new InvalidArgumentException( + 'expected params to contain redirectUrl' + ); + } + $params = $this->_underscoreKeys($params); + $now = new DateTime('now', new DateTimeZone('UTC')); + $trDataParams = array_merge($params, + [ + 'api_version' => Configuration::API_VERSION, + 'public_key' => $this->_config->publicKey(), + 'time' => $now->format('YmdHis'), + ] + ); + ksort($trDataParams); + $urlEncodedData = http_build_query($trDataParams, null, "&"); + $signatureService = new SignatureService( + $this->_config->privateKey(), + "Braintree\Digest::hexDigestSha1" + ); + return $signatureService->sign($urlEncodedData); + } + + private function _underscoreKeys($array) + { + foreach($array as $key=>$value) + { + $newKey = Util::camelCaseToDelimiter($key, '_'); + unset($array[$key]); + if (is_array($value)) + { + $array[$newKey] = $this->_underscoreKeys($value); + } + else + { + $array[$newKey] = $value; + } + } + return $array; + } + + /** + * @ignore + */ + private function _hash($string) + { + return Digest::hexDigestSha1($this->_config->privateKey(), $string); + } +} +TransparentRedirectGateway::init(); +class_alias('Braintree\TransparentRedirectGateway', 'Braintree_TransparentRedirectGateway'); diff --git a/upload/system/storage/vendor/braintree/braintree_php/phpunit.xml.dist b/upload/system/storage/vendor/braintree/braintree_php/phpunit.xml.dist new file mode 100644 index 00000000000..074ca7f7f28 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/phpunit.xml.dist @@ -0,0 +1,24 @@ + + + + + + + + + + ./tests/unit + + + ./tests/integration + + + diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/Braintree/CreditCardDefaults.php b/upload/system/storage/vendor/braintree/braintree_php/tests/Braintree/CreditCardDefaults.php new file mode 100644 index 00000000000..a0959736c90 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/Braintree/CreditCardDefaults.php @@ -0,0 +1,8 @@ +config); + $http->useClientCredentials(); + $response = $http->post('/oauth_testing/grants', ['grant' => $params]); + return $response['grant']['code']; + } + + public static function createCredentials($params) + { + $gateway = new Braintree\Gateway([ + 'clientId' => $params['clientId'], + 'clientSecret' => $params['clientSecret'] + ]); + + $code = OAuthTestHelper::createGrant($gateway, [ + 'merchant_public_id' => $params['merchantId'], + 'scope' => 'read_write' + ]); + + $credentials = $gateway->oauth()->createTokenFromCode([ + 'code' => $code, + 'scope' => 'read_write', + ]); + + return $credentials; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/Helper.php b/upload/system/storage/vendor/braintree/braintree_php/tests/Helper.php new file mode 100644 index 00000000000..22009cc69ea --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/Helper.php @@ -0,0 +1,344 @@ + 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + } + + public static function advancedFraudIntegrationMerchantGateway() + { + return new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'advanced_fraud_integration_merchant_id', + 'publicKey' => 'advanced_fraud_integration_public_key', + 'privateKey' => 'advanced_fraud_integration_private_key' + ]); + } + + public static function defaultMerchantAccountId() + { + return 'sandbox_credit_card'; + } + + public static function nonDefaultMerchantAccountId() + { + return 'sandbox_credit_card_non_default'; + } + + public static function nonDefaultSubMerchantAccountId() + { + return 'sandbox_sub_merchant_account'; + } + + public static function threeDSecureMerchantAccountId() + { + return 'three_d_secure_merchant_account'; + } + + public static function fakeAmexDirectMerchantAccountId() + { + return 'fake_amex_direct_usd'; + } + + public static function fakeVenmoAccountMerchantAccountId() + { + return 'fake_first_data_venmo_account'; + } + + public static function usBankMerchantAccount() { + return 'us_bank_merchant_account'; + } + + public static function anotherUsBankMerchantAccount() { + return 'another_us_bank_merchant_account'; + } + + public static function createViaTr($regularParams, $trParams) + { + $trData = Braintree\TransparentRedirect::transactionData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + return self::submitTrRequest( + Braintree\TransparentRedirect::url(), + $regularParams, + $trData + ); + } + + public static function submitTrRequest($url, $regularParams, $trData) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST'); + curl_setopt($curl, CURLOPT_HEADER, true); + // curl_setopt($curl, CURLOPT_VERBOSE, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array_merge($regularParams, ['tr_data' => $trData]))); + curl_setopt($curl, CURLOPT_HTTPHEADER, [ + 'Content-Type: application/x-www-form-urlencoded' + ]); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($curl); + curl_close($curl); + preg_match('/Location: .*\?(.*)/i', $response, $match); + return trim($match[1]); + } + + public static function suppressDeprecationWarnings() + { + set_error_handler("Test\Helper::_errorHandler", E_USER_NOTICE); + } + + public static function _errorHandler($errno, $errstr, $errfile, $errline) + { + if (preg_match('/^DEPRECATED/', $errstr) == 0) { + trigger_error('Unknown error received: ' . $errstr, E_USER_ERROR); + } + } + + public static function includes($collection, $targetItem) + { + foreach ($collection AS $item) { + if ($item->id == $targetItem->id) { + return true; + } + } + return false; + } + + public static function assertPrintable($object) + { + " " . $object; + } + + public static function escrow($transactionId) + { + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/transactions/' . $transactionId . '/escrow'; + $http->put($path); + } + + public static function create3DSVerification($merchantAccountId, $params) + { + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/three_d_secure/create_verification/' . $merchantAccountId; + $response = $http->post($path, ['threeDSecureVerification' => $params]); + return $response['threeDSecureVerification']['threeDSecureToken']; + } + + public static function generate3DSNonce($params) + { + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/three_d_secure/create_nonce/' . self::threeDSecureMerchantAccountId(); + $response = $http->post($path, $params); + return $response['paymentMethodNonce']['nonce']; + } + + public static function nowInEastern() + { + $eastern = new DateTimeZone('America/New_York'); + $now = new DateTime('now', $eastern); + return $now->format('Y-m-d'); + } + + public static function decodedClientToken($params=[]) { + $encodedClientToken = Braintree\ClientToken::generate($params); + return base64_decode($encodedClientToken); + } + + public static function generateValidUsBankAccountNonce($accountNumber = '567891234') { + $client_token = json_decode(Helper::decodedClientToken(), true); + $url = $client_token['braintree_api']['url'] . '/tokens'; + $token = $client_token['braintree_api']['access_token']; + + $curl = curl_init(); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($curl, CURLOPT_URL, $url); + + $headers[] = 'Content-Type: application/json'; + $headers[] = 'Braintree-Version: 2016-10-07'; + $headers[] = 'Authorization: Bearer ' . $token; + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + + $requestBody = [ + 'type' => 'us_bank_account', + 'billing_address' => [ + 'street_address' => '123 Ave', + 'region' => 'CA', + 'locality' => 'San Francisco', + 'postal_code' => '94112' + ], + 'account_type' => 'checking', + 'ownership_type' => 'personal', + 'routing_number' => '021000021', + 'account_number' => $accountNumber, + 'first_name' => 'Dan', + 'last_name' => 'Schulman', + 'ach_mandate' => [ + 'text' => 'cl mandate text' + ] + ]; + + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($requestBody)); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + + $response = curl_exec($curl); + $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $error_code = curl_errno($curl); + curl_close($curl); + $jsonResponse = json_decode($response, true); + return $jsonResponse['data']['id']; + } + + public static function generatePlaidUsBankAccountNonce() { + $client_token = json_decode(Helper::decodedClientToken(), true); + $url = $client_token['braintree_api']['url'] . '/tokens'; + $token = $client_token['braintree_api']['access_token']; + + $curl = curl_init(); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($curl, CURLOPT_URL, $url); + + $headers[] = 'Content-Type: application/json'; + $headers[] = 'Braintree-Version: 2016-10-07'; + $headers[] = 'Authorization: Bearer ' . $token; + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + + $requestBody = [ + 'type' => 'plaid_public_token', + 'public_token' => 'good', + 'account_id' => 'plaid_account_id', + 'billing_address' => [ + 'street_address' => '123 Ave', + 'region' => 'CA', + 'locality' => 'San Francisco', + 'postal_code' => '94112' + ], + 'ownership_type' => 'personal', + 'first_name' => 'Dan', + 'last_name' => 'Schulman', + 'ach_mandate' => [ + 'text' => 'cl mandate text' + ] + ]; + + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($requestBody)); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + + $response = curl_exec($curl); + $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $error_code = curl_errno($curl); + curl_close($curl); + $jsonResponse = json_decode($response, true); + return $jsonResponse['data']['id']; + } + + public static function generateInvalidUsBankAccountNonce() { + $valid_characters = str_split(self::$valid_nonce_characters); + $nonce = 'tokenusbankacct'; + for($i=0; $i<4; $i++) { + $nonce = $nonce . '_'; + for($j=0; $j<6; $j++) { + $t = rand(0, sizeof($valid_characters)-1); + $nonce = $nonce . $valid_characters[$t]; + } + } + return $nonce . "_xxx"; + } + + public static function generateValidIdealPaymentId($amount = null) { + if (null === $amount) { + $amount = '100.00'; + } + + $client_token = json_decode(Helper::decodedClientToken([ + 'merchantAccountId' => 'ideal_merchant_account' + ]), true); + + $client = new Integration\HttpClientApi(Braintree\Configuration::$global); + $configuration = $client->get_configuration([ + "authorization_fingerprint" => $client_token['authorizationFingerprint'], + ]); + + $url = $client_token['braintree_api']['url'] . '/ideal-payments'; + $token = $client_token['braintree_api']['access_token']; + + $curl = curl_init(); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($curl, CURLOPT_URL, $url); + + $headers[] = 'Content-Type: application/json'; + $headers[] = 'Braintree-Version: 2015-11-01'; + $headers[] = 'Authorization: Bearer ' . $token; + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + + $requestBody = [ + 'issuer' => 'RABONL2U', + 'order_id' => 'ABC123', + 'amount' => $amount, + 'currency' => 'EUR', + 'redirect_url' => 'https://braintree-api.com', + 'route_id' => $configuration->ideal->routeId, + ]; + + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($requestBody)); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + + $response = curl_exec($curl); + $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $error_code = curl_errno($curl); + curl_close($curl); + $jsonResponse = json_decode($response, true); + return $jsonResponse['data']['id']; + } + + public static function generateInvalidIdealPaymentId() { + $valid_characters = str_split(self::$valid_nonce_characters); + $ideal_payment_id = 'idealpayment'; + for($i=0; $i<4; $i++) { + $ideal_payment_id = $ideal_payment_id . '_'; + for($j=0; $j<6; $j++) { + $t = rand(0, sizeof($valid_characters)-1); + $ideal_payment_id = $ideal_payment_id . $valid_characters[$t]; + } + } + return $ideal_payment_id . "_xxx"; + } + + public static function sampleNotificationFromXml($xml) { + $config = Helper::integrationMerchantGateway()->config; + $payload = base64_encode($xml) . "\n"; + $signature = $config->getPublicKey() . "|" . Braintree\Digest::hexDigestSha1($config->getPrivateKey(), $payload); + + return [ + 'bt_signature' => $signature, + 'bt_payload' => $payload + ]; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/SanityTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/SanityTest.php new file mode 100644 index 00000000000..0f3a28e94ef --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/SanityTest.php @@ -0,0 +1,20 @@ +markTestSkipped("Requires PHP >=5.4"); + } + + $returnValue = null; + + $testFile = escapeshellarg(realpath(__DIR__ . '/Braintree/fixtures/composer_implementation.php')); + $command = sprintf('%s %s', PHP_BINARY, $testFile); + + system($command, $returnValue); + + $this->assertEquals(0, $returnValue); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/Setup.php b/upload/system/storage/vendor/braintree/braintree_php/tests/Setup.php new file mode 100644 index 00000000000..97092c5a8fd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/Setup.php @@ -0,0 +1,32 @@ +}P)-ursbm~sAjZO5JQ<_gc*FBQ$v9x2}ITy$_P?0DTo-5f}(v0XNmYiU(mHuqB=n@*wH*7@ccV=?x|Q zI`YaTwK!5b))qc1Gc^}xwp-E!e1_HmP64(7NE!wVO^`nfl;QhbU%-GRz+GncMuA9D zBj6ff7;rkiI;;g|05i=@X+5H>3sTANn%Vd)y(NtV&WX=mz#YICU@*`GSO+``%qWy6 zX(G@9I63%QNt&J#{kECinJA|YFg2+YFdq0ma5=s=ZvY-Ov&T|8)&oWYmjIpcGt8?& zJ2$6Z$A{c2@fFm7)xZ;^+b(aWM&6~7w?oniiS%Ej_TQ(R37%ql74UMpW70ZFnwP^nF2Q%Aq-90Q`K`PIlVvrP zw4eyj(~|0Eb?R106XTg23YNz+GF3=#N!O~X!73$flytSEwvxI=-abjAf~St8S(09n zG(=JpNuQTAHuxp!?2Jz8CFwiy+#7VoI`ylPZc9|SBI?siQaef0B7MK4(}HJs)aO@` zw>iF(&n2mHj*IkyPK7%BPEwz!+s`6xMbMk1=OS&rq>JR+T+@)XJMwNzl{G8UH%Yoe zQe#PtLho&nHzli6^DwJW`HTkqYtZbF)HapZMpENcT0Kd1Gvq7`Ib-rVE9kx!bVX0U zlDZ`HADhZMUecDx8=T7f*n6s^{)w_CrSeQtmkio+Nu4ufjf(uTLfc8|mXLo|2G7vQ z+b5}YdQaU1+!()408Ro1;_Lo-k_MUCzjEsKxS73~Ovt(CwFa)1)DPdk%J4nzbCKUD zNB-eLz=J8h_Dfm^v;^vBavdHjfC;Ix1pGUZ)IZ*3z+KWoM~K3JZ;YP{o=NcR27a8u zV?br_4oG+E2WB=il{QJzeZY_Kt4)8hu`(z9BS;zo%)|#wIX;M50e!0D{RH^H%(iBv zSJpsTZ=2b+YG|6py9IDrHMDI~JPi+pr|9W7fyH>Ib}vG+?-1ln#XIyt;8ru+2_UH@ zFpK;FQ=2GscD=*kJ(Mp@UPz>`Ftf42GafhkpB-f^ z0A`!nR7n@%gS0O`n3f0cN2hy9i-Y$qU>dL)=m&fox08Rv%;w5(1S6uIdS|rXWHXze z(GKH)yW{h3z#L#J&>rv59{2?6X=b~E=exi|!LtZ>5}&!J1K*5x+ywNf&h}ftQb`9~ z{w3`#LjPX6BEfU6s!p9rtdq1P@m-$ax%&|GlceVpJXv?eDUo+WM&9cwJ=@9eoM}|Z zEo}9IE`3)|G$ER2>^0RzbP z?f~pFvxPa8X-t(Br4pYh^Y9s5u;$3jo(=l;_-L#S+s$lw@O+V~nP0#LGg~dcnsrI# z?J=`ODLv}~gYcEAIX-LWn%Ub4nhy9XmxtHP?47(!NlkG}SvQ~o-rg?)OU-P54o^ei z>p)NZe6kt%C$QMeitV)}lu$wmC6rJ?2_=+J!m$Az=zrZSX{Ds0)pKUbsxN70Lf#fh zf0Wd`2v1kJ8*V}#O-Z5pfwFwUCD%xaZ`E zgv1=GLI0?Pq;qqO99?kp;0?fOxLvdm4ss=MCLTJn3lGux6K)WB!ORv(GT=Jgm9;Ts z&M~twl9~YD3wdpUQFy2S88=@prpmbST1wv&f#JB<wAh5x-j|^y(@PZ*3O3ALQ)*zehB7e@WM;(tD?DqVG$3K+<{f{YcPtj_+sU`+2!- z_bbs+%Ous6^!tRYa{2x|OwyAv5V{Bd^q?6e>19cqQhME|MC`OYB4Tt5oIdgpm9g>| z>j|OXt&+w`x<(%IGFH-0<&i4aOZvH_!3xh&473)<y$GB6;O-8J6#o1>+f zU5m#p1H2ON!gpbboB;!oLS?@?MH2zFr3cf#HXJ%_+W_1R(n%Vl4 zyv2B9uf(0!o$(NrI(URax>L8wJzWcd^Ks|J($IGU?khbBcnNpG0lY6a`ZvJcn`OYo zLBAC^6+ghO0v?Mt!7^L!D2AlgKr1s_5#N1)b!N6DzAwgorBjn0mBLJoKm((no_CL~5|Kek|uy6nX002ov JPDHLkV1iq1mhAul literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/gif_extension_bt_logo.gif b/upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/gif_extension_bt_logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..943ec2c5ebf1c0bde1df6dc4a6b83cf0c5b0b741 GIT binary patch literal 2443 zcmV;633T>}P)-ursbm~sAjZO5JQ<_gc*FBQ$v9x2}ITy$_P?0DTo-5f}(v0XNmYiU(mHuqB=n@*wH*7@ccV=?x|Q zI`YaTwK!5b))qc1Gc^}xwp-E!e1_HmP64(7NE!wVO^`nfl;QhbU%-GRz+GncMuA9D zBj6ff7;rkiI;;g|05i=@X+5H>3sTANn%Vd)y(NtV&WX=mz#YICU@*`GSO+``%qWy6 zX(G@9I63%QNt&J#{kECinJA|YFg2+YFdq0ma5=s=ZvY-Ov&T|8)&oWYmjIpcGt8?& zJ2$6Z$A{c2@fFm7)xZ;^+b(aWM&6~7w?oniiS%Ej_TQ(R37%ql74UMpW70ZFnwP^nF2Q%Aq-90Q`K`PIlVvrP zw4eyj(~|0Eb?R106XTg23YNz+GF3=#N!O~X!73$flytSEwvxI=-abjAf~St8S(09n zG(=JpNuQTAHuxp!?2Jz8CFwiy+#7VoI`ylPZc9|SBI?siQaef0B7MK4(}HJs)aO@` zw>iF(&n2mHj*IkyPK7%BPEwz!+s`6xMbMk1=OS&rq>JR+T+@)XJMwNzl{G8UH%Yoe zQe#PtLho&nHzli6^DwJW`HTkqYtZbF)HapZMpENcT0Kd1Gvq7`Ib-rVE9kx!bVX0U zlDZ`HADhZMUecDx8=T7f*n6s^{)w_CrSeQtmkio+Nu4ufjf(uTLfc8|mXLo|2G7vQ z+b5}YdQaU1+!()408Ro1;_Lo-k_MUCzjEsKxS73~Ovt(CwFa)1)DPdk%J4nzbCKUD zNB-eLz=J8h_Dfm^v;^vBavdHjfC;Ix1pGUZ)IZ*3z+KWoM~K3JZ;YP{o=NcR27a8u zV?br_4oG+E2WB=il{QJzeZY_Kt4)8hu`(z9BS;zo%)|#wIX;M50e!0D{RH^H%(iBv zSJpsTZ=2b+YG|6py9IDrHMDI~JPi+pr|9W7fyH>Ib}vG+?-1ln#XIyt;8ru+2_UH@ zFpK;FQ=2GscD=*kJ(Mp@UPz>`Ftf42GafhkpB-f^ z0A`!nR7n@%gS0O`n3f0cN2hy9i-Y$qU>dL)=m&fox08Rv%;w5(1S6uIdS|rXWHXze z(GKH)yW{h3z#L#J&>rv59{2?6X=b~E=exi|!LtZ>5}&!J1K*5x+ywNf&h}ftQb`9~ z{w3`#LjPX6BEfU6s!p9rtdq1P@m-$ax%&|GlceVpJXv?eDUo+WM&9cwJ=@9eoM}|Z zEo}9IE`3)|G$ER2>^0RzbP z?f~pFvxPa8X-t(Br4pYh^Y9s5u;$3jo(=l;_-L#S+s$lw@O+V~nP0#LGg~dcnsrI# z?J=`ODLv}~gYcEAIX-LWn%Ub4nhy9XmxtHP?47(!NlkG}SvQ~o-rg?)OU-P54o^ei z>p)NZe6kt%C$QMeitV)}lu$wmC6rJ?2_=+J!m$Az=zrZSX{Ds0)pKUbsxN70Lf#fh zf0Wd`2v1kJ8*V}#O-Z5pfwFwUCD%xaZ`E zgv1=GLI0?Pq;qqO99?kp;0?fOxLvdm4ss=MCLTJn3lGux6K)WB!ORv(GT=Jgm9;Ts z&M~twl9~YD3wdpUQFy2S88=@prpmbST1wv&f#JB<wAh5x-j|^y(@PZ*3O3ALQ)*zehB7e@WM;(tD?DqVG$3K+<{f{YcPtj_+sU`+2!- z_bbs+%Ous6^!tRYa{2x|OwyAv5V{Bd^q?6e>19cqQhME|MC`OYB4Tt5oIdgpm9g>| z>j|OXt&+w`x<(%IGFH-0<&i4aOZvH_!3xh&473)<y$GB6;O-8J6#o1>+f zU5m#p1H2ON!gpbboB;!oLS?@?MH2zFr3cf#HXJ%_+W_1R(n%Vl4 zyv2B9uf(0!o$(NrI(URax>L8wJzWcd^Ks|J($IGU?khbBcnNpG0lY6a`ZvJcn`OYo zLBAC^6+ghO0v?Mt!7^L!D2AlgKr1s_5#N1)b!N6DzAwgorBjn0mBLJoKm((no_CL~5|Kek|uy6nX002ov JPDHLkV1iq1mhAul literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/malformed_pdf.pdf b/upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/malformed_pdf.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7fc3a2997847fd0c1957204c89a6fb0ffb14880e GIT binary patch literal 150 zcma!ufP+K(?BmkYvXjzE*$!Cwk>A`XZhhq#zTAb%@6M~KiqJ5 z?xESKK&sX8(0)-1QTxLUht@L59qKka+-MYic%8Vjut#Tzm^LCA9+mU literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/too_long.pdf b/upload/system/storage/vendor/braintree/braintree_php/tests/fixtures/too_long.pdf new file mode 100644 index 0000000000000000000000000000000000000000..24039f4d878a25c0156b9efe8a674130eb652d07 GIT binary patch literal 79008 zcmchg&5j+(b?3bqFKRz)-;p7d44b?eADMYCK~m@z)v}y*;r;~9rY;L~!`;*6yx1S%bzde4pnegUp``P8y@o>A@es*x<<({442B8q?n}oGfqLK*2h9@8M>ZD&WWgCllOng57(o-bwL}1K!_% zz)5A9V(%$nAMQQitWpL1KHERKmY?rG;H0t)IIwet`**IaQU%P;74F};vPu;&J6E`W z=gKO}fFnCsynpA)DpkPjT=D*$E2}I69@)9Z`**IaQU%P;HQv8-WtA#mcCPXMohz#> z1D@Eqru%oUtWpKc&Nbb?b7hrfz%x77eE-gsRjPp5x#s(KuB=i8%+596zjI}kWxzXj zuHF4RS5~P4X6M@7zjI}kWx#uOuKoQxS5~P4X6M@9zjI}kDqwc5{rx*vR#^t@2KFvD z+`oH?P8~Kom>cfj!$hYF+w9lhzmqwuXYbg}T<(b9bKl$_n1T7%xcGrIfE=#|IXZGho0OG~gQGfap{<-xaf|@d;>NRojPpxHQ#^@M5hYdU<2QP4Me97+wippY~T$x@CF{IfDOFC2Hs!;-+&E7r%JcM2EG9sh)x~0 zQLi;%18=Z_H`u^8U<1*q(rvJTZ@>nkQ-y7?fp5SDqEm-$)N2jcz#DAf4L0x%*g$lu zbQ^5o8?b@s)L|R-S_3xl1{-*T4SWMO5S=RB1{?SWY#=&y*han9fDOFC2Eky1(0~m@ zXPNF`ut8|R2BK4iZLmRTzy_jIht2g`Xut-dQ-{sI78bG;TC zuz~1QVH<1^8nA)r)L|RG)_@Iy!3M!#gV2BtM5ju(!3LoL8;DLFw&80H*dQ2e5DYd5 z4cI_*s&pG{5E`(7=+t2w^;!cq2nHJjgAGChHV~aE-3A+k25cZYRoDg_ga&LNI(67a zz1DyYg24vCV1v+r4Me9(x4{OX0UL-;9kx-gHDH5aut6}`AT(eD(W%mHut8|R2BK4k zZPaTG*dQ2e5Dhkn4cI_*mg$ZL8^i`|AUajp1{=f%Y#=&y*j%s025cZYb=d4{u>l*1 zP8GJn2C)Gfh)x|g*K4r>8;DL7w!sFm0UL-;9k$_X4cH(WY!D4Lhz;04bgFb4Y!Dl; zf#}p>8@|?n4WhvY(O`qvfDJ^aO1HrVu>l*1P93&UuQgzUXs|&v*dR7w1JS9{ZLmRX zzy_jIg>A4wY`_MhQ-^KTYYo^S8f*{^Hi!+_Ky<2f8*C68uz~2*VH@>Y12%{T8$^Q* zVgoi1ohsc18^i`|AUbu}M!nX64WhvYqrnDa12zzyWx7X$4aNp+AUajp1{;hG*g$mZ zu(@6v8?b@s)M2x)jSbj9bgHloHW(YQf#}p>bGy7#pyG=v3)8*kEkH2BK4kZPaTG z*kCl+U^LiZY`_MhQ>EKrgRub{h)xx@!3JXkHV~aUY@=Rlzy_ni2BX0SV*@r2ohsc1 z8;lLuKy>P`je4yC8;k}Uj0PKw4cI_*s&pG{Fg9QV(W%2W>a_-JFdA$y8Eh~$U<1)v zrh78jU~0eyqEm%!u))-T4Me97o9nfy0UL-;9X9*g)PM~{rwZF(gQ)=RHw=u}}FY%n!o1JS9& zHtMwoY%m#YFd1wxHDCkLsnTt*!PI~aM5hkhsMi{>!DO((WU#^1fDJ^aO1HrVQv)^- zojPozUTeSxlfeeF!3J{!HV~aP`xn7$auz~2*VY9Ez z4cI_*s;~_aNx=+t3zy*4*s1JS9%HrQZpzy_jIhi&*;12&iqHkb`Im>aNx=v3)8 z*kEqJ2BK4kZTMOPHkb`Im<=|V8?b@sROvR@U~a$$qEm-$)N2jcU^dubHrQZpzy_jI zrQ2YGxd9u9P8GJn26F>85S=<~qh4#k2D8Biv%v;)12zzyD%}Pf%njH;bn38;daVH) z%my3G1{=%`*g$lubQ^3iH(&$NslztvwFYc38*H#M*kIRy4Mb;|?mMOXt3SLxY`-}F z_ON|^xVSw3^yb~>>vWJUrdb~P-DVfv!`=S(C-~&{aDCk5GgeQwXNNa8Z*N~5-r(%{ zFK%yMe0ey2y~V```0(fNj=%Wwh)WGN$+l-FxYc0$vzzN9q~C1vv9#&ca!)}z!ZSq; zY8pnwrPE?nOfsS5cki!ENJ;AumsHAiTvC1%aY@I?wvUTX8Li{;A=ehW_;kE%hq!#O z!AEb&M03|JKKW0FxO}j|ow$6+xA%7Gk9NtYF%@y?oekg3C&?CZ>EpXQ z!*?^W-HpqxkMHgb-^~P9#HEk#?hN0}C(jmf>EpY5!*?^`-Hpq>kMHgc-_68V#HEk# zy1{VXd{ph-$he`8_qxGwU%A<$j7}d1c7x%;E>9wr(dpyE&V)9mHrL0EoiqH{$pyyY@%DfC8LN=CwOz-a%I9d*NNX81}+$E{f8WUPyD`9ffr|L7lUx&JotRv6CxX zU?+Ec6xQj4cFtlux%Q)sPA6Bk@Xit6xv7&YTZAWVC**S$^ErY(x9{W1-l9Iaq2#W0 zd?)Pl7WT=dC1rH_xU#pfPwp`(qtnNgy@h?Au+MkGK5t>4C+zc`u+LlA=L!3KC+zbU z_IbiS-wFG?g?*l|&v(K;Z(*O@oKlpmPT1!y?DK?uz7zI&3;X1LmBKomu+LlA=V=np z$4<4fg?*l|&v(K;Z(*NY%u-}lC+zbU_IbiS-wFG?g?*kT^n54m^A`5WjV?uIO`TlX z!ah&f=R0Aax3JIC%%1Orecr-8PuS->VV}3KPi}`Pe5Vukc?VPCMY&(myQ=!AX2!ali==5A(%p^qyE3;X1Xnld_l zurFBH7YO@8C+rIr_65Se&U`O>2IYqtG3HySDeSxqqbi%%1VP7EZ3!ShpSlB0b?i88T3HySD zeSxqqbi%%1VP7EZ3!ShpSlB0*^%R-a3HySDeSxqqbi%%1VP7EZ3!ShpSlAZ``$8w| z3l{dt#Xp7bbi%%1VP7EZ3!ShpSlAZ``$8w|3l{dtjX_0bb;7=2VP7EZ3!ShpTG$r| z`(h{Tix&3DRYP|(D|W)ZXknk+K2%1h5B5b1`yydq?1X*M!oEn@7dv5Jw6HG{_Qg)v z7cK0Ignh9S_C*W(B4J?J7Hh6urCt!#ZK54E$ow9k&1e!6ZS<5`yydq z?1X*M!oEn@7dv5Jw6IUEQz|m66ZS<5`yydq?1X*M!oEn@7dv5Jw6IU^VJb4K6ZS<5 z`yydq?1X*M!oEn@7dv5Jw6HG{_Qg)v7cK0QJDm#O>4bgJ!oEn@7dv5Jw6HG{_Qg)v z7cK0Q%b<$P>V$pK!oEn@7dv6!XklL@>>E2_-)Lc<+#+>1v&K%?H(J;y7fY4V>4SZv zg?%Go-`ENJMhp8!!oIN+_Kg>COD#!lEbTG%%d_KlseZ?v#)BXucEY~V!alk1s;GB5Vc%$B-$>XucEY~V!oHEPZ|sD9qlJBPQ&y2#ov?4T zux}*n8#`g&Xkp(-*f(~Xu zcEY~V!aljKtMHvp*f(0(Hxl-Zov?4Tux}*n8#`g&Xknk+^HpS4C+r(7>>COD#!lEb zS=cuc_D!9zZ?dpYE(p7uSyLzMn=I^;JHyK8^ufN#!oG>HZ|a17lZAZ~Vc*mV`z8zf zCc?g{6ZTCO_DzI+Qzz`3EbN;I`=(CVH(A&>5%x`;uy3-kZzAlQI$_^rVV~S(R@6J4 zuy3-kZzAlQI$_^rVc$g9H+90k$-+Ll1g*%dPS`hD*f$aOO`WiBvaoL=?3+4a-(+E* z+@4lsRwwM6EbN;I`=(CVH(A&>5%x`;uy3-kZzAlQI$_^rVV~T@R`^aQ?3*m?n+W@+ zPS`hD*f$aOO`WiBvanCCa4Rya6ZTCO_DzI+Qzz`3E$o{J`{qvAH(S^zcfZ}uthp2R z%@+2_b#P^L`e5H|Vc$&HH+RCm*}}e=uy5{!eY1sqGhyG{3HxRX`)0zvxfAxy7WU1A zeRC)5n=R~{3H#pn>%6O zY+;|=Z&zeiC+wRo?3)Su=1$l*Ti7=f_RXEJZ?>>cF2*Y|s}uIk7WU1AeRC)5n=R~{ z3H#u*sL)ZSr+{Z#LUsU0%G|e0?HE z=O-3BJIM@$Kj~!Dvy%PlKXULC%G?$Kk`ZLJDi>5HXDCLOKzji zPIB9TKcXeqg=Z(Z4mvx@WgmY;OZN4%lk8*oBU5%iz@P0{$obZL`B^`36ReE0ZE$NWslaT*QI^@8h^eo@W5jl8X(jkY!;CV@h9D{=A z_kOhGM_AG!M_u6eB^_Z&hn%W__e(m$k`CFxkM~PDWXn39mvqP`?ex6FZ%K#j2ZrY^ z>5v_;=~=#$J)g+_Z%KzNa7STV(jiN_)3bahi5wH>c)z4W78T)nNrx<>NzaSEB^|P21NFm_4q2m+ zp5;54mB;gv4w;9>^O6pkdByXR4w-Aj^O6pkT}#i4z9k(pk%RY3I;JHZGG~DIOFCqf z9M4NSWL!8sFZz~r$PgrIwj~`h=$4-4I~iue^O6o3Si$p>4jD?o^O6pMXFMq+?#vA)R2nU(zAnK0Gh!kd97zUi2;LkTw-{@{*3(tTu1Bq2 z4CKt~b>;P9AZJ2Xr0Y?u7XvxNcwKqD7|0pF73q4^>cv3Lq+L}mXT(;1t`-A1Lv>xc zUJT@n(RJy1F_1GjE7Db~$r+XF()D5>XE?4)*NcIiakwsBF9vc3;JS3Z7|0oU73sRw z>cv3LbX!+mF9vevSw*@YwR$m-GrCrl%b8h~pR2_{&Xii0t``G2b7@_=UJT?+qKb6Y zYI0`Jx^%r5$eA|l()D5>XTGdU*NcIiiLx$TF9vdENJYACwR$m-GcMMZ*NcIi0a1~z zN3C8AzWKkUjS6()D5>d(hXV>%~C!Xji1GR+Bx<>(cdNAbWh*rR&8& z_Q0-7*NcJd5nY$A7X#TtS&^<=tzHad&)>T8dNGhaaTV!$)au1R_HeB#mpxULpR2_{ z_8hHC*NcJd$yt}K7X#U|QjxA&P4;xGOV^8m?0Hz1t``H@6R<8_F9xz^eqFj=3}j7t zMY?XadNGhS(Cfv`YT`vZ*25eorUJPW7)Vg%N7|0r;b?JIBkTo_H>AKbG#X#1CtShe<16eas zk*-IrUJPW8e^t56xmSL!76X}XSfs!D!|TI`nTV6^mv6s0rZ>NR{`vOv!}Yhv?>3ku zj!&PyIo=-5U!6Su>ATnGFTOth&v3h-}`yy1IVz=-rdkEb<8dPOrD8oBYY~`zNQreg4Jfcyn|0{Us(|9_}By z2QK{0=H>1AtHTdBx8HBv!|4<%Z!caxI(zonq7Y9{PQN=IUq9MzfB4~thd+deH@Dwz z-G0B{4u0$X1AOt|%^$9h=kFd|zxhjqmm_ld+Ye&bZyx42J$!NVYJ2(Ht$R3Z-v{&z z$+^9JeZ0K6-lTxfzqxsPd~*8s?d8RzA)cSV7{0l9FrS|zuI^=cFyOxj(a*T0`{HH1 z7~=cjUf+pk5gvX(fB|;EzaD*Ydvo#j#o_kJ=`X(ceDjO%Zr&Uv{LTL1Fr99fA}FpTV<^ zhkrxr&PR8oZf?JVBRu`j*WX{?{BZrr>(^J8FV0gYNKjd5`R4I9<;xw5+_#O+Uq63d zx6-Ru$&J%@kDlGUc>C&bef;IKe~**gcfMY{_z>aOZ*Q-1iMV*NJzO19+}JNTsjqypFDe%3f6!H7~Wx3&iK1wIK}_?3}vtS#fRzP zcejU^Cj%y(r;}6-$$y(^gtpDgjl2T^rUhl`zs>dX4ja4Ebbav-l$xg0i+3JpXAbHe zK5+UwyrOqlP?0(Wg+82il$QMz?|j^)RZ_(}=u683)H{z?qH%YKG&N(OSy}^nuj79mNGlT%{$1#dlbsW#q?h)NvVx zeOlU4$UD#4!c*Q&DBcJrs&d86Q*Krx# zJ}p7i`nY^x1r*0`pO&8#vIAB?YTJ*fVDvlm9Jzepf_NPl)SR>SN$BJ9ft6MiKkvv- z2i()m&t*#Y-6a($KehA4euN4Cdgtd!Q`m6 zDfCg9lg(uicbRCLLf=T`W1mmBQ1Qzb zIjeV^4(Ovk2(HMbdU8OsMfrgnA+$}g7@1`K-l$)2#e|j}Vjh4m;tYLMrm<#Yuk#49 zX=t#JMR%8M3VqZsMm3c7glbuCLvbEF=LZ@>B^!pk%BrFI%##r*@UP}g>WKC(Sl!KBUeMVt}kG#;wnwt7$V3QHqv&p;=2Keqw{hYcVtrpOWYV--cq3S?I<0C!4=S#w$Bu@Xc{Tp0lNe!&N$vr z=Owx?^d0UkCKd+{Qrj~iJG4!qFKXWij@tmpQrk1YH?&QmZ`SXyVTRcXhnMN^2JB?e zJ`N(GaSL3GOz9Y47cDzr2ZXjM^pRbH55y^urM3sfoMfSo%04y*Q5l3RwLJq4!{PkM zr<|1j;`5e`;vHnUJ;!-1+NL8!seE8Zl(x%&$vG`MfK#+hp^xH>4N%PX*cGB>huM=& zp^y5-0oRlpvefnrIIV%p$Bz1rSer+j3|VS>22?McA3Lf$vC)g{JYb{0mK~7g+NQt- zk`34qru!g}rM73lju&kgY)+yv9$ZkJ_C}ZfGUww7)H@zmfj;6RBsXpC(X!m0W8*02 z2Rc7WHlXRz-(eJv+mv12JWzy-Bd5tH(Um8LKoiRC`OcF~p^w@g+*X|qkto7Nua4XE zUB1q__zwEW_87ULKJc*1_vaR}!!ED%D&8d=r1k?l@3bF4mbhZr<%K6&AC*B|hfRGr z$Wq%gpt;n3m4^DXZ(u!YI&G&27qVPuqYBgCK_9UTHcnC>WZ3Pf?HPd6+AcV^oW^*7 zd0bX^dun?IaFq4~=p)~S7f>5I?2R#=y(gPO-=4|``esx(ig(aQ<0=?M=dzFCFrAm^c9Kn@kLp<5@J)4C8XDH=z$gf{ zTWNTM$_JKX8M5T}pk%Ts^ikPI517gzWXTUeQPege>mQ%TeER|_s9@!N7C=ASu(L9|q7!kcmvMKaY-y2j* z3;|hcdoVIWHU)i9+k>GmnuCNal|hG-6Lh@+ePsK91wP~(E?i zrBj&|@W=LLZI&qqe7d2(s*xm=>b?3jJdJ4z&S|f#R?cYI__`*wA)C z(@pFLZ=pKOVbV*>A|_`jz$6=sG+aCI8?j)cep?wHd9p^bfS=$uTA2fD|VR;%u!DH2j<&k?Kwyd_rp%a7Yf-8yF@e zo1(`+vJrzVx{ie`l_Lko*LHzEntQ_bE~=T(x91V7HB?+M zok!tN!(n!T+8!MEL}|ki zH;vsytF6UFvpO%azLjhWee@0o2~i&evefoCtUcoVn5pfK9xI$wzCo7So-{1a`GL-q zlEn-GwV}vzYI__mF4VGU1!?XR2PRQF16ku;z8+EKFV8t(T9VoThlK@fgM2%H(zmCv zFO(u01I278wLR#bl1(u^P3(t*p{NeSavy4Y&=Vk=rs-~KKQMu${Q$Dm_BbFI=LfId zLRCWZ=a8kg2M3>#O|e>q=8kay7L7qcmf9YNAzG@h_JB_9e<2?|Rpgt))i(M&#E$HO z_|e!QT4^ILyq*RJypc_jMdagX@yG^{rMAc69tz5jJxV5}cTZygkfpWAeKC*qp8eE+Y$Wq&bgAU22xOk7|?l3Aqb3l-#w#VUEQ7#|( zSiHh6$X@ymvQ#e7TjTb8&vT^c=Fl8QT4qi*z_J2udo1@Mc0o^``XHEMrhG$5C7VJY zwcQbrL*)an$j33xpnW_oN22n9ll54Z*SO-~O0p?NRj7?Z4$&AgWU1|On6A|}g+3bl zk2t|k+ZnRd_P8CdNq{~Y`vTe17${_^?EzhqO<^ixKP>H`bl`ALYI{K9WGm<+yF}FO zG=7C{iOx&6=QRn?M`a(?6_r8AQrm+bA=wnm&1mizU2htLf-JQ?IM|eI3Vk$p5{>n{ z82X~N2g@kPrqD-m#>gR!p+J_}9(3EurfGQ{l@DYQl@D~oI6rtz0+z5)-x15cXbb>{ zzf#+SnLDy6^ikc3Sx&Muw(?Qi1L7o`LLbS-8G|0G{e>*GJ=lChHpL7n%{@hoS?Y2Q zS!#Pc#zC}Ap^wI1F&#<_23cx*u-kxa3Vk&8faaIV0!G%UO-akqbviJcLOzLA55y3V zrM3qv^T?*qM{N&QJkcB)WU1}J@GjXD`pEVXOsv}v$Wj}C5i+uAS}scEW5@F@kfpW< z%a+Kd&_`tu+pVY%2U%)+fXQT2=%cZlh#`I5en6J$Y|Q47O`(t21w96uKZh)}=jbVu zO(%4Lwe2xfKz;>TYI{5eB)EL=nw_}kHE14Kp=B`wPc}vTXzmlC(ik#isolc%3bHAX zlg9p|(FQ=4>T!=oUgsP1(b!kq^IRKbsb0f$1=$q(xQ<1c)_H`L22{>55>7Tv%b#`m zz*1Nm!-FjOJ$5*eO`(skfpZAW224sap)s<#=+M#e-2q{d$78RY&v1iTDOhB zBPvIbrM3qvXUL||N9jN>hvvYsi;wFFtn1UZhdz=`TOPGtu>FYI9!$ScT%eEUp5Wm$ zhYLw+dvFjv*)%QZr}BY;2Hn4cEVVtD;v<_vAB8bGEF{zY7i{CxEQ#VlHibUwdt<1S z7y`1?_F!c^*%Yg7sqMi5>okW3SuTT^*wuD{KC=CY!a!veOK`Pp8n)Gb0DWXr^i*gL z2(r}nU>6J76ia((>>9XFeK^Q+nL$&b(*b=nc7xqaG>3s564dr!6+GD#`iNaHszUV! zWU1{z2xL>BF8L6K(P<1Gvh3rL*CeFvDcW~2v`%d(rl+ax!Kyj3DfH3YC*Iv1zdzod zUtS$_Sv(~KE>c1+S~b4jMZZE-w>bv+h6=X9TETLcz%1#Tkx?(H~5nu|M=&>`RwHX E1CH&CCIA2c literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddOnsTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddOnsTest.php new file mode 100644 index 00000000000..7623b9d4fd4 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddOnsTest.php @@ -0,0 +1,88 @@ + "100.00", + "description" => "some description", + "id" => $newId, + "kind" => "add_on", + "name" => "php_add_on", + "neverExpires" => "false", + "numberOfBillingCycles" => "1" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . "/modifications/create_modification_for_tests"; + $http->post($path, ["modification" => $addOnParams]); + + $addOns = Braintree\AddOn::all(); + + foreach ($addOns as $addOn) + { + if ($addOn->id == $newId) + { + $actualAddOn = $addOn; + } + } + + $this->assertNotNull($actualAddOn); + $this->assertEquals($addOnParams["amount"], $actualAddOn->amount); + $this->assertEquals($addOnParams["description"], $actualAddOn->description); + $this->assertEquals($addOnParams["id"], $actualAddOn->id); + $this->assertEquals($addOnParams["kind"], $actualAddOn->kind); + $this->assertEquals($addOnParams["name"], $actualAddOn->name); + $this->assertFalse($actualAddOn->neverExpires); + $this->assertEquals($addOnParams["numberOfBillingCycles"], $actualAddOn->numberOfBillingCycles); + } + + public function testGatewayAll_returnsAllAddOns() + { + $newId = strval(rand()); + + $addOnParams = [ + "amount" => "100.00", + "description" => "some description", + "id" => $newId, + "kind" => "add_on", + "name" => "php_add_on", + "neverExpires" => "false", + "numberOfBillingCycles" => "1" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . "/modifications/create_modification_for_tests"; + $http->post($path, ["modification" => $addOnParams]); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $addOns = $gateway->addOn()->all(); + + foreach ($addOns as $addOn) + { + if ($addOn->id == $newId) + { + $actualAddOn = $addOn; + } + } + + $this->assertNotNull($actualAddOn); + $this->assertEquals($addOnParams["amount"], $actualAddOn->amount); + $this->assertEquals($addOnParams["description"], $actualAddOn->description); + $this->assertEquals($addOnParams["id"], $actualAddOn->id); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddressTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddressTest.php new file mode 100644 index 00000000000..fbed2a041ec --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/AddressTest.php @@ -0,0 +1,311 @@ + $customer->id, + 'firstName' => 'Dan', + 'lastName' => 'Smith', + 'company' => 'Braintree', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Apt 1F', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'Vatican City', + 'countryCodeAlpha2' => 'VA', + 'countryCodeAlpha3' => 'VAT', + 'countryCodeNumeric' => '336' + ]); + $this->assertTrue($result->success); + $address = $result->address; + $this->assertEquals('Dan', $address->firstName); + $this->assertEquals('Smith', $address->lastName); + $this->assertEquals('Braintree', $address->company); + $this->assertEquals('1 E Main St', $address->streetAddress); + $this->assertEquals('Apt 1F', $address->extendedAddress); + $this->assertEquals('Chicago', $address->locality); + $this->assertEquals('IL', $address->region); + $this->assertEquals('60622', $address->postalCode); + $this->assertEquals('Vatican City', $address->countryName); + $this->assertEquals('VA', $address->countryCodeAlpha2); + $this->assertEquals('VAT', $address->countryCodeAlpha3); + $this->assertEquals('336', $address->countryCodeNumeric); + } + + public function testGatewayCreate() + { + $customer = Braintree\Customer::createNoValidate(); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->address()->create([ + 'customerId' => $customer->id, + 'streetAddress' => '1 E Main St', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + ]); + + $this->assertTrue($result->success); + $address = $result->address; + $this->assertEquals('1 E Main St', $address->streetAddress); + $this->assertEquals('Chicago', $address->locality); + $this->assertEquals('IL', $address->region); + $this->assertEquals('60622', $address->postalCode); + } + + public function testCreate_withValidationErrors() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\Address::create([ + 'customerId' => $customer->id, + 'countryName' => 'Invalid States of America' + ]); + $this->assertFalse($result->success); + $countryErrors = $result->errors->forKey('address')->onAttribute('countryName'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_COUNTRY_NAME_IS_NOT_ACCEPTED, $countryErrors[0]->code); + } + + public function testCreate_withValidationErrors_onCountryCodes() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\Address::create([ + 'customerId' => $customer->id, + 'countryCodeAlpha2' => 'ZZ' + ]); + $this->assertFalse($result->success); + $countryErrors = $result->errors->forKey('address')->onAttribute('countryCodeAlpha2'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_COUNTRY_CODE_ALPHA2_IS_NOT_ACCEPTED, $countryErrors[0]->code); + } + + public function testCreate_withNotFoundErrors() + { + $this->setExpectedException('Braintree\Exception\NotFound','Customer nonExistentCustomerId not found.'); + $result = Braintree\Address::create([ + 'customerId' => 'nonExistentCustomerId', + ]); + } + + public function testCreateNoValidate() + { + $customer = Braintree\Customer::createNoValidate(); + $address = Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'firstName' => 'Dan', + 'lastName' => 'Smith', + 'company' => 'Braintree', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Apt 1F', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America' + ]); + $this->assertEquals('Dan', $address->firstName); + $this->assertEquals('Smith', $address->lastName); + $this->assertEquals('Braintree', $address->company); + $this->assertEquals('1 E Main St', $address->streetAddress); + $this->assertEquals('Apt 1F', $address->extendedAddress); + $this->assertEquals('Chicago', $address->locality); + $this->assertEquals('IL', $address->region); + $this->assertEquals('60622', $address->postalCode); + $this->assertEquals('United States of America', $address->countryName); + } + + public function testCreateNoValidate_withValidationErrors() + { + $customer = Braintree\Customer::createNoValidate(); + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'countryName' => 'Invalid States of America' + ]); + } + + public function testDelete() + { + $customer = Braintree\Customer::createNoValidate(); + $address = Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'streetAddress' => '1 E Main St' + ]); + Braintree\Address::find($customer->id, $address->id); + Braintree\Address::delete($customer->id, $address->id); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\Address::find($customer->id, $address->id); + } + + public function testFind() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\Address::create([ + 'customerId' => $customer->id, + 'firstName' => 'Dan', + 'lastName' => 'Smith', + 'company' => 'Braintree', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Apt 1F', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America' + ]); + $this->assertTrue($result->success); + $address = Braintree\Address::find($customer->id, $result->address->id); + $this->assertEquals('Dan', $address->firstName); + $this->assertEquals('Smith', $address->lastName); + $this->assertEquals('Braintree', $address->company); + $this->assertEquals('1 E Main St', $address->streetAddress); + $this->assertEquals('Apt 1F', $address->extendedAddress); + $this->assertEquals('Chicago', $address->locality); + $this->assertEquals('IL', $address->region); + $this->assertEquals('60622', $address->postalCode); + $this->assertEquals('United States of America', $address->countryName); + } + + public function testFind_whenNotFound() + { + $customer = Braintree\Customer::createNoValidate(); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\Address::find($customer->id, 'does-not-exist'); + } + + public function testUpdate() + { + $customer = Braintree\Customer::createNoValidate(); + $address = Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + 'company' => 'Old Company', + 'streetAddress' => '1 E Old St', + 'extendedAddress' => 'Apt Old', + 'locality' => 'Old Chicago', + 'region' => 'Old Region', + 'postalCode' => 'Old Postal', + 'countryName' => 'United States of America', + 'countryCodeAlpha2' => 'US', + 'countryCodeAlpha3' => 'USA', + 'countryCodeNumeric' => '840' + ]); + $result = Braintree\Address::update($customer->id, $address->id, [ + 'firstName' => 'New First', + 'lastName' => 'New Last', + 'company' => 'New Company', + 'streetAddress' => '1 E New St', + 'extendedAddress' => 'Apt New', + 'locality' => 'New Chicago', + 'region' => 'New Region', + 'postalCode' => 'New Postal', + 'countryName' => 'Mexico', + 'countryCodeAlpha2' => 'MX', + 'countryCodeAlpha3' => 'MEX', + 'countryCodeNumeric' => '484' + ]); + $this->assertTrue($result->success); + $address = $result->address; + $this->assertEquals('New First', $address->firstName); + $this->assertEquals('New Last', $address->lastName); + $this->assertEquals('New Company', $address->company); + $this->assertEquals('1 E New St', $address->streetAddress); + $this->assertEquals('Apt New', $address->extendedAddress); + $this->assertEquals('New Chicago', $address->locality); + $this->assertEquals('New Region', $address->region); + $this->assertEquals('New Postal', $address->postalCode); + $this->assertEquals('Mexico', $address->countryName); + $this->assertEquals('MX', $address->countryCodeAlpha2); + $this->assertEquals('MEX', $address->countryCodeAlpha3); + $this->assertEquals('484', $address->countryCodeNumeric); + } + + public function testUpdate_withValidationErrors() + { + $customer = Braintree\Customer::createNoValidate(); + $address = Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'streetAddress' => '1 E Main St' + ]); + $result = Braintree\Address::update( + $customer->id, + $address->id, + [ + 'countryName' => 'Invalid States of America' + ] + ); + $this->assertFalse($result->success); + $countryErrors = $result->errors->forKey('address')->onAttribute('countryName'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_COUNTRY_NAME_IS_NOT_ACCEPTED, $countryErrors[0]->code); + } + + public function testUpdate_withValidationErrors_onCountry() + { + $customer = Braintree\Customer::createNoValidate(); + $address = Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'streetAddress' => '1 E Main St' + ]); + $result = Braintree\Address::update( + $customer->id, + $address->id, + [ + 'countryCodeAlpha2' => 'MU', + 'countryCodeAlpha3' => 'MYT' + ] + ); + $this->assertFalse($result->success); + $countryErrors = $result->errors->forKey('address')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_INCONSISTENT_COUNTRY, $countryErrors[0]->code); + } + + + public function testUpdateNoValidate() + { + $customer = Braintree\Customer::createNoValidate(); + $createdAddress = Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + 'company' => 'Old Company', + 'streetAddress' => '1 E Old St', + 'extendedAddress' => 'Apt Old', + 'locality' => 'Old Chicago', + 'region' => 'Old Region', + 'postalCode' => 'Old Postal', + 'countryName' => 'United States of America' + ]); + $address = Braintree\Address::updateNoValidate($customer->id, $createdAddress->id, [ + 'firstName' => 'New First', + 'lastName' => 'New Last', + 'company' => 'New Company', + 'streetAddress' => '1 E New St', + 'extendedAddress' => 'Apt New', + 'locality' => 'New Chicago', + 'region' => 'New Region', + 'postalCode' => 'New Postal', + 'countryName' => 'Mexico' + ]); + $this->assertEquals('New First', $address->firstName); + $this->assertEquals('New Last', $address->lastName); + $this->assertEquals('New Company', $address->company); + $this->assertEquals('1 E New St', $address->streetAddress); + $this->assertEquals('Apt New', $address->extendedAddress); + $this->assertEquals('New Chicago', $address->locality); + $this->assertEquals('New Region', $address->region); + $this->assertEquals('New Postal', $address->postalCode); + $this->assertEquals('Mexico', $address->countryName); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/ApplePayTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/ApplePayTest.php new file mode 100644 index 00000000000..d56c0524d54 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/ApplePayTest.php @@ -0,0 +1,83 @@ + 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + ]); + + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + return new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + } + + public function testRegisterDomainWithExpectedStubbedResult() + { + $result = self::$gateway->applePay()->registerDomain('domain'); + $this->assertEquals(true, $result->success); + } + + public function testValidationErrorWhenRegisteringNoDomain() + { + $result = self::$gateway->applePay()->registerDomain(''); + $this->assertEquals(false, $result->success); + $this->assertEquals(1, preg_match('/Domain name is required\./', $result->message)); + } + + public function testUnregisterDomainWithExpectedStubbedResult() + { + $domain = 'example.com'; + $result = self::$gateway->applePay()->unregisterDomain($domain); + $this->assertEquals(true, $result->success); + } + + public function testUnregisterDomainWithSpecialCharactersWithExpectedStubbedResult() + { + $domain = 'ex&mple.com'; + $result = self::$gateway->applePay()->unregisterDomain($domain); + $this->assertEquals(true, $result->success); + } + + public function testUnregisterDomainWithSchemeWithExpectedStubbedResult() + { + $domain = 'http://example.com'; + $result = self::$gateway->applePay()->unregisterDomain($domain); + $this->assertEquals(true, $result->success); + } + + public function testRegisteredDomainsWithExpectedStubbedResult() + { + $result = self::$gateway->applePay()->registeredDomains(); + $this->assertEquals(true, $result->success); + $registeredDomains = $result->applePayOptions->domains; + $this->assertEmpty(array_diff(['www.example.com'], $registeredDomains)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/ClientTokenTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/ClientTokenTest.php new file mode 100644 index 00000000000..d2d92adf8b3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/ClientTokenTest.php @@ -0,0 +1,189 @@ +authorizationFingerprint; + $http = new HttpClientApi(Braintree\Configuration::$global); + $response = $http->get_cards([ + "authorization_fingerprint" => $authorizationFingerprint, + "shared_customer_identifier" => "fake_identifier", + "shared_customer_identifier_type" => "testing", + ]); + + $this->assertEquals(200, $response["status"]); + } + + public function test_VersionOptionSupported() + { + $clientToken = Braintree\ClientToken::generate(["version" => 1]); + $version = json_decode($clientToken)->version; + $this->assertEquals(1, $version); + } + + public function test_VersionDefaultsToTwo() + { + $encodedClientToken = Braintree\ClientToken::generate(); + $clientToken = base64_decode($encodedClientToken); + $version = json_decode($clientToken)->version; + $this->assertEquals(2, $version); + } + + public function testGateway_VersionDefaultsToTwo() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key', + ]); + $encodedClientToken = $gateway->clientToken()->generate(); + $clientToken = base64_decode($encodedClientToken); + $version = json_decode($clientToken)->version; + $this->assertEquals(2, $version); + } + + public function test_GatewayRespectsVerifyCard() + { + $result = Braintree\Customer::create(); + $this->assertTrue($result->success); + $customerId = $result->customer->id; + + $clientToken = Test\Helper::decodedClientToken([ + "customerId" => $customerId, + "options" => [ + "verifyCard" => true + ] + ]); + $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; + + $http = new HttpClientApi(Braintree\Configuration::$global); + $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ + "credit_card" => [ + "number" => "4000111111111115", + "expirationDate" => "11/2099" + ], + "authorization_fingerprint" => $authorizationFingerprint, + "shared_customer_identifier" => "fake_identifier", + "shared_customer_identifier_type" => "testing" + ])); + + $this->assertEquals(422, $response["status"]); + } + + public function test_GatewayRespectsFailOnDuplicatePaymentMethod() + { + $result = Braintree\Customer::create(); + $this->assertTrue($result->success); + $customerId = $result->customer->id; + + $clientToken = Test\Helper::decodedClientToken([ + "customerId" => $customerId, + ]); + $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; + + $http = new HttpClientApi(Braintree\Configuration::$global); + $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ + "credit_card" => [ + "number" => "4242424242424242", + "expirationDate" => "11/2099" + ], + "authorization_fingerprint" => $authorizationFingerprint, + "shared_customer_identifier" => "fake_identifier", + "shared_customer_identifier_type" => "testing" + ])); + $this->assertEquals(201, $response["status"]); + + $clientToken = Test\Helper::decodedClientToken([ + "customerId" => $customerId, + "options" => [ + "failOnDuplicatePaymentMethod" => true + ] + ]); + $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; + + $http = new HttpClientApi(Braintree\Configuration::$global); + $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ + "credit_card" => [ + "number" => "4242424242424242", + "expirationDate" => "11/2099" + ], + "authorization_fingerprint" => $authorizationFingerprint, + "shared_customer_identifier" => "fake_identifier", + "shared_customer_identifier_type" => "testing" + ])); + $this->assertEquals(422, $response["status"]); + } + + public function test_GatewayRespectsMakeDefault() + { + $result = Braintree\Customer::create(); + $this->assertTrue($result->success); + $customerId = $result->customer->id; + + $result = Braintree\CreditCard::create([ + 'customerId' => $customerId, + 'number' => '4111111111111111', + 'expirationDate' => '11/2099' + ]); + $this->assertTrue($result->success); + + $clientToken = Test\Helper::decodedClientToken([ + "customerId" => $customerId, + "options" => [ + "makeDefault" => true + ] + ]); + $authorizationFingerprint = json_decode($clientToken)->authorizationFingerprint; + + $http = new HttpClientApi(Braintree\Configuration::$global); + $response = $http->post('/client_api/v1/payment_methods/credit_cards.json', json_encode([ + "credit_card" => [ + "number" => "4242424242424242", + "expirationDate" => "11/2099" + ], + "authorization_fingerprint" => $authorizationFingerprint, + "shared_customer_identifier" => "fake_identifier", + "shared_customer_identifier_type" => "testing" + ])); + + $this->assertEquals(201, $response["status"]); + + $customer = Braintree\Customer::find($customerId); + $this->assertEquals(2, count($customer->creditCards)); + foreach ($customer->creditCards as $creditCard) { + if ($creditCard->last4 == "4242") { + $this->assertTrue($creditCard->default); + } + } + } + + public function test_ClientTokenAcceptsMerchantAccountId() + { + $expectedMerchantAccountId = Test\Helper::nonDefaultMerchantAccountId(); + $clientToken = Test\Helper::decodedClientToken([ + 'merchantAccountId' => $expectedMerchantAccountId + ]); + $merchantAccountId = json_decode($clientToken)->merchantAccountId; + + $this->assertEquals($expectedMerchantAccountId, $merchantAccountId); + } + + public function test_GenerateRaisesExceptionOnGateway422() + { + $this->setExpectedException('InvalidArgumentException', 'customer_id'); + + Braintree\ClientToken::generate([ + "customerId" => "not_a_customer" + ]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardTest.php new file mode 100644 index 00000000000..1e54f023dbd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardTest.php @@ -0,0 +1,1403 @@ + $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->assertTrue($result->success); + $this->assertEquals($customer->id, $result->creditCard->customerId); + $this->assertEquals('510510', $result->creditCard->bin); + $this->assertEquals('5100', $result->creditCard->last4); + $this->assertEquals('Cardholder', $result->creditCard->cardholderName); + $this->assertEquals('05/2012', $result->creditCard->expirationDate); + $this->assertEquals(1, preg_match('/\A\w{32}\z/', $result->creditCard->uniqueNumberIdentifier)); + $this->assertFalse($result->creditCard->isVenmoSdk()); + $this->assertEquals(1, preg_match('/png/', $result->creditCard->imageUrl)); + } + + public function testGatewayCreate() + { + $customer = Braintree\Customer::createNoValidate(); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + + $this->assertTrue($result->success); + $this->assertEquals($customer->id, $result->creditCard->customerId); + $this->assertEquals('510510', $result->creditCard->bin); + $this->assertEquals('5100', $result->creditCard->last4); + $this->assertEquals('Cardholder', $result->creditCard->cardholderName); + $this->assertEquals('05/2012', $result->creditCard->expirationDate); + } + + public function testCreate_withDefault() + { + $customer = Braintree\Customer::createNoValidate(); + $card1 = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + $this->assertTrue($card1->isDefault()); + + $card2 = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'makeDefault' => true + ] + ])->creditCard; + + $card1 = Braintree\CreditCard::find($card1->token); + $this->assertFalse($card1->isDefault()); + $this->assertTrue($card2->isDefault()); + } + + public function testCreateWithVerificationAmount() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '4111111111111111', + 'expirationDate' => '05/12', + 'options' => [ + 'verificationAmount' => '5.00', + 'verifyCard' => true + ] + ]); + $this->assertTrue($result->success); + $this->assertEquals($customer->id, $result->creditCard->customerId); + $this->assertEquals('411111', $result->creditCard->bin); + $this->assertEquals('1111', $result->creditCard->last4); + $this->assertEquals('Cardholder', $result->creditCard->cardholderName); + $this->assertEquals('05/2012', $result->creditCard->expirationDate); + $this->assertEquals(1, preg_match('/\A\w{32}\z/', $result->creditCard->uniqueNumberIdentifier)); + $this->assertFalse($result->creditCard->isVenmoSdk()); + $this->assertEquals(1, preg_match('/png/', $result->creditCard->imageUrl)); + } + + public function testAddCardToExistingCustomerUsingNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "credit_card" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "share" => true + ]); + + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertSame("411111", $result->creditCard->bin); + $this->assertSame("1111", $result->creditCard->last4); + } + + public function testCreate_withSecurityParams() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'deviceSessionId' => 'abc_123', + 'fraudMerchantId' => '456', + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_withExpirationMonthAndYear() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationMonth' => '05', + 'expirationYear' => '2011' + ]); + $this->assertTrue($result->success); + $this->assertEquals($customer->id, $result->creditCard->customerId); + $this->assertEquals('510510', $result->creditCard->bin); + $this->assertEquals('5100', $result->creditCard->last4); + $this->assertEquals('Cardholder', $result->creditCard->cardholderName); + $this->assertEquals('05/2011', $result->creditCard->expirationDate); + } + + public function testCreate_withSpecifyingToken() + { + $token = strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'token' => $token + ]); + $this->assertTrue($result->success); + $this->assertEquals($token, $result->creditCard->token); + $this->assertEquals($token, Braintree\CreditCard::find($token)->token); + } + + public function testCreate_withDuplicateCardCheck() + { + $customer = Braintree\Customer::createNoValidate(); + + $attributes = [ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'options' => ['failOnDuplicatePaymentMethod' => true] + ]; + Braintree\CreditCard::create($attributes); + + $result = Braintree\CreditCard::create($attributes); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('creditCard')->onAttribute('number'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_DUPLICATE_CARD_EXISTS, $errors[0]->code); + $this->assertEquals(1, preg_match('/Duplicate card exists in the vault\./', $result->message)); + } + + public function testCreate_withCardVerification() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'options' => ['verifyCard' => true] + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + $this->assertEquals('2000', $result->creditCardVerification->processorResponseCode); + $this->assertEquals('Do Not Honor', $result->creditCardVerification->processorResponseText); + $this->assertEquals('I', $result->creditCardVerification->cvvResponseCode); + $this->assertEquals(null, $result->creditCardVerification->avsErrorResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsPostalCodeResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsStreetAddressResponseCode); + $this->assertEquals(Braintree\CreditCard::PREPAID_UNKNOWN, $result->creditCardVerification->creditCard['prepaid']); + } + + public function testCreate_withCardVerificationReturnsVerificationWithRiskData() + { + $gateway = Test\Helper::advancedFraudIntegrationMerchantGateway(); + $customer = $gateway->customer()->createNoValidate(); + $result = $gateway->creditCard()->create([ + 'customerId' => $customer->id, + 'number' => '4111111111111111', + 'expirationDate' => '05/2011', + 'options' => ['verifyCard' => true], + 'deviceSessionId' => 'abc123' + ]); + $this->assertTrue($result->success); + $this->assertNotNull($result->creditCard->verification->riskData); + $this->assertNotNull($result->creditCard->verification->riskData->decision); + $this->assertNotNull($result->creditCard->verification->riskData->deviceDataCaptured); + $this->assertNotNull($result->creditCard->verification->riskData->id); + $this->assertNotNull($result->creditCard->verification->riskData->fraudServiceProvider); + } + + public function testCreate_withCardVerificationAndOverriddenAmount() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'options' => ['verifyCard' => true, 'verificationAmount' => '1.02'] + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + $this->assertEquals('1.02', $result->creditCardVerification->amount); + $this->assertEquals('USD', $result->creditCardVerification->currencyIsoCode); + $this->assertEquals('2000', $result->creditCardVerification->processorResponseCode); + $this->assertEquals('Do Not Honor', $result->creditCardVerification->processorResponseText); + $this->assertEquals('I', $result->creditCardVerification->cvvResponseCode); + $this->assertEquals(null, $result->creditCardVerification->avsErrorResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsPostalCodeResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsStreetAddressResponseCode); + $this->assertEquals(Braintree\CreditCard::PREPAID_UNKNOWN, $result->creditCardVerification->creditCard['prepaid']); + } + + public function testCreate_withCardVerificationAndSpecificMerchantAccount() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'options' => ['verificationMerchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), 'verifyCard' => true], + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + $this->assertEquals('2000', $result->creditCardVerification->processorResponseCode); + $this->assertEquals('Do Not Honor', $result->creditCardVerification->processorResponseText); + $this->assertEquals('I', $result->creditCardVerification->cvvResponseCode); + $this->assertEquals(null, $result->creditCardVerification->avsErrorResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsPostalCodeResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsStreetAddressResponseCode); + } + + public function testCreate_withBillingAddress() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Peter Tomlin', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Suite 101', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'Micronesia', + 'countryCodeAlpha2' => 'FM', + 'countryCodeAlpha3' => 'FSM', + 'countryCodeNumeric' => '583' + ] + ]); + $this->assertTrue($result->success); + $this->assertEquals($customer->id, $result->creditCard->customerId); + $this->assertEquals('510510', $result->creditCard->bin); + $this->assertEquals('5100', $result->creditCard->last4); + $this->assertEquals('Peter Tomlin', $result->creditCard->cardholderName); + $this->assertEquals('05/2012', $result->creditCard->expirationDate); + $address = $result->creditCard->billingAddress; + $this->assertEquals('Drew', $address->firstName); + $this->assertEquals('Smith', $address->lastName); + $this->assertEquals('Smith Co.', $address->company); + $this->assertEquals('1 E Main St', $address->streetAddress); + $this->assertEquals('Suite 101', $address->extendedAddress); + $this->assertEquals('Chicago', $address->locality); + $this->assertEquals('IL', $address->region); + $this->assertEquals('60622', $address->postalCode); + $this->assertEquals('Micronesia', $address->countryName); + $this->assertEquals('FM', $address->countryCodeAlpha2); + $this->assertEquals('FSM', $address->countryCodeAlpha3); + $this->assertEquals('583', $address->countryCodeNumeric); + } + + public function testCreate_withExistingBillingAddress() + { + $customer = Braintree\Customer::createNoValidate(); + $existingAddress = Braintree\Address::createNoValidate([ + 'customerId' => $customer->id, + 'firstName' => 'John' + ]); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddressId' => $existingAddress->id + ]); + $this->assertTrue($result->success); + $address = $result->creditCard->billingAddress; + $this->assertEquals($existingAddress->id, $address->id); + $this->assertEquals('John', $address->firstName); + } + + public function testCreate_withValidationErrors() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'expirationDate' => 'invalid', + 'billingAddress' => [ + 'countryName' => 'Tuvalu', + 'countryCodeAlpha2' => 'US' + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('creditCard')->onAttribute('expirationDate'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_EXPIRATION_DATE_IS_INVALID, $errors[0]->code); + $this->assertEquals(1, preg_match('/Credit card number is required\./', $result->message)); + $this->assertEquals(1, preg_match('/Customer ID is required\./', $result->message)); + $this->assertEquals(1, preg_match('/Expiration date is invalid\./', $result->message)); + + $errors = $result->errors->forKey('creditCard')->forKey('billingAddress')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_INCONSISTENT_COUNTRY, $errors[0]->code); + } + + public function testCreate_withVenmoSdkPaymentMethodCode() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'venmoSdkPaymentMethodCode' => Braintree\Test\VenmoSdk::generateTestPaymentMethodCode('378734493671000') + ]); + $this->assertTrue($result->success); + $this->assertEquals("378734", $result->creditCard->bin); + } + + public function testCreate_with_invalid_venmoSdkPaymentMethodCode() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'venmoSdkPaymentMethodCode' => Braintree\Test\VenmoSdk::getInvalidPaymentMethodCode(), + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('creditCard')->onAttribute('venmoSdkPaymentMethodCode'); + $this->assertEquals($errors[0]->code, Braintree\Error\Codes::CREDIT_CARD_INVALID_VENMO_SDK_PAYMENT_METHOD_CODE); + + } + + public function testCreate_with_venmoSdkSession() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'venmoSdkSession' => Braintree\Test\VenmoSdk::getTestSession() + ] + ]); + $this->assertTrue($result->success); + $this->assertFalse($result->creditCard->isVenmoSdk()); + } + + public function testCreate_with_invalidVenmoSdkSession() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'venmoSdkSession' => Braintree\Test\VenmoSdk::getInvalidTestSession(), + ] + ]); + $this->assertTrue($result->success); + $this->assertFalse($result->creditCard->isVenmoSdk()); + } + + public function testCreate_withAccountTypeCredit() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'credit' + ] + ]); + $this->assertTrue($result->success); + $this->assertEquals('credit', $result->creditCard->verification->creditCard['accountType']); + } + + public function testCreate_withAccountTypeDebit() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'debit' + ] + ]); + $this->assertTrue($result->success); + $this->assertEquals('debit', $result->creditCard->verification->creditCard['accountType']); + } + + public function testCreate_ErrorsWithVerificationAccountTypeIsInvalid() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'wrong' + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('creditCard')->forKey('options')->onAttribute('verificationAccountType'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_OPTIONS_VERIFICATION_ACCOUNT_TYPE_IS_INVALID, $errors[0]->code); + } + + public function testCreate_ErrorsWithVerificationAccountTypeNotSupported() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationAccountType' => 'credit' + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('creditCard')->forKey('options')->onAttribute('verificationAccountType'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_OPTIONS_VERIFICATION_ACCOUNT_TYPE_NOT_SUPPORTED, $errors[0]->code); + } + + public function testCreateNoValidate_throwsIfValidationsFail() + { + + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + $customer = Braintree\Customer::createNoValidate(); + Braintree\CreditCard::createNoValidate([ + 'expirationDate' => 'invalid', + ]); + } + + public function testCreateNoValidate_returnsCreditCardIfValid() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCard = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->assertEquals($customer->id, $creditCard->customerId); + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('Cardholder', $creditCard->cardholderName); + $this->assertEquals('05/2012', $creditCard->expirationDate); + } + + public function testCreateFromTransparentRedirect() + { + Test\Helper::suppressDeprecationWarnings(); + $customer = Braintree\Customer::createNoValidate(); + $queryString = $this->createCreditCardViaTr( + [ + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12' + ] + ], + [ + 'creditCard' => [ + 'customerId' => $customer->id + ] + ] + ); + $result = Braintree\CreditCard::createFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $this->assertEquals('510510', $result->creditCard->bin); + $this->assertEquals('5100', $result->creditCard->last4); + $this->assertEquals('05/2012', $result->creditCard->expirationDate); + } + + public function testCreateFromTransparentRedirect_withDefault() + { + Test\Helper::suppressDeprecationWarnings(); + $customer = Braintree\Customer::createNoValidate(); + $queryString = $this->createCreditCardViaTr( + [ + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12', + 'options' => ['make_default' => true] + ] + ], + [ + 'creditCard' => [ + 'customerId' => $customer->id + ] + ] + ); + $result = Braintree\CreditCard::createFromTransparentRedirect($queryString); + $this->assertTrue($result->creditCard->isDefault()); + } + + public function testUpdateFromTransparentRedirect() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCard = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $queryString = $this->updateCreditCardViaTr( + [ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expiration_date' => '01/11' + ] + ], + ['paymentMethodToken' => $creditCard->token] + ); + $result = Braintree\CreditCard::updateFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $this->assertEquals('411111', $result->creditCard->bin); + $this->assertEquals('1111', $result->creditCard->last4); + $this->assertEquals('01/2011', $result->creditCard->expirationDate); + } + + public function testUpdateFromTransparentRedirect_withDefault() + { + $customer = Braintree\Customer::createNoValidate(); + $card1 = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $card2 = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->assertFalse($card2->isDefault()); + + $queryString = $this->updateCreditCardViaTr( + [ + 'credit_card' => [ + 'options' => [ + 'make_default' => true + ] + ] + ], + ['paymentMethodToken' => $card2->token] + ); + $result = Braintree\CreditCard::updateFromTransparentRedirect($queryString); + $this->assertFalse(Braintree\CreditCard::find($card1->token)->isDefault()); + $this->assertTrue(Braintree\CreditCard::find($card2->token)->isDefault()); + } + + public function testUpdateFromTransparentRedirect_andUpdateExistingBillingAddress() + { + $customer = Braintree\Customer::createNoValidate(); + $card = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '123 Old St', + 'extendedAddress' => 'Suite 101', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America' + ] + ]); + + $queryString = $this->updateCreditCardViaTr( + [], + [ + 'paymentMethodToken' => $card->token, + 'creditCard' => [ + 'billingAddress' => [ + 'streetAddress' => '123 New St', + 'locality' => 'St. Louis', + 'region' => 'MO', + 'postalCode' => '63119', + 'options' => [ + 'updateExisting' => True + ] + ] + ] + ] + ); + $result = Braintree\CreditCard::updateFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $card = $result->creditCard; + $this->assertEquals(1, sizeof(Braintree\Customer::find($customer->id)->addresses)); + $this->assertEquals('123 New St', $card->billingAddress->streetAddress); + $this->assertEquals('St. Louis', $card->billingAddress->locality); + $this->assertEquals('MO', $card->billingAddress->region); + $this->assertEquals('63119', $card->billingAddress->postalCode); + } + + public function testSale_createsASaleUsingGivenToken() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $result = Braintree\CreditCard::sale($creditCard->token, [ + 'amount' => '100.00' + ]); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals($customer->id, $result->transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $result->transaction->creditCardDetails->token); + } + + public function testSaleNoValidate_createsASaleUsingGivenToken() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $transaction = Braintree\CreditCard::saleNoValidate($creditCard->token, [ + 'amount' => '100.00' + ]); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals($customer->id, $transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $transaction->creditCardDetails->token); + } + + public function testSaleNoValidate_createsASaleUsingGivenTokenAndCvv() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $transaction = Braintree\CreditCard::saleNoValidate($creditCard->token, [ + 'amount' => '100.00', + 'creditCard' => [ + 'cvv' => '301' + ] + ]); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals($customer->id, $transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $transaction->creditCardDetails->token); + $this->assertEquals('S', $transaction->cvvResponseCode); + } + + public function testSaleNoValidate_throwsIfInvalid() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + Braintree\CreditCard::saleNoValidate($creditCard->token, [ + 'amount' => 'invalid' + ]); + } + + public function testCredit_createsACreditUsingGivenToken() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $result = Braintree\CreditCard::credit($creditCard->token, [ + 'amount' => '100.00' + ]); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals(Braintree\Transaction::CREDIT, $result->transaction->type); + $this->assertEquals($customer->id, $result->transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $result->transaction->creditCardDetails->token); + } + + public function testCreditNoValidate_createsACreditUsingGivenToken() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $transaction = Braintree\CreditCard::creditNoValidate($creditCard->token, [ + 'amount' => '100.00' + ]); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals(Braintree\Transaction::CREDIT, $transaction->type); + $this->assertEquals($customer->id, $transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $transaction->creditCardDetails->token); + } + + public function testCreditNoValidate_throwsIfInvalid() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + Braintree\CreditCard::creditNoValidate($creditCard->token, [ + 'amount' => 'invalid' + ]); + } + + public function testExpired() + { + $collection = Braintree\CreditCard::expired(); + $this->assertTrue($collection->maximumCount() > 1); + + $arr = []; + foreach($collection as $creditCard) { + $this->assertTrue($creditCard->isExpired()); + array_push($arr, $creditCard->token); + } + $uniqueCreditCardTokens = array_unique(array_values($arr)); + $this->assertEquals($collection->maximumCount(), count($uniqueCreditCardTokens)); + } + + + public function testExpiringBetween() + { + $collection = Braintree\CreditCard::expiringBetween( + mktime(0, 0, 0, 1, 1, 2010), + mktime(23, 59, 59, 12, 31, 2010) + ); + $this->assertTrue($collection->maximumCount() > 1); + + $arr = []; + foreach($collection as $creditCard) { + $this->assertEquals('2010', $creditCard->expirationYear); + array_push($arr, $creditCard->token); + } + $uniqueCreditCardTokens = array_unique(array_values($arr)); + $this->assertEquals($collection->maximumCount(), count($uniqueCreditCardTokens)); + } + + public function testExpiringBetween_parsesCreditCardDetailsUnderTransactionsCorrectly() + { + $collection = Braintree\CreditCard::expiringBetween( + mktime(0, 0, 0, 1, 1, 2010), + mktime(23, 59, 59, 12, 31, 2010) + ); + $this->assertTrue($collection->maximumCount() > 1); + + foreach($collection as $creditCard) { + foreach($creditCard->subscriptions as $subscription) { + foreach($subscription->transactions as $transaction) { + $this->assertNotNull($transaction->creditCardDetails->expirationMonth); + } + } + } + } + + public function testFind() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->assertTrue($result->success); + $creditCard = Braintree\CreditCard::find($result->creditCard->token); + $this->assertEquals($customer->id, $creditCard->customerId); + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('Cardholder', $creditCard->cardholderName); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals([], $creditCard->subscriptions); + } + + public function testFindReturnsAssociatedSubscriptions() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Suite 101', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America' + ] + ]); + $id = strval(rand()); + Braintree\Subscription::create([ + 'id' => $id, + 'paymentMethodToken' => $result->creditCard->token, + 'planId' => 'integration_trialless_plan', + 'price' => '1.00' + ]); + $creditCard = Braintree\CreditCard::find($result->creditCard->token); + $this->assertEquals($id, $creditCard->subscriptions[0]->id); + $this->assertEquals('integration_trialless_plan', $creditCard->subscriptions[0]->planId); + $this->assertEquals('1.00', $creditCard->subscriptions[0]->price); + } + + public function testFind_throwsIfCannotBeFound() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\CreditCard::find('invalid-token'); + } + + public function testFind_throwsUsefulErrorMessagesWhenEmpty() + { + $this->setExpectedException('InvalidArgumentException', 'expected credit card id to be set'); + Braintree\CreditCard::find(''); + } + + public function testFind_throwsUsefulErrorMessagesWhenInvalid() + { + $this->setExpectedException('InvalidArgumentException', '@ is an invalid credit card token'); + Braintree\CreditCard::find('@'); + } + + public function testFromNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "credit_card" => [ + "number" => "4009348888881881", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "customerId" => $customer->id + ]); + + $creditCard = Braintree\CreditCard::fromNonce($nonce); + + $customer = Braintree\Customer::find($customer->id); + $this->assertEquals($customer->creditCards[0], $creditCard); + } + + public function testFromNonce_ReturnsErrorWhenNoncePointsToSharedCard() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "credit_card" => [ + "number" => "4009348888881881", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "share" => true + ]); + + $this->setExpectedException('Braintree\Exception\NotFound', "not found"); + Braintree\CreditCard::fromNonce($nonce); + } + + public function testFromNonce_ReturnsErrorWhenNonceIsConsumed() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "credit_card" => [ + "number" => "4009348888881881", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "customerId" => $customer->id + ]); + + Braintree\CreditCard::fromNonce($nonce); + $this->setExpectedException('Braintree\Exception\NotFound', "consumed"); + Braintree\CreditCard::fromNonce($nonce); + } + + public function testUpdate() + { + $customer = Braintree\Customer::createNoValidate(); + $createResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Old Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->assertTrue($createResult->success); + $updateResult = Braintree\CreditCard::update($createResult->creditCard->token, [ + 'cardholderName' => 'New Cardholder', + 'number' => '4111111111111111', + 'expirationDate' => '07/14' + ]); + $this->assertEquals($customer->id, $updateResult->creditCard->customerId); + $this->assertEquals('411111', $updateResult->creditCard->bin); + $this->assertEquals('1111', $updateResult->creditCard->last4); + $this->assertEquals('New Cardholder', $updateResult->creditCard->cardholderName); + $this->assertEquals('07/2014', $updateResult->creditCard->expirationDate); + } + + public function testUpdate_withCardVerification() + { + $customer = Braintree\Customer::createNoValidate(); + $initialCreditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + + $result = Braintree\CreditCard::update($initialCreditCard->token, [ + 'billingAddress' => [ + 'region' => 'IL' + ], + 'options' => ['verifyCard' => true] + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + $this->assertEquals('2000', $result->creditCardVerification->processorResponseCode); + $this->assertEquals('Do Not Honor', $result->creditCardVerification->processorResponseText); + $this->assertEquals('I', $result->creditCardVerification->cvvResponseCode); + $this->assertEquals(null, $result->creditCardVerification->avsErrorResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsPostalCodeResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsStreetAddressResponseCode); + $this->assertEquals(Test\Helper::defaultMerchantAccountId(), $result->creditCardVerification->merchantAccountId); + } + + public function testUpdate_withCardVerificationAndSpecificMerchantAccount() + { + $customer = Braintree\Customer::createNoValidate(); + $initialCreditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + + $result = Braintree\CreditCard::update($initialCreditCard->token, [ + 'billingAddress' => [ + 'region' => 'IL' + ], + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'verifyCard' => true + ] + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + $this->assertEquals(Test\Helper::nonDefaultMerchantAccountId(), $result->creditCardVerification->merchantAccountId); + } + + public function testUpdate_createsNewBillingAddressByDefault() + { + $customer = Braintree\Customer::createNoValidate(); + $initialCreditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'streetAddress' => '123 Nigeria Ave' + ] + ])->creditCard; + + $updatedCreditCard = Braintree\CreditCard::update($initialCreditCard->token, [ + 'billingAddress' => [ + 'region' => 'IL' + ] + ])->creditCard; + $this->assertEquals('IL', $updatedCreditCard->billingAddress->region); + $this->assertNull($updatedCreditCard->billingAddress->streetAddress); + $this->assertNotEquals($initialCreditCard->billingAddress->id, $updatedCreditCard->billingAddress->id); + } + + public function testUpdate_updatesExistingBillingAddressIfUpdateExistingOptionIsTrue() + { + $customer = Braintree\Customer::createNoValidate(); + $initialCreditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'countryName' => 'Turkey', + 'countryCodeAlpha2' => 'TR', + 'countryCodeAlpha3' => 'TUR', + 'countryCodeNumeric' => '792', + ] + ])->creditCard; + + $updatedCreditCard = Braintree\CreditCard::update($initialCreditCard->token, [ + 'billingAddress' => [ + 'countryName' => 'Thailand', + 'countryCodeAlpha2' => 'TH', + 'countryCodeAlpha3' => 'THA', + 'countryCodeNumeric' => '764', + 'options' => [ + 'updateExisting' => True + ] + ] + ])->creditCard; + $this->assertEquals('Thailand', $updatedCreditCard->billingAddress->countryName); + $this->assertEquals('TH', $updatedCreditCard->billingAddress->countryCodeAlpha2); + $this->assertEquals('THA', $updatedCreditCard->billingAddress->countryCodeAlpha3); + $this->assertEquals('764', $updatedCreditCard->billingAddress->countryCodeNumeric); + $this->assertEquals($initialCreditCard->billingAddress->id, $updatedCreditCard->billingAddress->id); + } + + public function testUpdate_canChangeToken() + { + $oldToken = strval(rand()); + $newToken = strval(rand()); + + $customer = Braintree\Customer::createNoValidate(); + $createResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'token' => $oldToken, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->assertTrue($createResult->success); + $updateResult = Braintree\CreditCard::update($oldToken, [ + 'token' => $newToken + ]); + $this->assertEquals($customer->id, $updateResult->creditCard->customerId); + $this->assertEquals($newToken, $updateResult->creditCard->token); + $this->assertEquals($newToken, Braintree\CreditCard::find($newToken)->token); + } + + public function testUpdateNoValidate() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCard = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'cardholderName' => 'Old Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $updatedCard = Braintree\CreditCard::updateNoValidate($creditCard->token, [ + 'cardholderName' => 'New Cardholder', + 'number' => '4111111111111111', + 'expirationDate' => '07/14' + ]); + $this->assertEquals($customer->id, $updatedCard->customerId); + $this->assertEquals('411111', $updatedCard->bin); + $this->assertEquals('1111', $updatedCard->last4); + $this->assertEquals('New Cardholder', $updatedCard->cardholderName); + $this->assertEquals('07/2014', $updatedCard->expirationDate); + } + + public function testUpdateNoValidate_throwsIfInvalid() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCard = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'cardholderName' => 'Old Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + Braintree\CreditCard::updateNoValidate($creditCard->token, [ + 'number' => 'invalid', + ]); + } + + public function testUpdate_withDefault() + { + $customer = Braintree\Customer::createNoValidate(); + $card1 = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + $card2 = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + + $this->assertTrue($card1->isDefault()); + $this->assertFalse($card2->isDefault()); + + Braintree\CreditCard::update($card2->token, [ + 'options' => ['makeDefault' => true] + ])->creditCard; + + $this->assertFalse(Braintree\CreditCard::find($card1->token)->isDefault()); + $this->assertTrue(Braintree\CreditCard::find($card2->token)->isDefault()); + } + + public function testDelete_deletesThePaymentMethod() + { + $customer = Braintree\Customer::createNoValidate([]); + $creditCard = Braintree\CreditCard::createNoValidate([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + Braintree\CreditCard::find($creditCard->token); + Braintree\CreditCard::delete($creditCard->token); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\CreditCard::find($creditCard->token); + } + + public function testGatewayRejectionOnCVV() + { + $old_merchant_id = Braintree\Configuration::merchantId(); + $old_public_key = Braintree\Configuration::publicKey(); + $old_private_key = Braintree\Configuration::privateKey(); + + Braintree\Configuration::merchantId('processing_rules_merchant_id'); + Braintree\Configuration::publicKey('processing_rules_public_key'); + Braintree\Configuration::privateKey('processing_rules_private_key'); + + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '4111111111111111', + 'expirationDate' => '05/2011', + 'cvv' => '200', + 'options' => ['verifyCard' => true] + ]); + + Braintree\Configuration::merchantId($old_merchant_id); + Braintree\Configuration::publicKey($old_public_key); + Braintree\Configuration::privateKey($old_private_key); + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Transaction::CVV, $result->creditCardVerification->gatewayRejectionReason); + } + + public function testGatewayRejectionIsNullOnProcessorDecline() + { + $old_merchant_id = Braintree\Configuration::merchantId(); + $old_public_key = Braintree\Configuration::publicKey(); + $old_private_key = Braintree\Configuration::privateKey(); + + Braintree\Configuration::merchantId('processing_rules_merchant_id'); + Braintree\Configuration::publicKey('processing_rules_public_key'); + Braintree\Configuration::privateKey('processing_rules_private_key'); + + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'cvv' => '200', + 'options' => ['verifyCard' => true] + ]); + + Braintree\Configuration::merchantId($old_merchant_id); + Braintree\Configuration::publicKey($old_public_key); + Braintree\Configuration::privateKey($old_private_key); + + $this->assertFalse($result->success); + $this->assertNull($result->creditCardVerification->gatewayRejectionReason); + } + + public function createCreditCardViaTr($regularParams, $trParams) + { + $trData = Braintree\TransparentRedirect::createCreditCardData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + return Test\Helper::submitTrRequest( + Braintree\CreditCard::createCreditCardUrl(), + $regularParams, + $trData + ); + } + + public function updateCreditCardViaTr($regularParams, $trParams) + { + $trData = Braintree\TransparentRedirect::updateCreditCardData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + return Test\Helper::submitTrRequest( + Braintree\CreditCard::updateCreditCardUrl(), + $regularParams, + $trData + ); + } + + public function testPrepaidCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::PREPAID, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::PREPAID_YES, $result->creditCard->prepaid); + } + + public function testCommercialCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::COMMERCIAL, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::COMMERCIAL_YES, $result->creditCard->commercial); + } + + public function testDebitCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::DEBIT, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::DEBIT_YES, $result->creditCard->debit); + } + + public function testPayrollCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::PAYROLL, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::PAYROLL_YES, $result->creditCard->payroll); + $this->assertEquals('MSA', $result->creditCard->productId); + } + + public function testHealthCareCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::HEALTHCARE, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::HEALTHCARE_YES, $result->creditCard->healthcare); + $this->assertEquals('J3', $result->creditCard->productId); + } + + public function testDurbinRegulatedCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::DURBIN_REGULATED, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::DURBIN_REGULATED_YES, $result->creditCard->durbinRegulated); + } + + public function testCountryOfIssuanceCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::COUNTRY_OF_ISSUANCE, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals("USA", $result->creditCard->countryOfIssuance); + } + + public function testIssuingBankCard() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::ISSUING_BANK, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals("NETWORK ONLY", $result->creditCard->issuingBank); + } + + public function testNegativeCardTypeIndicators() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::NO, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::PREPAID_NO, $result->creditCard->prepaid); + $this->assertEquals(Braintree\CreditCard::DURBIN_REGULATED_NO, $result->creditCard->durbinRegulated); + $this->assertEquals(Braintree\CreditCard::PAYROLL_NO, $result->creditCard->payroll); + $this->assertEquals(Braintree\CreditCard::DEBIT_NO, $result->creditCard->debit); + $this->assertEquals(Braintree\CreditCard::HEALTHCARE_NO, $result->creditCard->healthcare); + $this->assertEquals(Braintree\CreditCard::COMMERCIAL_NO, $result->creditCard->commercial); + $this->assertEquals('MSB', $result->creditCard->productId); + } + + public function testUnknownCardTypeIndicators() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => CardTypeIndicators::UNKNOWN, + 'expirationDate' => '05/12', + 'options' => ['verifyCard' => true] + ]); + $this->assertEquals(Braintree\CreditCard::PREPAID_UNKNOWN, $result->creditCard->prepaid); + $this->assertEquals(Braintree\CreditCard::DURBIN_REGULATED_UNKNOWN, $result->creditCard->durbinRegulated); + $this->assertEquals(Braintree\CreditCard::PAYROLL_UNKNOWN, $result->creditCard->payroll); + $this->assertEquals(Braintree\CreditCard::DEBIT_UNKNOWN, $result->creditCard->debit); + $this->assertEquals(Braintree\CreditCard::HEALTHCARE_UNKNOWN, $result->creditCard->healthcare); + $this->assertEquals(Braintree\CreditCard::COMMERCIAL_UNKNOWN, $result->creditCard->commercial); + $this->assertEquals(Braintree\CreditCard::COUNTRY_OF_ISSUANCE_UNKNOWN, $result->creditCard->countryOfIssuance); + $this->assertEquals(Braintree\CreditCard::ISSUING_BANK_UNKNOWN, $result->creditCard->issuingBank); + $this->assertEquals(Braintree\CreditCard::PRODUCT_ID_UNKNOWN, $result->creditCard->productId); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationAdvancedSearchTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationAdvancedSearchTest.php new file mode 100644 index 00000000000..365e8829bf7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationAdvancedSearchTest.php @@ -0,0 +1,259 @@ + 'Tim Toole', + 'creditCardExpirationDate' => '05/2010', + 'creditCardNumber' => Braintree\Test\CreditCardNumbers::$failsSandboxVerification['Visa'], + 'billingAddressDetailsPostalCode' => '90210', + ]; + $result = Braintree\Customer::create([ + 'creditCard' => [ + 'cardholderName' => $searchCriteria['creditCardCardholderName'], + 'number' => $searchCriteria['creditCardNumber'], + 'expirationDate' => $searchCriteria['creditCardExpirationDate'], + 'billingAddress' => [ + 'postalCode' => $searchCriteria['billingAddressDetailsPostalCode'] + ], + 'options' => ['verifyCard' => true], + ], + ]); + $verification = $result->creditCardVerification; + + $query = [Braintree\CreditCardVerificationSearch::id()->is($verification->id)]; + foreach ($searchCriteria AS $criterion => $value) { + $query[] = Braintree\CreditCardVerificationSearch::$criterion()->is($value); + } + + $collection = Braintree\CreditCardVerification::search($query); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($result->creditCardVerification->id, $collection->firstItem()->id); + + foreach ($searchCriteria AS $criterion => $value) { + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::$criterion()->is($value), + Braintree\CreditCardVerificationSearch::id()->is($result->creditCardVerification->id) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($result->creditCardVerification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::$criterion()->is('invalid_attribute'), + Braintree\CreditCardVerificationSearch::id()->is($result->creditCardVerification->id) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + } + + public function test_searchOnSuccessfulCustomerAndPaymentFields() + { + $customerId = uniqid(); + $searchCriteria = [ + 'customerId' => $customerId, + 'customerEmail' => $customerId . 'sandworm@example.com', + 'paymentMethodToken' => $customerId . 'token', + ]; + $result = Braintree\Customer::create([ + 'id' => $customerId, + 'email' => $searchCriteria['customerEmail'], + 'creditCard' => [ + 'token' => $searchCriteria['paymentMethodToken'], + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2017', + 'options' => ['verifyCard' => true] + ] + ]); + $customer = $result->customer; + + $query = []; + foreach ($searchCriteria AS $criterion => $value) { + $query[] = Braintree\CreditCardVerificationSearch::$criterion()->is($value); + } + + $collection = Braintree\CreditCardVerification::search($query); + $this->assertEquals(1, $collection->maximumCount()); + + foreach ($searchCriteria AS $criterion => $value) { + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::$criterion()->is($value), + ]); + $this->assertEquals(1, $collection->maximumCount()); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::$criterion()->is('invalid_attribute'), + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + } + + public function testGateway_searchEmpty() + { + $query = []; + $query[] = Braintree\CreditCardVerificationSearch::creditCardCardholderName()->is('Not Found'); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $collection = $gateway->creditCardVerification()->search($query); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_createdAt() + { + $result = Braintree\Customer::create([ + 'creditCard' => [ + 'cardholderName' => 'Joe Smith', + 'number' => '4000111111111115', + 'expirationDate' => '12/2016', + 'options' => ['verifyCard' => true], + ], + ]); + + $verification = $result->creditCardVerification; + + $past = clone $verification->createdAt; + $past->modify('-1 hour'); + $future = clone $verification->createdAt; + $future->modify('+1 hour'); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($verification->id), + Braintree\CreditCardVerificationSearch::createdAt()->between($past, $future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($verification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($verification->id), + Braintree\CreditCardVerificationSearch::createdAt()->lessThanOrEqualTo($future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($verification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($verification->id), + Braintree\CreditCardVerificationSearch::createdAt()->greaterThanOrEqualTo($past) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($verification->id, $collection->firstItem()->id); + } + + public function test_multipleValueNode_ids() + { + $result = Braintree\Customer::create([ + 'creditCard' => [ + 'cardholderName' => 'Joe Smith', + 'number' => '4000111111111115', + 'expirationDate' => '12/2016', + 'options' => ['verifyCard' => true], + ], + ]); + + $creditCardVerification = $result->creditCardVerification; + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::ids()->is($creditCardVerification->id) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($creditCardVerification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::ids()->in( + [$creditCardVerification->id,'1234'] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($creditCardVerification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::ids()->is('1234') + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_creditCardType() + { + $result = Braintree\Customer::create([ + 'creditCard' => [ + 'cardholderName' => 'Joe Smith', + 'number' => '4000111111111115', + 'expirationDate' => '12/2016', + 'options' => ['verifyCard' => true], + ], + ]); + + $creditCardVerification = $result->creditCardVerification; + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($creditCardVerification->id), + Braintree\CreditCardVerificationSearch::creditCardCardType()->is($creditCardVerification->creditCard['cardType']) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($creditCardVerification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($creditCardVerification->id), + Braintree\CreditCardVerificationSearch::creditCardCardType()->in( + [$creditCardVerification->creditCard['cardType'], Braintree\CreditCard::CHINA_UNION_PAY] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($creditCardVerification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($creditCardVerification->id), + Braintree\CreditCardVerificationSearch::creditCardCardType()->is(Braintree\CreditCard::CHINA_UNION_PAY) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_status() + { + $result = Braintree\Customer::create([ + 'creditCard' => [ + 'cardholderName' => 'Joe Smith', + 'number' => '4000111111111115', + 'expirationDate' => '12/2016', + 'options' => ['verifyCard' => true], + ], + ]); + + $creditCardVerification = $result->creditCardVerification; + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($creditCardVerification->id), + Braintree\CreditCardVerificationSearch::status()->is($creditCardVerification->status) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($creditCardVerification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($creditCardVerification->id), + Braintree\CreditCardVerificationSearch::status()->in( + [$creditCardVerification->status, Braintree\Result\CreditCardVerification::VERIFIED] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($creditCardVerification->id, $collection->firstItem()->id); + + $collection = Braintree\CreditCardVerification::search([ + Braintree\CreditCardVerificationSearch::id()->is($creditCardVerification->id), + Braintree\CreditCardVerificationSearch::status()->is(Braintree\Result\CreditCardVerification::VERIFIED) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationTest.php new file mode 100644 index 00000000000..503a4e22ffa --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CreditCardVerificationTest.php @@ -0,0 +1,136 @@ + [ + 'number' => '4111111111111111', + 'expirationDate' => '05/2011', + ], + ]); + $this->assertTrue($result->success); + + $verification = $result->verification; + + $this->assertEquals($verification->processorResponseCode, '1000'); + $this->assertEquals($verification->processorResponseText, 'Approved'); + $this->assertEquals($verification->processorResponseType, Braintree\ProcessorResponseTypes::APPROVED); + } + + public function test_createWithUnsuccessfulResponse() + { + $result = Braintree\CreditCardVerification::create([ + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$failsSandboxVerification['Visa'], + 'expirationDate' => '05/2011', + ], + ]); + $this->assertFalse($result->success); + $this->assertEquals($result->verification->status, Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED); + + $verification = $result->verification; + + $this->assertEquals($verification->processorResponseCode, '2000'); + $this->assertEquals($verification->processorResponseText, 'Do Not Honor'); + $this->assertEquals($verification->processorResponseType, Braintree\ProcessorResponseTypes::SOFT_DECLINED); + } + + public function test_createWithInvalidRequest() + { + $result = Braintree\CreditCardVerification::create([ + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$failsSandboxVerification['Visa'], + 'expirationDate' => '05/2011', + ], + 'options' => [ + 'amount' => '-5.00' + ], + ]); + $this->assertFalse($result->success); + + $amountErrors = $result->errors->forKey('verification')->forKey('options')->onAttribute('amount'); + $this->assertEquals(Braintree\Error\Codes::VERIFICATION_OPTIONS_AMOUNT_CANNOT_BE_NEGATIVE, $amountErrors[0]->code); + } + + public function test_createWithAccountTypeCredit() + { + $result = Braintree\CreditCardVerification::create([ + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/2011', + ], + 'options' => [ + 'merchantAccountId' => 'hiper_brl', + 'accountType' => 'credit' + ] + ]); + $this->assertTrue($result->success); + + $verification = $result->verification; + + $this->assertEquals($verification->creditCard['accountType'], 'credit'); + } + + public function test_createWithAccountTypeDebit() + { + $result = Braintree\CreditCardVerification::create([ + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/2011', + ], + 'options' => [ + 'merchantAccountId' => 'hiper_brl', + 'accountType' => 'debit' + ] + ]); + $this->assertTrue($result->success); + + $verification = $result->verification; + + $this->assertEquals($verification->creditCard['accountType'], 'debit'); + } + + public function test_createErrorsWithAccountTypeIsInvalid() + { + $result = Braintree\CreditCardVerification::create([ + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/2011', + ], + 'options' => [ + 'merchantAccountId' => 'hiper_brl', + 'accountType' => 'wrong' + ] + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('verification')->forKey('options')->onAttribute('accountType'); + $this->assertEquals(Braintree\Error\Codes::VERIFICATION_OPTIONS_ACCOUNT_TYPE_IS_INVALID, $errors[0]->code); + } + + public function test_createErrorsWithAccountTypeNotSupported() + { + $result = Braintree\CreditCardVerification::create([ + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2011', + ], + 'options' => [ + 'accountType' => 'credit' + ] + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('verification')->forKey('options')->onAttribute('accountType'); + $this->assertEquals(Braintree\Error\Codes::VERIFICATION_OPTIONS_ACCOUNT_TYPE_NOT_SUPPORTED, $errors[0]->code); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerAdvancedSearchTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerAdvancedSearchTest.php new file mode 100644 index 00000000000..2b8d196452b --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerAdvancedSearchTest.php @@ -0,0 +1,199 @@ +is('badname') + ]); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_noRequestsWhenIterating() + { + $resultsReturned = false; + $collection = Braintree\Customer::search([ + Braintree\CustomerSearch::firstName()->is('badname') + ]); + + foreach($collection as $customer) { + $resultsReturned = true; + break; + } + + $this->assertSame(0, $collection->maximumCount()); + $this->assertEquals(false, $resultsReturned); + } + + public function test_findDuplicateCardsGivenPaymentMethodToken() + { + $creditCardRequest = ['number' => '63049580000009', 'expirationDate' => '05/2012']; + + $jim = Braintree\Customer::create(['firstName' => 'Jim', 'creditCard' => $creditCardRequest])->customer; + $joe = Braintree\Customer::create(['firstName' => 'Joe', 'creditCard' => $creditCardRequest])->customer; + + $query = [Braintree\CustomerSearch::paymentMethodTokenWithDuplicates()->is($jim->creditCards[0]->token)]; + $collection = Braintree\Customer::search($query); + + $customerIds = []; + foreach($collection as $customer) + { + $customerIds[] = $customer->id; + } + + $this->assertTrue(in_array($jim->id, $customerIds)); + $this->assertTrue(in_array($joe->id, $customerIds)); + } + + public function test_searchOnTextFields() + { + $token = 'cctoken' . rand(); + + $search_criteria = [ + 'firstName' => 'Timmy', + 'lastName' => 'OToole', + 'company' => 'OToole and Son(s)' . rand(), + 'email' => 'timmy@example.com', + 'website' => 'http://example.com', + 'phone' => '3145551234', + 'fax' => '3145551235', + 'cardholderName' => 'Tim Toole', + 'creditCardExpirationDate' => '05/2010', + 'creditCardNumber' => '4111111111111111', + 'paymentMethodToken' => $token, + 'addressFirstName' => 'Thomas', + 'addressLastName' => 'Otool', + 'addressStreetAddress' => '1 E Main St', + 'addressExtendedAddress' => 'Suite 3', + 'addressLocality' => 'Chicago', + 'addressRegion' => 'Illinois', + 'addressPostalCode' => '60622', + 'addressCountryName' => 'United States of America' + ]; + + $customer = Braintree\Customer::createNoValidate([ + 'firstName' => $search_criteria['firstName'], + 'lastName' => $search_criteria['lastName'], + 'company' => $search_criteria['company'], + 'email' => $search_criteria['email'], + 'fax' => $search_criteria['fax'], + 'phone' => $search_criteria['phone'], + 'website' => $search_criteria['website'], + 'creditCard' => [ + 'cardholderName' => 'Tim Toole', + 'number' => '4111111111111111', + 'expirationDate' => $search_criteria['creditCardExpirationDate'], + 'token' => $token, + 'billingAddress' => [ + 'firstName' => $search_criteria['addressFirstName'], + 'lastName' => $search_criteria['addressLastName'], + 'streetAddress' => $search_criteria['addressStreetAddress'], + 'extendedAddress' => $search_criteria['addressExtendedAddress'], + 'locality' => $search_criteria['addressLocality'], + 'region' => $search_criteria['addressRegion'], + 'postalCode' => $search_criteria['addressPostalCode'], + 'countryName' => 'United States of America' + ] + ] + ]); + + $query = [Braintree\CustomerSearch::id()->is($customer->id)]; + foreach ($search_criteria AS $criterion => $value) { + $query[] = Braintree\CustomerSearch::$criterion()->is($value); + } + + $collection = Braintree\Customer::search($query); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($customer->id, $collection->firstItem()->id); + + foreach ($search_criteria AS $criterion => $value) { + $collection = Braintree\Customer::search([ + Braintree\CustomerSearch::$criterion()->is($value), + Braintree\CustomerSearch::id()->is($customer->id), + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($customer->id, $collection->firstItem()->id); + + $collection = Braintree\Customer::search([ + Braintree\CustomerSearch::$criterion()->is('invalid_attribute'), + Braintree\CustomerSearch::id()->is($customer->id), + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + } + + public function test_createdAt() + { + $customer = Braintree\Customer::createNoValidate(); + + $past = clone $customer->createdAt; + $past->modify("-1 hour"); + $future = clone $customer->createdAt; + $future->modify("+1 hour"); + + $collection = Braintree\Customer::search([ + Braintree\CustomerSearch::id()->is($customer->id), + Braintree\CustomerSearch::createdAt()->between($past, $future), + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($customer->id, $collection->firstItem()->id); + + $collection = Braintree\Customer::search([ + Braintree\CustomerSearch::id()->is($customer->id), + Braintree\CustomerSearch::createdAt()->lessThanOrEqualTo($future), + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($customer->id, $collection->firstItem()->id); + + $collection = Braintree\Customer::search([ + Braintree\CustomerSearch::id()->is($customer->id), + Braintree\CustomerSearch::createdAt()->greaterThanOrEqualTo($past), + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($customer->id, $collection->firstItem()->id); + } + + public function test_paypalAccountEmail() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + ] + ]); + + $customerId = 'UNIQUE_CUSTOMER_ID-' . strval(rand()); + $customerResult = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce, + 'id' => $customerId + ]); + + $this->assertTrue($customerResult->success); + + $customer = $customerResult->customer; + + $collection = Braintree\Customer::search([ + Braintree\CustomerSearch::id()->is($customer->id), + Braintree\CustomerSearch::paypalAccountEmail()->is('jane.doe@example.com') + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($customer->id, $collection->firstItem()->id); + } + + public function test_throwsIfNoOperatorNodeGiven() + { + $this->setExpectedException('InvalidArgumentException', 'Operator must be provided'); + Braintree\Customer::search([ + Braintree\CustomerSearch::creditCardExpirationDate() + ]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerTest.php new file mode 100644 index 00000000000..c0d17ca99d9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/CustomerTest.php @@ -0,0 +1,1886 @@ +assertTrue($all->maximumCount() > 0); + } + + public function testAllWithManyResults() + { + $collection = Braintree\Customer::all(); + $this->assertTrue($collection->maximumCount() > 1); + $customer = $collection->firstItem(); + + $this->assertTrue(strlen($customer->id) > 0); + $this->assertTrue($customer instanceof Braintree\Customer); + } + + public function testCreate() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Mike', $customer->firstName); + $this->assertEquals('Jones', $customer->lastName); + $this->assertEquals('Jones Co.', $customer->company); + $this->assertEquals('mike.jones@example.com', $customer->email); + $this->assertEquals('419.555.1234', $customer->phone); + $this->assertEquals('419.555.1235', $customer->fax); + $this->assertEquals('http://example.com', $customer->website); + $this->assertNotNull($customer->merchantId); + } + + public function testCreateWithIdOfZero() + { + $result = Braintree\Customer::create([ + 'id' => '0' + ]); + + $this->assertEquals(true, $result->success); + $this->assertEquals($result->customer->id, '0'); + $customer = Braintree\Customer::find('0'); + + $this->assertEquals('0', $customer->id); + + Braintree\Customer::delete('0'); + } + + public function testGatewayCreate() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->customer()->create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Mike', $customer->firstName); + $this->assertEquals('Jones', $customer->lastName); + $this->assertNotNull($customer->merchantId); + } + + public function testCreateWithAccessToken() + { + $credentials = Test\Braintree\OAuthTestHelper::createCredentials([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + 'merchantId' => 'integration_merchant_id', + ]); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken, + ]); + + $result = $gateway->customer()->create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Mike', $customer->firstName); + $this->assertEquals('Jones', $customer->lastName); + $this->assertNotNull($customer->merchantId); + } + + public function testCreateWithAccountTypeDebit() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'debit' + ] + ] + ]); + $this->assertEquals(true, $result->success); + $this->assertEquals('debit', $result->customer->creditCards[0]->verification->creditCard['accountType']); + } + + public function testCreateWithAccountTypeCredit() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'credit' + ] + ] + ]); + $this->assertEquals(true, $result->success); + $this->assertEquals('credit', $result->customer->creditCards[0]->verification->creditCard['accountType']); + } + + public function testCreateErrorsWithVerificationAccountTypeIsInvalid() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'wrong' + ] + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->forKey('options')->onAttribute('verificationAccountType'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_OPTIONS_VERIFICATION_ACCOUNT_TYPE_IS_INVALID, $errors[0]->code); + } + + public function testCreateErrorsWithVerificationAccountTypeNotSupported() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + "number" => "4111111111111111", + 'expirationDate' => '05/12', + 'options' => [ + 'verifyCard' => true, + 'verificationAccountType' => 'credit' + ] + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->forKey('options')->onAttribute('verificationAccountType'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_OPTIONS_VERIFICATION_ACCOUNT_TYPE_NOT_SUPPORTED, $errors[0]->code); + } + + public function testCreateCustomerWithCardUsingNonce() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "share" => true + ]); + + $result = Braintree\Customer::create([ + 'creditCard' => [ + 'paymentMethodNonce' => $nonce + ] + ]); + + $this->assertTrue($result->success); + $this->assertSame("411111", $result->customer->creditCards[0]->bin); + $this->assertSame("1111", $result->customer->creditCards[0]->last4); + } + + public function testCreateCustomerWithApplePayCard() + { + $nonce = Braintree\Test\Nonces::$applePayVisa; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->applePayCards[0]); + $this->assertNotNull($customer->paymentMethods[0]); + } + + public function testCreateCustomerWithAndroidPayProxyCard() + { + $nonce = Braintree\Test\Nonces::$androidPayDiscover; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->androidPayCards[0]); + $this->assertNotNull($customer->paymentMethods[0]); + $androidPayCard = $customer->androidPayCards[0]; + $this->assertTrue($androidPayCard instanceof Braintree\AndroidPayCard); + $this->assertNotNull($androidPayCard->token); + $this->assertNotNull($androidPayCard->expirationYear); + } + + public function testCreateCustomerWithAndroidPayNetworkToken() + { + $nonce = Braintree\Test\Nonces::$androidPayMasterCard; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->androidPayCards[0]); + $this->assertNotNull($customer->paymentMethods[0]); + $androidPayCard = $customer->androidPayCards[0]; + $this->assertTrue($androidPayCard instanceof Braintree\AndroidPayCard); + $this->assertNotNull($androidPayCard->token); + $this->assertNotNull($androidPayCard->expirationYear); + } + + public function testCreateCustomerWithAmexExpressCheckoutCard() + { + $nonce = Braintree\Test\Nonces::$amexExpressCheckout; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->amexExpressCheckoutCards[0]); + $this->assertNotNull($customer->paymentMethods[0]); + $amexExpressCheckoutCard = $customer->amexExpressCheckoutCards[0]; + $this->assertTrue($amexExpressCheckoutCard instanceof Braintree\AmexExpressCheckoutCard); + $this->assertNotNull($amexExpressCheckoutCard->token); + $this->assertNotNull($amexExpressCheckoutCard->expirationYear); + } + + public function testCreateCustomerWithVenmoAccount() + { + $nonce = Braintree\Test\Nonces::$venmoAccount; + $result = Braintree\Customer::create(array( + 'paymentMethodNonce' => $nonce + )); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->venmoAccounts[0]); + $this->assertNotNull($customer->paymentMethods[0]); + $venmoAccount = $customer->venmoAccounts[0]; + $this->assertTrue($venmoAccount instanceof Braintree\VenmoAccount); + $this->assertNotNull($venmoAccount->token); + $this->assertNotNull($venmoAccount->username); + $this->assertNotNull($venmoAccount->venmoUserId); + } + + public function testCannotCreateCustomerWithCoinbase() + { + $nonce = Braintree\Test\Nonces::$coinbase; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::PAYMENT_METHOD_NO_LONGER_SUPPORTED, $result->errors->forKey('coinbaseAccount')->onAttribute('base')[0]->code); + } + + public function testCreateCustomerWithUsBankAccount() + { + $nonce = Test\Helper::generateValidUsBankAccountNonce(); + $result = Braintree\Customer::create(array( + 'paymentMethodNonce' => $nonce, + 'creditCard' => [ + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ] + )); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->usBankAccounts[0]); + $this->assertNotNull($customer->paymentMethods[0]); + $usBankAccount = $customer->usBankAccounts[0]; + $this->assertTrue($usBankAccount instanceof Braintree\UsBankAccount); + $this->assertNotNull($usBankAccount->token); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertEquals('021000021', $usBankAccount->routingNumber); + $this->assertEquals('1234', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertRegexp('/CHASE/', $usBankAccount->bankName); + } + + public function testCreate_withUnicode() + { + $result = Braintree\Customer::create([ + 'firstName' => "ЗдравÑтвуйте", + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals("ЗдравÑтвуйте", $customer->firstName); + $this->assertEquals('Jones', $customer->lastName); + $this->assertEquals('Jones Co.', $customer->company); + $this->assertEquals('mike.jones@example.com', $customer->email); + $this->assertEquals('419.555.1234', $customer->phone); + $this->assertEquals('419.555.1235', $customer->fax); + $this->assertEquals('http://example.com', $customer->website); + $this->assertNotNull($customer->merchantId); + } + + public function testCreate_withCountry() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Bat', + 'lastName' => 'Manderson', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'countryName' => 'Gabon', + 'countryCodeAlpha2' => 'GA', + 'countryCodeAlpha3' => 'GAB', + 'countryCodeNumeric' => '266' + ] + ] + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Gabon', $customer->creditCards[0]->billingAddress->countryName); + $this->assertEquals('GA', $customer->creditCards[0]->billingAddress->countryCodeAlpha2); + $this->assertEquals('GAB', $customer->creditCards[0]->billingAddress->countryCodeAlpha3); + $this->assertEquals('266', $customer->creditCards[0]->billingAddress->countryCodeNumeric); + $this->assertEquals(1, preg_match('/\A\w{32}\z/', $customer->creditCards[0]->uniqueNumberIdentifier)); + } + + public function testCreate_withVenmoSdkSession() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Bat', + 'lastName' => 'Manderson', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'venmoSdkSession' => Braintree\Test\VenmoSdk::getTestSession() + ] + ] + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals(false, $customer->creditCards[0]->venmoSdk); + } + + public function testCreate_withVenmoSdkPaymentMethodCode() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Bat', + 'lastName' => 'Manderson', + 'creditCard' => [ + 'venmoSdkPaymentMethodCode' => Braintree\Test\VenmoSdk::$visaPaymentMethodCode + ], + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals("411111", $customer->creditCards[0]->bin); + } + + public function testCreate_blankCustomer() + { + $result = Braintree\Customer::create(); + $this->assertEquals(true, $result->success); + $this->assertNotNull($result->customer->id); + + $result = Braintree\Customer::create([]); + $this->assertEquals(true, $result->success); + $this->assertNotNull($result->customer->id); + } + + public function testCreate_withSpecialChars() + { + $result = Braintree\Customer::create(['firstName' => '<>&"\'']); + $this->assertEquals(true, $result->success); + $this->assertEquals('<>&"\'', $result->customer->firstName); + } + + public function testCreate_withCustomFields() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'customFields' => [ + 'store_me' => 'some custom value' + ] + ]); + $this->assertEquals(true, $result->success); + $customFields = $result->customer->customFields; + $this->assertEquals('some custom value', $customFields['store_me']); + } + + public function testCreate_withFraudParams() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Mike Jones', + 'deviceSessionId' => 'abc123', + 'fraudMerchantId' => '456' + ] + ]); + $this->assertEquals(true, $result->success); + } + + public function testCreate_withRiskData() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Mike Jones', + ], + 'riskData' => [ + 'customer_browser' => 'IE5', + 'customer_ip' => '192.168.0.1' + ] + ]); + $this->assertEquals(true, $result->success); + } + + public function testCreate_withCreditCard() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Mike Jones' + ] + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Mike', $customer->firstName); + $this->assertEquals('Jones', $customer->lastName); + $this->assertEquals('Jones Co.', $customer->company); + $this->assertEquals('mike.jones@example.com', $customer->email); + $this->assertEquals('419.555.1234', $customer->phone); + $this->assertEquals('419.555.1235', $customer->fax); + $this->assertEquals('http://example.com', $customer->website); + $creditCard = $customer->creditCards[0]; + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('Mike Jones', $creditCard->cardholderName); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('05', $creditCard->expirationMonth); + $this->assertEquals('2012', $creditCard->expirationYear); + } + + public function testCreate_withDuplicateCardCheck() + { + $customer = Braintree\Customer::createNoValidate(); + + $attributes = [ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Mike Jones', + 'options' => [ + 'failOnDuplicatePaymentMethod' => true + ] + ] + ]; + Braintree\Customer::create($attributes); + $result = Braintree\Customer::create($attributes); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->onAttribute('number'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_DUPLICATE_CARD_EXISTS, $errors[0]->code); + $this->assertEquals(1, preg_match('/Duplicate card exists in the vault\./', $result->message)); + } + + public function testCreate_withCreditCardAndSpecificVerificationMerchantAccount() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Mike Jones', + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'verifyCard' => true + ] + ] + ]); + Test\Helper::assertPrintable($result); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + $this->assertEquals('2000', $result->creditCardVerification->processorResponseCode); + $this->assertEquals('Do Not Honor', $result->creditCardVerification->processorResponseText); + $this->assertEquals('M', $result->creditCardVerification->cvvResponseCode); + $this->assertEquals(null, $result->creditCardVerification->avsErrorResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsPostalCodeResponseCode); + $this->assertEquals('I', $result->creditCardVerification->avsStreetAddressResponseCode); + } + + public function testCreate_withCreditCardAndVerificationAmount() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => '5555555555554444', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Mike Jones', + 'options' => [ + 'verifyCard' => true, + 'verificationAmount' => '2.00' + ] + ] + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_withCreditCardAndBillingAddress() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Mike Jones', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Suite 101', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America' + ] + ] + ]); + Test\Helper::assertPrintable($result); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Mike', $customer->firstName); + $this->assertEquals('Jones', $customer->lastName); + $this->assertEquals('Jones Co.', $customer->company); + $this->assertEquals('mike.jones@example.com', $customer->email); + $this->assertEquals('419.555.1234', $customer->phone); + $this->assertEquals('419.555.1235', $customer->fax); + $this->assertEquals('http://example.com', $customer->website); + $creditCard = $customer->creditCards[0]; + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('Mike Jones', $creditCard->cardholderName); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('05', $creditCard->expirationMonth); + $this->assertEquals('2012', $creditCard->expirationYear); + $address = $customer->addresses[0]; + $this->assertEquals($address, $creditCard->billingAddress); + $this->assertEquals('Drew', $address->firstName); + $this->assertEquals('Smith', $address->lastName); + $this->assertEquals('Smith Co.', $address->company); + $this->assertEquals('1 E Main St', $address->streetAddress); + $this->assertEquals('Suite 101', $address->extendedAddress); + $this->assertEquals('Chicago', $address->locality); + $this->assertEquals('IL', $address->region); + $this->assertEquals('60622', $address->postalCode); + $this->assertEquals('United States of America', $address->countryName); + } + + public function testCreate_withValidationErrors() + { + $result = Braintree\Customer::create([ + 'email' => 'invalid', + 'creditCard' => [ + 'number' => 'invalid', + 'billingAddress' => [ + 'streetAddress' => str_repeat('x', 256) + ] + ] + ]); + Test\Helper::assertPrintable($result); + $this->assertEquals(false, $result->success); + $errors = $result->errors->forKey('customer')->onAttribute('email'); + $this->assertEquals(Braintree\Error\Codes::CUSTOMER_EMAIL_IS_INVALID, $errors[0]->code); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->onAttribute('number'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_NUMBER_INVALID_LENGTH, $errors[0]->code); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->forKey('billingAddress')->onAttribute('streetAddress'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_STREET_ADDRESS_IS_TOO_LONG, $errors[0]->code); + } + + public function testCreate_countryValidations_inconsistency() + { + $result = Braintree\Customer::create([ + 'creditCard' => [ + 'billingAddress' => [ + 'countryName' => 'Georgia', + 'countryCodeAlpha2' => 'TF' + ] + ] + ]); + $this->assertEquals(false, $result->success); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->forKey('billingAddress')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_INCONSISTENT_COUNTRY, $errors[0]->code); + } + + public function testCreateNoValidate_returnsCustomer() + { + $customer = Braintree\Customer::createNoValidate([ + 'firstName' => 'Paul', + 'lastName' => 'Martin' + ]); + $this->assertEquals('Paul', $customer->firstName); + $this->assertEquals('Martin', $customer->lastName); + } + + public function testCreateNoValidate_throwsIfInvalid() + { + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + $customer = Braintree\Customer::createNoValidate(['email' => 'invalid']); + } + + public function testCreate_worksWithFuturePayPalNonce() + { + $nonce = Braintree\Test\Nonces::$paypalFuturePayment; + + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_worksWithOrderPaymentPayPalNonce() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + ] + ]); + + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_worksWithOrderPaymentPayPalNonceWithSnakeCase() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + ] + ]); + + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'paypal' => [ + 'payee_email' => 'payee@example.com', + 'order_id' => 'merchant-order-id', + 'custom_field' => 'custom merchant field', + 'description' => 'merchant description', + 'amount' => '1.23', + ], + ], + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_worksWithOrderPaymentPayPalNonceWithCamelCase() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + ] + ]); + + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'paypal' => [ + 'payeeEmail' => 'payee@example.com', + 'orderId' => 'merchant-order-id', + 'customField' => 'custom merchant field', + 'description' => 'merchant description', + 'amount' => '1.23', + 'shipping' => [ + 'firstName' => 'Andrew', + 'lastName' => 'Mason', + 'company' => 'Braintree', + 'streetAddress' => '456 W Main St', + 'extendedAddress' => 'Apt 2F', + 'locality' => 'Bartlett', + 'region' => 'IL', + 'postalCode' => '60103', + 'countryName' => 'United States of America', + 'countryCodeAlpha2' => 'US', + 'countryCodeAlpha3' => 'USA', + 'countryCodeNumeric' => '840' + ], + ], + ], + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_doesNotWorkWithOnetimePayPalNonce() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->forKey('paypalAccount')->errors; + $this->assertEquals(Braintree\Error\Codes::PAYPAL_ACCOUNT_CANNOT_VAULT_ONE_TIME_USE_PAYPAL_ACCOUNT, $errors[0]->code); + } + + public function testDelete_deletesTheCustomer() + { + $result = Braintree\Customer::create([]); + $this->assertEquals(true, $result->success); + Braintree\Customer::find($result->customer->id); + Braintree\Customer::delete($result->customer->id); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\Customer::find($result->customer->id); + } + + public function testFind() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ]); + $this->assertEquals(true, $result->success); + $customer = Braintree\Customer::find($result->customer->id); + $this->assertEquals('Mike', $customer->firstName); + $this->assertEquals('Jones', $customer->lastName); + $this->assertEquals('Jones Co.', $customer->company); + $this->assertEquals('mike.jones@example.com', $customer->email); + $this->assertEquals('419.555.1234', $customer->phone); + $this->assertEquals('419.555.1235', $customer->fax); + $this->assertEquals('http://example.com', $customer->website); + } + + public function test_findCustomerWithAllFilterableAssociationsFilteredOut() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'customFields' => [ + 'storeMe' => 'custom value' + ] + ]); + $creditCard = Braintree\CreditCard::create([ + 'customerId' => $result->customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '1 E Main St', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America' + ] + ]); + $id = strval(rand()); + $subscriptions = Braintree\Subscription::create([ + 'id' => $id, + 'paymentMethodToken' => $creditCard->creditCard->token, + 'planId' => 'integration_trialless_plan', + 'price' => '1.00' + ]); + + $customer = Braintree\Customer::find($result->customer->id, "customernoassociations"); + $this->assertEquals(0, count($customer->creditCards)); + $this->assertEquals(0, count($customer->paymentMethods)); + $this->assertEquals(0, count($customer->addresses)); + $this->assertEquals(0, count($customer->customFields)); + } + + public function test_findCustomerWithNestedFilterableAssociationsFilteredOut() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com', + 'customFields' => [ + 'storeMe' => 'custom value' + ] + ]); + $creditCard = Braintree\CreditCard::create([ + 'customerId' => $result->customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '1 E Main St', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America' + ] + ]); + $id = strval(rand()); + $subscriptions = Braintree\Subscription::create([ + 'id' => $id, + 'paymentMethodToken' => $creditCard->creditCard->token, + 'planId' => 'integration_trialless_plan', + 'price' => '1.00' + ]); + + $customer = Braintree\Customer::find($result->customer->id, "customertoplevelassociations"); + + $this->assertEquals(1, count($customer->creditCards)); + $this->assertEquals(0, count($customer->creditCards[0]->subscriptions)); + $this->assertEquals(1, count($customer->paymentMethods)); + $this->assertEquals(0, count($customer->paymentMethods[0]->subscriptions)); + $this->assertEquals(1, count($customer->addresses)); + $this->assertEquals(1, count($customer->customFields)); + } + + public function test_findUsBankAccountGivenPaymentMethodToken() + { + $nonce = Test\Helper::generateValidUsBankAccountNonce(); + $result = Braintree\Customer::create(array( + 'paymentMethodNonce' => $nonce, + 'creditCard' => [ + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ] + )); + $this->assertTrue($result->success); + + $customer = Braintree\Customer::find($result->customer->id); + $this->assertNotNull($customer->usBankAccounts[0]); + $this->assertNotNull($customer->paymentMethods[0]); + $usBankAccount = $customer->usBankAccounts[0]; + $this->assertTrue($usBankAccount instanceof Braintree\UsBankAccount); + $this->assertNotNull($usBankAccount->token); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertEquals('021000021', $usBankAccount->routingNumber); + $this->assertEquals('1234', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertRegexp('/CHASE/', $usBankAccount->bankName); + } + + public function testFind_throwsExceptionIfNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\Customer::find("does-not-exist"); + } + + public function testUpdate() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + 'company' => 'Old Company', + 'email' => 'old.email@example.com', + 'phone' => 'old phone', + 'fax' => 'old fax', + 'website' => 'http://old.example.com' + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $updateResult = Braintree\Customer::update($customer->id, [ + 'firstName' => 'New First', + 'lastName' => 'New Last', + 'company' => 'New Company', + 'email' => 'new.email@example.com', + 'phone' => 'new phone', + 'fax' => 'new fax', + 'website' => 'http://new.example.com' + ]); + $this->assertEquals(true, $updateResult->success); + $this->assertEquals('New First', $updateResult->customer->firstName); + $this->assertEquals('New Last', $updateResult->customer->lastName); + $this->assertEquals('New Company', $updateResult->customer->company); + $this->assertEquals('new.email@example.com', $updateResult->customer->email); + $this->assertEquals('new phone', $updateResult->customer->phone); + $this->assertEquals('new fax', $updateResult->customer->fax); + $this->assertEquals('http://new.example.com', $updateResult->customer->website); + } + + public function testUpdate_withCountry() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Bat', + 'lastName' => 'Manderson', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'countryName' => 'United States of America', + 'countryCodeAlpha2' => 'US', + 'countryCodeAlpha3' => 'USA', + 'countryCodeNumeric' => '840' + ] + ] + ])->customer; + + $result = Braintree\Customer::update($customer->id, [ + 'firstName' => 'Bat', + 'lastName' => 'Manderson', + 'creditCard' => [ + 'options' => [ + 'updateExistingToken' => $customer->creditCards[0]->token + ], + 'billingAddress' => [ + 'countryName' => 'Gabon', + 'countryCodeAlpha2' => 'GA', + 'countryCodeAlpha3' => 'GAB', + 'countryCodeNumeric' => '266', + 'options' => [ + 'updateExisting' => true + ] + ] + ] + ]); + + $this->assertEquals(true, $result->success); + $updatedCustomer = $result->customer; + $this->assertEquals('Gabon', $updatedCustomer->creditCards[0]->billingAddress->countryName); + $this->assertEquals('GA', $updatedCustomer->creditCards[0]->billingAddress->countryCodeAlpha2); + $this->assertEquals('GAB', $updatedCustomer->creditCards[0]->billingAddress->countryCodeAlpha3); + $this->assertEquals('266', $updatedCustomer->creditCards[0]->billingAddress->countryCodeNumeric); + } + + public function testUpdate_withUpdatingExistingCreditCard() + { + $create_result = Braintree\Customer::create([ + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + 'website' => 'http://old.example.com', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cardholderName' => 'Old Cardholder' + ] + ]); + $this->assertEquals(true, $create_result->success); + $customer = $create_result->customer; + $creditCard = $customer->creditCards[0]; + $result = Braintree\Customer::update($customer->id, [ + 'firstName' => 'New First', + 'lastName' => 'New Last', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '11/14', + 'cardholderName' => 'New Cardholder', + 'options' => [ + 'updateExistingToken' => $creditCard->token + ] + ] + ]); + $this->assertEquals(true, $result->success); + $this->assertEquals('New First', $result->customer->firstName); + $this->assertEquals('New Last', $result->customer->lastName); + $this->assertEquals(1, sizeof($result->customer->creditCards)); + $creditCard = $result->customer->creditCards[0]; + $this->assertEquals('411111', $creditCard->bin); + $this->assertEquals('11/2014', $creditCard->expirationDate); + $this->assertEquals('New Cardholder', $creditCard->cardholderName); + } + + public function testUpdate_failOnDuplicatePaymentMethod() + { + $create_result = Braintree\Customer::create([ + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '11/14', + ] + ]); + $this->assertEquals(true, $create_result->success); + $result = Braintree\Customer::update($create_result->customer->id, [ + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '11/14', + 'options' => [ + 'failOnDuplicatePaymentMethod' => true + ] + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->onAttribute('number'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_DUPLICATE_CARD_EXISTS, $errors[0]->code); + $this->assertEquals(1, preg_match('/Duplicate card exists in the vault\./', $result->message)); + } + + public function testUpdate_forBillingAddressAndExistingCreditCardAndCustomerDetailsTogether() + { + $create_result = Braintree\Customer::create([ + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '123', + 'cardholderName' => 'Old Cardholder', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith' + ] + ] + ]); + $this->assertEquals(true, $create_result->success); + $customer = $create_result->customer; + $creditCard = $customer->creditCards[0]; + $result = Braintree\Customer::update($customer->id, [ + 'firstName' => 'New Customer First', + 'lastName' => 'New Customer Last', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '11/14', + 'options' => [ + 'updateExistingToken' => $creditCard->token + ], + 'billingAddress' => [ + 'firstName' => 'New Billing First', + 'lastName' => 'New Billing Last', + 'options' => [ + 'updateExisting' => true + ] + ] + ] + ]); + $this->assertEquals(true, $result->success); + $this->assertEquals('New Customer First', $result->customer->firstName); + $this->assertEquals('New Customer Last', $result->customer->lastName); + $this->assertEquals(1, sizeof($result->customer->creditCards)); + $this->assertEquals(1, sizeof($result->customer->addresses)); + + $creditCard = $result->customer->creditCards[0]; + $this->assertEquals('411111', $creditCard->bin); + $this->assertEquals('11/2014', $creditCard->expirationDate); + + $billingAddress = $creditCard->billingAddress; + $this->assertEquals('New Billing First', $billingAddress->firstName); + $this->assertEquals('New Billing Last', $billingAddress->lastName); + } + + public function testUpdate_withNewCreditCardAndExistingBillingAddress() + { + $customer = Braintree\Customer::create()->customer; + $address = Braintree\Address::create([ + 'customerId' => $customer->id, + 'firstName' => 'Dan' + ])->address; + + $result = Braintree\Customer::update($customer->id, [ + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '11/14', + 'billingAddressId' => $address->id + ] + ]); + + $billingAddress = $result->customer->creditCards[0]->billingAddress; + $this->assertEquals($address->id, $billingAddress->id); + $this->assertEquals('Dan', $billingAddress->firstName); + } + + public function testUpdate_withNewCreditCardAndVerificationAmount() + { + $customer = Braintree\Customer::create()->customer; + $result = Braintree\Customer::update($customer->id, [ + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '11/14', + 'options' => [ + 'verifyCard' => true, + 'verificationAmount' => '2.00' + ] + ] + ]); + + $this->assertTrue($result->success); + } + + public function testUpdate_worksWithFuturePayPalNonce() + { + $customerResult = Braintree\Customer::create([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + $paypalAccountToken = 'PAYPALToken-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paypalAccountToken, + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + + $result = Braintree\Customer::update($customerResult->customer->id, [ + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + $this->assertEquals($result->customer->defaultPaymentMethod()->token, $paypalAccountToken); + + } + + public function testUpdate_worksWithOrderPaymentPayPalNonce() + { + $customerResult = Braintree\Customer::create([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + $paypalAccountToken = 'PAYPALToken-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + 'token' => $paypalAccountToken, + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + + $result = Braintree\Customer::update($customerResult->customer->id, [ + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + $this->assertEquals($result->customer->defaultPaymentMethod()->token, $paypalAccountToken); + } + + public function testUpdate_worksWithOrderPaymentPayPalNonceWithSnakeCase() + { + $customerResult = Braintree\Customer::create([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + $paypalAccountToken = 'PAYPALToken-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + 'token' => $paypalAccountToken, + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + + $result = Braintree\Customer::update($customerResult->customer->id, [ + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'paypal' => [ + 'payee_email' => 'payee@example.com', + 'order_id' => 'merchant-order-id', + 'custom_field' => 'custom merchant field', + 'description' => 'merchant description', + 'amount' => '1.23', + ], + ], + ]); + + $this->assertTrue($result->success); + $this->assertEquals($result->customer->defaultPaymentMethod()->token, $paypalAccountToken); + } + + public function testUpdate_worksWithOrderPaymentPayPalNonceWithCamelCase() + { + $customerResult = Braintree\Customer::create([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + $paypalAccountToken = 'PAYPALToken-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + 'token' => $paypalAccountToken, + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + + $result = Braintree\Customer::update($customerResult->customer->id, [ + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'paypal' => [ + 'payeeEmail' => 'payee@example.com', + 'orderId' => 'merchant-order-id', + 'customField' => 'custom merchant field', + 'description' => 'merchant description', + 'amount' => '1.23', + 'shipping' => [ + 'firstName' => 'Andrew', + 'lastName' => 'Mason', + 'company' => 'Braintree', + 'streetAddress' => '456 W Main St', + 'extendedAddress' => 'Apt 2F', + 'locality' => 'Bartlett', + 'region' => 'IL', + 'postalCode' => '60103', + 'countryName' => 'United States of America', + 'countryCodeAlpha2' => 'US', + 'countryCodeAlpha3' => 'USA', + 'countryCodeNumeric' => '840' + ], + ], + ], + ]); + + $this->assertTrue($result->success); + $this->assertEquals($result->customer->defaultPaymentMethod()->token, $paypalAccountToken); + } + + public function testUpdateDefaultPaymentMethod() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + ]); + + $this->assertEquals(true, $result->success); + $customer = $result->customer; + + $token1 = 'TOKEN-' . strval(rand()); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$transactableVisa, + 'token' => $token1 + ]); + + $updateResult = Braintree\Customer::update($customer->id, [ + 'defaultPaymentMethodToken' => $token1 + ]); + + $this->assertEquals(true, $updateResult->success); + $this->assertEquals($updateResult->customer->defaultPaymentMethod()->token, $token1); + + $token2 = 'TOKEN-' . strval(rand()); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$transactableMasterCard, + 'token' => $token2 + ]); + + $updateResult = Braintree\Customer::update($customer->id, [ + 'defaultPaymentMethodToken' => $token2 + ]); + + $this->assertEquals(true, $updateResult->success); + $this->assertEquals($updateResult->customer->defaultPaymentMethod()->token, $token2); + } + + + public function testUpdateDefaultPaymentMethodFromOptions() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + ]); + + $this->assertEquals(true, $result->success); + $customer = $result->customer; + + $token1 = 'TOKEN-' . strval(rand()); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$transactableVisa, + 'token' => $token1 + ]); + + $updateResult = Braintree\Customer::update($customer->id, [ + 'creditCard' => [ + 'options' => [ + 'updateExistingToken' => $token1, + 'makeDefault' => true + ] + ] + ]); + + $this->assertEquals(true, $updateResult->success); + $this->assertEquals($updateResult->customer->defaultPaymentMethod()->token, $token1); + + $token2 = 'TOKEN-' . strval(rand()); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$transactableMasterCard, + 'token' => $token2 + ]); + + $updateResult = Braintree\Customer::update($customer->id, [ + 'creditCard' => [ + 'options' => [ + 'updateExistingToken' => $token2, + 'makeDefault' => true + ] + ] + ]); + + $this->assertEquals(true, $updateResult->success); + $this->assertEquals($updateResult->customer->defaultPaymentMethod()->token, $token2); + } + public function testUpdate_doesNotWorkWithOnetimePayPalNonce() + { + $customerResult = Braintree\Customer::create([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + $paypalAccountToken = 'PAYPALToken-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'access_token' => 'PAYPAL_ACCESS_TOKEN', + 'token' => $paypalAccountToken, + 'options' => [ + 'makeDefault' => true + ] + ] + ]); + + $result = Braintree\Customer::update($customerResult->customer->id, [ + 'paymentMethodNonce' => $nonce + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->forKey('paypalAccount')->errors; + $this->assertEquals(Braintree\Error\Codes::PAYPAL_ACCOUNT_CANNOT_VAULT_ONE_TIME_USE_PAYPAL_ACCOUNT, $errors[0]->code); + + } + + public function testUpdateNoValidate() + { + $result = Braintree\Customer::create([ + 'firstName' => 'Old First', + 'lastName' => 'Old Last', + 'company' => 'Old Company', + 'email' => 'old.email@example.com', + 'phone' => 'old phone', + 'fax' => 'old fax', + 'website' => 'http://old.example.com' + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $updated = Braintree\Customer::updateNoValidate($customer->id, [ + 'firstName' => 'New First', + 'lastName' => 'New Last', + 'company' => 'New Company', + 'email' => 'new.email@example.com', + 'phone' => 'new phone', + 'fax' => 'new fax', + 'website' => 'http://new.example.com' + ]); + $this->assertEquals('New First', $updated->firstName); + $this->assertEquals('New Last', $updated->lastName); + $this->assertEquals('New Company', $updated->company); + $this->assertEquals('new.email@example.com', $updated->email); + $this->assertEquals('new phone', $updated->phone); + $this->assertEquals('new fax', $updated->fax); + $this->assertEquals('http://new.example.com', $updated->website); + } + + public function testCreateFromTransparentRedirect() + { + Test\Helper::suppressDeprecationWarnings(); + $queryString = $this->createCustomerViaTr( + [ + 'customer' => [ + 'first_name' => 'Joe', + 'last_name' => 'Martin', + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12' + ] + ] + ], + [ + ] + ); + $result = Braintree\Customer::createFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $this->assertEquals('Joe', $result->customer->firstName); + $this->assertEquals('Martin', $result->customer->lastName); + $creditCard = $result->customer->creditCards[0]; + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('05/2012', $creditCard->expirationDate); + } + + public function testCreateFromTransparentRedirect_withParamsInTrData() + { + Test\Helper::suppressDeprecationWarnings(); + $queryString = $this->createCustomerViaTr( + [ + ], + [ + 'customer' => [ + 'firstName' => 'Joe', + 'lastName' => 'Martin', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ] + ] + ); + $result = Braintree\Customer::createFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $this->assertEquals('Joe', $result->customer->firstName); + $this->assertEquals('Martin', $result->customer->lastName); + $creditCard = $result->customer->creditCards[0]; + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('05/2012', $creditCard->expirationDate); + } + + public function testCreateFromTransparentRedirect_withValidationErrors() + { + Test\Helper::suppressDeprecationWarnings(); + $queryString = $this->createCustomerViaTr( + [ + 'customer' => [ + 'first_name' => str_repeat('x', 256), + 'credit_card' => [ + 'number' => 'invalid', + 'expiration_date' => '' + ] + ] + ], + [ + ] + ); + $result = Braintree\Customer::createFromTransparentRedirect($queryString); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->onAttribute('firstName'); + $this->assertEquals(Braintree\Error\Codes::CUSTOMER_FIRST_NAME_IS_TOO_LONG, $errors[0]->code); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->onAttribute('number'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_NUMBER_INVALID_LENGTH, $errors[0]->code); + $errors = $result->errors->forKey('customer')->forKey('creditCard')->onAttribute('expirationDate'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED, $errors[0]->code); + } + + public function testCreateWithInvalidUTF8Bytes() + { + $result = Braintree\Customer::create([ + 'firstName' => "Jos\xe8 Maria" + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals("Jos\xc3\xa8 Maria", $customer->firstName); + } + + public function testCreateWithValidUTF8Bytes() + { + $result = Braintree\Customer::create([ + 'firstName' => "Jos\303\251" + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals("Jos\303\251", $customer->firstName); + } + + public function testUpdateFromTransparentRedirect() + { + Test\Helper::suppressDeprecationWarnings(); + $customer = Braintree\Customer::createNoValidate(); + $queryString = $this->updateCustomerViaTr( + [ + 'customer' => [ + 'first_name' => 'Joe', + 'last_name' => 'Martin', + 'email' => 'joe.martin@example.com' + ] + ], + [ + 'customerId' => $customer->id + ] + ); + $result = Braintree\Customer::updateFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $this->assertEquals('Joe', $result->customer->firstName); + $this->assertEquals('Martin', $result->customer->lastName); + $this->assertEquals('joe.martin@example.com', $result->customer->email); + } + + public function testUpdateFromTransparentRedirect_withParamsInTrData() + { + Test\Helper::suppressDeprecationWarnings(); + $customer = Braintree\Customer::createNoValidate(); + $queryString = $this->updateCustomerViaTr( + [ + ], + [ + 'customerId' => $customer->id, + 'customer' => [ + 'firstName' => 'Joe', + 'lastName' => 'Martin', + 'email' => 'joe.martin@example.com' + ] + ] + ); + $result = Braintree\Customer::updateFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $this->assertEquals('Joe', $result->customer->firstName); + $this->assertEquals('Martin', $result->customer->lastName); + $this->assertEquals('joe.martin@example.com', $result->customer->email); + } + + public function testUpdateFromTransparentRedirect_withValidationErrors() + { + Test\Helper::suppressDeprecationWarnings(); + $customer = Braintree\Customer::createNoValidate(); + $queryString = $this->updateCustomerViaTr( + [ + 'customer' => [ + 'first_name' => str_repeat('x', 256), + ] + ], + [ + 'customerId' => $customer->id + ] + ); + $result = Braintree\Customer::updateFromTransparentRedirect($queryString); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('customer')->onAttribute('firstName'); + $this->assertEquals(Braintree\Error\Codes::CUSTOMER_FIRST_NAME_IS_TOO_LONG, $errors[0]->code); + } + + public function testUpdateFromTransparentRedirect_withUpdateExisting() + { + Test\Helper::suppressDeprecationWarnings(); + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cardholderName' => 'Mike Jones', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith' + ] + ] + ])->customer; + + $queryString = $this->updateCustomerViaTr( + [], + [ + 'customerId' => $customer->id, + 'customer' => [ + 'firstName' => 'New First', + 'lastName' => 'New Last', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/13', + 'cardholderName' => 'New Cardholder', + 'options' => [ + 'updateExistingToken' => $customer->creditCards[0]->token + ], + 'billingAddress' => [ + 'firstName' => 'New First Billing', + 'lastName' => 'New Last Billing', + 'options' => [ + 'updateExisting' => true + ] + ] + ] + ] + ] + ); + $result = Braintree\Customer::updateFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('New First', $customer->firstName); + $this->assertEquals('New Last', $customer->lastName); + + $this->assertEquals(1, sizeof($result->customer->creditCards)); + $creditCard = $customer->creditCards[0]; + $this->assertEquals('411111', $creditCard->bin); + $this->assertEquals('1111', $creditCard->last4); + $this->assertEquals('New Cardholder', $creditCard->cardholderName); + $this->assertEquals('05/2013', $creditCard->expirationDate); + + $this->assertEquals(1, sizeof($result->customer->addresses)); + $address = $customer->addresses[0]; + $this->assertEquals($address, $creditCard->billingAddress); + $this->assertEquals('New First Billing', $address->firstName); + $this->assertEquals('New Last Billing', $address->lastName); + } + + public function testSale_createsASaleUsingGivenToken() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $result = Braintree\Customer::sale($customer->id, [ + 'amount' => '100.00' + ]); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals($customer->id, $result->transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $result->transaction->creditCardDetails->token); + } + + public function testSaleNoValidate_createsASaleUsingGivenToken() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $transaction = Braintree\Customer::saleNoValidate($customer->id, [ + 'amount' => '100.00' + ]); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals($customer->id, $transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $transaction->creditCardDetails->token); + } + + public function testSaleNoValidate_throwsIfInvalid() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + Braintree\Customer::saleNoValidate($customer->id, [ + 'amount' => 'invalid' + ]); + } + + public function testCredit_createsACreditUsingGivenCustomerId() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $result = Braintree\Customer::credit($customer->id, [ + 'amount' => '100.00' + ]); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals(Braintree\Transaction::CREDIT, $result->transaction->type); + $this->assertEquals($customer->id, $result->transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $result->transaction->creditCardDetails->token); + } + + public function testCreditNoValidate_createsACreditUsingGivenId() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $transaction = Braintree\Customer::creditNoValidate($customer->id, [ + 'amount' => '100.00' + ]); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals(Braintree\Transaction::CREDIT, $transaction->type); + $this->assertEquals($customer->id, $transaction->customerDetails->id); + $this->assertEquals($creditCard->token, $transaction->creditCardDetails->token); + } + + public function testCreditNoValidate_throwsIfInvalid() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $creditCard = $customer->creditCards[0]; + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + Braintree\Customer::creditNoValidate($customer->id, [ + 'amount' => 'invalid' + ]); + } + + public function createCustomerViaTr($regularParams, $trParams) + { + Test\Helper::suppressDeprecationWarnings(); + $trData = Braintree\TransparentRedirect::createCustomerData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + return Test\Helper::submitTrRequest( + Braintree\Customer::createCustomerUrl(), + $regularParams, + $trData + ); + } + + public function updateCustomerViaTr($regularParams, $trParams) + { + Test\Helper::suppressDeprecationWarnings(); + $trData = Braintree\TransparentRedirect::updateCustomerData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + return Test\Helper::submitTrRequest( + Braintree\Customer::updateCustomerUrl(), + $regularParams, + $trData + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisbursementTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisbursementTest.php new file mode 100644 index 00000000000..67c2bd40bc4 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisbursementTest.php @@ -0,0 +1,39 @@ + "123456", + "merchantAccount" => [ + "id" => "sandbox_sub_merchant_account", + "masterMerchantAccount" => [ + "id" => "sandbox_master_merchant_account", + "status" => "active" + ], + "status" => "active" + ], + "transactionIds" => ["sub_merchant_transaction"], + "exceptionMessage" => "invalid_account_number", + "amount" => "100.00", + "disbursementDate" => new DateTime("2013-04-10"), + "followUpAction" => "update", + "retry" => false, + "success" => false + ]); + + $transactions = $disbursement->transactions(); + + $this->assertNotNull($transactions); + $this->assertEquals(sizeOf($transactions), 1); + $this->assertEquals($transactions->firstItem()->id, 'sub_merchant_transaction'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DiscountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DiscountTest.php new file mode 100644 index 00000000000..981567626a6 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DiscountTest.php @@ -0,0 +1,88 @@ + "100.00", + "description" => "some description", + "id" => $newId, + "kind" => "discount", + "name" => "php_discount", + "neverExpires" => "false", + "numberOfBillingCycles" => "1" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . "/modifications/create_modification_for_tests"; + $http->post($path, ["modification" => $discountParams]); + + $discounts = Braintree\Discount::all(); + + foreach ($discounts as $discount) + { + if ($discount->id == $newId) + { + $actualDiscount = $discount; + } + } + + $this->assertNotNull($actualDiscount); + $this->assertEquals($discountParams["amount"], $actualDiscount->amount); + $this->assertEquals($discountParams["description"], $actualDiscount->description); + $this->assertEquals($discountParams["id"], $actualDiscount->id); + $this->assertEquals($discountParams["kind"], $actualDiscount->kind); + $this->assertEquals($discountParams["name"], $actualDiscount->name); + $this->assertFalse($actualDiscount->neverExpires); + $this->assertEquals($discountParams["numberOfBillingCycles"], $actualDiscount->numberOfBillingCycles); + } + + public function testGatewayAll_returnsAllDiscounts() + { + $newId = strval(rand()); + + $discountParams = [ + "amount" => "100.00", + "description" => "some description", + "id" => $newId, + "kind" => "discount", + "name" => "php_discount", + "neverExpires" => "false", + "numberOfBillingCycles" => "1" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . "/modifications/create_modification_for_tests"; + $http->post($path, ["modification" => $discountParams]); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $discounts = $gateway->discount()->all(); + + foreach ($discounts as $discount) + { + if ($discount->id == $newId) + { + $actualDiscount = $discount; + } + } + + $this->assertNotNull($actualDiscount); + $this->assertEquals($discountParams["amount"], $actualDiscount->amount); + $this->assertEquals($discountParams["id"], $actualDiscount->id); + $this->assertEquals($discountParams["kind"], $actualDiscount->kind); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeSearchTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeSearchTest.php new file mode 100644 index 00000000000..1ff8c8a61c8 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeSearchTest.php @@ -0,0 +1,122 @@ +is('non_existent_dispute') + ]); + + $disputes = $this->collectionToArray($collection); + + $this->assertEquals(0, count($disputes)); + } + + public function testAdvancedSearch_byId_returnsSingleDispute() + { + $collection = Braintree\Dispute::search([ + Braintree\DisputeSearch::id()->is('open_dispute') + ]); + + $disputes = $this->collectionToArray($collection); + + $this->assertEquals(1, count($disputes)); + } + + public function testAdvancedSearch_byCustomerid_returnsDispute() + { + $customerId = Braintree\Customer::create()->customer->id; + Braintree\Transaction::sale([ + 'amount' => '10.00', + 'customerId' => $customerId, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$disputes['Chargeback'], + 'expirationDate' => "12/20" + ] + ]); + + $collection = Braintree\Dispute::search([ + Braintree\DisputeSearch::customerId()->is($customerId) + ]); + + $disputes = $this->collectionToArray($collection); + + $this->assertEquals(1, count($disputes)); + } + + public function testAdvancededSearch_byReason_returnsTwoDisputes() + { + $collection = Braintree\Dispute::search([ + Braintree\DisputeSearch::reason()->in([ + Braintree\Dispute::PRODUCT_UNSATISFACTORY, + Braintree\Dispute::RETRIEVAL + ]) + ]); + + $disputes = $this->collectionToArray($collection); + + $this->assertEquals(2, count($disputes)); + } + + public function testAdvancedSearch_byReceivedDateRange_returnsDispute() + { + $collection = Braintree\Dispute::search([ + Braintree\DisputeSearch::receivedDate()->between( + "03/03/2014", + "03/05/2014" + ) + ]); + + $disputes = $this->collectionToArray($collection); + + $this->assertEquals(1, count($disputes)); + $this->assertEquals($disputes[0]->receivedDate, DateTime::createFromFormat('Ymd His', '20140304 000000')); + } + + public function testAdvancedSearch_byDisbursementDateRange_returnsDispute() + { + $collection = Braintree\Dispute::search([ + Braintree\DisputeSearch::disbursementDate()->between( + "03/03/2014", + "03/05/2014" + ) + ]); + + $disputes = $this->collectionToArray($collection); + + $this->assertEquals(1, count($disputes)); + $this->assertEquals($disputes[0]->statusHistory[0]->effectiveDate, DateTime::createFromFormat('Ymd His', '20140304 000000')); + } + + public function testAdvancedSearch_byEffectiveDateRange_returnsDispute() + { + $collection = Braintree\Dispute::search([ + Braintree\DisputeSearch::disbursementDate()->between( + "03/03/2014", + "03/05/2014" + ) + ]); + + $disputes = $this->collectionToArray($collection); + + $this->assertEquals(1, count($disputes)); + $this->assertEquals($disputes[0]->statusHistory[0]->disbursementDate, DateTime::createFromFormat('Ymd His', '20140305 000000')); + } + + private function collectionToArray($collection) { + $array = []; + foreach($collection as $element) { + array_push($array, $element); + } + return $array; + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeTest.php new file mode 100644 index 00000000000..aa1224a1c55 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DisputeTest.php @@ -0,0 +1,412 @@ +gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + } + + public function createSampleDocument() + { + $pngFile = fopen(dirname(__DIR__) . '/fixtures/bt_logo.png', 'rb'); + + $result = Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "file" => $pngFile + ]); + + return $result->documentUpload; + } + + public function createSampleDispute() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$disputes['Chargeback'], + 'expirationDate' => '12/2019', + ] + ]); + return $result->transaction->disputes[0]; + } + + public function testAccept_changesDisputeStatusToAccepted() + { + $dispute = $this->createSampleDispute(); + $result = $this->gateway->dispute()->accept($dispute->id); + + $this->assertTrue($result->success); + + $updatedDispute = $this->gateway->dispute()->find($dispute->id); + + $this->assertEquals(Braintree\Dispute::ACCEPTED, $updatedDispute->status); + + $transaction = $this->gateway->transaction()->find($dispute->transaction->id); + + $this->assertEquals(Braintree\Dispute::ACCEPTED, $transaction->disputes[0]->status); + } + + public function testAccept_errors_whenDisputeNotOpen() + { + $result = $this->gateway->dispute()->accept("wells_dispute"); + $error = $result->errors->forKey('dispute')->errors[0]; + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_CAN_ONLY_ACCEPT_OPEN_DISPUTE, $error->code); + $this->assertEquals("Disputes can only be accepted when they are in an Open state", $error->message); + } + + public function testAccept_raisesError_whenDisputeNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "invalid-id" not found'); + $this->gateway->dispute()->accept("invalid-id"); + } + + public function testAddFileEvidence_addsEvidence() + { + $disputeId = $this->createSampleDispute()->id; + $documentId = $this->createSampleDocument()->id; + + $result = $this->gateway->dispute()->addFileEvidence($disputeId, $documentId); + + $this->assertTrue($result->success); + + $updatedDispute = $this->gateway->dispute()->find($disputeId); + + $this->assertEquals($result->evidence->id, $updatedDispute->evidence[0]->id); + } + + public function testAddFileEvidence_addsEvidence_withCategory() + { + $disputeId = $this->createSampleDispute()->id; + $documentId = $this->createSampleDocument()->id; + + $result = Braintree\Dispute::addFileEvidence($disputeId, + [ + 'category' => 'GENERAL', + 'documentId' => $documentId, + ] + ); + + $this->assertTrue($result->success); + $this->assertEquals('GENERAL', $result->evidence->category); + } + + public function testAddFileEvidence_raisesError_whenDisputeNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "unknown_dispute_id" not found'); + $this->gateway->dispute()->addFileEvidence("unknown_dispute_id", "unknown_file_id"); + } + + public function testAddFileEvidence_raisesError_whenDisputeNotOpen() + { + $disputeId = $this->createSampleDispute()->id; + $documentId = $this->createSampleDocument()->id; + + $this->gateway->dispute()->accept($disputeId); + + $result = $this->gateway->dispute()->addFileEvidence($disputeId, $documentId); + $error = $result->errors->forKey('dispute')->errors[0]; + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_CAN_ONLY_ADD_EVIDENCE_TO_OPEN_DISPUTE, $error->code); + $this->assertEquals("Evidence can only be attached to disputes that are in an Open state", $error->message); + } + + public function testAddTextEvidence_addsTextEvidence() + { + $disputeId = $this->createSampleDispute()->id; + + $result = $this->gateway->dispute()->addTextEvidence($disputeId, "text evidence"); + $evidence = $result->evidence; + + $this->assertTrue($result->success); + $this->assertEquals("text evidence", $evidence->comment); + $this->assertNotNull($evidence->createdAt); + $this->assertRegExp('/^\w{16,}$/', $evidence->id); + $this->assertNull($evidence->sentToProcessorAt); + $this->assertNull($evidence->url); + $this->assertNull($evidence->tag); + $this->assertNull($evidence->sequenceNumber); + } + + public function testAddTaggedTextEvidence_addsTextEvidence() + { + $disputeId = $this->createSampleDispute()->id; + + $result = $this->gateway->dispute()->addTextEvidence($disputeId, + [ + 'content' => "UPS", + 'category' => "CARRIER_NAME", + 'sequenceNumber' => "1" + ] + ); + $evidence = $result->evidence; + + $this->assertTrue($result->success); + $this->assertEquals("UPS", $evidence->comment); + $this->assertNotNull($evidence->createdAt); + $this->assertRegExp('/^\w{16,}$/', $evidence->id); + $this->assertNull($evidence->sentToProcessorAt); + $this->assertNull($evidence->url); + $this->assertEquals("CARRIER_NAME", $evidence->category); + $this->assertEquals("CARRIER_NAME", $evidence->tag); + $this->assertEquals("1", $evidence->sequenceNumber); + } + + public function testAddTextEvidence_raisesError_whenDisputeNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "unknown_dispute_id" not found'); + $dispute = $this->gateway->dispute()->addTextEvidence("unknown_dispute_id", "text evidence"); + } + + public function testAddTextEvidence_raisesError_whenDisputeNotOpen() + { + $disputeId = $this->createSampleDispute()->id; + + $this->gateway->dispute()->accept($disputeId); + + $result = $this->gateway->dispute()->addTextEvidence($disputeId, "text evidence"); + $error = $result->errors->forKey('dispute')->errors[0]; + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_CAN_ONLY_ADD_EVIDENCE_TO_OPEN_DISPUTE, $error->code); + $this->assertEquals("Evidence can only be attached to disputes that are in an Open state", $error->message); + } + + public function testAddTextEvidence_showsNewRecord_inFind() + { + $disputeId = $this->createSampleDispute()->id; + + $evidence = $this->gateway->dispute()->addTextEvidence($disputeId, "text evidence")->evidence; + + $refreshedDispute = $this->gateway->dispute()->find($disputeId); + $refreshedEvidence = $refreshedDispute->evidence[0]; + + $this->assertEquals($evidence->id, $refreshedEvidence->id); + $this->assertEquals($evidence->comment, $refreshedEvidence->comment); + } + + public function testFinalize_changesDisputeStatus_toDisputed() + { + $disputeId = $this->createSampleDispute()->id; + + $result = $this->gateway->dispute()->finalize($disputeId); + + $this->assertTrue($result->success); + + $updatedDispute = $this->gateway->dispute()->find($disputeId); + + $this->assertEquals(Braintree\Dispute::DISPUTED, $updatedDispute->status); + } + + public function testFinalize_errors_whenDisputeNotOpen() + { + $result = $this->gateway->dispute()->finalize("wells_dispute"); + $error = $result->errors->forKey('dispute')->errors[0]; + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_CAN_ONLY_FINALIZE_OPEN_DISPUTE, $error->code); + $this->assertEquals("Disputes can only be finalized when they are in an Open state", $error->message); + } + + public function testFinalize_raisesError_whenDisputeNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "invalid-id" not found'); + $result = $this->gateway->dispute()->finalize("invalid-id"); + } + + public function testFind_returnsDispute_withGivenId() + { + $dispute = $this->gateway->dispute()->find("open_dispute"); + + $this->assertEquals("31.0", $dispute->amountDisputed); + $this->assertEquals("0.0", $dispute->amountWon); + $this->assertEquals("open_dispute", $dispute->id); + $this->assertEquals(Braintree\Dispute::OPEN, $dispute->status); + $this->assertEquals("open_disputed_transaction", $dispute->transaction->id); + } + + public function testFind_raisesError_whenDisputeNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "invalid-id" not found'); + $this->gateway->dispute()->find("invalid-id"); + } + + public function testRemoveEvidence_removesEvidenceFromTheDisupute() + { + $disputeId = $this->createSampleDispute()->id; + $evidenceId = $this->gateway->dispute()->addTextEvidence($disputeId, "text evidence")->evidence->id; + + $result = $this->gateway->dispute()->removeEvidence($disputeId, $evidenceId); + + $this->assertTrue($result->success); + } + + public function testRemoveEvidence_raisesError_whenDisputeOrEvidenceNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', "evidence with id \"unknown_evidence_id\" for dispute with id \"unknown_dispute_id\" not found"); + $this->gateway->dispute()->removeEvidence("unknown_dispute_id", "unknown_evidence_id"); + } + + public function testRemoveEvidence_errors_whenDisputeNotOpen() + { + $disputeId = $this->createSampleDispute()->id; + $evidenceId = $this->gateway->dispute()->addTextEvidence($disputeId, "text evidence")->evidence->id; + + $this->gateway->dispute()->accept($disputeId); + + $result = $this->gateway->dispute()->removeEvidence($disputeId, $evidenceId); + $error = $result->errors->forKey('dispute')->errors[0]; + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_CAN_ONLY_REMOVE_EVIDENCE_FROM_OPEN_DISPUTE, $error->code); + $this->assertEquals("Evidence can only be removed from disputes that are in an Open state", $error->message); + } + + public function testCategorizedEvidence_fileForTextOnlyCategory() + { + $disputeId = $this->createSampleDispute()->id; + $documentId = $this->createSampleDocument()->id; + + $result = Braintree\Dispute::addFileEvidence($disputeId, + [ + 'category' => 'DEVICE_ID', + 'documentId' => $documentId, + ] + ); + + $error = $result->errors->forKey('dispute')->errors[0]; + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_EVIDENCE_CATEGORY_TEXT_ONLY, $error->code); + } + + public function testCategorizedEvidence_withFile_invalidCategoryProvided() + { + $disputeId = $this->createSampleDispute()->id; + $documentId = $this->createSampleDocument()->id; + + $result = Braintree\Dispute::addFileEvidence($disputeId, + [ + 'category' => 'NOTREALCATEGORY', + 'documentId' => $documentId, + ] + ); + + $error = $result->errors->forKey('dispute')->errors[0]; + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_CAN_ONLY_CREATE_EVIDENCE_WITH_VALID_CATEGORY, $error->code); + } + + public function testCategorizedEvidence_withText_invalidCategoryProvided() + { + $disputeId = $this->createSampleDispute()->id; + + $result = Braintree\Dispute::addTextEvidence($disputeId, + [ + 'category' => 'NOTREALCATEGORY', + 'content' => 'evidence', + ] + ); + + $error = $result->errors->forKey('dispute')->errors[0]; + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_CAN_ONLY_CREATE_EVIDENCE_WITH_VALID_CATEGORY, $error->code); + } + + public function testCategorizedEvidence_textForFileOnlyCategory() + { + $disputeId = $this->createSampleDispute()->id; + + $result = Braintree\Dispute::addTextEvidence($disputeId, + [ + 'category' => 'MERCHANT_WEBSITE_OR_APP_ACCESS', + 'content' => 'evidence', + ] + ); + + $error = $result->errors->forKey('dispute')->errors[0]; + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_EVIDENCE_CATEGORY_DOCUMENT_ONLY, $error->code); + } + + public function testCategorizedEvidence_invalidDateTimeFormatFails() + { + $disputeId = $this->createSampleDispute()->id; + + $result = Braintree\Dispute::addTextEvidence($disputeId, + [ + 'category' => 'DOWNLOAD_DATE_TIME', + 'content' => 'baddate', + ] + ); + + $error = $result->errors->forKey('dispute')->errors[0]; + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_EVIDENCE_CONTENT_DATE_INVALID, $error->code); + } + + public function testCategorizedEvidence_validDateTimeFormatSuccess() + { + $disputeId = $this->createSampleDispute()->id; + + $result = Braintree\Dispute::addTextEvidence($disputeId, + [ + 'category' => 'DOWNLOAD_DATE_TIME', + 'content' => '2018-10-20T18:00:00-0500', + ] + ); + + $this->assertTrue($result->success); + } + + public function testCategorizedEvidence_finalizeFail_DigitalGoodsPartialEvidence() + { + $disputeId = $this->createSampleDispute()->id; + + Braintree\Dispute::addTextEvidence($disputeId, + [ + 'category' => 'DEVICE_ID', + 'content' => 'iphone_id', + ] + ); + + $result = Braintree\Dispute::finalize($disputeId); + $this->assertFalse($result->success); + + $errors = $result->errors->forKey('dispute')->errors; + $this->assertEquals(Braintree\Error\Codes::DISPUTE_DIGITAL_GOODS_MISSING_EVIDENCE, $errors[0]->code); + $this->assertEquals(Braintree\Error\Codes::DISPUTE_DIGITAL_GOODS_MISSING_DOWNLOAD_DATE, $errors[1]->code); + } + + public function testCategorizedEvidence_finalizeFail_PartialNonDisputeTransInfo() + { + $disputeId = $this->createSampleDispute()->id; + + Braintree\Dispute::addTextEvidence($disputeId, + [ + 'category' => 'PRIOR_NON_DISPUTED_TRANSACTION_ARN', + 'content' => '123', + ] + ); + + $result = Braintree\Dispute::finalize($disputeId); + $this->assertFalse($result->success); + + $error = $result->errors->forKey('dispute')->errors[0]; + $this->assertEquals(Braintree\Error\Codes::DISPUTE_PRIOR_NON_DISPUTED_TRANSACTION_MISSING_DATE, $error->code); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DocumentUploadTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DocumentUploadTest.php new file mode 100644 index 00000000000..2fcb996030b --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/DocumentUploadTest.php @@ -0,0 +1,122 @@ +gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + + $this->pngFile = fopen(dirname(__DIR__) . '/fixtures/bt_logo.png', 'rb'); + } + + public function testCreate_whenValid_returnsSuccessfulResult() + { + $result = Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "file" => $this->pngFile + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_withUnsupportedFileType_returnsError() + { + $gifFile = fopen(dirname(__DIR__) . '/fixtures/gif_extension_bt_logo.gif', 'rb'); + $result = Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "file" => $gifFile + ]); + + $error = $result->errors->forKey('documentUpload')->errors[0]; + $this->assertEquals(Braintree\Error\Codes::DOCUMENT_UPLOAD_FILE_TYPE_IS_INVALID, $error->code); + } + + public function testCreate_withMalformedFile_returnsError() + { + $badPdfFile = fopen(dirname(__DIR__) . '/fixtures/malformed_pdf.pdf', 'rb'); + $result = Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "file" => $badPdfFile + ]); + + $error = $result->errors->forKey('documentUpload')->errors[0]; + $this->assertEquals(Braintree\Error\Codes::DOCUMENT_UPLOAD_FILE_IS_MALFORMED_OR_ENCRYPTED, $error->code); + } + + public function testCreate_withInvalidKind_returnsError() + { + $result = Braintree\DocumentUpload::create([ + "kind" => "invalid_kind", + "file" => $this->pngFile + ]); + + $error = $result->errors->forKey('documentUpload')->errors[0]; + $this->assertEquals(Braintree\Error\Codes::DOCUMENT_UPLOAD_KIND_IS_INVALID, $error->code); + } + + public function testCreate_whenFileIsOver4Mb_returnsError() + { + $bigFile = fopen(dirname(__DIR__) . '/fixtures/large_file.png', 'w+'); + foreach(range(0, 1048577) as $i) { + fwrite($bigFile, 'aaaa'); + } + + fclose($bigFile); + + $bigFile = fopen(dirname(__DIR__) . '/fixtures/large_file.png', 'rb'); + + $result = Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "file" => $bigFile + ]); + + $error = $result->errors->forKey('documentUpload')->errors[0]; + $this->assertEquals(Braintree\Error\Codes::DOCUMENT_UPLOAD_FILE_IS_TOO_LARGE, $error->code); + } + + public function testCreate_whenPDFFileIsOver50Pages_returnsError() + { + $tooLongFile = fopen(dirname(__DIR__) . '/fixtures/too_long.pdf', 'rb'); + + $result = Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "file" => $tooLongFile + ]); + + $error = $result->errors->forKey('documentUpload')->errors[0]; + $this->assertEquals(Braintree\Error\Codes::DOCUMENT_UPLOAD_FILE_IS_TOO_LONG, $error->code); + } + + public function testCreate_whenInvalidSignature_throwsInvalidArgumentException() + { + $this->setExpectedException('InvalidArgumentException', 'invalid keys: bad_key'); + + Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "bad_key" => "value" + ]); + } + + public function test_create_whenFileIsInvalid_throwsError() + { + $this->setExpectedException('InvalidArgumentException', 'file must be a stream resource'); + + $result = Braintree\DocumentUpload::create([ + "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT, + "file" => "not-a-file" + ]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ErrorCollectionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ErrorCollectionTest.php new file mode 100644 index 00000000000..d1e70256281 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ErrorCollectionTest.php @@ -0,0 +1,96 @@ + 'invalid', + 'creditCard' => [ + 'number' => 'invalid', + 'expirationDate' => 'invalid', + 'billingAddress' => [ + 'countryName' => 'invaild' + ] + ] + ]); + $this->assertEquals(false, $result->success); + $this->assertEquals(4, $result->errors->deepSize()); + } + + public function testOnHtmlField() + { + $result = Braintree\Customer::create([ + 'email' => 'invalid', + 'creditCard' => [ + 'number' => 'invalid', + 'expirationDate' => 'invalid', + 'billingAddress' => [ + 'countryName' => 'invaild' + ] + ] + ]); + $this->assertEquals(false, $result->success); + $errors = $result->errors->onHtmlField('customer[email]'); + $this->assertEquals(Braintree\Error\Codes::CUSTOMER_EMAIL_IS_INVALID, $errors[0]->code); + $errors = $result->errors->onHtmlField('customer[credit_card][number]'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_NUMBER_INVALID_LENGTH, $errors[0]->code); + $errors = $result->errors->onHtmlField('customer[credit_card][billing_address][country_name]'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_COUNTRY_NAME_IS_NOT_ACCEPTED, $errors[0]->code); + } + + public function testOnHtmlField_returnsEmptyArrayIfNone() + { + $result = Braintree\Customer::create([ + 'email' => 'invalid', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'billingAddress' => [ + 'streetAddress' => '1 E Main St' + ] + ] + ]); + $this->assertEquals(false, $result->success); + $errors = $result->errors->onHtmlField('customer[email]'); + $this->assertEquals(Braintree\Error\Codes::CUSTOMER_EMAIL_IS_INVALID, $errors[0]->code); + $this->assertEquals([], $result->errors->onHtmlField('customer[credit_card][number]')); + $this->assertEquals([], $result->errors->onHtmlField('customer[credit_card][billing_address][country_name]')); + } + + public function testOnHtmlField_returnsEmptyForCustomFieldsIfNoErrors() + { + $result = Braintree\Customer::create([ + 'email' => 'invalid', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'customFields' => ['storeMe' => 'value'] + ]); + $this->assertEquals(false, $result->success); + $this->assertEquals([], $result->errors->onHtmlField('customer[custom_fields][store_me]')); + } + + public function testCount_returnsTheNumberOfErrors() + { + $result = Braintree\Customer::create([ + 'email' => 'invalid', + 'creditCard' => [ + 'number' => 'invalid', + 'expirationDate' => 'invalid', + 'billingAddress' => [ + 'countryName' => 'invaild' + ] + ] + ]); + $this->assertEquals(false, $result->success); + $this->assertEquals(4, count($result->errors)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ValidationErrorCollectionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ValidationErrorCollectionTest.php new file mode 100644 index 00000000000..6975f34eca7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Error/ValidationErrorCollectionTest.php @@ -0,0 +1,75 @@ +code;'), $validationErrors); + sort($codes); + return $codes; + } + + public function test_shallowAll_givesAllErrorsShallowly() + { + $result = Braintree\Customer::create([ + 'email' => 'invalid', + 'creditCard' => [ + 'number' => '1234123412341234', + 'expirationDate' => 'invalid', + 'billingAddress' => [ + 'countryName' => 'invalid' + ] + ] + ]); + + $this->assertEquals([], $result->errors->shallowAll()); + + $expectedCustomerErrors = [Braintree\Error\Codes::CUSTOMER_EMAIL_IS_INVALID]; + $actualCustomerErrors = $result->errors->forKey('customer')->shallowAll(); + $this->assertEquals($expectedCustomerErrors, self::mapValidationErrorsToCodes($actualCustomerErrors)); + + $expectedCreditCardErrors = [ + Braintree\Error\Codes::CREDIT_CARD_EXPIRATION_DATE_IS_INVALID, + Braintree\Error\Codes::CREDIT_CARD_NUMBER_IS_INVALID, + ]; + $actualCreditCardErrors = $result->errors->forKey('customer')->forKey('creditCard')->shallowAll(); + $this->assertEquals($expectedCreditCardErrors, self::mapValidationErrorsToCodes($actualCreditCardErrors)); + } + + public function test_deepAll_givesAllErrorsDeeply() + { + $result = Braintree\Customer::create([ + 'email' => 'invalid', + 'creditCard' => [ + 'number' => '1234123412341234', + 'expirationDate' => 'invalid', + 'billingAddress' => [ + 'countryName' => 'invalid' + ] + ] + ]); + + $expectedErrors = [ + Braintree\Error\Codes::CUSTOMER_EMAIL_IS_INVALID, + Braintree\Error\Codes::CREDIT_CARD_EXPIRATION_DATE_IS_INVALID, + Braintree\Error\Codes::CREDIT_CARD_NUMBER_IS_INVALID, + Braintree\Error\Codes::ADDRESS_COUNTRY_NAME_IS_NOT_ACCEPTED, + ]; + $actualErrors = $result->errors->deepAll(); + $this->assertEquals($expectedErrors, self::mapValidationErrorsToCodes($actualErrors)); + + $expectedErrors = [ + Braintree\Error\Codes::CREDIT_CARD_EXPIRATION_DATE_IS_INVALID, + Braintree\Error\Codes::CREDIT_CARD_NUMBER_IS_INVALID, + Braintree\Error\Codes::ADDRESS_COUNTRY_NAME_IS_NOT_ACCEPTED, + ]; + $actualErrors = $result->errors->forKey('customer')->forKey('creditCard')->deepAll(); + $this->assertEquals($expectedErrors, self::mapValidationErrorsToCodes($actualErrors)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/GraphQLTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/GraphQLTest.php new file mode 100644 index 00000000000..0cee01409bb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/GraphQLTest.php @@ -0,0 +1,86 @@ +request($definition, NULL); + + $this->assertEquals('pong', $response["data"]["ping"]); + } + + public function testGraphQLProductionSSL() + { + Braintree\Configuration::environment('production'); + $graphQL = new Braintree\GraphQL(Braintree\Configuration::$global); + $definition = "query { ping }"; + + $this->setExpectedException('Braintree\Exception\Authentication'); + $response = $graphQL->request($definition, NULL); + } + + public function testGraphQLSandboxSSL() + { + Braintree\Configuration::environment('sandbox'); + $graphQL = new Braintree\GraphQL(Braintree\Configuration::$global); + $definition = "query { ping }"; + + $this->setExpectedException('Braintree\Exception\Authentication'); + $response = $graphQL->request($definition, NULL); + } + + public function testGraphQLWithVariableInputs() + { + Braintree\Configuration::environment('development'); + $graphQL = new Braintree\GraphQL(Braintree\Configuration::$global); + $definition = ' +mutation CreateClientToken($input: CreateClientTokenInput!) { + createClientToken(input: $input) { + clientMutationId + clientToken + } +}'; + $variables = [ + "input" => [ + "clientMutationId" => "abc123", + "clientToken" => [ + "merchantAccountId" => "ABC123" + ] + ] + ]; + $response = $graphQL->request($definition, $variables); + + $this->assertArrayNotHasKey("errors", $response); + $this->assertTrue(is_string($response["data"]["createClientToken"]["clientToken"])); + } + + public function testGraphQLWithVariableInputsCanReturnParsableErrors() + { + Braintree\Configuration::environment('development'); + $graphQL = new Braintree\GraphQL(Braintree\Configuration::$global); + $definition = ' +query TransactionLevelFeeReport($date: Date!, $merchantAccountId: ID) { + report { + transactionLevelFees(date: $date, merchantAccountId: $merchantAccountId) { + url + } + } +}'; + $variables = [ + "date" => "2018-01-01", + "merchantAccountId" => "some_merchant" + ]; + $response = $graphQL->request($definition, $variables); + + $this->assertEquals("Invalid merchant account id: some_merchant", $response["errors"][0]["message"]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpClientApi.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpClientApi.php new file mode 100644 index 00000000000..9cef293a589 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpClientApi.php @@ -0,0 +1,105 @@ +_doUrlRequest($httpVerb, $this->_config->baseUrl() . "/merchants/" . $this->_config->getMerchantId() . $path, $requestBody, $file, $headers); + } + + public function get($path) + { + return $this->_doRequest('GET', $path); + } + + public function post($path, $body = null) + { + return $this->_doRequest('POST', $path, $body); + } + + public function _doUrlRequest($httpVerb, $url, $requestBody = null, $file = null, $headers = null) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_TIMEOUT, 60); + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb); + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_HTTPHEADER, [ + 'Content-Type: application/json', + 'X-ApiVersion: ' . Braintree\Configuration::API_VERSION, + ]); + curl_setopt($curl, CURLOPT_USERPWD, $this->_config->publicKey() . ':' . $this->_config->privateKey()); + + if(!empty($requestBody)) { + curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody); + } + + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($curl); + $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); + curl_close($curl); + return ['status' => $httpStatus, 'body' => $response]; + } + + public function get_configuration($options) { + $encoded_fingerprint = urlencode($options["authorization_fingerprint"]); + $url = "/client_api/v1/configuration?"; + $url .= "authorizationFingerprint=" . $encoded_fingerprint; + $url .= "&configVersion=3"; + + $response = $this->get($url); + if ($response["status"] == 200) { + return json_decode($response["body"]); + } else { + throw new Braintree\Exception(print_r($response, true)); + } + } + + public function get_cards($options) { + $encoded_fingerprint = urlencode($options["authorization_fingerprint"]); + $url = "/client_api/v1/payment_methods.json?"; + $url .= "authorizationFingerprint=" . $encoded_fingerprint; + $url .= "&sharedCustomerIdentifier=" . $options["shared_customer_identifier"]; + $url .= "&sharedCustomerIdentifierType=" . $options["shared_customer_identifier_type"]; + + return $this->get($url); + } + + public function nonce_for_new_card($options) { + $clientTokenOptions = []; + if (array_key_exists("customerId", $options)) { + $clientTokenOptions["customerId"] = $options["customerId"]; + unset($options["customerId"]); + } + + $clientToken = json_decode(Test\Helper::decodedClientToken($clientTokenOptions)); + + $options["authorization_fingerprint"] = $clientToken->authorizationFingerprint; + $options["shared_customer_identifier"] = "fake_identifier_" . rand(); + $options["shared_customer_identifier_type"] = "testing"; + $response = $this->post('/client_api/v1/payment_methods/credit_cards.json', json_encode($options)); + if ($response["status"] == 201 || $response["status"] == 202) { + $body = json_decode($response["body"]); + return $body->creditCards[0]->nonce; + } else { + throw new Braintree\Exception(print_r($response, true)); + } + } + + public function nonceForPayPalAccount($options) { + $clientToken = json_decode(Test\Helper::decodedClientToken()); + $options["authorization_fingerprint"] = $clientToken->authorizationFingerprint; + $response = $this->post('/client_api/v1/payment_methods/paypal_accounts.json', json_encode($options)); + if ($response["status"] == 201 || $response["status"] == 202) { + $body = json_decode($response["body"], true); + return $body["paypalAccounts"][0]["nonce"]; + } else { + throw new Braintree\Exception(print_r($response, true)); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpTest.php new file mode 100644 index 00000000000..d7e3e41d4ba --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/HttpTest.php @@ -0,0 +1,164 @@ +setExpectedException('Braintree\Exception\Authentication'); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->get('/'); + } catch (Braintree\Exception $e) { + Braintree\Configuration::environment('development'); + throw $e; + } + Braintree\Configuration::environment('development'); + } + + public function testSandboxSSL() + { + try { + Braintree\Configuration::environment('sandbox'); + $this->setExpectedException('Braintree\Exception\Authentication'); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->get('/'); + } catch (Braintree\Exception $e) { + Braintree\Configuration::environment('development'); + throw $e; + } + Braintree\Configuration::environment('development'); + } + + public function testSandboxSSLWithExplicitVersionSet() + { + try { + Braintree\Configuration::environment('sandbox'); + Braintree\Configuration::sslVersion(6); + $this->setExpectedException('Braintree\Exception\Authentication'); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->get('/'); + } catch (Braintree\Exception $e) { + Braintree\Configuration::environment('development'); + Braintree\Configuration::sslVersion(null); + throw $e; + } + Braintree\Configuration::environment('development'); + Braintree\Configuration::sslVersion(null); + } + + public function testSandboxSSLFailsWithIncompatibleSSLVersion() + { + try { + Braintree\Configuration::environment('sandbox'); + Braintree\Configuration::sslVersion(3); + $this->setExpectedException('Braintree\Exception\SSLCertificate', null, 35); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->get('/'); + } catch (Braintree\Exception $e) { + Braintree\Configuration::environment('development'); + Braintree\Configuration::sslVersion(null); + throw $e; + } + Braintree\Configuration::environment('development'); + Braintree\Configuration::sslVersion(null); + } + + public function testSslError() + { + try { + Braintree\Configuration::environment('sandbox'); + $this->setExpectedException('Braintree\Exception\SSLCertificate', null, 3); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->_doUrlRequest('get', '/malformed_url'); + } catch (Braintree\Exception $e) { + Braintree\Configuration::environment('development'); + throw $e; + } + Braintree\Configuration::environment('development'); + } + + public function testAcceptGzipEncodingSetFalse() + { + $originalGzipEncoding = Braintree\Configuration::acceptGzipEncoding(); + Braintree\Configuration::acceptGzipEncoding(false); + try { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Mike', $customer->firstName); + } catch(Braintree\Exception $e) { + Braintree\Configuration::acceptGzipEncoding($originalGzipEncoding); + throw $e; + } + Braintree\Configuration::acceptGzipEncoding($originalGzipEncoding); + } + + public function testAcceptGzipEncodingSetToTrue() + { + $originalGzipEncoding = Braintree\Configuration::acceptGzipEncoding(); + Braintree\Configuration::acceptGzipEncoding(true); + try { + $result = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ]); + $this->assertEquals(true, $result->success); + $customer = $result->customer; + $this->assertEquals('Mike', $customer->firstName); + } catch(Braintree\Exception $e) { + Braintree\Configuration::acceptGzipEncoding($originalGzipEncoding); + throw $e; + } + Braintree\Configuration::acceptGzipEncoding($originalGzipEncoding); + } + + public function testAuthorizationWithConfig() + { + $config = new Braintree\Configuration([ + 'environment' => 'development', + 'merchant_id' => 'integration_merchant_id', + 'publicKey' => 'badPublicKey', + 'privateKey' => 'badPrivateKey' + ]); + + $http = new Braintree\Http($config); + $result = $http->_doUrlRequest('GET', $config->baseUrl() . '/merchants/integration_merchant_id/customers'); + $this->assertEquals(401, $result['status']); + } + + public function testPostMultiPartUploadsFileSuccessfully() + { + $config = Braintree\Configuration::$global; + $http = new Braintree\Http($config); + + $path = '/merchants/integration_merchant_id/document_uploads'; + $params = [ + 'document_upload[kind]' => 'evidence_document' + ]; + $file = fopen(dirname(__DIR__) . '/fixtures/bt_logo.png', 'rb'); + $response = $http->postMultipart($path, $params, $file); + + $this->assertEquals('image/png', $response['documentUpload']['contentType']); + $this->assertNotNull($response['documentUpload']['id']); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/IdealPaymentTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/IdealPaymentTest.php new file mode 100644 index 00000000000..8bff16415b8 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/IdealPaymentTest.php @@ -0,0 +1,93 @@ +assertInstanceOf('Braintree\IdealPayment', $foundIdealPayment); + $this->assertRegExp('/^idealpayment_\w{6,}$/', $foundIdealPayment->id); + $this->assertRegExp('/^\d{16,}$/', $foundIdealPayment->idealTransactionId); + $this->assertNotNull($foundIdealPayment->currency); + $this->assertNotNull($foundIdealPayment->amount); + $this->assertEquals('COMPLETE', $foundIdealPayment->status); + $this->assertEquals('ABC123', $foundIdealPayment->orderId); + $this->assertNotNull($foundIdealPayment->issuer); + $this->assertRegExp('/^https:\/\//', $foundIdealPayment->approvalUrl); + $this->assertNotNull($foundIdealPayment->ibanBankAccount->maskedIban); + $this->assertNotNull($foundIdealPayment->ibanBankAccount->bic); + $this->assertNotNull($foundIdealPayment->ibanBankAccount->ibanCountry); + $this->assertNotNull($foundIdealPayment->ibanBankAccount->description); + $this->assertRegExp('/^\d{4}$/', $foundIdealPayment->ibanBankAccount->ibanAccountNumberLast4); + } + + public function testFindIdealPayment_throwsIfCannotBeFound() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\IdealPayment::find(Test\Helper::generateInvalidIdealPaymentId()); + } + + public function testSale_createsASaleUsingId() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $idealPaymentId = Test\Helper::generateValidIdealPaymentId(); + + $result = Braintree\IdealPayment::sale($idealPaymentId, [ + 'merchantAccountId' => 'ideal_merchant_account', + 'amount' => '100.00', + 'orderId' => 'ABC123' + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertRegExp('/^idealpayment_\w{6,}$/', $transaction->idealPayment->idealPaymentId); + $this->assertRegExp('/^\d{16,}$/', $transaction->idealPayment->idealTransactionId); + $this->assertRegExp('/^https:\/\//', $transaction->idealPayment->imageUrl); + $this->assertNotNull($transaction->idealPayment->maskedIban); + $this->assertNotNull($transaction->idealPayment->bic); + } + + public function testSale_createsASaleWithNotCompletePayment() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $idealPaymentId = Test\Helper::generateValidIdealPaymentId('3.00'); + + $result = Braintree\IdealPayment::sale($idealPaymentId, [ + 'merchantAccountId' => 'ideal_merchant_account', + 'amount' => '3.00', + 'orderId' => 'ABC123' + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('paymentMethodNonce'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_IDEAL_PAYMENT_NOT_COMPLETE, $baseErrors[0]->code); + } + + public function testSale_createsASaleUsingInvalidId() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + + $result = Braintree\IdealPayment::sale('invalid_id', [ + 'merchantAccountId' => 'ideal_merchant_account', + 'amount' => '100.00', + 'orderId' => 'ABC123' + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('paymentMethodNonce'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PAYMENT_METHOD_NONCE_UNKNOWN, $baseErrors[0]->code); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MasterpassCardTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MasterpassCardTest.php new file mode 100644 index 00000000000..8af37ecf976 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MasterpassCardTest.php @@ -0,0 +1,128 @@ + $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$masterpassDiscover, + ]); + + $this->assertTrue($result->success); + $masterpassCard = $result->paymentMethod; + $this->assertSame(Braintree\CreditCard::DISCOVER, $masterpassCard->cardType); + $this->assertTrue($masterpassCard->default); + $this->assertContains('discover', $masterpassCard->imageUrl); + $this->assertTrue(intval($masterpassCard->expirationMonth) > 0); + $this->assertTrue(intval($masterpassCard->expirationYear) > 0); + $this->assertSame($customer->id, $masterpassCard->customerId); + $this->assertSame($masterpassCard->last4, '1117'); + $this->assertSame($masterpassCard->maskedNumber, '601111******1117'); + + $this->assertNotNull($masterpassCard->billingAddress); + $this->assertNotNull($masterpassCard->bin); + $this->assertNotNull($masterpassCard->cardType); + $this->assertNotNull($masterpassCard->cardholderName); + $this->assertNotNull($masterpassCard->commercial); + $this->assertNotNull($masterpassCard->countryOfIssuance); + $this->assertNotNull($masterpassCard->createdAt); + $this->assertNotNull($masterpassCard->customerId); + $this->assertNotNull($masterpassCard->customerLocation); + $this->assertNotNull($masterpassCard->debit); + $this->assertNotNull($masterpassCard->default); + $this->assertNotNull($masterpassCard->durbinRegulated); + $this->assertNotNull($masterpassCard->expirationDate); + $this->assertNotNull($masterpassCard->expirationMonth); + $this->assertNotNull($masterpassCard->expirationYear); + $this->assertNotNull($masterpassCard->expired); + $this->assertNotNull($masterpassCard->healthcare); + $this->assertNotNull($masterpassCard->imageUrl); + $this->assertNotNull($masterpassCard->issuingBank); + $this->assertNotNull($masterpassCard->last4); + $this->assertNotNull($masterpassCard->maskedNumber); + $this->assertNotNull($masterpassCard->payroll); + $this->assertNotNull($masterpassCard->prepaid); + $this->assertNotNull($masterpassCard->productId); + $this->assertNotNull($masterpassCard->subscriptions); + $this->assertNotNull($masterpassCard->token); + $this->assertNotNull($masterpassCard->uniqueNumberIdentifier); + $this->assertNotNull($masterpassCard->updatedAt); + } + + public function testTransactionSearchWithMasterpass() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => Braintree\Test\Nonces::$masterpassDiscover, + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::paymentInstrumentType()->is(Braintree\PaymentInstrumentType::MASTERPASS_CARD) + ]); + + + $this->assertEquals($transaction->paymentInstrumentType, Braintree\PaymentInstrumentType::MASTERPASS_CARD); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function testCreateCustomerwithMasterpassCard() + { + $nonce = Braintree\Test\Nonces::$masterpassDiscover; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->masterpassCards[0]); + $this->assertNotNull($customer->paymentMethods[0]); + } + + public function testCreateTransactionWithMasterpassNonceAndVault() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$masterpassAmEx, + 'options' => [ + 'storeInVault' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $masterpassCardDetails = $transaction->masterpassCardDetails; + $this->assertSame(Braintree\CreditCard::AMEX, $masterpassCardDetails->cardType); + + $this->assertNotNull($masterpassCardDetails->bin); + $this->assertNotNull($masterpassCardDetails->cardType); + $this->assertNotNull($masterpassCardDetails->cardholderName); + $this->assertNotNull($masterpassCardDetails->commercial); + $this->assertNotNull($masterpassCardDetails->countryOfIssuance); + $this->assertNotNull($masterpassCardDetails->customerLocation); + $this->assertNotNull($masterpassCardDetails->debit); + $this->assertNotNull($masterpassCardDetails->durbinRegulated); + $this->assertNotNull($masterpassCardDetails->expirationDate); + $this->assertNotNull($masterpassCardDetails->expirationMonth); + $this->assertNotNull($masterpassCardDetails->expirationYear); + $this->assertNotNull($masterpassCardDetails->healthcare); + $this->assertNotNull($masterpassCardDetails->imageUrl); + $this->assertNotNull($masterpassCardDetails->issuingBank); + $this->assertNotNull($masterpassCardDetails->last4); + $this->assertNotNull($masterpassCardDetails->maskedNumber); + $this->assertNotNull($masterpassCardDetails->payroll); + $this->assertNotNull($masterpassCardDetails->prepaid); + $this->assertNotNull($masterpassCardDetails->productId); + $this->assertNotNull($masterpassCardDetails->token); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantAccountTest.php new file mode 100644 index 00000000000..02dde311587 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantAccountTest.php @@ -0,0 +1,631 @@ + [ + 'companyName' => "Robot City", + 'firstName' => "Joe", + 'lastName' => "Bloggs", + 'email' => "joe@bloggs.com", + 'phone' => "555-555-5555", + 'address' => [ + 'streetAddress' => "123 Credibility St.", + 'postalCode' => "60606", + 'locality' => "Chicago", + 'region' => "IL", + ], + 'dateOfBirth' => "10/9/1980", + 'ssn' => "123-00-1234", + 'taxId' => "123456789", + 'routingNumber' => "122100024", + 'accountNumber' => "43759348798" + ], + 'tosAccepted' => true, + 'masterMerchantAccountId' => "sandbox_master_merchant_account" + ]; + + private static $validParams = [ + 'individual' => [ + 'firstName' => "Joe", + 'lastName' => "Bloggs", + 'email' => "joe@bloggs.com", + 'phone' => "555-555-5555", + 'address' => [ + 'streetAddress' => "123 Credibility St.", + 'postalCode' => "60606", + 'locality' => "Chicago", + 'region' => "IL", + ], + 'dateOfBirth' => "10/9/1980", + 'ssn' => "123-00-1234", + ], + 'business' => [ + 'dbaName' => "Robot City", + 'legalName' => "Robot City INC", + 'taxId' => "123456789", + ], + 'funding' => [ + 'routingNumber' => "122100024", + 'accountNumber' => "43759348798", + 'destination' => Braintree\MerchantAccount::FUNDING_DESTINATION_BANK, + 'descriptor' => 'Joes Bloggs MI', + ], + 'tosAccepted' => true, + 'masterMerchantAccountId' => "sandbox_master_merchant_account" + ]; + + public function testCreate() + { + $result = Braintree\MerchantAccount::create(self::$validParams); + $this->assertEquals(true, $result->success); + $merchantAccount = $result->merchantAccount; + $this->assertEquals(Braintree\MerchantAccount::STATUS_PENDING, $merchantAccount->status); + $this->assertEquals("sandbox_master_merchant_account", $merchantAccount->masterMerchantAccount->id); + } + + public function testGatewayCreate() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->merchantAccount()->create(self::$validParams); + $this->assertEquals(true, $result->success); + $merchantAccount = $result->merchantAccount; + $this->assertEquals(Braintree\MerchantAccount::STATUS_PENDING, $merchantAccount->status); + $this->assertEquals("sandbox_master_merchant_account", $merchantAccount->masterMerchantAccount->id); + } + + public function testCreateWithDeprecatedParameters() + { + Test\Helper::suppressDeprecationWarnings(); + $result = Braintree\MerchantAccount::create(self::$deprecatedValidParams); + $this->assertEquals(true, $result->success); + $merchantAccount = $result->merchantAccount; + $this->assertEquals(Braintree\MerchantAccount::STATUS_PENDING, $merchantAccount->status); + $this->assertEquals("sandbox_master_merchant_account", $merchantAccount->masterMerchantAccount->id); + } + + public function testCreateWithId() + { + $rand = rand(1, 1000); + $subMerchantAccountId = "sub_merchant_account_id" + $rand; + $validParamsWithId = array_merge([], self::$validParams); + $validParamsWithId['id'] = $subMerchantAccountId; + $result = Braintree\MerchantAccount::create($validParamsWithId); + $this->assertEquals(true, $result->success); + $merchantAccount = $result->merchantAccount; + $this->assertEquals(Braintree\MerchantAccount::STATUS_PENDING, $merchantAccount->status); + $this->assertEquals("sandbox_master_merchant_account", $merchantAccount->masterMerchantAccount->id); + $this->assertEquals("sub_merchant_account_id" + $rand, $merchantAccount->id); + } + + public function testFailedCreate() + { + $result = Braintree\MerchantAccount::create([]); + $this->assertEquals(false, $result->success); + $errors = $result->errors->forKey('merchantAccount')->onAttribute('masterMerchantAccountId'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_ACCOUNT_MASTER_MERCHANT_ACCOUNT_ID_IS_REQUIRED, $errors[0]->code); + } + + public function testCreateWithFundingDestination() + { + $params = array_merge([], self::$validParams); + $params['funding']['destination'] = Braintree\MerchantAccount::FUNDING_DESTINATION_BANK; + $result = Braintree\MerchantAccount::create($params); + $this->assertEquals(true, $result->success); + + $params = array_merge([], self::$validParams); + $params['funding']['destination'] = Braintree\MerchantAccount::FUNDING_DESTINATION_EMAIL; + $params['funding']['email'] = "billgates@outlook.com"; + $result = Braintree\MerchantAccount::create($params); + $this->assertEquals(true, $result->success); + + $params = array_merge([], self::$validParams); + $params['funding']['destination'] = Braintree\MerchantAccount::FUNDING_DESTINATION_MOBILE_PHONE; + $params['funding']['mobilePhone'] = "1112224444"; + $result = Braintree\MerchantAccount::create($params); + $this->assertEquals(true, $result->success); + } + + public function testFind() + { + $params = array_merge([], self::$validParams); + $result = Braintree\MerchantAccount::create(self::$validParams); + $this->assertEquals(true, $result->success); + $this->assertEquals(Braintree\MerchantAccount::STATUS_PENDING, $result->merchantAccount->status); + + $id = $result->merchantAccount->id; + $merchantAccount = Braintree\MerchantAccount::find($id); + + $this->assertEquals(Braintree\MerchantAccount::STATUS_ACTIVE, $merchantAccount->status); + $this->assertEquals($params['individual']['firstName'], $merchantAccount->individualDetails->firstName); + $this->assertEquals($params['individual']['lastName'], $merchantAccount->individualDetails->lastName); + } + + public function testRetrievesMasterMerchantAccountCurrencyIsoCode() + { + $merchantAccount = Braintree\MerchantAccount::find("sandbox_master_merchant_account"); + + $this->assertEquals("USD", $merchantAccount->currencyIsoCode); + } + + public function testFind_throwsIfNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'merchant account with id does-not-exist not found'); + Braintree\MerchantAccount::find('does-not-exist'); + } + + public function testUpdate() + { + $params = array_merge([], self::$validParams); + unset($params["tosAccepted"]); + unset($params["masterMerchantAccountId"]); + $params["individual"]["firstName"] = "John"; + $params["individual"]["lastName"] = "Doe"; + $params["individual"]["email"] = "john.doe@example.com"; + $params["individual"]["dateOfBirth"] = "1970-01-01"; + $params["individual"]["phone"] = "3125551234"; + $params["individual"]["address"]["streetAddress"] = "123 Fake St"; + $params["individual"]["address"]["locality"] = "Chicago"; + $params["individual"]["address"]["region"] = "IL"; + $params["individual"]["address"]["postalCode"] = "60622"; + $params["business"]["dbaName"] = "James's Bloggs"; + $params["business"]["legalName"] = "James's Bloggs Inc"; + $params["business"]["taxId"] = "123456789"; + $params["business"]["address"]["streetAddress"] = "999 Fake St"; + $params["business"]["address"]["locality"] = "Miami"; + $params["business"]["address"]["region"] = "FL"; + $params["business"]["address"]["postalCode"] = "99999"; + $params["funding"]["accountNumber"] = "43759348798"; + $params["funding"]["routingNumber"] = "071000013"; + $params["funding"]["email"] = "check@this.com"; + $params["funding"]["mobilePhone"] = "1234567890"; + $params["funding"]["destination"] = Braintree\MerchantAccount::FUNDING_DESTINATION_BANK; + $params["funding"]["descriptor"] = "Joes Bloggs FL"; + + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(true, $result->success); + + $updatedMerchantAccount = $result->merchantAccount; + $this->assertEquals("active", $updatedMerchantAccount->status); + $this->assertEquals("sandbox_sub_merchant_account", $updatedMerchantAccount->id); + $this->assertEquals("sandbox_master_merchant_account", $updatedMerchantAccount->masterMerchantAccount->id); + $this->assertEquals("John", $updatedMerchantAccount->individualDetails->firstName); + $this->assertEquals("Doe", $updatedMerchantAccount->individualDetails->lastName); + $this->assertEquals("john.doe@example.com", $updatedMerchantAccount->individualDetails->email); + $this->assertEquals("1970-01-01", $updatedMerchantAccount->individualDetails->dateOfBirth); + $this->assertEquals("3125551234", $updatedMerchantAccount->individualDetails->phone); + $this->assertEquals("123 Fake St", $updatedMerchantAccount->individualDetails->addressDetails->streetAddress); + $this->assertEquals("Chicago", $updatedMerchantAccount->individualDetails->addressDetails->locality); + $this->assertEquals("IL", $updatedMerchantAccount->individualDetails->addressDetails->region); + $this->assertEquals("60622", $updatedMerchantAccount->individualDetails->addressDetails->postalCode); + $this->assertEquals("James's Bloggs", $updatedMerchantAccount->businessDetails->dbaName); + $this->assertEquals("James's Bloggs Inc", $updatedMerchantAccount->businessDetails->legalName); + $this->assertEquals("123456789", $updatedMerchantAccount->businessDetails->taxId); + $this->assertEquals("999 Fake St", $updatedMerchantAccount->businessDetails->addressDetails->streetAddress); + $this->assertEquals("Miami", $updatedMerchantAccount->businessDetails->addressDetails->locality); + $this->assertEquals("FL", $updatedMerchantAccount->businessDetails->addressDetails->region); + $this->assertEquals("99999", $updatedMerchantAccount->businessDetails->addressDetails->postalCode); + $this->assertEquals("8798", $updatedMerchantAccount->fundingDetails->accountNumberLast4); + $this->assertEquals("071000013", $updatedMerchantAccount->fundingDetails->routingNumber); + $this->assertEquals("check@this.com", $updatedMerchantAccount->fundingDetails->email); + $this->assertEquals("1234567890", $updatedMerchantAccount->fundingDetails->mobilePhone); + $this->assertEquals(Braintree\MerchantAccount::FUNDING_DESTINATION_BANK, $updatedMerchantAccount->fundingDetails->destination); + $this->assertEquals("Joes Bloggs FL", $updatedMerchantAccount->fundingDetails->descriptor); + } + + public function testUpdateDoesNotRequireAllFields() + { + $params = [ + 'individual' => [ + 'firstName' => "Joe" + ] + ]; + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(true, $result->success); + } + + public function testUpdateWithBlankFields() + { + $params = [ + 'individual' => [ + 'firstName' => "", + 'lastName' => "", + 'email' => "", + 'phone' => "", + 'address' => [ + 'streetAddress' => "", + 'postalCode' => "", + 'locality' => "", + 'region' => "", + ], + 'dateOfBirth' => "", + 'ssn' => "", + ], + 'business' => [ + 'dbaName' => "", + 'legalName' => "", + 'taxId' => "", + ], + 'funding' => [ + 'routingNumber' => "", + 'accountNumber' => "", + 'destination' => "", + ], + ]; + + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(false, $result->success); + + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("firstName"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_FIRST_NAME_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("lastName"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_LAST_NAME_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("dateOfBirth"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_DATE_OF_BIRTH_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("email"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_EMAIL_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->forKey("address")->onAttribute("streetAddress"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_STREET_ADDRESS_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->forKey("address")->onAttribute("postalCode"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_POSTAL_CODE_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->forKey("address")->onAttribute("locality"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_LOCALITY_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->forKey("address")->onAttribute("region"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_REGION_IS_REQUIRED); + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("destination"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_DESTINATION_IS_REQUIRED); + } + + public function testUpdateWithInvalidFields() + { + $params = [ + "individual" => [ + "firstName" => "<>", + "lastName" => "<>", + "email" => "bad", + "phone" => "999", + "address" => [ + "streetAddress" => "nope", + "postalCode" => "1", + "region" => "QQ", + ], + "dateOfBirth" => "hah", + "ssn" => "12345", + ], + "business" => [ + "legalName" => "``{}", + "dbaName" => "{}``", + "taxId" => "bad", + "address" => [ + "streetAddress" => "nope", + "postalCode" => "1", + "region" => "QQ", + ], + ], + "funding" => [ + "destination" => "MY WALLET", + "routingNumber" => "LEATHER", + "accountNumber" => "BACK POCKET", + "email" => "BILLFOLD", + "mobilePhone" => "TRIFOLD" + ], + ]; + + + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(false, $result->success); + + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("firstName"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_FIRST_NAME_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("lastName"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_LAST_NAME_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("email"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_EMAIL_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("phone"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_PHONE_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->forKey("address")->onAttribute("streetAddress"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_STREET_ADDRESS_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->forKey("address")->onAttribute("postalCode"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_POSTAL_CODE_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->forKey("address")->onAttribute("region"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_ADDRESS_REGION_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("individual")->onAttribute("ssn"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_INDIVIDUAL_SSN_IS_INVALID); + ; + $error = $result->errors->forKey("merchantAccount")->forKey("business")->onAttribute("legalName"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_LEGAL_NAME_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("business")->onAttribute("dbaName"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_DBA_NAME_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("business")->onAttribute("taxId"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_TAX_ID_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("business")->forKey("address")->onAttribute("streetAddress"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_ADDRESS_STREET_ADDRESS_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("business")->forKey("address")->onAttribute("postalCode"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_ADDRESS_POSTAL_CODE_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("business")->forKey("address")->onAttribute("region"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_ADDRESS_REGION_IS_INVALID); + + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("destination"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_DESTINATION_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("routingNumber"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_ROUTING_NUMBER_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("accountNumber"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_ACCOUNT_NUMBER_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("email"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_EMAIL_IS_INVALID); + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("mobilePhone"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_MOBILE_PHONE_IS_INVALID); + } + + public function testUpdateWithInvalidBusinessFields() + { + $params = [ + "business" => [ + "legalName" => "", + "taxId" => "111223333", + ] + ]; + + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(false, $result->success); + + $error = $result->errors->forKey("merchantAccount")->forKey("business")->onAttribute("legalName"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_LEGAL_NAME_IS_REQUIRED_WITH_TAX_ID); + $error = $result->errors->forKey("merchantAccount")->forKey("business")->onAttribute("taxId"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_TAX_ID_MUST_BE_BLANK); + + $params = [ + "business" => [ + "legalName" => "legal name", + "taxId" => "", + ] + ]; + + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(false, $result->success); + + $error = $result->errors->forKey("merchantAccount")->forKey("business")->onAttribute("taxId"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_BUSINESS_TAX_ID_IS_REQUIRED_WITH_LEGAL_NAME); + } + + public function testUpdateWithInvalidFundingFields() + { + $params = [ + "funding" => [ + "destination" => Braintree\MerchantAccount::FUNDING_DESTINATION_EMAIL, + "email" => "", + ] + ]; + + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(false, $result->success); + + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("email"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_EMAIL_IS_REQUIRED); + + $params = [ + "funding" => [ + "destination" => Braintree\MerchantAccount::FUNDING_DESTINATION_MOBILE_PHONE, + "mobilePhone" => "", + ] + ]; + + $result = Braintree\MerchantAccount::update("sandbox_sub_merchant_account", $params); + $this->assertEquals(false, $result->success); + + $error = $result->errors->forKey("merchantAccount")->forKey("funding")->onAttribute("mobilePhone"); + $this->assertEquals($error[0]->code, Braintree\Error\Codes::MERCHANT_ACCOUNT_FUNDING_MOBILE_PHONE_IS_REQUIRED); + } + + public function testCreateForCurrency() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'GBR', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + $this->assertEquals(true, $result->success); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + + $result = $gateway->merchantAccount()->createForCurrency([ + 'currency' => "USD", + ]); + + $this->assertEquals(true, $result->success); + + $merchantAccount = $result->merchantAccount; + $this->assertEquals("USD", $merchantAccount->currencyIsoCode); + $this->assertEquals("USD", $merchantAccount->id); + } + + public function testCreateForCurrencyWithDuplicateCurrency() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'GBR', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + $this->assertEquals(true, $result->success); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + + $merchantAccount = $result->merchant->merchantAccounts[0]; + $result = $gateway->merchantAccount()->createForCurrency([ + 'currency' => "GBP", + ]); + + $this->assertEquals(false, $result->success); + + $errors = $result->errors->forKey('merchant')->onAttribute('currency'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_CURRENCY, $errors[0]->code); + } + + public function testCreateForCurrencyWithInvalidCurrency() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'GBR', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + $this->assertEquals(true, $result->success); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + + $result = $gateway->merchantAccount()->createForCurrency([ + 'currency' => "FAKE_CURRENCY", + ]); + + $this->assertEquals(false, $result->success); + + $errors = $result->errors->forKey('merchant')->onAttribute('currency'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_CURRENCY_IS_INVALID, $errors[0]->code); + } + + public function testCreateForCurrencyWithoutCurrency() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'GBR', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + $this->assertEquals(true, $result->success); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + + $result = $gateway->merchantAccount()->createForCurrency([]); + + $this->assertEquals(false, $result->success); + + $errors = $result->errors->forKey('merchant')->onAttribute('currency'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_CURRENCY_IS_REQUIRED, $errors[0]->code); + } + + public function testCreateForCurrencyWithDuplicateId() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'GBR', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + $this->assertEquals(true, $result->success); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + + $merchantAccount = $result->merchant->merchantAccounts[0]; + $result = $gateway->merchantAccount()->createForCurrency([ + 'currency' => "USD", + 'id' => $merchantAccount->id, + ]); + + $this->assertEquals(false, $result->success); + + $errors = $result->errors->forKey('merchant')->onAttribute('id'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_ID, $errors[0]->code); + } + + public function testAllReturnsAllMerchantAccounts() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($gateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write' + ]); + + $credentials = $gateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $result = $gateway->merchantAccount()->all(); + $merchantAccounts = []; + foreach($result as $ma) { + array_push($merchantAccounts, $ma); + } + $this->assertEquals(true, count($merchantAccounts) > 20); + } + + public function testAllReturnsMerchantAccountWithCorrectAttributes() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + ]); + + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + + $result = $gateway->merchantAccount()->all(); + $merchantAccounts = []; + foreach($result as $ma) { + array_push($merchantAccounts, $ma); + } + + $this->assertEquals(1, count($merchantAccounts)); + $merchantAccount = $merchantAccounts[0]; + $this->assertEquals("USD", $merchantAccount->currencyIsoCode); + $this->assertEquals(Braintree\MerchantAccount::STATUS_ACTIVE, $merchantAccount->status); + $this->assertTrue($merchantAccount->default); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantTest.php new file mode 100644 index 00000000000..ee67ed9843f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MerchantTest.php @@ -0,0 +1,257 @@ + 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['credit_card', 'paypal'], + ]); + + $this->assertEquals(true, $result->success); + $merchant = $result->merchant; + $this->assertNotNull($merchant->id); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage clientId needs to be passed to Braintree\Gateway + */ + public function testAssertsHasCredentials() + { + $gateway = new Braintree\Gateway([ + 'clientSecret' => 'client_secret$development$integration_client_secret', + ]); + $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + ]); + } + + public function testBadPaymentMethods() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['fake_money'], + ]); + + $this->assertEquals(false, $result->success); + $errors = $result->errors->forKey('merchant')->onAttribute('paymentMethods'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID, $errors[0]->code); + } + + public function testCreateUSMerchantThatAcceptsMultipleCurrencies() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['credit_card', 'paypal'], + 'currencies' => ['GBP', 'USD'] + ]); + + $this->assertEquals(true, $result->success); + $merchant = $result->merchant; + $this->assertNotNull($merchant->id); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + + $merchantAccounts = $merchant->merchantAccounts; + $this->assertEquals(2, count($merchantAccounts)); + + $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD'); + $this->assertNotNull($usdMerchantAccount); + $this->assertEquals(true, $usdMerchantAccount->default); + $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); + + $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP'); + $this->assertNotNull($gbpMerchantAccount); + $this->assertEquals(false, $gbpMerchantAccount->default); + $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode); + } + + public function testCreateEUMerchantThatAcceptsMultipleCurrencies() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'GBR', + 'paymentMethods' => ['credit_card', 'paypal'], + 'currencies' => ['GBP', 'USD'] + ]); + + $this->assertEquals(true, $result->success); + $merchant = $result->merchant; + $this->assertNotNull($merchant->id); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + + $merchantAccounts = $merchant->merchantAccounts; + $this->assertEquals(2, count($merchantAccounts)); + + $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD'); + $this->assertNotNull($usdMerchantAccount); + $this->assertEquals(false, $usdMerchantAccount->default); + $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); + + $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP'); + $this->assertNotNull($gbpMerchantAccount); + $this->assertEquals(true, $gbpMerchantAccount->default); + $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode); + } + + public function testCreatePaypalOnlyMerchantThatAcceptsMultipleCurrencies() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['paypal'], + 'currencies' => ['GBP', 'USD'], + 'paypalAccount' => [ + 'clientId' => 'fake_client_id', + 'clientSecret' => 'fake_client_secret', + ] + ]); + + $this->assertEquals(true, $result->success); + $merchant = $result->merchant; + $this->assertNotNull($merchant->id); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + + $merchantAccounts = $merchant->merchantAccounts; + $this->assertEquals(2, count($merchantAccounts)); + + $usdMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'USD'); + $this->assertNotNull($usdMerchantAccount); + $this->assertEquals(true, $usdMerchantAccount->default); + $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); + + $gbpMerchantAccount = $this->getMerchantAccountForCurrency($merchantAccounts, 'GBP'); + $this->assertNotNull($gbpMerchantAccount); + $this->assertEquals(false, $gbpMerchantAccount->default); + $this->assertEquals('GBP', $gbpMerchantAccount->currencyIsoCode); + } + + private function getMerchantAccountForCurrency($merchantAccounts, $currency) + { + foreach($merchantAccounts as $merchantAccount) { + if($merchantAccount->id == $currency) { + return $merchantAccount; + } + } + return null; + } + + public function testCreatePaypalOnlyMerchantWithNoCurrenciesProvided() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'JPN', + 'paymentMethods' => ['paypal'], + 'paypalAccount' => [ + 'clientId' => 'fake_client_id', + 'clientSecret' => 'fake_client_secret', + ] + ]); + + $this->assertEquals(true, $result->success); + $merchant = $result->merchant; + $this->assertNotNull($merchant->id); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + + $merchantAccounts = $merchant->merchantAccounts; + $this->assertEquals(1, count($merchantAccounts)); + + $jpyMerchantAccount = $merchantAccounts[0]; + $this->assertEquals(true, $jpyMerchantAccount->default); + $this->assertEquals('JPY', $jpyMerchantAccount->currencyIsoCode); + } + + public function testCreatePaypalOnlyMerchantWithUnsupportedCountryCodeProvided() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'YEM', + 'paymentMethods' => ['paypal'], + 'paypalAccount' => [ + 'clientId' => 'fake_client_id', + 'clientSecret' => 'fake_client_secret', + ] + ]); + + $this->assertEquals(true, $result->success); + $merchant = $result->merchant; + $this->assertNotNull($merchant->id); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + + $merchantAccounts = $merchant->merchantAccounts; + $this->assertEquals(1, count($merchantAccounts)); + + $usdMerchantAccount = $merchantAccounts[0]; + $this->assertEquals(true, $usdMerchantAccount->default); + $this->assertEquals('USD', $usdMerchantAccount->currencyIsoCode); + } + + public function testInvalidCurrencyForMultiCurrency() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$signup_client_id', + 'clientSecret' => 'client_secret$development$signup_client_secret', + ]); + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['paypal'], + 'currencies' => ['FAKE', 'USD'], + 'paypalAccount' => [ + 'clientId' => 'fake_client_id', + 'clientSecret' => 'fake_client_secret', + ] + ]); + + $this->assertEquals(false, $result->success); + $errors = $result->errors->forKey('merchant')->onAttribute('currencies'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_CURRENCIES_ARE_INVALID, $errors[0]->code); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MultipleValueNodeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MultipleValueNodeTest.php new file mode 100644 index 00000000000..e688f8e2b8e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/MultipleValueNodeTest.php @@ -0,0 +1,94 @@ + $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '3' + ])->subscription; + + $canceledSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '3' + ])->subscription; + Braintree\Subscription::cancel($canceledSubscription->id); + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::status()->in([Braintree\Subscription::ACTIVE]), + Braintree\SubscriptionSearch::price()->is('3'), + ]); + foreach ($collection AS $item) { + $this->assertEquals(Braintree\Subscription::ACTIVE, $item->status); + } + + $this->assertTrue(Test\Helper::includes($collection, $activeSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $canceledSubscription)); + } + + public function testIs() + { + $found = false; + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::status()->is(Braintree\Subscription::PAST_DUE) + ]); + foreach ($collection AS $item) { + $found = true; + $this->assertEquals(Braintree\Subscription::PAST_DUE, $item->status); + } + $this->assertTrue($found); + } + + public function testSearch_statusIsExpired() + { + $found = false; + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::status()->in([Braintree\Subscription::EXPIRED]) + ]); + foreach ($collection AS $item) { + $found = true; + $this->assertEquals(Braintree\Subscription::EXPIRED, $item->status); + } + $this->assertTrue($found); + } + + public function testIn_multipleValues() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $activeSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '4' + ])->subscription; + + $canceledSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '4' + ])->subscription; + Braintree\Subscription::cancel($canceledSubscription->id); + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::status()->in([Braintree\Subscription::ACTIVE, Braintree\Subscription::CANCELED]), + Braintree\SubscriptionSearch::price()->is('4') + ]); + + $this->assertTrue(Test\Helper::includes($collection, $activeSubscription)); + $this->assertTrue(Test\Helper::includes($collection, $canceledSubscription)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/OAuthTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/OAuthTest.php new file mode 100644 index 00000000000..30c28347007 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/OAuthTest.php @@ -0,0 +1,323 @@ + 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $code = Test\Braintree\OAuthTestHelper::createGrant($gateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write' + ]); + $result = $gateway->oauth()->createTokenFromCode([ + 'code' => $code, + 'scope' => 'read_write', + ]); + + $this->assertEquals(true, $result->success); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + $this->assertNotNull($credentials->refreshToken); + $this->assertEquals('bearer', $credentials->tokenType); + $this->assertNotNull($credentials->expiresAt); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage clientSecret needs to be passed to Braintree\Gateway. + */ + public function testAssertsHasCredentials() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id' + ]); + $gateway->oauth()->createTokenFromCode([ + 'code' => 'integration_oauth_auth_code_' . rand(0,299) + ]); + } + + public function testCreateTokenFromCodeWithMixedCredentials() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + 'accessToken' => 'access_token$development$integration_merchant_id$f9ac33b3dd', + ]); + $code = Test\Braintree\OAuthTestHelper::createGrant($gateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write' + ]); + $result = $gateway->oauth()->createTokenFromCode([ + 'code' => $code, + 'scope' => 'read_write', + ]); + + $this->assertEquals(true, $result->success); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + $this->assertNotNull($credentials->refreshToken); + $this->assertEquals('bearer', $credentials->tokenType); + $this->assertNotNull($credentials->expiresAt); + } + + public function testCreateTokenFromCode_JsonAPI() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $code = Test\Braintree\OAuthTestHelper::createGrant($gateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write' + ]); + $result = $gateway->oauth()->createTokenFromCode([ + 'code' => $code, + 'scope' => 'read_write', + ]); + + $this->assertEquals(true, $result->success); + $this->assertNotNull($result->accessToken); + $this->assertNotNull($result->refreshToken); + $this->assertEquals('bearer', $result->tokenType); + $this->assertNotNull($result->expiresAt); + } + + public function testRevokeAccessToken() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + ]); + $code = Test\Braintree\OAuthTestHelper::createGrant($gateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write' + ]); + $result = $gateway->oauth()->createTokenFromCode([ + 'code' => $code, + 'scope' => 'read_write', + ]); + + $revokeAccessTokenResult = $gateway->oauth()->revokeAccessToken($result->accessToken); + + $this->assertTrue($revokeAccessTokenResult->success); + $this->assertTrue($revokeAccessTokenResult->result->success); + + $gateway = new Braintree\Gateway(['accessToken' => $result->accessToken]); + $this->setExpectedException('Braintree\Exception\Authentication'); + $gateway->customer()->create(); + } + + public function testCreateTokenFromCode_ValidationErrorTest() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $result = $gateway->oauth()->createTokenFromCode([ + 'code' => 'bad_code', + 'scope' => 'read_write', + ]); + + $this->assertEquals(false, $result->success); + $errors = $result->errors->forKey('credentials')->onAttribute('code'); + $this->assertEquals(Braintree\Error\Codes::OAUTH_INVALID_GRANT, $errors[0]->code); + $this->assertEquals(1, preg_match('/Invalid grant: code not found/', $result->message)); + } + + public function testCreateTokenFromCode_OldError() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $result = $gateway->oauth()->createTokenFromCode([ + 'code' => 'bad_code', + 'scope' => 'read_write', + ]); + + $this->assertEquals(false, $result->success); + $this->assertEquals('invalid_grant', $result->error); + $this->assertEquals('code not found', $result->errorDescription); + } + + public function testCreateTokenFromRefreshToken() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $code = Test\Braintree\OAuthTestHelper::createGrant($gateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write' + ]); + $refreshToken = $gateway->oauth()->createTokenFromCode([ + 'code' => $code, + 'scope' => 'read_write', + ])->credentials->refreshToken; + + $result = $gateway->oauth()->createTokenFromRefreshToken([ + 'refreshToken' => $refreshToken, + 'scope' => 'read_write', + ]); + + $this->assertEquals(true, $result->success); + $credentials = $result->credentials; + $this->assertNotNull($credentials->accessToken); + $this->assertNotNull($credentials->refreshToken); + $this->assertEquals('bearer', $credentials->tokenType); + $this->assertNotNull($credentials->expiresAt); + } + + + public function testBuildConnectUrl() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $url = $gateway->oauth()->connectUrl([ + 'merchantId' => 'integration_merchant_id', + 'redirectUri' => 'http://bar.example.com', + 'scope' => 'read_write', + 'state' => 'baz_state', + 'landingPage' => 'login', + 'loginOnly' => 'true', + 'user' => [ + 'country' => 'USA', + 'email' => 'foo@example.com', + 'firstName' => 'Bob', + 'lastName' => 'Jones', + 'phone' => '555-555-5555', + 'dobYear' => '1970', + 'dobMonth' => '01', + 'dobDay' => '01', + 'streetAddress' => '222 W Merchandise Mart', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60606', + ], + 'business' => [ + 'name' => '14 Ladders', + 'registeredAs' => '14.0 Ladders', + 'industry' => 'Ladders', + 'description' => 'We sell the best ladders', + 'streetAddress' => '111 N Canal', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60606', + 'country' => 'USA', + 'annualVolumeAmount' => '1000000', + 'averageTransactionAmount' => '100', + 'maximumTransactionAmount' => '10000', + 'shipPhysicalGoods' => true, + 'fulfillmentCompletedIn' => 7, + 'currency' => 'USD', + 'website' => 'http://example.com', + ], + 'paymentMethods' => ['credit_card'], + ]); + + $components = parse_url($url); + $queryString = $components['query']; + parse_str($queryString, $query); + + $this->assertEquals('localhost', $components['host']); + $this->assertEquals('/oauth/connect', $components['path']); + $this->assertEquals('integration_merchant_id', $query['merchant_id']); + $this->assertEquals('client_id$development$integration_client_id', $query['client_id']); + $this->assertEquals('http://bar.example.com', $query['redirect_uri']); + $this->assertEquals('read_write', $query['scope']); + $this->assertEquals('baz_state', $query['state']); + $this->assertEquals('login', $query['landing_page']); + $this->assertEquals('true', $query['login_only']); + + $this->assertEquals('USA', $query['user']['country']); + $this->assertEquals('foo@example.com', $query['user']['email']); + $this->assertEquals('Bob', $query['user']['first_name']); + $this->assertEquals('Jones', $query['user']['last_name']); + $this->assertEquals('555-555-5555', $query['user']['phone']); + $this->assertEquals('1970', $query['user']['dob_year']); + $this->assertEquals('01', $query['user']['dob_month']); + $this->assertEquals('01', $query['user']['dob_day']); + $this->assertEquals('222 W Merchandise Mart', $query['user']['street_address']); + $this->assertEquals('Chicago', $query['user']['locality']); + $this->assertEquals('IL', $query['user']['region']); + $this->assertEquals('60606', $query['user']['postal_code']); + + $this->assertEquals('14 Ladders', $query['business']['name']); + $this->assertEquals('14.0 Ladders', $query['business']['registered_as']); + $this->assertEquals('Ladders', $query['business']['industry']); + $this->assertEquals('We sell the best ladders', $query['business']['description']); + $this->assertEquals('111 N Canal', $query['business']['street_address']); + $this->assertEquals('Chicago', $query['business']['locality']); + $this->assertEquals('IL', $query['business']['region']); + $this->assertEquals('60606', $query['business']['postal_code']); + $this->assertEquals('USA', $query['business']['country']); + $this->assertEquals('1000000', $query['business']['annual_volume_amount']); + $this->assertEquals('100', $query['business']['average_transaction_amount']); + $this->assertEquals('10000', $query['business']['maximum_transaction_amount']); + $this->assertEquals(true, $query['business']['ship_physical_goods']); + $this->assertEquals(7, $query['business']['fulfillment_completed_in']); + $this->assertEquals('USD', $query['business']['currency']); + $this->assertEquals('http://example.com', $query['business']['website']); + + $this->assertCount(1, $query['payment_methods']); + $this->assertEquals('credit_card', $query['payment_methods'][0]); + } + + public function testBuildConnectUrlWithoutOptionalParams() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $url = $gateway->oauth()->connectUrl(); + + $queryString = parse_url($url)['query']; + parse_str($queryString, $query); + + $this->assertEquals('client_id$development$integration_client_id', $query['client_id']); + $this->assertArrayNotHasKey('merchant_id', $query); + $this->assertArrayNotHasKey('redirect_uri', $query); + $this->assertArrayNotHasKey('scope', $query); + } + + public function testBuildConnectUrlWithPaymentMethods() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $url = $gateway->oauth()->connectUrl([ + 'paymentMethods' => ['credit_card', 'paypal'] + ]); + + $queryString = parse_url($url)['query']; + parse_str($queryString, $query); + + $this->assertEquals(['credit_card', 'paypal'], $query['payment_methods']); + } + + public function testComputeSignature() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + $urlToSign = 'http://localhost:3000/oauth/connect?business%5Bname%5D=We+Like+Spaces&client_id=client_id%24development%24integration_client_id'; + + $signature = $gateway->oauth()->computeSignature($urlToSign); + + $this->assertEquals("a36bcf10dd982e2e47e0d6a2cb930aea47ade73f954b7d59c58dae6167894d41", $signature); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PayPalAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PayPalAccountTest.php new file mode 100644 index 00000000000..52f505f4604 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PayPalAccountTest.php @@ -0,0 +1,309 @@ +nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $foundPayPalAccount = Braintree\PayPalAccount::find($paymentMethodToken); + + $this->assertSame('jane.doe@example.com', $foundPayPalAccount->email); + $this->assertSame($paymentMethodToken, $foundPayPalAccount->token); + $this->assertNotNull($foundPayPalAccount->imageUrl); + } + + public function testGatewayFind() + { + $paymentMethodToken = 'PAYPALToken-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $foundPayPalAccount = $gateway->paypalAccount()->find($paymentMethodToken); + + $this->assertSame('jane.doe@example.com', $foundPayPalAccount->email); + $this->assertSame($paymentMethodToken, $foundPayPalAccount->token); + $this->assertNotNull($foundPayPalAccount->imageUrl); + } + + public function testFind_doesNotReturnIncorrectPaymentMethodType() + { + $creditCardToken = 'creditCardToken-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'token' => $creditCardToken + ]); + $this->assertTrue($result->success); + + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PayPalAccount::find($creditCardToken); + } + + public function test_PayPalAccountExposesTimestamps() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$paypalFuturePayment, + ]); + $this->assertTrue($result->success); + + $this->assertNotNull($result->paymentMethod->createdAt); + $this->assertNotNull($result->paymentMethod->updatedAt); + } + + public function test_PayPalAccountExposesBillingAgreementId() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$paypalBillingAgreement + ]); + $this->assertTrue($result->success); + + $foundPayPalAccount = Braintree\PayPalAccount::find($result->paymentMethod->token); + + $this->assertNotNull($foundPayPalAccount->billingAgreementId); + } + + public function testFind_throwsIfCannotBeFound() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PayPalAccount::find('invalid-token'); + } + + public function testFind_throwsUsefulErrorMessagesWhenEmpty() + { + $this->setExpectedException('InvalidArgumentException', 'expected paypal account id to be set'); + Braintree\PayPalAccount::find(''); + } + + public function testFind_throwsUsefulErrorMessagesWhenInvalid() + { + $this->setExpectedException('InvalidArgumentException', '@ is an invalid paypal account token'); + Braintree\PayPalAccount::find('@'); + } + + public function testFind_returnsSubscriptionsAssociatedWithAPaypalAccount() + { + $customer = Braintree\Customer::createNoValidate(); + $paymentMethodToken = 'paypal-account-' . strval(rand()); + + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'consent-code', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id + ]); + $this->assertTrue($result->success); + + $token = $result->paymentMethod->token; + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $subscription1 = Braintree\Subscription::create([ + 'paymentMethodToken' => $token, + 'planId' => $triallessPlan['id'] + ])->subscription; + + $subscription2 = Braintree\Subscription::create([ + 'paymentMethodToken' => $token, + 'planId' => $triallessPlan['id'] + ])->subscription; + + $paypalAccount = Braintree\PayPalAccount::find($token); + $getIds = function($sub) { return $sub->id; }; + $subIds = array_map($getIds, $paypalAccount->subscriptions); + $this->assertTrue(in_array($subscription1->id, $subIds)); + $this->assertTrue(in_array($subscription2->id, $subIds)); + } + + public function testUpdate() + { + $originalToken = 'ORIGINAL_PAYPALToken-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $originalToken + ] + ]); + + $createResult = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($createResult->success); + + $newToken = 'NEW_PAYPALToken-' . strval(rand()); + $updateResult = Braintree\PayPalAccount::update($originalToken, [ + 'token' => $newToken + ]); + + $this->assertTrue($updateResult->success); + $this->assertEquals($newToken, $updateResult->paypalAccount->token); + + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PayPalAccount::find($originalToken); + + } + + public function testUpdateAndMakeDefault() + { + $customer = Braintree\Customer::createNoValidate(); + + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ]); + $this->assertTrue($creditCardResult->success); + + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE' + ] + ]); + + $createResult = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($createResult->success); + + $updateResult = Braintree\PayPalAccount::update($createResult->paymentMethod->token, [ + 'options' => ['makeDefault' => true] + ]); + + $this->assertTrue($updateResult->success); + $this->assertTrue($updateResult->paypalAccount->isDefault()); + } + + public function testUpdate_handleErrors() + { + $customer = Braintree\Customer::createNoValidate(); + + $firstToken = 'FIRST_PAYPALToken-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $firstNonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $firstToken + ] + ]); + $firstPaypalAccount = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $firstNonce + ]); + $this->assertTrue($firstPaypalAccount->success); + + $secondToken = 'SECOND_PAYPALToken-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $secondNonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $secondToken + ] + ]); + $secondPaypalAccount = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $secondNonce + ]); + $this->assertTrue($secondPaypalAccount->success); + + $updateResult = Braintree\PayPalAccount::update($firstToken, [ + 'token' => $secondToken + ]); + + $this->assertFalse($updateResult->success); + $errors = $updateResult->errors->forKey('paypalAccount')->errors; + $this->assertEquals(Braintree\Error\Codes::PAYPAL_ACCOUNT_TOKEN_IS_IN_USE, $errors[0]->code); + } + + public function testDelete() + { + $paymentMethodToken = 'PAYPALToken-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + Braintree\PayPalAccount::delete($paymentMethodToken); + + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PayPalAccount::find($paymentMethodToken); + } + + public function testSale_createsASaleUsingGivenToken() + { + $nonce = Braintree\Test\Nonces::$paypalFuturePayment; + $customer = Braintree\Customer::createNoValidate([ + 'paymentMethodNonce' => $nonce + ]); + $paypalAccount = $customer->paypalAccounts[0]; + + $result = Braintree\PayPalAccount::sale($paypalAccount->token, [ + 'amount' => '100.00' + ]); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals($customer->id, $result->transaction->customerDetails->id); + $this->assertEquals($paypalAccount->token, $result->transaction->paypalDetails->token); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodNonceTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodNonceTest.php new file mode 100644 index 00000000000..af169037a1f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodNonceTest.php @@ -0,0 +1,184 @@ + $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ])->creditCard; + + $result = Braintree\PaymentMethodNonce::create($card->token); + + $this->assertTrue($result->success); + $this->assertNotNull($result->paymentMethodNonce); + $this->assertNotNull($result->paymentMethodNonce->nonce); + } + + public function testCreate_fromNonExistentPaymentMethodToken() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethodNonce::create('not_a_token'); + } + + public function testFind_exposesVenmoDetails() + { + $foundNonce = Braintree\PaymentMethodNonce::find('fake-venmo-account-nonce'); + $details = $foundNonce->details; + + $this->assertEquals('99', $details['lastTwo']); + $this->assertEquals('venmojoe', $details['username']); + $this->assertEquals('Venmo-Joe-1', $details['venmoUserId']); + } + + public function testFind_exposesThreeDSecureInfo() + { + $creditCard = [ + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '12', + 'expirationYear' => '2020' + ] + ]; + $nonce = Helper::generate3DSNonce($creditCard); + $foundNonce = Braintree\PaymentMethodNonce::find($nonce); + $info = $foundNonce->threeDSecureInfo; + + $this->assertEquals($nonce, $foundNonce->nonce); + $this->assertEquals('CreditCard', $foundNonce->type); + $this->assertEquals('Y', $info->enrolled); + $this->assertEquals('authenticate_successful', $info->status); + $this->assertTrue($info->liabilityShifted); + $this->assertTrue($info->liabilityShiftPossible); + } + + public function testFind_returnsBin() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableVisa); + $this->assertEquals("401288", $nonce->details["bin"]); + } + + public function testFind_exposesBinData() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableVisa); + $this->assertEquals(Braintree\Test\Nonces::$transactableVisa, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $binData = $nonce->binData; + $this->assertEquals(Braintree\CreditCard::COMMERCIAL_UNKNOWN, $binData->commercial); + $this->assertEquals(Braintree\CreditCard::DEBIT_UNKNOWN, $binData->debit); + $this->assertEquals(Braintree\CreditCard::DURBIN_REGULATED_UNKNOWN, $binData->durbinRegulated); + $this->assertEquals(Braintree\CreditCard::HEALTHCARE_UNKNOWN, $binData->healthcare); + $this->assertEquals(Braintree\CreditCard::PAYROLL_UNKNOWN, $binData->payroll); + $this->assertEquals(Braintree\CreditCard::PREPAID_NO, $binData->prepaid); + $this->assertEquals("Unknown", $binData->issuingBank); + $this->assertEquals("Unknown", $binData->productId); + } + + public function testFind_returnsBinDataForCommercialNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableCommercial); + $this->assertEquals(Braintree\Test\Nonces::$transactableCommercial, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals(Braintree\CreditCard::COMMERCIAL_YES, $nonce->binData->commercial); + } + + public function testFind_returnsBinDataForDebitNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableDebit); + $this->assertEquals(Braintree\Test\Nonces::$transactableDebit, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals(Braintree\CreditCard::DEBIT_YES, $nonce->binData->debit); + } + + public function testFind_returnsBinDataForDurbinRegulatedNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableDurbinRegulated); + $this->assertEquals(Braintree\Test\Nonces::$transactableDurbinRegulated, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals(Braintree\CreditCard::DURBIN_REGULATED_YES, $nonce->binData->durbinRegulated); + } + + public function testFind_returnsBinDataForHealthcareNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableHealthcare); + $this->assertEquals(Braintree\Test\Nonces::$transactableHealthcare, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals(Braintree\CreditCard::HEALTHCARE_YES, $nonce->binData->healthcare); + } + + public function testFind_returnsBinDataForPayrollNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactablePayroll); + $this->assertEquals(Braintree\Test\Nonces::$transactablePayroll, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals(Braintree\CreditCard::PAYROLL_YES, $nonce->binData->payroll); + } + + public function testFind_returnsBinDataForPrepaidNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactablePrepaid); + $this->assertEquals(Braintree\Test\Nonces::$transactablePrepaid, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals(Braintree\CreditCard::PREPAID_YES, $nonce->binData->prepaid); + } + + public function testFind_returnsBinDataForCountryOfIssuanceNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableCountryOfIssuanceUSA); + $this->assertEquals(Braintree\Test\Nonces::$transactableCountryOfIssuanceUSA, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals("USA", $nonce->binData->countryOfIssuance); + } + + public function testFind_returnsBinDataForIssuingBankNonce() + { + $nonce = Braintree\PaymentMethodNonce::find(Braintree\Test\Nonces::$transactableIssuingBankNetworkOnly); + $this->assertEquals(Braintree\Test\Nonces::$transactableIssuingBankNetworkOnly, $nonce->nonce); + $this->assertEquals('CreditCard', $nonce->type); + $this->assertNotNull($nonce->binData); + $this->assertEquals("NETWORK ONLY", $nonce->binData->issuingBank); + } + + public function testFind_exposesNullThreeDSecureInfoIfNoneExists() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ] + ]); + + $foundNonce = Braintree\PaymentMethodNonce::find($nonce); + $info = $foundNonce->threeDSecureInfo; + + $this->assertEquals($nonce, $foundNonce->nonce); + $this->assertNull($info); + } + + public function testFind_nonExistantNonce() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethodNonce::find('not_a_nonce'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodTest.php new file mode 100644 index 00000000000..523b3d9f7d7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodTest.php @@ -0,0 +1,1881 @@ +nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '11', + 'expirationYear' => '2099' + ], + 'share' => true + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertSame('411111', $result->paymentMethod->bin); + $this->assertSame('1111', $result->paymentMethod->last4); + $this->assertNotNull($result->paymentMethod->token); + $this->assertNotNull($result->paymentMethod->imageUrl); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + } + + public function testGatewayCreate_fromVaultedCreditCardNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '11', + 'expirationYear' => '2099' + ], + 'share' => true + ]); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertSame('411111', $result->paymentMethod->bin); + $this->assertSame('1111', $result->paymentMethod->last4); + $this->assertNotNull($result->paymentMethod->token); + $this->assertNotNull($result->paymentMethod->imageUrl); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + } + + public function testCreate_fromFakeApplePayNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$applePayVisa, + ]); + + $this->assertTrue($result->success); + $applePayCard = $result->paymentMethod; + $this->assertNotNull($applePayCard->token); + $this->assertNotNull($applePayCard->bin); + $this->assertSame(Braintree\ApplePayCard::VISA, $applePayCard->cardType); + $this->assertContains("Visa ", $applePayCard->paymentInstrumentName); + $this->assertContains("Visa ", $applePayCard->sourceDescription); + $this->assertTrue($applePayCard->default); + $this->assertContains('apple_pay', $applePayCard->imageUrl); + $this->assertTrue(intval($applePayCard->expirationMonth) > 0); + $this->assertTrue(intval($applePayCard->expirationYear) > 0); + $this->assertSame($customer->id, $applePayCard->customerId); + } + + public function testCreate_fromFakeAndroidPayProxyCardNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$androidPayDiscover + ]); + + $this->assertTrue($result->success); + $androidPayCard = $result->paymentMethod; + $this->assertNotNull($androidPayCard->token); + $this->assertSame(Braintree\CreditCard::DISCOVER, $androidPayCard->virtualCardType); + $this->assertSame(Braintree\CreditCard::DISCOVER, $androidPayCard->cardType); + $this->assertSame("1117", $androidPayCard->virtualCardLast4); + $this->assertSame("1117", $androidPayCard->last4); + $this->assertSame(Braintree\CreditCard::DISCOVER, $androidPayCard->sourceCardType); + $this->assertSame("1111", $androidPayCard->sourceCardLast4); + $this->assertSame("Discover 1111", $androidPayCard->sourceDescription); + $this->assertTrue($androidPayCard->default); + $this->assertContains('android_pay', $androidPayCard->imageUrl); + $this->assertTrue(intval($androidPayCard->expirationMonth) > 0); + $this->assertTrue(intval($androidPayCard->expirationYear) > 0); + $this->assertSame($customer->id, $androidPayCard->customerId); + } + + public function testCreate_fromFakeAndroidPayNetworkTokenNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$androidPayMasterCard + ]); + + $this->assertTrue($result->success); + $androidPayCard = $result->paymentMethod; + $this->assertNotNull($androidPayCard->token); + $this->assertSame(Braintree\CreditCard::MASTER_CARD, $androidPayCard->virtualCardType); + $this->assertSame(Braintree\CreditCard::MASTER_CARD, $androidPayCard->cardType); + $this->assertSame("4444", $androidPayCard->virtualCardLast4); + $this->assertSame("4444", $androidPayCard->last4); + $this->assertSame(Braintree\CreditCard::MASTER_CARD, $androidPayCard->sourceCardType); + $this->assertSame("4444", $androidPayCard->sourceCardLast4); + $this->assertSame("MasterCard 4444", $androidPayCard->sourceDescription); + $this->assertTrue($androidPayCard->default); + $this->assertContains('android_pay', $androidPayCard->imageUrl); + $this->assertTrue(intval($androidPayCard->expirationMonth) > 0); + $this->assertTrue(intval($androidPayCard->expirationYear) > 0); + $this->assertSame($customer->id, $androidPayCard->customerId); + } + + public function testCreate_fromFakeAmexExpressCheckoutCardNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$amexExpressCheckout + ]); + + $this->assertTrue($result->success); + $amexExpressCheckoutCard = $result->paymentMethod; + $this->assertInstanceOf('Braintree\AmexExpressCheckoutCard', $amexExpressCheckoutCard); + + $this->assertNotNull($amexExpressCheckoutCard->token); + $this->assertSame(Braintree\CreditCard::AMEX, $amexExpressCheckoutCard->cardType); + $this->assertSame("341111", $amexExpressCheckoutCard->bin); + $this->assertSame("12/21", $amexExpressCheckoutCard->cardMemberExpiryDate); + $this->assertSame("0005", $amexExpressCheckoutCard->cardMemberNumber); + $this->assertSame("American Express", $amexExpressCheckoutCard->cardType); + $this->assertNotNull($amexExpressCheckoutCard->sourceDescription); + $this->assertContains(".png", $amexExpressCheckoutCard->imageUrl); + $this->assertTrue(intval($amexExpressCheckoutCard->expirationMonth) > 0); + $this->assertTrue(intval($amexExpressCheckoutCard->expirationYear) > 0); + $this->assertTrue($amexExpressCheckoutCard->default); + $this->assertSame($customer->id, $amexExpressCheckoutCard->customerId); + $this->assertEquals([], $amexExpressCheckoutCard->subscriptions); + } + + public function testCreate_fromFakeVenmoAccountNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create(array( + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$venmoAccount + )); + + $this->assertTrue($result->success); + $venmoAccount = $result->paymentMethod; + $this->assertInstanceOf('Braintree\VenmoAccount', $venmoAccount); + + $this->assertNotNull($venmoAccount->token); + $this->assertNotNull($venmoAccount->sourceDescription); + $this->assertContains(".png", $venmoAccount->imageUrl); + $this->assertTrue($venmoAccount->default); + $this->assertSame($customer->id, $venmoAccount->customerId); + $this->assertEquals(array(), $venmoAccount->subscriptions); + $this->assertSame("venmojoe", $venmoAccount->username); + $this->assertSame("Venmo-Joe-1", $venmoAccount->venmoUserId); + } + + public function testCreate_fromUnvalidatedCreditCardNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '11', + 'expirationYear' => '2099', + 'options' => [ + 'validate' => false + ] + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertSame('411111', $result->paymentMethod->bin); + $this->assertSame('1111', $result->paymentMethod->last4); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + $this->assertNotNull($result->paymentMethod->token); + } + + public function testCreate_fromUnvalidatedFuturePaypalAccountNonce() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertSame('jane.doe@example.com', $result->paymentMethod->email); + $this->assertSame($paymentMethodToken, $result->paymentMethod->token); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + } + + public function testCreate_fromOrderPaymentPaypalAccountNonce() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + 'token' => $paymentMethodToken, + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertSame('bt_buyer_us@paypal.com', $result->paymentMethod->email); + $this->assertSame($paymentMethodToken, $result->paymentMethod->token); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + $this->assertNotNull($result->paymentMethod->payerId); + } + + public function testCreate_fromOrderPaymentPaypalAccountNonceWithPayPalOptionsSnakeCase() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + 'token' => $paymentMethodToken, + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'paypal' => [ + 'payee_email' => 'payee@example.com', + 'order_id' => 'merchant-order-id', + 'custom_field' => 'custom merchant field', + 'description' => 'merchant description', + 'amount' => '1.23', + ] + ], + ]); + + $this->assertSame('bt_buyer_us@paypal.com', $result->paymentMethod->email); + $this->assertSame($paymentMethodToken, $result->paymentMethod->token); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + $this->assertNotNull($result->paymentMethod->payerId); + } + + public function testCreate_fromOrderPaymentPaypalAccountNonceWithPayPalOptionsCamelCase() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'intent' => 'order', + 'payment_token' => 'paypal-payment-token', + 'payer_id' => 'paypal-payer-id', + 'token' => $paymentMethodToken, + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'paypal' => [ + 'payeeEmail' => 'payee@example.com', + 'orderId' => 'merchant-order-id', + 'customField' => 'custom merchant field', + 'description' => 'merchant description', + 'amount' => '1.23', + 'shipping' => [ + 'firstName' => 'Andrew', + 'lastName' => 'Mason', + 'company' => 'Braintree', + 'streetAddress' => '456 W Main St', + 'extendedAddress' => 'Apt 2F', + 'locality' => 'Bartlett', + 'region' => 'IL', + 'postalCode' => '60103', + 'countryName' => 'United States of America', + 'countryCodeAlpha2' => 'US', + 'countryCodeAlpha3' => 'USA', + 'countryCodeNumeric' => '840' + ], + ], + ], + ]); + + $this->assertSame('bt_buyer_us@paypal.com', $result->paymentMethod->email); + $this->assertSame($paymentMethodToken, $result->paymentMethod->token); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + $this->assertNotNull($result->paymentMethod->payerId); + } + + public function testCreate_fromPayPalRefreshToken() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paypalRefreshToken' => 'PAYPAL_REFRESH_TOKEN', + ]); + + $this->assertSame($customer->id, $result->paymentMethod->customerId); + $this->assertSame("B_FAKE_ID", $result->paymentMethod->billingAgreementId); + $this->assertNotNull($result->paymentMethod->payerId); + } + + public function testCreate_fromPayPalRefreshTokenWithoutUpgrade() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paypalRefreshToken' => 'PAYPAL_REFRESH_TOKEN', + 'paypalVaultWithoutUpgrade' => true, + ]); + + $this->assertSame($customer->id, $result->paymentMethod->customerId); + $this->assertNull($result->paymentMethod->billingAgreementId); + } + + public function testCreate_fromAbstractPaymentMethodNonce() + { + $customer = Braintree\Customer::createNoValidate(); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$abstractTransactable, + ]); + + $this->assertTrue($result->success); + $this->assertNotNull($result->paymentMethod->token); + $this->assertSame($customer->id, $result->paymentMethod->customerId); + } + + public function testCreate_doesNotWorkForUnvalidatedOnetimePaypalAccountNonce() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'access_token' => 'PAYPAL_ACCESS_TOKEN', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('paypalAccount')->errors; + $this->assertEquals(Braintree\Error\Codes::PAYPAL_ACCOUNT_CANNOT_VAULT_ONE_TIME_USE_PAYPAL_ACCOUNT, $errors[0]->code); + } + + public function testCreate_handlesValidationErrorsForPayPalAccounts() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('paypalAccount')->errors; + $this->assertEquals(Braintree\Error\Codes::PAYPAL_ACCOUNT_CANNOT_VAULT_ONE_TIME_USE_PAYPAL_ACCOUNT, $errors[0]->code); + $this->assertEquals(Braintree\Error\Codes::PAYPAL_ACCOUNT_CONSENT_CODE_OR_ACCESS_TOKEN_IS_REQUIRED, $errors[1]->code); + } + + public function testCreate_allowsPassingDefaultOptionWithNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $card1 = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + + $this->assertTrue($card1->isDefault()); + + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '11', + 'expirationYear' => '2099', + 'options' => [ + 'validate' => false + ] + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'makeDefault' => true + ] + ]); + + $card2 = $result->paymentMethod; + $card1 = Braintree\CreditCard::find($card1->token); + $this->assertFalse($card1->isDefault()); + $this->assertTrue($card2->isDefault()); + } + + public function testCreate_overridesNonceToken() + { + $customer = Braintree\Customer::createNoValidate(); + $firstToken = 'FIRST_TOKEN-' . strval(rand()); + $secondToken = 'SECOND_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'token' => $firstToken, + 'number' => '4111111111111111', + 'expirationMonth' => '11', + 'expirationYear' => '2099', + 'options' => [ + 'validate' => false + ] + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'token' => $secondToken + ]); + + $card = $result->paymentMethod; + $this->assertEquals($secondToken, $card->token); + } + + public function testCreateWithVerificationAmount() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4000111111111115', + 'expirationMonth' => '11', + 'expirationYear' => '2099', + ] + ]); + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'options' => [ + 'verifyCard' => 'true', + 'verificationAmount' => '5.00', + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + } + + public function testCreate_respectsVerifyCardAndVerificationMerchantAccountIdWhenIncludedOutsideOfTheNonce() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4000111111111115', + 'expirationMonth' => '11', + 'expirationYear' => '2099', + ] + ]); + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'options' => [ + 'verifyCard' => 'true', + 'verificationMerchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $result->creditCardVerification->status); + $this->assertEquals('2000', $result->creditCardVerification->processorResponseCode); + $this->assertEquals('Do Not Honor', $result->creditCardVerification->processorResponseText); + $this->assertEquals(Test\Helper::nonDefaultMerchantAccountId(), $result->creditCardVerification->merchantAccountId); + } + + public function testCreate_respectsFailOnDuplicatePaymentMethodWhenIncludedOutsideTheNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ]); + $this->assertTrue($result->success); + + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ] + ]); + $updateResult = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'options' => [ + 'failOnDuplicatePaymentMethod' => 'true', + ] + ]); + + $this->assertFalse($updateResult->success); + $resultErrors = $updateResult->errors->deepAll(); + $this->assertEquals("81724", $resultErrors[0]->code); + } + + public function testCreate_allowsPassingABillingAddressOutsideOfTheNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '12', + 'expirationYear' => '2020', + 'options' => [ + 'validate' => false + ] + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'billingAddress' => [ + 'streetAddress' => '123 Abc Way' + ] + ]); + + $this->assertTrue($result->success); + $this->assertTrue(is_a($result->paymentMethod, 'Braintree\CreditCard')); + $token = $result->paymentMethod->token; + + $foundCreditCard = Braintree\CreditCard::find($token); + $this->assertTrue(NULL != $foundCreditCard); + $this->assertEquals('123 Abc Way', $foundCreditCard->billingAddress->streetAddress); + } + + public function testCreate_overridesTheBillingAddressInTheNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '12', + 'expirationYear' => '2020', + 'options' => [ + 'validate' => false + ], + 'billingAddress' => [ + 'streetAddress' => '456 Xyz Way' + ] + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'billingAddress' => [ + 'streetAddress' => '123 Abc Way' + ] + ]); + + $this->assertTrue($result->success); + $this->assertTrue(is_a($result->paymentMethod, 'Braintree\CreditCard')); + $token = $result->paymentMethod->token; + + $foundCreditCard = Braintree\CreditCard::find($token); + $this->assertTrue(NULL != $foundCreditCard); + $this->assertEquals('123 Abc Way', $foundCreditCard->billingAddress->streetAddress); + } + + public function testCreate_doesNotOverrideTheBillingAddressForAVaultedCreditCard() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'customerId' => $customer->id, + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '12', + 'expirationYear' => '2020', + 'billingAddress' => [ + 'streetAddress' => '456 Xyz Way' + ] + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'billingAddress' => [ + 'streetAddress' => '123 Abc Way' + ] + ]); + + $this->assertTrue($result->success); + $this->assertTrue(is_a($result->paymentMethod, 'Braintree\CreditCard')); + $token = $result->paymentMethod->token; + + $foundCreditCard = Braintree\CreditCard::find($token); + $this->assertTrue(NULL != $foundCreditCard); + $this->assertEquals('456 Xyz Way', $foundCreditCard->billingAddress->streetAddress); + } + + public function testCreate_allowsPassingABillingAddressIdOutsideOfTheNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '4111111111111111', + 'expirationMonth' => '12', + 'expirationYear' => '2020', + 'options' => [ + 'validate' => false + ] + ] + ]); + + $address = Braintree\Address::create([ + 'customerId' => $customer->id, + 'firstName' => 'Bobby', + 'lastName' => 'Tables' + ])->address; + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'billingAddressId' => $address->id + ]); + + $this->assertTrue($result->success); + $this->assertTrue(is_a($result->paymentMethod, 'Braintree\CreditCard')); + $token = $result->paymentMethod->token; + + $foundCreditCard = Braintree\CreditCard::find($token); + $this->assertTrue(NULL != $foundCreditCard); + $this->assertEquals('Bobby', $foundCreditCard->billingAddress->firstName); + $this->assertEquals('Tables', $foundCreditCard->billingAddress->lastName); + } + + public function testCreate_doesNotReturnAnErrorIfCreditCardOptionsArePresentForAPaypalNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $originalToken = 'paypal-account-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPaypalAccount([ + 'paypalAccount' => [ + 'consentCode' => 'consent-code', + 'token' => $originalToken + ] + ]); + + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'options' => [ + 'verifyCard' => 'true', + 'failOnDuplicatePaymentMethod' => 'true', + 'verificationMerchantAccountId' => 'Not a Real Merchant Account Id' + ] + ]); + + $this->assertTrue($result->success); + } + + public function testCreate_ignoresPassedBillingAddressParamsForPaypalAccount() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPaypalAccount([ + 'paypalAccount' => [ + 'consentCode' => 'PAYPAL_CONSENT_CODE', + ] + ]); + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'billingAddress' => [ + 'streetAddress' => '123 Abc Way' + ] + ]); + + $this->assertTrue($result->success); + $this->assertTrue(is_a($result->paymentMethod, 'Braintree\PaypalAccount')); + $token = $result->paymentMethod->token; + + $foundPaypalAccount = Braintree\PaypalAccount::find($token); + $this->assertTrue(NULL != $foundPaypalAccount); + } + + public function testCreate_ignoresPassedBillingAddressIdForPaypalAccount() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPaypalAccount([ + 'paypalAccount' => [ + 'consentCode' => 'PAYPAL_CONSENT_CODE', + ] + ]); + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id, + 'billingAddressId' => 'address_id' + ]); + + $this->assertTrue($result->success); + $this->assertTrue(is_a($result->paymentMethod, 'Braintree\PaypalAccount')); + $token = $result->paymentMethod->token; + + $foundPaypalAccount = Braintree\PaypalAccount::find($token); + $this->assertTrue(NULL != $foundPaypalAccount); + } + + public function testCreate_acceptsNumberAndOtherCreditCardParameters() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$transactable, + 'cardholderName' => 'Jane Doe', + 'cvv' => '123', + 'expirationMonth' => '10', + 'expirationYear' => '24', + 'number' => '4242424242424242' + ]); + + $this->assertTrue($result->success); + $this->assertTrue('Jane Doe' == $result->paymentMethod->cardholderName); + $this->assertTrue('10' == $result->paymentMethod->expirationMonth); + $this->assertTrue('2024' == $result->paymentMethod->expirationYear); + $this->assertTrue('424242' == $result->paymentMethod->bin); + $this->assertTrue('4242' == $result->paymentMethod->last4); + } + + public function testCreate_acceptAccountTypeCredit() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationMonth' => '11', + 'expirationYear' => '2099', + ], + 'share' => true + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'credit' + ] + ]); + + $this->assertSame('credit', $result->paymentMethod->verification->creditCard['accountType']); + } + + public function testCreate_acceptAccountTypeDebit() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationMonth' => '11', + 'expirationYear' => '2099', + ], + 'share' => true + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'debit' + ] + ]); + + $this->assertSame('debit', $result->paymentMethod->verification->creditCard['accountType']); + } + + public function testUpdate_acceptAccountTypeCredit() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'cardholderName' => 'Original Holder', + 'customerId' => $customer->id, + 'cvv' => '123', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'cardholderName' => 'New Holder', + 'cvv' => '456', + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '06/2013', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'credit' + ] + ]); + + $this->assertTrue($updateResult->success); + $this->assertSame($updateResult->paymentMethod->token, $creditCard->token); + $this->assertSame('credit', $updateResult->paymentMethod->verification->creditCard['accountType']); + } + + public function testUpdate_acceptAccountTypeDebit() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'cardholderName' => 'Original Holder', + 'customerId' => $customer->id, + 'cvv' => '123', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'cardholderName' => 'New Holder', + 'cvv' => '456', + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationDate' => '06/2013', + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'debit' + ] + ]); + + $this->assertTrue($updateResult->success); + $this->assertSame($updateResult->paymentMethod->token, $creditCard->token); + $this->assertSame('debit', $updateResult->paymentMethod->verification->creditCard['accountType']); + } + + public function testCreate_ErrorsWithVerificationAccountTypeIsInvalid() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationMonth' => '11', + 'expirationYear' => '2099', + ], + 'share' => true + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'verifyCard' => true, + 'verificationMerchantAccountId' => 'hiper_brl', + 'verificationAccountType' => 'wrong' + ] + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('creditCard')->forKey('options')->onAttribute('verificationAccountType'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_OPTIONS_VERIFICATION_ACCOUNT_TYPE_IS_INVALID, $errors[0]->code); + } + + public function testCreate_ErrorsWithVerificationAccountTypeNotSupported() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + 'credit_card' => [ + 'number' => '5105105105105100', + 'expirationMonth' => '11', + 'expirationYear' => '2099', + ], + 'share' => true + ]); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'verifyCard' => true, + 'verificationAccountType' => 'wrong' + ] + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('creditCard')->forKey('options')->onAttribute('verificationAccountType'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_OPTIONS_VERIFICATION_ACCOUNT_TYPE_NOT_SUPPORTED, $errors[0]->code); + } + + public function testFind_returnsCreditCards() + { + $paymentMethodToken = 'CREDIT_CARD_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'token' => $paymentMethodToken + ]); + $this->assertTrue($creditCardResult->success); + + $foundCreditCard = Braintree\PaymentMethod::find($creditCardResult->creditCard->token); + + $this->assertEquals($paymentMethodToken, $foundCreditCard->token); + $this->assertEquals('510510', $foundCreditCard->bin); + $this->assertEquals('5100', $foundCreditCard->last4); + $this->assertEquals('05/2011', $foundCreditCard->expirationDate); + } + + public function testFind_returnsCreditCardsWithSubscriptions() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + ]); + $this->assertTrue($creditCardResult->success); + + $subscriptionId = strval(rand()); + Braintree\Subscription::create([ + 'id' => $subscriptionId, + 'paymentMethodToken' => $creditCardResult->creditCard->token, + 'planId' => 'integration_trialless_plan', + 'price' => '1.00' + ]); + + $foundCreditCard = Braintree\PaymentMethod::find($creditCardResult->creditCard->token); + $this->assertEquals($subscriptionId, $foundCreditCard->subscriptions[0]->id); + $this->assertEquals('integration_trialless_plan', $foundCreditCard->subscriptions[0]->planId); + $this->assertEquals('1.00', $foundCreditCard->subscriptions[0]->price); + } + + public function testFind_returnsPayPalAccounts() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $foundPayPalAccount = Braintree\PaymentMethod::find($paymentMethodToken); + + $this->assertSame('jane.doe@example.com', $foundPayPalAccount->email); + $this->assertSame($paymentMethodToken, $foundPayPalAccount->token); + } + + public function testFind_returnsApplePayCards() + { + $paymentMethodToken = 'APPLE_PAY-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $nonce = Braintree\Test\Nonces::$applePayVisa; + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'token' => $paymentMethodToken + ]); + + $foundApplePayCard = Braintree\PaymentMethod::find($paymentMethodToken); + + $this->assertSame($paymentMethodToken, $foundApplePayCard->token); + $this->assertInstanceOf('Braintree\ApplePayCard', $foundApplePayCard); + $this->assertTrue(intval($foundApplePayCard->expirationMonth) > 0); + $this->assertTrue(intval($foundApplePayCard->expirationYear) > 0); + } + + public function testFind_returnsAndroidPayCards() + { + $paymentMethodToken = 'ANDROID-PAY-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $nonce = Braintree\Test\Nonces::$androidPay; + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'token' => $paymentMethodToken + ]); + + $foundAndroidPayCard = Braintree\PaymentMethod::find($paymentMethodToken); + + $this->assertSame($paymentMethodToken, $foundAndroidPayCard->token); + $this->assertInstanceOf('Braintree\AndroidPayCard', $foundAndroidPayCard); + $this->assertSame(Braintree\CreditCard::DISCOVER, $foundAndroidPayCard->virtualCardType); + $this->assertSame("1117", $foundAndroidPayCard->virtualCardLast4); + $this->assertSame(Braintree\CreditCard::DISCOVER, $foundAndroidPayCard->sourceCardType); + $this->assertSame("1111", $foundAndroidPayCard->sourceCardLast4); + $this->assertSame($customer->id, $foundAndroidPayCard->customerId); + $this->assertTrue($foundAndroidPayCard->default); + $this->assertContains('android_pay', $foundAndroidPayCard->imageUrl); + $this->assertTrue(intval($foundAndroidPayCard->expirationMonth) > 0); + $this->assertTrue(intval($foundAndroidPayCard->expirationYear) > 0); + } + + public function testFind_returnsAbstractPaymentMethods() + { + $paymentMethodToken = 'ABSTRACT-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $nonce = Braintree\Test\Nonces::$abstractTransactable; + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'token' => $paymentMethodToken + ]); + + $foundPaymentMethod = Braintree\PaymentMethod::find($paymentMethodToken); + + $this->assertSame($paymentMethodToken, $foundPaymentMethod-> token); + } + + public function testFind_throwsIfCannotBeFound() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find('NON_EXISTENT_TOKEN'); + } + + public function testUpdate_updatesTheCreditCard() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'cardholderName' => 'Original Holder', + 'customerId' => $customer->id, + 'cvv' => '123', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'cardholderName' => 'New Holder', + 'cvv' => '456', + 'number' => Braintree\Test\CreditCardNumbers::$masterCard, + 'expirationDate' => "06/2013" + ]); + + $this->assertTrue($updateResult->success); + $this->assertSame($updateResult->paymentMethod->token, $creditCard->token); + $updatedCreditCard = $updateResult->paymentMethod; + $this->assertSame("New Holder", $updatedCreditCard->cardholderName); + $this->assertSame(substr(Braintree\Test\CreditCardNumbers::$masterCard, 0, 6), $updatedCreditCard->bin); + $this->assertSame(substr(Braintree\Test\CreditCardNumbers::$masterCard, -4), $updatedCreditCard->last4); + $this->assertSame("06/2013", $updatedCreditCard->expirationDate); + } + + public function testUpdate_createsANewBillingAddressByDefault() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012", + 'billingAddress' => [ + 'streetAddress' => '123 Nigeria Ave' + ] + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'billingAddress' => [ + 'region' => 'IL' + ] + ]); + + $this->assertTrue($updateResult->success); + $updatedCreditCard = $updateResult->paymentMethod; + $this->assertSame("IL", $updatedCreditCard->billingAddress->region); + $this->assertSame(NULL, $updatedCreditCard->billingAddress->streetAddress); + $this->assertFalse($creditCard->billingAddress->id == $updatedCreditCard->billingAddress->id); + } + + public function testUpdate_updatesTheBillingAddressIfOptionIsSpecified() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012", + 'billingAddress' => [ + 'streetAddress' => '123 Nigeria Ave' + ] + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'billingAddress' => [ + 'region' => 'IL', + 'options' => [ + 'updateExisting' => 'true' + ] + ], + ]); + + $this->assertTrue($updateResult->success); + $updatedCreditCard = $updateResult->paymentMethod; + $this->assertSame("IL", $updatedCreditCard->billingAddress->region); + $this->assertSame("123 Nigeria Ave", $updatedCreditCard->billingAddress->streetAddress); + $this->assertTrue($creditCard->billingAddress->id == $updatedCreditCard->billingAddress->id); + } + + public function testUpdate_updatesTheCountryViaCodes() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012", + 'billingAddress' => [ + 'streetAddress' => '123 Nigeria Ave' + ] + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'billingAddress' => [ + 'countryName' => 'American Samoa', + 'countryCodeAlpha2' => 'AS', + 'countryCodeAlpha3' => 'ASM', + 'countryCodeNumeric' => '016', + 'options' => [ + 'updateExisting' => 'true' + ] + ], + ]); + + $this->assertTrue($updateResult->success); + $updatedCreditCard = $updateResult->paymentMethod; + $this->assertSame("American Samoa", $updatedCreditCard->billingAddress->countryName); + $this->assertSame("AS", $updatedCreditCard->billingAddress->countryCodeAlpha2); + $this->assertSame("ASM", $updatedCreditCard->billingAddress->countryCodeAlpha3); + $this->assertSame("016", $updatedCreditCard->billingAddress->countryCodeNumeric); + } + + public function testUpdate_canPassExpirationMonthAndExpirationYear() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'number' => Braintree\Test\CreditCardNumbers::$masterCard, + 'expirationMonth' => "07", + 'expirationYear' => "2011" + ]); + + $this->assertTrue($updateResult->success); + $this->assertSame($updateResult->paymentMethod->token, $creditCard->token); + $updatedCreditCard = $updateResult->paymentMethod; + $this->assertSame("07", $updatedCreditCard->expirationMonth); + $this->assertSame("07", $updatedCreditCard->expirationMonth); + $this->assertSame("07/2011", $updatedCreditCard->expirationDate); + } + + public function testUpdate_verifiesTheUpdateIfOptionsVerifyCardIsTrue() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'cardholderName' => 'Original Holder', + 'customerId' => $customer->id, + 'cvv' => '123', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'cardholderName' => 'New Holder', + 'cvv' => '456', + 'number' => Braintree\Test\CreditCardNumbers::$failsSandboxVerification['MasterCard'], + 'expirationDate' => "06/2013", + 'options' => [ + 'verifyCard' => 'true' + ] + ]); + + $this->assertFalse($updateResult->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $updateResult->creditCardVerification->status); + $this->assertEquals(NULL, $updateResult->creditCardVerification->gatewayRejectionReason); + } + + public function testUpdate_canPassCustomVerificationAmount() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'cardholderName' => 'Card Holder', + 'customerId' => $customer->id, + 'cvv' => '123', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2020" + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'paymentMethodNonce' => Braintree\Test\Nonces::$processorDeclinedMasterCard, + 'options' => [ + 'verifyCard' => 'true', + 'verificationAmount' => '2.34' + ] + ]); + + $this->assertFalse($updateResult->success); + $this->assertEquals(Braintree\Result\CreditCardVerification::PROCESSOR_DECLINED, $updateResult->creditCardVerification->status); + $this->assertEquals(NULL, $updateResult->creditCardVerification->gatewayRejectionReason); + } + + public function testUpdate_canUpdateTheBillingAddress() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'cardholderName' => 'Original Holder', + 'customerId' => $customer->id, + 'cvv' => '123', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012', + 'billingAddress' => [ + 'firstName' => 'Old First Name', + 'lastName' => 'Old Last Name', + 'company' => 'Old Company', + 'streetAddress' => '123 Old St', + 'extendedAddress' => 'Apt Old', + 'locality' => 'Old City', + 'region' => 'Old State', + 'postalCode' => '12345', + 'countryName' => 'Canada' + ] + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'billingAddress' => [ + 'firstName' => 'New First Name', + 'lastName' => 'New Last Name', + 'company' => 'New Company', + 'streetAddress' => '123 New St', + 'extendedAddress' => 'Apt New', + 'locality' => 'New City', + 'region' => 'New State', + 'postalCode' => '56789', + 'countryName' => 'United States of America' + ] + ]); + + $this->assertTrue($updateResult->success); + $address = $updateResult->paymentMethod->billingAddress; + $this->assertSame('New First Name', $address->firstName); + $this->assertSame('New Last Name', $address->lastName); + $this->assertSame('New Company', $address->company); + $this->assertSame('123 New St', $address->streetAddress); + $this->assertSame('Apt New', $address->extendedAddress); + $this->assertSame('New City', $address->locality); + $this->assertSame('New State', $address->region); + $this->assertSame('56789', $address->postalCode); + $this->assertSame('United States of America', $address->countryName); + } + + public function testUpdate_returnsAnErrorIfInvalid() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'cardholderName' => 'Original Holder', + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2012" + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $updateResult = Braintree\PaymentMethod::update($creditCard->token, [ + 'cardholderName' => 'New Holder', + 'number' => 'invalid', + 'expirationDate' => "05/2014", + ]); + + $this->assertFalse($updateResult->success); + $numberErrors = $updateResult->errors->forKey('creditCard')->onAttribute('number'); + $this->assertEquals("Credit card number must be 12-19 digits.", $numberErrors[0]->message); + } + + public function testUpdate_canUpdateTheDefault() + { + $customer = Braintree\Customer::createNoValidate(); + + $creditCardResult1 = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2009" + ]); + $this->assertTrue($creditCardResult1->success); + $creditCard1 = $creditCardResult1->creditCard; + + $creditCardResult2 = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => "05/2009" + ]); + $this->assertTrue($creditCardResult2->success); + $creditCard2 = $creditCardResult2->creditCard; + + $this->assertTrue($creditCard1->default); + $this->assertFalse($creditCard2->default); + + + $updateResult = Braintree\PaymentMethod::update($creditCard2->token, [ + 'options' => [ + 'makeDefault' => 'true' + ] + ]); + $this->assertTrue($updateResult->success); + + $this->assertFalse(Braintree\PaymentMethod::find($creditCard1->token)->default); + $this->assertTrue(Braintree\PaymentMethod::find($creditCard2->token)->default); + } + + public function testUpdate_updatesAPaypalAccountsToken() + { + $customer = Braintree\Customer::createNoValidate(); + $originalToken = 'paypal-account-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'consent-code', + 'token' => $originalToken + ] + ]); + + $originalResult = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id + ]); + $this->assertTrue($originalResult->success); + + $originalPaypalAccount = $originalResult->paymentMethod; + + $updatedToken = 'UPDATED_TOKEN-' . strval(rand()); + $updateResult = Braintree\PaymentMethod::update($originalPaypalAccount->token, [ + 'token' => $updatedToken + ]); + $this->assertTrue($updateResult->success); + + $updatedPaypalAccount = Braintree\PaymentMethod::find($updatedToken); + $this->assertEquals($originalPaypalAccount->email, $updatedPaypalAccount->email); + + $this->setExpectedException('Braintree\Exception\NotFound', 'payment method with token ' . $originalToken . ' not found'); + Braintree\PaymentMethod::find($originalToken); + } + + public function testUpdate_canMakeAPaypalAccountTheDefaultPaymentMethod() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + 'options' => [ + 'makeDefault' => 'true' + ] + ]); + $this->assertTrue($creditCardResult->success); + $creditCard = $creditCardResult->creditCard; + + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'consent-code', + ] + ]); + + $originalToken = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $nonce, + 'customerId' => $customer->id + ])->paymentMethod->token; + + $updateResult = Braintree\PaymentMethod::update($originalToken, [ + 'options' => [ + 'makeDefault' => 'true' + ] + ]); + $this->assertTrue($updateResult->success); + + $updatedPaypalAccount = Braintree\PaymentMethod::find($originalToken); + $this->assertTrue($updatedPaypalAccount->default); + + } + + public function testUpdate_returnsAnErrorIfATokenForAccountIsUsedToAttemptAnUpdate() + { + $customer = Braintree\Customer::createNoValidate(); + $firstToken = 'paypal-account-' . strval(rand()); + $secondToken = 'paypal-account-' . strval(rand()); + + $http = new HttpClientApi(Braintree\Configuration::$global); + $firstNonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'consent-code', + 'token' => $firstToken + ] + ]); + $firstResult = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $firstNonce, + 'customerId' => $customer->id + ]); + $this->assertTrue($firstResult->success); + $firstPaypalAccount = $firstResult->paymentMethod; + + $http = new HttpClientApi(Braintree\Configuration::$global); + $secondNonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'consent-code', + 'token' => $secondToken + ] + ]); + $secondResult = Braintree\PaymentMethod::create([ + 'paymentMethodNonce' => $secondNonce, + 'customerId' => $customer->id + ]); + $this->assertTrue($secondResult->success); + $secondPaypalAccount = $firstResult->paymentMethod; + + + $updateResult = Braintree\PaymentMethod::update($firstToken, [ + 'token' => $secondToken + ]); + + $this->assertFalse($updateResult->success); + $resultErrors = $updateResult->errors->deepAll(); + $this->assertEquals("92906", $resultErrors[0]->code); + + } + + public function testDelete_worksWithCreditCards() + { + $paymentMethodToken = 'CREDIT_CARD_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $creditCardResult = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'token' => $paymentMethodToken + ]); + $this->assertTrue($creditCardResult->success); + + Braintree\PaymentMethod::delete($paymentMethodToken); + + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + self::integrationMerchantConfig(); + } + + public function testDelete_worksWithPayPalAccounts() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $paypalAccountResult = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($paypalAccountResult->success); + + Braintree\PaymentMethod::delete($paymentMethodToken, ['revokeAllGrants' => false]); + + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testGrant_returnsASingleUseNonce() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token); + $this->assertTrue($grantResult->success); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + $this->assertTrue($result->success); + + $secondResult = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + $this->assertFalse($secondResult->success); + } + + public function testGrant_returnsANonceThatIsNotVaultable() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, ['allow_vaulting' => false]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Bob', + 'lastName' => 'Rob' + ])->customer; + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + $this->assertFalse($result->success); + } + + public function testGrant_returnsANonceThatIsVaultableSnakeCase() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, ['allow_vaulting' => true]); + + $customer = Braintree\Customer::create([ + 'firstName' => 'Bob', + 'lastName' => 'Rob' + ])->customer; + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + $this->assertTrue($result->success); + } + + public function testGrant_returnsANonceThatIsVaultableCamelCase() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, ['allowVaulting' => true, 'includeBillingPostalCode' => true]); + + $customer = Braintree\Customer::create([ + 'firstName' => 'Bob', + 'lastName' => 'Rob' + ])->customer; + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + $this->assertTrue($result->success); + } + + public function testGrant_raisesAnErrorIfTokenIsNotFound() + { + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $this->setExpectedException('Braintree\Exception\NotFound'); + $grantResult = $grantingGateway->paymentMethod()->grant("not_a_real_token", false); + } + + public function testRevoke_rendersANonceUnusable() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, false); + $revokeResult = $grantingGateway->paymentMethod()->revoke($creditCard->token); + $this->assertTrue($revokeResult->success); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + $this->assertFalse($result->success); + } + + public function testRevoke_raisesAnErrorIfTokenIsNotFound() + { + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $this->setExpectedException('Braintree\Exception\NotFound'); + $grantResult = $grantingGateway->paymentMethod()->revoke("not_a_real_token"); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodWithUsBankAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodWithUsBankAccountTest.php new file mode 100644 index 00000000000..5ff95dfde2a --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PaymentMethodWithUsBankAccountTest.php @@ -0,0 +1,147 @@ + $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals('021000021', $usBankAccount->routingNumber); + $this->assertEquals('1234', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertRegexp('/CHASE/', $usBankAccount->bankName); + $this->assertEquals(true, $usBankAccount->verified); + + $this->assertEquals(1, count($usBankAccount->verifications)); + + $verification = $usBankAccount->verifications[0]; + + $this->assertEquals(Braintree\Result\UsBankAccountVerification::VERIFIED, $verification->status); + $this->assertEquals(Braintree\Result\UsBankAccountVerification::INDEPENDENT_CHECK, $verification->verificationMethod); + } + + public function testCreate_fromUsBankAccountNonceWithVerification() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce('1000000000'), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::NETWORK_CHECK, + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals('021000021', $usBankAccount->routingNumber); + $this->assertEquals('0000', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertRegexp('/CHASE/', $usBankAccount->bankName); + $this->assertEquals(true, $usBankAccount->verified); + + $this->assertEquals(1, count($usBankAccount->verifications)); + + $verification = $usBankAccount->verifications[0]; + + $this->assertEquals(Braintree\Result\UsBankAccountVerification::VERIFIED, $verification->status); + $this->assertEquals(Braintree\Result\UsBankAccountVerification::NETWORK_CHECK, $verification->verificationMethod); + } + + public function testCreate_fromPlaidUsBankAccountNonce() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generatePlaidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals('011000015', $usBankAccount->routingNumber); + $this->assertEquals('0000', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertRegexp('/FEDERAL/', $usBankAccount->bankName); + $this->assertEquals(true, $usBankAccount->verified); + + $this->assertEquals(1, count($usBankAccount->verifications)); + + $verification = $usBankAccount->verifications[0]; + + $this->assertEquals(Braintree\Result\UsBankAccountVerification::VERIFIED, $verification->status); + $this->assertEquals(Braintree\Result\UsBankAccountVerification::TOKENIZED_CHECK, $verification->verificationMethod); + } + + public function testFind_returnsUsBankAccount() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ]); + + $foundUsBankAccount = Braintree\PaymentMethod::find($result->paymentMethod->token); + $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount); + $this->assertEquals('021000021', $foundUsBankAccount->routingNumber); + $this->assertEquals('1234', $foundUsBankAccount->last4); + $this->assertEquals('checking', $foundUsBankAccount->accountType); + $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName); + $this->assertRegExp('/CHASE/', $foundUsBankAccount->bankName); + } + + public function testCompliantCreate_fromUsBankAccountNonce() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $customer = $gateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount() + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals('021000021', $usBankAccount->routingNumber); + $this->assertEquals('1234', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertRegexp('/CHASE/', $usBankAccount->bankName); + $this->assertEquals(false, $usBankAccount->verified); + + $this->assertEquals(0, count($usBankAccount->verifications)); + } + +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PlanTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PlanTest.php new file mode 100644 index 00000000000..c98c51cf8e1 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/PlanTest.php @@ -0,0 +1,132 @@ +assertEquals($plans, []); + self::integrationMerchantConfig(); + + } + + public function testAll_returnsAllPlans() + { + $newId = strval(rand()); + $params = [ + "id" => $newId, + "billingDayOfMonth" => "1", + "billingFrequency" => "1", + "currencyIsoCode" => "USD", + "description" => "some description", + "name" => "php test plan", + "numberOfBillingCycles" => "1", + "price" => "1.00", + "trialPeriod" => "false" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/plans/create_plan_for_tests'; + $http->post($path, ["plan" => $params]); + + $addOnParams = [ + "kind" => "add_on", + "plan_id" => $newId, + "amount" => "1.00", + "name" => "add_on_name" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/modifications/create_modification_for_tests'; + $http->post($path, ['modification' => $addOnParams]); + + $discountParams = [ + "kind" => "discount", + "plan_id" => $newId, + "amount" => "1.00", + "name" => "discount_name" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/modifications/create_modification_for_tests'; + $http->post($path, ["modification" => $discountParams]); + + $plans = Braintree\Plan::all(); + + foreach ($plans as $plan) + { + if ($plan->id == $newId) + { + $actualPlan = $plan; + } + } + + $this->assertNotNull($actualPlan); + $this->assertEquals($params["billingDayOfMonth"], $actualPlan->billingDayOfMonth); + $this->assertEquals($params["billingFrequency"], $actualPlan->billingFrequency); + $this->assertEquals($params["currencyIsoCode"], $actualPlan->currencyIsoCode); + $this->assertEquals($params["description"], $actualPlan->description); + $this->assertEquals($params["name"], $actualPlan->name); + $this->assertEquals($params["numberOfBillingCycles"], $actualPlan->numberOfBillingCycles); + $this->assertEquals($params["price"], $actualPlan->price); + + $addOn = $actualPlan->addOns[0]; + $this->assertEquals($addOnParams["name"], $addOn->name); + + $discount = $actualPlan->discounts[0]; + $this->assertEquals($discountParams["name"], $discount->name); + } + + public function testGatewayAll_returnsAllPlans() + { + $newId = strval(rand()); + $params = [ + "id" => $newId, + "billingDayOfMonth" => "1", + "billingFrequency" => "1", + "currencyIsoCode" => "USD", + "description" => "some description", + "name" => "php test plan", + "numberOfBillingCycles" => "1", + "price" => "1.00", + "trialPeriod" => "false" + ]; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/plans/create_plan_for_tests'; + $http->post($path, ["plan" => $params]); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $plans = $gateway->plan()->all(); + + foreach ($plans as $plan) + { + if ($plan->id == $newId) + { + $actualPlan = $plan; + } + } + + $this->assertNotNull($actualPlan); + $this->assertEquals($params["billingDayOfMonth"], $actualPlan->billingDayOfMonth); + $this->assertEquals($params["billingFrequency"], $actualPlan->billingFrequency); + $this->assertEquals($params["currencyIsoCode"], $actualPlan->currencyIsoCode); + $this->assertEquals($params["description"], $actualPlan->description); + $this->assertEquals($params["name"], $actualPlan->name); + $this->assertEquals($params["numberOfBillingCycles"], $actualPlan->numberOfBillingCycles); + $this->assertEquals($params["price"], $actualPlan->price); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Result/ErrorTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Result/ErrorTest.php new file mode 100644 index 00000000000..967011288f0 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/Result/ErrorTest.php @@ -0,0 +1,33 @@ + 'invalid-email', + 'creditCard' => [ + 'number' => 'invalid-number', + 'expirationDate' => 'invalid-exp', + 'billingAddress' => [ + 'countryName' => 'invalid-country' + ] + ], + 'customFields' => [ + 'store_me' => 'some custom value' + ] + ]); + $this->assertEquals(false, $result->success); + $this->assertEquals('invalid-email', $result->valueForHtmlField('customer[email]')); + $this->assertEquals('', $result->valueForHtmlField('customer[credit_card][number]')); + $this->assertEquals('invalid-exp', $result->valueForHtmlField('customer[credit_card][expiration_date]')); + $this->assertEquals('invalid-country', $result->valueForHtmlField('customer[credit_card][billing_address][country_name]')); + $this->assertEquals('some custom value', $result->valueForHtmlField('customer[custom_fields][store_me]')); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SamsungPayCardTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SamsungPayCardTest.php new file mode 100644 index 00000000000..885bfa188fe --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SamsungPayCardTest.php @@ -0,0 +1,190 @@ + $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$samsungPayDiscover, + 'cardholderName' => 'Jenny Block', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Suite 101', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'Micronesia', + 'countryCodeAlpha2' => 'FM', + 'countryCodeAlpha3' => 'FSM', + 'countryCodeNumeric' => '583' + ] + ]); + + $this->assertTrue($result->success); + $samsungPayCard = $result->paymentMethod; + $this->assertNotNull($samsungPayCard->token); + $this->assertSame(Braintree\CreditCard::DISCOVER, $samsungPayCard->cardType); + $this->assertTrue($samsungPayCard->default); + $this->assertContains('discover', $samsungPayCard->imageUrl); + $this->assertTrue(intval($samsungPayCard->expirationMonth) > 0); + $this->assertTrue(intval($samsungPayCard->expirationYear) > 0); + $this->assertSame($customer->id, $samsungPayCard->customerId); + $this->assertSame($samsungPayCard->last4, '1117'); + $this->assertSame($samsungPayCard->maskedNumber, '601111******1117'); + + $this->assertNotNull($samsungPayCard->billingAddress); + $this->assertNotNull($samsungPayCard->bin); + $this->assertNotNull($samsungPayCard->cardholderName); + $this->assertNotNull($samsungPayCard->cardType); + $this->assertNotNull($samsungPayCard->commercial); + $this->assertNotNull($samsungPayCard->countryOfIssuance); + $this->assertNotNull($samsungPayCard->createdAt); + $this->assertNotNull($samsungPayCard->customerId); + $this->assertNotNull($samsungPayCard->customerLocation); + $this->assertNotNull($samsungPayCard->debit); + $this->assertNotNull($samsungPayCard->default); + $this->assertNotNull($samsungPayCard->durbinRegulated); + $this->assertNotNull($samsungPayCard->expirationDate); + $this->assertNotNull($samsungPayCard->expirationMonth); + $this->assertNotNull($samsungPayCard->expirationYear); + $this->assertNotNull($samsungPayCard->expired); + $this->assertNotNull($samsungPayCard->healthcare); + $this->assertNotNull($samsungPayCard->imageUrl); + $this->assertNotNull($samsungPayCard->issuingBank); + $this->assertNotNull($samsungPayCard->last4); + $this->assertNotNull($samsungPayCard->maskedNumber); + $this->assertNotNull($samsungPayCard->payroll); + $this->assertNotNull($samsungPayCard->prepaid); + $this->assertNotNull($samsungPayCard->productId); + $this->assertNotNull($samsungPayCard->sourceCardLast4); + $this->assertNotNull($samsungPayCard->subscriptions); + $this->assertNotNull($samsungPayCard->token); + $this->assertNotNull($samsungPayCard->uniqueNumberIdentifier); + $this->assertNotNull($samsungPayCard->updatedAt); + } + + public function testCreateWithNameAndAddress() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$samsungPayDiscover, + 'cardholderName' => 'Jenny Block', + 'billingAddress' => [ + 'firstName' => 'Drew', + 'lastName' => 'Smith', + 'company' => 'Smith Co.', + 'streetAddress' => '1 E Main St', + 'extendedAddress' => 'Suite 101', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'Micronesia', + 'countryCodeAlpha2' => 'FM', + 'countryCodeAlpha3' => 'FSM', + 'countryCodeNumeric' => '583' + ] + ]); + + $this->assertTrue($result->success); + $samsungPayCard = $result->paymentMethod; + $this->assertEquals($samsungPayCard->cardholderName, 'Jenny Block'); + + $address = $samsungPayCard->billingAddress; + $this->assertEquals('Drew', $address->firstName); + $this->assertEquals('Smith', $address->lastName); + $this->assertEquals('Smith Co.', $address->company); + $this->assertEquals('1 E Main St', $address->streetAddress); + $this->assertEquals('Suite 101', $address->extendedAddress); + $this->assertEquals('Chicago', $address->locality); + $this->assertEquals('IL', $address->region); + $this->assertEquals('60622', $address->postalCode); + $this->assertEquals('Micronesia', $address->countryName); + $this->assertEquals('FM', $address->countryCodeAlpha2); + $this->assertEquals('FSM', $address->countryCodeAlpha3); + } + + public function testTransactionSearchWithSamsungPay() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => Braintree\Test\Nonces::$samsungPayDiscover, + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::paymentInstrumentType()->is(Braintree\PaymentInstrumentType::SAMSUNG_PAY_CARD) + ]); + + + $this->assertEquals($transaction->paymentInstrumentType, Braintree\PaymentInstrumentType::SAMSUNG_PAY_CARD); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function testCreateCustomerWithSamsungPayCard() + { + $nonce = Braintree\Test\Nonces::$samsungPayDiscover; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->samsungPayCards[0]); + $this->assertNotNull($customer->paymentMethods[0]); + } + + public function testCreateTransactionWithSamsungPayNonceAndVault() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$samsungPayAmEx, + 'options' => [ + 'storeInVault' => true + ], + 'creditCard' => [ + 'cardholderName' => 'Jenny Block' + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $samsungPayCardDetails = $transaction->samsungPayCardDetails; + $this->assertSame(Braintree\CreditCard::AMEX, $samsungPayCardDetails->cardType); + + $this->assertNotNull($samsungPayCardDetails->bin); + $this->assertNotNull($samsungPayCardDetails->cardholderName); + $this->assertNotNull($samsungPayCardDetails->cardType); + $this->assertNotNull($samsungPayCardDetails->commercial); + $this->assertNotNull($samsungPayCardDetails->countryOfIssuance); + $this->assertNotNull($samsungPayCardDetails->customerLocation); + $this->assertNotNull($samsungPayCardDetails->debit); + $this->assertNotNull($samsungPayCardDetails->durbinRegulated); + $this->assertNotNull($samsungPayCardDetails->expirationDate); + $this->assertNotNull($samsungPayCardDetails->expirationMonth); + $this->assertNotNull($samsungPayCardDetails->expirationYear); + $this->assertNotNull($samsungPayCardDetails->healthcare); + $this->assertNotNull($samsungPayCardDetails->imageUrl); + $this->assertNotNull($samsungPayCardDetails->issuingBank); + $this->assertNotNull($samsungPayCardDetails->last4); + $this->assertNotNull($samsungPayCardDetails->maskedNumber); + $this->assertNotNull($samsungPayCardDetails->payroll); + $this->assertNotNull($samsungPayCardDetails->prepaid); + $this->assertNotNull($samsungPayCardDetails->productId); + $this->assertNotNull($samsungPayCardDetails->sourceCardLast4); + $this->assertNotNull($samsungPayCardDetails->token); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SettlementBatchSummaryTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SettlementBatchSummaryTest.php new file mode 100644 index 00000000000..4a8c33f4c63 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SettlementBatchSummaryTest.php @@ -0,0 +1,95 @@ +assertTrue($result->success); + $this->assertEquals(0, count($result->settlementBatchSummary->records)); + } + + public function testGatewayGenerate_returnsAnEmptyCollectionWhenThereIsNoData() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->settlementBatchSummary()->generate('2000-01-01'); + + $this->assertTrue($result->success); + $this->assertEquals(0, count($result->settlementBatchSummary->records)); + } + + public function testGenerate_returnsAnErrorIfTheDateCanNotBeParsed() + { + $result = Braintree\SettlementBatchSummary::generate('OMG NOT A DATE'); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('settlementBatchSummary')->onAttribute('settlementDate'); + $this->assertEquals(Braintree\Error\Codes::SETTLEMENT_BATCH_SUMMARY_SETTLEMENT_DATE_IS_INVALID, $errors[0]->code); + } + + public function testGenerate_returnsTransactionsSettledOnAGivenDay() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => ['submitForSettlement' => true] + ]); + Braintree\Test\Transaction::settle($transaction->id); + + $today = new Datetime; + $result = Braintree\SettlementBatchSummary::generate(Test\Helper::nowInEastern()); + + $this->assertTrue($result->success); + $masterCardRecords = array_filter($result->settlementBatchSummary->records, 'self::isMasterCard'); + $masterCardKeys = array_keys($masterCardRecords); + $masterCardIndex = $masterCardKeys[0]; + $this->assertTrue(count($masterCardRecords) > 0); + $this->assertEquals(Braintree\CreditCard::MASTER_CARD, $masterCardRecords[$masterCardIndex]['cardType']); + } + + public function testGenerate_canBeGroupedByACustomField() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'customFields' => [ + 'store_me' => 'custom value' + ], + 'options' => ['submitForSettlement' => true] + ]); + + Braintree\Test\Transaction::settle($transaction->id); + + $today = new Datetime; + $result = Braintree\SettlementBatchSummary::generate(Test\Helper::nowInEastern(), 'store_me'); + + $this->assertTrue($result->success); + $this->assertTrue(count($result->settlementBatchSummary->records) > 0); + $this->assertArrayHasKey('store_me', $result->settlementBatchSummary->records[0]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionHelper.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionHelper.php new file mode 100644 index 00000000000..0f007f8ff94 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionHelper.php @@ -0,0 +1,86 @@ + "Plan for integration tests -- with add-ons and discounts", + 'id' => "integration_plan_with_add_ons_and_discounts", + 'price' => '9.99', + 'trial_period' => true, + 'trial_duration' => 2, + 'trial_duration_unit' => 'day' + ]; + } + + public static function billingDayOfMonthPlan() + { + return [ + 'description' => 'Plan for integration tests -- with billing day of month', + 'id' => 'integration_plan_with_billing_day_of_month', + 'numberOfBillingCycles' => 5, + 'price' => '8.88', + 'trial_period' => false + ]; + } + + public static function trialPlan() + { + return [ + 'description' => 'Plan for integration tests -- with trial', + 'id' => 'integration_trial_plan', + 'numberOfBillingCycles' => 12, + 'price' => '43.21', + 'trial_period' => true, + 'trial_duration' => 2, + 'trial_duration_unit' => 'day' + ]; + } + + public static function triallessPlan() + { + return [ + 'description' => 'Plan for integration tests -- without a trial', + 'id' => 'integration_trialless_plan', + 'numberOfBillingCycles' => 12, + 'price' => '12.34', + 'trial_period' => false + ]; + } + + public static function createCreditCard() + { + $customer = Braintree\Customer::createNoValidate([ + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/2010' + ] + ]); + return $customer->creditCards[0]; + } + + public static function createSubscription() + { + $plan = self::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => self::createCreditCard()->token, + 'price' => '54.99', + 'planId' => $plan['id'] + ]); + return $result->subscription; + } + + public static function compareModificationsById($left, $right) + { + return strcmp($left->id, $right->id); + } + + public static function sortModificationsById(&$modifications) + { + usort($modifications, ['Test\Integration\SubscriptionHelper', 'compareModificationsById']); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionSearchTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionSearchTest.php new file mode 100644 index 00000000000..b86840a77d3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionSearchTest.php @@ -0,0 +1,479 @@ + $creditCard->token, + 'planId' => $trialPlan['id'], + 'price' => '1' + ])->subscription; + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '1' + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::planId()->is('integration_trial_plan'), + Braintree\SubscriptionSearch::price()->is('1') + ]); + + $this->assertTrue(Test\Helper::includes($collection, $trialSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription)); + } + + public function test_noRequestsWhenIterating() + { + $resultsReturned = false; + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::planId()->is('imaginary') + ]); + + foreach ($collection as $transaction) { + $resultsReturned = true; + break; + } + + $this->assertSame(0, $collection->maximumCount()); + $this->assertEquals(false, $resultsReturned); + } + + public function testSearch_inTrialPeriod() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + $trialPlan = SubscriptionHelper::trialPlan(); + + $trialSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $trialPlan['id'], + 'price' => '1' + ])->subscription; + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '1' + ])->subscription; + + $subscriptions_in_trial = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::inTrialPeriod()->is(true) + ]); + + $this->assertTrue(Test\Helper::includes($subscriptions_in_trial, $trialSubscription)); + $this->assertFalse(Test\Helper::includes($subscriptions_in_trial, $triallessSubscription)); + + $subscriptions_not_in_trial = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::inTrialPeriod()->is(false) + ]); + + $this->assertTrue(Test\Helper::includes($subscriptions_not_in_trial, $triallessSubscription)); + $this->assertFalse(Test\Helper::includes($subscriptions_not_in_trial, $trialSubscription)); + } + + public function testSearch_statusIsPastDue() + { + $found = false; + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::status()->in([Braintree\Subscription::PAST_DUE]) + ]); + foreach ($collection AS $item) { + $found = true; + $this->assertEquals(Braintree\Subscription::PAST_DUE, $item->status); + } + $this->assertTrue($found); + } + + public function testSearch_statusIsExpired() + { + $found = false; + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::status()->in([Braintree\Subscription::EXPIRED]) + ]); + foreach ($collection as $item) { + $found = true; + $this->assertEquals(Braintree\Subscription::EXPIRED, $item->status); + } + $this->assertTrue($found); + } + + public function testSearch_billingCyclesRemaing() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $subscription_4 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'numberOfBillingCycles' => 4 + ])->subscription; + + $subscription_8 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'numberOfBillingCycles' => 8 + ])->subscription; + + $subscription_10 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'numberOfBillingCycles' => 10 + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::billingCyclesRemaining()->between(5, 10) + ]); + + $this->assertFalse(Test\Helper::includes($collection, $subscription_4)); + $this->assertTrue(Test\Helper::includes($collection, $subscription_8)); + $this->assertTrue(Test\Helper::includes($collection, $subscription_10)); + } + + public function testSearch_subscriptionId() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $rand_id = strval(rand()); + + $subscription_1 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'id' => 'subscription_123_id_' . $rand_id + ])->subscription; + + $subscription_2 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'id' => 'subscription_23_id_' . $rand_id + ])->subscription; + + $subscription_3 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'id' => 'subscription_3_id_' . $rand_id + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::id()->contains('23_id_') + ]); + + $this->assertTrue(Test\Helper::includes($collection, $subscription_1)); + $this->assertTrue(Test\Helper::includes($collection, $subscription_2)); + $this->assertFalse(Test\Helper::includes($collection, $subscription_3)); + } + + public function testSearch_merchantAccountId() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $rand_id = strval(rand()); + + $subscription_1 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'id' => strval(rand()) . '_subscription_' . $rand_id, + 'price' => '2' + ])->subscription; + + $subscription_2 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'id' => strval(rand()) . '_subscription_' . $rand_id, + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'price' => '2' + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::id()->endsWith('subscription_' . $rand_id), + Braintree\SubscriptionSearch::merchantAccountId()->in([Test\Helper::nonDefaultMerchantAccountId()]), + Braintree\SubscriptionSearch::price()->is('2') + ]); + + $this->assertFalse(Test\Helper::includes($collection, $subscription_1)); + $this->assertTrue(Test\Helper::includes($collection, $subscription_2)); + } + + public function testSearch_bogusMerchantAccountId() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $rand_id = strval(rand()); + + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'id' => strval(rand()) . '_subscription_' . $rand_id, + 'price' => '11.38' + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::id()->endsWith('subscription_' . $rand_id), + Braintree\SubscriptionSearch::merchantAccountId()->in(['bogus_merchant_account']), + Braintree\SubscriptionSearch::price()->is('11.38') + ]); + + $this->assertFalse(Test\Helper::includes($collection, $subscription)); + } + + public function testSearch_daysPastDue() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'] + ])->subscription; + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due'; + $http->put($path, ['daysPastDue' => 5]); + + $found = false; + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::daysPastDue()->between(2, 10) + ]); + foreach ($collection AS $item) { + $found = true; + $this->assertTrue($item->daysPastDue <= 10); + $this->assertTrue($item->daysPastDue >= 2); + } + $this->assertTrue($found); + } + + public function testSearch_price() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $subscription_850 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '8.50' + ])->subscription; + + $subscription_851 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '8.51' + ])->subscription; + + $subscription_852 = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '8.52' + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::price()->between('8.51', '8.52') + ]); + + $this->assertTrue(Test\Helper::includes($collection, $subscription_851)); + $this->assertTrue(Test\Helper::includes($collection, $subscription_852)); + $this->assertFalse(Test\Helper::includes($collection, $subscription_850)); + } + + public function testSearch_nextBillingDate() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + $trialPlan = SubscriptionHelper::trialPlan(); + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + ])->subscription; + + $trialSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $trialPlan['id'], + ])->subscription; + + $fiveDaysFromNow = new DateTime(); + $fiveDaysFromNow->modify("+5 days"); + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::nextBillingDate()->greaterThanOrEqualTo($fiveDaysFromNow), + ]); + + $this->assertTrue(Test\Helper::includes($collection, $triallessSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $trialSubscription)); + } + + public function testSearch_createdAt_lessThanOrEqualTo() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + + $subscription= Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ])->subscription; + + $fiveDaysFromNow = new DateTime(); + $fiveDaysFromNow->modify("+5 days"); + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->lessThanOrEqualTo($fiveDaysFromNow), + ]); + + $this->assertTrue(Test\Helper::includes($collection, $subscription)); + + $fiveDaysAgo = new DateTime(); + $fiveDaysAgo->modify("-5 days"); + + $emptyCollection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->lessThanOrEqualTo($fiveDaysAgo), + ]); + + $this->assertFalse(Test\Helper::includes($emptyCollection, $subscription)); + } + + public function testSearch_createdAt_greaterThanOrEqualTo() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + + $subscription= Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ])->subscription; + + $fiveDaysAgo = new DateTime(); + $fiveDaysAgo->modify("-5 days"); + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->greaterThanOrEqualTo($fiveDaysAgo), + ]); + + $this->assertTrue(Test\Helper::includes($collection, $subscription)); + + $fiveDaysFromNow = new DateTime(); + $fiveDaysFromNow->modify("+5 days"); + + $emptyCollection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->greaterThanOrEqualTo($fiveDaysFromNow), + ]); + + $this->assertFalse(Test\Helper::includes($emptyCollection, $subscription)); + } + + public function testSearch_createdAt_between() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + + $subscription= Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ])->subscription; + + $fiveDaysAgo = new DateTime(); + $fiveDaysFromNow = new DateTime(); + $tenDaysFromNow = new DateTime(); + + $fiveDaysAgo->modify("-5 days"); + $fiveDaysFromNow->modify("+5 days"); + $tenDaysFromNow->modify("+10 days"); + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->between($fiveDaysAgo, $fiveDaysFromNow), + ]); + + $this->assertTrue(Test\Helper::includes($collection, $subscription)); + + $emptyCollection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->between($fiveDaysFromNow, $tenDaysFromNow), + ]); + + $this->assertFalse(Test\Helper::includes($emptyCollection, $subscription)); + } + + public function testSearch_createdAt_is() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + + $subscription= Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->is($subscription->createdAt), + ]); + + $this->assertTrue(Test\Helper::includes($collection, $subscription)); + + $oneDayAgo = $subscription->createdAt; + $oneDayAgo->modify("-1 days"); + + $emptyCollection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->is($oneDayAgo), + ]); + + $this->assertFalse(Test\Helper::includes($emptyCollection, $subscription)); + } + + public function testSearch_createdAt_convertLocalToUTC() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + + $subscription= Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ])->subscription; + + $tenMinAgo = date_create("now -10 minutes", new DateTimeZone("US/Pacific")); + $tenMinFromNow = date_create("now +10 minutes", new DateTimeZone("US/Pacific")); + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::createdAt()->between($tenMinAgo, $tenMinFromNow), + ]); + + $this->assertTrue(Test\Helper::includes($collection, $subscription)); + } + + public function testSearch_transactionId() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + + $matchingSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + ])->subscription; + + $nonMatchingSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::transactionId()->is($matchingSubscription->transactions[0]->id), + ]); + + $this->assertTrue(Test\Helper::includes($collection, $matchingSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $nonMatchingSubscription)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionTest.php new file mode 100644 index 00000000000..cdb47c86e83 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/SubscriptionTest.php @@ -0,0 +1,1312 @@ +setExpectedException('InvalidArgumentException', 'invalid keys: bad'); + $result = Braintree\Subscription::create([ + 'bad' => 'value' + ]); + } + + public function testCreate_whenSuccessful() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + + ]); + Test\Helper::assertPrintable($result); + $this->assertTrue($result->success); + $subscription = $result->subscription; + $this->assertEquals($creditCard->token, $subscription->paymentMethodToken); + $this->assertEquals(0, $subscription->failureCount); + $this->assertEquals($plan['id'], $subscription->planId); + $this->assertEquals(Test\Helper::defaultMerchantAccountId(), $subscription->merchantAccountId); + $this->assertEquals(Braintree\Subscription::ACTIVE, $subscription->status); + $this->assertEquals('12.34', $subscription->nextBillAmount); + $this->assertEquals('12.34', $subscription->nextBillingPeriodAmount); + $this->assertEquals('0.00', $subscription->balance); + $this->assertEquals(1, $subscription->currentBillingCycle); + $this->assertInstanceOf('DateTime', $subscription->firstBillingDate); + $this->assertInstanceOf('DateTime', $subscription->nextBillingDate); + $this->assertInstanceOf('DateTime', $subscription->billingPeriodStartDate); + $this->assertInstanceOf('DateTime', $subscription->billingPeriodEndDate); + $this->assertInstanceOf('DateTime', $subscription->paidThroughDate); + $this->assertInstanceOf('DateTime', $subscription->updatedAt); + $this->assertInstanceOf('DateTime', $subscription->createdAt); + + $this->assertEquals('12.34', $subscription->statusHistory[0]->price); + $this->assertEquals('0.00', $subscription->statusHistory[0]->balance); + $this->assertEquals('USD', $subscription->statusHistory[0]->currencyIsoCode); + $this->assertEquals($plan['id'], $subscription->statusHistory[0]->planId); + $this->assertEquals(Braintree\Subscription::ACTIVE, $subscription->statusHistory[0]->status); + $this->assertEquals(Braintree\Subscription::API, $subscription->statusHistory[0]->subscriptionSource); + } + + public function testGatewayCreate_whenSuccessful() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->subscription()->create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + + ]); + Test\Helper::assertPrintable($result); + $this->assertTrue($result->success); + $subscription = $result->subscription; + $this->assertEquals($creditCard->token, $subscription->paymentMethodToken); + $this->assertEquals(0, $subscription->failureCount); + $this->assertEquals($plan['id'], $subscription->planId); + $this->assertEquals(Test\Helper::defaultMerchantAccountId(), $subscription->merchantAccountId); + $this->assertEquals(Braintree\Subscription::ACTIVE, $subscription->status); + } + + public function testCreate_withPaymentMethodNonce() + { + $customerId = Braintree\Customer::create()->customer->id; + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "customerId" => $customerId, + "share" => true + ]); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodNonce' => $nonce, + 'planId' => $plan['id'] + ]); + + $this->assertTrue($result->success); + + $transaction = $result->subscription->transactions[0]; + $this->assertEquals("411111", $transaction->creditCardDetails->bin); + $this->assertEquals("1111", $transaction->creditCardDetails->last4); + } + + public function testCreate_returnsTransactionWhenTransactionFails() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'price' => Braintree\Test\TransactionAmounts::$decline + + ]); + Test\Helper::assertPrintable($result); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Transaction::PROCESSOR_DECLINED, $result->transaction->status); + } + + public function testCreate_canSetTheId() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $newId = strval(rand()); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'id' => $newId + ]); + + $this->assertTrue($result->success); + $subscription = $result->subscription; + $this->assertEquals($newId, $subscription->id); + } + + public function testCreate_canSetTheMerchantAccountId() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId() + ]); + + $this->assertTrue($result->success); + $subscription = $result->subscription; + $this->assertEquals(Test\Helper::nonDefaultMerchantAccountId(), $subscription->merchantAccountId); + } + + public function testCreate_trialPeriodDefaultsToPlanWithoutTrial() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ]); + $subscription = $result->subscription; + $this->assertFalse($subscription->trialPeriod); + $this->assertNull($subscription->trialDuration); + $this->assertNull($subscription->trialDurationUnit); + } + + public function testCreate_trialPeriondDefaultsToPlanWithTrial() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ]); + $subscription = $result->subscription; + $this->assertTrue($subscription->trialPeriod); + $this->assertEquals(2, $subscription->trialDuration); + $this->assertEquals('day', $subscription->trialDurationUnit); + } + + public function testCreate_alterPlanTrialPeriod() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'trialDuration' => 5, + 'trialDurationUnit' => 'month' + ]); + $subscription = $result->subscription; + $this->assertTrue($subscription->trialPeriod); + $this->assertEquals(5, $subscription->trialDuration); + $this->assertEquals('month', $subscription->trialDurationUnit); + } + + public function testCreate_removePlanTrialPeriod() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'trialPeriod' => false, + ]); + $subscription = $result->subscription; + $this->assertFalse($subscription->trialPeriod); + } + + public function testCreate_createsATransactionIfNoTrialPeriod() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ]); + $subscription = $result->subscription; + $this->assertEquals(1, sizeof($subscription->transactions)); + $transaction = $subscription->transactions[0]; + $this->assertInstanceOf('Braintree\Transaction', $transaction); + $this->assertEquals($plan['price'], $transaction->amount); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals($subscription->id, $transaction->subscriptionId); + } + + public function testCreate_doesNotCreateTransactionIfTrialPeriod() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ]); + $subscription = $result->subscription; + $this->assertEquals(0, sizeof($subscription->transactions)); + } + + public function testCreate_returnsATransactionWithSubscriptionBillingPeriod() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ]); + $subscription = $result->subscription; + $transaction = $subscription->transactions[0]; + $this->assertEquals($subscription->billingPeriodStartDate, $transaction->subscriptionDetails->billingPeriodStartDate); + $this->assertEquals($subscription->billingPeriodEndDate, $transaction->subscriptionDetails->billingPeriodEndDate); + } + + public function testCreate_priceCanBeOverriden() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'price' => '2.00' + ]); + $subscription = $result->subscription; + $this->assertEquals('2.00', $subscription->price); + } + + public function testCreate_billingDayOfMonthIsInheritedFromPlan() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::billingDayOfMonthPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + ]); + $subscription = $result->subscription; + $this->assertEquals(5, $subscription->billingDayOfMonth); + } + + public function testCreate_billingDayOfMonthCanBeOverriden() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::billingDayOfMonthPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'billingDayOfMonth' => 14 + ]); + $subscription = $result->subscription; + $this->assertEquals(14, $subscription->billingDayOfMonth); + } + + public function testCreate_billingDayOfMonthCanBeOverridenWithStartImmediately() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::billingDayOfMonthPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'options' => ['startImmediately' => true] + ]); + $subscription = $result->subscription; + $this->assertEquals(1, sizeof($subscription->transactions)); + } + + public function testCreate_firstBillingDateCanBeSet() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::billingDayOfMonthPlan(); + + $tomorrow = new DateTime("now + 1 day"); + $tomorrow->setTime(0,0,0); + + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'firstBillingDate' => $tomorrow + ]); + + $subscription = $result->subscription; + $this->assertEquals($tomorrow, $subscription->firstBillingDate); + $this->assertEquals(Braintree\Subscription::PENDING, $result->subscription->status); + } + + public function testCreate_firstBillingDateInThePast() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::billingDayOfMonthPlan(); + + $past = new DateTime("now - 3 days"); + $past->setTime(0,0,0); + + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'firstBillingDate' => $past + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('subscription')->onAttribute('firstBillingDate'); + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_FIRST_BILLING_DATE_CANNOT_BE_IN_THE_PAST, $errors[0]->code); + } + + public function testCreate_numberOfBillingCyclesCanBeOverridden() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + ]); + $subscription = $result->subscription; + $this->assertEquals($plan['numberOfBillingCycles'], $subscription->numberOfBillingCycles); + + $result = Braintree\Subscription::create([ + 'numberOfBillingCycles' => '10', + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + ]); + $subscription = $result->subscription; + $this->assertEquals(10, $subscription->numberOfBillingCycles); + $this->assertFalse($subscription->neverExpires); + } + + public function testCreate_numberOfBillingCyclesCanBeOverriddenToNeverExpire() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + ]); + $subscription = $result->subscription; + $this->assertEquals($plan['numberOfBillingCycles'], $subscription->numberOfBillingCycles); + + $result = Braintree\Subscription::create([ + 'neverExpires' => true, + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + ]); + $subscription = $result->subscription; + $this->assertNull($subscription->numberOfBillingCycles); + $this->assertTrue($subscription->neverExpires); + } + + public function testCreate_doesNotInheritAddOnsAndDiscountsWhenDoNotInheritAddOnsOrDiscountsIsSet() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'options' => ['doNotInheritAddOnsOrDiscounts' => true] + ]); + $subscription = $result->subscription; + $this->assertEquals(0, sizeof($subscription->addOns)); + $this->assertEquals(0, sizeof($subscription->discounts)); + } + + public function testCreate_inheritsAddOnsAndDiscountsFromPlanByDefault() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + ]); + $subscription = $result->subscription; + $this->assertEquals(2, sizeof($subscription->addOns)); + $addOns = $subscription->addOns; + SubscriptionHelper::sortModificationsById($addOns); + + $this->assertEquals($addOns[0]->amount, "10.00"); + $this->assertEquals($addOns[0]->quantity, 1); + $this->assertEquals($addOns[0]->numberOfBillingCycles, null); + $this->assertEquals($addOns[0]->neverExpires, true); + $this->assertEquals($addOns[0]->currentBillingCycle, 0); + + $this->assertEquals($addOns[1]->amount, "20.00"); + $this->assertEquals($addOns[1]->quantity, 1); + $this->assertEquals($addOns[1]->numberOfBillingCycles, null); + $this->assertEquals($addOns[1]->neverExpires, true); + $this->assertEquals($addOns[1]->currentBillingCycle, 0); + + $this->assertEquals(2, sizeof($subscription->discounts)); + $discounts = $subscription->discounts; + SubscriptionHelper::sortModificationsById($discounts); + + $this->assertEquals($discounts[0]->amount, "11.00"); + $this->assertEquals($discounts[0]->quantity, 1); + $this->assertEquals($discounts[0]->numberOfBillingCycles, null); + $this->assertEquals($discounts[0]->neverExpires, true); + $this->assertEquals($discounts[0]->currentBillingCycle, 0); + + $this->assertEquals($discounts[1]->amount, "7.00"); + $this->assertEquals($discounts[1]->quantity, 1); + $this->assertEquals($discounts[1]->numberOfBillingCycles, null); + $this->assertEquals($discounts[1]->neverExpires, true); + $this->assertEquals($discounts[1]->currentBillingCycle, 0); + } + + public function testCreate_allowsOverridingInheritedAddOnsAndDiscounts() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'addOns' => [ + 'update' => [ + [ + 'amount' => '50.00', + 'existingId' => 'increase_10', + 'quantity' => 2, + 'numberOfBillingCycles' => 5 + ], + [ + 'amount' => '60.00', + 'existingId' => 'increase_20', + 'quantity' => 4, + 'numberOfBillingCycles' => 9 + ] + ], + ], + 'discounts' => [ + 'update' => [ + [ + 'amount' => '15.00', + 'existingId' => 'discount_7', + 'quantity' => 2, + 'neverExpires' => true + ] + ] + ] + ]); + $subscription = $result->subscription; + $this->assertEquals(2, sizeof($subscription->addOns)); + $addOns = $subscription->addOns; + SubscriptionHelper::sortModificationsById($addOns); + + $this->assertEquals($addOns[0]->amount, "50.00"); + $this->assertEquals($addOns[0]->quantity, 2); + $this->assertEquals($addOns[0]->numberOfBillingCycles, 5); + $this->assertEquals($addOns[0]->neverExpires, false); + $this->assertEquals($addOns[0]->currentBillingCycle, 0); + + $this->assertEquals($addOns[1]->amount, "60.00"); + $this->assertEquals($addOns[1]->quantity, 4); + $this->assertEquals($addOns[1]->numberOfBillingCycles, 9); + $this->assertEquals($addOns[1]->neverExpires, false); + $this->assertEquals($addOns[1]->currentBillingCycle, 0); + + $this->assertEquals(2, sizeof($subscription->discounts)); + $discounts = $subscription->discounts; + SubscriptionHelper::sortModificationsById($discounts); + + $this->assertEquals($discounts[0]->amount, "11.00"); + $this->assertEquals($discounts[0]->quantity, 1); + $this->assertEquals($discounts[0]->numberOfBillingCycles, null); + $this->assertEquals($discounts[0]->neverExpires, true); + $this->assertEquals($discounts[0]->currentBillingCycle, 0); + + $this->assertEquals($discounts[1]->amount, "15.00"); + $this->assertEquals($discounts[1]->quantity, 2); + $this->assertEquals($discounts[1]->numberOfBillingCycles, null); + $this->assertEquals($discounts[1]->neverExpires, true); + $this->assertEquals($discounts[1]->currentBillingCycle, 0); + } + + public function testCreate_allowsRemovalOfInheritedAddOnsAndDiscounts() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'addOns' => [ + 'remove' => ['increase_10', 'increase_20'] + ], + 'discounts' => [ + 'remove' => ['discount_7'] + ] + ]); + $subscription = $result->subscription; + $this->assertEquals(0, sizeof($subscription->addOns)); + + $this->assertEquals(1, sizeof($subscription->discounts)); + + $this->assertEquals($subscription->discounts[0]->amount, "11.00"); + $this->assertEquals($subscription->discounts[0]->quantity, 1); + $this->assertEquals($subscription->discounts[0]->numberOfBillingCycles, null); + $this->assertEquals($subscription->discounts[0]->neverExpires, true); + $this->assertEquals($subscription->discounts[0]->currentBillingCycle, 0); + } + + public function testCreate_allowsAddingNewAddOnsAndDiscounts() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'addOns' => [ + 'add' => [ + [ + 'inheritedFromId' => 'increase_30', + 'amount' => '35.00', + 'neverExpires' => true, + 'quantity' => 2 + ], + ], + ], + 'discounts' => [ + 'add' => [ + [ + 'inheritedFromId' => 'discount_15', + 'amount' => '15.50', + 'numberOfBillingCycles' => 10, + 'quantity' => 3 + ] + ] + ] + ]); + + $subscription = $result->subscription; + $this->assertEquals(3, sizeof($subscription->addOns)); + $addOns = $subscription->addOns; + SubscriptionHelper::sortModificationsById($addOns); + + $this->assertEquals($addOns[0]->amount, "10.00"); + $this->assertEquals($addOns[1]->amount, "20.00"); + $this->assertEquals($addOns[2]->id, "increase_30"); + $this->assertEquals($addOns[2]->amount, "35.00"); + $this->assertEquals($addOns[2]->neverExpires, true); + $this->assertEquals($addOns[2]->numberOfBillingCycles, null); + $this->assertEquals($addOns[2]->quantity, 2); + $this->assertEquals($addOns[2]->currentBillingCycle, 0); + + + $this->assertEquals(3, sizeof($subscription->discounts)); + $discounts = $subscription->discounts; + SubscriptionHelper::sortModificationsById($discounts); + + $this->assertEquals($discounts[0]->amount, "11.00"); + + $this->assertEquals($discounts[1]->amount, "15.50"); + $this->assertEquals($discounts[1]->id, "discount_15"); + $this->assertEquals($discounts[1]->neverExpires, false); + $this->assertEquals($discounts[1]->numberOfBillingCycles, 10); + $this->assertEquals($discounts[1]->quantity, 3); + $this->assertEquals($discounts[1]->currentBillingCycle, 0); + + $this->assertEquals($discounts[2]->amount, "7.00"); + } + + public function testCreate_properlyParsesValidationErrorsForArrays() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'addOns' => [ + 'update' => [ + [ + 'existingId' => 'increase_10', + 'amount' => 'invalid', + ], + [ + 'existingId' => 'increase_20', + 'quantity' => -10, + ] + ] + ] + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('subscription')->forKey('addOns')->forKey('update')->forIndex(0)->onAttribute('amount'); + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_MODIFICATION_AMOUNT_IS_INVALID, $errors[0]->code); + $errors = $result->errors->forKey('subscription')->forKey('addOns')->forKey('update')->forIndex(1)->onAttribute('quantity'); + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_MODIFICATION_QUANTITY_IS_INVALID, $errors[0]->code); + } + + public function testCreate_withDescriptor() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]); + $this->assertTrue($result->success); + $subscription = $result->subscription; + $this->assertEquals('123*123456789012345678', $subscription->descriptor->name); + $this->assertEquals('3334445555', $subscription->descriptor->phone); + $this->assertEquals('ebay.com', $subscription->descriptor->url); + $transaction = $subscription->transactions[0]; + $this->assertEquals('123*123456789012345678', $transaction->descriptor->name); + $this->assertEquals('3334445555', $transaction->descriptor->phone); + $this->assertEquals('ebay.com', $transaction->descriptor->url); + } + + public function testCreate_withDescriptorValidation() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'descriptor' => [ + 'name' => 'xxxxxx', + 'phone' => 'xxxx', + 'url' => '12345678901234' + ] + ]); + $this->assertFalse($result->success); + $subscription = $result->subscription; + + $errors = $result->errors->forKey('subscription')->forKey('descriptor')->onAttribute('name'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_NAME_FORMAT_IS_INVALID, $errors[0]->code); + + $errors = $result->errors->forKey('subscription')->forKey('descriptor')->onAttribute('phone'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_PHONE_FORMAT_IS_INVALID, $errors[0]->code); + + $errors = $result->errors->forKey('subscription')->forKey('descriptor')->onAttribute('url'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_URL_FORMAT_IS_INVALID, $errors[0]->code); + } + + public function testCreate_withDescription() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $plan = SubscriptionHelper::triallessPlan(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $paypalResult = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $paymentMethodToken, + 'planId' => $plan['id'], + 'options' => [ + 'paypal' => [ + 'description' => 'A great product' + ] + ] + ]); + $this->assertTrue($result->success); + $subscription = $result->subscription; + $this->assertEquals('A great product', $subscription->description); + $transaction = $subscription->transactions[0]; + $this->assertEquals('A great product', $transaction->paypalDetails->description); + } + + public function testCreate_fromPayPalACcount() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $plan = SubscriptionHelper::triallessPlan(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $paypalResult = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $subscriptionResult = Braintree\Subscription::create([ + 'paymentMethodToken' => $paymentMethodToken, + 'planId' => $plan['id'] + + ]); + $this->assertTrue($subscriptionResult->success); + $transaction = $subscriptionResult->subscription->transactions[0]; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + } + + public function testCreate_fromPayPalACcountDoesNotWorkWithFutureNonce() + { + $plan = SubscriptionHelper::triallessPlan(); + $nonce = Braintree\Test\Nonces::$paypalFuturePayment; + + $subscriptionResult = Braintree\Subscription::create([ + 'paymentMethodNonce' => $nonce, + 'planId' => $plan['id'] + + ]); + $this->assertFalse($subscriptionResult->success); + $errors = $subscriptionResult->errors->forKey('subscription')->errors; + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_PAYMENT_METHOD_NONCE_IS_INVALID, $errors[0]->code); + } + + public function testCreate_fromPayPalACcountDoesNotWorkWithOnetimeNonce() + { + $plan = SubscriptionHelper::triallessPlan(); + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $subscriptionResult = Braintree\Subscription::create([ + 'paymentMethodNonce' => $nonce, + 'planId' => $plan['id'] + + ]); + $this->assertFalse($subscriptionResult->success); + $errors = $subscriptionResult->errors->forKey('subscription')->errors; + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_PAYMENT_METHOD_NONCE_IS_INVALID, $errors[0]->code); + } + + public function testValidationErrors_hasValidationErrorsOnId() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'id' => 'invalid token' + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('subscription')->onAttribute('id'); + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_TOKEN_FORMAT_IS_INVALID, $errors[0]->code); + } + + public function testFind() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'] + ]); + $this->assertTrue($result->success); + $subscription = Braintree\Subscription::find($result->subscription->id); + $this->assertEquals($result->subscription->id, $subscription->id); + $this->assertEquals($plan['id'], $subscription->planId); + } + + public function testFind_throwsIfNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'subscription with id does-not-exist not found'); + Braintree\Subscription::find('does-not-exist'); + + } + + public function testUpdate_whenSuccessful() + { + $subscription = SubscriptionHelper::createSubscription(); + $newId = strval(rand()); + $newPlan = SubscriptionHelper::trialPlan(); + $result = Braintree\Subscription::update($subscription->id, [ + 'id' => $newId, + 'price' => '999.99', + 'planId' => $newPlan['id'] + ]); + $this->assertTrue($result->success); + $this->assertEquals($newId, $result->subscription->id); + $this->assertEquals($newPlan['id'], $result->subscription->planId); + $this->assertEquals('999.99', $result->subscription->price); + } + + public function testUpdate_doesNotAcceptBadAttributes() + { + $this->setExpectedException('InvalidArgumentException', 'invalid keys: bad'); + $result = Braintree\Subscription::update('id', [ + 'bad' => 'value' + ]); + } + + public function testUpdate_canUpdateNumberOfBillingCycles() + { + $plan = SubscriptionHelper::triallessPlan(); + $subscription = SubscriptionHelper::createSubscription(); + $this->assertEquals($plan['numberOfBillingCycles'], $subscription->numberOfBillingCycles); + + $updatedSubscription = Braintree\Subscription::update($subscription->id, [ + 'numberOfBillingCycles' => 15 + ])->subscription; + $this->assertEquals(15, $updatedSubscription->numberOfBillingCycles); + } + + public function testUpdate_canUpdateNumberOfBillingCyclesToNeverExpire() + { + $plan = SubscriptionHelper::triallessPlan(); + $subscription = SubscriptionHelper::createSubscription(); + $this->assertEquals($plan['numberOfBillingCycles'], $subscription->numberOfBillingCycles); + + $updatedSubscription = Braintree\Subscription::update($subscription->id, [ + 'neverExpires' => true + ])->subscription; + $this->assertNull($updatedSubscription->numberOfBillingCycles); + } + + public function testUpdate_createsTransactionOnProration() + { + $subscription = SubscriptionHelper::createSubscription(); + $result = Braintree\Subscription::update($subscription->id, [ + 'price' => $subscription->price + 1, + ]); + $this->assertTrue($result->success); + $this->assertEquals(sizeof($subscription->transactions) + 1, sizeof($result->subscription->transactions)); + } + + public function testUpdate_createsProratedTransactionWhenFlagIsPassedTrue() + { + $subscription = SubscriptionHelper::createSubscription(); + $result = Braintree\Subscription::update($subscription->id, [ + 'price' => $subscription->price + 1, + 'options' => ['prorateCharges' => true] + ]); + $this->assertTrue($result->success); + $this->assertEquals(sizeof($subscription->transactions) + 1, sizeof($result->subscription->transactions)); + } + + public function testUpdate_createsProratedTransactionWhenFlagIsPassedFalse() + { + $subscription = SubscriptionHelper::createSubscription(); + $result = Braintree\Subscription::update($subscription->id, [ + 'price' => $subscription->price + 1, + 'options' => ['prorateCharges' => false] + ]); + $this->assertTrue($result->success); + $this->assertEquals(sizeof($subscription->transactions), sizeof($result->subscription->transactions)); + } + + public function testUpdate_DoesNotUpdateSubscriptionWhenProrationTransactionFailsAndRevertIsTrue() + { + $subscription = SubscriptionHelper::createSubscription(); + $result = Braintree\Subscription::update($subscription->id, [ + 'price' => $subscription->price + 2100, + 'options' => ['prorateCharges' => true, 'revertSubscriptionOnProrationFailure' => true] + ]); + $this->assertFalse($result->success); + $this->assertEquals(sizeof($subscription->transactions) + 1, sizeof($result->subscription->transactions)); + $this->assertEquals(Braintree\Transaction::PROCESSOR_DECLINED, $result->subscription->transactions[0]->status); + $this->assertEquals("0.00", $result->subscription->balance); + $this->assertEquals($subscription->price, $result->subscription->price); + } + + public function testUpdate_UpdatesSubscriptionWhenProrationTransactionFailsAndRevertIsFalse() + { + $subscription = SubscriptionHelper::createSubscription(); + $result = Braintree\Subscription::update($subscription->id, [ + 'price' => $subscription->price + 2100, + 'options' => ['prorateCharges' => true, 'revertSubscriptionOnProrationFailure' => false] + ]); + $this->assertTrue($result->success); + $this->assertEquals(sizeof($subscription->transactions) + 1, sizeof($result->subscription->transactions)); + $this->assertEquals(Braintree\Transaction::PROCESSOR_DECLINED, $result->subscription->transactions[0]->status); + $this->assertEquals($result->subscription->transactions[0]->amount, $result->subscription->balance); + $this->assertEquals($subscription->price + 2100, $result->subscription->price); + } + + public function testUpdate_invalidSubscriptionId() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\Subscription::update('does-not-exist', []); + } + + public function testUpdate_validationErrors() + { + $subscription = SubscriptionHelper::createSubscription(); + $result = Braintree\Subscription::update($subscription->id, ['price' => '']); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('subscription')->onAttribute('price'); + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_PRICE_CANNOT_BE_BLANK, $errors[0]->code); + } + + public function testUpdate_cannotUpdateCanceledSubscription() + { + $subscription = SubscriptionHelper::createSubscription(); + Braintree\Subscription::cancel($subscription->id); + $result = Braintree\Subscription::update($subscription->id, ['price' => '1.00']); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('subscription')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_CANNOT_EDIT_CANCELED_SUBSCRIPTION, $errors[0]->code); + } + + public function testUpdate_canUpdatePaymentMethodToken() + { + $oldCreditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $oldCreditCard->token, + 'price' => '54.99', + 'planId' => $plan['id'] + ])->subscription; + + $newCreditCard = Braintree\CreditCard::createNoValidate([ + 'number' => '5105105105105100', + 'expirationDate' => '05/2010', + 'customerId' => $oldCreditCard->customerId + ]); + + $result = Braintree\Subscription::update($subscription->id, [ + 'paymentMethodToken' => $newCreditCard->token + ]); + $this->assertTrue($result->success); + $this->assertEquals($newCreditCard->token, $result->subscription->paymentMethodToken); + } + + public function testUpdate_canUpdatePaymentMethodWithPaymentMethodNonce() + { + $oldCreditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $oldCreditCard->token, + 'price' => '54.99', + 'planId' => $plan['id'] + ])->subscription; + + $customerId = Braintree\Customer::create()->customer->id; + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "customerId" => $oldCreditCard->customerId, + "share" => true + ]); + + $result = Braintree\Subscription::update($subscription->id, [ + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + + $newCreditCard = Braintree\CreditCard::find($result->subscription->paymentMethodToken); + + $this->assertEquals("1111", $newCreditCard->last4); + $this->assertNotEquals($oldCreditCard->last4, $newCreditCard->last4); + } + + public function testUpdate_canUpdateAddOnsAndDiscounts() + { + $oldCreditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $oldCreditCard->token, + 'price' => '54.99', + 'planId' => $plan['id'] + ])->subscription; + + $result = Braintree\Subscription::update($subscription->id, [ + 'addOns' => [ + 'update' => [ + [ + 'amount' => '99.99', + 'existingId' => 'increase_10', + 'quantity' => 99, + 'numberOfBillingCycles' => 99 + ], + [ + 'amount' => '22.22', + 'existingId' => 'increase_20', + 'quantity' => 22, + 'neverExpires' => true + ] + ], + ], + 'discounts' => [ + 'update' => [ + [ + 'amount' => '33.33', + 'existingId' => 'discount_11', + 'quantity' => 33, + 'numberOfBillingCycles' => 33 + ] + ], + ], + ]); + $this->assertTrue($result->success); + + $subscription = $result->subscription; + $this->assertEquals(2, sizeof($subscription->addOns)); + $addOns = $subscription->addOns; + SubscriptionHelper::sortModificationsById($addOns); + + $this->assertEquals($addOns[0]->id, "increase_10"); + $this->assertEquals($addOns[0]->amount, "99.99"); + $this->assertEquals($addOns[0]->neverExpires, false); + $this->assertEquals($addOns[0]->numberOfBillingCycles, 99); + $this->assertEquals($addOns[0]->quantity, 99); + + $this->assertEquals($addOns[1]->id, "increase_20"); + $this->assertEquals($addOns[1]->amount, "22.22"); + $this->assertEquals($addOns[1]->neverExpires, true); + $this->assertEquals($addOns[1]->numberOfBillingCycles, null); + $this->assertEquals($addOns[1]->quantity, 22); + + $this->assertEquals(2, sizeof($subscription->discounts)); + $discounts = $subscription->discounts; + SubscriptionHelper::sortModificationsById($discounts); + + $this->assertEquals($discounts[0]->id, "discount_11"); + $this->assertEquals($discounts[0]->amount, "33.33"); + $this->assertEquals($discounts[0]->neverExpires, false); + $this->assertEquals($discounts[0]->numberOfBillingCycles, 33); + $this->assertEquals($discounts[0]->quantity, 33); + } + + public function testUpdate_canAddAndRemoveAddOnsAndDiscounts() + { + $oldCreditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $oldCreditCard->token, + 'price' => '54.99', + 'planId' => $plan['id'] + ])->subscription; + + $result = Braintree\Subscription::update($subscription->id, [ + 'addOns' => [ + 'add' => [ + [ + 'amount' => '33.33', + 'inheritedFromId' => 'increase_30', + 'quantity' => 33, + 'numberOfBillingCycles' => 33 + ] + ], + 'remove' => ['increase_10', 'increase_20'] + ], + 'discounts' => [ + 'add' => [ + [ + 'inheritedFromId' => 'discount_15', + ] + ], + 'remove' => ['discount_7'] + ], + ]); + $this->assertTrue($result->success); + + $subscription = $result->subscription; + $this->assertEquals(1, sizeof($subscription->addOns)); + $addOns = $subscription->addOns; + SubscriptionHelper::sortModificationsById($addOns); + + $this->assertEquals($addOns[0]->id, "increase_30"); + $this->assertEquals($addOns[0]->amount, "33.33"); + $this->assertEquals($addOns[0]->neverExpires, false); + $this->assertEquals($addOns[0]->numberOfBillingCycles, 33); + $this->assertEquals($addOns[0]->quantity, 33); + + $this->assertEquals(2, sizeof($subscription->discounts)); + $discounts = $subscription->discounts; + SubscriptionHelper::sortModificationsById($discounts); + + $this->assertEquals($discounts[0]->id, "discount_11"); + $this->assertEquals($discounts[1]->id, "discount_15"); + $this->assertEquals($discounts[1]->amount, "15.00"); + $this->assertEquals($discounts[1]->neverExpires, true); + $this->assertNull($discounts[1]->numberOfBillingCycles); + $this->assertEquals($discounts[1]->quantity, 1); + } + + public function testUpdate_canReplaceEntireSetOfAddonsAndDiscounts() + { + $oldCreditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::addOnDiscountPlan(); + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $oldCreditCard->token, + 'price' => '54.99', + 'planId' => $plan['id'] + ])->subscription; + + $result = Braintree\Subscription::update($subscription->id, [ + 'addOns' => [ + 'add' => [ + ['inheritedFromId' => 'increase_30'], + ['inheritedFromId' => 'increase_20'] + ] + ], + 'discounts' => [ + 'add' => [ + ['inheritedFromId' => 'discount_15'] + ] + ], + 'options' => ['replaceAllAddOnsAndDiscounts' => true] + ]); + $this->assertTrue($result->success); + $subscription = $result->subscription; + + $this->assertEquals(2, sizeof($subscription->addOns)); + $addOns = $subscription->addOns; + SubscriptionHelper::sortModificationsById($addOns); + + $this->assertEquals($addOns[0]->id, "increase_20"); + $this->assertEquals($addOns[1]->id, "increase_30"); + + $this->assertEquals(1, sizeof($subscription->discounts)); + $discounts = $subscription->discounts; + + $this->assertEquals($discounts[0]->id, "discount_15"); + } + + public function testUpdate_withDescriptor() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555' + ] + ])->subscription; + $result = Braintree\Subscription::update($subscription->id, [ + 'descriptor' => [ + 'name' => '999*9999999', + 'phone' => '8887776666' + ] + ]); + $updatedSubscription = $result->subscription; + $this->assertEquals('999*9999999', $updatedSubscription->descriptor->name); + $this->assertEquals('8887776666', $updatedSubscription->descriptor->phone); + } + + public function testUpdate_withDescription() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $plan = SubscriptionHelper::triallessPlan(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $paypalResult = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + + $subscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $paymentMethodToken, + 'planId' => $plan['id'], + 'options' => [ + 'paypal' => [ + 'description' => 'A great product' + ] + ] + ])->subscription; + $result = Braintree\Subscription::update($subscription->id, [ + 'options' => [ + 'paypal' => [ + 'description' => 'An incredible product' + ] + ] + ]); + $updatedSubscription = $result->subscription; + $this->assertEquals('An incredible product', $updatedSubscription->description); + } + + public function testCancel_returnsSuccessIfCanceled() + { + $subscription = SubscriptionHelper::createSubscription(); + $result = Braintree\Subscription::cancel($subscription->id); + $this->assertTrue($result->success); + $this->assertEquals(Braintree\Subscription::CANCELED, $result->subscription->status); + } + + public function testCancel_throwsErrorIfRecordNotFound() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\Subscription::cancel('non-existing-id'); + } + + public function testCancel_returnsErrorIfCancelingCanceledSubscription() + { + $subscription = SubscriptionHelper::createSubscription(); + Braintree\Subscription::cancel($subscription->id); + $result = Braintree\Subscription::cancel($subscription->id); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('subscription')->onAttribute('status'); + $this->assertEquals(Braintree\Error\Codes::SUBSCRIPTION_STATUS_IS_CANCELED, $errors[0]->code); + } + + public function testRetryCharge_WithoutAmount() + { + $subscription = SubscriptionHelper::createSubscription(); + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due'; + $http->put($path); + + $result = Braintree\Subscription::retryCharge($subscription->id); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $this->assertEquals($subscription->price, $transaction->amount); + $this->assertNotNull($transaction->processorAuthorizationCode); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + } + + public function testRetryCharge_WithAmount() + { + $subscription = SubscriptionHelper::createSubscription(); + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due'; + $http->put($path); + + $result = Braintree\Subscription::retryCharge($subscription->id, 1000); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $this->assertEquals(1000, $transaction->amount); + $this->assertNotNull($transaction->processorAuthorizationCode); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + } + + public function testRetryCharge_WithSubmitForSettlement() + { + $subscription = SubscriptionHelper::createSubscription(); + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due'; + $http->put($path); + + $result = Braintree\Subscription::retryCharge($subscription->id, null, true); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $this->assertEquals($subscription->price, $transaction->amount); + $this->assertNotNull($transaction->processorAuthorizationCode); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status); + } + + public function testRetryCharge_WithSubmitForSettlementAndAmount() + { + $subscription = SubscriptionHelper::createSubscription(); + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due'; + $http->put($path); + + $result = Braintree\Subscription::retryCharge($subscription->id, 1002, true); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $this->assertEquals(1002, $transaction->amount); + $this->assertNotNull($transaction->processorAuthorizationCode); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TestTransactionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TestTransactionTest.php new file mode 100644 index 00000000000..5809753b12f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TestTransactionTest.php @@ -0,0 +1,101 @@ +setExpectedException('Braintree\Exception\TestOperationPerformedInProduction'); + + $transaction = Braintree\Test\Transaction::settle('foo'); + } + + public function testSettle() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => ['submitForSettlement' => true] + ]); + + $transaction = Braintree\Test\Transaction::settle($transaction->id); + + $this->assertEquals('settled', $transaction->status); + } + + public function testSettlementConfirmed() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => ['submitForSettlement' => true] + ]); + + $transaction = Braintree\Test\Transaction::settlementConfirm($transaction->id); + + $this->assertEquals('settlement_confirmed', $transaction->status); + } + + public function testSettlementDeclined() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => ['submitForSettlement' => true] + ]); + + $transaction = Braintree\Test\Transaction::settlementDecline($transaction->id); + + $this->assertEquals('settlement_declined', $transaction->status); + } + + public function testSettlementPending() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => ['submitForSettlement' => true] + ]); + + $transaction = Braintree\Test\Transaction::settlementPending($transaction->id); + + $this->assertEquals('settlement_pending', $transaction->status); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TextNodeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TextNodeTest.php new file mode 100644 index 00000000000..50853b3c04d --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TextNodeTest.php @@ -0,0 +1,147 @@ + $creditCard->token, + 'planId' => $trialPlan['id'], + 'price' => '5', + ])->subscription; + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '5', + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::planId()->is("integration_trial_plan"), + Braintree\SubscriptionSearch::price()->is('5') + ]); + + $this->assertTrue(Test\Helper::includes($collection, $trialSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription)); + } + + public function testIsNot() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + $trialPlan = SubscriptionHelper::trialPlan(); + + $trialSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $trialPlan['id'], + 'price' => '6', + ])->subscription; + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '6' + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::planId()->isNot("integration_trialless_plan"), + Braintree\SubscriptionSearch::price()->is("6") + ]); + + $this->assertTrue(Test\Helper::includes($collection, $trialSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription)); + } + + public function testStartsWith() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + $trialPlan = SubscriptionHelper::trialPlan(); + + $trialSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $trialPlan['id'], + 'price' => '7', + ])->subscription; + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '7', + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::planId()->startsWith("integration_trial_pl"), + Braintree\SubscriptionSearch::price()->is('7') + ]); + + $this->assertTrue(Test\Helper::includes($collection, $trialSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription)); + } + + public function testEndsWith() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + $trialPlan = SubscriptionHelper::trialPlan(); + + $trialSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $trialPlan['id'], + 'price' => '8' + ])->subscription; + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '8' + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::planId()->endsWith("rial_plan"), + Braintree\SubscriptionSearch::price()->is("8") + ]); + + $this->assertTrue(Test\Helper::includes($collection, $trialSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription)); + } + + + public function testContains() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $triallessPlan = SubscriptionHelper::triallessPlan(); + $trialPlan = SubscriptionHelper::trialPlan(); + + $trialSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $trialPlan['id'], + 'price' => '9' + ])->subscription; + + $triallessSubscription = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $triallessPlan['id'], + 'price' => '9' + ])->subscription; + + $collection = Braintree\Subscription::search([ + Braintree\SubscriptionSearch::planId()->contains("ration_trial_pl"), + Braintree\SubscriptionSearch::price()->is("9") + ]); + + $this->assertTrue(Test\Helper::includes($collection, $trialSubscription)); + $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionAdvancedSearchTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionAdvancedSearchTest.php new file mode 100644 index 00000000000..1924caf25a9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionAdvancedSearchTest.php @@ -0,0 +1,1581 @@ +is('thisnameisnotreal') + ]); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_noRequestsWhenIterating() + { + $resultsReturned = false; + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::billingFirstName()->is('thisnameisnotreal') + ]); + + foreach($collection as $transaction) { + $resultsReturned = true; + break; + } + + $this->assertSame(0, $collection->maximumCount()); + $this->assertEquals(false, $resultsReturned); + } + + public function testSearchOnTextFields() + { + $firstName = 'Tim' . rand(); + $token = 'creditcard' . rand(); + $customerId = 'customer' . rand(); + + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012', + 'cardholderName' => 'Tom Smith', + 'token' => $token, + ], + 'billing' => [ + 'company' => 'Braintree', + 'countryName' => 'United States of America', + 'extendedAddress' => 'Suite 123', + 'firstName' => $firstName, + 'lastName' => 'Smith', + 'locality' => 'Chicago', + 'postalCode' => '12345', + 'region' => 'IL', + 'streetAddress' => '123 Main St' + ], + 'customer' => [ + 'company' => 'Braintree', + 'email' => 'smith@example.com', + 'fax' => '5551231234', + 'firstName' => 'Tom', + 'id' => $customerId, + 'lastName' => 'Smith', + 'phone' => '5551231234', + 'website' => 'http://example.com', + ], + 'options' => [ + 'storeInVault' => true + ], + 'orderId' => 'myorder', + 'shipping' => [ + 'company' => 'Braintree P.S.', + 'countryName' => 'Mexico', + 'extendedAddress' => 'Apt 456', + 'firstName' => 'Thomas', + 'lastName' => 'Smithy', + 'locality' => 'Braintree', + 'postalCode' => '54321', + 'region' => 'MA', + 'streetAddress' => '456 Road' + ], + ]); + + $search_criteria = [ + 'billingCompany' => "Braintree", + 'billingCountryName' => "United States of America", + 'billingExtendedAddress' => "Suite 123", + 'billingFirstName' => $firstName, + 'billingLastName' => "Smith", + 'billingLocality' => "Chicago", + 'billingPostalCode' => "12345", + 'billingRegion' => "IL", + 'billingStreetAddress' => "123 Main St", + 'creditCardCardholderName' => "Tom Smith", + 'creditCardExpirationDate' => "05/2012", + 'creditCardNumber' => Braintree\Test\CreditCardNumbers::$visa, + 'creditCardUniqueIdentifier' => $transaction->creditCardDetails->uniqueNumberIdentifier, + 'currency' => "USD", + 'customerCompany' => "Braintree", + 'customerEmail' => "smith@example.com", + 'customerFax' => "5551231234", + 'customerFirstName' => "Tom", + 'customerId' => $customerId, + 'customerLastName' => "Smith", + 'customerPhone' => "5551231234", + 'customerWebsite' => "http://example.com", + 'orderId' => "myorder", + 'paymentMethodToken' => $token, + 'paymentInstrumentType' => 'CreditCardDetail', + 'processorAuthorizationCode' => $transaction->processorAuthorizationCode, + 'shippingCompany' => "Braintree P.S.", + 'shippingCountryName' => "Mexico", + 'shippingExtendedAddress' => "Apt 456", + 'shippingFirstName' => "Thomas", + 'shippingLastName' => "Smithy", + 'shippingLocality' => "Braintree", + 'shippingPostalCode' => "54321", + 'shippingRegion' => "MA", + 'shippingStreetAddress' => "456 Road", + 'user' => "integration_user_public_id" + ]; + + $query = [Braintree\TransactionSearch::id()->is($transaction->id)]; + foreach ($search_criteria AS $criterion => $value) { + $query[] = Braintree\TransactionSearch::$criterion()->is($value); + } + + $collection = Braintree\Transaction::search($query); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + foreach ($search_criteria AS $criterion => $value) { + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::$criterion()->is($value), + Braintree\TransactionSearch::id()->is($transaction->id) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::$criterion()->is('invalid_attribute'), + Braintree\TransactionSearch::id()->is($transaction->id) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + } + + public function testIs() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012', + 'cardholderName' => 'tom smith' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->is('tom smith') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->is('somebody else') + ]); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function testIsNot() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012', + 'cardholderName' => 'tom smith' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->isNot('somebody else') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->isNot('tom smith') + ]); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function testEndsWith() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012', + 'cardholderName' => 'tom smith' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->endsWith('m smith') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->endsWith('tom s') + ]); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function testStartsWith() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012', + 'cardholderName' => 'tom smith' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->startsWith('tom s') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->startsWith('m smith') + ]); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function testContains() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012', + 'cardholderName' => 'tom smith' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->contains('m sm') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardholderName()->contains('something else') + ]); + + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_createdUsing() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::createdUsing()->is(Braintree\Transaction::FULL_INFORMATION) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::createdUsing()->in( + [Braintree\Transaction::FULL_INFORMATION, Braintree\Transaction::TOKEN] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::createdUsing()->in([Braintree\Transaction::TOKEN]) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_paymentInstrumentType_is_creditCard() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::paymentInstrumentType()->is("CreditCardDetail") + ]); + + + $this->assertEquals($transaction->paymentInstrumentType, Braintree\PaymentInstrumentType::CREDIT_CARD); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_multipleValueNode_paymentInstrumentType_is_paypal() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => Braintree\Test\Nonces::$paypalOneTimePayment + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::paymentInstrumentType()->is("PayPalDetail") + ]); + + + $this->assertEquals($transaction->paymentInstrumentType, Braintree\PaymentInstrumentType::PAYPAL_ACCOUNT); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_multipleValueNode_paymentInstrumentType_is_applepay() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => Braintree\Test\Nonces::$applePayVisa + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::paymentInstrumentType()->is("ApplePayDetail") + ]); + + + $this->assertEquals($transaction->paymentInstrumentType, Braintree\PaymentInstrumentType::APPLE_PAY_CARD); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_multipleValueNode_createdUsing_allowedValues() + { + $this->setExpectedException('InvalidArgumentException', 'Invalid argument(s) for created_using: noSuchCreatedUsing'); + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::createdUsing()->is('noSuchCreatedUsing') + ]); + } + + public function test_multipleValueNode_creditCardCustomerLocation() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCustomerLocation()->is(Braintree\CreditCard::US) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCustomerLocation()->in( + [Braintree\CreditCard::US, Braintree\CreditCard::INTERNATIONAL] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCustomerLocation()->in([Braintree\CreditCard::INTERNATIONAL]) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_creditCardCustomerLocation_allowedValues() + { + $this->setExpectedException('InvalidArgumentException', 'Invalid argument(s) for credit_card_customer_location: noSuchLocation'); + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCustomerLocation()->is('noSuchLocation') + ]); + } + + public function test_multipleValueNode_merchantAccountId() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::merchantAccountId()->is($transaction->merchantAccountId) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::merchantAccountId()->in( + [$transaction->merchantAccountId, "bogus_merchant_account_id"] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::merchantAccountId()->is('bogus_merchant_account_id') + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_creditCardType() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardType()->is($transaction->creditCardDetails->cardType) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardType()->in( + [$transaction->creditCardDetails->cardType, Braintree\CreditCard::CHINA_UNION_PAY] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardType()->is(Braintree\CreditCard::CHINA_UNION_PAY) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_elo_creditCardType() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '47.00', + 'creditCard' => [ + 'number' => '5066991111111118', + 'expirationMonth' => '10', + 'expirationYear' => '2020', + 'cvv' => '737', + ], + 'merchantAccountId' => 'adyen_ma', + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::creditCardCardType()->is($transaction->creditCardDetails->cardType) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_multipleValueNode_creditCardType_allowedValues() + { + $this->setExpectedException('InvalidArgumentException', 'Invalid argument(s) for credit_card_card_type: noSuchCardType'); + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardType()->is('noSuchCardType') + ]); + } + + public function test_multipleValueNode_status() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::status()->is($transaction->status) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::status()->in( + [$transaction->status, Braintree\Transaction::SETTLED] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::status()->is(Braintree\Transaction::SETTLED) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_status_authorizationExpired() + { + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::status()->is(Braintree\Transaction::AUTHORIZATION_EXPIRED) + ]); + $this->assertGreaterThan(0, $collection->maximumCount()); + $this->assertEquals(Braintree\Transaction::AUTHORIZATION_EXPIRED, $collection->firstItem()->status); + } + + public function test_multipleValueNode_status_allowedValues() + { + $this->setExpectedException('InvalidArgumentException', 'Invalid argument(s) for status: noSuchStatus'); + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::status()->is('noSuchStatus') + ]); + } + + public function test_multipleValueNode_source() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2012' + ] + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::source()->is(Braintree\Transaction::API) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::source()->in( + [Braintree\Transaction::API, Braintree\Transaction::RECURRING] + ) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::source()->is(Braintree\Transaction::RECURRING) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_multipleValueNode_type() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Joe Everyman' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + + $sale = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodToken' => $creditCard->token, + 'options' => ['submitForSettlement' => true] + ]); + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/transactions/' . $sale->id . '/settle'; + $http->put($path); + $refund = Braintree\Transaction::refund($sale->id)->transaction; + + $credit = Braintree\Transaction::creditNoValidate([ + 'amount' => '100.00', + 'paymentMethodToken' => $creditCard->token + ]); + + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::type()->is($sale->type) + ]); + $this->assertEquals(1, $collection->maximumCount()); + + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::type()->in( + [$sale->type, $credit->type] + ) + ]); + $this->assertEquals(3, $collection->maximumCount()); + + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::type()->is($credit->type) + ]); + $this->assertEquals(2, $collection->maximumCount()); + } + + public function test_multipleValueNode_type_allowedValues() + { + $this->setExpectedException('InvalidArgumentException', 'Invalid argument(s) for type: noSuchType'); + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::type()->is('noSuchType') + ]); + } + + public function test_multipleValueNode_type_withRefund() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Joe Everyman' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + + $sale = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodToken' => $creditCard->token, + 'options' => ['submitForSettlement' => true] + ]); + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/transactions/' . $sale->id . '/settle'; + $http->put($path); + $refund = Braintree\Transaction::refund($sale->id)->transaction; + + $credit = Braintree\Transaction::creditNoValidate([ + 'amount' => '100.00', + 'paymentMethodToken' => $creditCard->token + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::type()->is($credit->type), + Braintree\TransactionSearch::refund()->is(True) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($refund->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::type()->is($credit->type), + Braintree\TransactionSearch::refund()->is(False) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($credit->id, $collection->firstItem()->id); + } + + public function test_rangeNode_amount() + { + $customer = Braintree\Customer::createNoValidate(); + $creditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Jane Everywoman' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ])->creditCard; + + $t_1000 = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'paymentMethodToken' => $creditCard->token + ]); + + $t_1500 = Braintree\Transaction::saleNoValidate([ + 'amount' => '1500.00', + 'paymentMethodToken' => $creditCard->token + ]); + + $t_1800 = Braintree\Transaction::saleNoValidate([ + 'amount' => '1800.00', + 'paymentMethodToken' => $creditCard->token + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::amount()->greaterThanOrEqualTo('1700') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($t_1800->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::amount()->lessThanOrEqualTo('1250') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($t_1000->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($creditCard->cardholderName), + Braintree\TransactionSearch::amount()->between('1100', '1600') + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($t_1500->id, $collection->firstItem()->id); + } + + private function runDisbursementDateSearchTests($disbursementDateString, $comparison) + { + $knownDepositId = "deposittransaction"; + $now = new DateTime($disbursementDateString); + $past = clone $now; + $past->modify("-1 hour"); + $future = clone $now; + $future->modify("+1 hour"); + + $collections = [ + 'future' => Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownDepositId), + $comparison($future) + ]), + 'now' => Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownDepositId), + $comparison($now) + ]), + 'past' => Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownDepositId), + $comparison($past) + ]) + ]; + return $collections; + } + + public function test_rangeNode_disbursementDate_lessThanOrEqualTo() + { + $compareLessThan = function($time) { + return Braintree\TransactionSearch::disbursementDate()->lessThanOrEqualTo($time); + }; + $collection = $this->runDisbursementDateSearchTests("2013-04-10", $compareLessThan); + + $this->assertEquals(0, $collection['past']->maximumCount()); + $this->assertEquals(1, $collection['now']->maximumCount()); + $this->assertEquals(1, $collection['future']->maximumCount()); + } + + public function test_rangeNode_disbursementDate_GreaterThanOrEqualTo() + { + $comparison = function($time) { + return Braintree\TransactionSearch::disbursementDate()->GreaterThanOrEqualTo($time); + }; + $collection = $this->runDisbursementDateSearchTests("2013-04-11", $comparison); + + $this->assertEquals(1, $collection['past']->maximumCount()); + $this->assertEquals(0, $collection['now']->maximumCount()); + $this->assertEquals(0, $collection['future']->maximumCount()); + } + + public function test_rangeNode_disbursementDate_between() + { + $knownId = "deposittransaction"; + + $now = new DateTime("2013-04-10"); + $past = clone $now; + $past->modify("-1 day"); + $future = clone $now; + $future->modify("+1 day"); + $future2 = clone $now; + $future2->modify("+2 days"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disbursementDate()->between($past, $future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disbursementDate()->between($now, $future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disbursementDate()->between($past, $now) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disbursementDate()->between($future, $future2) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_rangeNode_disbursementDate_is() + { + $knownId = "deposittransaction"; + + $now = new DateTime("2013-04-10"); + $past = clone $now; + $past->modify("-1 day"); + $future = clone $now; + $future->modify("+1 day"); + $future2 = clone $now; + $future2->modify("+2 days"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disbursementDate()->is($past) + ]); + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disbursementDate()->is($now) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disbursementDate()->is($future) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + private static $disputedTransaction = null; + + private function createTestDisputedTransaction() + { + if(self::$disputedTransaction !== null) { + return self::$disputedTransaction; + } + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$disputes['Chargeback'], + 'expirationDate' => '12/2019', + ] + ]); + self::$disputedTransaction = $result->transaction; + + for($i = 0; $i < 60; $i++) { + sleep(1); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($result->transaction->id), + Braintree\TransactionSearch::disputeDate()->is($result->transaction->disputes[0]->receivedDate) + ]); + + if($collection->maximumCount() > 0) { + return self::$disputedTransaction; + } + } + + throw new \Exception('Unable to find the disputed transaction.'); + } + + private function rundisputeDateSearchTests($comparison) + { + $transactionId = $this->createTestDisputedTransaction()->id; + $disputeDate = $this->createTestDisputedTransaction()->disputes[0]->receivedDate; + + $past = clone $disputeDate; + $past->modify("-1 day"); + $future = clone $disputeDate; + $future->modify("+1 day"); + + $collections = [ + 'future' => Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transactionId), + $comparison($future) + ]), + 'now' => Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transactionId), + $comparison($disputeDate) + ]), + 'past' => Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transactionId), + $comparison($past) + ]) + ]; + return $collections; + } + + public function test_rangeNode_disputeDate_lessThanOrEqualTo() + { + $compareLessThan = function($time) { + return Braintree\TransactionSearch::disputeDate()->lessThanOrEqualTo($time); + }; + + $collection = $this->rundisputeDateSearchTests($compareLessThan); + + $this->assertEquals(0, $collection['past']->maximumCount()); + $this->assertEquals(1, $collection['now']->maximumCount()); + $this->assertEquals(1, $collection['future']->maximumCount()); + } + + public function test_rangeNode_disputeDate_GreaterThanOrEqualTo() + { + $comparison = function($time) { + return Braintree\TransactionSearch::disputeDate()->GreaterThanOrEqualTo($time); + }; + + $collection = $this->rundisputeDateSearchTests($comparison); + + $this->assertEquals(1, $collection['past']->maximumCount()); + $this->assertEquals(1, $collection['now']->maximumCount()); + $this->assertEquals(0, $collection['future']->maximumCount()); + } + + public function test_rangeNode_disputeDate_between() + { + $disputedTransaction = $this->createTestDisputedTransaction(); + $knownId = $disputedTransaction->id; + $receivedDate = $disputedTransaction->disputes[0]->receivedDate; + + $past = clone $receivedDate; + $past->modify("-1 day"); + $future = clone $receivedDate; + $future->modify("+1 day"); + $future2 = clone $receivedDate; + $future2->modify("+2 days"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disputeDate()->between($past, $future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disputeDate()->between($receivedDate, $future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disputeDate()->between($past, $receivedDate) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disputeDate()->between($future, $future2) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_rangeNode_disputeDate_is() + { + $disputedTransaction = $this->createTestDisputedTransaction(); + $knownId = $disputedTransaction->id; + $receivedDate = $disputedTransaction->disputes[0]->receivedDate; + + $past = clone $receivedDate; + $past->modify("-1 day"); + $future = clone $receivedDate; + $future->modify("+1 day"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disputeDate()->is($past) + ]); + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disputeDate()->is($receivedDate) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($knownId, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($knownId), + Braintree\TransactionSearch::disputeDate()->is($future) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_rangeNode_createdAt_lessThanOrEqualTo() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'cardholderName' => 'Ted Everywoman' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $past = clone $transaction->createdAt; + $past->modify("-1 hour"); + $now = $transaction->createdAt; + $future = clone $transaction->createdAt; + $future->modify("+1 hour"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->lessThanOrEqualTo($future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->lessThanOrEqualTo($now) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->lessThanOrEqualTo($past) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_rangeNode_createdAt_GreaterThanOrEqualTo() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'cardholderName' => 'Ted Everyman' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $past = clone $transaction->createdAt; + $past->modify("-1 hour"); + $now = $transaction->createdAt; + $future = clone $transaction->createdAt; + $future->modify("+1 hour"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->GreaterThanOrEqualTo($future) + ]); + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->GreaterThanOrEqualTo($now) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->GreaterThanOrEqualTo($past) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + + + public function test_rangeNode_createdAt_between() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'cardholderName' => 'Ted Everyman' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $past = clone $transaction->createdAt; + $past->modify("-1 hour"); + $now = $transaction->createdAt; + $future = clone $transaction->createdAt; + $future->modify("+1 hour"); + $future2 = clone $transaction->createdAt; + $future2->modify("+1 day"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->between($past, $future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->between($now, $future) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->between($past, $now) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->between($future, $future2) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_rangeNode_createdAt_is() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'cardholderName' => 'Ted Everyman' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $past = clone $transaction->createdAt; + $past->modify("-1 hour"); + $now = $transaction->createdAt; + $future = clone $transaction->createdAt; + $future->modify("+1 hour"); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->is($future) + ]); + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->is($now) + ]); + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardCardholderName()->is($transaction->creditCardDetails->cardholderName), + Braintree\TransactionSearch::createdAt()->is($past) + ]); + $this->assertEquals(0, $collection->maximumCount()); + } + + public function test_rangeNode_createdAt_convertLocalToUTC() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'cardholderName' => 'Pingu Penguin' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("US/Pacific")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("US/Pacific")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::createdAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_createdAt_handlesUTCDateTimes() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'cardholderName' => 'Pingu Penguin' . rand(), + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::createdAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_authorizationExpiredAt() + { + $two_days_ago = date_create("now -2 days", new DateTimeZone("UTC")); + $yesterday = date_create("now -1 day", new DateTimeZone("UTC")); + $tomorrow = date_create("now +1 day", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::authorizationExpiredAt()->between($two_days_ago, $yesterday) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::authorizationExpiredAt()->between($yesterday, $tomorrow) + ]); + + $this->assertGreaterThan(0, $collection->maximumCount()); + $this->assertEquals(Braintree\Transaction::AUTHORIZATION_EXPIRED, $collection->firstItem()->status); + } + + public function test_rangeNode_authorizedAt() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12' + ] + ]); + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::authorizedAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::authorizedAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_failedAt() + { + $transaction = Braintree\Transaction::sale([ + 'amount' => '3000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12' + ] + ])->transaction; + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::failedAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::failedAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_gatewayRejectedAt() + { + $old_merchant_id = Braintree\Configuration::merchantId(); + $old_public_key = Braintree\Configuration::publicKey(); + $old_private_key = Braintree\Configuration::privateKey(); + + Braintree\Configuration::merchantId('processing_rules_merchant_id'); + Braintree\Configuration::publicKey('processing_rules_public_key'); + Braintree\Configuration::privateKey('processing_rules_private_key'); + + $transaction = Braintree\Transaction::sale([ + 'amount' => '1000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12', + 'cvv' => '200' + ] + ])->transaction; + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::gatewayRejectedAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $firstCount = $collection->maximumCount(); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::gatewayRejectedAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $secondCount = $collection->maximumCount(); + $firstId = $collection->firstItem()->id; + + Braintree\Configuration::merchantId($old_merchant_id); + Braintree\Configuration::publicKey($old_public_key); + Braintree\Configuration::privateKey($old_private_key); + + $this->assertEquals(0, $firstCount); + $this->assertEquals(1, $secondCount); + $this->assertEquals($transaction->id, $firstId); + } + + public function test_rangeNode_processorDeclinedAt() + { + $transaction = Braintree\Transaction::sale([ + 'amount' => '2000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12' + ] + ])->transaction; + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::processorDeclinedAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::processorDeclinedAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_settledAt() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $http = new Braintree\Http(Braintree\Configuration::$global); + $path = Braintree\Configuration::$global->merchantPath() . '/transactions/' . $transaction->id . '/settle'; + $http->put($path); + $transaction = Braintree\Transaction::find($transaction->id); + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::settledAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::settledAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_submittedForSettlementAt() + { + $transaction = Braintree\Transaction::sale([ + 'amount' => '1000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ])->transaction; + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::submittedForSettlementAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::submittedForSettlementAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_voidedAt() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '1000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12' + ] + ]); + + $transaction = Braintree\Transaction::void($transaction->id)->transaction; + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::voidedAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::voidedAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_rangeNode_canSearchOnMultipleStatuses() + { + $transaction = Braintree\Transaction::sale([ + 'amount' => '1000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ])->transaction; + + $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC")); + $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC")); + $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC")); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::authorizedAt()->between($twenty_min_ago, $ten_min_ago), + Braintree\TransactionSearch::submittedForSettlementAt()->between($twenty_min_ago, $ten_min_ago) + ]); + + $this->assertEquals(0, $collection->maximumCount()); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::authorizedAt()->between($ten_min_ago, $ten_min_from_now), + Braintree\TransactionSearch::submittedForSettlementAt()->between($ten_min_ago, $ten_min_from_now) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function test_advancedSearchGivesIterableResult() + { + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::creditCardNumber()->startsWith("411111") + ]); + $this->assertGreaterThan(100, $collection->maximumCount()); + + $arr = []; + foreach($collection as $transaction) { + array_push($arr, $transaction->id); + } + $unique_transaction_ids = array_unique(array_values($arr)); + $this->assertEquals($collection->maximumCount(), count($unique_transaction_ids)); + } + + public function test_handles_search_timeout() + { + $this->setExpectedException('Braintree\Exception\DownForMaintenance'); + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::amount()->is('-5') + ]); + } + + public function testHandlesPayPalAccounts() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'access_token' => 'PAYPAL_ACCESS_TOKEN' + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + $paypalDetails = $result->transaction->paypalDetails; + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::paypalPaymentId()->is($paypalDetails->paymentId), + Braintree\TransactionSearch::paypalAuthorizationId()->is($paypalDetails->authorizationId), + Braintree\TransactionSearch::paypalPayerEmail()->is($paypalDetails->payerEmail) + ]); + + $this->assertEquals(1, $collection->maximumCount()); + $this->assertEquals($result->transaction->id, $collection->firstItem()->id); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionLineItemTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionLineItemTest.php new file mode 100644 index 00000000000..b56fe92fdad --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionLineItemTest.php @@ -0,0 +1,42 @@ + '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [[ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'totalAmount' => '45.15', + ]] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $lineItems = Braintree\TransactionLineItem::findAll($transaction->id); + $this->assertEquals(1, sizeof($lineItems)); + + $lineItem = $lineItems[0]; + $this->assertEquals('1.0232', $lineItem->quantity); + $this->assertEquals('Name #1', $lineItem->name); + $this->assertEquals(Braintree\TransactionLineItem::DEBIT, $lineItem->kind); + $this->assertEquals('45.1232', $lineItem->unitAmount); + $this->assertEquals('45.15', $lineItem->totalAmount); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionTest.php new file mode 100644 index 00000000000..b412426cb83 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionTest.php @@ -0,0 +1,6135 @@ + '100.00', + 'orderId' => '123', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + ], + 'customer' => [ + 'firstName' => 'Dan', + ], + 'billing' => [ + 'firstName' => 'Carl', + ], + 'shipping' => [ + 'firstName' => 'Andrew', + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $cloneResult = Braintree\Transaction::cloneTransaction( + $transaction->id, + [ + 'amount' => '123.45', + 'channel' => 'MyShoppingCartProvider', + 'options' => ['submitForSettlement' => false] + ] + ); + Test\Helper::assertPrintable($cloneResult); + $this->assertTrue($cloneResult->success); + $cloneTransaction = $cloneResult->transaction; + $this->assertEquals('Dan', $cloneTransaction->customerDetails->firstName); + $this->assertEquals('Carl', $cloneTransaction->billingDetails->firstName); + $this->assertEquals('Andrew', $cloneTransaction->shippingDetails->firstName); + $this->assertEquals('510510******5100', $cloneTransaction->creditCardDetails->maskedNumber); + $this->assertEquals('authorized', $cloneTransaction->status); + $this->assertEquals('123.45', $cloneTransaction->amount); + $this->assertEquals('MyShoppingCartProvider', $cloneTransaction->channel); + } + + public function testCreateTransactionUsingNonce() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "share" => true + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('47.00', $transaction->amount); + } + + public function testCreateEloCardTransaction() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'creditCard' => [ + 'number' => '5066991111111118', + 'expirationMonth' => '10', + 'expirationYear' => '2020', + 'cvv' => '737', + ], + 'merchantAccountId' => 'adyen_ma', + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('47.00', $transaction->amount); + } + + public function testGatewayCreateTransactionUsingNonce() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "share" => true + ]); + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $result = $gateway->transaction()->sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('47.00', $transaction->amount); + } + + public function testSaleWithIdealPaymentId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'merchantAccountId' => 'ideal_merchant_account', + 'paymentMethodNonce' => Test\Helper::generateValidIdealPaymentId(), + 'orderId' => 'ABC123', + 'options' => [ + 'submitForSettlement' => true, + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals(Braintree\PaymentInstrumentType::IDEAL_PAYMENT, $transaction->paymentInstrumentType); + $this->assertEquals('100.00', $transaction->amount); + $this->assertRegExp('/^idealpayment_\w{6,}$/', $transaction->idealPayment->idealPaymentId); + $this->assertRegExp('/^\d{16,}$/', $transaction->idealPayment->idealTransactionId); + $this->assertRegExp('/^https:\/\//', $transaction->idealPayment->imageUrl); + $this->assertNotNull($transaction->idealPayment->maskedIban); + $this->assertNotNull($transaction->idealPayment->bic); + } + + public function testCreateWithAccountTypeCredit() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationMonth' => '10', + 'expirationYear' => '2020', + 'cvv' => '737', + ], + 'options' => [ + 'creditCard' => [ + 'accountType' => 'credit' + ] + ], + 'merchantAccountId' => 'hiper_brl', + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('credit', $transaction->creditCard['accountType']); + } + + public function testCreateWithAccountTypeDebit() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationMonth' => '10', + 'expirationYear' => '2020', + 'cvv' => '737', + ], + 'options' => [ + 'submitForSettlement' => true, + 'creditCard' => [ + 'accountType' => 'debit' + ] + ], + 'merchantAccountId' => 'hiper_brl', + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('debit', $transaction->creditCard['accountType']); + } + + public function testCreateErrorsWithAccountTypeIsInvalid() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationMonth' => '10', + 'expirationYear' => '2020', + 'cvv' => '737', + ], + 'options' => [ + 'creditCard' => [ + 'accountType' => 'wrong' + ] + ], + 'merchantAccountId' => 'hiper_brl', + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('options')->forKey('creditCard')->onAttribute('accountType'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_OPTIONS_CREDIT_CARD_ACCOUNT_TYPE_IS_INVALID, $errors[0]->code); + } + + public function testCreateErrorsWithAccountTypeNotSupported() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationMonth' => '10', + 'expirationYear' => '2020', + 'cvv' => '737', + ], + 'options' => [ + 'creditCard' => [ + 'accountType' => 'credit' + ] + ], + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('options')->forKey('creditCard')->onAttribute('accountType'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_OPTIONS_CREDIT_CARD_ACCOUNT_TYPE_NOT_SUPPORTED, $errors[0]->code); + } + + public function testCreateErrorsWithAccountTypeDebitDoesNotSupportAuths() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$hiper, + 'expirationMonth' => '10', + 'expirationYear' => '2020', + 'cvv' => '737', + ], + 'options' => [ + 'creditCard' => [ + 'accountType' => 'debit' + ] + ], + 'merchantAccountId' => 'hiper_brl', + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('options')->forKey('creditCard')->onAttribute('accountType'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_OPTIONS_CREDIT_CARD_ACCOUNT_TYPE_DEBIT_DOES_NOT_SUPPORT_AUTHS, $errors[0]->code); + } + + public function testSaleAndSkipAdvancedFraudChecking() + { + $gateway = Test\Helper::advancedFraudIntegrationMerchantGateway(); + $result = $gateway->transaction()->sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'options' => [ + 'skipAdvancedFraudChecking' => true + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertFalse(property_exists($transaction, "riskData")); + } + + public function testSaleAndSkipAvs() + { + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2019', + ], + 'options' => [ + 'skipAvs' => true + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertNull($transaction->avsErrorResponseCode); + $this->assertEquals($transaction->avsStreetAddressResponseCode, 'B'); + } + + public function testSaleAndSkipCvv() + { + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2019', + ], + 'options' => [ + 'skipCvv' => true + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals($transaction->cvvResponseCode, 'B'); + } + + public function testSaleWithLevel3SummaryFields() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'shippingAmount' => '1.00', + 'discountAmount' => '2.00', + 'shipsFromPostalCode' => '12345', + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('1.00', $transaction->shippingAmount); + $this->assertEquals('2.00', $transaction->discountAmount); + $this->assertEquals('12345', $transaction->shipsFromPostalCode); + } + + public function testSaleWhenDiscountAmountFormatIsInvalid() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'discountAmount' => '123.456', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('discountAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_DISCOUNT_AMOUNT_FORMAT_IS_INVALID, $baseErrors[0]->code); + } + + public function testSaleWhenDiscountAmountCannotBeNegative() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'discountAmount' => '-2.00', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('discountAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_DISCOUNT_AMOUNT_CANNOT_BE_NEGATIVE, $baseErrors[0]->code); + } + + public function testSaleWhenDiscountAmountIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'discountAmount' => '2147483647', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('discountAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_DISCOUNT_AMOUNT_IS_TOO_LARGE, $baseErrors[0]->code); + } + + public function testSaleWhenShippingAmountFormatIsInvalid() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'shippingAmount' => '1a00', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('shippingAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SHIPPING_AMOUNT_FORMAT_IS_INVALID, $baseErrors[0]->code); + } + + public function testSaleWhenShippingAmountCannotBeNegative() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'shippingAmount' => '-1.00', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('shippingAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SHIPPING_AMOUNT_CANNOT_BE_NEGATIVE, $baseErrors[0]->code); + } + + public function testSaleWhenShippingAmountIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'shippingAmount' => '2147483647', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('shippingAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SHIPPING_AMOUNT_IS_TOO_LARGE, $baseErrors[0]->code); + } + + public function testSaleWhenShipsFromPostalCodeIsTooLong() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'shipsFromPostalCode' => '12345678901', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('shipsFromPostalCode'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SHIPS_FROM_POSTAL_CODE_IS_TOO_LONG, $baseErrors[0]->code); + } + + public function testSaleWhenShipsFromPostalCodeIsInvalid() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'shipsFromPostalCode' => [1, 2, 3], + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('shipsFromPostalCode'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SHIPS_FROM_POSTAL_CODE_IS_INVALID, $baseErrors[0]->code); + } + + public function testSaleWhenShipsFromPostalCodeInvalidCharacters() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'shipsFromPostalCode' => '1$345', + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('shipsFromPostalCode'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SHIPS_FROM_POSTAL_CODE_INVALID_CHARACTERS, $baseErrors[0]->code); + } + + public function testSale_withLineItemsZero() + { + $result = Braintree\Transaction::sale([ + 'amount' => '45.15', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $lineItems = $transaction->lineItems(); + $this->assertEquals(0, sizeof($lineItems)); + } + + public function testSale_withLineItemsSingleOnlyRequiredFields() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [[ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'totalAmount' => '45.15', + ]] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $lineItems = $transaction->lineItems(); + $this->assertEquals(1, sizeof($lineItems)); + + $lineItem = $lineItems[0]; + $this->assertEquals('1.0232', $lineItem->quantity); + $this->assertEquals('Name #1', $lineItem->name); + $this->assertEquals(Braintree\TransactionLineItem::DEBIT, $lineItem->kind); + $this->assertEquals('45.1232', $lineItem->unitAmount); + $this->assertEquals('45.15', $lineItem->totalAmount); + } + + public function testSale_withLineItemsSingleZeroAmounts() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [[ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'totalAmount' => '45.15', + 'discountAmount' => '0', + 'taxAmount' => '0', + 'unitTaxAmount' => '0', + ]] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $lineItems = $transaction->lineItems(); + $this->assertEquals(1, sizeof($lineItems)); + + $lineItem = $lineItems[0]; + $this->assertEquals('1.0232', $lineItem->quantity); + $this->assertEquals('Name #1', $lineItem->name); + $this->assertEquals(Braintree\TransactionLineItem::DEBIT, $lineItem->kind); + $this->assertEquals('45.1232', $lineItem->unitAmount); + $this->assertEquals('45.15', $lineItem->totalAmount); + $this->assertEquals('0', $lineItem->discountAmount); + $this->assertEquals('0', $lineItem->taxAmount); + $this->assertEquals('0', $lineItem->unitTaxAmount); + } + + public function testSale_withLineItemsSingle() + { + $result = Braintree\Transaction::sale([ + 'amount' => '45.15', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [[ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'description' => 'Description #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitTaxAmount' => '1.23', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + 'url' => 'https://example.com/products/23434', + ]] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $lineItems = $transaction->lineItems(); + $this->assertEquals(1, sizeof($lineItems)); + + $lineItem = $lineItems[0]; + $this->assertEquals('1.0232', $lineItem->quantity); + $this->assertEquals('Name #1', $lineItem->name); + $this->assertEquals('Description #1', $lineItem->description); + $this->assertEquals(Braintree\TransactionLineItem::DEBIT, $lineItem->kind); + $this->assertEquals('45.1232', $lineItem->unitAmount); + $this->assertEquals('1.23', $lineItem->unitTaxAmount); + $this->assertEquals('gallon', $lineItem->unitOfMeasure); + $this->assertEquals('1.02', $lineItem->discountAmount); + $this->assertEquals('4.50', $lineItem->taxAmount); + $this->assertEquals('45.15', $lineItem->totalAmount); + $this->assertEquals('23434', $lineItem->productCode); + $this->assertEquals('9SAASSD8724', $lineItem->commodityCode); + $this->assertEquals('https://example.com/products/23434', $lineItem->url); + } + + public function testSale_withLineItemsMultiple() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'description' => 'Description #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '2.02', + 'name' => 'Name #2', + 'description' => 'Description #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '5', + 'unitOfMeasure' => 'gallon', + 'totalAmount' => '45.15', + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $lineItems = $transaction->lineItems(); + $this->assertEquals(2, sizeof($lineItems)); + + $lineItem1 = null; + foreach ($lineItems as $lineItem) { + if ($lineItem->name == 'Name #1') { + $lineItem1 = $lineItem; + break; + } + } + if ($lineItem1 == null) { + $this->fail('TransactionLineItem with name \'Name #1\' not returned.'); + } + $this->assertEquals('1.0232', $lineItem1->quantity); + $this->assertEquals('Name #1', $lineItem1->name); + $this->assertEquals('Description #1', $lineItem1->description); + $this->assertEquals(Braintree\TransactionLineItem::DEBIT, $lineItem1->kind); + $this->assertEquals('45.1232', $lineItem1->unitAmount); + $this->assertEquals('gallon', $lineItem1->unitOfMeasure); + $this->assertEquals('1.02', $lineItem1->discountAmount); + $this->assertEquals('4.50', $lineItem1->taxAmount); + $this->assertEquals('45.15', $lineItem1->totalAmount); + $this->assertEquals('23434', $lineItem1->productCode); + $this->assertEquals('9SAASSD8724', $lineItem1->commodityCode); + + $lineItem2 = null; + foreach ($lineItems as $lineItem) { + if ($lineItem->name == 'Name #2') { + $lineItem2 = $lineItem; + break; + } + } + if ($lineItem2 == null) { + $this->fail('TransactionLineItem with name \'Name #2\' not returned.'); + } + $this->assertEquals('2.02', $lineItem2->quantity); + $this->assertEquals('Name #2', $lineItem2->name); + $this->assertEquals('Description #2', $lineItem2->description); + $this->assertEquals(Braintree\TransactionLineItem::CREDIT, $lineItem2->kind); + $this->assertEquals('5', $lineItem2->unitAmount); + $this->assertEquals('gallon', $lineItem2->unitOfMeasure); + $this->assertEquals('45.15', $lineItem2->totalAmount); + $this->assertEquals(null, $lineItem2->discountAmount); + $this->assertEquals(null, $lineItem2->taxAmount); + $this->assertEquals(null, $lineItem2->productCode); + $this->assertEquals(null, $lineItem2->commodityCode); + } + + public function testSale_withLineItemsValidationErrorCommodityCodeIsTooLong() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '0123456789123', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_COMMODITY_CODE_IS_TOO_LONG, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('commodityCode')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorDescriptionIsTooLong() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'description' => "This is a line item description which is far too long. Like, way too long to be practical. We don't like how long this line item description is.", + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_DESCRIPTION_IS_TOO_LONG, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('description')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorDiscountAmountIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '2147483648', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_IS_TOO_LARGE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('discountAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorDiscountAmountCannotBeNegative() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '-2', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_DISCOUNT_AMOUNT_CANNOT_BE_NEGATIVE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('discountAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorTaxAmountFormatIsInvalid() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.511', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + ], + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_TAX_AMOUNT_FORMAT_IS_INVALID, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index0')->onAttribute('taxAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorTaxAmountIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '2147483648', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + ], + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_TAX_AMOUNT_IS_TOO_LARGE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index0')->onAttribute('taxAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorTaxAmountCannotBeNegative() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '-2', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + ], + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_TAX_AMOUNT_CANNOT_BE_NEGATIVE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index0')->onAttribute('taxAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorKindIsRequired() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_KIND_IS_REQUIRED, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('kind')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorNameIsRequired() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_NAME_IS_REQUIRED, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('name')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorNameIsTooLong() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => '123456789012345678901234567890123456', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_NAME_IS_TOO_LONG, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('name')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorProductCodeIsTooLong() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '123456789012345678901234567890123456', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_PRODUCT_CODE_IS_TOO_LONG, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('productCode')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorQuantityIsRequired() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_QUANTITY_IS_REQUIRED, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('quantity')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorQuantityIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '2147483648', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_QUANTITY_IS_TOO_LARGE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('quantity')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorTotalAmountIsRequired() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_TOTAL_AMOUNT_IS_REQUIRED, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('totalAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorTotalAmountIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '2147483648', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_TOTAL_AMOUNT_IS_TOO_LARGE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('totalAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorTotalAmountMustBeGreaterThanZero() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '-2', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_TOTAL_AMOUNT_MUST_BE_GREATER_THAN_ZERO, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('totalAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorUnitAmountIsRequired() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_UNIT_AMOUNT_IS_REQUIRED, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('unitAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorUnitAmountIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\TransactionLineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\TransactionLineItem::CREDIT, + 'unitAmount' => '2147483648', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_UNIT_AMOUNT_IS_TOO_LARGE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('unitAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorUnitAmountMustBeGreaterThanZero() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\Transaction\LineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\Transaction\LineItem::CREDIT, + 'unitAmount' => '-2', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_UNIT_AMOUNT_MUST_BE_GREATER_THAN_ZERO, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('unitAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorUnitOfMeasureIsTooLong() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.0232', + 'name' => 'Name #1', + 'kind' => Braintree\Transaction\LineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.0232', + 'name' => 'Name #2', + 'kind' => Braintree\Transaction\LineItem::CREDIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => '1234567890123', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_UNIT_OF_MEASURE_IS_TOO_LONG, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('unitOfMeasure')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorUnitTaxAmountFormatIsInvalid() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.2322', + 'name' => 'Name #1', + 'kind' => Braintree\Transaction\LineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.2322', + 'name' => 'Name #2', + 'kind' => Braintree\Transaction\LineItem::CREDIT, + 'unitAmount' => '45.0122', + 'unitTaxAmount' => '2.012', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_FORMAT_IS_INVALID, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('unitTaxAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorUnitTaxAmountIsTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.2322', + 'name' => 'Name #1', + 'kind' => Braintree\Transaction\LineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitTaxAmount' => '1.23', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.2322', + 'name' => 'Name #2', + 'kind' => Braintree\Transaction\LineItem::CREDIT, + 'unitAmount' => '45.0122', + 'unitTaxAmount' => '2147483648', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_IS_TOO_LARGE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('unitTaxAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorUnitTaxAmountCannotBeNegative() + { + $result = Braintree\Transaction::sale([ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [ + [ + 'quantity' => '1.2322', + 'name' => 'Name #1', + 'kind' => Braintree\Transaction\LineItem::DEBIT, + 'unitAmount' => '45.1232', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ], + [ + 'quantity' => '1.2322', + 'name' => 'Name #2', + 'kind' => Braintree\Transaction\LineItem::CREDIT, + 'unitAmount' => '45.0122', + 'unitTaxAmount' => '-1.23', + 'unitOfMeasure' => 'gallon', + 'discountAmount' => '1.02', + 'taxAmount' => '4.50', + 'totalAmount' => '45.15', + 'productCode' => '23434', + 'commodityCode' => '9SAASSD8724', + ] + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_LINE_ITEM_UNIT_TAX_AMOUNT_CANNOT_BE_NEGATIVE, + $result->errors->forKey('transaction')->forKey('lineItems')->forKey('index1')->onAttribute('unitTaxAmount')[0]->code + ); + } + + public function testSale_withLineItemsValidationErrorTooManyLineItems() + { + $transactionParams = [ + 'amount' => '35.05', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'lineItems' => [], + ]; + + for ($i = 0; $i < 250; $i++) { + array_push($transactionParams['lineItems'], [ + 'quantity' => '2.02', + 'name' => 'Line item #' . $i, + 'kind' => Braintree\Transaction\LineItem::CREDIT, + 'unitAmount' => '5', + 'unitOfMeasure' => 'gallon', + 'totalAmount' => '10.1', + ]); + } + + $result = Braintree\Transaction::sale($transactionParams); + $this->assertFalse($result->success); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_TOO_MANY_LINE_ITEMS, + $result->errors->forKey('transaction')->onAttribute('lineItems')[0]->code + ); + } + + public function testCreateTransactionUsingFakeApplePayNonce() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$applePayAmEx + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $applePayDetails = $transaction->applePayCardDetails; + $this->assertSame(Braintree\ApplePayCard::AMEX, $applePayDetails->cardType); + $this->assertContains("AmEx ", $applePayDetails->sourceDescription); + $this->assertContains("AmEx ", $applePayDetails->paymentInstrumentName); + $this->assertTrue(intval($applePayDetails->expirationMonth) > 0); + $this->assertTrue(intval($applePayDetails->expirationYear) > 0); + $this->assertNotNull($applePayDetails->cardholderName); + } + + public function testCreateTransactionUsingRawApplePayParams() + { + $result = Braintree\Transaction::sale([ + 'amount' => '1.02', + 'applePayCard' => [ + 'number' => "370295001292109", + 'cardholderName' => "JANE SMITH", + 'cryptogram' => "AAAAAAAA/COBt84dnIEcwAA3gAAGhgEDoLABAAhAgAABAAAALnNCLw==", + 'expirationMonth' => "10", + 'expirationYear' => "17", + 'eciIndicator' => "07" + ] + ]); + $this->assertTrue($result->success); + } + + public function testCreateTransactionUsingRawApplePayParamsInSnakeCaseForBackwardsCompatibility() + { + $result = Braintree\Transaction::sale([ + 'amount' => '1.02', + 'apple_pay_card' => [ + 'number' => "370295001292109", + 'cardholder_name' => "JANE SMITH", + 'cryptogram' => "AAAAAAAA/COBt84dnIEcwAA3gAAGhgEDoLABAAhAgAABAAAALnNCLw==", + 'expiration_month' => "10", + 'expiration_year' => "17", + 'eci_indicator' => "07" + ] + ]); + $this->assertTrue($result->success); + } + + public function testCreateTransactionUsingFakeAndroidPayProxyCardNonce() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$androidPayDiscover + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $androidPayCardDetails = $transaction->androidPayCardDetails; + $this->assertSame(Braintree\CreditCard::DISCOVER, $androidPayCardDetails->cardType); + $this->assertSame("1117", $androidPayCardDetails->last4); + $this->assertNull($androidPayCardDetails->token); + $this->assertSame(Braintree\CreditCard::DISCOVER, $androidPayCardDetails->virtualCardType); + $this->assertSame("1117", $androidPayCardDetails->virtualCardLast4); + $this->assertSame(Braintree\CreditCard::DISCOVER, $androidPayCardDetails->sourceCardType); + $this->assertSame("1111", $androidPayCardDetails->sourceCardLast4); + $this->assertSame("Discover 1111", $androidPayCardDetails->sourceDescription); + $this->assertContains('android_pay', $androidPayCardDetails->imageUrl); + $this->assertTrue(intval($androidPayCardDetails->expirationMonth) > 0); + $this->assertTrue(intval($androidPayCardDetails->expirationYear) > 0); + } + + public function testCreateTransactionUsingFakeAndroidPayNetworkTokenNonce() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$androidPayMasterCard + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $androidPayCardDetails = $transaction->androidPayCardDetails; + $this->assertSame(Braintree\CreditCard::MASTER_CARD, $androidPayCardDetails->cardType); + $this->assertSame("4444", $androidPayCardDetails->last4); + $this->assertNull($androidPayCardDetails->token); + $this->assertSame(Braintree\CreditCard::MASTER_CARD, $androidPayCardDetails->virtualCardType); + $this->assertSame("4444", $androidPayCardDetails->virtualCardLast4); + $this->assertSame(Braintree\CreditCard::MASTER_CARD, $androidPayCardDetails->sourceCardType); + $this->assertSame("4444", $androidPayCardDetails->sourceCardLast4); + $this->assertSame("MasterCard 4444", $androidPayCardDetails->sourceDescription); + $this->assertContains('android_pay', $androidPayCardDetails->imageUrl); + $this->assertTrue(intval($androidPayCardDetails->expirationMonth) > 0); + $this->assertTrue(intval($androidPayCardDetails->expirationYear) > 0); + } + + public function testCreateTransactionUsingFakeAmexExpressCheckoutNonce() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'paymentMethodNonce' => Braintree\Test\Nonces::$amexExpressCheckout + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $amexExpressCheckoutCardDetails = $transaction->amexExpressCheckoutCardDetails; + + $this->assertSame(Braintree\CreditCard::AMEX, $amexExpressCheckoutCardDetails->cardType); + $this->assertSame("341111", $amexExpressCheckoutCardDetails->bin); + $this->assertSame("12/21", $amexExpressCheckoutCardDetails->cardMemberExpiryDate); + $this->assertSame("0005", $amexExpressCheckoutCardDetails->cardMemberNumber); + $this->assertNull($amexExpressCheckoutCardDetails->token); + $this->assertNotNull($amexExpressCheckoutCardDetails->sourceDescription); + $this->assertContains(".png", $amexExpressCheckoutCardDetails->imageUrl); + $this->assertTrue(intval($amexExpressCheckoutCardDetails->expirationMonth) > 0); + $this->assertTrue(intval($amexExpressCheckoutCardDetails->expirationYear) > 0); + } + + public function testCreateTransactionUsingFakeVenmoAccountNonceAndProfileId() + { + $result = Braintree\Transaction::sale(array( + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeVenmoAccountMerchantAccountId(), + 'paymentMethodNonce' => Braintree\Test\Nonces::$venmoAccount, + 'options' => [ + 'venmo' => [ + 'profileId' => "integration_venmo_merchant_public_id" + ] + ] + )); + + $this->assertTrue($result->success); + } + + public function testCreateTransactionUsingFakeVenmoAccountNonceAndProfileIdUsingSnakeCaseKeyforProfileId() + { + $result = Braintree\Transaction::sale(array( + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeVenmoAccountMerchantAccountId(), + 'paymentMethodNonce' => Braintree\Test\Nonces::$venmoAccount, + 'options' => [ + 'venmo' => [ + 'profile_id' => "integration_venmo_merchant_public_id" + ] + ] + )); + + $this->assertTrue($result->success); + } + + public function testCreateTransactionUsingFakeVenmoAccountNonce() + { + $result = Braintree\Transaction::sale(array( + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeVenmoAccountMerchantAccountId(), + 'paymentMethodNonce' => Braintree\Test\Nonces::$venmoAccount + )); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $this->assertEquals(Braintree\PaymentInstrumentType::VENMO_ACCOUNT, $transaction->paymentInstrumentType); + $venmoAccountDetails = $transaction->venmoAccountDetails; + + $this->assertNull($venmoAccountDetails->token); + $this->assertNotNull($venmoAccountDetails->sourceDescription); + $this->assertContains(".png", $venmoAccountDetails->imageUrl); + $this->assertSame("venmojoe", $venmoAccountDetails->username); + $this->assertSame("Venmo-Joe-1", $venmoAccountDetails->venmoUserId); + } + + public function testCannotCreateTransactionUsingFakeCoinbaseNonce() + { + $result = Braintree\Transaction::sale([ + 'amount' => '17.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$coinbase + ]); + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::PAYMENT_METHOD_NO_LONGER_SUPPORTED, $result->errors->forKey('transaction')->onAttribute('base')[0]->code); + } + + public function testCreateTransactionReturnsPaymentInstrumentType() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ], + "share" => true + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\PaymentInstrumentType::CREDIT_CARD, $transaction->paymentInstrumentType); + } + + public function testCloneTransactionAndSubmitForSettlement() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $cloneResult = Braintree\Transaction::cloneTransaction($transaction->id, ['amount' => '123.45', 'options' => ['submitForSettlement' => true]]); + $cloneTransaction = $cloneResult->transaction; + $this->assertEquals('submitted_for_settlement', $cloneTransaction->status); + } + + public function testCloneWithValidations() + { + $result = Braintree\Transaction::credit([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/2011' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $cloneResult = Braintree\Transaction::cloneTransaction($transaction->id, ['amount' => '123.45']); + $this->assertFalse($cloneResult->success); + + $baseErrors = $cloneResult->errors->forKey('transaction')->onAttribute('base'); + + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_CANNOT_CLONE_CREDIT, $baseErrors[0]->code); + } + + public function testSale() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertNotNull($transaction->processorAuthorizationCode); + $this->assertEquals('510510', $transaction->creditCardDetails->bin); + $this->assertEquals('5100', $transaction->creditCardDetails->last4); + $this->assertEquals('The Cardholder', $transaction->creditCardDetails->cardholderName); + $this->assertEquals(1000, $result->transaction->processorResponseCode); + $this->assertEquals("Approved", $result->transaction->processorResponseText); + $this->assertEquals(Braintree\ProcessorResponseTypes::APPROVED, $result->transaction->processorResponseType); + } + + public function testSaleWithAccessToken() + { + $credentials = Test\Braintree\OAuthTestHelper::createCredentials([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + 'merchantId' => 'integration_merchant_id', + ]); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken, + ]); + + $result = $gateway->transaction()->sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertNotNull($transaction->processorAuthorizationCode); + $this->assertEquals('510510', $transaction->creditCardDetails->bin); + $this->assertEquals('5100', $transaction->creditCardDetails->last4); + $this->assertEquals('The Cardholder', $transaction->creditCardDetails->cardholderName); + } + + public function testSaleWithRiskData() + { + $gateway = Test\Helper::advancedFraudIntegrationMerchantGateway(); + $result = $gateway->transaction()->sale([ + 'amount' => '100.00', + 'deviceSessionId' => 'abc123', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertNotNull($transaction->riskData); + $this->assertNotNull($transaction->riskData->decision); + $this->assertNotNull($transaction->riskData->id); + $this->assertNotNull($transaction->riskData->deviceDataCaptured); + $this->assertNotNull($transaction->riskData->fraudServiceProvider); + } + + public function testRecurring() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'recurring' => true, + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(true, $transaction->recurring); + } + + public function testTransactionSourceWithRecurringFirst() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'transactionSource' => 'recurring_first', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(true, $transaction->recurring); + } + + public function testTransactionSourceWithRecurring() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'transactionSource' => 'recurring', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(true, $transaction->recurring); + } + + public function testTransactionSourceWithMerchant() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'transactionSource' => 'merchant', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(false, $transaction->recurring); + } + + public function testTransactionSourceWithMoto() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'transactionSource' => 'moto', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(False, $transaction->recurring); + } + + public function testTransactionSourceInvalid() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'transactionSource' => 'invalid_value', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_TRANSACTION_SOURCE_IS_INVALID, $result->errors->forKey('transaction')->onAttribute('transactionSource')[0]->code); + } + + public function testSale_withServiceFee() + { + $result = Braintree\Transaction::sale([ + 'amount' => '10.00', + 'merchantAccountId' => Test\Helper::nonDefaultSubMerchantAccountId(), + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'serviceFeeAmount' => '1.00' + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('1.00', $transaction->serviceFeeAmount); + } + + public function testSale_isInvalidIfTransactionMerchantAccountIsNotSub() + { + $result = Braintree\Transaction::sale([ + 'amount' => '10.00', + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'serviceFeeAmount' => '1.00' + ]); + $this->assertFalse($result->success); + $transaction = $result->transaction; + $serviceFeeErrors = $result->errors->forKey('transaction')->onAttribute('serviceFeeAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SERVICE_FEE_AMOUNT_NOT_ALLOWED_ON_MASTER_MERCHANT_ACCOUNT, $serviceFeeErrors[0]->code); + } + + public function testSale_isInvalidIfSubMerchantAccountHasNoServiceFee() + { + $result = Braintree\Transaction::sale([ + 'amount' => '10.00', + 'merchantAccountId' => Test\Helper::nonDefaultSubMerchantAccountId(), + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertFalse($result->success); + $transaction = $result->transaction; + $serviceFeeErrors = $result->errors->forKey('transaction')->onAttribute('merchantAccountId'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SUB_MERCHANT_ACCOUNT_REQUIRES_SERVICE_FEE_AMOUNT, $serviceFeeErrors[0]->code); + } + + public function testSale_withVenmoSdkSession() + { + $result = Braintree\Transaction::sale([ + 'amount' => '10.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'venmoSdkSession' => Braintree\Test\VenmoSdk::getTestSession() + ] + ]); + $this->assertEquals(true, $result->success); + $transaction = $result->transaction; + $this->assertEquals(false, $transaction->creditCardDetails->venmoSdk); + } + + public function testSale_withVenmoSdkPaymentMethodCode() + { + $result = Braintree\Transaction::sale([ + 'amount' => '10.00', + 'venmoSdkPaymentMethodCode' => Braintree\Test\VenmoSdk::$visaPaymentMethodCode + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals("411111", $transaction->creditCardDetails->bin); + } + + public function testSale_withLevel2Attributes() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'expirationDate' => '05/2011', + 'number' => '5105105105105100' + ], + 'taxExempt' => true, + 'taxAmount' => '10.00', + 'purchaseOrderNumber' => '12345' + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $this->assertTrue($transaction->taxExempt); + $this->assertEquals('10.00', $transaction->taxAmount); + $this->assertEquals('12345', $transaction->purchaseOrderNumber); + } + + public function testSale_withInvalidTaxAmountAttribute() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'expirationDate' => '05/2011', + 'number' => '5105105105105100' + ], + 'taxAmount' => 'abc' + ]); + + $this->assertFalse($result->success); + + $taxAmountErrors = $result->errors->forKey('transaction')->onAttribute('taxAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_TAX_AMOUNT_FORMAT_IS_INVALID, $taxAmountErrors[0]->code); + } + + public function testSale_withServiceFeeTooLarge() + { + $result = Braintree\Transaction::sale([ + 'amount' => '10.00', + 'merchantAccountId' => Test\Helper::nonDefaultSubMerchantAccountId(), + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'serviceFeeAmount' => '20.00' + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('serviceFeeAmount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SERVICE_FEE_AMOUNT_IS_TOO_LARGE, $errors[0]->code); + } + + public function testSale_withTooLongPurchaseOrderAttribute() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'expirationDate' => '05/2011', + 'number' => '5105105105105100' + ], + 'purchaseOrderNumber' => 'aaaaaaaaaaaaaaaaaa' + ]); + + $this->assertFalse($result->success); + + $purchaseOrderNumberErrors = $result->errors->forKey('transaction')->onAttribute('purchaseOrderNumber'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PURCHASE_ORDER_NUMBER_IS_TOO_LONG, $purchaseOrderNumberErrors[0]->code); + } + + public function testSale_withInvalidPurchaseOrderNumber() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'expirationDate' => '05/2011', + 'number' => '5105105105105100' + ], + 'purchaseOrderNumber' => "\x80\x90\xA0" + ]); + + $this->assertFalse($result->success); + + $purchaseOrderNumberErrors = $result->errors->forKey('transaction')->onAttribute('purchaseOrderNumber'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PURCHASE_ORDER_NUMBER_IS_INVALID, $purchaseOrderNumberErrors[0]->code); + } + + public function testSale_withAllAttributes() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'orderId' => '123', + 'channel' => 'MyShoppingCardProvider', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => '5105105105105100', + 'expirationDate' => '05/2011', + 'cvv' => '123' + ], + 'customer' => [ + 'firstName' => 'Dan', + 'lastName' => 'Smith', + 'company' => 'Braintree', + 'email' => 'dan@example.com', + 'phone' => '419-555-1234', + 'fax' => '419-555-1235', + 'website' => 'http://braintreepayments.com' + ], + 'billing' => [ + 'firstName' => 'Carl', + 'lastName' => 'Jones', + 'company' => 'Braintree', + 'streetAddress' => '123 E Main St', + 'extendedAddress' => 'Suite 403', + 'locality' => 'Chicago', + 'region' => 'IL', + 'postalCode' => '60622', + 'countryName' => 'United States of America', + 'countryCodeAlpha2' => 'US', + 'countryCodeAlpha3' => 'USA', + 'countryCodeNumeric' => '840' + ], + 'shipping' => [ + 'firstName' => 'Andrew', + 'lastName' => 'Mason', + 'company' => 'Braintree', + 'streetAddress' => '456 W Main St', + 'extendedAddress' => 'Apt 2F', + 'locality' => 'Bartlett', + 'region' => 'IL', + 'postalCode' => '60103', + 'countryName' => 'United States of America', + 'countryCodeAlpha2' => 'US', + 'countryCodeAlpha3' => 'USA', + 'countryCodeNumeric' => '840' + ] + ]); + Test\Helper::assertPrintable($result); + $this->assertTrue($result->success); + $transaction = $result->transaction; + + $this->assertNotNull($transaction->id); + $this->assertInstanceOf('DateTime', $transaction->authorizationExpiresAt); + $this->assertInstanceOf('DateTime', $transaction->updatedAt); + $this->assertInstanceOf('DateTime', $transaction->createdAt); + $this->assertNull($transaction->refundId); + + $this->assertEquals(Test\Helper::defaultMerchantAccountId(), $transaction->merchantAccountId); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('USD', $transaction->currencyIsoCode); + $this->assertEquals('123', $transaction->orderId); + $this->assertEquals('MyShoppingCardProvider', $transaction->channel); + $this->assertEquals('MasterCard', $transaction->creditCardDetails->cardType); + $this->assertEquals('1000', $transaction->processorResponseCode); + $this->assertEquals('Approved', $transaction->processorResponseText); + $this->assertNull($transaction->voiceReferralNumber); + $this->assertFalse($transaction->taxExempt); + + $this->assertEquals('M', $transaction->avsPostalCodeResponseCode); + $this->assertEquals('M', $transaction->avsStreetAddressResponseCode); + $this->assertEquals('M', $transaction->cvvResponseCode); + + $this->assertEquals('Dan', $transaction->customerDetails->firstName); + $this->assertEquals('Smith', $transaction->customerDetails->lastName); + $this->assertEquals('Braintree', $transaction->customerDetails->company); + $this->assertEquals('dan@example.com', $transaction->customerDetails->email); + $this->assertEquals('419-555-1234', $transaction->customerDetails->phone); + $this->assertEquals('419-555-1235', $transaction->customerDetails->fax); + $this->assertEquals('http://braintreepayments.com', $transaction->customerDetails->website); + + $this->assertEquals('Carl', $transaction->billingDetails->firstName); + $this->assertEquals('Jones', $transaction->billingDetails->lastName); + $this->assertEquals('Braintree', $transaction->billingDetails->company); + $this->assertEquals('123 E Main St', $transaction->billingDetails->streetAddress); + $this->assertEquals('Suite 403', $transaction->billingDetails->extendedAddress); + $this->assertEquals('Chicago', $transaction->billingDetails->locality); + $this->assertEquals('IL', $transaction->billingDetails->region); + $this->assertEquals('60622', $transaction->billingDetails->postalCode); + $this->assertEquals('United States of America', $transaction->billingDetails->countryName); + $this->assertEquals('US', $transaction->billingDetails->countryCodeAlpha2); + $this->assertEquals('USA', $transaction->billingDetails->countryCodeAlpha3); + $this->assertEquals('840', $transaction->billingDetails->countryCodeNumeric); + + $this->assertEquals('Andrew', $transaction->shippingDetails->firstName); + $this->assertEquals('Mason', $transaction->shippingDetails->lastName); + $this->assertEquals('Braintree', $transaction->shippingDetails->company); + $this->assertEquals('456 W Main St', $transaction->shippingDetails->streetAddress); + $this->assertEquals('Apt 2F', $transaction->shippingDetails->extendedAddress); + $this->assertEquals('Bartlett', $transaction->shippingDetails->locality); + $this->assertEquals('IL', $transaction->shippingDetails->region); + $this->assertEquals('60103', $transaction->shippingDetails->postalCode); + $this->assertEquals('United States of America', $transaction->shippingDetails->countryName); + $this->assertEquals('US', $transaction->shippingDetails->countryCodeAlpha2); + $this->assertEquals('USA', $transaction->shippingDetails->countryCodeAlpha3); + $this->assertEquals('840', $transaction->shippingDetails->countryCodeNumeric); + + $this->assertNotNull($transaction->processorAuthorizationCode); + $this->assertEquals('510510', $transaction->creditCardDetails->bin); + $this->assertEquals('5100', $transaction->creditCardDetails->last4); + $this->assertEquals('510510******5100', $transaction->creditCardDetails->maskedNumber); + $this->assertEquals('The Cardholder', $transaction->creditCardDetails->cardholderName); + $this->assertEquals('05', $transaction->creditCardDetails->expirationMonth); + $this->assertEquals('2011', $transaction->creditCardDetails->expirationYear); + $this->assertNotNull($transaction->creditCardDetails->imageUrl); + } + + public function testSale_withCustomFields() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'customFields' => [ + 'store_me' => 'custom value' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $customFields = $transaction->customFields; + $this->assertEquals('custom value', $customFields['store_me']); + } + + public function testSale_withExpirationMonthAndYear() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationMonth' => '5', + 'expirationYear' => '2012' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('05', $transaction->creditCardDetails->expirationMonth); + $this->assertEquals('2012', $transaction->creditCardDetails->expirationYear); + } + + public function testSale_underscoresAllCustomFields() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'customFields' => [ + 'storeMe' => 'custom value' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $customFields = $transaction->customFields; + $this->assertEquals('custom value', $customFields['store_me']); + } + + public function testSale_withInvalidCustomField() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'customFields' => [ + 'invalidKey' => 'custom value' + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('customFields'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_CUSTOM_FIELD_IS_INVALID, $errors[0]->code); + $this->assertEquals('Custom field is invalid: invalidKey.', $errors[0]->message); + } + + public function testSale_withMerchantAccountId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Test\Helper::nonDefaultMerchantAccountId(), $transaction->merchantAccountId); + } + + public function testSale_withoutMerchantAccountIdFallsBackToDefault() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Test\Helper::defaultMerchantAccountId(), $transaction->merchantAccountId); + } + + public function testSale_withShippingAddressId() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/12' + ] + ])->customer; + + $address = Braintree\Address::create([ + 'customerId' => $customer->id, + 'streetAddress' => '123 Fake St.' + ])->address; + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'customerId' => $customer->id, + 'shippingAddressId' => $address->id + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('123 Fake St.', $transaction->shippingDetails->streetAddress); + $this->assertEquals($address->id, $transaction->shippingDetails->id); + } + + public function testSale_withBillingAddressId() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/12' + ] + ])->customer; + + $address = Braintree\Address::create([ + 'customerId' => $customer->id, + 'streetAddress' => '123 Fake St.' + ])->address; + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'customerId' => $customer->id, + 'billingAddressId' => $address->id + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('123 Fake St.', $transaction->billingDetails->streetAddress); + $this->assertEquals($address->id, $transaction->billingDetails->id); + } + + public function testSaleNoValidate() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('510510', $transaction->creditCardDetails->bin); + $this->assertEquals('5100', $transaction->creditCardDetails->last4); + } + + public function testSale_withSoftDecline() + { + + $gateway = Test\Helper::integrationMerchantGateway(); + $result = $gateway->transaction()->sale([ + 'amount' => Braintree\Test\TransactionAmounts::$decline, + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Transaction::PROCESSOR_DECLINED, $result->transaction->status); + $this->assertEquals(2000, $result->transaction->processorResponseCode); + $this->assertEquals("Do Not Honor", $result->transaction->processorResponseText); + $this->assertEquals(Braintree\ProcessorResponseTypes::SOFT_DECLINED, $result->transaction->processorResponseType); + $this->assertEquals("2000 : Do Not Honor", $result->transaction->additionalProcessorResponse); + } + + public function testSale_withHardDecline() + { + + $gateway = Test\Helper::integrationMerchantGateway(); + $result = $gateway->transaction()->sale([ + 'amount' => Braintree\Test\TransactionAmounts::$hardDecline, + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Transaction::PROCESSOR_DECLINED, $result->transaction->status); + $this->assertEquals(2015, $result->transaction->processorResponseCode); + $this->assertEquals("Transaction Not Allowed", $result->transaction->processorResponseText); + $this->assertEquals(Braintree\ProcessorResponseTypes::HARD_DECLINED, $result->transaction->processorResponseType); + $this->assertEquals("2015 : Transaction Not Allowed", $result->transaction->additionalProcessorResponse); + } + + public function testSale_withExistingCustomer() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ])->customer; + + $transaction = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'customerId' => $customer->id, + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/12' + ] + ])->transaction; + $this->assertEquals($transaction->creditCardDetails->maskedNumber, '401288******1881'); + $this->assertNull($transaction->vaultCreditCard()); + } + + public function testSale_andStoreShippingAddressInVault() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ])->customer; + + $transaction = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'customerId' => $customer->id, + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/12' + ], + 'shipping' => [ + 'firstName' => 'Darren', + 'lastName' => 'Stevens' + ], + 'options' => [ + 'storeInVault' => true, + 'storeShippingAddressInVault' => true + ] + ])->transaction; + + $customer = Braintree\Customer::find($customer->id); + $this->assertEquals('Darren', $customer->addresses[0]->firstName); + $this->assertEquals('Stevens', $customer->addresses[0]->lastName); + } + + public function testSale_withExistingCustomer_storeInVault() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jones', + 'company' => 'Jones Co.', + 'email' => 'mike.jones@example.com', + 'phone' => '419.555.1234', + 'fax' => '419.555.1235', + 'website' => 'http://example.com' + ])->customer; + + $transaction = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'customerId' => $customer->id, + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/12' + ], + 'options' => [ + 'storeInVault' => true + ] + ])->transaction; + $this->assertEquals($transaction->creditCardDetails->maskedNumber, '401288******1881'); + $this->assertEquals($transaction->vaultCreditCard()->maskedNumber, '401288******1881'); + } + + public function testCredit() + { + $result = Braintree\Transaction::credit([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status); + $this->assertEquals(Braintree\Transaction::CREDIT, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('510510', $transaction->creditCardDetails->bin); + $this->assertEquals('5100', $transaction->creditCardDetails->last4); + } + + public function testCreditNoValidate() + { + $transaction = Braintree\Transaction::creditNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::CREDIT, $transaction->type); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('510510', $transaction->creditCardDetails->bin); + $this->assertEquals('5100', $transaction->creditCardDetails->last4); + } + + public function testCredit_withMerchantAccountId() + { + $result = Braintree\Transaction::credit([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Test\Helper::nonDefaultMerchantAccountId(), $transaction->merchantAccountId); + } + + public function testCredit_withoutMerchantAccountIdFallsBackToDefault() + { + $result = Braintree\Transaction::credit([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Test\Helper::defaultMerchantAccountId(), $transaction->merchantAccountId); + } + + public function testCredit_withServiceFeeNotAllowed() + { + $result = Braintree\Transaction::credit([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'serviceFeeAmount' => '12.75' + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SERVICE_FEE_IS_NOT_ALLOWED_ON_CREDITS, $errors[0]->code); + } + + public function testSubmitForSettlement_nullAmount() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id); + $this->assertEquals(true, $submitResult->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitResult->transaction->status); + $this->assertEquals('100.00', $submitResult->transaction->amount); + } + + public function testSubmitForSettlement_amountLessThanServiceFee() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '10.00', + 'merchantAccountId' => Test\Helper::nonDefaultSubMerchantAccountId(), + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'serviceFeeAmount' => '5.00' + ]); + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id, '1.00'); + $errors = $submitResult->errors->forKey('transaction')->onAttribute('amount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SETTLEMENT_AMOUNT_IS_LESS_THAN_SERVICE_FEE_AMOUNT, $errors[0]->code); + } + + public function testSubmitForSettlement_withAmount() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id, '50.00'); + $this->assertEquals(true, $submitResult->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitResult->transaction->status); + $this->assertEquals('50.00', $submitResult->transaction->amount); + } + + public function testSubmitForSettlement_withOrderId() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id, '67.00', ['orderId' => 'ABC123']); + $this->assertEquals(true, $submitResult->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitResult->transaction->status); + $this->assertEquals('ABC123', $submitResult->transaction->orderId); + $this->assertEquals('67.00', $submitResult->transaction->amount); + } + + public function testSubmitForSettlement_withDescriptor() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $params = [ + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]; + + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id, '67.00', $params); + $this->assertEquals(true, $submitResult->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitResult->transaction->status); + $this->assertEquals('123*123456789012345678', $submitResult->transaction->descriptor->name); + $this->assertEquals('3334445555', $submitResult->transaction->descriptor->phone); + $this->assertEquals('ebay.com', $submitResult->transaction->descriptor->url); + } + + public function testSubmitForSettlement_withInvalidParams() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $params = ['invalid' => 'invalid']; + + $this->setExpectedException('InvalidArgumentException', 'invalid keys: invalid'); + Braintree\Transaction::submitForSettlement($transaction->id, '67.00', $params); + } + + public function testSubmitForSettlementNoValidate_whenValidWithoutAmount() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submittedTransaction = Braintree\Transaction::submitForSettlementNoValidate($transaction->id); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submittedTransaction->status); + $this->assertEquals('100.00', $submittedTransaction->amount); + } + + public function testSubmitForSettlementNoValidate_whenValidWithAmount() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submittedTransaction = Braintree\Transaction::submitForSettlementNoValidate($transaction->id, '99.00'); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submittedTransaction->status); + $this->assertEquals('99.00', $submittedTransaction->amount); + } + + public function testSubmitForSettlementNoValidate_whenInvalid() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + $submittedTransaction = Braintree\Transaction::submitForSettlementNoValidate($transaction->id, '101.00'); + } + + public function testUpdateDetails() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $updateOptions = [ + 'amount' => '90.00', + 'orderId' => '123', + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]; + + $result = Braintree\Transaction::updateDetails($transaction->id, $updateOptions); + $this->assertEquals(true, $result->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $result->transaction->status); + $this->assertEquals('90.00', $result->transaction->amount); + } + + public function testUpdateDetails_withInvalidParams() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $updateOptions = [ + 'amount' => '90.00', + 'invalid' => 'some value' + ]; + + $this->setExpectedException('InvalidArgumentException', 'invalid keys: invalid'); + Braintree\Transaction::updateDetails($transaction->id, $updateOptions); + } + + public function testUpdateDetails_withInvalidAmount() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $updateOptions = [ + 'amount' => '900.00', + 'orderId' => '123', + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]; + + $result = Braintree\Transaction::updateDetails($transaction->id, $updateOptions); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('amount'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_SETTLEMENT_AMOUNT_IS_TOO_LARGE, $errors[0]->code); + + } + + public function testUpdateDetails_withInvalidDescriptor() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $updateOptions = [ + 'amount' => '90.00', + 'orderId' => '123', + 'descriptor' => [ + 'name' => 'invalid name', + 'phone' => 'invalid phone', + 'url' => 'invalid way too long url' + ] + ]; + + $result = Braintree\Transaction::updateDetails($transaction->id, $updateOptions); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('descriptor')->onAttribute('name'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_NAME_FORMAT_IS_INVALID, $errors[0]->code); + + $errors = $result->errors->forKey('transaction')->forKey('descriptor')->onAttribute('phone'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_PHONE_FORMAT_IS_INVALID, $errors[0]->code); + + $errors = $result->errors->forKey('transaction')->forKey('descriptor')->onAttribute('url'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_URL_FORMAT_IS_INVALID, $errors[0]->code); + } + + public function testUpdateDetails_withInvalidOrderId() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $updateOptions = [ + 'amount' => '90.00', + 'orderId' => str_repeat('x', 256), + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]; + + $result = Braintree\Transaction::updateDetails($transaction->id, $updateOptions); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('orderId'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_ORDER_ID_IS_TOO_LONG, $errors[0]->code); + } + + public function testUpdateDetails_withInvalidProcessor() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$amexPayWithPoints['Success'], + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $updateOptions = [ + 'amount' => '90.00', + 'orderId' => '123', + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]; + + $result = Braintree\Transaction::updateDetails($transaction->id, $updateOptions); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_DETAILS, $errors[0]->code); + } + + public function testUpdateDetails_withBadStatus() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $updateOptions = [ + 'amount' => '90.00', + 'orderId' => '123', + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]; + + $result = Braintree\Transaction::updateDetails($transaction->id, $updateOptions); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_CANNOT_UPDATE_DETAILS_NOT_SUBMITTED_FOR_SETTLEMENT, $errors[0]->code); + } + + public function testVoid() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $voidResult = Braintree\Transaction::void($transaction->id); + $this->assertEquals(true, $voidResult->success); + $this->assertEquals(Braintree\Transaction::VOIDED, $voidResult->transaction->status); + } + + public function test_countryValidationError_inconsistency() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'billing' => [ + 'countryCodeAlpha2' => 'AS', + 'countryCodeAlpha3' => 'USA' + ] + ]); + $this->assertFalse($result->success); + + $errors = $result->errors->forKey('transaction')->forKey('billing')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_INCONSISTENT_COUNTRY, $errors[0]->code); + } + + public function test_countryValidationError_incorrectAlpha2() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'billing' => [ + 'countryCodeAlpha2' => 'ZZ' + ] + ]); + $this->assertFalse($result->success); + + $errors = $result->errors->forKey('transaction')->forKey('billing')->onAttribute('countryCodeAlpha2'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_COUNTRY_CODE_ALPHA2_IS_NOT_ACCEPTED, $errors[0]->code); + } + + public function test_countryValidationError_incorrectAlpha3() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'billing' => [ + 'countryCodeAlpha3' => 'ZZZ' + ] + ]); + $this->assertFalse($result->success); + + $errors = $result->errors->forKey('transaction')->forKey('billing')->onAttribute('countryCodeAlpha3'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_COUNTRY_CODE_ALPHA3_IS_NOT_ACCEPTED, $errors[0]->code); + } + + public function test_countryValidationError_incorrectNumericCode() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'billing' => [ + 'countryCodeNumeric' => '000' + ] + ]); + $this->assertFalse($result->success); + + $errors = $result->errors->forKey('transaction')->forKey('billing')->onAttribute('countryCodeNumeric'); + $this->assertEquals(Braintree\Error\Codes::ADDRESS_COUNTRY_CODE_NUMERIC_IS_NOT_ACCEPTED, $errors[0]->code); + } + + public function testVoid_withValidationError() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $voided = Braintree\Transaction::voidNoValidate($transaction->id); + $this->assertEquals(Braintree\Transaction::VOIDED, $voided->status); + $result = Braintree\Transaction::void($transaction->id); + $this->assertEquals(false, $result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_CANNOT_BE_VOIDED, $errors[0]->code); + } + + public function testVoidNoValidate() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $voided = Braintree\Transaction::voidNoValidate($transaction->id); + $this->assertEquals(Braintree\Transaction::VOIDED, $voided->status); + } + + public function testVoidNoValidate_throwsIfNotInvalid() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $voided = Braintree\Transaction::voidNoValidate($transaction->id); + $this->assertEquals(Braintree\Transaction::VOIDED, $voided->status); + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + $voided = Braintree\Transaction::voidNoValidate($transaction->id); + } + + public function testFind() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $transaction = Braintree\Transaction::find($result->transaction->id); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('510510', $transaction->creditCardDetails->bin); + $this->assertEquals('5100', $transaction->creditCardDetails->last4); + } + + public function testFindExposesDisbursementDetails() + { + $transaction = Braintree\Transaction::find("deposittransaction"); + + $this->assertEquals(true, $transaction->isDisbursed()); + + $disbursementDetails = $transaction->disbursementDetails; + $this->assertEquals('100.00', $disbursementDetails->settlementAmount); + $this->assertEquals('USD', $disbursementDetails->settlementCurrencyIsoCode); + $this->assertEquals('1', $disbursementDetails->settlementCurrencyExchangeRate); + $this->assertEquals(false, $disbursementDetails->fundsHeld); + $this->assertEquals(true, $disbursementDetails->success); + $this->assertEquals(new DateTime('2013-04-10'), $disbursementDetails->disbursementDate); + } + + public function testFindExposesAuthorizationAdjustments() + { + $transaction = Braintree\Transaction::find("authadjustmenttransaction"); + + $authorizationAdjustment = $transaction->authorizationAdjustments[0]; + $this->assertEquals('-20.00', $authorizationAdjustment->amount); + $this->assertInstanceOf('DateTime', $authorizationAdjustment->timestamp); + $this->assertEquals(true, $authorizationAdjustment->success); + $this->assertEquals('1000', $authorizationAdjustment->processorResponseCode); + $this->assertEquals('Approved', $authorizationAdjustment->processorResponseText); + $this->assertEquals(Braintree\ProcessorResponseTypes::APPROVED, $authorizationAdjustment->processorResponseType); + } + + public function testFindExposesAuthorizationAdjustmentsSoftDeclined() + { + $transaction = Braintree\Transaction::find("authadjustmenttransactionsoftdeclined"); + + $authorizationAdjustment = $transaction->authorizationAdjustments[0]; + $this->assertEquals('-20.00', $authorizationAdjustment->amount); + $this->assertInstanceOf('DateTime', $authorizationAdjustment->timestamp); + $this->assertEquals(false, $authorizationAdjustment->success); + $this->assertEquals('3000', $authorizationAdjustment->processorResponseCode); + $this->assertEquals('Processor Network Unavailable - Try Again', $authorizationAdjustment->processorResponseText); + $this->assertEquals(Braintree\ProcessorResponseTypes::SOFT_DECLINED, $authorizationAdjustment->processorResponseType); + } + + public function testFindExposesAuthorizationAdjustmentsHardDeclined() + { + $transaction = Braintree\Transaction::find("authadjustmenttransactionharddeclined"); + + $authorizationAdjustment = $transaction->authorizationAdjustments[0]; + $this->assertEquals('-20.00', $authorizationAdjustment->amount); + $this->assertInstanceOf('DateTime', $authorizationAdjustment->timestamp); + $this->assertEquals(false, $authorizationAdjustment->success); + $this->assertEquals('2015', $authorizationAdjustment->processorResponseCode); + $this->assertEquals('Transaction Not Allowed', $authorizationAdjustment->processorResponseText); + $this->assertEquals(Braintree\ProcessorResponseTypes::HARD_DECLINED, $authorizationAdjustment->processorResponseType); + } + + public function testFindExposesDisputes() + { + $transaction = Braintree\Transaction::find("disputedtransaction"); + + $dispute = $transaction->disputes[0]; + $this->assertEquals('250.00', $dispute->amount); + $this->assertEquals('USD', $dispute->currencyIsoCode); + $this->assertEquals(Braintree\Dispute::FRAUD, $dispute->reason); + $this->assertEquals(Braintree\Dispute::WON, $dispute->status); + $this->assertEquals(new DateTime('2014-03-01'), $dispute->receivedDate); + $this->assertEquals(new DateTime('2014-03-21'), $dispute->replyByDate); + $this->assertEquals("disputedtransaction", $dispute->transactionDetails->id); + $this->assertEquals("1000.00", $dispute->transactionDetails->amount); + $this->assertEquals(Braintree\Dispute::CHARGEBACK, $dispute->kind); + $this->assertEquals(new DateTime('2014-03-01'), $dispute->dateOpened); + $this->assertEquals(new DateTime('2014-03-07'), $dispute->dateWon); + } + + public function testFindExposesThreeDSecureInfo() + { + $transaction = Braintree\Transaction::find("threedsecuredtransaction"); + + $info = $transaction->threeDSecureInfo; + $this->assertEquals("Y", $info->enrolled); + $this->assertEquals("authenticate_successful", $info->status); + $this->assertTrue($info->liabilityShifted); + $this->assertTrue($info->liabilityShiftPossible); + } + + public function testFindExposesNullThreeDSecureInfo() + { + $transaction = Braintree\Transaction::find("settledtransaction"); + + $this->assertNull($transaction->threeDSecureInfo); + } + + public function testFindExposesRetrievals() + { + $transaction = Braintree\Transaction::find("retrievaltransaction"); + + $dispute = $transaction->disputes[0]; + $this->assertEquals('1000.00', $dispute->amount); + $this->assertEquals('USD', $dispute->currencyIsoCode); + $this->assertEquals(Braintree\Dispute::RETRIEVAL, $dispute->reason); + $this->assertEquals(Braintree\Dispute::OPEN, $dispute->status); + $this->assertEquals("retrievaltransaction", $dispute->transactionDetails->id); + $this->assertEquals("1000.00", $dispute->transactionDetails->amount); + } + + public function testFindExposesPayPalDetails() + { + $transaction = Braintree\Transaction::find("settledtransaction"); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->assertNotNull($transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->authorizationId); + $this->assertNotNull($transaction->paypalDetails->payerId); + $this->assertNotNull($transaction->paypalDetails->payerFirstName); + $this->assertNotNull($transaction->paypalDetails->payerLastName); + $this->assertNotNull($transaction->paypalDetails->payerStatus); + $this->assertNotNull($transaction->paypalDetails->sellerProtectionStatus); + $this->assertNotNull($transaction->paypalDetails->captureId); + $this->assertNotNull($transaction->paypalDetails->refundId); + $this->assertNotNull($transaction->paypalDetails->transactionFeeAmount); + $this->assertNotNull($transaction->paypalDetails->transactionFeeCurrencyIsoCode); + } + + public function testSale_storeInVault() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'Card Holder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'customer' => [ + 'firstName' => 'Dan', + 'lastName' => 'Smith', + 'company' => 'Braintree', + 'email' => 'dan@example.com', + 'phone' => '419-555-1234', + 'fax' => '419-555-1235', + 'website' => 'http://getbraintree.com' + ], + 'options' => [ + 'storeInVault' => true + ] + ]); + $this->assertNotNull($transaction->creditCardDetails->token); + $creditCard = $transaction->vaultCreditCard(); + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('Card Holder', $creditCard->cardholderName); + $customer = $transaction->vaultCustomer(); + $this->assertEquals('Dan', $customer->firstName); + $this->assertEquals('Smith', $customer->lastName); + $this->assertEquals('Braintree', $customer->company); + $this->assertEquals('dan@example.com', $customer->email); + $this->assertEquals('419-555-1234', $customer->phone); + $this->assertEquals('419-555-1235', $customer->fax); + $this->assertEquals('http://getbraintree.com', $customer->website); + } + + public function testSale_storeInVaultOnSuccessWithSuccessfulTransaction() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'cardholderName' => 'Card Holder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'customer' => [ + 'firstName' => 'Dan', + 'lastName' => 'Smith', + 'company' => 'Braintree', + 'email' => 'dan@example.com', + 'phone' => '419-555-1234', + 'fax' => '419-555-1235', + 'website' => 'http://getbraintree.com' + ], + 'options' => [ + 'storeInVaultOnSuccess' => true + ] + ]); + $this->assertNotNull($transaction->creditCardDetails->token); + $creditCard = $transaction->vaultCreditCard(); + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('Card Holder', $creditCard->cardholderName); + $customer = $transaction->vaultCustomer(); + $this->assertEquals('Dan', $customer->firstName); + $this->assertEquals('Smith', $customer->lastName); + $this->assertEquals('Braintree', $customer->company); + $this->assertEquals('dan@example.com', $customer->email); + $this->assertEquals('419-555-1234', $customer->phone); + $this->assertEquals('419-555-1235', $customer->fax); + $this->assertEquals('http://getbraintree.com', $customer->website); + } + + public function testSale_storeInVaultOnSuccessWithFailedTransaction() + { + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$decline, + 'creditCard' => [ + 'cardholderName' => 'Card Holder', + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'customer' => [ + 'firstName' => 'Dan', + 'lastName' => 'Smith', + 'company' => 'Braintree', + 'email' => 'dan@example.com', + 'phone' => '419-555-1234', + 'fax' => '419-555-1235', + 'website' => 'http://getbraintree.com' + ], + 'options' => [ + 'storeInVaultOnSuccess' => true + ] + ]); + $transaction = $result->transaction; + $this->assertNull($transaction->creditCardDetails->token); + $this->assertNull($transaction->vaultCreditCard()); + $this->assertNull($transaction->customerDetails->id); + $this->assertNull($transaction->vaultCustomer()); + } + + public function testSale_withFraudParams() + { + $result = Braintree\Transaction::sale([ + 'deviceSessionId' => '123abc', + 'fraudMerchantId' => '456', + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ] + ]); + + $this->assertTrue($result->success); + } + + public function testSale_withRiskData() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'riskData' => [ + 'customer_browser' => 'IE5', + 'customer_ip' => '192.168.0.1' + ] + ]); + + $this->assertTrue($result->success); + } + + public function testSale_withDescriptor() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('123*123456789012345678', $transaction->descriptor->name); + $this->assertEquals('3334445555', $transaction->descriptor->phone); + $this->assertEquals('ebay.com', $transaction->descriptor->url); + } + + public function testSale_withDescriptorValidation() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'descriptor' => [ + 'name' => 'badcompanyname12*badproduct12', + 'phone' => '%bad4445555', + 'url' => '12345678901234' + ] + ]); + $this->assertFalse($result->success); + $transaction = $result->transaction; + + $errors = $result->errors->forKey('transaction')->forKey('descriptor')->onAttribute('name'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_NAME_FORMAT_IS_INVALID, $errors[0]->code); + + $errors = $result->errors->forKey('transaction')->forKey('descriptor')->onAttribute('phone'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_PHONE_FORMAT_IS_INVALID, $errors[0]->code); + + $errors = $result->errors->forKey('transaction')->forKey('descriptor')->onAttribute('url'); + $this->assertEquals(Braintree\Error\Codes::DESCRIPTOR_URL_FORMAT_IS_INVALID, $errors[0]->code); + } + + public function testSale_withHoldInEscrow() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::nonDefaultSubMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'holdInEscrow' => true + ], + 'serviceFeeAmount' => '1.00' + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::ESCROW_HOLD_PENDING, $transaction->escrowStatus); + } + + public function testSale_withHoldInEscrowFailsForMasterMerchantAccount() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'holdInEscrow' => true + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_CANNOT_HOLD_IN_ESCROW, + $errors[0]->code + ); + } + + public function testSale_withThreeDSecureOptionRequired() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ] + ]); + + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/09' + ], + 'options' => [ + 'threeDSecure' => [ + 'required' => true + ] + ] + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Transaction::THREE_D_SECURE, $result->transaction->gatewayRejectionReason); + } + + public function testSale_withThreeDSecureOptionRequiredInSnakeCase() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonce_for_new_card([ + "creditCard" => [ + "number" => "4111111111111111", + "expirationMonth" => "11", + "expirationYear" => "2099" + ] + ]); + + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/09' + ], + 'options' => [ + 'three_d_secure' => [ + 'required' => true + ] + ] + ]); + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Transaction::THREE_D_SECURE, $result->transaction->gatewayRejectionReason); + } + + public function testSale_withThreeDSecureToken() + { + $threeDSecureToken = Test\Helper::create3DSVerification( + Test\Helper::threeDSecureMerchantAccountId(), + [ + 'number' => '4111111111111111', + 'expirationMonth' => '05', + 'expirationYear' => '2009' + ] + ); + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/09' + ], + 'threeDSecureToken' => $threeDSecureToken + ]); + $this->assertTrue($result->success); + } + + public function testSale_returnsErrorIfThreeDSecureToken() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/09' + ], + 'threeDSecureToken' => NULL + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('threeDSecureToken'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_THREE_D_SECURE_TOKEN_IS_INVALID, + $errors[0]->code + ); + } + + public function testSale_returnsErrorIf3dsLookupDataDoesNotMatchTransactionData() + { + $threeDSecureToken = Test\Helper::create3DSVerification( + Test\Helper::threeDSecureMerchantAccountId(), + [ + 'number' => '4111111111111111', + 'expirationMonth' => '05', + 'expirationYear' => '2009' + ] + ); + + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/09' + ], + 'threeDSecureToken' => $threeDSecureToken + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('threeDSecureToken'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_THREE_D_SECURE_TRANSACTION_DATA_DOESNT_MATCH_VERIFY, + $errors[0]->code + ); + } + + public function testSale_withThreeDSecurePassThru() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/09' + ], + 'threeDSecurePassThru' => [ + 'eciFlag' => '02', + 'cavv' => 'some_cavv', + 'xid' => 'some_xid' + ], + ]); + $this->assertTrue($result->success); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $result->transaction->status); + } + + public function testSale_returnsErrorsWhenThreeDSecurePassThruMerchantAcountDoesNotSupportCardType() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => 'adyen_ma', + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/09' + ], + 'threeDSecurePassThru' => [ + 'eciFlag' => '02', + 'cavv' => 'some_cavv', + 'xid' => 'some_xid' + ], + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_THREE_D_SECURE_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_CARD_TYPE, + $errors->onAttribute("merchantAccountId")[0]->code + ); + } + + public function testSale_returnsErrorsWhenThreeDSecurePassThruIsMissingEciFlag() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/09' + ], + 'threeDSecurePassThru' => [ + 'eciFlag' => '', + 'cavv' => 'some_cavv', + 'xid' => 'some_xid' + ], + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('threeDSecurePassThru'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_THREE_D_SECURE_ECI_FLAG_IS_REQUIRED, + $errors->onAttribute("eciFlag")[0]->code + ); + } + + public function testSale_returnsErrorsWhenThreeDSecurePassThruIsMissingCavvOrXid() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/09' + ], + 'threeDSecurePassThru' => [ + 'eciFlag' => '06', + 'cavv' => '', + 'xid' => '' + ], + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('threeDSecurePassThru'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_THREE_D_SECURE_CAVV_IS_REQUIRED, + $errors->onAttribute("cavv")[0]->code + ); + } + + public function testSale_returnsErrorsWhenThreeDSecurePassThruEciFlagIsInvalid() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::threeDSecureMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/09' + ], + 'threeDSecurePassThru' => [ + 'eciFlag' => 'bad_eci_flag', + 'cavv' => 'some_cavv', + 'xid' => 'some_xid' + ], + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('threeDSecurePassThru'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_THREE_D_SECURE_ECI_FLAG_IS_INVALID, + $errors->onAttribute("eciFlag")[0]->code + ); + } + + public function testHoldInEscrow_afterSale() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::nonDefaultSubMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'serviceFeeAmount' => '1.00' + ]); + $result = Braintree\Transaction::holdInEscrow($result->transaction->id); + $this->assertTrue($result->success); + $this->assertEquals(Braintree\Transaction::ESCROW_HOLD_PENDING, $result->transaction->escrowStatus); + } + + public function testHoldInEscrow_afterSaleFailsWithMasterMerchantAccount() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $result = Braintree\Transaction::holdInEscrow($result->transaction->id); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_CANNOT_HOLD_IN_ESCROW, + $errors[0]->code + ); + } + + public function testSubmitForRelease_FromEscrow() + { + $transaction = $this->createEscrowedTransaction(); + $result = Braintree\Transaction::releaseFromEscrow($transaction->id); + $this->assertTrue($result->success); + $this->assertEquals(Braintree\Transaction::ESCROW_RELEASE_PENDING, $result->transaction->escrowStatus); + } + + public function testSubmitForRelease_fromEscrowFailsForTransactionsNotHeldInEscrow() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::nonDefaultMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $result = Braintree\Transaction::releaseFromEscrow($result->transaction->id); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_CANNOT_RELEASE_FROM_ESCROW, + $errors[0]->code + ); + } + + public function testCancelRelease_fromEscrow() + { + $transaction = $this->createEscrowedTransaction(); + $result = Braintree\Transaction::releaseFromEscrow($transaction->id); + $result = Braintree\Transaction::cancelRelease($transaction->id); + $this->assertTrue($result->success); + $this->assertEquals( + Braintree\Transaction::ESCROW_HELD, + $result->transaction->escrowStatus + ); + } + + public function testCancelRelease_fromEscrowFailsIfTransactionNotSubmittedForRelease() + { + $transaction = $this->createEscrowedTransaction(); + $result = Braintree\Transaction::cancelRelease($transaction->id); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_CANNOT_CANCEL_RELEASE, + $errors[0]->code + ); + } + + public function testCreateFromTransparentRedirect() + { + Test\Helper::suppressDeprecationWarnings(); + $queryString = $this->createTransactionViaTr( + [ + 'transaction' => [ + 'customer' => [ + 'first_name' => 'First' + ], + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12' + ] + ] + ], + [ + 'transaction' => [ + 'type' => Braintree\Transaction::SALE, + 'amount' => '100.00' + ] + ] + ); + $result = Braintree\Transaction::createFromTransparentRedirect($queryString); + Test\Helper::assertPrintable($result); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals(Braintree\Transaction::SALE, $result->transaction->type); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $result->transaction->status); + $creditCard = $result->transaction->creditCardDetails; + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('US', $creditCard->customerLocation); + $this->assertEquals('MasterCard', $creditCard->cardType); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('510510******5100', $creditCard->maskedNumber); + $customer = $result->transaction->customerDetails; + $this->assertequals('First', $customer->firstName); + } + + public function testCreateFromTransparentRedirectWithInvalidParams() + { + Test\Helper::suppressDeprecationWarnings(); + $queryString = $this->createTransactionViaTr( + [ + 'transaction' => [ + 'bad_key' => 'bad_value', + 'customer' => [ + 'first_name' => 'First' + ], + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12' + ] + ] + ], + [ + 'transaction' => [ + 'type' => Braintree\Transaction::SALE, + 'amount' => '100.00' + ] + ] + ); + try { + $result = Braintree\Transaction::createFromTransparentRedirect($queryString); + $this->fail(); + } catch (Braintree\Exception\Authorization $e) { + $this->assertEquals("Invalid params: transaction[bad_key]", $e->getMessage()); + } + } + + public function testCreateFromTransparentRedirect_withParamsInTrData() + { + Test\Helper::suppressDeprecationWarnings(); + $queryString = $this->createTransactionViaTr( + [ + ], + [ + 'transaction' => [ + 'type' => Braintree\Transaction::SALE, + 'amount' => '100.00', + 'customer' => [ + 'firstName' => 'First' + ], + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ] + ] + ); + $result = Braintree\Transaction::createFromTransparentRedirect($queryString); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals(Braintree\Transaction::SALE, $result->transaction->type); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $result->transaction->status); + $creditCard = $result->transaction->creditCardDetails; + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('US', $creditCard->customerLocation); + $this->assertEquals('MasterCard', $creditCard->cardType); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('510510******5100', $creditCard->maskedNumber); + $customer = $result->transaction->customerDetails; + $this->assertequals('First', $customer->firstName); + } + + public function testCreateFromTransparentRedirect_withValidationErrors() + { + Test\Helper::suppressDeprecationWarnings(); + $queryString = $this->createTransactionViaTr( + [ + 'transaction' => [ + 'customer' => [ + 'first_name' => str_repeat('x', 256), + ], + 'credit_card' => [ + 'number' => 'invalid', + 'expiration_date' => '' + ] + ] + ], + [ + 'transaction' => ['type' => Braintree\Transaction::SALE] + ] + ); + $result = Braintree\Transaction::createFromTransparentRedirect($queryString); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('customer')->onAttribute('firstName'); + $this->assertEquals(Braintree\Error\Codes::CUSTOMER_FIRST_NAME_IS_TOO_LONG, $errors[0]->code); + $errors = $result->errors->forKey('transaction')->forKey('creditCard')->onAttribute('number'); + $this->assertTrue(count($errors) > 0); + $errors = $result->errors->forKey('transaction')->forKey('creditCard')->onAttribute('expirationDate'); + $this->assertEquals(Braintree\Error\Codes::CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED, $errors[0]->code); + } + + public function testRefund() + { + $transaction = $this->createTransactionToRefund(); + $result = Braintree\Transaction::refund($transaction->id); + $this->assertTrue($result->success); + $refund = $result->transaction; + $this->assertEquals(Braintree\Transaction::CREDIT, $refund->type); + $this->assertEquals($transaction->id, $refund->refundedTransactionId); + $this->assertEquals($refund->id, Braintree\Transaction::find($transaction->id)->refundId); + } + + public function testRefundWithPartialAmount() + { + $transaction = $this->createTransactionToRefund(); + $result = Braintree\Transaction::refund($transaction->id, '50.00'); + $this->assertTrue($result->success); + $this->assertEquals(Braintree\Transaction::CREDIT, $result->transaction->type); + $this->assertEquals("50.00", $result->transaction->amount); + } + + public function testMultipleRefundsWithPartialAmounts() + { + $transaction = $this->createTransactionToRefund(); + + $transaction1 = Braintree\Transaction::refund($transaction->id, '50.00')->transaction; + $this->assertEquals(Braintree\Transaction::CREDIT, $transaction1->type); + $this->assertEquals("50.00", $transaction1->amount); + + $transaction2 = Braintree\Transaction::refund($transaction->id, '50.00')->transaction; + $this->assertEquals(Braintree\Transaction::CREDIT, $transaction2->type); + $this->assertEquals("50.00", $transaction2->amount); + + $transaction = Braintree\Transaction::find($transaction->id); + + $expectedRefundIds = [$transaction1->id, $transaction2->id]; + $refundIds = $transaction->refundIds; + sort($expectedRefundIds); + sort($refundIds); + + $this->assertEquals($expectedRefundIds, $refundIds); + } + + public function testRefundWithUnsuccessfulPartialAmount() + { + $transaction = $this->createTransactionToRefund(); + $result = Braintree\Transaction::refund($transaction->id, '150.00'); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->onAttribute('amount'); + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_REFUND_AMOUNT_IS_TOO_LARGE, + $errors[0]->code + ); + } + + public function testRefundWithOptionsParam() + { + $transaction = $this->createTransactionToRefund(); + $options = [ + "orderId" => 'abcd', + "amount" => '1.00' + ]; + $result = Braintree\Transaction::refund($transaction->id, $options); + $this->assertTrue($result->success); + $this->assertEquals( + 'abcd', + $result->transaction->orderId + ); + $this->assertEquals( + '1.00', + $result->transaction->amount + ); + } + + public function testGatewayRejectionOnApplicationIncomplete() + { + $gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $result = $gateway->merchant()->create([ + 'email' => 'name@email.com', + 'countryCodeAlpha3' => 'USA', + 'paymentMethods' => ['credit_card', 'paypal'] + ]); + + $gateway = new Braintree\Gateway([ + 'accessToken' => $result->credentials->accessToken, + ]); + + $result = $gateway->transaction()->sale([ + 'amount' => '4000.00', + 'creditCard' => [ + 'number' => '4111111111111111', + 'expirationDate' => '05/20' + ] + ]); + $this->assertFalse($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::APPLICATION_INCOMPLETE, $transaction->gatewayRejectionReason); + } + + public function testGatewayRejectionOnAvs() + { + $old_merchant_id = Braintree\Configuration::merchantId(); + $old_public_key = Braintree\Configuration::publicKey(); + $old_private_key = Braintree\Configuration::privateKey(); + + Braintree\Configuration::merchantId('processing_rules_merchant_id'); + Braintree\Configuration::publicKey('processing_rules_public_key'); + Braintree\Configuration::privateKey('processing_rules_private_key'); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'billing' => [ + 'streetAddress' => '200 2nd Street' + ], + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + Braintree\Configuration::merchantId($old_merchant_id); + Braintree\Configuration::publicKey($old_public_key); + Braintree\Configuration::privateKey($old_private_key); + + $this->assertFalse($result->success); + Test\Helper::assertPrintable($result); + $transaction = $result->transaction; + + $this->assertEquals(Braintree\Transaction::AVS, $transaction->gatewayRejectionReason); + } + + public function testGatewayRejectionOnAvsAndCvv() + { + $old_merchant_id = Braintree\Configuration::merchantId(); + $old_public_key = Braintree\Configuration::publicKey(); + $old_private_key = Braintree\Configuration::privateKey(); + + Braintree\Configuration::merchantId('processing_rules_merchant_id'); + Braintree\Configuration::publicKey('processing_rules_public_key'); + Braintree\Configuration::privateKey('processing_rules_private_key'); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'billing' => [ + 'postalCode' => '20000' + ], + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '200' + ] + ]); + + Braintree\Configuration::merchantId($old_merchant_id); + Braintree\Configuration::publicKey($old_public_key); + Braintree\Configuration::privateKey($old_private_key); + + $this->assertFalse($result->success); + $transaction = $result->transaction; + + $this->assertEquals(Braintree\Transaction::AVS_AND_CVV, $transaction->gatewayRejectionReason); + } + + public function testGatewayRejectionOnCvv() + { + $old_merchant_id = Braintree\Configuration::merchantId(); + $old_public_key = Braintree\Configuration::publicKey(); + $old_private_key = Braintree\Configuration::privateKey(); + + Braintree\Configuration::merchantId('processing_rules_merchant_id'); + Braintree\Configuration::publicKey('processing_rules_public_key'); + Braintree\Configuration::privateKey('processing_rules_private_key'); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + 'cvv' => '200' + ] + ]); + + Braintree\Configuration::merchantId($old_merchant_id); + Braintree\Configuration::publicKey($old_public_key); + Braintree\Configuration::privateKey($old_private_key); + + $this->assertFalse($result->success); + $transaction = $result->transaction; + + $this->assertEquals(Braintree\Transaction::CVV, $transaction->gatewayRejectionReason); + } + + public function testGatewayRejectionOnFraud() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '4000111111111511', + 'expirationDate' => '05/17', + 'cvv' => '333' + ] + ]); + + $this->assertFalse($result->success); + $this->assertEquals(Braintree\Transaction::FRAUD, $result->transaction->gatewayRejectionReason); + } + + public function testSnapshotPlanIdAddOnsAndDiscountsFromSubscription() + { + $creditCard = SubscriptionHelper::createCreditCard(); + $plan = SubscriptionHelper::triallessPlan(); + $result = Braintree\Subscription::create([ + 'paymentMethodToken' => $creditCard->token, + 'planId' => $plan['id'], + 'addOns' => [ + 'add' => [ + [ + 'amount' => '11.00', + 'inheritedFromId' => 'increase_10', + 'quantity' => 2, + 'numberOfBillingCycles' => 5 + ], + [ + 'amount' => '21.00', + 'inheritedFromId' => 'increase_20', + 'quantity' => 3, + 'numberOfBillingCycles' => 6 + ] + ], + ], + 'discounts' => [ + 'add' => [ + [ + 'amount' => '7.50', + 'inheritedFromId' => 'discount_7', + 'quantity' => 2, + 'neverExpires' => true + ] + ] + ] + ]); + + $transaction = $result->subscription->transactions[0]; + + $this->assertEquals($transaction->planId, $plan['id']); + + $addOns = $transaction->addOns; + SubscriptionHelper::sortModificationsById($addOns); + + $this->assertEquals($addOns[0]->amount, "11.00"); + $this->assertEquals($addOns[0]->id, "increase_10"); + $this->assertEquals($addOns[0]->quantity, 2); + $this->assertEquals($addOns[0]->numberOfBillingCycles, 5); + $this->assertFalse($addOns[0]->neverExpires); + + $this->assertEquals($addOns[1]->amount, "21.00"); + $this->assertEquals($addOns[1]->id, "increase_20"); + $this->assertEquals($addOns[1]->quantity, 3); + $this->assertEquals($addOns[1]->numberOfBillingCycles, 6); + $this->assertFalse($addOns[1]->neverExpires); + + $discounts = $transaction->discounts; + $this->assertEquals($discounts[0]->amount, "7.50"); + $this->assertEquals($discounts[0]->id, "discount_7"); + $this->assertEquals($discounts[0]->quantity, 2); + $this->assertEquals($discounts[0]->numberOfBillingCycles, null); + $this->assertTrue($discounts[0]->neverExpires); + } + + public function createTransactionViaTr($regularParams, $trParams) + { + Test\Helper::suppressDeprecationWarnings(); + $trData = Braintree\TransparentRedirect::transactionData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + return Test\Helper::submitTrRequest( + Braintree\Transaction::createTransactionUrl(), + $regularParams, + $trData + ); + } + + public function createTransactionToRefund() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => ['submitForSettlement' => true] + ]); + Braintree\Test\Transaction::settle($transaction->id); + return $transaction; + } + + public function createEscrowedTransaction() + { + $result = Braintree\Transaction::sale([ + 'merchantAccountId' => Test\Helper::nonDefaultSubMerchantAccountId(), + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ], + 'options' => [ + 'holdInEscrow' => true + ], + 'serviceFeeAmount' => '1.00' + ]); + Test\Helper::escrow($result->transaction->id); + return $result->transaction; + } + + public function testCardTypeIndicators() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::PREPAID, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals(Braintree\CreditCard::PREPAID_YES, $transaction->creditCardDetails->prepaid); + + $prepaid_card_transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::COMMERCIAL, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals(Braintree\CreditCard::COMMERCIAL_YES, $prepaid_card_transaction->creditCardDetails->commercial); + + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::PAYROLL, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals(Braintree\CreditCard::PAYROLL_YES, $transaction->creditCardDetails->payroll); + $this->assertEquals("MSA", $transaction->creditCardDetails->productId); + + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::HEALTHCARE, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals(Braintree\CreditCard::HEALTHCARE_YES, $transaction->creditCardDetails->healthcare); + $this->assertEquals("J3", $transaction->creditCardDetails->productId); + + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::DURBIN_REGULATED, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals(Braintree\CreditCard::DURBIN_REGULATED_YES, $transaction->creditCardDetails->durbinRegulated); + + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::DEBIT, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals(Braintree\CreditCard::DEBIT_YES, $transaction->creditCardDetails->debit); + + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::ISSUING_BANK, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals("NETWORK ONLY", $transaction->creditCardDetails->issuingBank); + + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => CardTypeIndicators::COUNTRY_OF_ISSUANCE, + 'expirationDate' => '05/12', + ] + ]); + + $this->assertEquals("USA", $transaction->creditCardDetails->countryOfIssuance); + } + + + public function testCreate_withVaultedPayPal() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce + ]); + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodToken' => $paymentMethodToken, + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + } + + public function testCreate_withFuturePayPal() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withLocalPaymentWebhookContent() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'options' => [ + 'submitForSettlement' => True, + ], + 'paypalAccount' => [ + 'paymentId' => 'PAY-1234', + 'payerId' => 'PAYER-1234', + ], + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('PAY-1234', $transaction->paypalDetails->paymentId); + $this->assertEquals('PAYER-1234', $transaction->paypalDetails->payerId); + } + + public function testCreate_withPayeeId() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [ + 'payeeId' => 'fake-payee-id' + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->assertNotNull($transaction->paypalDetails->payeeId); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayeeIdInOptions() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [], + 'options' => [ + 'payeeId' => 'fake-payee-id' + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->assertNotNull($transaction->paypalDetails->payeeId); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayeeIdInOptionsPayPal() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [], + 'options' => [ + 'paypal' => [ + 'payeeId' => 'fake-payee-id' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->assertNotNull($transaction->paypalDetails->payeeId); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayeeEmail() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [ + 'payeeEmail' => 'payee@example.com' + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->assertNotNull($transaction->paypalDetails->payeeEmail); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayeeEmailInOptions() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [], + 'options' => [ + 'payeeEmail' => 'payee@example.com' + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->assertNotNull($transaction->paypalDetails->payeeEmail); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayeeEmailInOptionsPayPal() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [], + 'options' => [ + 'paypal' => [ + 'payeeEmail' => 'payee@example.com' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->assertNotNull($transaction->paypalDetails->payeeEmail); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayPalCustomField() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [], + 'options' => [ + 'paypal' => [ + 'customField' => 'custom field stuff' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('custom field stuff', $transaction->paypalDetails->customField); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayPalSupplementaryData() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [], + 'options' => [ + 'paypal' => [ + 'supplementaryData' => [ + 'key1' => 'value', + 'key2' => 'value' + ] + ] + ] + ]); + + // note - supplementary data is not returned in response + $this->assertTrue($result->success); + } + + public function testCreate_withPayPalDescription() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'paypalAccount' => [], + 'options' => [ + 'paypal' => [ + 'description' => 'Product description' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('Product description', $transaction->paypalDetails->description); + } + + public function testCreate_withPayPalReturnsPaymentInstrumentType() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\PaymentInstrumentType::PAYPAL_ACCOUNT, $transaction->paymentInstrumentType); + $this->assertNotNull($transaction->paypalDetails->debugId); + } + + public function testCreate_withFuturePayPalAndVault() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'consent_code' => 'PAYPAL_CONSENT_CODE', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'storeInVault' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $foundPayPalAccount = Braintree\PaymentMethod::find($paymentMethodToken); + $this->assertEquals($paymentMethodToken, $foundPayPalAccount->token); + } + + public function testCreate_withOnetimePayPal() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'access_token' => 'PAYPAL_ACCESS_TOKEN', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withOnetimePayPalAndDoesNotVault() + { + $paymentMethodToken = 'PAYPAL_TOKEN-' . strval(rand()); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'access_token' => 'PAYPAL_ACCESS_TOKEN', + 'token' => $paymentMethodToken + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'storeInVault' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('payer@example.com', $transaction->paypalDetails->payerEmail); + $this->assertNotNull($transaction->paypalDetails->imageUrl); + $this->assertNotNull($transaction->paypalDetails->debugId); + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\PaymentMethod::find($paymentMethodToken); + } + + public function testCreate_withPayPalAndSubmitForSettlement() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLING, $transaction->status); + } + + public function testCreate_withPayPalHandlesBadUnvalidatedNonces() + { + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = $http->nonceForPayPalAccount([ + 'paypal_account' => [ + 'access_token' => 'PAYPAL_ACCESS_TOKEN', + 'consent_code' => 'PAYPAL_CONSENT_CODE' + ] + ]); + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->forKey('paypalAccount')->errors; + $this->assertEquals(Braintree\Error\Codes::PAYPAL_ACCOUNT_CANNOT_HAVE_BOTH_ACCESS_TOKEN_AND_CONSENT_CODE, $errors[0]->code); + } + + public function testCreate_withPayPalHandlesNonExistentNonces() + { + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => 'NON_EXISTENT_NONCE', + 'options' => [ + 'submitForSettlement' => true + ] + ]); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->errors; + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PAYMENT_METHOD_NONCE_UNKNOWN, $errors[0]->code); + } + + public function testVoid_withPayPal() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce + ]); + + $this->assertTrue($result->success); + $voided_transaction = Braintree\Transaction::voidNoValidate($result->transaction->id); + $this->assertEquals(Braintree\Transaction::VOIDED, $voided_transaction->status); + } + + public function testVoid_failsOnDeclinedPayPal() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $result = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$decline, + 'paymentMethodNonce' => $nonce + ]); + $this->setExpectedException('Braintree\Exception\ValidationsFailed'); + Braintree\Transaction::voidNoValidate($result->transaction->id); + } + + public function testRefund_withPayPal() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $transactionResult = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $this->assertTrue($transactionResult->success); + Braintree\Test\Transaction::settle($transactionResult->transaction->id); + + $result = Braintree\Transaction::refund($transactionResult->transaction->id); + $this->assertTrue($result->success); + $this->assertEquals($result->transaction->type, Braintree\Transaction::CREDIT); + } + + public function testRefund_withPayPalAssignsRefundId() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $transactionResult = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $this->assertTrue($transactionResult->success); + $originalTransaction = $transactionResult->transaction; + Braintree\Test\Transaction::settle($transactionResult->transaction->id); + + $result = Braintree\Transaction::refund($transactionResult->transaction->id); + $this->assertTrue($result->success); + $refundTransaction = $result->transaction; + $updatedOriginalTransaction = Braintree\Transaction::find($originalTransaction->id); + $this->assertEquals($refundTransaction->id, $updatedOriginalTransaction->refundId); + } + + public function testRefund_withPayPalAssignsRefundedTransactionId() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $transactionResult = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $this->assertTrue($transactionResult->success); + $originalTransaction = $transactionResult->transaction; + Braintree\Test\Transaction::settle($transactionResult->transaction->id); + + $result = Braintree\Transaction::refund($transactionResult->transaction->id); + $this->assertTrue($result->success); + $refundTransaction = $result->transaction; + $this->assertEquals($refundTransaction->refundedTransactionId, $originalTransaction->id); + } + + public function testRefund_withPayPalFailsIfNotSettled() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $transactionResult = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + ]); + + $this->assertTrue($transactionResult->success); + + $result = Braintree\Transaction::refund($transactionResult->transaction->id); + $this->assertFalse($result->success); + $errors = $result->errors->forKey('transaction')->errors; + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_CANNOT_REFUND_UNLESS_SETTLED, $errors[0]->code); + } + + public function testRefund_partialWithPayPal() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $transactionResult = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $this->assertTrue($transactionResult->success); + Braintree\Test\Transaction::settle($transactionResult->transaction->id); + + $result = Braintree\Transaction::refund( + $transactionResult->transaction->id, + $transactionResult->transaction->amount / 2 + ); + + $this->assertTrue($result->success); + $this->assertEquals($result->transaction->type, Braintree\Transaction::CREDIT); + $this->assertEquals($result->transaction->amount, $transactionResult->transaction->amount / 2); + } + + public function testRefund_multiplePartialWithPayPal() + { + $nonce = Braintree\Test\Nonces::$paypalOneTimePayment; + + $transactionResult = Braintree\Transaction::sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + $this->assertTrue($transactionResult->success); + $originalTransaction = $transactionResult->transaction; + Braintree\Test\Transaction::settle($originalTransaction->id); + + $firstRefund = Braintree\Transaction::refund( + $transactionResult->transaction->id, + $transactionResult->transaction->amount / 2 + ); + $this->assertTrue($firstRefund->success); + $firstRefundTransaction = $firstRefund->transaction; + + $secondRefund = Braintree\Transaction::refund( + $transactionResult->transaction->id, + $transactionResult->transaction->amount / 2 + ); + $this->assertTrue($secondRefund->success); + $secondRefundTransaction = $secondRefund->transaction; + + + $updatedOriginalTransaction = Braintree\Transaction::find($originalTransaction->id); + $expectedRefundIds = [$secondRefundTransaction->id, $firstRefundTransaction->id]; + + $updatedRefundIds = $updatedOriginalTransaction->refundIds; + + $this->assertTrue(in_array($expectedRefundIds[0],$updatedRefundIds)); + $this->assertTrue(in_array($expectedRefundIds[1],$updatedRefundIds)); + } + + public function testIncludeProcessorSettlementResponseForSettlementDeclinedTransaction() + { + $result = Braintree\Transaction::sale([ + "paymentMethodNonce" => Braintree\Test\Nonces::$visaCheckoutVisa, + "amount" => "100", + "options" => [ + "submitForSettlement" => true + ] + ]); + + $this->assertTrue($result->success); + + $transaction = $result->transaction; + Braintree\Test\Transaction::settlementDecline($transaction->id); + + $inline_transaction = Braintree\Transaction::find($transaction->id); + $this->assertEquals($inline_transaction->status, Braintree\Transaction::SETTLEMENT_DECLINED); + $this->assertEquals($inline_transaction->processorSettlementResponseCode, "4001"); + $this->assertEquals($inline_transaction->processorSettlementResponseText, "Settlement Declined"); + } + + public function testIncludeProcessorSettlementResponseForSettlementPendingTransaction() + { + $result = Braintree\Transaction::sale([ + "paymentMethodNonce" => Braintree\Test\Nonces::$visaCheckoutVisa, + "amount" => "100", + "options" => [ + "submitForSettlement" => true + ] + ]); + + $this->assertTrue($result->success); + + $transaction = $result->transaction; + Braintree\Test\Transaction::settlementPending($transaction->id); + + $inline_transaction = Braintree\Transaction::find($transaction->id); + $this->assertEquals($inline_transaction->status, Braintree\Transaction::SETTLEMENT_PENDING); + $this->assertEquals($inline_transaction->processorSettlementResponseCode, "4002"); + $this->assertEquals($inline_transaction->processorSettlementResponseText, "Settlement Pending"); + } + + public function testSale_withLodgingIndustryData() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'industry' => [ + 'industryType' => Braintree\Transaction::LODGING_INDUSTRY, + 'data' => [ + 'folioNumber' => 'aaa', + 'checkInDate' => '2014-07-07', + 'checkOutDate' => '2014-07-09', + 'roomRate' => '239.00' + ] + ] + ]); + $this->assertTrue($result->success); + } + + public function testSale_withLodgingIndustryDataValidation() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'industry' => [ + 'industryType' => Braintree\Transaction::LODGING_INDUSTRY, + 'data' => [ + 'folioNumber' => 'aaa', + 'checkInDate' => '2014-07-07', + 'checkOutDate' => '2014-06-09', + 'roomRate' => '239.00' + ] + ] + ]); + $this->assertFalse($result->success); + $transaction = $result->transaction; + + $errors = $result->errors->forKey('transaction')->forKey('industry')->onAttribute('checkOutDate'); + $this->assertEquals(Braintree\Error\Codes::INDUSTRY_DATA_LODGING_CHECK_OUT_DATE_MUST_FOLLOW_CHECK_IN_DATE, $errors[0]->code); + } + + public function testSale_withTravelCruiseIndustryData() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'industry' => [ + 'industryType' => Braintree\Transaction::TRAVEL_AND_CRUISE_INDUSTRY, + 'data' => [ + 'travelPackage' => 'flight', + 'departureDate' => '2014-07-07', + 'lodgingCheckInDate' => '2014-07-09', + 'lodgingCheckOutDate' => '2014-07-10', + 'lodgingName' => 'Disney', + ] + ] + ]); + $this->assertTrue($result->success); + } + + public function testSale_withTravelCruiseIndustryDataValidation() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + 'industry' => [ + 'industryType' => Braintree\Transaction::TRAVEL_AND_CRUISE_INDUSTRY, + 'data' => [ + 'travelPackage' => 'invalid', + 'departureDate' => '2014-07-07', + 'lodgingCheckInDate' => '2014-07-09', + 'lodgingCheckOutDate' => '2014-07-10', + 'lodgingName' => 'Disney', + ] + ] + ]); + $this->assertFalse($result->success); + $transaction = $result->transaction; + + $errors = $result->errors->forKey('transaction')->forKey('industry')->onAttribute('travelPackage'); + $this->assertEquals(Braintree\Error\Codes::INDUSTRY_DATA_TRAVEL_CRUISE_TRAVEL_PACKAGE_IS_INVALID, $errors[0]->code); + } + + public function testSale_withTravelFlightIndustryData() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$paypalOneTimePayment, + 'options' => ['submitForSettlement' => true], + 'industry' => [ + 'industryType' => Braintree\Transaction::TRAVEL_AND_FLIGHT_INDUSTRY, + 'data' => [ + 'passengerFirstName' => 'John', + 'passengerLastName' => 'Doe', + 'passengerMiddleInitial' => 'M', + 'passengerTitle' => 'Mr.', + 'issuedDate' => '2018-01-01', + 'travelAgencyName' => 'Expedia', + 'travelAgencyCode' => '12345678', + 'ticketNumber' => 'ticket-number', + 'issuingCarrierCode' => 'AA', + 'customerCode' => 'customer-code', + 'fareAmount' => '70.00', + 'feeAmount' => '10.00', + 'taxAmount' => '20.00', + 'restrictedTicket' => false, + 'legs' => [ + [ + 'conjunctionTicket' => 'CJ0001', + 'exchangeTicket' => 'ET0001', + 'couponNumber' => '1', + 'serviceClass' => 'Y', + 'carrierCode' => 'AA', + 'fareBasisCode' => 'W', + 'flightNumber' => 'AA100', + 'departureDate' => '2018-01-02', + 'departureAirportCode' => 'MDW', + 'departureTime' => '08:00', + 'arrivalAirportCode' => 'ATX', + 'arrivalTime' => '10:00', + 'stopoverPermitted' => false, + 'fareAmount' => '35.00', + 'feeAmount' => '5.00', + 'taxAmount' => '10.00', + 'endorsementOrRestrictions' => 'NOT REFUNDABLE' + ], + [ + 'conjunctionTicket' => 'CJ0002', + 'exchangeTicket' => 'ET0002', + 'couponNumber' => '1', + 'serviceClass' => 'Y', + 'carrierCode' => 'AA', + 'fareBasisCode' => 'W', + 'flightNumber' => 'AA200', + 'departureDate' => '2018-01-03', + 'departureAirportCode' => 'ATX', + 'departureTime' => '12:00', + 'arrivalAirportCode' => 'MDW', + 'arrivalTime' => '14:00', + 'stopoverPermitted' => false, + 'fareAmount' => '35.00', + 'feeAmount' => '5.00', + 'taxAmount' => '10.00', + 'endorsementOrRestrictions' => 'NOT REFUNDABLE' + ] + ] + ] + ] + ]); + $this->assertTrue($result->success); + } + + public function testSale_withTravelFlightIndustryDataValidation() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$paypalOneTimePayment, + 'options' => ['submitForSettlement' => true], + 'industry' => [ + 'industryType' => Braintree\Transaction::TRAVEL_AND_FLIGHT_INDUSTRY, + 'data' => [ + 'fareAmount' => '-1.23', + 'legs' => [ + [ + 'fareAmount' => '-1.23' + ] + ] + ] + ] + ]); + $this->assertFalse($result->success); + $transaction = $result->transaction; + + $this->assertEquals( + Braintree\Error\Codes::INDUSTRY_DATA_TRAVEL_FLIGHT_FARE_AMOUNT_CANNOT_BE_NEGATIVE, + $result->errors->forKey('transaction')->forKey('industry')->onAttribute('fareAmount')[0]->code + ); + $this->assertEquals( + Braintree\Error\Codes::INDUSTRY_DATA_LEG_TRAVEL_FLIGHT_FARE_AMOUNT_CANNOT_BE_NEGATIVE, + $result->errors->forKey('transaction')->forKey('industry')->forKey('legs')->forKey('index0')->onAttribute('fareAmount')[0]->code + ); + } + + public function testSale_withAmexRewardsSucceeds() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$amexPayWithPoints['Success'], + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true, + 'amexRewards' => [ + 'requestId' => 'ABC123', + 'points' => '100', + 'currencyAmount' => '1.00', + 'currencyIsoCode' => 'USD' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + } + + public function testSale_withAmexRewardsSucceedsEvenIfCardIsIneligible() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$amexPayWithPoints['IneligibleCard'], + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true, + 'amexRewards' => [ + 'requestId' => 'ABC123', + 'points' => '100', + 'currencyAmount' => '1.00', + 'currencyIsoCode' => 'USD' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + } + + public function testSale_withAmexRewardsSucceedsEvenIfCardBalanceIsInsufficient() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$amexPayWithPoints['InsufficientPoints'], + 'expirationDate' => '05/12' + ], + 'options' => [ + 'submitForSettlement' => true, + 'amexRewards' => [ + 'requestId' => 'ABC123', + 'points' => '100', + 'currencyAmount' => '1.00', + 'currencyIsoCode' => 'USD' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + } + + public function testSubmitForSettlement_withAmexRewardsSucceeds() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$amexPayWithPoints['Success'], + 'expirationDate' => '05/12' + ], + 'options' => [ + 'amexRewards' => [ + 'requestId' => 'ABC123', + 'points' => '100', + 'currencyAmount' => '1.00', + 'currencyIsoCode' => 'USD' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id, '47.00'); + $submitTransaction = $submitResult->transaction; + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitTransaction->status); + } + + public function testSubmitForSettlement_withAmexRewardsSucceedsEvenIfCardIsIneligible() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$amexPayWithPoints['IneligibleCard'], + 'expirationDate' => '05/12' + ], + 'options' => [ + 'amexRewards' => [ + 'requestId' => 'ABC123', + 'points' => '100', + 'currencyAmount' => '1.00', + 'currencyIsoCode' => 'USD' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id, '47.00'); + $submitTransaction = $submitResult->transaction; + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitTransaction->status); + } + + public function testSubmitForSettlement_withAmexRewardsSucceedsEvenIfCardBalanceIsInsufficient() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'merchantAccountId' => Test\Helper::fakeAmexDirectMerchantAccountId(), + 'creditCard' => [ + 'cardholderName' => 'The Cardholder', + 'number' => Braintree\Test\CreditCardNumbers::$amexPayWithPoints['InsufficientPoints'], + 'expirationDate' => '05/12' + ], + 'options' => [ + 'amexRewards' => [ + 'requestId' => 'ABC123', + 'points' => '100', + 'currencyAmount' => '1.00', + 'currencyIsoCode' => 'USD' + ] + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + + $submitResult = Braintree\Transaction::submitForSettlement($transaction->id, '47.00'); + $submitTransaction = $submitResult->transaction; + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitTransaction->status); + } + + public function testSubmitForPartialSettlement() + { + $authorizedTransaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $authorizedTransaction->status); + $partialSettlementResult1 = Braintree\Transaction::submitForPartialSettlement($authorizedTransaction->id, '60.00'); + $this->assertTrue($partialSettlementResult1->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $partialSettlementResult1->transaction->status); + $this->assertEquals('60.00', $partialSettlementResult1->transaction->amount); + + $partialSettlementResult2 = Braintree\Transaction::submitForPartialSettlement($authorizedTransaction->id, '40.00'); + $this->assertTrue($partialSettlementResult2->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $partialSettlementResult2->transaction->status); + $this->assertEquals('40.00', $partialSettlementResult2->transaction->amount); + + $refreshedAuthorizedTransaction = Braintree\Transaction::find($authorizedTransaction->id); + $this->assertEquals(2, count($refreshedAuthorizedTransaction->partialSettlementTransactionIds)); + } + + public function testSubmitForPartialSettlementUnsuccesful() + { + $authorizedTransaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $authorizedTransaction->status); + $partialSettlementResult1 = Braintree\Transaction::submitForPartialSettlement($authorizedTransaction->id, '60.00'); + $this->assertTrue($partialSettlementResult1->success); + + $partialSettlementResult2 = Braintree\Transaction::submitForPartialSettlement($partialSettlementResult1->transaction->id, '10.00'); + $this->assertFalse($partialSettlementResult2->success); + $baseErrors = $partialSettlementResult2->errors->forKey('transaction')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_CANNOT_SUBMIT_FOR_PARTIAL_SETTLEMENT, $baseErrors[0]->code); + } + + public function testSubmitForPartialSettlement_withOrderId() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submitResult = Braintree\Transaction::submitForPartialSettlement($transaction->id, '67.00', ['orderId' => 'ABC123']); + $this->assertEquals(true, $submitResult->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitResult->transaction->status); + $this->assertEquals('ABC123', $submitResult->transaction->orderId); + $this->assertEquals('67.00', $submitResult->transaction->amount); + } + + public function testSubmitForPartialSettlement_withDescriptor() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $params = [ + 'descriptor' => [ + 'name' => '123*123456789012345678', + 'phone' => '3334445555', + 'url' => 'ebay.com' + ] + ]; + + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $transaction->status); + $submitResult = Braintree\Transaction::submitForPartialSettlement($transaction->id, '67.00', $params); + $this->assertEquals(true, $submitResult->success); + $this->assertEquals(Braintree\Transaction::SUBMITTED_FOR_SETTLEMENT, $submitResult->transaction->status); + $this->assertEquals('123*123456789012345678', $submitResult->transaction->descriptor->name); + $this->assertEquals('3334445555', $submitResult->transaction->descriptor->phone); + $this->assertEquals('ebay.com', $submitResult->transaction->descriptor->url); + } + + public function testSubmitForPartialSettlement_withInvalidParams() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12' + ] + ]); + + $params = ['invalid' => 'invalid']; + + $this->setExpectedException('InvalidArgumentException', 'invalid keys: invalid'); + Braintree\Transaction::submitForPartialSettlement($transaction->id, '67.00', $params); + } + + public function testFacilitatedAndFacilitatorDetailsAreReturnedOnTransactionsCreatedViaNonceGranting() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, false); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + + $this->assertEquals( + $result->transaction->facilitatedDetails->merchantId, + 'integration_merchant_id' + ); + $this->assertEquals( + $result->transaction->facilitatedDetails->merchantName, + '14ladders' + ); + $this->assertEquals( + $result->transaction->facilitatedDetails->paymentMethodNonce, + $grantResult->paymentMethodNonce->nonce + ); + + $this->assertEquals( + $result->transaction->facilitatorDetails->oauthApplicationClientId, + "client_id\$development\$integration_client_id" + ); + $this->assertEquals( + $result->transaction->facilitatorDetails->oauthApplicationName, + "PseudoShop" + ); + + $this->assertNull($result->transaction->billing["postalCode"]); + } + + public function testBillingPostalCodeIsReturnedWhenRequestedOnTransactionsCreatedViaNonceGranting() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009', + 'billingAddress' => [ + 'firstName' => 'Adam', + 'lastName' => 'Davis', + 'postalCode' => '95131' + ] + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'grant_payment_method' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $grantingGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $grantResult = $grantingGateway->paymentMethod()->grant($creditCard->token, ['allow_vaulting' => false, 'include_billing_postal_code' => true]); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => $grantResult->paymentMethodNonce->nonce + ]); + + $this->assertEquals($result->transaction->billing["postalCode"], "95131"); + } + + public function testTransactionsCanBeCreatedWithSharedPaymentMethodToken() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $address = $partnerMerchantGateway->address()->create([ + 'customerId' => $customer->id, + 'firstName' => 'Dan', + 'lastName' => 'Smith', + ])->address; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write,shared_vault_transactions' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $oauthAccesTokenGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $result = $oauthAccesTokenGateway->transaction()->sale([ + 'amount' => '100.00', + 'sharedPaymentMethodToken' => $creditCard->token, + 'sharedCustomerId' => $customer->id, + 'sharedShippingAddressId' => $address->id, + 'sharedBillingAddressId' => $address->id + ]); + + $this->assertEquals( + $result->transaction->shippingDetails->firstName, + $address->firstName + ); + $this->assertEquals( + $result->transaction->billingDetails->firstName, + $address->firstName + ); + } + + public function testTransactionsCanBeCreatedWithSharedPaymentMethodNonce() + { + $partnerMerchantGateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_public_id', + 'publicKey' => 'oauth_app_partner_user_public_key', + 'privateKey' => 'oauth_app_partner_user_private_key' + ]); + + $customer = $partnerMerchantGateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + $address = $partnerMerchantGateway->address()->create([ + 'customerId' => $customer->id, + 'firstName' => 'Dan', + 'lastName' => 'Smith', + ])->address; + $creditCard = $partnerMerchantGateway->creditCard()->create([ + 'customerId' => $customer->id, + 'cardholderName' => 'Adam Davis', + 'number' => '4111111111111111', + 'expirationDate' => '05/2009' + ])->creditCard; + + $oauthAppGateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $code = Test\Braintree\OAuthTestHelper::createGrant($oauthAppGateway, [ + 'merchant_public_id' => 'integration_merchant_id', + 'scope' => 'read_write,shared_vault_transactions' + ]); + + $credentials = $oauthAppGateway->oauth()->createTokenFromCode([ + 'code' => $code, + ]); + + $oauthAccesTokenGateway = new Braintree\Gateway([ + 'accessToken' => $credentials->accessToken + ]); + + $sharedNonce = $partnerMerchantGateway->paymentMethodNonce()->create( + $creditCard->token + )->paymentMethodNonce->nonce; + + $result = $oauthAccesTokenGateway->transaction()->sale([ + 'amount' => '100.00', + 'sharedPaymentMethodNonce' => $sharedNonce, + 'sharedCustomerId' => $customer->id, + 'sharedShippingAddressId' => $address->id, + 'sharedBillingAddressId' => $address->id + ]); + + $this->assertEquals( + $result->transaction->shippingDetails->firstName, + $address->firstName + ); + $this->assertEquals( + $result->transaction->billingDetails->firstName, + $address->firstName + ); + } + + public function testVisaTransactionReceivesNetworkTransactionId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + ]); + + $this->assertTrue($result->success); + + $transaction = $result->transaction; + $this->assertTrue(strlen($transaction->networkTransactionId) > 0); + } + + public function testNonVisaTransactionDoesNotReceiveNetworkTransactionId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$masterCard, + 'expirationDate' => '05/2009', + ], + ]); + + $this->assertTrue($result->success); + + $transaction = $result->transaction; + $this->assertNull($transaction->networkTransactionId); + } + + public function testTransactionExternalVaultVisaWorksWithStatus() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "will_vault", + ], + ]); + + $this->assertTrue($result->success); + $this->assertNotNull($result->transaction->networkTransactionId); + } + + public function testTransactionExternalVaultNonVisaWorksWithStatus() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$masterCard, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "will_vault", + ], + ]); + + $this->assertTrue($result->success); + $this->assertNull($result->transaction->networkTransactionId); + } + + public function testTransactionExternalVaultNonVisaWorksWithNullPreviousTransactionId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$masterCard, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "will_vault", + 'previousNetworkTransactionId' => null, + ], + ]); + + $this->assertTrue($result->success); + $this->assertNull($result->transaction->networkTransactionId); + } + + public function testTransactionVisaExternalVaultWorksWithPreviousNetworkTransactionId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "vaulted", + 'previousNetworkTransactionId' => "123456789012345", + ], + ]); + + $this->assertTrue($result->success); + $this->assertNotNull($result->transaction->networkTransactionId); + } + + public function testTransactionExternalVaultWorksWithStatusVaultedWithoutPreviousNetworkTransactionId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "vaulted", + ], + ]); + + $this->assertTrue($result->success); + $this->assertNotNull($result->transaction->networkTransactionId); + } + + public function testTransactionExternalVaultValidationErrorUnsupportedPaymentInstrumentType() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$applePayVisa, + 'externalVault' => [ + 'status' => "vaulted", + 'previousNetworkTransactionId' => "123456789012345", + ], + ]); + + $this->assertFalse($result->success); + + $transaction = $result->transaction; + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_PAYMENT_INSTRUMENT_WITH_EXTERNAL_VAULT_IS_INVALID, + $result->errors->forKey('transaction')->onAttribute('externalVault')[0]->code + ); + } + + public function testTransactionExternalVaultValidationErrorInvalidStatus() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "bad_status", + ], + ]); + + $this->assertFalse($result->success); + + $transaction = $result->transaction; + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_EXTERNAL_VAULT_STATUS_IS_INVALID, + $result->errors->forKey('transaction')->forKey('externalVault')->onAttribute('status')[0]->code + ); + } + + public function testTransactionExternalVaultValidationErrorInvalidStatusWithPreviousNetworkTransactionId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "will_vault", + 'previousNetworkTransactionId' => "123456789012345", + ], + ]); + + $this->assertFalse($result->success); + + $transaction = $result->transaction; + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_EXTERNAL_VAULT_STATUS_WITH_PREVIOUS_NETWORK_TRANSACTION_ID_IS_INVALID, + $result->errors->forKey('transaction')->forKey('externalVault')->onAttribute('status')[0]->code + ); + } + + public function testTransactionExternalVaultValidationErrorInvalidPreviousNetworkTransactionId() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "vaulted", + 'previousNetworkTransactionId' => "bad_value", + ], + ]); + + $this->assertFalse($result->success); + + $transaction = $result->transaction; + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_EXTERNAL_VAULT_PREVIOUS_NETWORK_TRANSACTION_ID_IS_INVALID, + $result->errors->forKey('transaction')->forKey('externalVault')->onAttribute('previousNetworkTransactionId')[0]->code + ); + } + + public function testTransactionExternalVaultValidationErrorInvalidCardType() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$masterCard, + 'expirationDate' => '05/2009', + ], + 'externalVault' => [ + 'status' => "vaulted", + 'previousNetworkTransactionId' => "123456789012345", + ], + ]); + + $this->assertFalse($result->success); + + $transaction = $result->transaction; + $this->assertEquals( + Braintree\Error\Codes::TRANSACTION_EXTERNAL_VAULT_CARD_TYPE_IS_INVALID, + $result->errors->forKey('transaction')->forKey('externalVault')->onAttribute('previousNetworkTransactionId')[0]->code + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionWithUsBankAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionWithUsBankAccountTest.php new file mode 100644 index 00000000000..f60b38764ed --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransactionWithUsBankAccountTest.php @@ -0,0 +1,268 @@ + '100.00', + 'merchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber); + $this->assertEquals('1234', $transaction->usBankAccount->last4); + $this->assertEquals('checking', $transaction->usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName); + $this->assertRegExp('/CHASE/', $transaction->usBankAccount->bankName); + $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text); + $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt)); + } + + public function testSaleWithUsBankAccountNonceAndVaultedToken() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber); + $this->assertEquals('1234', $transaction->usBankAccount->last4); + $this->assertEquals('checking', $transaction->usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName); + $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text); + $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt)); + + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'paymentMethodToken' => $transaction->usBankAccount->token, + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber); + $this->assertEquals('1234', $transaction->usBankAccount->last4); + $this->assertEquals('checking', $transaction->usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName); + $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text); + $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt)); + } + + public function testSaleWithPlaidUsBankAccountNonce() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'paymentMethodNonce' => Test\Helper::generatePlaidUsBankAccountNonce(), + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('011000015', $transaction->usBankAccount->routingNumber); + $this->assertEquals('0000', $transaction->usBankAccount->last4); + $this->assertEquals('checking', $transaction->usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName); + $this->assertRegExp('/FEDERAL/', $transaction->usBankAccount->bankName); + $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text); + $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt)); + } + + public function testSaleWithInvalidUsBankAccountNonce() + { + $result = Braintree\Transaction::sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'paymentMethodNonce' => Test\Helper::generateInvalidUsBankAccountNonce(), + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertFalse($result->success); + $baseErrors = $result->errors->forKey('transaction')->onAttribute('paymentMethodNonce'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_PAYMENT_METHOD_NONCE_UNKNOWN, $baseErrors[0]->code); + } + + public function testCompliantMerchantUnverifiedToken() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $customer = $gateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount() + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals('021000021', $usBankAccount->routingNumber); + $this->assertEquals('1234', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertRegexp('/CHASE/', $usBankAccount->bankName); + $this->assertEquals(false, $usBankAccount->verified); + + $this->assertEquals(0, count($usBankAccount->verifications)); + + $sale = $gateway->transaction()->sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'paymentMethodToken' => $usBankAccount->token, + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertFalse($sale->success); + $baseErrors = $sale->errors->forKey('transaction')->onAttribute('paymentMethodToken'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_US_BANK_ACCOUNT_NOT_VERIFIED, $baseErrors[0]->code); + } + + public function testCompliantMerchantUnverifiedNonce() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $sale = $gateway->transaction()->sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertFalse($sale->success); + $baseErrors = $sale->errors->forKey('transaction')->onAttribute('paymentMethodNonce'); + $this->assertEquals(Braintree\Error\Codes::TRANSACTION_US_BANK_ACCOUNT_NONCE_MUST_BE_PLAID_VERIFIED, $baseErrors[0]->code); + } + + public function testCompliantMerchantPlaidToken() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $customer = $gateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generatePlaidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount() + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals('011000015', $usBankAccount->routingNumber); + $this->assertEquals('0000', $usBankAccount->last4); + $this->assertEquals('checking', $usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $usBankAccount->accountHolderName); + $this->assertRegexp('/FEDERAL/', $usBankAccount->bankName); + $this->assertEquals(true, $usBankAccount->verified); + + $this->assertEquals(1, count($usBankAccount->verifications)); + + $sale = $gateway->transaction()->sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'paymentMethodToken' => $usBankAccount->token, + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertTrue($sale->success); + $this->assertEquals($sale->transaction->amount, '100'); + $this->assertEquals($sale->transaction->usBankAccount->token, $usBankAccount->token); + } + + public function testCompliantMerchantPlaidNonce() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $sale = $gateway->transaction()->sale([ + 'amount' => '100.00', + 'merchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'paymentMethodNonce' => Test\Helper::generatePlaidUsBankAccountNonce(), + 'options' => [ + 'submitForSettlement' => true, + 'storeInVault' => true + ] + ]); + + $this->assertTrue($sale->success); + $this->assertEquals($sale->transaction->amount, '100'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransparentRedirectTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransparentRedirectTest.php new file mode 100644 index 00000000000..1d23343f413 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/TransparentRedirectTest.php @@ -0,0 +1,354 @@ + "http://www.example.com?foo=bar"] + ); + $config = Braintree\Configuration::$global; + $queryString = Test\Helper::submitTrRequest( + $config->baseUrl() . $config->merchantPath() . '/test/maintenance', + [], + $trData + ); + $this->setExpectedException('Braintree\Exception\DownForMaintenance'); + Braintree\Customer::createFromTransparentRedirect($queryString); + } + + public function testParseAndValidateQueryString_throwsDownForMaintenanceErrorIfDownForMaintenance() + { + Test\Helper::suppressDeprecationWarnings(); + $trData = Braintree\TransparentRedirect::createCustomerData( + ["redirectUrl" => "http://www.example.com"] + ); + $config = Braintree\Configuration::$global; + $queryString = Test\Helper::submitTrRequest( + $config->baseUrl() . $config->merchantPath() . '/test/maintenance', + [], + $trData + ); + $this->setExpectedException('Braintree\Exception\DownForMaintenance'); + Braintree\Customer::createFromTransparentRedirect($queryString); + } + + public function testParseAndValidateQueryString_throwsAuthenticationErrorIfBadCredentials() + { + Test\Helper::suppressDeprecationWarnings(); + $privateKey = Braintree\Configuration::privateKey(); + Braintree\Configuration::privateKey('incorrect'); + try { + $trData = Braintree\TransparentRedirect::createCustomerData( + ["redirectUrl" => "http://www.example.com"] + ); + $queryString = Test\Helper::submitTrRequest( + Braintree\Customer::createCustomerUrl(), + [], + $trData + ); + $this->setExpectedException('Braintree\Exception\Authentication'); + Braintree\Customer::createFromTransparentRedirect($queryString); + } catch (Braintree\Exception $e) { + } + $privateKey = Braintree\Configuration::privateKey($privateKey); + if (isset($e)) throw $e; + } + + public function testCreateTransactionFromTransparentRedirect() + { + $params = [ + 'transaction' => [ + 'customer' => [ + 'first_name' => 'First' + ], + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12' + ] + ] + ]; + $trParams = [ + 'transaction' => [ + 'type' => Braintree\Transaction::SALE, + 'amount' => '100.00' + ] + ]; + + $trData = Braintree\TransparentRedirect::transactionData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + + $queryString = Test\Helper::submitTrRequest( + Braintree\TransparentRedirect::url(), + $params, + $trData + ); + + $result = Braintree\TransparentRedirect::confirm($queryString); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals(Braintree\Transaction::SALE, $result->transaction->type); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $result->transaction->status); + $creditCard = $result->transaction->creditCardDetails; + $this->assertEquals('510510', $creditCard->bin); + $this->assertEquals('5100', $creditCard->last4); + $this->assertEquals('US', $creditCard->customerLocation); + $this->assertEquals('MasterCard', $creditCard->cardType); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('510510******5100', $creditCard->maskedNumber); + $customer = $result->transaction->customerDetails; + $this->assertequals('First', $customer->firstName); + } + + public function testGatewayCreateTransactionFromTransparentRedirect() + { + $params = [ + 'transaction' => [ + 'customer' => [ + 'first_name' => 'First' + ], + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12' + ] + ] + ]; + $trParams = [ + 'transaction' => [ + 'type' => Braintree\Transaction::SALE, + 'amount' => '100.00' + ] + ]; + + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + $trData = $gateway->transparentRedirect()->transactionData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + + $queryString = Test\Helper::submitTrRequest( + $gateway->transparentRedirect()->url(), + $params, + $trData + ); + + $result = $gateway->transparentRedirect()->confirm($queryString); + $this->assertTrue($result->success); + $this->assertEquals('100.00', $result->transaction->amount); + $this->assertEquals(Braintree\Transaction::SALE, $result->transaction->type); + $this->assertEquals(Braintree\Transaction::AUTHORIZED, $result->transaction->status); + $creditCard = $result->transaction->creditCardDetails; + $this->assertEquals('US', $creditCard->customerLocation); + $this->assertEquals('05/2012', $creditCard->expirationDate); + $this->assertEquals('510510******5100', $creditCard->maskedNumber); + $customer = $result->transaction->customerDetails; + $this->assertequals('First', $customer->firstName); + } + + public function testCreateTransactionWithServiceFeesFromTransparentRedirect() + { + $params = [ + 'transaction' => [ + 'customer' => [ + 'first_name' => 'First' + ], + 'credit_card' => [ + 'number' => '5105105105105100', + 'expiration_date' => '05/12' + ], + 'service_fee_amount' => '1.00', + 'merchant_account_id' => Test\Helper::nonDefaultSubMerchantAccountId(), + ] + ]; + $trParams = [ + 'transaction' => [ + 'type' => Braintree\Transaction::SALE, + 'amount' => '100.00' + ] + ]; + + $trData = Braintree\TransparentRedirect::transactionData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + + $queryString = Test\Helper::submitTrRequest( + Braintree\TransparentRedirect::url(), + $params, + $trData + ); + + $result = Braintree\TransparentRedirect::confirm($queryString); + $this->assertTrue($result->success); + $this->assertEquals('1.00', $result->transaction->serviceFeeAmount); + } + + public function testCreateCustomerFromTransparentRedirect() + { + $params = [ + 'customer' => [ + 'first_name' => 'Second' + ] + ]; + $trParams = [ + 'customer' => [ + 'lastName' => 'Penultimate' + ] + ]; + + $trData = Braintree\TransparentRedirect::createCustomerData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + + $queryString = Test\Helper::submitTrRequest( + Braintree\TransparentRedirect::url(), + $params, + $trData + ); + + $result = Braintree\TransparentRedirect::confirm($queryString); + $this->assertTrue($result->success); + + $customer = $result->customer; + $this->assertequals('Second', $customer->firstName); + $this->assertequals('Penultimate', $customer->lastName); + } + + public function testUpdateCustomerFromTransparentRedirect() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jonez' + ])->customer; + $params = [ + 'customer' => [ + 'first_name' => 'Second' + ] + ]; + $trParams = [ + 'customerId' => $customer->id, + 'customer' => [ + 'lastName' => 'Penultimate' + ] + ]; + + $trData = Braintree\TransparentRedirect::updateCustomerData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + + $queryString = Test\Helper::submitTrRequest( + Braintree\TransparentRedirect::url(), + $params, + $trData + ); + + $result = Braintree\TransparentRedirect::confirm($queryString); + $this->assertTrue($result->success); + + $customer = $result->customer; + $this->assertequals('Second', $customer->firstName); + $this->assertequals('Penultimate', $customer->lastName); + } + + public function testCreateCreditCardFromTransparentRedirect() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jonez' + ])->customer; + + $params = [ + 'credit_card' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa + ] + ]; + $trParams = [ + 'creditCard' => [ + 'customerId' => $customer->id, + 'expirationMonth' => '01', + 'expirationYear' => '10' + ] + ]; + + $trData = Braintree\TransparentRedirect::createCreditCardData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + + $queryString = Test\Helper::submitTrRequest( + Braintree\TransparentRedirect::url(), + $params, + $trData + ); + + $result = Braintree\TransparentRedirect::confirm($queryString); + $this->assertTrue($result->success); + + $creditCard = $result->creditCard; + $this->assertequals('401288', $creditCard->bin); + $this->assertequals('1881', $creditCard->last4); + $this->assertequals('01/2010', $creditCard->expirationDate); + } + + public function testUpdateCreditCardFromTransparentRedirect() + { + $customer = Braintree\Customer::create([ + 'firstName' => 'Mike', + 'lastName' => 'Jonez' + ])->customer; + $creditCard = Braintree\CreditCard::create([ + 'customerId' => $customer->id, + 'number' => Braintree\Test\CreditCardNumbers::$masterCard, + 'expirationMonth' => '10', + 'expirationYear' => '10' + ])->creditCard; + + $params = [ + 'credit_card' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + ] + ]; + $trParams = [ + 'paymentMethodToken' => $creditCard->token, + 'creditCard' => [ + 'expirationMonth' => '11', + 'expirationYear' => '11' + ] + ]; + + $trData = Braintree\TransparentRedirect::updateCreditCardData( + array_merge($trParams, ["redirectUrl" => "http://www.example.com"]) + ); + + $queryString = Test\Helper::submitTrRequest( + Braintree\TransparentRedirect::url(), + $params, + $trData + ); + + Braintree\TransparentRedirect::confirm($queryString); + + $creditCard = Braintree\CreditCard::find($creditCard->token); + $this->assertequals('401288', $creditCard->bin); + $this->assertequals('1881', $creditCard->last4); + $this->assertequals('11/2011', $creditCard->expirationDate); + } + + public function testUrl() + { + $url = Braintree\TransparentRedirect::url(); + $developmentPort = getenv("GATEWAY_PORT") ? getenv("GATEWAY_PORT") : 3000; + $this->assertEquals("http://localhost:" . $developmentPort . "/merchants/integration_merchant_id/transparent_redirect_requests", $url); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountTest.php new file mode 100644 index 00000000000..9622deaf055 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountTest.php @@ -0,0 +1,104 @@ + $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ]); + + $foundUsBankAccount = $result->paymentMethod; + $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount); + $this->assertEquals('021000021', $foundUsBankAccount->routingNumber); + $this->assertEquals('1234', $foundUsBankAccount->last4); + $this->assertEquals('checking', $foundUsBankAccount->accountType); + $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName); + $this->assertRegExp('/CHASE/', $foundUsBankAccount->bankName); + $this->assertEquals('cl mandate text', $foundUsBankAccount->achMandate->text); + $this->assertEquals('DateTime', get_class($foundUsBankAccount->achMandate->acceptedAt)); + $this->assertEquals(true, $foundUsBankAccount->default); + } + + public function testFind() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = Test\Helper::generateValidUsBankAccountNonce(); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ]); + + $foundUsBankAccount= Braintree\UsBankAccount::find($result->paymentMethod->token); + $this->assertInstanceOf('Braintree\UsBankAccount', $foundUsBankAccount); + $this->assertEquals('021000021', $foundUsBankAccount->routingNumber); + $this->assertEquals('1234', $foundUsBankAccount->last4); + $this->assertEquals('checking', $foundUsBankAccount->accountType); + $this->assertEquals('Dan Schulman', $foundUsBankAccount->accountHolderName); + $this->assertRegExp('/CHASE/', $foundUsBankAccount->bankName); + $this->assertEquals('cl mandate text', $foundUsBankAccount->achMandate->text); + $this->assertEquals('DateTime', get_class($foundUsBankAccount->achMandate->acceptedAt)); + $this->assertEquals(true, $foundUsBankAccount->default); + } + + public function testFind_throwsIfCannotBeFound() + { + $this->setExpectedException('Braintree\Exception\NotFound'); + Braintree\UsBankAccount::find(Test\Helper::generateInvalidUsBankAccountNonce()); + } + + public function testSale_createsASaleUsingGivenToken() + { + $customer = Braintree\Customer::createNoValidate(); + $http = new HttpClientApi(Braintree\Configuration::$global); + $nonce = Test\Helper::generateValidUsBankAccountNonce(); + + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount() + ] + ]); + + $result = Braintree\UsBankAccount::sale($result->paymentMethod->token, [ + 'merchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'amount' => '100.00' + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals(Braintree\Transaction::SETTLEMENT_PENDING, $transaction->status); + $this->assertEquals(Braintree\Transaction::SALE, $transaction->type); + $this->assertEquals('100.00', $transaction->amount); + $this->assertEquals('021000021', $transaction->usBankAccount->routingNumber); + $this->assertEquals('1234', $transaction->usBankAccount->last4); + $this->assertEquals('checking', $transaction->usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName); + $this->assertRegExp('/CHASE/', $transaction->usBankAccount->bankName); + $this->assertEquals('cl mandate text', $transaction->usBankAccount->achMandate->text); + $this->assertEquals('DateTime', get_class($transaction->usBankAccount->achMandate->acceptedAt)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountVerificationTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountVerificationTest.php new file mode 100644 index 00000000000..2b7ca9db25a --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/UsBankAccountVerificationTest.php @@ -0,0 +1,233 @@ + $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'usBankAccountVerificationMethod' => 'network_check', + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals(1, count($usBankAccount->verifications)); + $verification = $usBankAccount->verifications[0]; + $this->assertEquals('network_check', $verification->verificationMethod); + } + + public function test_findVerification() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::NETWORK_CHECK, + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals(1, count($usBankAccount->verifications)); + $createdVerification = $usBankAccount->verifications[0]; + $foundVerification = Braintree\UsBankAccountVerification::find($createdVerification->id); + $this->assertEquals($foundVerification, $createdVerification); + } + + public function test_searchVerification() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::usBankMerchantAccount(), + 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::INDEPENDENT_CHECK, + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals(1, count($usBankAccount->verifications)); + $createdVerification = $usBankAccount->verifications[0]; + + $query = [Braintree\UsBankAccountVerificationSearch::id()->is($createdVerification->id)]; + $query[] = Braintree\UsBankAccountVerificationSearch::accountNumber()->endsWith("1234"); + + $collection = Braintree\UsBankAccountVerification::search($query); + + $this->assertEquals(1, $collection->maximumCount()); + } + + public function test_attemptConfirmMicroTransferAmounts() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $customer = $gateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals(1, count($usBankAccount->verifications)); + $createdVerification = $usBankAccount->verifications[0]; + + $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [1, 1]); + + $this->assertFalse($result->success); + + $amountErrors = $result->errors->forKey('usBankAccountVerification')->onAttribute('base'); + $this->assertEquals( + Braintree\Error\Codes::US_BANK_ACCOUNT_VERIFICATION_AMOUNTS_DO_NOT_MATCH, + $amountErrors[0]->code + ); + } + + public function test_confirmMicroTransferAmountsSettled() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $customer = $gateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce('1000000000'), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals(1, count($usBankAccount->verifications)); + $createdVerification = $usBankAccount->verifications[0]; + + $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [17, 29]); + + $this->assertTrue($result->success); + + $usBankAccountVerification = $result->usBankAccountVerification; + $this->assertEquals($usBankAccountVerification->status, Braintree\Result\UsBankAccountVerification::VERIFIED); + $usBankAccount = $gateway->usBankAccount()->find($usBankAccountVerification->usBankAccount->token); + $this->assertTrue($usBankAccount->verified); + } + + public function test_confirmMicroTransferAmountsUnsettled() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $customer = $gateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce('1000000001'), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals(1, count($usBankAccount->verifications)); + $createdVerification = $usBankAccount->verifications[0]; + + $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [17, 29]); + + $this->assertTrue($result->success); + + $usBankAccountVerification = $result->usBankAccountVerification; + $this->assertEquals($usBankAccountVerification->status, Braintree\Result\UsBankAccountVerification::PENDING); + $usBankAccount = $gateway->usBankAccount()->find($usBankAccountVerification->usBankAccount->token); + $this->assertFalse($usBankAccount->verified); + } + + public function test_exceedRetryThreshold() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'development', + 'merchantId' => 'integration2_merchant_id', + 'publicKey' => 'integration2_public_key', + 'privateKey' => 'integration2_private_key' + ]); + + $customer = $gateway->customer()->create([ + 'firstName' => 'Joe', + 'lastName' => 'Brown' + ])->customer; + + $result = $gateway->paymentMethod()->create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Test\Helper::generateValidUsBankAccountNonce(), + 'options' => [ + 'verificationMerchantAccountId' => Test\Helper::anotherUsBankMerchantAccount(), + 'usBankAccountVerificationMethod' => Braintree\Result\UsBankAccountVerification::MICRO_TRANSFERS, + ] + ]); + + $usBankAccount = $result->paymentMethod; + $this->assertEquals(1, count($usBankAccount->verifications)); + $createdVerification = $usBankAccount->verifications[0]; + + for ($i = 0; $i < 4; $i++) { + $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [1, 1]); + $this->assertFalse($result->success); + + $amountErrors = $result->errors->forKey('usBankAccountVerification')->onAttribute('base'); + $this->assertEquals( + Braintree\Error\Codes::US_BANK_ACCOUNT_VERIFICATION_AMOUNTS_DO_NOT_MATCH, + $amountErrors[0]->code + ); + } + + $result = $gateway->usBankAccountVerification()->confirmMicroTransferAmounts($createdVerification->id, [1, 1]); + $this->assertFalse($result->success); + + $amountErrors = $result->errors->forKey('usBankAccountVerification')->onAttribute('base'); + $this->assertEquals( + Braintree\Error\Codes::US_BANK_ACCOUNT_VERIFICATION_TOO_MANY_CONFIRMATION_ATTEMPTS, + $amountErrors[0]->code + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/integration/VisaCheckoutCardTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/VisaCheckoutCardTest.php new file mode 100644 index 00000000000..a081cd62d72 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/integration/VisaCheckoutCardTest.php @@ -0,0 +1,151 @@ + $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$visaCheckoutDiscover, + ]); + + $this->assertTrue($result->success); + $visaCheckoutCard = $result->paymentMethod; + $this->assertNotNull($visaCheckoutCard->token); + $this->assertSame(Braintree\CreditCard::DISCOVER, $visaCheckoutCard->cardType); + $this->assertTrue($visaCheckoutCard->default); + $this->assertContains('discover', $visaCheckoutCard->imageUrl); + $this->assertTrue(intval($visaCheckoutCard->expirationMonth) > 0); + $this->assertTrue(intval($visaCheckoutCard->expirationYear) > 0); + $this->assertSame($customer->id, $visaCheckoutCard->customerId); + $this->assertSame('abc123', $visaCheckoutCard->callId); + $this->assertSame($visaCheckoutCard->last4, '1117'); + $this->assertSame($visaCheckoutCard->maskedNumber, '601111******1117'); + + $this->assertNotNull($visaCheckoutCard->billingAddress); + $this->assertNotNull($visaCheckoutCard->bin); + $this->assertNotNull($visaCheckoutCard->callId); + $this->assertNotNull($visaCheckoutCard->cardType); + $this->assertNotNull($visaCheckoutCard->cardholderName); + $this->assertNotNull($visaCheckoutCard->commercial); + $this->assertNotNull($visaCheckoutCard->countryOfIssuance); + $this->assertNotNull($visaCheckoutCard->createdAt); + $this->assertNotNull($visaCheckoutCard->customerId); + $this->assertNotNull($visaCheckoutCard->customerLocation); + $this->assertNotNull($visaCheckoutCard->debit); + $this->assertNotNull($visaCheckoutCard->default); + $this->assertNotNull($visaCheckoutCard->durbinRegulated); + $this->assertNotNull($visaCheckoutCard->expirationDate); + $this->assertNotNull($visaCheckoutCard->expirationMonth); + $this->assertNotNull($visaCheckoutCard->expirationYear); + $this->assertNotNull($visaCheckoutCard->expired); + $this->assertNotNull($visaCheckoutCard->healthcare); + $this->assertNotNull($visaCheckoutCard->imageUrl); + $this->assertNotNull($visaCheckoutCard->issuingBank); + $this->assertNotNull($visaCheckoutCard->last4); + $this->assertNotNull($visaCheckoutCard->maskedNumber); + $this->assertNotNull($visaCheckoutCard->payroll); + $this->assertNotNull($visaCheckoutCard->prepaid); + $this->assertNotNull($visaCheckoutCard->productId); + $this->assertNotNull($visaCheckoutCard->subscriptions); + $this->assertNotNull($visaCheckoutCard->token); + $this->assertNotNull($visaCheckoutCard->uniqueNumberIdentifier); + $this->assertNotNull($visaCheckoutCard->updatedAt); + } + + public function testCreateWithVisaCheckoutCardNonceWithVerification() + { + $customer = Braintree\Customer::createNoValidate(); + $result = Braintree\PaymentMethod::create([ + 'customerId' => $customer->id, + 'paymentMethodNonce' => Braintree\Test\Nonces::$visaCheckoutDiscover, + 'options' => [ + 'verifyCard' => true + ] + ]); + + $this->assertTrue($result->success); + $visaCheckoutCard = $result->paymentMethod; + $verification = $visaCheckoutCard->verification; + + $this->assertNotNull($verification); + $this->assertNotNull($verification->status); + } + + public function testTransactionSearchWithVisaCheckout() + { + $transaction = Braintree\Transaction::saleNoValidate([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'paymentMethodNonce' => Braintree\Test\Nonces::$visaCheckoutDiscover, + ]); + + $collection = Braintree\Transaction::search([ + Braintree\TransactionSearch::id()->is($transaction->id), + Braintree\TransactionSearch::paymentInstrumentType()->is(Braintree\PaymentInstrumentType::VISA_CHECKOUT_CARD) + ]); + + + $this->assertEquals($transaction->paymentInstrumentType, Braintree\PaymentInstrumentType::VISA_CHECKOUT_CARD); + $this->assertEquals($transaction->id, $collection->firstItem()->id); + } + + public function testCreateCustomerWithVisaCheckoutCard() + { + $nonce = Braintree\Test\Nonces::$visaCheckoutDiscover; + $result = Braintree\Customer::create([ + 'paymentMethodNonce' => $nonce + ]); + $this->assertTrue($result->success); + $customer = $result->customer; + $this->assertNotNull($customer->visaCheckoutCards[0]); + $this->assertNotNull($customer->paymentMethods[0]); + } + + public function testCreateTransactionWithVisaCheckoutNonceAndVault() + { + $result = Braintree\Transaction::sale([ + 'amount' => '47.00', + 'paymentMethodNonce' => Braintree\Test\Nonces::$visaCheckoutAmEx, + 'options' => [ + 'storeInVault' => true + ] + ]); + + $this->assertTrue($result->success); + $transaction = $result->transaction; + $this->assertEquals('47.00', $transaction->amount); + $visaCheckoutCardDetails = $transaction->visaCheckoutCardDetails; + $this->assertSame(Braintree\CreditCard::AMEX, $visaCheckoutCardDetails->cardType); + + $this->assertNotNull($visaCheckoutCardDetails->bin); + $this->assertNotNull($visaCheckoutCardDetails->callId); + $this->assertNotNull($visaCheckoutCardDetails->cardType); + $this->assertNotNull($visaCheckoutCardDetails->cardholderName); + $this->assertNotNull($visaCheckoutCardDetails->commercial); + $this->assertNotNull($visaCheckoutCardDetails->countryOfIssuance); + $this->assertNotNull($visaCheckoutCardDetails->customerLocation); + $this->assertNotNull($visaCheckoutCardDetails->debit); + $this->assertNotNull($visaCheckoutCardDetails->durbinRegulated); + $this->assertNotNull($visaCheckoutCardDetails->expirationDate); + $this->assertNotNull($visaCheckoutCardDetails->expirationMonth); + $this->assertNotNull($visaCheckoutCardDetails->expirationYear); + $this->assertNotNull($visaCheckoutCardDetails->healthcare); + $this->assertNotNull($visaCheckoutCardDetails->imageUrl); + $this->assertNotNull($visaCheckoutCardDetails->issuingBank); + $this->assertNotNull($visaCheckoutCardDetails->last4); + $this->assertNotNull($visaCheckoutCardDetails->maskedNumber); + $this->assertNotNull($visaCheckoutCardDetails->payroll); + $this->assertNotNull($visaCheckoutCardDetails->prepaid); + $this->assertNotNull($visaCheckoutCardDetails->productId); + $this->assertNotNull($visaCheckoutCardDetails->token); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddOnTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddOnTest.php new file mode 100644 index 00000000000..29d20e8b0ee --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddOnTest.php @@ -0,0 +1,34 @@ +assertInstanceOf('Braintree\AddOn', $addOn); + } + + public function testToString() + { + $addOnParams = [ + "amount" => "100.00", + "description" => "some description", + "id" => "1", + "kind" => "add_on", + "name" => "php_add_on", + "neverExpires" => "false", + "numberOfBillingCycles" => "1" + ]; + + $addOn = Braintree\AddOn::factory($addOnParams); + + $this->assertEquals("Braintree\AddOn[amount=100.00, description=some description, id=1, kind=add_on, name=php_add_on, neverExpires=false, numberOfBillingCycles=1]", (string) $addOn); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddressTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddressTest.php new file mode 100644 index 00000000000..6947d49aa8f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AddressTest.php @@ -0,0 +1,79 @@ +setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree\Address: foo'); + $a = Braintree\Address::factory([]); + $a->foo; + } + + public function testIsEqual() + { + $first = Braintree\Address::factory( + ['customerId' => 'c1', 'id' => 'a1'] + ); + $second = Braintree\Address::factory( + ['customerId' => 'c1', 'id' => 'a1'] + ); + + $this->assertTrue($first->isEqual($second)); + $this->assertTrue($second->isEqual($first)); + + } + public function testIsNotEqual() { + $first = Braintree\Address::factory( + ['customerId' => 'c1', 'id' => 'a1'] + ); + $second = Braintree\Address::factory( + ['customerId' => 'c1', 'id' => 'not a1'] + ); + + $this->assertFalse($first->isEqual($second)); + $this->assertFalse($second->isEqual($first)); + } + + public function testCustomerIdNotEqual() + { + $first = Braintree\Address::factory( + ['customerId' => 'c1', 'id' => 'a1'] + ); + $second = Braintree\Address::factory( + ['customerId' => 'not c1', 'id' => 'a1'] + ); + + $this->assertFalse($first->isEqual($second)); + $this->assertFalse($second->isEqual($first)); + } + + public function testFindErrorsOnBlankCustomerId() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Address::find('', '123'); + } + + public function testFindErrorsOnBlankAddressId() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Address::find('123', ''); + } + + public function testFindErrorsOnWhitespaceOnlyId() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Address::find('123', ' '); + } + + public function testFindErrorsOnWhitespaceOnlyCustomerId() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Address::find(' ', '123'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AuthorizationAdjustmentTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AuthorizationAdjustmentTest.php new file mode 100644 index 00000000000..f7e737942a7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/AuthorizationAdjustmentTest.php @@ -0,0 +1,32 @@ +assertinstanceof('Braintree\AuthorizationAdjustment', $authorizationAdjustment); + } + + public function testToString() + { + $authorizationAdjustmentParams = [ + 'amount' => '100.00', + 'timestamp' => new \DateTime('2017-07-12 01:02:03'), + 'success' => true, + 'processorResponseCode' => '1000', + 'processorResponseText' => 'Approved', + ]; + + $authorizationAdjustment = Braintree\AuthorizationAdjustment::factory($authorizationAdjustmentParams); + + $this->assertEquals('Braintree\AuthorizationAdjustment[amount=100.00, timestamp=Wednesday, 12-Jul-17 01:02:03 UTC, success=1, processorResponseCode=1000, processorResponseText=Approved]', (string) $authorizationAdjustment); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/BraintreeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/BraintreeTest.php new file mode 100644 index 00000000000..790fe60258f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/BraintreeTest.php @@ -0,0 +1,25 @@ + ['expirationMonth' => '05', 'expirationYear' => '2010', 'bin' => '510510', 'last4' => '5100'], + 'customer' => [], + 'billing' => [], + 'descriptor' => [], + 'shipping' => [], + 'subscription' => ['billingPeriodStartDate' => '1983-07-12'], + 'statusHistory' => [], + ]); + $this->assertTrue(isset($t->creditCard)); + $this->assertFalse(empty($t->creditCard)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ClientApi/ClientTokenTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ClientApi/ClientTokenTest.php new file mode 100644 index 00000000000..40e15b54ecb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ClientApi/ClientTokenTest.php @@ -0,0 +1,22 @@ +setExpectedException('InvalidArgumentException', 'invalid keys: options[makeDefault]'); + Braintree\ClientToken::generate(["options" => ["makeDefault" => true]]); + } + + public function testErrorsWhenInvalidArgumentIsSupplied() + { + $this->setExpectedException('InvalidArgumentException', 'invalid keys: customrId'); + Braintree\ClientToken::generate(["customrId" => "1234"]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ConfigurationTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ConfigurationTest.php new file mode 100644 index 00000000000..600a81d82db --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ConfigurationTest.php @@ -0,0 +1,529 @@ +config = new Braintree\Configuration(); + } + + public function teardown() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey('integration_private_key'); + } + + public function testAssertGlobalHasAccessTokenOrKeys() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey('integration_private_key'); + + try { + Braintree\Configuration::assertGlobalHasAccessTokenOrKeys(); + } catch (Exception $notExpected) { + $this->fail(); + } + + $this->assertTrue(TRUE); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Configuration::publicKey needs to be set + */ + public function testAssertGlobalHasAccessTokenOrKeysWithoutPublicKey() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey(''); + Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::assertGlobalHasAccessTokenOrKeys(); + } + + public function testConstructWithArrayOfCredentials() + { + $config = new Braintree\Configuration([ + 'environment' => 'sandbox', + 'merchantId' => 'sandbox_merchant_id', + 'publicKey' => 'sandbox_public_key', + 'privateKey' => 'sandbox_private_key', + 'timeout' => 120, + 'acceptGzipEncoding' => false, + ]); + + $this->assertEquals('sandbox', $config->getEnvironment()); + $this->assertEquals('sandbox_merchant_id', $config->getMerchantId()); + $this->assertEquals(120, $config->getTimeout()); + $this->assertFalse($config->getAcceptGzipEncoding()); + } + + public function testSetValidEnvironment() + { + Braintree\Configuration::environment('sandbox'); + $this->assertEquals('sandbox', Braintree\Configuration::environment()); + Braintree\Configuration::reset(); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage "invalid" is not a valid environment. + */ + public function testSetInvalidEnvironment() + { + Braintree\Configuration::environment('invalid'); + Braintree\Configuration::reset(); + } + + public function testMerchantPath() + { + $this->config->setMerchantId('abc123'); + $mp = $this->config->merchantPath(); + $this->assertEquals('/merchants/abc123', $mp); + } + + public function testCaFile() + { + $this->config->setEnvironment('development'); + $this->setExpectedException('Braintree\Exception\SSLCaFileNotFound'); + $this->config->caFile('/does/not/exist/'); + } + + public function testSSLOn() + { + $this->config->setEnvironment('development'); + $on = $this->config->sslOn(); + $this->assertFalse($on); + + $this->config->setEnvironment('sandbox'); + $on = $this->config->sslOn(); + $this->assertTrue($on); + + $this->config->setEnvironment('production'); + $on = $this->config->sslOn(); + $this->assertTrue($on); + } + + public function testPortNumber() + { + $this->config->setEnvironment('development'); + $pn = $this->config->portNumber(); + $this->assertEquals(getenv("GATEWAY_PORT") ? getenv("GATEWAY_PORT") : 3000, $pn); + + $this->config->setEnvironment('sandbox'); + $pn = $this->config->portNumber(); + $this->assertEquals(443, $pn); + + $this->config->setEnvironment('production'); + $pn = $this->config->portNumber(); + $this->assertEquals(443, $pn); + } + + + public function testProtocol() + { + $this->config->setEnvironment('development'); + $p = $this->config->protocol(); + $this->assertEquals('http', $p); + + $this->config->setEnvironment('sandbox'); + $p = $this->config->protocol(); + $this->assertEquals('https', $p); + + $this->config->setEnvironment('production'); + $p = $this->config->protocol(); + $this->assertEquals('https', $p); + } + + public function testServerName() + { + $this->config->setEnvironment('development'); + $sn = $this->config->serverName(); + $this->assertEquals('localhost', $sn); + + $this->config->setEnvironment('sandbox'); + $sn = $this->config->serverName(); + $this->assertEquals('api.sandbox.braintreegateway.com', $sn); + + $this->config->setEnvironment('production'); + $sn = $this->config->serverName(); + $this->assertEquals('api.braintreegateway.com', $sn); + } + + public function testAuthUrl() + { + $this->config->setEnvironment('development'); + $authUrl = $this->config->authUrl(); + $this->assertEquals('http://auth.venmo.dev:9292', $authUrl); + + $this->config->setEnvironment('qa'); + $authUrl = $this->config->authUrl(); + $this->assertEquals('https://auth.qa.venmo.com', $authUrl); + + $this->config->setEnvironment('sandbox'); + $authUrl = $this->config->authUrl(); + $this->assertEquals('https://auth.sandbox.venmo.com', $authUrl); + + $this->config->setEnvironment('production'); + $authUrl = $this->config->authUrl(); + $this->assertEquals('https://auth.venmo.com', $authUrl); + } + + public function testBaseUrl() + { + $this->config->setEnvironment('development'); + $bu = $this->config->baseUrl(); + $this->assertEquals('http://localhost:' . $this->config->portNumber(), $bu); + + $this->config->setEnvironment('qa'); + $bu = $this->config->baseUrl(); + $this->assertEquals('https://gateway.qa.braintreepayments.com:443', $bu); + + $this->config->setEnvironment('sandbox'); + $bu = $this->config->baseUrl(); + $this->assertEquals('https://api.sandbox.braintreegateway.com:443', $bu); + + $this->config->setEnvironment('production'); + $bu = $this->config->baseUrl(); + $this->assertEquals('https://api.braintreegateway.com:443', $bu); + } + + function testProxyHost() + { + $this->config->proxyHost('example.com'); + $this->assertEquals('example.com', $this->config->proxyHost()); + } + + function testProxyPort() + { + $this->config->proxyPort('1234'); + $this->assertEquals('1234', $this->config->proxyPort()); + } + + function testProxyType() + { + $this->config->proxyType('MY_PROXY'); + $this->assertEquals('MY_PROXY', $this->config->proxyType()); + } + + function testProxyIsConfigured() + { + $this->config->proxyHost('example.com'); + $this->config->proxyPort('1234'); + + $this->assertTrue($this->config->isUsingProxy()); + } + + function testProxyUser() + { + $this->config->proxyUser('user'); + $this->assertEquals('user', $this->config->proxyUser()); + } + + function testProxyPassword() + { + $this->config->proxyPassword('password'); + $this->assertEquals('password', $this->config->proxyPassword()); + } + + function testIsAuthenticatedProxy() + { + $this->config->proxyUser('username'); + $this->config->proxyPassword('password'); + + $this->assertTrue($this->config->isAuthenticatedProxy()); + } + + function testTimeout() + { + $this->config->timeout(30); + + $this->assertEquals(30, $this->config->timeout()); + } + + function testTimeoutDefaultsToSixty() + { + $this->assertEquals(60, $this->config->timeout()); + } + + function testSslVersion() + { + $this->config->sslVersion(6); + + $this->assertEquals(6, $this->config->sslVersion()); + } + + function testSslVersionDefaultsToNull() + { + $this->assertEquals(null, $this->config->sslVersion()); + } + + public function testAcceptEncodingDefaultsTrue() + { + $this->assertTrue($this->config->acceptGzipEncoding()); + } + + public function testAcceptGzipEncoding() + { + $this->assertTrue($this->config->acceptGzipEncoding()); + $this->config->acceptGzipEncoding(false); + $this->assertFalse($this->config->acceptGzipEncoding()); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage environment needs to be set + */ + public function testValidateAbsentEnvironment() + { + //Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage environment needs to be set + */ + public function testValidateEmptyStringEnvironment() + { + Braintree\Configuration::environment(''); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage merchantId needs to be set + */ + public function testAbsentMerchantId() + { + Braintree\Configuration::environment('development'); + //Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage merchantId needs to be set + */ + public function testEmptyStringMerchantId() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId(''); + Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage publicKey needs to be set + */ + public function testAbsentPublicKey() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + //Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage publicKey needs to be set + */ + public function testEmptyStringPublicKey() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey(''); + Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage privateKey needs to be set + */ + public function testAbsentPrivateKey() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('integration_public_key'); + //Braintree\Configuration::privateKey('integration_private_key'); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage privateKey needs to be set + */ + public function testEmptyStringPrivateKey() + { + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('integration_public_key'); + Braintree\Configuration::privateKey(''); + + Braintree\Configuration::$global->assertHasAccessTokenOrKeys(); + } + + public function testValidWithOAuthClientCredentials() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $config->assertHasClientCredentials(); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage clientSecret needs to be passed + */ + public function testInvalidWithOAuthClientCredentials() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_id$development$integration_client_id' + ]); + + $config->assertHasClientCredentials(); + } + + public function testDetectEnvironmentFromClientId() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + + $this->assertEquals('development', $config->getEnvironment()); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Mismatched credential environments: clientId environment is sandbox and clientSecret environment is development + */ + public function testDetectEnvironmentFromClientIdFail() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_id$sandbox$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Value passed for clientId is not a clientId + */ + public function testClientIdTypeFail() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_secret$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + } + + public function testValidWithAccessToken() + { + $config = new Braintree\Configuration([ + 'accessToken' => 'access_token$development$integration_merchant_id$integration_access_token', + ]); + + $config->assertHasAccessTokenOrKeys(); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Value passed for accessToken is not an accessToken + */ + public function testInvalidAccessTokenType() + { + $config = new Braintree\Configuration([ + 'accessToken' => 'client_id$development$integration_merchant_id$integration_access_token', + ]); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Incorrect accessToken syntax. Expected: type$environment$merchant_id$token + */ + public function testInvalidAccessTokenSyntax() + { + $config = new Braintree\Configuration([ + 'accessToken' => 'client_id$development$integration_client_id', + ]); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage "invalid" is not a valid environment. + */ + public function testInvalidAccessTokenEnvironment() + { + $config = new Braintree\Configuration([ + 'accessToken' => 'access_token$invalid$integration_merchant_id$integration_access_token', + ]); + } + + + public function testValidWithOAuthClientCredentialsAndAccessToken() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + 'accessToken' => 'access_token$development$integration_merchant_id$integration_access_token', + ]); + + $config->assertHasClientCredentials(); + $config->assertHasAccessTokenOrKeys(); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Mismatched credential environments: clientId environment is development and accessToken environment is sandbox + */ + public function testInvalidEnvironmentWithOAuthClientCredentialsAndAccessToken() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + 'accessToken' => 'access_token$sandbox$integration_merchant_id$integration_access_token', + ]); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Cannot mix OAuth credentials (clientId, clientSecret, accessToken) with key credentials (publicKey, privateKey, environment, merchantId) + */ + public function testCannotMixKeysWithOAuthCredentials() + { + $config = new Braintree\Configuration([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret', + 'environment' => 'development', + 'merchantId' => 'integration_merchant_id', + 'publicKey' => 'integration_public_key', + 'privateKey' => 'integration_private_key' + ]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardTest.php new file mode 100644 index 00000000000..bd73e8921cf --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardTest.php @@ -0,0 +1,151 @@ +setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree\CreditCard: foo'); + $cc = Braintree\CreditCard::factory([]); + $cc->foo; + } + + public function testCreate_throwsIfInvalidKey() + { + $this->setExpectedException('InvalidArgumentException', 'invalid keys: invalidKey'); + Braintree\CreditCard::create(['invalidKey' => 'foo']); + } + + public function testIsDefault() + { + $creditCard = Braintree\CreditCard::factory(['default' => true]); + $this->assertTrue($creditCard->isDefault()); + + $creditCard = Braintree\CreditCard::factory(['default' => false]); + $this->assertFalse($creditCard->isDefault()); + } + + public function testMaskedNumber() + { + $creditCard = Braintree\CreditCard::factory(['bin' => '123456', 'last4' => '7890']); + $this->assertEquals('123456******7890', $creditCard->maskedNumber); + } + + public function testCreateSignature() + { + $expected = [ + 'billingAddressId', 'cardholderName', 'cvv', 'number', 'deviceSessionId', + 'expirationDate', 'expirationMonth', 'expirationYear', 'token', 'venmoSdkPaymentMethodCode', + 'deviceData', 'fraudMerchantId', 'paymentMethodNonce', + ['options' => ['makeDefault', 'verificationMerchantAccountId', 'verifyCard', 'verificationAmount', 'verificationAccountType', 'venmoSdkSession', 'failOnDuplicatePaymentMethod']], + [ + 'billingAddress' => [ + 'firstName', + 'lastName', + 'company', + 'countryCodeAlpha2', + 'countryCodeAlpha3', + 'countryCodeNumeric', + 'countryName', + 'extendedAddress', + 'locality', + 'region', + 'postalCode', + 'streetAddress', + ], + ], + 'customerId' + ]; + $this->assertEquals($expected, Braintree\CreditCardGateway::createSignature()); + } + + public function testUpdateSignature() + { + $expected = [ + 'billingAddressId', 'cardholderName', 'cvv', 'number', 'deviceSessionId', + 'expirationDate', 'expirationMonth', 'expirationYear', 'token', 'venmoSdkPaymentMethodCode', + 'deviceData', 'fraudMerchantId', 'paymentMethodNonce', + [ + 'options' => [ + 'makeDefault', + 'verificationMerchantAccountId', + 'verifyCard', + 'verificationAmount', + 'verificationAccountType', + 'venmoSdkSession', + 'failOnDuplicatePaymentMethod', + ] + ], + [ + 'billingAddress' => [ + 'firstName', + 'lastName', + 'company', + 'countryCodeAlpha2', + 'countryCodeAlpha3', + 'countryCodeNumeric', + 'countryName', + 'extendedAddress', + 'locality', + 'region', + 'postalCode', + 'streetAddress', + [ + 'options' => [ + 'updateExisting' + ] + ] + ], + ], + ]; + $this->assertEquals($expected, Braintree\CreditCardGateway::updateSignature()); + } + + public function testErrorsOnFindWithBlankArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\CreditCard::find(''); + } + + public function testErrorsOnFindWithWhitespaceArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\CreditCard::find(' '); + } + + public function testErrorsOnFindWithWhitespaceCharacterArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\CreditCard::find('\t'); + } + + public function testVerificationIsLatestVerification() + { + $creditCard = Braintree\CreditCard::factory( + [ + 'verifications' => [ + [ + 'id' => '123', + 'createdAt' => DateTime::createFromFormat('Ymd', '20121212') + ], + [ + 'id' => '932', + 'createdAt' => DateTime::createFromFormat('Ymd', '20121215') + ], + [ + 'id' => '456', + 'createdAt' => DateTime::createFromFormat('Ymd', '20121213') + ] + ] + ] + ); + + $this->assertEquals('932', $creditCard->verification->id); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardVerificationTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardVerificationTest.php new file mode 100644 index 00000000000..4c6b1dc5019 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CreditCardVerificationTest.php @@ -0,0 +1,22 @@ +setExpectedException('InvalidArgumentException', 'invalid keys: invalidProperty'); + Braintree\CreditCardVerification::create(['options' => ['amount' => '123.45'], 'invalidProperty' => 'foo']); + } + + public function test_createWithPaymentMethodArguments() + { + $this->setExpectedException('InvalidArgumentException', 'invalid keys: creditCard[venmoSdkPaymentMethodCode]'); + Braintree\CreditCardVerification::create(['options' => ['amount' => '123.45'], 'creditCard' => ['venmoSdkPaymentMethodCode' => 'foo']]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CustomerTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CustomerTest.php new file mode 100644 index 00000000000..1496327be27 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/CustomerTest.php @@ -0,0 +1,61 @@ +setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree\Customer: foo'); + $c = Braintree\Customer::factory([]); + $c->foo; + } + + public function testUpdateSignature_doesNotAlterOptionsInCreditCardUpdateSignature() + { + Braintree\CustomerGateway::updateSignature(); + foreach (Braintree\CreditCardGateway::updateSignature() as $key => $value) { + if(is_array($value) and array_key_exists('options', $value)) { + $this->assertEquals([ + 'makeDefault', + 'verificationMerchantAccountId', + 'verifyCard', + 'verificationAmount', + 'verificationAccountType', + 'venmoSdkSession', + 'failOnDuplicatePaymentMethod', + ], $value['options']); + } + } + } + + public function testCreateSignature_doesNotIncludeCustomerIdOnCreditCard() + { + $signature = Braintree\CustomerGateway::createSignature(); + $creditCardSignatures = array_filter($signature, 'Test\Unit\CustomerTest::findCreditCardArray'); + $creditCardSignature = array_shift($creditCardSignatures)['creditCard']; + + $this->assertNotContains('customerId', $creditCardSignature); + } + + public function findCreditCardArray($el) + { + return is_array($el) && array_key_exists('creditCard', $el); + } + + public function testFindErrorsOnBlankId() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Customer::find(''); + } + + public function testFindErrorsOnWhitespaceId() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Customer::find('\t'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DigestTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DigestTest.php new file mode 100644 index 00000000000..1f82ab484fc --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DigestTest.php @@ -0,0 +1,97 @@ +assertTrue(Braintree\Digest::secureCompare("a_string", "a_string")); + } + + public function testSecureCompareReturnsFalseForDifferentLengths() + { + $this->assertFalse(Braintree\Digest::secureCompare("a_string", "a_string_that_is_longer")); + } + + public function testSecureCompareReturnsFalseForNonmatchingSameLengthStrings() + { + $this->assertFalse(Braintree\Digest::secureCompare("a_string", "a_strong")); + } + + public function testHexDigestSha1() + { + $key = str_repeat(chr(0xaa),80); + $message = 'Test Using Larger Than Block-Size Key - Hash Key First'; + $d = Braintree\Digest::hexDigestSha1($key, $message); + + $this->assertEquals('aa4ae5e15272d00e95705637ce8a3b55ed402112', $d); + } + + public function testHexDigestSha1_again() + { + $key = str_repeat(chr(0xaa),80); + $message = 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data'; + $d = Braintree\Digest::hexDigestSha1($key, $message); + + $this->assertEquals('e8e99d0f45237d786d6bbaa7965c7808bbff1a91', $d); + } + + public function testHexDigestSha256() + { + $key = str_repeat(chr(0xaa),80); + $message = 'Test Using Larger Than Block-Size Key - Hash Key First'; + $d = Braintree\Digest::hexDigestSha256($key, $message); + + $this->assertEquals('6953025ed96f0c09f80a96f78e6538dbe2e7b820e3dd970e7ddd39091b32352f', $d); + } + + public function testHexDigestSha256_again() + { + $key = str_repeat(chr(0xaa),80); + $message = 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data'; + $d = Braintree\Digest::hexDigestSha256($key, $message); + + $this->assertEquals('6355ac22e890d0a3c8481a5ca4825bc884d3e7a1ff98a2fc2ac7d8e064c3b2e6', $d); + } + + public function testBuiltInHmacSha1() + { + Braintree\Configuration::privateKey(str_repeat(chr(0xaa),80)); + $message = 'Test Using Larger Than Block-Size Key - Hash Key First'; + $d = Braintree\Digest::_builtInHmacSha1($message, Braintree\Configuration::privateKey()); + + $this->assertEquals('aa4ae5e15272d00e95705637ce8a3b55ed402112', $d); + } + + public function testBuiltInHmacSha1_again() + { + Braintree\Configuration::privateKey(str_repeat(chr(0xaa),80)); + $message = 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data'; + $d = Braintree\Digest::_builtInHmacSha1($message, Braintree\Configuration::privateKey()); + + $this->assertEquals('e8e99d0f45237d786d6bbaa7965c7808bbff1a91', $d); + } + + public function testHmacSha1() + { + Braintree\Configuration::privateKey(str_repeat(chr(0xaa),80)); + $message = 'Test Using Larger Than Block-Size Key - Hash Key First'; + $d = Braintree\Digest::_hmacSha1($message, Braintree\Configuration::privateKey()); + + $this->assertEquals('aa4ae5e15272d00e95705637ce8a3b55ed402112', $d); + } + + public function testHmacSha1_again() + { + Braintree\Configuration::privateKey(str_repeat(chr(0xaa),80)); + $message = 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data'; + $d = Braintree\Digest::_hmacSha1($message, Braintree\Configuration::privateKey()); + + $this->assertEquals('e8e99d0f45237d786d6bbaa7965c7808bbff1a91', $d); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementDetailsTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementDetailsTest.php new file mode 100644 index 00000000000..42255453f8e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementDetailsTest.php @@ -0,0 +1,29 @@ + new DateTime("2013-04-10") + ]); + + $this->assertTrue($details->isValid()); + } + + public function testIsValidReturnsFalse() + { + $details = new Braintree\DisbursementDetails([ + "disbursementDate" => null + ]); + + $this->assertFalse($details->isValid()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementTest.php new file mode 100644 index 00000000000..1d49ef6257f --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisbursementTest.php @@ -0,0 +1,86 @@ + "123456", + "merchantAccount" => [ + "id" => "sandbox_sub_merchant_account", + "masterMerchantAccount" => [ + "id" => "sandbox_master_merchant_account", + "status" => "active" + ], + "status" => "active" + ], + "transactionIds" => ["sub_merchant_transaction"], + "exceptionMessage" => "invalid_account_number", + "amount" => "100.00", + "disbursementType" => "credit", + "disbursementDate" => new DateTime("2013-04-10"), + "followUpAction" => "update", + "retry" => false, + "success" => false + ]); + + $this->assertEquals((string) $disbursement, 'Braintree\Disbursement[id=123456, merchantAccountDetails=id=sandbox_sub_merchant_account, masterMerchantAccount=id=sandbox_master_merchant_account, status=active, status=active, exceptionMessage=invalid_account_number, amount=100.00, disbursementDate=Wednesday, 10-Apr-13 00:00:00 UTC, followUpAction=update, retry=, success=, transactionIds=0=sub_merchant_transaction, disbursementType=credit]'); + } + + public function testIsDebit() + { + $disbursement = Braintree\Disbursement::factory([ + "id" => "123456", + "merchantAccount" => [ + "id" => "sandbox_sub_merchant_account", + "masterMerchantAccount" => [ + "id" => "sandbox_master_merchant_account", + "status" => "active" + ], + "status" => "active" + ], + "transactionIds" => ["sub_merchant_transaction"], + "exceptionMessage" => "invalid_account_number", + "amount" => "100.00", + "disbursementType" => "debit", + "disbursementDate" => new DateTime("2013-04-10"), + "followUpAction" => "update", + "retry" => false, + "success" => false + ]); + + $this->asserttrue($disbursement->isDebit()); + } + + public function testIsCredit() + { + $disbursement = Braintree\Disbursement::factory([ + "id" => "123456", + "merchantAccount" => [ + "id" => "sandbox_sub_merchant_account", + "masterMerchantAccount" => [ + "id" => "sandbox_master_merchant_account", + "status" => "active" + ], + "status" => "active" + ], + "transactionIds" => ["sub_merchant_transaction"], + "exceptionMessage" => "invalid_account_number", + "amount" => "100.00", + "disbursementType" => "credit", + "disbursementDate" => new DateTime("2013-04-10"), + "followUpAction" => "update", + "retry" => false, + "success" => false + ]); + + $this->asserttrue($disbursement->isCredit()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DiscountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DiscountTest.php new file mode 100644 index 00000000000..fb6d62dac4e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DiscountTest.php @@ -0,0 +1,34 @@ +assertInstanceOf('Braintree\Discount', $discount); + } + + public function testToString() + { + $discountParams = [ + "amount" => "100.00", + "description" => "some description", + "id" => "1", + "kind" => "discount", + "name" => "php_discount", + "neverExpires" => "false", + "numberOfBillingCycles" => "1" + ]; + + $discount = Braintree\Discount::factory($discountParams); + + $this->assertEquals("Braintree\Discount[amount=100.00, description=some description, id=1, kind=discount, name=php_discount, neverExpires=false, numberOfBillingCycles=1]", (string) $discount); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisputeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisputeTest.php new file mode 100644 index 00000000000..7ea99ac884c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DisputeTest.php @@ -0,0 +1,428 @@ +attributes = [ + 'amount' => '100.00', + 'amountDisputed' => '100.00', + 'amountWon' => '0.00', + 'caseNumber' => 'CB123456', + 'createdAt' => DateTime::createFromFormat('Ymd-His', '20130410-105039'), + 'currencyIsoCode' => 'USD', + 'dateOpened' => DateTime::createFromFormat('Ymd-His', '20130401-000000'), + 'dateWon' => DateTime::createFromFormat('Ymd-His', '20130402-000000'), + 'forwardedComments' => 'Forwarded comments', + 'id' => '123456', + 'kind' => 'chargeback', + 'merchantAccountId' => 'abc123', + 'originalDisputeId' => 'original_dispute_id', + 'reason' => 'fraud', + 'reasonCode' => '83', + 'reasonDescription' => 'Reason code 83 description', + 'receivedDate' => DateTime::createFromFormat('Ymd-His', '20130410-000410'), + 'referenceNumber' => '123456', + 'replyByDate' => DateTime::createFromFormat('Ymd-His', '20130417-0000417'), + 'status' => 'open', + 'updatedAt' => DateTime::createFromFormat('Ymd-His', '20130410-105039'), + 'evidence' => [[ + 'category' => NULL, + 'comment' => NULL, + 'createdAt' => DateTime::createFromFormat('Ymd-His', '20130411-105039'), + 'id' => 'evidence1', + 'sentToProcessorAt' => NULL, + 'sequenceNumber' => NULL, + 'url' => 'url_of_file_evidence', + ],[ + 'comment' => 'text evidence', + 'createdAt' => DateTime::createFromFormat('Ymd-His', '20130411-105039'), + 'id' => 'evidence2', + 'sentToProcessorAt' => '2009-04-11', + 'url' => NULL, + ]], + 'statusHistory' => [[ + 'effectiveDate' => '2013-04-10', + 'status' => 'open', + 'timestamp' => DateTime::createFromFormat('Ymd-His', '20130410-105039'), + ]], + 'transaction' => [ + 'id' => 'transaction_id', + 'amount' => '100.00', + 'createdAt' => DateTime::createFromFormat('Ymd-His', '20130319-105039'), + 'orderId' => NULL, + 'purchaseOrderNumber' => 'po', + 'paymentInstrumentSubtype' => 'Visa', + ] + ]; + } + + public function testLegacyConstructor() + { + $legacyParams = [ + 'transaction' => [ + 'id' => 'transaction_id', + 'amount' => '100.00', + ], + 'id' => '123456', + 'currencyIsoCode' => 'USD', + 'status' => 'open', + 'amount' => '100.00', + 'receivedDate' => DateTime::createFromFormat('Ymd-His', '20130410-000410'), + 'replyByDate' => DateTime::createFromFormat('Ymd-His', '20130421-000421'), + 'reason' => 'fraud', + 'transactionIds' => [ + 'asdf', 'qwer' + ], + 'dateOpened' => DateTime::createFromFormat('Ymd-His', '20130410-000410'), + 'dateWon' =>DateTime::createFromFormat('Ymd-His', '20130422-000422'), + 'kind' => 'chargeback' + ]; + + $dispute = Braintree\Dispute::factory($legacyParams); + + $this->assertEquals('123456', $dispute->id); + $this->assertEquals('100.00', $dispute->amount); + $this->assertEquals('USD', $dispute->currencyIsoCode); + $this->assertEquals(Braintree\Dispute::FRAUD, $dispute->reason); + $this->assertEquals(Braintree\Dispute::OPEN, $dispute->status); + $this->assertEquals(Braintree\Dispute::Open, $dispute->status); + $this->assertEquals('transaction_id', $dispute->transactionDetails->id); + $this->assertEquals('100.00', $dispute->transactionDetails->amount); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130410-000410'), $dispute->dateOpened); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130422-000422'), $dispute->dateWon); + $this->assertEquals(Braintree\Dispute::CHARGEBACK, $dispute->kind); + } + + public function testLegacyParamsWithNewAttributes() + { + $dispute = Braintree\Dispute::factory($this->attributes); + + $this->assertEquals('123456', $dispute->id); + $this->assertEquals('100.00', $dispute->amount); + $this->assertEquals('USD', $dispute->currencyIsoCode); + $this->assertEquals(Braintree\Dispute::FRAUD, $dispute->reason); + $this->assertEquals(Braintree\Dispute::Open, $dispute->status); + $this->assertEquals(Braintree\Dispute::OPEN, $dispute->status); + $this->assertEquals('transaction_id', $dispute->transactionDetails->id); + $this->assertEquals('100.00', $dispute->transactionDetails->amount); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130401-000000'), $dispute->dateOpened); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130402-000000'), $dispute->dateWon); + $this->assertEquals(Braintree\Dispute::CHARGEBACK, $dispute->kind); + } + + public function testConstructorPopulatesNewFields() + { + $dispute = Braintree\Dispute::factory($this->attributes); + + $this->assertEquals("100.00", $dispute->amountDisputed); + $this->assertEquals("0.00", $dispute->amountWon); + $this->assertEquals("CB123456", $dispute->caseNumber); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130410-105039'), $dispute->createdAt); + $this->assertEquals("Forwarded comments", $dispute->forwardedComments); + $this->assertEquals("abc123", $dispute->merchantAccountId); + $this->assertEquals("original_dispute_id", $dispute->originalDisputeId); + $this->assertEquals("83", $dispute->reasonCode); + $this->assertEquals("Reason code 83 description", $dispute->reasonDescription); + $this->assertEquals("123456", $dispute->referenceNumber); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130410-105039'), $dispute->updatedAt); + $this->assertNull($dispute->evidence[0]->comment); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130411-105039'), $dispute->evidence[0]->createdAt); + $this->assertNull($dispute->evidence[0]->category); + $this->assertEquals('evidence1', $dispute->evidence[0]->id); + $this->assertNull($dispute->evidence[0]->sentToProcessorAt); + $this->assertNull($dispute->evidence[0]->sequenceNumber); + $this->assertEquals('url_of_file_evidence', $dispute->evidence[0]->url); + $this->assertEquals('text evidence', $dispute->evidence[1]->comment); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130411-105039'), $dispute->evidence[1]->createdAt); + $this->assertEquals('evidence2', $dispute->evidence[1]->id); + $this->assertEquals('2009-04-11', $dispute->evidence[1]->sentToProcessorAt); + $this->assertNull($dispute->evidence[1]->url); + $this->assertEquals('2013-04-10', $dispute->statusHistory[0]->effectiveDate); + $this->assertEquals('open', $dispute->statusHistory[0]->status); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130410-105039'), $dispute->statusHistory[0]->timestamp); + } + + public function testConstructorHandlesNullFields() + { + $emptyAttributes = [ + 'amount' => NULL, + 'dateOpened' => NULL, + 'dateWon' => NULL, + 'evidence' => NULL, + 'replyByDate' => NULL, + 'statusHistory' => NULL + ]; + + $attrs = array_merge([], $this->attributes, $emptyAttributes); + + $dispute = Braintree\Dispute::factory($attrs); + + $this->assertNull($dispute->amount); + $this->assertNull($dispute->dateOpened); + $this->assertNull($dispute->dateWon); + $this->assertNull($dispute->evidence); + $this->assertNull($dispute->replyByDate); + $this->assertNull($dispute->statusHistory); + } + + public function testConstructorPopulatesTransaction() + { + $dispute = Braintree\Dispute::factory($this->attributes); + + $this->assertEquals('transaction_id', $dispute->transaction->id); + $this->assertEquals('100.00', $dispute->transaction->amount); + $this->assertEquals(DateTime::createFromFormat('Ymd-His', '20130319-105039'), $dispute->transaction->createdAt); + $this->assertNull($dispute->transaction->orderId); + $this->assertEquals('po', $dispute->transaction->purchaseOrderNumber); + $this->assertEquals('Visa', $dispute->transaction->paymentInstrumentSubtype); + } + + public function testAcceptNullRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "" not found'); + + Braintree\Dispute::accept(null); + } + + public function testAcceptEmptyIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id " " not found'); + + Braintree\Dispute::accept(" "); + } + + public function testAddTextEvidenceEmptyIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id " " not found'); + + Braintree\Dispute::addTextEvidence(" ", "evidence"); + } + + public function testAddTextEvidenceNullIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "" not found'); + + Braintree\Dispute::addTextEvidence(null, "evidence"); + } + + public function testAddTextEvidenceEmptyEvidenceRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'content cannot be blank'); + + Braintree\Dispute::addTextEvidence("disputeId", " "); + } + + public function testAddTextEvidenceNullEvidenceRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'content cannot be blank'); + + Braintree\Dispute::addTextEvidence("disputeId", null); + } + + public function testAddTextEvidenceBlankRequestContentRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'content cannot be blank'); + + Braintree\Dispute::addTextEvidence("disputeId", + [ + 'content' => ' ', + 'category' => 'CARRIER_NAME', + 'sequenceNumber' => '0', + ] + ); + } + + public function testAddTextEvidenceNullRequestContentRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'content cannot be blank'); + + Braintree\Dispute::addTextEvidence("disputeId", + [ + 'content' => null, + 'category' => 'CARRIER_NAME', + 'sequenceNumber' => '0', + ] + ); + } + + public function testAddTextEvidenceBlankRequestCategoryRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'category cannot be blank'); + + Braintree\Dispute::addTextEvidence("disputeId", + [ + 'content' => 'UPS', + 'category' => '', + 'sequenceNumber' => '0', + ] + ); + } + + public function testAddTextEvidenceBlankRequestSequenceNumberRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'sequenceNumber cannot be blank'); + + Braintree\Dispute::addTextEvidence("disputeId", + [ + 'content' => 'UPS', + 'category' => 'CARRIER_NAME', + 'sequenceNumber' => '', + ] + ); + } + + public function testAddTextEvidenceNonIntegerNumberRequestSequenceNumberRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'sequenceNumber must be an int'); + + Braintree\Dispute::addTextEvidence("disputeId", + [ + 'content' => 'UPS', + 'category' => 'CARRIER_NAME', + 'sequenceNumber' => '4.5', + ] + ); + } + + public function testAddTextEvidenceNonIntegerStringRequestSequenceNumberRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'sequenceNumber must be an int'); + + Braintree\Dispute::addTextEvidence("disputeId", + [ + 'content' => 'UPS', + 'category' => 'CARRIER_NAME', + 'sequenceNumber' => 'Blah', + ] + ); + } + + public function testAddFileEvidenceEmptyIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id " " not found'); + + Braintree\Dispute::addFileEvidence(" ", 1); + } + + public function testAddFileEvidenceNullIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "" not found'); + + Braintree\Dispute::addFileEvidence(null, 1); + } + + public function testAddFileEvidenceEmptyEvidenceRaisesValueException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'document with id " " not found'); + + Braintree\Dispute::addFileEvidence("disputeId", " "); + } + + public function testAddFileEvidenceNullEvidenceRaisesValueException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'document with id "" not found'); + + Braintree\Dispute::addFileEvidence("disputeId", null); + } + + public function testAddFileEvidenceBlankRequestContentRaisesValueException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'document with id " " not found'); + + Braintree\Dispute::addFileEvidence("disputeId", + [ + 'documentId' => ' ', + 'category' => 'GENERAL', + ] + ); + } + + public function testAddFileEvidenceNullRequestContentRaisesValueException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'document with id "" not found'); + + Braintree\Dispute::addFileEvidence("disputeId", + [ + 'documentId' => null, + 'category' => 'GENERAL', + ] + ); + } + + public function testAddFileEvidenceBlankRequestCategoryRaisesValueException() + { + $this->setExpectedException('InvalidArgumentException', 'category cannot be blank'); + + Braintree\Dispute::addFileEvidence("disputeId", + [ + 'documentId' => '123', + 'category' => '', + ] + ); + } + + public function testFinalizeNullRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "" not found'); + + Braintree\Dispute::finalize(null); + } + + public function testFinalizeEmptyIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id " " not found'); + + Braintree\Dispute::finalize(" "); + } + + public function testFindingNullRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id "" not found'); + + Braintree\Dispute::find(null); + } + + public function testFindingEmptyIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'dispute with id " " not found'); + + Braintree\Dispute::find(" "); + } + + public function testRemoveEvidenceEmptyDisputeIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'evidence with id "evidence" for dispute with id " " not found'); + + Braintree\Dispute::removeEvidence(" ", "evidence"); + } + + public function testRemoveEvidenceNullDisputeIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'evidence with id "evidence" for dispute with id "" not found'); + + Braintree\Dispute::removeEvidence(null, "evidence"); + } + + public function testRemoveEvidenceEvidenceNullIdRaisesNotFoundException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'evidence with id "" for dispute with id "dispute_id" not found'); + + Braintree\Dispute::removeEvidence("dispute_id", null); + } + + public function testRemoveEvidenceEmptyEvidenceIdRaisesValueException() + { + $this->setExpectedException('Braintree\Exception\NotFound', 'evidence with id " " for dispute with id "dispute_id" not found'); + + Braintree\Dispute::removeEvidence("dispute_id", " "); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DocumentUploadTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DocumentUploadTest.php new file mode 100644 index 00000000000..2f784c5e8f6 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/DocumentUploadTest.php @@ -0,0 +1,20 @@ +setExpectedException('InvalidArgumentException', 'invalid keys: bad_key'); + + Braintree\DocumentUpload::create(["bad_key" => "value"]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/EndsWithNodeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/EndsWithNodeTest.php new file mode 100644 index 00000000000..3a00b734540 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/EndsWithNodeTest.php @@ -0,0 +1,17 @@ +endsWith('value'); + $this->assertEquals(['ends_with' => 'value'], $node->toParam()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/GatewayTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/GatewayTest.php new file mode 100644 index 00000000000..40ce297bc06 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/GatewayTest.php @@ -0,0 +1,51 @@ +addOn(); + } + + public function testConstructWithArrayOfCredentials() + { + $gateway = new Braintree\Gateway([ + 'environment' => 'sandbox', + 'merchantId' => 'sandbox_merchant_id', + 'publicKey' => 'sandbox_public_key', + 'privateKey' => 'sandbox_private_key' + ]); + + $this->assertEquals('sandbox', $gateway->config->getEnvironment()); + $this->assertEquals('sandbox_merchant_id', $gateway->config->getMerchantId()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/HttpTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/HttpTest.php new file mode 100644 index 00000000000..6d99a256773 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/HttpTest.php @@ -0,0 +1,60 @@ +setExpectedException('Braintree\Exception\Connection', null, 3); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->_doUrlRequest('get', '/a_malformed_url'); + } catch (Braintree\Exception $e) { + throw $e; + } + } + + public function testMalformedUrlUsingSsl() + { + try { + Braintree\Configuration::environment('sandbox'); + $this->setExpectedException('Braintree\Exception\SSLCertificate', null, 3); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->_doUrlRequest('get', '/a_malformed_url_using_ssl'); + } catch (Braintree\Exception $e) { + Braintree\Configuration::environment('development'); + throw $e; + } + Braintree\Configuration::environment('development'); + } + + public function testSSLVersionError() + { + try { + Braintree\Configuration::environment('sandbox'); + Braintree\Configuration::sslVersion(3); + $this->setExpectedException('Braintree\Exception\SSLCertificate', null, 35); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->get('/'); + } catch (Braintree\Exception $e) { + Braintree\Configuration::environment('development'); + Braintree\Configuration::sslVersion(null); + throw $e; + } + Braintree\Configuration::environment('development'); + Braintree\Configuration::sslVersion(null); + } + + public function testGoodRequest() + { + Braintree\Configuration::environment('development'); + $http = new Braintree\Http(Braintree\Configuration::$global); + $http->_doUrlRequest('get', 'http://example.com'); + } +} \ No newline at end of file diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/InstanceTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/InstanceTest.php new file mode 100644 index 00000000000..c79221fbc40 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/InstanceTest.php @@ -0,0 +1,37 @@ + [ + 'expirationMonth' => '05', + 'expirationYear' => '2010', + 'bin' => '510510', + 'last4' => '5100', + 'cardType' => 'MasterCard', + ], + ]); + $this->assertEquals('MasterCard', $transaction->creditCardDetails->cardType); + $this->assertFalse(empty($transaction->creditCardDetails->cardType)); + $this->assertTrue(isset($transaction->creditCardDetails->cardType)); + + $transaction = Braintree\Transaction::factory([ + 'creditCard' => [ + 'expirationMonth' => '05', + 'expirationYear' => '2010', + 'bin' => '510510', + 'last4' => '5100', + ], + ]); + $this->assertTrue(empty($transaction->creditCardDetails->cardType)); + $this->assertFalse(isset($transaction->creditCardDetails->cardType)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MerchantAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MerchantAccountTest.php new file mode 100644 index 00000000000..9960f3b5b86 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MerchantAccountTest.php @@ -0,0 +1,67 @@ + "sub_merchant_account", + "status" => "active", + "masterMerchantAccount" => [ + "id" => "master_merchant_account", + "status" => "active" + ], + "individual" => [ + "firstName" => "John", + "lastName" => "Doe", + "email" => "john.doe@example.com", + "dateOfBirth" => "1970-01-01", + "phone" => "3125551234", + "ssnLast4" => "6789", + "address" => [ + "streetAddress" => "123 Fake St", + "locality" => "Chicago", + "region" => "IL", + "postalCode" => "60622", + ] + ], + "business" => [ + "dbaName" => "James's Bloggs", + "taxId" => "123456789", + ], + "funding" => [ + "accountNumberLast4" => "8798", + "routingNumber" => "071000013", + "descriptor" => "Joes Bloggs MI", + ] + ]; + $merchantAccount = Braintree\MerchantAccount::factory($params); + + + $this->assertEquals($merchantAccount->status, "active"); + $this->assertEquals($merchantAccount->id, "sub_merchant_account"); + $this->assertEquals($merchantAccount->masterMerchantAccount->id, "master_merchant_account"); + $this->assertEquals($merchantAccount->masterMerchantAccount->status, "active"); + $this->assertEquals($merchantAccount->individualDetails->firstName, "John"); + $this->assertEquals($merchantAccount->individualDetails->lastName, "Doe"); + $this->assertEquals($merchantAccount->individualDetails->email, "john.doe@example.com"); + $this->assertEquals($merchantAccount->individualDetails->dateOfBirth, "1970-01-01"); + $this->assertEquals($merchantAccount->individualDetails->phone, "3125551234"); + $this->assertEquals($merchantAccount->individualDetails->ssnLast4, "6789"); + $this->assertEquals($merchantAccount->individualDetails->addressDetails->streetAddress, "123 Fake St"); + $this->assertEquals($merchantAccount->individualDetails->addressDetails->locality, "Chicago"); + $this->assertEquals($merchantAccount->individualDetails->addressDetails->region, "IL"); + $this->assertEquals($merchantAccount->individualDetails->addressDetails->postalCode, "60622"); + $this->assertEquals($merchantAccount->businessDetails->dbaName, "James's Bloggs"); + $this->assertEquals($merchantAccount->businessDetails->taxId, "123456789"); + $this->assertEquals($merchantAccount->fundingDetails->accountNumberLast4, "8798"); + $this->assertEquals($merchantAccount->fundingDetails->routingNumber, "071000013"); + $this->assertEquals($merchantAccount->fundingDetails->descriptor, "Joes Bloggs MI"); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueNodeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueNodeTest.php new file mode 100644 index 00000000000..3461512eb0e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueNodeTest.php @@ -0,0 +1,24 @@ +is('value'); + $this->assertEquals(['value'], $node->toParam()); + } + + public function testIn() + { + $node = new Braintree\MultipleValueNode('field'); + $node->in(['firstValue', 'secondValue']); + $this->assertEquals(['firstValue', 'secondValue'], $node->toParam()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueOrTextNodeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueOrTextNodeTest.php new file mode 100644 index 00000000000..31102639da9 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/MultipleValueOrTextNodeTest.php @@ -0,0 +1,52 @@ +in(['firstValue', 'secondValue']); + $this->assertEquals(['firstValue', 'secondValue'], $node->toParam()); + } + + public function testIs() + { + $node = new Braintree\MultipleValueOrTextNode('field'); + $node->is('value'); + $this->assertEquals(['is' => 'value'], $node->toParam()); + } + + public function testIsNot() + { + $node = new Braintree\MultipleValueOrTextNode('field'); + $node->isNot('value'); + $this->assertEquals(['is_not' => 'value'], $node->toParam()); + } + + public function testStartsWith() + { + $node = new Braintree\MultipleValueOrTextNode('field'); + $node->startsWith('beginning'); + $this->assertEquals(['starts_with' => 'beginning'], $node->toParam()); + } + + public function testEndsWith() + { + $node = new Braintree\MultipleValueOrTextNode('field'); + $node->endsWith('end'); + $this->assertEquals(['ends_with' => 'end'], $node->toParam()); + } + + public function testContains() + { + $node = new Braintree\MultipleValueOrTextNode('field'); + $node->contains('middle'); + $this->assertEquals(['contains' => 'middle'], $node->toParam()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthAccessRevocationTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthAccessRevocationTest.php new file mode 100644 index 00000000000..84fd8aa10c7 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthAccessRevocationTest.php @@ -0,0 +1,19 @@ + 'abc123xyz' + ]); + + $this->assertEquals($revocation->merchantId, 'abc123xyz'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthTest.php new file mode 100644 index 00000000000..d7b6e8df99d --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/OAuthTest.php @@ -0,0 +1,71 @@ +gateway = new Braintree\Gateway([ + 'clientId' => 'client_id$development$integration_client_id', + 'clientSecret' => 'client_secret$development$integration_client_secret' + ]); + } + + public function testMapInvalidGrantCodeToOldError() + { + $result = $this->_buildResult([ + 'code' => '93801', + 'message' => 'Invalid grant: code not found' + ]); + + $this->gateway->oauth()->_mapError($result); + + $this->assertEquals($result->error, 'invalid_grant'); + $this->assertEquals($result->errorDescription, 'code not found'); + } + + public function testMapInvalidCredentialsCodeToOldError() + { + $result = $this->_buildResult([ + 'code' => '93802', + 'message' => 'Invalid credentials: wrong client id or secret' + ]); + + $this->gateway->oauth()->_mapError($result); + + $this->assertEquals($result->error, 'invalid_credentials'); + $this->assertEquals($result->errorDescription, 'wrong client id or secret'); + } + + public function testMapInvalidScopeCodeToOldError() + { + $result = $this->_buildResult([ + 'code' => '93803', + 'message' => 'Invalid scope: scope is invalid' + ]); + + $this->gateway->oauth()->_mapError($result); + + $this->assertEquals($result->error, 'invalid_scope'); + $this->assertEquals($result->errorDescription, 'scope is invalid'); + } + + protected function _buildResult($error) + { + return new Braintree\Result\Error([ + 'errors' => [ + 'errors' => [], + 'credentials' => [ + 'errors' => [$error] + ] + ] + ]); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaginatedCollectionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaginatedCollectionTest.php new file mode 100644 index 00000000000..48f8a9fcb5c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaginatedCollectionTest.php @@ -0,0 +1,106 @@ +_pagingFunc = $pagingFunc; + } + + public function page ($page) { + return call_user_func($this->_pagingFunc, $page); + } +} + +class PaginatedCollectionTest extends Setup +{ + public function testFetchesOnePageWhenPageAndTotalSizesMatch() + { + + $pager = [ + 'object' => new Pager(function ($page) { + if ($page > 1) + { + throw new \Exception('too many pages fetched'); + } + else + { + return new Braintree\PaginatedResult(1, 1, [1]); + } + }), + 'method' => 'page', + ]; + $collection = new Braintree\PaginatedCollection($pager); + + $items = []; + foreach($collection as $item) + { + array_push($items, $item); + } + + $this->assertEquals(1, $items[0]); + $this->assertEquals(1, count($items)); + } + + public function testFetchCollectionOfLessThanOnePage() + { + $pager = [ + 'object' => new Pager(function ($page) { + if ($page > 1) + { + throw new \Exception('too many pages fetched'); + } + else + { + return new Braintree\PaginatedResult(2, 5, [1, 2]); + } + }), + 'method' => 'page', + ]; + $collection = new Braintree\PaginatedCollection($pager); + + $items = []; + foreach($collection as $item) + { + array_push($items, $item); + } + + $this->assertEquals(1, $items[0]); + $this->assertEquals(2, $items[1]); + $this->assertEquals(2, count($items)); + } + + public function testFetchesMultiplePages() + { + $pager = [ + 'object' => new Pager(function ($page) { + if ($page > 2) + { + throw new \Exception('too many pages fetched'); + } + else + { + return new Braintree\PaginatedResult(2, 1, [$page]); + } + }), + 'method' => 'page', + ]; + $collection = new Braintree\PaginatedCollection($pager); + + $items = []; + foreach($collection as $item) + { + array_push($items, $item); + } + + $this->assertEquals(1, $items[0]); + $this->assertEquals(2, $items[1]); + $this->assertEquals(2, count($items)); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PayPalAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PayPalAccountTest.php new file mode 100644 index 00000000000..38421703802 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PayPalAccountTest.php @@ -0,0 +1,44 @@ +setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree\PayPalAccount: foo'); + $paypalAccount = Braintree\PayPalAccount::factory([]); + $paypalAccount->foo; + } + + public function testIsDefault() + { + $paypalAccount = Braintree\PayPalAccount::factory(['default' => true]); + $this->assertTrue($paypalAccount->isDefault()); + + $paypalAccount = Braintree\PayPalAccount::factory(['default' => false]); + $this->assertFalse($paypalAccount->isDefault()); + } + + public function testErrorsOnFindWithBlankArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\PayPalAccount::find(''); + } + + public function testErrorsOnFindWithWhitespaceArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\PayPalAccount::find(' '); + } + + public function testErrorsOnFindWithWhitespaceCharacterArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\PayPalAccount::find('\t'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaymentMethodTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaymentMethodTest.php new file mode 100644 index 00000000000..49d63b5281e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/PaymentMethodTest.php @@ -0,0 +1,121 @@ +setExpectedException('InvalidArgumentException', 'invalid keys: invalidKey'); + Braintree\PaymentMethod::create(['invalidKey' => 'foo']); + } + + public function testCreateSignature() + { + $expected = [ + 'billingAddressId', + 'cardholderName', + 'cvv', + 'deviceData', + 'expirationDate', + 'expirationMonth', + 'expirationYear', + 'number', + 'paymentMethodNonce', + 'token', + ['options' => [ + 'failOnDuplicatePaymentMethod', + 'makeDefault', + 'verificationMerchantAccountId', + 'verifyCard', + 'verificationAccountType', + 'verificationAmount', + 'usBankAccountVerificationMethod', + ['paypal' => [ + 'payee_email', + 'payeeEmail', + 'order_id', + 'orderId', + 'custom_field', + 'customField', + 'description', + 'amount', + ['shipping' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', + 'extendedAddress', 'locality', 'postalCode', 'region', + 'streetAddress'], + ], + ]], + ]], + ['billingAddress' => Braintree\AddressGateway::createSignature()], + 'customerId', + 'paypalRefreshToken', + 'paypalVaultWithoutUpgrade' + ]; + $this->assertEquals($expected, Braintree\PaymentMethodGateway::createSignature()); + } + + public function testErrorsOnFindWithBlankArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\PaymentMethod::find(''); + } + + public function testErrorsOnFindWithWhitespaceArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\PaymentMethod::find(' '); + } + + public function testErrorsOnFindWithWhitespaceCharacterArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\PaymentMethod::find('\t'); + } + + public function testDeleteWithRevokeAllGrantsAsTrue() + { + $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete(); + $expectedURL = "/payment_methods/any/some_token?revoke_all_grants=1"; + $paymentMethodGateway->expects($this->once())->method('_doDelete')->with($this->equalTo($expectedURL)); + $paymentMethodGateway->delete("some_token", ['revokeAllGrants' => true]); + } + + public function testDeleteWithRevokeAllGrantsAsFalse() + { + $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete(); + $expectedURL = "/payment_methods/any/some_token?revoke_all_grants=0"; + $paymentMethodGateway->expects($this->once())->method('_doDelete')->with($this->equalTo($expectedURL)); + $paymentMethodGateway->delete("some_token", ['revokeAllGrants' => false]); + } + + public function testDeleteWithoutRevokeAllGrantsOption() + { + $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete(); + $expectedURL = "/payment_methods/any/some_token"; + $paymentMethodGateway->expects($this->once())->method('_doDelete')->with($this->equalTo($expectedURL)); + $paymentMethodGateway->delete("some_token"); + } + + public function testDeleteWithInvalidOption() + { + $paymentMethodGateway = $this->mockPaymentMethodGatewayDoDelete(); + $this->setExpectedException('InvalidArgumentException'); + $paymentMethodGateway->expects($this->never())->method('_doDelete'); + $paymentMethodGateway->delete("some_token", ['invalidKey' => false]); + } + + private function mockPaymentMethodGatewayDoDelete() + { + return $this->getMockBuilder('Braintree\PaymentMethodGateway') + ->setConstructorArgs(array(Braintree\Configuration::gateway())) + ->setMethods(array('_doDelete')) + ->getMock(); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/RangeNodeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/RangeNodeTest.php new file mode 100644 index 00000000000..19818825856 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/RangeNodeTest.php @@ -0,0 +1,38 @@ +greaterThanOrEqualTo('smallest'); + $this->assertEquals(['min' => 'smallest'], $node->toParam()); + } + + public function testLessThanOrEqualTo() + { + $node = new Braintree\RangeNode('field'); + $node->lessThanOrEqualTo('biggest'); + $this->assertEquals(['max' => 'biggest'], $node->toParam()); + } + + public function testBetween() + { + $node = new Braintree\RangeNode('field'); + $node->between('alpha', 'omega'); + $this->assertEquals(['min' => 'alpha', 'max' => 'omega'], $node->toParam()); + } + + public function testIs() + { + $node = new Braintree\RangeNode('field'); + $node->is('something'); + $this->assertEquals(['is' => 'something'], $node->toParam()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ResourceCollectionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ResourceCollectionTest.php new file mode 100644 index 00000000000..405cc6bf31c --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/ResourceCollectionTest.php @@ -0,0 +1,132 @@ + [ + 'pageSize' => 2, + 'ids' => ['0', '1', '2', '3', '4'] + ] + ]; + + $object = new TestResource(); + $pager = [ + 'object' => $object, + 'method' => 'fetch', + 'methodArgs' => [] + ]; + + $collection = new Braintree\ResourceCollection($response, $pager); + + $count = 0; + $index = 0; + foreach ($collection as $value) + { + $this->assertEquals(self::$values[$index], $value); + $index += 1; + $count += 1; + } + + $this->assertEquals(5, $count); + } + + public function testDoesntIterateWhenNoResults() + { + + $response = [ + 'searchResults' => [ + 'pageSize' => 2, + 'ids' => [] + ] + ]; + + $object = new TestResource(); + $pager = [ + 'object' => $object, + 'method' => 'fetch', + 'methodArgs' => [] + ]; + + $collection = new Braintree\ResourceCollection($response, $pager); + + $count = 0; + $index = 0; + foreach ($collection as $value) + { + $index += 1; + $count += 1; + break; + } + + $this->assertEquals(0, $count); + $this->assertEquals(0, $index); + } + + public function testGetIdsReturnsArrayOfIds() + { + + $response = [ + 'searchResults' => [ + 'pageSize' => 2, + 'ids' => ["1", "2", "3"] + ] + ]; + + $object = new TestResource(); + $pager = [ + 'object' => $object, + 'method' => 'fetch', + 'methodArgs' => [] + ]; + + $collection = new Braintree\ResourceCollection($response, $pager); + + $this->assertEquals($collection->getIds(), ["1", "2", "3"]); + } + + public function testGetIdsReturnsAnEmptyArrayIfNoIds() + { + + $response = [ + 'searchResults' => [ + 'pageSize' => 2, + 'ids' => [] + ] + ]; + + $object = new TestResource(); + $pager = [ + 'object' => $object, + 'method' => 'fetch', + 'methodArgs' => [] + ]; + + $collection = new Braintree\ResourceCollection($response, $pager); + + $this->assertEquals($collection->getIds(), []); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/ErrorTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/ErrorTest.php new file mode 100644 index 00000000000..ac73d132976 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/ErrorTest.php @@ -0,0 +1,16 @@ + [], 'params' => [], 'message' => 'briefly describe']); + $this->assertNull($result->transaction); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/SuccessfulTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/SuccessfulTest.php new file mode 100644 index 00000000000..466785f8390 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Result/SuccessfulTest.php @@ -0,0 +1,21 @@ +assertNotNull($result->transaction); + $this->assertNull($result->notAProperty); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SanityTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SanityTest.php new file mode 100644 index 00000000000..686755a6f37 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SanityTest.php @@ -0,0 +1,19 @@ +assertNotContains("?>", $code, "$codeFile should not contain a PHP close tag"); + } + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionSearchTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionSearchTest.php new file mode 100644 index 00000000000..badb5b39050 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionSearchTest.php @@ -0,0 +1,70 @@ +assertInstanceOf('Braintree\RangeNode', $node); + } + + public function testSearch_price_isRangeNode() + { + $node = Braintree\SubscriptionSearch::price(); + $this->assertInstanceOf('Braintree\RangeNode', $node); + } + + public function testSearch_daysPastDue_isRangeNode() + { + $node = Braintree\SubscriptionSearch::daysPastDue(); + $this->assertInstanceOf('Braintree\RangeNode', $node); + } + + public function testSearch_createdAt_isRangeNode() + { + $node = Braintree\SubscriptionSearch::createdAt(); + $this->assertInstanceOf('Braintree\RangeNode', $node); + } + + public function testSearch_id_isTextNode() + { + $node = Braintree\SubscriptionSearch::id(); + $this->assertInstanceOf('Braintree\TextNode', $node); + } + + public function testSearch_ids_isMultipleValueNode() + { + $node = Braintree\SubscriptionSearch::ids(); + $this->assertInstanceOf('Braintree\MultipleValueNode', $node); + } + + public function testSearch_inTrialPeriod_isMultipleValueNode() + { + $node = Braintree\SubscriptionSearch::inTrialPeriod(); + $this->assertInstanceOf('Braintree\MultipleValueNode', $node); + } + + public function testSearch_merchantAccountId_isMultipleValueNode() + { + $node = Braintree\SubscriptionSearch::merchantAccountId(); + $this->assertInstanceOf('Braintree\MultipleValueNode', $node); + } + + public function testSearch_planId_isMultipleValueOrTextNode() + { + $node = Braintree\SubscriptionSearch::planId(); + $this->assertInstanceOf('Braintree\MultipleValueOrTextNode', $node); + } + + public function testSearch_status_isMultipleValueNode() + { + $node = Braintree\SubscriptionSearch::status(); + $this->assertInstanceOf('Braintree\MultipleValueNode', $node); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionTest.php new file mode 100644 index 00000000000..936ccd53d70 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/SubscriptionTest.php @@ -0,0 +1,22 @@ +setExpectedException('InvalidArgumentException'); + Braintree\Subscription::find(''); + } + + public function testErrorsOnFindWithWhitespaceArgument() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Subscription::find('\t'); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TextNodeTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TextNodeTest.php new file mode 100644 index 00000000000..0892c147539 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TextNodeTest.php @@ -0,0 +1,45 @@ +is('value'); + $this->assertEquals(['is' => 'value'], $node->toParam()); + } + + public function testIsNot() + { + $node = new Braintree\TextNode('field'); + $node->isNot('value'); + $this->assertEquals(['is_not' => 'value'], $node->toParam()); + } + + public function testStartsWith() + { + $node = new Braintree\TextNode('field'); + $node->startsWith('beginning'); + $this->assertEquals(['starts_with' => 'beginning'], $node->toParam()); + } + + public function testEndsWith() + { + $node = new Braintree\TextNode('field'); + $node->endsWith('end'); + $this->assertEquals(['ends_with' => 'end'], $node->toParam()); + } + + public function testContains() + { + $node = new Braintree\TextNode('field'); + $node->contains('middle'); + $this->assertEquals(['contains' => 'middle'], $node->toParam()); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionLineItemTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionLineItemTest.php new file mode 100644 index 00000000000..396e8995bbb --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionLineItemTest.php @@ -0,0 +1,26 @@ +assertEquals( + Braintree\TransactionLineItem::CREDIT, + Braintree\Transaction\LineItem::CREDIT + ); + } + + public function testDEBIT_equalsDeprecatedDEBIT() + { + $this->assertEquals( + Braintree\TransactionLineItem::DEBIT, + Braintree\Transaction\LineItem::DEBIT + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionTest.php new file mode 100644 index 00000000000..33d3f31e68a --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransactionTest.php @@ -0,0 +1,120 @@ + ['expirationMonth' => '05', 'expirationYear' => '2010', 'bin' => '510510', 'last4' => '5100'], + 'customer' => [], + 'billing' => [], + 'descriptor' => [], + 'shipping' => [], + 'subscription' => ['billingPeriodStartDate' => '1983-07-12'], + 'statusHistory' => [] + ]); + $this->setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree\Transaction: foo'); + $t->foo; + } + + public function testCloneTransaction_RaisesErrorOnInvalidProperty() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Transaction::cloneTransaction('an id', ['amount' => '123.45', 'invalidProperty' => 'foo']); + } + + public function testErrorsWhenFindWithBlankString() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Transaction::find(''); + } + + public function testErrorsWhenFindWithWhitespaceString() + { + $this->setExpectedException('InvalidArgumentException'); + Braintree\Transaction::find('\t'); + } + + public function testInitializationWithoutArguments() + { + $transaction = Braintree\Transaction::factory([]); + $this->assertTrue($transaction instanceof Braintree\Transaction); + } + + public function testSaleWithSkipAdvancedFraudCheckingValueAsTrue() + { + $transactionGateway = $this->mockTransactionGatewayDoCreate(); + $transactionGateway + ->expects($this->once()) + ->method('_doCreate') + ->will($this->returnCallback(function($path, $params) { + $this->assertTrue($params["transaction"]["options"]["skipAdvancedFraudChecking"]); + })); + $transactionGateway->sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'options' => [ + 'skipAdvancedFraudChecking' => true + ] + ]); + } + + public function testSaleWithSkipAdvancedFraudCheckingValueAsFalse() + { + $transactionGateway = $this->mockTransactionGatewayDoCreate(); + $transactionGateway + ->expects($this->once()) + ->method('_doCreate') + ->will($this->returnCallback(function($path, $params) { + $this->assertFalse($params["transaction"]["options"]["skipAdvancedFraudChecking"]); + })); + $transactionGateway->sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'options' => [ + 'skipAdvancedFraudChecking' => false + ] + ]); + } + + public function testSaleWithoutSkipAdvancedFraudCheckingOption() + { + $transactionGateway = $this->mockTransactionGatewayDoCreate(); + $transactionGateway + ->expects($this->once()) + ->method('_doCreate') + ->will($this->returnCallback(function($path, $params) { + $this->assertArrayNotHasKey("skipAdvancedFraudChecking", $params["transaction"]["options"]); + })); + $transactionGateway->sale([ + 'amount' => Braintree\Test\TransactionAmounts::$authorize, + 'creditCard' => [ + 'number' => Braintree\Test\CreditCardNumbers::$visa, + 'expirationDate' => '05/2009', + ], + 'options' => [ + 'submitForSettlement' => true + ] + ]); + } + + private function mockTransactionGatewayDoCreate() + { + return $this->getMockBuilder('Braintree\TransactionGateway') + ->setConstructorArgs(array(Braintree\Configuration::gateway())) + ->setMethods(array('_doCreate')) + ->getMock(); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransparentRedirectTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransparentRedirectTest.php new file mode 100644 index 00000000000..7f62e09be9d --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/TransparentRedirectTest.php @@ -0,0 +1,31 @@ + 'http://www.example.com']); + ini_set("arg_separator.output", $originalSeparator); + $this->assertFalse(strpos($trData, "&")); + } + + public function testData_doesNotClobberDefaultTimezone() + { + $originalZone = date_default_timezone_get(); + date_default_timezone_set('Europe/London'); + + $trData = Braintree\TransparentRedirect::createCustomerData(['redirectUrl' => 'http://www.example.com']); + $zoneAfterCall = date_default_timezone_get(); + date_default_timezone_set($originalZone); + + $this->assertEquals('Europe/London', $zoneAfterCall); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UnknownPaymentMethodTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UnknownPaymentMethodTest.php new file mode 100644 index 00000000000..f5fd7654486 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UnknownPaymentMethodTest.php @@ -0,0 +1,25 @@ + [ + 'token' => 'SOME_TOKEN', + 'default' => true + ] + ]; + $unknownPaymentMethodObject = Braintree\UnknownPaymentMethod::factory($response); + $this->assertEquals('SOME_TOKEN', $unknownPaymentMethodObject->token); + $this->assertTrue($unknownPaymentMethodObject->isDefault()); + $this->assertEquals('https://assets.braintreegateway.com/payment_method_logo/unknown.png', $unknownPaymentMethodObject->imageUrl); + } +} + diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountTest.php new file mode 100644 index 00000000000..73a38686fd3 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountTest.php @@ -0,0 +1,48 @@ + true]); + $this->assertTrue($usBankAccount->isDefault()); + + $usBankAccount = Braintree\UsBankAccount::factory(['default' => false]); + $this->assertFalse($usBankAccount->isDefault()); + } + + public function testHasVerifications() + { + $usBankAccount = Braintree\UsBankAccount::factory([ + 'verifications' => [ + [ + 'status' => Braintree\Result\UsBankAccountVerification::VERIFIED, + 'verificationMethod' => Braintree\Result\UsBankAccountVerification::TOKENIZED_CHECK + ], + [ + 'status' => Braintree\Result\UsBankAccountVerification::PENDING, + 'verificationMethod' => Braintree\Result\UsBankAccountVerification::NETWORK_CHECK + ], + ] + ]); + + + $this->assertEquals(2, count($usBankAccount->verifications)); + + $verification1 = $usBankAccount->verifications[0]; + $this->assertEquals($verification1->status, Braintree\Result\UsBankAccountVerification::VERIFIED); + $this->assertEquals(Braintree\Result\UsBankAccountVerification::TOKENIZED_CHECK, $verification1->verificationMethod); + + $verification2 = $usBankAccount->verifications[1]; + $this->assertEquals(Braintree\Result\UsBankAccountVerification::PENDING, $verification2->status); + $this->assertEquals(Braintree\Result\UsBankAccountVerification::NETWORK_CHECK, $verification2->verificationMethod); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountVerificationTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountVerificationTest.php new file mode 100644 index 00000000000..1b8cb973e1a --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UsBankAccountVerificationTest.php @@ -0,0 +1,34 @@ + Braintree\Result\UsBankAccountVerification::VERIFIED, + 'verificationMethod' => Braintree\Result\UsBankAccountVerification::NETWORK_CHECK, + 'usBankAccount' => [ + 'token' => 'abc123', + ], + ]); + + $this->assertEquals(Braintree\Result\UsBankAccountVerification::VERIFIED, $verification->status); + $this->assertEquals( + Braintree\Result\UsBankAccountVerification::NETWORK_CHECK, + $verification->verificationMethod + ); + + $this->assertEquals( + 'abc123', + $verification->usBankAccount->token + ); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UtilTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UtilTest.php new file mode 100644 index 00000000000..ca394a1cc8e --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/UtilTest.php @@ -0,0 +1,452 @@ + [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "AUTHENTICATION" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\Authorization + */ + public function testThrowGraphQLAuthorizationException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "AUTHORIZATION" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\NotFound + */ + public function testThrowGraphQLNotFoundException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "NOT_FOUND" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\UpgradeRequired + */ + public function testThrowGraphQLUnsupportedClientException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "UNSUPPORTED_CLIENT" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\TooManyRequests + */ + public function testThrowGraphQLResourceLimitException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "RESOURCE_LIMIT" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\ServerError + */ + public function testThrowGraphQLInternalException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "INTERNAL" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\DownForMaintenance + */ + public function testThrowGraphQLServiceAvailabilityException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "SERVICE_AVAILABILITY" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\Unexpected + */ + public function testThrowGraphQLUnexpectedException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "UNDOCUMENTED_ERROR" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + public function testDoesNotThrowGraphQLValidationException() + { + $response = [ + "errors" => [ + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "VALIDATION" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + /** + * @expectedException Braintree\Exception\Unexpected + */ + public function testThrowGraphQLUnexpectedExceptionAndNotValidationExceptionWhenBothArePresent() + { + $response = [ + "errors" => [ + [ + "message" => "validation_error", + "extensions" => [ + "errorClass" => "VALIDATION" + ] + ], + [ + "message" => "error_message", + "extensions" => [ + "errorClass" => "UNDOCUMENTED_ERROR" + ] + ] + ] + ]; + Braintree\Util::throwGraphQLResponseException($response); + } + + public function testExtractAttributeAsArrayReturnsEmptyArray() + { + $attributes = []; + $this->assertEquals([], Braintree\Util::extractAttributeAsArray($attributes, "foo")); + } + + public function testExtractAttributeAsArrayReturnsSingleElementArray() + { + $attributes = ['verification' => 'val1']; + $this->assertEquals(['val1'], Braintree\Util::extractAttributeAsArray($attributes, "verification")); + } + + public function testExtractAttributeAsArrayReturnsArrayOfObjects() + { + $attributes = ['verification' => [['status' => 'val1']]]; + $expected = new Braintree\CreditCardVerification(['status' => 'val1']); + $this->assertEquals([$expected], Braintree\Util::extractAttributeAsArray($attributes, "verification")); + } + + public function testDelimeterToUnderscore() + { + $this->assertEquals("a_b_c", Braintree\Util::delimiterToUnderscore("a-b-c")); + } + + public function testCleanClassName() + { + $cn = Braintree\Util::cleanClassName('Braintree\Transaction'); + $this->assertEquals('transaction', $cn); + } + + public function testBuildClassName() + { + $cn = Braintree\Util::buildClassName('creditCard'); + $this->assertEquals('Braintree\CreditCard', $cn); + } + + public function testimplodeAssociativeArray() + { + $array = [ + 'test1' => 'val1', + 'test2' => 'val2', + 'test3' => new DateTime('2015-05-15 17:21:00'), + ]; + $string = Braintree\Util::implodeAssociativeArray($array); + $this->assertEquals('test1=val1, test2=val2, test3=Fri, 15 May 2015 17:21:00 +0000', $string); + } + + public function testVerifyKeys_withThreeLevels() + { + $signature = [ + 'firstName', + ['creditCard' => ['number', ['billingAddress' => ['streetAddress']]]] + ]; + $data = [ + 'firstName' => 'Dan', + 'creditCard' => [ + 'number' => '5100', + 'billingAddress' => [ + 'streetAddress' => '1 E Main St' + ] + ] + ]; + Braintree\Util::verifyKeys($signature, $data); + } + + public function testVerifyKeys_withArrayOfArrays() + { + $signature = [ + ['addOns' => [['update' => ['amount', 'existingId']]]] + ]; + + $goodData = [ + 'addOns' => [ + 'update' => [ + [ + 'amount' => '50.00', + 'existingId' => 'increase_10', + ], + [ + 'amount' => '60.00', + 'existingId' => 'increase_20', + ] + ] + ] + ]; + + Braintree\Util::verifyKeys($signature, $goodData); + + $badData = [ + 'addOns' => [ + 'update' => [ + [ + 'invalid' => '50.00', + ] + ] + ] + ]; + + $this->setExpectedException('InvalidArgumentException'); + Braintree\Util::verifyKeys($signature, $badData); + } + + public function testVerifyKeys_arrayAsValue() + { + $signature = ['key']; + $data = ['key' => ['value']]; + $this->setExpectedException('InvalidArgumentException'); + Braintree\Util::verifyKeys($signature, $data); + } + + public function testVerifyKeys() + { + $signature = [ + 'amount', 'customerId', 'orderId', 'channel', 'paymentMethodToken', 'type', + + ['creditCard' => + ['token', 'cvv', 'expirationDate', 'number'], + ], + ['customer' => + [ + 'id', 'company', 'email', 'fax', 'firstName', + 'lastName', 'phone', 'website'], + ], + ['billing' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'extendedAddress', 'locality', 'postalCode', 'region', + 'streetAddress'], + ], + ['shipping' => + [ + 'firstName', 'lastName', 'company', 'countryName', + 'extendedAddress', 'locality', 'postalCode', 'region', + 'streetAddress'], + ], + ['options' => + [ + 'storeInVault', 'submitForSettlement', + 'addBillingAddressToPaymentMethod'], + ], + ['customFields' => ['_anyKey_'] + ], + ]; + + // test valid + $userKeys = [ + 'amount' => '100.00', + 'customFields' => ['HEY' => 'HO', + 'WAY' => 'NO'], + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + ]; + + $n = Braintree\Util::verifyKeys($signature, $userKeys); + $this->assertNull($n); + + $userKeys = [ + 'amount' => '100.00', + 'customFields' => ['HEY' => 'HO', + 'WAY' => 'NO'], + 'bogus' => 'FAKE', + 'totallyFake' => 'boom', + 'creditCard' => [ + 'number' => '5105105105105100', + 'expirationDate' => '05/12', + ], + ]; + + // test invalid + $this->setExpectedException('InvalidArgumentException'); + + Braintree\Util::verifyKeys($signature, $userKeys); + } + + /** + * @expectedException Braintree\Exception\ValidationsFailed + */ + public function testReturnException() + { + $this->success = false; + Braintree\Util::returnObjectOrThrowException('Braintree\Transaction', $this); + } + + public function testReturnObject() + { + $this->success = true; + $this->transaction = new stdClass(); + $t = Braintree\Util::returnObjectOrThrowException('Braintree\Transaction', $this); + $this->assertInternalType('object', $t); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/WebhookNotificationTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/WebhookNotificationTest.php new file mode 100644 index 00000000000..9fae6db6cfd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/WebhookNotificationTest.php @@ -0,0 +1,920 @@ +assertEquals('integration_public_key|d9b899556c966b3f06945ec21311865d35df3ce4', $verificationString); + } + + /** + * @expectedException Braintree\Exception\InvalidChallenge + * @expectedExceptionMessage challenge contains non-hex characters + */ + public function testVerifyRaisesErrorWithInvalidChallenge() + { + $this->setExpectedException('Braintree\Exception\InvalidChallenge', 'challenge contains non-hex characters'); + + Braintree\WebhookNotification::verify('bad challenge'); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway) + */ + public function testVerifyRaisesErrorWhenEnvironmentNotSet() + { + Braintree\Configuration::reset(); + + Braintree\WebhookNotification::verify('20f9f8ed05f77439fe955c977e4c8a53'); + } + + public function testSampleNotificationReturnsAParsableNotification() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, $webhookNotification->kind); + $this->assertNotNull($webhookNotification->timestamp); + $this->assertEquals("my_id", $webhookNotification->subscription->id); + $this->assertNull($webhookNotification->sourceMerchantId); + } + + public function testSampleNotificationContainsSourceMerchantIdIfSpecified() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id', + 'my_source_merchant_id' + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals($webhookNotification->sourceMerchantId, 'my_source_merchant_id'); + } + + public function testParsingModifiedSignatureRaisesError() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $this->setExpectedException('Braintree\Exception\InvalidSignature', 'signature does not match payload - one has been modified'); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'] . "bad", + $sampleNotification['bt_payload'] + ); + } + + /** + * @expectedException Braintree\Exception\Configuration + * @expectedExceptionMessage Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway) + */ + public function testParsingWithNoKeysRaisesError() + { + Braintree\Configuration::reset(); + + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + } + + public function testParsingWebhookWithWrongKeysRaisesError() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + Braintree\Configuration::environment('development'); + Braintree\Configuration::merchantId('integration_merchant_id'); + Braintree\Configuration::publicKey('wrong_public_key'); + Braintree\Configuration::privateKey('wrong_private_key'); + + $this->setExpectedException('Braintree\Exception\InvalidSignature', 'no matching public key'); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + "bad" . $sampleNotification['bt_payload'] + ); + } + + public function testParsingModifiedPayloadRaisesError() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $this->setExpectedException('Braintree\Exception\InvalidSignature'); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + "bad" . $sampleNotification['bt_payload'] + ); + } + + public function testParsingUnknownPublicKeyRaisesError() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $this->setExpectedException('Braintree\Exception\InvalidSignature'); + + $webhookNotification = Braintree\WebhookNotification::parse( + "bad" . $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + } + + public function testParsingInvalidSignatureRaisesError() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $this->setExpectedException('Braintree\Exception\InvalidSignature'); + + $webhookNotification = Braintree\WebhookNotification::parse( + "bad_signature", + $sampleNotification['bt_payload'] + ); + } + + public function testParsingNullSignatureRaisesError() + { + $this->setExpectedException('Braintree\Exception\InvalidSignature', 'signature cannot be null'); + + $webhookNotification = Braintree\WebhookNotification::parse(null, "payload"); + } + + public function testParsingNullPayloadRaisesError() + { + $this->setExpectedException('Braintree\Exception\InvalidSignature', 'payload cannot be null'); + + $webhookNotification = Braintree\WebhookNotification::parse("signature", null); + } + + public function testParsingInvalidCharactersRaisesError() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $this->setExpectedException('Braintree\Exception\InvalidSignature', 'payload contains illegal characters'); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + "~*~*invalid*~*~" + ); + } + + public function testParsingAllowsAllValidCharacters() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $this->setExpectedException('Braintree\Exception\InvalidSignature', 'signature does not match payload - one has been modified'); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+=/\n" + ); + } + + public function testParsingRetriesPayloadWithANewline() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, + 'my_id' + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + rtrim($sampleNotification['bt_payload']) + ); + } + + public function testAllowsParsingUsingGateway() + { + $gateway = new Braintree\Gateway([ + 'privateKey' => 'integration_private_key', + 'publicKey' => 'integration_public_key', + 'merchantId' => 'integration_merchant_id', + 'environment' => 'development' + ]); + + $sampleNotification = $gateway->webhookTesting()->sampleNotification( + Braintree\WebhookNotification::CHECK, + "my_id" + ); + + $webhookNotification = $gateway->webhookNotification()->parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::CHECK, $webhookNotification->kind); + } + + public function testAllowsParsingUsingStaticMethods() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::CHECK, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::CHECK, $webhookNotification->kind); + } + + public function testBuildsASampleNotificationForASubscriptionChargedSuccessfullyWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_CHARGED_SUCCESSFULLY, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::SUBSCRIPTION_CHARGED_SUCCESSFULLY, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->subscription->id); + $this->assertEquals(new DateTime('2016-03-21'), $webhookNotification->subscription->billingPeriodStartDate); + $this->assertEquals(new DateTime('2017-03-31'), $webhookNotification->subscription->billingPeriodEndDate); + $this->assertEquals(1, count($webhookNotification->subscription->transactions)); + + $transaction = $webhookNotification->subscription->transactions[0]; + $this->assertEquals('submitted_for_settlement', $transaction->status); + $this->assertEquals('49.99', $transaction->amount); + } + + public function testBuildsASampleNotificationForASubscriptionChargedUnsuccessfullyWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUBSCRIPTION_CHARGED_UNSUCCESSFULLY, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::SUBSCRIPTION_CHARGED_UNSUCCESSFULLY, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->subscription->id); + $this->assertEquals(new DateTime('2016-03-21'), $webhookNotification->subscription->billingPeriodStartDate); + $this->assertEquals(new DateTime('2017-03-31'), $webhookNotification->subscription->billingPeriodEndDate); + $this->assertEquals(1, count($webhookNotification->subscription->transactions)); + + $transaction = $webhookNotification->subscription->transactions[0]; + $this->assertEquals('failed', $transaction->status); + $this->assertEquals('49.99', $transaction->amount); + } + + public function testBuildsASampleNotificationForAMerchantAccountApprovedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUB_MERCHANT_ACCOUNT_APPROVED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::SUB_MERCHANT_ACCOUNT_APPROVED, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->merchantAccount->id); + $this->assertEquals(Braintree\MerchantAccount::STATUS_ACTIVE, $webhookNotification->merchantAccount->status); + $this->assertEquals("master_ma_for_my_id", $webhookNotification->merchantAccount->masterMerchantAccount->id); + $this->assertEquals(Braintree\MerchantAccount::STATUS_ACTIVE, $webhookNotification->merchantAccount->masterMerchantAccount->status); + } + + public function testBuildsASampleNotificationForAMerchantAccountDeclinedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::SUB_MERCHANT_ACCOUNT_DECLINED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::SUB_MERCHANT_ACCOUNT_DECLINED, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->merchantAccount->id); + $this->assertEquals(Braintree\MerchantAccount::STATUS_SUSPENDED, $webhookNotification->merchantAccount->status); + $this->assertEquals("master_ma_for_my_id", $webhookNotification->merchantAccount->masterMerchantAccount->id); + $this->assertEquals(Braintree\MerchantAccount::STATUS_SUSPENDED, $webhookNotification->merchantAccount->masterMerchantAccount->status); + $this->assertEquals("Credit score is too low", $webhookNotification->message); + $errors = $webhookNotification->errors->forKey('merchantAccount')->onAttribute('base'); + $this->assertEquals(Braintree\Error\Codes::MERCHANT_ACCOUNT_DECLINED_OFAC, $errors[0]->code); + } + + public function testBuildsASampleNotificationForATransactionDisbursedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::TRANSACTION_DISBURSED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::TRANSACTION_DISBURSED, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->transaction->id); + $this->assertEquals(100, $webhookNotification->transaction->amount); + $this->assertNotNull($webhookNotification->transaction->disbursementDetails->disbursementDate); + } + + public function testBuildsASampleNotificationForATransactionSettledWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::TRANSACTION_SETTLED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::TRANSACTION_SETTLED, $webhookNotification->kind); + $transaction = $webhookNotification->transaction; + $this->assertEquals("my_id", $transaction->id); + $this->assertEquals("settled", $transaction->status); + $this->assertEquals(100, $transaction->amount); + $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber); + $this->assertEquals('1234', $transaction->usBankAccount->last4); + $this->assertEquals('checking', $transaction->usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName); + } + + public function testBuildsASampleNotificationForATransactionSettlementDeclinedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::TRANSACTION_SETTLEMENT_DECLINED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::TRANSACTION_SETTLEMENT_DECLINED, $webhookNotification->kind); + $transaction = $webhookNotification->transaction; + $this->assertEquals("my_id", $transaction->id); + $this->assertEquals("settlement_declined", $transaction->status); + $this->assertEquals(100, $transaction->amount); + $this->assertEquals('123456789', $transaction->usBankAccount->routingNumber); + $this->assertEquals('1234', $transaction->usBankAccount->last4); + $this->assertEquals('checking', $transaction->usBankAccount->accountType); + $this->assertEquals('Dan Schulman', $transaction->usBankAccount->accountHolderName); + } + + public function testBuildsASampleNotificationForADisputeOpenedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::DISPUTE_OPENED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::DISPUTE_OPENED, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->dispute->id); + $this->assertEquals(Braintree\Dispute::OPEN, $webhookNotification->dispute->status); + $this->assertEquals(Braintree\Dispute::CHARGEBACK, $webhookNotification->dispute->kind); + $this->assertEquals(new DateTime('2014-03-21'), $webhookNotification->dispute->dateOpened); + } + + public function testBuildsASampleNotificationForADisputeLostWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::DISPUTE_LOST, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::DISPUTE_LOST, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->dispute->id); + $this->assertEquals(Braintree\Dispute::LOST, $webhookNotification->dispute->status); + $this->assertEquals(Braintree\Dispute::CHARGEBACK, $webhookNotification->dispute->kind); + $this->assertEquals(new DateTime('2014-03-21'), $webhookNotification->dispute->dateOpened); + } + + public function testBuildsASampleNotificationForADisputeWonWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::DISPUTE_WON, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::DISPUTE_WON, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->dispute->id); + $this->assertEquals(Braintree\Dispute::WON, $webhookNotification->dispute->status); + $this->assertEquals(Braintree\Dispute::CHARGEBACK, $webhookNotification->dispute->kind); + $this->assertEquals(new DateTime('2014-03-21'), $webhookNotification->dispute->dateOpened); + $this->assertEquals(new DateTime('2014-03-22'), $webhookNotification->dispute->dateWon); + } + + public function testBuildsASampleNotificationForADisbursementExceptionWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::DISBURSEMENT_EXCEPTION, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + + $this->assertEquals(Braintree\WebhookNotification::DISBURSEMENT_EXCEPTION, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->disbursement->id); + $this->assertEquals(false, $webhookNotification->disbursement->retry); + $this->assertEquals(false, $webhookNotification->disbursement->success); + $this->assertEquals("bank_rejected", $webhookNotification->disbursement->exceptionMessage); + $this->assertEquals(100.00, $webhookNotification->disbursement->amount); + $this->assertEquals("update_funding_information", $webhookNotification->disbursement->followUpAction); + $this->assertEquals("merchant_account_token", $webhookNotification->disbursement->merchantAccount->id); + $this->assertEquals(new DateTime("2014-02-10"), $webhookNotification->disbursement->disbursementDate); + $this->assertEquals(["asdfg", "qwert"], $webhookNotification->disbursement->transactionIds); + } + + public function testBuildsASampleNotificationForADisbursementWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::DISBURSEMENT, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + + $this->assertEquals(Braintree\WebhookNotification::DISBURSEMENT, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->disbursement->id); + $this->assertEquals(false, $webhookNotification->disbursement->retry); + $this->assertEquals(true, $webhookNotification->disbursement->success); + $this->assertEquals(NULL, $webhookNotification->disbursement->exceptionMessage); + $this->assertEquals(100.00, $webhookNotification->disbursement->amount); + $this->assertEquals(NULL, $webhookNotification->disbursement->followUpAction); + $this->assertEquals("merchant_account_token", $webhookNotification->disbursement->merchantAccount->id); + $this->assertEquals(new DateTime("2014-02-10"), $webhookNotification->disbursement->disbursementDate); + $this->assertEquals(["asdfg", "qwert"], $webhookNotification->disbursement->transactionIds); + } + public function testBuildsASampleNotificationForAPartnerMerchantConnectedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::PARTNER_MERCHANT_CONNECTED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::PARTNER_MERCHANT_CONNECTED, $webhookNotification->kind); + $this->assertEquals("public_id", $webhookNotification->partnerMerchant->merchantPublicId); + $this->assertEquals("public_key", $webhookNotification->partnerMerchant->publicKey); + $this->assertEquals("private_key", $webhookNotification->partnerMerchant->privateKey); + $this->assertEquals("abc123", $webhookNotification->partnerMerchant->partnerMerchantId); + $this->assertEquals("cse_key", $webhookNotification->partnerMerchant->clientSideEncryptionKey); + } + + public function testBuildsASampleNotificationForAPartnerMerchantDisconnectedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::PARTNER_MERCHANT_DISCONNECTED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::PARTNER_MERCHANT_DISCONNECTED, $webhookNotification->kind); + $this->assertEquals("abc123", $webhookNotification->partnerMerchant->partnerMerchantId); + } + + public function testBuildsASampleNotificationForAPartnerMerchantDeclinedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::PARTNER_MERCHANT_DECLINED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::PARTNER_MERCHANT_DECLINED, $webhookNotification->kind); + $this->assertEquals("abc123", $webhookNotification->partnerMerchant->partnerMerchantId); + } + + public function testBuildsASampleNotificationForOAuthAccessRevokedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::OAUTH_ACCESS_REVOKED, + 'my_id' + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::OAUTH_ACCESS_REVOKED, $webhookNotification->kind); + $this->assertEquals('my_id', $webhookNotification->oauthAccessRevocation->merchantId); + $this->assertEquals("oauth_application_client_id", $webhookNotification->oauthAccessRevocation->oauthApplicationClientId); + } + + public function testBuildsASampleNotificationForConnectedMerchantStatusTransitionedWebhook() + { + $gateway = new Braintree\Gateway([ + 'privateKey' => 'integration_private_key', + 'publicKey' => 'integration_public_key', + 'merchantId' => 'integration_merchant_id', + 'environment' => 'development' + ]); + + $sampleNotification = $gateway->webhookTesting()->sampleNotification( + Braintree\WebhookNotification::CONNECTED_MERCHANT_STATUS_TRANSITIONED, + "my_id" + ); + + $webhookNotification = $gateway->webhookNotification()->parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::CONNECTED_MERCHANT_STATUS_TRANSITIONED, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->connectedMerchantStatusTransitioned->merchantPublicId); + $this->assertEquals("my_id", $webhookNotification->connectedMerchantStatusTransitioned->merchantId); + $this->assertEquals("new_status", $webhookNotification->connectedMerchantStatusTransitioned->status); + $this->assertEquals("oauth_application_client_id", $webhookNotification->connectedMerchantStatusTransitioned->oauthApplicationClientId); + } + + public function testBuildsASampleNotificationForConnectedMerchantPayPalStatusChangedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::CONNECTED_MERCHANT_PAYPAL_STATUS_CHANGED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::CONNECTED_MERCHANT_PAYPAL_STATUS_CHANGED, $webhookNotification->kind); + $this->assertEquals("my_id", $webhookNotification->connectedMerchantPayPalStatusChanged->merchantPublicId); + $this->assertEquals("my_id", $webhookNotification->connectedMerchantPayPalStatusChanged->merchantId); + $this->assertEquals("link", $webhookNotification->connectedMerchantPayPalStatusChanged->action); + $this->assertEquals("oauth_application_client_id", $webhookNotification->connectedMerchantPayPalStatusChanged->oauthApplicationClientId); + } + + public function testBuildsASampleNotificationForACheckWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::CHECK, + "" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification["bt_signature"], + $sampleNotification["bt_payload"] + ); + + $this->assertEquals(Braintree\WebhookNotification::CHECK, $webhookNotification->kind); + } + + public function testAccountUpdaterDailyReportWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::ACCOUNT_UPDATER_DAILY_REPORT, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::ACCOUNT_UPDATER_DAILY_REPORT, $webhookNotification->kind); + $this->assertEquals("link-to-csv-report", $webhookNotification->accountUpdaterDailyReport->reportUrl); + $this->assertEquals(new DateTime("2016-01-14"), $webhookNotification->accountUpdaterDailyReport->reportDate); + } + + public function testIdealPaymentCompleteWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::IDEAL_PAYMENT_COMPLETE, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::IDEAL_PAYMENT_COMPLETE, $webhookNotification->kind); + $idealPayment = $webhookNotification->idealPayment; + + $this->assertEquals("my_id", $idealPayment->id); + $this->assertEquals("COMPLETE", $idealPayment->status); + $this->assertEquals("ORDERABC", $idealPayment->orderId); + $this->assertEquals("10.00", $idealPayment->amount); + $this->assertEquals("https://example.com", $idealPayment->approvalUrl); + $this->assertEquals("1234567890", $idealPayment->idealTransactionId); + } + + public function testIdealPaymentFailedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::IDEAL_PAYMENT_FAILED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::IDEAL_PAYMENT_FAILED, $webhookNotification->kind); + $idealPayment = $webhookNotification->idealPayment; + + $this->assertEquals("my_id", $idealPayment->id); + $this->assertEquals("FAILED", $idealPayment->status); + $this->assertEquals("ORDERABC", $idealPayment->orderId); + $this->assertEquals("10.00", $idealPayment->amount); + $this->assertEquals("https://example.com", $idealPayment->approvalUrl); + $this->assertEquals("1234567890", $idealPayment->idealTransactionId); + } + + public function testGrantorUpdatedGrantedPaymentMethodWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::GRANTOR_UPDATED_GRANTED_PAYMENT_METHOD, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::GRANTOR_UPDATED_GRANTED_PAYMENT_METHOD, $webhookNotification->kind); + $update = $webhookNotification->grantedPaymentInstrumentUpdate; + + $this->assertEquals("vczo7jqrpwrsi2px", $update->grantOwnerMerchantId); + $this->assertEquals("cf0i8wgarszuy6hc", $update->grantRecipientMerchantId); + $this->assertEquals("ee257d98-de40-47e8-96b3-a6954ea7a9a4", $update->paymentMethodNonce->nonce); + $this->assertEquals("abc123z", $update->token); + $this->assertEquals(array("expiration-month", "expiration-year"), $update->updatedFields); + } + + public function testRecipientUpdatedGrantedPaymentMethodWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::RECIPIENT_UPDATED_GRANTED_PAYMENT_METHOD, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::RECIPIENT_UPDATED_GRANTED_PAYMENT_METHOD, $webhookNotification->kind); $update = $webhookNotification->grantedPaymentInstrumentUpdate; + + $this->assertEquals("vczo7jqrpwrsi2px", $update->grantOwnerMerchantId); + $this->assertEquals("cf0i8wgarszuy6hc", $update->grantRecipientMerchantId); + $this->assertEquals("ee257d98-de40-47e8-96b3-a6954ea7a9a4", $update->paymentMethodNonce->nonce); + $this->assertEquals("abc123z", $update->token); + $this->assertEquals(array("expiration-month", "expiration-year"), $update->updatedFields); + } + + public function testGrantedPaymentMethodRevokedCreditCardWebhook() + { + $xmlPayload = " + + 12345 + 2018-10-10T22:46:41Z + granted_payment_method_revoked + + + 555555 + MasterCard + Amber Ankunding + Unknown + Unknown + 2018-10-10T22:46:41Z + credit_card_customer_id + US + Unknown + true + Unknown + 06 + 2020 + false + cGF5bWVudG1ldGhvZF8zcHQ2d2hz + Unknown + https://assets.braintreegateway.com/payment_method_logo/mastercard.png?environment=test + Unknown + 4444 + Unknown + Unknown + Unknown + + credit_card_token + 08199d188e37460163207f714faf074a + 2018-10-10T22:46:41Z + false + + + + + "; + + $sampleNotification = Helper::sampleNotificationFromXml($xmlPayload); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::GRANTED_PAYMENT_METHOD_REVOKED, $webhookNotification->kind); + $metadata = $webhookNotification->revokedPaymentMethodMetadata; + + $this->assertEquals("credit_card_customer_id", $metadata->customerId); + $this->assertEquals("credit_card_token", $metadata->token); + $this->assertTrue($metadata->revokedPaymentMethod instanceof Braintree\CreditCard); + } + + public function testGrantedPaymentMethodRevokedPayPalAccountWebhook() + { + $xmlPayload = " + + 12345 + 2018-10-10T22:46:41Z + granted_payment_method_revoked + + + billing_agreement_id + 2018-10-11T21:10:33Z + paypal_customer_id + true + johndoe@example.com + cGF5bWVudG1ldGhvZF9wYXlwYWxfdG9rZW4 + https://assets.braintreegateway.com/payment_method_logo/mastercard.png?environment=test + + paypal_token + 2018-10-11T21:10:33Z + a6a8e1a4 + + + "; + + $sampleNotification = Helper::sampleNotificationFromXml($xmlPayload); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::GRANTED_PAYMENT_METHOD_REVOKED, $webhookNotification->kind); + $metadata = $webhookNotification->revokedPaymentMethodMetadata; + + $this->assertEquals("paypal_customer_id", $metadata->customerId); + $this->assertEquals("paypal_token", $metadata->token); + $this->assertTrue($metadata->revokedPaymentMethod instanceof Braintree\PayPalAccount); + } + + public function testGrantedPaymentMethodRevokedVenmoAccountWebhook() + { + $xmlPayload = " + + 12345 + 2018-10-10T22:46:41Z + granted_payment_method_revoked + + + 2018-10-11T21:28:37Z + 2018-10-11T21:28:37Z + true + https://assets.braintreegateway.com/payment_method_logo/mastercard.png?environment=test + venmo_token + Venmo Account: venmojoe + venmojoe + 456 + + venmo_customer_id + cGF5bWVudG1ldGhvZF92ZW5tb2FjY291bnQ + + + "; + + $sampleNotification = Helper::sampleNotificationFromXml($xmlPayload); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::GRANTED_PAYMENT_METHOD_REVOKED, $webhookNotification->kind); + $metadata = $webhookNotification->revokedPaymentMethodMetadata; + + $this->assertEquals("venmo_customer_id", $metadata->customerId); + $this->assertEquals("venmo_token", $metadata->token); + $this->assertTrue($metadata->revokedPaymentMethod instanceof Braintree\VenmoAccount); + } + + + public function testLocalPaymentCompletedWebhook() + { + $sampleNotification = Braintree\WebhookTesting::sampleNotification( + Braintree\WebhookNotification::LOCAL_PAYMENT_COMPLETED, + "my_id" + ); + + $webhookNotification = Braintree\WebhookNotification::parse( + $sampleNotification['bt_signature'], + $sampleNotification['bt_payload'] + ); + + $this->assertEquals(Braintree\WebhookNotification::LOCAL_PAYMENT_COMPLETED, $webhookNotification->kind); + $localPaymentCompleted = $webhookNotification->localPaymentCompleted; + + $this->assertEquals("a-payment-id", $localPaymentCompleted->paymentId); + $this->assertEquals("a-payer-id", $localPaymentCompleted->payerId); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_GeneratorTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_GeneratorTest.php new file mode 100644 index 00000000000..d1bc3e5ef72 --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_GeneratorTest.php @@ -0,0 +1,134 @@ + + + true + false + + +XML; + $xml = Braintree\Xml::buildXmlFromArray([ + 'root' => ['yes' => true, 'no' => false] + ]); + $this->assertEquals($expected, $xml); + } + + public function testCreatesArrays() + { + $expected = << + + + foo + bar + + + +XML; + $xml = Braintree\Xml::buildXmlFromArray([ + 'root' => ['stuff' => ['foo', 'bar']] + ]); + $this->assertEquals($expected, $xml); + } + + public function testCreatesWithDashes() + { + $expected = << + + + 42 + 3 + + + +XML; + $xml = Braintree\Xml::buildXmlFromArray([ + 'root' => ['someStuff' => ['innerFoo' => 42, 'barBarBar' => 3]] + ]); + $this->assertEquals($expected, $xml); + } + + public function testCreatesArraysWithBooleans() + { + $expected = << + + + true + false + + + +XML; + $xml = Braintree\Xml::buildXmlFromArray([ + 'root' => ['stuff' => [true, false]] + ]); + $this->assertEquals($expected, $xml); + } + + public function testHandlesEmptyArrays() + { + $expected = << + + + + +XML; + $xml = Braintree\Xml::buildXmlFromArray([ + 'root' => ['stuff' => []] + ]); + $this->assertEquals($expected, $xml); + } + + public function testEscapingSpecialChars() + { + $expected = << + + <>&'" + + +XML; + $xml = Braintree\Xml::buildXmlFromArray([ + 'root' => ['stuff' => '<>&\'"'] + ]); + $this->assertEquals($expected, $xml); + } + + public function testDoesNotModifyDateTime() + { + $date = new \DateTime(); + $date->setTimestamp(strtotime('2016-05-17T21:22:26Z')); + $date->setTimezone(new \DateTimeZone('Europe/Paris')); + + $originalDate = clone $date; + + $expected = << + + 2016-05-17T21:22:26Z + + +XML; + + $xml = Braintree\Xml::buildXmlFromArray([ + 'root' => ['stuff' => $date] + ]); + + $this->assertEquals($originalDate, $date); + $this->assertEquals($expected, $xml); + } +} diff --git a/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_ParserTest.php b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_ParserTest.php new file mode 100644 index 00000000000..eb1099957fd --- /dev/null +++ b/upload/system/storage/vendor/braintree/braintree_php/tests/unit/Xml_ParserTest.php @@ -0,0 +1,542 @@ +123'); + $this->assertEquals($array, ['root' => ['foo' => 123]]); + + } + + public function testDashesUnderscores() + { + $xml =<< + + + +XML; + + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals(['root' => + ['dashEs' => '', 'underScores' => '']], $array); + } + + public function testCustomFieldsUnderscore() + { + $xml =<< + + convert to underscore + + +XML; + + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals(['root' => + ['customFields' => ['with_dashes' => 'convert to underscore']]], $array); + } + + public function testNullOrEmptyString() + { + $xml = << + + + +XML; + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals(['root' => + ['aNilValue' => null, 'anEmptyString' => '']], $array); + } + + public function testTypeCastsDatetimes() + { + $xml = << + 2009-10-28T10:19:49Z + +XML; + $array = Braintree\Xml::buildArrayFromXml($xml); + date_default_timezone_set('UTC'); + $dateTime = new DateTime('2009-10-28T10:19:49', new DateTimeZone('UTC')); + $this->assertEquals(['root' => ['createdAt' => $dateTime]], $array); + $this->assertInstanceOf('DateTime', $array['root']['createdAt']); + } + + public function testTypeCastsDates() + { + $xml = << + 2009-10-28 + +XML; + $array = Braintree\Xml::buildArrayFromXml($xml); + date_default_timezone_set('UTC'); + $dateTime = new DateTime('2009-10-28', new DateTimeZone('UTC')); + $this->assertEquals(['root' => ['someDate' => $dateTime]], $array); + } + + public function testBuildsArray() + { + $xml = << + + Adam + Ben + + +XML; + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals(['root' => + ['customers' => + [['name' => 'Adam'], + ['name' => 'Ben']] + ] + ], $array + ); + + } + + public function testReturnsBoolean() + { + $xml = << + true + 1 + false + anything + true + +XML; + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals( + ['root' => + ['castedTrue' => true, + 'castedOne' => true, + 'castedFalse' => false, + 'castedAnything' => false, + 'uncastedTrue' => 'true'] + ], $array); + + } + + public function testEmptyArrayAndNestedElements() + { + $xml = << + + 1 + + + +XML; + + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals( + ['root' => [ + 'noValues' => [], + 'nestedValues' => [ + 'value' => 1 + ] + ] + ], $array); + } + + public function testParsingNilEqualsTrueAfterArray() + { + $xml = << + + Dan + + + +XML; + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals(null, $array['root']['blank']); + + } + + public function testTransactionParsingNil() + { + $xml = << + 8ysndw + settled + sale + USD + 1.00 + default + + + 2010-04-01T19:32:23Z + 2010-04-02T08:05:35Z + + + First + Last + + + + + + + + + + + Widgets Inc + 1234 My Street + Apt 1 + Ottawa + ON + K1C2N6 + Canada + + + + + + + + + + + + + + + + + + M + M + M + 13390 + 1000 + Approved + + + 510510 + 5100 + MasterCard + 09 + 2011 + US + + + + + 2010-04-01T19:32:24Z + authorized + 1.00 + dmanges-am + API + + + 2010-04-01T19:32:25Z + submitted_for_settlement + 1.00 + dmanges-am + API + + + 2010-04-02T08:05:36Z + settled + 1.00 + + + + + +XML; + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals(null, $array['transaction']['avsErrorResponseCode']); + $this->assertEquals(null, $array['transaction']['refundId']); + $this->assertEquals(null, $array['transaction']['orderId']); + $this->assertEquals(null, $array['transaction']['channel']); + $this->assertEquals(null, $array['transaction']['customer']['fax']); + $this->assertEquals(null, $array['transaction']['creditCard']['token']); + $this->assertEquals(null, $array['transaction']['creditCard']['cardholderName']); + $this->assertEquals('First', $array['transaction']['customer']['firstName']); + $this->assertEquals('Approved', $array['transaction']['processorResponseText']); + + } + + public function testParsingWithNodeHavingSameNameAsNodesDirectlyUnderCollection() + { + $xml = << + 50 + + one + + + two + bug was here + + +END; + $array = Braintree\Xml::buildArrayFromXml($xml); + $this->assertEquals(['baz' => 'two', 'bar' => 'bug was here'], $array['foos']['bar'][1]); + } + + public function testParsingCreditCardSearchResults() + { + $xml = << + 1 + 50 + 8 + + 411111 + John Doe + Visa + 2010-07-02T15:50:51Z + 589636 + true + 05 + 2009 + true + US + 1111 + + 22pb + 2010-07-02T15:50:51Z + + + 411111 + + Visa + 2010-07-02T15:52:09Z + 613603 + false + 05 + 2009 + true + US + 1111 + + + hzjh8b + 54.32 + integration_trialless_plan + 2010-07-02 + 2010-08-02 + 2010-07-02 + 2010-08-01 + sandbox_credit_card + false + Active + 0 + 3wx6 + + + + + 2dpk76 + submitted_for_settlement + sale + USD + 54.32 + sandbox_credit_card + + + 2010-07-02T15:52:09Z + 2010-07-02T15:52:09Z + + 613603 + Mike + Jones + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + I + I + I + + 9ZR5QB + 1000 + Approved + + sb8w + 411111 + 1111 + Visa + 05 + 2010 + US + + + + + 2010-07-02T15:52:09Z + authorized + 54.32 + merchant + Recurring + + + 2010-07-02T15:52:09Z + submitted_for_settlement + 54.32 + merchant + Recurring + + + hzjh8b + + + + + 3wx6 + 2010-07-02T15:52:09Z + + +END; + $array = Braintree\Xml::buildArrayFromXml($xml); + $creditCards = $array['paymentMethods']['creditCard']; + $creditCardWithSubscription = $creditCards[1]; + $transaction = $creditCardWithSubscription['subscriptions'][0]['transactions'][0]; + $this->assertEquals('411111', $transaction['creditCard']['bin']); + $this->assertEquals('1111', $transaction['creditCard']['last4']); + $this->assertEquals('Visa', $transaction['creditCard']['cardType']); + } + + public function xmlAndBack($array) + { + $xml = Braintree\Xml::buildXmlFromArray($array); + return Braintree\Xml::buildArrayFromXml($xml); + + } + + public function testSimpleCaseRoundtrip() + { + $array = ['root' => [ + 'foo' => 'fooValue', + 'bar' => 'barValue'] + ]; + + $array2 = $this->xmlAndBack($array); + $this->assertEquals($array, $array2); + } + + public function testArrayRoundtrip() + { + $array = ['root' => [ + 'items' => [ + ['name' => 'first'], + ['name' => 'second'], + ] + ]]; + $array2 = $this->xmlAndBack($array); + $this->assertEquals($array, $array2); + } + + public function testBooleanRoundtrip() + { + $array = ['root' => [ + 'stringTrue' => true, + 'boolTrue' => true, + 'stringFalse' => false, + 'boolFalse' => false, + ]]; + $array2 = $this->xmlAndBack($array); + $this->assertEquals($array, $array2); + + } + public function testTimestampRoundtrip() + { + date_default_timezone_set('UTC'); + $array = ['root' => [ + 'aTimestamp' => date('D M d H:i:s e Y', mktime(1, 2, 3, 10, 28, 2009)), + ]]; + $array2 = $this->xmlAndBack($array); + $this->assertEquals($array, $array2); + + } + + public function testNullvsEmptyStringToXml() + { + $array = ['root' => [ + 'anEmptyString' => '', + 'aNullValue' => null, + ]]; + $xml = Braintree\Xml::buildXmlFromArray($array); + $xml2 =<< + + + + + +XML; + + $this->assertEquals($xml, $xml2); + } + + public function testIncludesTheEncodingRoundtrip() + { + $array = ['root' => [ + 'root' => 'bar', + ]]; + $xml = Braintree\Xml::buildXmlFromArray($array); + $this->assertRegExp('<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>', $xml); + + } + + public function testRootNodeAndStringRoundtrip() + { + $array = ['id' => '123']; + $array2 = $this->xmlAndBack($array); + $this->assertEquals($array, $array2); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/CreateSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/CreateSpec.php new file mode 100644 index 00000000000..915daada637 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/CreateSpec.php @@ -0,0 +1,68 @@ +beConstructedWith($this->paymentId, $this->description); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_contains_loaded_options() + { + $this->getAttributes()->shouldReturn([ + 'description' => $this->description, + ]); + } + + function it_does_not_contain_optional_properties() + { + $this->beConstructedWith($this->paymentId); + + $this->getAttributes()->shouldReturn([]); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + sprintf('payments/%s/voids', $this->paymentId) + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('POST'); + } + + function it_has_body() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Void\Void') + ; + } + + function it_has_validation_constraints() + { + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetAllSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetAllSpec.php new file mode 100644 index 00000000000..4a6c3368fb1 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetAllSpec.php @@ -0,0 +1,58 @@ +beConstructedWith($this->paymentId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/voids' + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_has_create_result() + { + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Void\Void') + ; + } + + function it_has_validation_constraints() + { + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetSpec.php new file mode 100644 index 00000000000..a60ea2d68c5 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/GetSpec.php @@ -0,0 +1,64 @@ +beConstructedWith($this->paymentId, $this->voidId); + } + + function it_is_initializable() + { + $this->shouldImplement('Cardinity\Method\MethodInterface'); + } + + function it_has_payment_id() + { + $this->getPaymentId()->shouldReturn($this->paymentId); + } + + function it_has_settlement_id() + { + $this->getvoidId()->shouldReturn($this->voidId); + } + + function it_has_action() + { + $this->getAction()->shouldReturn( + 'payments/' . $this->paymentId . '/voids/' . $this->voidId + ); + } + + function it_has_method() + { + $this->getMethod()->shouldReturn('GET'); + } + + function it_has_query() + { + $this->getAttributes()->shouldBeArray(); + } + + function it_creates_result_object() + { + $this->createResultObject() + ->shouldReturnAnInstanceOf('Cardinity\Method\Void\Void') + ; + } + + function it_has_validation_constraints() + { + $this + ->getValidationConstraints() + ->shouldReturnAnInstanceOf('Symfony\Component\Validator\Constraint') + ; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/VoidSpec.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/VoidSpec.php new file mode 100644 index 00000000000..e547085f004 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/spec/Method/Void/VoidSpec.php @@ -0,0 +1,19 @@ +shouldImplement('Cardinity\Method\ResultObjectInterface'); + } + + function it_is_serializable() + { + $this->shouldImplement('\Serializable'); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Create.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Create.php new file mode 100644 index 00000000000..2783abc231b --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Create.php @@ -0,0 +1,56 @@ +paymentId = $paymentId; + $this->description = $description; + } + + public function getAction() + { + return sprintf('payments/%s/voids', $this->paymentId); + } + + public function getMethod() + { + return MethodInterface::POST; + } + + public function getAttributes() + { + $return = []; + + if ($this->description !== null) { + $return['description'] = $this->description; + } + + return $return; + } + + public function createResultObject() + { + return new Void(); + } + + public function getValidationConstraints() + { + return new Assert\Collection([ + 'description' => new Assert\Optional([ + new Assert\Type(['type' => 'string']), + new Assert\Length([ + 'max' => 255 + ]), + ]), + ]); + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Get.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Get.php new file mode 100644 index 00000000000..203fefabd0e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Get.php @@ -0,0 +1,57 @@ +paymentId = $paymentId; + $this->voidId = $voidId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/voids/%s', + $this->getPaymentId(), + $this->getvoidId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Void(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function getvoidId() + { + return $this->voidId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/GetAll.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/GetAll.php new file mode 100644 index 00000000000..f534e61714e --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/GetAll.php @@ -0,0 +1,50 @@ +paymentId = $paymentId; + } + + public function getAction() + { + return sprintf( + 'payments/%s/voids', + $this->getPaymentId() + ); + } + + public function getMethod() + { + return MethodInterface::GET; + } + + public function createResultObject() + { + return new Void(); + } + + public function getAttributes() + { + return []; + } + + public function getValidationConstraints() + { + return new Assert\Collection([]); + } + + public function getPaymentId() + { + return $this->paymentId; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Void.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Void.php new file mode 100644 index 00000000000..fb001e31f42 --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/src/Method/Void/Void.php @@ -0,0 +1,221 @@ +id; + } + + /** + * Sets the value of id. + * @param mixed $id the id + * @return void + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * Gets the value of type. + * @return mixed + */ + public function getType() + { + return $this->type; + } + + /** + * Sets the value of type. + * @param mixed $type the type + * @return void + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * Gets the value of created. + * @return mixed + */ + public function getCreated() + { + return $this->created; + } + + /** + * Sets the value of created. + * @param mixed $created the created + * @return void + */ + public function setCreated($created) + { + $this->created = $created; + } + + /** + * Gets the value of live. + * @return mixed + */ + public function getLive() + { + return $this->live; + } + + /** + * Sets the value of live. + * @param mixed $live the live + * @return void + */ + public function setLive($live) + { + $this->live = $live; + } + + /** + * Gets the value of parentId. + * @return mixed + */ + public function getParentId() + { + return $this->parentId; + } + + /** + * Sets the value of parentId. + * @param mixed $parentId the parent id + * @return void + */ + public function setParentId($parentId) + { + $this->parentId = $parentId; + } + + /** + * Gets the value of status. + * @return mixed + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets the value of status. + * @param mixed $status the status + * @return void + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * Gets the value of error. + * @return mixed + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the value of error. + * @param mixed $error the error + * @return void + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the value of orderId. + * @return mixed + */ + public function getOrderId() + { + return $this->orderId; + } + + /** + * Sets the value of orderId. + * @param mixed $orderId the order id + * @return void + */ + public function setOrderId($orderId) + { + $this->orderId = $orderId; + } + + /** + * Gets the value of description. + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the value of description. + * @param mixed $description the description + * @return void + */ + public function setDescription($description) + { + $this->description = $description; + } +} diff --git a/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidTest.php b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidTest.php new file mode 100644 index 00000000000..1c468d9d30c --- /dev/null +++ b/upload/system/storage/vendor/cardinity/cardinity-sdk-php/tests/VoidTest.php @@ -0,0 +1,105 @@ +setId('foo'); + $refund->setType('bar'); + $refund->setCreated(null); + + $this->assertSame( + '{"id":"foo","type":"bar"}', + $refund->serialize() + ); + } + + public function testResultObjectUnserialization() + { + $json = '{"id":"foo","type":"bar"}'; + + $payment = new Void\Void(); + $payment->unserialize($json); + + $this->assertSame('foo', $payment->getId()); + $this->assertSame('bar', $payment->getType()); + $this->assertSame(null, $payment->getDescription()); + } + + /** + * @return Payment\Payment + */ + public function testCreatePayment() + { + $method = new Payment\Create($this->getPaymentParams()); + $payment = $this->client->call($method); + + return $payment; + } + + /** + * @depends testCreatePayment + * @expectedException Cardinity\Exception\Declined + */ + public function testCreateFail(Payment\Payment $payment) + { + $method = new Void\Create( + $payment->getId(), + 'fail' + ); + $this->client->call($method); + } + + /** + * @depends testCreatePayment + */ + public function testCreate(Payment\Payment $payment) + { + $method = new Void\Create( + $payment->getId(), + 'my description' + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Void\Void', $result); + + return $result; + } + + /** + * @depends testCreate + */ + public function testGet(Void\Void $void) + { + $method = new Void\Get( + $void->getParentId(), + $void->getId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Void\Void', $result); + $this->assertSame($void->getParentId(), $result->getParentId()); + $this->assertSame('void', $result->getType()); + $this->assertSame('my description', $result->getDescription()); + } + + /** + * @depends testCreate + */ + public function testGetAll(Void\Void $void) + { + $method = new Void\GetAll( + $void->getParentId() + ); + $result = $this->client->call($method); + + $this->assertInstanceOf('Cardinity\Method\Void\Void', $result[0]); + $this->assertSame($void->getId(), $result[0]->getId()); + $this->assertSame($void->getParentId(), $result[0]->getParentId()); + } +} diff --git a/upload/system/storage/vendor/composer/InstalledVersions.php b/upload/system/storage/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000000..d50e0c9fcc4 --- /dev/null +++ b/upload/system/storage/vendor/composer/InstalledVersions.php @@ -0,0 +1,350 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + */ +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 + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + 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 false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @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} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // 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 = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @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 + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + 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'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // 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'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php new file mode 100644 index 00000000000..81b99ccb8b7 --- /dev/null +++ b/upload/system/storage/vendor/composer/installed.php @@ -0,0 +1,185 @@ + array( + 'pretty_version' => 'dev-3.0.x.x_Maintenance', + 'version' => 'dev-3.0.x.x_Maintenance', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../../../../', + 'aliases' => array(), + 'reference' => '94a8e8254518f4f649aa21315810b9ff2499895a', + 'name' => 'opencart/opencart', + 'dev' => true, + ), + 'versions' => array( + 'braintree/braintree_php' => array( + 'pretty_version' => '3.40.0', + 'version' => '3.40.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../braintree/braintree_php', + 'aliases' => array(), + 'reference' => '840fc6ebf8d96756fed475cce94565fef178187d', + 'dev_requirement' => false, + ), + 'cardinity/cardinity-sdk-php' => array( + 'pretty_version' => 'v1.0.3', + 'version' => '1.0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../cardinity/cardinity-sdk-php', + 'aliases' => array(), + 'reference' => 'f51f6fbacee393b4eeff7b80be2b1cee77896b4c', + 'dev_requirement' => false, + ), + 'divido/divido-php' => array( + 'pretty_version' => 'v1.15-stable', + 'version' => '1.15.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../divido/divido-php', + 'aliases' => array(), + 'reference' => '8edd902ec2be8151331985021107031292b41ca1', + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '5.3.4', + 'version' => '5.3.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'reference' => 'b87eda7a7162f95574032da17e9323c9899cb6b2', + 'dev_requirement' => false, + ), + 'guzzlehttp/log-subscriber' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/log-subscriber', + 'aliases' => array(), + 'reference' => '99c3c0004165db721d8ef7bbef60c996210e538a', + 'dev_requirement' => false, + ), + 'guzzlehttp/oauth-subscriber' => array( + 'pretty_version' => '0.2.0', + 'version' => '0.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/oauth-subscriber', + 'aliases' => array(), + 'reference' => '03f1ebe31d3112526106d0570c80eba6820e86e5', + 'dev_requirement' => false, + ), + 'guzzlehttp/ringphp' => array( + 'pretty_version' => '1.1.1', + 'version' => '1.1.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/ringphp', + 'aliases' => array(), + 'reference' => '5e2a174052995663dd68e6b5ad838afd47dd615b', + 'dev_requirement' => false, + ), + 'guzzlehttp/streams' => array( + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/streams', + 'aliases' => array(), + 'reference' => '47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5', + 'dev_requirement' => false, + ), + 'klarna/kco_rest' => array( + 'pretty_version' => 'v2.2.0', + 'version' => '2.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../klarna/kco_rest', + 'aliases' => array(), + 'reference' => '8a2142a2ebb087bb61901d51d1bb9698790e78c5', + 'dev_requirement' => false, + ), + 'opencart/opencart' => array( + 'pretty_version' => 'dev-3.0.x.x_Maintenance', + 'version' => 'dev-3.0.x.x_Maintenance', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../../../../', + 'aliases' => array(), + 'reference' => '94a8e8254518f4f649aa21315810b9ff2499895a', + 'dev_requirement' => false, + ), + 'psr/log' => array( + 'pretty_version' => '1.1.3', + 'version' => '1.1.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/log', + 'aliases' => array(), + 'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc', + 'dev_requirement' => false, + ), + 'react/promise' => array( + 'pretty_version' => 'v2.8.0', + 'version' => '2.8.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../react/promise', + 'aliases' => array(), + 'reference' => 'f3cff96a19736714524ca0dd1d4130de73dbbbc4', + 'dev_requirement' => false, + ), + 'scssphp/scssphp' => array( + 'pretty_version' => '1.1.1', + 'version' => '1.1.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../scssphp/scssphp', + 'aliases' => array(), + 'reference' => '824e4cec10b2bfa88eec5dac23991cb9106622c1', + 'dev_requirement' => false, + ), + 'symfony/polyfill-ctype' => array( + 'pretty_version' => 'v1.18.0', + 'version' => '1.18.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', + 'aliases' => array(), + 'reference' => '1c302646f6efc070cd46856e600e5e0684d6b454', + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.18.0', + 'version' => '1.18.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'reference' => 'a6977d63bf9a0ad4c65cd352709e230876f9904a', + 'dev_requirement' => false, + ), + 'symfony/translation' => array( + 'pretty_version' => 'v3.0.9', + 'version' => '3.0.9.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/translation', + 'aliases' => array(), + 'reference' => 'eee6c664853fd0576f21ae25725cfffeafe83f26', + 'dev_requirement' => false, + ), + 'symfony/validator' => array( + 'pretty_version' => 'v2.8.52', + 'version' => '2.8.52.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/validator', + 'aliases' => array(), + 'reference' => 'd5d2090bba3139d8ddb79959fbf516e87238fe3a', + 'dev_requirement' => false, + ), + 'twig/twig' => array( + 'pretty_version' => 'v3.3.8', + 'version' => '3.3.8.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../twig/twig', + 'aliases' => array(), + 'reference' => '972d8604a92b7054828b539f2febb0211dd5945c', + 'dev_requirement' => false, + ), + 'zoujingli/wechat-php-sdk' => array( + 'pretty_version' => 'v1.3.18', + 'version' => '1.3.18.0', + 'type' => 'project', + 'install_path' => __DIR__ . '/../zoujingli/wechat-php-sdk', + 'aliases' => array(), + 'reference' => 'd37d0c1919ede2ee54e65100ac3792e947b1e0ef', + 'dev_requirement' => false, + ), + ), +); diff --git a/upload/system/storage/vendor/composer/platform_check.php b/upload/system/storage/vendor/composer/platform_check.php new file mode 100644 index 00000000000..a8b98d5ceb1 --- /dev/null +++ b/upload/system/storage/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70205)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/.travis.yml b/upload/system/storage/vendor/guzzlehttp/guzzle/.travis.yml new file mode 100644 index 00000000000..607b00a051b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/.travis.yml @@ -0,0 +1,52 @@ +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - hhvm + - nightly + +env: + global: + - TEST_COMMAND="composer test" + +before_script: + - curl --version + - pear config-set php_ini ~/.phpenv/versions/`php -r 'echo phpversion();'`/etc/php.ini || echo 'Error modifying PEAR' + - pecl install uri_template || echo 'Error installing uri_template' + # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi + - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction + - ~/.nvm/nvm.sh install v0.6.14 + - ~/.nvm/nvm.sh run v0.6.14 + +script: $TEST_COMMAND + +matrix: + allow_failures: + - php: hhvm + - php: nightly + fast_finish: true + include: + - php: 5.4 + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" + +before_deploy: + - make package + +deploy: + provider: releases + api_key: + secure: UpypqlYgsU68QT/x40YzhHXvzWjFwCNo9d+G8KAdm7U9+blFfcWhV1aMdzugvPMl6woXgvJj7qHq5tAL4v6oswCORhpSBfLgOQVFaica5LiHsvWlAedOhxGmnJqMTwuepjBCxXhs3+I8Kof1n4oUL9gKytXjOVCX/f7XU1HiinU= + file: + - build/artifacts/guzzle.phar + - build/artifacts/guzzle.zip + on: + repo: guzzle/guzzle + tags: true + all_branches: true + php: 5.4 diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/BatchResults.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/BatchResults.php new file mode 100644 index 00000000000..e5af433ddf1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/BatchResults.php @@ -0,0 +1,148 @@ +hash = $hash; + } + + /** + * Get the keys that are available on the batch result. + * + * @return array + */ + public function getKeys() + { + return iterator_to_array($this->hash); + } + + /** + * Gets a result from the container for the given object. When getting + * results for a batch of requests, provide the request object. + * + * @param object $forObject Object to retrieve the result for. + * + * @return mixed|null + */ + public function getResult($forObject) + { + return isset($this->hash[$forObject]) ? $this->hash[$forObject] : null; + } + + /** + * Get an array of successful results. + * + * @return array + */ + public function getSuccessful() + { + $results = []; + foreach ($this->hash as $key) { + if (!($this->hash[$key] instanceof \Exception)) { + $results[] = $this->hash[$key]; + } + } + + return $results; + } + + /** + * Get an array of failed results. + * + * @return array + */ + public function getFailures() + { + $results = []; + foreach ($this->hash as $key) { + if ($this->hash[$key] instanceof \Exception) { + $results[] = $this->hash[$key]; + } + } + + return $results; + } + + /** + * Allows iteration over all batch result values. + * + * @return \ArrayIterator + */ + public function getIterator() + { + $results = []; + foreach ($this->hash as $key) { + $results[] = $this->hash[$key]; + } + + return new \ArrayIterator($results); + } + + /** + * Counts the number of elements in the batch result. + * + * @return int + */ + public function count() + { + return count($this->hash); + } + + /** + * Checks if the batch contains a specific numerical array index. + * + * @param int $key Index to access + * + * @return bool + */ + public function offsetExists($key) + { + return $key < count($this->hash); + } + + /** + * Allows access of the batch using a numerical array index. + * + * @param int $key Index to access. + * + * @return mixed|null + */ + public function offsetGet($key) + { + $i = -1; + foreach ($this->hash as $obj) { + if ($key === ++$i) { + return $this->hash[$obj]; + } + } + + return null; + } + + public function offsetUnset($key) + { + throw new \RuntimeException('Not implemented'); + } + + public function offsetSet($key, $value) + { + throw new \RuntimeException('Not implemented'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Collection.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Collection.php new file mode 100644 index 00000000000..4aabd20b00e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Collection.php @@ -0,0 +1,236 @@ +data = $data; + } + + /** + * Create a new collection from an array, validate the keys, and add default + * values where missing + * + * @param array $config Configuration values to apply. + * @param array $defaults Default parameters + * @param array $required Required parameter names + * + * @return self + * @throws \InvalidArgumentException if a parameter is missing + */ + public static function fromConfig( + array $config = [], + array $defaults = [], + array $required = [] + ) { + $data = $config + $defaults; + + if ($missing = array_diff($required, array_keys($data))) { + throw new \InvalidArgumentException( + 'Config is missing the following keys: ' . + implode(', ', $missing)); + } + + return new self($data); + } + + /** + * Removes all key value pairs + */ + public function clear() + { + $this->data = []; + } + + /** + * Get a specific key value. + * + * @param string $key Key to retrieve. + * + * @return mixed|null Value of the key or NULL + */ + public function get($key) + { + return isset($this->data[$key]) ? $this->data[$key] : null; + } + + /** + * Set a key value pair + * + * @param string $key Key to set + * @param mixed $value Value to set + */ + public function set($key, $value) + { + $this->data[$key] = $value; + } + + /** + * Add a value to a key. If a key of the same name has already been added, + * the key value will be converted into an array and the new value will be + * pushed to the end of the array. + * + * @param string $key Key to add + * @param mixed $value Value to add to the key + */ + public function add($key, $value) + { + if (!array_key_exists($key, $this->data)) { + $this->data[$key] = $value; + } elseif (is_array($this->data[$key])) { + $this->data[$key][] = $value; + } else { + $this->data[$key] = array($this->data[$key], $value); + } + } + + /** + * Remove a specific key value pair + * + * @param string $key A key to remove + */ + public function remove($key) + { + unset($this->data[$key]); + } + + /** + * Get all keys in the collection + * + * @return array + */ + public function getKeys() + { + return array_keys($this->data); + } + + /** + * Returns whether or not the specified key is present. + * + * @param string $key The key for which to check the existence. + * + * @return bool + */ + public function hasKey($key) + { + return array_key_exists($key, $this->data); + } + + /** + * Checks if any keys contains a certain value + * + * @param string $value Value to search for + * + * @return mixed Returns the key if the value was found FALSE if the value + * was not found. + */ + public function hasValue($value) + { + return array_search($value, $this->data, true); + } + + /** + * Replace the data of the object with the value of an array + * + * @param array $data Associative array of data + */ + public function replace(array $data) + { + $this->data = $data; + } + + /** + * Add and merge in a Collection or array of key value pair data. + * + * @param Collection|array $data Associative array of key value pair data + */ + public function merge($data) + { + foreach ($data as $key => $value) { + $this->add($key, $value); + } + } + + /** + * Overwrite key value pairs in this collection with all of the data from + * an array or collection. + * + * @param array|\Traversable $data Values to override over this config + */ + public function overwriteWith($data) + { + if (is_array($data)) { + $this->data = $data + $this->data; + } elseif ($data instanceof Collection) { + $this->data = $data->toArray() + $this->data; + } else { + foreach ($data as $key => $value) { + $this->data[$key] = $value; + } + } + } + + /** + * Returns a Collection containing all the elements of the collection after + * applying the callback function to each one. + * + * The callable should accept three arguments: + * - (string) $key + * - (string) $value + * - (array) $context + * + * The callable must return a the altered or unaltered value. + * + * @param callable $closure Map function to apply + * @param array $context Context to pass to the callable + * + * @return Collection + */ + public function map(callable $closure, array $context = []) + { + $collection = new static(); + foreach ($this as $key => $value) { + $collection[$key] = $closure($key, $value, $context); + } + + return $collection; + } + + /** + * Iterates over each key value pair in the collection passing them to the + * callable. If the callable returns true, the current value from input is + * returned into the result Collection. + * + * The callable must accept two arguments: + * - (string) $key + * - (string) $value + * + * @param callable $closure Evaluation function + * + * @return Collection + */ + public function filter(callable $closure) + { + $collection = new static(); + foreach ($this->data as $key => $value) { + if ($closure($key, $value)) { + $collection[$key] = $value; + } + } + + return $collection; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractEvent.php new file mode 100644 index 00000000000..0d2f4dbf0ce --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractEvent.php @@ -0,0 +1,20 @@ +propagationStopped; + } + + public function stopPropagation() + { + $this->propagationStopped = true; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php new file mode 100644 index 00000000000..8a6ee47c856 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php @@ -0,0 +1,61 @@ +transaction = $transaction; + } + + /** + * Get the HTTP client associated with the event. + * + * @return ClientInterface + */ + public function getClient() + { + return $this->transaction->client; + } + + /** + * Get the request object + * + * @return RequestInterface + */ + public function getRequest() + { + return $this->transaction->request; + } + + /** + * Get the number of transaction retries. + * + * @return int + */ + public function getRetryCount() + { + return $this->transaction->retries; + } + + /** + * @return Transaction + */ + public function getTransaction() + { + return $this->transaction; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php new file mode 100644 index 00000000000..bbbdfaf8313 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php @@ -0,0 +1,40 @@ +transaction->state = 'retry'; + + if ($afterDelay) { + $this->transaction->request->getConfig()->set('delay', $afterDelay); + } + + $this->stopPropagation(); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php new file mode 100644 index 00000000000..3b106df0078 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php @@ -0,0 +1,63 @@ +transaction->transferInfo; + } + + return isset($this->transaction->transferInfo[$name]) + ? $this->transaction->transferInfo[$name] + : null; + } + + /** + * Returns true/false if a response is available. + * + * @return bool + */ + public function hasResponse() + { + return !($this->transaction->response instanceof FutureInterface); + } + + /** + * Get the response. + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->hasResponse() ? $this->transaction->response : null; + } + + /** + * Intercept the request and associate a response + * + * @param ResponseInterface $response Response to set + */ + public function intercept(ResponseInterface $response) + { + $this->transaction->response = $response; + $this->transaction->exception = null; + $this->stopPropagation(); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/BeforeEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/BeforeEvent.php new file mode 100644 index 00000000000..f313c37561d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/BeforeEvent.php @@ -0,0 +1,26 @@ +transaction->response = $response; + $this->transaction->exception = null; + $this->stopPropagation(); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php new file mode 100644 index 00000000000..56cc557e3e5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/CompleteEvent.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @link https://github.com/symfony/symfony/tree/master/src/Symfony/Component/EventDispatcher + */ +class Emitter implements EmitterInterface +{ + /** @var array */ + private $listeners = []; + + /** @var array */ + private $sorted = []; + + public function on($eventName, callable $listener, $priority = 0) + { + if ($priority === 'first') { + $priority = isset($this->listeners[$eventName]) + ? max(array_keys($this->listeners[$eventName])) + 1 + : 1; + } elseif ($priority === 'last') { + $priority = isset($this->listeners[$eventName]) + ? min(array_keys($this->listeners[$eventName])) - 1 + : -1; + } + + $this->listeners[$eventName][$priority][] = $listener; + unset($this->sorted[$eventName]); + } + + public function once($eventName, callable $listener, $priority = 0) + { + $onceListener = function ( + EventInterface $event + ) use (&$onceListener, $eventName, $listener, $priority) { + $this->removeListener($eventName, $onceListener); + $listener($event, $eventName); + }; + + $this->on($eventName, $onceListener, $priority); + } + + public function removeListener($eventName, callable $listener) + { + if (empty($this->listeners[$eventName])) { + return; + } + + foreach ($this->listeners[$eventName] as $priority => $listeners) { + if (false !== ($key = array_search($listener, $listeners, true))) { + unset( + $this->listeners[$eventName][$priority][$key], + $this->sorted[$eventName] + ); + } + } + } + + public function listeners($eventName = null) + { + // Return all events in a sorted priority order + if ($eventName === null) { + foreach (array_keys($this->listeners) as $eventName) { + if (empty($this->sorted[$eventName])) { + $this->listeners($eventName); + } + } + return $this->sorted; + } + + // Return the listeners for a specific event, sorted in priority order + if (empty($this->sorted[$eventName])) { + $this->sorted[$eventName] = []; + if (isset($this->listeners[$eventName])) { + krsort($this->listeners[$eventName], SORT_NUMERIC); + foreach ($this->listeners[$eventName] as $listeners) { + foreach ($listeners as $listener) { + $this->sorted[$eventName][] = $listener; + } + } + } + } + + return $this->sorted[$eventName]; + } + + public function hasListeners($eventName) + { + return !empty($this->listeners[$eventName]); + } + + public function emit($eventName, EventInterface $event) + { + if (isset($this->listeners[$eventName])) { + foreach ($this->listeners($eventName) as $listener) { + $listener($event, $eventName); + if ($event->isPropagationStopped()) { + break; + } + } + } + + return $event; + } + + public function attach(SubscriberInterface $subscriber) + { + foreach ($subscriber->getEvents() as $eventName => $listeners) { + if (is_array($listeners[0])) { + foreach ($listeners as $listener) { + $this->on( + $eventName, + [$subscriber, $listener[0]], + isset($listener[1]) ? $listener[1] : 0 + ); + } + } else { + $this->on( + $eventName, + [$subscriber, $listeners[0]], + isset($listeners[1]) ? $listeners[1] : 0 + ); + } + } + } + + public function detach(SubscriberInterface $subscriber) + { + foreach ($subscriber->getEvents() as $eventName => $listener) { + $this->removeListener($eventName, [$subscriber, $listener[0]]); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EmitterInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EmitterInterface.php new file mode 100644 index 00000000000..9783efd15ae --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EmitterInterface.php @@ -0,0 +1,96 @@ +transaction->exception; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php new file mode 100644 index 00000000000..7432134d03e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php @@ -0,0 +1,27 @@ +transaction->exception; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EventInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EventInterface.php new file mode 100644 index 00000000000..97247e84c65 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/EventInterface.php @@ -0,0 +1,23 @@ +emitter) { + $this->emitter = new Emitter(); + } + + return $this->emitter; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php new file mode 100644 index 00000000000..407dc92dd5e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ListenerAttacherTrait.php @@ -0,0 +1,88 @@ +getEmitter(); + foreach ($listeners as $el) { + if ($el['once']) { + $emitter->once($el['name'], $el['fn'], $el['priority']); + } else { + $emitter->on($el['name'], $el['fn'], $el['priority']); + } + } + } + + /** + * Extracts the allowed events from the provided array, and ignores anything + * else in the array. The event listener must be specified as a callable or + * as an array of event listener data ("name", "fn", "priority", "once"). + * + * @param array $source Array containing callables or hashes of data to be + * prepared as event listeners. + * @param array $events Names of events to look for in the provided $source + * array. Other keys are ignored. + * @return array + */ + private function prepareListeners(array $source, array $events) + { + $listeners = []; + foreach ($events as $name) { + if (isset($source[$name])) { + $this->buildListener($name, $source[$name], $listeners); + } + } + + return $listeners; + } + + /** + * Creates a complete event listener definition from the provided array of + * listener data. Also works recursively if more than one listeners are + * contained in the provided array. + * + * @param string $name Name of the event the listener is for. + * @param array|callable $data Event listener data to prepare. + * @param array $listeners Array of listeners, passed by reference. + * + * @throws \InvalidArgumentException if the event data is malformed. + */ + private function buildListener($name, $data, &$listeners) + { + static $defaults = ['priority' => 0, 'once' => false]; + + // If a callable is provided, normalize it to the array format. + if (is_callable($data)) { + $data = ['fn' => $data]; + } + + // Prepare the listener and add it to the array, recursively. + if (isset($data['fn'])) { + $data['name'] = $name; + $listeners[] = $data + $defaults; + } elseif (is_array($data)) { + foreach ($data as $listenerData) { + $this->buildListener($name, $listenerData, $listeners); + } + } else { + throw new \InvalidArgumentException('Each event listener must be a ' + . 'callable or an associative array containing a "fn" key.'); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ProgressEvent.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ProgressEvent.php new file mode 100644 index 00000000000..3fd0de4ac05 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/ProgressEvent.php @@ -0,0 +1,51 @@ +downloadSize = $downloadSize; + $this->downloaded = $downloaded; + $this->uploadSize = $uploadSize; + $this->uploaded = $uploaded; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php new file mode 100644 index 00000000000..f51d420654a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php @@ -0,0 +1,56 @@ + ['methodName']] + * - ['eventName' => ['methodName', $priority]] + * - ['eventName' => [['methodName'], ['otherMethod']] + * - ['eventName' => [['methodName'], ['otherMethod', $priority]] + * - ['eventName' => [['methodName', $priority], ['otherMethod', $priority]] + * + * @return array + */ + public function getEvents(); +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/CouldNotRewindStreamException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/CouldNotRewindStreamException.php new file mode 100644 index 00000000000..fbe2dcd7cc9 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/CouldNotRewindStreamException.php @@ -0,0 +1,4 @@ +response = $response; + } + /** + * Get the associated response + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/StateException.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/StateException.php new file mode 100644 index 00000000000..a7652a384fd --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Exception/StateException.php @@ -0,0 +1,4 @@ +error = $error; + } + + /** + * Get the associated error + * + * @return \LibXMLError|null + */ + public function getError() + { + return $this->error; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/HasDataTrait.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/HasDataTrait.php new file mode 100644 index 00000000000..020dfc9aba2 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/HasDataTrait.php @@ -0,0 +1,75 @@ +data); + } + + public function offsetGet($offset) + { + return isset($this->data[$offset]) ? $this->data[$offset] : null; + } + + public function offsetSet($offset, $value) + { + $this->data[$offset] = $value; + } + + public function offsetExists($offset) + { + return isset($this->data[$offset]); + } + + public function offsetUnset($offset) + { + unset($this->data[$offset]); + } + + public function toArray() + { + return $this->data; + } + + public function count() + { + return count($this->data); + } + + /** + * Get a value from the collection using a path syntax to retrieve nested + * data. + * + * @param string $path Path to traverse and retrieve a value from + * + * @return mixed|null + */ + public function getPath($path) + { + return Utils::getPath($this->data, $path); + } + + /** + * Set a value into a nested array key. Keys will be created as needed to + * set the value. + * + * @param string $path Path to set + * @param mixed $value Value to set at the key + * + * @throws \RuntimeException when trying to setPath using a nested path + * that travels through a scalar value + */ + public function setPath($path, $value) + { + Utils::setPath($this->data, $path, $value); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php new file mode 100644 index 00000000000..f118e0fe5f8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php @@ -0,0 +1,253 @@ +getBody(); + } + + public function getProtocolVersion() + { + return $this->protocolVersion; + } + + public function getBody() + { + return $this->body; + } + + public function setBody(StreamInterface $body = null) + { + if ($body === null) { + // Setting a null body will remove the body of the request + $this->removeHeader('Content-Length'); + $this->removeHeader('Transfer-Encoding'); + } + + $this->body = $body; + } + + public function addHeader($header, $value) + { + if (is_array($value)) { + $current = array_merge($this->getHeaderAsArray($header), $value); + } else { + $current = $this->getHeaderAsArray($header); + $current[] = (string) $value; + } + + $this->setHeader($header, $current); + } + + public function addHeaders(array $headers) + { + foreach ($headers as $name => $header) { + $this->addHeader($name, $header); + } + } + + public function getHeader($header) + { + $name = strtolower($header); + return isset($this->headers[$name]) + ? implode(', ', $this->headers[$name]) + : ''; + } + + public function getHeaderAsArray($header) + { + $name = strtolower($header); + return isset($this->headers[$name]) ? $this->headers[$name] : []; + } + + public function getHeaders() + { + $headers = []; + foreach ($this->headers as $name => $values) { + $headers[$this->headerNames[$name]] = $values; + } + + return $headers; + } + + public function setHeader($header, $value) + { + $header = trim($header); + $name = strtolower($header); + $this->headerNames[$name] = $header; + + if (is_array($value)) { + foreach ($value as &$v) { + $v = trim($v); + } + $this->headers[$name] = $value; + } else { + $this->headers[$name] = [trim($value)]; + } + } + + public function setHeaders(array $headers) + { + $this->headers = $this->headerNames = []; + foreach ($headers as $key => $value) { + $this->addHeader($key, $value); + } + } + + public function hasHeader($header) + { + return isset($this->headers[strtolower($header)]); + } + + public function removeHeader($header) + { + $name = strtolower($header); + unset($this->headers[$name], $this->headerNames[$name]); + } + + /** + * Parse an array of header values containing ";" separated data into an + * array of associative arrays representing the header key value pair + * data 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. + * + * @param MessageInterface $message That contains the header + * @param string $header Header to retrieve from the message + * + * @return array Returns the parsed header values. + */ + public static function parseHeader(MessageInterface $message, $header) + { + static $trimmed = "\"' \n\t\r"; + $params = $matches = []; + + foreach (self::normalizeHeader($message, $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); + } + } + } + if ($part) { + $params[] = $part; + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param MessageInterface $message That contains the header + * @param string $header Header to retrieve from the message + * + * @return array Returns the normalized header field values. + */ + public static function normalizeHeader(MessageInterface $message, $header) + { + $h = $message->getHeaderAsArray($header); + for ($i = 0, $total = count($h); $i < $total; $i++) { + if (strpos($h[$i], ',') === false) { + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $h[$i]) as $v) { + $h[] = trim($v); + } + unset($h[$i]); + } + + return $h; + } + + /** + * Gets the start-line and headers of a message as a string + * + * @param MessageInterface $message + * + * @return string + */ + public static function getStartLineAndHeaders(MessageInterface $message) + { + return static::getStartLine($message) + . self::getHeadersAsString($message); + } + + /** + * Gets the headers of a message as a string + * + * @param MessageInterface $message + * + * @return string + */ + public static function getHeadersAsString(MessageInterface $message) + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= "\r\n{$name}: " . implode(', ', $values); + } + + return $result; + } + + /** + * Gets the start line of a message + * + * @param MessageInterface $message + * + * @return string + * @throws \InvalidArgumentException + */ + public static function getStartLine(MessageInterface $message) + { + if ($message instanceof RequestInterface) { + return trim($message->getMethod() . ' ' + . $message->getResource()) + . ' HTTP/' . $message->getProtocolVersion(); + } elseif ($message instanceof ResponseInterface) { + return 'HTTP/' . $message->getProtocolVersion() . ' ' + . $message->getStatusCode() . ' ' + . $message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + } + + /** + * Accepts and modifies the options provided to the message in the + * constructor. + * + * Can be overridden in subclasses as necessary. + * + * @param array $options Options array passed by reference. + */ + protected function handleOptions(array &$options) + { + if (isset($options['protocol_version'])) { + $this->protocolVersion = $options['protocol_version']; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php new file mode 100644 index 00000000000..ca42f20f309 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/AppliesHeadersInterface.php @@ -0,0 +1,24 @@ +then($onFulfilled, $onRejected, $onProgress), + [$future, 'wait'], + [$future, 'cancel'] + ); + } + + public function getStatusCode() + { + return $this->_value->getStatusCode(); + } + + public function setStatusCode($code) + { + $this->_value->setStatusCode($code); + } + + public function getReasonPhrase() + { + return $this->_value->getReasonPhrase(); + } + + public function setReasonPhrase($phrase) + { + $this->_value->setReasonPhrase($phrase); + } + + public function getEffectiveUrl() + { + return $this->_value->getEffectiveUrl(); + } + + public function setEffectiveUrl($url) + { + $this->_value->setEffectiveUrl($url); + } + + public function json(array $config = []) + { + return $this->_value->json($config); + } + + public function xml(array $config = []) + { + return $this->_value->xml($config); + } + + public function __toString() + { + try { + return $this->_value->__toString(); + } catch (\Exception $e) { + trigger_error($e->getMessage(), E_USER_WARNING); + return ''; + } + } + + public function getProtocolVersion() + { + return $this->_value->getProtocolVersion(); + } + + public function setBody(StreamInterface $body = null) + { + $this->_value->setBody($body); + } + + public function getBody() + { + return $this->_value->getBody(); + } + + public function getHeaders() + { + return $this->_value->getHeaders(); + } + + public function getHeader($header) + { + return $this->_value->getHeader($header); + } + + public function getHeaderAsArray($header) + { + return $this->_value->getHeaderAsArray($header); + } + + public function hasHeader($header) + { + return $this->_value->hasHeader($header); + } + + public function removeHeader($header) + { + $this->_value->removeHeader($header); + } + + public function addHeader($header, $value) + { + $this->_value->addHeader($header, $value); + } + + public function addHeaders(array $headers) + { + $this->_value->addHeaders($headers); + } + + public function setHeader($header, $value) + { + $this->_value->setHeader($header, $value); + } + + public function setHeaders(array $headers) + { + $this->_value->setHeaders($headers); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php new file mode 100644 index 00000000000..b366d6d318c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php @@ -0,0 +1,364 @@ + 1, 'timeout' => 1, 'verify' => 1, 'ssl_key' => 1, + 'cert' => 1, 'proxy' => 1, 'debug' => 1, 'save_to' => 1, 'stream' => 1, + 'expect' => 1, 'future' => 1 + ]; + + /** @var array Default allow_redirects request option settings */ + private static $defaultRedirect = [ + 'max' => 5, + 'strict' => false, + 'referer' => false, + 'protocols' => ['http', 'https'] + ]; + + /** + * @param array $customOptions Associative array of custom request option + * names mapping to functions used to apply + * the option. The function accepts the request + * and the option value to apply. + */ + public function __construct(array $customOptions = []) + { + $this->errorPlugin = new HttpError(); + $this->redirectPlugin = new Redirect(); + $this->customOptions = $customOptions; + } + + public function createResponse( + $statusCode, + array $headers = [], + $body = null, + array $options = [] + ) { + if (null !== $body) { + $body = Stream::factory($body); + } + + return new Response($statusCode, $headers, $body, $options); + } + + public function createRequest($method, $url, array $options = []) + { + // Handle the request protocol version option that needs to be + // specified in the request constructor. + if (isset($options['version'])) { + $options['config']['protocol_version'] = $options['version']; + unset($options['version']); + } + + $request = new Request($method, $url, [], null, + isset($options['config']) ? $options['config'] : []); + + unset($options['config']); + + // Use a POST body by default + if (strtoupper($method) == 'POST' + && !isset($options['body']) + && !isset($options['json']) + ) { + $options['body'] = []; + } + + if ($options) { + $this->applyOptions($request, $options); + } + + return $request; + } + + /** + * Create a request or response object from an HTTP message string + * + * @param string $message Message to parse + * + * @return RequestInterface|ResponseInterface + * @throws \InvalidArgumentException if unable to parse a message + */ + public function fromMessage($message) + { + static $parser; + if (!$parser) { + $parser = new MessageParser(); + } + + // Parse a response + if (strtoupper(substr($message, 0, 4)) == 'HTTP') { + $data = $parser->parseResponse($message); + return $this->createResponse( + $data['code'], + $data['headers'], + $data['body'] === '' ? null : $data['body'], + $data + ); + } + + // Parse a request + if (!($data = ($parser->parseRequest($message)))) { + throw new \InvalidArgumentException('Unable to parse request'); + } + + return $this->createRequest( + $data['method'], + Url::buildUrl($data['request_url']), + [ + 'headers' => $data['headers'], + 'body' => $data['body'] === '' ? null : $data['body'], + 'config' => [ + 'protocol_version' => $data['protocol_version'] + ] + ] + ); + } + + /** + * Apply POST fields and files to a request to attempt to give an accurate + * representation. + * + * @param RequestInterface $request Request to update + * @param array $body Body to apply + */ + protected function addPostData(RequestInterface $request, array $body) + { + static $fields = ['string' => true, 'array' => true, 'NULL' => true, + 'boolean' => true, 'double' => true, 'integer' => true]; + + $post = new PostBody(); + foreach ($body as $key => $value) { + if (isset($fields[gettype($value)])) { + $post->setField($key, $value); + } elseif ($value instanceof PostFileInterface) { + $post->addFile($value); + } else { + $post->addFile(new PostFile($key, $value)); + } + } + + if ($request->getHeader('Content-Type') == 'multipart/form-data') { + $post->forceMultipartUpload(true); + } + + $request->setBody($post); + } + + protected function applyOptions( + RequestInterface $request, + array $options = [] + ) { + $config = $request->getConfig(); + $emitter = $request->getEmitter(); + + foreach ($options as $key => $value) { + + if (isset(self::$configMap[$key])) { + $config[$key] = $value; + continue; + } + + switch ($key) { + + case 'allow_redirects': + + if ($value === false) { + continue 2; + } + + if ($value === true) { + $value = self::$defaultRedirect; + } elseif (!is_array($value)) { + throw new Iae('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $value += self::$defaultRedirect; + } + + $config['redirect'] = $value; + $emitter->attach($this->redirectPlugin); + break; + + case 'decode_content': + + if ($value === false) { + continue 2; + } + + $config['decode_content'] = true; + if ($value !== true) { + $request->setHeader('Accept-Encoding', $value); + } + break; + + case 'headers': + + if (!is_array($value)) { + throw new Iae('header value must be an array'); + } + foreach ($value as $k => $v) { + $request->setHeader($k, $v); + } + break; + + case 'exceptions': + + if ($value === true) { + $emitter->attach($this->errorPlugin); + } + break; + + case 'body': + + if (is_array($value)) { + $this->addPostData($request, $value); + } elseif ($value !== null) { + $request->setBody(Stream::factory($value)); + } + break; + + case 'auth': + + if (!$value) { + continue 2; + } + + if (is_array($value)) { + $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; + } else { + $type = strtolower($value); + } + + $config['auth'] = $value; + + if ($type == 'basic') { + $request->setHeader( + 'Authorization', + 'Basic ' . base64_encode("$value[0]:$value[1]") + ); + } elseif ($type == 'digest') { + // @todo: Do not rely on curl + $config->setPath('curl/' . CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); + $config->setPath('curl/' . CURLOPT_USERPWD, "$value[0]:$value[1]"); + } + break; + + case 'query': + + if ($value instanceof Query) { + $original = $request->getQuery(); + // Do not overwrite existing query string variables by + // overwriting the object with the query string data passed + // in the URL + $value->overwriteWith($original->toArray()); + $request->setQuery($value); + } elseif (is_array($value)) { + // Do not overwrite existing query string variables + $query = $request->getQuery(); + foreach ($value as $k => $v) { + if (!isset($query[$k])) { + $query[$k] = $v; + } + } + } else { + throw new Iae('query must be an array or Query object'); + } + break; + + case 'cookies': + + if ($value === true) { + static $cookie = null; + if (!$cookie) { + $cookie = new Cookie(); + } + $emitter->attach($cookie); + } elseif (is_array($value)) { + $emitter->attach( + new Cookie(CookieJar::fromArray($value, $request->getHost())) + ); + } elseif ($value instanceof CookieJarInterface) { + $emitter->attach(new Cookie($value)); + } elseif ($value !== false) { + throw new Iae('cookies must be an array, true, or CookieJarInterface'); + } + break; + + case 'events': + + if (!is_array($value)) { + throw new Iae('events must be an array'); + } + + $this->attachListeners($request, + $this->prepareListeners( + $value, + ['before', 'complete', 'error', 'progress', 'end'] + ) + ); + break; + + case 'subscribers': + + if (!is_array($value)) { + throw new Iae('subscribers must be an array'); + } + + foreach ($value as $subscribers) { + $emitter->attach($subscribers); + } + break; + + case 'json': + + $request->setBody(Stream::factory(json_encode($value))); + if (!$request->hasHeader('Content-Type')) { + $request->setHeader('Content-Type', 'application/json'); + } + break; + + default: + + // Check for custom handler functions. + if (isset($this->customOptions[$key])) { + $fn = $this->customOptions[$key]; + $fn($request, $value); + continue 2; + } + + throw new Iae("No method can handle the {$key} config key"); + } + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php new file mode 100644 index 00000000000..86ae9c7ee0c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageFactoryInterface.php @@ -0,0 +1,71 @@ +getHeaders() as $name => $values) { + * echo $name . ": " . implode(", ", $values); + * } + * + * @return array Returns an associative array of the message's headers. + */ + public function getHeaders(); + + /** + * Retrieve a header by the given case-insensitive name. + * + * @param string $header Case-insensitive header name. + * + * @return string + */ + public function getHeader($header); + + /** + * Retrieves a header by the given case-insensitive name as an array of strings. + * + * @param string $header Case-insensitive header name. + * + * @return string[] + */ + public function getHeaderAsArray($header); + + /** + * Checks if a header exists by the given case-insensitive name. + * + * @param string $header Case-insensitive header name. + * + * @return bool Returns true if any header names match the given header + * name using a case-insensitive string comparison. Returns false if + * no matching header name is found in the message. + */ + public function hasHeader($header); + + /** + * Remove a specific header by case-insensitive name. + * + * @param string $header Case-insensitive header name. + */ + public function removeHeader($header); + + /** + * Appends a header value to any existing values associated with the + * given header name. + * + * @param string $header Header name to add + * @param string $value Value of the header + */ + public function addHeader($header, $value); + + /** + * Merges in an associative array of headers. + * + * Each array key MUST be a string representing the case-insensitive name + * of a header. Each value MUST be either a string or an array of strings. + * For each value, the value is appended to any existing header of the same + * name, or, if a header does not already exist by the given name, then the + * header is added. + * + * @param array $headers Associative array of headers to add to the message + */ + public function addHeaders(array $headers); + + /** + * Sets a header, replacing any existing values of any headers with the + * same case-insensitive name. + * + * The header values MUST be a string or an array of strings. + * + * @param string $header Header name + * @param string|array $value Header value(s) + */ + public function setHeader($header, $value); + + /** + * Sets headers, replacing any headers that have already been set on the + * message. + * + * The array keys MUST be a string. The array values must be either a + * string or an array of strings. + * + * @param array $headers Headers to set. + */ + public function setHeaders(array $headers); +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageParser.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageParser.php new file mode 100644 index 00000000000..c3cc195e329 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/MessageParser.php @@ -0,0 +1,171 @@ +parseMessage($message))) { + return false; + } + + // Parse the protocol and protocol version + if (isset($parts['start_line'][2])) { + $startParts = explode('/', $parts['start_line'][2]); + $protocol = strtoupper($startParts[0]); + $version = isset($startParts[1]) ? $startParts[1] : '1.1'; + } else { + $protocol = 'HTTP'; + $version = '1.1'; + } + + $parsed = [ + 'method' => strtoupper($parts['start_line'][0]), + 'protocol' => $protocol, + 'protocol_version' => $version, + 'headers' => $parts['headers'], + 'body' => $parts['body'] + ]; + + $parsed['request_url'] = $this->getUrlPartsFromMessage( + (isset($parts['start_line'][1]) ? $parts['start_line'][1] : ''), $parsed); + + return $parsed; + } + + /** + * Parse an HTTP response message into an associative array of parts. + * + * @param string $message HTTP response to parse + * + * @return array|bool Returns false if the message is invalid + */ + public function parseResponse($message) + { + if (!($parts = $this->parseMessage($message))) { + return false; + } + + list($protocol, $version) = explode('/', trim($parts['start_line'][0])); + + return [ + 'protocol' => $protocol, + 'protocol_version' => $version, + 'code' => $parts['start_line'][1], + 'reason_phrase' => isset($parts['start_line'][2]) ? $parts['start_line'][2] : '', + 'headers' => $parts['headers'], + 'body' => $parts['body'] + ]; + } + + /** + * Parse a message into parts + * + * @param string $message Message to parse + * + * @return array|bool + */ + private function parseMessage($message) + { + if (!$message) { + return false; + } + + $startLine = null; + $headers = []; + $body = ''; + + // Iterate over each line in the message, accounting for line endings + $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE); + for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) { + + $line = $lines[$i]; + + // If two line breaks were encountered, then this is the end of body + if (empty($line)) { + if ($i < $totalLines - 1) { + $body = implode('', array_slice($lines, $i + 2)); + } + break; + } + + // Parse message headers + if (!$startLine) { + $startLine = explode(' ', $line, 3); + } elseif (strpos($line, ':')) { + $parts = explode(':', $line, 2); + $key = trim($parts[0]); + $value = isset($parts[1]) ? trim($parts[1]) : ''; + if (!isset($headers[$key])) { + $headers[$key] = $value; + } elseif (!is_array($headers[$key])) { + $headers[$key] = [$headers[$key], $value]; + } else { + $headers[$key][] = $value; + } + } + } + + return [ + 'start_line' => $startLine, + 'headers' => $headers, + 'body' => $body + ]; + } + + /** + * Create URL parts from HTTP message parts + * + * @param string $requestUrl Associated URL + * @param array $parts HTTP message parts + * + * @return array + */ + private function getUrlPartsFromMessage($requestUrl, array $parts) + { + // Parse the URL information from the message + $urlParts = ['path' => $requestUrl, 'scheme' => 'http']; + + // Check for the Host header + if (isset($parts['headers']['Host'])) { + $urlParts['host'] = $parts['headers']['Host']; + } elseif (isset($parts['headers']['host'])) { + $urlParts['host'] = $parts['headers']['host']; + } else { + $urlParts['host'] = null; + } + + if (false === strpos($urlParts['host'], ':')) { + $urlParts['port'] = ''; + } else { + $hostParts = explode(':', $urlParts['host']); + $urlParts['host'] = trim($hostParts[0]); + $urlParts['port'] = (int) trim($hostParts[1]); + if ($urlParts['port'] == 443) { + $urlParts['scheme'] = 'https'; + } + } + + // Check if a query is present + $path = $urlParts['path']; + $qpos = strpos($path, '?'); + if ($qpos) { + $urlParts['query'] = substr($path, $qpos + 1); + $urlParts['path'] = substr($path, 0, $qpos); + } else { + $urlParts['query'] = ''; + } + + return $urlParts; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/Request.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/Request.php new file mode 100644 index 00000000000..38714af80fe --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/Request.php @@ -0,0 +1,195 @@ +setUrl($url); + $this->method = strtoupper($method); + $this->handleOptions($options); + $this->transferOptions = new Collection($options); + $this->addPrepareEvent(); + + if ($body !== null) { + $this->setBody($body); + } + + if ($headers) { + foreach ($headers as $key => $value) { + $this->addHeader($key, $value); + } + } + } + + public function __clone() + { + if ($this->emitter) { + $this->emitter = clone $this->emitter; + } + $this->transferOptions = clone $this->transferOptions; + $this->url = clone $this->url; + } + + public function setUrl($url) + { + $this->url = $url instanceof Url ? $url : Url::fromString($url); + $this->updateHostHeaderFromUrl(); + } + + public function getUrl() + { + return (string) $this->url; + } + + public function setQuery($query) + { + $this->url->setQuery($query); + } + + public function getQuery() + { + return $this->url->getQuery(); + } + + public function setMethod($method) + { + $this->method = strtoupper($method); + } + + public function getMethod() + { + return $this->method; + } + + public function getScheme() + { + return $this->url->getScheme(); + } + + public function setScheme($scheme) + { + $this->url->setScheme($scheme); + } + + public function getPort() + { + return $this->url->getPort(); + } + + public function setPort($port) + { + $this->url->setPort($port); + $this->updateHostHeaderFromUrl(); + } + + public function getHost() + { + return $this->url->getHost(); + } + + public function setHost($host) + { + $this->url->setHost($host); + $this->updateHostHeaderFromUrl(); + } + + public function getPath() + { + return '/' . ltrim($this->url->getPath(), '/'); + } + + public function setPath($path) + { + $this->url->setPath($path); + } + + public function getResource() + { + $resource = $this->getPath(); + if ($query = (string) $this->url->getQuery()) { + $resource .= '?' . $query; + } + + return $resource; + } + + public function getConfig() + { + return $this->transferOptions; + } + + protected function handleOptions(array &$options) + { + parent::handleOptions($options); + // Use a custom emitter if one is specified, and remove it from + // options that are exposed through getConfig() + if (isset($options['emitter'])) { + $this->emitter = $options['emitter']; + unset($options['emitter']); + } + } + + /** + * Adds a subscriber that ensures a request's body is prepared before + * sending. + */ + private function addPrepareEvent() + { + static $subscriber; + if (!$subscriber) { + $subscriber = new Prepare(); + } + + $this->getEmitter()->attach($subscriber); + } + + private function updateHostHeaderFromUrl() + { + $port = $this->url->getPort(); + $scheme = $this->url->getScheme(); + if ($host = $this->url->getHost()) { + if (($port == 80 && $scheme == 'http') || + ($port == 443 && $scheme == 'https') + ) { + $this->setHeader('Host', $host); + } else { + $this->setHeader('Host', "{$host}:{$port}"); + } + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/RequestInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/RequestInterface.php new file mode 100644 index 00000000000..f6a69d1e1f1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/RequestInterface.php @@ -0,0 +1,136 @@ + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-Status', + 208 => 'Already Reported', + 226 => 'IM Used', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 307 => 'Temporary Redirect', + 308 => 'Permanent Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Reserved for WebDAV advanced collections expired proposal', + 426 => 'Upgrade required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported', + 506 => 'Variant Also Negotiates (Experimental)', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 510 => 'Not Extended', + 511 => 'Network Authentication Required', + ]; + + /** @var string The reason phrase of the response (human readable code) */ + private $reasonPhrase; + + /** @var string The status code of the response */ + private $statusCode; + + /** @var string The effective URL that returned this response */ + private $effectiveUrl; + + /** + * @param int|string $statusCode The response status code (e.g. 200) + * @param array $headers The response headers + * @param StreamInterface $body The body of the response + * @param array $options Response message options + * - reason_phrase: Set a custom reason phrase + * - protocol_version: Set a custom protocol version + */ + public function __construct( + $statusCode, + array $headers = [], + StreamInterface $body = null, + array $options = [] + ) { + $this->statusCode = (int) $statusCode; + $this->handleOptions($options); + + // Assume a reason phrase if one was not applied as an option + if (!$this->reasonPhrase && + isset(self::$statusTexts[$this->statusCode]) + ) { + $this->reasonPhrase = self::$statusTexts[$this->statusCode]; + } + + if ($headers) { + $this->setHeaders($headers); + } + + if ($body) { + $this->setBody($body); + } + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function setStatusCode($code) + { + return $this->statusCode = (int) $code; + } + + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + public function setReasonPhrase($phrase) + { + return $this->reasonPhrase = $phrase; + } + + public function json(array $config = []) + { + try { + return Utils::jsonDecode( + (string) $this->getBody(), + isset($config['object']) ? !$config['object'] : true, + 512, + isset($config['big_int_strings']) ? JSON_BIGINT_AS_STRING : 0 + ); + } catch (\InvalidArgumentException $e) { + throw new ParseException( + $e->getMessage(), + $this + ); + } + } + + public function xml(array $config = []) + { + $disableEntities = libxml_disable_entity_loader(true); + $internalErrors = libxml_use_internal_errors(true); + + try { + // Allow XML to be retrieved even if there is no response body + $xml = new \SimpleXMLElement( + (string) $this->getBody() ?: '', + isset($config['libxml_options']) ? $config['libxml_options'] : LIBXML_NONET, + false, + isset($config['ns']) ? $config['ns'] : '', + isset($config['ns_is_prefix']) ? $config['ns_is_prefix'] : false + ); + libxml_disable_entity_loader($disableEntities); + libxml_use_internal_errors($internalErrors); + } catch (\Exception $e) { + libxml_disable_entity_loader($disableEntities); + libxml_use_internal_errors($internalErrors); + throw new XmlParseException( + 'Unable to parse response body into XML: ' . $e->getMessage(), + $this, + $e, + (libxml_get_last_error()) ?: null + ); + } + + return $xml; + } + + public function getEffectiveUrl() + { + return $this->effectiveUrl; + } + + public function setEffectiveUrl($url) + { + $this->effectiveUrl = $url; + } + + /** + * Accepts and modifies the options provided to the response in the + * constructor. + * + * @param array $options Options array passed by reference. + */ + protected function handleOptions(array &$options = []) + { + parent::handleOptions($options); + if (isset($options['reason_phrase'])) { + $this->reasonPhrase = $options['reason_phrase']; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/ResponseInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/ResponseInterface.php new file mode 100644 index 00000000000..c0ae9be93b6 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Message/ResponseInterface.php @@ -0,0 +1,111 @@ + 'text/vnd.in3d.3dml', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gpp', + '7z' => 'application/x-7z-compressed', + 'aab' => 'application/x-authorware-bin', + 'aac' => 'audio/x-aac', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abw' => 'application/x-abiword', + 'ac' => 'application/pkix-attr-cert', + 'acc' => 'application/vnd.americandynamics.acc', + 'ace' => 'application/x-ace-compressed', + 'acu' => 'application/vnd.acucobol', + 'acutc' => 'application/vnd.acucorp', + 'adp' => 'audio/adpcm', + 'aep' => 'application/vnd.audiograph', + 'afm' => 'application/x-font-type1', + 'afp' => 'application/vnd.ibm.modcap', + 'ahead' => 'application/vnd.ahead.space', + 'ai' => 'application/postscript', + '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', + 'apk' => 'application/vnd.android.package-archive', + 'application' => 'application/x-ms-application', + 'apr' => 'application/vnd.lotus-approach', + 'asa' => 'text/plain', + 'asax' => 'application/octet-stream', + 'asc' => 'application/pgp-signature', + 'ascx' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'ashx' => 'text/plain', + 'asm' => 'text/x-asm', + 'asmx' => 'text/plain', + 'aso' => 'application/vnd.accpac.simply.aso', + 'asp' => 'text/plain', + 'aspx' => 'text/plain', + 'asx' => 'video/x-ms-asf', + 'atc' => 'application/vnd.acucorp', + 'atom' => 'application/atom+xml', + 'atomcat' => 'application/atomcat+xml', + 'atomsvc' => 'application/atomsvc+xml', + 'atx' => 'application/vnd.antix.game-component', + 'au' => 'audio/basic', + 'avi' => 'video/x-msvideo', + 'aw' => 'application/applixware', + 'axd' => 'text/plain', + 'azf' => 'application/vnd.airzip.filesecure.azf', + 'azs' => 'application/vnd.airzip.filesecure.azs', + 'azw' => 'application/vnd.amazon.ebook', + 'bat' => 'application/x-msdownload', + 'bcpio' => 'application/x-bcpio', + 'bdf' => 'application/x-font-bdf', + 'bdm' => 'application/vnd.syncml.dm+wbxml', + 'bed' => 'application/vnd.realvnc.bed', + 'bh2' => 'application/vnd.fujitsu.oasysprs', + 'bin' => 'application/octet-stream', + 'bmi' => 'application/vnd.bmi', + 'bmp' => 'image/bmp', + 'book' => 'application/vnd.framemaker', + 'box' => 'application/vnd.previewsystems.box', + 'boz' => 'application/x-bzip2', + 'bpk' => 'application/octet-stream', + 'btif' => 'image/prs.btif', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', + 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', + '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', + 'cab' => 'application/vnd.ms-cab-compressed', + 'car' => 'application/vnd.curl.car', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cc' => 'text/x-c', + 'cct' => 'application/x-director', + 'ccxml' => 'application/ccxml+xml', + 'cdbcmsg' => 'application/vnd.contact.cmsg', + 'cdf' => 'application/x-netcdf', + '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', + 'cdx' => 'chemical/x-cdx', + 'cdxml' => 'application/vnd.chemdraw+xml', + 'cdy' => 'application/vnd.cinderella', + 'cer' => 'application/pkix-cert', + 'cfc' => 'application/x-coldfusion', + 'cfm' => 'application/x-coldfusion', + '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', + 'cla' => 'application/vnd.claymore', + 'class' => 'application/java-vm', + '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', + 'com' => 'application/x-msdownload', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpp' => 'text/x-c', + 'cpt' => 'application/mac-compactpro', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'cryptonote' => 'application/vnd.rig.cryptonote', + 'cs' => 'text/plain', + 'csh' => 'application/x-csh', + 'csml' => 'chemical/x-csml', + 'csp' => 'application/vnd.commonspace', + 'css' => 'text/css', + 'cst' => 'application/x-director', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'curl' => 'text/vnd.curl', + 'cww' => 'application/prs.cww', + 'cxt' => 'application/x-director', + 'cxx' => 'text/x-c', + 'dae' => 'model/vnd.collada+xml', + 'daf' => 'application/vnd.mobius.daf', + 'dataless' => 'application/vnd.fdsn.seed', + 'davmount' => 'application/davmount+xml', + 'dcr' => 'application/x-director', + 'dcurl' => 'text/vnd.curl.dcurl', + 'dd2' => 'application/vnd.oma.dd2+xml', + 'ddd' => 'application/vnd.fujixerox.ddd', + 'deb' => 'application/x-debian-package', + 'def' => 'text/plain', + 'deploy' => 'application/octet-stream', + 'der' => 'application/x-x509-ca-cert', + 'dfac' => 'application/vnd.dreamfactory', + 'dic' => 'text/x-c', + 'dir' => 'application/x-director', + 'dis' => 'application/vnd.mobius.dis', + 'dist' => 'application/octet-stream', + 'distz' => 'application/octet-stream', + 'djv' => 'image/vnd.djvu', + 'djvu' => 'image/vnd.djvu', + 'dll' => 'application/x-msdownload', + 'dmg' => 'application/octet-stream', + 'dms' => 'application/octet-stream', + 'dna' => 'application/vnd.dna', + 'doc' => 'application/msword', + 'docm' => 'application/vnd.ms-word.document.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', + 'dra' => 'audio/vnd.dra', + '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', + 'dvi' => 'application/x-dvi', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/vnd.dwg', + 'dxf' => 'image/vnd.dxf', + 'dxp' => 'application/vnd.spotfire.dxp', + 'dxr' => 'application/x-director', + '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', + 'eml' => 'message/rfc822', + 'emma' => 'application/emma+xml', + 'eol' => 'audio/vnd.digital-winds', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'es3' => 'application/vnd.eszigno3+xml', + 'esf' => 'application/vnd.epson.esf', + 'et3' => 'application/vnd.eszigno3+xml', + 'etx' => 'text/x-setext', + 'exe' => 'application/x-msdownload', + 'exi' => 'application/exi', + '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/x-f4v', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fbs' => 'image/vnd.fastbidsheet', + 'fcs' => 'application/vnd.isac.fcs', + 'fdf' => 'application/vnd.fdf', + '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', + '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', + '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', + 'gdl' => 'model/vnd.gdl', + 'geo' => 'application/vnd.dynageo', + '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', + 'gmx' => 'application/vnd.gmx', + 'gnumeric' => 'application/x-gnumeric', + 'gph' => 'application/vnd.flographit', + 'gqf' => 'application/vnd.grafeq', + 'gqs' => 'application/vnd.grafeq', + 'gram' => 'application/srgs', + 'gre' => 'application/vnd.geometry-explorer', + 'grv' => 'application/vnd.groove-injector', + 'grxml' => 'application/srgs+xml', + 'gsf' => 'application/x-font-ghostscript', + 'gtar' => 'application/x-gtar', + 'gtm' => 'application/vnd.groove-tool-message', + 'gtw' => 'model/vnd.gtw', + 'gv' => 'text/vnd.graphviz', + 'gxt' => 'application/vnd.geonext', + 'h' => 'text/x-c', + 'h261' => 'video/h261', + 'h263' => 'video/h263', + 'h264' => 'video/h264', + 'hal' => 'application/vnd.hal+xml', + 'hbci' => 'application/vnd.hbci', + 'hdf' => 'application/x-hdf', + 'hh' => 'text/x-c', + 'hlp' => 'application/winhlp', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hpid' => 'application/vnd.hp-hpid', + 'hps' => 'application/vnd.hp-hps', + 'hqx' => 'application/mac-binhex40', + 'hta' => 'application/octet-stream', + 'htc' => 'text/html', + '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', + 'imp' => 'application/vnd.accpac.simply.imp', + 'ims' => 'application/vnd.ms-ims', + 'in' => 'text/plain', + 'ini' => 'text/plain', + 'ipfix' => 'application/ipfix', + 'ipk' => 'application/vnd.shana.informed.package', + 'irm' => 'application/vnd.ibm.rights-management', + 'irp' => 'application/vnd.irepository.package+xml', + 'iso' => 'application/octet-stream', + 'itp' => 'application/vnd.shana.informed.formtemplate', + 'ivp' => 'application/vnd.immervision-ivp', + 'ivu' => 'application/vnd.immervision-ivu', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jam' => 'application/vnd.jam', + 'jar' => 'application/java-archive', + 'java' => 'text/x-java-source', + 'jisp' => 'application/vnd.jisp', + 'jlt' => 'application/vnd.hp-jlyt', + 'jnlp' => 'application/x-java-jnlp-file', + 'joda' => 'application/vnd.joost.joda-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'jpgm' => 'video/jpm', + 'jpgv' => 'video/jpeg', + 'jpm' => 'video/jpm', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'kar' => 'audio/midi', + 'karbon' => 'application/vnd.kde.karbon', + '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', + 'ksp' => 'application/vnd.kde.kspread', + 'ktr' => 'application/vnd.kahootz', + 'ktx' => 'image/ktx', + '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', + 'lha' => 'application/octet-stream', + 'link66' => 'application/vnd.route66.link66+xml', + 'list' => 'text/plain', + 'list3820' => 'application/vnd.ibm.modcap', + 'listafp' => 'application/vnd.ibm.modcap', + 'log' => 'text/plain', + 'lostxml' => 'application/lost+xml', + 'lrf' => 'application/octet-stream', + 'lrm' => 'application/vnd.ms-lrm', + 'ltf' => 'application/vnd.frogans.ltf', + 'lvp' => 'audio/vnd.lucent.voice', + 'lwp' => 'application/vnd.lotus-wordpro', + 'lzh' => 'application/octet-stream', + 'm13' => 'application/x-msmediaview', + 'm14' => 'application/x-msmediaview', + 'm1v' => 'video/mpeg', + 'm21' => 'application/mp21', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3a' => 'audio/mpeg', + 'm3u' => 'audio/x-mpegurl', + 'm3u8' => 'application/vnd.apple.mpegurl', + 'm4a' => 'audio/mp4', + 'm4u' => 'video/vnd.mpegurl', + 'm4v' => 'video/mp4', + 'ma' => 'application/mathematica', + 'mads' => 'application/mads+xml', + 'mag' => 'application/vnd.ecowin.chart', + 'maker' => 'application/vnd.framemaker', + 'man' => 'text/troff', + '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', + 'mdb' => 'application/x-msaccess', + 'mdi' => 'image/vnd.ms-modi', + 'me' => 'text/troff', + 'mesh' => 'model/mesh', + 'meta4' => 'application/metalink4+xml', + 'mets' => 'application/mets+xml', + 'mfm' => 'application/vnd.mfmp', + 'mgp' => 'application/vnd.osgeo.mapguide.package', + 'mgz' => 'application/vnd.proteus.magazine', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mif' => 'application/vnd.mif', + 'mime' => 'message/rfc822', + 'mj2' => 'video/mj2', + 'mjp2' => 'video/mj2', + 'mlp' => 'application/vnd.dolby.mlp', + 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', + 'mmf' => 'application/vnd.smaf', + 'mmr' => 'image/vnd.fujixerox.edmics-mmr', + 'mny' => 'application/x-msmoney', + 'mobi' => 'application/x-mobipocket-ebook', + 'mods' => 'application/mods+xml', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp21' => 'application/mp21', + 'mp2a' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4s' => 'application/mp4', + 'mp4v' => 'video/mp4', + 'mpc' => 'application/vnd.mophun.certificate', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + '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', + 'msh' => 'model/mesh', + 'msi' => 'application/x-msdownload', + 'msl' => 'application/vnd.mobius.msl', + 'msty' => 'application/vnd.muvee.style', + 'mts' => 'model/vnd.mts', + 'mus' => 'application/vnd.musician', + 'musicxml' => 'application/vnd.recordare.musicxml+xml', + 'mvb' => 'application/x-msmediaview', + 'mwf' => 'application/vnd.mfer', + 'mxf' => 'application/mxf', + 'mxl' => 'application/vnd.recordare.musicxml', + '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', + 'ngdat' => 'application/vnd.nokia.n-gage.data', + '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', + 'nsf' => 'application/vnd.lotus-notes', + 'oa2' => 'application/vnd.fujitsu.oasys2', + 'oa3' => 'application/vnd.fujitsu.oasys3', + 'oas' => 'application/vnd.fujitsu.oasys', + 'obd' => 'application/x-msbinder', + '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', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'onepkg' => 'application/onenote', + 'onetmp' => 'application/onenote', + 'onetoc' => 'application/onenote', + 'onetoc2' => 'application/onenote', + 'opf' => 'application/oebps-package+xml', + 'oprc' => 'application/vnd.palm', + 'org' => 'application/vnd.lotus-organizer', + 'osf' => 'application/vnd.yamaha.openscoreformat', + 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', + 'otc' => 'application/vnd.oasis.opendocument.chart-template', + 'otf' => 'application/x-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', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'p' => 'text/x-pascal', + 'p10' => 'application/pkcs10', + 'p12' => 'application/x-pkcs12', + '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', + 'pas' => 'text/x-pascal', + 'paw' => 'application/vnd.pawaafile', + 'pbd' => 'application/vnd.powerbuilder6', + 'pbm' => 'image/x-portable-bitmap', + '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/vnd.palm', + 'pdf' => 'application/pdf', + '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-encrypted', + 'php' => 'text/x-php', + 'phps' => 'application/x-httpd-phps', + 'pic' => 'image/x-pict', + 'pkg' => 'application/octet-stream', + 'pki' => 'application/pkixcmp', + 'pkipath' => 'application/pkix-pkipath', + 'plb' => 'application/vnd.3gpp.pic-bw-large', + 'plc' => 'application/vnd.mobius.plc', + 'plf' => 'application/vnd.pocketlearn', + 'pls' => 'application/pls+xml', + '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.template.macroenabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + '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/vnd.ms-powerpoint', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pqa' => 'application/vnd.palm', + 'prc' => 'application/x-mobipocket-ebook', + 'pre' => 'application/vnd.lotus-freelance', + 'prf' => 'application/pics-rules', + 'ps' => 'application/postscript', + 'psb' => 'application/vnd.3gpp.pic-bw-small', + 'psd' => 'image/vnd.adobe.photoshop', + 'psf' => 'application/x-font-linux-psf', + 'pskcxml' => 'application/pskc+xml', + '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', + '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-pn-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rb' => 'text/plain', + 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', + 'rdf' => 'application/rdf+xml', + 'rdz' => 'application/vnd.data-vision.rdz', + 'rep' => 'application/vnd.businessobjects', + 'res' => 'application/x-dtbresource+xml', + 'resx' => 'text/xml', + 'rgb' => 'image/x-rgb', + 'rif' => 'application/reginfo+xml', + 'rip' => 'audio/vnd.rip', + 'rl' => 'application/resource-lists+xml', + 'rlc' => 'image/vnd.fujixerox.edmics-rlc', + 'rld' => 'application/resource-lists-diff+xml', + 'rm' => 'application/vnd.rn-realmedia', + 'rmi' => 'audio/midi', + 'rmp' => 'audio/x-pn-realaudio-plugin', + 'rms' => 'application/vnd.jcp.javame.midlet-rms', + 'rnc' => 'application/relax-ng-compact-syntax', + 'roff' => 'text/troff', + 'rp9' => 'application/vnd.cloanto.rp9', + 'rpss' => 'application/vnd.nokia.radio-presets', + 'rpst' => 'application/vnd.nokia.radio-preset', + 'rq' => 'application/sparql-query', + 'rs' => 'application/rls-services+xml', + 'rsd' => 'application/rsd+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'rtx' => 'text/richtext', + 's' => 'text/x-asm', + 'saf' => 'application/vnd.yamaha.smaf-audio', + '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', + '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', + 'see' => 'application/vnd.seemail', + 'seed' => 'application/vnd.fdsn.seed', + 'sema' => 'application/vnd.sema', + 'semd' => 'application/vnd.semd', + 'semf' => 'application/vnd.semf', + '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', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'shf' => 'application/shf+xml', + 'sig' => 'application/pgp-signature', + 'silo' => 'model/mesh', + 'sis' => 'application/vnd.symbian.install', + 'sisx' => 'application/vnd.symbian.install', + 'sit' => 'application/x-stuffit', + 'sitx' => 'application/x-stuffitx', + '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', + 'slt' => 'application/vnd.epson.salt', + 'sm' => 'application/vnd.stepmania.stepchart', + 'smf' => 'application/vnd.stardivision.math', + 'smi' => 'application/smil+xml', + 'smil' => 'application/smil+xml', + 'snd' => 'audio/basic', + 'snf' => 'application/x-font-snf', + 'so' => 'application/octet-stream', + 'spc' => 'application/x-pkcs7-certificates', + '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', + 'src' => 'application/x-wais-source', + 'sru' => 'application/sru+xml', + 'srx' => 'application/sparql-results+xml', + 'sse' => 'application/vnd.kodak-descriptor', + 'ssf' => 'application/vnd.epson.ssf', + 'ssml' => 'application/ssml+xml', + 'st' => 'application/vnd.sailingtracker.track', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'stf' => 'application/vnd.wt.stf', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stk' => 'application/hyperstudio', + 'stl' => 'application/vnd.ms-pki.stl', + 'str' => 'application/vnd.pg.format', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'sub' => 'image/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', + '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', + 'tao' => 'application/vnd.tao.intent-module-archive', + 'tar' => 'application/x-tar', + 'tcap' => 'application/vnd.3gpp2.tcap', + 'tcl' => 'application/x-tcl', + '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', + 'thmx' => 'application/vnd.ms-officetheme', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tmo' => 'application/vnd.tmobile-livetv', + 'torrent' => 'application/x-bittorrent', + 'tpl' => 'application/vnd.groove-tool-template', + 'tpt' => 'application/vnd.trid.tpt', + 'tr' => 'text/troff', + 'tra' => 'application/vnd.trueapp', + 'trm' => 'application/x-msterminal', + 'tsd' => 'application/timestamped-data', + 'tsv' => 'text/tab-separated-values', + 'ttc' => 'application/x-font-ttf', + 'ttf' => 'application/x-font-ttf', + 'ttl' => 'text/turtle', + 'twd' => 'application/vnd.simtech-mindmapper', + 'twds' => 'application/vnd.simtech-mindmapper', + 'txd' => 'application/vnd.genomatix.tuxedo', + 'txf' => 'application/vnd.mobius.txf', + 'txt' => 'text/plain', + 'u32' => 'application/x-authorware-bin', + 'udeb' => 'application/x-debian-package', + 'ufd' => 'application/vnd.ufdl', + 'ufdl' => 'application/vnd.ufdl', + 'umj' => 'application/vnd.umajin', + 'unityweb' => 'application/vnd.unity', + 'uoml' => 'application/vnd.uoml+xml', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'urls' => 'text/uri-list', + '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', + 'uvx' => 'application/vnd.dece.unspecified', + 'vcd' => 'application/x-cdlink', + 'vcf' => 'text/x-vcard', + 'vcg' => 'application/vnd.groove-vcard', + 'vcs' => 'text/x-vcalendar', + 'vcx' => 'application/vnd.vcx', + 'vis' => 'application/vnd.visionary', + 'viv' => 'video/vnd.vivo', + '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', + 'vtu' => 'model/vnd.vtu', + 'vxml' => 'application/voicexml+xml', + 'w3d' => 'application/x-director', + 'wad' => 'application/x-doom', + 'wav' => 'audio/x-wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wbs' => 'application/vnd.criticaltools.wbs+xml', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wcm' => 'application/vnd.ms-works', + 'wdb' => 'application/vnd.ms-works', + 'weba' => 'audio/webm', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wg' => 'application/vnd.pmi.widget', + 'wgt' => 'application/widget', + 'wks' => 'application/vnd.ms-works', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'application/x-msmetafile', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-ms-wmz', + 'woff' => 'application/x-font-woff', + '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', + 'wsdl' => 'application/wsdl+xml', + 'wspolicy' => 'application/wspolicy+xml', + 'wtb' => 'application/vnd.webturbo', + 'wvx' => 'video/x-ms-wvx', + 'x32' => 'application/x-authorware-bin', + 'x3d' => 'application/vnd.hzn-3d-crossword', + 'xap' => 'application/x-silverlight-app', + 'xar' => 'application/vnd.xara', + 'xbap' => 'application/x-ms-xbap', + 'xbd' => 'application/vnd.fujixerox.docuworks.binder', + 'xbm' => 'image/x-xbitmap', + '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', + 'xenc' => 'application/xenc+xml', + 'xer' => 'application/patch-ops-error+xml', + 'xfdf' => 'application/vnd.adobe.xfdf', + 'xfdl' => 'application/vnd.xfdl', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'xhvml' => 'application/xv+xml', + 'xif' => 'image/vnd.xiff', + 'xla' => 'application/vnd.ms-excel', + 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', + 'xlc' => 'application/vnd.ms-excel', + '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', + 'xml' => 'application/xml', + 'xo' => 'application/vnd.olpc-sugar', + 'xop' => 'application/xop+xml', + 'xpi' => 'application/x-xpinstall', + 'xpm' => 'image/x-xpixmap', + 'xpr' => 'application/vnd.is-xpr', + 'xps' => 'application/vnd.ms-xpsdocument', + 'xpw' => 'application/vnd.intercon.formnet', + 'xpx' => 'application/vnd.intercon.formnet', + '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', + 'yaml' => 'text/yaml', + 'yang' => 'application/yang', + 'yin' => 'application/yin+xml', + 'yml' => 'text/yaml', + 'zaz' => 'application/vnd.zzazz.deck+xml', + 'zip' => 'application/zip', + 'zir' => 'application/vnd.zul', + 'zirz' => 'application/vnd.zul', + 'zmm' => 'application/vnd.handheld-entertainment+xml' + ); + + /** + * Get a singleton instance of the class + * + * @return self + * @codeCoverageIgnore + */ + public static function getInstance() + { + if (!self::$instance) { + self::$instance = new self(); + } + + return self::$instance; + } + + /** + * Get a mimetype value from a file extension + * + * @param string $extension File extension + * + * @return string|null + * + */ + public function fromExtension($extension) + { + $extension = strtolower($extension); + + return isset($this->mimetypes[$extension]) + ? $this->mimetypes[$extension] + : null; + } + + /** + * Get a mimetype from a filename + * + * @param string $filename Filename to generate a mimetype from + * + * @return string|null + */ + public function fromFilename($filename) + { + return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php new file mode 100644 index 00000000000..1149e623544 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php @@ -0,0 +1,109 @@ +boundary = $boundary ?: uniqid(); + $this->stream = $this->createStream($fields, $files); + } + + /** + * Get the boundary + * + * @return string + */ + public function getBoundary() + { + return $this->boundary; + } + + public function isWritable() + { + return false; + } + + /** + * Get the string needed to transfer a POST field + */ + private function getFieldString($name, $value) + { + return sprintf( + "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", + $this->boundary, + $name, + $value + ); + } + + /** + * Get the headers needed before transferring the content of a POST file + */ + private function getFileHeaders(PostFileInterface $file) + { + $headers = ''; + foreach ($file->getHeaders() as $key => $value) { + $headers .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n" . trim($headers) . "\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $fields, array $files) + { + $stream = new AppendStream(); + + foreach ($fields as $name => $fieldValues) { + foreach ((array) $fieldValues as $value) { + $stream->addStream( + Stream::factory($this->getFieldString($name, $value)) + ); + } + } + + foreach ($files as $file) { + + if (!$file instanceof PostFileInterface) { + throw new \InvalidArgumentException('All POST fields must ' + . 'implement PostFieldInterface'); + } + + $stream->addStream( + Stream::factory($this->getFileHeaders($file)) + ); + $stream->addStream($file->getContent()); + $stream->addStream(Stream::factory("\r\n")); + } + + // Add the trailing boundary with CRLF + $stream->addStream(Stream::factory("--{$this->boundary}--\r\n")); + + return $stream; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBody.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBody.php new file mode 100644 index 00000000000..ed14d1f7037 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBody.php @@ -0,0 +1,287 @@ +files || $this->forceMultipart) { + $request->setHeader( + 'Content-Type', + 'multipart/form-data; boundary=' . $this->getBody()->getBoundary() + ); + } elseif ($this->fields && !$request->hasHeader('Content-Type')) { + $request->setHeader( + 'Content-Type', + 'application/x-www-form-urlencoded' + ); + } + + if ($size = $this->getSize()) { + $request->setHeader('Content-Length', $size); + } + } + + public function forceMultipartUpload($force) + { + $this->forceMultipart = $force; + } + + public function setAggregator(callable $aggregator) + { + $this->aggregator = $aggregator; + } + + public function setField($name, $value) + { + $this->fields[$name] = $value; + $this->mutate(); + } + + public function replaceFields(array $fields) + { + $this->fields = $fields; + $this->mutate(); + } + + public function getField($name) + { + return isset($this->fields[$name]) ? $this->fields[$name] : null; + } + + public function removeField($name) + { + unset($this->fields[$name]); + $this->mutate(); + } + + public function getFields($asString = false) + { + if (!$asString) { + return $this->fields; + } + + $query = new Query($this->fields); + $query->setEncodingType(Query::RFC1738); + $query->setAggregator($this->getAggregator()); + + return (string) $query; + } + + public function hasField($name) + { + return isset($this->fields[$name]); + } + + public function getFile($name) + { + foreach ($this->files as $file) { + if ($file->getName() == $name) { + return $file; + } + } + + return null; + } + + public function getFiles() + { + return $this->files; + } + + public function addFile(PostFileInterface $file) + { + $this->files[] = $file; + $this->mutate(); + } + + public function clearFiles() + { + $this->files = []; + $this->mutate(); + } + + /** + * Returns the numbers of fields + files + * + * @return int + */ + public function count() + { + return count($this->files) + count($this->fields); + } + + public function __toString() + { + return (string) $this->getBody(); + } + + public function getContents($maxLength = -1) + { + return $this->getBody()->getContents(); + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->detached = true; + $this->fields = $this->files = []; + + if ($this->body) { + $this->body->close(); + $this->body = null; + } + } + + public function attach($stream) + { + throw new CannotAttachException(); + } + + public function eof() + { + return $this->getBody()->eof(); + } + + public function tell() + { + return $this->body ? $this->body->tell() : 0; + } + + public function isSeekable() + { + return true; + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return false; + } + + public function getSize() + { + return $this->getBody()->getSize(); + } + + public function seek($offset, $whence = SEEK_SET) + { + return $this->getBody()->seek($offset, $whence); + } + + public function read($length) + { + return $this->getBody()->read($length); + } + + public function write($string) + { + return false; + } + + public function getMetadata($key = null) + { + return $key ? null : []; + } + + /** + * Return a stream object that is built from the POST fields and files. + * + * If one has already been created, the previously created stream will be + * returned. + */ + private function getBody() + { + if ($this->body) { + return $this->body; + } elseif ($this->files || $this->forceMultipart) { + return $this->body = $this->createMultipart(); + } elseif ($this->fields) { + return $this->body = $this->createUrlEncoded(); + } else { + return $this->body = Stream::factory(); + } + } + + /** + * Get the aggregator used to join multi-valued field parameters + * + * @return callable + */ + final protected function getAggregator() + { + if (!$this->aggregator) { + $this->aggregator = Query::phpAggregator(); + } + + return $this->aggregator; + } + + /** + * Creates a multipart/form-data body stream + * + * @return MultipartBody + */ + private function createMultipart() + { + // Flatten the nested query string values using the correct aggregator + return new MultipartBody( + call_user_func($this->getAggregator(), $this->fields), + $this->files + ); + } + + /** + * Creates an application/x-www-form-urlencoded stream body + * + * @return StreamInterface + */ + private function createUrlEncoded() + { + return Stream::factory($this->getFields(true)); + } + + /** + * Get rid of any cached data + */ + private function mutate() + { + $this->body = null; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBodyInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBodyInterface.php new file mode 100644 index 00000000000..c2ec9a62c5b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostBodyInterface.php @@ -0,0 +1,109 @@ +headers = $headers; + $this->name = $name; + $this->prepareContent($content); + $this->prepareFilename($filename); + $this->prepareDefaultHeaders(); + } + + public function getName() + { + return $this->name; + } + + public function getFilename() + { + return $this->filename; + } + + public function getContent() + { + return $this->content; + } + + public function getHeaders() + { + return $this->headers; + } + + /** + * Prepares the contents of a POST file. + * + * @param mixed $content Content of the POST file + */ + private function prepareContent($content) + { + $this->content = $content; + + if (!($this->content instanceof StreamInterface)) { + $this->content = Stream::factory($this->content); + } elseif ($this->content instanceof MultipartBody) { + if (!$this->hasHeader('Content-Disposition')) { + $disposition = 'form-data; name="' . $this->name .'"'; + $this->headers['Content-Disposition'] = $disposition; + } + + if (!$this->hasHeader('Content-Type')) { + $this->headers['Content-Type'] = sprintf( + "multipart/form-data; boundary=%s", + $this->content->getBoundary() + ); + } + } + } + + /** + * Applies a file name to the POST file based on various checks. + * + * @param string|null $filename Filename to apply (or null to guess) + */ + private function prepareFilename($filename) + { + $this->filename = $filename; + + if (!$this->filename) { + $this->filename = $this->content->getMetadata('uri'); + } + + if (!$this->filename || substr($this->filename, 0, 6) === 'php://') { + $this->filename = $this->name; + } + } + + /** + * Applies default Content-Disposition and Content-Type headers if needed. + */ + private function prepareDefaultHeaders() + { + // Set a default content-disposition header if one was no provided + if (!$this->hasHeader('Content-Disposition')) { + $this->headers['Content-Disposition'] = sprintf( + 'form-data; name="%s"; filename="%s"', + $this->name, + basename($this->filename) + ); + } + + // Set a default Content-Type if one was not supplied + if (!$this->hasHeader('Content-Type')) { + $this->headers['Content-Type'] = Mimetypes::getInstance() + ->fromFilename($this->filename) ?: 'text/plain'; + } + } + + /** + * Check if a specific header exists on the POST file by name. + * + * @param string $name Case-insensitive header to check + * + * @return bool + */ + private function hasHeader($name) + { + return isset(array_change_key_case($this->headers)[strtolower($name)]); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostFileInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostFileInterface.php new file mode 100644 index 00000000000..2e816c0884f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Post/PostFileInterface.php @@ -0,0 +1,41 @@ +setEncodingType($urlEncoding); + } + + $qp->parseInto($q, $query, $urlEncoding); + + return $q; + } + + /** + * Convert the query string parameters to a query string string + * + * @return string + */ + public function __toString() + { + if (!$this->data) { + return ''; + } + + // The default aggregator is statically cached + static $defaultAggregator; + + if (!$this->aggregator) { + if (!$defaultAggregator) { + $defaultAggregator = self::phpAggregator(); + } + $this->aggregator = $defaultAggregator; + } + + $result = ''; + $aggregator = $this->aggregator; + $encoder = $this->encoding; + + foreach ($aggregator($this->data) as $key => $values) { + foreach ($values as $value) { + if ($result) { + $result .= '&'; + } + $result .= $encoder($key); + if ($value !== null) { + $result .= '=' . $encoder($value); + } + } + } + + return $result; + } + + /** + * Controls how multi-valued query string parameters are aggregated into a + * string. + * + * $query->setAggregator($query::duplicateAggregator()); + * + * @param callable $aggregator Callable used to convert a deeply nested + * array of query string variables into a flattened array of key value + * pairs. The callable accepts an array of query data and returns a + * flattened array of key value pairs where each value is an array of + * strings. + */ + public function setAggregator(callable $aggregator) + { + $this->aggregator = $aggregator; + } + + /** + * Specify how values are URL encoded + * + * @param string|bool $type One of 'RFC1738', 'RFC3986', or false to disable encoding + * + * @throws \InvalidArgumentException + */ + public function setEncodingType($type) + { + switch ($type) { + case self::RFC3986: + $this->encoding = 'rawurlencode'; + break; + case self::RFC1738: + $this->encoding = 'urlencode'; + break; + case false: + $this->encoding = function ($v) { return $v; }; + break; + default: + throw new \InvalidArgumentException('Invalid URL encoding type'); + } + } + + /** + * Query string aggregator that does not aggregate nested query string + * values and allows duplicates in the resulting array. + * + * Example: http://test.com?q=1&q=2 + * + * @return callable + */ + public static function duplicateAggregator() + { + return function (array $data) { + return self::walkQuery($data, '', function ($key, $prefix) { + return is_int($key) ? $prefix : "{$prefix}[{$key}]"; + }); + }; + } + + /** + * Aggregates nested query string variables using the same technique as + * ``http_build_query()``. + * + * @param bool $numericIndices Pass false to not include numeric indices + * when multi-values query string parameters are present. + * + * @return callable + */ + public static function phpAggregator($numericIndices = true) + { + return function (array $data) use ($numericIndices) { + return self::walkQuery( + $data, + '', + function ($key, $prefix) use ($numericIndices) { + return !$numericIndices && is_int($key) + ? "{$prefix}[]" + : "{$prefix}[{$key}]"; + } + ); + }; + } + + /** + * Easily create query aggregation functions by providing a key prefix + * function to this query string array walker. + * + * @param array $query Query string to walk + * @param string $keyPrefix Key prefix (start with '') + * @param callable $prefixer Function used to create a key prefix + * + * @return array + */ + public static function walkQuery(array $query, $keyPrefix, callable $prefixer) + { + $result = []; + foreach ($query as $key => $value) { + if ($keyPrefix) { + $key = $prefixer($key, $keyPrefix); + } + if (is_array($value)) { + $result += self::walkQuery($value, $key, $prefixer); + } elseif (isset($result[$key])) { + $result[$key][] = $value; + } else { + $result[$key] = array($value); + } + } + + return $result; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/QueryParser.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/QueryParser.php new file mode 100644 index 00000000000..90727cc6cf0 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/QueryParser.php @@ -0,0 +1,163 @@ +duplicates = false; + $this->numericIndices = true; + $decoder = self::getDecoder($urlEncoding); + + foreach (explode('&', $str) as $kvp) { + + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + + // Special handling needs to be taken for PHP nested array syntax + if (strpos($key, '[') !== false) { + $this->parsePhpValue($key, $value, $result); + continue; + } + + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + $this->duplicates = true; + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + $query->replace($result); + + if (!$this->numericIndices) { + $query->setAggregator(Query::phpAggregator(false)); + } elseif ($this->duplicates) { + $query->setAggregator(Query::duplicateAggregator()); + } + } + + /** + * Returns a callable that is used to URL decode query keys and values. + * + * @param string|bool $type One of true, false, RFC3986, and RFC1738 + * + * @return callable|string + */ + private static function getDecoder($type) + { + if ($type === true) { + return function ($value) { + return rawurldecode(str_replace('+', ' ', $value)); + }; + } elseif ($type == Query::RFC3986) { + return 'rawurldecode'; + } elseif ($type == Query::RFC1738) { + return 'urldecode'; + } else { + return function ($str) { return $str; }; + } + } + + /** + * Parses a PHP style key value pair. + * + * @param string $key Key to parse (e.g., "foo[a][b]") + * @param string|null $value Value to set + * @param array $result Result to modify by reference + */ + private function parsePhpValue($key, $value, array &$result) + { + $node =& $result; + $keyBuffer = ''; + + for ($i = 0, $t = strlen($key); $i < $t; $i++) { + switch ($key[$i]) { + case '[': + if ($keyBuffer) { + $this->prepareNode($node, $keyBuffer); + $node =& $node[$keyBuffer]; + $keyBuffer = ''; + } + break; + case ']': + $k = $this->cleanKey($node, $keyBuffer); + $this->prepareNode($node, $k); + $node =& $node[$k]; + $keyBuffer = ''; + break; + default: + $keyBuffer .= $key[$i]; + break; + } + } + + if (isset($node)) { + $this->duplicates = true; + $node[] = $value; + } else { + $node = $value; + } + } + + /** + * Prepares a value in the array at the given key. + * + * If the key already exists, the key value is converted into an array. + * + * @param array $node Result node to modify + * @param string $key Key to add or modify in the node + */ + private function prepareNode(&$node, $key) + { + if (!isset($node[$key])) { + $node[$key] = null; + } elseif (!is_array($node[$key])) { + $node[$key] = [$node[$key]]; + } + } + + /** + * Returns the appropriate key based on the node and key. + */ + private function cleanKey($node, $key) + { + if ($key === '') { + $key = $node ? (string) count($node) : 0; + // Found a [] key, so track this to ensure that we disable numeric + // indexing of keys in the resolved query aggregator. + $this->numericIndices = false; + } + + return $key; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestFsm.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestFsm.php new file mode 100644 index 00000000000..b37c190d431 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RequestFsm.php @@ -0,0 +1,153 @@ +mf = $messageFactory; + $this->maxTransitions = $maxTransitions; + $this->handler = $handler; + } + + /** + * Runs the state machine until a terminal state is entered or the + * optionally supplied $finalState is entered. + * + * @param Transaction $trans Transaction being transitioned. + * + * @throws \Exception if a terminal state throws an exception. + */ + public function __invoke(Transaction $trans) + { + $trans->_transitionCount = 0; + + if (!$trans->state) { + $trans->state = 'before'; + } + + transition: + + if (++$trans->_transitionCount > $this->maxTransitions) { + throw new StateException("Too many state transitions were " + . "encountered ({$trans->_transitionCount}). This likely " + . "means that a combination of event listeners are in an " + . "infinite loop."); + } + + switch ($trans->state) { + case 'before': goto before; + case 'complete': goto complete; + case 'error': goto error; + case 'retry': goto retry; + case 'send': goto send; + case 'end': goto end; + default: throw new StateException("Invalid state: {$trans->state}"); + } + + before: { + try { + $trans->request->getEmitter()->emit('before', new BeforeEvent($trans)); + $trans->state = 'send'; + if ((bool) $trans->response) { + $trans->state = 'complete'; + } + } catch (\Exception $e) { + $trans->state = 'error'; + $trans->exception = $e; + } + goto transition; + } + + complete: { + try { + if ($trans->response instanceof FutureInterface) { + // Futures will have their own end events emitted when + // dereferenced. + return; + } + $trans->state = 'end'; + $trans->response->setEffectiveUrl($trans->request->getUrl()); + $trans->request->getEmitter()->emit('complete', new CompleteEvent($trans)); + } catch (\Exception $e) { + $trans->state = 'error'; + $trans->exception = $e; + } + goto transition; + } + + error: { + try { + // Convert non-request exception to a wrapped exception + $trans->exception = RequestException::wrapException( + $trans->request, $trans->exception + ); + $trans->state = 'end'; + $trans->request->getEmitter()->emit('error', new ErrorEvent($trans)); + // An intercepted request (not retried) transitions to complete + if (!$trans->exception && $trans->state !== 'retry') { + $trans->state = 'complete'; + } + } catch (\Exception $e) { + $trans->state = 'end'; + $trans->exception = $e; + } + goto transition; + } + + retry: { + $trans->retries++; + $trans->response = null; + $trans->exception = null; + $trans->state = 'before'; + goto transition; + } + + send: { + $fn = $this->handler; + $trans->response = FutureResponse::proxy( + $fn(RingBridge::prepareRingRequest($trans)), + function ($value) use ($trans) { + RingBridge::completeRingResponse($trans, $value, $this->mf, $this); + $this($trans); + return $trans->response; + } + ); + return; + } + + end: { + $trans->request->getEmitter()->emit('end', new EndEvent($trans)); + // Throw exceptions in the terminal event if the exception + // was not handled by an "end" event listener. + if ($trans->exception) { + if (!($trans->exception instanceof RequestException)) { + $trans->exception = RequestException::wrapException( + $trans->request, $trans->exception + ); + } + throw $trans->exception; + } + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/RingBridge.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RingBridge.php new file mode 100644 index 00000000000..bc6841d42bc --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/RingBridge.php @@ -0,0 +1,165 @@ +getConfig()->toArray(); + $url = $request->getUrl(); + // No need to calculate the query string twice (in URL and query). + $qs = ($pos = strpos($url, '?')) ? substr($url, $pos + 1) : null; + + return [ + 'scheme' => $request->getScheme(), + 'http_method' => $request->getMethod(), + 'url' => $url, + 'uri' => $request->getPath(), + 'headers' => $request->getHeaders(), + 'body' => $request->getBody(), + 'version' => $request->getProtocolVersion(), + 'client' => $options, + 'query_string' => $qs, + 'future' => isset($options['future']) ? $options['future'] : false + ]; + } + + /** + * Creates a Ring request from a request object AND prepares the callbacks. + * + * @param Transaction $trans Transaction to update. + * + * @return array Converted Guzzle Ring request. + */ + public static function prepareRingRequest(Transaction $trans) + { + // Clear out the transaction state when initiating. + $trans->exception = null; + $request = self::createRingRequest($trans->request); + + // Emit progress events if any progress listeners are registered. + if ($trans->request->getEmitter()->hasListeners('progress')) { + $emitter = $trans->request->getEmitter(); + $request['client']['progress'] = function ($a, $b, $c, $d) use ($trans, $emitter) { + $emitter->emit('progress', new ProgressEvent($trans, $a, $b, $c, $d)); + }; + } + + return $request; + } + + /** + * Handles the process of processing a response received from a ring + * handler. The created response is added to the transaction, and the + * transaction stat is set appropriately. + * + * @param Transaction $trans Owns request and response. + * @param array $response Ring response array + * @param MessageFactoryInterface $messageFactory Creates response objects. + */ + public static function completeRingResponse( + Transaction $trans, + array $response, + MessageFactoryInterface $messageFactory + ) { + $trans->state = 'complete'; + $trans->transferInfo = isset($response['transfer_stats']) + ? $response['transfer_stats'] : []; + + if (!empty($response['status'])) { + $options = []; + if (isset($response['version'])) { + $options['protocol_version'] = $response['version']; + } + if (isset($response['reason'])) { + $options['reason_phrase'] = $response['reason']; + } + $trans->response = $messageFactory->createResponse( + $response['status'], + isset($response['headers']) ? $response['headers'] : [], + isset($response['body']) ? $response['body'] : null, + $options + ); + if (isset($response['effective_url'])) { + $trans->response->setEffectiveUrl($response['effective_url']); + } + } elseif (empty($response['error'])) { + // When nothing was returned, then we need to add an error. + $response['error'] = self::getNoRingResponseException($trans->request); + } + + if (isset($response['error'])) { + $trans->state = 'error'; + $trans->exception = $response['error']; + } + } + + /** + * Creates a Guzzle request object using a ring request array. + * + * @param array $request Ring request + * + * @return Request + * @throws \InvalidArgumentException for incomplete requests. + */ + public static function fromRingRequest(array $request) + { + $options = []; + if (isset($request['version'])) { + $options['protocol_version'] = $request['version']; + } + + if (!isset($request['http_method'])) { + throw new \InvalidArgumentException('No http_method'); + } + + return new Request( + $request['http_method'], + Core::url($request), + isset($request['headers']) ? $request['headers'] : [], + isset($request['body']) ? Stream::factory($request['body']) : null, + $options + ); + } + + /** + * Get an exception that can be used when a RingPHP handler does not + * populate a response. + * + * @param RequestInterface $request + * + * @return RequestException + */ + public static function getNoRingResponseException(RequestInterface $request) + { + $message = <<cookieJar = $cookieJar ?: new CookieJar(); + } + + public function getEvents() + { + // Fire the cookie plugin complete event before redirecting + return [ + 'before' => ['onBefore'], + 'complete' => ['onComplete', RequestEvents::REDIRECT_RESPONSE + 10] + ]; + } + + /** + * Get the cookie cookieJar + * + * @return CookieJarInterface + */ + public function getCookieJar() + { + return $this->cookieJar; + } + + public function onBefore(BeforeEvent $event) + { + $this->cookieJar->addCookieHeader($event->getRequest()); + } + + public function onComplete(CompleteEvent $event) + { + $this->cookieJar->extractCookies( + $event->getRequest(), + $event->getResponse() + ); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/History.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/History.php new file mode 100644 index 00000000000..5cf06119f64 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/History.php @@ -0,0 +1,172 @@ +limit = $limit; + } + + public function getEvents() + { + return [ + 'complete' => ['onComplete', RequestEvents::EARLY], + 'error' => ['onError', RequestEvents::EARLY], + ]; + } + + /** + * Convert to a string that contains all request and response headers + * + * @return string + */ + public function __toString() + { + $lines = array(); + foreach ($this->transactions as $entry) { + $response = isset($entry['response']) ? $entry['response'] : ''; + $lines[] = '> ' . trim($entry['sent_request']) + . "\n\n< " . trim($response) . "\n"; + } + + return implode("\n", $lines); + } + + public function onComplete(CompleteEvent $event) + { + $this->add($event->getRequest(), $event->getResponse()); + } + + public function onError(ErrorEvent $event) + { + // Only track when no response is present, meaning this didn't ever + // emit a complete event + if (!$event->getResponse()) { + $this->add($event->getRequest()); + } + } + + /** + * Returns an Iterator that yields associative array values where each + * associative array contains the following key value pairs: + * + * - request: Representing the actual request that was received. + * - sent_request: A clone of the request that will not be mutated. + * - response: The response that was received (if available). + * + * @return \Iterator + */ + public function getIterator() + { + return new \ArrayIterator($this->transactions); + } + + /** + * Get all of the requests sent through the plugin. + * + * Requests can be modified after they are logged by the history + * subscriber. By default this method will return the actual request + * instances that were received. Pass true to this method if you wish to + * get copies of the requests that represent the request state when it was + * initially logged by the history subscriber. + * + * @param bool $asSent Set to true to get clones of the requests that have + * not been mutated since the request was received by + * the history subscriber. + * + * @return RequestInterface[] + */ + public function getRequests($asSent = false) + { + return array_map(function ($t) use ($asSent) { + return $asSent ? $t['sent_request'] : $t['request']; + }, $this->transactions); + } + + /** + * Get the number of requests in the history + * + * @return int + */ + public function count() + { + return count($this->transactions); + } + + /** + * Get the last request sent. + * + * Requests can be modified after they are logged by the history + * subscriber. By default this method will return the actual request + * instance that was received. Pass true to this method if you wish to get + * a copy of the request that represents the request state when it was + * initially logged by the history subscriber. + * + * @param bool $asSent Set to true to get a clone of the last request that + * has not been mutated since the request was received + * by the history subscriber. + * + * @return RequestInterface + */ + public function getLastRequest($asSent = false) + { + return $asSent + ? end($this->transactions)['sent_request'] + : end($this->transactions)['request']; + } + + /** + * Get the last response in the history + * + * @return ResponseInterface|null + */ + public function getLastResponse() + { + return end($this->transactions)['response']; + } + + /** + * Clears the history + */ + public function clear() + { + $this->transactions = array(); + } + + /** + * Add a request to the history + * + * @param RequestInterface $request Request to add + * @param ResponseInterface $response Response of the request + */ + private function add( + RequestInterface $request, + ResponseInterface $response = null + ) { + $this->transactions[] = [ + 'request' => $request, + 'sent_request' => clone $request, + 'response' => $response + ]; + if (count($this->transactions) > $this->limit) { + array_shift($this->transactions); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php new file mode 100644 index 00000000000..ed9de5bcc06 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php @@ -0,0 +1,36 @@ + ['onComplete', RequestEvents::VERIFY_RESPONSE]]; + } + + /** + * Throw a RequestException on an HTTP protocol error + * + * @param CompleteEvent $event Emitted event + * @throws RequestException + */ + public function onComplete(CompleteEvent $event) + { + $code = (string) $event->getResponse()->getStatusCode(); + // Throw an exception for an unsuccessful response + if ($code[0] >= 4) { + throw RequestException::create( + $event->getRequest(), + $event->getResponse() + ); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Mock.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Mock.php new file mode 100644 index 00000000000..2af4d3758dd --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Mock.php @@ -0,0 +1,147 @@ +factory = new MessageFactory(); + $this->readBodies = $readBodies; + $this->addMultiple($items); + } + + public function getEvents() + { + // Fire the event last, after signing + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST - 10]]; + } + + /** + * @throws \OutOfBoundsException|\Exception + */ + public function onBefore(BeforeEvent $event) + { + if (!$item = array_shift($this->queue)) { + throw new \OutOfBoundsException('Mock queue is empty'); + } elseif ($item instanceof RequestException) { + throw $item; + } + + // Emulate reading a response body + $request = $event->getRequest(); + if ($this->readBodies && $request->getBody()) { + while (!$request->getBody()->eof()) { + $request->getBody()->read(8096); + } + } + + $saveTo = $event->getRequest()->getConfig()->get('save_to'); + + if (null !== $saveTo) { + $body = $item->getBody(); + + if (is_resource($saveTo)) { + fwrite($saveTo, $body); + } elseif (is_string($saveTo)) { + file_put_contents($saveTo, $body); + } elseif ($saveTo instanceof StreamInterface) { + $saveTo->write($body); + } + } + + $event->intercept($item); + } + + public function count() + { + return count($this->queue); + } + + /** + * Add a response to the end of the queue + * + * @param string|ResponseInterface $response Response or path to response file + * + * @return self + * @throws \InvalidArgumentException if a string or Response is not passed + */ + public function addResponse($response) + { + if (is_string($response)) { + $response = file_exists($response) + ? $this->factory->fromMessage(file_get_contents($response)) + : $this->factory->fromMessage($response); + } elseif (!($response instanceof ResponseInterface)) { + throw new \InvalidArgumentException('Response must a message ' + . 'string, response object, or path to a file'); + } + + $this->queue[] = $response; + + return $this; + } + + /** + * Add an exception to the end of the queue + * + * @param RequestException $e Exception to throw when the request is executed + * + * @return self + */ + public function addException(RequestException $e) + { + $this->queue[] = $e; + + return $this; + } + + /** + * Add multiple items to the queue + * + * @param array $items Items to add + */ + public function addMultiple(array $items) + { + foreach ($items as $item) { + if ($item instanceof RequestException) { + $this->addException($item); + } else { + $this->addResponse($item); + } + } + } + + /** + * Clear the queue + */ + public function clearQueue() + { + $this->queue = []; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php new file mode 100644 index 00000000000..b5ed4e26092 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php @@ -0,0 +1,130 @@ + ['onBefore', RequestEvents::PREPARE_REQUEST]]; + } + + public function onBefore(BeforeEvent $event) + { + $request = $event->getRequest(); + + // Set the appropriate Content-Type for a request if one is not set and + // there are form fields + if (!($body = $request->getBody())) { + return; + } + + $this->addContentLength($request, $body); + + if ($body instanceof AppliesHeadersInterface) { + // Synchronize the body with the request headers + $body->applyRequestHeaders($request); + } elseif (!$request->hasHeader('Content-Type')) { + $this->addContentType($request, $body); + } + + $this->addExpectHeader($request, $body); + } + + private function addContentType( + RequestInterface $request, + StreamInterface $body + ) { + if (!($uri = $body->getMetadata('uri'))) { + return; + } + + // Guess the content-type based on the stream's "uri" metadata value. + // The file extension is used to determine the appropriate mime-type. + if ($contentType = Mimetypes::getInstance()->fromFilename($uri)) { + $request->setHeader('Content-Type', $contentType); + } + } + + private function addContentLength( + RequestInterface $request, + StreamInterface $body + ) { + // Set the Content-Length header if it can be determined, and never + // send a Transfer-Encoding: chunked and Content-Length header in + // the same request. + if ($request->hasHeader('Content-Length')) { + // Remove transfer-encoding if content-length is set. + $request->removeHeader('Transfer-Encoding'); + return; + } + + if ($request->hasHeader('Transfer-Encoding')) { + return; + } + + if (null !== ($size = $body->getSize())) { + $request->setHeader('Content-Length', $size); + $request->removeHeader('Transfer-Encoding'); + } elseif ('1.1' == $request->getProtocolVersion()) { + // Use chunked Transfer-Encoding if there is no determinable + // content-length header and we're using HTTP/1.1. + $request->setHeader('Transfer-Encoding', 'chunked'); + $request->removeHeader('Content-Length'); + } + } + + private function addExpectHeader( + RequestInterface $request, + StreamInterface $body + ) { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = $request->getConfig()['expect']; + + // Return if disabled or if you're not using HTTP/1.1 + if ($expect === false || $request->getProtocolVersion() !== '1.1') { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $request->setHeader('Expect', '100-Continue'); + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $size = $body->getSize(); + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $request->setHeader('Expect', '100-Continue'); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Redirect.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Redirect.php new file mode 100644 index 00000000000..ff992268bb0 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Subscriber/Redirect.php @@ -0,0 +1,176 @@ + ['onComplete', RequestEvents::REDIRECT_RESPONSE]]; + } + + /** + * Rewind the entity body of the request if needed + * + * @param RequestInterface $redirectRequest + * @throws CouldNotRewindStreamException + */ + public static function rewindEntityBody(RequestInterface $redirectRequest) + { + // Rewind the entity body of the request if needed + if ($body = $redirectRequest->getBody()) { + // Only rewind the body if some of it has been read already, and + // throw an exception if the rewind fails + if ($body->tell() && !$body->seek(0)) { + throw new CouldNotRewindStreamException( + 'Unable to rewind the non-seekable request body after redirecting', + $redirectRequest + ); + } + } + } + + /** + * Called when a request receives a redirect response + * + * @param CompleteEvent $event Event emitted + * @throws TooManyRedirectsException + */ + public function onComplete(CompleteEvent $event) + { + $response = $event->getResponse(); + + if (substr($response->getStatusCode(), 0, 1) != '3' + || !$response->hasHeader('Location') + ) { + return; + } + + $request = $event->getRequest(); + $config = $request->getConfig(); + + // Increment the redirect and initialize the redirect state. + if ($redirectCount = $config['redirect_count']) { + $config['redirect_count'] = ++$redirectCount; + } else { + $config['redirect_scheme'] = $request->getScheme(); + $config['redirect_count'] = $redirectCount = 1; + } + + $max = $config->getPath('redirect/max') ?: 5; + + if ($redirectCount > $max) { + throw new TooManyRedirectsException( + "Will not follow more than {$redirectCount} redirects", + $request + ); + } + + $this->modifyRedirectRequest($request, $response); + $event->retry(); + } + + private function modifyRedirectRequest( + RequestInterface $request, + ResponseInterface $response + ) { + $config = $request->getConfig(); + $protocols = $config->getPath('redirect/protocols') ?: ['http', 'https']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 || + ($statusCode <= 302 && $request->getBody() && !$config->getPath('redirect/strict')) + ) { + $request->setMethod('GET'); + $request->setBody(null); + } + + $previousUrl = $request->getUrl(); + $this->setRedirectUrl($request, $response, $protocols); + $this->rewindEntityBody($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($config->getPath('redirect/referer') + && ($request->getScheme() == 'https' || $request->getScheme() == $config['redirect_scheme']) + ) { + $url = Url::fromString($previousUrl); + $url->setUsername(null); + $url->setPassword(null); + $request->setHeader('Referer', (string) $url); + } else { + $request->removeHeader('Referer'); + } + } + + /** + * Set the appropriate URL on the request based on the location header + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param array $protocols + */ + private function setRedirectUrl( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ) { + $location = $response->getHeader('Location'); + $location = Url::fromString($location); + + // Combine location with the original URL if it is not absolute. + if (!$location->isAbsolute()) { + $originalUrl = Url::fromString($request->getUrl()); + // Remove query string parameters and just take what is present on + // the redirect Location header + $originalUrl->getQuery()->clear(); + $location = $originalUrl->combine($location); + } + + // Ensure that the redirect URL is allowed based on the protocols. + if (!in_array($location->getScheme(), $protocols)) { + throw new BadResponseException( + sprintf( + 'Redirect URL, %s, does not use one of the allowed redirect protocols: %s', + $location, + implode(', ', $protocols) + ), + $request, + $response + ); + } + + $request->setUrl($location); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/ToArrayInterface.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/ToArrayInterface.php new file mode 100644 index 00000000000..d57c0229a44 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/ToArrayInterface.php @@ -0,0 +1,15 @@ +client = $client; + $this->request = $request; + $this->_future = $future; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/guzzle/src/Url.php b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Url.php new file mode 100644 index 00000000000..637f60c2abb --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/guzzle/src/Url.php @@ -0,0 +1,595 @@ + 80, 'https' => 443, 'ftp' => 21]; + private static $pathPattern = '/[^a-zA-Z0-9\-\._~!\$&\'\(\)\*\+,;=%:@\/]+|%(?![A-Fa-f0-9]{2})/'; + private static $queryPattern = '/[^a-zA-Z0-9\-\._~!\$\'\(\)\*\+,;%:@\/\?=&]+|%(?![A-Fa-f0-9]{2})/'; + /** @var Query|string Query part of the URL */ + private $query; + + /** + * Factory method to create a new URL from a URL string + * + * @param string $url Full URL used to create a Url object + * + * @return Url + * @throws \InvalidArgumentException + */ + public static function fromString($url) + { + static $defaults = ['scheme' => null, 'host' => null, + 'path' => null, 'port' => null, 'query' => null, + 'user' => null, 'pass' => null, 'fragment' => null]; + + if (false === ($parts = parse_url($url))) { + throw new \InvalidArgumentException('Unable to parse malformed ' + . 'url: ' . $url); + } + + $parts += $defaults; + + // Convert the query string into a Query object + if ($parts['query'] || 0 !== strlen($parts['query'])) { + $parts['query'] = Query::fromString($parts['query']); + } + + return new static($parts['scheme'], $parts['host'], $parts['user'], + $parts['pass'], $parts['port'], $parts['path'], $parts['query'], + $parts['fragment']); + } + + /** + * Build a URL from parse_url parts. The generated URL will be a relative + * URL if a scheme or host are not provided. + * + * @param array $parts Array of parse_url parts + * + * @return string + */ + public static function buildUrl(array $parts) + { + $url = $scheme = ''; + + if (!empty($parts['scheme'])) { + $scheme = $parts['scheme']; + $url .= $scheme . ':'; + } + + if (!empty($parts['host'])) { + $url .= '//'; + if (isset($parts['user'])) { + $url .= $parts['user']; + if (isset($parts['pass'])) { + $url .= ':' . $parts['pass']; + } + $url .= '@'; + } + + $url .= $parts['host']; + + // Only include the port if it is not the default port of the scheme + if (isset($parts['port']) && + (!isset(self::$defaultPorts[$scheme]) || + $parts['port'] != self::$defaultPorts[$scheme]) + ) { + $url .= ':' . $parts['port']; + } + } + + // Add the path component if present + if (isset($parts['path']) && strlen($parts['path'])) { + // Always ensure that the path begins with '/' if set and something + // is before the path + if (!empty($parts['host']) && $parts['path'][0] != '/') { + $url .= '/'; + } + $url .= $parts['path']; + } + + // Add the query string if present + if (isset($parts['query'])) { + $queryStr = (string) $parts['query']; + if ($queryStr || $queryStr === '0') { + $url .= '?' . $queryStr; + } + } + + // Ensure that # is only added to the url if fragment contains anything. + if (isset($parts['fragment'])) { + $url .= '#' . $parts['fragment']; + } + + return $url; + } + + /** + * Create a new URL from URL parts + * + * @param string $scheme Scheme of the URL + * @param string $host Host of the URL + * @param string $username Username of the URL + * @param string $password Password of the URL + * @param int $port Port of the URL + * @param string $path Path of the URL + * @param Query|array|string $query Query string of the URL + * @param string $fragment Fragment of the URL + */ + public function __construct( + $scheme, + $host, + $username = null, + $password = null, + $port = null, + $path = null, + $query = null, + $fragment = null + ) { + $this->scheme = strtolower($scheme); + $this->host = $host; + $this->port = $port; + $this->username = $username; + $this->password = $password; + $this->fragment = $fragment; + + if ($query) { + $this->setQuery($query); + } + + $this->setPath($path); + } + + /** + * Clone the URL + */ + public function __clone() + { + if ($this->query instanceof Query) { + $this->query = clone $this->query; + } + } + + /** + * Returns the URL as a URL string + * + * @return string + */ + public function __toString() + { + return static::buildUrl($this->getParts()); + } + + /** + * Get the parts of the URL as an array + * + * @return array + */ + public function getParts() + { + return array( + 'scheme' => $this->scheme, + 'user' => $this->username, + 'pass' => $this->password, + 'host' => $this->host, + 'port' => $this->port, + 'path' => $this->path, + 'query' => $this->query, + 'fragment' => $this->fragment, + ); + } + + /** + * Set the host of the request. + * + * @param string $host Host to set (e.g. www.yahoo.com, yahoo.com) + * + * @return Url + */ + public function setHost($host) + { + if (strpos($host, ':') === false) { + $this->host = $host; + } else { + list($host, $port) = explode(':', $host); + $this->host = $host; + $this->setPort($port); + } + } + + /** + * Get the host part of the URL + * + * @return string + */ + public function getHost() + { + return $this->host; + } + + /** + * Set the scheme part of the URL (http, https, ftp, etc.) + * + * @param string $scheme Scheme to set + */ + public function setScheme($scheme) + { + // Remove the default port if one is specified + if ($this->port + && isset(self::$defaultPorts[$this->scheme]) + && self::$defaultPorts[$this->scheme] == $this->port + ) { + $this->port = null; + } + + $this->scheme = strtolower($scheme); + } + + /** + * Get the scheme part of the URL + * + * @return string + */ + public function getScheme() + { + return $this->scheme; + } + + /** + * Set the port part of the URL + * + * @param int $port Port to set + */ + public function setPort($port) + { + $this->port = $port; + } + + /** + * Get the port part of the URl. + * + * If no port was set, this method will return the default port for the + * scheme of the URI. + * + * @return int|null + */ + public function getPort() + { + if ($this->port) { + return $this->port; + } elseif (isset(self::$defaultPorts[$this->scheme])) { + return self::$defaultPorts[$this->scheme]; + } + + return null; + } + + /** + * Set the path part of the URL. + * + * The provided URL is URL encoded as necessary. + * + * @param string $path Path string to set + */ + public function setPath($path) + { + $this->path = self::encodePath($path); + } + + /** + * Removes dot segments from a URL + * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 + */ + public function removeDotSegments() + { + static $noopPaths = ['' => true, '/' => true, '*' => true]; + static $ignoreSegments = ['.' => true, '..' => true]; + + if (isset($noopPaths[$this->path])) { + return; + } + + $results = []; + $segments = $this->getPathSegments(); + foreach ($segments as $segment) { + if ($segment == '..') { + array_pop($results); + } elseif (!isset($ignoreSegments[$segment])) { + $results[] = $segment; + } + } + + $newPath = implode('/', $results); + + // Add the leading slash if necessary + if (substr($this->path, 0, 1) === '/' && + substr($newPath, 0, 1) !== '/' + ) { + $newPath = '/' . $newPath; + } + + // Add the trailing slash if necessary + if ($newPath != '/' && isset($ignoreSegments[end($segments)])) { + $newPath .= '/'; + } + + $this->path = $newPath; + } + + /** + * Add a relative path to the currently set path. + * + * @param string $relativePath Relative path to add + */ + public function addPath($relativePath) + { + if ($relativePath != '/' && + is_string($relativePath) && + strlen($relativePath) > 0 + ) { + // Add a leading slash if needed + if ($relativePath[0] !== '/' && + substr($this->path, -1, 1) !== '/' + ) { + $relativePath = '/' . $relativePath; + } + + $this->setPath($this->path . $relativePath); + } + } + + /** + * Get the path part of the URL + * + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Get the path segments of the URL as an array + * + * @return array + */ + public function getPathSegments() + { + return explode('/', $this->path); + } + + /** + * Set the password part of the URL + * + * @param string $password Password to set + */ + public function setPassword($password) + { + $this->password = $password; + } + + /** + * Get the password part of the URL + * + * @return null|string + */ + public function getPassword() + { + return $this->password; + } + + /** + * Set the username part of the URL + * + * @param string $username Username to set + */ + public function setUsername($username) + { + $this->username = $username; + } + + /** + * Get the username part of the URl + * + * @return null|string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Get the query part of the URL as a Query object + * + * @return Query + */ + public function getQuery() + { + // Convert the query string to a query object if not already done. + if (!$this->query instanceof Query) { + $this->query = $this->query === null + ? new Query() + : Query::fromString($this->query); + } + + return $this->query; + } + + /** + * Set the query part of the URL. + * + * You may provide a query string as a string and pass $rawString as true + * to provide a query string that is not parsed until a call to getQuery() + * is made. Setting a raw query string will still encode invalid characters + * in a query string. + * + * @param Query|string|array $query Query string value to set. Can + * be a string that will be parsed into a Query object, an array + * of key value pairs, or a Query object. + * @param bool $rawString Set to true when providing a raw query string. + * + * @throws \InvalidArgumentException + */ + public function setQuery($query, $rawString = false) + { + if ($query instanceof Query) { + $this->query = $query; + } elseif (is_string($query)) { + if (!$rawString) { + $this->query = Query::fromString($query); + } else { + // Ensure the query does not have illegal characters. + $this->query = preg_replace_callback( + self::$queryPattern, + [__CLASS__, 'encodeMatch'], + $query + ); + } + + } elseif (is_array($query)) { + $this->query = new Query($query); + } else { + throw new \InvalidArgumentException('Query must be a Query, ' + . 'array, or string. Got ' . Core::describeType($query)); + } + } + + /** + * Get the fragment part of the URL + * + * @return null|string + */ + public function getFragment() + { + return $this->fragment; + } + + /** + * Set the fragment part of the URL + * + * @param string $fragment Fragment to set + */ + public function setFragment($fragment) + { + $this->fragment = $fragment; + } + + /** + * Check if this is an absolute URL + * + * @return bool + */ + public function isAbsolute() + { + return $this->scheme && $this->host; + } + + /** + * Combine the URL with another URL and return a new URL instance. + * + * Follows the rules specific in RFC 3986 section 5.4. + * + * @param string $url Relative URL to combine with + * + * @return Url + * @throws \InvalidArgumentException + * @link http://tools.ietf.org/html/rfc3986#section-5.4 + */ + public function combine($url) + { + $url = static::fromString($url); + + // Use the more absolute URL as the base URL + if (!$this->isAbsolute() && $url->isAbsolute()) { + $url = $url->combine($this); + } + + $parts = $url->getParts(); + + // Passing a URL with a scheme overrides everything + if ($parts['scheme']) { + return clone $url; + } + + // Setting a host overrides the entire rest of the URL + if ($parts['host']) { + return new static( + $this->scheme, + $parts['host'], + $parts['user'], + $parts['pass'], + $parts['port'], + $parts['path'], + $parts['query'] instanceof Query + ? clone $parts['query'] + : $parts['query'], + $parts['fragment'] + ); + } + + if (!$parts['path'] && $parts['path'] !== '0') { + // The relative URL has no path, so check if it is just a query + $path = $this->path ?: ''; + $query = $parts['query'] ?: $this->query; + } else { + $query = $parts['query']; + if ($parts['path'][0] == '/' || !$this->path) { + // Overwrite the existing path if the rel path starts with "/" + $path = $parts['path']; + } else { + // If the relative URL does not have a path or the base URL + // path does not end in a "/" then overwrite the existing path + // up to the last "/" + $path = substr($this->path, 0, strrpos($this->path, '/') + 1) . $parts['path']; + } + } + + $result = new self( + $this->scheme, + $this->host, + $this->username, + $this->password, + $this->port, + $path, + $query instanceof Query ? clone $query : $query, + $parts['fragment'] + ); + + if ($path) { + $result->removeDotSegments(); + } + + return $result; + } + + /** + * Encodes the path part of a URL without double-encoding percent-encoded + * key value pairs. + * + * @param string $path Path to encode + * + * @return string + */ + public static function encodePath($path) + { + static $cb = [__CLASS__, 'encodeMatch']; + return preg_replace_callback(self::$pathPattern, $cb, $path); + } + + private static function encodeMatch(array $match) + { + return rawurlencode($match[0]); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/.gitignore b/upload/system/storage/vendor/guzzlehttp/log-subscriber/.gitignore new file mode 100644 index 00000000000..c33d3965fdd --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/.gitignore @@ -0,0 +1,6 @@ +.idea +.DS_STORE +coverage +phpunit.xml +composer.lock +vendor/ diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/.travis.yml b/upload/system/storage/vendor/guzzlehttp/log-subscriber/.travis.yml new file mode 100644 index 00000000000..4355f26b1f4 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/.travis.yml @@ -0,0 +1,13 @@ +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - hhvm + +before_script: + - composer self-update + - composer install --no-interaction --prefer-source --dev + +script: vendor/bin/phpunit diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/LICENSE b/upload/system/storage/vendor/guzzlehttp/log-subscriber/LICENSE new file mode 100644 index 00000000000..71d3b783cb5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/README.rst b/upload/system/storage/vendor/guzzlehttp/log-subscriber/README.rst new file mode 100644 index 00000000000..df7f8a0acc5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/README.rst @@ -0,0 +1,151 @@ +===================== +Guzzle Log Subscriber +===================== + +The LogSubscriber logs HTTP requests and responses to a +`PSR-3 logger `_, callable, resource returned +by ``fopen()``, or by calling ``echo()``. + +Here's the simplest example of how it's used: + +.. code-block:: php + + use GuzzleHttp\Client; + use GuzzleHttp\Subscriber\Log\LogSubscriber; + + $client = new Client(); + $client->getEmitter()->attach(new LogSubscriber()); + $client->get('http://httpbin.org'); + +Running the above example will echo a message using the +`Apache Common Log Format (CLF) `_. + +:: + + [info] hostname Guzzle/5.0 curl/7.21.4 PHP/5.5.7 - [2014-03-01T22:48:13+00:00] "GET / HTTP/1.1" 200 7641 + +.. note:: + + Because no logger is provided, the subscriber simply logs messages with + ``echo()``. This is the method used for logging if ``null`` is provided. + +Installing +---------- + +This project can be installed using Composer. Add the following to your +composer.json: + +.. code-block:: javascript + + { + "require": { + "guzzlehttp/log-subscriber": "~1.0" + } + } + +Using PSR-3 Loggers +------------------- + +You can provide a PSR-3 logger to the constructor as well. The following +example shows how the LogSubscriber can be combined with +`Monolog `_. + +.. code-block:: php + + use GuzzleHttp\Client; + use GuzzleHttp\Subscriber\Log\LogSubscriber; + use Monolog\Logger; + use Monolog\Handler\StreamHandler; + + // create a log channel + $log = new Logger('name'); + $log->pushHandler(new StreamHandler('/path/to/your.log', Logger::WARNING)); + + $client = new Client(); + $subscriber = new LogSubscriber($log); + $client->getEmitter()->attach($subscriber); + +Logging with a custom message format +------------------------------------ + +The LogSubscriber's constructor accepts a logger as the first argument and a +message format string or a message formatter as the second argument. You could +log the full HTTP request and Response message using the debug format via +``GuzzleHttp\Subscriber\Log\Formatter::DEBUG``. + +.. code-block:: php + + use GuzzleHttp\Subscriber\Log\LogSubscriber; + use GuzzleHttp\Subscriber\Log\Formatter; + + // Log the full request and response messages using echo() calls. + $subscriber = new LogSubscriber(null, Formatter::DEBUG); + +Message Formatter +~~~~~~~~~~~~~~~~~ + +Included in this repository is a *message formatter*. The message formatter is +used to format log messages for both requests and responses using a log +template that uses variable substitution for string enclosed in braces +(``{}``). + +The following variables are available in message formatter templates: + +{request} + Full HTTP request message + +{response} + Full HTTP response message + +{ts} + Timestamp + +{host} + Host of the request + +{method} + Method of the request + +{url} + URL of the request + +{protocol} + Request protocol + +{version} + Protocol version + +{resource} + Resource of the request (path + query + fragment) + +{hostname} + Hostname of the machine that sent the request + +{code} + Status code of the response (if available) + +{phrase} + Reason phrase of the response (if available) + +{error} + Any error messages (if available) + +{req_header_*} + Replace ``*`` with the lowercased name of a request header to add to the + message. + +{res_header_*} + Replace ``*`` with the lowercased name of a response header to add to the + message + +{req_headers} + Request headers as a string. + +{res_headers} + Response headers as a string. + +{req_body} + Request body as a string. + +{res_body} + Response body as a string. diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/composer.json b/upload/system/storage/vendor/guzzlehttp/log-subscriber/composer.json new file mode 100644 index 00000000000..7bd183aaa3a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/composer.json @@ -0,0 +1,30 @@ +{ + "name": "guzzlehttp/log-subscriber", + "description": "Logs HTTP requests and responses as they are sent over the wire (Guzzle 4+)", + "homepage": "http://guzzlephp.org/", + "keywords": ["plugin", "log", "guzzle"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.4.0", + "guzzlehttp/guzzle": "~4.0 | ~5.0", + "psr/log": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "autoload": { + "psr-4": { "GuzzleHttp\\Subscriber\\Log\\": "src/" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/phpunit.xml.dist b/upload/system/storage/vendor/guzzlehttp/log-subscriber/phpunit.xml.dist new file mode 100644 index 00000000000..994e1584eac --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/phpunit.xml.dist @@ -0,0 +1,14 @@ + + + + + tests + + + + + src + + + diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/Formatter.php b/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/Formatter.php new file mode 100644 index 00000000000..610e4b19a35 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/Formatter.php @@ -0,0 +1,179 @@ +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + const SHORT = '[{ts}] "{method} {resource} {protocol}/{version}" {code}'; + + /** @var string Template used to format log messages */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct($template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + * @param \Exception $error Exception that was received + * @param array $customData Associative array of custom template data + * + * @return string + */ + public function format( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $error = null, + array $customData = [] + ) { + $cache = $customData; + + return preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = $request; + break; + case 'response': + $result = $response; + break; + case 'req_headers': + $result = trim($request->getMethod() . ' ' + . $request->getResource()) . ' HTTP/' + . $request->getProtocolVersion() . "\r\n" + . $this->headers($request); + break; + case 'res_headers': + $result = $response ? + sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ) . "\r\n" . $this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody(); + break; + case 'res_body': + $result = $response ? $response->getBody() : 'NULL'; + break; + case 'ts': + $result = gmdate('c'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'url': + $result = $request->getUrl(); + break; + case 'resource': + $result = $request->getResource(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHost(); + break; + case 'hostname': + $result = gethostname(); + break; + case 'code': + $result = $response + ? $response->getStatusCode() + : 'NULL'; + break; + case 'phrase': + $result = $response + ? $response->getReasonPhrase() + : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeader(substr($matches[1], 11)); + } elseif (strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeader(substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + return $result; + }, + $this->template + ); + } + + private function headers(MessageInterface $message) + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name . ': ' . implode(', ', $values) . "\r\n"; + } + + return trim($result); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/LogSubscriber.php b/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/LogSubscriber.php new file mode 100644 index 00000000000..cded5adc450 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/LogSubscriber.php @@ -0,0 +1,89 @@ +logger = $logger instanceof LoggerInterface + ? $logger + : new SimpleLogger($logger); + + $this->formatter = $formatter instanceof Formatter + ? $formatter + : new Formatter($formatter); + } + + public function getEvents() + { + return [ + // Fire after responses are verified (which trigger error events). + 'complete' => ['onComplete', RequestEvents::VERIFY_RESPONSE - 10], + 'error' => ['onError', RequestEvents::EARLY] + ]; + } + + public function onComplete(CompleteEvent $event) + { + $this->logger->log( + substr($event->getResponse()->getStatusCode(), 0, 1) == '2' + ? LogLevel::INFO + : LogLevel::WARNING, + $this->formatter->format( + $event->getRequest(), + $event->getResponse() + ), [ + 'request' => $event->getRequest(), + 'response' => $event->getResponse() + ] + ); + } + + public function onError(ErrorEvent $event) + { + $ex = $event->getException(); + $this->logger->log( + LogLevel::CRITICAL, + $this->formatter->format( + $event->getRequest(), + $event->getResponse(), + $ex + ), [ + 'request' => $event->getRequest(), + 'response' => $event->getResponse(), + 'exception' => $ex + ] + ); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/SimpleLogger.php b/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/SimpleLogger.php new file mode 100644 index 00000000000..9ad25cf0296 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/src/SimpleLogger.php @@ -0,0 +1,32 @@ +writeTo = $writeTo; + } + + public function log($level, $message, array $context = array()) + { + if (is_resource($this->writeTo)) { + fwrite($this->writeTo, "[{$level}] {$message}\n"); + } elseif (is_callable($this->writeTo)) { + call_user_func($this->writeTo, "[{$level}] {$message}\n"); + } else { + echo "[{$level}] {$message}\n"; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/FormatterTest.php b/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/FormatterTest.php new file mode 100644 index 00000000000..a23925565f7 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/FormatterTest.php @@ -0,0 +1,90 @@ +assertEquals(Formatter::CLF, $this->readAttribute($f, 'template')); + $f = new Formatter(null); + $this->assertEquals(Formatter::CLF, $this->readAttribute($f, 'template')); + } + + public function testFormatsMessagesWithCustomData() + { + $f = new Formatter('{foo} - {method} - {code}'); + $request = new Request('GET', '/'); + $response = new Response(200); + $result = $f->format($request, $response, null, ['foo' => 'bar']); + $this->assertEquals('bar - GET - 200', $result); + } + + public function testFormatsTimestamps() + { + $f = new Formatter('{ts}'); + $request = new Request('GET', '/'); + $result = $f->format($request); + // Ensure it matches this format: '2014-03-02T00:18:41+00:00'; + $this->assertEquals(1, preg_match('/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}/', $result)); + } + + public function formatProvider() + { + $request = new Request('PUT', '/', ['x-test' => 'abc'], Stream::factory('foo')); + $response = new Response(200, ['X-Baz' => 'Bar'], Stream::factory('baz')); + $err = new RequestException('Test', $request, $response); + + return [ + ['{request}', [$request], (string) $request], + ['{response}', [$request, $response], (string) $response], + ['{request} {response}', [$request, $response], $request . ' ' . $response], + // Empty response yields no value + ['{request} {response}', [$request], $request . ' '], + ['{req_headers}', [$request], "PUT / HTTP/1.1\r\nx-test: abc"], + ['{res_headers}', [$request, $response], "HTTP/1.1 200 OK\r\nX-Baz: Bar"], + ['{res_headers}', [$request], 'NULL'], + ['{req_body}', [$request], 'foo'], + ['{res_body}', [$request, $response], 'baz'], + ['{res_body}', [$request], 'NULL'], + ['{method}', [$request], $request->getMethod()], + ['{url}', [$request], $request->getUrl()], + ['{resource}', [$request], $request->getResource()], + ['{req_version}', [$request], $request->getProtocolVersion()], + ['{res_version}', [$request, $response], $response->getProtocolVersion()], + ['{res_version}', [$request], 'NULL'], + ['{host}', [$request], $request->getHost()], + ['{hostname}', [$request, $response], gethostname()], + ['{hostname}{hostname}', [$request, $response], gethostname() . gethostname()], + ['{code}', [$request, $response], $response->getStatusCode()], + ['{code}', [$request], 'NULL'], + ['{phrase}', [$request, $response], $response->getReasonPhrase()], + ['{phrase}', [$request], 'NULL'], + ['{error}', [$request, $response, $err], 'Test'], + ['{error}', [$request], 'NULL'], + ['{req_header_x-test}', [$request], 'abc'], + ['{req_header_x-not}', [$request], ''], + ['{res_header_X-Baz}', [$request, $response], 'Bar'], + ['{res_header_x-not}', [$request, $response], ''], + ['{res_header_X-Baz}', [$request], 'NULL'], + ]; + } + + /** + * @dataProvider formatProvider + */ + public function testFormatsMessages($template, $args, $result) + { + $f = new Formatter($template); + $this->assertEquals((string) $result, call_user_func_array(array($f, 'format'), $args)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/LogSubscriberTest.php b/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/LogSubscriberTest.php new file mode 100644 index 00000000000..618dfccb3b8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/LogSubscriberTest.php @@ -0,0 +1,76 @@ +assertInstanceOf('GuzzleHttp\\Subscriber\\Log\\SimpleLogger', $this->readAttribute($s, 'logger')); + $s = new LogSubscriber(function () {}); + $this->assertInstanceOf('GuzzleHttp\\Subscriber\\Log\\SimpleLogger', $this->readAttribute($s, 'logger')); + $r = fopen('php://temp', 'r+'); + $s = new LogSubscriber($r); + $this->assertInstanceOf('GuzzleHttp\\Subscriber\\Log\\SimpleLogger', $this->readAttribute($s, 'logger')); + fclose($r); + } + + public function testUsesLogger() + { + $logger = new SimpleLogger(); + $log = new LogSubscriber($logger); + $this->assertSame($logger, $this->readAttribute($log, 'logger')); + } + + public function testUsesFormatString() + { + $log = new LogSubscriber(null, '{test}'); + $formatter = $this->readAttribute($log, 'formatter'); + $this->assertEquals('{test}', $this->readAttribute($formatter, 'template')); + } + + public function testUsesFormatter() + { + $formatter = new Formatter(); + $log = new LogSubscriber(null, $formatter); + $this->assertSame($formatter, $this->readAttribute($log, 'formatter')); + } + + public function testLogsAfterSending() + { + $resource = fopen('php://temp', 'r+'); + $logger = new LogSubscriber($resource, '{code}'); + $client = new Client(); + $client->getEmitter()->attach($logger); + $client->getEmitter()->attach(new Mock([new Response(200)])); + $client->get('http://httbin.org/get'); + rewind($resource); + $this->assertEquals("[info] 200\n", stream_get_contents($resource)); + fclose($resource); + } + + public function testLogsAfterError() + { + $resource = fopen('php://temp', 'r+'); + $logger = new LogSubscriber($resource, '{code}'); + $client = new Client(); + $client->getEmitter()->attach($logger); + $client->getEmitter()->attach(new Mock([new Response(500)])); + try { + $client->get('http://httbin.org/get'); + } catch (\Exception $e) {} + rewind($resource); + $this->assertEquals("[critical] 500\n", stream_get_contents($resource)); + fclose($resource); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/SimpleLoggerTest.php b/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/SimpleLoggerTest.php new file mode 100644 index 00000000000..300687e7d15 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/log-subscriber/tests/SimpleLoggerTest.php @@ -0,0 +1,41 @@ +log('WARN', 'Test'); + rewind($resource); + $this->assertEquals("[WARN] Test\n", stream_get_contents($resource)); + fclose($resource); + } + + public function testLogsToCallable() + { + $called = false; + $c = function ($message) use (&$called) { + $this->assertEquals("[WARN] Test\n", $message); + $called = true; + }; + $logger = new SimpleLogger($c); + $logger->log('WARN', 'Test'); + $this->assertTrue($called); + } + + public function testLogsWithEcho() + { + ob_start(); + $logger = new SimpleLogger(); + $logger->log('WARN', 'Test'); + $result = ob_get_clean(); + $this->assertEquals("[WARN] Test\n", $result); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/.editorconfig b/upload/system/storage/vendor/guzzlehttp/ringphp/.editorconfig new file mode 100644 index 00000000000..70dabca1336 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[{Makefile,*.mk}] +indent_style = tab diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/.gitignore b/upload/system/storage/vendor/guzzlehttp/ringphp/.gitignore new file mode 100644 index 00000000000..290a9452417 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/.gitignore @@ -0,0 +1,4 @@ +vendor +build/artifacts/ +composer.lock +docs/_build/ diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/.travis.yml b/upload/system/storage/vendor/guzzlehttp/ringphp/.travis.yml new file mode 100644 index 00000000000..18562e4276b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/.travis.yml @@ -0,0 +1,43 @@ +language: php + +cache: + directories: + - $HOME/.composer/cache/files + +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - hhvm + - nightly + +env: + global: + - TEST_COMMAND="composer test" + +matrix: + allow_failures: + - php: hhvm + - php: nightly + fast_finish: true + include: + - php: 5.4 + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" + +before_install: + - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi + +install: + # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi + - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction + +before_script: + - ~/.nvm/nvm.sh install v0.6.14 + - ~/.nvm/nvm.sh run v0.6.14 + +script: + - $TEST_COMMAND diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/CHANGELOG.md b/upload/system/storage/vendor/guzzlehttp/ringphp/CHANGELOG.md new file mode 100644 index 00000000000..8e12bf3cc72 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/CHANGELOG.md @@ -0,0 +1,118 @@ +# Changelog + + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## [Unreleased] + + +## [1.1.1] - 2018-07-31 + +### Fixed + +- `continue` keyword usage on PHP 7.3 + + +## [1.1.0] - 2015-05-19 + +### Added + +- Added `CURL_HTTP_VERSION_2_0` + +### Changed + +- The PHP stream wrapper handler now sets `allow_self_signed` to `false` to + match the cURL handler when `verify` is set to `true` or a certificate file. +- Ensuring that a directory exists before using the `save_to` option. +- Response protocol version is now correctly extracted from a response. + +### Fixed + +- Fixed a bug in which the result of `CurlFactory::retryFailedRewind` did not + return an array. + + +## [1.0.7] - 2015-03-29 + +### Fixed + +- PHP 7 fixes. + + +## [1.0.6] - 2015-02-26 + +### Changed + +- The multi handle of the CurlMultiHandler is now created lazily. + +### Fixed + +- Bug fix: futures now extend from React's PromiseInterface to ensure that they + are properly forwarded down the promise chain. + + +## [1.0.5] - 2014-12-10 + +### Added + +- Adding more error information to PHP stream wrapper exceptions. +- Added digest auth integration test support to test server. + + +## [1.0.4] - 2014-12-01 + +### Added + +- Added support for older versions of cURL that do not have CURLOPT_TIMEOUT_MS. +- Added a fix to the StreamHandler to return a `FutureArrayInterface` when an + +### Changed + +- Setting debug to `false` does not enable debug output. error occurs. + + +## [1.0.3] - 2014-11-03 + +### Fixed + +- Setting the `header` stream option as a string to be compatible with GAE. +- Header parsing now ensures that header order is maintained in the parsed + message. + + +## [1.0.2] - 2014-10-28 + +### Fixed + +- Now correctly honoring a `version` option is supplied in a request. + See https://github.com/guzzle/RingPHP/pull/8 + + +## [1.0.1] - 2014-10-26 + +### Fixed + +- Fixed a header parsing issue with the `CurlHandler` and `CurlMultiHandler` + that caused cURL requests with multiple responses to merge repsonses together + (e.g., requests with digest authentication). + + +## 1.0.0 - 2014-10-12 + +- Initial release + + +[Unreleased]: https://github.com/guzzle/RingPHP/compare/1.1.1...HEAD +[1.1.1]: https://github.com/guzzle/RingPHP/compare/1.1.0...1.1.1 +[1.1.0]: https://github.com/guzzle/RingPHP/compare/1.0.7...1.1.0 +[1.0.7]: https://github.com/guzzle/RingPHP/compare/1.0.6...1.0.7 +[1.0.6]: https://github.com/guzzle/RingPHP/compare/1.0.5...1.0.6 +[1.0.5]: https://github.com/guzzle/RingPHP/compare/1.0.4...1.0.5 +[1.0.4]: https://github.com/guzzle/RingPHP/compare/1.0.3...1.0.4 +[1.0.3]: https://github.com/guzzle/RingPHP/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/guzzle/RingPHP/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/guzzle/RingPHP/compare/1.0.0...1.0.1 diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/LICENSE b/upload/system/storage/vendor/guzzlehttp/ringphp/LICENSE new file mode 100644 index 00000000000..71d3b783cb5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/Makefile b/upload/system/storage/vendor/guzzlehttp/ringphp/Makefile new file mode 100644 index 00000000000..21c812e3813 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/Makefile @@ -0,0 +1,46 @@ +all: clean coverage docs + +docs: + cd docs && make html + +view-docs: + open docs/_build/html/index.html + +start-server: stop-server + node tests/Client/server.js &> /dev/null & + +stop-server: + @PID=$(shell ps axo pid,command \ + | grep 'tests/Client/server.js' \ + | grep -v grep \ + | cut -f 1 -d " "\ + ) && [ -n "$$PID" ] && kill $$PID || true + +test: start-server + vendor/bin/phpunit $(TEST) + $(MAKE) stop-server + +coverage: start-server + vendor/bin/phpunit --coverage-html=build/artifacts/coverage $(TEST) + $(MAKE) stop-server + +view-coverage: + open build/artifacts/coverage/index.html + +clean: + rm -rf build/artifacts/* + cd docs && make clean + +tag: + $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1")) + @echo Tagging $(TAG) + chag update -m '$(TAG) ()' + git add -A + git commit -m '$(TAG) release' + chag tag + +perf: start-server + php tests/perf.php + $(MAKE) stop-server + +.PHONY: docs diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/README.rst b/upload/system/storage/vendor/guzzlehttp/ringphp/README.rst new file mode 100644 index 00000000000..10374e813b1 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/README.rst @@ -0,0 +1,46 @@ +======= +RingPHP +======= + +Provides a simple API and specification that abstracts away the details of HTTP +into a single PHP function. RingPHP be used to power HTTP clients and servers +through a PHP function that accepts a request hash and returns a response hash +that is fulfilled using a `promise `_, +allowing RingPHP to support both synchronous and asynchronous workflows. + +By abstracting the implementation details of different HTTP clients and +servers, RingPHP allows you to utilize pluggable HTTP clients and servers +without tying your application to a specific implementation. + +.. code-block:: php + + 'GET', + 'uri' => '/', + 'headers' => [ + 'host' => ['www.google.com'], + 'x-foo' => ['baz'] + ] + ]); + + $response->then(function (array $response) { + echo $response['status']; + }); + + $response->wait(); + +RingPHP is inspired by Clojure's `Ring `_, +which, in turn, was inspired by Python's WSGI and Ruby's Rack. RingPHP is +utilized as the handler layer in `Guzzle `_ 5.0+ to send +HTTP requests. + +Documentation +------------- + +See http://ringphp.readthedocs.org/ for the full online documentation. diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/composer.json b/upload/system/storage/vendor/guzzlehttp/ringphp/composer.json new file mode 100644 index 00000000000..8df60eccc65 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/composer.json @@ -0,0 +1,43 @@ +{ + "name": "guzzlehttp/ringphp", + "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.4.0", + "guzzlehttp/streams": "~3.0", + "react/promise": "~2.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "ext-curl": "Guzzle will use specific adapters if cURL is present" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Ring\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\Ring\\": "tests/" + } + }, + "scripts": { + "test": "make test", + "test-ci": "make coverage" + }, + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/Makefile b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/Makefile new file mode 100644 index 00000000000..51270aa5d39 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/GuzzleRing.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/GuzzleRing.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/GuzzleRing" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/GuzzleRing" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_handlers.rst b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_handlers.rst new file mode 100644 index 00000000000..3151f00216c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_handlers.rst @@ -0,0 +1,173 @@ +=============== +Client Handlers +=============== + +Client handlers accept a request array and return a future response array that +can be used synchronously as an array or asynchronously using a promise. + +Built-In Handlers +----------------- + +RingPHP comes with three built-in client handlers. + +Stream Handler +~~~~~~~~~~~~~~ + +The ``GuzzleHttp\Ring\Client\StreamHandler`` uses PHP's +`http stream wrapper `_ to send +requests. + +.. note:: + + This handler cannot send requests concurrently. + +You can provide an associative array of custom stream context options to the +StreamHandler using the ``stream_context`` key of the ``client`` request +option. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\StreamHandler; + + $response = $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => ['httpbin.org']], + 'client' => [ + 'stream_context' => [ + 'http' => [ + 'request_fulluri' => true, + 'method' => 'HEAD' + ], + 'socket' => [ + 'bindto' => '127.0.0.1:0' + ], + 'ssl' => [ + 'verify_peer' => false + ] + ] + ] + ]); + + // Even though it's already completed, you can still use a promise + $response->then(function ($response) { + echo $response['status']; // 200 + }); + + // Or access the response using the future interface + echo $response['status']; // 200 + +cURL Handler +~~~~~~~~~~~~ + +The ``GuzzleHttp\Ring\Client\CurlHandler`` can be used with PHP 5.5+ to send +requests using cURL easy handles. This handler is great for sending requests +one at a time because the execute and select loop is implemented in C code +which executes faster and consumes less memory than using PHP's +``curl_multi_*`` interface. + +.. note:: + + This handler cannot send requests concurrently. + +When using the CurlHandler, custom curl options can be specified as an +associative array of `cURL option constants `_ +mapping to values in the ``client`` option of a requst using the **curl** key. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlHandler; + + $handler = new CurlHandler(); + + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => ['curl' => [CURLOPT_LOW_SPEED_LIMIT => 10]] + ]; + + $response = $handler($request); + + // The response can be used directly as an array. + echo $response['status']; // 200 + + // Or, it can be used as a promise (that has already fulfilled). + $response->then(function ($response) { + echo $response['status']; // 200 + }); + +cURL Multi Handler +~~~~~~~~~~~~~~~~~~ + +The ``GuzzleHttp\Ring\Client\CurlMultiHandler`` transfers requests using +cURL's `multi API `_. The +``CurlMultiHandler`` is great for sending requests concurrently. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlMultiHandler; + + $handler = new CurlMultiHandler(); + + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]] + ]; + + // this call returns a future array immediately. + $response = $handler($request); + + // Ideally, you should use the promise API to not block. + $response + ->then(function ($response) { + // Got the response at some point in the future + echo $response['status']; // 200 + // Don't break the chain + return $response; + })->then(function ($response) { + // ... + }); + + // If you really need to block, then you can use the response as an + // associative array. This will block until it has completed. + echo $response['status']; // 200 + +Just like the ``CurlHandler``, the ``CurlMultiHandler`` accepts custom curl +option in the ``curl`` key of the ``client`` request option. + +Mock Handler +~~~~~~~~~~~~ + +The ``GuzzleHttp\Ring\Client\MockHandler`` is used to return mock responses. +When constructed, the handler can be configured to return the same response +array over and over, a future response, or a the evaluation of a callback +function. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\MockHandler; + + // Return a canned response. + $mock = new MockHandler(['status' => 200]); + $response = $mock([]); + assert(200 == $response['status']); + assert([] == $response['headers']); + +Implementing Handlers +--------------------- + +Client handlers are just PHP callables (functions or classes that have the +``__invoke`` magic method). The callable accepts a request array and MUST +return an instance of ``GuzzleHttp\Ring\Future\FutureArrayInterface`` so that +the response can be used by both blocking and non-blocking consumers. + +Handlers need to follow a few simple rules: + +1. Do not throw exceptions. If an error is encountered, return an array that + contains the ``error`` key that maps to an ``\Exception`` value. +2. If the request has a ``delay`` client option, then the handler should only + send the request after the specified delay time in seconds. Blocking + handlers may find it convenient to just let the + ``GuzzleHttp\Ring\Core::doSleep($request)`` function handle this for them. +3. Always return an instance of ``GuzzleHttp\Ring\Future\FutureArrayInterface``. +4. Complete any outstanding requests when the handler is destructed. diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_middleware.rst b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_middleware.rst new file mode 100644 index 00000000000..5a2c1a8abd0 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/client_middleware.rst @@ -0,0 +1,165 @@ +================= +Client Middleware +================= + +Middleware intercepts requests before they are sent over the wire and can be +used to add functionality to handlers. + +Modifying Requests +------------------ + +Let's say you wanted to modify requests before they are sent over the wire +so that they always add specific headers. This can be accomplished by creating +a function that accepts a handler and returns a new function that adds the +composed behavior. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlHandler; + + $handler = new CurlHandler(); + + $addHeaderHandler = function (callable $handler, array $headers = []) { + return function (array $request) use ($handler, $headers) { + // Add our custom headers + foreach ($headers as $key => $value) { + $request['headers'][$key] = $value; + } + + // Send the request using the handler and return the response. + return $handler($request); + } + }; + + // Create a new handler that adds headers to each request. + $handler = $addHeaderHandler($handler, [ + 'X-AddMe' => 'hello', + 'Authorization' => 'Basic xyz' + ]); + + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['Host' => ['httpbin.org']] + ]); + +Modifying Responses +------------------- + +You can change a response as it's returned from a middleware. Remember that +responses returned from an handler (including middleware) must implement +``GuzzleHttp\Ring\Future\FutureArrayInterface``. In order to be a good citizen, +you should not expect that the responses returned through your middleware will +be completed synchronously. Instead, you should use the +``GuzzleHttp\Ring\Core::proxy()`` function to modify the response when the +underlying promise is resolved. This function is a helper function that makes it +easy to create a new instance of ``FutureArrayInterface`` that wraps an existing +``FutureArrayInterface`` object. + +Let's say you wanted to add headers to a response as they are returned from +your middleware, but you want to make sure you aren't causing future +responses to be dereferenced right away. You can achieve this by modifying the +incoming request and using the ``Core::proxy`` function. + +.. code-block:: php + + use GuzzleHttp\Ring\Core; + use GuzzleHttp\Ring\Client\CurlHandler; + + $handler = new CurlHandler(); + + $responseHeaderHandler = function (callable $handler, array $headers) { + return function (array $request) use ($handler, $headers) { + // Send the request using the wrapped handler. + return Core::proxy($handler($request), function ($response) use ($headers) { + // Add the headers to the response when it is available. + foreach ($headers as $key => $value) { + $response['headers'][$key] = (array) $value; + } + // Note that you can return a regular response array when using + // the proxy method. + return $response; + }); + } + }; + + // Create a new handler that adds headers to each response. + $handler = $responseHeaderHandler($handler, ['X-Header' => 'hello!']); + + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['Host' => ['httpbin.org']] + ]); + + assert($response['headers']['X-Header'] == 'hello!'); + +Built-In Middleware +------------------- + +RingPHP comes with a few basic client middlewares that modify requests +and responses. + +Streaming Middleware +~~~~~~~~~~~~~~~~~~~~ + +If you want to send all requests with the ``streaming`` option to a specific +handler but other requests to a different handler, then use the streaming +middleware. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlHandler; + use GuzzleHttp\Ring\Client\StreamHandler; + use GuzzleHttp\Ring\Client\Middleware; + + $defaultHandler = new CurlHandler(); + $streamingHandler = new StreamHandler(); + $streamingHandler = Middleware::wrapStreaming( + $defaultHandler, + $streamingHandler + ); + + // Send the request using the streaming handler. + $response = $streamingHandler([ + 'http_method' => 'GET', + 'headers' => ['Host' => ['www.google.com']], + 'stream' => true + ]); + + // Send the request using the default handler. + $response = $streamingHandler([ + 'http_method' => 'GET', + 'headers' => ['Host' => ['www.google.com']] + ]); + +Future Middleware +~~~~~~~~~~~~~~~~~ + +If you want to send all requests with the ``future`` option to a specific +handler but other requests to a different handler, then use the future +middleware. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlHandler; + use GuzzleHttp\Ring\Client\CurlMultiHandler; + use GuzzleHttp\Ring\Client\Middleware; + + $defaultHandler = new CurlHandler(); + $futureHandler = new CurlMultiHandler(); + $futureHandler = Middleware::wrapFuture( + $defaultHandler, + $futureHandler + ); + + // Send the request using the blocking CurlHandler. + $response = $futureHandler([ + 'http_method' => 'GET', + 'headers' => ['Host' => ['www.google.com']] + ]); + + // Send the request using the non-blocking CurlMultiHandler. + $response = $futureHandler([ + 'http_method' => 'GET', + 'headers' => ['Host' => ['www.google.com']], + 'future' => true + ]); diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/conf.py b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/conf.py new file mode 100644 index 00000000000..c6404aa1e14 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/conf.py @@ -0,0 +1,23 @@ +import sys, os +import sphinx_rtd_theme +from sphinx.highlighting import lexers +from pygments.lexers.web import PhpLexer + + +lexers['php'] = PhpLexer(startinline=True, linenos=1) +lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) +primary_domain = 'php' + +extensions = [] +templates_path = ['_templates'] +source_suffix = '.rst' +master_doc = 'index' +project = u'RingPHP' +copyright = u'2014, Michael Dowling' +version = '1.0.0-alpha' +exclude_patterns = ['_build'] + +html_title = "RingPHP" +html_short_title = "RingPHP" +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/futures.rst b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/futures.rst new file mode 100644 index 00000000000..af29cb3780c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/futures.rst @@ -0,0 +1,164 @@ +======= +Futures +======= + +Futures represent a computation that may have not yet completed. RingPHP +uses hybrid of futures and promises to provide a consistent API that can be +used for both blocking and non-blocking consumers. + +Promises +-------- + +You can get the result of a future when it is ready using the promise interface +of a future. Futures expose a promise API via a ``then()`` method that utilizes +`React's promise library `_. You should +use this API when you do not wish to block. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlMultiHandler; + + $request = [ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => ['httpbin.org']] + ]; + + $response = $handler($request); + + // Use the then() method to use the promise API of the future. + $response->then(function ($response) { + echo $response['status']; + }); + +You can get the promise used by a future, an instance of +``React\Promise\PromiseInterface``, by calling the ``promise()`` method. + +.. code-block:: php + + $response = $handler($request); + $promise = $response->promise(); + $promise->then(function ($response) { + echo $response['status']; + }); + +This promise value can be used with React's +`aggregate promise functions `_. + +Waiting +------- + +You can wait on a future to complete and retrieve the value, or *dereference* +the future, using the ``wait()`` method. Calling the ``wait()`` method of a +future will block until the result is available. The result is then returned or +an exception is thrown if and exception was encountered while waiting on the +the result. Subsequent calls to dereference a future will return the previously +completed result or throw the previously encountered exception. Futures can be +cancelled, which stops the computation if possible. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlMultiHandler; + + $response = $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => ['httpbin.org']] + ]); + + // You can explicitly call block to wait on a result. + $realizedResponse = $response->wait(); + + // Future responses can be used like a regular PHP array. + echo $response['status']; + +In addition to explicitly calling the ``wait()`` function, using a future like +a normal value will implicitly trigger the ``wait()`` function. + +Future Responses +---------------- + +RingPHP uses futures to return asynchronous responses immediately. Client +handlers always return future responses that implement +``GuzzleHttp\Ring\Future\ArrayFutureInterface``. These future responses act +just like normal PHP associative arrays for blocking access and provide a +promise interface for non-blocking access. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlMultiHandler; + + $handler = new CurlMultiHandler(); + + $request = [ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['Host' => ['www.google.com']] + ]; + + $response = $handler($request); + + // Use the promise API for non-blocking access to the response. The actual + // response value will be delivered to the promise. + $response->then(function ($response) { + echo $response['status']; + }); + + // You can wait (block) until the future is completed. + $response->wait(); + + // This will implicitly call wait(), and will block too! + $response['status']; + +.. important:: + + Futures that are not completed by the time the underlying handler is + destructed will be completed when the handler is shutting down. + +Cancelling +---------- + +Futures can be cancelled if they have not already been dereferenced. + +RingPHP futures are typically implemented with the +``GuzzleHttp\Ring\Future\BaseFutureTrait``. This trait provides the cancellation +functionality that should be common to most implementations. Cancelling a +future response will try to prevent the request from sending over the wire. + +When a future is cancelled, the cancellation function is invoked and performs +the actual work needed to cancel the request from sending if possible +(e.g., telling an event loop to stop sending a request or to close a socket). +If no cancellation function is provided, then a request cannot be cancelled. If +a cancel function is provided, then it should accept the future as an argument +and return true if the future was successfully cancelled or false if it could +not be cancelled. + +Wrapping an existing Promise +---------------------------- + +You can easily create a future from any existing promise using the +``GuzzleHttp\Ring\Future\FutureValue`` class. This class's constructor +accepts a promise as the first argument, a wait function as the second +argument, and a cancellation function as the third argument. The dereference +function is used to force the promise to resolve (for example, manually ticking +an event loop). The cancel function is optional and is used to tell the thing +that created the promise that it can stop computing the result (for example, +telling an event loop to stop transferring a request). + +.. code-block:: php + + use GuzzleHttp\Ring\Future\FutureValue; + use React\Promise\Deferred; + + $deferred = new Deferred(); + $promise = $deferred->promise(); + + $f = new FutureValue( + $promise, + function () use ($deferred) { + // This function is responsible for blocking and resolving the + // promise. Here we pass in a reference to the deferred so that + // it can be resolved or rejected. + $deferred->resolve('foo'); + } + ); diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/index.rst b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/index.rst new file mode 100644 index 00000000000..4bbce631c70 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/index.rst @@ -0,0 +1,50 @@ +======= +RingPHP +======= + +Provides a simple API and specification that abstracts away the details of HTTP +into a single PHP function. RingPHP be used to power HTTP clients and servers +through a PHP function that accepts a request hash and returns a response hash +that is fulfilled using a `promise `_, +allowing RingPHP to support both synchronous and asynchronous workflows. + +By abstracting the implementation details of different HTTP clients and +servers, RingPHP allows you to utilize pluggable HTTP clients and servers +without tying your application to a specific implementation. + +.. toctree:: + :maxdepth: 2 + + spec + futures + client_middleware + client_handlers + testing + +.. code-block:: php + + 'GET', + 'uri' => '/', + 'headers' => [ + 'host' => ['www.google.com'], + 'x-foo' => ['baz'] + ] + ]); + + $response->then(function (array $response) { + echo $response['status']; + }); + + $response->wait(); + +RingPHP is inspired by Clojure's `Ring `_, +which, in turn, was inspired by Python's WSGI and Ruby's Rack. RingPHP is +utilized as the handler layer in `Guzzle `_ 5.0+ to send +HTTP requests. diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/requirements.txt b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/requirements.txt new file mode 100644 index 00000000000..483a4e9600b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/requirements.txt @@ -0,0 +1 @@ +sphinx_rtd_theme diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/spec.rst b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/spec.rst new file mode 100644 index 00000000000..bc9107898f4 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/spec.rst @@ -0,0 +1,311 @@ +============= +Specification +============= + +RingPHP applications consist of handlers, requests, responses, and +middleware. + +Handlers +-------- + +Handlers are implemented as a PHP ``callable`` that accept a request array +and return a response array (``GuzzleHttp\Ring\Future\FutureArrayInterface``). + +For example: + +.. code-block:: php + + use GuzzleHttp\Ring\Future\CompletedFutureArray; + + $mockHandler = function (array $request) { + return new CompletedFutureArray([ + 'status' => 200, + 'headers' => ['X-Foo' => ['Bar']], + 'body' => 'Hello!' + ]); + }; + +This handler returns the same response each time it is invoked. All RingPHP +handlers must return a ``GuzzleHttp\Ring\Future\FutureArrayInterface``. Use +``GuzzleHttp\Ring\Future\CompletedFutureArray`` when returning a response that +has already completed. + +Requests +-------- + +A request array is a PHP associative array that contains the configuration +settings need to send a request. + +.. code-block:: php + + $request = [ + 'http_method' => 'GET', + 'scheme' => 'http', + 'uri' => '/', + 'body' => 'hello!', + 'client' => ['timeout' => 1.0], + 'headers' => [ + 'host' => ['httpbin.org'], + 'X-Foo' => ['baz', 'bar'] + ] + ]; + +The request array contains the following key value pairs: + +request_method + (string, required) The HTTP request method, must be all caps corresponding + to a HTTP request method, such as ``GET`` or ``POST``. + +scheme + (string) The transport protocol, must be one of ``http`` or ``https``. + Defaults to ``http``. + +uri + (string, required) The request URI excluding the query string. Must + start with "/". + +query_string + (string) The query string, if present (e.g., ``foo=bar``). + +version + (string) HTTP protocol version. Defaults to ``1.1``. + +headers + (required, array) Associative array of headers. Each key represents the + header name. Each value contains an array of strings where each entry of + the array SHOULD be sent over the wire on a separate header line. + +body + (string, fopen resource, ``Iterator``, ``GuzzleHttp\Stream\StreamInterface``) + The body of the request, if present. Can be a string, resource returned + from fopen, an ``Iterator`` that yields chunks of data, an object that + implemented ``__toString``, or a ``GuzzleHttp\Stream\StreamInterface``. + +future + (bool, string) Controls the asynchronous behavior of a response. + + Set to ``true`` or omit the ``future`` option to *request* that a request + will be completed asynchronously. Keep in mind that your request might not + necessarily be completed asynchronously based on the handler you are using. + Set the ``future`` option to ``false`` to request that a synchronous + response be provided. + + You can provide a string value to specify fine-tuned future behaviors that + may be specific to the underlying handlers you are using. There are, + however, some common future options that handlers should implement if + possible. + + lazy + Requests that the handler does not open and send the request + immediately, but rather only opens and sends the request once the + future is dereferenced. This option is often useful for sending a large + number of requests concurrently to allow handlers to take better + advantage of non-blocking transfers by first building up a pool of + requests. + + If an handler does not implement or understand a provided string value, + then the request MUST be treated as if the user provided ``true`` rather + than the string value. + + Future responses created by asynchronous handlers MUST attempt to complete + any outstanding future responses when they are destructed. Asynchronous + handlers MAY choose to automatically complete responses when the number + of outstanding requests reaches an handler-specific threshold. + +Client Specific Options +~~~~~~~~~~~~~~~~~~~~~~~ + +The following options are only used in ring client handlers. + +.. _client-options: + +client + (array) Associative array of client specific transfer options. The + ``client`` request key value pair can contain the following keys: + + cert + (string, array) Set to a string to specify the path to a file + containing a PEM formatted SSL client side certificate. If a password + is required, then set ``cert`` to an array containing the path to the + PEM file in the first array element followed by the certificate + password in the second array element. + + connect_timeout + (float) Float describing the number of seconds to wait while trying to + connect to a server. Use ``0`` to wait indefinitely (the default + behavior). + + debug + (bool, fopen() resource) Set to true or set to a PHP stream returned by + fopen() to enable debug output with the handler used to send a request. + If set to ``true``, the output is written to PHP's STDOUT. If a PHP + ``fopen`` resource handle is provided, the output is written to the + stream. + + "Debug output" is handler specific: different handlers will yield + different output and various various level of detail. For example, when + using cURL to transfer requests, cURL's `CURLOPT_VERBOSE `_ + will be used. When using the PHP stream wrapper, `stream notifications `_ + will be emitted. + + decode_content + (bool) Specify whether or not ``Content-Encoding`` responses + (gzip, deflate, etc.) are automatically decoded. Set to ``true`` to + automatically decode encoded responses. Set to ``false`` to not decode + responses. By default, content is *not* decoded automatically. + + delay + (int) The number of milliseconds to delay before sending the request. + This is often used for delaying before retrying a request. Handlers + SHOULD implement this if possible, but it is not a strict requirement. + + progress + (function) Defines a function to invoke when transfer progress is made. + The function accepts the following arguments: + + 1. The total number of bytes expected to be downloaded + 2. The number of bytes downloaded so far + 3. The number of bytes expected to be uploaded + 4. The number of bytes uploaded so far + + proxy + (string, array) Pass a string to specify an HTTP proxy, or an + associative array to specify different proxies for different protocols + where the scheme is the key and the value is the proxy address. + + .. code-block:: php + + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => ['httpbin.org']], + 'client' => [ + // Use different proxies for different URI schemes. + 'proxy' => [ + 'http' => 'http://proxy.example.com:5100', + 'https' => 'https://proxy.example.com:6100' + ] + ] + ]; + + ssl_key + (string, array) Specify the path to a file containing a private SSL key + in PEM format. If a password is required, then set to an array + containing the path to the SSL key in the first array element followed + by the password required for the certificate in the second element. + + save_to + (string, fopen resource, ``GuzzleHttp\Stream\StreamInterface``) + Specifies where the body of the response is downloaded. Pass a string to + open a local file on disk and save the output to the file. Pass an fopen + resource to save the output to a PHP stream resource. Pass a + ``GuzzleHttp\Stream\StreamInterface`` to save the output to a Guzzle + StreamInterface. Omitting this option will typically save the body of a + response to a PHP temp stream. + + stream + (bool) Set to true to stream a response rather than download it all + up-front. This option will only be utilized when the corresponding + handler supports it. + + timeout + (float) Float describing the timeout of the request in seconds. Use 0 to + wait indefinitely (the default behavior). + + verify + (bool, string) Describes the SSL certificate verification behavior of a + request. Set to true to enable SSL certificate verification using the + system CA bundle when available (the default). Set to false to disable + certificate verification (this is insecure!). Set to a string to provide + the path to a CA bundle on disk to enable verification using a custom + certificate. + + version + (string) HTTP protocol version to use with the request. + +Server Specific Options +~~~~~~~~~~~~~~~~~~~~~~~ + +The following options are only used in ring server handlers. + +server_port + (integer) The port on which the request is being handled. This is only + used with ring servers, and is required. + +server_name + (string) The resolved server name, or the server IP address. Required when + using a Ring server. + +remote_addr + (string) The IP address of the client or the last proxy that sent the + request. Required when using a Ring server. + +Responses +--------- + +A response is an array-like object that implements +``GuzzleHttp\Ring\Future\FutureArrayInterface``. Responses contain the +following key value pairs: + +body + (string, fopen resource, ``Iterator``, ``GuzzleHttp\Stream\StreamInterface``) + The body of the response, if present. Can be a string, resource returned + from fopen, an ``Iterator`` that yields chunks of data, an object that + implemented ``__toString``, or a ``GuzzleHttp\Stream\StreamInterface``. + +effective_url + (string) The URL that returned the resulting response. + +error + (``\Exception``) Contains an exception describing any errors that were + encountered during the transfer. + +headers + (Required, array) Associative array of headers. Each key represents the + header name. Each value contains an array of strings where each entry of + the array is a header line. The headers array MAY be an empty array in the + event an error occurred before a response was received. + +reason + (string) Optional reason phrase. This option should be provided when the + reason phrase does not match the typical reason phrase associated with the + ``status`` code. See `RFC 7231 `_ + for a list of HTTP reason phrases mapped to status codes. + +status + (Required, integer) The HTTP status code. The status code MAY be set to + ``null`` in the event an error occurred before a response was received + (e.g., a networking error). + +transfer_stats + (array) Provides an associative array of arbitrary transfer statistics if + provided by the underlying handler. + +version + (string) HTTP protocol version. Defaults to ``1.1``. + +Middleware +---------- + +Ring middleware augments the functionality of handlers by invoking them in the +process of generating responses. Middleware is typically implemented as a +higher-order function that takes one or more handlers as arguments followed by +an optional associative array of options as the last argument, returning a new +handler with the desired compound behavior. + +Here's an example of a middleware that adds a Content-Type header to each +request. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\CurlHandler; + use GuzzleHttp\Ring\Core; + + $contentTypeHandler = function(callable $handler, $contentType) { + return function (array $request) use ($handler, $contentType) { + return $handler(Core::setHeader('Content-Type', $contentType)); + }; + }; + + $baseHandler = new CurlHandler(); + $wrappedHandler = $contentTypeHandler($baseHandler, 'text/html'); + $response = $wrappedHandler([/** request hash **/]); diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/docs/testing.rst b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/testing.rst new file mode 100644 index 00000000000..9df2562ed42 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/docs/testing.rst @@ -0,0 +1,74 @@ +======= +Testing +======= + +RingPHP tests client handlers using `PHPUnit `_ and a +built-in node.js web server. + +Running Tests +------------- + +First, install the dependencies using `Composer `_. + + composer.phar install + +Next, run the unit tests using ``Make``. + + make test + +The tests are also run on Travis-CI on each commit: https://travis-ci.org/guzzle/guzzle-ring + +Test Server +----------- + +Testing client handlers usually involves actually sending HTTP requests. +RingPHP provides a node.js web server that returns canned responses and +keep a list of the requests that have been received. The server can then +be queried to get a list of the requests that were sent by the client so that +you can ensure that the client serialized and transferred requests as intended. + +The server keeps a list of queued responses and returns responses that are +popped off of the queue as HTTP requests are received. When there are not +more responses to serve, the server returns a 500 error response. + +The test server uses the ``GuzzleHttp\Tests\Ring\Client\Server`` class to +control the server. + +.. code-block:: php + + use GuzzleHttp\Ring\Client\StreamHandler; + use GuzzleHttp\Tests\Ring\Client\Server; + + // First return a 200 followed by a 404 response. + Server::enqueue([ + ['status' => 200], + ['status' => 404] + ]); + + $handler = new StreamHandler(); + + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'uri' => '/' + ]); + + assert(200 == $response['status']); + + $response = $handler([ + 'http_method' => 'HEAD', + 'headers' => ['host' => [Server::$host]], + 'uri' => '/' + ]); + + assert(404 == $response['status']); + +After requests have been sent, you can get a list of the requests as they +were sent over the wire to ensure they were sent correctly. + +.. code-block:: php + + $received = Server::received(); + + assert('GET' == $received[0]['http_method']); + assert('HEAD' == $received[1]['http_method']); diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/phpunit.xml.dist b/upload/system/storage/vendor/guzzlehttp/ringphp/phpunit.xml.dist new file mode 100644 index 00000000000..1d192902507 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/phpunit.xml.dist @@ -0,0 +1,14 @@ + + + + + tests + + + + + src + + + diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/ClientUtils.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/ClientUtils.php new file mode 100644 index 00000000000..27d5fe7eaf6 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/ClientUtils.php @@ -0,0 +1,74 @@ +getDefaultOptions($request, $headers); + $this->applyMethod($request, $options); + + if (isset($request['client'])) { + $this->applyHandlerOptions($request, $options); + } + + $this->applyHeaders($request, $options); + unset($options['_headers']); + + // Add handler options from the request's configuration options + if (isset($request['client']['curl'])) { + $options = $this->applyCustomCurlOptions( + $request['client']['curl'], + $options + ); + } + + if (!$handle) { + $handle = curl_init(); + } + + $body = $this->getOutputBody($request, $options); + curl_setopt_array($handle, $options); + + return [$handle, &$headers, $body]; + } + + /** + * Creates a response hash from a cURL result. + * + * @param callable $handler Handler that was used. + * @param array $request Request that sent. + * @param array $response Response hash to update. + * @param array $headers Headers received during transfer. + * @param resource $body Body fopen response. + * + * @return array + */ + public static function createResponse( + callable $handler, + array $request, + array $response, + array $headers, + $body + ) { + if (isset($response['transfer_stats']['url'])) { + $response['effective_url'] = $response['transfer_stats']['url']; + } + + if (!empty($headers)) { + $startLine = explode(' ', array_shift($headers), 3); + $headerList = Core::headersFromLines($headers); + $response['headers'] = $headerList; + $response['version'] = isset($startLine[0]) ? substr($startLine[0], 5) : null; + $response['status'] = isset($startLine[1]) ? (int) $startLine[1] : null; + $response['reason'] = isset($startLine[2]) ? $startLine[2] : null; + $response['body'] = $body; + Core::rewindBody($response); + } + + return !empty($response['curl']['errno']) || !isset($response['status']) + ? self::createErrorResponse($handler, $request, $response) + : $response; + } + + private static function createErrorResponse( + callable $handler, + array $request, + array $response + ) { + static $connectionErrors = [ + CURLE_OPERATION_TIMEOUTED => true, + CURLE_COULDNT_RESOLVE_HOST => true, + CURLE_COULDNT_CONNECT => true, + CURLE_SSL_CONNECT_ERROR => true, + CURLE_GOT_NOTHING => true, + ]; + + // Retry when nothing is present or when curl failed to rewind. + if (!isset($response['err_message']) + && (empty($response['curl']['errno']) + || $response['curl']['errno'] == 65) + ) { + return self::retryFailedRewind($handler, $request, $response); + } + + $message = isset($response['err_message']) + ? $response['err_message'] + : sprintf('cURL error %s: %s', + $response['curl']['errno'], + isset($response['curl']['error']) + ? $response['curl']['error'] + : 'See http://curl.haxx.se/libcurl/c/libcurl-errors.html'); + + $error = isset($response['curl']['errno']) + && isset($connectionErrors[$response['curl']['errno']]) + ? new ConnectException($message) + : new RingException($message); + + return $response + [ + 'status' => null, + 'reason' => null, + 'body' => null, + 'headers' => [], + 'error' => $error, + ]; + } + + private function getOutputBody(array $request, array &$options) + { + // Determine where the body of the response (if any) will be streamed. + if (isset($options[CURLOPT_WRITEFUNCTION])) { + return $request['client']['save_to']; + } + + if (isset($options[CURLOPT_FILE])) { + return $options[CURLOPT_FILE]; + } + + if ($request['http_method'] != 'HEAD') { + // Create a default body if one was not provided + return $options[CURLOPT_FILE] = fopen('php://temp', 'w+'); + } + + return null; + } + + private function getDefaultOptions(array $request, array &$headers) + { + $url = Core::url($request); + $startingResponse = false; + + $options = [ + '_headers' => $request['headers'], + CURLOPT_CUSTOMREQUEST => $request['http_method'], + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => false, + CURLOPT_HEADER => false, + CURLOPT_CONNECTTIMEOUT => 150, + CURLOPT_HEADERFUNCTION => function ($ch, $h) use (&$headers, &$startingResponse) { + $value = trim($h); + if ($value === '') { + $startingResponse = true; + } elseif ($startingResponse) { + $startingResponse = false; + $headers = [$value]; + } else { + $headers[] = $value; + } + return strlen($h); + }, + ]; + + if (isset($request['version'])) { + if ($request['version'] == 2.0) { + $options[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; + } else if ($request['version'] == 1.1) { + $options[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; + } else { + $options[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; + } + } + + if (defined('CURLOPT_PROTOCOLS')) { + $options[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; + } + + return $options; + } + + private function applyMethod(array $request, array &$options) + { + if (isset($request['body'])) { + $this->applyBody($request, $options); + return; + } + + switch ($request['http_method']) { + case 'PUT': + case 'POST': + // See http://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!Core::hasHeader($request, 'Content-Length')) { + $options[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + break; + case 'HEAD': + $options[CURLOPT_NOBODY] = true; + unset( + $options[CURLOPT_WRITEFUNCTION], + $options[CURLOPT_READFUNCTION], + $options[CURLOPT_FILE], + $options[CURLOPT_INFILE] + ); + } + } + + private function applyBody(array $request, array &$options) + { + $contentLength = Core::firstHeader($request, 'Content-Length'); + $size = $contentLength !== null ? (int) $contentLength : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [client][curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || + isset($request['client']['curl']['body_as_string']) || + is_string($request['body']) + ) { + $options[CURLOPT_POSTFIELDS] = Core::body($request); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $options); + $this->removeHeader('Transfer-Encoding', $options); + } else { + $options[CURLOPT_UPLOAD] = true; + if ($size !== null) { + // Let cURL handle setting the Content-Length header + $options[CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $options); + } + $this->addStreamingBody($request, $options); + } + + // If the Expect header is not present, prevent curl from adding it + if (!Core::hasHeader($request, 'Expect')) { + $options[CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!Core::hasHeader($request, 'Content-Type')) { + $options[CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function addStreamingBody(array $request, array &$options) + { + $body = $request['body']; + + if ($body instanceof StreamInterface) { + $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { + return (string) $body->read($length); + }; + if (!isset($options[CURLOPT_INFILESIZE])) { + if ($size = $body->getSize()) { + $options[CURLOPT_INFILESIZE] = $size; + } + } + } elseif (is_resource($body)) { + $options[CURLOPT_INFILE] = $body; + } elseif ($body instanceof \Iterator) { + $buf = ''; + $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body, &$buf) { + if ($body->valid()) { + $buf .= $body->current(); + $body->next(); + } + $result = (string) substr($buf, 0, $length); + $buf = substr($buf, $length); + return $result; + }; + } else { + throw new \InvalidArgumentException('Invalid request body provided'); + } + } + + private function applyHeaders(array $request, array &$options) + { + foreach ($options['_headers'] as $name => $values) { + foreach ($values as $value) { + $options[CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + + // Remove the Accept header if one was not set + if (!Core::hasHeader($request, 'Accept')) { + $options[CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Takes an array of curl options specified in the 'curl' option of a + * request's configuration array and maps them to CURLOPT_* options. + * + * This method is only called when a request has a 'curl' config setting. + * + * @param array $config Configuration array of custom curl option + * @param array $options Array of existing curl options + * + * @return array Returns a new array of curl options + */ + private function applyCustomCurlOptions(array $config, array $options) + { + $curlOptions = []; + foreach ($config as $key => $value) { + if (is_int($key)) { + $curlOptions[$key] = $value; + } + } + + return $curlOptions + $options; + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader($name, array &$options) + { + foreach (array_keys($options['_headers']) as $key) { + if (!strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + return; + } + } + } + + /** + * Applies an array of request client options to a the options array. + * + * This method uses a large switch rather than double-dispatch to save on + * high overhead of calling functions in PHP. + */ + private function applyHandlerOptions(array $request, array &$options) + { + foreach ($request['client'] as $key => $value) { + switch ($key) { + // Violating PSR-4 to provide more room. + case 'verify': + + if ($value === false) { + unset($options[CURLOPT_CAINFO]); + $options[CURLOPT_SSL_VERIFYHOST] = 0; + $options[CURLOPT_SSL_VERIFYPEER] = false; + continue 2; + } + + $options[CURLOPT_SSL_VERIFYHOST] = 2; + $options[CURLOPT_SSL_VERIFYPEER] = true; + + if (is_string($value)) { + $options[CURLOPT_CAINFO] = $value; + if (!file_exists($value)) { + throw new \InvalidArgumentException( + "SSL CA bundle not found: $value" + ); + } + } + break; + + case 'decode_content': + + if ($value === false) { + continue 2; + } + + $accept = Core::firstHeader($request, 'Accept-Encoding'); + if ($accept) { + $options[CURLOPT_ENCODING] = $accept; + } else { + $options[CURLOPT_ENCODING] = ''; + // Don't let curl send the header over the wire + $options[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + break; + + case 'save_to': + + if (is_string($value)) { + if (!is_dir(dirname($value))) { + throw new \RuntimeException(sprintf( + 'Directory %s does not exist for save_to value of %s', + dirname($value), + $value + )); + } + $value = new LazyOpenStream($value, 'w+'); + } + + if ($value instanceof StreamInterface) { + $options[CURLOPT_WRITEFUNCTION] = + function ($ch, $write) use ($value) { + return $value->write($write); + }; + } elseif (is_resource($value)) { + $options[CURLOPT_FILE] = $value; + } else { + throw new \InvalidArgumentException('save_to must be a ' + . 'GuzzleHttp\Stream\StreamInterface or resource'); + } + break; + + case 'timeout': + + if (defined('CURLOPT_TIMEOUT_MS')) { + $options[CURLOPT_TIMEOUT_MS] = $value * 1000; + } else { + $options[CURLOPT_TIMEOUT] = $value; + } + break; + + case 'connect_timeout': + + if (defined('CURLOPT_CONNECTTIMEOUT_MS')) { + $options[CURLOPT_CONNECTTIMEOUT_MS] = $value * 1000; + } else { + $options[CURLOPT_CONNECTTIMEOUT] = $value; + } + break; + + case 'proxy': + + if (!is_array($value)) { + $options[CURLOPT_PROXY] = $value; + } elseif (isset($request['scheme'])) { + $scheme = $request['scheme']; + if (isset($value[$scheme])) { + $options[CURLOPT_PROXY] = $value[$scheme]; + } + } + break; + + case 'cert': + + if (is_array($value)) { + $options[CURLOPT_SSLCERTPASSWD] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new \InvalidArgumentException( + "SSL certificate not found: {$value}" + ); + } + + $options[CURLOPT_SSLCERT] = $value; + break; + + case 'ssl_key': + + if (is_array($value)) { + $options[CURLOPT_SSLKEYPASSWD] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new \InvalidArgumentException( + "SSL private key not found: {$value}" + ); + } + + $options[CURLOPT_SSLKEY] = $value; + break; + + case 'progress': + + if (!is_callable($value)) { + throw new \InvalidArgumentException( + 'progress client option must be callable' + ); + } + + $options[CURLOPT_NOPROGRESS] = false; + $options[CURLOPT_PROGRESSFUNCTION] = + function () use ($value) { + $args = func_get_args(); + // PHP 5.5 pushed the handle onto the start of the args + if (is_resource($args[0])) { + array_shift($args); + } + call_user_func_array($value, $args); + }; + break; + + case 'debug': + + if ($value) { + $options[CURLOPT_STDERR] = Core::getDebugResource($value); + $options[CURLOPT_VERBOSE] = true; + } + break; + } + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + */ + private static function retryFailedRewind( + callable $handler, + array $request, + array $response + ) { + // If there is no body, then there is some other kind of issue. This + // is weird and should probably never happen. + if (!isset($request['body'])) { + $response['err_message'] = 'No response was received for a request ' + . 'with no body. This could mean that you are saturating your ' + . 'network.'; + return self::createErrorResponse($handler, $request, $response); + } + + if (!Core::rewindBody($request)) { + $response['err_message'] = 'The connection unexpectedly failed ' + . 'without providing an error. The request would have been ' + . 'retried, but attempting to rewind the request body failed.'; + return self::createErrorResponse($handler, $request, $response); + } + + // Retry no more than 3 times before giving up. + if (!isset($request['curl']['retries'])) { + $request['curl']['retries'] = 1; + } elseif ($request['curl']['retries'] == 2) { + $response['err_message'] = 'The cURL request was retried 3 times ' + . 'and did no succeed. 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::createErrorResponse($handler, $request, $response); + } else { + $request['curl']['retries']++; + } + + return $handler($request); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php new file mode 100644 index 00000000000..e00aa4eaca3 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlHandler.php @@ -0,0 +1,135 @@ +handles = $this->ownedHandles = []; + $this->factory = isset($options['handle_factory']) + ? $options['handle_factory'] + : new CurlFactory(); + $this->maxHandles = isset($options['max_handles']) + ? $options['max_handles'] + : 5; + } + + public function __destruct() + { + foreach ($this->handles as $handle) { + if (is_resource($handle)) { + curl_close($handle); + } + } + } + + /** + * @param array $request + * + * @return CompletedFutureArray + */ + public function __invoke(array $request) + { + return new CompletedFutureArray( + $this->_invokeAsArray($request) + ); + } + + /** + * @internal + * + * @param array $request + * + * @return array + */ + public function _invokeAsArray(array $request) + { + $factory = $this->factory; + + // Ensure headers are by reference. They're updated elsewhere. + $result = $factory($request, $this->checkoutEasyHandle()); + $h = $result[0]; + $hd =& $result[1]; + $bd = $result[2]; + Core::doSleep($request); + curl_exec($h); + $response = ['transfer_stats' => curl_getinfo($h)]; + $response['curl']['error'] = curl_error($h); + $response['curl']['errno'] = curl_errno($h); + $response['transfer_stats'] = array_merge($response['transfer_stats'], $response['curl']); + $this->releaseEasyHandle($h); + + return CurlFactory::createResponse([$this, '_invokeAsArray'], $request, $response, $hd, $bd); + } + + private function checkoutEasyHandle() + { + // Find an unused handle in the cache + if (false !== ($key = array_search(false, $this->ownedHandles, true))) { + $this->ownedHandles[$key] = true; + return $this->handles[$key]; + } + + // Add a new handle + $handle = curl_init(); + $id = (int) $handle; + $this->handles[$id] = $handle; + $this->ownedHandles[$id] = true; + + return $handle; + } + + private function releaseEasyHandle($handle) + { + $id = (int) $handle; + if (count($this->ownedHandles) > $this->maxHandles) { + curl_close($this->handles[$id]); + unset($this->handles[$id], $this->ownedHandles[$id]); + } else { + // curl_reset doesn't clear these out for some reason + static $unsetValues = [ + CURLOPT_HEADERFUNCTION => null, + CURLOPT_WRITEFUNCTION => null, + CURLOPT_READFUNCTION => null, + CURLOPT_PROGRESSFUNCTION => null, + ]; + curl_setopt_array($handle, $unsetValues); + curl_reset($handle); + $this->ownedHandles[$id] = false; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php new file mode 100644 index 00000000000..f84cf19939a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/CurlMultiHandler.php @@ -0,0 +1,248 @@ +_mh = $options['mh']; + } + $this->factory = isset($options['handle_factory']) + ? $options['handle_factory'] : new CurlFactory(); + $this->selectTimeout = isset($options['select_timeout']) + ? $options['select_timeout'] : 1; + $this->maxHandles = isset($options['max_handles']) + ? $options['max_handles'] : 100; + } + + public function __get($name) + { + if ($name === '_mh') { + return $this->_mh = curl_multi_init(); + } + + throw new \BadMethodCallException(); + } + + public function __destruct() + { + // Finish any open connections before terminating the script. + if ($this->handles) { + $this->execute(); + } + + if (isset($this->_mh)) { + curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(array $request) + { + $factory = $this->factory; + $result = $factory($request); + $entry = [ + 'request' => $request, + 'response' => [], + 'handle' => $result[0], + 'headers' => &$result[1], + 'body' => $result[2], + 'deferred' => new Deferred(), + ]; + + $id = (int) $result[0]; + + $future = new FutureArray( + $entry['deferred']->promise(), + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest($entry); + + // Transfer outstanding requests if there are too many open handles. + if (count($this->handles) >= $this->maxHandles) { + $this->execute(); + } + + return $future; + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute() + { + do { + + if ($this->active && + curl_multi_select($this->_mh, $this->selectTimeout) === -1 + ) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + usleep(250); + } + + // Add any delayed futures if needed. + if ($this->delays) { + $this->addDelays(); + } + + do { + $mrc = curl_multi_exec($this->_mh, $this->active); + } while ($mrc === CURLM_CALL_MULTI_PERFORM); + + $this->processMessages(); + + // If there are delays but no transfers, then sleep for a bit. + if (!$this->active && $this->delays) { + usleep(500); + } + + } while ($this->active || $this->handles); + } + + private function addRequest(array &$entry) + { + $id = (int) $entry['handle']; + $this->handles[$id] = $entry; + + // If the request is a delay, then add the reques to the curl multi + // pool only after the specified delay. + if (isset($entry['request']['client']['delay'])) { + $this->delays[$id] = microtime(true) + ($entry['request']['client']['delay'] / 1000); + } elseif (empty($entry['request']['future'])) { + curl_multi_add_handle($this->_mh, $entry['handle']); + } else { + curl_multi_add_handle($this->_mh, $entry['handle']); + // "lazy" futures are only sent once the pool has many requests. + if ($entry['request']['future'] !== 'lazy') { + do { + $mrc = curl_multi_exec($this->_mh, $this->active); + } while ($mrc === CURLM_CALL_MULTI_PERFORM); + $this->processMessages(); + } + } + } + + private function removeProcessed($id) + { + if (isset($this->handles[$id])) { + curl_multi_remove_handle( + $this->_mh, + $this->handles[$id]['handle'] + ); + curl_close($this->handles[$id]['handle']); + unset($this->handles[$id], $this->delays[$id]); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id) + { + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['handle']; + unset($this->delays[$id], $this->handles[$id]); + curl_multi_remove_handle($this->_mh, $handle); + curl_close($handle); + + return true; + } + + private function addDelays() + { + $currentTime = microtime(true); + + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['handle'] + ); + } + } + } + + private function processMessages() + { + while ($done = curl_multi_info_read($this->_mh)) { + $id = (int) $done['handle']; + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + $entry['response']['transfer_stats'] = curl_getinfo($done['handle']); + + if ($done['result'] !== CURLM_OK) { + $entry['response']['curl']['errno'] = $done['result']; + $entry['response']['curl']['error'] = curl_error($done['handle']); + } + + $result = CurlFactory::createResponse( + $this, + $entry['request'], + $entry['response'], + $entry['headers'], + $entry['body'] + ); + + $this->removeProcessed($id); + $entry['deferred']->resolve($result); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/Middleware.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/Middleware.php new file mode 100644 index 00000000000..6fa7318abae --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/Middleware.php @@ -0,0 +1,58 @@ +result = $result; + } + + public function __invoke(array $request) + { + Core::doSleep($request); + $response = is_callable($this->result) + ? call_user_func($this->result, $request) + : $this->result; + + if (is_array($response)) { + $response = new CompletedFutureArray($response + [ + 'status' => null, + 'body' => null, + 'headers' => [], + 'reason' => null, + 'effective_url' => null, + ]); + } elseif (!$response instanceof FutureArrayInterface) { + throw new \InvalidArgumentException( + 'Response must be an array or FutureArrayInterface. Found ' + . Core::describeType($request) + ); + } + + return $response; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php new file mode 100644 index 00000000000..4bacec13371 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php @@ -0,0 +1,414 @@ +options = $options; + } + + public function __invoke(array $request) + { + $url = Core::url($request); + Core::doSleep($request); + + try { + // Does not support the expect header. + $request = Core::removeHeader($request, 'Expect'); + $stream = $this->createStream($url, $request); + return $this->createResponse($request, $url, $stream); + } catch (RingException $e) { + return $this->createErrorResponse($url, $e); + } + } + + private function createResponse(array $request, $url, $stream) + { + $hdrs = $this->lastHeaders; + $this->lastHeaders = null; + $parts = explode(' ', array_shift($hdrs), 3); + $response = [ + 'version' => substr($parts[0], 5), + 'status' => $parts[1], + 'reason' => isset($parts[2]) ? $parts[2] : null, + 'headers' => Core::headersFromLines($hdrs), + 'effective_url' => $url, + ]; + + $stream = $this->checkDecode($request, $response, $stream); + + // If not streaming, then drain the response into a stream. + if (empty($request['client']['stream'])) { + $dest = isset($request['client']['save_to']) + ? $request['client']['save_to'] + : fopen('php://temp', 'r+'); + $stream = $this->drain($stream, $dest); + } + + $response['body'] = $stream; + + return new CompletedFutureArray($response); + } + + private function checkDecode(array $request, array $response, $stream) + { + // Automatically decode responses when instructed. + if (!empty($request['client']['decode_content'])) { + switch (Core::firstHeader($response, 'Content-Encoding', true)) { + case 'gzip': + case 'deflate': + $stream = new InflateStream(Stream::factory($stream)); + break; + } + } + + return $stream; + } + + /** + * Drains the stream into the "save_to" client option. + * + * @param resource $stream + * @param string|resource|StreamInterface $dest + * + * @return Stream + * @throws \RuntimeException when the save_to option is invalid. + */ + private function drain($stream, $dest) + { + if (is_resource($stream)) { + if (!is_resource($dest)) { + $stream = Stream::factory($stream); + } else { + stream_copy_to_stream($stream, $dest); + fclose($stream); + rewind($dest); + return $dest; + } + } + + // Stream the response into the destination stream + $dest = is_string($dest) + ? new Stream(Utils::open($dest, 'r+')) + : Stream::factory($dest); + + Utils::copyToStream($stream, $dest); + $dest->seek(0); + $stream->close(); + + return $dest; + } + + /** + * Creates an error response for the given stream. + * + * @param string $url + * @param RingException $e + * + * @return array + */ + private function createErrorResponse($url, RingException $e) + { + // Determine if the error was a networking error. + $message = $e->getMessage(); + + // This list can probably get more comprehensive. + if (strpos($message, 'getaddrinfo') // DNS lookup failed + || strpos($message, 'Connection refused') + ) { + $e = new ConnectException($e->getMessage(), 0, $e); + } + + return new CompletedFutureArray([ + 'status' => null, + 'body' => null, + 'headers' => [], + 'effective_url' => $url, + 'error' => $e + ]); + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = null; + set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line + ]; + return true; + }); + + $resource = $callback(); + restore_error_handler(); + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value" . PHP_EOL; + } + } + throw new RingException(trim($message)); + } + + return $resource; + } + + private function createStream($url, array $request) + { + static $methods; + if (!$methods) { + $methods = array_flip(get_class_methods(__CLASS__)); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ((!isset($request['version']) || $request['version'] == '1.1') + && !Core::hasHeader($request, 'Connection') + ) { + $request['headers']['Connection'] = ['close']; + } + + // Ensure SSL is verified by default + if (!isset($request['client']['verify'])) { + $request['client']['verify'] = true; + } + + $params = []; + $options = $this->getDefaultOptions($request); + + if (isset($request['client'])) { + foreach ($request['client'] as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $options, $value, $params); + } + } + } + + return $this->createStreamResource( + $url, + $request, + $options, + $this->createContext($request, $options, $params) + ); + } + + private function getDefaultOptions(array $request) + { + $headers = ""; + foreach ($request['headers'] as $name => $value) { + foreach ((array) $value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request['http_method'], + 'header' => $headers, + 'protocol_version' => isset($request['version']) ? $request['version'] : 1.1, + 'ignore_errors' => true, + 'follow_location' => 0, + ], + ]; + + $body = Core::body($request); + if (isset($body)) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!Core::hasHeader($request, 'Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = rtrim($context['http']['header']); + + return $context; + } + + private function add_proxy(array $request, &$options, $value, &$params) + { + if (!is_array($value)) { + $options['http']['proxy'] = $value; + } else { + $scheme = isset($request['scheme']) ? $request['scheme'] : 'http'; + if (isset($value[$scheme])) { + $options['http']['proxy'] = $value[$scheme]; + } + } + } + + private function add_timeout(array $request, &$options, $value, &$params) + { + $options['http']['timeout'] = $value; + } + + private function add_verify(array $request, &$options, $value, &$params) + { + if ($value === true) { + // PHP 5.6 or greater will find the system cert by default. When + // < 5.6, use the Guzzle bundled cacert. + if (PHP_VERSION_ID < 50600) { + $options['ssl']['cafile'] = ClientUtils::getDefaultCaBundle(); + } + } elseif (is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!file_exists($value)) { + throw new RingException("SSL CA bundle not found: $value"); + } + } elseif ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['allow_self_signed'] = true; + return; + } else { + throw new RingException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + private function add_cert(array $request, &$options, $value, &$params) + { + if (is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new RingException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + private function add_progress(array $request, &$options, $value, &$params) + { + $fn = function ($code, $_1, $_2, $_3, $transferred, $total) use ($value) { + if ($code == STREAM_NOTIFY_PROGRESS) { + $value($total, $transferred, null, null); + } + }; + + // Wrap the existing function if needed. + $params['notification'] = isset($params['notification']) + ? Core::callArray([$params['notification'], $fn]) + : $fn; + } + + private function add_debug(array $request, &$options, $value, &$params) + { + if ($value === false) { + return; + } + + static $map = [ + 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', + ]; + + static $args = ['severity', 'message', 'message_code', + 'bytes_transferred', 'bytes_max']; + + $value = Core::getDebugResource($value); + $ident = $request['http_method'] . ' ' . Core::url($request); + $fn = function () use ($ident, $value, $map, $args) { + $passed = func_get_args(); + $code = array_shift($passed); + fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (array_filter($passed) as $i => $v) { + fwrite($value, $args[$i] . ': "' . $v . '" '); + } + fwrite($value, "\n"); + }; + + // Wrap the existing function if needed. + $params['notification'] = isset($params['notification']) + ? Core::callArray([$params['notification'], $fn]) + : $fn; + } + + private function applyCustomOptions(array $request, array &$options) + { + if (!isset($request['client']['stream_context'])) { + return; + } + + if (!is_array($request['client']['stream_context'])) { + throw new RingException('stream_context must be an array'); + } + + $options = array_replace_recursive( + $options, + $request['client']['stream_context'] + ); + } + + private function createContext(array $request, array $options, array $params) + { + $this->applyCustomOptions($request, $options); + return $this->createResource( + function () use ($request, $options, $params) { + return stream_context_create($options, $params); + }, + $request, + $options + ); + } + + private function createStreamResource( + $url, + array $request, + array $options, + $context + ) { + return $this->createResource( + function () use ($url, $context) { + if (false === strpos($url, 'http')) { + trigger_error("URL is invalid: {$url}", E_USER_WARNING); + return null; + } + $resource = fopen($url, 'r', null, $context); + $this->lastHeaders = $http_response_header; + return $resource; + }, + $request, + $options + ); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Core.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Core.php new file mode 100644 index 00000000000..dd7d1a0c5a7 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Core.php @@ -0,0 +1,364 @@ + $value) { + if (!strcasecmp($name, $header)) { + $result = array_merge($result, $value); + } + } + } + + return $result; + } + + /** + * Gets a header value from a message as a string or null + * + * This method searches through the "headers" key of a message for a header + * using a case-insensitive search. The lines of the header are imploded + * using commas into a single string return value. + * + * @param array $message Request or response hash. + * @param string $header Header to retrieve + * + * @return string|null Returns the header string if found, or null if not. + */ + public static function header($message, $header) + { + $match = self::headerLines($message, $header); + return $match ? implode(', ', $match) : null; + } + + /** + * Returns the first header value from a message as a string or null. If + * a header line contains multiple values separated by a comma, then this + * function will return the first value in the list. + * + * @param array $message Request or response hash. + * @param string $header Header to retrieve + * + * @return string|null Returns the value as a string if found. + */ + public static function firstHeader($message, $header) + { + if (!empty($message['headers'])) { + foreach ($message['headers'] as $name => $value) { + if (!strcasecmp($name, $header)) { + // Return the match itself if it is a single value. + $pos = strpos($value[0], ','); + return $pos ? substr($value[0], 0, $pos) : $value[0]; + } + } + } + + return null; + } + + /** + * Returns true if a message has the provided case-insensitive header. + * + * @param array $message Request or response hash. + * @param string $header Header to check + * + * @return bool + */ + public static function hasHeader($message, $header) + { + if (!empty($message['headers'])) { + foreach ($message['headers'] as $name => $value) { + if (!strcasecmp($name, $header)) { + return true; + } + } + } + + return false; + } + + /** + * Parses an array of header lines into an associative array of headers. + * + * @param array $lines Header lines array of strings in the following + * format: "Name: Value" + * @return array + */ + public static function headersFromLines($lines) + { + $headers = []; + + foreach ($lines as $line) { + $parts = explode(':', $line, 2); + $headers[trim($parts[0])][] = isset($parts[1]) + ? trim($parts[1]) + : null; + } + + return $headers; + } + + /** + * Removes a header from a message using a case-insensitive comparison. + * + * @param array $message Message that contains 'headers' + * @param string $header Header to remove + * + * @return array + */ + public static function removeHeader(array $message, $header) + { + if (isset($message['headers'])) { + foreach (array_keys($message['headers']) as $key) { + if (!strcasecmp($header, $key)) { + unset($message['headers'][$key]); + } + } + } + + return $message; + } + + /** + * Replaces any existing case insensitive headers with the given value. + * + * @param array $message Message that contains 'headers' + * @param string $header Header to set. + * @param array $value Value to set. + * + * @return array + */ + public static function setHeader(array $message, $header, array $value) + { + $message = self::removeHeader($message, $header); + $message['headers'][$header] = $value; + + return $message; + } + + /** + * Creates a URL string from a request. + * + * If the "url" key is present on the request, it is returned, otherwise + * the url is built up based on the scheme, host, uri, and query_string + * request values. + * + * @param array $request Request to get the URL from + * + * @return string Returns the request URL as a string. + * @throws \InvalidArgumentException if no Host header is present. + */ + public static function url(array $request) + { + if (isset($request['url'])) { + return $request['url']; + } + + $uri = (isset($request['scheme']) + ? $request['scheme'] : 'http') . '://'; + + if ($host = self::header($request, 'host')) { + $uri .= $host; + } else { + throw new \InvalidArgumentException('No Host header was provided'); + } + + if (isset($request['uri'])) { + $uri .= $request['uri']; + } + + if (isset($request['query_string'])) { + $uri .= '?' . $request['query_string']; + } + + return $uri; + } + + /** + * Reads the body of a message into a string. + * + * @param array|FutureArrayInterface $message Array containing a "body" key + * + * @return null|string Returns the body as a string or null if not set. + * @throws \InvalidArgumentException if a request body is invalid. + */ + public static function body($message) + { + if (!isset($message['body'])) { + return null; + } + + if ($message['body'] instanceof StreamInterface) { + return (string) $message['body']; + } + + switch (gettype($message['body'])) { + case 'string': + return $message['body']; + case 'resource': + return stream_get_contents($message['body']); + case 'object': + if ($message['body'] instanceof \Iterator) { + return implode('', iterator_to_array($message['body'])); + } elseif (method_exists($message['body'], '__toString')) { + return (string) $message['body']; + } + default: + throw new \InvalidArgumentException('Invalid request body: ' + . self::describeType($message['body'])); + } + } + + /** + * Rewind the body of the provided message if possible. + * + * @param array $message Message that contains a 'body' field. + * + * @return bool Returns true on success, false on failure + */ + public static function rewindBody($message) + { + if ($message['body'] instanceof StreamInterface) { + return $message['body']->seek(0); + } + + if ($message['body'] instanceof \Generator) { + return false; + } + + if ($message['body'] instanceof \Iterator) { + $message['body']->rewind(); + return true; + } + + if (is_resource($message['body'])) { + return rewind($message['body']); + } + + return is_string($message['body']) + || (is_object($message['body']) + && method_exists($message['body'], '__toString')); + } + + /** + * Debug function used to describe the provided value type and class. + * + * @param mixed $input + * + * @return string Returns a string containing the type of the variable and + * if a class is provided, the class name. + */ + public static function describeType($input) + { + switch (gettype($input)) { + case 'object': + return 'object(' . get_class($input) . ')'; + case 'array': + return 'array(' . count($input) . ')'; + default: + ob_start(); + var_dump($input); + // normalize float vs double + return str_replace('double(', 'float(', rtrim(ob_get_clean())); + } + } + + /** + * Sleep for the specified amount of time specified in the request's + * ['client']['delay'] option if present. + * + * This function should only be used when a non-blocking sleep is not + * possible. + * + * @param array $request Request to sleep + */ + public static function doSleep(array $request) + { + if (isset($request['client']['delay'])) { + usleep($request['client']['delay'] * 1000); + } + } + + /** + * Returns a proxied future that modifies the dereferenced value of another + * future using a promise. + * + * @param FutureArrayInterface $future Future to wrap with a new future + * @param callable $onFulfilled Invoked when the future fulfilled + * @param callable $onRejected Invoked when the future rejected + * @param callable $onProgress Invoked when the future progresses + * + * @return FutureArray + */ + public static function proxy( + FutureArrayInterface $future, + callable $onFulfilled = null, + callable $onRejected = null, + callable $onProgress = null + ) { + return new FutureArray( + $future->then($onFulfilled, $onRejected, $onProgress), + [$future, 'wait'], + [$future, 'cancel'] + ); + } + + /** + * Returns a debug stream based on the provided variable. + * + * @param mixed $value Optional value + * + * @return resource + */ + public static function getDebugResource($value = null) + { + if (is_resource($value)) { + return $value; + } elseif (defined('STDOUT')) { + return STDOUT; + } else { + return fopen('php://output', 'w'); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Exception/CancelledException.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Exception/CancelledException.php new file mode 100644 index 00000000000..95b353acfde --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Exception/CancelledException.php @@ -0,0 +1,7 @@ +wrappedPromise = $promise; + $this->waitfn = $wait; + $this->cancelfn = $cancel; + } + + public function wait() + { + if (!$this->isRealized) { + $this->addShadow(); + if (!$this->isRealized && $this->waitfn) { + $this->invokeWait(); + } + if (!$this->isRealized) { + $this->error = new RingException('Waiting did not resolve future'); + } + } + + if ($this->error) { + throw $this->error; + } + + return $this->result; + } + + public function promise() + { + return $this->wrappedPromise; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null, + callable $onProgress = null + ) { + return $this->wrappedPromise->then($onFulfilled, $onRejected, $onProgress); + } + + public function cancel() + { + if (!$this->isRealized) { + $cancelfn = $this->cancelfn; + $this->waitfn = $this->cancelfn = null; + $this->isRealized = true; + $this->error = new CancelledFutureAccessException(); + if ($cancelfn) { + $cancelfn($this); + } + } + } + + private function addShadow() + { + // Get the result and error when the promise is resolved. Note that + // calling this function might trigger the resolution immediately. + $this->wrappedPromise->then( + function ($value) { + $this->isRealized = true; + $this->result = $value; + $this->waitfn = $this->cancelfn = null; + }, + function ($error) { + $this->isRealized = true; + $this->error = $error; + $this->waitfn = $this->cancelfn = null; + } + ); + } + + private function invokeWait() + { + try { + $wait = $this->waitfn; + $this->waitfn = null; + $wait(); + } catch (\Exception $e) { + // Defer can throw to reject. + $this->error = $e; + $this->isRealized = true; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php new file mode 100644 index 00000000000..0a90c939f7b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php @@ -0,0 +1,43 @@ +result[$offset]); + } + + public function offsetGet($offset) + { + return $this->result[$offset]; + } + + public function offsetSet($offset, $value) + { + $this->result[$offset] = $value; + } + + public function offsetUnset($offset) + { + unset($this->result[$offset]); + } + + public function count() + { + return count($this->result); + } + + public function getIterator() + { + return new \ArrayIterator($this->result); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php new file mode 100644 index 00000000000..0d25af72d4d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php @@ -0,0 +1,57 @@ +result = $result; + $this->error = $e; + } + + public function wait() + { + if ($this->error) { + throw $this->error; + } + + return $this->result; + } + + public function cancel() {} + + public function promise() + { + if (!$this->cachedPromise) { + $this->cachedPromise = $this->error + ? new RejectedPromise($this->error) + : new FulfilledPromise($this->result); + } + + return $this->cachedPromise; + } + + public function then( + callable $onFulfilled = null, + callable $onRejected = null, + callable $onProgress = null + ) { + return $this->promise()->then($onFulfilled, $onRejected, $onProgress); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php new file mode 100644 index 00000000000..3d64c9643ac --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArray.php @@ -0,0 +1,40 @@ +_value[$offset]); + } + + public function offsetGet($offset) + { + return $this->_value[$offset]; + } + + public function offsetSet($offset, $value) + { + $this->_value[$offset] = $value; + } + + public function offsetUnset($offset) + { + unset($this->_value[$offset]); + } + + public function count() + { + return count($this->_value); + } + + public function getIterator() + { + return new \ArrayIterator($this->_value); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php new file mode 100644 index 00000000000..58f5f736706 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php @@ -0,0 +1,11 @@ +_value = $this->wait(); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php new file mode 100644 index 00000000000..ebde187cfa8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlFactoryTest.php @@ -0,0 +1,821 @@ + 200, + 'headers' => [ + 'Foo' => ['Bar'], + 'Baz' => ['bam'], + 'Content-Length' => [2], + ], + 'body' => 'hi', + ]]); + + $stream = Stream::factory(); + + $request = [ + 'http_method' => 'PUT', + 'headers' => [ + 'host' => [Server::$url], + 'Hi' => [' 123'], + ], + 'body' => 'testing', + 'client' => ['save_to' => $stream], + ]; + + $f = new CurlFactory(); + $result = $f($request); + $this->assertInternalType('array', $result); + $this->assertCount(3, $result); + $this->assertInternalType('resource', $result[0]); + $this->assertInternalType('array', $result[1]); + $this->assertSame($stream, $result[2]); + curl_close($result[0]); + + $this->assertEquals('PUT', $_SERVER['_curl'][CURLOPT_CUSTOMREQUEST]); + $this->assertEquals( + 'http://http://127.0.0.1:8125/', + $_SERVER['_curl'][CURLOPT_URL] + ); + // Sends via post fields when the request is small enough + $this->assertEquals('testing', $_SERVER['_curl'][CURLOPT_POSTFIELDS]); + $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_RETURNTRANSFER]); + $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_HEADER]); + $this->assertEquals(150, $_SERVER['_curl'][CURLOPT_CONNECTTIMEOUT]); + $this->assertInstanceOf('Closure', $_SERVER['_curl'][CURLOPT_HEADERFUNCTION]); + + if (defined('CURLOPT_PROTOCOLS')) { + $this->assertEquals( + CURLPROTO_HTTP | CURLPROTO_HTTPS, + $_SERVER['_curl'][CURLOPT_PROTOCOLS] + ); + } + + $this->assertContains('Expect:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); + $this->assertContains('Accept:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); + $this->assertContains('Content-Type:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); + $this->assertContains('Hi: 123', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); + $this->assertContains('host: http://127.0.0.1:8125/', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); + } + + public function testSendsHeadRequests() + { + Server::flush(); + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'HEAD', + 'headers' => ['host' => [Server::$host]], + ]); + $response->wait(); + $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_NOBODY]); + $checks = [CURLOPT_WRITEFUNCTION, CURLOPT_READFUNCTION, CURLOPT_FILE, CURLOPT_INFILE]; + foreach ($checks as $check) { + $this->assertArrayNotHasKey($check, $_SERVER['_curl']); + } + $this->assertEquals('HEAD', Server::received()[0]['http_method']); + } + + public function testCanAddCustomCurlOptions() + { + Server::flush(); + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => ['curl' => [CURLOPT_LOW_SPEED_LIMIT => 10]], + ]); + $this->assertEquals(10, $_SERVER['_curl'][CURLOPT_LOW_SPEED_LIMIT]); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage SSL CA bundle not found: /does/not/exist + */ + public function testValidatesVerify() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['verify' => '/does/not/exist'], + ]); + } + + public function testCanSetVerifyToFile() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['verify' => __FILE__], + ]); + $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_CAINFO]); + $this->assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); + $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); + } + + public function testAddsVerifyAsTrue() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['verify' => true], + ]); + $this->assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); + $this->assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); + $this->assertArrayNotHasKey(CURLOPT_CAINFO, $_SERVER['_curl']); + } + + public function testCanDisableVerify() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['verify' => false], + ]); + $this->assertEquals(0, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); + $this->assertEquals(false, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); + } + + public function testAddsProxy() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['proxy' => 'http://bar.com'], + ]); + $this->assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]); + } + + public function testAddsViaScheme() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'scheme' => 'http', + 'headers' => ['host' => ['foo.com']], + 'client' => [ + 'proxy' => ['http' => 'http://bar.com', 'https' => 'https://t'], + ], + ]); + $this->assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage SSL private key not found: /does/not/exist + */ + public function testValidatesSslKey() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['ssl_key' => '/does/not/exist'], + ]); + } + + public function testAddsSslKey() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['ssl_key' => __FILE__], + ]); + $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]); + } + + public function testAddsSslKeyWithPassword() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['ssl_key' => [__FILE__, 'test']], + ]); + $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]); + $this->assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLKEYPASSWD]); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage SSL certificate not found: /does/not/exist + */ + public function testValidatesCert() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['cert' => '/does/not/exist'], + ]); + } + + public function testAddsCert() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['cert' => __FILE__], + ]); + $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]); + } + + public function testAddsCertWithPassword() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['cert' => [__FILE__, 'test']], + ]); + $this->assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]); + $this->assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLCERTPASSWD]); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage progress client option must be callable + */ + public function testValidatesProgress() + { + $f = new CurlFactory(); + $f([ + 'http_method' => 'GET', + 'headers' => ['host' => ['foo.com']], + 'client' => ['progress' => 'foo'], + ]); + } + + public function testEmitsDebugInfoToStream() + { + $res = fopen('php://memory', 'r+'); + Server::flush(); + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'HEAD', + 'headers' => ['host' => [Server::$host]], + 'client' => ['debug' => $res], + ]); + $response->wait(); + rewind($res); + $output = str_replace("\r", '', stream_get_contents($res)); + $this->assertContains( + "> HEAD / HTTP/1.1\nhost: 127.0.0.1:8125\n\n", + $output + ); + $this->assertContains("< HTTP/1.1 200", $output); + fclose($res); + } + + public function testEmitsProgressToFunction() + { + Server::flush(); + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $called = []; + $response = $a([ + 'http_method' => 'HEAD', + 'headers' => ['host' => [Server::$host]], + 'client' => [ + 'progress' => function () use (&$called) { + $called[] = func_get_args(); + }, + ], + ]); + $response->wait(); + $this->assertNotEmpty($called); + foreach ($called as $call) { + $this->assertCount(4, $call); + } + } + + private function addDecodeResponse($withEncoding = true) + { + $content = gzencode('test'); + $response = [ + 'status' => 200, + 'reason' => 'OK', + 'headers' => ['Content-Length' => [strlen($content)]], + 'body' => $content, + ]; + + if ($withEncoding) { + $response['headers']['Content-Encoding'] = ['gzip']; + } + + Server::flush(); + Server::enqueue([$response]); + + return $content; + } + + public function testDecodesGzippedResponses() + { + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => ['decode_content' => true], + ]); + $response->wait(); + $this->assertEquals('test', Core::body($response)); + $this->assertEquals('', $_SERVER['_curl'][CURLOPT_ENCODING]); + $sent = Server::received()[0]; + $this->assertNull(Core::header($sent, 'Accept-Encoding')); + } + + public function testDecodesGzippedResponsesWithHeader() + { + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => [ + 'host' => [Server::$host], + 'Accept-Encoding' => ['gzip'], + ], + 'client' => ['decode_content' => true], + ]); + $response->wait(); + $this->assertEquals('gzip', $_SERVER['_curl'][CURLOPT_ENCODING]); + $sent = Server::received()[0]; + $this->assertEquals('gzip', Core::header($sent, 'Accept-Encoding')); + $this->assertEquals('test', Core::body($response)); + } + + public function testDoesNotForceDecode() + { + $content = $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => ['decode_content' => false], + ]); + $response->wait(); + $sent = Server::received()[0]; + $this->assertNull(Core::header($sent, 'Accept-Encoding')); + $this->assertEquals($content, Core::body($response)); + } + + public function testProtocolVersion() + { + Server::flush(); + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'version' => 1.0, + ]); + $this->assertEquals(CURL_HTTP_VERSION_1_0, $_SERVER['_curl'][CURLOPT_HTTP_VERSION]); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testValidatesSaveTo() + { + $handler = new CurlMultiHandler(); + $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => ['save_to' => true], + ]); + } + + public function testSavesToStream() + { + $stream = fopen('php://memory', 'r+'); + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => [ + 'decode_content' => true, + 'save_to' => $stream, + ], + ]); + $response->wait(); + rewind($stream); + $this->assertEquals('test', stream_get_contents($stream)); + } + + public function testSavesToGuzzleStream() + { + $stream = Stream::factory(); + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => [ + 'decode_content' => true, + 'save_to' => $stream, + ], + ]); + $response->wait(); + $this->assertEquals('test', (string) $stream); + } + + public function testSavesToFileOnDisk() + { + $tmpfile = tempnam(sys_get_temp_dir(), 'testfile'); + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => [ + 'decode_content' => true, + 'save_to' => $tmpfile, + ], + ]); + $response->wait(); + $this->assertEquals('test', file_get_contents($tmpfile)); + unlink($tmpfile); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testValidatesBody() + { + $handler = new CurlMultiHandler(); + $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'body' => false, + ]); + } + + public function testAddsLargePayloadFromStreamWithNoSizeUsingChunked() + { + $stream = Stream::factory('foo'); + $stream = FnStream::decorate($stream, [ + 'getSize' => function () { + return null; + } + ]); + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'body' => $stream, + ]); + $response->wait(); + $sent = Server::received()[0]; + $this->assertEquals('chunked', Core::header($sent, 'Transfer-Encoding')); + $this->assertNull(Core::header($sent, 'Content-Length')); + $this->assertEquals('foo', $sent['body']); + } + + public function testAddsPayloadFromIterator() + { + $iter = new \ArrayIterator(['f', 'o', 'o']); + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'body' => $iter, + ]); + $response->wait(); + $sent = Server::received()[0]; + $this->assertEquals('chunked', Core::header($sent, 'Transfer-Encoding')); + $this->assertNull(Core::header($sent, 'Content-Length')); + $this->assertEquals('foo', $sent['body']); + } + + public function testAddsPayloadFromResource() + { + $res = fopen('php://memory', 'r+'); + $data = str_repeat('.', 1000000); + fwrite($res, $data); + rewind($res); + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => [ + 'host' => [Server::$host], + 'content-length' => [1000000], + ], + 'body' => $res, + ]); + $response->wait(); + $sent = Server::received()[0]; + $this->assertNull(Core::header($sent, 'Transfer-Encoding')); + $this->assertEquals(1000000, Core::header($sent, 'Content-Length')); + $this->assertEquals($data, $sent['body']); + } + + public function testAddsContentLengthFromStream() + { + $stream = Stream::factory('foo'); + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'body' => $stream, + ]); + $response->wait(); + $sent = Server::received()[0]; + $this->assertEquals(3, Core::header($sent, 'Content-Length')); + $this->assertNull(Core::header($sent, 'Transfer-Encoding')); + $this->assertEquals('foo', $sent['body']); + } + + public function testDoesNotAddMultipleContentLengthHeaders() + { + $this->addDecodeResponse(); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => [ + 'host' => [Server::$host], + 'content-length' => [3], + ], + 'body' => 'foo', + ]); + $response->wait(); + $sent = Server::received()[0]; + $this->assertEquals(3, Core::header($sent, 'Content-Length')); + $this->assertNull(Core::header($sent, 'Transfer-Encoding')); + $this->assertEquals('foo', $sent['body']); + } + + public function testSendsPostWithNoBodyOrDefaultContentType() + { + Server::flush(); + Server::enqueue([['status' => 200]]); + $handler = new CurlMultiHandler(); + $response = $handler([ + 'http_method' => 'POST', + 'uri' => '/', + 'headers' => ['host' => [Server::$host]], + ]); + $response->wait(); + $received = Server::received()[0]; + $this->assertEquals('POST', $received['http_method']); + $this->assertNull(Core::header($received, 'content-type')); + $this->assertSame('0', Core::firstHeader($received, 'content-length')); + } + + public function testParseProtocolVersion() + { + $res = CurlFactory::createResponse( + function () {}, + [], + ['curl' => ['errno' => null]], + ['HTTP/1.1 200 Ok'], + null + ); + + $this->assertSame('1.1', $res['version']); + } + + public function testFailsWhenNoResponseAndNoBody() + { + $res = CurlFactory::createResponse(function () {}, [], [], [], null); + $this->assertInstanceOf('GuzzleHttp\Ring\Exception\RingException', $res['error']); + $this->assertContains( + 'No response was received for a request with no body', + $res['error']->getMessage() + ); + } + + public function testFailsWhenCannotRewindRetry() + { + $res = CurlFactory::createResponse(function () {}, [ + 'body' => new NoSeekStream(Stream::factory('foo')) + ], [], [], null); + $this->assertInstanceOf('GuzzleHttp\Ring\Exception\RingException', $res['error']); + $this->assertContains( + 'rewind the request body failed', + $res['error']->getMessage() + ); + } + + public function testRetriesWhenBodyCanBeRewound() + { + $callHandler = $called = false; + $res = CurlFactory::createResponse(function () use (&$callHandler) { + $callHandler = true; + return ['status' => 200]; + }, [ + 'body' => FnStream::decorate(Stream::factory('test'), [ + 'seek' => function () use (&$called) { + $called = true; + return true; + } + ]) + ], [], [], null); + + $this->assertTrue($callHandler); + $this->assertTrue($called); + $this->assertEquals('200', $res['status']); + } + + public function testFailsWhenRetryMoreThanThreeTimes() + { + $call = 0; + $mock = new MockHandler(function (array $request) use (&$mock, &$call) { + $call++; + return CurlFactory::createResponse($mock, $request, [], [], null); + }); + $response = $mock([ + 'http_method' => 'GET', + 'body' => 'test', + ]); + $this->assertEquals(3, $call); + $this->assertArrayHasKey('error', $response); + $this->assertContains( + 'The cURL request was retried 3 times', + $response['error']->getMessage() + ); + } + + public function testHandles100Continue() + { + Server::flush(); + Server::enqueue([ + [ + 'status' => '200', + 'reason' => 'OK', + 'headers' => [ + 'Test' => ['Hello'], + 'Content-Length' => ['4'], + ], + 'body' => 'test', + ], + ]); + + $request = [ + 'http_method' => 'PUT', + 'headers' => [ + 'Host' => [Server::$host], + 'Expect' => ['100-Continue'], + ], + 'body' => 'test', + ]; + + $handler = new CurlMultiHandler(); + $response = $handler($request)->wait(); + $this->assertEquals(200, $response['status']); + $this->assertEquals('OK', $response['reason']); + $this->assertEquals(['Hello'], $response['headers']['Test']); + $this->assertEquals(['4'], $response['headers']['Content-Length']); + $this->assertEquals('test', Core::body($response)); + } + + public function testCreatesConnectException() + { + $m = new \ReflectionMethod('GuzzleHttp\Ring\Client\CurlFactory', 'createErrorResponse'); + $m->setAccessible(true); + $response = $m->invoke( + null, + function () {}, + [], + [ + 'err_message' => 'foo', + 'curl' => [ + 'errno' => CURLE_COULDNT_CONNECT, + ] + ] + ); + $this->assertInstanceOf('GuzzleHttp\Ring\Exception\ConnectException', $response['error']); + } + + public function testParsesLastResponseOnly() + { + $response1 = [ + 'status' => 301, + 'headers' => [ + 'Content-Length' => ['0'], + 'Location' => ['/foo'] + ] + ]; + + $response2 = [ + 'status' => 200, + 'headers' => [ + 'Content-Length' => ['0'], + 'Foo' => ['bar'] + ] + ]; + + Server::flush(); + Server::enqueue([$response1, $response2]); + + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['Host' => [Server::$host]], + 'client' => [ + 'curl' => [ + CURLOPT_FOLLOWLOCATION => true + ] + ] + ])->wait(); + + $this->assertEquals(1, $response['transfer_stats']['redirect_count']); + $this->assertEquals('http://127.0.0.1:8125/foo', $response['effective_url']); + $this->assertEquals(['bar'], $response['headers']['Foo']); + $this->assertEquals(200, $response['status']); + $this->assertFalse(Core::hasHeader($response, 'Location')); + } + + public function testMaintainsMultiHeaderOrder() + { + Server::flush(); + Server::enqueue([ + [ + 'status' => 200, + 'headers' => [ + 'Content-Length' => ['0'], + 'Foo' => ['a', 'b'], + 'foo' => ['c', 'd'], + ] + ] + ]); + + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['Host' => [Server::$host]] + ])->wait(); + + $this->assertEquals( + ['a', 'b', 'c', 'd'], + Core::headerLines($response, 'Foo') + ); + } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage Directory /path/to/does/not does not exist for save_to value of /path/to/does/not/exist.txt + */ + public function testThrowsWhenDirNotFound() + { + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$url]], + 'client' => ['save_to' => '/path/to/does/not/exist.txt'], + ]; + + $f = new CurlFactory(); + $f($request); + } +} + +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php new file mode 100644 index 00000000000..ba03b8cd37b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlHandlerTest.php @@ -0,0 +1,96 @@ +markTestSkipped('curl_reset() is not available'); + } + } + + protected function getHandler($factory = null, $options = []) + { + return new CurlHandler($options); + } + + public function testCanSetMaxHandles() + { + $a = new CurlHandler(['max_handles' => 10]); + $this->assertEquals(10, $this->readAttribute($a, 'maxHandles')); + } + + public function testCreatesCurlErrors() + { + $handler = new CurlHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => ['localhost:123']], + 'client' => ['timeout' => 0.001, 'connect_timeout' => 0.001], + ]); + $this->assertNull($response['status']); + $this->assertNull($response['reason']); + $this->assertEquals([], $response['headers']); + $this->assertInstanceOf( + 'GuzzleHttp\Ring\Exception\RingException', + $response['error'] + ); + + $this->assertEquals( + 1, + preg_match('/^cURL error \d+: .*$/', $response['error']->getMessage()) + ); + } + + public function testReleasesAdditionalEasyHandles() + { + Server::flush(); + $response = [ + 'status' => 200, + 'headers' => ['Content-Length' => [4]], + 'body' => 'test', + ]; + + Server::enqueue([$response, $response, $response, $response]); + $a = new CurlHandler(['max_handles' => 2]); + + $fn = function () use (&$calls, $a, &$fn) { + if (++$calls < 4) { + $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => ['progress' => $fn], + ]); + } + }; + + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => [ + 'progress' => $fn, + ], + ]; + + $a($request); + $this->assertCount(2, $this->readAttribute($a, 'handles')); + } + + public function testReusesHandles() + { + Server::flush(); + $response = ['status' => 200]; + Server::enqueue([$response, $response]); + $a = new CurlHandler(); + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + ]; + $a($request); + $a($request); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php new file mode 100644 index 00000000000..530b2394ab6 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php @@ -0,0 +1,181 @@ + 200]]); + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + ]); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $this->assertEquals(200, $response['status']); + $this->assertArrayHasKey('transfer_stats', $response); + $realUrl = trim($response['transfer_stats']['url'], '/'); + $this->assertEquals(trim(Server::$url, '/'), $realUrl); + $this->assertArrayHasKey('effective_url', $response); + $this->assertEquals( + trim(Server::$url, '/'), + trim($response['effective_url'], '/') + ); + } + + public function testCreatesErrorResponses() + { + $url = 'http://localhost:123/'; + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['host' => ['localhost:123']], + ]); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $this->assertNull($response['status']); + $this->assertNull($response['reason']); + $this->assertEquals([], $response['headers']); + $this->assertArrayHasKey('error', $response); + $this->assertContains('cURL error ', $response['error']->getMessage()); + $this->assertArrayHasKey('transfer_stats', $response); + $this->assertEquals( + trim($url, '/'), + trim($response['transfer_stats']['url'], '/') + ); + $this->assertArrayHasKey('effective_url', $response); + $this->assertEquals( + trim($url, '/'), + trim($response['effective_url'], '/') + ); + } + + public function testSendsFuturesWhenDestructed() + { + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + ]); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $a->__destruct(); + $this->assertEquals(200, $response['status']); + } + + public function testCanSetMaxHandles() + { + $a = new CurlMultiHandler(['max_handles' => 2]); + $this->assertEquals(2, $this->readAttribute($a, 'maxHandles')); + } + + public function testCanSetSelectTimeout() + { + $a = new CurlMultiHandler(['select_timeout' => 2]); + $this->assertEquals(2, $this->readAttribute($a, 'selectTimeout')); + } + + public function testSendsFuturesWhenMaxHandlesIsReached() + { + $request = [ + 'http_method' => 'PUT', + 'headers' => ['host' => [Server::$host]], + 'future' => 'lazy', // passing this to control the test + ]; + $response = ['status' => 200]; + Server::flush(); + Server::enqueue([$response, $response, $response]); + $a = new CurlMultiHandler(['max_handles' => 3]); + for ($i = 0; $i < 5; $i++) { + $responses[] = $a($request); + } + $this->assertCount(3, Server::received()); + $responses[3]->cancel(); + $responses[4]->cancel(); + } + + public function testCanCancel() + { + Server::flush(); + $response = ['status' => 200]; + Server::enqueue(array_fill_keys(range(0, 10), $response)); + $a = new CurlMultiHandler(); + $responses = []; + + for ($i = 0; $i < 10; $i++) { + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'future' => 'lazy', + ]); + $response->cancel(); + $responses[] = $response; + } + + $this->assertCount(0, Server::received()); + + foreach ($responses as $response) { + $this->assertTrue($this->readAttribute($response, 'isRealized')); + } + } + + public function testCannotCancelFinished() + { + Server::flush(); + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + ]); + $response->wait(); + $response->cancel(); + } + + public function testDelaysInParallel() + { + Server::flush(); + Server::enqueue([['status' => 200]]); + $a = new CurlMultiHandler(); + $expected = microtime(true) + (100 / 1000); + $response = $a([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'client' => ['delay' => 100], + ]); + $response->wait(); + $this->assertGreaterThanOrEqual($expected, microtime(true)); + } + + public function testSendsNonLazyFutures() + { + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'future' => true, + ]; + Server::flush(); + Server::enqueue([['status' => 202]]); + $a = new CurlMultiHandler(); + $response = $a($request); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $this->assertEquals(202, $response['status']); + } + + public function testExtractsErrors() + { + $request = [ + 'http_method' => 'GET', + 'headers' => ['host' => ['127.0.0.1:123']], + 'future' => true, + ]; + Server::flush(); + Server::enqueue([['status' => 202]]); + $a = new CurlMultiHandler(); + $response = $a($request); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $this->assertEquals(CURLE_COULDNT_CONNECT, $response['curl']['errno']); + $this->assertNotEmpty($response['curl']['error']); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php new file mode 100644 index 00000000000..a47bb30bab4 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MiddlewareTest.php @@ -0,0 +1,65 @@ + 200]); + $calledA = false; + $a = function (array $req) use (&$calledA, $future) { + $calledA = true; + return $future; + }; + $calledB = false; + $b = function (array $req) use (&$calledB) { $calledB = true; }; + $s = Middleware::wrapFuture($a, $b); + $s([]); + $this->assertTrue($calledA); + $this->assertFalse($calledB); + } + + public function testFutureCallsStreamingHandler() + { + $future = new CompletedFutureArray(['status' => 200]); + $calledA = false; + $a = function (array $req) use (&$calledA) { $calledA = true; }; + $calledB = false; + $b = function (array $req) use (&$calledB, $future) { + $calledB = true; + return $future; + }; + $s = Middleware::wrapFuture($a, $b); + $result = $s(['client' => ['future' => true]]); + $this->assertFalse($calledA); + $this->assertTrue($calledB); + $this->assertSame($future, $result); + } + + public function testStreamingCallsDefaultHandler() + { + $calledA = false; + $a = function (array $req) use (&$calledA) { $calledA = true; }; + $calledB = false; + $b = function (array $req) use (&$calledB) { $calledB = true; }; + $s = Middleware::wrapStreaming($a, $b); + $s([]); + $this->assertTrue($calledA); + $this->assertFalse($calledB); + } + + public function testStreamingCallsStreamingHandler() + { + $calledA = false; + $a = function (array $req) use (&$calledA) { $calledA = true; }; + $calledB = false; + $b = function (array $req) use (&$calledB) { $calledB = true; }; + $s = Middleware::wrapStreaming($a, $b); + $s(['client' => ['stream' => true]]); + $this->assertFalse($calledA); + $this->assertTrue($calledB); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php new file mode 100644 index 00000000000..26bcd6cdc7e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/MockHandlerTest.php @@ -0,0 +1,86 @@ + 200]); + $response = $mock([]); + $this->assertEquals(200, $response['status']); + $this->assertEquals([], $response['headers']); + $this->assertNull($response['body']); + $this->assertNull($response['reason']); + $this->assertNull($response['effective_url']); + } + + public function testReturnsFutures() + { + $deferred = new Deferred(); + $future = new FutureArray( + $deferred->promise(), + function () use ($deferred) { + $deferred->resolve(['status' => 200]); + } + ); + $mock = new MockHandler($future); + $response = $mock([]); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $this->assertEquals(200, $response['status']); + } + + public function testReturnsFuturesWithThenCall() + { + $deferred = new Deferred(); + $future = new FutureArray( + $deferred->promise(), + function () use ($deferred) { + $deferred->resolve(['status' => 200]); + } + ); + $mock = new MockHandler($future); + $response = $mock([]); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $this->assertEquals(200, $response['status']); + $req = null; + $promise = $response->then(function ($value) use (&$req) { + $req = $value; + $this->assertEquals(200, $req['status']); + }); + $this->assertInstanceOf('React\Promise\PromiseInterface', $promise); + $this->assertEquals(200, $req['status']); + } + + public function testReturnsFuturesAndProxiesCancel() + { + $c = null; + $deferred = new Deferred(); + $future = new FutureArray( + $deferred->promise(), + function () {}, + function () use (&$c) { + $c = true; + return true; + } + ); + $mock = new MockHandler($future); + $response = $mock([]); + $this->assertInstanceOf('GuzzleHttp\Ring\Future\FutureArray', $response); + $response->cancel(); + $this->assertTrue($c); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Response must be an array or FutureArrayInterface. Found + */ + public function testEnsuresMockIsValid() + { + $mock = new MockHandler('foo'); + $mock([]); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/Server.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/Server.php new file mode 100644 index 00000000000..14665a5565d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/Server.php @@ -0,0 +1,183 @@ + [], 'reason' => '', 'body' => '']; + $data[] = $response; + } + + self::send('PUT', '/guzzle-server/responses', json_encode($data)); + } + + /** + * Get all of the received requests as a RingPHP request structure. + * + * @return array + * @throws \RuntimeException + */ + public static function received() + { + if (!self::$started) { + return []; + } + + $response = self::send('GET', '/guzzle-server/requests'); + $body = Core::body($response); + $result = json_decode($body, true); + if ($result === false) { + throw new \RuntimeException('Error decoding response: ' + . json_last_error()); + } + + foreach ($result as &$res) { + if (isset($res['uri'])) { + $res['resource'] = $res['uri']; + } + if (isset($res['query_string'])) { + $res['resource'] .= '?' . $res['query_string']; + } + if (!isset($res['resource'])) { + $res['resource'] = ''; + } + // Ensure that headers are all arrays + if (isset($res['headers'])) { + foreach ($res['headers'] as &$h) { + $h = (array) $h; + } + unset($h); + } + } + + unset($res); + return $result; + } + + /** + * Stop running the node.js server + */ + public static function stop() + { + if (self::$started) { + self::send('DELETE', '/guzzle-server'); + } + + self::$started = false; + } + + public static function wait($maxTries = 20) + { + $tries = 0; + while (!self::isListening() && ++$tries < $maxTries) { + usleep(100000); + } + + if (!self::isListening()) { + throw new \RuntimeException('Unable to contact node.js server'); + } + } + + public static function start() + { + if (self::$started) { + return; + } + + try { + self::wait(); + } catch (\Exception $e) { + exec('node ' . __DIR__ . \DIRECTORY_SEPARATOR . 'server.js ' + . self::$port . ' >> /tmp/server.log 2>&1 &'); + self::wait(); + } + + self::$started = true; + } + + private static function isListening() + { + $response = self::send('GET', '/guzzle-server/perf', null, [ + 'connect_timeout' => 1, + 'timeout' => 1 + ]); + + return !isset($response['error']); + } + + private static function send( + $method, + $path, + $body = null, + array $client = [] + ) { + $handler = new StreamHandler(); + + $request = [ + 'http_method' => $method, + 'uri' => $path, + 'request_port' => 8125, + 'headers' => ['host' => ['127.0.0.1:8125']], + 'body' => $body, + 'client' => $client, + ]; + + if ($body) { + $request['headers']['content-length'] = [strlen($body)]; + } + + return $handler($request); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php new file mode 100644 index 00000000000..3cb9a8e1e63 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php @@ -0,0 +1,480 @@ +queueRes(); + $handler = new StreamHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => [ + 'host' => [Server::$host], + 'Foo' => ['Bar'], + ], + ]); + + $this->assertEquals('1.1', $response['version']); + $this->assertEquals(200, $response['status']); + $this->assertEquals('OK', $response['reason']); + $this->assertEquals(['Bar'], $response['headers']['Foo']); + $this->assertEquals(['8'], $response['headers']['Content-Length']); + $this->assertEquals('hi there', Core::body($response)); + + $sent = Server::received()[0]; + $this->assertEquals('GET', $sent['http_method']); + $this->assertEquals('/', $sent['resource']); + $this->assertEquals(['127.0.0.1:8125'], $sent['headers']['host']); + $this->assertEquals('Bar', Core::header($sent, 'foo')); + } + + public function testAddsErrorToResponse() + { + $handler = new StreamHandler(); + $result = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => ['localhost:123']], + 'client' => ['timeout' => 0.01], + ]); + $this->assertInstanceOf( + 'GuzzleHttp\Ring\Future\CompletedFutureArray', + $result + ); + $this->assertNull($result['status']); + $this->assertNull($result['body']); + $this->assertEquals([], $result['headers']); + $this->assertInstanceOf( + 'GuzzleHttp\Ring\Exception\RingException', + $result['error'] + ); + } + + public function testEnsuresTheHttpProtocol() + { + $handler = new StreamHandler(); + $result = $handler([ + 'http_method' => 'GET', + 'url' => 'ftp://localhost:123', + ]); + $this->assertArrayHasKey('error', $result); + $this->assertContains( + 'URL is invalid: ftp://localhost:123', + $result['error']->getMessage() + ); + } + + public function testStreamAttributeKeepsStreamOpen() + { + $this->queueRes(); + $handler = new StreamHandler(); + $response = $handler([ + 'http_method' => 'PUT', + 'uri' => '/foo', + 'query_string' => 'baz=bar', + 'headers' => [ + 'host' => [Server::$host], + 'Foo' => ['Bar'], + ], + 'body' => 'test', + 'client' => ['stream' => true], + ]); + + $this->assertEquals(200, $response['status']); + $this->assertEquals('OK', $response['reason']); + $this->assertEquals('8', Core::header($response, 'Content-Length')); + $body = $response['body']; + $this->assertTrue(is_resource($body)); + $this->assertEquals('http', stream_get_meta_data($body)['wrapper_type']); + $this->assertEquals('hi there', stream_get_contents($body)); + fclose($body); + $sent = Server::received()[0]; + $this->assertEquals('PUT', $sent['http_method']); + $this->assertEquals('/foo', $sent['uri']); + $this->assertEquals('baz=bar', $sent['query_string']); + $this->assertEquals('/foo?baz=bar', $sent['resource']); + $this->assertEquals('127.0.0.1:8125', Core::header($sent, 'host')); + $this->assertEquals('Bar', Core::header($sent, 'foo')); + } + + public function testDrainsResponseIntoTempStream() + { + $this->queueRes(); + $handler = new StreamHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => [Server::$host]], + ]); + $body = $response['body']; + $this->assertEquals('php://temp', stream_get_meta_data($body)['uri']); + $this->assertEquals('hi', fread($body, 2)); + fclose($body); + } + + public function testDrainsResponseIntoSaveToBody() + { + $r = fopen('php://temp', 'r+'); + $this->queueRes(); + $handler = new StreamHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => [Server::$host]], + 'client' => ['save_to' => $r], + ]); + $body = $response['body']; + $this->assertEquals('php://temp', stream_get_meta_data($body)['uri']); + $this->assertEquals('hi', fread($body, 2)); + $this->assertEquals(' there', stream_get_contents($r)); + fclose($r); + } + + public function testDrainsResponseIntoSaveToBodyAtPath() + { + $tmpfname = tempnam('/tmp', 'save_to_path'); + $this->queueRes(); + $handler = new StreamHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => [Server::$host]], + 'client' => ['save_to' => $tmpfname], + ]); + $body = $response['body']; + $this->assertInstanceOf('GuzzleHttp\Stream\StreamInterface', $body); + $this->assertEquals($tmpfname, $body->getMetadata('uri')); + $this->assertEquals('hi', $body->read(2)); + $body->close(); + unlink($tmpfname); + } + + public function testAutomaticallyDecompressGzip() + { + Server::flush(); + $content = gzencode('test'); + Server::enqueue([ + [ + 'status' => 200, + 'reason' => 'OK', + 'headers' => [ + 'Content-Encoding' => ['gzip'], + 'Content-Length' => [strlen($content)], + ], + 'body' => $content, + ], + ]); + + $handler = new StreamHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'uri' => '/', + 'client' => ['decode_content' => true], + ]); + $this->assertEquals('test', Core::body($response)); + } + + public function testDoesNotForceGzipDecode() + { + Server::flush(); + $content = gzencode('test'); + Server::enqueue([ + [ + 'status' => 200, + 'reason' => 'OK', + 'headers' => [ + 'Content-Encoding' => ['gzip'], + 'Content-Length' => [strlen($content)], + ], + 'body' => $content, + ], + ]); + + $handler = new StreamHandler(); + $response = $handler([ + 'http_method' => 'GET', + 'headers' => ['host' => [Server::$host]], + 'uri' => '/', + 'client' => ['stream' => true, 'decode_content' => false], + ]); + $this->assertSame($content, Core::body($response)); + } + + public function testProtocolVersion() + { + $this->queueRes(); + $handler = new StreamHandler(); + $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => [Server::$host]], + 'version' => 1.0, + ]); + + $this->assertEquals(1.0, Server::received()[0]['version']); + } + + protected function getSendResult(array $opts) + { + $this->queueRes(); + $handler = new StreamHandler(); + $opts['stream'] = true; + return $handler([ + 'http_method' => 'GET', + 'uri' => '/', + 'headers' => ['host' => [Server::$host]], + 'client' => $opts, + ]); + } + + public function testAddsProxy() + { + $res = $this->getSendResult(['stream' => true, 'proxy' => '127.0.0.1:8125']); + $opts = stream_context_get_options($res['body']); + $this->assertEquals('127.0.0.1:8125', $opts['http']['proxy']); + } + + public function testAddsTimeout() + { + $res = $this->getSendResult(['stream' => true, 'timeout' => 200]); + $opts = stream_context_get_options($res['body']); + $this->assertEquals(200, $opts['http']['timeout']); + } + + public function testVerifiesVerifyIsValidIfPath() + { + $res = $this->getSendResult(['verify' => '/does/not/exist']); + $this->assertContains( + 'SSL CA bundle not found: /does/not/exist', + (string) $res['error'] + ); + } + + public function testVerifyCanBeDisabled() + { + $res = $this->getSendResult(['verify' => false]); + $this->assertArrayNotHasKey('error', $res); + } + + public function testVerifiesCertIfValidPath() + { + $res = $this->getSendResult(['cert' => '/does/not/exist']); + $this->assertContains( + 'SSL certificate not found: /does/not/exist', + (string) $res['error'] + ); + } + + public function testVerifyCanBeSetToPath() + { + $path = $path = ClientUtils::getDefaultCaBundle(); + $res = $this->getSendResult(['verify' => $path]); + $this->assertArrayNotHasKey('error', $res); + $opts = stream_context_get_options($res['body']); + $this->assertEquals(true, $opts['ssl']['verify_peer']); + $this->assertEquals($path, $opts['ssl']['cafile']); + $this->assertTrue(file_exists($opts['ssl']['cafile'])); + } + + public function testUsesSystemDefaultBundle() + { + $path = $path = ClientUtils::getDefaultCaBundle(); + $res = $this->getSendResult(['verify' => true]); + $this->assertArrayNotHasKey('error', $res); + $opts = stream_context_get_options($res['body']); + if (PHP_VERSION_ID < 50600) { + $this->assertEquals($path, $opts['ssl']['cafile']); + } + } + + public function testEnsuresVerifyOptionIsValid() + { + $res = $this->getSendResult(['verify' => 10]); + $this->assertContains( + 'Invalid verify request option', + (string) $res['error'] + ); + } + + public function testCanSetPasswordWhenSettingCert() + { + $path = __FILE__; + $res = $this->getSendResult(['cert' => [$path, 'foo']]); + $opts = stream_context_get_options($res['body']); + $this->assertEquals($path, $opts['ssl']['local_cert']); + $this->assertEquals('foo', $opts['ssl']['passphrase']); + } + + public function testDebugAttributeWritesToStream() + { + $this->queueRes(); + $f = fopen('php://temp', 'w+'); + $this->getSendResult(['debug' => $f]); + fseek($f, 0); + $contents = stream_get_contents($f); + $this->assertContains(' [CONNECT]', $contents); + $this->assertContains(' [FILE_SIZE_IS]', $contents); + $this->assertContains(' [PROGRESS]', $contents); + } + + public function testDebugAttributeWritesStreamInfoToBuffer() + { + $called = false; + $this->queueRes(); + $buffer = fopen('php://temp', 'r+'); + $this->getSendResult([ + 'progress' => function () use (&$called) { $called = true; }, + 'debug' => $buffer, + ]); + fseek($buffer, 0); + $contents = stream_get_contents($buffer); + $this->assertContains(' [CONNECT]', $contents); + $this->assertContains(' [FILE_SIZE_IS] message: "Content-Length: 8"', $contents); + $this->assertContains(' [PROGRESS] bytes_max: "8"', $contents); + $this->assertTrue($called); + } + + public function testEmitsProgressInformation() + { + $called = []; + $this->queueRes(); + $this->getSendResult([ + 'progress' => function () use (&$called) { + $called[] = func_get_args(); + }, + ]); + $this->assertNotEmpty($called); + $this->assertEquals(8, $called[0][0]); + $this->assertEquals(0, $called[0][1]); + } + + public function testEmitsProgressInformationAndDebugInformation() + { + $called = []; + $this->queueRes(); + $buffer = fopen('php://memory', 'w+'); + $this->getSendResult([ + 'debug' => $buffer, + 'progress' => function () use (&$called) { + $called[] = func_get_args(); + }, + ]); + $this->assertNotEmpty($called); + $this->assertEquals(8, $called[0][0]); + $this->assertEquals(0, $called[0][1]); + rewind($buffer); + $this->assertNotEmpty(stream_get_contents($buffer)); + fclose($buffer); + } + + public function testAddsProxyByProtocol() + { + $url = str_replace('http', 'tcp', Server::$url); + $res = $this->getSendResult(['proxy' => ['http' => $url]]); + $opts = stream_context_get_options($res['body']); + $this->assertEquals($url, $opts['http']['proxy']); + } + + public function testPerformsShallowMergeOfCustomContextOptions() + { + $res = $this->getSendResult([ + 'stream_context' => [ + 'http' => [ + 'request_fulluri' => true, + 'method' => 'HEAD', + ], + 'socket' => [ + 'bindto' => '127.0.0.1:0', + ], + 'ssl' => [ + 'verify_peer' => false, + ], + ], + ]); + + $opts = stream_context_get_options($res['body']); + $this->assertEquals('HEAD', $opts['http']['method']); + $this->assertTrue($opts['http']['request_fulluri']); + $this->assertFalse($opts['ssl']['verify_peer']); + $this->assertEquals('127.0.0.1:0', $opts['socket']['bindto']); + } + + public function testEnsuresThatStreamContextIsAnArray() + { + $res = $this->getSendResult(['stream_context' => 'foo']); + $this->assertContains( + 'stream_context must be an array', + (string) $res['error'] + ); + } + + public function testDoesNotAddContentTypeByDefault() + { + $this->queueRes(); + $handler = new StreamHandler(); + $handler([ + 'http_method' => 'PUT', + 'uri' => '/', + 'headers' => ['host' => [Server::$host], 'content-length' => [3]], + 'body' => 'foo', + ]); + $req = Server::received()[0]; + $this->assertEquals('', Core::header($req, 'Content-Type')); + $this->assertEquals(3, Core::header($req, 'Content-Length')); + } + + private function queueRes() + { + Server::flush(); + Server::enqueue([ + [ + 'status' => 200, + 'reason' => 'OK', + 'headers' => [ + 'Foo' => ['Bar'], + 'Content-Length' => [8], + ], + 'body' => 'hi there', + ], + ]); + } + + public function testSupports100Continue() + { + Server::flush(); + Server::enqueue([ + [ + 'status' => '200', + 'reason' => 'OK', + 'headers' => [ + 'Test' => ['Hello'], + 'Content-Length' => ['4'], + ], + 'body' => 'test', + ], + ]); + + $request = [ + 'http_method' => 'PUT', + 'headers' => [ + 'Host' => [Server::$host], + 'Expect' => ['100-Continue'], + ], + 'body' => 'test', + ]; + + $handler = new StreamHandler(); + $response = $handler($request); + $this->assertEquals(200, $response['status']); + $this->assertEquals('OK', $response['reason']); + $this->assertEquals(['Hello'], $response['headers']['Test']); + $this->assertEquals(['4'], $response['headers']['Content-Length']); + $this->assertEquals('test', Core::body($response)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/server.js b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/server.js new file mode 100644 index 00000000000..6a03e33ab22 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Client/server.js @@ -0,0 +1,241 @@ +/** + * Guzzle node.js test server to return queued responses to HTTP requests and + * expose a RESTful API for enqueueing responses and retrieving the requests + * that have been received. + * + * - Delete all requests that have been received: + * > DELETE /guzzle-server/requests + * > Host: 127.0.0.1:8125 + * + * - Enqueue responses + * > PUT /guzzle-server/responses + * > Host: 127.0.0.1:8125 + * > + * > [{'status': 200, 'reason': 'OK', 'headers': {}, 'body': '' }] + * + * - Get the received requests + * > GET /guzzle-server/requests + * > Host: 127.0.0.1:8125 + * + * < HTTP/1.1 200 OK + * < + * < [{'http_method': 'GET', 'uri': '/', 'headers': {}, 'body': 'string'}] + * + * - Attempt access to the secure area + * > GET /secure/by-digest/qop-auth/guzzle-server/requests + * > Host: 127.0.0.1:8125 + * + * < HTTP/1.1 401 Unauthorized + * < WWW-Authenticate: Digest realm="Digest Test", qop="auth", nonce="0796e98e1aeef43141fab2a66bf4521a", algorithm="MD5", stale="false" + * < + * < 401 Unauthorized + * + * - Shutdown the server + * > DELETE /guzzle-server + * > Host: 127.0.0.1:8125 + * + * @package Guzzle PHP + * @license See the LICENSE file that was distributed with this source code. + */ + +var http = require('http'); +var url = require('url'); + +/** + * Guzzle node.js server + * @class + */ +var GuzzleServer = function(port, log) { + + this.port = port; + this.log = log; + this.responses = []; + this.requests = []; + var that = this; + + var md5 = function(input) { + var crypto = require('crypto'); + var hasher = crypto.createHash('md5'); + hasher.update(input); + return hasher.digest('hex'); + } + + /** + * Node.js HTTP server authentication module. + * + * It is only initialized on demand (by loadAuthentifier). This avoids + * requiring the dependency to http-auth on standard operations, and the + * performance hit at startup. + */ + var auth; + + /** + * Provides authentication handlers (Basic, Digest). + */ + var loadAuthentifier = function(type, options) { + var typeId = type; + if (type == 'digest') { + typeId += '.'+(options && options.qop ? options.qop : 'none'); + } + if (!loadAuthentifier[typeId]) { + if (!auth) { + try { + auth = require('http-auth'); + } catch (e) { + if (e.code == 'MODULE_NOT_FOUND') { + return; + } + } + } + switch (type) { + case 'digest': + var digestParams = { + realm: 'Digest Test', + login: 'me', + password: 'test' + }; + if (options && options.qop) { + digestParams.qop = options.qop; + } + loadAuthentifier[typeId] = auth.digest(digestParams, function(username, callback) { + callback(md5(digestParams.login + ':' + digestParams.realm + ':' + digestParams.password)); + }); + break + } + } + return loadAuthentifier[typeId]; + }; + + var firewallRequest = function(request, req, res, requestHandlerCallback) { + var securedAreaUriParts = request.uri.match(/^\/secure\/by-(digest)(\/qop-([^\/]*))?(\/.*)$/); + if (securedAreaUriParts) { + var authentifier = loadAuthentifier(securedAreaUriParts[1], { qop: securedAreaUriParts[2] }); + if (!authentifier) { + res.writeHead(501, 'HTTP authentication not implemented', { 'Content-Length': 0 }); + res.end(); + return; + } + authentifier.check(req, res, function(req, res) { + req.url = securedAreaUriParts[4]; + requestHandlerCallback(request, req, res); + }); + } else { + requestHandlerCallback(request, req, res); + } + }; + + var controlRequest = function(request, req, res) { + if (req.url == '/guzzle-server/perf') { + res.writeHead(200, 'OK', {'Content-Length': 16}); + res.end('Body of response'); + } else if (req.method == 'DELETE') { + if (req.url == '/guzzle-server/requests') { + // Clear the received requests + that.requests = []; + res.writeHead(200, 'OK', { 'Content-Length': 0 }); + res.end(); + if (that.log) { + console.log('Flushing requests'); + } + } else if (req.url == '/guzzle-server') { + // Shutdown the server + res.writeHead(200, 'OK', { 'Content-Length': 0, 'Connection': 'close' }); + res.end(); + if (that.log) { + console.log('Shutting down'); + } + that.server.close(); + } + } else if (req.method == 'GET') { + if (req.url === '/guzzle-server/requests') { + if (that.log) { + console.log('Sending received requests'); + } + // Get received requests + var body = JSON.stringify(that.requests); + res.writeHead(200, 'OK', { 'Content-Length': body.length }); + res.end(body); + } + } else if (req.method == 'PUT' && req.url == '/guzzle-server/responses') { + if (that.log) { + console.log('Adding responses...'); + } + if (!request.body) { + if (that.log) { + console.log('No response data was provided'); + } + res.writeHead(400, 'NO RESPONSES IN REQUEST', { 'Content-Length': 0 }); + } else { + that.responses = eval('(' + request.body + ')'); + for (var i = 0; i < that.responses.length; i++) { + if (that.responses[i].body) { + that.responses[i].body = new Buffer(that.responses[i].body, 'base64'); + } + } + if (that.log) { + console.log(that.responses); + } + res.writeHead(200, 'OK', { 'Content-Length': 0 }); + } + res.end(); + } + }; + + var receivedRequest = function(request, req, res) { + if (req.url.indexOf('/guzzle-server') === 0) { + controlRequest(request, req, res); + } else if (req.url.indexOf('/guzzle-server') == -1 && !that.responses.length) { + res.writeHead(500); + res.end('No responses in queue'); + } else { + if (that.log) { + console.log('Returning response from queue and adding request'); + } + that.requests.push(request); + var response = that.responses.shift(); + res.writeHead(response.status, response.reason, response.headers); + res.end(response.body); + } + }; + + this.start = function() { + + that.server = http.createServer(function(req, res) { + + var parts = url.parse(req.url, false); + var request = { + http_method: req.method, + scheme: parts.scheme, + uri: parts.pathname, + query_string: parts.query, + headers: req.headers, + version: req.httpVersion, + body: '' + }; + + // Receive each chunk of the request body + req.addListener('data', function(chunk) { + request.body += chunk; + }); + + // Called when the request completes + req.addListener('end', function() { + firewallRequest(request, req, res, receivedRequest); + }); + }); + + that.server.listen(this.port, '127.0.0.1'); + + if (this.log) { + console.log('Server running at http://127.0.0.1:8125/'); + } + }; +}; + +// Get the port from the arguments +port = process.argv.length >= 3 ? process.argv[2] : 8125; +log = process.argv.length >= 4 ? process.argv[3] : false; + +// Start the server +server = new GuzzleServer(port, log); +server.start(); diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/CoreTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/CoreTest.php new file mode 100644 index 00000000000..49522f26b7e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/CoreTest.php @@ -0,0 +1,336 @@ +assertNull(Core::header([], 'Foo')); + $this->assertNull(Core::firstHeader([], 'Foo')); + } + + public function testChecksIfHasHeader() + { + $message = [ + 'headers' => [ + 'Foo' => ['Bar', 'Baz'], + 'foo' => ['hello'], + 'bar' => ['1'] + ] + ]; + $this->assertTrue(Core::hasHeader($message, 'Foo')); + $this->assertTrue(Core::hasHeader($message, 'foo')); + $this->assertTrue(Core::hasHeader($message, 'FoO')); + $this->assertTrue(Core::hasHeader($message, 'bar')); + $this->assertFalse(Core::hasHeader($message, 'barr')); + } + + public function testReturnsFirstHeaderWhenSimple() + { + $this->assertEquals('Bar', Core::firstHeader([ + 'headers' => ['Foo' => ['Bar', 'Baz']], + ], 'Foo')); + } + + public function testReturnsFirstHeaderWhenMultiplePerLine() + { + $this->assertEquals('Bar', Core::firstHeader([ + 'headers' => ['Foo' => ['Bar, Baz']], + ], 'Foo')); + } + + public function testExtractsCaseInsensitiveHeader() + { + $this->assertEquals( + 'hello', + Core::header(['headers' => ['foo' => ['hello']]], 'FoO') + ); + } + + public function testExtractsCaseInsensitiveHeaderLines() + { + $this->assertEquals( + ['a', 'b', 'c', 'd'], + Core::headerLines([ + 'headers' => [ + 'foo' => ['a', 'b'], + 'Foo' => ['c', 'd'] + ] + ], 'foo') + ); + } + + public function testExtractsHeaderLines() + { + $this->assertEquals( + ['bar', 'baz'], + Core::headerLines([ + 'headers' => [ + 'Foo' => ['bar', 'baz'], + ], + ], 'Foo') + ); + } + + public function testExtractsHeaderAsString() + { + $this->assertEquals( + 'bar, baz', + Core::header([ + 'headers' => [ + 'Foo' => ['bar', 'baz'], + ], + ], 'Foo', true) + ); + } + + public function testReturnsNullWhenHeaderNotFound() + { + $this->assertNull(Core::header(['headers' => []], 'Foo')); + } + + public function testRemovesHeaders() + { + $message = [ + 'headers' => [ + 'foo' => ['bar'], + 'Foo' => ['bam'], + 'baz' => ['123'], + ], + ]; + + $this->assertSame($message, Core::removeHeader($message, 'bam')); + $this->assertEquals([ + 'headers' => ['baz' => ['123']], + ], Core::removeHeader($message, 'foo')); + } + + public function testCreatesUrl() + { + $req = [ + 'scheme' => 'http', + 'headers' => ['host' => ['foo.com']], + 'uri' => '/', + ]; + + $this->assertEquals('http://foo.com/', Core::url($req)); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage No Host header was provided + */ + public function testEnsuresHostIsAvailableWhenCreatingUrls() + { + Core::url([]); + } + + public function testCreatesUrlWithQueryString() + { + $req = [ + 'scheme' => 'http', + 'headers' => ['host' => ['foo.com']], + 'uri' => '/', + 'query_string' => 'foo=baz', + ]; + + $this->assertEquals('http://foo.com/?foo=baz', Core::url($req)); + } + + public function testUsesUrlIfSet() + { + $req = ['url' => 'http://foo.com']; + $this->assertEquals('http://foo.com', Core::url($req)); + } + + public function testReturnsNullWhenNoBody() + { + $this->assertNull(Core::body([])); + } + + public function testReturnsStreamAsString() + { + $this->assertEquals( + 'foo', + Core::body(['body' => Stream::factory('foo')]) + ); + } + + public function testReturnsString() + { + $this->assertEquals('foo', Core::body(['body' => 'foo'])); + } + + public function testReturnsResourceContent() + { + $r = fopen('php://memory', 'w+'); + fwrite($r, 'foo'); + rewind($r); + $this->assertEquals('foo', Core::body(['body' => $r])); + fclose($r); + } + + public function testReturnsIteratorContent() + { + $a = new \ArrayIterator(['a', 'b', 'cd', '']); + $this->assertEquals('abcd', Core::body(['body' => $a])); + } + + public function testReturnsObjectToString() + { + $this->assertEquals('foo', Core::body(['body' => new StrClass])); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testEnsuresBodyIsValid() + { + Core::body(['body' => false]); + } + + public function testParsesHeadersFromLines() + { + $lines = ['Foo: bar', 'Foo: baz', 'Abc: 123', 'Def: a, b']; + $this->assertEquals([ + 'Foo' => ['bar', 'baz'], + 'Abc' => ['123'], + 'Def' => ['a, b'], + ], Core::headersFromLines($lines)); + } + + public function testParsesHeadersFromLinesWithMultipleLines() + { + $lines = ['Foo: bar', 'Foo: baz', 'Foo: 123']; + $this->assertEquals([ + 'Foo' => ['bar', 'baz', '123'], + ], Core::headersFromLines($lines)); + } + + public function testCreatesArrayCallFunctions() + { + $called = []; + $a = function ($a, $b) use (&$called) { + $called['a'] = func_get_args(); + }; + $b = function ($a, $b) use (&$called) { + $called['b'] = func_get_args(); + }; + $c = Core::callArray([$a, $b]); + $c(1, 2); + $this->assertEquals([1, 2], $called['a']); + $this->assertEquals([1, 2], $called['b']); + } + + public function testRewindsGuzzleStreams() + { + $str = Stream::factory('foo'); + $this->assertTrue(Core::rewindBody(['body' => $str])); + } + + public function testRewindsStreams() + { + $str = Stream::factory('foo')->detach(); + $this->assertTrue(Core::rewindBody(['body' => $str])); + } + + public function testRewindsIterators() + { + $iter = new \ArrayIterator(['foo']); + $this->assertTrue(Core::rewindBody(['body' => $iter])); + } + + public function testRewindsStrings() + { + $this->assertTrue(Core::rewindBody(['body' => 'hi'])); + } + + public function testRewindsToStrings() + { + $this->assertTrue(Core::rewindBody(['body' => new StrClass()])); + } + + public function typeProvider() + { + return [ + ['foo', 'string(3) "foo"'], + [true, 'bool(true)'], + [false, 'bool(false)'], + [10, 'int(10)'], + [1.0, 'float(1)'], + [new StrClass(), 'object(GuzzleHttp\Tests\Ring\StrClass)'], + [['foo'], 'array(1)'] + ]; + } + + /** + * @dataProvider typeProvider + */ + public function testDescribesType($input, $output) + { + $this->assertEquals($output, Core::describeType($input)); + } + + public function testDoesSleep() + { + $t = microtime(true); + $expected = $t + (100 / 1000); + Core::doSleep(['client' => ['delay' => 100]]); + $this->assertGreaterThanOrEqual($expected, microtime(true)); + } + + public function testProxiesFuture() + { + $f = new CompletedFutureArray(['status' => 200]); + $res = null; + $proxied = Core::proxy($f, function ($value) use (&$res) { + $value['foo'] = 'bar'; + $res = $value; + return $value; + }); + $this->assertNotSame($f, $proxied); + $this->assertEquals(200, $f->wait()['status']); + $this->assertArrayNotHasKey('foo', $f->wait()); + $this->assertEquals('bar', $proxied->wait()['foo']); + $this->assertEquals(200, $proxied->wait()['status']); + } + + public function testProxiesDeferredFuture() + { + $d = new Deferred(); + $f = new FutureArray($d->promise()); + $f2 = Core::proxy($f); + $d->resolve(['foo' => 'bar']); + $this->assertEquals('bar', $f['foo']); + $this->assertEquals('bar', $f2['foo']); + } + + public function testProxiesDeferredFutureFailure() + { + $d = new Deferred(); + $f = new FutureArray($d->promise()); + $f2 = Core::proxy($f); + $d->reject(new \Exception('foo')); + try { + $f2['hello?']; + $this->fail('did not throw'); + } catch (\Exception $e) { + $this->assertEquals('foo', $e->getMessage()); + } + + } +} + +final class StrClass +{ + public function __toString() + { + return 'foo'; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php new file mode 100644 index 00000000000..82d7efbf5ca --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureArrayTest.php @@ -0,0 +1,21 @@ + 'bar']); + $this->assertEquals('bar', $f['foo']); + $this->assertFalse(isset($f['baz'])); + $f['abc'] = '123'; + $this->assertTrue(isset($f['abc'])); + $this->assertEquals(['foo' => 'bar', 'abc' => '123'], iterator_to_array($f)); + $this->assertEquals(2, count($f)); + unset($f['abc']); + $this->assertEquals(1, count($f)); + $this->assertEquals(['foo' => 'bar'], iterator_to_array($f)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php new file mode 100644 index 00000000000..6ded40dfba6 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/CompletedFutureValueTest.php @@ -0,0 +1,46 @@ +assertEquals('hi', $f->wait()); + $f->cancel(); + + $a = null; + $f->then(function ($v) use (&$a) { + $a = $v; + }); + $this->assertSame('hi', $a); + } + + public function testThrows() + { + $ex = new \Exception('foo'); + $f = new CompletedFutureValue(null, $ex); + $f->cancel(); + try { + $f->wait(); + $this->fail('did not throw'); + } catch (\Exception $e) { + $this->assertSame($e, $ex); + } + } + + public function testMarksAsCancelled() + { + $ex = new CancelledFutureAccessException(); + $f = new CompletedFutureValue(null, $ex); + try { + $f->wait(); + $this->fail('did not throw'); + } catch (\Exception $e) { + $this->assertSame($e, $ex); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php new file mode 100644 index 00000000000..0e09f5afa83 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureArrayTest.php @@ -0,0 +1,56 @@ +promise(), + function () use (&$c, $deferred) { + $c = true; + $deferred->resolve(['status' => 200]); + } + ); + $this->assertFalse($c); + $this->assertFalse($this->readAttribute($f, 'isRealized')); + $this->assertEquals(200, $f['status']); + $this->assertTrue($c); + } + + public function testActsLikeArray() + { + $deferred = new Deferred(); + $f = new FutureArray( + $deferred->promise(), + function () use (&$c, $deferred) { + $deferred->resolve(['status' => 200]); + } + ); + + $this->assertTrue(isset($f['status'])); + $this->assertEquals(200, $f['status']); + $this->assertEquals(['status' => 200], $f->wait()); + $this->assertEquals(1, count($f)); + $f['baz'] = 10; + $this->assertEquals(10, $f['baz']); + unset($f['baz']); + $this->assertFalse(isset($f['baz'])); + $this->assertEquals(['status' => 200], iterator_to_array($f)); + } + + /** + * @expectedException \RuntimeException + */ + public function testThrowsWhenAccessingInvalidProperty() + { + $deferred = new Deferred(); + $f = new FutureArray($deferred->promise(), function () {}); + $f->foo; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureValueTest.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureValueTest.php new file mode 100644 index 00000000000..d59c543d0ff --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/Future/FutureValueTest.php @@ -0,0 +1,109 @@ +promise(), + function () use ($deferred, &$called) { + $called++; + $deferred->resolve('foo'); + } + ); + + $this->assertEquals('foo', $f->wait()); + $this->assertEquals(1, $called); + $this->assertEquals('foo', $f->wait()); + $this->assertEquals(1, $called); + $f->cancel(); + $this->assertTrue($this->readAttribute($f, 'isRealized')); + } + + /** + * @expectedException \GuzzleHttp\Ring\Exception\CancelledFutureAccessException + */ + public function testThrowsWhenAccessingCancelled() + { + $f = new FutureValue( + (new Deferred())->promise(), + function () {}, + function () { return true; } + ); + $f->cancel(); + $f->wait(); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testThrowsWhenDerefFailure() + { + $called = false; + $deferred = new Deferred(); + $f = new FutureValue( + $deferred->promise(), + function () use(&$called) { + $called = true; + } + ); + $deferred->reject(new \OutOfBoundsException()); + $f->wait(); + $this->assertFalse($called); + } + + /** + * @expectedException \GuzzleHttp\Ring\Exception\RingException + * @expectedExceptionMessage Waiting did not resolve future + */ + public function testThrowsWhenDerefDoesNotResolve() + { + $deferred = new Deferred(); + $f = new FutureValue( + $deferred->promise(), + function () use(&$called) { + $called = true; + } + ); + $f->wait(); + } + + public function testThrowingCancelledFutureAccessExceptionCancels() + { + $deferred = new Deferred(); + $f = new FutureValue( + $deferred->promise(), + function () use ($deferred) { + throw new CancelledFutureAccessException(); + } + ); + try { + $f->wait(); + $this->fail('did not throw'); + } catch (CancelledFutureAccessException $e) {} + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage foo + */ + public function testThrowingExceptionInDerefMarksAsFailed() + { + $deferred = new Deferred(); + $f = new FutureValue( + $deferred->promise(), + function () { + throw new \Exception('foo'); + } + ); + $f->wait(); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/ringphp/tests/bootstrap.php b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/bootstrap.php new file mode 100644 index 00000000000..017610fe0d8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/ringphp/tests/bootstrap.php @@ -0,0 +1,11 @@ + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/guzzlehttp/streams/Makefile b/upload/system/storage/vendor/guzzlehttp/streams/Makefile new file mode 100644 index 00000000000..f4d42849e52 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/Makefile @@ -0,0 +1,19 @@ +all: clean coverage + +release: tag + git push origin --tags + +tag: + chag tag --sign --debug CHANGELOG.rst + +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/upload/system/storage/vendor/guzzlehttp/streams/README.rst b/upload/system/storage/vendor/guzzlehttp/streams/README.rst new file mode 100644 index 00000000000..baff63b37d5 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/README.rst @@ -0,0 +1,36 @@ +============== +Guzzle Streams +============== + +Provides a simple abstraction over streams of data. + +This library is used in `Guzzle 5 `_, and is +(currently) compatible with the WIP PSR-7. + +Installation +============ + +This package can be installed easily using `Composer `_. +Simply add the following to the composer.json file at the root of your project: + +.. code-block:: javascript + + { + "require": { + "guzzlehttp/streams": "~3.0" + } + } + +Then install your dependencies using ``composer.phar install``. + +Documentation +============= + +The documentation for this package can be found on the main Guzzle website at +http://docs.guzzlephp.org/en/guzzle4/streams.html. + +Testing +======= + +This library is tested using PHPUnit. You'll need to install the dependencies +using `Composer `_ then run ``make test``. diff --git a/upload/system/storage/vendor/guzzlehttp/streams/composer.json b/upload/system/storage/vendor/guzzlehttp/streams/composer.json new file mode 100644 index 00000000000..6d7034370bd --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/composer.json @@ -0,0 +1,28 @@ +{ + "name": "guzzlehttp/streams", + "description": "Provides a simple abstraction over streams of data", + "homepage": "http://guzzlephp.org/", + "keywords": ["stream", "guzzle"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "autoload": { + "psr-4": { "GuzzleHttp\\Stream\\": "src/" } + }, + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/phpunit.xml.dist b/upload/system/storage/vendor/guzzlehttp/streams/phpunit.xml.dist new file mode 100644 index 00000000000..6e758c1927b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/phpunit.xml.dist @@ -0,0 +1,17 @@ + + + + + tests + + + + + src + + src/functions.php + + + + diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/AppendStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/AppendStream.php new file mode 100644 index 00000000000..94bda7173f7 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/AppendStream.php @@ -0,0 +1,220 @@ +addStream($stream); + } + } + + public function __toString() + { + try { + $this->seek(0); + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream) + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Closes each attached stream. + * + * {@inheritdoc} + */ + public function close() + { + $this->pos = $this->current = 0; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream + * + * {@inheritdoc} + */ + public function detach() + { + $this->close(); + $this->detached = true; + } + + public function attach($stream) + { + throw new CannotAttachException(); + } + + public function tell() + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + * + * {@inheritdoc} + */ + public function getSize() + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof() + { + return !$this->streams || + ($this->current >= count($this->streams) - 1 && + $this->streams[$this->current]->eof()); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + * + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if (!$this->seekable || $whence !== SEEK_SET) { + return false; + } + + $success = true; + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $stream) { + if (!$stream->seek(0)) { + $success = false; + } + } + + if (!$success) { + return false; + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $this->read(min(8096, $offset - $this->pos)); + } + + return $this->pos == $offset; + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + * + * {@inheritdoc} + */ + public function read($length) + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + + while ($remaining > 0) { + // Progress to the next stream if needed. + if ($this->streams[$this->current]->eof()) { + if ($this->current == $total) { + break; + } + $this->current++; + } + $buffer .= $this->streams[$this->current]->read($remaining); + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return false; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function write($string) + { + return false; + } + + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/AsyncReadStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/AsyncReadStream.php new file mode 100644 index 00000000000..25ad96021a7 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/AsyncReadStream.php @@ -0,0 +1,207 @@ +isReadable() || !$buffer->isWritable()) { + throw new \InvalidArgumentException( + 'Buffer must be readable and writable' + ); + } + + if (isset($config['size'])) { + $this->size = $config['size']; + } + + static $callables = ['pump', 'drain']; + foreach ($callables as $check) { + if (isset($config[$check])) { + if (!is_callable($config[$check])) { + throw new \InvalidArgumentException( + $check . ' must be callable' + ); + } + $this->{$check} = $config[$check]; + } + } + + $this->hwm = $buffer->getMetadata('hwm'); + + // Cannot drain when there's no high water mark. + if ($this->hwm === null) { + $this->drain = null; + } + + $this->stream = $buffer; + } + + /** + * Factory method used to create new async stream and an underlying buffer + * if no buffer is provided. + * + * This function accepts the same options as AsyncReadStream::__construct, + * but added the following key value pairs: + * + * - buffer: (StreamInterface) Buffer used to buffer data. If none is + * provided, a default buffer is created. + * - hwm: (int) High water mark to use if a buffer is created on your + * behalf. + * - max_buffer: (int) If provided, wraps the utilized buffer in a + * DroppingStream decorator to ensure that buffer does not exceed a given + * length. When exceeded, the stream will begin dropping data. Set the + * max_buffer to 0, to use a NullStream which does not store data. + * - write: (callable) A function that is invoked when data is written + * to the underlying buffer. The function accepts the buffer as the first + * argument, and the data being written as the second. The function MUST + * return the number of bytes that were written or false to let writers + * know to slow down. + * - drain: (callable) See constructor documentation. + * - pump: (callable) See constructor documentation. + * + * @param array $options Associative array of options. + * + * @return array Returns an array containing the buffer used to buffer + * data, followed by the ready to use AsyncReadStream object. + */ + public static function create(array $options = []) + { + $maxBuffer = isset($options['max_buffer']) + ? $options['max_buffer'] + : null; + + if ($maxBuffer === 0) { + $buffer = new NullStream(); + } elseif (isset($options['buffer'])) { + $buffer = $options['buffer']; + } else { + $hwm = isset($options['hwm']) ? $options['hwm'] : 16384; + $buffer = new BufferStream($hwm); + } + + if ($maxBuffer > 0) { + $buffer = new DroppingStream($buffer, $options['max_buffer']); + } + + // Call the on_write callback if an on_write function was provided. + if (isset($options['write'])) { + $onWrite = $options['write']; + $buffer = FnStream::decorate($buffer, [ + 'write' => function ($string) use ($buffer, $onWrite) { + $result = $buffer->write($string); + $onWrite($buffer, $string); + return $result; + } + ]); + } + + return [$buffer, new self($buffer, $options)]; + } + + public function getSize() + { + return $this->size; + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + return false; + } + + public function read($length) + { + if (!$this->needsDrain && $this->drain) { + $this->needsDrain = $this->stream->getSize() >= $this->hwm; + } + + $result = $this->stream->read($length); + + // If we need to drain, then drain when the buffer is empty. + if ($this->needsDrain && $this->stream->getSize() === 0) { + $this->needsDrain = false; + $drainFn = $this->drain; + $drainFn($this->stream); + } + + $resultLen = strlen($result); + + // If a pump was provided, the buffer is still open, and not enough + // data was given, then block until the data is provided. + if ($this->pump && $resultLen < $length) { + $pumpFn = $this->pump; + $result .= $pumpFn($length - $resultLen); + } + + return $result; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/BufferStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/BufferStream.php new file mode 100644 index 00000000000..0fffbd63a8c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/BufferStream.php @@ -0,0 +1,138 @@ +hwm = $hwm; + } + + public function __toString() + { + return $this->getContents(); + } + + public function getContents() + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close() + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + } + + public function attach($stream) + { + throw new CannotAttachException(); + } + + public function getSize() + { + return strlen($this->buffer); + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return true; + } + + public function isSeekable() + { + return false; + } + + public function seek($offset, $whence = SEEK_SET) + { + return false; + } + + public function eof() + { + return strlen($this->buffer) === 0; + } + + public function tell() + { + return false; + } + + /** + * Reads data from the buffer. + */ + public function read($length) + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string) + { + $this->buffer .= $string; + + if (strlen($this->buffer) >= $this->hwm) { + return false; + } + + return strlen($string); + } + + public function getMetadata($key = null) + { + if ($key == 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/CachingStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/CachingStream.php new file mode 100644 index 00000000000..60bb9056c43 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/CachingStream.php @@ -0,0 +1,122 @@ +remoteStream = $stream; + $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); + } + + public function getSize() + { + return max($this->stream->getSize(), $this->remoteStream->getSize()); + } + + /** + * {@inheritdoc} + * @throws SeekException When seeking with SEEK_END or when seeking + * past the total size of the buffer stream + */ + public function seek($offset, $whence = SEEK_SET) + { + if ($whence == SEEK_SET) { + $byte = $offset; + } elseif ($whence == SEEK_CUR) { + $byte = $offset + $this->tell(); + } else { + return false; + } + + // You cannot skip ahead past where you've read from the remote stream + if ($byte > $this->stream->getSize()) { + throw new SeekException( + $this, + $byte, + sprintf('Cannot seek to byte %d when the buffered stream only' + . ' contains %d bytes', $byte, $this->stream->getSize()) + ); + } + + return $this->stream->seek($byte); + } + + public function read($length) + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string) + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof() + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close() + { + $this->remoteStream->close() && $this->stream->close(); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/DroppingStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/DroppingStream.php new file mode 100644 index 00000000000..56ee80c123a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/DroppingStream.php @@ -0,0 +1,42 @@ +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string) + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning false when the underlying stream is too large. + if ($diff <= 0) { + return false; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + $this->stream->write(substr($string, 0, $diff)); + + return false; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/Exception/CannotAttachException.php b/upload/system/storage/vendor/guzzlehttp/streams/src/Exception/CannotAttachException.php new file mode 100644 index 00000000000..e631b9fa44b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/Exception/CannotAttachException.php @@ -0,0 +1,4 @@ +stream = $stream; + $msg = $msg ?: 'Could not seek the stream to position ' . $pos; + parent::__construct($msg); + } + + /** + * @return StreamInterface + */ + public function getStream() + { + return $this->stream; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/FnStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/FnStream.php new file mode 100644 index 00000000000..6b5872d7f6c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/FnStream.php @@ -0,0 +1,147 @@ +methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_' . $name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * @throws \BadMethodCallException + */ + public function __get($name) + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + . '() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { + $methods[$diff] = [$stream, $diff]; + } + + return new self($methods); + } + + public function __toString() + { + return call_user_func($this->_fn___toString); + } + + public function close() + { + return call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function attach($stream) + { + return call_user_func($this->_fn_attach, $stream); + } + + public function getSize() + { + return call_user_func($this->_fn_getSize); + } + + public function tell() + { + return call_user_func($this->_fn_tell); + } + + public function eof() + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable() + { + return call_user_func($this->_fn_isSeekable); + } + + public function seek($offset, $whence = SEEK_SET) + { + return call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable() + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string) + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable() + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length) + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents() + { + return call_user_func($this->_fn_getContents); + } + + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/GuzzleStreamWrapper.php b/upload/system/storage/vendor/guzzlehttp/streams/src/GuzzleStreamWrapper.php new file mode 100644 index 00000000000..4d049a6936d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/GuzzleStreamWrapper.php @@ -0,0 +1,117 @@ +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + . 'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, null, stream_context_create([ + 'guzzle' => ['stream' => $stream] + ])); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register() + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open($path, $mode, $options, &$opened_path) + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read($count) + { + return $this->stream->read($count); + } + + public function stream_write($data) + { + return (int) $this->stream->write($data); + } + + public function stream_tell() + { + return $this->stream->tell(); + } + + public function stream_eof() + { + return $this->stream->eof(); + } + + public function stream_seek($offset, $whence) + { + return $this->stream->seek($offset, $whence); + } + + public function stream_stat() + { + static $modeMap = [ + 'r' => 33060, + 'r+' => 33206, + 'w' => 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, + 'blksize' => 0, + 'blocks' => 0 + ]; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/InflateStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/InflateStream.php new file mode 100644 index 00000000000..978af21031b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/InflateStream.php @@ -0,0 +1,27 @@ +stream = new Stream($resource); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/LazyOpenStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/LazyOpenStream.php new file mode 100644 index 00000000000..6242ee7b57f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/LazyOpenStream.php @@ -0,0 +1,37 @@ +filename = $filename; + $this->mode = $mode; + } + + /** + * Creates the underlying stream lazily when required. + * + * @return StreamInterface + */ + protected function createStream() + { + return Stream::factory(Utils::open($this->filename, $this->mode)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/LimitStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/LimitStream.php new file mode 100644 index 00000000000..e9fad985733 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/LimitStream.php @@ -0,0 +1,161 @@ +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof() + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit == -1) { + return false; + } + + $tell = $this->stream->tell(); + if ($tell === false) { + return false; + } + + return $tell >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + * {@inheritdoc} + */ + public function getSize() + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit == -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if ($whence !== SEEK_SET || $offset < 0) { + return false; + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + return $this->stream->seek($offset); + } + + /** + * Give a relative tell() + * {@inheritdoc} + */ + public function tell() + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @return self + * @throws SeekException + */ + public function setOffset($offset) + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if (!$this->stream->seek($offset)) { + if ($current > $offset) { + throw new SeekException($this, $offset); + } else { + $this->stream->read($offset - $current); + } + } + } + + $this->offset = $offset; + + return $this; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + * @return self + */ + public function setLimit($limit) + { + $this->limit = $limit; + + return $this; + } + + public function read($length) + { + if ($this->limit == -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } else { + return false; + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/MetadataStreamInterface.php b/upload/system/storage/vendor/guzzlehttp/streams/src/MetadataStreamInterface.php new file mode 100644 index 00000000000..c1433ad83e8 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/MetadataStreamInterface.php @@ -0,0 +1,11 @@ +stream->attach($stream); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/NullStream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/NullStream.php new file mode 100644 index 00000000000..41ee776683a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/NullStream.php @@ -0,0 +1,78 @@ +source = $source; + $this->size = isset($options['size']) ? $options['size'] : null; + $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; + $this->buffer = new BufferStream(); + } + + public function __toString() + { + return Utils::copyToString($this); + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = false; + $this->source = null; + } + + public function attach($stream) + { + throw new CannotAttachException(); + } + + public function getSize() + { + return $this->size; + } + + public function tell() + { + return $this->tellPos; + } + + public function eof() + { + return !$this->source; + } + + public function isSeekable() + { + return false; + } + + public function seek($offset, $whence = SEEK_SET) + { + return false; + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + return false; + } + + public function isReadable() + { + return true; + } + + public function read($length) + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents() + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + } + + private function pump($length) + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/Stream.php b/upload/system/storage/vendor/guzzlehttp/streams/src/Stream.php new file mode 100644 index 00000000000..7adbc5e3f3e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/Stream.php @@ -0,0 +1,261 @@ + [ + 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, + 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, + 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a+' => true + ], + 'write' => [ + 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, + 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, + 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true + ] + ]; + + /** + * Create a new stream based on the input type. + * + * This factory accepts the same associative array of options as described + * in the constructor. + * + * @param resource|string|StreamInterface $resource Entity body data + * @param array $options Additional options + * + * @return Stream + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function factory($resource = '', array $options = []) + { + $type = gettype($resource); + + if ($type == 'string') { + $stream = fopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, $resource); + fseek($stream, 0); + } + return new self($stream, $options); + } + + if ($type == 'resource') { + return new self($resource, $options); + } + + if ($resource instanceof StreamInterface) { + return $resource; + } + + if ($type == 'object' && method_exists($resource, '__toString')) { + return self::factory((string) $resource, $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + if ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . $type); + } + + /** + * This constructor accepts an associative array of options. + * + * - size: (int) If a read stream would otherwise have an indeterminate + * size, but the size is known due to foreknownledge, then you can + * provide that size, in bytes. + * - metadata: (array) Any additional metadata to return when the metadata + * of the stream is accessed. + * + * @param resource $stream Stream resource to wrap. + * @param array $options Associative array of options. + * + * @throws \InvalidArgumentException if the stream is not a stream resource + */ + public function __construct($stream, $options = []) + { + if (!is_resource($stream)) { + throw new \InvalidArgumentException('Stream must be a resource'); + } + + if (isset($options['size'])) { + $this->size = $options['size']; + } + + $this->customMetadata = isset($options['metadata']) + ? $options['metadata'] + : []; + + $this->attach($stream); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString() + { + if (!$this->stream) { + return ''; + } + + $this->seek(0); + + return (string) stream_get_contents($this->stream); + } + + public function getContents() + { + return $this->stream ? stream_get_contents($this->stream) : ''; + } + + public function close() + { + if (is_resource($this->stream)) { + fclose($this->stream); + } + + $this->detach(); + } + + public function detach() + { + $result = $this->stream; + $this->stream = $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function attach($stream) + { + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]); + $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]); + $this->uri = $this->getMetadata('uri'); + } + + public function getSize() + { + if ($this->size !== null) { + return $this->size; + } + + if (!$this->stream) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + return $this->size; + } + + return null; + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function eof() + { + return !$this->stream || feof($this->stream); + } + + public function tell() + { + return $this->stream ? ftell($this->stream) : false; + } + + public function setSize($size) + { + $this->size = $size; + + return $this; + } + + public function seek($offset, $whence = SEEK_SET) + { + return $this->seekable + ? fseek($this->stream, $offset, $whence) === 0 + : false; + } + + public function read($length) + { + return $this->readable ? fread($this->stream, $length) : false; + } + + public function write($string) + { + // We can't know the size after writing anything + $this->size = null; + + return $this->writable ? fwrite($this->stream, $string) : false; + } + + public function getMetadata($key = null) + { + if (!$this->stream) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return isset($meta[$key]) ? $meta[$key] : null; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/StreamDecoratorTrait.php b/upload/system/storage/vendor/guzzlehttp/streams/src/StreamDecoratorTrait.php new file mode 100644 index 00000000000..39c19c58ccf --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/StreamDecoratorTrait.php @@ -0,0 +1,143 @@ +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + */ + public function __get($name) + { + if ($name == 'stream') { + $this->stream = $this->createStream(); + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString() + { + try { + $this->seek(0); + return $this->getContents(); + } catch (\Exception $e) { + // Really, PHP? https://bugs.php.net/bug.php?id=53648 + trigger_error('StreamDecorator::__toString exception: ' + . (string) $e, E_USER_ERROR); + return ''; + } + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Allow decorators to implement custom methods + * + * @param string $method Missing method name + * @param array $args Method arguments + * + * @return mixed + */ + public function __call($method, array $args) + { + $result = call_user_func_array(array($this->stream, $method), $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close() + { + $this->stream->close(); + } + + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function attach($stream) + { + throw new CannotAttachException(); + } + + public function getSize() + { + return $this->stream->getSize(); + } + + public function eof() + { + return $this->stream->eof(); + } + + public function tell() + { + return $this->stream->tell(); + } + + public function isReadable() + { + return $this->stream->isReadable(); + } + + public function isWritable() + { + return $this->stream->isWritable(); + } + + public function isSeekable() + { + return $this->stream->isSeekable(); + } + + public function seek($offset, $whence = SEEK_SET) + { + return $this->stream->seek($offset, $whence); + } + + public function read($length) + { + return $this->stream->read($length); + } + + public function write($string) + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @return StreamInterface + * @throws \BadMethodCallException + */ + protected function createStream() + { + throw new \BadMethodCallException('createStream() not implemented in ' + . get_class($this)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/src/StreamInterface.php b/upload/system/storage/vendor/guzzlehttp/streams/src/StreamInterface.php new file mode 100644 index 00000000000..fd19c6f25ae --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/src/StreamInterface.php @@ -0,0 +1,159 @@ +eof()) { + $buf = $stream->read(1048576); + if ($buf === false) { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + if ($buf === false) { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + */ + public static function copyToStream( + StreamInterface $source, + StreamInterface $dest, + $maxLen = -1 + ) { + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read(1048576))) { + break; + } + } + return; + } + + $bytes = 0; + while (!$source->eof()) { + $buf = $source->read($maxLen - $bytes); + if (!($len = strlen($buf))) { + break; + } + $bytes += $len; + $dest->write($buf); + if ($bytes == $maxLen) { + break; + } + } + } + + /** + * Calculate a hash of a Stream + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @return string Returns the hash of the stream + * @throws SeekException + */ + public static function hash( + StreamInterface $stream, + $algo, + $rawOutput = false + ) { + $pos = $stream->tell(); + + if ($pos > 0 && !$stream->seek(0)) { + throw new SeekException($stream); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Read a line from the stream up to the maximum allowed buffer length + * + * @param StreamInterface $stream Stream to read from + * @param int $maxLength Maximum buffer length + * + * @return string|bool + */ + public static function readline(StreamInterface $stream, $maxLength = null) + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + if (false === ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte == PHP_EOL || ++$size == $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Alias of GuzzleHttp\Stream\Stream::factory. + * + * @param mixed $resource Resource to create + * @param array $options Associative array of stream options defined in + * {@see \GuzzleHttp\Stream\Stream::__construct} + * + * @return StreamInterface + * + * @see GuzzleHttp\Stream\Stream::factory + * @see GuzzleHttp\Stream\Stream::__construct + */ + public static function create($resource, array $options = []) + { + return Stream::factory($resource, $options); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/AppendStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/AppendStreamTest.php new file mode 100644 index 00000000000..78798d9f7a0 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/AppendStreamTest.php @@ -0,0 +1,178 @@ +getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['isReadable']) + ->getMockForAbstractClass(); + $s->expects($this->once()) + ->method('isReadable') + ->will($this->returnValue(false)); + $a->addStream($s); + } + + public function testValidatesSeekType() + { + $a = new AppendStream(); + $this->assertFalse($a->seek(100, SEEK_CUR)); + } + + public function testTriesToRewindOnSeek() + { + $a = new AppendStream(); + $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['isReadable', 'seek', 'isSeekable']) + ->getMockForAbstractClass(); + $s->expects($this->once()) + ->method('isReadable') + ->will($this->returnValue(true)); + $s->expects($this->once()) + ->method('isSeekable') + ->will($this->returnValue(true)); + $s->expects($this->once()) + ->method('seek') + ->will($this->returnValue(false)); + $a->addStream($s); + $this->assertFalse($a->seek(10)); + } + + public function testSeeksToPositionByReading() + { + $a = new AppendStream([ + Stream::factory('foo'), + Stream::factory('bar'), + Stream::factory('baz'), + ]); + + $this->assertTrue($a->seek(3)); + $this->assertEquals(3, $a->tell()); + $this->assertEquals('bar', $a->read(3)); + $a->seek(6); + $this->assertEquals(6, $a->tell()); + $this->assertEquals('baz', $a->read(3)); + } + + public function testDetachesEachStream() + { + $s1 = Stream::factory('foo'); + $s2 = Stream::factory('foo'); + $a = new AppendStream([$s1, $s2]); + $this->assertSame('foofoo', (string) $a); + $a->detach(); + $this->assertSame('', (string) $a); + $this->assertSame(0, $a->getSize()); + } + + public function testClosesEachStream() + { + $s1 = Stream::factory('foo'); + $a = new AppendStream([$s1]); + $a->close(); + $this->assertSame('', (string) $a); + } + + public function testIsNotWritable() + { + $a = new AppendStream([Stream::factory('foo')]); + $this->assertFalse($a->isWritable()); + $this->assertTrue($a->isSeekable()); + $this->assertTrue($a->isReadable()); + $this->assertFalse($a->write('foo')); + } + + public function testDoesNotNeedStreams() + { + $a = new AppendStream(); + $this->assertEquals('', (string) $a); + } + + public function testCanReadFromMultipleStreams() + { + $a = new AppendStream([ + Stream::factory('foo'), + Stream::factory('bar'), + Stream::factory('baz'), + ]); + $this->assertFalse($a->eof()); + $this->assertSame(0, $a->tell()); + $this->assertEquals('foo', $a->read(3)); + $this->assertEquals('bar', $a->read(3)); + $this->assertEquals('baz', $a->read(3)); + $this->assertTrue($a->eof()); + $this->assertSame(9, $a->tell()); + $this->assertEquals('foobarbaz', (string) $a); + } + + public function testCanDetermineSizeFromMultipleStreams() + { + $a = new AppendStream([ + Stream::factory('foo'), + Stream::factory('bar') + ]); + $this->assertEquals(6, $a->getSize()); + + $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['isSeekable', 'isReadable']) + ->getMockForAbstractClass(); + $s->expects($this->once()) + ->method('isSeekable') + ->will($this->returnValue(null)); + $s->expects($this->once()) + ->method('isReadable') + ->will($this->returnValue(true)); + $a->addStream($s); + $this->assertNull($a->getSize()); + } + + public function testCatchesExceptionsWhenCastingToString() + { + $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['read', 'isReadable', 'eof']) + ->getMockForAbstractClass(); + $s->expects($this->once()) + ->method('read') + ->will($this->throwException(new \RuntimeException('foo'))); + $s->expects($this->once()) + ->method('isReadable') + ->will($this->returnValue(true)); + $s->expects($this->any()) + ->method('eof') + ->will($this->returnValue(false)); + $a = new AppendStream([$s]); + $this->assertFalse($a->eof()); + $this->assertSame('', (string) $a); + } + + public function testCanDetach() + { + $s = new AppendStream(); + $s->detach(); + } + + public function testReturnsEmptyMetadata() + { + $s = new AppendStream(); + $this->assertEquals([], $s->getMetadata()); + $this->assertNull($s->getMetadata('foo')); + } + + /** + * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException + */ + public function testCannotAttach() + { + $p = new AppendStream(); + $p->attach('a'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/AsyncReadStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/AsyncReadStreamTest.php new file mode 100644 index 00000000000..8c78995962a --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/AsyncReadStreamTest.php @@ -0,0 +1,186 @@ + function () { return false; }] + )); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Buffer must be readable and writable + */ + public function testValidatesWritableBuffer() + { + new AsyncReadStream(FnStream::decorate( + Stream::factory(), + ['isWritable' => function () { return false; }] + )); + } + + public function testValidatesHwmMetadata() + { + $a = new AsyncReadStream(Stream::factory(), [ + 'drain' => function() {} + ]); + $this->assertNull($this->readAttribute($a, 'drain')); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage pump must be callable + */ + public function testValidatesPumpIsCallable() + { + new AsyncReadStream(new BufferStream(), ['pump' => true]); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage drain must be callable + */ + public function testValidatesDrainIsCallable() + { + new AsyncReadStream(new BufferStream(), ['drain' => true]); + } + + public function testCanInitialize() + { + $buffer = new BufferStream(); + $a = new AsyncReadStream($buffer, [ + 'size' => 10, + 'drain' => function () {}, + 'pump' => function () {}, + ]); + $this->assertSame($buffer, $this->readAttribute($a, 'stream')); + $this->assertTrue(is_callable($this->readAttribute($a, 'drain'))); + $this->assertTrue(is_callable($this->readAttribute($a, 'pump'))); + $this->assertTrue($a->isReadable()); + $this->assertFalse($a->isSeekable()); + $this->assertFalse($a->isWritable()); + $this->assertFalse($a->write('foo')); + $this->assertEquals(10, $a->getSize()); + } + + public function testReadsFromBufferWithNoDrainOrPump() + { + $buffer = new BufferStream(); + $a = new AsyncReadStream($buffer); + $buffer->write('foo'); + $this->assertNull($a->getSize()); + $this->assertEquals('foo', $a->read(10)); + $this->assertEquals('', $a->read(10)); + } + + public function testCallsPumpForMoreDataWhenRequested() + { + $called = 0; + $buffer = new BufferStream(); + $a = new AsyncReadStream($buffer, [ + 'pump' => function ($size) use (&$called) { + $called++; + return str_repeat('.', $size); + } + ]); + $buffer->write('foobar'); + $this->assertEquals('foo', $a->read(3)); + $this->assertEquals(0, $called); + $this->assertEquals('bar.....', $a->read(8)); + $this->assertEquals(1, $called); + $this->assertEquals('..', $a->read(2)); + $this->assertEquals(2, $called); + } + + public function testCallsDrainWhenNeeded() + { + $called = 0; + $buffer = new BufferStream(5); + $a = new AsyncReadStream($buffer, [ + 'drain' => function (BufferStream $b) use (&$called, $buffer) { + $this->assertSame($b, $buffer); + $called++; + } + ]); + + $buffer->write('foobar'); + $this->assertEquals(6, $buffer->getSize()); + $this->assertEquals(0, $called); + + $a->read(3); + $this->assertTrue($this->readAttribute($a, 'needsDrain')); + $this->assertEquals(3, $buffer->getSize()); + $this->assertEquals(0, $called); + + $a->read(3); + $this->assertEquals(0, $buffer->getSize()); + $this->assertFalse($this->readAttribute($a, 'needsDrain')); + $this->assertEquals(1, $called); + } + + public function testCreatesBufferWithNoConfig() + { + list($buffer, $async) = AsyncReadStream::create(); + $this->assertInstanceOf('GuzzleHttp\Stream\BufferStream', $buffer); + $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); + } + + public function testCreatesBufferWithSpecifiedBuffer() + { + $buf = new BufferStream(); + list($buffer, $async) = AsyncReadStream::create(['buffer' => $buf]); + $this->assertSame($buf, $buffer); + $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); + } + + public function testCreatesNullStream() + { + list($buffer, $async) = AsyncReadStream::create(['max_buffer' => 0]); + $this->assertInstanceOf('GuzzleHttp\Stream\NullStream', $buffer); + $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); + } + + public function testCreatesDroppingStream() + { + list($buffer, $async) = AsyncReadStream::create(['max_buffer' => 5]); + $this->assertInstanceOf('GuzzleHttp\Stream\DroppingStream', $buffer); + $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); + $buffer->write('12345678910'); + $this->assertEquals(5, $buffer->getSize()); + } + + public function testCreatesOnWriteStream() + { + $c = 0; + $b = new BufferStream(); + list($buffer, $async) = AsyncReadStream::create([ + 'buffer' => $b, + 'write' => function (BufferStream $buf, $data) use (&$c, $b) { + $this->assertSame($buf, $b); + $this->assertEquals('foo', $data); + $c++; + } + ]); + $this->assertInstanceOf('GuzzleHttp\Stream\FnStream', $buffer); + $this->assertInstanceOf('GuzzleHttp\Stream\AsyncReadStream', $async); + $this->assertEquals(0, $c); + $this->assertEquals(3, $buffer->write('foo')); + $this->assertEquals(1, $c); + $this->assertEquals(3, $buffer->write('foo')); + $this->assertEquals(2, $c); + $this->assertEquals('foofoo', (string) $buffer); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/BufferStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/BufferStreamTest.php new file mode 100644 index 00000000000..f9bfea21d18 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/BufferStreamTest.php @@ -0,0 +1,69 @@ +assertTrue($b->isReadable()); + $this->assertTrue($b->isWritable()); + $this->assertFalse($b->isSeekable()); + $this->assertEquals(null, $b->getMetadata('foo')); + $this->assertEquals(10, $b->getMetadata('hwm')); + $this->assertEquals([], $b->getMetadata()); + } + + public function testRemovesReadDataFromBuffer() + { + $b = new BufferStream(); + $this->assertEquals(3, $b->write('foo')); + $this->assertEquals(3, $b->getSize()); + $this->assertFalse($b->eof()); + $this->assertEquals('foo', $b->read(10)); + $this->assertTrue($b->eof()); + $this->assertEquals('', $b->read(10)); + } + + public function testCanCastToStringOrGetContents() + { + $b = new BufferStream(); + $b->write('foo'); + $b->write('baz'); + $this->assertEquals('foo', $b->read(3)); + $b->write('bar'); + $this->assertEquals('bazbar', (string) $b); + $this->assertFalse($b->tell()); + } + + public function testDetachClearsBuffer() + { + $b = new BufferStream(); + $b->write('foo'); + $b->detach(); + $this->assertEquals(0, $b->tell()); + $this->assertTrue($b->eof()); + $this->assertEquals(3, $b->write('abc')); + $this->assertEquals('abc', $b->read(10)); + } + + public function testExceedingHighwaterMarkReturnsFalseButStillBuffers() + { + $b = new BufferStream(5); + $this->assertEquals(3, $b->write('hi ')); + $this->assertFalse($b->write('hello')); + $this->assertEquals('hi hello', (string) $b); + $this->assertEquals(4, $b->write('test')); + } + + /** + * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException + */ + public function testCannotAttach() + { + $p = new BufferStream(); + $p->attach('a'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/CachingStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/CachingStreamTest.php new file mode 100644 index 00000000000..ea969b3ad7e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/CachingStreamTest.php @@ -0,0 +1,136 @@ +decorated = Stream::factory('testing'); + $this->body = new CachingStream($this->decorated); + } + + public function tearDown() + { + $this->decorated->close(); + $this->body->close(); + } + + public function testUsesRemoteSizeIfPossible() + { + $body = Stream::factory('test'); + $caching = new CachingStream($body); + $this->assertEquals(4, $caching->getSize()); + } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage Cannot seek to byte 10 + */ + public function testCannotSeekPastWhatHasBeenRead() + { + $this->body->seek(10); + } + + public function testCannotUseSeekEnd() + { + $this->assertFalse($this->body->seek(2, SEEK_END)); + } + + public function testRewindUsesSeek() + { + $a = Stream::factory('foo'); + $d = $this->getMockBuilder('GuzzleHttp\Stream\CachingStream') + ->setMethods(array('seek')) + ->setConstructorArgs(array($a)) + ->getMock(); + $d->expects($this->once()) + ->method('seek') + ->with(0) + ->will($this->returnValue(true)); + $d->seek(0); + } + + public function testCanSeekToReadBytes() + { + $this->assertEquals('te', $this->body->read(2)); + $this->body->seek(0); + $this->assertEquals('test', $this->body->read(4)); + $this->assertEquals(4, $this->body->tell()); + $this->body->seek(2); + $this->assertEquals(2, $this->body->tell()); + $this->body->seek(2, SEEK_CUR); + $this->assertEquals(4, $this->body->tell()); + $this->assertEquals('ing', $this->body->read(3)); + } + + public function testWritesToBufferStream() + { + $this->body->read(2); + $this->body->write('hi'); + $this->body->seek(0); + $this->assertEquals('tehiing', (string) $this->body); + } + + public function testSkipsOverwrittenBytes() + { + $decorated = Stream::factory( + implode("\n", array_map(function ($n) { + return str_pad($n, 4, '0', STR_PAD_LEFT); + }, range(0, 25))) + ); + + $body = new CachingStream($decorated); + + $this->assertEquals("0000\n", Utils::readline($body)); + $this->assertEquals("0001\n", Utils::readline($body)); + // Write over part of the body yet to be read, so skip some bytes + $this->assertEquals(5, $body->write("TEST\n")); + $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); + // Read, which skips bytes, then reads + $this->assertEquals("0003\n", Utils::readline($body)); + $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); + $this->assertEquals("0004\n", Utils::readline($body)); + $this->assertEquals("0005\n", Utils::readline($body)); + + // Overwrite part of the cached body (so don't skip any bytes) + $body->seek(5); + $this->assertEquals(5, $body->write("ABCD\n")); + $this->assertEquals(0, $this->readAttribute($body, 'skipReadBytes')); + $this->assertEquals("TEST\n", Utils::readline($body)); + $this->assertEquals("0003\n", Utils::readline($body)); + $this->assertEquals("0004\n", Utils::readline($body)); + $this->assertEquals("0005\n", Utils::readline($body)); + $this->assertEquals("0006\n", Utils::readline($body)); + $this->assertEquals(5, $body->write("1234\n")); + $this->assertEquals(5, $this->readAttribute($body, 'skipReadBytes')); + + // Seek to 0 and ensure the overwritten bit is replaced + $body->seek(0); + $this->assertEquals("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50)); + + // Ensure that casting it to a string does not include the bit that was overwritten + $this->assertContains("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body); + } + + public function testClosesBothStreams() + { + $s = fopen('php://temp', 'r'); + $a = Stream::factory($s); + $d = new CachingStream($a); + $d->close(); + $this->assertFalse(is_resource($s)); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php new file mode 100644 index 00000000000..bb2cb22048e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/DroppingStreamTest.php @@ -0,0 +1,26 @@ +assertEquals(3, $drop->write('hel')); + $this->assertFalse($drop->write('lo')); + $this->assertEquals(5, $drop->getSize()); + $this->assertEquals('hello', $drop->read(5)); + $this->assertEquals(0, $drop->getSize()); + $drop->write('12345678910'); + $this->assertEquals(5, $stream->getSize()); + $this->assertEquals(5, $drop->getSize()); + $this->assertEquals('12345', (string) $drop); + $this->assertEquals(0, $drop->getSize()); + $drop->write('hello'); + $this->assertFalse($drop->write('test')); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php new file mode 100644 index 00000000000..fd8cd1ad266 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/Exception/SeekExceptionTest.php @@ -0,0 +1,16 @@ +assertSame($s, $e->getStream()); + $this->assertContains('10', $e->getMessage()); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/FnStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/FnStreamTest.php new file mode 100644 index 00000000000..6cc336b916c --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/FnStreamTest.php @@ -0,0 +1,89 @@ +seek(1); + } + + public function testProxiesToFunction() + { + $s = new FnStream([ + 'read' => function ($len) { + $this->assertEquals(3, $len); + return 'foo'; + } + ]); + + $this->assertEquals('foo', $s->read(3)); + } + + public function testCanCloseOnDestruct() + { + $called = false; + $s = new FnStream([ + 'close' => function () use (&$called) { + $called = true; + } + ]); + unset($s); + $this->assertTrue($called); + } + + public function testDoesNotRequireClose() + { + $s = new FnStream([]); + unset($s); + } + + public function testDecoratesStream() + { + $a = Stream::factory('foo'); + $b = FnStream::decorate($a, []); + $this->assertEquals(3, $b->getSize()); + $this->assertEquals($b->isWritable(), true); + $this->assertEquals($b->isReadable(), true); + $this->assertEquals($b->isSeekable(), true); + $this->assertEquals($b->read(3), 'foo'); + $this->assertEquals($b->tell(), 3); + $this->assertEquals($a->tell(), 3); + $this->assertEquals($b->eof(), true); + $this->assertEquals($a->eof(), true); + $b->seek(0); + $this->assertEquals('foo', (string) $b); + $b->seek(0); + $this->assertEquals('foo', $b->getContents()); + $this->assertEquals($a->getMetadata(), $b->getMetadata()); + $b->seek(0, SEEK_END); + $b->write('bar'); + $this->assertEquals('foobar', (string) $b); + $this->assertInternalType('resource', $b->detach()); + $b->close(); + } + + public function testDecoratesWithCustomizations() + { + $called = false; + $a = Stream::factory('foo'); + $b = FnStream::decorate($a, [ + 'read' => function ($len) use (&$called, $a) { + $called = true; + return $a->read($len); + } + ]); + $this->assertEquals('foo', $b->read(3)); + $this->assertTrue($called); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php new file mode 100644 index 00000000000..33c3eccb4c0 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/GuzzleStreamWrapperTest.php @@ -0,0 +1,99 @@ +assertSame('foo', fread($handle, 3)); + $this->assertSame(3, ftell($handle)); + $this->assertSame(3, fwrite($handle, 'bar')); + $this->assertSame(0, fseek($handle, 0)); + $this->assertSame('foobar', fread($handle, 6)); + $this->assertTrue(feof($handle)); + + // This fails on HHVM for some reason + if (!defined('HHVM_VERSION')) { + $this->assertEquals([ + 'dev' => 0, + 'ino' => 0, + 'mode' => 33206, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 6, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0, + 0 => 0, + 1 => 0, + 2 => 33206, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 6, + 8 => 0, + 9 => 0, + 10 => 0, + 11 => 0, + 12 => 0, + ], fstat($handle)); + } + + $this->assertTrue(fclose($handle)); + $this->assertSame('foobar', (string) $stream); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testValidatesStream() + { + $stream = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['isReadable', 'isWritable']) + ->getMockForAbstractClass(); + $stream->expects($this->once()) + ->method('isReadable') + ->will($this->returnValue(false)); + $stream->expects($this->once()) + ->method('isWritable') + ->will($this->returnValue(false)); + GuzzleStreamWrapper::getResource($stream); + } + + /** + * @expectedException \PHPUnit_Framework_Error_Warning + */ + public function testReturnsFalseWhenStreamDoesNotExist() + { + fopen('guzzle://foo', 'r'); + } + + public function testCanOpenReadonlyStream() + { + $stream = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['isReadable', 'isWritable']) + ->getMockForAbstractClass(); + $stream->expects($this->once()) + ->method('isReadable') + ->will($this->returnValue(false)); + $stream->expects($this->once()) + ->method('isWritable') + ->will($this->returnValue(true)); + $r = GuzzleStreamWrapper::getResource($stream); + $this->assertInternalType('resource', $r); + fclose($r); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/InflateStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/InflateStreamTest.php new file mode 100644 index 00000000000..ead9356a53f --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/InflateStreamTest.php @@ -0,0 +1,16 @@ +assertEquals('test', (string) $b); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/LazyOpenStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/LazyOpenStreamTest.php new file mode 100644 index 00000000000..79e0078e888 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/LazyOpenStreamTest.php @@ -0,0 +1,64 @@ +fname = tempnam('/tmp', 'tfile'); + + if (file_exists($this->fname)) { + unlink($this->fname); + } + } + + public function tearDown() + { + if (file_exists($this->fname)) { + unlink($this->fname); + } + } + + public function testOpensLazily() + { + $l = new LazyOpenStream($this->fname, 'w+'); + $l->write('foo'); + $this->assertInternalType('array', $l->getMetadata()); + $this->assertFileExists($this->fname); + $this->assertEquals('foo', file_get_contents($this->fname)); + $this->assertEquals('foo', (string) $l); + } + + public function testProxiesToFile() + { + file_put_contents($this->fname, 'foo'); + $l = new LazyOpenStream($this->fname, 'r'); + $this->assertEquals('foo', $l->read(4)); + $this->assertTrue($l->eof()); + $this->assertEquals(3, $l->tell()); + $this->assertTrue($l->isReadable()); + $this->assertTrue($l->isSeekable()); + $this->assertFalse($l->isWritable()); + $l->seek(1); + $this->assertEquals('oo', $l->getContents()); + $this->assertEquals('foo', (string) $l); + $this->assertEquals(3, $l->getSize()); + $this->assertInternalType('array', $l->getMetadata()); + $l->close(); + } + + public function testDetachesUnderlyingStream() + { + file_put_contents($this->fname, 'foo'); + $l = new LazyOpenStream($this->fname, 'r'); + $r = $l->detach(); + $this->assertInternalType('resource', $r); + fseek($r, 0); + $this->assertEquals('foo', stream_get_contents($r)); + fclose($r); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/LimitStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/LimitStreamTest.php new file mode 100644 index 00000000000..efb1dc58ff3 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/LimitStreamTest.php @@ -0,0 +1,133 @@ +decorated = Stream::factory(fopen(__FILE__, 'r')); + $this->body = new LimitStream($this->decorated, 10, 3); + } + + public function testReturnsSubset() + { + $body = new LimitStream(Stream::factory('foo'), -1, 1); + $this->assertEquals('oo', (string) $body); + $this->assertTrue($body->eof()); + $body->seek(0); + $this->assertFalse($body->eof()); + $this->assertEquals('oo', $body->read(100)); + $this->assertTrue($body->eof()); + } + + public function testReturnsSubsetWhenCastToString() + { + $body = Stream::factory('foo_baz_bar'); + $limited = new LimitStream($body, 3, 4); + $this->assertEquals('baz', (string) $limited); + } + + public function testReturnsSubsetOfEmptyBodyWhenCastToString() + { + $body = Stream::factory(''); + $limited = new LimitStream($body, 0, 10); + $this->assertEquals('', (string) $limited); + } + + public function testSeeksWhenConstructed() + { + $this->assertEquals(0, $this->body->tell()); + $this->assertEquals(3, $this->decorated->tell()); + } + + public function testAllowsBoundedSeek() + { + $this->assertEquals(true, $this->body->seek(100)); + $this->assertEquals(10, $this->body->tell()); + $this->assertEquals(13, $this->decorated->tell()); + $this->assertEquals(true, $this->body->seek(0)); + $this->assertEquals(0, $this->body->tell()); + $this->assertEquals(3, $this->decorated->tell()); + $this->assertEquals(false, $this->body->seek(-10)); + $this->assertEquals(0, $this->body->tell()); + $this->assertEquals(3, $this->decorated->tell()); + $this->assertEquals(true, $this->body->seek(5)); + $this->assertEquals(5, $this->body->tell()); + $this->assertEquals(8, $this->decorated->tell()); + $this->assertEquals(false, $this->body->seek(1000, SEEK_END)); + } + + public function testReadsOnlySubsetOfData() + { + $data = $this->body->read(100); + $this->assertEquals(10, strlen($data)); + $this->assertFalse($this->body->read(1000)); + + $this->body->setOffset(10); + $newData = $this->body->read(100); + $this->assertEquals(10, strlen($newData)); + $this->assertNotSame($data, $newData); + } + + /** + * @expectedException \GuzzleHttp\Stream\Exception\SeekException + * @expectedExceptionMessage Could not seek the stream to position 2 + */ + public function testThrowsWhenCurrentGreaterThanOffsetSeek() + { + $a = Stream::factory('foo_bar'); + $b = new NoSeekStream($a); + $c = new LimitStream($b); + $a->getContents(); + $c->setOffset(2); + } + + public function testClaimsConsumedWhenReadLimitIsReached() + { + $this->assertFalse($this->body->eof()); + $this->body->read(1000); + $this->assertTrue($this->body->eof()); + } + + public function testContentLengthIsBounded() + { + $this->assertEquals(10, $this->body->getSize()); + } + + public function testGetContentsIsBasedOnSubset() + { + $body = new LimitStream(Stream::factory('foobazbar'), 3, 3); + $this->assertEquals('baz', $body->getContents()); + } + + public function testReturnsNullIfSizeCannotBeDetermined() + { + $a = new FnStream([ + 'getSize' => function () { return null; }, + 'tell' => function () { return 0; }, + ]); + $b = new LimitStream($a); + $this->assertNull($b->getSize()); + } + + public function testLengthLessOffsetWhenNoLimitSize() + { + $a = Stream::factory('foo_bar'); + $b = new LimitStream($a, -1, 4); + $this->assertEquals(3, $b->getSize()); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php new file mode 100644 index 00000000000..21b7c6d2270 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php @@ -0,0 +1,41 @@ +getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['isSeekable', 'seek']) + ->getMockForAbstractClass(); + $s->expects($this->never())->method('seek'); + $s->expects($this->never())->method('isSeekable'); + $wrapped = new NoSeekStream($s); + $this->assertFalse($wrapped->isSeekable()); + $this->assertFalse($wrapped->seek(2)); + } + + public function testHandlesClose() + { + $s = Stream::factory('foo'); + $wrapped = new NoSeekStream($s); + $wrapped->close(); + $this->assertFalse($wrapped->write('foo')); + } + + public function testCanAttach() + { + $s1 = Stream::factory('foo'); + $s2 = Stream::factory('bar'); + $wrapped = new NoSeekStream($s1); + $wrapped->attach($s2->detach()); + $this->assertEquals('bar', (string) $wrapped); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/NullStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/NullStreamTest.php new file mode 100644 index 00000000000..8e41431592e --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/NullStreamTest.php @@ -0,0 +1,39 @@ +assertEquals('', $b->read(10)); + $this->assertEquals(4, $b->write('test')); + $this->assertEquals('', (string) $b); + $this->assertNull($b->getMetadata('a')); + $this->assertEquals([], $b->getMetadata()); + $this->assertEquals(0, $b->getSize()); + $this->assertEquals('', $b->getContents()); + $this->assertEquals(0, $b->tell()); + + $this->assertTrue($b->isReadable()); + $this->assertTrue($b->isWritable()); + $this->assertTrue($b->isSeekable()); + $this->assertFalse($b->seek(10)); + + $this->assertTrue($b->eof()); + $b->detach(); + $this->assertTrue($b->eof()); + $b->close(); + } + + /** + * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException + */ + public function testCannotAttach() + { + $p = new NullStream(); + $p->attach('a'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/PumpStreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/PumpStreamTest.php new file mode 100644 index 00000000000..2d20ce90c0d --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/PumpStreamTest.php @@ -0,0 +1,77 @@ + ['foo' => 'bar'], + 'size' => 100 + ]); + + $this->assertEquals('bar', $p->getMetadata('foo')); + $this->assertEquals(['foo' => 'bar'], $p->getMetadata()); + $this->assertEquals(100, $p->getSize()); + } + + public function testCanReadFromCallable() + { + $p = Stream::factory(function ($size) { + return 'a'; + }); + $this->assertEquals('a', $p->read(1)); + $this->assertEquals(1, $p->tell()); + $this->assertEquals('aaaaa', $p->read(5)); + $this->assertEquals(6, $p->tell()); + } + + public function testStoresExcessDataInBuffer() + { + $called = []; + $p = Stream::factory(function ($size) use (&$called) { + $called[] = $size; + return 'abcdef'; + }); + $this->assertEquals('a', $p->read(1)); + $this->assertEquals('b', $p->read(1)); + $this->assertEquals('cdef', $p->read(4)); + $this->assertEquals('abcdefabc', $p->read(9)); + $this->assertEquals([1, 9, 3], $called); + } + + public function testInifiniteStreamWrappedInLimitStream() + { + $p = Stream::factory(function () { return 'a'; }); + $s = new LimitStream($p, 5); + $this->assertEquals('aaaaa', (string) $s); + } + + public function testDescribesCapabilities() + { + $p = Stream::factory(function () {}); + $this->assertTrue($p->isReadable()); + $this->assertFalse($p->isSeekable()); + $this->assertFalse($p->isWritable()); + $this->assertNull($p->getSize()); + $this->assertFalse($p->write('aa')); + $this->assertEquals('', $p->getContents()); + $this->assertEquals('', (string) $p); + $p->close(); + $this->assertEquals('', $p->read(10)); + $this->assertTrue($p->eof()); + } + + /** + * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException + */ + public function testCannotAttach() + { + $p = Stream::factory(function () {}); + $p->attach('a'); + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php new file mode 100644 index 00000000000..2ba79addfad --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php @@ -0,0 +1,147 @@ +c = fopen('php://temp', 'r+'); + fwrite($this->c, 'foo'); + fseek($this->c, 0); + $this->a = Stream::factory($this->c); + $this->b = new Str($this->a); + } + + public function testCatchesExceptionsWhenCastingToString() + { + $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') + ->setMethods(['read']) + ->getMockForAbstractClass(); + $s->expects($this->once()) + ->method('read') + ->will($this->throwException(new \Exception('foo'))); + $msg = ''; + set_error_handler(function ($errNo, $str) use (&$msg) { $msg = $str; }); + echo new Str($s); + restore_error_handler(); + $this->assertContains('foo', $msg); + } + + public function testToString() + { + $this->assertEquals('foo', (string) $this->b); + } + + public function testHasSize() + { + $this->assertEquals(3, $this->b->getSize()); + $this->assertSame($this->b, $this->b->setSize(2)); + $this->assertEquals(2, $this->b->getSize()); + } + + public function testReads() + { + $this->assertEquals('foo', $this->b->read(10)); + } + + public function testCheckMethods() + { + $this->assertEquals($this->a->isReadable(), $this->b->isReadable()); + $this->assertEquals($this->a->isWritable(), $this->b->isWritable()); + $this->assertEquals($this->a->isSeekable(), $this->b->isSeekable()); + } + + public function testSeeksAndTells() + { + $this->assertTrue($this->b->seek(1)); + $this->assertEquals(1, $this->a->tell()); + $this->assertEquals(1, $this->b->tell()); + $this->assertTrue($this->b->seek(0)); + $this->assertEquals(0, $this->a->tell()); + $this->assertEquals(0, $this->b->tell()); + $this->assertTrue($this->b->seek(0, SEEK_END)); + $this->assertEquals(3, $this->a->tell()); + $this->assertEquals(3, $this->b->tell()); + } + + public function testGetsContents() + { + $this->assertEquals('foo', $this->b->getContents()); + $this->assertEquals('', $this->b->getContents()); + $this->b->seek(1); + $this->assertEquals('oo', $this->b->getContents(1)); + } + + public function testCloses() + { + $this->b->close(); + $this->assertFalse(is_resource($this->c)); + } + + public function testDetaches() + { + $this->b->detach(); + $this->assertFalse($this->b->isReadable()); + } + + /** + * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException + */ + public function testCannotAttachByDefault() + { + $this->b->attach('a'); + } + + public function testWrapsMetadata() + { + $this->assertSame($this->b->getMetadata(), $this->a->getMetadata()); + $this->assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri')); + } + + public function testWrapsWrites() + { + $this->b->seek(0, SEEK_END); + $this->b->write('foo'); + $this->assertEquals('foofoo', (string) $this->a); + } + + /** + * @expectedException \UnexpectedValueException + */ + public function testThrowsWithInvalidGetter() + { + $this->b->foo; + } + + /** + * @expectedException \BadMethodCallException + */ + public function testThrowsWhenGetterNotImplemented() + { + $s = new BadStream(); + $s->stream; + } +} + +class BadStream +{ + use StreamDecoratorTrait; + + public function __construct() {} +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/StreamTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/StreamTest.php new file mode 100644 index 00000000000..2985bfbb17b --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/StreamTest.php @@ -0,0 +1,252 @@ +assertTrue($stream->isReadable()); + $this->assertTrue($stream->isWritable()); + $this->assertTrue($stream->isSeekable()); + $this->assertEquals('php://temp', $stream->getMetadata('uri')); + $this->assertInternalType('array', $stream->getMetadata()); + $this->assertEquals(4, $stream->getSize()); + $this->assertFalse($stream->eof()); + $stream->close(); + } + + public function testStreamClosesHandleOnDestruct() + { + $handle = fopen('php://temp', 'r'); + $stream = new Stream($handle); + unset($stream); + $this->assertFalse(is_resource($handle)); + } + + public function testConvertsToString() + { + $handle = fopen('php://temp', 'w+'); + fwrite($handle, 'data'); + $stream = new Stream($handle); + $this->assertEquals('data', (string) $stream); + $this->assertEquals('data', (string) $stream); + $stream->close(); + } + + public function testGetsContents() + { + $handle = fopen('php://temp', 'w+'); + fwrite($handle, 'data'); + $stream = new Stream($handle); + $this->assertEquals('', $stream->getContents()); + $stream->seek(0); + $this->assertEquals('data', $stream->getContents()); + $this->assertEquals('', $stream->getContents()); + } + + public function testChecksEof() + { + $handle = fopen('php://temp', 'w+'); + fwrite($handle, 'data'); + $stream = new Stream($handle); + $this->assertFalse($stream->eof()); + $stream->read(4); + $this->assertTrue($stream->eof()); + $stream->close(); + } + + public function testAllowsSettingManualSize() + { + $handle = fopen('php://temp', 'w+'); + fwrite($handle, 'data'); + $stream = new Stream($handle); + $stream->setSize(10); + $this->assertEquals(10, $stream->getSize()); + $stream->close(); + } + + public function testGetSize() + { + $size = filesize(__FILE__); + $handle = fopen(__FILE__, 'r'); + $stream = new Stream($handle); + $this->assertEquals($size, $stream->getSize()); + // Load from cache + $this->assertEquals($size, $stream->getSize()); + $stream->close(); + } + + public function testEnsuresSizeIsConsistent() + { + $h = fopen('php://temp', 'w+'); + $this->assertEquals(3, fwrite($h, 'foo')); + $stream = new Stream($h); + $this->assertEquals(3, $stream->getSize()); + $this->assertEquals(4, $stream->write('test')); + $this->assertEquals(7, $stream->getSize()); + $this->assertEquals(7, $stream->getSize()); + $stream->close(); + } + + public function testProvidesStreamPosition() + { + $handle = fopen('php://temp', 'w+'); + $stream = new Stream($handle); + $this->assertEquals(0, $stream->tell()); + $stream->write('foo'); + $this->assertEquals(3, $stream->tell()); + $stream->seek(1); + $this->assertEquals(1, $stream->tell()); + $this->assertSame(ftell($handle), $stream->tell()); + $stream->close(); + } + + public function testKeepsPositionOfResource() + { + $h = fopen(__FILE__, 'r'); + fseek($h, 10); + $stream = Stream::factory($h); + $this->assertEquals(10, $stream->tell()); + $stream->close(); + } + + public function testCanDetachAndAttachStream() + { + $r = fopen('php://temp', 'w+'); + $stream = new Stream($r); + $stream->write('foo'); + $this->assertTrue($stream->isReadable()); + $this->assertSame($r, $stream->detach()); + $this->assertNull($stream->detach()); + + $this->assertFalse($stream->isReadable()); + $this->assertFalse($stream->read(10)); + $this->assertFalse($stream->isWritable()); + $this->assertFalse($stream->write('bar')); + $this->assertFalse($stream->isSeekable()); + $this->assertFalse($stream->seek(10)); + $this->assertFalse($stream->tell()); + $this->assertTrue($stream->eof()); + $this->assertNull($stream->getSize()); + $this->assertSame('', (string) $stream); + $this->assertSame('', $stream->getContents()); + + $stream->attach($r); + $stream->seek(0); + $this->assertEquals('foo', $stream->getContents()); + $this->assertTrue($stream->isReadable()); + $this->assertTrue($stream->isWritable()); + $this->assertTrue($stream->isSeekable()); + + $stream->close(); + } + + public function testCloseClearProperties() + { + $handle = fopen('php://temp', 'r+'); + $stream = new Stream($handle); + $stream->close(); + + $this->assertEmpty($stream->getMetadata()); + $this->assertFalse($stream->isSeekable()); + $this->assertFalse($stream->isReadable()); + $this->assertFalse($stream->isWritable()); + $this->assertNull($stream->getSize()); + } + + public function testCreatesWithFactory() + { + $stream = Stream::factory('foo'); + $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $stream); + $this->assertEquals('foo', $stream->getContents()); + $stream->close(); + } + + public function testFactoryCreatesFromEmptyString() + { + $s = Stream::factory(); + $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s); + } + + public function testFactoryCreatesFromResource() + { + $r = fopen(__FILE__, 'r'); + $s = Stream::factory($r); + $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s); + $this->assertSame(file_get_contents(__FILE__), (string) $s); + } + + public function testFactoryCreatesFromObjectWithToString() + { + $r = new HasToString(); + $s = Stream::factory($r); + $this->assertInstanceOf('GuzzleHttp\Stream\Stream', $s); + $this->assertEquals('foo', (string) $s); + } + + public function testCreatePassesThrough() + { + $s = Stream::factory('foo'); + $this->assertSame($s, Stream::factory($s)); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testThrowsExceptionForUnknown() + { + Stream::factory(new \stdClass()); + } + + public function testReturnsCustomMetadata() + { + $s = Stream::factory('foo', ['metadata' => ['hwm' => 3]]); + $this->assertEquals(3, $s->getMetadata('hwm')); + $this->assertArrayHasKey('hwm', $s->getMetadata()); + } + + public function testCanSetSize() + { + $s = Stream::factory('', ['size' => 10]); + $this->assertEquals(10, $s->getSize()); + } + + public function testCanCreateIteratorBasedStream() + { + $a = new \ArrayIterator(['foo', 'bar', '123']); + $p = Stream::factory($a); + $this->assertInstanceOf('GuzzleHttp\Stream\PumpStream', $p); + $this->assertEquals('foo', $p->read(3)); + $this->assertFalse($p->eof()); + $this->assertEquals('b', $p->read(1)); + $this->assertEquals('a', $p->read(1)); + $this->assertEquals('r12', $p->read(3)); + $this->assertFalse($p->eof()); + $this->assertEquals('3', $p->getContents()); + $this->assertTrue($p->eof()); + $this->assertEquals(9, $p->tell()); + } +} + +class HasToString +{ + public function __toString() { + return 'foo'; + } +} diff --git a/upload/system/storage/vendor/guzzlehttp/streams/tests/UtilsTest.php b/upload/system/storage/vendor/guzzlehttp/streams/tests/UtilsTest.php new file mode 100644 index 00000000000..6e3e3b21608 --- /dev/null +++ b/upload/system/storage/vendor/guzzlehttp/streams/tests/UtilsTest.php @@ -0,0 +1,155 @@ +assertEquals('foobaz', Utils::copyToString($s)); + $s->seek(0); + $this->assertEquals('foo', Utils::copyToString($s, 3)); + $this->assertEquals('baz', Utils::copyToString($s, 3)); + $this->assertEquals('', Utils::copyToString($s)); + } + + public function testCopiesToStringStopsWhenReadFails() + { + $s1 = Stream::factory('foobaz'); + $s1 = FnStream::decorate($s1, [ + 'read' => function () { + return false; + } + ]); + $result = Utils::copyToString($s1); + $this->assertEquals('', $result); + } + + public function testCopiesToStream() + { + $s1 = Stream::factory('foobaz'); + $s2 = Stream::factory(''); + Utils::copyToStream($s1, $s2); + $this->assertEquals('foobaz', (string) $s2); + $s2 = Stream::factory(''); + $s1->seek(0); + Utils::copyToStream($s1, $s2, 3); + $this->assertEquals('foo', (string) $s2); + Utils::copyToStream($s1, $s2, 3); + $this->assertEquals('foobaz', (string) $s2); + } + + public function testStopsCopyToStreamWhenWriteFails() + { + $s1 = Stream::factory('foobaz'); + $s2 = Stream::factory(''); + $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); + Utils::copyToStream($s1, $s2); + $this->assertEquals('', (string) $s2); + } + + public function testStopsCopyToSteamWhenWriteFailsWithMaxLen() + { + $s1 = Stream::factory('foobaz'); + $s2 = Stream::factory(''); + $s2 = FnStream::decorate($s2, ['write' => function () { return 0; }]); + Utils::copyToStream($s1, $s2, 10); + $this->assertEquals('', (string) $s2); + } + + public function testStopsCopyToSteamWhenReadFailsWithMaxLen() + { + $s1 = Stream::factory('foobaz'); + $s1 = FnStream::decorate($s1, ['read' => function () { return ''; }]); + $s2 = Stream::factory(''); + Utils::copyToStream($s1, $s2, 10); + $this->assertEquals('', (string) $s2); + } + + public function testReadsLines() + { + $s = Stream::factory("foo\nbaz\nbar"); + $this->assertEquals("foo\n", Utils::readline($s)); + $this->assertEquals("baz\n", Utils::readline($s)); + $this->assertEquals("bar", Utils::readline($s)); + } + + public function testReadsLinesUpToMaxLength() + { + $s = Stream::factory("12345\n"); + $this->assertEquals("123", Utils::readline($s, 4)); + $this->assertEquals("45\n", Utils::readline($s)); + } + + public function testReadsLineUntilFalseReturnedFromRead() + { + $s = $this->getMockBuilder('GuzzleHttp\Stream\Stream') + ->setMethods(['read', 'eof']) + ->disableOriginalConstructor() + ->getMock(); + $s->expects($this->exactly(2)) + ->method('read') + ->will($this->returnCallback(function () { + static $c = false; + if ($c) { + return false; + } + $c = true; + return 'h'; + })); + $s->expects($this->exactly(2)) + ->method('eof') + ->will($this->returnValue(false)); + $this->assertEquals("h", Utils::readline($s)); + } + + public function testCalculatesHash() + { + $s = Stream::factory('foobazbar'); + $this->assertEquals(md5('foobazbar'), Utils::hash($s, 'md5')); + } + + /** + * @expectedException \GuzzleHttp\Stream\Exception\SeekException + */ + public function testCalculatesHashThrowsWhenSeekFails() + { + $s = new NoSeekStream(Stream::factory('foobazbar')); + $s->read(2); + Utils::hash($s, 'md5'); + } + + public function testCalculatesHashSeeksToOriginalPosition() + { + $s = Stream::factory('foobazbar'); + $s->seek(4); + $this->assertEquals(md5('foobazbar'), Utils::hash($s, 'md5')); + $this->assertEquals(4, $s->tell()); + } + + public function testOpensFilesSuccessfully() + { + $r = Utils::open(__FILE__, 'r'); + $this->assertInternalType('resource', $r); + fclose($r); + } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage Unable to open /path/to/does/not/exist using mode r + */ + public function testThrowsExceptionNotWarning() + { + Utils::open('/path/to/does/not/exist', 'r'); + } + + public function testProxiesToFactory() + { + $this->assertEquals('foo', (string) Utils::create('foo')); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml b/upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml new file mode 100644 index 00000000000..09bbb257dc7 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/.coveralls.yml @@ -0,0 +1,3 @@ +src_dir: src +coverage_clover: build/logs/clover.xml +json_path: build/logs/coveralls-upload.json diff --git a/upload/system/storage/vendor/klarna/kco_rest/.gitignore b/upload/system/storage/vendor/klarna/kco_rest/.gitignore new file mode 100644 index 00000000000..b5294333576 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/.gitignore @@ -0,0 +1,3 @@ +/vendor/ +/build/ +/docs/reference diff --git a/upload/system/storage/vendor/klarna/kco_rest/.travis.yml b/upload/system/storage/vendor/klarna/kco_rest/.travis.yml new file mode 100644 index 00000000000..5932d306bd6 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/.travis.yml @@ -0,0 +1,29 @@ +language: php +php: + - 7.0 + - 5.6 + - 5.5 + - 5.4 + - hhvm + +matrix: + allow_failures: + - php: 7.0 + +branches: + only: + - /^v\d\.\d/ +cache: + directories: + - vendor + +before_script: + - composer install --no-interaction + +script: + - composer run test + +after_script: + - php vendor/bin/coveralls -v + +sudo: false diff --git a/upload/system/storage/vendor/klarna/kco_rest/composer.lock b/upload/system/storage/vendor/klarna/kco_rest/composer.lock new file mode 100644 index 00000000000..f6bb9a8b5ae --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/composer.lock @@ -0,0 +1,3569 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "faa4d6f172d4f9991cf2583e57f9b43c", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f3c8c22471cb55475105c14769644a49c3262b93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93", + "reference": "f3c8c22471cb55475105c14769644a49c3262b93", + "shasum": "" + }, + "require": { + "guzzlehttp/ringphp": "^1.1", + "php": ">=5.4.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2015-05-20 03:47:55" + }, + { + "name": "guzzlehttp/ringphp", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/RingPHP.git", + "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", + "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", + "shasum": "" + }, + "require": { + "guzzlehttp/streams": "~3.0", + "php": ">=5.4.0", + "react/promise": "~2.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "ext-curl": "Guzzle will use specific adapters if cURL is present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Ring\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", + "time": "2015-05-20 03:37:09" + }, + { + "name": "guzzlehttp/streams", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/streams.git", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Provides a simple abstraction over streams of data", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "Guzzle", + "stream" + ], + "time": "2014-10-12 19:18:40" + }, + { + "name": "react/promise", + "version": "v2.2.1", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/3b6fca09c7d56321057fa8867c8dbe1abf648627", + "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "time": "2015-07-03 13:48:55" + } + ], + "packages-dev": [ + { + "name": "andrewsville/php-token-reflection", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Andrewsville/PHP-Token-Reflection.git", + "reference": "e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Andrewsville/PHP-Token-Reflection/zipball/e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee", + "reference": "e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "TokenReflection": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3" + ], + "authors": [ + { + "name": "Ondřej Nešpor", + "homepage": "https://github.com/andrewsville" + }, + { + "name": "Jaroslav Hanslík", + "homepage": "https://github.com/kukulich" + } + ], + "description": "Library emulating the PHP internal reflection using just the tokenized source code.", + "homepage": "http://andrewsville.github.com/PHP-Token-Reflection/", + "keywords": [ + "library", + "reflection", + "tokenizer" + ], + "time": "2014-08-06 16:37:08" + }, + { + "name": "apigen/apigen", + "version": "v4.0.1", + "source": { + "type": "git", + "url": "https://github.com/ApiGen/ApiGen.git", + "reference": "b719a6ad49107b5bc0bdf9fc8fae219a9a6dd5f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ApiGen/ApiGen/zipball/b719a6ad49107b5bc0bdf9fc8fae219a9a6dd5f1", + "reference": "b719a6ad49107b5bc0bdf9fc8fae219a9a6dd5f1", + "shasum": "" + }, + "require": { + "andrewsville/php-token-reflection": "~1.4", + "herrera-io/phar-update": "~2.0", + "kdyby/events": "~2.0", + "kukulich/fshl": "~2.1", + "latte/latte": "~2.2", + "michelf/php-markdown": "~1.4", + "nette/application": "~2.2", + "nette/bootstrap": "~2.2", + "nette/di": "~2.2", + "nette/mail": "~2.2", + "nette/neon": "~2.2", + "nette/robot-loader": "~2.2", + "nette/safe-stream": "~2.2", + "php": ">=5.4", + "symfony/console": "~2.6", + "symfony/options-resolver": "~2.6.1", + "tracy/tracy": "~2.2" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "~0.8", + "mockery/mockery": "~0.9", + "phpunit/phpunit": "~4.4", + "zenify/coding-standard": "~3.0" + }, + "bin": [ + "bin/apigen" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.0-dev" + } + }, + "autoload": { + "psr-4": { + "ApiGen\\": "src/ApiGen" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Ondřej Nešpor", + "homepage": "https://github.com/andrewsville" + }, + { + "name": "Jaroslav Hanslík", + "homepage": "https://github.com/kukulich" + }, + { + "name": "Tomáš Votruba", + "email": "tomas.vot@gmail.com" + }, + { + "name": "Olivier Laviale", + "homepage": "https://github.com/olvlvl" + } + ], + "description": "PHP source code API generator", + "homepage": "http://apigen.org/", + "keywords": [ + "api", + "documentation", + "generator", + "phpdoc" + ], + "time": "2015-03-09 11:03:45" + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, + { + "name": "guzzle/guzzle", + "version": "v3.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" + }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.9-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2015-03-18 18:23:50" + }, + { + "name": "herrera-io/json", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/kherge-abandoned/php-json.git", + "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kherge-abandoned/php-json/zipball/60c696c9370a1e5136816ca557c17f82a6fa83f1", + "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "justinrainbow/json-schema": ">=1.0,<2.0-dev", + "php": ">=5.3.3", + "seld/jsonlint": ">=1.0,<2.0-dev" + }, + "require-dev": { + "herrera-io/phpunit-test-case": "1.*", + "mikey179/vfsstream": "1.1.0", + "phpunit/phpunit": "3.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "files": [ + "src/lib/json_version.php" + ], + "psr-0": { + "Herrera\\Json": "src/lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Herrera", + "email": "kevin@herrera.io", + "homepage": "http://kevin.herrera.io" + } + ], + "description": "A library for simplifying JSON linting and validation.", + "homepage": "http://herrera-io.github.com/php-json", + "keywords": [ + "json", + "lint", + "schema", + "validate" + ], + "time": "2013-10-30 16:51:34" + }, + { + "name": "herrera-io/phar-update", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/kherge-abandoned/php-phar-update.git", + "reference": "15643c90d3d43620a4f45c910e6afb7a0ad4b488" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kherge-abandoned/php-phar-update/zipball/15643c90d3d43620a4f45c910e6afb7a0ad4b488", + "reference": "15643c90d3d43620a4f45c910e6afb7a0ad4b488", + "shasum": "" + }, + "require": { + "herrera-io/json": "1.*", + "herrera-io/version": "1.*", + "php": ">=5.3.3" + }, + "require-dev": { + "herrera-io/phpunit-test-case": "1.*", + "mikey179/vfsstream": "1.1.0", + "phpunit/phpunit": "3.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "files": [ + "src/lib/constants.php" + ], + "psr-0": { + "Herrera\\Phar\\Update": "src/lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Herrera", + "email": "kevin@herrera.io", + "homepage": "http://kevin.herrera.io" + } + ], + "description": "A library for self-updating Phars.", + "homepage": "http://herrera-io.github.com/php-phar-update", + "keywords": [ + "phar", + "update" + ], + "time": "2013-11-09 17:13:13" + }, + { + "name": "herrera-io/version", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/kherge-abandoned/php-version.git", + "reference": "d39d9642b92a04d8b8a28b871b797a35a2545e85" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kherge-abandoned/php-version/zipball/d39d9642b92a04d8b8a28b871b797a35a2545e85", + "reference": "d39d9642b92a04d8b8a28b871b797a35a2545e85", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "herrera-io/phpunit-test-case": "1.*", + "phpunit/phpunit": "3.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Herrera\\Version": "src/lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Herrera", + "email": "kevin@herrera.io", + "homepage": "http://kevin.herrera.io" + } + ], + "description": "A library for creating, editing, and comparing semantic versioning numbers.", + "homepage": "http://github.com/herrera-io/php-version", + "keywords": [ + "semantic", + "version" + ], + "time": "2014-05-27 05:29:25" + }, + { + "name": "justinrainbow/json-schema", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", + "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "json-schema/json-schema-test-suite": "1.1.0", + "phpdocumentor/phpdocumentor": "~2", + "phpunit/phpunit": "~3.7" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "JsonSchema": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2015-07-14 16:29:50" + }, + { + "name": "kdyby/events", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/Kdyby/Events.git", + "reference": "8049e0fc7abb48178b4a2a9af230eceebe1a83bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Kdyby/Events/zipball/8049e0fc7abb48178b4a2a9af230eceebe1a83bc", + "reference": "8049e0fc7abb48178b4a2a9af230eceebe1a83bc", + "shasum": "" + }, + "require": { + "nette/di": "~2.3@dev", + "nette/utils": "~2.3@dev" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "~0.7", + "latte/latte": "~2.3@dev", + "nette/application": "~2.3@dev", + "nette/bootstrap": "~2.3@dev", + "nette/caching": "~2.3@dev", + "nette/component-model": "~2.2@dev", + "nette/database": "~2.3@dev", + "nette/deprecated": "~2.3@dev", + "nette/di": "~2.3@dev", + "nette/finder": "~2.3@dev", + "nette/forms": "~2.3@dev", + "nette/http": "~2.3@dev", + "nette/mail": "~2.3@dev", + "nette/neon": "~2.3@dev", + "nette/nette": "~2.3@dev", + "nette/php-generator": "~2.3@dev", + "nette/reflection": "~2.3@dev", + "nette/robot-loader": "~2.3@dev", + "nette/safe-stream": "~2.3@dev", + "nette/security": "~2.3@dev", + "nette/tester": "~1.4@rc", + "nette/tokenizer": "~2.2@dev", + "nette/utils": "~2.3@dev", + "symfony/event-dispatcher": "~2.5", + "tracy/tracy": "~2.3@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Kdyby\\Events\\": "src/" + }, + "classmap": [ + "src/Kdyby/Events/exceptions.php" + ], + "files": [ + "src/Doctrine/compatibility.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "Filip Procházka", + "email": "filip@prochazka.su", + "homepage": "http://filip-prochazka.com" + } + ], + "description": "Events for Nette Framework", + "homepage": "http://kdyby.org", + "keywords": [ + "kdyby", + "nette" + ], + "time": "2015-04-04 16:29:31" + }, + { + "name": "klarna/apigen-theme", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/klarna/klarna-apigen-theme.git", + "reference": "1ffcd0e4ea5620d50dbfb74639e4aa4113924911" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/klarna/klarna-apigen-theme/zipball/1ffcd0e4ea5620d50dbfb74639e4aa4113924911", + "reference": "1ffcd0e4ea5620d50dbfb74639e4aa4113924911", + "shasum": "" + }, + "require": { + "latte/latte": "~2.2" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tomáš Votruba", + "email": "tomas.vot@gmail.com" + }, + { + "name": "Olivier Laviale", + "homepage": "https://github.com/olvlvl" + }, + { + "name": "David Keijser", + "email": "david.keijser@klarna.com" + }, + { + "name": "Petros Gkourasas", + "email": "petros.gkourasas@klarna.com" + } + ], + "description": "Klarna theme for ApiGen", + "homepage": "http://klarna.com/", + "time": "2015-03-30 15:27:12" + }, + { + "name": "kukulich/fshl", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/kukulich/fshl.git", + "reference": "974c294ade5d76c0c16b6fe3fd3a584ba999b24f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kukulich/fshl/zipball/974c294ade5d76c0c16b6fe3fd3a584ba999b24f", + "reference": "974c294ade5d76c0c16b6fe3fd3a584ba999b24f", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "autoload": { + "psr-0": { + "FSHL": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Jaroslav Hanslík", + "homepage": "https://github.com/kukulich" + } + ], + "description": "FSHL is a free, open source, universal, fast syntax highlighter written in PHP.", + "homepage": "http://fshl.kukulich.cz/", + "keywords": [ + "highlight", + "library", + "syntax" + ], + "time": "2012-09-08 19:00:07" + }, + { + "name": "latte/latte", + "version": "v2.3.3", + "source": { + "type": "git", + "url": "https://github.com/nette/latte.git", + "reference": "025883a04b3a5ca48995246e8d82e6ff323d941e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/latte/zipball/025883a04b3a5ca48995246e8d82e6ff323d941e", + "reference": "025883a04b3a5ca48995246e8d82e6ff323d941e", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.1" + }, + "require-dev": { + "nette/tester": "~1.3" + }, + "suggest": { + "ext-fileinfo": "to use filter |datastream", + "ext-mbstring": "to use filters like lower, upper, capitalize, ..." + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Latte: the amazing template engine for PHP", + "homepage": "http://latte.nette.org", + "keywords": [ + "templating", + "twig" + ], + "time": "2015-07-03 13:37:59" + }, + { + "name": "michelf/php-markdown", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9", + "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-lib": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Michelf": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "John Gruber", + "homepage": "http://daringfireball.net/" + }, + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "https://michelf.ca/", + "role": "Developer" + } + ], + "description": "PHP Markdown", + "homepage": "https://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ], + "time": "2015-03-01 12:03:08" + }, + { + "name": "nette/application", + "version": "v2.3.4", + "source": { + "type": "git", + "url": "https://github.com/nette/application.git", + "reference": "785801e441ef83fa4d75cc47c292afedee9b3e4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/application/zipball/785801e441ef83fa4d75cc47c292afedee9b3e4e", + "reference": "785801e441ef83fa4d75cc47c292afedee9b3e4e", + "shasum": "" + }, + "require": { + "nette/component-model": "~2.2", + "nette/http": "~2.2", + "nette/reflection": "~2.2", + "nette/security": "~2.2", + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "latte/latte": "~2.3.0", + "nette/di": "~2.3", + "nette/forms": "~2.2", + "nette/robot-loader": "~2.2", + "nette/tester": "~1.3" + }, + "suggest": { + "latte/latte": "Allows using Latte in templates", + "nette/forms": "Allows to use Nette\\Application\\UI\\Form" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Application MVC Component", + "homepage": "http://nette.org", + "time": "2015-07-01 15:54:47" + }, + { + "name": "nette/bootstrap", + "version": "v2.3.3", + "source": { + "type": "git", + "url": "https://github.com/nette/bootstrap.git", + "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/bootstrap/zipball/8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", + "reference": "8e2db45c39a1fa24f88e94c7b2a62ad09e9a306e", + "shasum": "" + }, + "require": { + "nette/di": "~2.3", + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "latte/latte": "~2.2", + "nette/application": "~2.3", + "nette/caching": "~2.3", + "nette/database": "~2.3", + "nette/forms": "~2.3", + "nette/http": "~2.3", + "nette/mail": "~2.3", + "nette/robot-loader": "~2.2", + "nette/safe-stream": "~2.2", + "nette/security": "~2.3", + "nette/tester": "~1.3", + "tracy/tracy": "~2.3" + }, + "suggest": { + "nette/robot-loader": "to use Configurator::createRobotLoader()", + "tracy/tracy": "to use Configurator::enableDebugger()" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Bootstrap", + "homepage": "http://nette.org", + "time": "2015-07-11 21:07:11" + }, + { + "name": "nette/caching", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/nette/caching.git", + "reference": "1523a0d2596193dd792045a07e89795eeef435db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/caching/zipball/1523a0d2596193dd792045a07e89795eeef435db", + "reference": "1523a0d2596193dd792045a07e89795eeef435db", + "shasum": "" + }, + "require": { + "nette/finder": "~2.2", + "nette/utils": "~2.2", + "php": ">=5.4.4" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "latte/latte": "~2.4", + "nette/di": "~2.3", + "nette/tester": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Caching Component", + "homepage": "http://nette.org", + "time": "2015-06-15 16:32:59" + }, + { + "name": "nette/component-model", + "version": "v2.2.3", + "source": { + "type": "git", + "url": "https://github.com/nette/component-model.git", + "reference": "fe13e630a307ef4585b3573eae0a161dc1c3d428" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/component-model/zipball/fe13e630a307ef4585b3573eae0a161dc1c3d428", + "reference": "fe13e630a307ef4585b3573eae0a161dc1c3d428", + "shasum": "" + }, + "require": { + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~1.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Component Model", + "homepage": "http://nette.org", + "time": "2015-07-11 21:11:20" + }, + { + "name": "nette/di", + "version": "v2.3.5", + "source": { + "type": "git", + "url": "https://github.com/nette/di.git", + "reference": "c3e726f8bef49033ba78efe19e999e5fac63f433" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/di/zipball/c3e726f8bef49033ba78efe19e999e5fac63f433", + "reference": "c3e726f8bef49033ba78efe19e999e5fac63f433", + "shasum": "" + }, + "require": { + "nette/neon": "~2.3", + "nette/php-generator": "~2.3", + "nette/utils": "~2.3", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~1.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Dependency Injection Component", + "homepage": "http://nette.org", + "time": "2015-07-13 22:28:49" + }, + { + "name": "nette/finder", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/nette/finder.git", + "reference": "38f803a03f4cddf352e28af70294c71f7026e516" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/finder/zipball/38f803a03f4cddf352e28af70294c71f7026e516", + "reference": "38f803a03f4cddf352e28af70294c71f7026e516", + "shasum": "" + }, + "require": { + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~1.4" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Finder: Files Searching", + "homepage": "http://nette.org", + "time": "2015-07-11 21:13:50" + }, + { + "name": "nette/http", + "version": "v2.3.3", + "source": { + "type": "git", + "url": "https://github.com/nette/http.git", + "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/http/zipball/ff2e4608391bca2444df9af6eaf8666ac853eb02", + "reference": "ff2e4608391bca2444df9af6eaf8666ac853eb02", + "shasum": "" + }, + "require": { + "nette/utils": "~2.2, >=2.2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/di": "~2.3", + "nette/tester": "~1.4" + }, + "suggest": { + "ext-fileinfo": "to detect type of uploaded files" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette HTTP Component", + "homepage": "http://nette.org", + "time": "2015-07-19 16:17:50" + }, + { + "name": "nette/mail", + "version": "v2.3.2", + "source": { + "type": "git", + "url": "https://github.com/nette/mail.git", + "reference": "2c6c64787edf8131ec5e1b514ecc4a80a6477f80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/mail/zipball/2c6c64787edf8131ec5e1b514ecc4a80a6477f80", + "reference": "2c6c64787edf8131ec5e1b514ecc4a80a6477f80", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/di": "~2.3", + "nette/tester": "~1.3" + }, + "suggest": { + "ext-fileinfo": "to detect type of attached files" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Mail: Sending E-mails", + "homepage": "http://nette.org", + "time": "2015-07-03 13:31:38" + }, + { + "name": "nette/neon", + "version": "v2.3.2", + "source": { + "type": "git", + "url": "https://github.com/nette/neon.git", + "reference": "48b25e0962d70e9125797e67a144f3e057243d9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/neon/zipball/48b25e0962d70e9125797e67a144f3e057243d9d", + "reference": "48b25e0962d70e9125797e67a144f3e057243d9d", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=5.3.1" + }, + "require-dev": { + "nette/tester": "~1.4" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette NEON: parser & generator for Nette Object Notation", + "homepage": "http://ne-on.org", + "time": "2015-07-13 22:29:08" + }, + { + "name": "nette/php-generator", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/nette/php-generator.git", + "reference": "c47ad59b972e8a5f4bb00299951bd8053a8fc074" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/php-generator/zipball/c47ad59b972e8a5f4bb00299951bd8053a8fc074", + "reference": "c47ad59b972e8a5f4bb00299951bd8053a8fc074", + "shasum": "" + }, + "require": { + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~1.4" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette PHP Generator", + "homepage": "http://nette.org", + "time": "2015-07-11 21:19:33" + }, + { + "name": "nette/reflection", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/nette/reflection.git", + "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/reflection/zipball/9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", + "reference": "9c2ed2a29f1f58125a0f19ffc987812d6b17d3e6", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nette/caching": "~2.2", + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/di": "~2.3", + "nette/tester": "~1.4" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette PHP Reflection Component", + "homepage": "http://nette.org", + "time": "2015-07-11 21:34:53" + }, + { + "name": "nette/robot-loader", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/nette/robot-loader.git", + "reference": "69331d359bbc9e5f911c12b82187cac914d983fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/69331d359bbc9e5f911c12b82187cac914d983fb", + "reference": "69331d359bbc9e5f911c12b82187cac914d983fb", + "shasum": "" + }, + "require": { + "nette/caching": "~2.2", + "nette/finder": "~2.3", + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~1.4" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette RobotLoader: comfortable autoloading", + "homepage": "http://nette.org", + "time": "2015-07-11 21:20:57" + }, + { + "name": "nette/safe-stream", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/nette/safe-stream.git", + "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/safe-stream/zipball/bf30db367b51a0932c44dcb9a378927644d48b2e", + "reference": "bf30db367b51a0932c44dcb9a378927644d48b2e", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "files": [ + "src/loader.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette SafeStream: Atomic Operations", + "homepage": "http://nette.org", + "time": "2015-07-11 20:59:15" + }, + { + "name": "nette/security", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/nette/security.git", + "reference": "744264a42b506d63009d7e3853ed72b04c99e964" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/security/zipball/744264a42b506d63009d7e3853ed72b04c99e964", + "reference": "744264a42b506d63009d7e3853ed72b04c99e964", + "shasum": "" + }, + "require": { + "nette/utils": "~2.2", + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/di": "~2.3", + "nette/http": "~2.3", + "nette/tester": "~1.4" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Security: Access Control Component", + "homepage": "http://nette.org", + "time": "2015-07-11 21:22:53" + }, + { + "name": "nette/utils", + "version": "v2.3.3", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "ff80fce39fdc381e7e0db6cc5ffc82162e59f6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/ff80fce39fdc381e7e0db6cc5ffc82162e59f6bb", + "reference": "ff80fce39fdc381e7e0db6cc5ffc82162e59f6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "~1.0" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize() and toAscii()", + "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", + "ext-mbstring": "to use Strings::lower() etc..." + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Nette Utility Classes", + "homepage": "http://nette.org", + "time": "2015-07-13 22:30:00" + }, + { + "name": "pdepend/pdepend", + "version": "2.0.6", + "source": { + "type": "git", + "url": "https://github.com/pdepend/pdepend.git", + "reference": "a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4", + "reference": "a15ffcbfbcc4570d4a733ca7b76e9cac0a56c3f4", + "shasum": "" + }, + "require": { + "symfony/config": ">=2.4", + "symfony/dependency-injection": ">=2.4", + "symfony/filesystem": ">=2.4" + }, + "require-dev": { + "phpunit/phpunit": "4.*@stable", + "squizlabs/php_codesniffer": "@stable" + }, + "bin": [ + "src/bin/pdepend" + ], + "type": "library", + "autoload": { + "psr-0": { + "PDepend\\": "src/main/php/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of pdepend to be handled with Composer", + "time": "2015-03-02 08:06:43" + }, + { + "name": "phploc/phploc", + "version": "2.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phploc.git", + "reference": "322ad07c112d5c6832abed4269d648cacff5959b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/322ad07c112d5c6832abed4269d648cacff5959b", + "reference": "322ad07c112d5c6832abed4269d648cacff5959b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/finder-facade": "~1.1", + "sebastian/git": "~1.0", + "sebastian/version": "~1.0", + "symfony/console": "~2.2" + }, + "bin": [ + "phploc" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "A tool for quickly measuring the size of a PHP project.", + "homepage": "https://github.com/sebastianbergmann/phploc", + "time": "2014-06-25 08:11:02" + }, + { + "name": "phpmd/phpmd", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "1a485d9db869137af5e9678bd844568c92998b25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/1a485d9db869137af5e9678bd844568c92998b25", + "reference": "1a485d9db869137af5e9678bd844568c92998b25", + "shasum": "" + }, + "require": { + "pdepend/pdepend": "2.0.*", + "php": ">=5.3.0", + "symfony/config": "2.5.*", + "symfony/dependency-injection": "2.5.*", + "symfony/filesystem": "2.5.*" + }, + "bin": [ + "src/bin/phpmd" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPMD\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of PHPMD handled with Composer.", + "time": "2014-09-25 15:56:22" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.1.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5bd48b86cd282da411bb80baac1398ce3fefac41", + "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-07-26 12:54:47" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "File/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2013-10-10 15:34:57" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2015-06-21 08:01:12" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-06-19 03:43:16" + }, + { + "name": "phpunit/phpunit", + "version": "4.2.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c28a790620fe30b049bb693be1ef9cd4e0fe906c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c28a790620fe30b049bb693be1ef9cd4e0fe906c", + "reference": "c28a790620fe30b049bb693be1ef9cd4e0fe906c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~2.0", + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": "~2.2", + "sebastian/comparator": "~1.0", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.0", + "sebastian/exporter": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "", + "../../symfony/yaml/" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-09-14 09:31:24" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", + "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "~1.0,>=1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-07-10 06:54:24" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "satooshi/php-coveralls", + "version": "v0.6.1", + "source": { + "type": "git", + "url": "https://github.com/satooshi/php-coveralls.git", + "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", + "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-simplexml": "*", + "guzzle/guzzle": ">=3.0", + "php": ">=5.3", + "psr/log": "1.0.0", + "symfony/config": ">=2.0", + "symfony/console": ">=2.0", + "symfony/stopwatch": ">=2.2", + "symfony/yaml": ">=2.0" + }, + "require-dev": { + "apigen/apigen": "2.8.*@stable", + "pdepend/pdepend": "dev-master", + "phpmd/phpmd": "dev-master", + "phpunit/php-invoker": ">=1.1.0,<1.2.0", + "phpunit/phpunit": "3.7.*@stable", + "sebastian/finder-facade": "dev-master", + "sebastian/phpcpd": "1.4.*@stable", + "squizlabs/php_codesniffer": "1.4.*@stable", + "theseer/fdomdocument": "dev-master" + }, + "bin": [ + "composer/bin/coveralls" + ], + "type": "library", + "autoload": { + "psr-0": { + "Contrib\\Component": "src/", + "Contrib\\Bundle": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kitamura Satoshi", + "email": "with.no.parachute@gmail.com", + "homepage": "https://www.facebook.com/satooshi.jp" + } + ], + "description": "PHP client library for Coveralls API", + "homepage": "https://github.com/satooshi/php-coveralls", + "keywords": [ + "ci", + "coverage", + "github", + "test" + ], + "time": "2013-05-04 08:07:33" + }, + { + "name": "sebastian/comparator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26 15:48:44" + }, + { + "name": "sebastian/diff", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-02-22 15:13:53" + }, + { + "name": "sebastian/environment", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", + "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2015-07-26 06:42:57" + }, + { + "name": "sebastian/exporter", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2015-06-21 07:55:53" + }, + { + "name": "sebastian/finder-facade", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/finder-facade.git", + "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/a520dcc3dd39160eea480daa3426f4fd419a327b", + "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b", + "shasum": "" + }, + "require": { + "symfony/finder": "~2.3", + "theseer/fdomdocument": "~1.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", + "homepage": "https://github.com/sebastianbergmann/finder-facade", + "time": "2015-06-04 08:11:58" + }, + { + "name": "sebastian/git", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/git.git", + "reference": "a99fbc102e982c1404041ef3e4d431562b29bcba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/a99fbc102e982c1404041ef3e4d431562b29bcba", + "reference": "a99fbc102e982c1404041ef3e4d431562b29bcba", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple wrapper for Git", + "homepage": "http://www.github.com/sebastianbergmann/git", + "keywords": [ + "git" + ], + "time": "2013-08-04 09:35:29" + }, + { + "name": "sebastian/phpcpd", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpcpd.git", + "reference": "d3ad100fdf15805495f6ff19f473f4314c99390c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/d3ad100fdf15805495f6ff19f473f4314c99390c", + "reference": "d3ad100fdf15805495f6ff19f473f4314c99390c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-timer": "~1.0", + "sebastian/finder-facade": "~1.1", + "sebastian/version": "~1.0", + "symfony/console": "~2.2", + "theseer/fdomdocument": "~1.4" + }, + "bin": [ + "phpcpd" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Copy/Paste Detector (CPD) for PHP code.", + "homepage": "https://github.com/sebastianbergmann/phpcpd", + "time": "2015-03-26 14:47:38" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-06-21 08:04:50" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21 13:59:46" + }, + { + "name": "seld/jsonlint", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "863ae85c6d3ef60ca49cb12bd051c4a0648c40c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/863ae85c6d3ef60ca49cb12bd051c4a0648c40c4", + "reference": "863ae85c6d3ef60ca49cb12bd051c4a0648c40c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "time": "2015-01-04 21:18:15" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.1.2" + }, + "suggest": { + "phpunit/php-timer": "dev-master" + }, + "bin": [ + "scripts/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-phpcs-fixer": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/CommentParser/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2014-12-04 22:32:15" + }, + { + "name": "symfony/config", + "version": "v2.5.12", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "c7309e33b719433d5cf3845d0b5b9608609d8c8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/c7309e33b719433d5cf3845d0b5b9608609d8c8e", + "reference": "c7309e33b719433d5cf3845d0b5b9608609d8c8e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com", + "time": "2015-01-03 08:01:13" + }, + { + "name": "symfony/console", + "version": "v2.7.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/8cf484449130cabfd98dcb4694ca9945802a21ed", + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/phpunit-bridge": "~2.7", + "symfony/process": "~2.1" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2015-07-09 16:07:40" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.5.12", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/c42aee05b466cc9c66b87ddf7d263402befb6962", + "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "~2.2", + "symfony/expression-language": "~2.4,>=2.4.10", + "symfony/yaml": "~2.1" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com", + "time": "2015-01-25 04:37:39" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.7.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.6", + "symfony/expression-language": "~2.6", + "symfony/phpunit-bridge": "~2.7", + "symfony/stopwatch": "~2.3" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2015-06-18 19:21:56" + }, + { + "name": "symfony/filesystem", + "version": "v2.5.12", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "d3c24d7d6e9c342008d8421b2fade460311647ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/d3c24d7d6e9c342008d8421b2fade460311647ea", + "reference": "d3c24d7d6e9c342008d8421b2fade460311647ea", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com", + "time": "2015-01-03 21:04:44" + }, + { + "name": "symfony/finder", + "version": "v2.7.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", + "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2015-07-09 16:07:40" + }, + { + "name": "symfony/options-resolver", + "version": "v2.6.11", + "target-dir": "Symfony/Component/OptionsResolver", + "source": { + "type": "git", + "url": "https://github.com/symfony/OptionsResolver.git", + "reference": "31e56594cee489e9a235b852228b0598b52101c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/OptionsResolver/zipball/31e56594cee489e9a235b852228b0598b52101c1", + "reference": "31e56594cee489e9a235b852228b0598b52101c1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\OptionsResolver\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2015-05-13 11:33:56" + }, + { + "name": "symfony/stopwatch", + "version": "v2.7.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/Stopwatch.git", + "reference": "b07a866719bbac5294c67773340f97b871733310" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b07a866719bbac5294c67773340f97b871733310", + "reference": "b07a866719bbac5294c67773340f97b871733310", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2015-07-01 18:23:16" + }, + { + "name": "symfony/yaml", + "version": "v2.7.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4bfbe0ed3909bfddd75b70c094391ec1f142f860", + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-07-01 11:25:50" + }, + { + "name": "theseer/fdomdocument", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/fDOMDocument.git", + "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", + "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "lib-libxml": "*", + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "lead" + } + ], + "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", + "homepage": "https://github.com/theseer/fDOMDocument", + "time": "2015-05-27 22:58:02" + }, + { + "name": "tracy/tracy", + "version": "v2.3.3", + "source": { + "type": "git", + "url": "https://github.com/nette/tracy.git", + "reference": "17d15b8dc83cab3bc5022a45d32c681a76cc19e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/tracy/zipball/17d15b8dc83cab3bc5022a45d32c681a76cc19e1", + "reference": "17d15b8dc83cab3bc5022a45d32c681a76cc19e1", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "nette/di": "~2.3", + "nette/tester": "~1.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ], + "files": [ + "src/shortcuts.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "http://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "http://nette.org/contributors" + } + ], + "description": "Tracy: useful PHP debugger", + "homepage": "http://tracy.nette.org", + "keywords": [ + "debug", + "debugger", + "nette" + ], + "time": "2015-07-03 12:52:35" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [] +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php new file mode 100644 index 00000000000..5bbdc2c6960 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/add_shipping_info.php @@ -0,0 +1,34 @@ +fetchCapture($captureId); +$capture->addShippingInfo([ + "shipping_info" => [ + [ + "shipping_company" => "DHL", + "shipping_method" => "Home", + "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", + "tracking_number" => "1234567890", + "return_tracking_number" => "E-55-KL", + "return_shipping_company" => "DHL", + "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" + ] + ] +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php new file mode 100644 index 00000000000..968d187bb88 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/trigger_send_out.php @@ -0,0 +1,22 @@ +fetchCapture($captureId); +$capture->triggerSendout(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php new file mode 100644 index 00000000000..6cfe3348baf --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/capture/update_customer_details.php @@ -0,0 +1,27 @@ +fetchCapture($captureId); +$capture->updateCustomerDetails([ + "billing_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ] +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php new file mode 100644 index 00000000000..f34b171ca83 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout.php @@ -0,0 +1,60 @@ +create([ + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "http://www.merchant.com/toc", + "checkout" => "http://www.merchant.com/checkout?klarna_order_id={checkout.order.id}", + "confirmation" => "http://www.merchant.com/thank-you?klarna_order_id={checkout.order.id}", + "push" => "http://www.merchant.com/create_order?klarna_order_id={checkout.order.id}" + ] +]); + +$checkout->fetch(); + +// Store checkout order id +$orderId = $checkout->getId(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php new file mode 100644 index 00000000000..02997424058 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/create_checkout_attachment.php @@ -0,0 +1,79 @@ + [ + [ + "unique_account_identifier" => "Test Testperson", + "payment_option" => "card", + "number_paid_purchases" => 1, + "total_amount_paid_purchases" => 10000, + "date_of_last_paid_purchase" => (new DateTime())->format(EMD_FORMAT), + "date_of_first_paid_purchase" => (new DateTime())->format(EMD_FORMAT) + ] + ] +]; + +$checkout = new Klarna\Rest\Checkout\Order($connector); +$checkout->create([ + "purchase_country" => "gb", + "purchase_currency" => "gbp", + "locale" => "en-gb", + "order_amount" => 10000, + "order_tax_amount" => 2000, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ] + ], + "merchant_urls" => [ + "terms" => "http://www.merchant.com/toc", + "checkout" => "http://www.merchant.com/checkout?klarna_order_id={checkout.order.id}", + "confirmation" => "http://www.merchant.com/thank-you?klarna_order_id={checkout.order.id}", + "push" => "http://www.merchant.com/create_order?klarna_order_id={checkout.order.id}" + ], + "attachment" => [ + "content_type" => "application/vnd.klarna.internal.emd-v2+json", + "body" => json_encode($emd) + ] +]); + +$checkout->fetch(); + +// Store checkout order id +$orderId = $checkout->getId(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php new file mode 100644 index 00000000000..8e1df96cced --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/fetch_checkout.php @@ -0,0 +1,19 @@ +fetch(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php new file mode 100644 index 00000000000..6d42d595d2e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/checkout/update_checkout.php @@ -0,0 +1,56 @@ +update([ + "order_amount" => 11000, + "order_tax_amount" => 2200, + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ], + [ + "type" => "physical", + "reference" => "543670", + "name" => "Bananas", + "quantity" => 1, + "quantity_unit" => "bag", + "unit_price" => 5000, + "tax_rate" => 2500, + "total_amount" => 4000, + "total_discount_amount" => 1000, + "total_tax_amount" => 800 + ], + [ + "type" => "shipping_fee", + "name" => "Express delivery", + "quantity" => 1, + "unit_price" => 1000, + "tax_rate" => 2500, + "total_amount" => 1000, + "total_tax_amount" => 200 + ] + ] +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php new file mode 100644 index 00000000000..359f628efce --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/acknowledge_order.php @@ -0,0 +1,22 @@ +acknowledge(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php new file mode 100644 index 00000000000..ebd49eb4c04 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/cancel_order.php @@ -0,0 +1,21 @@ +cancel(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php new file mode 100644 index 00000000000..88f06f79abb --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/create_capture.php @@ -0,0 +1,49 @@ +createCapture([ + "captured_amount" => 6000, + "description" => "Shipped part of the order", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ] + ], + "shipping_info" => [ + [ + "shipping_company" => "DHL", + "shipping_method" => "Home", + "tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=1234567890", + "tracking_number" => "1234567890", + "return_tracking_number" => "E-55-KL", + "return_shipping_company" => "DHL", + "return_tracking_uri" => "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=98389222" + ] + ] +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php new file mode 100644 index 00000000000..745d1beffb3 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/extend_authorization_time.php @@ -0,0 +1,19 @@ +extendAuthorizationTime(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php new file mode 100644 index 00000000000..e0d0053826f --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_capture.php @@ -0,0 +1,21 @@ +fetchCapture($captureId); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php new file mode 100644 index 00000000000..e333dacdcf1 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/fetch_order.php @@ -0,0 +1,19 @@ +fetch(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php new file mode 100644 index 00000000000..aafb52f711d --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/refund_order.php @@ -0,0 +1,37 @@ +refund([ + "refunded_amount" => 3000, + "description" => "Refunding half the tomatoes", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 5, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 3000, + "total_tax_amount" => 600 + ] + ] +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php new file mode 100644 index 00000000000..fc51926d715 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/release_remaining_authorization.php @@ -0,0 +1,21 @@ +releaseRemainingAuthorization(); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php new file mode 100644 index 00000000000..aa29e179501 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_customer_details.php @@ -0,0 +1,30 @@ +updateCustomerDetails([ + "billing_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ], + "shipping_address" => [ + "email" => "user@example.com", + "phone" => "57-3895734" + ] +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php new file mode 100644 index 00000000000..5cd3bc395ef --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_merchant_references.php @@ -0,0 +1,25 @@ +updateMerchantReferences([ + "merchant_reference1" => "15632423", + "merchant_reference2" => "special order" +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php new file mode 100644 index 00000000000..b90ef1154ff --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/docs/examples/order/update_order_lines.php @@ -0,0 +1,37 @@ +updateAuthorization([ + "order_amount" => 6000, + "description" => "Removed bad bananas", + "order_lines" => [ + [ + "type" => "physical", + "reference" => "123050", + "name" => "Tomatoes", + "quantity" => 10, + "quantity_unit" => "kg", + "unit_price" => 600, + "tax_rate" => 2500, + "total_amount" => 6000, + "total_tax_amount" => 1200 + ] + ] +]); diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md new file mode 100644 index 00000000000..cb38f17063c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/README.md @@ -0,0 +1,14 @@ +install +------- + + git remote add -f hooks ssh://git@stash.internal.machines:7999/mint/git-hooks.git + git merge -s ours --no-commit hooks/master + git read-tree --prefix=git_hooks -u hooks/master + git commit -m "imported git hooks" + + +updating +-------- + + git fetch hooks + git merge -s subtree hooks/master diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint new file mode 100644 index 00000000000..e3084704324 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/coffeelint @@ -0,0 +1,103 @@ +{ + "arrow_spacing": { + "level": "ignore" + }, + "camel_case_classes": { + "level": "error" + }, + "coffeescript_error": { + "level": "error" + }, + "colon_assignment_spacing": { + "level": "ignore", + "spacing": { + "left": 0, + "right": 0 + } + }, + "cyclomatic_complexity": { + "value": 10, + "level": "ignore" + }, + "duplicate_key": { + "level": "error" + }, + "empty_constructor_needs_parens": { + "level": "ignore" + }, + "indentation": { + "value": 4, + "level": "error" + }, + "line_endings": { + "level": "ignore", + "value": "unix" + }, + "max_line_length": { + "value": 80, + "level": "error", + "limitComments": true + }, + "missing_fat_arrows": { + "level": "ignore" + }, + "newlines_after_classes": { + "value": 3, + "level": "ignore" + }, + "no_backticks": { + "level": "error" + }, + "no_debugger": { + "level": "warn" + }, + "no_empty_functions": { + "level": "ignore" + }, + "no_empty_param_list": { + "level": "ignore" + }, + "no_implicit_braces": { + "level": "ignore", + "strict": true + }, + "no_implicit_parens": { + "strict": true, + "level": "ignore" + }, + "no_interpolation_in_single_quotes": { + "level": "ignore" + }, + "no_plusplus": { + "level": "ignore" + }, + "no_stand_alone_at": { + "level": "ignore" + }, + "no_tabs": { + "level": "error" + }, + "no_throwing_strings": { + "level": "error" + }, + "no_trailing_semicolons": { + "level": "error" + }, + "no_trailing_whitespace": { + "level": "error", + "allowed_in_comments": false, + "allowed_in_empty_lines": true + }, + "no_unnecessary_double_quotes": { + "level": "ignore" + }, + "no_unnecessary_fat_arrows": { + "level": "warn" + }, + "non_empty_constructor_needs_parens": { + "level": "ignore" + }, + "space_operators": { + "level": "ignore" + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format new file mode 100755 index 00000000000..c579f220292 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/message-format @@ -0,0 +1,34 @@ +#!/bin/bash +# http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html + +case "${1}" in + --about ) + echo "make sure commit message is within line width limits" + ;; + * ) + awk ' +/^#/ { + NR-- + next +} + +NR == 1 { + if (length > 50) { + print "title too long" + exit 1 + } +} + +NR == 2 { + if (length != 0) { + print "2nd line should be empty" + exit 2 + } +} + +{ + if (length > 72) { + print "line ", FNR, " is too long"; + } +}' "${1}" +esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number new file mode 100755 index 00000000000..a312756ef14 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/commit-msg/ticket-number @@ -0,0 +1,30 @@ +#!/bin/bash + +function run_test +{ + if ! grep -qvE '^#.*|^$' $1 ; then + exit 0 + fi + + ticket=$(git symbolic-ref HEAD | grep -oP "([A-Z]+)-([0-9]+)") + + if [ -z $ticket ]; then + exit 0 + fi + + if grep -q "^$ticket" $1; then + exit 0 + fi + + echo >> $1 + echo $ticket >> $1 +} + +case "${1}" in + --about ) + echo "Append ticket number to commit message" + ;; + * ) + run_test "$@" + ;; +esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint new file mode 100644 index 00000000000..da2bb59cf80 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/jshint @@ -0,0 +1,69 @@ +{ + // ENFORCE + "curly" : true, // Require {} around one-line blocks + "eqeqeq" : true, // Require === + "forin" : true, // Require hasOwnProperty inside forins + "immed" : false, // Require immediate invocations to be wrapped in parenthesis + // eg. (fun(){}()) + "latedef" : true, // Prohibit undefined variables (undef?!) + "newcap" : true, // Require capitalized constructors + "noarg" : true, // Prohibit arguments.callee and .caller + "noempty" : false, // Prohibit empty blocks "{}" + "nonew" : false, // Prohibit new + "plusplus" : false, // Prohibit ++ and -- + "regexp" : false, // Prohibit . in RegExp + "strict" : true, // Require 'use strict' + "trailing" : true, // Prohibit trailing spaces + "undef" : true, // Prohibit undeclared variables + "unused" : "vars",// Prohibit unused variables + + // RELAX + "asi" : false, // Allow missing semicolons due to automatic insertion + "bitwise" : false, // Allow bitwise operators + "boss" : false, // Allow advanced usage of assignments + "debug" : false, // Allow debugger statements + "eqnull" : false, // Allow "== null" + "esnext" : false, // Allow ES.next statements + "evil" : false, // Allow eval + "expr" : false, // Allow expressions instead of assignments/function calls + "funcscope" : false, // Allow vars declared in blocks (ie. if) + "globalstrict" : false, // Allow global 'use strict' + "iterator" : false, // Allow __iterator__ + "lastsemic" : false, // Allow one-line blocks with no semicolon + "laxbreak" : false, // Allow unsafe line breaks + "loopfunc" : false, // Allow function creation inside loops + "multistr" : false, // Allow multiline strings + "nonstandard" : false, // Allow (un)escape + "onecase" : false, // Allow one-case switch statements (=if) + "proto" : false, // Allow __proto__ + "regexdash" : false, // Allow RegExp to finish with a dash + "scripturl" : false, // Allow script-targeted URLs + "shadow" : false, // Allow variable shadowing (redeclaring in new scope) + "sub" : false, // Allow object['name'], not just object.name + "supernew" : false, // Allow "new function(){}" and "new Object" + "validthis" : false, // Allow this even inside a non-constructor + + // LEGACY + "nomen" : false, // Enforce no dangling underscores + "onevar" : true, // Enforce one var per function scope + "passfail" : false, // Stop on first error + "white" : false, // Strict Douglas' whitespace rules + + // MISC + "indent" : 4, // Check that indentation is X spaces + "maxlen" : 100, // Maximum characters/line + + // ENVIRONMENT (GLOBALS) + "browser" : true, // Browser (setTimeout, document,..) + "couch" : false, // CouchDB + "devel" : false, // Development (console, alert,..) + "dojo" : false, + "jquery" : false, + "mootools" : false, + "node" : false, + "mocha" : true, + "prototypejs" : false, + "rhino" : false, + "wsh" : false // Window Scripting Host +} + diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee new file mode 100755 index 00000000000..aa25de50cfd --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-coffee @@ -0,0 +1,59 @@ +#!/bin/bash + +coffeelint_alt="node_modules/.bin/coffeelint coffeelint" + +for c in 'coffeelint.json' "`dirname $0`/../coffeelint"; do + if [ -e "$c" ]; then + config="$c" + fi +done + +function run_coffeelint { + if [ -n "$config" ]; then + $coffeelint -f "${config}" ${@} + else + $coffeelint ${@} + fi +} + +function changed_files { + git diff --cached --name-only --diff-filter=ACM +} + +function write_staged { + while read file; do + name=`echo "$file" | sed 's:/:-:g'` + tmpfile=`mktemp /tmp/XXXXX-${name}` + git show ":$file" > $tmpfile + echo "$tmpfile" + done +} + +case "${1}" in + --about ) + if [ -z "$config" ]; then + config='default config' + fi + echo "Perform static analysis of coffee-script files (${config})" + ;; + * ) + coffeelint=`which $jshint_alt 2>/dev/null | head -n 1` + + # call out to tools + files=`changed_files | grep -e '\.coffee$' | write_staged` + + if [ -z "$files" ]; then + exit 0 + fi + + if test -z "$coffeelint"; then + echo "Please install coffeelint: npm install -g coffeelint" + exit 0 + fi + + run_coffeelint $files + status=$? + rm $files + exit $status + ;; +esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js new file mode 100755 index 00000000000..3b8ce7ef520 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-js @@ -0,0 +1,59 @@ +#!/bin/bash + +jshint_alt="node_modules/.bin/jshint jshint" + +for c in '.jshintrc' "`dirname $0`/../jshint"; do + if [ -e "$c" ]; then + config="$c" + fi +done + +function run_jshint { + if [ -n "$config" ]; then + $jshint --config "${config}" ${@} + else + $jshint ${@} + fi +} + +function changed_files { + git diff --cached --name-only --diff-filter=ACM +} + +function write_staged { + while read file; do + name=`basename $file` + tmpfile=`mktemp /tmp/XXXXX-${name}` + git show ":$file" > $tmpfile + echo "$tmpfile" + done +} + +case "${1}" in + --about ) + if [ -z "$config" ]; then + config='default config' + fi + echo "Perform static analysis of js source files (${config})" + ;; + * ) + jshint=`which $jshint_alt 2>/dev/null | head -n 1` + + # call out to tools + files=`changed_files | grep -e '\.js$' | write_staged` + + if [ -z "$files" ]; then + exit 0 + fi + + if test -z "$jshint"; then + echo "Please install jshint: npm install -g jshint" + exit 0 + fi + + run_jshint $files + status=$? + rm $files + exit $status + ;; +esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php new file mode 100755 index 00000000000..8f591edc158 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-php @@ -0,0 +1,65 @@ +#!/bin/bash + +phpcs_alt="vendor/bin/phpcs bin/phpcs ~/.composer/vendor/bin/phpcs phpcs" +phpmd_alt="vendor/bin/phpmd bin/phpmd ~/.composer/vendor/bin/phpmd phpmd" + +phpcs_standard='PSR2' +if [ -e "phpcs.xml" ]; then + phpcs_standard="./phpcs.xml" +fi + +phpmd_output=text +phpmd_rules='phpmd.xml' +if [ ! -e "$phpmd_rules" ]; then + phpmd_rules='codesize,design,naming,unusedcode' +fi + +function run_phpcs { + $phpcs --report-emacs --standard="$phpcs_standard" ${@} +} + +function run_phpmd { + $phpmd "`echo $1 | tr ' ' ','`" "$phpmd_output" "$phpmd_rules" +} + +function changed_files { + git diff --cached --name-only --diff-filter=ACM +} + +function write_staged { + while read file; do + name=`basename $file` + tmpfile=`mktemp /tmp/XXXXX-${name}` + git show ":$file" > $tmpfile + echo "$tmpfile" + done +} + +case "${1}" in + --about ) + echo "Perform static analysis of php source files" + ;; + * ) + phpcs=`which $phpcs_alt 2>/dev/null | head -n 1` + phpmd=`which $phpmd_alt 2>/dev/null | head -n 1` + + # call out to tools + files=`changed_files | grep -e '\.php$' | write_staged` + if [ -z "$files" ]; then + exit 0 + fi + + if test -z "$phpcs" -o -z "$phpmd"; then + echo "Please install phpcs and phpmd: composer global require squizlabs/php_codesniffer phpmd/phpmd" + exit 0 + fi + + run_phpcs $files + phpcs_status=$? + run_phpmd $files + phpmd_status=$? + rm $files + test "$phpcs_status" -eq 0 -a "$phpmd_status" -eq 0 + exit $? + ;; +esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python new file mode 100755 index 00000000000..aa935679d2c --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/git_hooks/pre-commit/check-python @@ -0,0 +1,48 @@ +#!/bin/bash + +function run_pep8 { + pep8 ${@} +} + +function run_pyflakes { + pyflakes ${@} +} + +function changed_files { + git diff --cached --name-only --diff-filter=ACM +} + +function write_staged { + while read file; do + name=`basename $file` + tmpfile=`mktemp /tmp/XXXXX-${name}` + git show ":$file" > $tmpfile + echo "$tmpfile" + done +} + +case "${1}" in + --about ) + echo "Perform static analysis of python source files" + ;; + * ) + # call out to tools + files=`changed_files | grep -e '\.py$' | write_staged` + if [ -z "$files" ]; then + exit 0 + fi + + if ! which pep8 pyflakes > /dev/null; then + echo "Please install pep8 and pyflakes: pip install pep8 pyflakes" + exit 0 + fi + + run_pep8 $files + pep8_status=$? + run_pyflakes $files + pyflakes_status=$? + rm $files + test "$pep8_status" -eq 0 -a "$pyflakes_status" -eq 0 + exit $? + ;; +esac diff --git a/upload/system/storage/vendor/klarna/kco_rest/phpmd.xml b/upload/system/storage/vendor/klarna/kco_rest/phpmd.xml new file mode 100644 index 00000000000..2348e784325 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/phpmd.xml @@ -0,0 +1,32 @@ + + + Klarna PHPMD ruleset + + + + + + + + + 1 + + + + + + + + + + + + + + + diff --git a/upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist b/upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist new file mode 100644 index 00000000000..133de98b9af --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/phpunit.xml.dist @@ -0,0 +1,40 @@ + + + + + + + tests/Unit + + + + tests/Component + + + + + + src/ + + + + + + + + + diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Checkout/OrderTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Checkout/OrderTest.php new file mode 100644 index 00000000000..3e85a160876 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Checkout/OrderTest.php @@ -0,0 +1,135 @@ +mock->addResponse( + new Response(201, ['Location' => 'http://somewhere/a-path']) + ); + + $order = new Order($this->connector); + $location = $order->create(['data' => 'goes here']) + ->getLocation(); + + $this->assertEquals('http://somewhere/a-path', $location); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals('/checkout/v3/orders', $request->getPath()); + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"goes here"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct and that the updated data + * is accessible. + * + * @return void + */ + public function testUpdate() + { + $json = <<mock->addResponse( + new Response( + 200, + ['Content-Type' => 'application/json'], + Stream::factory($json) + ) + ); + + $order = new Order($this->connector, '0001'); + $order['updated'] = 'not from json'; + + $order->update(['data' => 'sent in']); + + $this->assertEquals('from json', $order['updated']); + $this->assertEquals('0001', $order->getId()); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals('/checkout/v3/orders/0001', $request->getPath()); + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent and retrieved data is correct. + * + * @return void + */ + public function testFetch() + { + $json = <<mock->addResponse( + new Response( + 200, + ['Content-Type' => 'application/json'], + Stream::factory($json) + ) + ); + + $order = new Order($this->connector, '0002'); + $order['updated'] = 'not from json'; + + $order->fetch(); + + $this->assertEquals('from json', $order['updated']); + $this->assertEquals('0002', $order->getId()); + + $request = $this->history->getLastRequest(); + $this->assertEquals('GET', $request->getMethod()); + $this->assertEquals('/checkout/v3/orders/0002', $request->getPath()); + + $this->assertAuthorization($request); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php new file mode 100644 index 00000000000..7b38d836e08 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/CaptureTest.php @@ -0,0 +1,168 @@ +mock->addResponse( + new Response( + 200, + ['Content-Type' => 'application/json'], + Stream::factory($json) + ) + ); + + $capture = new Capture($this->connector, '/path', '1002'); + $capture['updated'] = 'not from json'; + + $capture->fetch(); + + $this->assertEquals('from json', $capture['updated']); + $this->assertEquals('1002', $capture->getId()); + + $request = $this->history->getLastRequest(); + $this->assertEquals('GET', $request->getMethod()); + $this->assertEquals('/path/captures/1002', $request->getPath()); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct and that the location is updated + * when creating the capture. + * + * @return void + */ + public function testCreate() + { + $this->mock->addResponse( + new Response(201, ['Location' => 'http://somewhere/a-path']) + ); + + $capture = new Capture($this->connector, '/path/to/order'); + $location = $capture->create(['data' => 'goes here']) + ->getLocation(); + + $this->assertEquals('http://somewhere/a-path', $location); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals('/path/to/order/captures', $request->getPath()); + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"goes here"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when appending shipping info. + * + * @return void + */ + public function testAddShippingInfo() + { + $this->mock->addResponse(new Response(204)); + + $capture = new Capture($this->connector, '/order/0002', '1002'); + $capture->addShippingInfo(['data' => 'sent in']); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/order/0002/captures/1002/shipping-info', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when updating customer details. + * + * @return void + */ + public function testUpdateCustomerDetails() + { + $this->mock->addResponse(new Response(204)); + + $capture = new Capture($this->connector, '/order/0002', '1002'); + $capture->updateCustomerDetails(['data' => 'sent in']); + + $request = $this->history->getLastRequest(); + $this->assertEquals('PATCH', $request->getMethod()); + $this->assertEquals( + '/order/0002/captures/1002/customer-details', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when triggering a send-out. + * + * @return void + */ + public function testTriggerSendout() + { + $this->mock->addResponse(new Response(204)); + + $capture = new Capture($this->connector, '/order/0002', '1002'); + $capture->triggerSendout(); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/order/0002/captures/1002/trigger-send-out', + $request->getPath() + ); + + $this->assertAuthorization($request); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php new file mode 100644 index 00000000000..711d8d897c3 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/OrderManagement/OrderTest.php @@ -0,0 +1,451 @@ +mock->addResponse( + new Response( + 200, + ['Content-Type' => 'application/json'], + Stream::factory($json) + ) + ); + + $order = new Order($this->connector, '0002'); + $order['updated'] = 'not from json'; + + $order->fetch(); + + $this->assertEquals('from json', $order['updated']); + $this->assertEquals('0002', $order->getId()); + + $request = $this->history->getLastRequest(); + $this->assertEquals('GET', $request->getMethod()); + $this->assertEquals('/ordermanagement/v1/orders/0002', $request->getPath()); + + $this->assertAuthorization($request); + + $capture = $order['captures'][0]; + $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); + $this->assertEquals($capture->getId(), $capture['capture_id']); + $this->assertEquals('1002', $capture->getId()); + $this->assertEquals('data', $capture['test']); + } + + /** + * Make sure that the request sent is correct when acknowledging an order. + * + * @return void + */ + public function testAcknowledge() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->acknowledge(); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/acknowledge', + $request->getPath() + ); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when cancelling an order. + * + * @return void + */ + public function testCancel() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->cancel(); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/cancel', + $request->getPath() + ); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when extending authorization time. + * + * @return void + */ + public function testExtendAuthorizationTime() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->extendAuthorizationTime(); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/extend-authorization-time', + $request->getPath() + ); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when releasing remaining + * authorization. + * + * @return void + */ + public function testReleaseRemainingAuthorization() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->releaseRemainingAuthorization(); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/release-remaining-authorization', + $request->getPath() + ); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when updating authorization. + * + * @return void + */ + public function testUpdateAuthorization() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->updateAuthorization(['data' => 'sent in']); + + $request = $this->history->getLastRequest(); + $this->assertEquals('PATCH', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/authorization', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when updating merchant references. + * + * @return void + */ + public function testUpdateMerchantReferences() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->updateMerchantReferences(['data' => 'sent in']); + + $request = $this->history->getLastRequest(); + $this->assertEquals('PATCH', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/merchant-references', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when updating customer details. + * + * @return void + */ + public function testUpdateCustomerDetails() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->updateCustomerDetails(['data' => 'sent in']); + + $request = $this->history->getLastRequest(); + $this->assertEquals('PATCH', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/customer-details', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when performing a refund. + * + * @return void + */ + public function testRefund() + { + $this->mock->addResponse(new Response(204)); + + $order = new Order($this->connector, '0002'); + $order->refund(['data' => 'sent in']); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/refunds', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct when performing a refund. + * + * @return void + */ + public function testRefund201() + { + $this->mock->addResponse(new Response(201)); + + $order = new Order($this->connector, '0002'); + $order->refund(['data' => 'sent in']); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/refunds', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"sent in"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent is correct and that the location is updated + * when creating an order. + * + * @return void + */ + public function testCreateCapture() + { + $this->mock->addResponse( + new Response(201, ['Location' => 'http://somewhere/a-path']) + ); + + $order = new Order($this->connector, '0002'); + $capture = $order->createCapture(['data' => 'goes here']); + + $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); + $this->assertEquals('http://somewhere/a-path', $capture->getLocation()); + + $request = $this->history->getLastRequest(); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/captures', + $request->getPath() + ); + + $this->assertEquals('application/json', $request->getHeader('Content-Type')); + $this->assertEquals('{"data":"goes here"}', strval($request->getBody())); + + $this->assertAuthorization($request); + } + + /** + * Make sure that the request sent and retrieved data is correct when fetching + * a capture. + * + * @return void + */ + public function testFetchCapture() + { + $json = <<mock->addResponse( + new Response( + 200, + ['Content-Type' => 'application/json'], + Stream::factory($json) + ) + ); + + $order = new Order($this->connector, '0002'); + + $capture = $order->fetchCapture('1002'); + $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/captures/1002', + $capture->getLocation() + ); + + $this->assertEquals('from json', $capture['updated']); + $this->assertEquals('1002', $capture->getId()); + $this->assertEquals($capture->getId(), $capture['capture_id']); + } + + /** + * Make sure that the request sent and retrieved data is correct when fetching + * a capture that exists in the captures list. + * + * @return void + */ + public function testFetchCaptureExisting() + { + $json = <<mock->addResponse( + new Response( + 200, + ['Content-Type' => 'application/json'], + Stream::factory($json) + ) + ); + + $order = new Order($this->connector, '0002'); + + $capture = new Capture($this->connector, $order->getLocation(), '1002'); + $capture['capture_id'] = '1002'; + $capture['updated'] = 'not from json'; + + $order['captures'][] = $capture; + + $capture = $order->fetchCapture('1002'); + $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/captures/1002', + $capture->getLocation() + ); + + $this->assertEquals('from json', $capture['updated']); + $this->assertEquals('1002', $capture->getId()); + $this->assertEquals($capture->getId(), $capture['capture_id']); + } + + /** + * Make sure that the request sent and retrieved data is correct when fetching + * a capture that is not already in the captures list. + * + * @return void + */ + public function testFetchCaptureNew() + { + $json = <<mock->addResponse( + new Response( + 200, + ['Content-Type' => 'application/json'], + Stream::factory($json) + ) + ); + + $order = new Order($this->connector, '0002'); + + $capture = new Capture($this->connector, $order->getLocation(), '1002'); + $capture['capture_id'] = '1002'; + $capture['updated'] = 'not from json'; + + $order['captures'][] = $capture; + + $capture = $order->fetchCapture('1003'); + $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); + $this->assertEquals( + '/ordermanagement/v1/orders/0002/captures/1003', + $capture->getLocation() + ); + + $this->assertEquals('from json', $capture['updated']); + $this->assertEquals('1003', $capture->getId()); + $this->assertEquals($capture->getId(), $capture['capture_id']); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php new file mode 100644 index 00000000000..eb0b1ae711e --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/ResourceTestCase.php @@ -0,0 +1,45 @@ +getHeader('Authorization')); + + $this->assertEquals('Basic', $alg); + + $expected = self::MERCHANT_ID . ':' . self::SHARED_SECRET; + $this->assertEquals($expected, base64_decode($digest)); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php new file mode 100644 index 00000000000..06c5151deb6 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/TestCase.php @@ -0,0 +1,80 @@ +client = new Client(); + $this->mock = new Mock(); + $this->history = new History(); + + // Add the mock subscriber to the client. + $this->client->getEmitter()->attach($this->mock); + $this->client->getEmitter()->attach($this->history); + + $this->connector = new Connector( + $this->client, + self::MERCHANT_ID, + self::SHARED_SECRET + ); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php new file mode 100644 index 00000000000..7dbe72e9167 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Component/Transport/ConnectorTest.php @@ -0,0 +1,144 @@ +connector->createRequest( + 'https://localhost:8888/path-here', + 'POST', + ['query' => ['q' => '1']] + ); + + $this->assertInstanceOf('GuzzleHttp\Message\RequestInterface', $request); + $this->assertEquals('POST', $request->getMethod()); + $this->assertEquals( + 'https://localhost:8888/path-here?q=1', + $request->getUrl() + ); + + $this->assertEquals(self::MERCHANT_ID, $request->getConfig()['auth'][0]); + $this->assertEquals(self::SHARED_SECRET, $request->getConfig()['auth'][1]); + + $this->assertEquals( + strval($this->connector->getUserAgent()), + $request->getHeader('User-Agent') + ); + } + + /** + * Make sure that the request sent returns an response. + * + * @return void + */ + public function testSend() + { + $response = new Response(200); + $this->mock->addResponse($response); + + $request = $this->connector->createRequest('http://somewhere/path', 'POST'); + $this->assertSame($response, $this->connector->send($request)); + } + + /** + * Make sure that an API error response throws a connector exception. + * + * @return void + */ + public function testSendError() + { + $json = << 'application/json'], + Stream::factory($json) + ); + $this->mock->addResponse($response); + + $this->setExpectedException( + 'Klarna\Rest\Transport\Exception\ConnectorException', + 'ERR_1: msg1, msg2 (#cid_1)' + ); + + $request = $this->connector->createRequest('http://somewhere/path', 'POST'); + $this->connector->send($request); + } + + /** + * Make sure that an error response throws an exception. + * + * @return void + */ + public function testSendGuzzleError() + { + $response = new Response(404); + $this->mock->addResponse($response); + + $this->setExpectedException('GuzzleHttp\Exception\ClientException'); + + $request = $this->connector->createRequest('http://somewhere/path', 'POST'); + $this->connector->send($request); + } + + /** + * Make sure that the factory method creates a connector as expected. + * + * @return void + */ + public function testCreate() + { + $userAgent = $this->getMockBuilder('Klarna\Rest\Transport\UserAgent') + ->getMock(); + + $connector = Connector::create( + self::MERCHANT_ID, + self::SHARED_SECRET, + self::BASE_URL, + $userAgent + ); + + $this->assertSame($userAgent, $connector->getUserAgent()); + $this->assertEquals(self::BASE_URL, $connector->getClient()->getBaseUrl()); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php new file mode 100644 index 00000000000..5e32cbb3957 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Checkout/OrderTest.php @@ -0,0 +1,418 @@ +connector); + $this->assertNull($order->getId()); + + $order = new Order($this->connector, '12345'); + $order['order_id'] = '12345'; + $this->assertEquals('12345', $order->getId()); + $this->assertEquals('/checkout/v3/orders/12345', $order->getLocation()); + } + + /** + * Make sure the correct data is sent and location is updated. + * + * @return void + */ + public function testCreate() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/checkout/v3/orders', + 'POST', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('201')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Location') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Location') + ->will($this->returnValue('http://somewhere/a-path')); + + $order = new Order($this->connector); + $location = $order->create($data) + ->getLocation(); + + $this->assertEquals('http://somewhere/a-path', $location); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testCreateInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 204' + ); + + $order->create(['data' => 'goes here']); + } + + /** + * Make sure a missing location header in the response results in an exception. + * + * @return void + */ + public function testCreateNoLocation() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('201')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Location') + ->will($this->returnValue(false)); + + $order = new Order($this->connector); + + $this->setExpectedException( + 'RuntimeException', + 'Response is missing a Location header' + ); + + $order->create(['data' => 'goes here']); + } + + /** + * Make sure the correct data is sent and that the replied data is accessible. + * + * @return void + */ + public function testUpdate() + { + $updateData = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/checkout/v3/orders/12345', + 'POST', + ['json' => $updateData] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = [ + 'data' => 'from response json', + 'order_id' => '12345' + ]; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $order = new Order($this->connector, '12345'); + $order['order_id'] = '12345'; + $order['data'] = 'is overwritten'; + + $order->update($updateData); + + $this->assertEquals('from response json', $order['data']); + $this->assertEquals('12345', $order->getId()); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testUpdateInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 204' + ); + + $order->update(['data' => 'goes here']); + } + + /** + * Make sure a non-JSON response results in an exception. + * + * @return void + */ + public function testUpdateNotJson() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('text/plain')); + + $order = new Order($this->connector); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected Content-Type header received: text/plain' + ); + + $order->update(['data' => 'goes here']); + } + + /** + * Make sure fetched data is accessible. + * + * @return void + */ + public function testFetch() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/checkout/v3/orders/12345', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = [ + 'data' => 'from response json', + 'order_id' => '12345' + ]; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $order = new Order($this->connector, '12345'); + $order['data'] = 'is overwritten'; + + $order->fetch(); + + $this->assertEquals('from response json', $order['data']); + $this->assertEquals('12345', $order->getId()); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testFetchInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/checkout/v3/orders/12345', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order['data'] = 'is overwritten'; + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 204' + ); + + $order->fetch(); + } + + /** + * Make sure a non-JSON response results in an exception. + * + * @return void + */ + public function testFetchNotJson() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/checkout/v3/orders/12345', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('text/plain')); + + $order = new Order($this->connector, '12345'); + $order['data'] = 'is overwritten'; + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected Content-Type header received: text/plain' + ); + + $order->fetch(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php new file mode 100644 index 00000000000..ff665d9eea5 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/CaptureTest.php @@ -0,0 +1,512 @@ +connector, '/orders/1'); + $this->assertEquals('/orders/1/captures', $capture->getLocation()); + } + + /** + * Make sure the location is correct for fetch method. + * + * @return void + */ + public function testConstructorExisting() + { + $capture = new Capture($this->connector, '/orders/1', '2'); + $this->assertEquals('/orders/1/captures/2', $capture->getLocation()); + } + + /** + * Make sure the identifier is retrievable. + * + * @return void + */ + public function testGetId() + { + $capture = new Capture($this->connector, '/orders/12345'); + $this->assertNull($capture->getId()); + + $capture = new Capture($this->connector, '/orders/12345', '2'); + $this->assertEquals('2', $capture->getId()); + } + + /** + * Make sure fetched data is accessible. + * + * @return void + */ + public function testFetch() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = [ + 'data' => 'from response json', + 'capture_id' => '2' + ]; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $capture = new Capture($this->connector, '/orders/1', '2'); + $capture['data'] = 'is overwritten'; + + $capture->fetch(); + + $this->assertEquals('from response json', $capture['data']); + $this->assertEquals('2', $capture->getId()); + } + + /** + * Make sure that an unknown status code response results in an exception. + * + * @return void + */ + public function testFetchInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + $capture['data'] = 'is overwritten'; + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 204' + ); + + $capture->fetch(); + } + + /** + * Make sure a non-JSON response results in an exception. + * + * @return void + */ + public function testFetchNotJson() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('text/plain')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + $capture['data'] = 'is overwritten'; + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected Content-Type header received: text/plain' + ); + + $capture->fetch(); + } + + /** + * Make sure the correct data is sent and location is updated. + * + * @return void + */ + public function testCreate() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures', + 'POST', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('201')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Location') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Location') + ->will($this->returnValue('http://somewhere/a-path')); + + $capture = new Capture($this->connector, '/orders/1'); + $location = $capture->create($data) + ->getLocation(); + + $this->assertEquals('http://somewhere/a-path', $location); + } + + /** + * Make sure that an unknown status code response results in an exception. + * + * @return void + */ + public function testCreateInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $capture = new Capture($this->connector, '/orders/1'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 204' + ); + + $capture->create(['data' => 'goes here']); + } + + /** + * Make sure a missing location header in the response results in an exception. + * + * @return void + */ + public function testCreateNoLocation() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('201')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Location') + ->will($this->returnValue(false)); + + $capture = new Capture($this->connector, '/orders/1'); + + $this->setExpectedException( + 'RuntimeException', + 'Response is missing a Location header' + ); + + $capture->create(['data' => 'goes here']); + } + + /** + * Make sure the correct data is sent. + * + * @return void + */ + public function testAddShippingInfo() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2/shipping-info', + 'POST', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + $capture->addShippingInfo($data); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testAddShippingInfoInvalidStatusCode() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2/shipping-info', + 'POST', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $capture->addShippingInfo($data); + } + + /** + * Make sure the correct data is sent. + * + * @return void + */ + public function testUpdateCustomerDetails() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2/customer-details', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + $capture->updateCustomerDetails($data); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testUpdateCustomerDetailsInvalidStatusCode() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2/customer-details', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $capture->updateCustomerDetails($data); + } + + /** + * Make sure that the correct request is sent. + * + * @return void + */ + public function testTriggerSendout() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2/trigger-send-out', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + $capture->triggerSendout(); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testTriggerSendoutInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/orders/1/captures/2/trigger-send-out', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $capture = new Capture($this->connector, '/orders/1', '2'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $capture->triggerSendout(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php new file mode 100644 index 00000000000..44de858cce7 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/OrderManagement/OrderTest.php @@ -0,0 +1,921 @@ +connector, '12345'); + $this->assertEquals('12345', $order->getId()); + $this->assertEquals('/ordermanagement/v1/orders/12345', $order->getLocation()); + } + + /** + * Make sure fetched data is accessible. + * + * @return void + */ + public function testFetch() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = [ + 'data' => 'from response json', + 'order_id' => '12345', + 'captures' => [ + [ + 'capture_id' => '1002', + 'data' => 'also from json' + ], + [ + 'capture_id' => '1003', + 'data' => 'something else' + ] + ] + ]; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $order = new Order($this->connector, '12345'); + $order['data'] = 'is overwritten'; + $order['captures'][] = new \ArrayObject(); + + $order->fetch(); + + $this->assertEquals('from response json', $order['data']); + $this->assertEquals('12345', $order->getId()); + + $this->assertCount(2, $order['captures']); + $this->assertContainsOnlyInstancesOf( + 'Klarna\Rest\OrderManagement\Capture', + $order['captures'] + ); + + $this->assertEquals('1002', $order['captures'][0]->getId()); + $this->assertEquals('also from json', $order['captures'][0]['data']); + $this->assertEquals('1003', $order['captures'][1]->getId()); + $this->assertEquals('something else', $order['captures'][1]['data']); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testFetchInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order['data'] = 'is overwritten'; + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 204' + ); + + $order->fetch(); + } + + /** + * Make sure a non-JSON response results in an exception. + * + * @return void + */ + public function testFetchNotJson() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('text/plain')); + + $order = new Order($this->connector, '12345'); + $order['data'] = 'is overwritten'; + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected Content-Type header received: text/plain' + ); + + $order->fetch(); + } + + /** + * Make sure that the correct request is sent. + * + * @return void + */ + public function testAcknowledge() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/acknowledge', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->acknowledge(); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testAcknowledgeInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/acknowledge', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->acknowledge(); + } + + /** + * Make sure that the correct request is sent. + * + * @return void + */ + public function testCancel() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/cancel', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->cancel(); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testCancelInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/cancel', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->cancel(); + } + + /** + * Make sure the correct data is sent. + * + * @return void + */ + public function testUpdateAuthorization() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/authorization', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->updateAuthorization($data); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testUpdateAuthorizationInvalidStatusCode() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/authorization', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->updateAuthorization($data); + } + + /** + * Make sure that the correct request is sent. + * + * @return void + */ + public function testExtendAuthorizationTime() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/extend-authorization-time', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->extendAuthorizationTime(); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testExtendAuthorizationTimeInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/extend-authorization-time', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->extendAuthorizationTime(); + } + + /** + * Make sure the correct data is sent. + * + * @return void + */ + public function testUpdateMerchantReferences() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/merchant-references', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->updateMerchantReferences($data); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testUpdateMerchantReferencesInvalidStatusCode() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/merchant-references', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->updateMerchantReferences($data); + } + + /** + * Make sure the correct data is sent. + * + * @return void + */ + public function testUpdateCustomerDetails() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/customer-details', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->updateCustomerDetails($data); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testUpdateCustomerDetailsInvalidStatusCode() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/customer-details', + 'PATCH', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->updateCustomerDetails($data); + } + + /** + * Make sure the correct data is sent. + * + * @return void + */ + public function testRefund() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/refunds', + 'POST', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->refund($data); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testRefundInvalidStatusCode() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/refunds', + 'POST', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->refund($data); + } + + /** + * Make sure that the correct request is sent. + * + * @return void + */ + public function testReleaseRemainingAuthorization() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/release-remaining-authorization', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $order = new Order($this->connector, '12345'); + $order->releaseRemainingAuthorization(); + } + + /** + * Make sure an unknown status code response results in an exception. + * + * @return void + */ + public function testReleaseRemainingAuthorizationInvalidStatusCode() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/release-remaining-authorization', + 'POST', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $order = new Order($this->connector, '12345'); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $order->releaseRemainingAuthorization(); + } + + /** + * Make sure that a capture is created properly. + * + * @return void + */ + public function testCreateCapture() + { + $data = ['data' => 'goes here']; + + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/captures', + 'POST', + ['json' => $data] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('201')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Location') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Location') + ->will($this->returnValue('http://somewhere/a-path')); + + $order = new Order($this->connector, '12345'); + $capture = $order->createCapture($data); + + $this->assertEquals('http://somewhere/a-path', $capture->getLocation()); + } + + /** + * Make sure that a capture is fetched. + * + * @return void + */ + public function testFetchCapture() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/captures/2', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = [ + 'data' => 'from response json', + 'capture_id' => '2' + ]; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $order = new Order($this->connector, '12345'); + $capture = $order->fetchCapture('2'); + + $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); + $this->assertEquals('from response json', $capture['data']); + } + + /** + * Make sure that an existing capture is refreshed before returned. + * + * @return void + */ + public function testFetchCaptureExisting() + { + $this->connector->expects($this->never()) + ->method('createRequest'); + + $order = new Order($this->connector, '12345'); + + $order['captures'][] = $this->getMockBuilder('Klarna\Rest\OrderManagement\Capture') + ->disableOriginalConstructor() + ->getMock(); + + $order['captures'][0]->expects($this->once()) + ->method('getId') + ->will($this->returnValue('1')); + + $order['captures'][0]->expects($this->never()) + ->method('fetch'); + + $order['captures'][] = $this->getMockBuilder('Klarna\Rest\OrderManagement\Capture') + ->disableOriginalConstructor() + ->getMock(); + + $order['captures'][1]->expects($this->once()) + ->method('getId') + ->will($this->returnValue('2')); + + $order['captures'][1]->expects($this->once()) + ->method('fetch') + ->will($this->returnValue($order['captures'][1])); + + $this->assertSame($order['captures'][1], $order->fetchCapture('2')); + } + + /** + * Make sure that a new capture is fetched if it is not in the resource. + * + * @return void + */ + public function testFetchCaptureNoCache() + { + $this->connector->expects($this->once()) + ->method('createRequest') + ->with( + '/ordermanagement/v1/orders/12345/captures/2', + 'GET', + [] + ) + ->will($this->returnValue($this->request)); + + $this->connector->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = [ + 'data' => 'from response json', + 'capture_id' => '2' + ]; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $order = new Order($this->connector, '12345'); + $order['captures'][] = $this->getMockBuilder('Klarna\Rest\OrderManagement\Capture') + ->disableOriginalConstructor() + ->getMock(); + + $order['captures'][0]->expects($this->once()) + ->method('getId') + ->will($this->returnValue('1')); + + $capture = $order->fetchCapture('2'); + + $this->assertInstanceOf('Klarna\Rest\OrderManagement\Capture', $capture); + $this->assertEquals('from response json', $capture['data']); + $this->assertEquals('2', $capture->getId()); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php new file mode 100644 index 00000000000..72fdab1cba5 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/TestCase.php @@ -0,0 +1,57 @@ +request = $this->getMockBuilder('GuzzleHttp\Message\RequestInterface') + ->getMock(); + + $this->response = $this->getMockBuilder('GuzzleHttp\Message\ResponseInterface') + ->getMock(); + + $this->connector = $this->getMockBuilder('Klarna\Rest\Transport\Connector') + ->disableOriginalConstructor() + ->getMock(); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php new file mode 100644 index 00000000000..cdba5d162e1 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ConnectorTest.php @@ -0,0 +1,343 @@ +client = $this->getMockBuilder('GuzzleHttp\ClientInterface') + ->getMock(); + + $this->userAgent = $this->getMockBuilder('Klarna\Rest\Transport\UserAgent') + ->getMock(); + + $this->userAgent->expects($this->any()) + ->method('__toString') + ->will($this->returnValue('a-user-agent')); + + $this->object = new Connector( + $this->client, + self::MERCHANT_ID, + self::SHARED_SECRET, + $this->userAgent + ); + } + + /** + * Make sure that the request is created as intended. + * + * @return void + */ + public function testCreateRequest() + { + $options = [ + 'opt' => 'val', + 'auth' => [self::MERCHANT_ID, self::SHARED_SECRET], + 'headers' => ['User-Agent' => 'a-user-agent'] + ]; + + $this->client->expects($this->any()) + ->method('createRequest') + ->with('uri', 'method', $options) + ->will($this->returnValue($this->request)); + + $request = $this->object->createRequest('method', 'uri', ['opt' => 'val']); + $this->assertSame($this->request, $request); + } + + /** + * Make sure that the request is sent and a response is returned. + * + * @return void + */ + public function testSend() + { + $this->client->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->returnValue($this->response)); + + $response = $this->object->send($this->request); + + $this->assertSame($this->response, $response); + } + + /** + * Make sure that an exception without a response is re-thrown. + * + * @return void + */ + public function testSendRequestException() + { + $exception = new RequestException( + 'Something went terribly wrong', + $this->request + ); + + $this->client->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->throwException($exception)); + + $this->setExpectedException( + 'GuzzleHttp\Exception\RequestException', + 'Something went terribly wrong' + ); + + $this->object->send($this->request); + } + + /** + * Make sure that an exception without a JSON response is re-thrown. + * + * @return void + */ + public function testSendConnectorExceptionNoJson() + { + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('')); + + $exception = new RequestException( + 'Something went terribly wrong', + $this->request, + $this->response + ); + + $this->client->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->throwException($exception)); + + $this->setExpectedException( + 'GuzzleHttp\Exception\RequestException', + 'Something went terribly wrong' + ); + + $this->object->send($this->request); + } + + /** + * Make sure that an exception without data but with json content-type is + * re-thrown. + * + * @return void + */ + public function testSendConnectorExceptionEmptyJson() + { + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $exception = new RequestException( + 'Something went terribly wrong', + $this->request, + $this->response + ); + + $this->client->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->throwException($exception)); + + $this->setExpectedException( + 'GuzzleHttp\Exception\RequestException', + 'Something went terribly wrong' + ); + + $this->object->send($this->request); + } + + /** + * Make sure that an exception without a proper JSON response is re-thrown. + * + * @return void + */ + public function testSendConnectorExceptionMissingFields() + { + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = []; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $exception = new RequestException( + 'Something went terribly wrong', + $this->request, + $this->response + ); + + $this->client->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->throwException($exception)); + + $this->setExpectedException( + 'GuzzleHttp\Exception\RequestException', + 'Something went terribly wrong' + ); + + $this->object->send($this->request); + } + + /** + * Make sure that an exception with a error response is wrapped properly. + * + * @return void + */ + public function testSendConnectorException() + { + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('application/json')); + + $data = [ + 'error_code' => 'ERROR_CODE_1', + 'error_messages' => [ + 'Oh dear...', + 'Oh no...' + ], + 'correlation_id' => 'corr_id_1' + ]; + + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue($data)); + + $exception = new RequestException( + 'Something went terribly wrong', + $this->request, + $this->response + ); + + $this->client->expects($this->once()) + ->method('send') + ->with($this->request) + ->will($this->throwException($exception)); + + $this->setExpectedException( + 'Klarna\Rest\Transport\Exception\ConnectorException', + 'ERROR_CODE_1: Oh dear..., Oh no... (#corr_id_1)' + ); + + $this->object->send($this->request); + } + + /** + * Make sure that the factory method creates a connector properly. + * + * @return void + */ + public function testCreate() + { + $connector = Connector::create( + self::MERCHANT_ID, + self::SHARED_SECRET, + self::BASE_URL, + $this->userAgent + ); + + $client = $connector->getClient(); + $this->assertInstanceOf('GuzzleHttp\ClientInterface', $client); + + $this->assertEquals(self::BASE_URL, $client->getBaseUrl()); + + $userAgent = $connector->getUserAgent(); + + $this->assertSame($this->userAgent, $userAgent); + $this->assertEquals('a-user-agent', strval($userAgent)); + } + + /** + * Make sure that the factory method uses the default user agent. + * + * @return void + */ + public function testCreateDefaultUserAgent() + { + $connector = Connector::create( + self::MERCHANT_ID, + self::SHARED_SECRET, + self::BASE_URL + ); + + $userAgent = $connector->getUserAgent(); + $this->assertInstanceOf('Klarna\Rest\Transport\UserAgent', $userAgent); + $this->assertContains('Library/Klarna.kco_rest_php', strval($userAgent)); + } + + /** + * Make sure that the client is retrievable. + * + * @return void + */ + public function testGetClient() + { + $client = $this->object->getClient(); + + $this->assertInstanceOf('GuzzleHttp\ClientInterface', $client); + $this->assertSame($this->client, $client); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php new file mode 100644 index 00000000000..11163fc4f9a --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/Exception/ConnectorExceptionTest.php @@ -0,0 +1,80 @@ + 'ERROR_CODE_1', + 'error_messages' => [ + 'Oh dear...', + 'Oh no...' + ], + 'correlation_id' => 'corr_id_1' + ]; + + $request = $this->getMockBuilder('GuzzleHttp\Message\RequestInterface') + ->getMock(); + $response = $this->getMockBuilder('GuzzleHttp\Message\ResponseInterface') + ->getMock(); + + $response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('500')); + + $previous = new RequestException('Error', $request, $response); + + $exception = new ConnectorException($data, $previous); + + $this->assertEquals(500, $exception->getCode()); + $this->assertSame($response, $exception->getResponse()); + + $this->assertContains( + $data['error_messages'][0], + $exception->getMessages() + ); + $this->assertContains( + $data['error_messages'][1], + $exception->getMessages() + ); + + $this->assertEquals($data['error_code'], $exception->getErrorCode()); + $this->assertEquals($data['correlation_id'], $exception->getCorrelationId()); + + $this->assertSame($previous, $exception->getPrevious()); + $this->assertEquals( + 'ERROR_CODE_1: Oh dear..., Oh no... (#corr_id_1)', + $exception->getMessage() + ); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php new file mode 100644 index 00000000000..09c4e78ddd6 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/ResponseValidatorTest.php @@ -0,0 +1,249 @@ +response = $this->getMockBuilder($interface) + ->getMock(); + + $this->validator = new ResponseValidator($this->response); + } + + /** + * Make sure the response is retrievable. + * + * @return void + */ + public function testGetResponse() + { + $this->assertSame($this->response, $this->validator->getResponse()); + } + + /** + * Make sure that the JSON data is possible to retrieve. + * + * @return void + */ + public function testGetJson() + { + $this->response->expects($this->once()) + ->method('json') + ->will($this->returnValue('json response')); + + $this->assertEquals('json response', $this->validator->getJson()); + } + + /** + * Make sure that the location header can be retrieved. + * + * @return void + */ + public function testGetLocation() + { + $this->response->expects($this->once()) + ->method('hasHeader') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Location') + ->will($this->returnValue('a location')); + + $this->assertEquals('a location', $this->validator->getLocation()); + } + + /** + * Make sure that a missing Location header throws an exception. + * + * @return void + */ + public function testGetLocationException() + { + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Location') + ->will($this->returnValue(false)); + + $this->setExpectedException( + 'RuntimeException', + 'Response is missing a Location header' + ); + + $this->validator->getLocation(); + } + + /** + * Make sure that the content type is asserted properly. + * + * @return void + */ + public function testContentType() + { + $this->response->expects($this->once()) + ->method('hasHeader') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('text/plain')); + + $this->assertSame( + $this->validator, + $this->validator->contentType('text/plain') + ); + } + + /** + * Make sure that a missing Content-Type header throws an exception. + * + * @return void + */ + public function testContentTypeMissingException() + { + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(false)); + + $this->setExpectedException( + 'RuntimeException', + 'Response is missing a Content-Type header' + ); + + $this->validator->contentType('text/plain'); + } + + /** + * Make sure that a different Content-Type header throws an exception. + * + * @return void + */ + public function testContentTypeWrongException() + { + $this->response->expects($this->once()) + ->method('hasHeader') + ->with('Content-Type') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue('text/plain')); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected Content-Type header received: text/plain' + ); + + $this->validator->contentType('application/json'); + } + + /** + * Make sure that the status code is asserted properly. + * + * @return void + */ + public function testStatus() + { + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->assertSame($this->validator, $this->validator->status('200')); + } + + /** + * Make sure that multiple status codes are asserted properly. + * + * @return void + */ + public function testStatuses() + { + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('204')); + + $this->assertSame( + $this->validator, + $this->validator->status(['201', '204']) + ); + } + + /** + * Make sure that a different status code throws an exception. + * + * @return void + */ + public function testStatusException() + { + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('201')); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 201' + ); + + $this->validator->status('200'); + } + + /** + * Make sure that a different status code throws an exception. + * + * @return void + */ + public function testStatusesException() + { + $this->response->expects($this->once()) + ->method('getStatusCode') + ->will($this->returnValue('200')); + + $this->setExpectedException( + 'RuntimeException', + 'Unexpected response status code: 200' + ); + + $this->validator->status(['201', '204']); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php new file mode 100644 index 00000000000..b2e3903c2f1 --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/Unit/Transport/UserAgentTest.php @@ -0,0 +1,125 @@ +agent = new UserAgent(); + } + + /** + * Make sure the default user agent components are present. + * + * @return void + */ + public function testCreateDefault() + { + $agent = UserAgent::createDefault(); + $text = $agent->__toString(); + + $this->assertContains( + 'Language/PHP_' . phpversion(), + $text, + 'No PHP language component present' + ); + + $this->assertContains( + 'OS/' . php_uname('s') . '_' . php_uname('r'), + $text, + 'No OS component present' + ); + + $this->assertContains( + 'Library/' . UserAgent::NAME . '_' . UserAgent::VERSION, + $text, + 'No Library component present', + false + ); + } + + /** + * Make sure the key and component are present in the user agent. + * + * @return void + */ + public function testSetField() + { + $this->agent->setField('key', 'component'); + + $this->assertEquals('key/component', strval($this->agent)); + } + + /** + * Make sure the key, component and version are present. + * + * @return void + */ + public function testSetFieldVersion() + { + $this->agent->setField('key', 'component', '1.0.0'); + + $this->assertEquals('key/component_1.0.0', strval($this->agent)); + } + + /** + * Make sure the key, component, version and options are present. + * + * @return void + */ + public function testSetFieldOptions() + { + $this->agent->setField('key', 'component', '1.0.0', ['attr']); + + $this->assertEquals( + 'key/component_1.0.0 (attr)', + strval($this->agent) + ); + } + + /** + * Make sure the key, component, version and multiple options are present. + * + * @return void + */ + public function testSetFieldTwoOptions() + { + $this->agent->setField('key', 'component', '1.0.0', ['attr1', 'attr2']); + + $this->assertEquals( + 'key/component_1.0.0 (attr1; attr2)', + strval($this->agent) + ); + } +} diff --git a/upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php b/upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php new file mode 100644 index 00000000000..9065528ce5b --- /dev/null +++ b/upload/system/storage/vendor/klarna/kco_rest/tests/bootstrap.php @@ -0,0 +1,23 @@ +addPsr4('Klarna\\Rest\\Tests\\', __DIR__.'/'); + +date_default_timezone_set('UTC'); diff --git a/upload/system/storage/vendor/psr/log/LICENSE b/upload/system/storage/vendor/psr/log/LICENSE new file mode 100644 index 00000000000..474c952b4b5 --- /dev/null +++ b/upload/system/storage/vendor/psr/log/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/psr/log/Psr/Log/AbstractLogger.php b/upload/system/storage/vendor/psr/log/Psr/Log/AbstractLogger.php new file mode 100644 index 00000000000..90e721af2d3 --- /dev/null +++ b/upload/system/storage/vendor/psr/log/Psr/Log/AbstractLogger.php @@ -0,0 +1,128 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } +} diff --git a/upload/system/storage/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/upload/system/storage/vendor/psr/log/Psr/Log/InvalidArgumentException.php new file mode 100644 index 00000000000..67f852d1dbc --- /dev/null +++ b/upload/system/storage/vendor/psr/log/Psr/Log/InvalidArgumentException.php @@ -0,0 +1,7 @@ +logger = $logger; + } +} diff --git a/upload/system/storage/vendor/psr/log/Psr/Log/LoggerInterface.php b/upload/system/storage/vendor/psr/log/Psr/Log/LoggerInterface.php new file mode 100644 index 00000000000..2206cfde41a --- /dev/null +++ b/upload/system/storage/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -0,0 +1,125 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function alert($message, array $context = array()) + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function critical($message, array $context = array()) + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function error($message, array $context = array()) + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function warning($message, array $context = array()) + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function notice($message, array $context = array()) + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function info($message, array $context = array()) + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function debug($message, array $context = array()) + { + $this->log(LogLevel::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + abstract public function log($level, $message, array $context = array()); +} diff --git a/upload/system/storage/vendor/psr/log/Psr/Log/NullLogger.php b/upload/system/storage/vendor/psr/log/Psr/Log/NullLogger.php new file mode 100644 index 00000000000..c8f7293b1c6 --- /dev/null +++ b/upload/system/storage/vendor/psr/log/Psr/Log/NullLogger.php @@ -0,0 +1,30 @@ +logger) { }` + * blocks. + */ +class NullLogger extends AbstractLogger +{ + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + public function log($level, $message, array $context = array()) + { + // noop + } +} diff --git a/upload/system/storage/vendor/psr/log/Psr/Log/Test/DummyTest.php b/upload/system/storage/vendor/psr/log/Psr/Log/Test/DummyTest.php new file mode 100644 index 00000000000..9638c110186 --- /dev/null +++ b/upload/system/storage/vendor/psr/log/Psr/Log/Test/DummyTest.php @@ -0,0 +1,18 @@ + ". + * + * Example ->error('Foo') would yield "error Foo". + * + * @return string[] + */ + abstract public function getLogs(); + + public function testImplements() + { + $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); + } + + /** + * @dataProvider provideLevelsAndMessages + */ + public function testLogsAtAllLevels($level, $message) + { + $logger = $this->getLogger(); + $logger->{$level}($message, array('user' => 'Bob')); + $logger->log($level, $message, array('user' => 'Bob')); + + $expected = array( + $level.' message of level '.$level.' with context: Bob', + $level.' message of level '.$level.' with context: Bob', + ); + $this->assertEquals($expected, $this->getLogs()); + } + + public function provideLevelsAndMessages() + { + return array( + LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), + LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), + LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), + LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), + LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), + LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), + LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), + LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), + ); + } + + /** + * @expectedException \Psr\Log\InvalidArgumentException + */ + public function testThrowsOnInvalidLevel() + { + $logger = $this->getLogger(); + $logger->log('invalid level', 'Foo'); + } + + public function testContextReplacement() + { + $logger = $this->getLogger(); + $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); + + $expected = array('info {Message {nothing} Bob Bar a}'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testObjectCastToString() + { + if (method_exists($this, 'createPartialMock')) { + $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); + } else { + $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); + } + $dummy->expects($this->once()) + ->method('__toString') + ->will($this->returnValue('DUMMY')); + + $this->getLogger()->warning($dummy); + + $expected = array('warning DUMMY'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testContextCanContainAnything() + { + $closed = fopen('php://memory', 'r'); + fclose($closed); + + $context = array( + 'bool' => true, + 'null' => null, + 'string' => 'Foo', + 'int' => 0, + 'float' => 0.5, + 'nested' => array('with object' => new DummyTest), + 'object' => new \DateTime, + 'resource' => fopen('php://memory', 'r'), + 'closed' => $closed, + ); + + $this->getLogger()->warning('Crazy context data', $context); + + $expected = array('warning Crazy context data'); + $this->assertEquals($expected, $this->getLogs()); + } + + public function testContextExceptionKeyCanBeExceptionOrOtherValues() + { + $logger = $this->getLogger(); + $logger->warning('Random message', array('exception' => 'oops')); + $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); + + $expected = array( + 'warning Random message', + 'critical Uncaught Exception!' + ); + $this->assertEquals($expected, $this->getLogs()); + } +} diff --git a/upload/system/storage/vendor/psr/log/Psr/Log/Test/TestLogger.php b/upload/system/storage/vendor/psr/log/Psr/Log/Test/TestLogger.php new file mode 100644 index 00000000000..1be3230496b --- /dev/null +++ b/upload/system/storage/vendor/psr/log/Psr/Log/Test/TestLogger.php @@ -0,0 +1,147 @@ + $level, + 'message' => $message, + 'context' => $context, + ]; + + $this->recordsByLevel[$record['level']][] = $record; + $this->records[] = $record; + } + + public function hasRecords($level) + { + return isset($this->recordsByLevel[$level]); + } + + public function hasRecord($record, $level) + { + if (is_string($record)) { + $record = ['message' => $record]; + } + return $this->hasRecordThatPasses(function ($rec) use ($record) { + if ($rec['message'] !== $record['message']) { + return false; + } + if (isset($record['context']) && $rec['context'] !== $record['context']) { + return false; + } + return true; + }, $level); + } + + public function hasRecordThatContains($message, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($message) { + return strpos($rec['message'], $message) !== false; + }, $level); + } + + public function hasRecordThatMatches($regex, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($regex) { + return preg_match($regex, $rec['message']) > 0; + }, $level); + } + + public function hasRecordThatPasses(callable $predicate, $level) + { + if (!isset($this->recordsByLevel[$level])) { + return false; + } + foreach ($this->recordsByLevel[$level] as $i => $rec) { + if (call_user_func($predicate, $rec, $i)) { + return true; + } + } + return false; + } + + public function __call($method, $args) + { + if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { + $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; + $level = strtolower($matches[2]); + if (method_exists($this, $genericMethod)) { + $args[] = $level; + return call_user_func_array([$this, $genericMethod], $args); + } + } + throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); + } + + public function reset() + { + $this->records = []; + $this->recordsByLevel = []; + } +} diff --git a/upload/system/storage/vendor/psr/log/README.md b/upload/system/storage/vendor/psr/log/README.md new file mode 100644 index 00000000000..a9f20c437b3 --- /dev/null +++ b/upload/system/storage/vendor/psr/log/README.md @@ -0,0 +1,58 @@ +PSR Log +======= + +This repository holds all interfaces/classes/traits related to +[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md). + +Note that this is not a logger of its own. It is merely an interface that +describes a logger. See the specification for more details. + +Installation +------------ + +```bash +composer require psr/log +``` + +Usage +----- + +If you need a logger, you can use the interface like this: + +```php +logger = $logger; + } + + public function doSomething() + { + if ($this->logger) { + $this->logger->info('Doing work'); + } + + try { + $this->doSomethingElse(); + } catch (Exception $exception) { + $this->logger->error('Oh no!', array('exception' => $exception)); + } + + // do something useful + } +} +``` + +You can then pick one of the implementations of the interface to get a logger. + +If you want to implement the interface, you can require this package and +implement `Psr\Log\LoggerInterface` in your code. Please read the +[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) +for details. diff --git a/upload/system/storage/vendor/psr/log/composer.json b/upload/system/storage/vendor/psr/log/composer.json new file mode 100644 index 00000000000..3f6d4eea4cb --- /dev/null +++ b/upload/system/storage/vendor/psr/log/composer.json @@ -0,0 +1,26 @@ +{ + "name": "psr/log", + "description": "Common interface for logging libraries", + "keywords": ["psr", "psr-3", "log"], + "homepage": "https://github.com/php-fig/log", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/.gitignore b/upload/system/storage/vendor/symfony/translation/.gitignore new file mode 100644 index 00000000000..c49a5d8df5c --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/upload/system/storage/vendor/symfony/translation/CHANGELOG.md b/upload/system/storage/vendor/symfony/translation/CHANGELOG.md new file mode 100644 index 00000000000..b011f9e6cc7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/CHANGELOG.md @@ -0,0 +1,69 @@ +CHANGELOG +========= + +3.0.0 +----- + + * removed `FileDumper::format()` method. + * Changed the visibility of the locale property in `Translator` from protected to private. + +2.8.0 +----- + + * deprecated FileDumper::format(), overwrite FileDumper::formatCatalogue() instead. + * deprecated Translator::getMessages(), rely on TranslatorBagInterface::getCatalogue() instead. + * added `FileDumper::formatCatalogue` which allows format the catalogue without dumping it into file. + * added option `json_encoding` to JsonFileDumper + * added options `as_tree`, `inline` to YamlFileDumper + * added support for XLIFF 2.0. + * added support for XLIFF target and tool attributes. + * added message parameters to DataCollectorTranslator. + * [DEPRECATION] The `DiffOperation` class has been deprecated and + will be removed in Symfony 3.0, since its operation has nothing to do with 'diff', + so the class name is misleading. The `TargetOperation` class should be used for + this use-case instead. + +2.7.0 +----- + + * added DataCollectorTranslator for collecting the translated messages. + +2.6.0 +----- + + * added possibility to cache catalogues + * added TranslatorBagInterface + * added LoggingTranslator + * added Translator::getMessages() for retrieving the message catalogue as an array + +2.5.0 +----- + + * added relative file path template to the file dumpers + * added optional backup to the file dumpers + * changed IcuResFileDumper to extend FileDumper + +2.3.0 +----- + + * added classes to make operations on catalogues (like making a diff or a merge on 2 catalogues) + * added Translator::getFallbackLocales() + * deprecated Translator::setFallbackLocale() in favor of the new Translator::setFallbackLocales() method + +2.2.0 +----- + + * QtTranslationsLoader class renamed to QtFileLoader. QtTranslationsLoader is deprecated and will be removed in 2.3. + * [BC BREAK] uniformized the exception thrown by the load() method when an error occurs. The load() method now + throws Symfony\Component\Translation\Exception\NotFoundResourceException when a resource cannot be found + and Symfony\Component\Translation\Exception\InvalidResourceException when a resource is invalid. + * changed the exception class thrown by some load() methods from \RuntimeException to \InvalidArgumentException + (IcuDatFileLoader, IcuResFileLoader and QtFileLoader) + +2.1.0 +----- + + * added support for more than one fallback locale + * added support for extracting translation messages from templates (Twig and PHP) + * added dumpers for translation catalogs + * added support for QT, gettext, and ResourceBundles diff --git a/upload/system/storage/vendor/symfony/translation/Catalogue/AbstractOperation.php b/upload/system/storage/vendor/symfony/translation/Catalogue/AbstractOperation.php new file mode 100644 index 00000000000..9598e1767a7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Catalogue/AbstractOperation.php @@ -0,0 +1,171 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Base catalogues binary operation class. + * + * A catalogue binary operation performs operation on + * source (the left argument) and target (the right argument) catalogues. + * + * @author Jean-François Simon + */ +abstract class AbstractOperation implements OperationInterface +{ + /** + * @var MessageCatalogueInterface The source catalogue + */ + protected $source; + + /** + * @var MessageCatalogueInterface The target catalogue + */ + protected $target; + + /** + * @var MessageCatalogue The result catalogue + */ + protected $result; + + /** + * @var null|array The domains affected by this operation + */ + private $domains; + + /** + * This array stores 'all', 'new' and 'obsolete' messages for all valid domains. + * + * The data structure of this array is as follows: + * ```php + * array( + * 'domain 1' => array( + * 'all' => array(...), + * 'new' => array(...), + * 'obsolete' => array(...) + * ), + * 'domain 2' => array( + * 'all' => array(...), + * 'new' => array(...), + * 'obsolete' => array(...) + * ), + * ... + * ) + * ``` + * + * @var array The array that stores 'all', 'new' and 'obsolete' messages + */ + protected $messages; + + /** + * @param MessageCatalogueInterface $source The source catalogue + * @param MessageCatalogueInterface $target The target catalogue + * + * @throws \LogicException + */ + public function __construct(MessageCatalogueInterface $source, MessageCatalogueInterface $target) + { + if ($source->getLocale() !== $target->getLocale()) { + throw new \LogicException('Operated catalogues must belong to the same locale.'); + } + + $this->source = $source; + $this->target = $target; + $this->result = new MessageCatalogue($source->getLocale()); + $this->domains = null; + $this->messages = array(); + } + + /** + * {@inheritdoc} + */ + public function getDomains() + { + if (null === $this->domains) { + $this->domains = array_values(array_unique(array_merge($this->source->getDomains(), $this->target->getDomains()))); + } + + return $this->domains; + } + + /** + * {@inheritdoc} + */ + public function getMessages($domain) + { + if (!in_array($domain, $this->getDomains())) { + throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); + } + + if (!isset($this->messages[$domain]['all'])) { + $this->processDomain($domain); + } + + return $this->messages[$domain]['all']; + } + + /** + * {@inheritdoc} + */ + public function getNewMessages($domain) + { + if (!in_array($domain, $this->getDomains())) { + throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); + } + + if (!isset($this->messages[$domain]['new'])) { + $this->processDomain($domain); + } + + return $this->messages[$domain]['new']; + } + + /** + * {@inheritdoc} + */ + public function getObsoleteMessages($domain) + { + if (!in_array($domain, $this->getDomains())) { + throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); + } + + if (!isset($this->messages[$domain]['obsolete'])) { + $this->processDomain($domain); + } + + return $this->messages[$domain]['obsolete']; + } + + /** + * {@inheritdoc} + */ + public function getResult() + { + foreach ($this->getDomains() as $domain) { + if (!isset($this->messages[$domain])) { + $this->processDomain($domain); + } + } + + return $this->result; + } + + /** + * Performs operation on source and target catalogues for the given domain and + * stores the results. + * + * @param string $domain The domain which the operation will be performed for + */ + abstract protected function processDomain($domain); +} diff --git a/upload/system/storage/vendor/symfony/translation/Catalogue/MergeOperation.php b/upload/system/storage/vendor/symfony/translation/Catalogue/MergeOperation.php new file mode 100644 index 00000000000..6db3f801f3b --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Catalogue/MergeOperation.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +/** + * Merge operation between two catalogues as follows: + * all = source ∪ target = {x: x ∈ source ∨ x ∈ target} + * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} + * obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ source ∧ x ∉ target} = ∅ + * Basically, the result contains messages from both catalogues. + * + * @author Jean-François Simon + */ +class MergeOperation extends AbstractOperation +{ + /** + * {@inheritdoc} + */ + protected function processDomain($domain) + { + $this->messages[$domain] = array( + 'all' => array(), + 'new' => array(), + 'obsolete' => array(), + ); + + foreach ($this->source->all($domain) as $id => $message) { + $this->messages[$domain]['all'][$id] = $message; + $this->result->add(array($id => $message), $domain); + if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) { + $this->result->setMetadata($id, $keyMetadata, $domain); + } + } + + foreach ($this->target->all($domain) as $id => $message) { + if (!$this->source->has($id, $domain)) { + $this->messages[$domain]['all'][$id] = $message; + $this->messages[$domain]['new'][$id] = $message; + $this->result->add(array($id => $message), $domain); + if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) { + $this->result->setMetadata($id, $keyMetadata, $domain); + } + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Catalogue/OperationInterface.php b/upload/system/storage/vendor/symfony/translation/Catalogue/OperationInterface.php new file mode 100644 index 00000000000..87d888efb76 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Catalogue/OperationInterface.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Represents an operation on catalogue(s). + * + * An instance of this interface performs an operation on one or more catalogues and + * stores intermediate and final results of the operation. + * + * The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and + * the following results are stored: + * + * Messages: also called 'all', are valid messages for the given domain after the operation is performed. + * + * New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}). + * + * Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}). + * + * Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'. + * + * @author Jean-François Simon + */ +interface OperationInterface +{ + /** + * Returns domains affected by operation. + * + * @return array + */ + public function getDomains(); + + /** + * Returns all valid messages ('all') after operation. + * + * @param string $domain + * + * @return array + */ + public function getMessages($domain); + + /** + * Returns new messages ('new') after operation. + * + * @param string $domain + * + * @return array + */ + public function getNewMessages($domain); + + /** + * Returns obsolete messages ('obsolete') after operation. + * + * @param string $domain + * + * @return array + */ + public function getObsoleteMessages($domain); + + /** + * Returns resulting catalogue ('result'). + * + * @return MessageCatalogueInterface + */ + public function getResult(); +} diff --git a/upload/system/storage/vendor/symfony/translation/Catalogue/TargetOperation.php b/upload/system/storage/vendor/symfony/translation/Catalogue/TargetOperation.php new file mode 100644 index 00000000000..e081e139a33 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Catalogue/TargetOperation.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +/** + * Target operation between two catalogues: + * intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target} + * all = intersection ∪ (target ∖ intersection) = target + * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} + * obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target} + * Basically, the result contains messages from the target catalogue. + * + * @author Michael Lee + */ +class TargetOperation extends AbstractOperation +{ + /** + * {@inheritdoc} + */ + protected function processDomain($domain) + { + $this->messages[$domain] = array( + 'all' => array(), + 'new' => array(), + 'obsolete' => array(), + ); + + // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, + // because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} + // + // For 'new' messages, the code can't be simplied as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));`` + // because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback} + // + // For 'obsolete' messages, the code can't be simplifed as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))`` + // because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} + + foreach ($this->source->all($domain) as $id => $message) { + if ($this->target->has($id, $domain)) { + $this->messages[$domain]['all'][$id] = $message; + $this->result->add(array($id => $message), $domain); + if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) { + $this->result->setMetadata($id, $keyMetadata, $domain); + } + } else { + $this->messages[$domain]['obsolete'][$id] = $message; + } + } + + foreach ($this->target->all($domain) as $id => $message) { + if (!$this->source->has($id, $domain)) { + $this->messages[$domain]['all'][$id] = $message; + $this->messages[$domain]['new'][$id] = $message; + $this->result->add(array($id => $message), $domain); + if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) { + $this->result->setMetadata($id, $keyMetadata, $domain); + } + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/upload/system/storage/vendor/symfony/translation/DataCollector/TranslationDataCollector.php new file mode 100644 index 00000000000..cb59d0a7e70 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/DataCollector/TranslationDataCollector.php @@ -0,0 +1,150 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\DataCollector\DataCollector; +use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; +use Symfony\Component\Translation\DataCollectorTranslator; + +/** + * @author Abdellatif Ait boudad + */ +class TranslationDataCollector extends DataCollector implements LateDataCollectorInterface +{ + /** + * @var DataCollectorTranslator + */ + private $translator; + + /** + * @param DataCollectorTranslator $translator + */ + public function __construct(DataCollectorTranslator $translator) + { + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function lateCollect() + { + $messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages()); + + $this->data = $this->computeCount($messages); + $this->data['messages'] = $messages; + } + + /** + * {@inheritdoc} + */ + public function collect(Request $request, Response $response, \Exception $exception = null) + { + } + + /** + * @return array + */ + public function getMessages() + { + return isset($this->data['messages']) ? $this->data['messages'] : array(); + } + + /** + * @return int + */ + public function getCountMissings() + { + return isset($this->data[DataCollectorTranslator::MESSAGE_MISSING]) ? $this->data[DataCollectorTranslator::MESSAGE_MISSING] : 0; + } + + /** + * @return int + */ + public function getCountFallbacks() + { + return isset($this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK]) ? $this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK] : 0; + } + + /** + * @return int + */ + public function getCountDefines() + { + return isset($this->data[DataCollectorTranslator::MESSAGE_DEFINED]) ? $this->data[DataCollectorTranslator::MESSAGE_DEFINED] : 0; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'translation'; + } + + private function sanitizeCollectedMessages($messages) + { + $result = array(); + foreach ($messages as $key => $message) { + $messageId = $message['locale'].$message['domain'].$message['id']; + + if (!isset($result[$messageId])) { + $message['count'] = 1; + $message['parameters'] = !empty($message['parameters']) ? array($message['parameters']) : array(); + $messages[$key]['translation'] = $this->sanitizeString($message['translation']); + $result[$messageId] = $message; + } else { + if (!empty($message['parameters'])) { + $result[$messageId]['parameters'][] = $message['parameters']; + } + + ++$result[$messageId]['count']; + } + + unset($messages[$key]); + } + + return $result; + } + + private function computeCount($messages) + { + $count = array( + DataCollectorTranslator::MESSAGE_DEFINED => 0, + DataCollectorTranslator::MESSAGE_MISSING => 0, + DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK => 0, + ); + + foreach ($messages as $message) { + ++$count[$message['state']]; + } + + return $count; + } + + private function sanitizeString($string, $length = 80) + { + $string = trim(preg_replace('/\s+/', ' ', $string)); + + if (false !== $encoding = mb_detect_encoding($string, null, true)) { + if (mb_strlen($string, $encoding) > $length) { + return mb_substr($string, 0, $length - 3, $encoding).'...'; + } + } elseif (strlen($string) > $length) { + return substr($string, 0, $length - 3).'...'; + } + + return $string; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/DataCollectorTranslator.php b/upload/system/storage/vendor/symfony/translation/DataCollectorTranslator.php new file mode 100644 index 00000000000..24467233580 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/DataCollectorTranslator.php @@ -0,0 +1,152 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * @author Abdellatif Ait boudad + */ +class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface +{ + const MESSAGE_DEFINED = 0; + const MESSAGE_MISSING = 1; + const MESSAGE_EQUALS_FALLBACK = 2; + + /** + * @var TranslatorInterface|TranslatorBagInterface + */ + private $translator; + + /** + * @var array + */ + private $messages = array(); + + /** + * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface + */ + public function __construct(TranslatorInterface $translator) + { + if (!$translator instanceof TranslatorBagInterface) { + throw new \InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator))); + } + + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null) + { + $trans = $this->translator->trans($id, $parameters, $domain, $locale); + $this->collectMessage($locale, $domain, $id, $trans, $parameters); + + return $trans; + } + + /** + * {@inheritdoc} + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + { + $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale); + $this->collectMessage($locale, $domain, $id, $trans, $parameters, $number); + + return $trans; + } + + /** + * {@inheritdoc} + */ + public function setLocale($locale) + { + $this->translator->setLocale($locale); + } + + /** + * {@inheritdoc} + */ + public function getLocale() + { + return $this->translator->getLocale(); + } + + /** + * {@inheritdoc} + */ + public function getCatalogue($locale = null) + { + return $this->translator->getCatalogue($locale); + } + + /** + * Passes through all unknown calls onto the translator object. + */ + public function __call($method, $args) + { + return call_user_func_array(array($this->translator, $method), $args); + } + + /** + * @return array + */ + public function getCollectedMessages() + { + return $this->messages; + } + + /** + * @param string|null $locale + * @param string|null $domain + * @param string $id + * @param string $translation + * @param array|null $parameters + * @param int|null $number + */ + private function collectMessage($locale, $domain, $id, $translation, $parameters = array(), $number = null) + { + if (null === $domain) { + $domain = 'messages'; + } + + $id = (string) $id; + $catalogue = $this->translator->getCatalogue($locale); + $locale = $catalogue->getLocale(); + if ($catalogue->defines($id, $domain)) { + $state = self::MESSAGE_DEFINED; + } elseif ($catalogue->has($id, $domain)) { + $state = self::MESSAGE_EQUALS_FALLBACK; + + $fallbackCatalogue = $catalogue->getFallbackCatalogue(); + while ($fallbackCatalogue) { + if ($fallbackCatalogue->defines($id, $domain)) { + $locale = $fallbackCatalogue->getLocale(); + break; + } + + $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); + } + } else { + $state = self::MESSAGE_MISSING; + } + + $this->messages[] = array( + 'locale' => $locale, + 'domain' => $domain, + 'id' => $id, + 'translation' => $translation, + 'parameters' => $parameters, + 'transChoiceNumber' => $number, + 'state' => $state, + ); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/CsvFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/CsvFileDumper.php new file mode 100644 index 00000000000..fe5dccb42a3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/CsvFileDumper.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * CsvFileDumper generates a csv formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class CsvFileDumper extends FileDumper +{ + private $delimiter = ';'; + private $enclosure = '"'; + + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + $handle = fopen('php://memory', 'rb+'); + + foreach ($messages->all($domain) as $source => $target) { + fputcsv($handle, array($source, $target), $this->delimiter, $this->enclosure); + } + + rewind($handle); + $output = stream_get_contents($handle); + fclose($handle); + + return $output; + } + + /** + * Sets the delimiter and escape character for CSV. + * + * @param string $delimiter delimiter character + * @param string $enclosure enclosure character + */ + public function setCsvControl($delimiter = ';', $enclosure = '"') + { + $this->delimiter = $delimiter; + $this->enclosure = $enclosure; + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'csv'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/DumperInterface.php b/upload/system/storage/vendor/symfony/translation/Dumper/DumperInterface.php new file mode 100644 index 00000000000..cebc65ed89d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/DumperInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * DumperInterface is the interface implemented by all translation dumpers. + * There is no common option. + * + * @author Michel Salib + */ +interface DumperInterface +{ + /** + * Dumps the message catalogue. + * + * @param MessageCatalogue $messages The message catalogue + * @param array $options Options that are used by the dumper + */ + public function dump(MessageCatalogue $messages, $options = array()); +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/FileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/FileDumper.php new file mode 100644 index 00000000000..9c9a8eeb577 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/FileDumper.php @@ -0,0 +1,123 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s). + * Performs backup of already existing files. + * + * Options: + * - path (mandatory): the directory where the files should be saved + * + * @author Michel Salib + */ +abstract class FileDumper implements DumperInterface +{ + /** + * A template for the relative paths to files. + * + * @var string + */ + protected $relativePathTemplate = '%domain%.%locale%.%extension%'; + + /** + * Make file backup before the dump. + * + * @var bool + */ + private $backup = true; + + /** + * Sets the template for the relative paths to files. + * + * @param string $relativePathTemplate A template for the relative paths to files + */ + public function setRelativePathTemplate($relativePathTemplate) + { + $this->relativePathTemplate = $relativePathTemplate; + } + + /** + * Sets backup flag. + * + * @param bool + */ + public function setBackup($backup) + { + $this->backup = $backup; + } + + /** + * {@inheritdoc} + */ + public function dump(MessageCatalogue $messages, $options = array()) + { + if (!array_key_exists('path', $options)) { + throw new \InvalidArgumentException('The file dumper needs a path option.'); + } + + // save a file for each domain + foreach ($messages->getDomains() as $domain) { + // backup + $fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale()); + if (file_exists($fullpath)) { + if ($this->backup) { + copy($fullpath, $fullpath.'~'); + } + } else { + $directory = dirname($fullpath); + if (!file_exists($directory) && !@mkdir($directory, 0777, true)) { + throw new \RuntimeException(sprintf('Unable to create directory "%s".', $directory)); + } + } + // save file + file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); + } + } + + /** + * Transforms a domain of a message catalogue to its string representation. + * + * @param MessageCatalogue $messages + * @param string $domain + * @param array $options + * + * @return string representation + */ + abstract public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()); + + /** + * Gets the file extension of the dumper. + * + * @return string file extension + */ + abstract protected function getExtension(); + + /** + * Gets the relative file path using the template. + * + * @param string $domain The domain + * @param string $locale The locale + * + * @return string The relative file path + */ + private function getRelativePath($domain, $locale) + { + return strtr($this->relativePathTemplate, array( + '%domain%' => $domain, + '%locale%' => $locale, + '%extension%' => $this->getExtension(), + )); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/IcuResFileDumper.php new file mode 100644 index 00000000000..ceb4b423db8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/IcuResFileDumper.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class IcuResFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + protected $relativePathTemplate = '%domain%/%locale%.%extension%'; + + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + $data = $indexes = $resources = ''; + + foreach ($messages->all($domain) as $source => $target) { + $indexes .= pack('v', strlen($data) + 28); + $data .= $source."\0"; + } + + $data .= $this->writePadding($data); + + $keyTop = $this->getPosition($data); + + foreach ($messages->all($domain) as $source => $target) { + $resources .= pack('V', $this->getPosition($data)); + + $data .= pack('V', strlen($target)) + .mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8') + .$this->writePadding($data) + ; + } + + $resOffset = $this->getPosition($data); + + $data .= pack('v', count($messages)) + .$indexes + .$this->writePadding($data) + .$resources + ; + + $bundleTop = $this->getPosition($data); + + $root = pack('V7', + $resOffset + (2 << 28), // Resource Offset + Resource Type + 6, // Index length + $keyTop, // Index keys top + $bundleTop, // Index resources top + $bundleTop, // Index bundle top + count($messages), // Index max table length + 0 // Index attributes + ); + + $header = pack('vC2v4C12@32', + 32, // Header size + 0xDA, 0x27, // Magic number 1 and 2 + 20, 0, 0, 2, // Rest of the header, ..., Size of a char + 0x52, 0x65, 0x73, 0x42, // Data format identifier + 1, 2, 0, 0, // Data version + 1, 4, 0, 0 // Unicode version + ); + + return $header.$root.$data; + } + + private function writePadding($data) + { + $padding = strlen($data) % 4; + + if ($padding) { + return str_repeat("\xAA", 4 - $padding); + } + } + + private function getPosition($data) + { + return (strlen($data) + 28) / 4; + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'res'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/IniFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/IniFileDumper.php new file mode 100644 index 00000000000..9ed3754037f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/IniFileDumper.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * IniFileDumper generates an ini formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class IniFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + $output = ''; + + foreach ($messages->all($domain) as $source => $target) { + $escapeTarget = str_replace('"', '\"', $target); + $output .= $source.'="'.$escapeTarget."\"\n"; + } + + return $output; + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'ini'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/JsonFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/JsonFileDumper.php new file mode 100644 index 00000000000..08b538e1fec --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/JsonFileDumper.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * JsonFileDumper generates an json formatted string representation of a message catalogue. + * + * @author singles + */ +class JsonFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + if (isset($options['json_encoding'])) { + $flags = $options['json_encoding']; + } else { + $flags = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0; + } + + return json_encode($messages->all($domain), $flags); + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'json'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/MoFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/MoFileDumper.php new file mode 100644 index 00000000000..f9aae42d8c8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/MoFileDumper.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Loader\MoFileLoader; + +/** + * MoFileDumper generates a gettext formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class MoFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + $output = $sources = $targets = $sourceOffsets = $targetOffsets = ''; + $offsets = array(); + $size = 0; + + foreach ($messages->all($domain) as $source => $target) { + $offsets[] = array_map('strlen', array($sources, $source, $targets, $target)); + $sources .= "\0".$source; + $targets .= "\0".$target; + ++$size; + } + + $header = array( + 'magicNumber' => MoFileLoader::MO_LITTLE_ENDIAN_MAGIC, + 'formatRevision' => 0, + 'count' => $size, + 'offsetId' => MoFileLoader::MO_HEADER_SIZE, + 'offsetTranslated' => MoFileLoader::MO_HEADER_SIZE + (8 * $size), + 'sizeHashes' => 0, + 'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size), + ); + + $sourcesSize = strlen($sources); + $sourcesStart = $header['offsetHashes'] + 1; + + foreach ($offsets as $offset) { + $sourceOffsets .= $this->writeLong($offset[1]) + .$this->writeLong($offset[0] + $sourcesStart); + $targetOffsets .= $this->writeLong($offset[3]) + .$this->writeLong($offset[2] + $sourcesStart + $sourcesSize); + } + + $output = implode(array_map(array($this, 'writeLong'), $header)) + .$sourceOffsets + .$targetOffsets + .$sources + .$targets + ; + + return $output; + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'mo'; + } + + private function writeLong($str) + { + return pack('V*', $str); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/PhpFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/PhpFileDumper.php new file mode 100644 index 00000000000..c7c37aac923 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/PhpFileDumper.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * PhpFileDumper generates PHP files from a message catalogue. + * + * @author Michel Salib + */ +class PhpFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + return "all($domain), true).";\n"; + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'php'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/PoFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/PoFileDumper.php new file mode 100644 index 00000000000..ed4418b1489 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/PoFileDumper.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * PoFileDumper generates a gettext formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class PoFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + $output = 'msgid ""'."\n"; + $output .= 'msgstr ""'."\n"; + $output .= '"Content-Type: text/plain; charset=UTF-8\n"'."\n"; + $output .= '"Content-Transfer-Encoding: 8bit\n"'."\n"; + $output .= '"Language: '.$messages->getLocale().'\n"'."\n"; + $output .= "\n"; + + $newLine = false; + foreach ($messages->all($domain) as $source => $target) { + if ($newLine) { + $output .= "\n"; + } else { + $newLine = true; + } + $output .= sprintf('msgid "%s"'."\n", $this->escape($source)); + $output .= sprintf('msgstr "%s"', $this->escape($target)); + } + + return $output; + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'po'; + } + + private function escape($str) + { + return addcslashes($str, "\0..\37\42\134"); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/QtFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/QtFileDumper.php new file mode 100644 index 00000000000..a9073f26df4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/QtFileDumper.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * QtFileDumper generates ts files from a message catalogue. + * + * @author Benjamin Eberlei + */ +class QtFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->formatOutput = true; + $ts = $dom->appendChild($dom->createElement('TS')); + $context = $ts->appendChild($dom->createElement('context')); + $context->appendChild($dom->createElement('name', $domain)); + + foreach ($messages->all($domain) as $source => $target) { + $message = $context->appendChild($dom->createElement('message')); + $message->appendChild($dom->createElement('source', $source)); + $message->appendChild($dom->createElement('translation', $target)); + } + + return $dom->saveXML(); + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'ts'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/XliffFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/XliffFileDumper.php new file mode 100644 index 00000000000..915dbcae8e8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/XliffFileDumper.php @@ -0,0 +1,183 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * XliffFileDumper generates xliff files from a message catalogue. + * + * @author Michel Salib + */ +class XliffFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + $xliffVersion = '1.2'; + if (array_key_exists('xliff_version', $options)) { + $xliffVersion = $options['xliff_version']; + } + + if (array_key_exists('default_locale', $options)) { + $defaultLocale = $options['default_locale']; + } else { + $defaultLocale = \Locale::getDefault(); + } + + if ('1.2' === $xliffVersion) { + return $this->dumpXliff1($defaultLocale, $messages, $domain, $options); + } + if ('2.0' === $xliffVersion) { + return $this->dumpXliff2($defaultLocale, $messages, $domain, $options); + } + + throw new \InvalidArgumentException(sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion)); + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'xlf'; + } + + private function dumpXliff1($defaultLocale, MessageCatalogue $messages, $domain, array $options = array()) + { + $toolInfo = array('tool-id' => 'symfony', 'tool-name' => 'Symfony'); + if (array_key_exists('tool_info', $options)) { + $toolInfo = array_merge($toolInfo, $options['tool_info']); + } + + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->formatOutput = true; + + $xliff = $dom->appendChild($dom->createElement('xliff')); + $xliff->setAttribute('version', '1.2'); + $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:1.2'); + + $xliffFile = $xliff->appendChild($dom->createElement('file')); + $xliffFile->setAttribute('source-language', str_replace('_', '-', $defaultLocale)); + $xliffFile->setAttribute('target-language', str_replace('_', '-', $messages->getLocale())); + $xliffFile->setAttribute('datatype', 'plaintext'); + $xliffFile->setAttribute('original', 'file.ext'); + + $xliffHead = $xliffFile->appendChild($dom->createElement('header')); + $xliffTool = $xliffHead->appendChild($dom->createElement('tool')); + foreach ($toolInfo as $id => $value) { + $xliffTool->setAttribute($id, $value); + } + + $xliffBody = $xliffFile->appendChild($dom->createElement('body')); + foreach ($messages->all($domain) as $source => $target) { + $translation = $dom->createElement('trans-unit'); + + $translation->setAttribute('id', md5($source)); + $translation->setAttribute('resname', $source); + + $s = $translation->appendChild($dom->createElement('source')); + $s->appendChild($dom->createTextNode($source)); + + // Does the target contain characters requiring a CDATA section? + $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); + + $targetElement = $dom->createElement('target'); + $metadata = $messages->getMetadata($source, $domain); + if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { + foreach ($metadata['target-attributes'] as $name => $value) { + $targetElement->setAttribute($name, $value); + } + } + $t = $translation->appendChild($targetElement); + $t->appendChild($text); + + if ($this->hasMetadataArrayInfo('notes', $metadata)) { + foreach ($metadata['notes'] as $note) { + if (!isset($note['content'])) { + continue; + } + + $n = $translation->appendChild($dom->createElement('note')); + $n->appendChild($dom->createTextNode($note['content'])); + + if (isset($note['priority'])) { + $n->setAttribute('priority', $note['priority']); + } + + if (isset($note['from'])) { + $n->setAttribute('from', $note['from']); + } + } + } + + $xliffBody->appendChild($translation); + } + + return $dom->saveXML(); + } + + private function dumpXliff2($defaultLocale, MessageCatalogue $messages, $domain, array $options = array()) + { + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->formatOutput = true; + + $xliff = $dom->appendChild($dom->createElement('xliff')); + $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0'); + $xliff->setAttribute('version', '2.0'); + $xliff->setAttribute('srcLang', str_replace('_', '-', $defaultLocale)); + $xliff->setAttribute('trgLang', str_replace('_', '-', $messages->getLocale())); + + $xliffFile = $xliff->appendChild($dom->createElement('file')); + $xliffFile->setAttribute('id', $domain.'.'.$messages->getLocale()); + + foreach ($messages->all($domain) as $source => $target) { + $translation = $dom->createElement('unit'); + $translation->setAttribute('id', md5($source)); + + $segment = $translation->appendChild($dom->createElement('segment')); + + $s = $segment->appendChild($dom->createElement('source')); + $s->appendChild($dom->createTextNode($source)); + + // Does the target contain characters requiring a CDATA section? + $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); + + $targetElement = $dom->createElement('target'); + $metadata = $messages->getMetadata($source, $domain); + if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { + foreach ($metadata['target-attributes'] as $name => $value) { + $targetElement->setAttribute($name, $value); + } + } + $t = $segment->appendChild($targetElement); + $t->appendChild($text); + + $xliffFile->appendChild($translation); + } + + return $dom->saveXML(); + } + + /** + * @param string $key + * @param array|null $metadata + * + * @return bool + */ + private function hasMetadataArrayInfo($key, $metadata = null) + { + return null !== $metadata && array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || is_array($metadata[$key])); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Dumper/YamlFileDumper.php b/upload/system/storage/vendor/symfony/translation/Dumper/YamlFileDumper.php new file mode 100644 index 00000000000..625953c7900 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Dumper/YamlFileDumper.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Util\ArrayConverter; +use Symfony\Component\Yaml\Yaml; + +/** + * YamlFileDumper generates yaml files from a message catalogue. + * + * @author Michel Salib + */ +class YamlFileDumper extends FileDumper +{ + /** + * {@inheritdoc} + */ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + if (!class_exists('Symfony\Component\Yaml\Yaml')) { + throw new \LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); + } + + $data = $messages->all($domain); + + if (isset($options['as_tree']) && $options['as_tree']) { + $data = ArrayConverter::expandToTree($data); + } + + if (isset($options['inline']) && ($inline = (int) $options['inline']) > 0) { + return Yaml::dump($data, $inline); + } + + return Yaml::dump($data); + } + + /** + * {@inheritdoc} + */ + protected function getExtension() + { + return 'yml'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Exception/ExceptionInterface.php b/upload/system/storage/vendor/symfony/translation/Exception/ExceptionInterface.php new file mode 100644 index 00000000000..c85fb93ca82 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Exception/ExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Exception interface for all exceptions thrown by the component. + * + * @author Fabien Potencier + */ +interface ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/translation/Exception/InvalidResourceException.php b/upload/system/storage/vendor/symfony/translation/Exception/InvalidResourceException.php new file mode 100644 index 00000000000..cf079432c99 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Exception/InvalidResourceException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Thrown when a resource cannot be loaded. + * + * @author Fabien Potencier + */ +class InvalidResourceException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/translation/Exception/NotFoundResourceException.php b/upload/system/storage/vendor/symfony/translation/Exception/NotFoundResourceException.php new file mode 100644 index 00000000000..cff73ae30bb --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Exception/NotFoundResourceException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Thrown when a resource does not exist. + * + * @author Fabien Potencier + */ +class NotFoundResourceException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/translation/Extractor/AbstractFileExtractor.php b/upload/system/storage/vendor/symfony/translation/Extractor/AbstractFileExtractor.php new file mode 100644 index 00000000000..57fd4938d22 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Extractor/AbstractFileExtractor.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +/** + * Base class used by classes that extract translation messages from files. + * + * @author Marcos D. Sánchez + */ +abstract class AbstractFileExtractor +{ + /** + * @param string|array $resource files, a file or a directory + * + * @return array + */ + protected function extractFiles($resource) + { + if (is_array($resource) || $resource instanceof \Traversable) { + $files = array(); + foreach ($resource as $file) { + if ($this->canBeExtracted($file)) { + $files[] = $this->toSplFileInfo($file); + } + } + } elseif (is_file($resource)) { + $files = $this->canBeExtracted($resource) ? array($this->toSplFileInfo($resource)) : array(); + } else { + $files = $this->extractFromDirectory($resource); + } + + return $files; + } + + /** + * @param string $file + * + * @return \SplFileInfo + */ + private function toSplFileInfo($file) + { + return ($file instanceof \SplFileInfo) ? $file : new \SplFileInfo($file); + } + + /** + * @param string $file + * + * @return bool + * + * @throws \InvalidArgumentException + */ + protected function isFile($file) + { + if (!is_file($file)) { + throw new \InvalidArgumentException(sprintf('The "%s" file does not exist.', $file)); + } + + return true; + } + + /** + * @param string $file + * + * @return bool + */ + abstract protected function canBeExtracted($file); + + /** + * @param string|array $resource files, a file or a directory + * + * @return array files to be extracted + */ + abstract protected function extractFromDirectory($resource); +} diff --git a/upload/system/storage/vendor/symfony/translation/Extractor/ChainExtractor.php b/upload/system/storage/vendor/symfony/translation/Extractor/ChainExtractor.php new file mode 100644 index 00000000000..50e3c84579f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Extractor/ChainExtractor.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * ChainExtractor extracts translation messages from template files. + * + * @author Michel Salib + */ +class ChainExtractor implements ExtractorInterface +{ + /** + * The extractors. + * + * @var ExtractorInterface[] + */ + private $extractors = array(); + + /** + * Adds a loader to the translation extractor. + * + * @param string $format The format of the loader + * @param ExtractorInterface $extractor The loader + */ + public function addExtractor($format, ExtractorInterface $extractor) + { + $this->extractors[$format] = $extractor; + } + + /** + * {@inheritdoc} + */ + public function setPrefix($prefix) + { + foreach ($this->extractors as $extractor) { + $extractor->setPrefix($prefix); + } + } + + /** + * {@inheritdoc} + */ + public function extract($directory, MessageCatalogue $catalogue) + { + foreach ($this->extractors as $extractor) { + $extractor->extract($directory, $catalogue); + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Extractor/ExtractorInterface.php b/upload/system/storage/vendor/symfony/translation/Extractor/ExtractorInterface.php new file mode 100644 index 00000000000..438f80b32f0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Extractor/ExtractorInterface.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * Extracts translation messages from a directory or files to the catalogue. + * New found messages are injected to the catalogue using the prefix. + * + * @author Michel Salib + */ +interface ExtractorInterface +{ + /** + * Extracts translation messages from files, a file or a directory to the catalogue. + * + * @param string|array $resource files, a file or a directory + * @param MessageCatalogue $catalogue The catalogue + */ + public function extract($resource, MessageCatalogue $catalogue); + + /** + * Sets the prefix that should be used for new found messages. + * + * @param string $prefix The prefix + */ + public function setPrefix($prefix); +} diff --git a/upload/system/storage/vendor/symfony/translation/IdentityTranslator.php b/upload/system/storage/vendor/symfony/translation/IdentityTranslator.php new file mode 100644 index 00000000000..46a046365b3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/IdentityTranslator.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * IdentityTranslator does not translate anything. + * + * @author Fabien Potencier + */ +class IdentityTranslator implements TranslatorInterface +{ + private $selector; + private $locale; + + /** + * Constructor. + * + * @param MessageSelector|null $selector The message selector for pluralization + */ + public function __construct(MessageSelector $selector = null) + { + $this->selector = $selector ?: new MessageSelector(); + } + + /** + * {@inheritdoc} + */ + public function setLocale($locale) + { + $this->locale = $locale; + } + + /** + * {@inheritdoc} + */ + public function getLocale() + { + return $this->locale ?: \Locale::getDefault(); + } + + /** + * {@inheritdoc} + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null) + { + return strtr((string) $id, $parameters); + } + + /** + * {@inheritdoc} + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + { + return strtr($this->selector->choose((string) $id, (int) $number, $locale ?: $this->getLocale()), $parameters); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Interval.php b/upload/system/storage/vendor/symfony/translation/Interval.php new file mode 100644 index 00000000000..2a51156ef73 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Interval.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * Tests if a given number belongs to a given math interval. + * + * An interval can represent a finite set of numbers: + * + * {1,2,3,4} + * + * An interval can represent numbers between two numbers: + * + * [1, +Inf] + * ]-1,2[ + * + * The left delimiter can be [ (inclusive) or ] (exclusive). + * The right delimiter can be [ (exclusive) or ] (inclusive). + * Beside numbers, you can use -Inf and +Inf for the infinite. + * + * @author Fabien Potencier + * + * @see http://en.wikipedia.org/wiki/Interval_%28mathematics%29#The_ISO_notation + */ +class Interval +{ + /** + * Tests if the given number is in the math interval. + * + * @param int $number A number + * @param string $interval An interval + * + * @return bool + * + * @throws \InvalidArgumentException + */ + public static function test($number, $interval) + { + $interval = trim($interval); + + if (!preg_match('/^'.self::getIntervalRegexp().'$/x', $interval, $matches)) { + throw new \InvalidArgumentException(sprintf('"%s" is not a valid interval.', $interval)); + } + + if ($matches[1]) { + foreach (explode(',', $matches[2]) as $n) { + if ($number == $n) { + return true; + } + } + } else { + $leftNumber = self::convertNumber($matches['left']); + $rightNumber = self::convertNumber($matches['right']); + + return + ('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber) + && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber) + ; + } + + return false; + } + + /** + * Returns a Regexp that matches valid intervals. + * + * @return string A Regexp (without the delimiters) + */ + public static function getIntervalRegexp() + { + return <<[\[\]]) + \s* + (?P-Inf|\-?\d+(\.\d+)?) + \s*,\s* + (?P\+?Inf|\-?\d+(\.\d+)?) + \s* + (?P[\[\]]) +EOF; + } + + private static function convertNumber($number) + { + if ('-Inf' === $number) { + return log(0); + } elseif ('+Inf' === $number || 'Inf' === $number) { + return -log(0); + } + + return (float) $number; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/LICENSE b/upload/system/storage/vendor/symfony/translation/LICENSE new file mode 100644 index 00000000000..12a74531e40 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2016 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/upload/system/storage/vendor/symfony/translation/Loader/ArrayLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/ArrayLoader.php new file mode 100644 index 00000000000..9a595b7dada --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/ArrayLoader.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * ArrayLoader loads translations from a PHP array. + * + * @author Fabien Potencier + */ +class ArrayLoader implements LoaderInterface +{ + /** + * {@inheritdoc} + */ + public function load($resource, $locale, $domain = 'messages') + { + $this->flatten($resource); + $catalogue = new MessageCatalogue($locale); + $catalogue->add($resource, $domain); + + return $catalogue; + } + + /** + * Flattens an nested array of translations. + * + * The scheme used is: + * 'key' => array('key2' => array('key3' => 'value')) + * Becomes: + * 'key.key2.key3' => 'value' + * + * This function takes an array by reference and will modify it + * + * @param array &$messages The array that will be flattened + * @param array $subnode Current subnode being parsed, used internally for recursive calls + * @param string $path Current path being parsed, used internally for recursive calls + */ + private function flatten(array &$messages, array $subnode = null, $path = null) + { + if (null === $subnode) { + $subnode = &$messages; + } + foreach ($subnode as $key => $value) { + if (is_array($value)) { + $nodePath = $path ? $path.'.'.$key : $key; + $this->flatten($messages, $value, $nodePath); + if (null === $path) { + unset($messages[$key]); + } + } elseif (null !== $path) { + $messages[$path.'.'.$key] = $value; + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/CsvFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/CsvFileLoader.php new file mode 100644 index 00000000000..f1d3443f4c7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/CsvFileLoader.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\NotFoundResourceException; + +/** + * CsvFileLoader loads translations from CSV files. + * + * @author Saša Stamenković + */ +class CsvFileLoader extends FileLoader +{ + private $delimiter = ';'; + private $enclosure = '"'; + private $escape = '\\'; + + /** + * {@inheritdoc} + */ + protected function loadResource($resource) + { + $messages = array(); + + try { + $file = new \SplFileObject($resource, 'rb'); + } catch (\RuntimeException $e) { + throw new NotFoundResourceException(sprintf('Error opening file "%s".', $resource), 0, $e); + } + + $file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY); + $file->setCsvControl($this->delimiter, $this->enclosure, $this->escape); + + foreach ($file as $data) { + if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === count($data)) { + $messages[$data[0]] = $data[1]; + } + } + + return $messages; + } + + /** + * Sets the delimiter, enclosure, and escape character for CSV. + * + * @param string $delimiter delimiter character + * @param string $enclosure enclosure character + * @param string $escape escape character + */ + public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\') + { + $this->delimiter = $delimiter; + $this->enclosure = $enclosure; + $this->escape = $escape; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/FileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/FileLoader.php new file mode 100644 index 00000000000..a7f24f41a65 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/FileLoader.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Config\Resource\FileResource; + +/** + * @author Abdellatif Ait boudad + */ +abstract class FileLoader extends ArrayLoader +{ + /** + * {@inheritdoc} + */ + public function load($resource, $locale, $domain = 'messages') + { + if (!stream_is_local($resource)) { + throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource)) { + throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); + } + + $messages = $this->loadResource($resource); + + // empty resource + if (null === $messages) { + $messages = array(); + } + + // not an array + if (!is_array($messages)) { + throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource)); + } + + $catalogue = parent::load($messages, $locale, $domain); + + if (class_exists('Symfony\Component\Config\Resource\FileResource')) { + $catalogue->addResource(new FileResource($resource)); + } + + return $catalogue; + } + + /* + * @param string $resource + * + * @return array + * + * @throws InvalidResourceException If stream content has an invalid format. + */ + abstract protected function loadResource($resource); +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/IcuDatFileLoader.php new file mode 100644 index 00000000000..71ba90a39d9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/IcuDatFileLoader.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Config\Resource\FileResource; + +/** + * IcuResFileLoader loads translations from a resource bundle. + * + * @author stealth35 + */ +class IcuDatFileLoader extends IcuResFileLoader +{ + /** + * {@inheritdoc} + */ + public function load($resource, $locale, $domain = 'messages') + { + if (!stream_is_local($resource.'.dat')) { + throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource.'.dat')) { + throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); + } + + try { + $rb = new \ResourceBundle($locale, $resource); + } catch (\Exception $e) { + // HHVM compatibility: constructor throws on invalid resource + $rb = null; + } + + if (!$rb) { + throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource)); + } elseif (intl_is_failure($rb->getErrorCode())) { + throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); + } + + $messages = $this->flatten($rb); + $catalogue = new MessageCatalogue($locale); + $catalogue->add($messages, $domain); + + if (class_exists('Symfony\Component\Config\Resource\FileResource')) { + $catalogue->addResource(new FileResource($resource.'.dat')); + } + + return $catalogue; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/IcuResFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/IcuResFileLoader.php new file mode 100644 index 00000000000..2f8037fb164 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Config\Resource\DirectoryResource; + +/** + * IcuResFileLoader loads translations from a resource bundle. + * + * @author stealth35 + */ +class IcuResFileLoader implements LoaderInterface +{ + /** + * {@inheritdoc} + */ + public function load($resource, $locale, $domain = 'messages') + { + if (!stream_is_local($resource)) { + throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); + } + + if (!is_dir($resource)) { + throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); + } + + try { + $rb = new \ResourceBundle($locale, $resource); + } catch (\Exception $e) { + // HHVM compatibility: constructor throws on invalid resource + $rb = null; + } + + if (!$rb) { + throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource)); + } elseif (intl_is_failure($rb->getErrorCode())) { + throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); + } + + $messages = $this->flatten($rb); + $catalogue = new MessageCatalogue($locale); + $catalogue->add($messages, $domain); + + if (class_exists('Symfony\Component\Config\Resource\DirectoryResource')) { + $catalogue->addResource(new DirectoryResource($resource)); + } + + return $catalogue; + } + + /** + * Flattens an ResourceBundle. + * + * The scheme used is: + * key { key2 { key3 { "value" } } } + * Becomes: + * 'key.key2.key3' => 'value' + * + * This function takes an array by reference and will modify it + * + * @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 + * + * @return array the flattened ResourceBundle + */ + protected function flatten(\ResourceBundle $rb, array &$messages = array(), $path = null) + { + foreach ($rb as $key => $value) { + $nodePath = $path ? $path.'.'.$key : $key; + if ($value instanceof \ResourceBundle) { + $this->flatten($value, $messages, $nodePath); + } else { + $messages[$nodePath] = $value; + } + } + + return $messages; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/IniFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/IniFileLoader.php new file mode 100644 index 00000000000..11d9b272e0a --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/IniFileLoader.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +/** + * IniFileLoader loads translations from an ini file. + * + * @author stealth35 + */ +class IniFileLoader extends FileLoader +{ + /** + * {@inheritdoc} + */ + protected function loadResource($resource) + { + return parse_ini_file($resource, true); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/JsonFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/JsonFileLoader.php new file mode 100644 index 00000000000..ce4e91ff4fb --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/JsonFileLoader.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; + +/** + * JsonFileLoader loads translations from an json file. + * + * @author singles + */ +class JsonFileLoader extends FileLoader +{ + /** + * {@inheritdoc} + */ + protected function loadResource($resource) + { + $messages = array(); + if ($data = file_get_contents($resource)) { + $messages = json_decode($data, true); + + if (0 < $errorCode = json_last_error()) { + throw new InvalidResourceException(sprintf('Error parsing JSON - %s', $this->getJSONErrorMessage($errorCode))); + } + } + + return $messages; + } + + /** + * Translates JSON_ERROR_* constant into meaningful message. + * + * @param int $errorCode Error code returned by json_last_error() call + * + * @return string Message string + */ + private function getJSONErrorMessage($errorCode) + { + switch ($errorCode) { + case JSON_ERROR_DEPTH: + return 'Maximum stack depth exceeded'; + case JSON_ERROR_STATE_MISMATCH: + return 'Underflow or the modes mismatch'; + case JSON_ERROR_CTRL_CHAR: + return 'Unexpected control character found'; + case JSON_ERROR_SYNTAX: + return 'Syntax error, malformed JSON'; + case JSON_ERROR_UTF8: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + default: + return 'Unknown error'; + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/LoaderInterface.php b/upload/system/storage/vendor/symfony/translation/Loader/LoaderInterface.php new file mode 100644 index 00000000000..6b65fe380bc --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/LoaderInterface.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; + +/** + * LoaderInterface is the interface implemented by all translation loaders. + * + * @author Fabien Potencier + */ +interface LoaderInterface +{ + /** + * Loads a locale. + * + * @param mixed $resource A resource + * @param string $locale A locale + * @param string $domain The domain + * + * @return MessageCatalogue A MessageCatalogue instance + * + * @throws NotFoundResourceException when the resource cannot be found + * @throws InvalidResourceException when the resource cannot be loaded + */ + public function load($resource, $locale, $domain = 'messages'); +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/MoFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/MoFileLoader.php new file mode 100644 index 00000000000..2fcada28477 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/MoFileLoader.php @@ -0,0 +1,154 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; + +/** + * @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/) + */ +class MoFileLoader extends FileLoader +{ + /** + * Magic used for validating the format of a MO file as well as + * detecting if the machine used to create that file was little endian. + * + * @var float + */ + const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; + + /** + * Magic used for validating the format of a MO file as well as + * detecting if the machine used to create that file was big endian. + * + * @var float + */ + const MO_BIG_ENDIAN_MAGIC = 0xde120495; + + /** + * The size of the header of a MO file in bytes. + * + * @var int Number of bytes + */ + const MO_HEADER_SIZE = 28; + + /** + * Parses machine object (MO) format, independent of the machine's endian it + * was created on. Both 32bit and 64bit systems are supported. + * + * {@inheritdoc} + */ + protected function loadResource($resource) + { + $stream = fopen($resource, 'r'); + + $stat = fstat($stream); + + if ($stat['size'] < self::MO_HEADER_SIZE) { + throw new InvalidResourceException('MO stream content has an invalid format.'); + } + $magic = unpack('V1', fread($stream, 4)); + $magic = hexdec(substr(dechex(current($magic)), -8)); + + if ($magic == self::MO_LITTLE_ENDIAN_MAGIC) { + $isBigEndian = false; + } elseif ($magic == self::MO_BIG_ENDIAN_MAGIC) { + $isBigEndian = true; + } else { + throw new InvalidResourceException('MO stream content has an invalid format.'); + } + + // formatRevision + $this->readLong($stream, $isBigEndian); + $count = $this->readLong($stream, $isBigEndian); + $offsetId = $this->readLong($stream, $isBigEndian); + $offsetTranslated = $this->readLong($stream, $isBigEndian); + // sizeHashes + $this->readLong($stream, $isBigEndian); + // offsetHashes + $this->readLong($stream, $isBigEndian); + + $messages = array(); + + for ($i = 0; $i < $count; ++$i) { + $singularId = $pluralId = null; + $translated = null; + + fseek($stream, $offsetId + $i * 8); + + $length = $this->readLong($stream, $isBigEndian); + $offset = $this->readLong($stream, $isBigEndian); + + if ($length < 1) { + continue; + } + + fseek($stream, $offset); + $singularId = fread($stream, $length); + + if (strpos($singularId, "\000") !== false) { + list($singularId, $pluralId) = explode("\000", $singularId); + } + + fseek($stream, $offsetTranslated + $i * 8); + $length = $this->readLong($stream, $isBigEndian); + $offset = $this->readLong($stream, $isBigEndian); + + if ($length < 1) { + continue; + } + + fseek($stream, $offset); + $translated = fread($stream, $length); + + if (strpos($translated, "\000") !== false) { + $translated = explode("\000", $translated); + } + + $ids = array('singular' => $singularId, 'plural' => $pluralId); + $item = compact('ids', 'translated'); + + if (is_array($item['translated'])) { + $messages[$item['ids']['singular']] = stripcslashes($item['translated'][0]); + if (isset($item['ids']['plural'])) { + $plurals = array(); + foreach ($item['translated'] as $plural => $translated) { + $plurals[] = sprintf('{%d} %s', $plural, $translated); + } + $messages[$item['ids']['plural']] = stripcslashes(implode('|', $plurals)); + } + } elseif (!empty($item['ids']['singular'])) { + $messages[$item['ids']['singular']] = stripcslashes($item['translated']); + } + } + + fclose($stream); + + return array_filter($messages); + } + + /** + * Reads an unsigned long from stream respecting endianess. + * + * @param resource $stream + * @param bool $isBigEndian + * + * @return int + */ + private function readLong($stream, $isBigEndian) + { + $result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4)); + $result = current($result); + + return (int) substr($result, -8); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/PhpFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/PhpFileLoader.php new file mode 100644 index 00000000000..a0050e8db1e --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/PhpFileLoader.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +/** + * PhpFileLoader loads translations from PHP files returning an array of translations. + * + * @author Fabien Potencier + */ +class PhpFileLoader extends FileLoader +{ + /** + * {@inheritdoc} + */ + protected function loadResource($resource) + { + return require $resource; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/PoFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/PoFileLoader.php new file mode 100644 index 00000000000..40f5464bf2f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/PoFileLoader.php @@ -0,0 +1,151 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +/** + * @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/) + * @copyright Copyright (c) 2012, Clemens Tolboom + */ +class PoFileLoader extends FileLoader +{ + /** + * Parses portable object (PO) format. + * + * From http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files + * we should be able to parse files having: + * + * white-space + * # translator-comments + * #. extracted-comments + * #: reference... + * #, flag... + * #| msgid previous-untranslated-string + * msgid untranslated-string + * msgstr translated-string + * + * extra or different lines are: + * + * #| msgctxt previous-context + * #| msgid previous-untranslated-string + * msgctxt context + * + * #| msgid previous-untranslated-string-singular + * #| msgid_plural previous-untranslated-string-plural + * msgid untranslated-string-singular + * msgid_plural untranslated-string-plural + * msgstr[0] translated-string-case-0 + * ... + * msgstr[N] translated-string-case-n + * + * The definition states: + * - white-space and comments are optional. + * - msgid "" that an empty singleline defines a header. + * + * This parser sacrifices some features of the reference implementation the + * differences to that implementation are as follows. + * - No support for comments spanning multiple lines. + * - Translator and extracted comments are treated as being the same type. + * - Message IDs are allowed to have other encodings as just US-ASCII. + * + * Items with an empty id are ignored. + * + * {@inheritdoc} + */ + protected function loadResource($resource) + { + $stream = fopen($resource, 'r'); + + $defaults = array( + 'ids' => array(), + 'translated' => null, + ); + + $messages = array(); + $item = $defaults; + $flags = array(); + + while ($line = fgets($stream)) { + $line = trim($line); + + if ($line === '') { + // Whitespace indicated current item is done + if (!in_array('fuzzy', $flags)) { + $this->addMessage($messages, $item); + } + $item = $defaults; + $flags = array(); + } elseif (substr($line, 0, 2) === '#,') { + $flags = array_map('trim', explode(',', substr($line, 2))); + } elseif (substr($line, 0, 7) === 'msgid "') { + // We start a new msg so save previous + // TODO: this fails when comments or contexts are added + $this->addMessage($messages, $item); + $item = $defaults; + $item['ids']['singular'] = substr($line, 7, -1); + } elseif (substr($line, 0, 8) === 'msgstr "') { + $item['translated'] = substr($line, 8, -1); + } elseif ($line[0] === '"') { + $continues = isset($item['translated']) ? 'translated' : 'ids'; + + if (is_array($item[$continues])) { + end($item[$continues]); + $item[$continues][key($item[$continues])] .= substr($line, 1, -1); + } else { + $item[$continues] .= substr($line, 1, -1); + } + } elseif (substr($line, 0, 14) === 'msgid_plural "') { + $item['ids']['plural'] = substr($line, 14, -1); + } elseif (substr($line, 0, 7) === 'msgstr[') { + $size = strpos($line, ']'); + $item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1); + } + } + // save last item + if (!in_array('fuzzy', $flags)) { + $this->addMessage($messages, $item); + } + fclose($stream); + + return $messages; + } + + /** + * Save a translation item to the messages. + * + * A .po file could contain by error missing plural indexes. We need to + * fix these before saving them. + * + * @param array $messages + * @param array $item + */ + private function addMessage(array &$messages, array $item) + { + if (is_array($item['translated'])) { + $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated'][0]); + if (isset($item['ids']['plural'])) { + $plurals = $item['translated']; + // PO are by definition indexed so sort by index. + ksort($plurals); + // Make sure every index is filled. + end($plurals); + $count = key($plurals); + // Fill missing spots with '-'. + $empties = array_fill(0, $count + 1, '-'); + $plurals += $empties; + ksort($plurals); + $messages[stripcslashes($item['ids']['plural'])] = stripcslashes(implode('|', $plurals)); + } + } elseif (!empty($item['ids']['singular'])) { + $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated']); + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/QtFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/QtFileLoader.php new file mode 100644 index 00000000000..657bd6eb53c --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/QtFileLoader.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Config\Util\XmlUtils; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Config\Resource\FileResource; + +/** + * QtFileLoader loads translations from QT Translations XML files. + * + * @author Benjamin Eberlei + */ +class QtFileLoader implements LoaderInterface +{ + /** + * {@inheritdoc} + */ + public function load($resource, $locale, $domain = 'messages') + { + if (!stream_is_local($resource)) { + throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource)) { + throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); + } + + try { + $dom = XmlUtils::loadFile($resource); + } catch (\InvalidArgumentException $e) { + throw new InvalidResourceException(sprintf('Unable to load "%s".', $resource), $e->getCode(), $e); + } + + $internalErrors = libxml_use_internal_errors(true); + libxml_clear_errors(); + + $xpath = new \DOMXPath($dom); + $nodes = $xpath->evaluate('//TS/context/name[text()="'.$domain.'"]'); + + $catalogue = new MessageCatalogue($locale); + if ($nodes->length == 1) { + $translations = $nodes->item(0)->nextSibling->parentNode->parentNode->getElementsByTagName('message'); + foreach ($translations as $translation) { + $translationValue = (string) $translation->getElementsByTagName('translation')->item(0)->nodeValue; + + if (!empty($translationValue)) { + $catalogue->set( + (string) $translation->getElementsByTagName('source')->item(0)->nodeValue, + $translationValue, + $domain + ); + } + $translation = $translation->nextSibling; + } + + if (class_exists('Symfony\Component\Config\Resource\FileResource')) { + $catalogue->addResource(new FileResource($resource)); + } + } + + libxml_use_internal_errors($internalErrors); + + return $catalogue; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/XliffFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/XliffFileLoader.php new file mode 100644 index 00000000000..d3fbec93d98 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -0,0 +1,321 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Config\Util\XmlUtils; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Config\Resource\FileResource; + +/** + * XliffFileLoader loads translations from XLIFF files. + * + * @author Fabien Potencier + */ +class XliffFileLoader implements LoaderInterface +{ + /** + * {@inheritdoc} + */ + public function load($resource, $locale, $domain = 'messages') + { + if (!stream_is_local($resource)) { + throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource)) { + throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); + } + + $catalogue = new MessageCatalogue($locale); + $this->extract($resource, $catalogue, $domain); + + if (class_exists('Symfony\Component\Config\Resource\FileResource')) { + $catalogue->addResource(new FileResource($resource)); + } + + return $catalogue; + } + + private function extract($resource, MessageCatalogue $catalogue, $domain) + { + try { + $dom = XmlUtils::loadFile($resource); + } catch (\InvalidArgumentException $e) { + throw new InvalidResourceException(sprintf('Unable to load "%s": %s', $resource, $e->getMessage()), $e->getCode(), $e); + } + + $xliffVersion = $this->getVersionNumber($dom); + $this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion)); + + if ('1.2' === $xliffVersion) { + $this->extractXliff1($dom, $catalogue, $domain); + } + + if ('2.0' === $xliffVersion) { + $this->extractXliff2($dom, $catalogue, $domain); + } + } + + /** + * Extract messages and metadata from DOMDocument into a MessageCatalogue. + * + * @param \DOMDocument $dom Source to extract messages and metadata + * @param MessageCatalogue $catalogue Catalogue where we'll collect messages and metadata + * @param string $domain The domain + */ + private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, $domain) + { + $xml = simplexml_import_dom($dom); + $encoding = strtoupper($dom->encoding); + + $xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:1.2'); + foreach ($xml->xpath('//xliff:trans-unit') as $translation) { + $attributes = $translation->attributes(); + + if (!(isset($attributes['resname']) || isset($translation->source))) { + continue; + } + + $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source; + // If the xlf file has another encoding specified, try to convert it because + // simple_xml will always return utf-8 encoded values + $target = $this->utf8ToCharset((string) (isset($translation->target) ? $translation->target : $source), $encoding); + + $catalogue->set((string) $source, $target, $domain); + + $metadata = array(); + if ($notes = $this->parseNotesMetadata($translation->note, $encoding)) { + $metadata['notes'] = $notes; + } + if (isset($translation->target) && $translation->target->attributes()) { + $metadata['target-attributes'] = array(); + foreach ($translation->target->attributes() as $key => $value) { + $metadata['target-attributes'][$key] = (string) $value; + } + } + + $catalogue->setMetadata((string) $source, $metadata, $domain); + } + } + + /** + * @param \DOMDocument $dom + * @param MessageCatalogue $catalogue + * @param string $domain + */ + private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, $domain) + { + $xml = simplexml_import_dom($dom); + $encoding = strtoupper($dom->encoding); + + $xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0'); + + foreach ($xml->xpath('//xliff:unit/xliff:segment') as $segment) { + $source = $segment->source; + + // If the xlf file has another encoding specified, try to convert it because + // simple_xml will always return utf-8 encoded values + $target = $this->utf8ToCharset((string) (isset($segment->target) ? $segment->target : $source), $encoding); + + $catalogue->set((string) $source, $target, $domain); + + $metadata = array(); + if (isset($segment->target) && $segment->target->attributes()) { + $metadata['target-attributes'] = array(); + foreach ($segment->target->attributes() as $key => $value) { + $metadata['target-attributes'][$key] = (string) $value; + } + } + + $catalogue->setMetadata((string) $source, $metadata, $domain); + } + } + + /** + * Convert a UTF8 string to the specified encoding. + * + * @param string $content String to decode + * @param string $encoding Target encoding + * + * @return string + */ + private function utf8ToCharset($content, $encoding = null) + { + if ('UTF-8' !== $encoding && !empty($encoding)) { + return mb_convert_encoding($content, $encoding, 'UTF-8'); + } + + return $content; + } + + /** + * Validates and parses the given file into a DOMDocument. + * + * @param string $file + * @param \DOMDocument $dom + * @param string $schema source of the schema + * + * @throws InvalidResourceException + */ + private function validateSchema($file, \DOMDocument $dom, $schema) + { + $internalErrors = libxml_use_internal_errors(true); + + $disableEntities = libxml_disable_entity_loader(false); + + if (!@$dom->schemaValidateSource($schema)) { + libxml_disable_entity_loader($disableEntities); + + throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $file, implode("\n", $this->getXmlErrors($internalErrors)))); + } + + libxml_disable_entity_loader($disableEntities); + + $dom->normalizeDocument(); + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + } + + private function getSchema($xliffVersion) + { + if ('1.2' === $xliffVersion) { + $schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd'); + $xmlUri = 'http://www.w3.org/2001/xml.xsd'; + } elseif ('2.0' === $xliffVersion) { + $schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-2.0.xsd'); + $xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd'; + } else { + throw new \InvalidArgumentException(sprintf('No support implemented for loading XLIFF version "%s".', $xliffVersion)); + } + + return $this->fixXmlLocation($schemaSource, $xmlUri); + } + + /** + * Internally changes the URI of a dependent xsd to be loaded locally. + * + * @param string $schemaSource Current content of schema file + * @param string $xmlUri External URI of XML to convert to local + * + * @return string + */ + private function fixXmlLocation($schemaSource, $xmlUri) + { + $newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd'; + $parts = explode('/', $newPath); + if (0 === stripos($newPath, 'phar://')) { + $tmpfile = tempnam(sys_get_temp_dir(), 'sf2'); + if ($tmpfile) { + copy($newPath, $tmpfile); + $parts = explode('/', str_replace('\\', '/', $tmpfile)); + } + } + $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; + $newPath = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts)); + + return str_replace($xmlUri, $newPath, $schemaSource); + } + + /** + * Returns the XML errors of the internal XML parser. + * + * @param bool $internalErrors + * + * @return array An array of errors + */ + private function getXmlErrors($internalErrors) + { + $errors = array(); + foreach (libxml_get_errors() as $error) { + $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)', + LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', + $error->code, + trim($error->message), + $error->file ?: 'n/a', + $error->line, + $error->column + ); + } + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + + return $errors; + } + + /** + * Gets xliff file version based on the root "version" attribute. + * Defaults to 1.2 for backwards compatibility. + * + * @param \DOMDocument $dom + * + * @throws \InvalidArgumentException + * + * @return string + */ + private function getVersionNumber(\DOMDocument $dom) + { + /** @var \DOMNode $xliff */ + foreach ($dom->getElementsByTagName('xliff') as $xliff) { + $version = $xliff->attributes->getNamedItem('version'); + if ($version) { + return $version->nodeValue; + } + + $namespace = $xliff->attributes->getNamedItem('xmlns'); + if ($namespace) { + if (substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34) !== 0) { + throw new \InvalidArgumentException(sprintf('Not a valid XLIFF namespace "%s"', $namespace)); + } + + return substr($namespace, 34); + } + } + + // Falls back to v1.2 + return '1.2'; + } + + /* + * @param \SimpleXMLElement|null $noteElement + * @param string|null $encoding + * + * @return array + */ + private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, $encoding = null) + { + $notes = array(); + + if (null === $noteElement) { + return $notes; + } + + foreach ($noteElement as $xmlNote) { + $noteAttributes = $xmlNote->attributes(); + $note = array('content' => $this->utf8ToCharset((string) $xmlNote, $encoding)); + if (isset($noteAttributes['priority'])) { + $note['priority'] = (int) $noteAttributes['priority']; + } + + if (isset($noteAttributes['from'])) { + $note['from'] = (string) $noteAttributes['from']; + } + + $notes[] = $note; + } + + return $notes; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/YamlFileLoader.php b/upload/system/storage/vendor/symfony/translation/Loader/YamlFileLoader.php new file mode 100644 index 00000000000..5d9a3aded1d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/YamlFileLoader.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Yaml\Parser as YamlParser; +use Symfony\Component\Yaml\Exception\ParseException; + +/** + * YamlFileLoader loads translations from Yaml files. + * + * @author Fabien Potencier + */ +class YamlFileLoader extends FileLoader +{ + private $yamlParser; + + /** + * {@inheritdoc} + */ + protected function loadResource($resource) + { + if (null === $this->yamlParser) { + if (!class_exists('Symfony\Component\Yaml\Parser')) { + throw new \LogicException('Loading translations from the YAML format requires the Symfony Yaml component.'); + } + + $this->yamlParser = new YamlParser(); + } + + try { + $messages = $this->yamlParser->parse(file_get_contents($resource)); + } catch (ParseException $e) { + throw new InvalidResourceException(sprintf('Error parsing YAML, invalid file "%s"', $resource), 0, $e); + } + + return $messages; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd b/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd new file mode 100644 index 00000000000..3ce2a8e8ab7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd @@ -0,0 +1,2223 @@ + + + + + + + + + + + + + + + Values for the attribute 'context-type'. + + + + + Indicates a database content. + + + + + Indicates the content of an element within an XML document. + + + + + Indicates the name of an element within an XML document. + + + + + Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found. + + + + + Indicates a the number of parameters contained within the <source>. + + + + + Indicates notes pertaining to the parameters in the <source>. + + + + + Indicates the content of a record within a database. + + + + + Indicates the name of a record within a database. + + + + + Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file. + + + + + + + Values for the attribute 'count-type'. + + + + + Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts. + + + + + Indicates the count units are translation units existing already in the same document. + + + + + Indicates a total count. + + + + + + + Values for the attribute 'ctype' when used other elements than <ph> or <x>. + + + + + Indicates a run of bolded text. + + + + + Indicates a run of text in italics. + + + + + Indicates a run of underlined text. + + + + + Indicates a run of hyper-text. + + + + + + + Values for the attribute 'ctype' when used with <ph> or <x>. + + + + + Indicates a inline image. + + + + + Indicates a page break. + + + + + Indicates a line break. + + + + + + + + + + + + Values for the attribute 'datatype'. + + + + + Indicates Active Server Page data. + + + + + Indicates C source file data. + + + + + Indicates Channel Definition Format (CDF) data. + + + + + Indicates ColdFusion data. + + + + + Indicates C++ source file data. + + + + + Indicates C-Sharp data. + + + + + Indicates strings from C, ASM, and driver files data. + + + + + Indicates comma-separated values data. + + + + + Indicates database data. + + + + + Indicates portions of document that follows data and contains metadata. + + + + + Indicates portions of document that precedes data and contains metadata. + + + + + Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import). + + + + + Indicates standard user input screen data. + + + + + Indicates HyperText Markup Language (HTML) data - document instance. + + + + + Indicates content within an HTML document’s <body> element. + + + + + Indicates Windows INI file data. + + + + + Indicates Interleaf data. + + + + + Indicates Java source file data (extension '.java'). + + + + + Indicates Java property resource bundle data. + + + + + Indicates Java list resource bundle data. + + + + + Indicates JavaScript source file data. + + + + + Indicates JScript source file data. + + + + + Indicates information relating to formatting. + + + + + Indicates LISP source file data. + + + + + Indicates information relating to margin formats. + + + + + Indicates a file containing menu. + + + + + Indicates numerically identified string table. + + + + + Indicates Maker Interchange Format (MIF) data. + + + + + Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute. + + + + + Indicates GNU Machine Object data. + + + + + Indicates Message Librarian strings created by Novell's Message Librarian Tool. + + + + + Indicates information to be displayed at the bottom of each page of a document. + + + + + Indicates information to be displayed at the top of each page of a document. + + + + + Indicates a list of property values (e.g., settings within INI files or preferences dialog). + + + + + Indicates Pascal source file data. + + + + + Indicates Hypertext Preprocessor data. + + + + + Indicates plain text file (no formatting other than, possibly, wrapping). + + + + + Indicates GNU Portable Object file. + + + + + Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc. + + + + + Indicates Windows .NET binary resources. + + + + + Indicates Windows .NET Resources. + + + + + Indicates Rich Text Format (RTF) data. + + + + + Indicates Standard Generalized Markup Language (SGML) data - document instance. + + + + + Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD). + + + + + Indicates Scalable Vector Graphic (SVG) data. + + + + + Indicates VisualBasic Script source file. + + + + + Indicates warning message. + + + + + Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file). + + + + + Indicates Extensible HyperText Markup Language (XHTML) data - document instance. + + + + + Indicates Extensible Markup Language (XML) data - document instance. + + + + + Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD). + + + + + Indicates Extensible Stylesheet Language (XSL) data. + + + + + Indicates XUL elements. + + + + + + + Values for the attribute 'mtype'. + + + + + Indicates the marked text is an abbreviation. + + + + + ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept. + + + + + ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective'). + + + + + ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging'). + + + + + ISO-12620: A proper-name term, such as the name of an agency or other proper entity. + + + + + ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another. + + + + + ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language. + + + + + Indicates the marked text is a date and/or time. + + + + + ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign. + + + + + ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form. + + + + + ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula. + + + + + ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record. + + + + + ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy'). + + + + + ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body. + + + + + ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages. + + + + + ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like. + + + + + ISO-12620 2.1.17: A unit to track object. + + + + + Indicates the marked text is a name. + + + + + ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others. + + + + + ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system. + + + + + Indicates the marked text is a phrase. + + + + + ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase. + + + + + Indicates the marked text should not be translated. + + + + + ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet. + + + + + Indicates that the marked text represents a segment. + + + + + ISO-12620 2.1.18.2: A fixed, lexicalized phrase. + + + + + ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs'). + + + + + ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system. + + + + + ISO-12620 2.1.19: A fixed chunk of recurring text. + + + + + ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof. + + + + + ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry. + + + + + ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language. + + + + + Indicates the marked text is a term. + + + + + ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted. + + + + + ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system. + + + + + ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza'). + + + + + ISO-12620 2.1.9: One of the alternate forms of a term. + + + + + + + Values for the attribute 'restype'. + + + + + Indicates a Windows RC AUTO3STATE control. + + + + + Indicates a Windows RC AUTOCHECKBOX control. + + + + + Indicates a Windows RC AUTORADIOBUTTON control. + + + + + Indicates a Windows RC BEDIT control. + + + + + Indicates a bitmap, for example a BITMAP resource in Windows. + + + + + Indicates a button object, for example a BUTTON control Windows. + + + + + Indicates a caption, such as the caption of a dialog box. + + + + + Indicates the cell in a table, for example the content of the <td> element in HTML. + + + + + Indicates check box object, for example a CHECKBOX control in Windows. + + + + + Indicates a menu item with an associated checkbox. + + + + + Indicates a list box, but with a check-box for each item. + + + + + Indicates a color selection dialog. + + + + + Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows. + + + + + Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234). + + + + + Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403). + + + + + Indicates a UI base class element that cannot be represented by any other element. + + + + + Indicates a context menu. + + + + + Indicates a Windows RC CTEXT control. + + + + + Indicates a cursor, for example a CURSOR resource in Windows. + + + + + Indicates a date/time picker. + + + + + Indicates a Windows RC DEFPUSHBUTTON control. + + + + + Indicates a dialog box. + + + + + Indicates a Windows RC DLGINIT resource block. + + + + + Indicates an edit box object, for example an EDIT control in Windows. + + + + + Indicates a filename. + + + + + Indicates a file dialog. + + + + + Indicates a footnote. + + + + + Indicates a font name. + + + + + Indicates a footer. + + + + + Indicates a frame object. + + + + + Indicates a XUL grid element. + + + + + Indicates a groupbox object, for example a GROUPBOX control in Windows. + + + + + Indicates a header item. + + + + + Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML. + + + + + Indicates a Windows RC HEDIT control. + + + + + Indicates a horizontal scrollbar. + + + + + Indicates an icon, for example an ICON resource in Windows. + + + + + Indicates a Windows RC IEDIT control. + + + + + Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF. + + + + + Indicates a label object. + + + + + Indicates a label that is also a HTML link (not necessarily a URL). + + + + + Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML). + + + + + Indicates a listbox object, for example an LISTBOX control in Windows. + + + + + Indicates an list item (an entry in a list). + + + + + Indicates a Windows RC LTEXT control. + + + + + Indicates a menu (a group of menu-items). + + + + + Indicates a toolbar containing one or more tope level menus. + + + + + Indicates a menu item (an entry in a menu). + + + + + Indicates a XUL menuseparator element. + + + + + Indicates a message, for example an entry in a MESSAGETABLE resource in Windows. + + + + + Indicates a calendar control. + + + + + Indicates an edit box beside a spin control. + + + + + Indicates a catch all for rectangular areas. + + + + + Indicates a standalone menu not necessarily associated with a menubar. + + + + + Indicates a pushbox object, for example a PUSHBOX control in Windows. + + + + + Indicates a Windows RC PUSHBUTTON control. + + + + + Indicates a radio button object. + + + + + Indicates a menuitem with associated radio button. + + + + + Indicates raw data resources for an application. + + + + + Indicates a row in a table. + + + + + Indicates a Windows RC RTEXT control. + + + + + Indicates a user navigable container used to show a portion of a document. + + + + + Indicates a generic divider object (e.g. menu group separator). + + + + + Windows accelerators, shortcuts in resource or property files. + + + + + Indicates a UI control to indicate process activity but not progress. + + + + + Indicates a splitter bar. + + + + + Indicates a Windows RC STATE3 control. + + + + + Indicates a window for providing feedback to the users, like 'read-only', etc. + + + + + Indicates a string, for example an entry in a STRINGTABLE resource in Windows. + + + + + Indicates a layers of controls with a tab to select layers. + + + + + Indicates a display and edits regular two-dimensional tables of cells. + + + + + Indicates a XUL textbox element. + + + + + Indicates a UI button that can be toggled to on or off state. + + + + + Indicates an array of controls, usually buttons. + + + + + Indicates a pop up tool tip text. + + + + + Indicates a bar with a pointer indicating a position within a certain range. + + + + + Indicates a control that displays a set of hierarchical data. + + + + + Indicates a URI (URN or URL). + + + + + Indicates a Windows RC USERBUTTON control. + + + + + Indicates a user-defined control like CONTROL control in Windows. + + + + + Indicates the text of a variable. + + + + + Indicates version information about a resource like VERSIONINFO in Windows. + + + + + Indicates a vertical scrollbar. + + + + + Indicates a graphical window. + + + + + + + Values for the attribute 'size-unit'. + + + + + Indicates a size in 8-bit bytes. + + + + + Indicates a size in Unicode characters. + + + + + Indicates a size in columns. Used for HTML text area. + + + + + Indicates a size in centimeters. + + + + + Indicates a size in dialog units, as defined in Windows resources. + + + + + Indicates a size in 'font-size' units (as defined in CSS). + + + + + Indicates a size in 'x-height' units (as defined in CSS). + + + + + Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster' + + + + + Indicates a size in inches. + + + + + Indicates a size in millimeters. + + + + + Indicates a size in percentage. + + + + + Indicates a size in pixels. + + + + + Indicates a size in point. + + + + + Indicates a size in rows. Used for HTML text area. + + + + + + + Values for the attribute 'state'. + + + + + Indicates the terminating state. + + + + + Indicates only non-textual information needs adaptation. + + + + + Indicates both text and non-textual information needs adaptation. + + + + + Indicates only non-textual information needs review. + + + + + Indicates both text and non-textual information needs review. + + + + + Indicates that only the text of the item needs to be reviewed. + + + + + Indicates that the item needs to be translated. + + + + + Indicates that the item is new. For example, translation units that were not in a previous version of the document. + + + + + Indicates that changes are reviewed and approved. + + + + + Indicates that the item has been translated. + + + + + + + Values for the attribute 'state-qualifier'. + + + + + Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously. + + + + + Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.). + + + + + Indicates a match based on matching IDs (in addition to matching text). + + + + + Indicates a translation derived from a glossary. + + + + + Indicates a translation derived from existing translation. + + + + + Indicates a translation derived from machine translation. + + + + + Indicates a translation derived from a translation repository. + + + + + Indicates a translation derived from a translation memory. + + + + + Indicates the translation is suggested by machine translation. + + + + + Indicates that the item has been rejected because of incorrect grammar. + + + + + Indicates that the item has been rejected because it is incorrect. + + + + + Indicates that the item has been rejected because it is too long or too short. + + + + + Indicates that the item has been rejected because of incorrect spelling. + + + + + Indicates the translation is suggested by translation memory. + + + + + + + Values for the attribute 'unit'. + + + + + Refers to words. + + + + + Refers to pages. + + + + + Refers to <trans-unit> elements. + + + + + Refers to <bin-unit> elements. + + + + + Refers to glyphs. + + + + + Refers to <trans-unit> and/or <bin-unit> elements. + + + + + Refers to the occurrences of instances defined by the count-type value. + + + + + Refers to characters. + + + + + Refers to lines. + + + + + Refers to sentences. + + + + + Refers to paragraphs. + + + + + Refers to segments. + + + + + Refers to placeables (inline elements). + + + + + + + Values for the attribute 'priority'. + + + + + Highest priority. + + + + + High priority. + + + + + High priority, but not as important as 2. + + + + + High priority, but not as important as 3. + + + + + Medium priority, but more important than 6. + + + + + Medium priority, but less important than 5. + + + + + Low priority, but more important than 8. + + + + + Low priority, but more important than 9. + + + + + Low priority. + + + + + Lowest priority. + + + + + + + + + This value indicates that all properties can be reformatted. This value must be used alone. + + + + + This value indicates that no properties should be reformatted. This value must be used alone. + + + + + + + + + + + + + This value indicates that all information in the coord attribute can be modified. + + + + + This value indicates that the x information in the coord attribute can be modified. + + + + + This value indicates that the y information in the coord attribute can be modified. + + + + + This value indicates that the cx information in the coord attribute can be modified. + + + + + This value indicates that the cy information in the coord attribute can be modified. + + + + + This value indicates that all the information in the font attribute can be modified. + + + + + This value indicates that the name information in the font attribute can be modified. + + + + + This value indicates that the size information in the font attribute can be modified. + + + + + This value indicates that the weight information in the font attribute can be modified. + + + + + This value indicates that the information in the css-style attribute can be modified. + + + + + This value indicates that the information in the style attribute can be modified. + + + + + This value indicates that the information in the exstyle attribute can be modified. + + + + + + + + + + + + + Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document. + + + + + Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed. + + + + + Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed. + + + + + + + + + Represents a translation proposal from a translation memory or other resource. + + + + + Represents a previous version of the target element. + + + + + Represents a rejected version of the target element. + + + + + Represents a translation to be used for reference purposes only, for example from a related product or a different language. + + + + + Represents a proposed translation that was used for the translation of the trans-unit, possibly modified. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Values for the attribute 'coord'. + + + + + + + + Version values: 1.0 and 1.1 are allowed for backward compatibility. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd b/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd new file mode 100644 index 00000000000..963232f9721 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd b/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd new file mode 100644 index 00000000000..a46162a7a7a --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd @@ -0,0 +1,309 @@ + + + + + + +
    +

    About the XML namespace

    + +
    +

    + + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

    +

    + See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

    + +

    + Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

    +

    + See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

    +
    +
    + +
    +
    + + + + +
    + +

    lang (as an attribute name)

    +

    + + denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

    + +
    +
    +

    Notes

    +

    + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

    +

    + + See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

    +

    + + The union allows for the 'un-declaration' of xml:lang with + the empty string. +

    +
    +
    +
    + + + + + + + + + + +
    + + + + + +
    + +

    space (as an attribute name)

    +

    + denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

    + +
    +
    +
    + + + + + + + +
    + + + + +
    + +

    base (as an attribute name)

    +

    + denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

    + +

    + See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

    + +
    +
    +
    +
    + + + + +
    + +

    id (as an attribute name)

    +

    + + denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

    + +

    + See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

    +
    +
    +
    + +
    + + + + + + + + + + + +
    + +

    Father (in any context at all)

    + +
    +

    + denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

    +
    +

    + + In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

    +
    +
    +
    +
    +
    + + + + +
    +

    About this schema document

    + +
    +

    + This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

    + +

    + To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

    +
    +          <schema.. .>
    +          .. .
    +           <import namespace="http://www.w3.org/XML/1998/namespace"
    +                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
    +     
    +

    + or +

    +
    +
    +           <import namespace="http://www.w3.org/XML/1998/namespace"
    +                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
    +     
    +

    + Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

    +
    +          <type.. .>
    +          .. .
    +           <attributeGroup ref="xml:specialAttrs"/>
    +     
    +

    + will define a type which will schema-validate an instance element + with any of those attributes. +

    + +
    +
    +
    +
    + + + +
    +

    Versioning policy for this schema document

    + +
    +

    + In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

    +

    + At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

    + +

    + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

    +

    + + Previous dated (and unchanging) versions of this schema + document are at: +

    + +
    +
    +
    +
    + +
    diff --git a/upload/system/storage/vendor/symfony/translation/LoggingTranslator.php b/upload/system/storage/vendor/symfony/translation/LoggingTranslator.php new file mode 100644 index 00000000000..fa5c5cc5b5f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/LoggingTranslator.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Psr\Log\LoggerInterface; + +/** + * @author Abdellatif Ait boudad + */ +class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface +{ + /** + * @var TranslatorInterface|TranslatorBagInterface + */ + private $translator; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface + * @param LoggerInterface $logger + */ + public function __construct(TranslatorInterface $translator, LoggerInterface $logger) + { + if (!$translator instanceof TranslatorBagInterface) { + throw new \InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator))); + } + + $this->translator = $translator; + $this->logger = $logger; + } + + /** + * {@inheritdoc} + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null) + { + $trans = $this->translator->trans($id, $parameters, $domain, $locale); + $this->log($id, $domain, $locale); + + return $trans; + } + + /** + * {@inheritdoc} + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + { + $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale); + $this->log($id, $domain, $locale); + + return $trans; + } + + /** + * {@inheritdoc} + */ + public function setLocale($locale) + { + $this->translator->setLocale($locale); + } + + /** + * {@inheritdoc} + */ + public function getLocale() + { + return $this->translator->getLocale(); + } + + /** + * {@inheritdoc} + */ + public function getCatalogue($locale = null) + { + return $this->translator->getCatalogue($locale); + } + + /** + * Passes through all unknown calls onto the translator object. + */ + public function __call($method, $args) + { + return call_user_func_array(array($this->translator, $method), $args); + } + + /** + * Logs for missing translations. + * + * @param string $id + * @param string|null $domain + * @param string|null $locale + */ + private function log($id, $domain, $locale) + { + if (null === $domain) { + $domain = 'messages'; + } + + $id = (string) $id; + $catalogue = $this->translator->getCatalogue($locale); + if ($catalogue->defines($id, $domain)) { + return; + } + + if ($catalogue->has($id, $domain)) { + $this->logger->debug('Translation use fallback catalogue.', array('id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale())); + } else { + $this->logger->warning('Translation not found.', array('id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale())); + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/MessageCatalogue.php b/upload/system/storage/vendor/symfony/translation/MessageCatalogue.php new file mode 100644 index 00000000000..dd354a85aae --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/MessageCatalogue.php @@ -0,0 +1,270 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Config\Resource\ResourceInterface; + +/** + * MessageCatalogue. + * + * @author Fabien Potencier + */ +class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface +{ + private $messages = array(); + private $metadata = array(); + private $resources = array(); + private $locale; + private $fallbackCatalogue; + private $parent; + + /** + * Constructor. + * + * @param string $locale The locale + * @param array $messages An array of messages classified by domain + */ + public function __construct($locale, array $messages = array()) + { + $this->locale = $locale; + $this->messages = $messages; + } + + /** + * {@inheritdoc} + */ + public function getLocale() + { + return $this->locale; + } + + /** + * {@inheritdoc} + */ + public function getDomains() + { + return array_keys($this->messages); + } + + /** + * {@inheritdoc} + */ + public function all($domain = null) + { + if (null === $domain) { + return $this->messages; + } + + return isset($this->messages[$domain]) ? $this->messages[$domain] : array(); + } + + /** + * {@inheritdoc} + */ + public function set($id, $translation, $domain = 'messages') + { + $this->add(array($id => $translation), $domain); + } + + /** + * {@inheritdoc} + */ + public function has($id, $domain = 'messages') + { + if (isset($this->messages[$domain][$id])) { + return true; + } + + if (null !== $this->fallbackCatalogue) { + return $this->fallbackCatalogue->has($id, $domain); + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function defines($id, $domain = 'messages') + { + return isset($this->messages[$domain][$id]); + } + + /** + * {@inheritdoc} + */ + public function get($id, $domain = 'messages') + { + if (isset($this->messages[$domain][$id])) { + return $this->messages[$domain][$id]; + } + + if (null !== $this->fallbackCatalogue) { + return $this->fallbackCatalogue->get($id, $domain); + } + + return $id; + } + + /** + * {@inheritdoc} + */ + public function replace($messages, $domain = 'messages') + { + $this->messages[$domain] = array(); + + $this->add($messages, $domain); + } + + /** + * {@inheritdoc} + */ + public function add($messages, $domain = 'messages') + { + if (!isset($this->messages[$domain])) { + $this->messages[$domain] = $messages; + } else { + $this->messages[$domain] = array_replace($this->messages[$domain], $messages); + } + } + + /** + * {@inheritdoc} + */ + public function addCatalogue(MessageCatalogueInterface $catalogue) + { + if ($catalogue->getLocale() !== $this->locale) { + throw new \LogicException(sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s"', $catalogue->getLocale(), $this->locale)); + } + + foreach ($catalogue->all() as $domain => $messages) { + $this->add($messages, $domain); + } + + foreach ($catalogue->getResources() as $resource) { + $this->addResource($resource); + } + + if ($catalogue instanceof MetadataAwareInterface) { + $metadata = $catalogue->getMetadata('', ''); + $this->addMetadata($metadata); + } + } + + /** + * {@inheritdoc} + */ + public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) + { + // detect circular references + $c = $catalogue; + while ($c = $c->getFallbackCatalogue()) { + if ($c->getLocale() === $this->getLocale()) { + throw new \LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); + } + } + + $c = $this; + do { + if ($c->getLocale() === $catalogue->getLocale()) { + throw new \LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); + } + } while ($c = $c->parent); + + $catalogue->parent = $this; + $this->fallbackCatalogue = $catalogue; + + foreach ($catalogue->getResources() as $resource) { + $this->addResource($resource); + } + } + + /** + * {@inheritdoc} + */ + public function getFallbackCatalogue() + { + return $this->fallbackCatalogue; + } + + /** + * {@inheritdoc} + */ + public function getResources() + { + return array_values($this->resources); + } + + /** + * {@inheritdoc} + */ + public function addResource(ResourceInterface $resource) + { + $this->resources[$resource->__toString()] = $resource; + } + + /** + * {@inheritdoc} + */ + public function getMetadata($key = '', $domain = 'messages') + { + if ('' == $domain) { + return $this->metadata; + } + + if (isset($this->metadata[$domain])) { + if ('' == $key) { + return $this->metadata[$domain]; + } + + if (isset($this->metadata[$domain][$key])) { + return $this->metadata[$domain][$key]; + } + } + } + + /** + * {@inheritdoc} + */ + public function setMetadata($key, $value, $domain = 'messages') + { + $this->metadata[$domain][$key] = $value; + } + + /** + * {@inheritdoc} + */ + public function deleteMetadata($key = '', $domain = 'messages') + { + if ('' == $domain) { + $this->metadata = array(); + } elseif ('' == $key) { + unset($this->metadata[$domain]); + } else { + unset($this->metadata[$domain][$key]); + } + } + + /** + * Adds current values with the new values. + * + * @param array $values Values to add + */ + private function addMetadata(array $values) + { + foreach ($values as $domain => $keys) { + foreach ($keys as $key => $value) { + $this->setMetadata($key, $value, $domain); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/MessageCatalogueInterface.php b/upload/system/storage/vendor/symfony/translation/MessageCatalogueInterface.php new file mode 100644 index 00000000000..b1b516dc289 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/MessageCatalogueInterface.php @@ -0,0 +1,142 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Config\Resource\ResourceInterface; + +/** + * MessageCatalogueInterface. + * + * @author Fabien Potencier + */ +interface MessageCatalogueInterface +{ + /** + * Gets the catalogue locale. + * + * @return string The locale + */ + public function getLocale(); + + /** + * Gets the domains. + * + * @return array An array of domains + */ + public function getDomains(); + + /** + * Gets the messages within a given domain. + * + * If $domain is null, it returns all messages. + * + * @param string $domain The domain name + * + * @return array An array of messages + */ + public function all($domain = null); + + /** + * Sets a message translation. + * + * @param string $id The message id + * @param string $translation The messages translation + * @param string $domain The domain name + */ + public function set($id, $translation, $domain = 'messages'); + + /** + * Checks if a message has a translation. + * + * @param string $id The message id + * @param string $domain The domain name + * + * @return bool true if the message has a translation, false otherwise + */ + public function has($id, $domain = 'messages'); + + /** + * Checks if a message has a translation (it does not take into account the fallback mechanism). + * + * @param string $id The message id + * @param string $domain The domain name + * + * @return bool true if the message has a translation, false otherwise + */ + public function defines($id, $domain = 'messages'); + + /** + * Gets a message translation. + * + * @param string $id The message id + * @param string $domain The domain name + * + * @return string The message translation + */ + public function get($id, $domain = 'messages'); + + /** + * Sets translations for a given domain. + * + * @param array $messages An array of translations + * @param string $domain The domain name + */ + public function replace($messages, $domain = 'messages'); + + /** + * Adds translations for a given domain. + * + * @param array $messages An array of translations + * @param string $domain The domain name + */ + public function add($messages, $domain = 'messages'); + + /** + * Merges translations from the given Catalogue into the current one. + * + * The two catalogues must have the same locale. + * + * @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance + */ + public function addCatalogue(MessageCatalogueInterface $catalogue); + + /** + * Merges translations from the given Catalogue into the current one + * only when the translation does not exist. + * + * This is used to provide default translations when they do not exist for the current locale. + * + * @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance + */ + public function addFallbackCatalogue(MessageCatalogueInterface $catalogue); + + /** + * Gets the fallback catalogue. + * + * @return MessageCatalogueInterface|null A MessageCatalogueInterface instance or null when no fallback has been set + */ + public function getFallbackCatalogue(); + + /** + * Returns an array of resources loaded to build this collection. + * + * @return ResourceInterface[] An array of resources + */ + public function getResources(); + + /** + * Adds a resource for this collection. + * + * @param ResourceInterface $resource A resource instance + */ + public function addResource(ResourceInterface $resource); +} diff --git a/upload/system/storage/vendor/symfony/translation/MessageSelector.php b/upload/system/storage/vendor/symfony/translation/MessageSelector.php new file mode 100644 index 00000000000..bdbb0f965ff --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/MessageSelector.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * MessageSelector. + * + * @author Fabien Potencier + * @author Bernhard Schussek + */ +class MessageSelector +{ + /** + * Given a message with different plural translations separated by a + * pipe (|), this method returns the correct portion of the message based + * on the given number, locale and the pluralization rules in the message + * itself. + * + * The message supports two different types of pluralization rules: + * + * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples + * indexed: There is one apple|There are %count% apples + * + * The indexed solution can also contain labels (e.g. one: There is one apple). + * This is purely for making the translations more clear - it does not + * affect the functionality. + * + * The two methods can also be mixed: + * {0} There are no apples|one: There is one apple|more: There are %count% apples + * + * @param string $message The message being translated + * @param int $number The number of items represented for the message + * @param string $locale The locale to use for choosing + * + * @return string + * + * @throws \InvalidArgumentException + */ + public function choose($message, $number, $locale) + { + $parts = explode('|', $message); + $explicitRules = array(); + $standardRules = array(); + foreach ($parts as $part) { + $part = trim($part); + + if (preg_match('/^(?P'.Interval::getIntervalRegexp().')\s*(?P.*?)$/xs', $part, $matches)) { + $explicitRules[$matches['interval']] = $matches['message']; + } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) { + $standardRules[] = $matches[1]; + } else { + $standardRules[] = $part; + } + } + + // try to match an explicit rule, then fallback to the standard ones + foreach ($explicitRules as $interval => $m) { + if (Interval::test($number, $interval)) { + return $m; + } + } + + $position = PluralizationRules::get($number, $locale); + + if (!isset($standardRules[$position])) { + // when there's exactly one rule given, and that rule is a standard + // rule, use this rule + if (1 === count($parts) && isset($standardRules[0])) { + return $standardRules[0]; + } + + throw new \InvalidArgumentException(sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $message, $locale, $number)); + } + + return $standardRules[$position]; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/MetadataAwareInterface.php b/upload/system/storage/vendor/symfony/translation/MetadataAwareInterface.php new file mode 100644 index 00000000000..e93c6fbc713 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/MetadataAwareInterface.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * MetadataAwareInterface. + * + * @author Fabien Potencier + */ +interface MetadataAwareInterface +{ + /** + * Gets metadata for the given domain and key. + * + * Passing an empty domain will return an array with all metadata indexed by + * domain and then by key. Passing an empty key will return an array with all + * metadata for the given domain. + * + * @param string $key The key + * @param string $domain The domain name + * + * @return mixed The value that was set or an array with the domains/keys or null + */ + public function getMetadata($key = '', $domain = 'messages'); + + /** + * Adds metadata to a message domain. + * + * @param string $key The key + * @param mixed $value The value + * @param string $domain The domain name + */ + public function setMetadata($key, $value, $domain = 'messages'); + + /** + * Deletes metadata for the given key and domain. + * + * Passing an empty domain will delete all metadata. Passing an empty key will + * delete all metadata for the given domain. + * + * @param string $key The key + * @param string $domain The domain name + */ + public function deleteMetadata($key = '', $domain = 'messages'); +} diff --git a/upload/system/storage/vendor/symfony/translation/PluralizationRules.php b/upload/system/storage/vendor/symfony/translation/PluralizationRules.php new file mode 100644 index 00000000000..ef2be709771 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/PluralizationRules.php @@ -0,0 +1,209 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * Returns the plural rules for a given locale. + * + * @author Fabien Potencier + */ +class PluralizationRules +{ + private static $rules = array(); + + /** + * Returns the plural position to use for the given locale and number. + * + * @param int $number The number + * @param string $locale The locale + * + * @return int The plural position + */ + public static function get($number, $locale) + { + if ('pt_BR' === $locale) { + // temporary set a locale for brazilian + $locale = 'xbr'; + } + + if (strlen($locale) > 3) { + $locale = substr($locale, 0, -strlen(strrchr($locale, '_'))); + } + + if (isset(self::$rules[$locale])) { + $return = call_user_func(self::$rules[$locale], $number); + + if (!is_int($return) || $return < 0) { + return 0; + } + + return $return; + } + + /* + * The plural rules are derived from code of the Zend Framework (2010-09-25), + * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). + * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + */ + switch ($locale) { + case 'az': + case 'bo': + case 'dz': + case 'id': + case 'ja': + case 'jv': + case 'ka': + case 'km': + case 'kn': + case 'ko': + case 'ms': + case 'th': + case 'tr': + case 'vi': + case 'zh': + return 0; + break; + + case 'af': + case 'bn': + case 'bg': + case 'ca': + case 'da': + case 'de': + case 'el': + case 'en': + case 'eo': + case 'es': + case 'et': + case 'eu': + case 'fa': + case 'fi': + case 'fo': + case 'fur': + case 'fy': + case 'gl': + case 'gu': + case 'ha': + case 'he': + case 'hu': + case 'is': + case 'it': + case 'ku': + case 'lb': + case 'ml': + case 'mn': + case 'mr': + case 'nah': + case 'nb': + case 'ne': + case 'nl': + case 'nn': + case 'no': + case 'om': + case 'or': + case 'pa': + case 'pap': + case 'ps': + case 'pt': + case 'so': + case 'sq': + case 'sv': + case 'sw': + case 'ta': + case 'te': + case 'tk': + case 'ur': + case 'zu': + return ($number == 1) ? 0 : 1; + + case 'am': + case 'bh': + case 'fil': + case 'fr': + case 'gun': + case 'hi': + case 'hy': + case 'ln': + case 'mg': + case 'nso': + case 'xbr': + case 'ti': + case 'wa': + return (($number == 0) || ($number == 1)) ? 0 : 1; + + case 'be': + case 'bs': + case 'hr': + case 'ru': + case 'sr': + case 'uk': + return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); + + case 'cs': + case 'sk': + return ($number == 1) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); + + case 'ga': + return ($number == 1) ? 0 : (($number == 2) ? 1 : 2); + + case 'lt': + return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); + + case 'sl': + return ($number % 100 == 1) ? 0 : (($number % 100 == 2) ? 1 : ((($number % 100 == 3) || ($number % 100 == 4)) ? 2 : 3)); + + case 'mk': + return ($number % 10 == 1) ? 0 : 1; + + case 'mt': + return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); + + case 'lv': + return ($number == 0) ? 0 : ((($number % 10 == 1) && ($number % 100 != 11)) ? 1 : 2); + + case 'pl': + return ($number == 1) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); + + case 'cy': + return ($number == 1) ? 0 : (($number == 2) ? 1 : ((($number == 8) || ($number == 11)) ? 2 : 3)); + + case 'ro': + return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); + + case 'ar': + return ($number == 0) ? 0 : (($number == 1) ? 1 : (($number == 2) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))); + + default: + return 0; + } + } + + /** + * Overrides the default plural rule for a given locale. + * + * @param callable $rule A PHP callable + * @param string $locale The locale + */ + public static function set(callable $rule, $locale) + { + if ('pt_BR' === $locale) { + // temporary set a locale for brazilian + $locale = 'xbr'; + } + + if (strlen($locale) > 3) { + $locale = substr($locale, 0, -strlen(strrchr($locale, '_'))); + } + + self::$rules[$locale] = $rule; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/README.md b/upload/system/storage/vendor/symfony/translation/README.md new file mode 100644 index 00000000000..46f3d1f2f25 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/README.md @@ -0,0 +1,13 @@ +Translation Component +===================== + +The Translation component provides tools to internationalize your application. + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/translation/index.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/AbstractOperationTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/AbstractOperationTest.php new file mode 100644 index 00000000000..30c21afa64c --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/AbstractOperationTest.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Catalogue; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\MessageCatalogueInterface; + +abstract class AbstractOperationTest extends \PHPUnit_Framework_TestCase +{ + public function testGetEmptyDomains() + { + $this->assertEquals( + array(), + $this->createOperation( + new MessageCatalogue('en'), + new MessageCatalogue('en') + )->getDomains() + ); + } + + public function testGetMergedDomains() + { + $this->assertEquals( + array('a', 'b', 'c'), + $this->createOperation( + new MessageCatalogue('en', array('a' => array(), 'b' => array())), + new MessageCatalogue('en', array('b' => array(), 'c' => array())) + )->getDomains() + ); + } + + public function testGetMessagesFromUnknownDomain() + { + $this->setExpectedException('InvalidArgumentException'); + $this->createOperation( + new MessageCatalogue('en'), + new MessageCatalogue('en') + )->getMessages('domain'); + } + + public function testGetEmptyMessages() + { + $this->assertEquals( + array(), + $this->createOperation( + new MessageCatalogue('en', array('a' => array())), + new MessageCatalogue('en') + )->getMessages('a') + ); + } + + public function testGetEmptyResult() + { + $this->assertEquals( + new MessageCatalogue('en'), + $this->createOperation( + new MessageCatalogue('en'), + new MessageCatalogue('en') + )->getResult() + ); + } + + abstract protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target); +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php new file mode 100644 index 00000000000..8b51c15daec --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Catalogue; + +use Symfony\Component\Translation\Catalogue\MergeOperation; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\MessageCatalogueInterface; + +class MergeOperationTest extends AbstractOperationTest +{ + public function testGetMessagesFromSingleDomain() + { + $operation = $this->createOperation( + new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), + new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) + ); + + $this->assertEquals( + array('a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c'), + $operation->getMessages('messages') + ); + + $this->assertEquals( + array('c' => 'new_c'), + $operation->getNewMessages('messages') + ); + + $this->assertEquals( + array(), + $operation->getObsoleteMessages('messages') + ); + } + + public function testGetResultFromSingleDomain() + { + $this->assertEquals( + new MessageCatalogue('en', array( + 'messages' => array('a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c'), + )), + $this->createOperation( + new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), + new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) + )->getResult() + ); + } + + public function testGetResultWithMetadata() + { + $leftCatalogue = new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))); + $leftCatalogue->setMetadata('a', 'foo', 'messages'); + $leftCatalogue->setMetadata('b', 'bar', 'messages'); + $rightCatalogue = new MessageCatalogue('en', array('messages' => array('b' => 'new_b', 'c' => 'new_c'))); + $rightCatalogue->setMetadata('b', 'baz', 'messages'); + $rightCatalogue->setMetadata('c', 'qux', 'messages'); + + $mergedCatalogue = new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c'))); + $mergedCatalogue->setMetadata('a', 'foo', 'messages'); + $mergedCatalogue->setMetadata('b', 'bar', 'messages'); + $mergedCatalogue->setMetadata('c', 'qux', 'messages'); + + $this->assertEquals( + $mergedCatalogue, + $this->createOperation( + $leftCatalogue, + $rightCatalogue + )->getResult() + ); + } + + protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target) + { + return new MergeOperation($source, $target); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php new file mode 100644 index 00000000000..271d17fb8f3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Catalogue; + +use Symfony\Component\Translation\Catalogue\TargetOperation; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\MessageCatalogueInterface; + +class TargetOperationTest extends AbstractOperationTest +{ + public function testGetMessagesFromSingleDomain() + { + $operation = $this->createOperation( + new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), + new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) + ); + + $this->assertEquals( + array('a' => 'old_a', 'c' => 'new_c'), + $operation->getMessages('messages') + ); + + $this->assertEquals( + array('c' => 'new_c'), + $operation->getNewMessages('messages') + ); + + $this->assertEquals( + array('b' => 'old_b'), + $operation->getObsoleteMessages('messages') + ); + } + + public function testGetResultFromSingleDomain() + { + $this->assertEquals( + new MessageCatalogue('en', array( + 'messages' => array('a' => 'old_a', 'c' => 'new_c'), + )), + $this->createOperation( + new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), + new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) + )->getResult() + ); + } + + public function testGetResultWithMetadata() + { + $leftCatalogue = new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))); + $leftCatalogue->setMetadata('a', 'foo', 'messages'); + $leftCatalogue->setMetadata('b', 'bar', 'messages'); + $rightCatalogue = new MessageCatalogue('en', array('messages' => array('b' => 'new_b', 'c' => 'new_c'))); + $rightCatalogue->setMetadata('b', 'baz', 'messages'); + $rightCatalogue->setMetadata('c', 'qux', 'messages'); + + $diffCatalogue = new MessageCatalogue('en', array('messages' => array('b' => 'old_b', 'c' => 'new_c'))); + $diffCatalogue->setMetadata('b', 'bar', 'messages'); + $diffCatalogue->setMetadata('c', 'qux', 'messages'); + + $this->assertEquals( + $diffCatalogue, + $this->createOperation( + $leftCatalogue, + $rightCatalogue + )->getResult() + ); + } + + protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target) + { + return new TargetOperation($source, $target); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/DataCollector/TranslationDataCollectorTest.php b/upload/system/storage/vendor/symfony/translation/Tests/DataCollector/TranslationDataCollectorTest.php new file mode 100644 index 00000000000..3d1e86e22cb --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/DataCollector/TranslationDataCollectorTest.php @@ -0,0 +1,148 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\DataCollector; + +use Symfony\Component\Translation\DataCollectorTranslator; +use Symfony\Component\Translation\DataCollector\TranslationDataCollector; + +class TranslationDataCollectorTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\HttpKernel\DataCollector\DataCollector')) { + $this->markTestSkipped('The "DataCollector" is not available'); + } + } + + public function testCollectEmptyMessages() + { + $translator = $this->getTranslator(); + $translator->expects($this->any())->method('getCollectedMessages')->will($this->returnValue(array())); + + $dataCollector = new TranslationDataCollector($translator); + $dataCollector->lateCollect(); + + $this->assertEquals(0, $dataCollector->getCountMissings()); + $this->assertEquals(0, $dataCollector->getCountFallbacks()); + $this->assertEquals(0, $dataCollector->getCountDefines()); + $this->assertEquals(array(), $dataCollector->getMessages()); + } + + public function testCollect() + { + $collectedMessages = array( + array( + 'id' => 'foo', + 'translation' => 'foo (en)', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_DEFINED, + 'parameters' => array(), + 'transChoiceNumber' => null, + ), + array( + 'id' => 'bar', + 'translation' => 'bar (fr)', + 'locale' => 'fr', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK, + 'parameters' => array(), + 'transChoiceNumber' => null, + ), + array( + 'id' => 'choice', + 'translation' => 'choice', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_MISSING, + 'parameters' => array('%count%' => 3), + 'transChoiceNumber' => 3, + ), + array( + 'id' => 'choice', + 'translation' => 'choice', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_MISSING, + 'parameters' => array('%count%' => 3), + 'transChoiceNumber' => 3, + ), + array( + 'id' => 'choice', + 'translation' => 'choice', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_MISSING, + 'parameters' => array('%count%' => 4, '%foo%' => 'bar'), + 'transChoiceNumber' => 4, + ), + ); + $expectedMessages = array( + array( + 'id' => 'foo', + 'translation' => 'foo (en)', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_DEFINED, + 'count' => 1, + 'parameters' => array(), + 'transChoiceNumber' => null, + ), + array( + 'id' => 'bar', + 'translation' => 'bar (fr)', + 'locale' => 'fr', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK, + 'count' => 1, + 'parameters' => array(), + 'transChoiceNumber' => null, + ), + array( + 'id' => 'choice', + 'translation' => 'choice', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_MISSING, + 'count' => 3, + 'parameters' => array( + array('%count%' => 3), + array('%count%' => 3), + array('%count%' => 4, '%foo%' => 'bar'), + ), + 'transChoiceNumber' => 3, + ), + ); + + $translator = $this->getTranslator(); + $translator->expects($this->any())->method('getCollectedMessages')->will($this->returnValue($collectedMessages)); + + $dataCollector = new TranslationDataCollector($translator); + $dataCollector->lateCollect(); + + $this->assertEquals(1, $dataCollector->getCountMissings()); + $this->assertEquals(1, $dataCollector->getCountFallbacks()); + $this->assertEquals(1, $dataCollector->getCountDefines()); + $this->assertEquals($expectedMessages, array_values($dataCollector->getMessages())); + } + + private function getTranslator() + { + $translator = $this + ->getMockBuilder('Symfony\Component\Translation\DataCollectorTranslator') + ->disableOriginalConstructor() + ->getMock() + ; + + return $translator; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php b/upload/system/storage/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php new file mode 100644 index 00000000000..5ef81712f41 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Translation\Translator; +use Symfony\Component\Translation\DataCollectorTranslator; +use Symfony\Component\Translation\Loader\ArrayLoader; + +class DataCollectorTranslatorTest extends \PHPUnit_Framework_TestCase +{ + public function testCollectMessages() + { + $collector = $this->createCollector(); + $collector->setFallbackLocales(array('fr', 'ru')); + + $collector->trans('foo'); + $collector->trans('bar'); + $collector->transChoice('choice', 0); + $collector->trans('bar_ru'); + $collector->trans('bar_ru', array('foo' => 'bar')); + + $expectedMessages = array(); + $expectedMessages[] = array( + 'id' => 'foo', + 'translation' => 'foo (en)', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_DEFINED, + 'parameters' => array(), + 'transChoiceNumber' => null, + ); + $expectedMessages[] = array( + 'id' => 'bar', + 'translation' => 'bar (fr)', + 'locale' => 'fr', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK, + 'parameters' => array(), + 'transChoiceNumber' => null, + ); + $expectedMessages[] = array( + 'id' => 'choice', + 'translation' => 'choice', + 'locale' => 'en', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_MISSING, + 'parameters' => array(), + 'transChoiceNumber' => 0, + ); + $expectedMessages[] = array( + 'id' => 'bar_ru', + 'translation' => 'bar (ru)', + 'locale' => 'ru', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK, + 'parameters' => array(), + 'transChoiceNumber' => null, + ); + $expectedMessages[] = array( + 'id' => 'bar_ru', + 'translation' => 'bar (ru)', + 'locale' => 'ru', + 'domain' => 'messages', + 'state' => DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK, + 'parameters' => array('foo' => 'bar'), + 'transChoiceNumber' => null, + ); + + $this->assertEquals($expectedMessages, $collector->getCollectedMessages()); + } + + private function createCollector() + { + $translator = new Translator('en'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foo (en)'), 'en'); + $translator->addResource('array', array('bar' => 'bar (fr)'), 'fr'); + $translator->addResource('array', array('bar_ru' => 'bar (ru)'), 'ru'); + + $collector = new DataCollectorTranslator($translator); + + return $collector; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php new file mode 100644 index 00000000000..961319208bf --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\CsvFileDumper; + +class CsvFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar', 'bar' => 'foo +foo', 'foo;foo' => 'bar')); + + $dumper = new CsvFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/valid.csv', $dumper->formatCatalogue($catalogue, 'messages')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php new file mode 100644 index 00000000000..ed58546dd3f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\FileDumper; + +class FileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testDump() + { + $tempDir = sys_get_temp_dir(); + + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new ConcreteFileDumper(); + $dumper->dump($catalogue, array('path' => $tempDir)); + + $this->assertTrue(file_exists($tempDir.'/messages.en.concrete')); + } + + public function testDumpBackupsFileIfExisting() + { + $tempDir = sys_get_temp_dir(); + $file = $tempDir.'/messages.en.concrete'; + $backupFile = $file.'~'; + + @touch($file); + + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new ConcreteFileDumper(); + $dumper->dump($catalogue, array('path' => $tempDir)); + + $this->assertTrue(file_exists($backupFile)); + + @unlink($file); + @unlink($backupFile); + } + + public function testDumpCreatesNestedDirectoriesAndFile() + { + $tempDir = sys_get_temp_dir(); + $translationsDir = $tempDir.'/test/translations'; + $file = $translationsDir.'/messages.en.concrete'; + + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new ConcreteFileDumper(); + $dumper->setRelativePathTemplate('test/translations/%domain%.%locale%.%extension%'); + $dumper->dump($catalogue, array('path' => $tempDir)); + + $this->assertTrue(file_exists($file)); + + @unlink($file); + @rmdir($translationsDir); + } +} + +class ConcreteFileDumper extends FileDumper +{ + public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) + { + return ''; + } + + protected function getExtension() + { + return 'concrete'; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/IcuResFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/IcuResFileDumperTest.php new file mode 100644 index 00000000000..618783c04cc --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/IcuResFileDumperTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\IcuResFileDumper; + +class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new IcuResFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resourcebundle/res/en.res', $dumper->formatCatalogue($catalogue, 'messages')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/IniFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/IniFileDumperTest.php new file mode 100644 index 00000000000..d8ae4b5b9f9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/IniFileDumperTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\IniFileDumper; + +class IniFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new IniFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.ini', $dumper->formatCatalogue($catalogue, 'messages')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/JsonFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/JsonFileDumperTest.php new file mode 100644 index 00000000000..27e9f4df55d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/JsonFileDumperTest.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\JsonFileDumper; + +class JsonFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new JsonFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.json', $dumper->formatCatalogue($catalogue, 'messages')); + } + + public function testDumpWithCustomEncoding() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => '"bar"')); + + $dumper = new JsonFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.dump.json', $dumper->formatCatalogue($catalogue, 'messages', array('json_encoding' => JSON_HEX_QUOT))); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/MoFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/MoFileDumperTest.php new file mode 100644 index 00000000000..c47656c831e --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/MoFileDumperTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\MoFileDumper; + +class MoFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new MoFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.mo', $dumper->formatCatalogue($catalogue, 'messages')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/PhpFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/PhpFileDumperTest.php new file mode 100644 index 00000000000..d24cd2b95be --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/PhpFileDumperTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\PhpFileDumper; + +class PhpFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new PhpFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.php', $dumper->formatCatalogue($catalogue, 'messages')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/PoFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/PoFileDumperTest.php new file mode 100644 index 00000000000..445961afe90 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/PoFileDumperTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\PoFileDumper; + +class PoFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new PoFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.po', $dumper->formatCatalogue($catalogue, 'messages')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/QtFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/QtFileDumperTest.php new file mode 100644 index 00000000000..690a4d0bf66 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/QtFileDumperTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\QtFileDumper; + +class QtFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add(array('foo' => 'bar'), 'resources'); + + $dumper = new QtFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/resources.ts', $dumper->formatCatalogue($catalogue, 'resources')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/XliffFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/XliffFileDumperTest.php new file mode 100644 index 00000000000..072b605d777 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/XliffFileDumperTest.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\XliffFileDumper; + +class XliffFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testFormatCatalogue() + { + $catalogue = new MessageCatalogue('en_US'); + $catalogue->add(array( + 'foo' => 'bar', + 'key' => '', + 'key.with.cdata' => ' & ', + )); + $catalogue->setMetadata('foo', array('notes' => array(array('priority' => 1, 'from' => 'bar', 'content' => 'baz')))); + $catalogue->setMetadata('key', array('notes' => array(array('content' => 'baz'), array('content' => 'qux')))); + + $dumper = new XliffFileDumper(); + + $this->assertStringEqualsFile( + __DIR__.'/../fixtures/resources-clean.xlf', + $dumper->formatCatalogue($catalogue, 'messages', array('default_locale' => 'fr_FR')) + ); + } + + public function testFormatCatalogueXliff2() + { + $catalogue = new MessageCatalogue('en_US'); + $catalogue->add(array( + 'foo' => 'bar', + 'key' => '', + 'key.with.cdata' => ' & ', + )); + $catalogue->setMetadata('key', array('target-attributes' => array('order' => 1))); + + $dumper = new XliffFileDumper(); + + $this->assertStringEqualsFile( + __DIR__.'/../fixtures/resources-2.0-clean.xlf', + $dumper->formatCatalogue($catalogue, 'messages', array('default_locale' => 'fr_FR', 'xliff_version' => '2.0')) + ); + } + + public function testFormatCatalogueWithCustomToolInfo() + { + $options = array( + 'default_locale' => 'en_US', + 'tool_info' => array('tool-id' => 'foo', 'tool-name' => 'foo', 'tool-version' => '0.0', 'tool-company' => 'Foo'), + ); + + $catalogue = new MessageCatalogue('en_US'); + $catalogue->add(array('foo' => 'bar')); + + $dumper = new XliffFileDumper(); + + $this->assertStringEqualsFile( + __DIR__.'/../fixtures/resources-tool-info.xlf', + $dumper->formatCatalogue($catalogue, 'messages', $options) + ); + } + + public function testFormatCatalogueWithTargetAttributesMetadata() + { + $catalogue = new MessageCatalogue('en_US'); + $catalogue->add(array( + 'foo' => 'bar', + )); + $catalogue->setMetadata('foo', array('target-attributes' => array('state' => 'needs-translation'))); + + $dumper = new XliffFileDumper(); + + $this->assertStringEqualsFile( + __DIR__.'/../fixtures/resources-target-attributes.xlf', + $dumper->formatCatalogue($catalogue, 'messages', array('default_locale' => 'fr_FR')) + ); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php new file mode 100644 index 00000000000..d6bb477185a --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\YamlFileDumper; + +class YamlFileDumperTest extends \PHPUnit_Framework_TestCase +{ + public function testTreeFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add( + array( + 'foo.bar1' => 'value1', + 'foo.bar2' => 'value2', + )); + + $dumper = new YamlFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/messages.yml', $dumper->formatCatalogue($catalogue, 'messages', array('as_tree' => true, 'inline' => 999))); + } + + public function testLinearFormatCatalogue() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->add( + array( + 'foo.bar1' => 'value1', + 'foo.bar2' => 'value2', + )); + + $dumper = new YamlFileDumper(); + + $this->assertStringEqualsFile(__DIR__.'/../fixtures/messages_linear.yml', $dumper->formatCatalogue($catalogue, 'messages')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/IdentityTranslatorTest.php b/upload/system/storage/vendor/symfony/translation/Tests/IdentityTranslatorTest.php new file mode 100644 index 00000000000..352dd318dc7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/IdentityTranslatorTest.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Intl\Util\IntlTestHelper; +use Symfony\Component\Translation\IdentityTranslator; + +class IdentityTranslatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getTransTests + */ + public function testTrans($expected, $id, $parameters) + { + $translator = new IdentityTranslator(); + + $this->assertEquals($expected, $translator->trans($id, $parameters)); + } + + /** + * @dataProvider getTransChoiceTests + */ + public function testTransChoiceWithExplicitLocale($expected, $id, $number, $parameters) + { + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $this->assertEquals($expected, $translator->transChoice($id, $number, $parameters)); + } + + /** + * @dataProvider getTransChoiceTests + */ + public function testTransChoiceWithDefaultLocale($expected, $id, $number, $parameters) + { + \Locale::setDefault('en'); + + $translator = new IdentityTranslator(); + + $this->assertEquals($expected, $translator->transChoice($id, $number, $parameters)); + } + + public function testGetSetLocale() + { + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $this->assertEquals('en', $translator->getLocale()); + } + + public function testGetLocaleReturnsDefaultLocaleIfNotSet() + { + // in order to test with "pt_BR" + IntlTestHelper::requireFullIntl($this); + + $translator = new IdentityTranslator(); + + \Locale::setDefault('en'); + $this->assertEquals('en', $translator->getLocale()); + + \Locale::setDefault('pt_BR'); + $this->assertEquals('pt_BR', $translator->getLocale()); + } + + public function getTransTests() + { + return array( + array('Symfony is great!', 'Symfony is great!', array()), + array('Symfony is awesome!', 'Symfony is %what%!', array('%what%' => 'awesome')), + ); + } + + public function getTransChoiceTests() + { + return array( + array('There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0, array('%count%' => 0)), + array('There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1, array('%count%' => 1)), + array('There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10, array('%count%' => 10)), + array('There are 0 apples', 'There is 1 apple|There are %count% apples', 0, array('%count%' => 0)), + array('There is 1 apple', 'There is 1 apple|There are %count% apples', 1, array('%count%' => 1)), + array('There are 10 apples', 'There is 1 apple|There are %count% apples', 10, array('%count%' => 10)), + // custom validation messages may be coded with a fixed value + array('There are 2 apples', 'There are 2 apples', 2, array('%count%' => 2)), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/IntervalTest.php b/upload/system/storage/vendor/symfony/translation/Tests/IntervalTest.php new file mode 100644 index 00000000000..075c98b768f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/IntervalTest.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Translation\Interval; + +class IntervalTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getTests + */ + public function testTest($expected, $number, $interval) + { + $this->assertEquals($expected, Interval::test($number, $interval)); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testTestException() + { + Interval::test(1, 'foobar'); + } + + public function getTests() + { + return array( + array(true, 3, '{1,2, 3 ,4}'), + array(false, 10, '{1,2, 3 ,4}'), + array(false, 3, '[1,2]'), + array(true, 1, '[1,2]'), + array(true, 2, '[1,2]'), + array(false, 1, ']1,2['), + array(false, 2, ']1,2['), + array(true, log(0), '[-Inf,2['), + array(true, -log(0), '[-2,+Inf]'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/CsvFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/CsvFileLoaderTest.php new file mode 100644 index 00000000000..463d3b50816 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/CsvFileLoaderTest.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\CsvFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class CsvFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new CsvFileLoader(); + $resource = __DIR__.'/../fixtures/resources.csv'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadDoesNothingIfEmpty() + { + $loader = new CsvFileLoader(); + $resource = __DIR__.'/../fixtures/empty.csv'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array(), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new CsvFileLoader(); + $resource = __DIR__.'/../fixtures/not-exists.csv'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadNonLocalResource() + { + $loader = new CsvFileLoader(); + $resource = 'http://example.com/resources.csv'; + $loader->load($resource, 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuDatFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuDatFileLoaderTest.php new file mode 100644 index 00000000000..888fb615744 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuDatFileLoaderTest.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\IcuDatFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +/** + * @requires extension intl + */ +class IcuDatFileLoaderTest extends LocalizedTestCase +{ + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadInvalidResource() + { + $loader = new IcuDatFileLoader(); + $loader->load(__DIR__.'/../fixtures/resourcebundle/corrupted/resources', 'es', 'domain2'); + } + + public function testDatEnglishLoad() + { + // bundled resource is build using pkgdata command which at least in ICU 4.2 comes in extremely! buggy form + // you must specify an temporary build directory which is not the same as current directory and + // MUST reside on the same partition. pkgdata -p resources -T /srv -d.packagelist.txt + $loader = new IcuDatFileLoader(); + $resource = __DIR__.'/../fixtures/resourcebundle/dat/resources'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('symfony' => 'Symfony 2 is great'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource.'.dat')), $catalogue->getResources()); + } + + public function testDatFrenchLoad() + { + $loader = new IcuDatFileLoader(); + $resource = __DIR__.'/../fixtures/resourcebundle/dat/resources'; + $catalogue = $loader->load($resource, 'fr', 'domain1'); + + $this->assertEquals(array('symfony' => 'Symfony 2 est génial'), $catalogue->all('domain1')); + $this->assertEquals('fr', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource.'.dat')), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new IcuDatFileLoader(); + $loader->load(__DIR__.'/../fixtures/non-existing.txt', 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuResFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuResFileLoaderTest.php new file mode 100644 index 00000000000..8d9ed199144 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/IcuResFileLoaderTest.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\IcuResFileLoader; +use Symfony\Component\Config\Resource\DirectoryResource; + +/** + * @requires extension intl + */ +class IcuResFileLoaderTest extends LocalizedTestCase +{ + public function testLoad() + { + // resource is build using genrb command + $loader = new IcuResFileLoader(); + $resource = __DIR__.'/../fixtures/resourcebundle/res'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new DirectoryResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new IcuResFileLoader(); + $loader->load(__DIR__.'/../fixtures/non-existing.txt', 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadInvalidResource() + { + $loader = new IcuResFileLoader(); + $loader->load(__DIR__.'/../fixtures/resourcebundle/corrupted', 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/IniFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/IniFileLoaderTest.php new file mode 100644 index 00000000000..1a5de0ed58d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/IniFileLoaderTest.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\IniFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class IniFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new IniFileLoader(); + $resource = __DIR__.'/../fixtures/resources.ini'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadDoesNothingIfEmpty() + { + $loader = new IniFileLoader(); + $resource = __DIR__.'/../fixtures/empty.ini'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array(), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new IniFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.ini'; + $loader->load($resource, 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/JsonFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/JsonFileLoaderTest.php new file mode 100644 index 00000000000..cd5d6339f7b --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/JsonFileLoaderTest.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\JsonFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class JsonFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new JsonFileLoader(); + $resource = __DIR__.'/../fixtures/resources.json'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadDoesNothingIfEmpty() + { + $loader = new JsonFileLoader(); + $resource = __DIR__.'/../fixtures/empty.json'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array(), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new JsonFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.json'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + * @expectedExceptionMessage Error parsing JSON - Syntax error, malformed JSON + */ + public function testParseException() + { + $loader = new JsonFileLoader(); + $resource = __DIR__.'/../fixtures/malformed.json'; + $loader->load($resource, 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/LocalizedTestCase.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/LocalizedTestCase.php new file mode 100644 index 00000000000..0d1fff7ac49 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/LocalizedTestCase.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +abstract class LocalizedTestCase extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!extension_loaded('intl')) { + $this->markTestSkipped('Extension intl is required.'); + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/MoFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/MoFileLoaderTest.php new file mode 100644 index 00000000000..34078d0a9e4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/MoFileLoaderTest.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\MoFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class MoFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new MoFileLoader(); + $resource = __DIR__.'/../fixtures/resources.mo'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadPlurals() + { + $loader = new MoFileLoader(); + $resource = __DIR__.'/../fixtures/plurals.mo'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar', 'foos' => '{0} bar|{1} bars'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new MoFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.mo'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadInvalidResource() + { + $loader = new MoFileLoader(); + $resource = __DIR__.'/../fixtures/empty.mo'; + $loader->load($resource, 'en', 'domain1'); + } + + public function testLoadEmptyTranslation() + { + $loader = new MoFileLoader(); + $resource = __DIR__.'/../fixtures/empty-translation.mo'; + $catalogue = $loader->load($resource, 'en', 'message'); + + $this->assertEquals(array(), $catalogue->all('message')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/PhpFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/PhpFileLoaderTest.php new file mode 100644 index 00000000000..0816b0f8549 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/PhpFileLoaderTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\PhpFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new PhpFileLoader(); + $resource = __DIR__.'/../fixtures/resources.php'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new PhpFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.php'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadThrowsAnExceptionIfFileNotLocal() + { + $loader = new PhpFileLoader(); + $resource = 'http://example.com/resources.php'; + $loader->load($resource, 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/PoFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/PoFileLoaderTest.php new file mode 100644 index 00000000000..5d340c766f2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/PoFileLoaderTest.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\PoFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class PoFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/resources.po'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadPlurals() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/plurals.po'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar', 'foos' => 'bar|bars'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadDoesNothingIfEmpty() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/empty.po'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array(), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.po'; + $loader->load($resource, 'en', 'domain1'); + } + + public function testLoadEmptyTranslation() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/empty-translation.po'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => ''), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testEscapedId() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/escaped-id.po'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $messages = $catalogue->all('domain1'); + $this->assertArrayHasKey('escaped "foo"', $messages); + $this->assertEquals('escaped "bar"', $messages['escaped "foo"']); + } + + public function testEscapedIdPlurals() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/escaped-id-plurals.po'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $messages = $catalogue->all('domain1'); + $this->assertArrayHasKey('escaped "foo"', $messages); + $this->assertArrayHasKey('escaped "foos"', $messages); + $this->assertEquals('escaped "bar"', $messages['escaped "foo"']); + $this->assertEquals('escaped "bar"|escaped "bars"', $messages['escaped "foos"']); + } + + public function testSkipFuzzyTranslations() + { + $loader = new PoFileLoader(); + $resource = __DIR__.'/../fixtures/fuzzy-translations.po'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $messages = $catalogue->all('domain1'); + $this->assertArrayHasKey('foo1', $messages); + $this->assertArrayNotHasKey('foo2', $messages); + $this->assertArrayHasKey('foo3', $messages); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/QtFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/QtFileLoaderTest.php new file mode 100644 index 00000000000..3aca86a53ed --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/QtFileLoaderTest.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\QtFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class QtFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new QtFileLoader(); + $resource = __DIR__.'/../fixtures/resources.ts'; + $catalogue = $loader->load($resource, 'en', 'resources'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('resources')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new QtFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.ts'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadNonLocalResource() + { + $loader = new QtFileLoader(); + $resource = 'http://domain1.com/resources.ts'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadInvalidResource() + { + $loader = new QtFileLoader(); + $resource = __DIR__.'/../fixtures/invalid-xml-resources.xlf'; + $loader->load($resource, 'en', 'domain1'); + } + + public function testLoadEmptyResource() + { + $loader = new QtFileLoader(); + $resource = __DIR__.'/../fixtures/empty.xlf'; + $this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s".', $resource)); + $loader->load($resource, 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php new file mode 100644 index 00000000000..2f466d879cf --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php @@ -0,0 +1,183 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\XliffFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new XliffFileLoader(); + $resource = __DIR__.'/../fixtures/resources.xlf'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + $this->assertSame(array(), libxml_get_errors()); + $this->assertContainsOnly('string', $catalogue->all('domain1')); + } + + public function testLoadWithInternalErrorsEnabled() + { + $internalErrors = libxml_use_internal_errors(true); + + $this->assertSame(array(), libxml_get_errors()); + + $loader = new XliffFileLoader(); + $resource = __DIR__.'/../fixtures/resources.xlf'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + $this->assertSame(array(), libxml_get_errors()); + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + } + + public function testLoadWithExternalEntitiesDisabled() + { + $disableEntities = libxml_disable_entity_loader(true); + + $loader = new XliffFileLoader(); + $resource = __DIR__.'/../fixtures/resources.xlf'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + libxml_disable_entity_loader($disableEntities); + + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadWithResname() + { + $loader = new XliffFileLoader(); + $catalogue = $loader->load(__DIR__.'/../fixtures/resname.xlf', 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo'), $catalogue->all('domain1')); + } + + public function testIncompleteResource() + { + $loader = new XliffFileLoader(); + $catalogue = $loader->load(__DIR__.'/../fixtures/resources.xlf', 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar', 'extra' => 'extra', 'key' => '', 'test' => 'with'), $catalogue->all('domain1')); + } + + public function testEncoding() + { + $loader = new XliffFileLoader(); + $catalogue = $loader->load(__DIR__.'/../fixtures/encoding.xlf', 'en', 'domain1'); + + $this->assertEquals(utf8_decode('föö'), $catalogue->get('bar', 'domain1')); + $this->assertEquals(utf8_decode('bär'), $catalogue->get('foo', 'domain1')); + $this->assertEquals(array('notes' => array(array('content' => utf8_decode('bäz')))), $catalogue->getMetadata('foo', 'domain1')); + } + + public function testTargetAttributesAreStoredCorrectly() + { + $loader = new XliffFileLoader(); + $catalogue = $loader->load(__DIR__.'/../fixtures/with-attributes.xlf', 'en', 'domain1'); + + $metadata = $catalogue->getMetadata('foo', 'domain1'); + $this->assertEquals('translated', $metadata['target-attributes']['state']); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadInvalidResource() + { + $loader = new XliffFileLoader(); + $loader->load(__DIR__.'/../fixtures/resources.php', 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadResourceDoesNotValidate() + { + $loader = new XliffFileLoader(); + $loader->load(__DIR__.'/../fixtures/non-valid.xlf', 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new XliffFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.xlf'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadThrowsAnExceptionIfFileNotLocal() + { + $loader = new XliffFileLoader(); + $resource = 'http://example.com/resources.xlf'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + * @expectedExceptionMessage Document types are not allowed. + */ + public function testDocTypeIsNotAllowed() + { + $loader = new XliffFileLoader(); + $loader->load(__DIR__.'/../fixtures/withdoctype.xlf', 'en', 'domain1'); + } + + public function testParseEmptyFile() + { + $loader = new XliffFileLoader(); + $resource = __DIR__.'/../fixtures/empty.xlf'; + $this->setExpectedException('Symfony\Component\Translation\Exception\InvalidResourceException', sprintf('Unable to load "%s":', $resource)); + $loader->load($resource, 'en', 'domain1'); + } + + public function testLoadNotes() + { + $loader = new XliffFileLoader(); + $catalogue = $loader->load(__DIR__.'/../fixtures/withnote.xlf', 'en', 'domain1'); + + $this->assertEquals(array('notes' => array(array('priority' => 1, 'content' => 'foo'))), $catalogue->getMetadata('foo', 'domain1')); + // message without target + $this->assertEquals(array('notes' => array(array('content' => 'bar', 'from' => 'foo'))), $catalogue->getMetadata('extra', 'domain1')); + // message with empty target + $this->assertEquals(array('notes' => array(array('content' => 'baz'), array('priority' => 2, 'from' => 'bar', 'content' => 'qux'))), $catalogue->getMetadata('key', 'domain1')); + } + + public function testLoadVersion2() + { + $loader = new XliffFileLoader(); + $resource = __DIR__.'/../fixtures/resources-2.0.xlf'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + $this->assertSame(array(), libxml_get_errors()); + + $domains = $catalogue->all(); + $this->assertCount(3, $domains['domain1']); + $this->assertContainsOnly('string', $catalogue->all('domain1')); + + // target attributes + $this->assertEquals(array('target-attributes' => array('order' => 1)), $catalogue->getMetadata('bar', 'domain1')); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Loader/YamlFileLoaderTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Loader/YamlFileLoaderTest.php new file mode 100644 index 00000000000..00f7163468d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Loader/YamlFileLoaderTest.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Loader; + +use Symfony\Component\Translation\Loader\YamlFileLoader; +use Symfony\Component\Config\Resource\FileResource; + +class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + public function testLoad() + { + $loader = new YamlFileLoader(); + $resource = __DIR__.'/../fixtures/resources.yml'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + public function testLoadDoesNothingIfEmpty() + { + $loader = new YamlFileLoader(); + $resource = __DIR__.'/../fixtures/empty.yml'; + $catalogue = $loader->load($resource, 'en', 'domain1'); + + $this->assertEquals(array(), $catalogue->all('domain1')); + $this->assertEquals('en', $catalogue->getLocale()); + $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testLoadNonExistingResource() + { + $loader = new YamlFileLoader(); + $resource = __DIR__.'/../fixtures/non-existing.yml'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadThrowsAnExceptionIfFileNotLocal() + { + $loader = new YamlFileLoader(); + $resource = 'http://example.com/resources.yml'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadThrowsAnExceptionIfNotAnArray() + { + $loader = new YamlFileLoader(); + $resource = __DIR__.'/../fixtures/non-valid.yml'; + $loader->load($resource, 'en', 'domain1'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/LoggingTranslatorTest.php b/upload/system/storage/vendor/symfony/translation/Tests/LoggingTranslatorTest.php new file mode 100644 index 00000000000..9f3e849bf4f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/LoggingTranslatorTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Translation\Translator; +use Symfony\Component\Translation\LoggingTranslator; +use Symfony\Component\Translation\Loader\ArrayLoader; + +class LoggingTranslatorTest extends \PHPUnit_Framework_TestCase +{ + public function testTransWithNoTranslationIsLogged() + { + $logger = $this->getMock('Psr\Log\LoggerInterface'); + $logger->expects($this->exactly(2)) + ->method('warning') + ->with('Translation not found.') + ; + + $translator = new Translator('ar'); + $loggableTranslator = new LoggingTranslator($translator, $logger); + $loggableTranslator->transChoice('some_message2', 10, array('%count%' => 10)); + $loggableTranslator->trans('bar'); + } + + public function testTransChoiceFallbackIsLogged() + { + $logger = $this->getMock('Psr\Log\LoggerInterface'); + $logger->expects($this->once()) + ->method('debug') + ->with('Translation use fallback catalogue.') + ; + + $translator = new Translator('ar'); + $translator->setFallbackLocales(array('en')); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('some_message2' => 'one thing|%count% things'), 'en'); + $loggableTranslator = new LoggingTranslator($translator, $logger); + $loggableTranslator->transChoice('some_message2', 10, array('%count%' => 10)); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/MessageCatalogueTest.php b/upload/system/storage/vendor/symfony/translation/Tests/MessageCatalogueTest.php new file mode 100644 index 00000000000..6f55b8cc5e8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/MessageCatalogueTest.php @@ -0,0 +1,214 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Translation\MessageCatalogue; + +class MessageCatalogueTest extends \PHPUnit_Framework_TestCase +{ + public function testGetLocale() + { + $catalogue = new MessageCatalogue('en'); + + $this->assertEquals('en', $catalogue->getLocale()); + } + + public function testGetDomains() + { + $catalogue = new MessageCatalogue('en', array('domain1' => array(), 'domain2' => array())); + + $this->assertEquals(array('domain1', 'domain2'), $catalogue->getDomains()); + } + + public function testAll() + { + $catalogue = new MessageCatalogue('en', $messages = array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + + $this->assertEquals(array('foo' => 'foo'), $catalogue->all('domain1')); + $this->assertEquals(array(), $catalogue->all('domain88')); + $this->assertEquals($messages, $catalogue->all()); + } + + public function testHas() + { + $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + + $this->assertTrue($catalogue->has('foo', 'domain1')); + $this->assertFalse($catalogue->has('bar', 'domain1')); + $this->assertFalse($catalogue->has('foo', 'domain88')); + } + + public function testGetSet() + { + $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + $catalogue->set('foo1', 'foo1', 'domain1'); + + $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); + $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); + } + + public function testAdd() + { + $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + $catalogue->add(array('foo1' => 'foo1'), 'domain1'); + + $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); + $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); + + $catalogue->add(array('foo' => 'bar'), 'domain1'); + $this->assertEquals('bar', $catalogue->get('foo', 'domain1')); + $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); + + $catalogue->add(array('foo' => 'bar'), 'domain88'); + $this->assertEquals('bar', $catalogue->get('foo', 'domain88')); + } + + public function testReplace() + { + $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + $catalogue->replace($messages = array('foo1' => 'foo1'), 'domain1'); + + $this->assertEquals($messages, $catalogue->all('domain1')); + } + + public function testAddCatalogue() + { + $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); + + $r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $r1->expects($this->any())->method('__toString')->will($this->returnValue('r1')); + + $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + $catalogue->addResource($r); + + $catalogue1 = new MessageCatalogue('en', array('domain1' => array('foo1' => 'foo1'))); + $catalogue1->addResource($r1); + + $catalogue->addCatalogue($catalogue1); + + $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); + $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); + + $this->assertEquals(array($r, $r1), $catalogue->getResources()); + } + + public function testAddFallbackCatalogue() + { + $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); + + $r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $r1->expects($this->any())->method('__toString')->will($this->returnValue('r1')); + + $catalogue = new MessageCatalogue('en_US', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); + $catalogue->addResource($r); + + $catalogue1 = new MessageCatalogue('en', array('domain1' => array('foo' => 'bar', 'foo1' => 'foo1'))); + $catalogue1->addResource($r1); + + $catalogue->addFallbackCatalogue($catalogue1); + + $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); + $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); + + $this->assertEquals(array($r, $r1), $catalogue->getResources()); + } + + /** + * @expectedException \LogicException + */ + public function testAddFallbackCatalogueWithParentCircularReference() + { + $main = new MessageCatalogue('en_US'); + $fallback = new MessageCatalogue('fr_FR'); + + $fallback->addFallbackCatalogue($main); + $main->addFallbackCatalogue($fallback); + } + + /** + * @expectedException \LogicException + */ + public function testAddFallbackCatalogueWithFallbackCircularReference() + { + $fr = new MessageCatalogue('fr'); + $en = new MessageCatalogue('en'); + $es = new MessageCatalogue('es'); + + $fr->addFallbackCatalogue($en); + $es->addFallbackCatalogue($en); + $en->addFallbackCatalogue($fr); + } + + /** + * @expectedException \LogicException + */ + public function testAddCatalogueWhenLocaleIsNotTheSameAsTheCurrentOne() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->addCatalogue(new MessageCatalogue('fr', array())); + } + + public function testGetAddResource() + { + $catalogue = new MessageCatalogue('en'); + $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); + $catalogue->addResource($r); + $catalogue->addResource($r); + $r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $r1->expects($this->any())->method('__toString')->will($this->returnValue('r1')); + $catalogue->addResource($r1); + + $this->assertEquals(array($r, $r1), $catalogue->getResources()); + } + + public function testMetadataDelete() + { + $catalogue = new MessageCatalogue('en'); + $this->assertEquals(array(), $catalogue->getMetadata('', ''), 'Metadata is empty'); + $catalogue->deleteMetadata('key', 'messages'); + $catalogue->deleteMetadata('', 'messages'); + $catalogue->deleteMetadata(); + } + + public function testMetadataSetGetDelete() + { + $catalogue = new MessageCatalogue('en'); + $catalogue->setMetadata('key', 'value'); + $this->assertEquals('value', $catalogue->getMetadata('key', 'messages'), "Metadata 'key' = 'value'"); + + $catalogue->setMetadata('key2', array()); + $this->assertEquals(array(), $catalogue->getMetadata('key2', 'messages'), 'Metadata key2 is array'); + + $catalogue->deleteMetadata('key2', 'messages'); + $this->assertNull($catalogue->getMetadata('key2', 'messages'), 'Metadata key2 should is deleted.'); + + $catalogue->deleteMetadata('key2', 'domain'); + $this->assertNull($catalogue->getMetadata('key2', 'domain'), 'Metadata key2 should is deleted.'); + } + + public function testMetadataMerge() + { + $cat1 = new MessageCatalogue('en'); + $cat1->setMetadata('a', 'b'); + $this->assertEquals(array('messages' => array('a' => 'b')), $cat1->getMetadata('', ''), 'Cat1 contains messages metadata.'); + + $cat2 = new MessageCatalogue('en'); + $cat2->setMetadata('b', 'c', 'domain'); + $this->assertEquals(array('domain' => array('b' => 'c')), $cat2->getMetadata('', ''), 'Cat2 contains domain metadata.'); + + $cat1->addCatalogue($cat2); + $this->assertEquals(array('messages' => array('a' => 'b'), 'domain' => array('b' => 'c')), $cat1->getMetadata('', ''), 'Cat1 contains merged metadata.'); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/MessageSelectorTest.php b/upload/system/storage/vendor/symfony/translation/Tests/MessageSelectorTest.php new file mode 100644 index 00000000000..f89bed16d59 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/MessageSelectorTest.php @@ -0,0 +1,130 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Translation\MessageSelector; + +class MessageSelectorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getChooseTests + */ + public function testChoose($expected, $id, $number) + { + $selector = new MessageSelector(); + + $this->assertEquals($expected, $selector->choose($id, $number, 'en')); + } + + public function testReturnMessageIfExactlyOneStandardRuleIsGiven() + { + $selector = new MessageSelector(); + + $this->assertEquals('There are two apples', $selector->choose('There are two apples', 2, 'en')); + } + + /** + * @dataProvider getNonMatchingMessages + * @expectedException \InvalidArgumentException + */ + public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) + { + $selector = new MessageSelector(); + + $selector->choose($id, $number, 'en'); + } + + public function getNonMatchingMessages() + { + return array( + array('{0} There are no apples|{1} There is one apple', 2), + array('{1} There is one apple|]1,Inf] There are %count% apples', 0), + array('{1} There is one apple|]2,Inf] There are %count% apples', 2), + array('{0} There are no apples|There is one apple', 2), + ); + } + + public function getChooseTests() + { + return array( + array('There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0), + array('There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0), + array('There are no apples', '{0}There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0), + + array('There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1), + + array('There are %count% apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10), + array('There are %count% apples', '{0} There are no apples|{1} There is one apple|]1,Inf]There are %count% apples', 10), + array('There are %count% apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10), + + array('There are %count% apples', 'There is one apple|There are %count% apples', 0), + array('There is one apple', 'There is one apple|There are %count% apples', 1), + array('There are %count% apples', 'There is one apple|There are %count% apples', 10), + + array('There are %count% apples', 'one: There is one apple|more: There are %count% apples', 0), + array('There is one apple', 'one: There is one apple|more: There are %count% apples', 1), + array('There are %count% apples', 'one: There is one apple|more: There are %count% apples', 10), + + array('There are no apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 0), + array('There is one apple', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 1), + array('There are %count% apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 10), + + array('', '{0}|{1} There is one apple|]1,Inf] There are %count% apples', 0), + array('', '{0} There are no apples|{1}|]1,Inf] There are %count% apples', 1), + + // Indexed only tests which are Gettext PoFile* compatible strings. + array('There are %count% apples', 'There is one apple|There are %count% apples', 0), + array('There is one apple', 'There is one apple|There are %count% apples', 1), + array('There are %count% apples', 'There is one apple|There are %count% apples', 2), + + // Tests for float numbers + array('There is almost one apple', '{0} There are no apples|]0,1[ There is almost one apple|{1} There is one apple|[1,Inf] There is more than one apple', 0.7), + array('There is one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1), + array('There is more than one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1.7), + array('There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0), + array('There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0.0), + array('There are no apples', '{0.0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0), + + // Test texts with new-lines + // with double-quotes and \n in id & double-quotes and actual newlines in text + array("This is a text with a\n new-line in it. Selector = 0.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 0), + // with double-quotes and \n in id and single-quotes and actual newlines in text + array("This is a text with a\n new-line in it. Selector = 1.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 1), + array("This is a text with a\n new-line in it. Selector > 1.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 5), + // with double-quotes and id split accros lines + array('This is a text with a + new-line in it. Selector = 1.', '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 1), + // with single-quotes and id split accros lines + array('This is a text with a + new-line in it. Selector > 1.', '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 5), + // with single-quotes and \n in text + array('This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0), + // with double-quotes and id split accros lines + array("This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/PluralizationRulesTest.php b/upload/system/storage/vendor/symfony/translation/Tests/PluralizationRulesTest.php new file mode 100644 index 00000000000..78bbc87eece --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/PluralizationRulesTest.php @@ -0,0 +1,123 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Translation\PluralizationRules; + +/** + * Test should cover all languages mentioned on http://translate.sourceforge.net/wiki/l10n/pluralforms + * and Plural forms mentioned on http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms. + * + * See also https://developer.mozilla.org/en/Localization_and_Plurals which mentions 15 rules having a maximum of 6 forms. + * The mozilla code is also interesting to check for. + * + * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199 + * + * The goal to cover all languages is to far fetched so this test case is smaller. + * + * @author Clemens Tolboom clemens@build2be.nl + */ +class PluralizationRulesTest extends \PHPUnit_Framework_TestCase +{ + /** + * We test failed langcode here. + * + * TODO: The languages mentioned in the data provide need to get fixed somehow within PluralizationRules. + * + * @dataProvider failingLangcodes + */ + public function testFailedLangcodes($nplural, $langCodes) + { + $matrix = $this->generateTestData($langCodes); + $this->validateMatrix($nplural, $matrix, false); + } + + /** + * @dataProvider successLangcodes + */ + public function testLangcodes($nplural, $langCodes) + { + $matrix = $this->generateTestData($langCodes); + $this->validateMatrix($nplural, $matrix); + } + + /** + * This array should contain all currently known langcodes. + * + * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. + * + * @return array + */ + public function successLangcodes() + { + return array( + array('1', array('ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky')), + array('2', array('nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM')), + array('3', array('be', 'bs', 'cs', 'hr')), + array('4', array('cy', 'mt', 'sl')), + array('5', array()), + array('6', array('ar')), + ); + } + + /** + * This array should be at least empty within the near future. + * + * This both depends on a complete list trying to add above as understanding + * the plural rules of the current failing languages. + * + * @return array with nplural together with langcodes + */ + public function failingLangcodes() + { + return array( + array('1', array('fa')), + array('2', array('jbo')), + array('3', array('cbs')), + array('4', array('gd', 'kw')), + array('5', array('ga')), + array('6', array()), + ); + } + + /** + * We validate only on the plural coverage. Thus the real rules is not tested. + * + * @param string $nplural plural expected + * @param array $matrix containing langcodes and their plural index values + * @param bool $expectSuccess + */ + 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."); + } else { + $this->assertNotEquals((int) $nplural, count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); + } + } + } + + protected function generateTestData($langCodes) + { + $matrix = array(); + foreach ($langCodes as $langCode) { + for ($count = 0; $count < 200; ++$count) { + $plural = PluralizationRules::get($count, $langCode); + $matrix[$langCode][$count] = $plural; + } + } + + return $matrix; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/TranslatorCacheTest.php b/upload/system/storage/vendor/symfony/translation/Tests/TranslatorCacheTest.php new file mode 100644 index 00000000000..75093580b47 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/TranslatorCacheTest.php @@ -0,0 +1,299 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Config\Resource\SelfCheckingResourceInterface; +use Symfony\Component\Translation\Loader\ArrayLoader; +use Symfony\Component\Translation\Loader\LoaderInterface; +use Symfony\Component\Translation\Translator; +use Symfony\Component\Translation\MessageCatalogue; + +class TranslatorCacheTest extends \PHPUnit_Framework_TestCase +{ + protected $tmpDir; + + protected function setUp() + { + $this->tmpDir = sys_get_temp_dir().'/sf2_translation'; + $this->deleteTmpDir(); + } + + protected function tearDown() + { + $this->deleteTmpDir(); + } + + protected function deleteTmpDir() + { + if (!file_exists($dir = $this->tmpDir)) { + return; + } + + $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir), \RecursiveIteratorIterator::CHILD_FIRST); + foreach ($iterator as $path) { + if (preg_match('#[/\\\\]\.\.?$#', $path->__toString())) { + continue; + } + if ($path->isDir()) { + rmdir($path->__toString()); + } else { + unlink($path->__toString()); + } + } + rmdir($this->tmpDir); + } + + /** + * @dataProvider runForDebugAndProduction + */ + public function testThatACacheIsUsed($debug) + { + $locale = 'any_locale'; + $format = 'some_format'; + $msgid = 'test'; + + // Prime the cache + $translator = new Translator($locale, null, $this->tmpDir, $debug); + $translator->addLoader($format, new ArrayLoader()); + $translator->addResource($format, array($msgid => 'OK'), $locale); + $translator->trans($msgid); + + // Try again and see we get a valid result whilst no loader can be used + $translator = new Translator($locale, null, $this->tmpDir, $debug); + $translator->addLoader($format, $this->createFailingLoader()); + $translator->addResource($format, array($msgid => 'OK'), $locale); + $this->assertEquals('OK', $translator->trans($msgid), '-> caching does not work in '.($debug ? 'debug' : 'production')); + } + + public function testCatalogueIsReloadedWhenResourcesAreNoLongerFresh() + { + /* + * The testThatACacheIsUsed() test showed that we don't need the loader as long as the cache + * is fresh. + * + * Now we add a Resource that is never fresh and make sure that the + * cache is discarded (the loader is called twice). + * + * We need to run this for debug=true only because in production the cache + * will never be revalidated. + */ + + $locale = 'any_locale'; + $format = 'some_format'; + $msgid = 'test'; + + $catalogue = new MessageCatalogue($locale, array()); + $catalogue->addResource(new StaleResource()); // better use a helper class than a mock, because it gets serialized in the cache and re-loaded + + /** @var LoaderInterface|\PHPUnit_Framework_MockObject_MockObject $loader */ + $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); + $loader + ->expects($this->exactly(2)) + ->method('load') + ->will($this->returnValue($catalogue)) + ; + + // 1st pass + $translator = new Translator($locale, null, $this->tmpDir, true); + $translator->addLoader($format, $loader); + $translator->addResource($format, null, $locale); + $translator->trans($msgid); + + // 2nd pass + $translator = new Translator($locale, null, $this->tmpDir, true); + $translator->addLoader($format, $loader); + $translator->addResource($format, null, $locale); + $translator->trans($msgid); + } + + /** + * @dataProvider runForDebugAndProduction + */ + public function testDifferentTranslatorsForSameLocaleDoNotOverwriteEachOthersCache($debug) + { + /* + * Similar to the previous test. After we used the second translator, make + * sure there's still a useable cache for the first one. + */ + + $locale = 'any_locale'; + $format = 'some_format'; + $msgid = 'test'; + + // Create a Translator and prime its cache + $translator = new Translator($locale, null, $this->tmpDir, $debug); + $translator->addLoader($format, new ArrayLoader()); + $translator->addResource($format, array($msgid => 'OK'), $locale); + $translator->trans($msgid); + + // Create another Translator with a different catalogue for the same locale + $translator = new Translator($locale, null, $this->tmpDir, $debug); + $translator->addLoader($format, new ArrayLoader()); + $translator->addResource($format, array($msgid => 'FAIL'), $locale); + $translator->trans($msgid); + + // Now the first translator must still have a useable cache. + $translator = new Translator($locale, null, $this->tmpDir, $debug); + $translator->addLoader($format, $this->createFailingLoader()); + $translator->addResource($format, array($msgid => 'OK'), $locale); + $this->assertEquals('OK', $translator->trans($msgid), '-> the cache was overwritten by another translator instance in '.($debug ? 'debug' : 'production')); + } + + public function testDifferentCacheFilesAreUsedForDifferentSetsOfFallbackLocales() + { + /* + * Because the cache file contains a catalogue including all of its fallback + * catalogues, we must take the set of fallback locales into consideration when + * loading a catalogue from the cache. + */ + $translator = new Translator('a', null, $this->tmpDir); + $translator->setFallbackLocales(array('b')); + + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foo (a)'), 'a'); + $translator->addResource('array', array('bar' => 'bar (b)'), 'b'); + + $this->assertEquals('bar (b)', $translator->trans('bar')); + + // Remove fallback locale + $translator->setFallbackLocales(array()); + $this->assertEquals('bar', $translator->trans('bar')); + + // Use a fresh translator with no fallback locales, result should be the same + $translator = new Translator('a', null, $this->tmpDir); + + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foo (a)'), 'a'); + $translator->addResource('array', array('bar' => 'bar (b)'), 'b'); + + $this->assertEquals('bar', $translator->trans('bar')); + } + + public function testPrimaryAndFallbackCataloguesContainTheSameMessagesRegardlessOfCaching() + { + /* + * As a safeguard against potential BC breaks, make sure that primary and fallback + * catalogues (reachable via getFallbackCatalogue()) always contain the full set of + * messages provided by the loader. This must also be the case when these catalogues + * are (internally) read from a cache. + * + * Optimizations inside the translator must not change this behaviour. + */ + + /* + * Create a translator that loads two catalogues for two different locales. + * The catalogues contain distinct sets of messages. + */ + $translator = new Translator('a', null, $this->tmpDir); + $translator->setFallbackLocales(array('b')); + + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foo (a)'), 'a'); + $translator->addResource('array', array('foo' => 'foo (b)'), 'b'); + $translator->addResource('array', array('bar' => 'bar (b)'), 'b'); + + $catalogue = $translator->getCatalogue('a'); + $this->assertFalse($catalogue->defines('bar')); // Sure, the "a" catalogue does not contain that message. + + $fallback = $catalogue->getFallbackCatalogue(); + $this->assertTrue($fallback->defines('foo')); // "foo" is present in "a" and "b" + + /* + * Now, repeat the same test. + * Behind the scenes, the cache is used. But that should not matter, right? + */ + $translator = new Translator('a', null, $this->tmpDir); + $translator->setFallbackLocales(array('b')); + + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foo (a)'), 'a'); + $translator->addResource('array', array('foo' => 'foo (b)'), 'b'); + $translator->addResource('array', array('bar' => 'bar (b)'), 'b'); + + $catalogue = $translator->getCatalogue('a'); + $this->assertFalse($catalogue->defines('bar')); + + $fallback = $catalogue->getFallbackCatalogue(); + $this->assertTrue($fallback->defines('foo')); + } + + public function testRefreshCacheWhenResourcesAreNoLongerFresh() + { + $resource = $this->getMock('Symfony\Component\Config\Resource\SelfCheckingResourceInterface'); + $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); + $resource->method('isFresh')->will($this->returnValue(false)); + $loader + ->expects($this->exactly(2)) + ->method('load') + ->will($this->returnValue($this->getCatalogue('fr', array(), array($resource)))); + + // prime the cache + $translator = new Translator('fr', null, $this->tmpDir, true); + $translator->addLoader('loader', $loader); + $translator->addResource('loader', 'foo', 'fr'); + $translator->trans('foo'); + + // prime the cache second time + $translator = new Translator('fr', null, $this->tmpDir, true); + $translator->addLoader('loader', $loader); + $translator->addResource('loader', 'foo', 'fr'); + $translator->trans('foo'); + } + + protected function getCatalogue($locale, $messages, $resources = array()) + { + $catalogue = new MessageCatalogue($locale); + foreach ($messages as $key => $translation) { + $catalogue->set($key, $translation); + } + foreach ($resources as $resource) { + $catalogue->addResource($resource); + } + + return $catalogue; + } + + public function runForDebugAndProduction() + { + return array(array(true), array(false)); + } + + /** + * @return LoaderInterface + */ + private function createFailingLoader() + { + $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); + $loader + ->expects($this->never()) + ->method('load'); + + return $loader; + } +} + +class StaleResource implements SelfCheckingResourceInterface +{ + public function isFresh($timestamp) + { + return false; + } + + public function getResource() + { + } + + public function __toString() + { + return ''; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/TranslatorTest.php b/upload/system/storage/vendor/symfony/translation/Tests/TranslatorTest.php new file mode 100644 index 00000000000..0f65d3e5efa --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/TranslatorTest.php @@ -0,0 +1,533 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests; + +use Symfony\Component\Translation\Translator; +use Symfony\Component\Translation\MessageSelector; +use Symfony\Component\Translation\Loader\ArrayLoader; +use Symfony\Component\Translation\MessageCatalogue; + +class TranslatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getInvalidLocalesTests + * @expectedException \InvalidArgumentException + */ + public function testConstructorInvalidLocale($locale) + { + $translator = new Translator($locale, new MessageSelector()); + } + + /** + * @dataProvider getValidLocalesTests + */ + public function testConstructorValidLocale($locale) + { + $translator = new Translator($locale, new MessageSelector()); + + $this->assertEquals($locale, $translator->getLocale()); + } + + public function testConstructorWithoutLocale() + { + $translator = new Translator(null, new MessageSelector()); + + $this->assertNull($translator->getLocale()); + } + + public function testSetGetLocale() + { + $translator = new Translator('en'); + + $this->assertEquals('en', $translator->getLocale()); + + $translator->setLocale('fr'); + $this->assertEquals('fr', $translator->getLocale()); + } + + /** + * @dataProvider getInvalidLocalesTests + * @expectedException \InvalidArgumentException + */ + public function testSetInvalidLocale($locale) + { + $translator = new Translator('fr', new MessageSelector()); + $translator->setLocale($locale); + } + + /** + * @dataProvider getValidLocalesTests + */ + public function testSetValidLocale($locale) + { + $translator = new Translator($locale, new MessageSelector()); + $translator->setLocale($locale); + + $this->assertEquals($locale, $translator->getLocale()); + } + + public function testGetCatalogue() + { + $translator = new Translator('en'); + + $this->assertEquals(new MessageCatalogue('en'), $translator->getCatalogue()); + + $translator->setLocale('fr'); + $this->assertEquals(new MessageCatalogue('fr'), $translator->getCatalogue('fr')); + } + + public function testGetCatalogueReturnsConsolidatedCatalogue() + { + /* + * This will be useful once we refactor so that different domains will be loaded lazily (on-demand). + * In that case, getCatalogue() will probably have to load all missing domains in order to return + * one complete catalogue. + */ + + $locale = 'whatever'; + $translator = new Translator($locale); + $translator->addLoader('loader-a', new ArrayLoader()); + $translator->addLoader('loader-b', new ArrayLoader()); + $translator->addResource('loader-a', array('foo' => 'foofoo'), $locale, 'domain-a'); + $translator->addResource('loader-b', array('bar' => 'foobar'), $locale, 'domain-b'); + + /* + * Test that we get a single catalogue comprising messages + * from different loaders and different domains + */ + $catalogue = $translator->getCatalogue($locale); + $this->assertTrue($catalogue->defines('foo', 'domain-a')); + $this->assertTrue($catalogue->defines('bar', 'domain-b')); + } + + public function testSetFallbackLocales() + { + $translator = new Translator('en'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foofoo'), 'en'); + $translator->addResource('array', array('bar' => 'foobar'), 'fr'); + + // force catalogue loading + $translator->trans('bar'); + + $translator->setFallbackLocales(array('fr')); + $this->assertEquals('foobar', $translator->trans('bar')); + } + + public function testSetFallbackLocalesMultiple() + { + $translator = new Translator('en'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foo (en)'), 'en'); + $translator->addResource('array', array('bar' => 'bar (fr)'), 'fr'); + + // force catalogue loading + $translator->trans('bar'); + + $translator->setFallbackLocales(array('fr_FR', 'fr')); + $this->assertEquals('bar (fr)', $translator->trans('bar')); + } + + /** + * @dataProvider getInvalidLocalesTests + * @expectedException \InvalidArgumentException + */ + public function testSetFallbackInvalidLocales($locale) + { + $translator = new Translator('fr', new MessageSelector()); + $translator->setFallbackLocales(array('fr', $locale)); + } + + /** + * @dataProvider getValidLocalesTests + */ + public function testSetFallbackValidLocales($locale) + { + $translator = new Translator($locale, new MessageSelector()); + $translator->setFallbackLocales(array('fr', $locale)); + // no assertion. this method just asserts that no exception is thrown + } + + public function testTransWithFallbackLocale() + { + $translator = new Translator('fr_FR'); + $translator->setFallbackLocales(array('en')); + + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('bar' => 'foobar'), 'en'); + + $this->assertEquals('foobar', $translator->trans('bar')); + } + + /** + * @dataProvider getInvalidLocalesTests + * @expectedException \InvalidArgumentException + */ + public function testAddResourceInvalidLocales($locale) + { + $translator = new Translator('fr', new MessageSelector()); + $translator->addResource('array', array('foo' => 'foofoo'), $locale); + } + + /** + * @dataProvider getValidLocalesTests + */ + public function testAddResourceValidLocales($locale) + { + $translator = new Translator('fr', new MessageSelector()); + $translator->addResource('array', array('foo' => 'foofoo'), $locale); + // no assertion. this method just asserts that no exception is thrown + } + + public function testAddResourceAfterTrans() + { + $translator = new Translator('fr'); + $translator->addLoader('array', new ArrayLoader()); + + $translator->setFallbackLocales(array('en')); + + $translator->addResource('array', array('foo' => 'foofoo'), 'en'); + $this->assertEquals('foofoo', $translator->trans('foo')); + + $translator->addResource('array', array('bar' => 'foobar'), 'en'); + $this->assertEquals('foobar', $translator->trans('bar')); + } + + /** + * @dataProvider getTransFileTests + * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException + */ + public function testTransWithoutFallbackLocaleFile($format, $loader) + { + $loaderClass = 'Symfony\\Component\\Translation\\Loader\\'.$loader; + $translator = new Translator('en'); + $translator->addLoader($format, new $loaderClass()); + $translator->addResource($format, __DIR__.'/fixtures/non-existing', 'en'); + $translator->addResource($format, __DIR__.'/fixtures/resources.'.$format, 'en'); + + // force catalogue loading + $translator->trans('foo'); + } + + /** + * @dataProvider getTransFileTests + */ + public function testTransWithFallbackLocaleFile($format, $loader) + { + $loaderClass = 'Symfony\\Component\\Translation\\Loader\\'.$loader; + $translator = new Translator('en_GB'); + $translator->addLoader($format, new $loaderClass()); + $translator->addResource($format, __DIR__.'/fixtures/non-existing', 'en_GB'); + $translator->addResource($format, __DIR__.'/fixtures/resources.'.$format, 'en', 'resources'); + + $this->assertEquals('bar', $translator->trans('foo', array(), 'resources')); + } + + public function testTransWithFallbackLocaleBis() + { + $translator = new Translator('en_US'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foofoo'), 'en_US'); + $translator->addResource('array', array('bar' => 'foobar'), 'en'); + $this->assertEquals('foobar', $translator->trans('bar')); + } + + public function testTransWithFallbackLocaleTer() + { + $translator = new Translator('fr_FR'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foo (en_US)'), 'en_US'); + $translator->addResource('array', array('bar' => 'bar (en)'), 'en'); + + $translator->setFallbackLocales(array('en_US', 'en')); + + $this->assertEquals('foo (en_US)', $translator->trans('foo')); + $this->assertEquals('bar (en)', $translator->trans('bar')); + } + + public function testTransNonExistentWithFallback() + { + $translator = new Translator('fr'); + $translator->setFallbackLocales(array('en')); + $translator->addLoader('array', new ArrayLoader()); + $this->assertEquals('non-existent', $translator->trans('non-existent')); + } + + /** + * @expectedException \RuntimeException + */ + public function testWhenAResourceHasNoRegisteredLoader() + { + $translator = new Translator('en'); + $translator->addResource('array', array('foo' => 'foofoo'), 'en'); + + $translator->trans('foo'); + } + + public function testFallbackCatalogueResources() + { + $translator = new Translator('en_GB', new MessageSelector()); + $translator->addLoader('yml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); + $translator->addResource('yml', __DIR__.'/fixtures/empty.yml', 'en_GB'); + $translator->addResource('yml', __DIR__.'/fixtures/resources.yml', 'en'); + + // force catalogue loading + $this->assertEquals('bar', $translator->trans('foo', array())); + + $resources = $translator->getCatalogue('en')->getResources(); + $this->assertCount(1, $resources); + $this->assertContains(__DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'resources.yml', $resources); + + $resources = $translator->getCatalogue('en_GB')->getResources(); + $this->assertCount(2, $resources); + $this->assertContains(__DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'empty.yml', $resources); + $this->assertContains(__DIR__.DIRECTORY_SEPARATOR.'fixtures'.DIRECTORY_SEPARATOR.'resources.yml', $resources); + } + + /** + * @dataProvider getTransTests + */ + public function testTrans($expected, $id, $translation, $parameters, $locale, $domain) + { + $translator = new Translator('en'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array((string) $id => $translation), $locale, $domain); + + $this->assertEquals($expected, $translator->trans($id, $parameters, $domain, $locale)); + } + + /** + * @dataProvider getInvalidLocalesTests + * @expectedException \InvalidArgumentException + */ + public function testTransInvalidLocale($locale) + { + $translator = new Translator('en', new MessageSelector()); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foofoo'), 'en'); + + $translator->trans('foo', array(), '', $locale); + } + + /** + * @dataProvider getValidLocalesTests + */ + public function testTransValidLocale($locale) + { + $translator = new Translator($locale, new MessageSelector()); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('test' => 'OK'), $locale); + + $this->assertEquals('OK', $translator->trans('test')); + $this->assertEquals('OK', $translator->trans('test', array(), null, $locale)); + } + + /** + * @dataProvider getFlattenedTransTests + */ + public function testFlattenedTrans($expected, $messages, $id) + { + $translator = new Translator('en'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', $messages, 'fr', ''); + + $this->assertEquals($expected, $translator->trans($id, array(), '', 'fr')); + } + + /** + * @dataProvider getTransChoiceTests + */ + public function testTransChoice($expected, $id, $translation, $number, $parameters, $locale, $domain) + { + $translator = new Translator('en'); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array((string) $id => $translation), $locale, $domain); + + $this->assertEquals($expected, $translator->transChoice($id, $number, $parameters, $domain, $locale)); + } + + /** + * @dataProvider getInvalidLocalesTests + * @expectedException \InvalidArgumentException + */ + public function testTransChoiceInvalidLocale($locale) + { + $translator = new Translator('en', new MessageSelector()); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foofoo'), 'en'); + + $translator->transChoice('foo', 1, array(), '', $locale); + } + + /** + * @dataProvider getValidLocalesTests + */ + public function testTransChoiceValidLocale($locale) + { + $translator = new Translator('en', new MessageSelector()); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('foo' => 'foofoo'), 'en'); + + $translator->transChoice('foo', 1, array(), '', $locale); + // no assertion. this method just asserts that no exception is thrown + } + + public function getTransFileTests() + { + return array( + array('csv', 'CsvFileLoader'), + array('ini', 'IniFileLoader'), + array('mo', 'MoFileLoader'), + array('po', 'PoFileLoader'), + array('php', 'PhpFileLoader'), + array('ts', 'QtFileLoader'), + array('xlf', 'XliffFileLoader'), + array('yml', 'YamlFileLoader'), + array('json', 'JsonFileLoader'), + ); + } + + public function getTransTests() + { + return array( + array('Symfony est super !', 'Symfony is great!', 'Symfony est super !', array(), 'fr', ''), + array('Symfony est awesome !', 'Symfony is %what%!', 'Symfony est %what% !', array('%what%' => 'awesome'), 'fr', ''), + array('Symfony est super !', new StringClass('Symfony is great!'), 'Symfony est super !', array(), 'fr', ''), + ); + } + + public function getFlattenedTransTests() + { + $messages = array( + 'symfony' => array( + 'is' => array( + 'great' => 'Symfony est super!', + ), + ), + 'foo' => array( + 'bar' => array( + 'baz' => 'Foo Bar Baz', + ), + 'baz' => 'Foo Baz', + ), + ); + + return array( + array('Symfony est super!', $messages, 'symfony.is.great'), + array('Foo Bar Baz', $messages, 'foo.bar.baz'), + array('Foo Baz', $messages, 'foo.baz'), + ); + } + + public function getTransChoiceTests() + { + return array( + array('Il y a 0 pomme', '{0} There are no appless|{1} There is one apple|]1,Inf] There is %count% apples', '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), + array('Il y a 1 pomme', '{0} There are no appless|{1} There is one apple|]1,Inf] There is %count% apples', '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), + array('Il y a 10 pommes', '{0} There are no appless|{1} There is one apple|]1,Inf] There is %count% apples', '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), + + array('Il y a 0 pomme', 'There is one apple|There is %count% apples', 'Il y a %count% pomme|Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), + array('Il y a 1 pomme', 'There is one apple|There is %count% apples', 'Il y a %count% pomme|Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), + array('Il y a 10 pommes', 'There is one apple|There is %count% apples', 'Il y a %count% pomme|Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), + + array('Il y a 0 pomme', 'one: There is one apple|more: There is %count% apples', 'one: Il y a %count% pomme|more: Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), + array('Il y a 1 pomme', 'one: There is one apple|more: There is %count% apples', 'one: Il y a %count% pomme|more: Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), + array('Il y a 10 pommes', 'one: There is one apple|more: There is %count% apples', 'one: Il y a %count% pomme|more: Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), + + array('Il n\'y a aucune pomme', '{0} There are no apples|one: There is one apple|more: There is %count% apples', '{0} Il n\'y a aucune pomme|one: Il y a %count% pomme|more: Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), + array('Il y a 1 pomme', '{0} There are no apples|one: There is one apple|more: There is %count% apples', '{0} Il n\'y a aucune pomme|one: Il y a %count% pomme|more: Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), + array('Il y a 10 pommes', '{0} There are no apples|one: There is one apple|more: There is %count% apples', '{0} Il n\'y a aucune pomme|one: Il y a %count% pomme|more: Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), + + array('Il y a 0 pomme', new StringClass('{0} There are no appless|{1} There is one apple|]1,Inf] There is %count% apples'), '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), + ); + } + + public function getInvalidLocalesTests() + { + return array( + array('fr FR'), + array('français'), + array('fr+en'), + array('utf#8'), + array('fr&en'), + array('fr~FR'), + array(' fr'), + array('fr '), + array('fr*'), + array('fr/FR'), + array('fr\\FR'), + ); + } + + public function getValidLocalesTests() + { + return array( + array(''), + array(null), + array('fr'), + array('francais'), + array('FR'), + array('frFR'), + array('fr-FR'), + array('fr_FR'), + array('fr.FR'), + array('fr-FR.UTF8'), + array('sr@latin'), + ); + } + + public function testTransChoiceFallback() + { + $translator = new Translator('ru'); + $translator->setFallbackLocales(array('en')); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('some_message2' => 'one thing|%count% things'), 'en'); + + $this->assertEquals('10 things', $translator->transChoice('some_message2', 10, array('%count%' => 10))); + } + + public function testTransChoiceFallbackBis() + { + $translator = new Translator('ru'); + $translator->setFallbackLocales(array('en_US', 'en')); + $translator->addLoader('array', new ArrayLoader()); + $translator->addResource('array', array('some_message2' => 'one thing|%count% things'), 'en_US'); + + $this->assertEquals('10 things', $translator->transChoice('some_message2', 10, array('%count%' => 10))); + } + + public function testTransChoiceFallbackWithNoTranslation() + { + $translator = new Translator('ru'); + $translator->setFallbackLocales(array('en')); + $translator->addLoader('array', new ArrayLoader()); + + // consistent behavior with Translator::trans(), which returns the string + // unchanged if it can't be found + $this->assertEquals('some_message2', $translator->transChoice('some_message2', 10, array('%count%' => 10))); + } +} + +class StringClass +{ + protected $str; + + public function __construct($str) + { + $this->str = $str; + } + + public function __toString() + { + return $this->str; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Util/ArrayConverterTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Util/ArrayConverterTest.php new file mode 100644 index 00000000000..9eea275be6b --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Util/ArrayConverterTest.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Util; + +use Symfony\Component\Translation\Util\ArrayConverter; + +class ArrayConverterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider messsagesData + */ + public function testDump($input, $expectedOutput) + { + $this->assertEquals($expectedOutput, ArrayConverter::expandToTree($input)); + } + + public function messsagesData() + { + return array( + array( + // input + array( + 'foo1' => 'bar', + 'foo.bar' => 'value', + ), + // expected output + array( + 'foo1' => 'bar', + 'foo' => array('bar' => 'value'), + ), + ), + array( + // input + array( + 'foo.bar' => 'value1', + 'foo.bar.test' => 'value2', + ), + // expected output + array( + 'foo' => array( + 'bar' => 'value1', + 'bar.test' => 'value2', + ), + ), + ), + array( + // input + array( + 'foo.level2.level3.level4' => 'value1', + 'foo.level2' => 'value2', + 'foo.bar' => 'value3', + ), + // expected output + array( + 'foo' => array( + 'level2' => 'value2', + 'level2.level3.level4' => 'value1', + 'bar' => 'value3', + ), + ), + ), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/Writer/TranslationWriterTest.php b/upload/system/storage/vendor/symfony/translation/Tests/Writer/TranslationWriterTest.php new file mode 100644 index 00000000000..f7a8a83d243 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/Writer/TranslationWriterTest.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Tests\Writer; + +use Symfony\Component\Translation\Dumper\DumperInterface; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Writer\TranslationWriter; + +class TranslationWriterTest extends \PHPUnit_Framework_TestCase +{ + public function testWriteTranslations() + { + $dumper = $this->getMock('Symfony\Component\Translation\Dumper\DumperInterface'); + $dumper + ->expects($this->once()) + ->method('dump'); + + $writer = new TranslationWriter(); + $writer->addDumper('test', $dumper); + $writer->writeTranslations(new MessageCatalogue(array()), 'test'); + } + + public function testDisableBackup() + { + $nonBackupDumper = new NonBackupDumper(); + $backupDumper = new BackupDumper(); + + $writer = new TranslationWriter(); + $writer->addDumper('non_backup', $nonBackupDumper); + $writer->addDumper('backup', $backupDumper); + $writer->disableBackup(); + + $this->assertFalse($backupDumper->backup, 'backup can be disabled if setBackup() method does exist'); + } +} + +class NonBackupDumper implements DumperInterface +{ + public function dump(MessageCatalogue $messages, $options = array()) + { + } +} + +class BackupDumper implements DumperInterface +{ + public $backup = true; + + public function dump(MessageCatalogue $messages, $options = array()) + { + } + + public function setBackup($backup) + { + $this->backup = $backup; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty-translation.mo b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty-translation.mo new file mode 100644 index 0000000000000000000000000000000000000000..ed01000c9b1b3fdf40fc2369a7799e72e41a1edf GIT binary patch literal 49 ncmca7#4?ou2pEA_28dNa93apEVrC%L1#y7D5JaTq=Q98RUv2}O literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty-translation.po b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty-translation.po new file mode 100644 index 00000000000..ff6f22afb1c --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty-translation.po @@ -0,0 +1,3 @@ +msgid "foo" +msgstr "" + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.csv b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.csv new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.ini b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.ini new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.json b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.mo b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.mo new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.po b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.po new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.xlf new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.yml b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/empty.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/encoding.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/encoding.xlf new file mode 100644 index 00000000000..0a88f926505 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/encoding.xlf @@ -0,0 +1,16 @@ + + + + + + foo + bär + bäz + + + bar + föö + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id-plurals.po b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id-plurals.po new file mode 100644 index 00000000000..c412aa26ec8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id-plurals.po @@ -0,0 +1,10 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" + +msgid "escaped \"foo\"" +msgid_plural "escaped \"foos\"" +msgstr[0] "escaped \"bar\"" +msgstr[1] "escaped \"bars\"" diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id.po b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id.po new file mode 100644 index 00000000000..308eadd9265 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/escaped-id.po @@ -0,0 +1,8 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" + +msgid "escaped \"foo\"" +msgstr "escaped \"bar\"" diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/fuzzy-translations.po b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/fuzzy-translations.po new file mode 100644 index 00000000000..04d4047aa4d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/fuzzy-translations.po @@ -0,0 +1,10 @@ +#, php-format +msgid "foo1" +msgstr "bar1" + +#, fuzzy, php-format +msgid "foo2" +msgstr "fuzzy bar2" + +msgid "foo3" +msgstr "bar3" diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/invalid-xml-resources.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/invalid-xml-resources.xlf new file mode 100644 index 00000000000..7bf6c98ba33 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/invalid-xml-resources.xlf @@ -0,0 +1,23 @@ + + + + + + foo + bar + + + extra + + + key + + + + test + with + note + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/malformed.json b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/malformed.json new file mode 100644 index 00000000000..4563ec6da8d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/malformed.json @@ -0,0 +1,3 @@ +{ + "foo" "bar" +} \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages.yml b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages.yml new file mode 100644 index 00000000000..d4f82d78106 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages.yml @@ -0,0 +1,3 @@ +foo: + bar1: value1 + bar2: value2 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages_linear.yml b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages_linear.yml new file mode 100644 index 00000000000..6c1687d0a36 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/messages_linear.yml @@ -0,0 +1,2 @@ +foo.bar1: value1 +foo.bar2: value2 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.xlf new file mode 100644 index 00000000000..734fc97e413 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.xlf @@ -0,0 +1,11 @@ + + + + + + foo + bar + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.yml b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.yml new file mode 100644 index 00000000000..257cc5642cb --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/non-valid.yml @@ -0,0 +1 @@ +foo diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/plurals.mo b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/plurals.mo new file mode 100644 index 0000000000000000000000000000000000000000..6445e77beab595289cd154ea253c4e49dfd6af47 GIT binary patch literal 74 zcmca7#4?ou2pEA_28dOFm>Gz5fS3b_Eugd`kOrxNfwcU51|TkGNJ=aM;bH~=*B}U7 literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/plurals.po b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/plurals.po new file mode 100644 index 00000000000..439c41ad7fe --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/plurals.po @@ -0,0 +1,5 @@ +msgid "foo" +msgid_plural "foos" +msgstr[0] "bar" +msgstr[1] "bars" + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resname.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resname.xlf new file mode 100644 index 00000000000..2df16af942f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resname.xlf @@ -0,0 +1,19 @@ + + + + + + + bar + + + bar source + baz + + + baz + foo + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/corrupted/resources.dat b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/corrupted/resources.dat new file mode 100644 index 00000000000..391250caa0a --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/corrupted/resources.dat @@ -0,0 +1 @@ +XXX \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/en.res b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/en.res new file mode 100644 index 0000000000000000000000000000000000000000..1fc1436d6641b7290ad5d9f4d331111e4a0419dd GIT binary patch literal 120 zcmY#jxTP+_00K-5L8-+~j7$s+j4WUQFaeZPU<0x^fmjTR8No6P48@hXY594T3_?JD sFheCnE<+kaK0_XmrNCeW#F-4mKr)@7h#{3Bk)Z^rYSk)61{ttf0N1AuGXMYp literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/en.txt b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/en.txt new file mode 100644 index 00000000000..3d9e9eae1c9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/en.txt @@ -0,0 +1,3 @@ +en{ + symfony{"Symfony is great"} +} \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/fr.res b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/fr.res new file mode 100644 index 0000000000000000000000000000000000000000..f58416094be89f5fb64f78f6c3b873c6458696d0 GIT binary patch literal 124 zcmY#jxTP+_00K-5L8-+~j7$s+j4WUQFd@popuh%XaRRY86f=Tl7#NBxbJOzkDj7if wgBdCrav9PX@)`1gECmK5AWmf{W+(yD=?pJ{qL~bd3^_oRt5z{G$biiQ03-qri2wiq literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/fr.txt b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/fr.txt new file mode 100644 index 00000000000..182d0a0de3f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/fr.txt @@ -0,0 +1,3 @@ +fr{ + symfony{"Symfony est génial"} +} \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/packagelist.txt b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/packagelist.txt new file mode 100644 index 00000000000..c5783ed4315 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/packagelist.txt @@ -0,0 +1,2 @@ +en.res +fr.res diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/resources.dat b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resourcebundle/dat/resources.dat new file mode 100644 index 0000000000000000000000000000000000000000..563b0eaef2e5a0a6e9623bf7b93b44beb0a7dc27 GIT binary patch literal 352 zcmY#jxTP+_00K-5&bfImj6fDMm=7VCfD}mH0f<$B_y7!;@F0Xawl zX+>axRdAqyWPVU;u@fWEKt>jzAy5D`TY(M8<^*CfC^BI_d>?DRn Nh9V%%$RGn&2LK231)%@{ literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0-clean.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0-clean.xlf new file mode 100644 index 00000000000..2efa155e656 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0-clean.xlf @@ -0,0 +1,23 @@ + + + + + + foo + bar + + + + + key + + + + + + key.with.cdata + & ]]> + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0.xlf new file mode 100644 index 00000000000..166172a84d1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-2.0.xlf @@ -0,0 +1,25 @@ + + + + + + Quetzal + Quetzal + + + + + + foo + XLIFF 文書を編集ã€ã¾ãŸã¯å‡¦ç† ã™ã‚‹ã‚¢ãƒ—リケーションã§ã™ã€‚ + + + + + bar + XLIFF データ・マãƒãƒ¼ã‚¸ãƒ£ + + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-clean.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-clean.xlf new file mode 100644 index 00000000000..436e19ec98b --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-clean.xlf @@ -0,0 +1,25 @@ + + + +
    + +
    + + + foo + bar + baz + + + key + + baz + qux + + + key.with.cdata + & ]]> + + +
    +
    diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-target-attributes.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-target-attributes.xlf new file mode 100644 index 00000000000..e3afb498b76 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-target-attributes.xlf @@ -0,0 +1,14 @@ + + + +
    + +
    + + + foo + bar + + +
    +
    diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-tool-info.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-tool-info.xlf new file mode 100644 index 00000000000..1ed06d2ac42 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources-tool-info.xlf @@ -0,0 +1,14 @@ + + + +
    + +
    + + + foo + bar + + +
    +
    diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.csv b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.csv new file mode 100644 index 00000000000..374b9eb5eb6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.csv @@ -0,0 +1,4 @@ +"foo"; "bar" +#"bar"; "foo" +"incorrect"; "number"; "columns"; "will"; "be"; "ignored" +"incorrect" \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.dump.json b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.dump.json new file mode 100644 index 00000000000..335965d592c --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.dump.json @@ -0,0 +1 @@ +{"foo":"\u0022bar\u0022"} \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ini b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ini new file mode 100644 index 00000000000..4953062e69e --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ini @@ -0,0 +1 @@ +foo="bar" diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.json b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.json new file mode 100644 index 00000000000..8a79687628f --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.mo b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.mo new file mode 100644 index 0000000000000000000000000000000000000000..0a9660257c07afef243a011d9806d6217e4f1379 GIT binary patch literal 52 pcmca7#4?ou2pEA_28dNa93apEVrC%Lh0=yVnjtMepCKu+2mox%1k?Zk literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.php b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.php new file mode 100644 index 00000000000..c2913985391 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.php @@ -0,0 +1,5 @@ + 'bar', +); diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.po b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.po new file mode 100644 index 00000000000..ccfce6bb98d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.po @@ -0,0 +1,8 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" + +msgid "foo" +msgstr "bar" \ No newline at end of file diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ts b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ts new file mode 100644 index 00000000000..40e18522c85 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.ts @@ -0,0 +1,10 @@ + + + + resources + + foo + bar + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.xlf new file mode 100644 index 00000000000..b0e59880f88 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.xlf @@ -0,0 +1,23 @@ + + + + + + foo + bar + + + extra + + + key + + + + test + with + note + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.yml b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.yml new file mode 100644 index 00000000000..20e9ff3feaa --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/resources.yml @@ -0,0 +1 @@ +foo: bar diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/valid.csv b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/valid.csv new file mode 100644 index 00000000000..59882e5da4d --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/valid.csv @@ -0,0 +1,4 @@ +foo;bar +bar;"foo +foo" +"foo;foo";bar diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/with-attributes.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/with-attributes.xlf new file mode 100644 index 00000000000..78730629cdc --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/with-attributes.xlf @@ -0,0 +1,21 @@ + + + + + + foo + bar + + + extra + bar + + + key + + baz + qux + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/withdoctype.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/withdoctype.xlf new file mode 100644 index 00000000000..f83e834ddc4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/withdoctype.xlf @@ -0,0 +1,12 @@ + + + + + + + foo + bar + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Tests/fixtures/withnote.xlf b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/withnote.xlf new file mode 100644 index 00000000000..b1d3f83a0c7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Tests/fixtures/withnote.xlf @@ -0,0 +1,22 @@ + + + + + + foo + bar + foo + + + extra + bar + + + key + + baz + qux + + + + diff --git a/upload/system/storage/vendor/symfony/translation/Translator.php b/upload/system/storage/vendor/symfony/translation/Translator.php new file mode 100644 index 00000000000..309a2b84697 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Translator.php @@ -0,0 +1,441 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Translation\Loader\LoaderInterface; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Config\ConfigCacheInterface; +use Symfony\Component\Config\ConfigCacheFactoryInterface; +use Symfony\Component\Config\ConfigCacheFactory; + +/** + * Translator. + * + * @author Fabien Potencier + */ +class Translator implements TranslatorInterface, TranslatorBagInterface +{ + /** + * @var MessageCatalogueInterface[] + */ + protected $catalogues = array(); + + /** + * @var string + */ + private $locale; + + /** + * @var array + */ + private $fallbackLocales = array(); + + /** + * @var LoaderInterface[] + */ + private $loaders = array(); + + /** + * @var array + */ + private $resources = array(); + + /** + * @var MessageSelector + */ + private $selector; + + /** + * @var string + */ + private $cacheDir; + + /** + * @var bool + */ + private $debug; + + /** + * @var ConfigCacheFactoryInterface|null + */ + private $configCacheFactory; + + /** + * Constructor. + * + * @param string $locale The locale + * @param MessageSelector|null $selector The message selector for pluralization + * @param string|null $cacheDir The directory to use for the cache + * @param bool $debug Use cache in debug mode ? + * + * @throws \InvalidArgumentException If a locale contains invalid characters + */ + public function __construct($locale, MessageSelector $selector = null, $cacheDir = null, $debug = false) + { + $this->setLocale($locale); + $this->selector = $selector ?: new MessageSelector(); + $this->cacheDir = $cacheDir; + $this->debug = $debug; + } + + /** + * Sets the ConfigCache factory to use. + * + * @param ConfigCacheFactoryInterface $configCacheFactory + */ + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) + { + $this->configCacheFactory = $configCacheFactory; + } + + /** + * Adds a Loader. + * + * @param string $format The name of the loader (@see addResource()) + * @param LoaderInterface $loader A LoaderInterface instance + */ + public function addLoader($format, LoaderInterface $loader) + { + $this->loaders[$format] = $loader; + } + + /** + * Adds a Resource. + * + * @param string $format The name of the loader (@see addLoader()) + * @param mixed $resource The resource name + * @param string $locale The locale + * @param string $domain The domain + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function addResource($format, $resource, $locale, $domain = null) + { + if (null === $domain) { + $domain = 'messages'; + } + + $this->assertValidLocale($locale); + + $this->resources[$locale][] = array($format, $resource, $domain); + + if (in_array($locale, $this->fallbackLocales)) { + $this->catalogues = array(); + } else { + unset($this->catalogues[$locale]); + } + } + + /** + * {@inheritdoc} + */ + public function setLocale($locale) + { + $this->assertValidLocale($locale); + $this->locale = $locale; + } + + /** + * {@inheritdoc} + */ + public function getLocale() + { + return $this->locale; + } + + /** + * Sets the fallback locales. + * + * @param array $locales The fallback locales + * + * @throws \InvalidArgumentException If a locale contains invalid characters + */ + public function setFallbackLocales(array $locales) + { + // needed as the fallback locales are linked to the already loaded catalogues + $this->catalogues = array(); + + foreach ($locales as $locale) { + $this->assertValidLocale($locale); + } + + $this->fallbackLocales = $locales; + } + + /** + * Gets the fallback locales. + * + * @return array $locales The fallback locales + */ + public function getFallbackLocales() + { + return $this->fallbackLocales; + } + + /** + * {@inheritdoc} + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null) + { + if (null === $domain) { + $domain = 'messages'; + } + + return strtr($this->getCatalogue($locale)->get((string) $id, $domain), $parameters); + } + + /** + * {@inheritdoc} + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + { + if (null === $domain) { + $domain = 'messages'; + } + + $id = (string) $id; + $catalogue = $this->getCatalogue($locale); + $locale = $catalogue->getLocale(); + while (!$catalogue->defines($id, $domain)) { + if ($cat = $catalogue->getFallbackCatalogue()) { + $catalogue = $cat; + $locale = $catalogue->getLocale(); + } else { + break; + } + } + + return strtr($this->selector->choose($catalogue->get($id, $domain), (int) $number, $locale), $parameters); + } + + /** + * {@inheritdoc} + */ + public function getCatalogue($locale = null) + { + if (null === $locale) { + $locale = $this->getLocale(); + } else { + $this->assertValidLocale($locale); + } + + if (!isset($this->catalogues[$locale])) { + $this->loadCatalogue($locale); + } + + return $this->catalogues[$locale]; + } + + /** + * Gets the loaders. + * + * @return array LoaderInterface[] + */ + protected function getLoaders() + { + return $this->loaders; + } + + /** + * @param string $locale + */ + protected function loadCatalogue($locale) + { + if (null === $this->cacheDir) { + $this->initializeCatalogue($locale); + } else { + $this->initializeCacheCatalogue($locale); + } + } + + /** + * @param string $locale + */ + protected function initializeCatalogue($locale) + { + $this->assertValidLocale($locale); + + try { + $this->doLoadCatalogue($locale); + } catch (NotFoundResourceException $e) { + if (!$this->computeFallbackLocales($locale)) { + throw $e; + } + } + $this->loadFallbackCatalogues($locale); + } + + /** + * @param string $locale + */ + private function initializeCacheCatalogue($locale) + { + if (isset($this->catalogues[$locale])) { + /* Catalogue already initialized. */ + return; + } + + $this->assertValidLocale($locale); + $cache = $this->getConfigCacheFactory()->cache($this->getCatalogueCachePath($locale), + function (ConfigCacheInterface $cache) use ($locale) { + $this->dumpCatalogue($locale, $cache); + } + ); + + if (isset($this->catalogues[$locale])) { + /* Catalogue has been initialized as it was written out to cache. */ + return; + } + + /* Read catalogue from cache. */ + $this->catalogues[$locale] = include $cache->getPath(); + } + + private function dumpCatalogue($locale, ConfigCacheInterface $cache) + { + $this->initializeCatalogue($locale); + $fallbackContent = $this->getFallbackContent($this->catalogues[$locale]); + + $content = sprintf(<<catalogues[$locale]->all(), true), + $fallbackContent + ); + + $cache->write($content, $this->catalogues[$locale]->getResources()); + } + + private function getFallbackContent(MessageCatalogue $catalogue) + { + $fallbackContent = ''; + $current = ''; + $replacementPattern = '/[^a-z0-9_]/i'; + $fallbackCatalogue = $catalogue->getFallbackCatalogue(); + while ($fallbackCatalogue) { + $fallback = $fallbackCatalogue->getLocale(); + $fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback)); + $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current)); + + $fallbackContent .= sprintf(<<addFallbackCatalogue(\$catalogue%s); + +EOF + , + $fallbackSuffix, + $fallback, + var_export($fallbackCatalogue->all(), true), + $currentSuffix, + $fallbackSuffix + ); + $current = $fallbackCatalogue->getLocale(); + $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); + } + + return $fallbackContent; + } + + private function getCatalogueCachePath($locale) + { + return $this->cacheDir.'/catalogue.'.$locale.'.'.sha1(serialize($this->fallbackLocales)).'.php'; + } + + private function doLoadCatalogue($locale) + { + $this->catalogues[$locale] = new MessageCatalogue($locale); + + if (isset($this->resources[$locale])) { + foreach ($this->resources[$locale] as $resource) { + if (!isset($this->loaders[$resource[0]])) { + throw new \RuntimeException(sprintf('The "%s" translation loader is not registered.', $resource[0])); + } + $this->catalogues[$locale]->addCatalogue($this->loaders[$resource[0]]->load($resource[1], $locale, $resource[2])); + } + } + } + + private function loadFallbackCatalogues($locale) + { + $current = $this->catalogues[$locale]; + + foreach ($this->computeFallbackLocales($locale) as $fallback) { + if (!isset($this->catalogues[$fallback])) { + $this->doLoadCatalogue($fallback); + } + + $fallbackCatalogue = new MessageCatalogue($fallback, $this->catalogues[$fallback]->all()); + foreach ($this->catalogues[$fallback]->getResources() as $resource) { + $fallbackCatalogue->addResource($resource); + } + $current->addFallbackCatalogue($fallbackCatalogue); + $current = $fallbackCatalogue; + } + } + + protected function computeFallbackLocales($locale) + { + $locales = array(); + foreach ($this->fallbackLocales as $fallback) { + if ($fallback === $locale) { + continue; + } + + $locales[] = $fallback; + } + + if (strrchr($locale, '_') !== false) { + array_unshift($locales, substr($locale, 0, -strlen(strrchr($locale, '_')))); + } + + return array_unique($locales); + } + + /** + * Asserts that the locale is valid, throws an Exception if not. + * + * @param string $locale Locale to tests + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + protected function assertValidLocale($locale) + { + if (1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { + throw new \InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale)); + } + } + + /** + * Provides the ConfigCache factory implementation, falling back to a + * default implementation if necessary. + * + * @return ConfigCacheFactoryInterface $configCacheFactory + */ + private function getConfigCacheFactory() + { + if (!$this->configCacheFactory) { + $this->configCacheFactory = new ConfigCacheFactory($this->debug); + } + + return $this->configCacheFactory; + } +} diff --git a/upload/system/storage/vendor/symfony/translation/TranslatorBagInterface.php b/upload/system/storage/vendor/symfony/translation/TranslatorBagInterface.php new file mode 100644 index 00000000000..14fbb17f5e4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/TranslatorBagInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * TranslatorBagInterface. + * + * @author Abdellatif Ait boudad + */ +interface TranslatorBagInterface +{ + /** + * Gets the catalogue by locale. + * + * @param string|null $locale The locale or null to use the default + * + * @return MessageCatalogueInterface + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function getCatalogue($locale = null); +} diff --git a/upload/system/storage/vendor/symfony/translation/TranslatorInterface.php b/upload/system/storage/vendor/symfony/translation/TranslatorInterface.php new file mode 100644 index 00000000000..6916c335bd4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/TranslatorInterface.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * TranslatorInterface. + * + * @author Fabien Potencier + */ +interface TranslatorInterface +{ + /** + * Translates the given message. + * + * @param string $id The message id (may also be an object that can be cast to string) + * @param array $parameters An array of parameters for the message + * @param string|null $domain The domain for the message or null to use the default + * @param string|null $locale The locale or null to use the default + * + * @return string The translated string + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null); + + /** + * Translates the given choice message by choosing a translation according to a number. + * + * @param string $id The message id (may also be an object that can be cast to string) + * @param int $number The number to use to find the indice of the message + * @param array $parameters An array of parameters for the message + * @param string|null $domain The domain for the message or null to use the default + * @param string|null $locale The locale or null to use the default + * + * @return string The translated string + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null); + + /** + * Sets the current locale. + * + * @param string $locale The locale + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function setLocale($locale); + + /** + * Returns the current locale. + * + * @return string The locale + */ + public function getLocale(); +} diff --git a/upload/system/storage/vendor/symfony/translation/Util/ArrayConverter.php b/upload/system/storage/vendor/symfony/translation/Util/ArrayConverter.php new file mode 100644 index 00000000000..60a55e9d370 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Util/ArrayConverter.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Util; + +/** + * ArrayConverter generates tree like structure from a message catalogue. + * e.g. this + * 'foo.bar1' => 'test1', + * 'foo.bar2' => 'test2' + * converts to follows: + * foo: + * bar1: test1 + * bar2: test2. + * + * @author Gennady Telegin + */ +class ArrayConverter +{ + /** + * Converts linear messages array to tree-like array. + * For example this rray('foo.bar' => 'value') will be converted to array('foo' => array('bar' => 'value')). + * + * @param array $messages Linear messages array + * + * @return array Tree-like messages array + */ + public static function expandToTree(array $messages) + { + $tree = array(); + + foreach ($messages as $id => $value) { + $referenceToElement = &self::getElementByPath($tree, explode('.', $id)); + + $referenceToElement = $value; + + unset($referenceToElement); + } + + return $tree; + } + + private static function &getElementByPath(array &$tree, array $parts) + { + $elem = &$tree; + $parentOfElem = null; + + foreach ($parts as $i => $part) { + if (isset($elem[$part]) && is_string($elem[$part])) { + /* Process next case: + * 'foo': 'test1', + * 'foo.bar': 'test2' + * + * $tree['foo'] was string before we found array {bar: test2}. + * Treat new element as string too, e.g. add $tree['foo.bar'] = 'test2'; + */ + $elem = &$elem[ implode('.', array_slice($parts, $i)) ]; + break; + } + $parentOfElem = &$elem; + $elem = &$elem[$part]; + } + + if (is_array($elem) && count($elem) > 0 && $parentOfElem) { + /* Process next case: + * 'foo.bar': 'test1' + * 'foo': 'test2' + * + * $tree['foo'] was array = {bar: 'test1'} before we found string constant `foo`. + * Cancel treating $tree['foo'] as array and cancel back it expansion, + * e.g. make it $tree['foo.bar'] = 'test1' again. + */ + self::cancelExpand($parentOfElem, $part, $elem); + } + + return $elem; + } + + private static function cancelExpand(array &$tree, $prefix, array $node) + { + $prefix .= '.'; + + foreach ($node as $id => $value) { + if (is_string($value)) { + $tree[$prefix.$id] = $value; + } else { + self::cancelExpand($tree, $prefix.$id, $value); + } + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/Writer/TranslationWriter.php b/upload/system/storage/vendor/symfony/translation/Writer/TranslationWriter.php new file mode 100644 index 00000000000..2f5eaa1edf0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/Writer/TranslationWriter.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Writer; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Dumper\DumperInterface; + +/** + * TranslationWriter writes translation messages. + * + * @author Michel Salib + */ +class TranslationWriter +{ + /** + * Dumpers used for export. + * + * @var array + */ + private $dumpers = array(); + + /** + * Adds a dumper to the writer. + * + * @param string $format The format of the dumper + * @param DumperInterface $dumper The dumper + */ + public function addDumper($format, DumperInterface $dumper) + { + $this->dumpers[$format] = $dumper; + } + + /** + * Disables dumper backup. + */ + public function disableBackup() + { + foreach ($this->dumpers as $dumper) { + if (method_exists($dumper, 'setBackup')) { + $dumper->setBackup(false); + } + } + } + + /** + * Obtains the list of supported formats. + * + * @return array + */ + public function getFormats() + { + return array_keys($this->dumpers); + } + + /** + * Writes translation from the catalogue according to the selected format. + * + * @param MessageCatalogue $catalogue The message catalogue to dump + * @param string $format The format to use to dump the messages + * @param array $options Options that are passed to the dumper + * + * @throws \InvalidArgumentException + */ + public function writeTranslations(MessageCatalogue $catalogue, $format, $options = array()) + { + if (!isset($this->dumpers[$format])) { + throw new \InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format)); + } + + // get the right dumper + $dumper = $this->dumpers[$format]; + + if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) { + throw new \RuntimeException(sprintf('Translation Writer was not able to create directory "%s"', $options['path'])); + } + + // save + $dumper->dump($catalogue, $options); + } +} diff --git a/upload/system/storage/vendor/symfony/translation/composer.json b/upload/system/storage/vendor/symfony/translation/composer.json new file mode 100644 index 00000000000..916cd1a1a6b --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/composer.json @@ -0,0 +1,48 @@ +{ + "name": "symfony/translation", + "type": "library", + "description": "Symfony Translation Component", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "suggest": { + "symfony/config": "", + "symfony/yaml": "", + "psr/log": "To use logging capability in translator" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\Translation\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + } +} diff --git a/upload/system/storage/vendor/symfony/translation/phpunit.xml.dist b/upload/system/storage/vendor/symfony/translation/phpunit.xml.dist new file mode 100644 index 00000000000..c25ec5eda69 --- /dev/null +++ b/upload/system/storage/vendor/symfony/translation/phpunit.xml.dist @@ -0,0 +1,28 @@ + + + + + + + + + + ./Tests/ + + + + + + ./ + + ./Tests + ./vendor + + + + diff --git a/upload/system/storage/vendor/symfony/validator/.gitignore b/upload/system/storage/vendor/symfony/validator/.gitignore new file mode 100644 index 00000000000..c49a5d8df5c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/upload/system/storage/vendor/symfony/validator/ClassBasedInterface.php b/upload/system/storage/vendor/symfony/validator/ClassBasedInterface.php new file mode 100644 index 00000000000..c57da274be1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ClassBasedInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * An object backed by a PHP class. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Mapping\ClassMetadataInterface} instead. + */ +interface ClassBasedInterface +{ + /** + * Returns the name of the backing PHP class. + * + * @return string The name of the backing class + */ + public function getClassName(); +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Collection/Optional.php b/upload/system/storage/vendor/symfony/validator/Constraints/Collection/Optional.php new file mode 100644 index 00000000000..fbd3d7a8461 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Collection/Optional.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints\Collection; + +@trigger_error('The '.__NAMESPACE__.'\Optional class is deprecated since Symfony 2.3 and will be removed in 3.0. Use the Symfony\Component\Validator\Constraints\Optional class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Validator\Constraints\Optional as BaseOptional; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + * + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Validator\Constraints\Optional} instead. + */ +class Optional extends BaseOptional +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Collection/Required.php b/upload/system/storage/vendor/symfony/validator/Constraints/Collection/Required.php new file mode 100644 index 00000000000..96f9bc2dded --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Collection/Required.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints\Collection; + +@trigger_error('The '.__NAMESPACE__.'\Required class is deprecated since Symfony 2.3 and will be removed in 3.0. Use the Symfony\Component\Validator\Constraints\Required class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Validator\Constraints\Required as BaseRequired; + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + * + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Validator\Constraints\Required} instead. + */ +class Required extends BaseRequired +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/False.php b/upload/system/storage/vendor/symfony/validator/Constraints/False.php new file mode 100644 index 00000000000..40dcc8e9a73 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/False.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +@trigger_error('The '.__NAMESPACE__.'\False class is deprecated since Symfony 2.7 and will be removed in 3.0. Use the IsFalse class in the same namespace instead.', E_USER_DEPRECATED); + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + * + * @deprecated since version 2.7, to be removed in 3.0. Use IsFalse instead. + */ +class False extends IsFalse +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/FalseValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/FalseValidator.php new file mode 100644 index 00000000000..c54a347f77c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/FalseValidator.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +@trigger_error('The '.__NAMESPACE__.'\FalseValidator class is deprecated since Symfony 2.7 and will be removed in 3.0. Use the IsFalseValidator class in the same namespace instead.', E_USER_DEPRECATED); + +/** + * @author Bernhard Schussek + * + * @deprecated since version 2.7, to be removed in 3.0. Use IsFalseValidator instead. + */ +class FalseValidator extends IsFalseValidator +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/Null.php b/upload/system/storage/vendor/symfony/validator/Constraints/Null.php new file mode 100644 index 00000000000..eef08268bfd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/Null.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +@trigger_error('The '.__NAMESPACE__.'\Null class is deprecated since Symfony 2.7 and will be removed in 3.0. Use the IsNull class in the same namespace instead.', E_USER_DEPRECATED); + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + * + * @deprecated since version 2.7, to be removed in 3.0. Use IsNull instead. + */ +class Null extends IsNull +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/NullValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/NullValidator.php new file mode 100644 index 00000000000..61b6521c836 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/NullValidator.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +@trigger_error('The '.__NAMESPACE__.'\NullValidator class is deprecated since Symfony 2.7 and will be removed in 3.0. Use the IsNullValidator class in the same namespace instead.', E_USER_DEPRECATED); + +/** + * @author Bernhard Schussek + * + * @deprecated since version 2.7, to be removed in 3.0. Use IsNullValidator instead. + */ +class NullValidator extends IsNullValidator +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/True.php b/upload/system/storage/vendor/symfony/validator/Constraints/True.php new file mode 100644 index 00000000000..9dbf4036614 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/True.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +@trigger_error('The '.__NAMESPACE__.'\True class is deprecated since Symfony 2.7 and will be removed in 3.0. Use the IsTrue class in the same namespace instead.', E_USER_DEPRECATED); + +/** + * @Annotation + * @Target({"PROPERTY", "METHOD", "ANNOTATION"}) + * + * @author Bernhard Schussek + * + * @deprecated since version 2.7, to be removed in 3.0. Use IsTrue instead. + */ +class True extends IsTrue +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/TrueValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/TrueValidator.php new file mode 100644 index 00000000000..c4a886b7cee --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Constraints/TrueValidator.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints; + +@trigger_error('The '.__NAMESPACE__.'\TrueValidator class is deprecated since Symfony 2.7 and will be removed in 3.0. Use the IsTrueValidator class in the same namespace instead.', E_USER_DEPRECATED); + +/** + * @author Bernhard Schussek + * + * @deprecated since version 2.7, to be removed in 3.0. Use IsTrueValidator instead. + */ +class TrueValidator extends IsTrueValidator +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContext.php b/upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContext.php new file mode 100644 index 00000000000..8c49c708ed4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContext.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Context; + +@trigger_error('The '.__NAMESPACE__.'\LegacyExecutionContext class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Validator\ValidatorInterface; + +/** + * An execution context that is compatible with the legacy API (< 2.5). + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + */ +class LegacyExecutionContext extends ExecutionContext +{ + /** + * Creates a new context. + * + * @see ExecutionContext::__construct() + * + * @internal Called by {@link LegacyExecutionContextFactory}. Should not be used + * in user code. + */ + public function __construct(ValidatorInterface $validator, $root, MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, $translationDomain = null) + { + parent::__construct( + $validator, + $root, + $translator, + $translationDomain + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContextFactory.php b/upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContextFactory.php new file mode 100644 index 00000000000..3cd4f79198c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Context/LegacyExecutionContextFactory.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Context; + +@trigger_error('The '.__NAMESPACE__.'\LegacyExecutionContextFactory class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Validator\ValidatorInterface; + +/** + * Creates new {@link LegacyExecutionContext} instances. + * + * Implemented for backward compatibility with Symfony < 2.5. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + */ +class LegacyExecutionContextFactory implements ExecutionContextFactoryInterface +{ + private $metadataFactory; + private $translator; + private $translationDomain; + + /** + * Creates a new context factory. + * + * @param MetadataFactoryInterface $metadataFactory The metadata factory + * @param TranslatorInterface $translator The translator + * @param string|null $translationDomain The translation domain + * to use for translating + * violation messages + */ + public function __construct(MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, $translationDomain = null) + { + $this->metadataFactory = $metadataFactory; + $this->translator = $translator; + $this->translationDomain = $translationDomain; + } + + /** + * {@inheritdoc} + */ + public function createContext(ValidatorInterface $validator, $root) + { + return new LegacyExecutionContext( + $validator, + $root, + $this->metadataFactory, + $this->translator, + $this->translationDomain + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/DefaultTranslator.php b/upload/system/storage/vendor/symfony/validator/DefaultTranslator.php new file mode 100644 index 00000000000..cd9b5d83854 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/DefaultTranslator.php @@ -0,0 +1,171 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +@trigger_error('The class '.__NAMESPACE__.'\DefaultTranslator is deprecated since Symfony 2.7 and will be removed in 3.0. Use Symfony\Component\Translation\IdentityTranslator instead.', E_USER_DEPRECATED); + +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\Exception\BadMethodCallException; +use Symfony\Component\Validator\Exception\InvalidArgumentException; + +/** + * Simple translator implementation that simply replaces the parameters in + * the message IDs. + * + * Example usage: + * + * $translator = new DefaultTranslator(); + * + * echo $translator->trans( + * 'This is a {{ var }}.', + * array('{{ var }}' => 'donkey') + * ); + * + * // -> This is a donkey. + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 3, + * array('{{ count }}' => 'three') + * ); + * + * // -> These are three donkeys. + * + * This translator does not support message catalogs, translation domains or + * locales. Instead, it implements a subset of the capabilities of + * {@link \Symfony\Component\Translation\Translator} and can be used in places + * where translation is not required by default but should be optional. + * + * @deprecated since version 2.7, to be removed in 3.0. Use Symfony\Component\Translation\IdentityTranslator instead. + * + * @author Bernhard Schussek + */ +class DefaultTranslator implements TranslatorInterface +{ + /** + * Interpolates the given message. + * + * Parameters are replaced in the message in the same manner that + * {@link strtr()} uses. + * + * Example usage: + * + * $translator = new DefaultTranslator(); + * + * echo $translator->trans( + * 'This is a {{ var }}.', + * array('{{ var }}' => 'donkey') + * ); + * + * // -> This is a donkey. + * + * @param string $id The message id + * @param array $parameters An array of parameters for the message + * @param string $domain Ignored + * @param string $locale Ignored + * + * @return string The interpolated string + */ + public function trans($id, array $parameters = array(), $domain = null, $locale = null) + { + return strtr($id, $parameters); + } + + /** + * Interpolates the given choice message by choosing a variant according to a number. + * + * The variants are passed in the message ID using the format + * "|". "" is chosen if the passed $number is + * exactly 1. "" is chosen otherwise. + * + * This format is consistent with the format supported by + * {@link \Symfony\Component\Translation\Translator}, but it does not + * have the same expressiveness. While Translator supports intervals in + * message translations, which are needed for languages other than English, + * this translator does not. You should use Translator or a custom + * implementation of {@link \Symfony\Component\Translation\TranslatorInterface} if you need this or similar + * functionality. + * + * Example usage: + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 0, + * array('{{ count }}' => 0) + * ); + * + * // -> These are 0 donkeys. + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 1, + * array('{{ count }}' => 1) + * ); + * + * // -> This is 1 donkey. + * + * echo $translator->transChoice( + * 'This is {{ count }} donkey.|These are {{ count }} donkeys.', + * 3, + * array('{{ count }}' => 3) + * ); + * + * // -> These are 3 donkeys. + * + * @param string $id The message id + * @param int $number The number to use to find the index of the message + * @param array $parameters An array of parameters for the message + * @param string $domain Ignored + * @param string $locale Ignored + * + * @return string The translated string + * + * @throws InvalidArgumentException if the message id does not have the format + * "singular|plural" + */ + public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) + { + $ids = explode('|', $id); + + if (1 == $number) { + return strtr($ids[0], $parameters); + } + + if (!isset($ids[1])) { + throw new InvalidArgumentException(sprintf('The message "%s" cannot be pluralized, because it is missing a plural (e.g. "There is one apple|There are %%count%% apples").', $id)); + } + + return strtr($ids[1], $parameters); + } + + /** + * Not supported. + * + * @param string $locale The locale + * + * @throws BadMethodCallException + */ + public function setLocale($locale) + { + throw new BadMethodCallException('Unsupported method.'); + } + + /** + * Returns the locale of the translator. + * + * @return string Always returns 'en' + */ + public function getLocale() + { + return 'en'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ExecutionContext.php b/upload/system/storage/vendor/symfony/validator/ExecutionContext.php new file mode 100644 index 00000000000..8d93e69eec0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ExecutionContext.php @@ -0,0 +1,269 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +@trigger_error('The '.__NAMESPACE__.'\ExecutionContext class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Context\ExecutionContext class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Translation\TranslatorInterface; + +/** + * Default implementation of {@link ExecutionContextInterface}. + * + * This class is immutable by design. + * + * @author Fabien Potencier + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Context\ExecutionContext} instead. + */ +class ExecutionContext implements ExecutionContextInterface +{ + private $globalContext; + private $translator; + private $translationDomain; + private $metadata; + private $value; + private $group; + private $propertyPath; + + /** + * Creates a new execution context. + * + * @param GlobalExecutionContextInterface $globalContext The global context storing node-independent state + * @param TranslatorInterface $translator The translator for translating violation messages + * @param string|null $translationDomain The domain of the validation messages + * @param MetadataInterface $metadata The metadata of the validated node + * @param mixed $value The value of the validated node + * @param string $group The current validation group + * @param string $propertyPath The property path to the current node + */ + public function __construct(GlobalExecutionContextInterface $globalContext, TranslatorInterface $translator, $translationDomain = null, MetadataInterface $metadata = null, $value = null, $group = null, $propertyPath = '') + { + if (null === $group) { + $group = Constraint::DEFAULT_GROUP; + } + + $this->globalContext = $globalContext; + $this->translator = $translator; + $this->translationDomain = $translationDomain; + $this->metadata = $metadata; + $this->value = $value; + $this->propertyPath = $propertyPath; + $this->group = $group; + } + + /** + * {@inheritdoc} + */ + public function addViolation($message, array $params = array(), $invalidValue = null, $plural = null, $code = null) + { + if (null === $plural) { + $translatedMessage = $this->translator->trans($message, $params, $this->translationDomain); + } else { + try { + $translatedMessage = $this->translator->transChoice($message, $plural, $params, $this->translationDomain); + } catch (\InvalidArgumentException $e) { + $translatedMessage = $this->translator->trans($message, $params, $this->translationDomain); + } + } + + $this->globalContext->getViolations()->add(new ConstraintViolation( + $translatedMessage, + $message, + $params, + $this->globalContext->getRoot(), + $this->propertyPath, + // check using func_num_args() to allow passing null values + \func_num_args() >= 3 ? $invalidValue : $this->value, + $plural, + $code + )); + } + + /** + * {@inheritdoc} + */ + public function addViolationAt($subPath, $message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null) + { + $this->globalContext->getViolations()->add(new ConstraintViolation( + null === $plural + ? $this->translator->trans($message, $parameters, $this->translationDomain) + : $this->translator->transChoice($message, $plural, $parameters, $this->translationDomain), + $message, + $parameters, + $this->globalContext->getRoot(), + $this->getPropertyPath($subPath), + // check using func_num_args() to allow passing null values + \func_num_args() >= 4 ? $invalidValue : $this->value, + $plural, + $code + )); + } + + /** + * {@inheritdoc} + */ + public function getViolations() + { + return $this->globalContext->getViolations(); + } + + /** + * {@inheritdoc} + */ + public function getRoot() + { + return $this->globalContext->getRoot(); + } + + /** + * {@inheritdoc} + */ + public function getPropertyPath($subPath = '') + { + if ('' != $subPath && '' !== $this->propertyPath && '[' !== $subPath[0]) { + return $this->propertyPath.'.'.$subPath; + } + + return $this->propertyPath.$subPath; + } + + /** + * {@inheritdoc} + */ + public function getClassName() + { + if ($this->metadata instanceof ClassBasedInterface) { + return $this->metadata->getClassName(); + } + } + + /** + * {@inheritdoc} + */ + public function getPropertyName() + { + if ($this->metadata instanceof PropertyMetadataInterface) { + return $this->metadata->getPropertyName(); + } + } + + /** + * {@inheritdoc} + */ + public function getValue() + { + return $this->value; + } + + /** + * {@inheritdoc} + */ + public function getGroup() + { + return $this->group; + } + + /** + * {@inheritdoc} + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * {@inheritdoc} + */ + public function getMetadataFor($value) + { + return $this->globalContext->getMetadataFactory()->getMetadataFor($value); + } + + /** + * {@inheritdoc} + */ + public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false) + { + $propertyPath = $this->getPropertyPath($subPath); + + $visitor = $this->globalContext->getVisitor(); + foreach ($this->resolveGroups($groups) as $group) { + $visitor->validate($value, $group, $propertyPath, $traverse, $deep); + } + } + + /** + * {@inheritdoc} + */ + public function validateValue($value, $constraints, $subPath = '', $groups = null) + { + $constraints = \is_array($constraints) ? $constraints : array($constraints); + + if (null === $groups && '' === $subPath) { + $context = clone $this; + $context->value = $value; + $context->executeConstraintValidators($value, $constraints); + + return; + } + + $propertyPath = $this->getPropertyPath($subPath); + + foreach ($this->resolveGroups($groups) as $group) { + $context = clone $this; + $context->value = $value; + $context->group = $group; + $context->propertyPath = $propertyPath; + $context->executeConstraintValidators($value, $constraints); + } + } + + /** + * {@inheritdoc} + */ + public function getMetadataFactory() + { + return $this->globalContext->getMetadataFactory(); + } + + /** + * Executes the validators of the given constraints for the given value. + * + * @param mixed $value The value to validate + * @param Constraint[] $constraints The constraints to match against + */ + private function executeConstraintValidators($value, array $constraints) + { + foreach ($constraints as $constraint) { + $validator = $this->globalContext->getValidatorFactory()->getInstance($constraint); + $validator->initialize($this); + $validator->validate($value, $constraint); + } + } + + /** + * Returns an array of group names. + * + * @param string|string[]|null $groups The groups to resolve. If a single string is + * passed, it is converted to an array. If null + * is passed, an array containing the current + * group of the context is returned. + * + * @return array An array of validation groups + */ + private function resolveGroups($groups) + { + return $groups ? (array) $groups : (array) $this->group; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ExecutionContextInterface.php b/upload/system/storage/vendor/symfony/validator/ExecutionContextInterface.php new file mode 100644 index 00000000000..4d5d2f6f65f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ExecutionContextInterface.php @@ -0,0 +1,299 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Stores the validator's state during validation. + * + * For example, let's validate the following object graph: + * + * (Person)---($firstName: string) + * \ + * ($address: Address)---($street: string) + * + * We validate the Person instance, which becomes the "root" of the + * validation run (see {@link getRoot}). The state of the context after the + * first step will be like this: + * + * (Person)---($firstName: string) + * ^ \ + * ($address: Address)---($street: string) + * + * The validator is stopped at the Person node, both the root and the + * value (see {@link getValue}) of the context point to the Person + * instance. The property path is empty at this point (see {@link getPropertyPath}). + * The metadata of the context is the metadata of the Person node + * (see {@link getMetadata}). + * + * After advancing to the property $firstName of the Person + * instance, the state of the context looks like this: + * + * (Person)---($firstName: string) + * \ ^ + * ($address: Address)---($street: string) + * + * The validator is stopped at the property $firstName. The root still + * points to the Person instance, because this is where the validation + * started. The property path is now "firstName" and the current value is the + * value of that property. + * + * After advancing to the $address property and then to the + * $street property of the Address instance, the context state + * looks like this: + * + * (Person)---($firstName: string) + * \ + * ($address: Address)---($street: string) + * ^ + * + * The validator is stopped at the property $street. The root still + * points to the Person instance, but the property path is now + * "address.street" and the validated value is the value of that property. + * + * Apart from the root, the property path and the currently validated value, + * the execution context also knows the metadata of the current node (see + * {@link getMetadata}) which for example returns a {@link Mapping\PropertyMetadata} + * or a {@link Mapping\ClassMetadata} object. he context also contains the + * validation group that is currently being validated (see {@link getGroup}) and + * the violations that happened up until now (see {@link getViolations}). + * + * Apart from reading the execution context, you can also use + * {@link addViolation} or {@link addViolationAt} to add new violations and + * {@link validate} or {@link validateValue} to validate values that the + * validator otherwise would not reach. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Context\ExecutionContextInterface} instead. + */ +interface ExecutionContextInterface +{ + /** + * Adds a violation at the current node of the validation graph. + * + * Note: the parameters $invalidValue, $plural and $code are deprecated since version 2.5 and will be removed in 3.0. + * + * @param string $message The error message + * @param array $params The parameters substituted in the error message + * @param mixed $invalidValue The invalid, validated value + * @param int|null $plural The number to use to pluralize of the message + * @param int|null $code The violation code + */ + public function addViolation($message, array $params = array(), $invalidValue = null, $plural = null, $code = null); + + /** + * Adds a violation at the validation graph node with the given property + * path relative to the current property path. + * + * @param string $subPath The relative property path for the violation + * @param string $message The error message + * @param array $parameters The parameters substituted in the error message + * @param mixed $invalidValue The invalid, validated value + * @param int|null $plural The number to use to pluralize of the message + * @param int|null $code The violation code + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Context\ExecutionContextInterface::buildViolation()} + * instead. + */ + public function addViolationAt($subPath, $message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null); + + /** + * Validates the given value within the scope of the current validation. + * + * The value may be any value recognized by the used metadata factory + * (see {@link MetadataFactoryInterface::getMetadata}), or an array or a + * traversable object of such values. + * + * Usually you validate a value that is not the current node of the + * execution context. For this case, you can pass the {@link $subPath} + * argument which is appended to the current property path when a violation + * is created. For example, take the following object graph: + * + * (Person)---($address: Address)---($phoneNumber: PhoneNumber) + * + * When the execution context stops at the Person instance, the + * property path is "address". When you validate the PhoneNumber + * instance now, pass "phoneNumber" as sub path to correct the property path + * to "address.phoneNumber": + * + * $context->validate($address->phoneNumber, 'phoneNumber'); + * + * Any violations generated during the validation will be added to the + * violation list that you can access with {@link getViolations}. + * + * @param mixed $value The value to validate + * @param string $subPath The path to append to the context's property path + * @param string|string[]|null $groups The groups to validate in. If you don't pass any + * groups here, the current group of the context + * will be used. + * @param bool $traverse Whether to traverse the value if it is an array + * or an instance of \Traversable + * @param bool $deep Whether to traverse the value recursively if + * it is a collection of collections + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Context\ExecutionContextInterface::getValidator()} + * instead. + */ + public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false); + + /** + * Validates a value against a constraint. + * + * Use the parameter $subPath to adapt the property path for the + * validated value. For example, take the following object graph: + * + * (Person)---($address: Address)---($street: string) + * + * When the validator validates the Address instance, the + * property path stored in the execution context is "address". When you + * manually validate the property $street now, pass the sub path + * "street" to adapt the full property path to "address.street": + * + * $context->validate($address->street, new NotNull(), 'street'); + * + * @param mixed $value The value to validate + * @param Constraint|Constraint[] $constraints The constraint(s) to validate against + * @param string $subPath The path to append to the context's property path + * @param string|string[]|null $groups The groups to validate in. If you don't pass any + * groups here, the current group of the context + * will be used. + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Context\ExecutionContextInterface::getValidator()} + * instead. + */ + public function validateValue($value, $constraints, $subPath = '', $groups = null); + + /** + * Returns the violations generated by the validator so far. + * + * @return ConstraintViolationListInterface The constraint violation list + */ + public function getViolations(); + + /** + * Returns the value at which validation was started in the object graph. + * + * The validator, when given an object, traverses the properties and + * related objects and their properties. The root of the validation is the + * object from which the traversal started. + * + * The current value is returned by {@link getValue}. + * + * @return mixed The root value of the validation + */ + public function getRoot(); + + /** + * Returns the value that the validator is currently validating. + * + * If you want to retrieve the object that was originally passed to the + * validator, use {@link getRoot}. + * + * @return mixed The currently validated value + */ + public function getValue(); + + /** + * Returns the metadata for the currently validated value. + * + * With the core implementation, this method returns a + * {@link Mapping\ClassMetadata} instance if the current value is an object, + * a {@link Mapping\PropertyMetadata} instance if the current value is + * the value of a property and a {@link Mapping\GetterMetadata} instance if + * the validated value is the result of a getter method. + * + * If the validated value is neither of these, for example if the validator + * has been called with a plain value and constraint, this method returns + * null. + * + * @return MetadataInterface|null the metadata of the currently validated + * value + */ + public function getMetadata(); + + /** + * Returns the used metadata factory. + * + * @return MetadataFactoryInterface The metadata factory + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Context\ExecutionContextInterface::getValidator()} + * instead and call + * {@link Validator\ValidatorInterface::getMetadataFor()} or + * {@link Validator\ValidatorInterface::hasMetadataFor()} there. + */ + public function getMetadataFactory(); + + /** + * Returns the validation group that is currently being validated. + * + * @return string The current validation group + */ + public function getGroup(); + + /** + * Returns the class name of the current node. + * + * If the metadata of the current node does not implement + * {@link ClassBasedInterface} or if no metadata is available for the + * current node, this method returns null. + * + * @return string|null The class name or null, if no class name could be found + */ + public function getClassName(); + + /** + * Returns the property name of the current node. + * + * If the metadata of the current node does not implement + * {@link PropertyMetadataInterface} or if no metadata is available for the + * current node, this method returns null. + * + * @return string|null The property name or null, if no property name could be found + */ + public function getPropertyName(); + + /** + * Returns the property path to the value that the validator is currently + * validating. + * + * For example, take the following object graph: + * + * (Person)---($address: Address)---($street: string) + * + * When the Person instance is passed to the validator, the + * property path is initially empty. When the $address property + * of that person is validated, the property path is "address". When + * the $street property of the related Address instance + * is validated, the property path is "address.street". + * + * Properties of objects are prefixed with a dot in the property path. + * Indices of arrays or objects implementing the {@link \ArrayAccess} + * interface are enclosed in brackets. For example, if the property in + * the previous example is $addresses and contains an array + * of Address instance, the property path generated for the + * $street property of one of these addresses is for example + * "addresses[0].street". + * + * @param string $subPath Optional. The suffix appended to the current + * property path. + * + * @return string The current property path. The result may be an empty + * string if the validator is currently validating the + * root value of the validation graph. + */ + public function getPropertyPath($subPath = ''); +} diff --git a/upload/system/storage/vendor/symfony/validator/GlobalExecutionContextInterface.php b/upload/system/storage/vendor/symfony/validator/GlobalExecutionContextInterface.php new file mode 100644 index 00000000000..d9bd315afd2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/GlobalExecutionContextInterface.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Stores the node-independent state of a validation run. + * + * When the validator validates a graph of objects, it uses two classes to + * store the state during the validation: + * + *
      + *
    • For each node in the validation graph (objects, properties, getters) the + * validator creates an instance of {@link ExecutionContextInterface} that + * stores the information about that node.
    • + *
    • One single GlobalExecutionContextInterface stores the state + * that is independent of the current node.
    • + *
    + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Context\ExecutionContextInterface} instead. + */ +interface GlobalExecutionContextInterface +{ + /** + * Returns the violations generated by the validator so far. + * + * @return ConstraintViolationListInterface A list of constraint violations + */ + public function getViolations(); + + /** + * Returns the value at which validation was started in the object graph. + * + * @return mixed The root value + * + * @see ExecutionContextInterface::getRoot() + */ + public function getRoot(); + + /** + * Returns the visitor instance used to validate the object graph nodes. + * + * @return ValidationVisitorInterface The validation visitor + */ + public function getVisitor(); + + /** + * Returns the factory for constraint validators. + * + * @return ConstraintValidatorFactoryInterface The constraint validator factory + */ + public function getValidatorFactory(); + + /** + * Returns the factory for validation metadata objects. + * + * @return MetadataFactoryInterface The metadata factory + */ + public function getMetadataFactory(); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/BlackholeMetadataFactory.php b/upload/system/storage/vendor/symfony/validator/Mapping/BlackholeMetadataFactory.php new file mode 100644 index 00000000000..34a3b44e72f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/BlackholeMetadataFactory.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +@trigger_error('The '.__NAMESPACE__.'\BlackholeMetadataFactory class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\Factory\BlackHoleMetadataFactory class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Validator\Mapping\Factory\BlackHoleMetadataFactory as MappingBlackHoleMetadataFactory; + +/** + * Alias of {@link Factory\BlackHoleMetadataFactory}. + * + * @author Fabien Potencier + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Factory\BlackHoleMetadataFactory} instead. + */ +class BlackholeMetadataFactory extends MappingBlackHoleMetadataFactory +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Cache/ApcCache.php b/upload/system/storage/vendor/symfony/validator/Mapping/Cache/ApcCache.php new file mode 100644 index 00000000000..0adaf047e27 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Cache/ApcCache.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Cache; + +@trigger_error('The '.__NAMESPACE__.'\ApcCache class is deprecated since Symfony 2.5 and will be removed in 3.0. Use DoctrineCache with the Doctrine\Common\Cache\ApcCache class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * @deprecated since version 2.5, to be removed in 3.0. + * Use DoctrineCache with \Doctrine\Common\Cache\ApcCache instead. + */ +class ApcCache implements CacheInterface +{ + private $prefix; + + public function __construct($prefix) + { + if (!\extension_loaded('apc')) { + throw new \RuntimeException('Unable to use ApcCache to cache validator mappings as APC is not enabled.'); + } + + $this->prefix = $prefix; + } + + public function has($class) + { + if (!\function_exists('apc_exists')) { + $exists = false; + + apc_fetch($this->prefix.$class, $exists); + + return $exists; + } + + return apc_exists($this->prefix.$class); + } + + public function read($class) + { + return apc_fetch($this->prefix.$class); + } + + public function write(ClassMetadata $metadata) + { + apc_store($this->prefix.$metadata->getClassName(), $metadata); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Cache/CacheInterface.php b/upload/system/storage/vendor/symfony/validator/Mapping/Cache/CacheInterface.php new file mode 100644 index 00000000000..f770f461540 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Cache/CacheInterface.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Cache; + +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Persists ClassMetadata instances in a cache. + * + * @author Bernhard Schussek + */ +interface CacheInterface +{ + /** + * Returns whether metadata for the given class exists in the cache. + * + * @param string $class + */ + public function has($class); + + /** + * Returns the metadata for the given class from the cache. + * + * @param string $class Class Name + * + * @return ClassMetadata|false A ClassMetadata instance or false on miss + */ + public function read($class); + + /** + * Stores a class metadata in the cache. + */ + public function write(ClassMetadata $metadata); +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Cache/DoctrineCache.php b/upload/system/storage/vendor/symfony/validator/Mapping/Cache/DoctrineCache.php new file mode 100644 index 00000000000..36f1febc5ac --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Cache/DoctrineCache.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Cache; + +use Doctrine\Common\Cache\Cache; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +/** + * Adapts a Doctrine cache to a CacheInterface. + * + * @author Florian Voutzinos + */ +final class DoctrineCache implements CacheInterface +{ + private $cache; + + public function __construct(Cache $cache) + { + $this->cache = $cache; + } + + public function setCache(Cache $cache) + { + $this->cache = $cache; + } + + /** + * {@inheritdoc} + */ + public function has($class) + { + return $this->cache->contains($class); + } + + /** + * {@inheritdoc} + */ + public function read($class) + { + return $this->cache->fetch($class); + } + + /** + * {@inheritdoc} + */ + public function write(ClassMetadata $metadata) + { + $this->cache->save($metadata->getClassName(), $metadata); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataFactory.php b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataFactory.php new file mode 100644 index 00000000000..17c459bc300 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadataFactory.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +@trigger_error('The '.__NAMESPACE__.'\ClassMetadataFactory class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; + +/** + * Alias of {@link LazyLoadingMetadataFactory}. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link LazyLoadingMetadataFactory} instead. + */ +class ClassMetadataFactory extends LazyLoadingMetadataFactory +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/ElementMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/ElementMetadata.php new file mode 100644 index 00000000000..2c9b080903b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Mapping/ElementMetadata.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping; + +/** + * Contains the metadata of a structural element. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Extend {@link GenericMetadata} instead. + */ +abstract class ElementMetadata extends GenericMetadata +{ + public function __construct() + { + if (!$this instanceof MemberMetadata && !$this instanceof ClassMetadata) { + @trigger_error('The '.__CLASS__.' class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\GenericMetadata class instead.', E_USER_DEPRECATED); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/MetadataFactoryInterface.php b/upload/system/storage/vendor/symfony/validator/MetadataFactoryInterface.php new file mode 100644 index 00000000000..555bea9aa21 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/MetadataFactoryInterface.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Returns {@link MetadataInterface} instances for values. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Mapping\Factory\MetadataFactoryInterface} instead. + */ +interface MetadataFactoryInterface +{ + /** + * Returns the metadata for the given value. + * + * @param mixed $value Some value + * + * @return MetadataInterface The metadata for the value + * + * @throws Exception\NoSuchMetadataException If no metadata exists for the given value + */ + public function getMetadataFor($value); + + /** + * Returns whether the class is able to return metadata for the given value. + * + * @param mixed $value Some value + * + * @return bool Whether metadata can be returned for that value + */ + public function hasMetadataFor($value); +} diff --git a/upload/system/storage/vendor/symfony/validator/MetadataInterface.php b/upload/system/storage/vendor/symfony/validator/MetadataInterface.php new file mode 100644 index 00000000000..2c8944903c6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/MetadataInterface.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * A container for validation metadata. + * + * The container contains constraints that may belong to different validation + * groups. Constraints for a specific group can be fetched by calling + * {@link findConstraints}. + * + * Implement this interface to add validation metadata to your own metadata + * layer. Each metadata may have named properties. Each property can be + * represented by one or more {@link PropertyMetadataInterface} instances that + * are returned by {@link getPropertyMetadata}. Since + * PropertyMetadataInterface inherits from MetadataInterface, + * each property may be divided into further properties. + * + * The {@link accept} method of each metadata implements the Visitor pattern. + * The method should forward the call to the visitor's + * {@link ValidationVisitorInterface::visit} method and additionally call + * accept() on all structurally related metadata instances. + * + * For example, to store constraints for PHP classes and their properties, + * create a class ClassMetadata (implementing MetadataInterface) + * and a class PropertyMetadata (implementing PropertyMetadataInterface). + * ClassMetadata::getPropertyMetadata($property) returns all + * PropertyMetadata instances for a property of that class. Its + * accept()-method simply forwards to ValidationVisitorInterface::visit() + * and calls accept() on all contained PropertyMetadata + * instances, which themselves call ValidationVisitorInterface::visit() + * again. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Mapping\MetadataInterface} instead. + */ +interface MetadataInterface +{ + /** + * Implementation of the Visitor design pattern. + * + * Calls {@link ValidationVisitorInterface::visit} and then forwards the + * accept()-call to all property metadata instances. + * + * @param ValidationVisitorInterface $visitor The visitor implementing the validation logic + * @param mixed $value The value to validate + * @param string|string[] $group The validation group to validate in + * @param string $propertyPath The current property path in the validation graph + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath); + + /** + * Returns all constraints for a given validation group. + * + * @param string $group The validation group + * + * @return Constraint[] A list of constraint instances + */ + public function findConstraints($group); +} diff --git a/upload/system/storage/vendor/symfony/validator/PropertyMetadataContainerInterface.php b/upload/system/storage/vendor/symfony/validator/PropertyMetadataContainerInterface.php new file mode 100644 index 00000000000..b5c9cf4da9d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/PropertyMetadataContainerInterface.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * A container for {@link PropertyMetadataInterface} instances. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Mapping\ClassMetadataInterface} instead. + */ +interface PropertyMetadataContainerInterface +{ + /** + * Check if there's any metadata attached to the given named property. + * + * @param string $property The property name + * + * @return bool + */ + public function hasPropertyMetadata($property); + + /** + * Returns all metadata instances for the given named property. + * + * If your implementation does not support properties, simply throw an + * exception in this method (for example a BadMethodCallException). + * + * @param string $property The property name + * + * @return PropertyMetadataInterface[] A list of metadata instances. Empty if + * no metadata exists for the property. + */ + public function getPropertyMetadata($property); +} diff --git a/upload/system/storage/vendor/symfony/validator/PropertyMetadataInterface.php b/upload/system/storage/vendor/symfony/validator/PropertyMetadataInterface.php new file mode 100644 index 00000000000..64ae881e320 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/PropertyMetadataInterface.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * A container for validation metadata of a property. + * + * What exactly you define as "property" is up to you. The validator expects + * implementations of {@link MetadataInterface} that contain constraints and + * optionally a list of named properties that also have constraints (and may + * have further sub properties). Such properties are mapped by implementations + * of this interface. + * + * @author Bernhard Schussek + * + * @see MetadataInterface + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Mapping\PropertyMetadataInterface} instead. + */ +interface PropertyMetadataInterface extends MetadataInterface +{ + /** + * Returns the name of the property. + * + * @return string The property name + */ + public function getPropertyName(); + + /** + * Extracts the value of the property from the given container. + * + * @param mixed $containingValue The container to extract the property value from + * + * @return mixed The value of the property + */ + public function getPropertyValue($containingValue); +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/ConstraintTest.php b/upload/system/storage/vendor/symfony/validator/Tests/ConstraintTest.php new file mode 100644 index 00000000000..a05741490fd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/ConstraintTest.php @@ -0,0 +1,245 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Tests\Fixtures\ClassConstraint; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintC; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithValue; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintWithValueAsDefault; + +class ConstraintTest extends TestCase +{ + public function testSetProperties() + { + $constraint = new ConstraintA(array( + 'property1' => 'foo', + 'property2' => 'bar', + )); + + $this->assertEquals('foo', $constraint->property1); + $this->assertEquals('bar', $constraint->property2); + } + + public function testSetNotExistingPropertyThrowsException() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\InvalidOptionsException'); + + new ConstraintA(array( + 'foo' => 'bar', + )); + } + + public function testMagicPropertiesAreNotAllowed() + { + $constraint = new ConstraintA(); + + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\InvalidOptionsException'); + + $constraint->foo = 'bar'; + } + + public function testInvalidAndRequiredOptionsPassed() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\InvalidOptionsException'); + + new ConstraintC(array( + 'option1' => 'default', + 'foo' => 'bar', + )); + } + + public function testSetDefaultProperty() + { + $constraint = new ConstraintA('foo'); + + $this->assertEquals('foo', $constraint->property2); + } + + public function testSetDefaultPropertyDoctrineStyle() + { + $constraint = new ConstraintA(array('value' => 'foo')); + + $this->assertEquals('foo', $constraint->property2); + } + + public function testSetDefaultPropertyDoctrineStylePlusOtherProperty() + { + $constraint = new ConstraintA(array('value' => 'foo', 'property1' => 'bar')); + + $this->assertEquals('foo', $constraint->property2); + $this->assertEquals('bar', $constraint->property1); + } + + public function testSetDefaultPropertyDoctrineStyleWhenDefaultPropertyIsNamedValue() + { + $constraint = new ConstraintWithValueAsDefault(array('value' => 'foo')); + + $this->assertEquals('foo', $constraint->value); + $this->assertNull($constraint->property); + } + + public function testDontSetDefaultPropertyIfValuePropertyExists() + { + $constraint = new ConstraintWithValue(array('value' => 'foo')); + + $this->assertEquals('foo', $constraint->value); + $this->assertNull($constraint->property); + } + + public function testSetUndefinedDefaultProperty() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); + + new ConstraintB('foo'); + } + + public function testRequiredOptionsMustBeDefined() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\MissingOptionsException'); + + new ConstraintC(); + } + + public function testRequiredOptionsPassed() + { + $constraint = new ConstraintC(array('option1' => 'default')); + + $this->assertSame('default', $constraint->option1); + } + + public function testGroupsAreConvertedToArray() + { + $constraint = new ConstraintA(array('groups' => 'Foo')); + + $this->assertEquals(array('Foo'), $constraint->groups); + } + + public function testAddDefaultGroupAddsGroup() + { + $constraint = new ConstraintA(array('groups' => 'Default')); + $constraint->addImplicitGroupName('Foo'); + $this->assertEquals(array('Default', 'Foo'), $constraint->groups); + } + + public function testAllowsSettingZeroRequiredPropertyValue() + { + $constraint = new ConstraintA(0); + $this->assertEquals(0, $constraint->property2); + } + + public function testCanCreateConstraintWithNoDefaultOptionAndEmptyArray() + { + $constraint = new ConstraintB(array()); + + $this->assertSame(array(Constraint::PROPERTY_CONSTRAINT, Constraint::CLASS_CONSTRAINT), $constraint->getTargets()); + } + + public function testGetTargetsCanBeString() + { + $constraint = new ClassConstraint(); + + $this->assertEquals('class', $constraint->getTargets()); + } + + public function testGetTargetsCanBeArray() + { + $constraint = new ConstraintA(); + + $this->assertEquals(array('property', 'class'), $constraint->getTargets()); + } + + public function testSerialize() + { + $constraint = new ConstraintA(array( + 'property1' => 'foo', + 'property2' => 'bar', + )); + + $restoredConstraint = unserialize(serialize($constraint)); + + $this->assertEquals($constraint, $restoredConstraint); + } + + public function testSerializeInitializesGroupsOptionToDefault() + { + $constraint = new ConstraintA(array( + 'property1' => 'foo', + 'property2' => 'bar', + )); + + $constraint = unserialize(serialize($constraint)); + + $expected = new ConstraintA(array( + 'property1' => 'foo', + 'property2' => 'bar', + 'groups' => 'Default', + )); + + $this->assertEquals($expected, $constraint); + } + + public function testSerializeKeepsCustomGroups() + { + $constraint = new ConstraintA(array( + 'property1' => 'foo', + 'property2' => 'bar', + 'groups' => 'MyGroup', + )); + + $constraint = unserialize(serialize($constraint)); + + $this->assertSame(array('MyGroup'), $constraint->groups); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\InvalidArgumentException + */ + public function testGetErrorNameForUnknownCode() + { + Constraint::getErrorName(1); + } + + public function testOptionsAsDefaultOption() + { + $constraint = new ConstraintA($options = array('value1')); + + $this->assertEquals($options, $constraint->property2); + + $constraint = new ConstraintA($options = array('value1', 'property1' => 'value2')); + + $this->assertEquals($options, $constraint->property2); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\InvalidOptionsException + * @expectedExceptionMessage The options "0", "5" do not exist + */ + public function testInvalidOptions() + { + new ConstraintA(array('property2' => 'foo', 'bar', 5 => 'baz')); + } + + public function testOptionsWithInvalidInternalPointer() + { + $options = array('property1' => 'foo'); + next($options); + next($options); + + $constraint = new ConstraintA($options); + + $this->assertEquals('foo', $constraint->property1); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationListTest.php b/upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationListTest.php new file mode 100644 index 00000000000..a35a1cd171b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationListTest.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Validator\ConstraintViolationList; + +class ConstraintViolationListTest extends TestCase +{ + protected $list; + + protected function setUp() + { + $this->list = new ConstraintViolationList(); + } + + protected function tearDown() + { + $this->list = null; + } + + public function testInit() + { + $this->assertCount(0, $this->list); + } + + public function testInitWithViolations() + { + $violation = $this->getViolation('Error'); + $this->list = new ConstraintViolationList(array($violation)); + + $this->assertCount(1, $this->list); + $this->assertSame($violation, $this->list[0]); + } + + public function testAdd() + { + $violation = $this->getViolation('Error'); + $this->list->add($violation); + + $this->assertCount(1, $this->list); + $this->assertSame($violation, $this->list[0]); + } + + public function testAddAll() + { + $violations = array( + 10 => $this->getViolation('Error 1'), + 20 => $this->getViolation('Error 2'), + 30 => $this->getViolation('Error 3'), + ); + $otherList = new ConstraintViolationList($violations); + $this->list->addAll($otherList); + + $this->assertCount(3, $this->list); + + $this->assertSame($violations[10], $this->list[0]); + $this->assertSame($violations[20], $this->list[1]); + $this->assertSame($violations[30], $this->list[2]); + } + + public function testIterator() + { + $violations = array( + 10 => $this->getViolation('Error 1'), + 20 => $this->getViolation('Error 2'), + 30 => $this->getViolation('Error 3'), + ); + + $this->list = new ConstraintViolationList($violations); + + // indices are reset upon adding -> array_values() + $this->assertSame(array_values($violations), iterator_to_array($this->list)); + } + + public function testArrayAccess() + { + $violation = $this->getViolation('Error'); + $this->list[] = $violation; + + $this->assertSame($violation, $this->list[0]); + $this->assertArrayHasKey(0, $this->list); + + unset($this->list[0]); + + $this->assertArrayNotHasKey(0, $this->list); + + $this->list[10] = $violation; + + $this->assertSame($violation, $this->list[10]); + $this->assertArrayHasKey(10, $this->list); + } + + public function testToString() + { + $this->list = new ConstraintViolationList(array( + $this->getViolation('Error 1', 'Root'), + $this->getViolation('Error 2', 'Root', 'foo.bar'), + $this->getViolation('Error 3', 'Root', '[baz]'), + $this->getViolation('Error 4', '', 'foo.bar'), + $this->getViolation('Error 5', '', '[baz]'), + )); + + $expected = <<<'EOF' +Root: + Error 1 +Root.foo.bar: + Error 2 +Root[baz]: + Error 3 +foo.bar: + Error 4 +[baz]: + Error 5 + +EOF; + + $this->assertEquals($expected, (string) $this->list); + } + + protected function getViolation($message, $root = null, $propertyPath = null) + { + return new ConstraintViolation($message, $message, array(), $root, $propertyPath, null); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationTest.php b/upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationTest.php new file mode 100644 index 00000000000..cef4782e0f8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/ConstraintViolationTest.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\ConstraintViolation; + +class ConstraintViolationTest extends TestCase +{ + public function testToStringHandlesArrays() + { + $violation = new ConstraintViolation( + 'Array', + '{{ value }}', + array('{{ value }}' => array(1, 2, 3)), + 'Root', + 'property.path', + null + ); + + $expected = <<<'EOF' +Root.property.path: + Array +EOF; + + $this->assertSame($expected, (string) $violation); + } + + public function testToStringHandlesArrayRoots() + { + $violation = new ConstraintViolation( + '42 cannot be used here', + 'this is the message template', + array(), + array('some_value' => 42), + 'some_value', + null + ); + + $expected = <<<'EOF' +Array.some_value: + 42 cannot be used here +EOF; + + $this->assertSame($expected, (string) $violation); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php new file mode 100644 index 00000000000..d593aac3cdb --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php @@ -0,0 +1,192 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Intl\Util\IntlTestHelper; +use Symfony\Component\Validator\Constraint; + +class ComparisonTest_Class +{ + protected $value; + + public function __construct($value) + { + $this->value = $value; + } + + public function __toString() + { + return (string) $this->value; + } +} + +/** + * @author Daniel Holmes + */ +abstract class AbstractComparisonValidatorTestCase extends AbstractConstraintValidatorTest +{ + protected static function addPhp5Dot5Comparisons(array $comparisons) + { + if (\PHP_VERSION_ID < 50500) { + return $comparisons; + } + + $result = $comparisons; + + // Duplicate all tests involving DateTime objects to be tested with + // DateTimeImmutable objects as well + foreach ($comparisons as $comparison) { + $add = false; + + foreach ($comparison as $i => $value) { + if ($value instanceof \DateTime) { + $comparison[$i] = new \DateTimeImmutable( + $value->format('Y-m-d H:i:s.u e'), + $value->getTimezone() + ); + $add = true; + } elseif ('DateTime' === $value) { + $comparison[$i] = 'DateTimeImmutable'; + $add = true; + } + } + + if ($add) { + $result[] = $comparison; + } + } + + return $result; + } + + public function provideInvalidConstraintOptions() + { + return array( + array(null), + array(array()), + ); + } + + /** + * @dataProvider provideInvalidConstraintOptions + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testThrowsConstraintExceptionIfNoValueOrProperty($options) + { + $this->createConstraint($options); + } + + /** + * @dataProvider provideAllValidComparisons + * + * @param mixed $dirtyValue + * @param mixed $comparisonValue + */ + public function testValidComparisonToValue($dirtyValue, $comparisonValue) + { + $constraint = $this->createConstraint(array('value' => $comparisonValue)); + + $this->validator->validate($dirtyValue, $constraint); + + $this->assertNoViolation(); + } + + /** + * @return array + */ + public function provideAllValidComparisons() + { + // The provider runs before setUp(), so we need to manually fix + // the default timezone + $this->setDefaultTimezone('UTC'); + + $comparisons = self::addPhp5Dot5Comparisons($this->provideValidComparisons()); + + $this->restoreDefaultTimezone(); + + return $comparisons; + } + + /** + * @return array + */ + abstract public function provideValidComparisons(); + + /** + * @dataProvider provideAllInvalidComparisons + * + * @param mixed $dirtyValue + * @param mixed $dirtyValueAsString + * @param mixed $comparedValue + * @param mixed $comparedValueString + * @param string $comparedValueType + */ + public function testInvalidComparisonToValue($dirtyValue, $dirtyValueAsString, $comparedValue, $comparedValueString, $comparedValueType) + { + // Conversion of dates to string differs between ICU versions + // Make sure we have the correct version loaded + if ($dirtyValue instanceof \DateTime || $dirtyValue instanceof \DateTimeInterface) { + IntlTestHelper::requireIntl($this, '57.1'); + + if (\PHP_VERSION_ID < 50304 && !(\extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) { + $this->markTestSkipped('Intl supports formatting DateTime objects since 5.3.4'); + } + } + + $constraint = $this->createConstraint(array('value' => $comparedValue)); + $constraint->message = 'Constraint Message'; + + $this->validator->validate($dirtyValue, $constraint); + + $this->buildViolation('Constraint Message') + ->setParameter('{{ value }}', $dirtyValueAsString) + ->setParameter('{{ compared_value }}', $comparedValueString) + ->setParameter('{{ compared_value_type }}', $comparedValueType) + ->setCode($this->getErrorCode()) + ->assertRaised(); + } + + /** + * @return array + */ + public function provideAllInvalidComparisons() + { + // The provider runs before setUp(), so we need to manually fix + // the default timezone + $this->setDefaultTimezone('UTC'); + + $comparisons = self::addPhp5Dot5Comparisons($this->provideInvalidComparisons()); + + $this->restoreDefaultTimezone(); + + return $comparisons; + } + + /** + * @return array + */ + abstract public function provideInvalidComparisons(); + + /** + * @param array|null $options Options for the constraint + * + * @return Constraint + */ + abstract protected function createConstraint(array $options = null); + + /** + * @return string|null + */ + protected function getErrorCode() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php new file mode 100644 index 00000000000..fe505c0a7c2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AbstractConstraintValidatorTest.php @@ -0,0 +1,441 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\Assert; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\ConstraintValidatorInterface; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Validator\Context\ExecutionContext; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Context\LegacyExecutionContext; +use Symfony\Component\Validator\ExecutionContextInterface as LegacyExecutionContextInterface; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\PropertyMetadata; +use Symfony\Component\Validator\Validation; + +/** + * @author Bernhard Schussek + */ +abstract class AbstractConstraintValidatorTest extends TestCase +{ + /** + * @var ExecutionContextInterface + */ + protected $context; + + /** + * @var ConstraintValidatorInterface + */ + protected $validator; + + protected $group; + protected $metadata; + protected $object; + protected $value; + protected $root; + protected $propertyPath; + protected $constraint; + protected $defaultTimezone; + + protected function setUp() + { + $this->group = 'MyGroup'; + $this->metadata = null; + $this->object = null; + $this->value = 'InvalidValue'; + $this->root = 'root'; + $this->propertyPath = 'property.path'; + + // Initialize the context with some constraint so that we can + // successfully build a violation. + $this->constraint = new NotNull(); + + $this->context = $this->createContext(); + $this->validator = $this->createValidator(); + $this->validator->initialize($this->context); + + \Locale::setDefault('en'); + + $this->setDefaultTimezone('UTC'); + } + + protected function tearDown() + { + $this->restoreDefaultTimezone(); + } + + protected function setDefaultTimezone($defaultTimezone) + { + // Make sure this method can not be called twice before calling + // also restoreDefaultTimezone() + if (null === $this->defaultTimezone) { + $this->defaultTimezone = date_default_timezone_get(); + date_default_timezone_set($defaultTimezone); + } + } + + protected function restoreDefaultTimezone() + { + if (null !== $this->defaultTimezone) { + date_default_timezone_set($this->defaultTimezone); + $this->defaultTimezone = null; + } + } + + protected function createContext() + { + $translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock(); + $validator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ValidatorInterface')->getMock(); + $contextualValidator = $this->getMockBuilder('Symfony\Component\Validator\Validator\ContextualValidatorInterface')->getMock(); + + switch ($this->getApiVersion()) { + case Validation::API_VERSION_2_5: + $context = new ExecutionContext( + $validator, + $this->root, + $translator + ); + break; + case Validation::API_VERSION_2_4: + case Validation::API_VERSION_2_5_BC: + $context = new LegacyExecutionContext( + $validator, + $this->root, + $this->getMockBuilder('Symfony\Component\Validator\MetadataFactoryInterface')->getMock(), + $translator + ); + break; + default: + throw new \RuntimeException('Invalid API version'); + } + + $context->setGroup($this->group); + $context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + $context->setConstraint($this->constraint); + + $validator->expects($this->any()) + ->method('inContext') + ->with($context) + ->will($this->returnValue($contextualValidator)); + + return $context; + } + + /** + * @param mixed $message + * @param array $parameters + * @param string $propertyPath + * @param string $invalidValue + * @param null $plural + * @param null $code + * + * @return ConstraintViolation + * + * @deprecated to be removed in Symfony 3.0. Use {@link buildViolation()} instead. + */ + protected function createViolation($message, array $parameters = array(), $propertyPath = 'property.path', $invalidValue = 'InvalidValue', $plural = null, $code = null) + { + return new ConstraintViolation( + null, + $message, + $parameters, + $this->root, + $propertyPath, + $invalidValue, + $plural, + $code, + $this->constraint + ); + } + + protected function setGroup($group) + { + $this->group = $group; + $this->context->setGroup($group); + } + + protected function setObject($object) + { + $this->object = $object; + $this->metadata = \is_object($object) + ? new ClassMetadata(\get_class($object)) + : null; + + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function setProperty($object, $property) + { + $this->object = $object; + $this->metadata = \is_object($object) + ? new PropertyMetadata(\get_class($object), $property) + : null; + + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function setValue($value) + { + $this->value = $value; + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function setRoot($root) + { + $this->root = $root; + $this->context = $this->createContext(); + $this->validator->initialize($this->context); + } + + protected function setPropertyPath($propertyPath) + { + $this->propertyPath = $propertyPath; + $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath); + } + + protected function expectNoValidate() + { + $validator = $this->context->getValidator()->inContext($this->context); + $validator->expects($this->never()) + ->method('atPath'); + $validator->expects($this->never()) + ->method('validate'); + } + + protected function expectValidateAt($i, $propertyPath, $value, $group) + { + $validator = $this->context->getValidator()->inContext($this->context); + $validator->expects($this->at(2 * $i)) + ->method('atPath') + ->with($propertyPath) + ->will($this->returnValue($validator)); + $validator->expects($this->at(2 * $i + 1)) + ->method('validate') + ->with($value, $this->logicalOr(null, array(), $this->isInstanceOf('\Symfony\Component\Validator\Constraints\Valid')), $group); + } + + protected function expectValidateValueAt($i, $propertyPath, $value, $constraints, $group = null) + { + $contextualValidator = $this->context->getValidator()->inContext($this->context); + $contextualValidator->expects($this->at(2 * $i)) + ->method('atPath') + ->with($propertyPath) + ->will($this->returnValue($contextualValidator)); + $contextualValidator->expects($this->at(2 * $i + 1)) + ->method('validate') + ->with($value, $constraints, $group); + } + + protected function assertNoViolation() + { + $this->assertSame(0, $violationsCount = \count($this->context->getViolations()), sprintf('0 violation expected. Got %u.', $violationsCount)); + } + + /** + * @param mixed $message + * @param array $parameters + * @param string $propertyPath + * @param string $invalidValue + * @param null $plural + * @param null $code + * + * @deprecated To be removed in Symfony 3.0. Use + * {@link buildViolation()} instead. + */ + protected function assertViolation($message, array $parameters = array(), $propertyPath = 'property.path', $invalidValue = 'InvalidValue', $plural = null, $code = null) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED); + + $this->buildViolation($message) + ->setParameters($parameters) + ->atPath($propertyPath) + ->setInvalidValue($invalidValue) + ->setCode($code) + ->setPlural($plural) + ->assertRaised(); + } + + /** + * @param array $expected + * + * @deprecated To be removed in Symfony 3.0. Use + * {@link buildViolation()} instead. + */ + protected function assertViolations(array $expected) + { + @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED); + + $violations = $this->context->getViolations(); + + $this->assertCount(\count($expected), $violations); + + $i = 0; + + foreach ($expected as $violation) { + $this->assertEquals($violation, $violations[$i++]); + } + } + + /** + * @param $message + * + * @return ConstraintViolationAssertion + */ + protected function buildViolation($message) + { + return new ConstraintViolationAssertion($this->context, $message, $this->constraint); + } + + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + abstract protected function createValidator(); +} + +/** + * @internal + */ +class ConstraintViolationAssertion +{ + /** + * @var LegacyExecutionContextInterface + */ + private $context; + + /** + * @var ConstraintViolationAssertion[] + */ + private $assertions; + + private $message; + private $parameters = array(); + private $invalidValue = 'InvalidValue'; + private $propertyPath = 'property.path'; + private $translationDomain; + private $plural; + private $code; + private $constraint; + private $cause; + + public function __construct(LegacyExecutionContextInterface $context, $message, Constraint $constraint = null, array $assertions = array()) + { + $this->context = $context; + $this->message = $message; + $this->constraint = $constraint; + $this->assertions = $assertions; + } + + public function atPath($path) + { + $this->propertyPath = $path; + + return $this; + } + + public function setParameter($key, $value) + { + $this->parameters[$key] = $value; + + return $this; + } + + public function setParameters(array $parameters) + { + $this->parameters = $parameters; + + return $this; + } + + public function setTranslationDomain($translationDomain) + { + $this->translationDomain = $translationDomain; + + return $this; + } + + public function setInvalidValue($invalidValue) + { + $this->invalidValue = $invalidValue; + + return $this; + } + + public function setPlural($number) + { + $this->plural = $number; + + return $this; + } + + public function setCode($code) + { + $this->code = $code; + + return $this; + } + + public function setCause($cause) + { + $this->cause = $cause; + + return $this; + } + + public function buildNextViolation($message) + { + $assertions = $this->assertions; + $assertions[] = $this; + + return new self($this->context, $message, $this->constraint, $assertions); + } + + public function assertRaised() + { + $expected = array(); + foreach ($this->assertions as $assertion) { + $expected[] = $assertion->getViolation(); + } + $expected[] = $this->getViolation(); + + $violations = iterator_to_array($this->context->getViolations()); + + Assert::assertSame($expectedCount = \count($expected), $violationsCount = \count($violations), sprintf('%u violation(s) expected. Got %u.', $expectedCount, $violationsCount)); + + reset($violations); + + foreach ($expected as $violation) { + Assert::assertEquals($violation, current($violations)); + next($violations); + } + } + + private function getViolation() + { + return new ConstraintViolation( + null, + $this->message, + $this->parameters, + $this->context->getRoot(), + $this->propertyPath, + $this->invalidValue, + $this->plural, + $this->code, + $this->constraint, + $this->cause + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllTest.php new file mode 100644 index 00000000000..25e71a1b44d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllTest.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\All; +use Symfony\Component\Validator\Constraints\Valid; + +/** + * @author Bernhard Schussek + */ +class AllTest extends TestCase +{ + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectNonConstraints() + { + new All(array( + 'foo', + )); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectValidConstraint() + { + new All(array( + new Valid(), + )); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllValidatorTest.php new file mode 100644 index 00000000000..57dd6006974 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/AllValidatorTest.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\All; +use Symfony\Component\Validator\Constraints\AllValidator; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Range; +use Symfony\Component\Validator\Validation; + +class AllValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new AllValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new All(new Range(array('min' => 4)))); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testThrowsExceptionIfNotTraversable() + { + $this->validator->validate('foo.barbar', new All(new Range(array('min' => 4)))); + } + + /** + * @dataProvider getValidArguments + */ + public function testWalkSingleConstraint($array) + { + $constraint = new Range(array('min' => 4)); + + $i = 0; + + foreach ($array as $key => $value) { + $this->expectValidateValueAt($i++, '['.$key.']', $value, array($constraint)); + } + + $this->validator->validate($array, new All($constraint)); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getValidArguments + */ + public function testWalkMultipleConstraints($array) + { + $constraint1 = new Range(array('min' => 4)); + $constraint2 = new NotNull(); + + $constraints = array($constraint1, $constraint2); + + $i = 0; + + foreach ($array as $key => $value) { + $this->expectValidateValueAt($i++, '['.$key.']', $value, array($constraint1, $constraint2)); + } + + $this->validator->validate($array, new All($constraints)); + + $this->assertNoViolation(); + } + + public function getValidArguments() + { + return array( + array(array(5, 6, 7)), + array(new \ArrayObject(array(5, 6, 7))), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/BicValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/BicValidatorTest.php new file mode 100644 index 00000000000..0646e444989 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/BicValidatorTest.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Bic; +use Symfony\Component\Validator\Constraints\BicValidator; + +class BicValidatorTest extends AbstractConstraintValidatorTest +{ + protected function createValidator() + { + return new BicValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Bic()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Bic()); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getValidBics + */ + public function testValidBics($bic) + { + $this->validator->validate($bic, new Bic()); + + $this->assertNoViolation(); + } + + public function getValidBics() + { + // http://formvalidation.io/validators/bic/ + return array( + array('ASPKAT2LXXX'), + array('ASPKAT2L'), + array('DSBACNBXSHA'), + array('UNCRIT2B912'), + array('DABADKKK'), + array('RZOOAT2L303'), + ); + } + + /** + * @dataProvider getInvalidBics + */ + public function testInvalidBics($bic, $code) + { + $constraint = new Bic(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($bic, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$bic.'"') + ->setCode($code) + ->assertRaised(); + } + + public function getInvalidBics() + { + return array( + array('DEUTD', Bic::INVALID_LENGTH_ERROR), + array('ASPKAT2LXX', Bic::INVALID_LENGTH_ERROR), + array('ASPKAT2LX', Bic::INVALID_LENGTH_ERROR), + array('ASPKAT2LXXX1', Bic::INVALID_LENGTH_ERROR), + array('DABADKK', Bic::INVALID_LENGTH_ERROR), + array('1SBACNBXSHA', Bic::INVALID_BANK_CODE_ERROR), + array('RZ00AT2L303', Bic::INVALID_BANK_CODE_ERROR), + array('D2BACNBXSHA', Bic::INVALID_BANK_CODE_ERROR), + array('DS3ACNBXSHA', Bic::INVALID_BANK_CODE_ERROR), + array('DSB4CNBXSHA', Bic::INVALID_BANK_CODE_ERROR), + array('DEUT12HH', Bic::INVALID_COUNTRY_CODE_ERROR), + array('DSBAC6BXSHA', Bic::INVALID_COUNTRY_CODE_ERROR), + array('DSBA5NBXSHA', Bic::INVALID_COUNTRY_CODE_ERROR), + + // branch code error + array('THISSVAL1D]', Bic::INVALID_CHARACTERS_ERROR), + + // location code error + array('DEUTDEF]', Bic::INVALID_CHARACTERS_ERROR), + + // lower case values are invalid + array('DeutAT2LXXX', Bic::INVALID_CASE_ERROR), + array('DEUTAT2lxxx', Bic::INVALID_CASE_ERROR), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/BlankValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/BlankValidatorTest.php new file mode 100644 index 00000000000..17d8bfbc2e8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/BlankValidatorTest.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Blank; +use Symfony\Component\Validator\Constraints\BlankValidator; +use Symfony\Component\Validator\Validation; + +class BlankValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new BlankValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Blank()); + + $this->assertNoViolation(); + } + + public function testBlankIsValid() + { + $this->validator->validate('', new Blank()); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getInvalidValues + */ + public function testInvalidValues($value, $valueAsString) + { + $constraint = new Blank(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', $valueAsString) + ->setCode(Blank::NOT_BLANK_ERROR) + ->assertRaised(); + } + + public function getInvalidValues() + { + return array( + array('foobar', '"foobar"'), + array(0, '0'), + array(false, 'false'), + array(1234, '1234'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php new file mode 100644 index 00000000000..e87c9c4752a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CallbackValidatorTest.php @@ -0,0 +1,351 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\CallbackValidator; +use Symfony\Component\Validator\ExecutionContextInterface; +use Symfony\Component\Validator\Validation; + +class CallbackValidatorTest_Class +{ + public static function validateCallback($object, ExecutionContextInterface $context) + { + $context->addViolation('Callback message', array('{{ value }}' => 'foobar')); + + return false; + } +} + +class CallbackValidatorTest_Object +{ + public function validate(ExecutionContextInterface $context) + { + $context->addViolation('My message', array('{{ value }}' => 'foobar')); + + return false; + } + + public static function validateStatic($object, ExecutionContextInterface $context) + { + $context->addViolation('Static message', array('{{ value }}' => 'baz')); + + return false; + } +} + +class CallbackValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new CallbackValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Callback()); + + $this->assertNoViolation(); + } + + public function testSingleMethod() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback('validate'); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + public function testSingleMethodExplicitName() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array('callback' => 'validate')); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + public function testSingleStaticMethod() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback('validateStatic'); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('Static message') + ->setParameter('{{ value }}', 'baz') + ->assertRaised(); + } + + public function testClosure() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(function ($object, ExecutionContextInterface $context) { + $context->addViolation('My message', array('{{ value }}' => 'foobar')); + + return false; + }); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + public function testClosureNullObject() + { + $constraint = new Callback(function ($object, ExecutionContextInterface $context) { + $context->addViolation('My message', array('{{ value }}' => 'foobar')); + + return false; + }); + + $this->validator->validate(null, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + public function testClosureExplicitName() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array( + 'callback' => function ($object, ExecutionContextInterface $context) { + $context->addViolation('My message', array('{{ value }}' => 'foobar')); + + return false; + }, + )); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + public function testArrayCallable() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array(__CLASS__.'_Class', 'validateCallback')); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('Callback message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + public function testArrayCallableNullObject() + { + $constraint = new Callback(array(__CLASS__.'_Class', 'validateCallback')); + + $this->validator->validate(null, $constraint); + + $this->buildViolation('Callback message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + public function testArrayCallableExplicitName() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array( + 'callback' => array(__CLASS__.'_Class', 'validateCallback'), + )); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('Callback message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + /** + * @group legacy + */ + public function testLegacySingleMethodBc() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array('validate')); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + /** + * @group legacy + */ + public function testLegacySingleMethodBcExplicitName() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array('methods' => array('validate'))); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + /** + * @group legacy + */ + public function testLegacyMultipleMethodsBc() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array('validate', 'validateStatic')); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->buildNextViolation('Static message') + ->setParameter('{{ value }}', 'baz') + ->assertRaised(); + } + + /** + * @group legacy + */ + public function testLegacyMultipleMethodsBcExplicitName() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array( + 'methods' => array('validate', 'validateStatic'), + )); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('My message') + ->setParameter('{{ value }}', 'foobar') + ->buildNextViolation('Static message') + ->setParameter('{{ value }}', 'baz') + ->assertRaised(); + } + + /** + * @group legacy + */ + public function testLegacySingleStaticMethodBc() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array( + array(__CLASS__.'_Class', 'validateCallback'), + )); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('Callback message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + /** + * @group legacy + */ + public function testLegacySingleStaticMethodBcExplicitName() + { + $object = new CallbackValidatorTest_Object(); + $constraint = new Callback(array( + 'methods' => array(array(__CLASS__.'_Class', 'validateCallback')), + )); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('Callback message') + ->setParameter('{{ value }}', 'foobar') + ->assertRaised(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testExpectValidMethods() + { + $object = new CallbackValidatorTest_Object(); + + $this->validator->validate($object, new Callback(array('callback' => array('foobar')))); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testExpectValidCallbacks() + { + $object = new CallbackValidatorTest_Object(); + + $this->validator->validate($object, new Callback(array('callback' => array('foo', 'bar')))); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + * @group legacy + */ + public function testLegacyExpectEitherCallbackOrMethods() + { + $object = new CallbackValidatorTest_Object(); + + $this->validator->validate($object, new Callback(array( + 'callback' => 'validate', + 'methods' => array('validateStatic'), + ))); + } + + public function testConstraintGetTargets() + { + $constraint = new Callback(array()); + $targets = array(Constraint::CLASS_CONSTRAINT, Constraint::PROPERTY_CONSTRAINT); + + $this->assertEquals($targets, $constraint->getTargets()); + } + + // Should succeed. Needed when defining constraints as annotations. + public function testNoConstructorArguments() + { + $constraint = new Callback(); + + $this->assertSame(array(Constraint::CLASS_CONSTRAINT, Constraint::PROPERTY_CONSTRAINT), $constraint->getTargets()); + } + + public function testAnnotationInvocationSingleValued() + { + $constraint = new Callback(array('value' => 'validateStatic')); + + $this->assertEquals(new Callback('validateStatic'), $constraint); + } + + public function testAnnotationInvocationMultiValued() + { + $constraint = new Callback(array('value' => array(__CLASS__.'_Class', 'validateCallback'))); + + $this->assertEquals(new Callback(array(__CLASS__.'_Class', 'validateCallback')), $constraint); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php new file mode 100644 index 00000000000..22c96447e9c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CardSchemeValidatorTest.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\CardScheme; +use Symfony\Component\Validator\Constraints\CardSchemeValidator; +use Symfony\Component\Validator\Validation; + +class CardSchemeValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new CardSchemeValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new CardScheme(array('schemes' => array()))); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new CardScheme(array('schemes' => array()))); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getValidNumbers + */ + public function testValidNumbers($scheme, $number) + { + $this->validator->validate($number, new CardScheme(array('schemes' => $scheme))); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getInvalidNumbers + */ + public function testInvalidNumbers($scheme, $number, $code) + { + $constraint = new CardScheme(array( + 'schemes' => $scheme, + 'message' => 'myMessage', + )); + + $this->validator->validate($number, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', \is_string($number) ? '"'.$number.'"' : $number) + ->setCode($code) + ->assertRaised(); + } + + public function getValidNumbers() + { + return array( + array('AMEX', '378282246310005'), + array('AMEX', '371449635398431'), + array('AMEX', '378734493671000'), + array('AMEX', '347298508610146'), + array('CHINA_UNIONPAY', '6228888888888888'), + array('CHINA_UNIONPAY', '62288888888888888'), + array('CHINA_UNIONPAY', '622888888888888888'), + array('CHINA_UNIONPAY', '6228888888888888888'), + array('DINERS', '30569309025904'), + array('DINERS', '36088894118515'), + array('DINERS', '38520000023237'), + array('DISCOVER', '6011111111111117'), + array('DISCOVER', '6011000990139424'), + array('INSTAPAYMENT', '6372476031350068'), + array('INSTAPAYMENT', '6385537775789749'), + array('INSTAPAYMENT', '6393440808445746'), + array('JCB', '3530111333300000'), + array('JCB', '3566002020360505'), + array('JCB', '213112345678901'), + array('JCB', '180012345678901'), + array('LASER', '6304678107004080'), + array('LASER', '6706440607428128629'), + array('LASER', '6771656738314582216'), + array('MAESTRO', '6759744069209'), + array('MAESTRO', '5020507657408074712'), + array('MAESTRO', '5612559223580173965'), + array('MAESTRO', '6759744069209'), + array('MAESTRO', '6594371785970435599'), + array('MASTERCARD', '5555555555554444'), + array('MASTERCARD', '5105105105105100'), + array('MASTERCARD', '2221005555554444'), + array('MASTERCARD', '2230000000000000'), + array('MASTERCARD', '2300000000000000'), + array('MASTERCARD', '2699999999999999'), + array('MASTERCARD', '2709999999999999'), + array('MASTERCARD', '2720995105105100'), + array('VISA', '4111111111111111'), + array('VISA', '4012888888881881'), + array('VISA', '4222222222222'), + array('VISA', '4917610000000000003'), + array(array('AMEX', 'VISA'), '4111111111111111'), + array(array('AMEX', 'VISA'), '378282246310005'), + array(array('JCB', 'MASTERCARD'), '5105105105105100'), + array(array('VISA', 'MASTERCARD'), '5105105105105100'), + ); + } + + public function getInvalidNumbers() + { + return array( + array('VISA', '42424242424242424242', CardScheme::INVALID_FORMAT_ERROR), + array('AMEX', '357298508610146', CardScheme::INVALID_FORMAT_ERROR), + array('DINERS', '31569309025904', CardScheme::INVALID_FORMAT_ERROR), + array('DINERS', '37088894118515', CardScheme::INVALID_FORMAT_ERROR), + array('INSTAPAYMENT', '6313440808445746', CardScheme::INVALID_FORMAT_ERROR), + array('CHINA_UNIONPAY', '622888888888888', CardScheme::INVALID_FORMAT_ERROR), + array('CHINA_UNIONPAY', '62288888888888888888', CardScheme::INVALID_FORMAT_ERROR), + array('AMEX', '30569309025904', CardScheme::INVALID_FORMAT_ERROR), // DINERS number + array('AMEX', 'invalid', CardScheme::NOT_NUMERIC_ERROR), // A string + array('AMEX', 0, CardScheme::INVALID_FORMAT_ERROR), // a lone number + array('AMEX', '0', CardScheme::INVALID_FORMAT_ERROR), // a lone number + array('AMEX', '000000000000', CardScheme::INVALID_FORMAT_ERROR), // a lone number + array('DINERS', '3056930', CardScheme::INVALID_FORMAT_ERROR), // only first part of the number + array('DISCOVER', '1117', CardScheme::INVALID_FORMAT_ERROR), // only last 4 digits + array('MASTERCARD', '2721001234567890', CardScheme::INVALID_FORMAT_ERROR), // Not assigned yet + array('MASTERCARD', '2220991234567890', CardScheme::INVALID_FORMAT_ERROR), // Not assigned yet + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ChoiceValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ChoiceValidatorTest.php new file mode 100644 index 00000000000..b515b843584 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ChoiceValidatorTest.php @@ -0,0 +1,304 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Choice; +use Symfony\Component\Validator\Constraints\ChoiceValidator; +use Symfony\Component\Validator\Validation; + +function choice_callback() +{ + return array('foo', 'bar'); +} + +class ChoiceValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new ChoiceValidator(); + } + + public static function staticCallback() + { + return array('foo', 'bar'); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectArrayIfMultipleIsTrue() + { + $constraint = new Choice(array( + 'choices' => array('foo', 'bar'), + 'multiple' => true, + )); + + $this->validator->validate('asdf', $constraint); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Choice(array('choices' => array('foo', 'bar')))); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testChoicesOrCallbackExpected() + { + $this->validator->validate('foobar', new Choice()); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testValidCallbackExpected() + { + $this->validator->validate('foobar', new Choice(array('callback' => 'abcd'))); + } + + public function testValidChoiceArray() + { + $constraint = new Choice(array('choices' => array('foo', 'bar'))); + + $this->validator->validate('bar', $constraint); + + $this->assertNoViolation(); + } + + public function testValidChoiceCallbackFunction() + { + $constraint = new Choice(array('callback' => __NAMESPACE__.'\choice_callback')); + + $this->validator->validate('bar', $constraint); + + $this->assertNoViolation(); + } + + public function testValidChoiceCallbackClosure() + { + $constraint = new Choice(array('callback' => function () { + return array('foo', 'bar'); + })); + + $this->validator->validate('bar', $constraint); + + $this->assertNoViolation(); + } + + public function testValidChoiceCallbackStaticMethod() + { + $constraint = new Choice(array('callback' => array(__CLASS__, 'staticCallback'))); + + $this->validator->validate('bar', $constraint); + + $this->assertNoViolation(); + } + + public function testValidChoiceCallbackContextMethod() + { + // search $this for "staticCallback" + $this->setObject($this); + + $constraint = new Choice(array('callback' => 'staticCallback')); + + $this->validator->validate('bar', $constraint); + + $this->assertNoViolation(); + } + + public function testMultipleChoices() + { + $constraint = new Choice(array( + 'choices' => array('foo', 'bar', 'baz'), + 'multiple' => true, + )); + + $this->validator->validate(array('baz', 'bar'), $constraint); + + $this->assertNoViolation(); + } + + public function testInvalidChoice() + { + $constraint = new Choice(array( + 'choices' => array('foo', 'bar'), + 'message' => 'myMessage', + )); + + $this->validator->validate('baz', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"baz"') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); + } + + public function testInvalidChoiceEmptyChoices() + { + $constraint = new Choice(array( + // May happen when the choices are provided dynamically, e.g. from + // the DB or the model + 'choices' => array(), + 'message' => 'myMessage', + )); + + $this->validator->validate('baz', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"baz"') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); + } + + public function testInvalidChoiceMultiple() + { + $constraint = new Choice(array( + 'choices' => array('foo', 'bar'), + 'multipleMessage' => 'myMessage', + 'multiple' => true, + )); + + $this->validator->validate(array('foo', 'baz'), $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"baz"') + ->setInvalidValue('baz') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); + } + + public function testTooFewChoices() + { + $constraint = new Choice(array( + 'choices' => array('foo', 'bar', 'moo', 'maa'), + 'multiple' => true, + 'min' => 2, + 'minMessage' => 'myMessage', + )); + + $value = array('foo'); + + $this->setValue($value); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ limit }}', 2) + ->setInvalidValue($value) + ->setPlural(2) + ->setCode(Choice::TOO_FEW_ERROR) + ->assertRaised(); + } + + public function testTooManyChoices() + { + $constraint = new Choice(array( + 'choices' => array('foo', 'bar', 'moo', 'maa'), + 'multiple' => true, + 'max' => 2, + 'maxMessage' => 'myMessage', + )); + + $value = array('foo', 'bar', 'moo'); + + $this->setValue($value); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ limit }}', 2) + ->setInvalidValue($value) + ->setPlural(2) + ->setCode(Choice::TOO_MANY_ERROR) + ->assertRaised(); + } + + public function testNonStrict() + { + $constraint = new Choice(array( + 'choices' => array(1, 2), + 'strict' => false, + )); + + $this->validator->validate('2', $constraint); + $this->validator->validate(2, $constraint); + + $this->assertNoViolation(); + } + + public function testStrictAllowsExactValue() + { + $constraint = new Choice(array( + 'choices' => array(1, 2), + 'strict' => true, + )); + + $this->validator->validate(2, $constraint); + + $this->assertNoViolation(); + } + + public function testStrictDisallowsDifferentType() + { + $constraint = new Choice(array( + 'choices' => array(1, 2), + 'strict' => true, + 'message' => 'myMessage', + )); + + $this->validator->validate('2', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"2"') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); + } + + public function testNonStrictWithMultipleChoices() + { + $constraint = new Choice(array( + 'choices' => array(1, 2, 3), + 'multiple' => true, + 'strict' => false, + )); + + $this->validator->validate(array('2', 3), $constraint); + + $this->assertNoViolation(); + } + + public function testStrictWithMultipleChoices() + { + $constraint = new Choice(array( + 'choices' => array(1, 2, 3), + 'multiple' => true, + 'strict' => true, + 'multipleMessage' => 'myMessage', + )); + + $this->validator->validate(array(2, '3'), $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"3"') + ->setInvalidValue('3') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionTest.php new file mode 100644 index 00000000000..b5fbf6c0b09 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionTest.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\Email; +use Symfony\Component\Validator\Constraints\Optional; +use Symfony\Component\Validator\Constraints\Required; +use Symfony\Component\Validator\Constraints\Valid; + +/** + * @author Bernhard Schussek + */ +class CollectionTest extends TestCase +{ + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectInvalidFieldsOption() + { + new Collection(array( + 'fields' => 'foo', + )); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectNonConstraints() + { + new Collection(array( + 'foo' => 'bar', + )); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectValidConstraint() + { + new Collection(array( + 'foo' => new Valid(), + )); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectValidConstraintWithinOptional() + { + new Collection(array( + 'foo' => new Optional(new Valid()), + )); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectValidConstraintWithinRequired() + { + new Collection(array( + 'foo' => new Required(new Valid()), + )); + } + + public function testAcceptOptionalConstraintAsOneElementArray() + { + $collection1 = new Collection(array( + 'fields' => array( + 'alternate_email' => array( + new Optional(new Email()), + ), + ), + )); + + $collection2 = new Collection(array( + 'fields' => array( + 'alternate_email' => new Optional(new Email()), + ), + )); + + $this->assertEquals($collection1, $collection2); + } + + public function testAcceptRequiredConstraintAsOneElementArray() + { + $collection1 = new Collection(array( + 'fields' => array( + 'alternate_email' => array( + new Required(new Email()), + ), + ), + )); + + $collection2 = new Collection(array( + 'fields' => array( + 'alternate_email' => new Required(new Email()), + ), + )); + + $this->assertEquals($collection1, $collection2); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayObjectTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayObjectTest.php new file mode 100644 index 00000000000..a3c4b3340ec --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayObjectTest.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +class CollectionValidatorArrayObjectTest extends CollectionValidatorTest +{ + public function prepareTestData(array $contents) + { + return new \ArrayObject($contents); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayTest.php new file mode 100644 index 00000000000..7517d0ce340 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorArrayTest.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +class CollectionValidatorArrayTest extends CollectionValidatorTest +{ + public function prepareTestData(array $contents) + { + return $contents; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorCustomArrayObjectTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorCustomArrayObjectTest.php new file mode 100644 index 00000000000..3d4c29681bf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorCustomArrayObjectTest.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Tests\Fixtures\CustomArrayObject; + +class CollectionValidatorCustomArrayObjectTest extends CollectionValidatorTest +{ + public function prepareTestData(array $contents) + { + return new CustomArrayObject($contents); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorTest.php new file mode 100644 index 00000000000..0376814341f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CollectionValidatorTest.php @@ -0,0 +1,389 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\CollectionValidator; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Optional; +use Symfony\Component\Validator\Constraints\Range; +use Symfony\Component\Validator\Constraints\Required; +use Symfony\Component\Validator\Validation; + +abstract class CollectionValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new CollectionValidator(); + } + + abstract protected function prepareTestData(array $contents); + + public function testNullIsValid() + { + $this->validator->validate(null, new Collection(array('fields' => array( + 'foo' => new Range(array('min' => 4)), + )))); + + $this->assertNoViolation(); + } + + public function testFieldsAsDefaultOption() + { + $constraint = new Range(array('min' => 4)); + + $data = $this->prepareTestData(array('foo' => 'foobar')); + + $this->expectValidateValueAt(0, '[foo]', $data['foo'], array($constraint)); + + $this->validator->validate($data, new Collection(array( + 'foo' => $constraint, + ))); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testThrowsExceptionIfNotTraversable() + { + $this->validator->validate('foobar', new Collection(array('fields' => array( + 'foo' => new Range(array('min' => 4)), + )))); + } + + public function testWalkSingleConstraint() + { + $constraint = new Range(array('min' => 4)); + + $array = array( + 'foo' => 3, + 'bar' => 5, + ); + + $i = 0; + + foreach ($array as $key => $value) { + $this->expectValidateValueAt($i++, '['.$key.']', $value, array($constraint)); + } + + $data = $this->prepareTestData($array); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => $constraint, + 'bar' => $constraint, + ), + ))); + + $this->assertNoViolation(); + } + + public function testWalkMultipleConstraints() + { + $constraints = array( + new Range(array('min' => 4)), + new NotNull(), + ); + + $array = array( + 'foo' => 3, + 'bar' => 5, + ); + + $i = 0; + + foreach ($array as $key => $value) { + $this->expectValidateValueAt($i++, '['.$key.']', $value, $constraints); + } + + $data = $this->prepareTestData($array); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => $constraints, + 'bar' => $constraints, + ), + ))); + + $this->assertNoViolation(); + } + + public function testExtraFieldsDisallowed() + { + $constraint = new Range(array('min' => 4)); + + $data = $this->prepareTestData(array( + 'foo' => 5, + 'baz' => 6, + )); + + $this->expectValidateValueAt(0, '[foo]', $data['foo'], array($constraint)); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => $constraint, + ), + 'extraFieldsMessage' => 'myMessage', + ))); + + $this->buildViolation('myMessage') + ->setParameter('{{ field }}', '"baz"') + ->atPath('property.path[baz]') + ->setInvalidValue(6) + ->setCode(Collection::NO_SUCH_FIELD_ERROR) + ->assertRaised(); + } + + // bug fix + public function testNullNotConsideredExtraField() + { + $data = $this->prepareTestData(array( + 'foo' => null, + )); + + $constraint = new Range(array('min' => 4)); + + $this->expectValidateValueAt(0, '[foo]', $data['foo'], array($constraint)); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => $constraint, + ), + ))); + + $this->assertNoViolation(); + } + + public function testExtraFieldsAllowed() + { + $data = $this->prepareTestData(array( + 'foo' => 5, + 'bar' => 6, + )); + + $constraint = new Range(array('min' => 4)); + + $this->expectValidateValueAt(0, '[foo]', $data['foo'], array($constraint)); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => $constraint, + ), + 'allowExtraFields' => true, + ))); + + $this->assertNoViolation(); + } + + public function testMissingFieldsDisallowed() + { + $data = $this->prepareTestData(array()); + + $constraint = new Range(array('min' => 4)); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => $constraint, + ), + 'missingFieldsMessage' => 'myMessage', + ))); + + $this->buildViolation('myMessage') + ->setParameter('{{ field }}', '"foo"') + ->atPath('property.path[foo]') + ->setInvalidValue(null) + ->setCode(Collection::MISSING_FIELD_ERROR) + ->assertRaised(); + } + + public function testMissingFieldsAllowed() + { + $data = $this->prepareTestData(array()); + + $constraint = new Range(array('min' => 4)); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => $constraint, + ), + 'allowMissingFields' => true, + ))); + + $this->assertNoViolation(); + } + + public function testOptionalFieldPresent() + { + $data = $this->prepareTestData(array( + 'foo' => null, + )); + + $this->validator->validate($data, new Collection(array( + 'foo' => new Optional(), + ))); + + $this->assertNoViolation(); + } + + public function testOptionalFieldNotPresent() + { + $data = $this->prepareTestData(array()); + + $this->validator->validate($data, new Collection(array( + 'foo' => new Optional(), + ))); + + $this->assertNoViolation(); + } + + public function testOptionalFieldSingleConstraint() + { + $array = array( + 'foo' => 5, + ); + + $constraint = new Range(array('min' => 4)); + + $this->expectValidateValueAt(0, '[foo]', $array['foo'], array($constraint)); + + $data = $this->prepareTestData($array); + + $this->validator->validate($data, new Collection(array( + 'foo' => new Optional($constraint), + ))); + + $this->assertNoViolation(); + } + + public function testOptionalFieldMultipleConstraints() + { + $array = array( + 'foo' => 5, + ); + + $constraints = array( + new NotNull(), + new Range(array('min' => 4)), + ); + + $this->expectValidateValueAt(0, '[foo]', $array['foo'], $constraints); + + $data = $this->prepareTestData($array); + + $this->validator->validate($data, new Collection(array( + 'foo' => new Optional($constraints), + ))); + + $this->assertNoViolation(); + } + + public function testRequiredFieldPresent() + { + $data = $this->prepareTestData(array( + 'foo' => null, + )); + + $this->validator->validate($data, new Collection(array( + 'foo' => new Required(), + ))); + + $this->assertNoViolation(); + } + + public function testRequiredFieldNotPresent() + { + $data = $this->prepareTestData(array()); + + $this->validator->validate($data, new Collection(array( + 'fields' => array( + 'foo' => new Required(), + ), + 'missingFieldsMessage' => 'myMessage', + ))); + + $this->buildViolation('myMessage') + ->setParameter('{{ field }}', '"foo"') + ->atPath('property.path[foo]') + ->setInvalidValue(null) + ->setCode(Collection::MISSING_FIELD_ERROR) + ->assertRaised(); + } + + public function testRequiredFieldSingleConstraint() + { + $array = array( + 'foo' => 5, + ); + + $constraint = new Range(array('min' => 4)); + + $this->expectValidateValueAt(0, '[foo]', $array['foo'], array($constraint)); + + $data = $this->prepareTestData($array); + + $this->validator->validate($data, new Collection(array( + 'foo' => new Required($constraint), + ))); + + $this->assertNoViolation(); + } + + public function testRequiredFieldMultipleConstraints() + { + $array = array( + 'foo' => 5, + ); + + $constraints = array( + new NotNull(), + new Range(array('min' => 4)), + ); + + $this->expectValidateValueAt(0, '[foo]', $array['foo'], $constraints); + + $data = $this->prepareTestData($array); + + $this->validator->validate($data, new Collection(array( + 'foo' => new Required($constraints), + ))); + + $this->assertNoViolation(); + } + + public function testObjectShouldBeLeftUnchanged() + { + $value = new \ArrayObject(array( + 'foo' => 3, + )); + + $constraint = new Range(array('min' => 2)); + + $this->expectValidateValueAt(0, '[foo]', $value['foo'], array($constraint)); + + $this->validator->validate($value, new Collection(array( + 'fields' => array( + 'foo' => $constraint, + ), + ))); + + $this->assertEquals(array( + 'foo' => 3, + ), (array) $value); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CompositeTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CompositeTest.php new file mode 100644 index 00000000000..df4255007c5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CompositeTest.php @@ -0,0 +1,148 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Composite; +use Symfony\Component\Validator\Constraints\NotBlank; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Valid; + +class ConcreteComposite extends Composite +{ + public $constraints; + + protected function getCompositeOption() + { + return 'constraints'; + } + + public function getDefaultOption() + { + return 'constraints'; + } +} + +/** + * @author Bernhard Schussek + */ +class CompositeTest extends TestCase +{ + public function testMergeNestedGroupsIfNoExplicitParentGroup() + { + $constraint = new ConcreteComposite(array( + new NotNull(array('groups' => 'Default')), + new NotBlank(array('groups' => array('Default', 'Strict'))), + )); + + $this->assertEquals(array('Default', 'Strict'), $constraint->groups); + $this->assertEquals(array('Default'), $constraint->constraints[0]->groups); + $this->assertEquals(array('Default', 'Strict'), $constraint->constraints[1]->groups); + } + + public function testSetImplicitNestedGroupsIfExplicitParentGroup() + { + $constraint = new ConcreteComposite(array( + 'constraints' => array( + new NotNull(), + new NotBlank(), + ), + 'groups' => array('Default', 'Strict'), + )); + + $this->assertEquals(array('Default', 'Strict'), $constraint->groups); + $this->assertEquals(array('Default', 'Strict'), $constraint->constraints[0]->groups); + $this->assertEquals(array('Default', 'Strict'), $constraint->constraints[1]->groups); + } + + public function testExplicitNestedGroupsMustBeSubsetOfExplicitParentGroups() + { + $constraint = new ConcreteComposite(array( + 'constraints' => array( + new NotNull(array('groups' => 'Default')), + new NotBlank(array('groups' => 'Strict')), + ), + 'groups' => array('Default', 'Strict'), + )); + + $this->assertEquals(array('Default', 'Strict'), $constraint->groups); + $this->assertEquals(array('Default'), $constraint->constraints[0]->groups); + $this->assertEquals(array('Strict'), $constraint->constraints[1]->groups); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testFailIfExplicitNestedGroupsNotSubsetOfExplicitParentGroups() + { + new ConcreteComposite(array( + 'constraints' => array( + new NotNull(array('groups' => array('Default', 'Foobar'))), + ), + 'groups' => array('Default', 'Strict'), + )); + } + + public function testImplicitGroupNamesAreForwarded() + { + $constraint = new ConcreteComposite(array( + new NotNull(array('groups' => 'Default')), + new NotBlank(array('groups' => 'Strict')), + )); + + $constraint->addImplicitGroupName('ImplicitGroup'); + + $this->assertEquals(array('Default', 'Strict', 'ImplicitGroup'), $constraint->groups); + $this->assertEquals(array('Default', 'ImplicitGroup'), $constraint->constraints[0]->groups); + $this->assertEquals(array('Strict'), $constraint->constraints[1]->groups); + } + + public function testSingleConstraintsAccepted() + { + $nestedConstraint = new NotNull(); + $constraint = new ConcreteComposite($nestedConstraint); + + $this->assertEquals(array($nestedConstraint), $constraint->constraints); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testFailIfNoConstraint() + { + new ConcreteComposite(array( + new NotNull(array('groups' => 'Default')), + 'NotBlank', + )); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testFailIfNoConstraintObject() + { + new ConcreteComposite(array( + new NotNull(array('groups' => 'Default')), + new \ArrayObject(), + )); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testValidCantBeNested() + { + new ConcreteComposite(array( + new Valid(), + )); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorArrayTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorArrayTest.php new file mode 100644 index 00000000000..5f562e7445f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorArrayTest.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +/** + * @author Bernhard Schussek + */ +class CountValidatorArrayTest extends CountValidatorTest +{ + protected function createCollection(array $content) + { + return $content; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorCountableTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorCountableTest.php new file mode 100644 index 00000000000..7d46967bde4 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorCountableTest.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Tests\Fixtures\Countable; + +/** + * @author Bernhard Schussek + */ +class CountValidatorCountableTest extends CountValidatorTest +{ + protected function createCollection(array $content) + { + return new Countable($content); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorTest.php new file mode 100644 index 00000000000..5c89c8531a3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountValidatorTest.php @@ -0,0 +1,203 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Count; +use Symfony\Component\Validator\Constraints\CountValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Bernhard Schussek + */ +abstract class CountValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new CountValidator(); + } + + abstract protected function createCollection(array $content); + + public function testNullIsValid() + { + $this->validator->validate(null, new Count(6)); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsCountableType() + { + $this->validator->validate(new \stdClass(), new Count(5)); + } + + public function getThreeOrLessElements() + { + return array( + array($this->createCollection(array(1))), + array($this->createCollection(array(1, 2))), + array($this->createCollection(array(1, 2, 3))), + array($this->createCollection(array('a' => 1, 'b' => 2, 'c' => 3))), + ); + } + + public function getFourElements() + { + return array( + array($this->createCollection(array(1, 2, 3, 4))), + array($this->createCollection(array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4))), + ); + } + + public function getFiveOrMoreElements() + { + return array( + array($this->createCollection(array(1, 2, 3, 4, 5))), + array($this->createCollection(array(1, 2, 3, 4, 5, 6))), + array($this->createCollection(array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5))), + ); + } + + /** + * @dataProvider getThreeOrLessElements + */ + public function testValidValuesMax($value) + { + $constraint = new Count(array('max' => 3)); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getFiveOrMoreElements + */ + public function testValidValuesMin($value) + { + $constraint = new Count(array('min' => 5)); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getFourElements + */ + public function testValidValuesExact($value) + { + $constraint = new Count(4); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getFiveOrMoreElements + */ + public function testTooManyValues($value) + { + $constraint = new Count(array( + 'max' => 4, + 'maxMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ count }}', \count($value)) + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Count::TOO_MANY_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getThreeOrLessElements + */ + public function testTooFewValues($value) + { + $constraint = new Count(array( + 'min' => 4, + 'minMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ count }}', \count($value)) + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Count::TOO_FEW_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getFiveOrMoreElements + */ + public function testTooManyValuesExact($value) + { + $constraint = new Count(array( + 'min' => 4, + 'max' => 4, + 'exactMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ count }}', \count($value)) + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Count::TOO_MANY_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getThreeOrLessElements + */ + public function testTooFewValuesExact($value) + { + $constraint = new Count(array( + 'min' => 4, + 'max' => 4, + 'exactMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ count }}', \count($value)) + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Count::TOO_FEW_ERROR) + ->assertRaised(); + } + + public function testDefaultOption() + { + $constraint = new Count(5); + + $this->assertEquals(5, $constraint->min); + $this->assertEquals(5, $constraint->max); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountryValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountryValidatorTest.php new file mode 100644 index 00000000000..4baee3eecaa --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CountryValidatorTest.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Intl\Util\IntlTestHelper; +use Symfony\Component\Validator\Constraints\Country; +use Symfony\Component\Validator\Constraints\CountryValidator; +use Symfony\Component\Validator\Validation; + +class CountryValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new CountryValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Country()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Country()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Country()); + } + + /** + * @dataProvider getValidCountries + */ + public function testValidCountries($country) + { + $this->validator->validate($country, new Country()); + + $this->assertNoViolation(); + } + + public function getValidCountries() + { + return array( + array('GB'), + array('AT'), + array('MY'), + ); + } + + /** + * @dataProvider getInvalidCountries + */ + public function testInvalidCountries($country) + { + $constraint = new Country(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($country, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$country.'"') + ->setCode(Country::NO_SUCH_COUNTRY_ERROR) + ->assertRaised(); + } + + public function getInvalidCountries() + { + return array( + array('foobar'), + array('EN'), + ); + } + + public function testValidateUsingCountrySpecificLocale() + { + // in order to test with "en_GB" + IntlTestHelper::requireFullIntl($this, false); + + \Locale::setDefault('en_GB'); + + $existingCountry = 'GB'; + + $this->validator->validate($existingCountry, new Country()); + + $this->assertNoViolation(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CurrencyValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CurrencyValidatorTest.php new file mode 100644 index 00000000000..1c11a6bbec8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/CurrencyValidatorTest.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Intl\Util\IntlTestHelper; +use Symfony\Component\Validator\Constraints\Currency; +use Symfony\Component\Validator\Constraints\CurrencyValidator; +use Symfony\Component\Validator\Validation; + +class CurrencyValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new CurrencyValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Currency()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Currency()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Currency()); + } + + /** + * @dataProvider getValidCurrencies + */ + public function testValidCurrencies($currency) + { + $this->validator->validate($currency, new Currency()); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getValidCurrencies + **/ + public function testValidCurrenciesWithCountrySpecificLocale($currency) + { + IntlTestHelper::requireFullIntl($this, false); + + \Locale::setDefault('en_GB'); + + $this->validator->validate($currency, new Currency()); + + $this->assertNoViolation(); + } + + public function getValidCurrencies() + { + return array( + array('EUR'), + array('USD'), + array('SIT'), + array('AUD'), + array('CAD'), + ); + } + + /** + * @dataProvider getInvalidCurrencies + */ + public function testInvalidCurrencies($currency) + { + $constraint = new Currency(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($currency, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$currency.'"') + ->setCode(Currency::NO_SUCH_CURRENCY_ERROR) + ->assertRaised(); + } + + public function getInvalidCurrencies() + { + return array( + array('EN'), + array('foobar'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateTimeValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateTimeValidatorTest.php new file mode 100644 index 00000000000..25d88aa2ab8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateTimeValidatorTest.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\DateTime; +use Symfony\Component\Validator\Constraints\DateTimeValidator; +use Symfony\Component\Validator\Validation; + +class DateTimeValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new DateTimeValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new DateTime()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new DateTime()); + + $this->assertNoViolation(); + } + + public function testDateTimeClassIsValid() + { + $this->validator->validate(new \DateTime(), new DateTime()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new DateTime()); + } + + /** + * @dataProvider getValidDateTimes + */ + public function testValidDateTimes($dateTime) + { + $this->validator->validate($dateTime, new DateTime()); + + $this->assertNoViolation(); + } + + public function getValidDateTimes() + { + return array( + array('2010-01-01 01:02:03'), + array('1955-12-12 00:00:00'), + array('2030-05-31 23:59:59'), + ); + } + + /** + * @dataProvider getInvalidDateTimes + */ + public function testInvalidDateTimes($dateTime, $code) + { + $constraint = new DateTime(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($dateTime, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$dateTime.'"') + ->setCode($code) + ->assertRaised(); + } + + public function getInvalidDateTimes() + { + return array( + array('foobar', DateTime::INVALID_FORMAT_ERROR), + array('2010-01-01', DateTime::INVALID_FORMAT_ERROR), + array('00:00:00', DateTime::INVALID_FORMAT_ERROR), + array('2010-01-01 00:00', DateTime::INVALID_FORMAT_ERROR), + array('2010-13-01 00:00:00', DateTime::INVALID_DATE_ERROR), + array('2010-04-32 00:00:00', DateTime::INVALID_DATE_ERROR), + array('2010-02-29 00:00:00', DateTime::INVALID_DATE_ERROR), + array('2010-01-01 24:00:00', DateTime::INVALID_TIME_ERROR), + array('2010-01-01 00:60:00', DateTime::INVALID_TIME_ERROR), + array('2010-01-01 00:00:60', DateTime::INVALID_TIME_ERROR), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateValidatorTest.php new file mode 100644 index 00000000000..21f0a2dcc3d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/DateValidatorTest.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Date; +use Symfony\Component\Validator\Constraints\DateValidator; +use Symfony\Component\Validator\Validation; + +class DateValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new DateValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Date()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Date()); + + $this->assertNoViolation(); + } + + public function testDateTimeClassIsValid() + { + $this->validator->validate(new \DateTime(), new Date()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Date()); + } + + /** + * @dataProvider getValidDates + */ + public function testValidDates($date) + { + $this->validator->validate($date, new Date()); + + $this->assertNoViolation(); + } + + public function getValidDates() + { + return array( + array('2010-01-01'), + array('1955-12-12'), + array('2030-05-31'), + ); + } + + /** + * @dataProvider getInvalidDates + */ + public function testInvalidDates($date, $code) + { + $constraint = new Date(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($date, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$date.'"') + ->setCode($code) + ->assertRaised(); + } + + public function getInvalidDates() + { + return array( + array('foobar', Date::INVALID_FORMAT_ERROR), + array('foobar 2010-13-01', Date::INVALID_FORMAT_ERROR), + array('2010-13-01 foobar', Date::INVALID_FORMAT_ERROR), + array('2010-13-01', Date::INVALID_DATE_ERROR), + array('2010-04-32', Date::INVALID_DATE_ERROR), + array('2010-02-29', Date::INVALID_DATE_ERROR), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php new file mode 100644 index 00000000000..5933bd5ed6a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/EmailValidatorTest.php @@ -0,0 +1,190 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Bridge\PhpUnit\DnsMock; +use Symfony\Component\Validator\Constraints\Email; +use Symfony\Component\Validator\Constraints\EmailValidator; +use Symfony\Component\Validator\Validation; + +/** + * @group dns-sensitive + */ +class EmailValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new EmailValidator(false); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Email()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Email()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Email()); + } + + /** + * @dataProvider getValidEmails + */ + public function testValidEmails($email) + { + $this->validator->validate($email, new Email()); + + $this->assertNoViolation(); + } + + public function getValidEmails() + { + return array( + array('fabien@symfony.com'), + array('example@example.co.uk'), + array('fabien_potencier@example.fr'), + ); + } + + /** + * @dataProvider getInvalidEmails + */ + public function testInvalidEmails($email) + { + $constraint = new Email(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($email, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$email.'"') + ->setCode(Email::INVALID_FORMAT_ERROR) + ->assertRaised(); + } + + public function getInvalidEmails() + { + return array( + array('example'), + array('example@'), + array('example@localhost'), + array('foo@example.com bar'), + ); + } + + public function testStrict() + { + $constraint = new Email(array('strict' => true)); + + $this->validator->validate('example@localhost', $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getDnsChecks + * @requires function Symfony\Bridge\PhpUnit\DnsMock::withMockedHosts + */ + public function testDnsChecks($type, $violation) + { + DnsMock::withMockedHosts(array('example.com' => array(array('type' => $violation ? false : $type)))); + + $constraint = new Email(array( + 'message' => 'myMessage', + 'MX' === $type ? 'checkMX' : 'checkHost' => true, + )); + + $this->validator->validate('foo@example.com', $constraint); + + if (!$violation) { + $this->assertNoViolation(); + } else { + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"foo@example.com"') + ->setCode($violation) + ->assertRaised(); + } + } + + public function getDnsChecks() + { + return array( + array('MX', false), + array('MX', Email::MX_CHECK_FAILED_ERROR), + array('A', false), + array('A', Email::HOST_CHECK_FAILED_ERROR), + array('AAAA', false), + array('AAAA', Email::HOST_CHECK_FAILED_ERROR), + ); + } + + /** + * @requires function Symfony\Bridge\PhpUnit\DnsMock::withMockedHosts + */ + public function testHostnameIsProperlyParsed() + { + DnsMock::withMockedHosts(array('baz.com' => array(array('type' => 'MX')))); + + $this->validator->validate( + '"foo@bar"@baz.com', + new Email(array('checkMX' => true)) + ); + + $this->assertNoViolation(); + } + + /** + * @dataProvider provideCheckTypes + */ + public function testEmptyHostIsNotValid($checkType, $violation) + { + $this->validator->validate( + 'foo@bar.fr@', + new Email(array( + 'message' => 'myMessage', + $checkType => true, + )) + ); + + $this + ->buildViolation('myMessage') + ->setParameter('{{ value }}', '"foo@bar.fr@"') + ->setCode($violation) + ->assertRaised(); + } + + public function provideCheckTypes() + { + return array( + array('checkMX', Email::MX_CHECK_FAILED_ERROR), + array('checkHost', Email::HOST_CHECK_FAILED_ERROR), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/EqualToValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/EqualToValidatorTest.php new file mode 100644 index 00000000000..32c81c3ae78 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/EqualToValidatorTest.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\EqualTo; +use Symfony\Component\Validator\Constraints\EqualToValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class EqualToValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new EqualToValidator(); + } + + protected function createConstraint(array $options = null) + { + return new EqualTo($options); + } + + protected function getErrorCode() + { + return EqualTo::NOT_EQUAL_ERROR; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + return array( + array(3, 3), + array(3, '3'), + array('a', 'a'), + array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')), + array(new \DateTime('2000-01-01'), '2000-01-01'), + array(new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'), + array(new ComparisonTest_Class(5), new ComparisonTest_Class(5)), + array(null, 1), + ); + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + return array( + array(1, '1', 2, '2', 'integer'), + array('22', '"22"', '333', '"333"', 'string'), + array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2001-01-01 UTC'), 'Jan 1, 2001, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php new file mode 100644 index 00000000000..ee287c9f1a0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ExpressionValidatorTest.php @@ -0,0 +1,279 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\Validator\Constraints\Expression; +use Symfony\Component\Validator\Constraints\ExpressionValidator; +use Symfony\Component\Validator\Tests\Fixtures\Entity; +use Symfony\Component\Validator\Tests\Fixtures\ToString; +use Symfony\Component\Validator\Validation; + +class ExpressionValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new ExpressionValidator(PropertyAccess::createPropertyAccessor()); + } + + public function testExpressionIsEvaluatedWithNullValue() + { + $constraint = new Expression(array( + 'expression' => 'false', + 'message' => 'myMessage', + )); + + $this->validator->validate(null, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'null') + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->assertRaised(); + } + + public function testExpressionIsEvaluatedWithEmptyStringValue() + { + $constraint = new Expression(array( + 'expression' => 'false', + 'message' => 'myMessage', + )); + + $this->validator->validate('', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '""') + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->assertRaised(); + } + + public function testSucceedingExpressionAtObjectLevel() + { + $constraint = new Expression('this.data == 1'); + + $object = new Entity(); + $object->data = '1'; + + $this->setObject($object); + + $this->validator->validate($object, $constraint); + + $this->assertNoViolation(); + } + + public function testFailingExpressionAtObjectLevel() + { + $constraint = new Expression(array( + 'expression' => 'this.data == 1', + 'message' => 'myMessage', + )); + + $object = new Entity(); + $object->data = '2'; + + $this->setObject($object); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'object') + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->assertRaised(); + } + + public function testSucceedingExpressionAtObjectLevelWithToString() + { + $constraint = new Expression('this.data == 1'); + + $object = new ToString(); + $object->data = '1'; + + $this->setObject($object); + + $this->validator->validate($object, $constraint); + + $this->assertNoViolation(); + } + + public function testFailingExpressionAtObjectLevelWithToString() + { + $constraint = new Expression(array( + 'expression' => 'this.data == 1', + 'message' => 'myMessage', + )); + + $object = new ToString(); + $object->data = '2'; + + $this->setObject($object); + + $this->validator->validate($object, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'toString') + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->assertRaised(); + } + + public function testSucceedingExpressionAtPropertyLevel() + { + $constraint = new Expression('value == this.data'); + + $object = new Entity(); + $object->data = '1'; + + $this->setRoot($object); + $this->setPropertyPath('data'); + $this->setProperty($object, 'data'); + + $this->validator->validate('1', $constraint); + + $this->assertNoViolation(); + } + + public function testFailingExpressionAtPropertyLevel() + { + $constraint = new Expression(array( + 'expression' => 'value == this.data', + 'message' => 'myMessage', + )); + + $object = new Entity(); + $object->data = '1'; + + $this->setRoot($object); + $this->setPropertyPath('data'); + $this->setProperty($object, 'data'); + + $this->validator->validate('2', $constraint); + + $this->buildViolation('myMessage') + ->atPath('data') + ->setParameter('{{ value }}', '"2"') + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->assertRaised(); + } + + public function testSucceedingExpressionAtNestedPropertyLevel() + { + $constraint = new Expression('value == this.data'); + + $object = new Entity(); + $object->data = '1'; + + $root = new Entity(); + $root->reference = $object; + + $this->setRoot($root); + $this->setPropertyPath('reference.data'); + $this->setProperty($object, 'data'); + + $this->validator->validate('1', $constraint); + + $this->assertNoViolation(); + } + + public function testFailingExpressionAtNestedPropertyLevel() + { + $constraint = new Expression(array( + 'expression' => 'value == this.data', + 'message' => 'myMessage', + )); + + $object = new Entity(); + $object->data = '1'; + + $root = new Entity(); + $root->reference = $object; + + $this->setRoot($root); + $this->setPropertyPath('reference.data'); + $this->setProperty($object, 'data'); + + $this->validator->validate('2', $constraint); + + $this->buildViolation('myMessage') + ->atPath('reference.data') + ->setParameter('{{ value }}', '"2"') + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->assertRaised(); + } + + /** + * When validatePropertyValue() is called with a class name + * https://github.com/symfony/symfony/pull/11498. + */ + public function testSucceedingExpressionAtPropertyLevelWithoutRoot() + { + $constraint = new Expression('value == "1"'); + + $this->setRoot('1'); + $this->setPropertyPath(''); + $this->setProperty(null, 'property'); + + $this->validator->validate('1', $constraint); + + $this->assertNoViolation(); + } + + /** + * When validatePropertyValue() is called with a class name + * https://github.com/symfony/symfony/pull/11498. + */ + public function testFailingExpressionAtPropertyLevelWithoutRoot() + { + $constraint = new Expression(array( + 'expression' => 'value == "1"', + 'message' => 'myMessage', + )); + + $this->setRoot('2'); + $this->setPropertyPath(''); + $this->setProperty(null, 'property'); + + $this->validator->validate('2', $constraint); + + $this->buildViolation('myMessage') + ->atPath('') + ->setParameter('{{ value }}', '"2"') + ->setCode(Expression::EXPRESSION_FAILED_ERROR) + ->assertRaised(); + } + + public function testExpressionLanguageUsage() + { + $constraint = new Expression(array( + 'expression' => 'false', + )); + + $expressionLanguage = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ExpressionLanguage')->getMock(); + + $used = false; + + $expressionLanguage->method('evaluate') + ->will($this->returnCallback(function () use (&$used) { + $used = true; + + return true; + })); + + $validator = new ExpressionValidator(null, $expressionLanguage); + $validator->initialize($this->createContext()); + $validator->validate(null, $constraint); + + $this->assertTrue($used, 'Failed asserting that custom ExpressionLanguage instance is used.'); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileTest.php new file mode 100644 index 00000000000..b7745f44fa1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileTest.php @@ -0,0 +1,139 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\File; +use Symfony\Component\Validator\Exception\ConstraintDefinitionException; + +class FileTest extends TestCase +{ + /** + * @dataProvider provideValidSizes + */ + public function testMaxSize($maxSize, $bytes, $binaryFormat) + { + $file = new File(array('maxSize' => $maxSize)); + + $this->assertSame($bytes, $file->maxSize); + $this->assertSame($binaryFormat, $file->binaryFormat); + $this->assertTrue($file->__isset('maxSize')); + } + + public function testMagicIsset() + { + $file = new File(array('maxSize' => 1)); + + $this->assertTrue($file->__isset('maxSize')); + $this->assertTrue($file->__isset('groups')); + $this->assertFalse($file->__isset('toto')); + } + + /** + * @dataProvider provideValidSizes + */ + public function testMaxSizeCanBeSetAfterInitialization($maxSize, $bytes, $binaryFormat) + { + $file = new File(); + $file->maxSize = $maxSize; + + $this->assertSame($bytes, $file->maxSize); + $this->assertSame($binaryFormat, $file->binaryFormat); + } + + /** + * @dataProvider provideInvalidSizes + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidValueForMaxSizeThrowsExceptionAfterInitialization($maxSize) + { + $file = new File(array('maxSize' => 1000)); + $file->maxSize = $maxSize; + } + + /** + * @dataProvider provideInvalidSizes + */ + public function testMaxSizeCannotBeSetToInvalidValueAfterInitialization($maxSize) + { + $file = new File(array('maxSize' => 1000)); + + try { + $file->maxSize = $maxSize; + } catch (ConstraintDefinitionException $e) { + } + + $this->assertSame(1000, $file->maxSize); + } + + /** + * @dataProvider provideInValidSizes + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMaxSize($maxSize) + { + new File(array('maxSize' => $maxSize)); + } + + public function provideValidSizes() + { + return array( + array('500', 500, false), + array(12300, 12300, false), + array('1ki', 1024, true), + array('1KI', 1024, true), + array('2k', 2000, false), + array('2K', 2000, false), + array('1mi', 1048576, true), + array('1MI', 1048576, true), + array('3m', 3000000, false), + array('3M', 3000000, false), + ); + } + + public function provideInvalidSizes() + { + return array( + array('+100'), + array('foo'), + array('1Ko'), + array('1kio'), + array('1G'), + array('1Gi'), + ); + } + + /** + * @dataProvider provideFormats + */ + public function testBinaryFormat($maxSize, $guessedFormat, $binaryFormat) + { + $file = new File(array('maxSize' => $maxSize, 'binaryFormat' => $guessedFormat)); + + $this->assertSame($binaryFormat, $file->binaryFormat); + } + + public function provideFormats() + { + return array( + array(100, null, false), + array(100, true, true), + array(100, false, false), + array('100K', null, false), + array('100K', true, true), + array('100K', false, false), + array('100Ki', null, true), + array('100Ki', true, true), + array('100Ki', false, false), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorObjectTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorObjectTest.php new file mode 100644 index 00000000000..f35f93b1797 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorObjectTest.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\HttpFoundation\File\File; + +class FileValidatorObjectTest extends FileValidatorTest +{ + protected function getFile($filename) + { + return new File($filename); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorPathTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorPathTest.php new file mode 100644 index 00000000000..11b8d4cb798 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorPathTest.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\File; + +class FileValidatorPathTest extends FileValidatorTest +{ + protected function getFile($filename) + { + return $filename; + } + + public function testFileNotFound() + { + $constraint = new File(array( + 'notFoundMessage' => 'myMessage', + )); + + $this->validator->validate('foobar', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ file }}', '"foobar"') + ->setCode(File::NOT_FOUND_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php new file mode 100644 index 00000000000..6e2199ce02a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/FileValidatorTest.php @@ -0,0 +1,483 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Symfony\Component\Validator\Constraints\File; +use Symfony\Component\Validator\Constraints\FileValidator; +use Symfony\Component\Validator\Validation; + +abstract class FileValidatorTest extends AbstractConstraintValidatorTest +{ + protected $path; + + protected $file; + + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new FileValidator(); + } + + protected function setUp() + { + parent::setUp(); + + $this->path = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'FileValidatorTest'; + $this->file = fopen($this->path, 'w'); + fwrite($this->file, ' ', 1); + } + + protected function tearDown() + { + parent::tearDown(); + + if (\is_resource($this->file)) { + fclose($this->file); + } + + if (file_exists($this->path)) { + unlink($this->path); + } + + $this->path = null; + $this->file = null; + } + + public function testNullIsValid() + { + $this->validator->validate(null, new File()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new File()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleTypeOrFile() + { + $this->validator->validate(new \stdClass(), new File()); + } + + public function testValidFile() + { + $this->validator->validate($this->path, new File()); + + $this->assertNoViolation(); + } + + public function testValidUploadedfile() + { + $file = new UploadedFile($this->path, 'originalName', null, null, null, true); + $this->validator->validate($file, new File()); + + $this->assertNoViolation(); + } + + public function provideMaxSizeExceededTests() + { + // We have various interesting limit - size combinations to test. + // Assume a limit of 1000 bytes (1 kB). Then the following table + // lists the violation messages for different file sizes: + // -----------+-------------------------------------------------------- + // Size | Violation Message + // -----------+-------------------------------------------------------- + // 1000 bytes | No violation + // 1001 bytes | "Size of 1001 bytes exceeded limit of 1000 bytes" + // 1004 bytes | "Size of 1004 bytes exceeded limit of 1000 bytes" + // | NOT: "Size of 1 kB exceeded limit of 1 kB" + // 1005 bytes | "Size of 1.01 kB exceeded limit of 1 kB" + // -----------+-------------------------------------------------------- + + // As you see, we have two interesting borders: + + // 1000/1001 - The border as of which a violation occurs + // 1004/1005 - The border as of which the message can be rounded to kB + + // Analogous for kB/MB. + + // Prior to Symfony 2.5, violation messages are always displayed in the + // same unit used to specify the limit. + + // As of Symfony 2.5, the above logic is implemented. + return array( + // limit in bytes + array(1001, 1000, '1001', '1000', 'bytes'), + array(1004, 1000, '1004', '1000', 'bytes'), + array(1005, 1000, '1.01', '1', 'kB'), + + array(1000001, 1000000, '1000001', '1000000', 'bytes'), + array(1004999, 1000000, '1005', '1000', 'kB'), + array(1005000, 1000000, '1.01', '1', 'MB'), + + // limit in kB + array(1001, '1k', '1001', '1000', 'bytes'), + array(1004, '1k', '1004', '1000', 'bytes'), + array(1005, '1k', '1.01', '1', 'kB'), + + array(1000001, '1000k', '1000001', '1000000', 'bytes'), + array(1004999, '1000k', '1005', '1000', 'kB'), + array(1005000, '1000k', '1.01', '1', 'MB'), + + // limit in MB + array(1000001, '1M', '1000001', '1000000', 'bytes'), + array(1004999, '1M', '1005', '1000', 'kB'), + array(1005000, '1M', '1.01', '1', 'MB'), + + // limit in KiB + array(1025, '1Ki', '1025', '1024', 'bytes'), + array(1029, '1Ki', '1029', '1024', 'bytes'), + array(1030, '1Ki', '1.01', '1', 'KiB'), + + array(1048577, '1024Ki', '1048577', '1048576', 'bytes'), + array(1053818, '1024Ki', '1029.12', '1024', 'KiB'), + array(1053819, '1024Ki', '1.01', '1', 'MiB'), + + // limit in MiB + array(1048577, '1Mi', '1048577', '1048576', 'bytes'), + array(1053818, '1Mi', '1029.12', '1024', 'KiB'), + array(1053819, '1Mi', '1.01', '1', 'MiB'), + ); + } + + /** + * @dataProvider provideMaxSizeExceededTests + */ + public function testMaxSizeExceeded($bytesWritten, $limit, $sizeAsString, $limitAsString, $suffix) + { + fseek($this->file, $bytesWritten - 1, SEEK_SET); + fwrite($this->file, '0'); + fclose($this->file); + + $constraint = new File(array( + 'maxSize' => $limit, + 'maxSizeMessage' => 'myMessage', + )); + + $this->validator->validate($this->getFile($this->path), $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ size }}', $sizeAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setParameter('{{ file }}', '"'.$this->path.'"') + ->setCode(File::TOO_LARGE_ERROR) + ->assertRaised(); + } + + public function provideMaxSizeNotExceededTests() + { + return array( + // limit in bytes + array(1000, 1000), + array(1000000, 1000000), + + // limit in kB + array(1000, '1k'), + array(1000000, '1000k'), + + // limit in MB + array(1000000, '1M'), + + // limit in KiB + array(1024, '1Ki'), + array(1048576, '1024Ki'), + + // limit in MiB + array(1048576, '1Mi'), + ); + } + + /** + * @dataProvider provideMaxSizeNotExceededTests + */ + public function testMaxSizeNotExceeded($bytesWritten, $limit) + { + fseek($this->file, $bytesWritten - 1, SEEK_SET); + fwrite($this->file, '0'); + fclose($this->file); + + $constraint = new File(array( + 'maxSize' => $limit, + 'maxSizeMessage' => 'myMessage', + )); + + $this->validator->validate($this->getFile($this->path), $constraint); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMaxSize() + { + $constraint = new File(array( + 'maxSize' => '1abc', + )); + + $this->validator->validate($this->path, $constraint); + } + + public function provideBinaryFormatTests() + { + return array( + array(11, 10, null, '11', '10', 'bytes'), + array(11, 10, true, '11', '10', 'bytes'), + array(11, 10, false, '11', '10', 'bytes'), + + // round(size) == 1.01kB, limit == 1kB + array(ceil(1000 * 1.01), 1000, null, '1.01', '1', 'kB'), + array(ceil(1000 * 1.01), '1k', null, '1.01', '1', 'kB'), + array(ceil(1024 * 1.01), '1Ki', null, '1.01', '1', 'KiB'), + + array(ceil(1024 * 1.01), 1024, true, '1.01', '1', 'KiB'), + array(ceil(1024 * 1.01 * 1000), '1024k', true, '1010', '1000', 'KiB'), + array(ceil(1024 * 1.01), '1Ki', true, '1.01', '1', 'KiB'), + + array(ceil(1000 * 1.01), 1000, false, '1.01', '1', 'kB'), + array(ceil(1000 * 1.01), '1k', false, '1.01', '1', 'kB'), + array(ceil(1024 * 1.01 * 10), '10Ki', false, '10.34', '10.24', 'kB'), + ); + } + + /** + * @dataProvider provideBinaryFormatTests + */ + public function testBinaryFormat($bytesWritten, $limit, $binaryFormat, $sizeAsString, $limitAsString, $suffix) + { + fseek($this->file, $bytesWritten - 1, SEEK_SET); + fwrite($this->file, '0'); + fclose($this->file); + + $constraint = new File(array( + 'maxSize' => $limit, + 'binaryFormat' => $binaryFormat, + 'maxSizeMessage' => 'myMessage', + )); + + $this->validator->validate($this->getFile($this->path), $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ limit }}', $limitAsString) + ->setParameter('{{ size }}', $sizeAsString) + ->setParameter('{{ suffix }}', $suffix) + ->setParameter('{{ file }}', '"'.$this->path.'"') + ->setCode(File::TOO_LARGE_ERROR) + ->assertRaised(); + } + + public function testValidMimeType() + { + $file = $this + ->getMockBuilder('Symfony\Component\HttpFoundation\File\File') + ->setConstructorArgs(array(__DIR__.'/Fixtures/foo')) + ->getMock(); + $file + ->expects($this->once()) + ->method('getPathname') + ->will($this->returnValue($this->path)); + $file + ->expects($this->once()) + ->method('getMimeType') + ->will($this->returnValue('image/jpg')); + + $constraint = new File(array( + 'mimeTypes' => array('image/png', 'image/jpg'), + )); + + $this->validator->validate($file, $constraint); + + $this->assertNoViolation(); + } + + public function testValidWildcardMimeType() + { + $file = $this + ->getMockBuilder('Symfony\Component\HttpFoundation\File\File') + ->setConstructorArgs(array(__DIR__.'/Fixtures/foo')) + ->getMock(); + $file + ->expects($this->once()) + ->method('getPathname') + ->will($this->returnValue($this->path)); + $file + ->expects($this->once()) + ->method('getMimeType') + ->will($this->returnValue('image/jpg')); + + $constraint = new File(array( + 'mimeTypes' => array('image/*'), + )); + + $this->validator->validate($file, $constraint); + + $this->assertNoViolation(); + } + + public function testInvalidMimeType() + { + $file = $this + ->getMockBuilder('Symfony\Component\HttpFoundation\File\File') + ->setConstructorArgs(array(__DIR__.'/Fixtures/foo')) + ->getMock(); + $file + ->expects($this->once()) + ->method('getPathname') + ->will($this->returnValue($this->path)); + $file + ->expects($this->once()) + ->method('getMimeType') + ->will($this->returnValue('application/pdf')); + + $constraint = new File(array( + 'mimeTypes' => array('image/png', 'image/jpg'), + 'mimeTypesMessage' => 'myMessage', + )); + + $this->validator->validate($file, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ type }}', '"application/pdf"') + ->setParameter('{{ types }}', '"image/png", "image/jpg"') + ->setParameter('{{ file }}', '"'.$this->path.'"') + ->setCode(File::INVALID_MIME_TYPE_ERROR) + ->assertRaised(); + } + + public function testInvalidWildcardMimeType() + { + $file = $this + ->getMockBuilder('Symfony\Component\HttpFoundation\File\File') + ->setConstructorArgs(array(__DIR__.'/Fixtures/foo')) + ->getMock(); + $file + ->expects($this->once()) + ->method('getPathname') + ->will($this->returnValue($this->path)); + $file + ->expects($this->once()) + ->method('getMimeType') + ->will($this->returnValue('application/pdf')); + + $constraint = new File(array( + 'mimeTypes' => array('image/*', 'image/jpg'), + 'mimeTypesMessage' => 'myMessage', + )); + + $this->validator->validate($file, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ type }}', '"application/pdf"') + ->setParameter('{{ types }}', '"image/*", "image/jpg"') + ->setParameter('{{ file }}', '"'.$this->path.'"') + ->setCode(File::INVALID_MIME_TYPE_ERROR) + ->assertRaised(); + } + + public function testDisallowEmpty() + { + ftruncate($this->file, 0); + + $constraint = new File(array( + 'disallowEmptyMessage' => 'myMessage', + )); + + $this->validator->validate($this->getFile($this->path), $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ file }}', '"'.$this->path.'"') + ->setCode(File::EMPTY_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider uploadedFileErrorProvider + */ + public function testUploadedFileError($error, $message, array $params = array(), $maxSize = null) + { + $file = new UploadedFile('/path/to/file', 'originalName', 'mime', 0, $error); + + $constraint = new File(array( + $message => 'myMessage', + 'maxSize' => $maxSize, + )); + + $this->validator->validate($file, $constraint); + + $this->buildViolation('myMessage') + ->setParameters($params) + ->setCode($error) + ->assertRaised(); + } + + public function uploadedFileErrorProvider() + { + $tests = array( + array(UPLOAD_ERR_FORM_SIZE, 'uploadFormSizeErrorMessage'), + array(UPLOAD_ERR_PARTIAL, 'uploadPartialErrorMessage'), + array(UPLOAD_ERR_NO_FILE, 'uploadNoFileErrorMessage'), + array(UPLOAD_ERR_NO_TMP_DIR, 'uploadNoTmpDirErrorMessage'), + array(UPLOAD_ERR_CANT_WRITE, 'uploadCantWriteErrorMessage'), + array(UPLOAD_ERR_EXTENSION, 'uploadExtensionErrorMessage'), + ); + + if (class_exists('Symfony\Component\HttpFoundation\File\UploadedFile')) { + // when no maxSize is specified on constraint, it should use the ini value + $tests[] = array(UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', array( + '{{ limit }}' => UploadedFile::getMaxFilesize() / 1048576, + '{{ suffix }}' => 'MiB', + )); + + // it should use the smaller limitation (maxSize option in this case) + $tests[] = array(UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', array( + '{{ limit }}' => 1, + '{{ suffix }}' => 'bytes', + ), '1'); + + // access FileValidator::factorizeSizes() private method to format max file size + $reflection = new \ReflectionClass(\get_class(new FileValidator())); + $method = $reflection->getMethod('factorizeSizes'); + $method->setAccessible(true); + list($sizeAsString, $limit, $suffix) = $method->invokeArgs(new FileValidator(), array(0, UploadedFile::getMaxFilesize(), false)); + + // it correctly parses the maxSize option and not only uses simple string comparison + // 1000M should be bigger than the ini value + $tests[] = array(UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', array( + '{{ limit }}' => $limit, + '{{ suffix }}' => $suffix, + ), '1000M'); + + // it correctly parses the maxSize option and not only uses simple string comparison + // 1000M should be bigger than the ini value + $tests[] = array(UPLOAD_ERR_INI_SIZE, 'uploadIniSizeErrorMessage', array( + '{{ limit }}' => '0.1', + '{{ suffix }}' => 'MB', + ), '100K'); + } + + return $tests; + } + + abstract protected function getFile($filename); +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/foo b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/foo new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test.gif b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test.gif new file mode 100644 index 0000000000000000000000000000000000000000..6b44fc7dfb859cbcfd1b5cc72b1fa68ddd5b4328 GIT binary patch literal 801 wcmZ?wbhEHbWMW`q_|Cxa|Nno6Q7{?;BQ*qcKpqF>1qKc_21X7R0RaYU0BZ&YM*si- literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_4by3.gif b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_4by3.gif new file mode 100644 index 0000000000000000000000000000000000000000..64dd3ff96a22b811751dba118c240d0ccd4165f7 GIT binary patch literal 57 zcmZ?wbhEHbWMN=tXkcLY4+e_=1f7dg6H8K46v{J8G8EiBeFGSD7=QqzjDd-{r9X_p F8UR8h5f=ae literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_landscape.gif b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_landscape.gif new file mode 100644 index 0000000000000000000000000000000000000000..870123532c3b97be8e2ab75452eca7060fb474c4 GIT binary patch literal 43 qcmZ?wbhEHbWMW`sXkcLY4+e@qSs1y10y+#p0Fq%~V)Ef)um%7ZunH6a literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_portrait.gif b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/Fixtures/test_portrait.gif new file mode 100644 index 0000000000000000000000000000000000000000..cc480ca88ed7fa80ff8e3907ba14d692e3e9d3d4 GIT binary patch literal 43 rcmZ?wbhEHbWMp7sXkcLY4+e@qSs1w(7#VaJfB+=Jz{KRk#b6Bp7pw{t literal 0 HcmV?d00001 diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php new file mode 100644 index 00000000000..2a8bcb3b5f1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\GreaterThanOrEqual; +use Symfony\Component\Validator\Constraints\GreaterThanOrEqualValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class GreaterThanOrEqualValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new GreaterThanOrEqualValidator(); + } + + protected function createConstraint(array $options = null) + { + return new GreaterThanOrEqual($options); + } + + protected function getErrorCode() + { + return GreaterThanOrEqual::TOO_LOW_ERROR; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + return array( + array(3, 2), + array(1, 1), + array(new \DateTime('2010/01/01'), new \DateTime('2000/01/01')), + array(new \DateTime('2000/01/01'), new \DateTime('2000/01/01')), + array(new \DateTime('2010/01/01'), '2000/01/01'), + array(new \DateTime('2000/01/01'), '2000/01/01'), + array(new \DateTime('2010/01/01 UTC'), '2000/01/01 UTC'), + array(new \DateTime('2000/01/01 UTC'), '2000/01/01 UTC'), + array('a', 'a'), + array('z', 'a'), + array(null, 1), + ); + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + return array( + array(1, '1', 2, '2', 'integer'), + array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'), + array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'), + array(new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'), + array('b', '"b"', 'c', '"c"', 'string'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanValidatorTest.php new file mode 100644 index 00000000000..8e763fbe309 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GreaterThanValidatorTest.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\GreaterThan; +use Symfony\Component\Validator\Constraints\GreaterThanValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class GreaterThanValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new GreaterThanValidator(); + } + + protected function createConstraint(array $options = null) + { + return new GreaterThan($options); + } + + protected function getErrorCode() + { + return GreaterThan::TOO_LOW_ERROR; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + return array( + array(2, 1), + array(new \DateTime('2005/01/01'), new \DateTime('2001/01/01')), + array(new \DateTime('2005/01/01'), '2001/01/01'), + array(new \DateTime('2005/01/01 UTC'), '2001/01/01 UTC'), + array(new ComparisonTest_Class(5), new ComparisonTest_Class(4)), + array('333', '22'), + array(null, 1), + ); + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + return array( + array(1, '1', 2, '2', 'integer'), + array(2, '2', 2, '2', 'integer'), + array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'), + array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'), + array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2000/01/01', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'), + array(new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000/01/01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), + array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), + array('22', '"22"', '333', '"333"', 'string'), + array('22', '"22"', '22', '"22"', 'string'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php new file mode 100644 index 00000000000..2b906a918f0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/GroupSequenceTest.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\GroupSequence; + +/** + * @author Bernhard Schussek + */ +class GroupSequenceTest extends TestCase +{ + public function testCreate() + { + $sequence = new GroupSequence(array('Group 1', 'Group 2')); + + $this->assertSame(array('Group 1', 'Group 2'), $sequence->groups); + } + + public function testCreateDoctrineStyle() + { + $sequence = new GroupSequence(array('value' => array('Group 1', 'Group 2'))); + + $this->assertSame(array('Group 1', 'Group 2'), $sequence->groups); + } + + /** + * @group legacy + */ + public function testLegacyIterate() + { + $sequence = new GroupSequence(array('Group 1', 'Group 2')); + + $this->assertSame(array('Group 1', 'Group 2'), iterator_to_array($sequence)); + } + + /** + * @group legacy + */ + public function testLegacyCount() + { + $sequence = new GroupSequence(array('Group 1', 'Group 2')); + + $this->assertCount(2, $sequence); + } + + /** + * @group legacy + */ + public function testLegacyArrayAccess() + { + $sequence = new GroupSequence(array('Group 1', 'Group 2')); + + $this->assertSame('Group 1', $sequence[0]); + $this->assertSame('Group 2', $sequence[1]); + $this->assertArrayHasKey(0, $sequence); + $this->assertArrayNotHasKey(2, $sequence); + unset($sequence[0]); + $this->assertArrayNotHasKey(0, $sequence); + $sequence[] = 'Group 3'; + $this->assertArrayHasKey(2, $sequence); + $this->assertSame('Group 3', $sequence[2]); + $sequence[0] = 'Group 1'; + $this->assertArrayHasKey(0, $sequence); + $this->assertSame('Group 1', $sequence[0]); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\OutOfBoundsException + * @group legacy + */ + public function testLegacyGetExpectsExistingKey() + { + $sequence = new GroupSequence(array('Group 1', 'Group 2')); + + $sequence[2]; + } + + /** + * @group legacy + */ + public function testLegacyUnsetIgnoresNonExistingKeys() + { + $sequence = new GroupSequence(array('Group 1', 'Group 2')); + + // should not fail + unset($sequence[2]); + + $this->assertCount(2, $sequence); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IbanValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IbanValidatorTest.php new file mode 100644 index 00000000000..16bf834f87c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IbanValidatorTest.php @@ -0,0 +1,450 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Iban; +use Symfony\Component\Validator\Constraints\IbanValidator; +use Symfony\Component\Validator\Validation; + +class IbanValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IbanValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Iban()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Iban()); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getValidIbans + */ + public function testValidIbans($iban) + { + $this->validator->validate($iban, new Iban()); + + $this->assertNoViolation(); + } + + public function getValidIbans() + { + return array( + array('CH9300762011623852957'), // Switzerland without spaces + array('CH93 0076 2011 6238 5295 7'), // Switzerland with multiple spaces + + // Country list + // http://www.rbs.co.uk/corporate/international/g0/guide-to-international-business/regulatory-information/iban/iban-example.ashx + + array('AL47 2121 1009 0000 0002 3569 8741'), //Albania + array('AD12 0001 2030 2003 5910 0100'), //Andorra + array('AT61 1904 3002 3457 3201'), //Austria + array('AZ21 NABZ 0000 0000 1370 1000 1944'), //Azerbaijan + array('BH67 BMAG 0000 1299 1234 56'), //Bahrain + array('BE62 5100 0754 7061'), //Belgium + array('BA39 1290 0794 0102 8494'), //Bosnia and Herzegovina + array('BG80 BNBG 9661 1020 3456 78'), //Bulgaria + array('BY 13 NBRB 3600 900000002Z00AB00'), //Belarus + array('BY13 NBRB 3600 900000002Z00AB00'), //Belarus + array('BY22NB23324232T78YR7823HR32U'), //Belarus + array('HR12 1001 0051 8630 0016 0'), //Croatia + array('CY17 0020 0128 0000 0012 0052 7600'), //Cyprus + array('CZ65 0800 0000 1920 0014 5399'), //Czech Republic + array('DK50 0040 0440 1162 43'), //Denmark + array('EE38 2200 2210 2014 5685'), //Estonia + array('FO97 5432 0388 8999 44'), //Faroe Islands + array('FI21 1234 5600 0007 85'), //Finland + array('FR14 2004 1010 0505 0001 3M02 606'), //France + array('GE29 NB00 0000 0101 9049 17'), //Georgia + array('DE89 3704 0044 0532 0130 00'), //Germany + array('GI75 NWBK 0000 0000 7099 453'), //Gibraltar + array('GR16 0110 1250 0000 0001 2300 695'), //Greece + array('GL56 0444 9876 5432 10'), //Greenland + array('HU42 1177 3016 1111 1018 0000 0000'), //Hungary + array('IS14 0159 2600 7654 5510 7303 39'), //Iceland + array('IE29 AIBK 9311 5212 3456 78'), //Ireland + array('IL62 0108 0000 0009 9999 999'), //Israel + array('IT40 S054 2811 1010 0000 0123 456'), //Italy + array('LV80 BANK 0000 4351 9500 1'), //Latvia + array('LB62 0999 0000 0001 0019 0122 9114'), //Lebanon + array('LI21 0881 0000 2324 013A A'), //Liechtenstein + array('LT12 1000 0111 0100 1000'), //Lithuania + array('LU28 0019 4006 4475 0000'), //Luxembourg + array('MK072 5012 0000 0589 84'), //Macedonia + array('MT84 MALT 0110 0001 2345 MTLC AST0 01S'), //Malta + array('MU17 BOMM 0101 1010 3030 0200 000M UR'), //Mauritius + array('MD24 AG00 0225 1000 1310 4168'), //Moldova + array('MC93 2005 2222 1001 1223 3M44 555'), //Monaco + array('ME25 5050 0001 2345 6789 51'), //Montenegro + array('NL39 RABO 0300 0652 64'), //Netherlands + array('NO93 8601 1117 947'), //Norway + array('PK36 SCBL 0000 0011 2345 6702'), //Pakistan + array('PL60 1020 1026 0000 0422 7020 1111'), //Poland + array('PT50 0002 0123 1234 5678 9015 4'), //Portugal + array('RO49 AAAA 1B31 0075 9384 0000'), //Romania + array('SM86 U032 2509 8000 0000 0270 100'), //San Marino + array('SA03 8000 0000 6080 1016 7519'), //Saudi Arabia + array('RS35 2600 0560 1001 6113 79'), //Serbia + array('SK31 1200 0000 1987 4263 7541'), //Slovak Republic + array('SI56 1910 0000 0123 438'), //Slovenia + array('ES80 2310 0001 1800 0001 2345'), //Spain + array('SE35 5000 0000 0549 1000 0003'), //Sweden + array('CH93 0076 2011 6238 5295 7'), //Switzerland + array('TN59 1000 6035 1835 9847 8831'), //Tunisia + array('TR33 0006 1005 1978 6457 8413 26'), //Turkey + array('AE07 0331 2345 6789 0123 456'), //UAE + array('GB12 CPBK 0892 9965 0449 91'), //United Kingdom + + //Extended country list + //http://www.nordea.com/Our+services/International+products+and+services/Cash+Management/IBAN+countries/908462.html + // https://www.swift.com/sites/default/files/resources/iban_registry.pdf + array('AO06000600000100037131174'), //Angola + array('AZ21NABZ00000000137010001944'), //Azerbaijan + array('BH29BMAG1299123456BH00'), //Bahrain + array('BJ11B00610100400271101192591'), //Benin + array('BR9700360305000010009795493P1'), // Brazil + array('BR1800000000141455123924100C2'), // Brazil + array('VG96VPVG0000012345678901'), //British Virgin Islands + array('BF1030134020015400945000643'), //Burkina Faso + array('BI43201011067444'), //Burundi + array('CM2110003001000500000605306'), //Cameroon + array('CV64000300004547069110176'), //Cape Verde + array('FR7630007000110009970004942'), //Central African Republic + array('CG5230011000202151234567890'), //Congo + array('CR05015202001026284066'), //Costa Rica + array('DO28BAGR00000001212453611324'), //Dominican Republic + array('GT82TRAJ01020000001210029690'), //Guatemala + array('IR580540105180021273113007'), //Iran + array('IL620108000000099999999'), //Israel + array('CI05A00060174100178530011852'), //Ivory Coast + array('JO94CBJO0010000000000131000302'), // Jordan + array('KZ176010251000042993'), //Kazakhstan + array('KW74NBOK0000000000001000372151'), //Kuwait + array('LB30099900000001001925579115'), //Lebanon + array('MG4600005030010101914016056'), //Madagascar + array('ML03D00890170001002120000447'), //Mali + array('MR1300012000010000002037372'), //Mauritania + array('MU17BOMM0101101030300200000MUR'), //Mauritius + array('MZ59000100000011834194157'), //Mozambique + array('PS92PALS000000000400123456702'), //Palestinian Territory + array('QA58DOHB00001234567890ABCDEFG'), //Qatar + array('XK051212012345678906'), //Republic of Kosovo + array('PT50000200000163099310355'), //Sao Tome and Principe + array('SA0380000000608010167519'), //Saudi Arabia + array('SN12K00100152000025690007542'), //Senegal + array('TL380080012345678910157'), //Timor-Leste + array('TN5914207207100707129648'), //Tunisia + array('TR330006100519786457841326'), //Turkey + array('UA213223130000026007233566001'), //Ukraine + array('AE260211000000230064016'), //United Arab Emirates + ); + } + + /** + * @dataProvider getIbansWithInvalidFormat + */ + public function testIbansWithInvalidFormat($iban) + { + $this->assertViolationRaised($iban, Iban::INVALID_FORMAT_ERROR); + } + + public function getIbansWithInvalidFormat() + { + return array( + array('AL47 2121 1009 0000 0002 3569 874'), //Albania + array('AD12 0001 2030 2003 5910 010'), //Andorra + array('AT61 1904 3002 3457 320'), //Austria + array('AZ21 NABZ 0000 0000 1370 1000 194'), //Azerbaijan + array('AZ21 N1BZ 0000 0000 1370 1000 1944'), //Azerbaijan + array('BH67 BMAG 0000 1299 1234 5'), //Bahrain + array('BH67 B2AG 0000 1299 1234 56'), //Bahrain + array('BE62 5100 0754 7061 2'), //Belgium + array('BA39 1290 0794 0102 8494 4'), //Bosnia and Herzegovina + array('BG80 BNBG 9661 1020 3456 7'), //Bulgaria + array('BG80 B2BG 9661 1020 3456 78'), //Bulgaria + array('BY 13 NBRB 3600 900000002Z00AB001'), //Belarus + array('BY 13 NBRB 3600 900000002Z00AB0'), //Belarus + array('BYRO NBRB 3600 900000002Z00AB0'), //Belarus + array('BY 13 3600 NBRB 900000002Z00AB05'), //Belarus + array('HR12 1001 0051 8630 0016 01'), //Croatia + array('CY17 0020 0128 0000 0012 0052 7600 1'), //Cyprus + array('CZ65 0800 0000 1920 0014 5399 1'), //Czech Republic + array('DK50 0040 0440 1162 431'), //Denmark + array('EE38 2200 2210 2014 5685 1'), //Estonia + array('FO97 5432 0388 8999 441'), //Faroe Islands + array('FI21 1234 5600 0007 851'), //Finland + array('FR14 2004 1010 0505 0001 3M02 6061'), //France + array('GE29 NB00 0000 0101 9049 171'), //Georgia + array('DE89 3704 0044 0532 0130 001'), //Germany + array('GI75 NWBK 0000 0000 7099 4531'), //Gibraltar + array('GR16 0110 1250 0000 0001 2300 6951'), //Greece + array('GL56 0444 9876 5432 101'), //Greenland + array('HU42 1177 3016 1111 1018 0000 0000 1'), //Hungary + array('IS14 0159 2600 7654 5510 7303 391'), //Iceland + array('IE29 AIBK 9311 5212 3456 781'), //Ireland + array('IL62 0108 0000 0009 9999 9991'), //Israel + array('IT40 S054 2811 1010 0000 0123 4561'), //Italy + array('LV80 BANK 0000 4351 9500 11'), //Latvia + array('LB62 0999 0000 0001 0019 0122 9114 1'), //Lebanon + array('LI21 0881 0000 2324 013A A1'), //Liechtenstein + array('LT12 1000 0111 0100 1000 1'), //Lithuania + array('LU28 0019 4006 4475 0000 1'), //Luxembourg + array('MK072 5012 0000 0589 84 1'), //Macedonia + array('MT84 MALT 0110 0001 2345 MTLC AST0 01SA'), //Malta + array('MU17 BOMM 0101 1010 3030 0200 000M URA'), //Mauritius + array('MD24 AG00 0225 1000 1310 4168 1'), //Moldova + array('MC93 2005 2222 1001 1223 3M44 5551'), //Monaco + array('ME25 5050 0001 2345 6789 511'), //Montenegro + array('NL39 RABO 0300 0652 641'), //Netherlands + array('NO93 8601 1117 9471'), //Norway + array('PK36 SCBL 0000 0011 2345 6702 1'), //Pakistan + array('PL60 1020 1026 0000 0422 7020 1111 1'), //Poland + array('PT50 0002 0123 1234 5678 9015 41'), //Portugal + array('RO49 AAAA 1B31 0075 9384 0000 1'), //Romania + array('SM86 U032 2509 8000 0000 0270 1001'), //San Marino + array('SA03 8000 0000 6080 1016 7519 1'), //Saudi Arabia + array('RS35 2600 0560 1001 6113 791'), //Serbia + array('SK31 1200 0000 1987 4263 7541 1'), //Slovak Republic + array('SI56 1910 0000 0123 4381'), //Slovenia + array('ES80 2310 0001 1800 0001 2345 1'), //Spain + array('SE35 5000 0000 0549 1000 0003 1'), //Sweden + array('CH93 0076 2011 6238 5295 71'), //Switzerland + array('TN59 1000 6035 1835 9847 8831 1'), //Tunisia + array('TR33 0006 1005 1978 6457 8413 261'), //Turkey + array('AE07 0331 2345 6789 0123 4561'), //UAE + array('GB12 CPBK 0892 9965 0449 911'), //United Kingdom + + //Extended country list + array('AO060006000001000371311741'), //Angola + array('AZ21NABZ000000001370100019441'), //Azerbaijan + array('BH29BMAG1299123456BH001'), //Bahrain + array('BJ11B006101004002711011925911'), //Benin + array('BR9700360305000010009795493P11'), // Brazil + array('BR1800000000141455123924100C21'), // Brazil + array('VG96VPVG00000123456789011'), //British Virgin Islands + array('BF10301340200154009450006431'), //Burkina Faso + array('BI432010110674441'), //Burundi + array('CM21100030010005000006053061'), //Cameroon + array('CV640003000045470691101761'), //Cape Verde + array('FR76300070001100099700049421'), //Central African Republic + array('CG52300110002021512345678901'), //Congo + array('CR05152020010262840661'), //Costa Rica + array('CR0515202001026284066'), //Costa Rica + array('DO28BAGR000000012124536113241'), //Dominican Republic + array('GT82TRAJ010200000012100296901'), //Guatemala + array('IR5805401051800212731130071'), //Iran + array('IL6201080000000999999991'), //Israel + array('CI05A000601741001785300118521'), //Ivory Coast + array('JO94CBJO00100000000001310003021'), // Jordan + array('KZ1760102510000429931'), //Kazakhstan + array('KW74NBOK00000000000010003721511'), //Kuwait + array('LB300999000000010019255791151'), //Lebanon + array('MG46000050300101019140160561'), //Madagascar + array('ML03D008901700010021200004471'), //Mali + array('MR13000120000100000020373721'), //Mauritania + array('MU17BOMM0101101030300200000MUR1'), //Mauritius + array('MZ590001000000118341941571'), //Mozambique + array('PS92PALS0000000004001234567021'), //Palestinian Territory + array('QA58DOHB00001234567890ABCDEFG1'), //Qatar + array('XK0512120123456789061'), //Republic of Kosovo + array('PT500002000001630993103551'), //Sao Tome and Principe + array('SA03800000006080101675191'), //Saudi Arabia + array('SN12K001001520000256900075421'), //Senegal + array('TL3800800123456789101571'), //Timor-Leste + array('TN59142072071007071296481'), //Tunisia + array('TR3300061005197864578413261'), //Turkey + array('UA21AAAA1300000260072335660012'), //Ukraine + array('AE2602110000002300640161'), //United Arab Emirates + ); + } + + /** + * @dataProvider getIbansWithValidFormatButIncorrectChecksum + */ + public function testIbansWithValidFormatButIncorrectChecksum($iban) + { + $this->assertViolationRaised($iban, Iban::CHECKSUM_FAILED_ERROR); + } + + public function getIbansWithValidFormatButIncorrectChecksum() + { + return array( + array('AL47 2121 1009 0000 0002 3569 8742'), //Albania + array('AD12 0001 2030 2003 5910 0101'), //Andorra + array('AT61 1904 3002 3457 3202'), //Austria + array('AZ21 NABZ 0000 0000 1370 1000 1945'), //Azerbaijan + array('BH67 BMAG 0000 1299 1234 57'), //Bahrain + array('BE62 5100 0754 7062'), //Belgium + array('BA39 1290 0794 0102 8495'), //Bosnia and Herzegovina + array('BG80 BNBG 9661 1020 3456 79'), //Bulgaria + array('BY90 NBRB 3600 900000002Z00AB00'), //Belarus + array('HR12 1001 0051 8630 0016 1'), //Croatia + array('CY17 0020 0128 0000 0012 0052 7601'), //Cyprus + array('CZ65 0800 0000 1920 0014 5398'), //Czech Republic + array('DK50 0040 0440 1162 44'), //Denmark + array('EE38 2200 2210 2014 5684'), //Estonia + array('FO97 5432 0388 8999 43'), //Faroe Islands + array('FI21 1234 5600 0007 84'), //Finland + array('FR14 2004 1010 0505 0001 3M02 605'), //France + array('GE29 NB00 0000 0101 9049 16'), //Georgia + array('DE89 3704 0044 0532 0130 01'), //Germany + array('GI75 NWBK 0000 0000 7099 452'), //Gibraltar + array('GR16 0110 1250 0000 0001 2300 694'), //Greece + array('GL56 0444 9876 5432 11'), //Greenland + array('HU42 1177 3016 1111 1018 0000 0001'), //Hungary + array('IS14 0159 2600 7654 5510 7303 38'), //Iceland + array('IE29 AIBK 9311 5212 3456 79'), //Ireland + array('IL62 0108 0000 0009 9999 998'), //Israel + array('IT40 S054 2811 1010 0000 0123 457'), //Italy + array('LV80 BANK 0000 4351 9500 2'), //Latvia + array('LB62 0999 0000 0001 0019 0122 9115'), //Lebanon + array('LI21 0881 0000 2324 013A B'), //Liechtenstein + array('LT12 1000 0111 0100 1001'), //Lithuania + array('LU28 0019 4006 4475 0001'), //Luxembourg + array('MK072 5012 0000 0589 85'), //Macedonia + array('MT84 MALT 0110 0001 2345 MTLC AST0 01T'), //Malta + array('MU17 BOMM 0101 1010 3030 0200 000M UP'), //Mauritius + array('MD24 AG00 0225 1000 1310 4169'), //Moldova + array('MC93 2005 2222 1001 1223 3M44 554'), //Monaco + array('ME25 5050 0001 2345 6789 52'), //Montenegro + array('NL39 RABO 0300 0652 65'), //Netherlands + array('NO93 8601 1117 948'), //Norway + array('PK36 SCBL 0000 0011 2345 6703'), //Pakistan + array('PL60 1020 1026 0000 0422 7020 1112'), //Poland + array('PT50 0002 0123 1234 5678 9015 5'), //Portugal + array('RO49 AAAA 1B31 0075 9384 0001'), //Romania + array('SM86 U032 2509 8000 0000 0270 101'), //San Marino + array('SA03 8000 0000 6080 1016 7518'), //Saudi Arabia + array('RS35 2600 0560 1001 6113 78'), //Serbia + array('SK31 1200 0000 1987 4263 7542'), //Slovak Republic + array('SI56 1910 0000 0123 439'), //Slovenia + array('ES80 2310 0001 1800 0001 2346'), //Spain + array('SE35 5000 0000 0549 1000 0004'), //Sweden + array('CH93 0076 2011 6238 5295 8'), //Switzerland + array('TN59 1000 6035 1835 9847 8832'), //Tunisia + array('TR33 0006 1005 1978 6457 8413 27'), //Turkey + array('AE07 0331 2345 6789 0123 457'), //UAE + array('GB12 CPBK 0892 9965 0449 92'), //United Kingdom + + //Extended country list + array('AO06000600000100037131175'), //Angola + array('AZ21NABZ00000000137010001945'), //Azerbaijan + array('BH29BMAG1299123456BH01'), //Bahrain + array('BJ11B00610100400271101192592'), //Benin + array('BR9700360305000010009795493P2'), // Brazil + array('BR1800000000141455123924100C3'), // Brazil + array('VG96VPVG0000012345678902'), //British Virgin Islands + array('BF1030134020015400945000644'), //Burkina Faso + array('BI43201011067445'), //Burundi + array('CM2110003001000500000605307'), //Cameroon + array('CV64000300004547069110177'), //Cape Verde + array('FR7630007000110009970004943'), //Central African Republic + array('CG5230011000202151234567891'), //Congo + array('CR96042332432534543564'), //Costa Rica + array('DO28BAGR00000001212453611325'), //Dominican Republic + array('GT82TRAJ01020000001210029691'), //Guatemala + array('IR580540105180021273113008'), //Iran + array('IL620108000000099999998'), //Israel + array('CI05A00060174100178530011853'), //Ivory Coast + array('JO94CBJO0010000000000131000303'), // Jordan + array('KZ176010251000042994'), //Kazakhstan + array('KW74NBOK0000000000001000372152'), //Kuwait + array('LB30099900000001001925579116'), //Lebanon + array('MG4600005030010101914016057'), //Madagascar + array('ML03D00890170001002120000448'), //Mali + array('MR1300012000010000002037373'), //Mauritania + array('MU17BOMM0101101030300200000MUP'), //Mauritius + array('MZ59000100000011834194158'), //Mozambique + array('PS92PALS000000000400123456703'), //Palestinian Territory + array('QA58DOHB00001234567890ABCDEFH'), //Qatar + array('XK051212012345678907'), //Republic of Kosovo + array('PT50000200000163099310356'), //Sao Tome and Principe + array('SA0380000000608010167518'), //Saudi Arabia + array('SN12K00100152000025690007543'), //Senegal + array('TL380080012345678910158'), //Timor-Leste + array('TN5914207207100707129649'), //Tunisia + array('TR330006100519786457841327'), //Turkey + array('UA213223130000026007233566002'), //Ukraine + array('AE260211000000230064017'), //United Arab Emirates + ); + } + + /** + * @dataProvider getUnsupportedCountryCodes + */ + public function testIbansWithUnsupportedCountryCode($countryCode) + { + $this->assertViolationRaised($countryCode.'260211000000230064016', Iban::NOT_SUPPORTED_COUNTRY_CODE_ERROR); + } + + public function getUnsupportedCountryCodes() + { + return array( + array('AG'), + array('AI'), + array('AQ'), + array('AS'), + array('AW'), + ); + } + + public function testIbansWithInvalidCharacters() + { + $this->assertViolationRaised('CH930076201162385295]', Iban::INVALID_CHARACTERS_ERROR); + } + + /** + * @dataProvider getIbansWithInvalidCountryCode + */ + public function testIbansWithInvalidCountryCode($iban) + { + $this->assertViolationRaised($iban, Iban::INVALID_COUNTRY_CODE_ERROR); + } + + public function getIbansWithInvalidCountryCode() + { + return array( + array('0750447346'), + array('2X0750447346'), + array('A20750447346'), + ); + } + + private function assertViolationRaised($iban, $code) + { + $constraint = new Iban(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($iban, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$iban.'"') + ->setCode($code) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IdenticalToValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IdenticalToValidatorTest.php new file mode 100644 index 00000000000..4999919a31a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IdenticalToValidatorTest.php @@ -0,0 +1,94 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\IdenticalTo; +use Symfony\Component\Validator\Constraints\IdenticalToValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class IdenticalToValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IdenticalToValidator(); + } + + protected function createConstraint(array $options = null) + { + return new IdenticalTo($options); + } + + protected function getErrorCode() + { + return IdenticalTo::NOT_IDENTICAL_ERROR; + } + + public function provideAllValidComparisons() + { + $this->setDefaultTimezone('UTC'); + + // Don't call addPhp5Dot5Comparisons() automatically, as it does + // not take care of identical objects + $comparisons = $this->provideValidComparisons(); + + $this->restoreDefaultTimezone(); + + return $comparisons; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + $date = new \DateTime('2000-01-01'); + $object = new ComparisonTest_Class(2); + + $comparisons = array( + array(3, 3), + array('a', 'a'), + array($date, $date), + array($object, $object), + array(null, 1), + ); + + if (\PHP_VERSION_ID >= 50500) { + $immutableDate = new \DateTimeImmutable('2000-01-01'); + $comparisons[] = array($immutableDate, $immutableDate); + } + + return $comparisons; + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + return array( + array(1, '1', 2, '2', 'integer'), + array(2, '2', '2', '"2"', 'string'), + array('22', '"22"', '333', '"333"', 'string'), + array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', 'DateTime'), + array(new \DateTime('2001-01-01'), 'Jan 1, 2001, 12:00 AM', new \DateTime('1999-01-01'), 'Jan 1, 1999, 12:00 AM', 'DateTime'), + array(new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ImageValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ImageValidatorTest.php new file mode 100644 index 00000000000..4605a06577a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ImageValidatorTest.php @@ -0,0 +1,332 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Image; +use Symfony\Component\Validator\Constraints\ImageValidator; +use Symfony\Component\Validator\Validation; + +/** + * @requires extension fileinfo + */ +class ImageValidatorTest extends AbstractConstraintValidatorTest +{ + protected $context; + + /** + * @var ImageValidator + */ + protected $validator; + + protected $path; + protected $image; + protected $imageLandscape; + protected $imagePortrait; + protected $image4By3; + + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new ImageValidator(); + } + + protected function setUp() + { + parent::setUp(); + + $this->image = __DIR__.'/Fixtures/test.gif'; + $this->imageLandscape = __DIR__.'/Fixtures/test_landscape.gif'; + $this->imagePortrait = __DIR__.'/Fixtures/test_portrait.gif'; + $this->image4By3 = __DIR__.'/Fixtures/test_4by3.gif'; + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Image()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Image()); + + $this->assertNoViolation(); + } + + public function testValidImage() + { + $this->validator->validate($this->image, new Image()); + + $this->assertNoViolation(); + } + + public function testFileNotFound() + { + // Check that the logic from FileValidator still works + $constraint = new Image(array( + 'notFoundMessage' => 'myMessage', + )); + + $this->validator->validate('foobar', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ file }}', '"foobar"') + ->setCode(Image::NOT_FOUND_ERROR) + ->assertRaised(); + } + + public function testValidSize() + { + $constraint = new Image(array( + 'minWidth' => 1, + 'maxWidth' => 2, + 'minHeight' => 1, + 'maxHeight' => 2, + )); + + $this->validator->validate($this->image, $constraint); + + $this->assertNoViolation(); + } + + public function testWidthTooSmall() + { + $constraint = new Image(array( + 'minWidth' => 3, + 'minWidthMessage' => 'myMessage', + )); + + $this->validator->validate($this->image, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', '2') + ->setParameter('{{ min_width }}', '3') + ->setCode(Image::TOO_NARROW_ERROR) + ->assertRaised(); + } + + public function testWidthTooBig() + { + $constraint = new Image(array( + 'maxWidth' => 1, + 'maxWidthMessage' => 'myMessage', + )); + + $this->validator->validate($this->image, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', '2') + ->setParameter('{{ max_width }}', '1') + ->setCode(Image::TOO_WIDE_ERROR) + ->assertRaised(); + } + + public function testHeightTooSmall() + { + $constraint = new Image(array( + 'minHeight' => 3, + 'minHeightMessage' => 'myMessage', + )); + + $this->validator->validate($this->image, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ height }}', '2') + ->setParameter('{{ min_height }}', '3') + ->setCode(Image::TOO_LOW_ERROR) + ->assertRaised(); + } + + public function testHeightTooBig() + { + $constraint = new Image(array( + 'maxHeight' => 1, + 'maxHeightMessage' => 'myMessage', + )); + + $this->validator->validate($this->image, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ height }}', '2') + ->setParameter('{{ max_height }}', '1') + ->setCode(Image::TOO_HIGH_ERROR) + ->assertRaised(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMinWidth() + { + $constraint = new Image(array( + 'minWidth' => '1abc', + )); + + $this->validator->validate($this->image, $constraint); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMaxWidth() + { + $constraint = new Image(array( + 'maxWidth' => '1abc', + )); + + $this->validator->validate($this->image, $constraint); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMinHeight() + { + $constraint = new Image(array( + 'minHeight' => '1abc', + )); + + $this->validator->validate($this->image, $constraint); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMaxHeight() + { + $constraint = new Image(array( + 'maxHeight' => '1abc', + )); + + $this->validator->validate($this->image, $constraint); + } + + public function testRatioTooSmall() + { + $constraint = new Image(array( + 'minRatio' => 2, + 'minRatioMessage' => 'myMessage', + )); + + $this->validator->validate($this->image, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ ratio }}', 1) + ->setParameter('{{ min_ratio }}', 2) + ->setCode(Image::RATIO_TOO_SMALL_ERROR) + ->assertRaised(); + } + + public function testRatioTooBig() + { + $constraint = new Image(array( + 'maxRatio' => 0.5, + 'maxRatioMessage' => 'myMessage', + )); + + $this->validator->validate($this->image, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ ratio }}', 1) + ->setParameter('{{ max_ratio }}', 0.5) + ->setCode(Image::RATIO_TOO_BIG_ERROR) + ->assertRaised(); + } + + public function testMaxRatioUsesTwoDecimalsOnly() + { + $constraint = new Image(array( + 'maxRatio' => 1.33, + )); + + $this->validator->validate($this->image4By3, $constraint); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMinRatio() + { + $constraint = new Image(array( + 'minRatio' => '1abc', + )); + + $this->validator->validate($this->image, $constraint); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidMaxRatio() + { + $constraint = new Image(array( + 'maxRatio' => '1abc', + )); + + $this->validator->validate($this->image, $constraint); + } + + public function testSquareNotAllowed() + { + $constraint = new Image(array( + 'allowSquare' => false, + 'allowSquareMessage' => 'myMessage', + )); + + $this->validator->validate($this->image, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', 2) + ->setParameter('{{ height }}', 2) + ->setCode(Image::SQUARE_NOT_ALLOWED_ERROR) + ->assertRaised(); + } + + public function testLandscapeNotAllowed() + { + $constraint = new Image(array( + 'allowLandscape' => false, + 'allowLandscapeMessage' => 'myMessage', + )); + + $this->validator->validate($this->imageLandscape, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', 2) + ->setParameter('{{ height }}', 1) + ->setCode(Image::LANDSCAPE_NOT_ALLOWED_ERROR) + ->assertRaised(); + } + + public function testPortraitNotAllowed() + { + $constraint = new Image(array( + 'allowPortrait' => false, + 'allowPortraitMessage' => 'myMessage', + )); + + $this->validator->validate($this->imagePortrait, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ width }}', 1) + ->setParameter('{{ height }}', 2) + ->setCode(Image::PORTRAIT_NOT_ALLOWED_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IpValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IpValidatorTest.php new file mode 100644 index 00000000000..bcb5f59e434 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IpValidatorTest.php @@ -0,0 +1,456 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Ip; +use Symfony\Component\Validator\Constraints\IpValidator; +use Symfony\Component\Validator\Validation; + +class IpValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IpValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Ip()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Ip()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Ip()); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testInvalidValidatorVersion() + { + new Ip(array( + 'version' => 666, + )); + } + + /** + * @dataProvider getValidIpsV4 + */ + public function testValidIpsV4($ip) + { + $this->validator->validate($ip, new Ip(array( + 'version' => Ip::V4, + ))); + + $this->assertNoViolation(); + } + + public function getValidIpsV4() + { + return array( + array('0.0.0.0'), + array('10.0.0.0'), + array('123.45.67.178'), + array('172.16.0.0'), + array('192.168.1.0'), + array('224.0.0.1'), + array('255.255.255.255'), + array('127.0.0.0'), + ); + } + + /** + * @dataProvider getValidIpsV6 + */ + public function testValidIpsV6($ip) + { + $this->validator->validate($ip, new Ip(array( + 'version' => Ip::V6, + ))); + + $this->assertNoViolation(); + } + + public function getValidIpsV6() + { + return array( + array('2001:0db8:85a3:0000:0000:8a2e:0370:7334'), + array('2001:0DB8:85A3:0000:0000:8A2E:0370:7334'), + array('2001:0Db8:85a3:0000:0000:8A2e:0370:7334'), + array('fdfe:dcba:9876:ffff:fdc6:c46b:bb8f:7d4c'), + array('fdc6:c46b:bb8f:7d4c:fdc6:c46b:bb8f:7d4c'), + array('fdc6:c46b:bb8f:7d4c:0000:8a2e:0370:7334'), + array('fe80:0000:0000:0000:0202:b3ff:fe1e:8329'), + array('fe80:0:0:0:202:b3ff:fe1e:8329'), + array('fe80::202:b3ff:fe1e:8329'), + array('0:0:0:0:0:0:0:0'), + array('::'), + array('0::'), + array('::0'), + array('0::0'), + // IPv4 mapped to IPv6 + array('2001:0db8:85a3:0000:0000:8a2e:0.0.0.0'), + array('::0.0.0.0'), + array('::255.255.255.255'), + array('::123.45.67.178'), + ); + } + + /** + * @dataProvider getValidIpsAll + */ + public function testValidIpsAll($ip) + { + $this->validator->validate($ip, new Ip(array( + 'version' => Ip::ALL, + ))); + + $this->assertNoViolation(); + } + + public function getValidIpsAll() + { + return array_merge($this->getValidIpsV4(), $this->getValidIpsV6()); + } + + /** + * @dataProvider getInvalidIpsV4 + */ + public function testInvalidIpsV4($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V4, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidIpsV4() + { + return array( + array('0'), + array('0.0'), + array('0.0.0'), + array('256.0.0.0'), + array('0.256.0.0'), + array('0.0.256.0'), + array('0.0.0.256'), + array('-1.0.0.0'), + array('foobar'), + ); + } + + /** + * @dataProvider getInvalidPrivateIpsV4 + */ + public function testInvalidPrivateIpsV4($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V4_NO_PRIV, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidPrivateIpsV4() + { + return array( + array('10.0.0.0'), + array('172.16.0.0'), + array('192.168.1.0'), + ); + } + + /** + * @dataProvider getInvalidReservedIpsV4 + */ + public function testInvalidReservedIpsV4($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V4_NO_RES, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidReservedIpsV4() + { + return array( + array('0.0.0.0'), + array('240.0.0.1'), + array('255.255.255.255'), + ); + } + + /** + * @dataProvider getInvalidPublicIpsV4 + */ + public function testInvalidPublicIpsV4($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V4_ONLY_PUBLIC, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidPublicIpsV4() + { + return array_merge($this->getInvalidPrivateIpsV4(), $this->getInvalidReservedIpsV4()); + } + + /** + * @dataProvider getInvalidIpsV6 + */ + public function testInvalidIpsV6($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V6, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidIpsV6() + { + return array( + array('z001:0db8:85a3:0000:0000:8a2e:0370:7334'), + array('fe80'), + array('fe80:8329'), + array('fe80:::202:b3ff:fe1e:8329'), + array('fe80::202:b3ff::fe1e:8329'), + // IPv4 mapped to IPv6 + array('2001:0db8:85a3:0000:0000:8a2e:0370:0.0.0.0'), + array('::0.0'), + array('::0.0.0'), + array('::256.0.0.0'), + array('::0.256.0.0'), + array('::0.0.256.0'), + array('::0.0.0.256'), + ); + } + + /** + * @dataProvider getInvalidPrivateIpsV6 + */ + public function testInvalidPrivateIpsV6($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V6_NO_PRIV, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidPrivateIpsV6() + { + return array( + array('fdfe:dcba:9876:ffff:fdc6:c46b:bb8f:7d4c'), + array('fdc6:c46b:bb8f:7d4c:fdc6:c46b:bb8f:7d4c'), + array('fdc6:c46b:bb8f:7d4c:0000:8a2e:0370:7334'), + ); + } + + /** + * @dataProvider getInvalidReservedIpsV6 + */ + public function testInvalidReservedIpsV6($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V6_NO_RES, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidReservedIpsV6() + { + // Quoting after official filter documentation: + // "FILTER_FLAG_NO_RES_RANGE = This flag does not apply to IPv6 addresses." + // Full description: http://php.net/manual/en/filter.filters.flags.php + return $this->getInvalidIpsV6(); + } + + /** + * @dataProvider getInvalidPublicIpsV6 + */ + public function testInvalidPublicIpsV6($ip) + { + $constraint = new Ip(array( + 'version' => Ip::V6_ONLY_PUBLIC, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidPublicIpsV6() + { + return array_merge($this->getInvalidPrivateIpsV6(), $this->getInvalidReservedIpsV6()); + } + + /** + * @dataProvider getInvalidIpsAll + */ + public function testInvalidIpsAll($ip) + { + $constraint = new Ip(array( + 'version' => Ip::ALL, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidIpsAll() + { + return array_merge($this->getInvalidIpsV4(), $this->getInvalidIpsV6()); + } + + /** + * @dataProvider getInvalidPrivateIpsAll + */ + public function testInvalidPrivateIpsAll($ip) + { + $constraint = new Ip(array( + 'version' => Ip::ALL_NO_PRIV, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidPrivateIpsAll() + { + return array_merge($this->getInvalidPrivateIpsV4(), $this->getInvalidPrivateIpsV6()); + } + + /** + * @dataProvider getInvalidReservedIpsAll + */ + public function testInvalidReservedIpsAll($ip) + { + $constraint = new Ip(array( + 'version' => Ip::ALL_NO_RES, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidReservedIpsAll() + { + return array_merge($this->getInvalidReservedIpsV4(), $this->getInvalidReservedIpsV6()); + } + + /** + * @dataProvider getInvalidPublicIpsAll + */ + public function testInvalidPublicIpsAll($ip) + { + $constraint = new Ip(array( + 'version' => Ip::ALL_ONLY_PUBLIC, + 'message' => 'myMessage', + )); + + $this->validator->validate($ip, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$ip.'"') + ->setCode(Ip::INVALID_IP_ERROR) + ->assertRaised(); + } + + public function getInvalidPublicIpsAll() + { + return array_merge($this->getInvalidPublicIpsV4(), $this->getInvalidPublicIpsV6()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsFalseValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsFalseValidatorTest.php new file mode 100644 index 00000000000..46cadecaf65 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsFalseValidatorTest.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\IsFalse; +use Symfony\Component\Validator\Constraints\IsFalseValidator; +use Symfony\Component\Validator\Validation; + +class IsFalseValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IsFalseValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new IsFalse()); + + $this->assertNoViolation(); + } + + public function testFalseIsValid() + { + $this->validator->validate(false, new IsFalse()); + + $this->assertNoViolation(); + } + + public function testTrueIsInvalid() + { + $constraint = new IsFalse(array( + 'message' => 'myMessage', + )); + + $this->validator->validate(true, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'true') + ->setCode(IsFalse::NOT_FALSE_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsNullValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsNullValidatorTest.php new file mode 100644 index 00000000000..5a5575313b7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsNullValidatorTest.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\IsNull; +use Symfony\Component\Validator\Constraints\IsNullValidator; +use Symfony\Component\Validator\Validation; + +class IsNullValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IsNullValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new IsNull()); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getInvalidValues + */ + public function testInvalidValues($value, $valueAsString) + { + $constraint = new IsNull(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', $valueAsString) + ->setCode(IsNull::NOT_NULL_ERROR) + ->assertRaised(); + } + + public function getInvalidValues() + { + return array( + array(0, '0'), + array(false, 'false'), + array(true, 'true'), + array('', '""'), + array('foo bar', '"foo bar"'), + array(new \DateTime(), 'object'), + array(new \stdClass(), 'object'), + array(array(), 'array'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsTrueValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsTrueValidatorTest.php new file mode 100644 index 00000000000..1c5927da4bf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsTrueValidatorTest.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\IsTrue; +use Symfony\Component\Validator\Constraints\IsTrueValidator; +use Symfony\Component\Validator\Validation; + +class IsTrueValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IsTrueValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new IsTrue()); + + $this->assertNoViolation(); + } + + public function testTrueIsValid() + { + $this->validator->validate(true, new IsTrue()); + + $this->assertNoViolation(); + } + + public function testFalseIsInvalid() + { + $constraint = new IsTrue(array( + 'message' => 'myMessage', + )); + + $this->validator->validate(false, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'false') + ->setCode(IsTrue::NOT_TRUE_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsbnValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsbnValidatorTest.php new file mode 100644 index 00000000000..314739f4d0b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IsbnValidatorTest.php @@ -0,0 +1,271 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Isbn; +use Symfony\Component\Validator\Constraints\IsbnValidator; +use Symfony\Component\Validator\Validation; + +/** + * @see https://en.wikipedia.org/wiki/Isbn + */ +class IsbnValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IsbnValidator(); + } + + public function getValidIsbn10() + { + return array( + array('2723442284'), + array('2723442276'), + array('2723455041'), + array('2070546810'), + array('2711858839'), + array('2756406767'), + array('2870971648'), + array('226623854X'), + array('2851806424'), + array('0321812700'), + array('0-45122-5244'), + array('0-4712-92311'), + array('0-9752298-0-X'), + ); + } + + public function getInvalidIsbn10() + { + return array( + array('27234422841', Isbn::TOO_LONG_ERROR), + array('272344228', Isbn::TOO_SHORT_ERROR), + array('0-4712-9231', Isbn::TOO_SHORT_ERROR), + array('1234567890', Isbn::CHECKSUM_FAILED_ERROR), + array('0987656789', Isbn::CHECKSUM_FAILED_ERROR), + array('7-35622-5444', Isbn::CHECKSUM_FAILED_ERROR), + array('0-4X19-92611', Isbn::CHECKSUM_FAILED_ERROR), + array('0_45122_5244', Isbn::INVALID_CHARACTERS_ERROR), + array('2870#971#648', Isbn::INVALID_CHARACTERS_ERROR), + array('0-9752298-0-x', Isbn::INVALID_CHARACTERS_ERROR), + array('1A34567890', Isbn::INVALID_CHARACTERS_ERROR), + // chr(1) evaluates to 0 + // 2070546810 is valid + array('2'.\chr(1).'70546810', Isbn::INVALID_CHARACTERS_ERROR), + ); + } + + public function getValidIsbn13() + { + return array( + array('978-2723442282'), + array('978-2723442275'), + array('978-2723455046'), + array('978-2070546817'), + array('978-2711858835'), + array('978-2756406763'), + array('978-2870971642'), + array('978-2266238540'), + array('978-2851806420'), + array('978-0321812704'), + array('978-0451225245'), + array('978-0471292319'), + ); + } + + public function getInvalidIsbn13() + { + return array( + array('978-27234422821', Isbn::TOO_LONG_ERROR), + array('978-272344228', Isbn::TOO_SHORT_ERROR), + array('978-2723442-82', Isbn::TOO_SHORT_ERROR), + array('978-2723442281', Isbn::CHECKSUM_FAILED_ERROR), + array('978-0321513774', Isbn::CHECKSUM_FAILED_ERROR), + array('979-0431225385', Isbn::CHECKSUM_FAILED_ERROR), + array('980-0474292319', Isbn::CHECKSUM_FAILED_ERROR), + array('0-4X19-92619812', Isbn::INVALID_CHARACTERS_ERROR), + array('978_2723442282', Isbn::INVALID_CHARACTERS_ERROR), + array('978#2723442282', Isbn::INVALID_CHARACTERS_ERROR), + array('978-272C442282', Isbn::INVALID_CHARACTERS_ERROR), + // chr(1) evaluates to 0 + // 978-2070546817 is valid + array('978-2'.\chr(1).'70546817', Isbn::INVALID_CHARACTERS_ERROR), + ); + } + + public function getValidIsbn() + { + return array_merge( + $this->getValidIsbn10(), + $this->getValidIsbn13() + ); + } + + public function getInvalidIsbn() + { + return array_merge( + $this->getInvalidIsbn10(), + $this->getInvalidIsbn13() + ); + } + + public function testNullIsValid() + { + $constraint = new Isbn(true); + + $this->validator->validate(null, $constraint); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $constraint = new Isbn(true); + + $this->validator->validate('', $constraint); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $constraint = new Isbn(true); + + $this->validator->validate(new \stdClass(), $constraint); + } + + /** + * @dataProvider getValidIsbn10 + */ + public function testValidIsbn10($isbn) + { + $constraint = new Isbn(array( + 'type' => 'isbn10', + )); + + $this->validator->validate($isbn, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getInvalidIsbn10 + */ + public function testInvalidIsbn10($isbn, $code) + { + $constraint = new Isbn(array( + 'type' => 'isbn10', + 'isbn10Message' => 'myMessage', + )); + + $this->validator->validate($isbn, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$isbn.'"') + ->setCode($code) + ->assertRaised(); + } + + /** + * @dataProvider getValidIsbn13 + */ + public function testValidIsbn13($isbn) + { + $constraint = new Isbn(array('type' => 'isbn13')); + + $this->validator->validate($isbn, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getInvalidIsbn13 + */ + public function testInvalidIsbn13($isbn, $code) + { + $constraint = new Isbn(array( + 'type' => 'isbn13', + 'isbn13Message' => 'myMessage', + )); + + $this->validator->validate($isbn, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$isbn.'"') + ->setCode($code) + ->assertRaised(); + } + + /** + * @dataProvider getValidIsbn + */ + public function testValidIsbnAny($isbn) + { + $constraint = new Isbn(); + + $this->validator->validate($isbn, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getInvalidIsbn10 + */ + public function testInvalidIsbnAnyIsbn10($isbn, $code) + { + $constraint = new Isbn(array( + 'bothIsbnMessage' => 'myMessage', + )); + + $this->validator->validate($isbn, $constraint); + + // Too long for an ISBN-10, but not long enough for an ISBN-13 + if (Isbn::TOO_LONG_ERROR === $code) { + $code = Isbn::TYPE_NOT_RECOGNIZED_ERROR; + } + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$isbn.'"') + ->setCode($code) + ->assertRaised(); + } + + /** + * @dataProvider getInvalidIsbn13 + */ + public function testInvalidIsbnAnyIsbn13($isbn, $code) + { + $constraint = new Isbn(array( + 'bothIsbnMessage' => 'myMessage', + )); + + $this->validator->validate($isbn, $constraint); + + // Too short for an ISBN-13, but not short enough for an ISBN-10 + if (Isbn::TOO_SHORT_ERROR === $code) { + $code = Isbn::TYPE_NOT_RECOGNIZED_ERROR; + } + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$isbn.'"') + ->setCode($code) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IssnValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IssnValidatorTest.php new file mode 100644 index 00000000000..a6d39944b0a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/IssnValidatorTest.php @@ -0,0 +1,187 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Issn; +use Symfony\Component\Validator\Constraints\IssnValidator; +use Symfony\Component\Validator\Validation; + +/** + * @see https://en.wikipedia.org/wiki/Issn + */ +class IssnValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new IssnValidator(); + } + + public function getValidLowerCasedIssn() + { + return array( + array('2162-321x'), + array('2160-200x'), + array('1537-453x'), + array('1937-710x'), + array('0002-922x'), + array('1553-345x'), + array('1553-619x'), + ); + } + + public function getValidNonHyphenatedIssn() + { + return array( + array('2162321X'), + array('01896016'), + array('15744647'), + array('14350645'), + array('07174055'), + array('20905076'), + array('14401592'), + ); + } + + public function getFullValidIssn() + { + return array( + array('1550-7416'), + array('1539-8560'), + array('2156-5376'), + array('1119-023X'), + array('1684-5315'), + array('1996-0786'), + array('1684-5374'), + array('1996-0794'), + ); + } + + public function getValidIssn() + { + return array_merge( + $this->getValidLowerCasedIssn(), + $this->getValidNonHyphenatedIssn(), + $this->getFullValidIssn() + ); + } + + public function getInvalidIssn() + { + return array( + array(0, Issn::TOO_SHORT_ERROR), + array('1539', Issn::TOO_SHORT_ERROR), + array('2156-537A', Issn::INVALID_CHARACTERS_ERROR), + array('1119-0231', Issn::CHECKSUM_FAILED_ERROR), + array('1684-5312', Issn::CHECKSUM_FAILED_ERROR), + array('1996-0783', Issn::CHECKSUM_FAILED_ERROR), + array('1684-537X', Issn::CHECKSUM_FAILED_ERROR), + array('1996-0795', Issn::CHECKSUM_FAILED_ERROR), + ); + } + + public function testNullIsValid() + { + $constraint = new Issn(); + + $this->validator->validate(null, $constraint); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $constraint = new Issn(); + + $this->validator->validate('', $constraint); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $constraint = new Issn(); + $this->validator->validate(new \stdClass(), $constraint); + } + + /** + * @dataProvider getValidLowerCasedIssn + */ + public function testCaseSensitiveIssns($issn) + { + $constraint = new Issn(array( + 'caseSensitive' => true, + 'message' => 'myMessage', + )); + + $this->validator->validate($issn, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$issn.'"') + ->setCode(Issn::INVALID_CASE_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getValidNonHyphenatedIssn + */ + public function testRequireHyphenIssns($issn) + { + $constraint = new Issn(array( + 'requireHyphen' => true, + 'message' => 'myMessage', + )); + + $this->validator->validate($issn, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$issn.'"') + ->setCode(Issn::MISSING_HYPHEN_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getValidIssn + */ + public function testValidIssn($issn) + { + $constraint = new Issn(); + + $this->validator->validate($issn, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getInvalidIssn + */ + public function testInvalidIssn($issn, $code) + { + $constraint = new Issn(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($issn, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$issn.'"') + ->setCode($code) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LanguageValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LanguageValidatorTest.php new file mode 100644 index 00000000000..d9bd4d04872 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LanguageValidatorTest.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Intl\Util\IntlTestHelper; +use Symfony\Component\Validator\Constraints\Language; +use Symfony\Component\Validator\Constraints\LanguageValidator; +use Symfony\Component\Validator\Validation; + +class LanguageValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new LanguageValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Language()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Language()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Language()); + } + + /** + * @dataProvider getValidLanguages + */ + public function testValidLanguages($language) + { + $this->validator->validate($language, new Language()); + + $this->assertNoViolation(); + } + + public function getValidLanguages() + { + return array( + array('en'), + array('en_US'), + array('my'), + ); + } + + /** + * @dataProvider getInvalidLanguages + */ + public function testInvalidLanguages($language) + { + $constraint = new Language(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($language, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$language.'"') + ->setCode(Language::NO_SUCH_LANGUAGE_ERROR) + ->assertRaised(); + } + + public function getInvalidLanguages() + { + return array( + array('EN'), + array('foobar'), + ); + } + + public function testValidateUsingCountrySpecificLocale() + { + IntlTestHelper::requireFullIntl($this, false); + + \Locale::setDefault('fr_FR'); + $existingLanguage = 'en'; + + $this->validator->validate($existingLanguage, new Language(array( + 'message' => 'aMessage', + ))); + + $this->assertNoViolation(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LengthValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LengthValidatorTest.php new file mode 100644 index 00000000000..cd501819d92 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LengthValidatorTest.php @@ -0,0 +1,252 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Length; +use Symfony\Component\Validator\Constraints\LengthValidator; +use Symfony\Component\Validator\Validation; + +class LengthValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new LengthValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Length(6)); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Length(6)); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Length(5)); + } + + public function getThreeOrLessCharacters() + { + return array( + array(12), + array('12'), + array('üü'), + array('éé'), + array(123), + array('123'), + array('üüü'), + array('ééé'), + ); + } + + public function getFourCharacters() + { + return array( + array(1234), + array('1234'), + array('üüüü'), + array('éééé'), + ); + } + + public function getFiveOrMoreCharacters() + { + return array( + array(12345), + array('12345'), + array('üüüüü'), + array('ééééé'), + array(123456), + array('123456'), + array('üüüüüü'), + array('éééééé'), + ); + } + + public function getOneCharset() + { + return array( + array('é', 'utf8', true), + array("\xE9", 'CP1252', true), + array("\xE9", 'XXX', false), + array("\xE9", 'utf8', false), + ); + } + + /** + * @dataProvider getFiveOrMoreCharacters + */ + public function testValidValuesMin($value) + { + $constraint = new Length(array('min' => 5)); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getThreeOrLessCharacters + */ + public function testValidValuesMax($value) + { + $constraint = new Length(array('max' => 3)); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getFourCharacters + */ + public function testValidValuesExact($value) + { + $constraint = new Length(4); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getThreeOrLessCharacters + */ + public function testInvalidValuesMin($value) + { + $constraint = new Length(array( + 'min' => 4, + 'minMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$value.'"') + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Length::TOO_SHORT_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getFiveOrMoreCharacters + */ + public function testInvalidValuesMax($value) + { + $constraint = new Length(array( + 'max' => 4, + 'maxMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$value.'"') + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Length::TOO_LONG_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getThreeOrLessCharacters + */ + public function testInvalidValuesExactLessThanFour($value) + { + $constraint = new Length(array( + 'min' => 4, + 'max' => 4, + 'exactMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$value.'"') + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Length::TOO_SHORT_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getFiveOrMoreCharacters + */ + public function testInvalidValuesExactMoreThanFour($value) + { + $constraint = new Length(array( + 'min' => 4, + 'max' => 4, + 'exactMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$value.'"') + ->setParameter('{{ limit }}', 4) + ->setInvalidValue($value) + ->setPlural(4) + ->setCode(Length::TOO_LONG_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getOneCharset + */ + public function testOneCharset($value, $charset, $isValid) + { + $constraint = new Length(array( + 'min' => 1, + 'max' => 1, + 'charset' => $charset, + 'charsetMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + if ($isValid) { + $this->assertNoViolation(); + } else { + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$value.'"') + ->setParameter('{{ charset }}', $charset) + ->setInvalidValue($value) + ->setCode(Length::INVALID_CHARACTERS_ERROR) + ->assertRaised(); + } + } + + public function testConstraintGetDefaultOption() + { + $constraint = new Length(5); + + $this->assertEquals(5, $constraint->min); + $this->assertEquals(5, $constraint->max); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanOrEqualValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanOrEqualValidatorTest.php new file mode 100644 index 00000000000..84f150bf133 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanOrEqualValidatorTest.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\LessThanOrEqual; +use Symfony\Component\Validator\Constraints\LessThanOrEqualValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class LessThanOrEqualValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new LessThanOrEqualValidator(); + } + + protected function createConstraint(array $options = null) + { + return new LessThanOrEqual($options); + } + + protected function getErrorCode() + { + return LessThanOrEqual::TOO_HIGH_ERROR; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + return array( + array(1, 2), + array(1, 1), + array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')), + array(new \DateTime('2000-01-01'), new \DateTime('2020-01-01')), + array(new \DateTime('2000-01-01'), '2000-01-01'), + array(new \DateTime('2000-01-01'), '2020-01-01'), + array(new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'), + array(new \DateTime('2000-01-01 UTC'), '2020-01-01 UTC'), + array(new ComparisonTest_Class(4), new ComparisonTest_Class(5)), + array(new ComparisonTest_Class(5), new ComparisonTest_Class(5)), + array('a', 'a'), + array('a', 'z'), + array(null, 1), + ); + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + return array( + array(2, '2', 1, '1', 'integer'), + array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2010-01-01 UTC'), 'Jan 1, 2010, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(4), '4', __NAMESPACE__.'\ComparisonTest_Class'), + array('c', '"c"', 'b', '"b"', 'string'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanValidatorTest.php new file mode 100644 index 00000000000..da2885fba3a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LessThanValidatorTest.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\LessThan; +use Symfony\Component\Validator\Constraints\LessThanValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class LessThanValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new LessThanValidator(); + } + + protected function createConstraint(array $options = null) + { + return new LessThan($options); + } + + protected function getErrorCode() + { + return LessThan::TOO_HIGH_ERROR; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + return array( + array(1, 2), + array(new \DateTime('2000-01-01'), new \DateTime('2010-01-01')), + array(new \DateTime('2000-01-01'), '2010-01-01'), + array(new \DateTime('2000-01-01 UTC'), '2010-01-01 UTC'), + array(new ComparisonTest_Class(4), new ComparisonTest_Class(5)), + array('22', '333'), + array(null, 1), + ); + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + return array( + array(3, '3', 2, '2', 'integer'), + array(2, '2', 2, '2', 'integer'), + array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2010-01-01 UTC'), 'Jan 1, 2010, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2000-01-01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), + array(new ComparisonTest_Class(6), '6', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), + array('333', '"333"', '22', '"22"', 'string'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LocaleValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LocaleValidatorTest.php new file mode 100644 index 00000000000..c028596b04c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LocaleValidatorTest.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Locale; +use Symfony\Component\Validator\Constraints\LocaleValidator; +use Symfony\Component\Validator\Validation; + +class LocaleValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new LocaleValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Locale()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Locale()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Locale()); + } + + /** + * @dataProvider getValidLocales + */ + public function testValidLocales($locale) + { + $this->validator->validate($locale, new Locale()); + + $this->assertNoViolation(); + } + + public function getValidLocales() + { + return array( + array('en'), + array('en_US'), + array('pt'), + array('pt_PT'), + array('zh_Hans'), + array('fil_PH'), + ); + } + + /** + * @dataProvider getInvalidLocales + */ + public function testInvalidLocales($locale) + { + $constraint = new Locale(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($locale, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$locale.'"') + ->setCode(Locale::NO_SUCH_LOCALE_ERROR) + ->assertRaised(); + } + + public function getInvalidLocales() + { + return array( + array('EN'), + array('foobar'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LuhnValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LuhnValidatorTest.php new file mode 100644 index 00000000000..b0e88c3456b --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/LuhnValidatorTest.php @@ -0,0 +1,127 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Luhn; +use Symfony\Component\Validator\Constraints\LuhnValidator; +use Symfony\Component\Validator\Validation; + +class LuhnValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new LuhnValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Luhn()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Luhn()); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getValidNumbers + */ + public function testValidNumbers($number) + { + $this->validator->validate($number, new Luhn()); + + $this->assertNoViolation(); + } + + public function getValidNumbers() + { + return array( + array('42424242424242424242'), + array('378282246310005'), + array('371449635398431'), + array('378734493671000'), + array('5610591081018250'), + array('30569309025904'), + array('38520000023237'), + array('6011111111111117'), + array('6011000990139424'), + array('3530111333300000'), + array('3566002020360505'), + array('5555555555554444'), + array('5105105105105100'), + array('4111111111111111'), + array('4012888888881881'), + array('4222222222222'), + array('5019717010103742'), + array('6331101999990016'), + ); + } + + /** + * @dataProvider getInvalidNumbers + */ + public function testInvalidNumbers($number, $code) + { + $constraint = new Luhn(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($number, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$number.'"') + ->setCode($code) + ->assertRaised(); + } + + public function getInvalidNumbers() + { + return array( + array('1234567812345678', Luhn::CHECKSUM_FAILED_ERROR), + array('4222222222222222', Luhn::CHECKSUM_FAILED_ERROR), + array('0000000000000000', Luhn::CHECKSUM_FAILED_ERROR), + array('000000!000000000', Luhn::INVALID_CHARACTERS_ERROR), + array('42-22222222222222', Luhn::INVALID_CHARACTERS_ERROR), + ); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + * @dataProvider getInvalidTypes + */ + public function testInvalidTypes($number) + { + $constraint = new Luhn(); + + $this->validator->validate($number, $constraint); + } + + public function getInvalidTypes() + { + return array( + array(0), + array(123), + array(42424242424242424242), + array(378282246310005), + array(371449635398431), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotBlankValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotBlankValidatorTest.php new file mode 100644 index 00000000000..c7c081a63be --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotBlankValidatorTest.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\NotBlank; +use Symfony\Component\Validator\Constraints\NotBlankValidator; +use Symfony\Component\Validator\Validation; + +class NotBlankValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new NotBlankValidator(); + } + + /** + * @dataProvider getValidValues + */ + public function testValidValues($value) + { + $this->validator->validate($value, new NotBlank()); + + $this->assertNoViolation(); + } + + public function getValidValues() + { + return array( + array('foobar'), + array(0), + array(0.0), + array('0'), + array(1234), + ); + } + + public function testNullIsInvalid() + { + $constraint = new NotBlank(array( + 'message' => 'myMessage', + )); + + $this->validator->validate(null, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'null') + ->setCode(NotBlank::IS_BLANK_ERROR) + ->assertRaised(); + } + + public function testBlankIsInvalid() + { + $constraint = new NotBlank(array( + 'message' => 'myMessage', + )); + + $this->validator->validate('', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '""') + ->setCode(NotBlank::IS_BLANK_ERROR) + ->assertRaised(); + } + + public function testFalseIsInvalid() + { + $constraint = new NotBlank(array( + 'message' => 'myMessage', + )); + + $this->validator->validate(false, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'false') + ->setCode(NotBlank::IS_BLANK_ERROR) + ->assertRaised(); + } + + public function testEmptyArrayIsInvalid() + { + $constraint = new NotBlank(array( + 'message' => 'myMessage', + )); + + $this->validator->validate(array(), $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'array') + ->setCode(NotBlank::IS_BLANK_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotEqualToValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotEqualToValidatorTest.php new file mode 100644 index 00000000000..a797762bd32 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotEqualToValidatorTest.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\NotEqualTo; +use Symfony\Component\Validator\Constraints\NotEqualToValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class NotEqualToValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new NotEqualToValidator(); + } + + protected function createConstraint(array $options = null) + { + return new NotEqualTo($options); + } + + protected function getErrorCode() + { + return NotEqualTo::IS_EQUAL_ERROR; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + return array( + array(1, 2), + array('22', '333'), + array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01')), + array(new \DateTime('2001-01-01'), '2000-01-01'), + array(new \DateTime('2001-01-01 UTC'), '2000-01-01 UTC'), + array(new ComparisonTest_Class(6), new ComparisonTest_Class(5)), + array(null, 1), + ); + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + return array( + array(3, '3', 3, '3', 'integer'), + array('2', '"2"', 2, '2', 'integer'), + array('a', '"a"', 'a', '"a"', 'string'), + array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', '2000-01-01', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new \DateTime('2000-01-01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000-01-01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotIdenticalToValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotIdenticalToValidatorTest.php new file mode 100644 index 00000000000..16f518f1791 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotIdenticalToValidatorTest.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\NotIdenticalTo; +use Symfony\Component\Validator\Constraints\NotIdenticalToValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Daniel Holmes + */ +class NotIdenticalToValidatorTest extends AbstractComparisonValidatorTestCase +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new NotIdenticalToValidator(); + } + + protected function createConstraint(array $options = null) + { + return new NotIdenticalTo($options); + } + + protected function getErrorCode() + { + return NotIdenticalTo::IS_IDENTICAL_ERROR; + } + + /** + * {@inheritdoc} + */ + public function provideValidComparisons() + { + return array( + array(1, 2), + array('2', 2), + array('22', '333'), + array(new \DateTime('2001-01-01'), new \DateTime('2000-01-01')), + array(new \DateTime('2000-01-01'), new \DateTime('2000-01-01')), + array(new \DateTime('2001-01-01'), '2000-01-01'), + array(new \DateTime('2000-01-01'), '2000-01-01'), + array(new \DateTime('2001-01-01'), '2000-01-01'), + array(new \DateTime('2000-01-01 UTC'), '2000-01-01 UTC'), + array(null, 1), + ); + } + + public function provideAllInvalidComparisons() + { + $this->setDefaultTimezone('UTC'); + + // Don't call addPhp5Dot5Comparisons() automatically, as it does + // not take care of identical objects + $comparisons = $this->provideInvalidComparisons(); + + $this->restoreDefaultTimezone(); + + return $comparisons; + } + + /** + * {@inheritdoc} + */ + public function provideInvalidComparisons() + { + $date = new \DateTime('2000-01-01'); + $object = new ComparisonTest_Class(2); + + $comparisons = array( + array(3, '3', 3, '3', 'integer'), + array('a', '"a"', 'a', '"a"', 'string'), + array($date, 'Jan 1, 2000, 12:00 AM', $date, 'Jan 1, 2000, 12:00 AM', 'DateTime'), + array($object, '2', $object, '2', __NAMESPACE__.'\ComparisonTest_Class'), + ); + + return $comparisons; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotNullValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotNullValidatorTest.php new file mode 100644 index 00000000000..a244f6382ba --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/NotNullValidatorTest.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\NotNullValidator; +use Symfony\Component\Validator\Validation; + +class NotNullValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new NotNullValidator(); + } + + /** + * @dataProvider getValidValues + */ + public function testValidValues($value) + { + $this->validator->validate($value, new NotNull()); + + $this->assertNoViolation(); + } + + public function getValidValues() + { + return array( + array(0), + array(false), + array(true), + array(''), + ); + } + + public function testNullIsInvalid() + { + $constraint = new NotNull(array( + 'message' => 'myMessage', + )); + + $this->validator->validate(null, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', 'null') + ->setCode(NotNull::IS_NULL_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RangeValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RangeValidatorTest.php new file mode 100644 index 00000000000..1093fa44602 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RangeValidatorTest.php @@ -0,0 +1,403 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Intl\Util\IntlTestHelper; +use Symfony\Component\Validator\Constraints\Range; +use Symfony\Component\Validator\Constraints\RangeValidator; +use Symfony\Component\Validator\Validation; + +class RangeValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new RangeValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Range(array('min' => 10, 'max' => 20))); + + $this->assertNoViolation(); + } + + public function getTenToTwenty() + { + return array( + array(10.00001), + array(19.99999), + array('10.00001'), + array('19.99999'), + array(10), + array(20), + array(10.0), + array(20.0), + ); + } + + public function getLessThanTen() + { + return array( + array(9.99999, '9.99999'), + array('9.99999', '"9.99999"'), + array(5, '5'), + array(1.0, '1.0'), + ); + } + + public function getMoreThanTwenty() + { + return array( + array(20.000001, '20.000001'), + array('20.000001', '"20.000001"'), + array(21, '21'), + array(30.0, '30.0'), + ); + } + + /** + * @dataProvider getTenToTwenty + */ + public function testValidValuesMin($value) + { + $constraint = new Range(array('min' => 10)); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getTenToTwenty + */ + public function testValidValuesMax($value) + { + $constraint = new Range(array('max' => 20)); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getTenToTwenty + */ + public function testValidValuesMinMax($value) + { + $constraint = new Range(array('min' => 10, 'max' => 20)); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getLessThanTen + */ + public function testInvalidValuesMin($value, $formattedValue) + { + $constraint = new Range(array( + 'min' => 10, + 'minMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', $formattedValue) + ->setParameter('{{ limit }}', 10) + ->setCode(Range::TOO_LOW_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getMoreThanTwenty + */ + public function testInvalidValuesMax($value, $formattedValue) + { + $constraint = new Range(array( + 'max' => 20, + 'maxMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', $formattedValue) + ->setParameter('{{ limit }}', 20) + ->setCode(Range::TOO_HIGH_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getMoreThanTwenty + */ + public function testInvalidValuesCombinedMax($value, $formattedValue) + { + $constraint = new Range(array( + 'min' => 10, + 'max' => 20, + 'minMessage' => 'myMinMessage', + 'maxMessage' => 'myMaxMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMaxMessage') + ->setParameter('{{ value }}', $formattedValue) + ->setParameter('{{ limit }}', 20) + ->setCode(Range::TOO_HIGH_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getLessThanTen + */ + public function testInvalidValuesCombinedMin($value, $formattedValue) + { + $constraint = new Range(array( + 'min' => 10, + 'max' => 20, + 'minMessage' => 'myMinMessage', + 'maxMessage' => 'myMaxMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMinMessage') + ->setParameter('{{ value }}', $formattedValue) + ->setParameter('{{ limit }}', 10) + ->setCode(Range::TOO_LOW_ERROR) + ->assertRaised(); + } + + public function getTenthToTwentiethMarch2014() + { + // The provider runs before setUp(), so we need to manually fix + // the default timezone + $this->setDefaultTimezone('UTC'); + + $tests = array( + array(new \DateTime('March 10, 2014')), + array(new \DateTime('March 15, 2014')), + array(new \DateTime('March 20, 2014')), + ); + + if (\PHP_VERSION_ID >= 50500) { + $tests[] = array(new \DateTimeImmutable('March 10, 2014')); + $tests[] = array(new \DateTimeImmutable('March 15, 2014')); + $tests[] = array(new \DateTimeImmutable('March 20, 2014')); + } + + $this->restoreDefaultTimezone(); + + return $tests; + } + + public function getSoonerThanTenthMarch2014() + { + // The provider runs before setUp(), so we need to manually fix + // the default timezone + $this->setDefaultTimezone('UTC'); + + $tests = array( + array(new \DateTime('March 20, 2013'), 'Mar 20, 2013, 12:00 AM'), + array(new \DateTime('March 9, 2014'), 'Mar 9, 2014, 12:00 AM'), + ); + + if (\PHP_VERSION_ID >= 50500) { + $tests[] = array(new \DateTimeImmutable('March 20, 2013'), 'Mar 20, 2013, 12:00 AM'); + $tests[] = array(new \DateTimeImmutable('March 9, 2014'), 'Mar 9, 2014, 12:00 AM'); + } + + $this->restoreDefaultTimezone(); + + return $tests; + } + + public function getLaterThanTwentiethMarch2014() + { + // The provider runs before setUp(), so we need to manually fix + // the default timezone + $this->setDefaultTimezone('UTC'); + + $tests = array( + array(new \DateTime('March 21, 2014'), 'Mar 21, 2014, 12:00 AM'), + array(new \DateTime('March 9, 2015'), 'Mar 9, 2015, 12:00 AM'), + ); + + if (\PHP_VERSION_ID >= 50500) { + $tests[] = array(new \DateTimeImmutable('March 21, 2014'), 'Mar 21, 2014, 12:00 AM'); + $tests[] = array(new \DateTimeImmutable('March 9, 2015'), 'Mar 9, 2015, 12:00 AM'); + } + + $this->restoreDefaultTimezone(); + + return $tests; + } + + /** + * @dataProvider getTenthToTwentiethMarch2014 + */ + public function testValidDatesMin($value) + { + $constraint = new Range(array('min' => 'March 10, 2014')); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getTenthToTwentiethMarch2014 + */ + public function testValidDatesMax($value) + { + $constraint = new Range(array('max' => 'March 20, 2014')); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getTenthToTwentiethMarch2014 + */ + public function testValidDatesMinMax($value) + { + $constraint = new Range(array('min' => 'March 10, 2014', 'max' => 'March 20, 2014')); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + /** + * @dataProvider getSoonerThanTenthMarch2014 + */ + public function testInvalidDatesMin($value, $dateTimeAsString) + { + // Conversion of dates to string differs between ICU versions + // Make sure we have the correct version loaded + IntlTestHelper::requireIntl($this, '57.1'); + + $constraint = new Range(array( + 'min' => 'March 10, 2014', + 'minMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', $dateTimeAsString) + ->setParameter('{{ limit }}', 'Mar 10, 2014, 12:00 AM') + ->setCode(Range::TOO_LOW_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getLaterThanTwentiethMarch2014 + */ + public function testInvalidDatesMax($value, $dateTimeAsString) + { + // Conversion of dates to string differs between ICU versions + // Make sure we have the correct version loaded + IntlTestHelper::requireIntl($this, '57.1'); + + $constraint = new Range(array( + 'max' => 'March 20, 2014', + 'maxMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', $dateTimeAsString) + ->setParameter('{{ limit }}', 'Mar 20, 2014, 12:00 AM') + ->setCode(Range::TOO_HIGH_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getLaterThanTwentiethMarch2014 + */ + public function testInvalidDatesCombinedMax($value, $dateTimeAsString) + { + // Conversion of dates to string differs between ICU versions + // Make sure we have the correct version loaded + IntlTestHelper::requireIntl($this, '57.1'); + + $constraint = new Range(array( + 'min' => 'March 10, 2014', + 'max' => 'March 20, 2014', + 'minMessage' => 'myMinMessage', + 'maxMessage' => 'myMaxMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMaxMessage') + ->setParameter('{{ value }}', $dateTimeAsString) + ->setParameter('{{ limit }}', 'Mar 20, 2014, 12:00 AM') + ->setCode(Range::TOO_HIGH_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getSoonerThanTenthMarch2014 + */ + public function testInvalidDatesCombinedMin($value, $dateTimeAsString) + { + // Conversion of dates to string differs between ICU versions + // Make sure we have the correct version loaded + IntlTestHelper::requireIntl($this, '57.1'); + + $constraint = new Range(array( + 'min' => 'March 10, 2014', + 'max' => 'March 20, 2014', + 'minMessage' => 'myMinMessage', + 'maxMessage' => 'myMaxMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMinMessage') + ->setParameter('{{ value }}', $dateTimeAsString) + ->setParameter('{{ limit }}', 'Mar 10, 2014, 12:00 AM') + ->setCode(Range::TOO_LOW_ERROR) + ->assertRaised(); + } + + public function getInvalidValues() + { + return array( + array(9.999999), + array(20.000001), + array('9.999999'), + array('20.000001'), + array(new \stdClass()), + ); + } + + public function testNonNumeric() + { + $this->validator->validate('abcd', new Range(array( + 'min' => 10, + 'max' => 20, + 'invalidMessage' => 'myMessage', + ))); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"abcd"') + ->setCode(Range::INVALID_CHARACTERS_ERROR) + ->assertRaised(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexTest.php new file mode 100644 index 00000000000..26ef1b27361 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexTest.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Regex; + +/** + * @author Bernhard Schussek + */ +class RegexTest extends TestCase +{ + public function testConstraintGetDefaultOption() + { + $constraint = new Regex('/^[0-9]+$/'); + + $this->assertSame('/^[0-9]+$/', $constraint->pattern); + } + + public function provideHtmlPatterns() + { + return array( + // HTML5 wraps the pattern in ^(?:pattern)$ + array('/^[0-9]+$/', '[0-9]+'), + array('/[0-9]+$/', '.*[0-9]+'), + array('/^[0-9]+/', '[0-9]+.*'), + array('/[0-9]+/', '.*[0-9]+.*'), + // We need a smart way to allow matching of patterns that contain + // ^ and $ at various sub-clauses of an or-clause + // .*(pattern).* seems to work correctly + array('/[0-9]$|[a-z]+/', '.*([0-9]$|[a-z]+).*'), + array('/[0-9]$|^[a-z]+/', '.*([0-9]$|^[a-z]+).*'), + array('/^[0-9]|[a-z]+$/', '.*(^[0-9]|[a-z]+$).*'), + // Unescape escaped delimiters + array('/^[0-9]+\/$/', '[0-9]+/'), + array('#^[0-9]+\#$#', '[0-9]+#'), + // Cannot be converted + array('/^[0-9]+$/i', null), + + // Inverse matches are simple, just wrap in + // ((?!pattern).)* + array('/^[0-9]+$/', '((?!^[0-9]+$).)*', false), + array('/[0-9]+$/', '((?![0-9]+$).)*', false), + array('/^[0-9]+/', '((?!^[0-9]+).)*', false), + array('/[0-9]+/', '((?![0-9]+).)*', false), + array('/[0-9]$|[a-z]+/', '((?![0-9]$|[a-z]+).)*', false), + array('/[0-9]$|^[a-z]+/', '((?![0-9]$|^[a-z]+).)*', false), + array('/^[0-9]|[a-z]+$/', '((?!^[0-9]|[a-z]+$).)*', false), + array('/^[0-9]+\/$/', '((?!^[0-9]+/$).)*', false), + array('#^[0-9]+\#$#', '((?!^[0-9]+#$).)*', false), + array('/^[0-9]+$/i', null, false), + ); + } + + /** + * @dataProvider provideHtmlPatterns + */ + public function testGetHtmlPattern($pattern, $htmlPattern, $match = true) + { + $constraint = new Regex(array( + 'pattern' => $pattern, + 'match' => $match, + )); + + $this->assertSame($pattern, $constraint->pattern); + $this->assertSame($htmlPattern, $constraint->getHtmlPattern()); + } + + public function testGetCustomHtmlPattern() + { + $constraint = new Regex(array( + 'pattern' => '((?![0-9]$|[a-z]+).)*', + 'htmlPattern' => 'foobar', + )); + + $this->assertSame('((?![0-9]$|[a-z]+).)*', $constraint->pattern); + $this->assertSame('foobar', $constraint->getHtmlPattern()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexValidatorTest.php new file mode 100644 index 00000000000..88e69966b59 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/RegexValidatorTest.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Regex; +use Symfony\Component\Validator\Constraints\RegexValidator; +use Symfony\Component\Validator\Validation; + +class RegexValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new RegexValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Regex(array('pattern' => '/^[0-9]+$/'))); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Regex(array('pattern' => '/^[0-9]+$/'))); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Regex(array('pattern' => '/^[0-9]+$/'))); + } + + /** + * @dataProvider getValidValues + */ + public function testValidValues($value) + { + $constraint = new Regex(array('pattern' => '/^[0-9]+$/')); + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + public function getValidValues() + { + return array( + array(0), + array('0'), + array('090909'), + array(90909), + ); + } + + /** + * @dataProvider getInvalidValues + */ + public function testInvalidValues($value) + { + $constraint = new Regex(array( + 'pattern' => '/^[0-9]+$/', + 'message' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$value.'"') + ->setCode(Regex::REGEX_FAILED_ERROR) + ->assertRaised(); + } + + public function getInvalidValues() + { + return array( + array('abcd'), + array('090foo'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/TimeValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/TimeValidatorTest.php new file mode 100644 index 00000000000..a6ca1435ed3 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/TimeValidatorTest.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Time; +use Symfony\Component\Validator\Constraints\TimeValidator; +use Symfony\Component\Validator\Validation; + +class TimeValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new TimeValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Time()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Time()); + + $this->assertNoViolation(); + } + + public function testDateTimeClassIsValid() + { + $this->validator->validate(new \DateTime(), new Time()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Time()); + } + + /** + * @dataProvider getValidTimes + */ + public function testValidTimes($time) + { + $this->validator->validate($time, new Time()); + + $this->assertNoViolation(); + } + + public function getValidTimes() + { + return array( + array('01:02:03'), + array('00:00:00'), + array('23:59:59'), + ); + } + + /** + * @dataProvider getInvalidTimes + */ + public function testInvalidTimes($time, $code) + { + $constraint = new Time(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($time, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$time.'"') + ->setCode($code) + ->assertRaised(); + } + + public function getInvalidTimes() + { + return array( + array('foobar', Time::INVALID_FORMAT_ERROR), + array('foobar 12:34:56', Time::INVALID_FORMAT_ERROR), + array('12:34:56 foobar', Time::INVALID_FORMAT_ERROR), + array('00:00', Time::INVALID_FORMAT_ERROR), + array('24:00:00', Time::INVALID_TIME_ERROR), + array('00:60:00', Time::INVALID_TIME_ERROR), + array('00:00:60', Time::INVALID_TIME_ERROR), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/TypeValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/TypeValidatorTest.php new file mode 100644 index 00000000000..51bd992d8f8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/TypeValidatorTest.php @@ -0,0 +1,187 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Type; +use Symfony\Component\Validator\Constraints\TypeValidator; +use Symfony\Component\Validator\Validation; + +class TypeValidatorTest extends AbstractConstraintValidatorTest +{ + protected static $file; + + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new TypeValidator(); + } + + public function testNullIsValid() + { + $constraint = new Type(array('type' => 'integer')); + + $this->validator->validate(null, $constraint); + + $this->assertNoViolation(); + } + + public function testEmptyIsValidIfString() + { + $constraint = new Type(array('type' => 'string')); + + $this->validator->validate('', $constraint); + + $this->assertNoViolation(); + } + + public function testEmptyIsInvalidIfNoString() + { + $constraint = new Type(array( + 'type' => 'integer', + 'message' => 'myMessage', + )); + + $this->validator->validate('', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '""') + ->setParameter('{{ type }}', 'integer') + ->setCode(Type::INVALID_TYPE_ERROR) + ->assertRaised(); + } + + /** + * @dataProvider getValidValues + */ + public function testValidValues($value, $type) + { + $constraint = new Type(array('type' => $type)); + + $this->validator->validate($value, $constraint); + + $this->assertNoViolation(); + } + + public function getValidValues() + { + $object = new \stdClass(); + $file = $this->createFile(); + + return array( + array(true, 'Boolean'), + array(false, 'Boolean'), + array(true, 'boolean'), + array(false, 'boolean'), + array(true, 'bool'), + array(false, 'bool'), + array(0, 'numeric'), + array('0', 'numeric'), + array(1.5, 'numeric'), + array('1.5', 'numeric'), + array(0, 'integer'), + array(1.5, 'float'), + array('12345', 'string'), + array(array(), 'array'), + array($object, 'object'), + array($object, 'stdClass'), + array($file, 'resource'), + array('12345', 'digit'), + array('12a34', 'alnum'), + array('abcde', 'alpha'), + array("\n\r\t", 'cntrl'), + array('arf12', 'graph'), + array('abcde', 'lower'), + array('ABCDE', 'upper'), + array('arf12', 'print'), + array('*&$()', 'punct'), + array("\n\r\t", 'space'), + array('AB10BC99', 'xdigit'), + ); + } + + /** + * @dataProvider getInvalidValues + */ + public function testInvalidValues($value, $type, $valueAsString) + { + $constraint = new Type(array( + 'type' => $type, + 'message' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', $valueAsString) + ->setParameter('{{ type }}', $type) + ->setCode(Type::INVALID_TYPE_ERROR) + ->assertRaised(); + } + + public function getInvalidValues() + { + $object = new \stdClass(); + $file = $this->createFile(); + + return array( + array('foobar', 'numeric', '"foobar"'), + array('foobar', 'boolean', '"foobar"'), + array('0', 'integer', '"0"'), + array('1.5', 'float', '"1.5"'), + array(12345, 'string', '12345'), + array($object, 'boolean', 'object'), + array($object, 'numeric', 'object'), + array($object, 'integer', 'object'), + array($object, 'float', 'object'), + array($object, 'string', 'object'), + array($object, 'resource', 'object'), + array($file, 'boolean', 'resource'), + array($file, 'numeric', 'resource'), + array($file, 'integer', 'resource'), + array($file, 'float', 'resource'), + array($file, 'string', 'resource'), + array($file, 'object', 'resource'), + array('12a34', 'digit', '"12a34"'), + array('1a#23', 'alnum', '"1a#23"'), + array('abcd1', 'alpha', '"abcd1"'), + array("\nabc", 'cntrl', "\"\nabc\""), + array("abc\n", 'graph', "\"abc\n\""), + array('abCDE', 'lower', '"abCDE"'), + array('ABcde', 'upper', '"ABcde"'), + array("\nabc", 'print', "\"\nabc\""), + array('abc&$!', 'punct', '"abc&$!"'), + array("\nabc", 'space', "\"\nabc\""), + array('AR1012', 'xdigit', '"AR1012"'), + ); + } + + protected function createFile() + { + if (!static::$file) { + static::$file = fopen(__FILE__, 'r'); + } + + return static::$file; + } + + public static function tearDownAfterClass() + { + if (static::$file) { + fclose(static::$file); + static::$file = null; + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/UrlValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/UrlValidatorTest.php new file mode 100644 index 00000000000..bc3bd027d1f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/UrlValidatorTest.php @@ -0,0 +1,242 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Bridge\PhpUnit\DnsMock; +use Symfony\Component\Validator\Constraints\Url; +use Symfony\Component\Validator\Constraints\UrlValidator; +use Symfony\Component\Validator\Validation; + +/** + * @group dns-sensitive + */ +class UrlValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new UrlValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Url()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Url()); + + $this->assertNoViolation(); + } + + public function testEmptyStringFromObjectIsValid() + { + $this->validator->validate(new EmailProvider(), new Url()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Url()); + } + + /** + * @dataProvider getValidUrls + */ + public function testValidUrls($url) + { + $this->validator->validate($url, new Url()); + + $this->assertNoViolation(); + } + + public function getValidUrls() + { + return array( + array('http://a.pl'), + array('http://www.google.com'), + array('http://www.google.com.'), + array('http://www.google.museum'), + array('https://google.com/'), + array('https://google.com:80/'), + array('http://www.example.coop/'), + array('http://www.test-example.com/'), + array('http://www.symfony.com/'), + array('http://symfony.fake/blog/'), + array('http://symfony.com/?'), + array('http://symfony.com/search?type=&q=url+validator'), + array('http://symfony.com/#'), + array('http://symfony.com/#?'), + array('http://www.symfony.com/doc/current/book/validation.html#supported-constraints'), + array('http://very.long.domain.name.com/'), + array('http://localhost/'), + array('http://myhost123/'), + array('http://127.0.0.1/'), + array('http://127.0.0.1:80/'), + array('http://[::1]/'), + array('http://[::1]:80/'), + array('http://[1:2:3::4:5:6:7]/'), + array('http://sãopaulo.com/'), + array('http://xn--sopaulo-xwa.com/'), + array('http://sãopaulo.com.br/'), + array('http://xn--sopaulo-xwa.com.br/'), + array('http://пример.иÑпытание/'), + array('http://xn--e1afmkfd.xn--80akhbyknj4f/'), + array('http://مثال.إختبار/'), + array('http://xn--mgbh0fb.xn--kgbechtv/'), + array('http://例å­.测试/'), + array('http://xn--fsqu00a.xn--0zwm56d/'), + array('http://例å­.測試/'), + array('http://xn--fsqu00a.xn--g6w251d/'), + array('http://例ãˆ.テスト/'), + array('http://xn--r8jz45g.xn--zckzah/'), + array('http://مثال.آزمایشی/'), + array('http://xn--mgbh0fb.xn--hgbk6aj7f53bba/'), + array('http://실례.테스트/'), + array('http://xn--9n2bp8q.xn--9t4b11yi5a/'), + array('http://العربية.idn.icann.org/'), + array('http://xn--ogb.idn.icann.org/'), + array('http://xn--e1afmkfd.xn--80akhbyknj4f.xn--e1afmkfd/'), + array('http://xn--espaa-rta.xn--ca-ol-fsay5a/'), + array('http://xn--d1abbgf6aiiy.xn--p1ai/'), + array('http://☎.com/'), + array('http://username:password@symfony.com'), + array('http://user.name:password@symfony.com'), + array('http://username:pass.word@symfony.com'), + array('http://user.name:pass.word@symfony.com'), + array('http://user-name@symfony.com'), + array('http://symfony.com?'), + array('http://symfony.com?query=1'), + array('http://symfony.com/?query=1'), + array('http://symfony.com#'), + array('http://symfony.com#fragment'), + array('http://symfony.com/#fragment'), + array('http://symfony.com/#one_more%20test'), + ); + } + + /** + * @dataProvider getInvalidUrls + */ + public function testInvalidUrls($url) + { + $constraint = new Url(array( + 'message' => 'myMessage', + )); + + $this->validator->validate($url, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$url.'"') + ->setCode(Url::INVALID_URL_ERROR) + ->assertRaised(); + } + + public function getInvalidUrls() + { + return array( + array('google.com'), + array('://google.com'), + array('http ://google.com'), + array('http:/google.com'), + array('http://goog_le.com'), + array('http://google.com::aa'), + array('http://google.com:aa'), + array('ftp://google.fr'), + array('faked://google.fr'), + array('http://127.0.0.1:aa/'), + array('ftp://[::1]/'), + array('http://[::1'), + array('http://hello.☎/'), + array('http://:password@symfony.com'), + array('http://:password@@symfony.com'), + array('http://username:passwordsymfony.com'), + array('http://usern@me:password@symfony.com'), + array('http://example.com/exploit.html?'), + array('http://example.com/exploit.html?hel lo'), + array('http://example.com/exploit.html?not_a%hex'), + array('http://'), + ); + } + + /** + * @dataProvider getValidCustomUrls + */ + public function testCustomProtocolIsValid($url) + { + $constraint = new Url(array( + 'protocols' => array('ftp', 'file', 'git'), + )); + + $this->validator->validate($url, $constraint); + + $this->assertNoViolation(); + } + + public function getValidCustomUrls() + { + return array( + array('ftp://google.com'), + array('file://127.0.0.1'), + array('git://[::1]/'), + ); + } + + /** + * @dataProvider getCheckDns + * @requires function Symfony\Bridge\PhpUnit\DnsMock::withMockedHosts + */ + public function testCheckDns($violation) + { + DnsMock::withMockedHosts(array('example.com' => array(array('type' => $violation ? '' : 'A')))); + + $constraint = new Url(array( + 'checkDNS' => true, + 'dnsMessage' => 'myMessage', + )); + + $this->validator->validate('http://example.com', $constraint); + + if (!$violation) { + $this->assertNoViolation(); + } else { + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"example.com"') + ->setCode(Url::INVALID_URL_ERROR) + ->assertRaised(); + } + } + + public function getCheckDns() + { + return array(array(true), array(false)); + } +} + +class EmailProvider +{ + public function __toString() + { + return ''; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/UuidValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/UuidValidatorTest.php new file mode 100644 index 00000000000..05a60684c25 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/UuidValidatorTest.php @@ -0,0 +1,221 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use Symfony\Component\Validator\Constraints\Uuid; +use Symfony\Component\Validator\Constraints\UuidValidator; +use Symfony\Component\Validator\Validation; + +/** + * @author Colin O'Dell + */ +class UuidValidatorTest extends AbstractConstraintValidatorTest +{ + protected function getApiVersion() + { + return Validation::API_VERSION_2_5; + } + + protected function createValidator() + { + return new UuidValidator(); + } + + public function testNullIsValid() + { + $this->validator->validate(null, new Uuid()); + + $this->assertNoViolation(); + } + + public function testEmptyStringIsValid() + { + $this->validator->validate('', new Uuid()); + + $this->assertNoViolation(); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsUuidConstraintCompatibleType() + { + $constraint = $this->getMockForAbstractClass('Symfony\\Component\\Validator\\Constraint'); + + $this->validator->validate('216fff40-98d9-11e3-a5e2-0800200c9a66', $constraint); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException + */ + public function testExpectsStringCompatibleType() + { + $this->validator->validate(new \stdClass(), new Uuid()); + } + + /** + * @dataProvider getValidStrictUuids + */ + public function testValidStrictUuids($uuid, $versions = null) + { + $constraint = new Uuid(); + + if (null !== $versions) { + $constraint->versions = $versions; + } + + $this->validator->validate($uuid, $constraint); + + $this->assertNoViolation(); + } + + public function getValidStrictUuids() + { + return array( + array('216fff40-98d9-11e3-a5e2-0800200c9a66'), // Version 1 UUID in lowercase + array('216fff40-98d9-11e3-a5e2-0800200c9a66', array(Uuid::V1_MAC)), + array('216FFF40-98D9-11E3-A5E2-0800200C9A66'), // Version 1 UUID in UPPERCASE + array('456daefb-5aa6-41b5-8dbc-068b05a8b201'), // Version 4 UUID in lowercase + array('456daEFb-5AA6-41B5-8DBC-068B05A8B201'), // Version 4 UUID in mixed case + array('456daEFb-5AA6-41B5-8DBC-068B05A8B201', array(Uuid::V4_RANDOM)), + ); + } + + /** + * @dataProvider getInvalidStrictUuids + */ + public function testInvalidStrictUuids($uuid, $code, $versions = null) + { + $constraint = new Uuid(array( + 'message' => 'testMessage', + )); + + if (null !== $versions) { + $constraint->versions = $versions; + } + + $this->validator->validate($uuid, $constraint); + + $this->buildViolation('testMessage') + ->setParameter('{{ value }}', '"'.$uuid.'"') + ->setCode($code) + ->assertRaised(); + } + + public function getInvalidStrictUuids() + { + return array( + array('216fff40-98d9-11e3-a5e2_0800200c9a66', Uuid::INVALID_CHARACTERS_ERROR), + array('216gff40-98d9-11e3-a5e2-0800200c9a66', Uuid::INVALID_CHARACTERS_ERROR), + array('216Gff40-98d9-11e3-a5e2-0800200c9a66', Uuid::INVALID_CHARACTERS_ERROR), + array('216fff40-98d9-11e3-a5e-20800200c9a66', Uuid::INVALID_HYPHEN_PLACEMENT_ERROR), + array('216f-ff40-98d9-11e3-a5e2-0800200c9a66', Uuid::INVALID_HYPHEN_PLACEMENT_ERROR), + array('216fff40-98d9-11e3-a5e2-0800-200c9a66', Uuid::INVALID_HYPHEN_PLACEMENT_ERROR), + array('216fff40-98d9-11e3-a5e2-0800200c-9a66', Uuid::INVALID_HYPHEN_PLACEMENT_ERROR), + array('216fff40-98d9-11e3-a5e20800200c9a66', Uuid::INVALID_HYPHEN_PLACEMENT_ERROR), + array('216fff4098d911e3a5e20800200c9a66', Uuid::INVALID_HYPHEN_PLACEMENT_ERROR), + array('216fff40-98d9-11e3-a5e2-0800200c9a6', Uuid::TOO_SHORT_ERROR), + array('216fff40-98d9-11e3-a5e2-0800200c9a666', Uuid::TOO_LONG_ERROR), + array('216fff40-98d9-01e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-61e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-71e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-81e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-91e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-a1e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-b1e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-c1e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-d1e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-e1e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-f1e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR), + array('216fff40-98d9-11e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR, array(Uuid::V2_DCE, Uuid::V3_MD5, Uuid::V4_RANDOM, Uuid::V5_SHA1)), + array('216fff40-98d9-21e3-a5e2-0800200c9a66', Uuid::INVALID_VERSION_ERROR, array(Uuid::V1_MAC, Uuid::V3_MD5, Uuid::V4_RANDOM, Uuid::V5_SHA1)), + array('216fff40-98d9-11e3-05e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-15e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-25e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-35e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-45e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-55e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-65e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-75e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-c5e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-d5e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-e5e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + array('216fff40-98d9-11e3-f5e2-0800200c9a66', Uuid::INVALID_VARIANT_ERROR), + + // Non-standard UUID allowed by some other systems + array('{216fff40-98d9-11e3-a5e2-0800200c9a66}', Uuid::INVALID_CHARACTERS_ERROR), + array('[216fff40-98d9-11e3-a5e2-0800200c9a66]', Uuid::INVALID_CHARACTERS_ERROR), + ); + } + + /** + * @dataProvider getValidNonStrictUuids + */ + public function testValidNonStrictUuids($uuid) + { + $constraint = new Uuid(array( + 'strict' => false, + )); + + $this->validator->validate($uuid, $constraint); + + $this->assertNoViolation(); + } + + public function getValidNonStrictUuids() + { + return array( + array('216fff40-98d9-11e3-a5e2-0800200c9a66'), // Version 1 UUID in lowercase + array('216FFF40-98D9-11E3-A5E2-0800200C9A66'), // Version 1 UUID in UPPERCASE + array('456daefb-5aa6-41b5-8dbc-068b05a8b201'), // Version 4 UUID in lowercase + array('456DAEFb-5AA6-41B5-8DBC-068b05a8B201'), // Version 4 UUID in mixed case + + // Non-standard UUIDs allowed by some other systems + array('216f-ff40-98d9-11e3-a5e2-0800-200c-9a66'), // Non-standard dash positions (every 4 chars) + array('216fff40-98d911e3-a5e20800-200c9a66'), // Non-standard dash positions (every 8 chars) + array('216fff4098d911e3a5e20800200c9a66'), // No dashes at all + array('{216fff40-98d9-11e3-a5e2-0800200c9a66}'), // Wrapped with curly braces + array('[216fff40-98d9-11e3-a5e2-0800200c9a66]'), // Wrapped with squared braces + ); + } + + /** + * @dataProvider getInvalidNonStrictUuids + */ + public function testInvalidNonStrictUuids($uuid, $code) + { + $constraint = new Uuid(array( + 'strict' => false, + 'message' => 'myMessage', + )); + + $this->validator->validate($uuid, $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$uuid.'"') + ->setCode($code) + ->assertRaised(); + } + + public function getInvalidNonStrictUuids() + { + return array( + array('216fff40-98d9-11e3-a5e2_0800200c9a66', Uuid::INVALID_CHARACTERS_ERROR), + array('216gff40-98d9-11e3-a5e2-0800200c9a66', Uuid::INVALID_CHARACTERS_ERROR), + array('216Gff40-98d9-11e3-a5e2-0800200c9a66', Uuid::INVALID_CHARACTERS_ERROR), + array('216fff40-98d9-11e3-a5e2_0800200c9a6', Uuid::INVALID_CHARACTERS_ERROR), + array('216fff40-98d9-11e3-a5e-20800200c9a66', Uuid::INVALID_HYPHEN_PLACEMENT_ERROR), + array('216fff40-98d9-11e3-a5e2-0800200c9a6', Uuid::TOO_SHORT_ERROR), + array('216fff40-98d9-11e3-a5e2-0800200c9a666', Uuid::TOO_LONG_ERROR), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ValidTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ValidTest.php new file mode 100644 index 00000000000..83722fd2df0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Constraints/ValidTest.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Constraints; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Valid; + +/** + * @author Bernhard Schussek + */ +class ValidTest extends TestCase +{ + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testRejectGroupsOption() + { + new Valid(array('groups' => 'foo')); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CallbackClass.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CallbackClass.php new file mode 100644 index 00000000000..0f6a2f4ae3d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CallbackClass.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\ExecutionContextInterface; + +/** + * @author Bernhard Schussek + */ +class CallbackClass +{ + public static function callback($object, ExecutionContextInterface $context) + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ClassConstraint.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ClassConstraint.php new file mode 100644 index 00000000000..a4dc77715c5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ClassConstraint.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +class ClassConstraint extends Constraint +{ + public function getTargets() + { + return self::CLASS_CONSTRAINT; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintA.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintA.php new file mode 100644 index 00000000000..8a196dcc914 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintA.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +/** @Annotation */ +class ConstraintA extends Constraint +{ + public $property1; + public $property2; + + public function getDefaultOption() + { + return 'property2'; + } + + public function getTargets() + { + return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintAValidator.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintAValidator.php new file mode 100644 index 00000000000..b3b85c895b0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintAValidator.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\ExecutionContextInterface; + +class ConstraintAValidator extends ConstraintValidator +{ + public static $passedContext; + + public function initialize(ExecutionContextInterface $context) + { + parent::initialize($context); + + self::$passedContext = $context; + } + + public function validate($value, Constraint $constraint) + { + if ('VALID' != $value) { + $this->context->addViolation('message', array('param' => 'value')); + + return; + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintB.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintB.php new file mode 100644 index 00000000000..6258923372e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintB.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +/** @Annotation */ +class ConstraintB extends Constraint +{ + public function getTargets() + { + return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintC.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintC.php new file mode 100644 index 00000000000..b0418b87186 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintC.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +/** @Annotation */ +class ConstraintC extends Constraint +{ + public $option1; + + public function getRequiredOptions() + { + return array('option1'); + } + + public function getTargets() + { + return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValue.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValue.php new file mode 100644 index 00000000000..4ebd981eef9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValue.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +/** @Annotation */ +class ConstraintWithValue extends Constraint +{ + public $property; + public $value; + + public function getDefaultOption() + { + return 'property'; + } + + public function getTargets() + { + return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValueAsDefault.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValueAsDefault.php new file mode 100644 index 00000000000..a975e0787fc --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ConstraintWithValueAsDefault.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +/** @Annotation */ +class ConstraintWithValueAsDefault extends Constraint +{ + public $property; + public $value; + + public function getDefaultOption() + { + return 'value'; + } + + public function getTargets() + { + return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Countable.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Countable.php new file mode 100644 index 00000000000..afc42376a25 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Countable.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +class Countable implements \Countable +{ + private $content; + + public function __construct(array $content) + { + $this->content = $content; + } + + public function count() + { + return \count($this->content); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.php new file mode 100644 index 00000000000..feb25318eb5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +/** + * This class is a hand written simplified version of PHP native `ArrayObject` + * class, to show that it behaves differently than the PHP native implementation. + */ +class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable +{ + private $array; + + public function __construct(array $array = null) + { + $this->array = $array ?: array(); + } + + public function offsetExists($offset) + { + return array_key_exists($offset, $this->array); + } + + public function offsetGet($offset) + { + return $this->array[$offset]; + } + + public function offsetSet($offset, $value) + { + if (null === $offset) { + $this->array[] = $value; + } else { + $this->array[$offset] = $value; + } + } + + public function offsetUnset($offset) + { + unset($this->array[$offset]); + } + + public function getIterator() + { + return new \ArrayIterator($this->array); + } + + public function count() + { + return \count($this->array); + } + + public function serialize() + { + return serialize($this->array); + } + + public function unserialize($serialized) + { + $this->array = (array) unserialize((string) $serialized); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Entity.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Entity.php new file mode 100644 index 00000000000..e30619103d9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Entity.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraints as Assert; +use Symfony\Component\Validator\ExecutionContextInterface; + +/** + * @Symfony\Component\Validator\Tests\Fixtures\ConstraintA + * @Assert\GroupSequence({"Foo", "Entity"}) + * @Assert\Callback({"Symfony\Component\Validator\Tests\Fixtures\CallbackClass", "callback"}) + */ +class Entity extends EntityParent implements EntityInterfaceB +{ + /** + * @Assert\NotNull + * @Assert\Range(min=3) + * @Assert\All({@Assert\NotNull, @Assert\Range(min=3)}), + * @Assert\All(constraints={@Assert\NotNull, @Assert\Range(min=3)}) + * @Assert\Collection(fields={ + * "foo" = {@Assert\NotNull, @Assert\Range(min=3)}, + * "bar" = @Assert\Range(min=5) + * }) + * @Assert\Choice(choices={"A", "B"}, message="Must be one of %choices%") + */ + public $firstName; + protected $lastName; + public $reference; + public $reference2; + private $internal; + public $data = 'Overridden data'; + public $initialized = false; + + public function __construct($internal = null) + { + $this->internal = $internal; + } + + public function getInternal() + { + return $this->internal.' from getter'; + } + + public function setLastName($lastName) + { + $this->lastName = $lastName; + } + + /** + * @Assert\NotNull + */ + public function getLastName() + { + return $this->lastName; + } + + public function getValid() + { + } + + /** + * @Assert\IsTrue + */ + public function isValid() + { + return 'valid'; + } + + /** + * @Assert\IsTrue + */ + public function hasPermissions() + { + return 'permissions'; + } + + public function getData() + { + return 'Overridden data'; + } + + /** + * @Assert\Callback(payload="foo") + */ + public function validateMe(ExecutionContextInterface $context) + { + } + + /** + * @Assert\Callback + */ + public static function validateMeStatic($object, ExecutionContextInterface $context) + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceA.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceA.php new file mode 100644 index 00000000000..a0afcf81631 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceA.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +interface EntityInterfaceA +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceB.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceB.php new file mode 100644 index 00000000000..93b389414fa --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityInterfaceB.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +interface EntityInterfaceB extends EntityParentInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParent.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParent.php new file mode 100644 index 00000000000..4674f8b35a2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParent.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraints\NotNull; + +class EntityParent implements EntityInterfaceA +{ + protected $firstName; + private $internal; + private $data = 'Data'; + + /** + * @NotNull + */ + protected $other; + + public function getData() + { + return 'Data'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParentInterface.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParentInterface.php new file mode 100644 index 00000000000..3aad6fec5f7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityParentInterface.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +interface EntityParentInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCar.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCar.php new file mode 100644 index 00000000000..0b384872db5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCar.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraints\Length; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +class EntityStaticCar extends EntityStaticVehicle +{ + public static function loadValidatorMetadata(ClassMetadata $metadata) + { + $metadata->addPropertyConstraint('wheels', new Length(array('max' => 99))); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCarTurbo.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCarTurbo.php new file mode 100644 index 00000000000..abf1edbdd13 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticCarTurbo.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraints\Length; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +class EntityStaticCarTurbo extends EntityStaticCar +{ + public static function loadValidatorMetadata(ClassMetadata $metadata) + { + $metadata->addPropertyConstraint('wheels', new Length(array('max' => 99))); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticVehicle.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticVehicle.php new file mode 100644 index 00000000000..9ce72935de5 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/EntityStaticVehicle.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraints\Length; +use Symfony\Component\Validator\Mapping\ClassMetadata; + +class EntityStaticVehicle +{ + public $wheels; + + public static function loadValidatorMetadata(ClassMetadata $metadata) + { + $metadata->addPropertyConstraint('wheels', new Length(array('max' => 99))); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraint.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraint.php new file mode 100644 index 00000000000..03019fc37ca --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraint.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +class FailingConstraint extends Constraint +{ + public $message = 'Failed'; + + public function getTargets() + { + return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraintValidator.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraintValidator.php new file mode 100644 index 00000000000..a019dd6f836 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FailingConstraintValidator.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; + +class FailingConstraintValidator extends ConstraintValidator +{ + public function validate($value, Constraint $constraint) + { + $this->context->addViolation($constraint->message, array()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeClassMetadata.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeClassMetadata.php new file mode 100644 index 00000000000..8c76a21598c --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeClassMetadata.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Mapping\ClassMetadata; + +class FakeClassMetadata extends ClassMetadata +{ + public function addCustomPropertyMetadata($propertyName, $metadata) + { + if (!isset($this->members[$propertyName])) { + $this->members[$propertyName] = array(); + } + + $this->members[$propertyName][] = $metadata; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php new file mode 100644 index 00000000000..dbc255f36eb --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Exception\NoSuchMetadataException; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\MetadataInterface; + +class FakeMetadataFactory implements MetadataFactoryInterface +{ + protected $metadatas = array(); + + public function getMetadataFor($class) + { + $hash = null; + + if (\is_object($class)) { + $hash = spl_object_hash($class); + $class = \get_class($class); + } + + if (!\is_string($class)) { + throw new NoSuchMetadataException(sprintf('No metadata for type %s', \gettype($class))); + } + + if (!isset($this->metadatas[$class])) { + if (isset($this->metadatas[$hash])) { + return $this->metadatas[$hash]; + } + + throw new NoSuchMetadataException(sprintf('No metadata for "%s"', $class)); + } + + return $this->metadatas[$class]; + } + + public function hasMetadataFor($class) + { + $hash = null; + + if (\is_object($class)) { + $hash = spl_object_hash($class); + $class = \get_class($class); + } + + if (!\is_string($class)) { + return false; + } + + return isset($this->metadatas[$class]) || isset($this->metadatas[$hash]); + } + + public function addMetadata($metadata) + { + $this->metadatas[$metadata->getClassName()] = $metadata; + } + + public function addMetadataForValue($value, MetadataInterface $metadata) + { + $key = \is_object($value) ? spl_object_hash($value) : $value; + $this->metadatas[$key] = $metadata; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FilesLoader.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FilesLoader.php new file mode 100644 index 00000000000..a4d6a6ab474 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/FilesLoader.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Mapping\Loader\FilesLoader as BaseFilesLoader; +use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; + +abstract class FilesLoader extends BaseFilesLoader +{ + protected $timesCalled = 0; + protected $loader; + + public function __construct(array $paths, LoaderInterface $loader) + { + $this->loader = $loader; + parent::__construct($paths); + } + + protected function getFileLoaderInstance($file) + { + ++$this->timesCalled; + + return $this->loader; + } + + public function getTimesCalled() + { + return $this->timesCalled; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderChildEntity.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderChildEntity.php new file mode 100644 index 00000000000..be7191f9b6e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderChildEntity.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +class GroupSequenceProviderChildEntity extends GroupSequenceProviderEntity +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderEntity.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderEntity.php new file mode 100644 index 00000000000..2b0beaf9adf --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderEntity.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraints as Assert; +use Symfony\Component\Validator\GroupSequenceProviderInterface; + +/** + * @Assert\GroupSequenceProvider + */ +class GroupSequenceProviderEntity implements GroupSequenceProviderInterface +{ + public $firstName; + public $lastName; + + protected $sequence = array(); + + public function __construct($sequence) + { + $this->sequence = $sequence; + } + + public function getGroupSequence() + { + return $this->sequence; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraint.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraint.php new file mode 100644 index 00000000000..6a9eaa797a8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraint.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +class InvalidConstraint extends Constraint +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraintValidator.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraintValidator.php new file mode 100644 index 00000000000..bd9a5cf6c32 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/InvalidConstraintValidator.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +class InvalidConstraintValidator +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/LegacyClassMetadata.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/LegacyClassMetadata.php new file mode 100644 index 00000000000..6a832a109f9 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/LegacyClassMetadata.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\ClassBasedInterface; +use Symfony\Component\Validator\MetadataInterface; +use Symfony\Component\Validator\PropertyMetadataContainerInterface; + +interface LegacyClassMetadata extends MetadataInterface, PropertyMetadataContainerInterface, ClassBasedInterface +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/PropertyConstraint.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/PropertyConstraint.php new file mode 100644 index 00000000000..fadb5358a61 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/PropertyConstraint.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\Constraint; + +class PropertyConstraint extends Constraint +{ + public function getTargets() + { + return self::PROPERTY_CONSTRAINT; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Reference.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Reference.php new file mode 100644 index 00000000000..af297359243 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/Reference.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +class Reference +{ + public $value; + + private $privateValue; + + public function setPrivateValue($privateValue) + { + $this->privateValue = $privateValue; + } + + public function getPrivateValue() + { + return $this->privateValue; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/StubGlobalExecutionContext.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/StubGlobalExecutionContext.php new file mode 100644 index 00000000000..bd2f5c94e7a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/StubGlobalExecutionContext.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +use Symfony\Component\Validator\ConstraintViolationList; +use Symfony\Component\Validator\GlobalExecutionContextInterface; +use Symfony\Component\Validator\ValidationVisitorInterface; + +/** + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0 + */ +class StubGlobalExecutionContext implements GlobalExecutionContextInterface +{ + private $violations; + private $root; + private $visitor; + + public function __construct($root = null, ValidationVisitorInterface $visitor = null) + { + $this->violations = new ConstraintViolationList(); + $this->root = $root; + $this->visitor = $visitor; + } + + public function getViolations() + { + return $this->violations; + } + + public function setRoot($root) + { + $this->root = $root; + } + + public function getRoot() + { + return $this->root; + } + + public function setVisitor(ValidationVisitorInterface $visitor) + { + $this->visitor = $visitor; + } + + public function getVisitor() + { + return $this->visitor; + } + + public function getValidatorFactory() + { + } + + public function getMetadataFactory() + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ToString.php b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ToString.php new file mode 100644 index 00000000000..714fdb9e98f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Fixtures/ToString.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Fixtures; + +class ToString +{ + public $data; + + public function __toString() + { + return 'toString'; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php b/upload/system/storage/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php new file mode 100644 index 00000000000..1130551c2e8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/LegacyExecutionContextTest.php @@ -0,0 +1,335 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\All; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\ConstraintValidatorFactory; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Validator\ConstraintViolationList; +use Symfony\Component\Validator\ExecutionContext; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; +use Symfony\Component\Validator\ValidationVisitor; + +/** + * @group legacy + */ +class LegacyExecutionContextTest extends TestCase +{ + const TRANS_DOMAIN = 'trans_domain'; + + private $visitor; + private $violations; + private $metadata; + private $metadataFactory; + private $globalContext; + private $translator; + + /** + * @var ExecutionContext + */ + private $context; + + protected function setUp() + { + $this->visitor = $this->getMockBuilder('Symfony\Component\Validator\ValidationVisitor') + ->disableOriginalConstructor() + ->getMock(); + $this->violations = new ConstraintViolationList(); + $this->metadata = $this->getMockBuilder('Symfony\Component\Validator\MetadataInterface')->getMock(); + $this->metadataFactory = $this->getMockBuilder('Symfony\Component\Validator\MetadataFactoryInterface')->getMock(); + $this->globalContext = $this->getMockBuilder('Symfony\Component\Validator\GlobalExecutionContextInterface')->getMock(); + $this->globalContext->expects($this->any()) + ->method('getRoot') + ->will($this->returnValue('Root')); + $this->globalContext->expects($this->any()) + ->method('getViolations') + ->will($this->returnValue($this->violations)); + $this->globalContext->expects($this->any()) + ->method('getVisitor') + ->will($this->returnValue($this->visitor)); + $this->globalContext->expects($this->any()) + ->method('getMetadataFactory') + ->will($this->returnValue($this->metadataFactory)); + $this->translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock(); + $this->context = new ExecutionContext($this->globalContext, $this->translator, self::TRANS_DOMAIN, $this->metadata, 'currentValue', 'Group', 'foo.bar'); + } + + protected function tearDown() + { + $this->globalContext = null; + $this->context = null; + } + + public function testInit() + { + $this->assertCount(0, $this->context->getViolations()); + $this->assertSame('Root', $this->context->getRoot()); + $this->assertSame('foo.bar', $this->context->getPropertyPath()); + $this->assertSame('Group', $this->context->getGroup()); + } + + public function testClone() + { + $clone = clone $this->context; + + // Cloning the context keeps the reference to the original violation + // list. This way we can efficiently duplicate context instances during + // the validation run and only modify the properties that need to be + // changed. + $this->assertSame($this->context->getViolations(), $clone->getViolations()); + } + + public function testAddViolation() + { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + + $this->context->addViolation('Error', array('foo' => 'bar'), 'invalid'); + + $this->assertEquals(new ConstraintViolationList(array( + new ConstraintViolation( + 'Translated error', + 'Error', + array('foo' => 'bar'), + 'Root', + 'foo.bar', + 'invalid' + ), + )), $this->context->getViolations()); + } + + public function testAddViolationUsesPreconfiguredValueIfNotPassed() + { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array()) + ->will($this->returnValue('Translated error')); + + $this->context->addViolation('Error'); + + $this->assertEquals(new ConstraintViolationList(array( + new ConstraintViolation( + 'Translated error', + 'Error', + array(), + 'Root', + 'foo.bar', + 'currentValue' + ), + )), $this->context->getViolations()); + } + + public function testAddViolationUsesPassedNullValue() + { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo1' => 'bar1')) + ->will($this->returnValue('Translated error')); + $this->translator->expects($this->once()) + ->method('transChoice') + ->with('Choice error', 1, array('foo2' => 'bar2')) + ->will($this->returnValue('Translated choice error')); + + // passed null value should override preconfigured value "invalid" + $this->context->addViolation('Error', array('foo1' => 'bar1'), null); + $this->context->addViolation('Choice error', array('foo2' => 'bar2'), null, 1); + + $this->assertEquals(new ConstraintViolationList(array( + new ConstraintViolation( + 'Translated error', + 'Error', + array('foo1' => 'bar1'), + 'Root', + 'foo.bar', + null + ), + new ConstraintViolation( + 'Translated choice error', + 'Choice error', + array('foo2' => 'bar2'), + 'Root', + 'foo.bar', + null, + 1 + ), + )), $this->context->getViolations()); + } + + public function testAddViolationAt() + { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + + // override preconfigured property path + $this->context->addViolationAt('bam.baz', 'Error', array('foo' => 'bar'), 'invalid'); + + $this->assertEquals(new ConstraintViolationList(array( + new ConstraintViolation( + 'Translated error', + 'Error', + array('foo' => 'bar'), + 'Root', + 'foo.bar.bam.baz', + 'invalid' + ), + )), $this->context->getViolations()); + } + + public function testAddViolationAtUsesPreconfiguredValueIfNotPassed() + { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array()) + ->will($this->returnValue('Translated error')); + + $this->context->addViolationAt('bam.baz', 'Error'); + + $this->assertEquals(new ConstraintViolationList(array( + new ConstraintViolation( + 'Translated error', + 'Error', + array(), + 'Root', + 'foo.bar.bam.baz', + 'currentValue' + ), + )), $this->context->getViolations()); + } + + public function testAddViolationAtUsesPassedNullValue() + { + $this->translator->expects($this->once()) + ->method('trans') + ->with('Error', array('foo' => 'bar')) + ->will($this->returnValue('Translated error')); + $this->translator->expects($this->once()) + ->method('transChoice') + ->with('Choice error', 2, array('foo' => 'bar')) + ->will($this->returnValue('Translated choice error')); + + // passed null value should override preconfigured value "invalid" + $this->context->addViolationAt('bam.baz', 'Error', array('foo' => 'bar'), null); + $this->context->addViolationAt('bam.baz', 'Choice error', array('foo' => 'bar'), null, 2); + + $this->assertEquals(new ConstraintViolationList(array( + new ConstraintViolation( + 'Translated error', + 'Error', + array('foo' => 'bar'), + 'Root', + 'foo.bar.bam.baz', + null + ), + new ConstraintViolation( + 'Translated choice error', + 'Choice error', + array('foo' => 'bar'), + 'Root', + 'foo.bar.bam.baz', + null, + 2 + ), + )), $this->context->getViolations()); + } + + public function testAddViolationPluralTranslationError() + { + $this->translator->expects($this->once()) + ->method('transChoice') + ->with('foo') + ->will($this->throwException(new \InvalidArgumentException())); + $this->translator->expects($this->once()) + ->method('trans') + ->with('foo'); + + $this->context->addViolation('foo', array(), null, 2); + } + + public function testGetPropertyPath() + { + $this->assertEquals('foo.bar', $this->context->getPropertyPath()); + } + + public function testGetPropertyPathWithIndexPath() + { + $this->assertEquals('foo.bar[bam]', $this->context->getPropertyPath('[bam]')); + } + + public function testGetPropertyPathWithEmptyPath() + { + $this->assertEquals('foo.bar', $this->context->getPropertyPath('')); + } + + public function testGetPropertyPathWithEmptyCurrentPropertyPath() + { + $this->context = new ExecutionContext($this->globalContext, $this->translator, self::TRANS_DOMAIN, $this->metadata, 'currentValue', 'Group', ''); + + $this->assertEquals('bam.baz', $this->context->getPropertyPath('bam.baz')); + } + + public function testGetPropertyPathWithNestedCollectionsAndAllMixed() + { + $constraints = new Collection(array( + 'shelves' => new All(array('constraints' => array( + new Collection(array( + 'name' => new ConstraintA(), + 'books' => new All(array('constraints' => array( + new ConstraintA(), + ))), + )), + ))), + 'name' => new ConstraintA(), + )); + $data = array( + 'shelves' => array( + array( + 'name' => 'Research', + 'books' => array('foo', 'bar'), + ), + array( + 'name' => 'VALID', + 'books' => array('foozy', 'VALID', 'bazzy'), + ), + ), + 'name' => 'Library', + ); + $expectedViolationPaths = array( + '[shelves][0][name]', + '[shelves][0][books][0]', + '[shelves][0][books][1]', + '[shelves][1][books][0]', + '[shelves][1][books][2]', + '[name]', + ); + + $visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory(), $this->translator); + $context = new ExecutionContext($visitor, $this->translator, self::TRANS_DOMAIN); + $context->validateValue($data, $constraints); + + foreach ($context->getViolations() as $violation) { + $violationPaths[] = $violation->getPropertyPath(); + } + + $this->assertEquals($expectedViolationPaths, $violationPaths); + } +} + +class ExecutionContextTest_TestClass +{ + public $myProperty; +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/LegacyValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/LegacyValidatorTest.php new file mode 100644 index 00000000000..a38f1abb9bb --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/LegacyValidatorTest.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests; + +use Symfony\Component\Translation\IdentityTranslator; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\ConstraintValidatorFactory; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Tests\Fixtures\Entity; +use Symfony\Component\Validator\Tests\Validator\AbstractLegacyApiTest; +use Symfony\Component\Validator\Validator as LegacyValidator; + +/** + * @group legacy + */ +class LegacyValidatorTest extends AbstractLegacyApiTest +{ + protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) + { + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + return new LegacyValidator($metadataFactory, new ConstraintValidatorFactory(), $translator, 'validators', $objectInitializers); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ValidatorException + */ + public function testValidateValueRejectsValid() + { + $this->validator->validateValue(new Entity(), new Valid()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/DoctrineCacheTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/DoctrineCacheTest.php new file mode 100644 index 00000000000..19b29227d6d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/DoctrineCacheTest.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Cache; + +use Doctrine\Common\Cache\ArrayCache; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\Cache\DoctrineCache; + +class DoctrineCacheTest extends TestCase +{ + private $cache; + + public function testWrite() + { + $meta = $this->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata') + ->disableOriginalConstructor() + ->setMethods(array('getClassName')) + ->getMock(); + + $meta->expects($this->once()) + ->method('getClassName') + ->will($this->returnValue('bar')); + + $this->cache->write($meta); + + $this->assertInstanceOf( + 'Symfony\\Component\\Validator\\Mapping\\ClassMetadata', + $this->cache->read('bar'), + 'write() stores metadata' + ); + } + + public function testHas() + { + $meta = $this->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata') + ->disableOriginalConstructor() + ->setMethods(array('getClassName')) + ->getMock(); + + $meta->expects($this->once()) + ->method('getClassName') + ->will($this->returnValue('bar')); + + $this->assertFalse($this->cache->has('bar'), 'has() returns false when there is no entry'); + + $this->cache->write($meta); + $this->assertTrue($this->cache->has('bar'), 'has() returns true when the is an entry'); + } + + public function testRead() + { + $meta = $this->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata') + ->disableOriginalConstructor() + ->setMethods(array('getClassName')) + ->getMock(); + + $meta->expects($this->once()) + ->method('getClassName') + ->will($this->returnValue('bar')); + + $this->assertFalse($this->cache->read('bar'), 'read() returns false when there is no entry'); + + $this->cache->write($meta); + + $this->assertInstanceOf( + 'Symfony\\Component\\Validator\\Mapping\\ClassMetadata', + $this->cache->read('bar'), + 'read() returns metadata' + ); + } + + protected function setUp() + { + $this->cache = new DoctrineCache(new ArrayCache()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php new file mode 100644 index 00000000000..7102474e844 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Cache/LegacyApcCacheTest.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Cache; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\Cache\ApcCache; + +/** + * @group legacy + * @requires extension apc + */ +class LegacyApcCacheTest extends TestCase +{ + protected function setUp() + { + if (!filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) || !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) { + $this->markTestSkipped('APC is not enabled.'); + } + } + + public function testWrite() + { + $meta = $this->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata') + ->disableOriginalConstructor() + ->setMethods(array('getClassName')) + ->getMock(); + + $meta->expects($this->once()) + ->method('getClassName') + ->will($this->returnValue('bar')); + + $cache = new ApcCache('foo'); + $cache->write($meta); + + $this->assertInstanceOf('Symfony\\Component\\Validator\\Mapping\\ClassMetadata', apc_fetch('foobar'), '->write() stores metadata in APC'); + } + + public function testHas() + { + $meta = $this->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata') + ->disableOriginalConstructor() + ->setMethods(array('getClassName')) + ->getMock(); + + $meta->expects($this->once()) + ->method('getClassName') + ->will($this->returnValue('bar')); + + apc_delete('foobar'); + + $cache = new ApcCache('foo'); + $this->assertFalse($cache->has('bar'), '->has() returns false when there is no entry'); + + $cache->write($meta); + $this->assertTrue($cache->has('bar'), '->has() returns true when the is an entry'); + } + + public function testRead() + { + $meta = $this->getMockBuilder('Symfony\\Component\\Validator\\Mapping\\ClassMetadata') + ->disableOriginalConstructor() + ->setMethods(array('getClassName')) + ->getMock(); + + $meta->expects($this->once()) + ->method('getClassName') + ->will($this->returnValue('bar')); + + $cache = new ApcCache('foo'); + $cache->write($meta); + + $this->assertInstanceOf('Symfony\\Component\\Validator\\Mapping\\ClassMetadata', $cache->read('bar'), '->read() returns metadata'); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/ClassMetadataTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/ClassMetadataTest.php new file mode 100644 index 00000000000..a3f8a8c1ec8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/ClassMetadataTest.php @@ -0,0 +1,323 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; +use Symfony\Component\Validator\Tests\Fixtures\PropertyConstraint; + +class ClassMetadataTest extends TestCase +{ + const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity'; + const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent'; + const PROVIDERCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity'; + const PROVIDERCHILDCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderChildEntity'; + + protected $metadata; + + protected function setUp() + { + $this->metadata = new ClassMetadata(self::CLASSNAME); + } + + protected function tearDown() + { + $this->metadata = null; + } + + public function testAddConstraintDoesNotAcceptValid() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); + + $this->metadata->addConstraint(new Valid()); + } + + public function testAddConstraintRequiresClassConstraints() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); + + $this->metadata->addConstraint(new PropertyConstraint()); + } + + public function testAddPropertyConstraints() + { + $this->metadata->addPropertyConstraint('firstName', new ConstraintA()); + $this->metadata->addPropertyConstraint('lastName', new ConstraintB()); + + $this->assertEquals(array('firstName', 'lastName'), $this->metadata->getConstrainedProperties()); + } + + public function testAddMultiplePropertyConstraints() + { + $this->metadata->addPropertyConstraints('lastName', array(new ConstraintA(), new ConstraintB())); + + $constraints = array( + new ConstraintA(array('groups' => array('Default', 'Entity'))), + new ConstraintB(array('groups' => array('Default', 'Entity'))), + ); + + $properties = $this->metadata->getPropertyMetadata('lastName'); + + $this->assertCount(1, $properties); + $this->assertEquals('lastName', $properties[0]->getName()); + $this->assertEquals($constraints, $properties[0]->getConstraints()); + } + + public function testAddGetterConstraints() + { + $this->metadata->addGetterConstraint('lastName', new ConstraintA()); + $this->metadata->addGetterConstraint('lastName', new ConstraintB()); + + $constraints = array( + new ConstraintA(array('groups' => array('Default', 'Entity'))), + new ConstraintB(array('groups' => array('Default', 'Entity'))), + ); + + $properties = $this->metadata->getPropertyMetadata('lastName'); + + $this->assertCount(1, $properties); + $this->assertEquals('getLastName', $properties[0]->getName()); + $this->assertEquals($constraints, $properties[0]->getConstraints()); + } + + public function testAddMultipleGetterConstraints() + { + $this->metadata->addGetterConstraints('lastName', array(new ConstraintA(), new ConstraintB())); + + $constraints = array( + new ConstraintA(array('groups' => array('Default', 'Entity'))), + new ConstraintB(array('groups' => array('Default', 'Entity'))), + ); + + $properties = $this->metadata->getPropertyMetadata('lastName'); + + $this->assertCount(1, $properties); + $this->assertEquals('getLastName', $properties[0]->getName()); + $this->assertEquals($constraints, $properties[0]->getConstraints()); + } + + public function testMergeConstraintsMergesClassConstraints() + { + $parent = new ClassMetadata(self::PARENTCLASS); + $parent->addConstraint(new ConstraintA()); + + $this->metadata->mergeConstraints($parent); + $this->metadata->addConstraint(new ConstraintA()); + + $constraints = array( + new ConstraintA(array('groups' => array( + 'Default', + 'EntityParent', + 'Entity', + ))), + new ConstraintA(array('groups' => array( + 'Default', + 'Entity', + ))), + ); + + $this->assertEquals($constraints, $this->metadata->getConstraints()); + } + + public function testMergeConstraintsMergesMemberConstraints() + { + $parent = new ClassMetadata(self::PARENTCLASS); + $parent->addPropertyConstraint('firstName', new ConstraintA()); + $parent->addPropertyConstraint('firstName', new ConstraintB(array('groups' => 'foo'))); + + $this->metadata->mergeConstraints($parent); + $this->metadata->addPropertyConstraint('firstName', new ConstraintA()); + + $constraintA1 = new ConstraintA(array('groups' => array( + 'Default', + 'EntityParent', + 'Entity', + ))); + $constraintA2 = new ConstraintA(array('groups' => array( + 'Default', + 'Entity', + ))); + $constraintB = new ConstraintB(array( + 'groups' => array('foo'), + )); + + $constraints = array( + $constraintA1, + $constraintB, + $constraintA2, + ); + + $constraintsByGroup = array( + 'Default' => array( + $constraintA1, + $constraintA2, + ), + 'EntityParent' => array( + $constraintA1, + ), + 'Entity' => array( + $constraintA1, + $constraintA2, + ), + 'foo' => array( + $constraintB, + ), + ); + + $members = $this->metadata->getPropertyMetadata('firstName'); + + $this->assertCount(1, $members); + $this->assertEquals(self::PARENTCLASS, $members[0]->getClassName()); + $this->assertEquals($constraints, $members[0]->getConstraints()); + $this->assertEquals($constraintsByGroup, $members[0]->constraintsByGroup); + } + + public function testMemberMetadatas() + { + $this->metadata->addPropertyConstraint('firstName', new ConstraintA()); + + $this->assertTrue($this->metadata->hasPropertyMetadata('firstName')); + $this->assertFalse($this->metadata->hasPropertyMetadata('non_existent_field')); + } + + public function testMergeConstraintsKeepsPrivateMembersSeparate() + { + $parent = new ClassMetadata(self::PARENTCLASS); + $parent->addPropertyConstraint('internal', new ConstraintA()); + + $this->metadata->mergeConstraints($parent); + $this->metadata->addPropertyConstraint('internal', new ConstraintA()); + + $parentConstraints = array( + new ConstraintA(array('groups' => array( + 'Default', + 'EntityParent', + 'Entity', + ))), + ); + $constraints = array( + new ConstraintA(array('groups' => array( + 'Default', + 'Entity', + ))), + ); + + $members = $this->metadata->getPropertyMetadata('internal'); + + $this->assertCount(2, $members); + $this->assertEquals(self::PARENTCLASS, $members[0]->getClassName()); + $this->assertEquals($parentConstraints, $members[0]->getConstraints()); + $this->assertEquals(self::CLASSNAME, $members[1]->getClassName()); + $this->assertEquals($constraints, $members[1]->getConstraints()); + } + + public function testGetReflectionClass() + { + $reflClass = new \ReflectionClass(self::CLASSNAME); + + $this->assertEquals($reflClass, $this->metadata->getReflectionClass()); + } + + public function testSerialize() + { + $this->metadata->addConstraint(new ConstraintA(array('property1' => 'A'))); + $this->metadata->addConstraint(new ConstraintB(array('groups' => 'TestGroup'))); + $this->metadata->addPropertyConstraint('firstName', new ConstraintA()); + $this->metadata->addGetterConstraint('lastName', new ConstraintB()); + + $metadata = unserialize(serialize($this->metadata)); + + $this->assertEquals($this->metadata, $metadata); + } + + public function testGroupSequencesWorkIfContainingDefaultGroup() + { + $this->metadata->setGroupSequence(array('Foo', $this->metadata->getDefaultGroup())); + + $this->assertInstanceOf('Symfony\Component\Validator\Constraints\GroupSequence', $this->metadata->getGroupSequence()); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\GroupDefinitionException + */ + public function testGroupSequencesFailIfNotContainingDefaultGroup() + { + $this->metadata->setGroupSequence(array('Foo', 'Bar')); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\GroupDefinitionException + */ + public function testGroupSequencesFailIfContainingDefault() + { + $this->metadata->setGroupSequence(array('Foo', $this->metadata->getDefaultGroup(), Constraint::DEFAULT_GROUP)); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\GroupDefinitionException + */ + public function testGroupSequenceFailsIfGroupSequenceProviderIsSet() + { + $metadata = new ClassMetadata(self::PROVIDERCLASS); + $metadata->setGroupSequenceProvider(true); + $metadata->setGroupSequence(array('GroupSequenceProviderEntity', 'Foo')); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\GroupDefinitionException + */ + public function testGroupSequenceProviderFailsIfGroupSequenceIsSet() + { + $metadata = new ClassMetadata(self::PROVIDERCLASS); + $metadata->setGroupSequence(array('GroupSequenceProviderEntity', 'Foo')); + $metadata->setGroupSequenceProvider(true); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\GroupDefinitionException + */ + public function testGroupSequenceProviderFailsIfDomainClassIsInvalid() + { + $metadata = new ClassMetadata('stdClass'); + $metadata->setGroupSequenceProvider(true); + } + + public function testGroupSequenceProvider() + { + $metadata = new ClassMetadata(self::PROVIDERCLASS); + $metadata->setGroupSequenceProvider(true); + $this->assertTrue($metadata->isGroupSequenceProvider()); + } + + public function testMergeConstraintsMergesGroupSequenceProvider() + { + $parent = new ClassMetadata(self::PROVIDERCLASS); + $parent->setGroupSequenceProvider(true); + + $metadata = new ClassMetadata(self::PROVIDERCHILDCLASS); + $metadata->mergeConstraints($parent); + + $this->assertTrue($metadata->isGroupSequenceProvider()); + } + + /** + * https://github.com/symfony/symfony/issues/11604. + */ + public function testGetPropertyMetadataReturnsEmptyArrayWithoutConfiguredMetadata() + { + $this->assertCount(0, $this->metadata->getPropertyMetadata('foo'), '->getPropertyMetadata() returns an empty collection if no metadata is configured for the given property'); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/BlackHoleMetadataFactoryTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/BlackHoleMetadataFactoryTest.php new file mode 100644 index 00000000000..a323567d231 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/BlackHoleMetadataFactoryTest.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Factory; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\Factory\BlackHoleMetadataFactory; + +class BlackHoleMetadataFactoryTest extends TestCase +{ + /** + * @expectedException \LogicException + */ + public function testGetMetadataForThrowsALogicException() + { + $metadataFactory = new BlackHoleMetadataFactory(); + $metadataFactory->getMetadataFor('foo'); + } + + public function testHasMetadataForReturnsFalse() + { + $metadataFactory = new BlackHoleMetadataFactory(); + + $this->assertFalse($metadataFactory->hasMetadataFor('foo')); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php new file mode 100644 index 00000000000..de6852271e1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php @@ -0,0 +1,218 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Factory; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; +use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; + +class LazyLoadingMetadataFactoryTest extends TestCase +{ + const CLASS_NAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity'; + const PARENT_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent'; + const INTERFACE_A_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterfaceA'; + const INTERFACE_B_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityInterfaceB'; + const PARENT_INTERFACE_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParentInterface'; + + public function testLoadClassMetadataWithInterface() + { + $factory = new LazyLoadingMetadataFactory(new TestLoader()); + $metadata = $factory->getMetadataFor(self::PARENT_CLASS); + + $constraints = array( + new ConstraintA(array('groups' => array('Default', 'EntityParent'))), + new ConstraintA(array('groups' => array('Default', 'EntityInterfaceA', 'EntityParent'))), + ); + + $this->assertEquals($constraints, $metadata->getConstraints()); + } + + public function testMergeParentConstraints() + { + $factory = new LazyLoadingMetadataFactory(new TestLoader()); + $metadata = $factory->getMetadataFor(self::CLASS_NAME); + + $constraints = array( + new ConstraintA(array('groups' => array( + 'Default', + 'Entity', + ))), + new ConstraintA(array('groups' => array( + 'Default', + 'EntityParent', + 'Entity', + ))), + new ConstraintA(array('groups' => array( + 'Default', + 'EntityInterfaceA', + 'EntityParent', + 'Entity', + ))), + new ConstraintA(array('groups' => array( + 'Default', + 'EntityInterfaceB', + 'Entity', + ))), + new ConstraintA(array('groups' => array( + 'Default', + 'EntityParentInterface', + 'EntityInterfaceB', + 'Entity', + ))), + ); + + $this->assertEquals($constraints, $metadata->getConstraints()); + } + + public function testWriteMetadataToCache() + { + $cache = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Cache\CacheInterface')->getMock(); + $factory = new LazyLoadingMetadataFactory(new TestLoader(), $cache); + + $parentClassConstraints = array( + new ConstraintA(array('groups' => array('Default', 'EntityParent'))), + new ConstraintA(array('groups' => array('Default', 'EntityInterfaceA', 'EntityParent'))), + ); + $interfaceAConstraints = array( + new ConstraintA(array('groups' => array('Default', 'EntityInterfaceA'))), + ); + + $cache->expects($this->never()) + ->method('has'); + $cache->expects($this->exactly(2)) + ->method('read') + ->withConsecutive( + array($this->equalTo(self::PARENT_CLASS)), + array($this->equalTo(self::INTERFACE_A_CLASS)) + ) + ->will($this->returnValue(false)); + $cache->expects($this->exactly(2)) + ->method('write') + ->withConsecutive( + $this->callback(function ($metadata) use ($interfaceAConstraints) { + return $interfaceAConstraints == $metadata->getConstraints(); + }), + $this->callback(function ($metadata) use ($parentClassConstraints) { + return $parentClassConstraints == $metadata->getConstraints(); + }) + ); + + $metadata = $factory->getMetadataFor(self::PARENT_CLASS); + + $this->assertEquals(self::PARENT_CLASS, $metadata->getClassName()); + $this->assertEquals($parentClassConstraints, $metadata->getConstraints()); + } + + public function testReadMetadataFromCache() + { + $loader = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $cache = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Cache\CacheInterface')->getMock(); + $factory = new LazyLoadingMetadataFactory($loader, $cache); + + $metadata = new ClassMetadata(self::PARENT_CLASS); + $metadata->addConstraint(new ConstraintA()); + + $parentClass = self::PARENT_CLASS; + $interfaceClass = self::INTERFACE_A_CLASS; + + $loader->expects($this->never()) + ->method('loadClassMetadata'); + + $cache->expects($this->never()) + ->method('has'); + $cache->expects($this->exactly(2)) + ->method('read') + ->withConsecutive( + array(self::PARENT_CLASS), + array(self::INTERFACE_A_CLASS) + ) + ->willReturnCallback(function ($name) use ($metadata, $parentClass, $interfaceClass) { + if ($parentClass == $name) { + return $metadata; + } + + return new ClassMetadata($interfaceClass); + }); + + $this->assertEquals($metadata, $factory->getMetadataFor(self::PARENT_CLASS)); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException + */ + public function testNonClassNameStringValues() + { + $testedValue = 'error@example.com'; + $loader = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $cache = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Cache\CacheInterface')->getMock(); + $factory = new LazyLoadingMetadataFactory($loader, $cache); + $cache + ->expects($this->never()) + ->method('read'); + $factory->getMetadataFor($testedValue); + } + + public function testMetadataCacheWithRuntimeConstraint() + { + $cache = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Cache\CacheInterface')->getMock(); + $factory = new LazyLoadingMetadataFactory(new TestLoader(), $cache); + + $cache + ->expects($this->any()) + ->method('write') + ->will($this->returnCallback(function ($metadata) { serialize($metadata); })) + ; + + $cache->expects($this->any()) + ->method('read') + ->will($this->returnValue(false)); + + $metadata = $factory->getMetadataFor(self::PARENT_CLASS); + $metadata->addConstraint(new Callback(function () {})); + + $this->assertCount(3, $metadata->getConstraints()); + + $metadata = $factory->getMetadataFor(self::CLASS_NAME); + + $this->assertCount(6, $metadata->getConstraints()); + } + + public function testGroupsFromParent() + { + $reader = new \Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader(); + $factory = new LazyLoadingMetadataFactory($reader); + $metadata = $factory->getMetadataFor('Symfony\Component\Validator\Tests\Fixtures\EntityStaticCarTurbo'); + $groups = array(); + + foreach ($metadata->getPropertyMetadata('wheels') as $propertyMetadata) { + $constraints = $propertyMetadata->getConstraints(); + $groups = array_replace($groups, $constraints[0]->groups); + } + + $this->assertCount(4, $groups); + $this->assertContains('Default', $groups); + $this->assertContains('EntityStaticCarTurbo', $groups); + $this->assertContains('EntityStaticCar', $groups); + $this->assertContains('EntityStaticVehicle', $groups); + } +} + +class TestLoader implements LoaderInterface +{ + public function loadClassMetadata(ClassMetadata $metadata) + { + $metadata->addConstraint(new ConstraintA()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/GetterMetadataTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/GetterMetadataTest.php new file mode 100644 index 00000000000..05aef47e84a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/GetterMetadataTest.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\GetterMetadata; +use Symfony\Component\Validator\Tests\Fixtures\Entity; + +class GetterMetadataTest extends TestCase +{ + const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity'; + + public function testInvalidPropertyName() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ValidatorException'); + + new GetterMetadata(self::CLASSNAME, 'foobar'); + } + + public function testGetPropertyValueFromPublicGetter() + { + // private getters don't work yet because ReflectionMethod::setAccessible() + // does not exist yet in a stable PHP release + + $entity = new Entity('foobar'); + $metadata = new GetterMetadata(self::CLASSNAME, 'internal'); + + $this->assertEquals('foobar from getter', $metadata->getPropertyValue($entity)); + } + + public function testGetPropertyValueFromOverriddenPublicGetter() + { + $entity = new Entity(); + $metadata = new GetterMetadata(self::CLASSNAME, 'data'); + + $this->assertEquals('Overridden data', $metadata->getPropertyValue($entity)); + } + + public function testGetPropertyValueFromIsser() + { + $entity = new Entity(); + $metadata = new GetterMetadata(self::CLASSNAME, 'valid', 'isValid'); + + $this->assertEquals('valid', $metadata->getPropertyValue($entity)); + } + + public function testGetPropertyValueFromHasser() + { + $entity = new Entity(); + $metadata = new GetterMetadata(self::CLASSNAME, 'permissions'); + + $this->assertEquals('permissions', $metadata->getPropertyValue($entity)); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ValidatorException + * @expectedExceptionMessage The hasLastName() method does not exist in class Symfony\Component\Validator\Tests\Fixtures\Entity. + */ + public function testUndefinedMethodNameThrowsException() + { + new GetterMetadata(self::CLASSNAME, 'lastName', 'hasLastName'); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php new file mode 100644 index 00000000000..1fb2e6e7c81 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\ElementMetadata; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; + +/** + * @group legacy + */ +class LegacyElementMetadataTest extends TestCase +{ + protected $metadata; + + protected function setUp() + { + $this->metadata = new TestElementMetadata(); + } + + protected function tearDown() + { + $this->metadata = null; + } + + public function testAddConstraints() + { + $this->metadata->addConstraint($constraint1 = new ConstraintA()); + $this->metadata->addConstraint($constraint2 = new ConstraintA()); + + $this->assertEquals(array($constraint1, $constraint2), $this->metadata->getConstraints()); + } + + public function testMultipleConstraintsOfTheSameType() + { + $constraint1 = new ConstraintA(array('property1' => 'A')); + $constraint2 = new ConstraintA(array('property1' => 'B')); + + $this->metadata->addConstraint($constraint1); + $this->metadata->addConstraint($constraint2); + + $this->assertEquals(array($constraint1, $constraint2), $this->metadata->getConstraints()); + } + + public function testFindConstraintsByGroup() + { + $constraint1 = new ConstraintA(array('groups' => 'TestGroup')); + $constraint2 = new ConstraintB(); + + $this->metadata->addConstraint($constraint1); + $this->metadata->addConstraint($constraint2); + + $this->assertEquals(array($constraint1), $this->metadata->findConstraints('TestGroup')); + } + + public function testSerialize() + { + $this->metadata->addConstraint(new ConstraintA(array('property1' => 'A'))); + $this->metadata->addConstraint(new ConstraintB(array('groups' => 'TestGroup'))); + + $metadata = unserialize(serialize($this->metadata)); + + $this->assertEquals($this->metadata, $metadata); + } +} + +class TestElementMetadata extends ElementMetadata +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php new file mode 100644 index 00000000000..d032f0e8caa --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader; + +use Symfony\Component\Validator\Mapping\ClassMetadata; + +abstract class AbstractStaticMethodLoader +{ + abstract public static function loadMetadata(ClassMetadata $metadata); +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AnnotationLoaderTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AnnotationLoaderTest.php new file mode 100644 index 00000000000..6e011934991 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/AnnotationLoaderTest.php @@ -0,0 +1,164 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader; + +use Doctrine\Common\Annotations\AnnotationReader; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\All; +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Choice; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\IsTrue; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Range; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; + +class AnnotationLoaderTest extends TestCase +{ + public function testLoadClassMetadataReturnsTrueIfSuccessful() + { + $reader = new AnnotationReader(); + $loader = new AnnotationLoader($reader); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $this->assertTrue($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadataReturnsFalseIfNotSuccessful() + { + $loader = new AnnotationLoader(new AnnotationReader()); + $metadata = new ClassMetadata('\stdClass'); + + $this->assertFalse($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadata() + { + $loader = new AnnotationLoader(new AnnotationReader()); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $loader->loadClassMetadata($metadata); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + $expected->setGroupSequence(array('Foo', 'Entity')); + $expected->addConstraint(new ConstraintA()); + $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback'))); + $expected->addConstraint(new Callback(array('callback' => 'validateMe', 'payload' => 'foo'))); + $expected->addConstraint(new Callback('validateMeStatic')); + $expected->addPropertyConstraint('firstName', new NotNull()); + $expected->addPropertyConstraint('firstName', new Range(array('min' => 3))); + $expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3))))); + $expected->addPropertyConstraint('firstName', new All(array('constraints' => array(new NotNull(), new Range(array('min' => 3)))))); + $expected->addPropertyConstraint('firstName', new Collection(array('fields' => array( + 'foo' => array(new NotNull(), new Range(array('min' => 3))), + 'bar' => new Range(array('min' => 5)), + )))); + $expected->addPropertyConstraint('firstName', new Choice(array( + 'message' => 'Must be one of %choices%', + 'choices' => array('A', 'B'), + ))); + $expected->addGetterConstraint('lastName', new NotNull()); + $expected->addGetterMethodConstraint('valid', 'isValid', new IsTrue()); + $expected->addGetterConstraint('permissions', new IsTrue()); + + // load reflection class so that the comparison passes + $expected->getReflectionClass(); + + $this->assertEquals($expected, $metadata); + } + + /** + * Test MetaData merge with parent annotation. + */ + public function testLoadParentClassMetadata() + { + $loader = new AnnotationLoader(new AnnotationReader()); + + // Load Parent MetaData + $parent_metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent'); + $loader->loadClassMetadata($parent_metadata); + + $expected_parent = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent'); + $expected_parent->addPropertyConstraint('other', new NotNull()); + $expected_parent->getReflectionClass(); + + $this->assertEquals($expected_parent, $parent_metadata); + } + + /** + * Test MetaData merge with parent annotation. + */ + public function testLoadClassMetadataAndMerge() + { + $loader = new AnnotationLoader(new AnnotationReader()); + + // Load Parent MetaData + $parent_metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent'); + $loader->loadClassMetadata($parent_metadata); + + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + // Merge parent metaData. + $metadata->mergeConstraints($parent_metadata); + + $loader->loadClassMetadata($metadata); + + $expected_parent = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\EntityParent'); + $expected_parent->addPropertyConstraint('other', new NotNull()); + $expected_parent->getReflectionClass(); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + $expected->mergeConstraints($expected_parent); + + $expected->setGroupSequence(array('Foo', 'Entity')); + $expected->addConstraint(new ConstraintA()); + $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback'))); + $expected->addConstraint(new Callback(array('callback' => 'validateMe', 'payload' => 'foo'))); + $expected->addConstraint(new Callback('validateMeStatic')); + $expected->addPropertyConstraint('firstName', new NotNull()); + $expected->addPropertyConstraint('firstName', new Range(array('min' => 3))); + $expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3))))); + $expected->addPropertyConstraint('firstName', new All(array('constraints' => array(new NotNull(), new Range(array('min' => 3)))))); + $expected->addPropertyConstraint('firstName', new Collection(array('fields' => array( + 'foo' => array(new NotNull(), new Range(array('min' => 3))), + 'bar' => new Range(array('min' => 5)), + )))); + $expected->addPropertyConstraint('firstName', new Choice(array( + 'message' => 'Must be one of %choices%', + 'choices' => array('A', 'B'), + ))); + $expected->addGetterConstraint('lastName', new NotNull()); + $expected->addGetterMethodConstraint('valid', 'isValid', new IsTrue()); + $expected->addGetterConstraint('permissions', new IsTrue()); + + // load reflection class so that the comparison passes + $expected->getReflectionClass(); + + $this->assertEquals($expected, $metadata); + } + + public function testLoadGroupSequenceProviderAnnotation() + { + $loader = new AnnotationLoader(new AnnotationReader()); + + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity'); + $loader->loadClassMetadata($metadata); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity'); + $expected->setGroupSequenceProvider(true); + $expected->getReflectionClass(); + + $this->assertEquals($expected, $metadata); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/FilesLoaderTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/FilesLoaderTest.php new file mode 100644 index 00000000000..6fee7b6ff54 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/FilesLoaderTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; + +class FilesLoaderTest extends TestCase +{ + public function testCallsGetFileLoaderInstanceForeachPath() + { + $loader = $this->getFilesLoader($this->getFileLoader()); + $this->assertEquals(4, $loader->getTimesCalled()); + } + + public function testCallsActualFileLoaderForMetadata() + { + $fileLoader = $this->getFileLoader(); + $fileLoader->expects($this->exactly(4)) + ->method('loadClassMetadata'); + $loader = $this->getFilesLoader($fileLoader); + $loader->loadClassMetadata(new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity')); + } + + public function getFilesLoader(LoaderInterface $loader) + { + return $this->getMockForAbstractClass('Symfony\Component\Validator\Tests\Fixtures\FilesLoader', array(array( + __DIR__.'/constraint-mapping.xml', + __DIR__.'/constraint-mapping.yaml', + __DIR__.'/constraint-mapping.test', + __DIR__.'/constraint-mapping.txt', + ), $loader)); + } + + public function getFileLoader() + { + return $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/LoaderChainTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/LoaderChainTest.php new file mode 100644 index 00000000000..0d28b0a399e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/LoaderChainTest.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\LoaderChain; + +class LoaderChainTest extends TestCase +{ + public function testAllLoadersAreCalled() + { + $metadata = new ClassMetadata('\stdClass'); + + $loader1 = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $loader1->expects($this->once()) + ->method('loadClassMetadata') + ->with($this->equalTo($metadata)); + + $loader2 = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $loader2->expects($this->once()) + ->method('loadClassMetadata') + ->with($this->equalTo($metadata)); + + $chain = new LoaderChain(array( + $loader1, + $loader2, + )); + + $chain->loadClassMetadata($metadata); + } + + public function testReturnsTrueIfAnyLoaderReturnedTrue() + { + $metadata = new ClassMetadata('\stdClass'); + + $loader1 = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $loader1->expects($this->any()) + ->method('loadClassMetadata') + ->will($this->returnValue(true)); + + $loader2 = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $loader2->expects($this->any()) + ->method('loadClassMetadata') + ->will($this->returnValue(false)); + + $chain = new LoaderChain(array( + $loader1, + $loader2, + )); + + $this->assertTrue($chain->loadClassMetadata($metadata)); + } + + public function testReturnsFalseIfNoLoaderReturnedTrue() + { + $metadata = new ClassMetadata('\stdClass'); + + $loader1 = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $loader1->expects($this->any()) + ->method('loadClassMetadata') + ->will($this->returnValue(false)); + + $loader2 = $this->getMockBuilder('Symfony\Component\Validator\Mapping\Loader\LoaderInterface')->getMock(); + $loader2->expects($this->any()) + ->method('loadClassMetadata') + ->will($this->returnValue(false)); + + $chain = new LoaderChain(array( + $loader1, + $loader2, + )); + + $this->assertFalse($chain->loadClassMetadata($metadata)); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php new file mode 100644 index 00000000000..069ccd32292 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php @@ -0,0 +1,140 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\StaticMethodLoader; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; + +class StaticMethodLoaderTest extends TestCase +{ + private $errorLevel; + + protected function setUp() + { + $this->errorLevel = error_reporting(); + } + + protected function tearDown() + { + error_reporting($this->errorLevel); + } + + public function testLoadClassMetadataReturnsTrueIfSuccessful() + { + $loader = new StaticMethodLoader('loadMetadata'); + $metadata = new ClassMetadata(__NAMESPACE__.'\StaticLoaderEntity'); + + $this->assertTrue($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadataReturnsFalseIfNotSuccessful() + { + $loader = new StaticMethodLoader('loadMetadata'); + $metadata = new ClassMetadata('\stdClass'); + + $this->assertFalse($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadata() + { + $loader = new StaticMethodLoader('loadMetadata'); + $metadata = new ClassMetadata(__NAMESPACE__.'\StaticLoaderEntity'); + + $loader->loadClassMetadata($metadata); + + $this->assertEquals(StaticLoaderEntity::$invokedWith, $metadata); + } + + public function testLoadClassMetadataDoesNotRepeatLoadWithParentClasses() + { + $loader = new StaticMethodLoader('loadMetadata'); + $metadata = new ClassMetadata(__NAMESPACE__.'\StaticLoaderDocument'); + $loader->loadClassMetadata($metadata); + $this->assertCount(0, $metadata->getConstraints()); + + $loader = new StaticMethodLoader('loadMetadata'); + $metadata = new ClassMetadata(__NAMESPACE__.'\BaseStaticLoaderDocument'); + $loader->loadClassMetadata($metadata); + $this->assertCount(1, $metadata->getConstraints()); + } + + public function testLoadClassMetadataIgnoresInterfaces() + { + $loader = new StaticMethodLoader('loadMetadata'); + $metadata = new ClassMetadata(__NAMESPACE__.'\StaticLoaderInterface'); + + $loader->loadClassMetadata($metadata); + + $this->assertCount(0, $metadata->getConstraints()); + } + + public function testLoadClassMetadataInAbstractClasses() + { + $loader = new StaticMethodLoader('loadMetadata'); + $metadata = new ClassMetadata(__NAMESPACE__.'\AbstractStaticLoader'); + + $loader->loadClassMetadata($metadata); + + $this->assertCount(1, $metadata->getConstraints()); + } + + public function testLoadClassMetadataIgnoresAbstractMethods() + { + // Disable error reporting, as AbstractStaticMethodLoader produces a + // strict standards error + error_reporting(0); + + $metadata = new ClassMetadata(__NAMESPACE__.'\AbstractStaticMethodLoader'); + + $loader = new StaticMethodLoader('loadMetadata'); + $loader->loadClassMetadata($metadata); + + $this->assertCount(0, $metadata->getConstraints()); + } +} + +interface StaticLoaderInterface +{ + public static function loadMetadata(ClassMetadata $metadata); +} + +abstract class AbstractStaticLoader +{ + public static function loadMetadata(ClassMetadata $metadata) + { + $metadata->addConstraint(new ConstraintA()); + } +} + +class StaticLoaderEntity +{ + public static $invokedWith = null; + + public static function loadMetadata(ClassMetadata $metadata) + { + self::$invokedWith = $metadata; + } +} + +class StaticLoaderDocument extends BaseStaticLoaderDocument +{ +} + +class BaseStaticLoaderDocument +{ + public static function loadMetadata(ClassMetadata $metadata) + { + $metadata->addConstraint(new ConstraintA()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/XmlFileLoaderTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/XmlFileLoaderTest.php new file mode 100644 index 00000000000..100e4fa062f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/XmlFileLoaderTest.php @@ -0,0 +1,136 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\All; +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Choice; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\IsTrue; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Range; +use Symfony\Component\Validator\Constraints\Regex; +use Symfony\Component\Validator\Constraints\Traverse; +use Symfony\Component\Validator\Exception\MappingException; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; + +class XmlFileLoaderTest extends TestCase +{ + public function testLoadClassMetadataReturnsTrueIfSuccessful() + { + $loader = new XmlFileLoader(__DIR__.'/constraint-mapping.xml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $this->assertTrue($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadataReturnsFalseIfNotSuccessful() + { + $loader = new XmlFileLoader(__DIR__.'/constraint-mapping.xml'); + $metadata = new ClassMetadata('\stdClass'); + + $this->assertFalse($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadata() + { + $loader = new XmlFileLoader(__DIR__.'/constraint-mapping.xml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $loader->loadClassMetadata($metadata); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + $expected->setGroupSequence(array('Foo', 'Entity')); + $expected->addConstraint(new ConstraintA()); + $expected->addConstraint(new ConstraintB()); + $expected->addConstraint(new Callback('validateMe')); + $expected->addConstraint(new Callback('validateMeStatic')); + $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback'))); + $expected->addConstraint(new Traverse(false)); + $expected->addPropertyConstraint('firstName', new NotNull()); + $expected->addPropertyConstraint('firstName', new Range(array('min' => 3))); + $expected->addPropertyConstraint('firstName', new Choice(array('A', 'B'))); + $expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3))))); + $expected->addPropertyConstraint('firstName', new All(array('constraints' => array(new NotNull(), new Range(array('min' => 3)))))); + $expected->addPropertyConstraint('firstName', new Collection(array('fields' => array( + 'foo' => array(new NotNull(), new Range(array('min' => 3))), + 'bar' => array(new Range(array('min' => 5))), + )))); + $expected->addPropertyConstraint('firstName', new Choice(array( + 'message' => 'Must be one of %choices%', + 'choices' => array('A', 'B'), + ))); + $expected->addGetterConstraint('lastName', new NotNull()); + $expected->addGetterConstraint('valid', new IsTrue()); + $expected->addGetterConstraint('permissions', new IsTrue()); + + $this->assertEquals($expected, $metadata); + } + + public function testLoadClassMetadataWithNonStrings() + { + $loader = new XmlFileLoader(__DIR__.'/constraint-mapping-non-strings.xml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $loader->loadClassMetadata($metadata); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + $expected->addPropertyConstraint('firstName', new Regex(array('pattern' => '/^1/', 'match' => false))); + + $properties = $metadata->getPropertyMetadata('firstName'); + $constraints = $properties[0]->getConstraints(); + + $this->assertFalse($constraints[0]->match); + } + + public function testLoadGroupSequenceProvider() + { + $loader = new XmlFileLoader(__DIR__.'/constraint-mapping.xml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity'); + + $loader->loadClassMetadata($metadata); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity'); + $expected->setGroupSequenceProvider(true); + + $this->assertEquals($expected, $metadata); + } + + public function testThrowExceptionIfDocTypeIsSet() + { + $loader = new XmlFileLoader(__DIR__.'/withdoctype.xml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('\Symfony\Component\Validator\Exception\MappingException'); + $loader->loadClassMetadata($metadata); + } + + /** + * @see https://github.com/symfony/symfony/pull/12158 + */ + public function testDoNotModifyStateIfExceptionIsThrown() + { + $loader = new XmlFileLoader(__DIR__.'/withdoctype.xml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + try { + $loader->loadClassMetadata($metadata); + } catch (MappingException $e) { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('\Symfony\Component\Validator\Exception\MappingException'); + $loader->loadClassMetadata($metadata); + } + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/YamlFileLoaderTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/YamlFileLoaderTest.php new file mode 100644 index 00000000000..680c2cce0a6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/YamlFileLoaderTest.php @@ -0,0 +1,139 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping\Loader; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\All; +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Choice; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\IsTrue; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Range; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Mapping\Loader\YamlFileLoader; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; + +class YamlFileLoaderTest extends TestCase +{ + public function testLoadClassMetadataReturnsFalseIfEmpty() + { + $loader = new YamlFileLoader(__DIR__.'/empty-mapping.yml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $this->assertFalse($loader->loadClassMetadata($metadata)); + + $r = new \ReflectionProperty($loader, 'classes'); + $r->setAccessible(true); + $this->assertSame(array(), $r->getValue($loader)); + } + + /** + * @dataProvider provideInvalidYamlFiles + * @expectedException \InvalidArgumentException + */ + public function testInvalidYamlFiles($path) + { + $loader = new YamlFileLoader(__DIR__.'/'.$path); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $loader->loadClassMetadata($metadata); + } + + public function provideInvalidYamlFiles() + { + return array( + array('nonvalid-mapping.yml'), + array('bad-format.yml'), + ); + } + + /** + * @see https://github.com/symfony/symfony/pull/12158 + */ + public function testDoNotModifyStateIfExceptionIsThrown() + { + $loader = new YamlFileLoader(__DIR__.'/nonvalid-mapping.yml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + try { + $loader->loadClassMetadata($metadata); + } catch (\InvalidArgumentException $e) { + // Call again. Again an exception should be thrown + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('\InvalidArgumentException'); + $loader->loadClassMetadata($metadata); + } + } + + public function testLoadClassMetadataReturnsTrueIfSuccessful() + { + $loader = new YamlFileLoader(__DIR__.'/constraint-mapping.yml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $this->assertTrue($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadataReturnsFalseIfNotSuccessful() + { + $loader = new YamlFileLoader(__DIR__.'/constraint-mapping.yml'); + $metadata = new ClassMetadata('\stdClass'); + + $this->assertFalse($loader->loadClassMetadata($metadata)); + } + + public function testLoadClassMetadata() + { + $loader = new YamlFileLoader(__DIR__.'/constraint-mapping.yml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + + $loader->loadClassMetadata($metadata); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\Entity'); + $expected->setGroupSequence(array('Foo', 'Entity')); + $expected->addConstraint(new ConstraintA()); + $expected->addConstraint(new ConstraintB()); + $expected->addConstraint(new Callback('validateMe')); + $expected->addConstraint(new Callback('validateMeStatic')); + $expected->addConstraint(new Callback(array('Symfony\Component\Validator\Tests\Fixtures\CallbackClass', 'callback'))); + $expected->addPropertyConstraint('firstName', new NotNull()); + $expected->addPropertyConstraint('firstName', new Range(array('min' => 3))); + $expected->addPropertyConstraint('firstName', new Choice(array('A', 'B'))); + $expected->addPropertyConstraint('firstName', new All(array(new NotNull(), new Range(array('min' => 3))))); + $expected->addPropertyConstraint('firstName', new All(array('constraints' => array(new NotNull(), new Range(array('min' => 3)))))); + $expected->addPropertyConstraint('firstName', new Collection(array('fields' => array( + 'foo' => array(new NotNull(), new Range(array('min' => 3))), + 'bar' => array(new Range(array('min' => 5))), + )))); + $expected->addPropertyConstraint('firstName', new Choice(array( + 'message' => 'Must be one of %choices%', + 'choices' => array('A', 'B'), + ))); + $expected->addGetterConstraint('lastName', new NotNull()); + $expected->addGetterConstraint('valid', new IsTrue()); + $expected->addGetterConstraint('permissions', new IsTrue()); + + $this->assertEquals($expected, $metadata); + } + + public function testLoadGroupSequenceProvider() + { + $loader = new YamlFileLoader(__DIR__.'/constraint-mapping.yml'); + $metadata = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity'); + + $loader->loadClassMetadata($metadata); + + $expected = new ClassMetadata('Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity'); + $expected->setGroupSequenceProvider(true); + + $this->assertEquals($expected, $metadata); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/bad-format.yml b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/bad-format.yml new file mode 100644 index 00000000000..d2b4ad2654d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/bad-format.yml @@ -0,0 +1,9 @@ +namespaces: + custom: Symfony\Component\Validator\Tests\Fixtures\ + +Symfony\Component\Validator\Tests\Fixtures\Entity: + constraints: + # Custom constraint + - Symfony\Component\Validator\Tests\Fixtures\ConstraintA: ~ + # Custom constraint with namespaces prefix + - "custom:ConstraintB": ~ diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping-non-strings.xml b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping-non-strings.xml new file mode 100644 index 00000000000..dfd5edddc5e --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping-non-strings.xml @@ -0,0 +1,19 @@ + + + + + Symfony\Component\Validator\Tests\Fixtures\ + + + + + + + + + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.xml b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.xml new file mode 100644 index 00000000000..b1426cf4a90 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.xml @@ -0,0 +1,124 @@ + + + + + Symfony\Component\Validator\Tests\Fixtures\ + + + + + Foo + Entity + + + + + + + + + + + + validateMe + + validateMeStatic + + + Symfony\Component\Validator\Tests\Fixtures\CallbackClass + callback + + + + + false + + + + + + + + + + + + + + + + + A + B + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.yml b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.yml new file mode 100644 index 00000000000..c39168c96ca --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/constraint-mapping.yml @@ -0,0 +1,62 @@ +namespaces: + custom: Symfony\Component\Validator\Tests\Fixtures\ + +Symfony\Component\Validator\Tests\Fixtures\Entity: + group_sequence: + - Foo + - Entity + + constraints: + # Custom constraint + - Symfony\Component\Validator\Tests\Fixtures\ConstraintA: ~ + # Custom constraint with namespaces prefix + - "custom:ConstraintB": ~ + # Callbacks + - Callback: validateMe + - Callback: validateMeStatic + - Callback: [Symfony\Component\Validator\Tests\Fixtures\CallbackClass, callback] + + properties: + firstName: + # Constraint without value + - NotNull: ~ + # Constraint with single value + - Range: + min: 3 + # Constraint with multiple values + - Choice: [A, B] + # Constraint with child constraints + - All: + - NotNull: ~ + - Range: + min: 3 + # Option with child constraints + - All: + constraints: + - NotNull: ~ + - Range: + min: 3 + # Value with child constraints + - Collection: + fields: + foo: + - NotNull: ~ + - Range: + min: 3 + bar: + - Range: + min: 5 + # Constraint with options + - Choice: { choices: [A, B], message: Must be one of %choices% } + dummy: + + getters: + lastName: + - NotNull: ~ + valid: + - "IsTrue": ~ + permissions: + - "IsTrue": ~ + +Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity: + group_sequence_provider: true diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/empty-mapping.yml b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/empty-mapping.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/nonvalid-mapping.yml b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/nonvalid-mapping.yml new file mode 100644 index 00000000000..257cc5642cb --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/nonvalid-mapping.yml @@ -0,0 +1 @@ +foo diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/withdoctype.xml b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/withdoctype.xml new file mode 100644 index 00000000000..0beacc32cda --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/Loader/withdoctype.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php new file mode 100644 index 00000000000..f0726c863f0 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/MemberMetadataTest.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Mapping\MemberMetadata; +use Symfony\Component\Validator\Tests\Fixtures\ClassConstraint; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; +use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; + +class MemberMetadataTest extends TestCase +{ + protected $metadata; + + protected function setUp() + { + $this->metadata = new TestMemberMetadata( + 'Symfony\Component\Validator\Tests\Fixtures\Entity', + 'getLastName', + 'lastName' + ); + } + + protected function tearDown() + { + $this->metadata = null; + } + + /** + * @group legacy + */ + public function testLegacyAddValidSetsMemberToCascaded() + { + $result = $this->metadata->addConstraint(new Valid()); + + $this->assertEquals(array(), $this->metadata->getConstraints()); + $this->assertEquals($result, $this->metadata); + $this->assertTrue($this->metadata->isCascaded()); + } + + /** + * @group legacy + */ + public function testLegacyAddOtherConstraintDoesNotSetMemberToCascaded() + { + $result = $this->metadata->addConstraint($constraint = new ConstraintA()); + + $this->assertEquals(array($constraint), $this->metadata->getConstraints()); + $this->assertEquals($result, $this->metadata); + $this->assertFalse($this->metadata->isCascaded()); + } + + public function testAddConstraintRequiresClassConstraints() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); + + $this->metadata->addConstraint(new ClassConstraint()); + } + + public function testSerialize() + { + $this->metadata->addConstraint(new ConstraintA(array('property1' => 'A'))); + $this->metadata->addConstraint(new ConstraintB(array('groups' => 'TestGroup'))); + + $metadata = unserialize(serialize($this->metadata)); + + $this->assertEquals($this->metadata, $metadata); + } + + public function testSerializeCollectionCascaded() + { + $this->metadata->addConstraint(new Valid(array('traverse' => true))); + + $metadata = unserialize(serialize($this->metadata)); + + $this->assertEquals($this->metadata, $metadata); + } + + /** + * @group legacy + */ + public function testLegacySerializeCollectionCascadedDeeply() + { + $this->metadata->addConstraint(new Valid(array('traverse' => true))); + + $metadata = unserialize(serialize($this->metadata)); + + $this->assertEquals($this->metadata, $metadata); + } + + public function testSerializeCollectionNotCascaded() + { + $this->metadata->addConstraint(new Valid(array('traverse' => false))); + + $metadata = unserialize(serialize($this->metadata)); + + $this->assertEquals($this->metadata, $metadata); + } +} + +class TestMemberMetadata extends MemberMetadata +{ + public function getPropertyValue($object) + { + } + + protected function newReflectionMember($object) + { + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Mapping/PropertyMetadataTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/PropertyMetadataTest.php new file mode 100644 index 00000000000..9fea435dff2 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Mapping/PropertyMetadataTest.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Mapping; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Mapping\PropertyMetadata; +use Symfony\Component\Validator\Tests\Fixtures\Entity; + +class PropertyMetadataTest extends TestCase +{ + const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity'; + const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent'; + + public function testInvalidPropertyName() + { + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ValidatorException'); + + new PropertyMetadata(self::CLASSNAME, 'foobar'); + } + + public function testGetPropertyValueFromPrivateProperty() + { + $entity = new Entity('foobar'); + $metadata = new PropertyMetadata(self::CLASSNAME, 'internal'); + + $this->assertEquals('foobar', $metadata->getPropertyValue($entity)); + } + + public function testGetPropertyValueFromOverriddenPrivateProperty() + { + $entity = new Entity('foobar'); + $metadata = new PropertyMetadata(self::PARENTCLASS, 'data'); + + $this->assertTrue($metadata->isPublic($entity)); + $this->assertEquals('Overridden data', $metadata->getPropertyValue($entity)); + } + + public function testGetPropertyValueFromRemovedProperty() + { + $entity = new Entity('foobar'); + $metadata = new PropertyMetadata(self::CLASSNAME, 'internal'); + $metadata->name = 'test'; + + $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ValidatorException'); + $metadata->getPropertyValue($entity); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Resources/TranslationFilesTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Resources/TranslationFilesTest.php new file mode 100644 index 00000000000..64b3f78934f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Resources/TranslationFilesTest.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Resources; + +use PHPUnit\Framework\TestCase; + +class TranslationFilesTest extends TestCase +{ + /** + * @dataProvider provideTranslationFiles + */ + public function testTranslationFileIsValid($filePath) + { + if (class_exists('PHPUnit_Util_XML')) { + \PHPUnit_Util_XML::loadfile($filePath, false, false, true); + } else { + \PHPUnit\Util\XML::loadfile($filePath, false, false, true); + } + + $this->addToAssertionCount(1); + } + + public function provideTranslationFiles() + { + return array_map( + function ($filePath) { return (array) $filePath; }, + glob(\dirname(\dirname(__DIR__)).'/Resources/translations/*.xlf') + ); + } + + public function testNorwegianAlias() + { + $this->assertFileEquals( + \dirname(\dirname(__DIR__)).'/Resources/translations/validators.nb.xlf', + \dirname(\dirname(__DIR__)).'/Resources/translations/validators.no.xlf', + 'The NO locale should be an alias for the NB variant of the Norwegian language.' + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Util/PropertyPathTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Util/PropertyPathTest.php new file mode 100644 index 00000000000..235e1780d90 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Util/PropertyPathTest.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Util; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Util\PropertyPath; + +class PropertyPathTest extends TestCase +{ + /** + * @dataProvider provideAppendPaths + */ + public function testAppend($basePath, $subPath, $expectedPath, $message) + { + $this->assertSame($expectedPath, PropertyPath::append($basePath, $subPath), $message); + } + + public function provideAppendPaths() + { + return array( + array('foo', '', 'foo', 'It returns the basePath if subPath is empty'), + array('', 'bar', 'bar', 'It returns the subPath if basePath is empty'), + array('foo', 'bar', 'foo.bar', 'It append the subPath to the basePath'), + array('foo', '[bar]', 'foo[bar]', 'It does not include the dot separator if subPath uses the array notation'), + array('0', 'bar', '0.bar', 'Leading zeros are kept.'), + ); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php new file mode 100644 index 00000000000..0394431a4ea --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php @@ -0,0 +1,742 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Validator; + +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\Expression; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Traverse; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\ConstraintViolationInterface; +use Symfony\Component\Validator\Context\ExecutionContextInterface; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Tests\Fixtures\Entity; +use Symfony\Component\Validator\Tests\Fixtures\FailingConstraint; +use Symfony\Component\Validator\Tests\Fixtures\FakeClassMetadata; +use Symfony\Component\Validator\Tests\Fixtures\Reference; +use Symfony\Component\Validator\Validator\ValidatorInterface; + +/** + * Verifies that a validator satisfies the API of Symfony 2.5+. + * + * @author Bernhard Schussek + */ +abstract class Abstract2Dot5ApiTest extends AbstractValidatorTest +{ + /** + * @var ValidatorInterface + */ + protected $validator; + + /** + * @return ValidatorInterface + */ + abstract protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()); + + protected function setUp() + { + parent::setUp(); + + $this->validator = $this->createValidator($this->metadataFactory); + } + + protected function validate($value, $constraints = null, $groups = null) + { + return $this->validator->validate($value, $constraints, $groups); + } + + protected function validateProperty($object, $propertyName, $groups = null) + { + return $this->validator->validateProperty($object, $propertyName, $groups); + } + + protected function validatePropertyValue($object, $propertyName, $value, $groups = null) + { + return $this->validator->validatePropertyValue($object, $propertyName, $value, $groups); + } + + public function testValidateConstraintWithoutGroup() + { + $violations = $this->validator->validate(null, new NotNull()); + + $this->assertCount(1, $violations); + } + + public function testValidateWithEmptyArrayAsConstraint() + { + $violations = $this->validator->validate('value', array()); + $this->assertCount(0, $violations); + } + + public function testGroupSequenceAbortsAfterFailedGroup() + { + $entity = new Entity(); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message 1'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message 2'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => function () {}, + 'groups' => 'Group 1', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group 2', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 3', + ))); + + $sequence = new GroupSequence(array('Group 1', 'Group 2', 'Group 3')); + $violations = $this->validator->validate($entity, new Valid(), $sequence); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message 1', $violations[0]->getMessage()); + } + + public function testGroupSequenceIncludesReferences() + { + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Reference violation 1'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Reference violation 2'); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group 1', + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 2', + ))); + + $sequence = new GroupSequence(array('Group 1', 'Entity')); + $violations = $this->validator->validate($entity, new Valid(), $sequence); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Reference violation 1', $violations[0]->getMessage()); + } + + public function testValidateInSeparateContext() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $violations = $context + ->getValidator() + // Since the validator is not context aware, the group must + // be passed explicitly + ->validate($value->reference, new Valid(), 'Group') + ; + + /* @var ConstraintViolationInterface[] $violations */ + $test->assertCount(1, $violations); + $test->assertSame('Message value', $violations[0]->getMessage()); + $test->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $test->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $test->assertSame('', $violations[0]->getPropertyPath()); + // The root is different as we're in a new context + $test->assertSame($entity->reference, $violations[0]->getRoot()); + $test->assertSame($entity->reference, $violations[0]->getInvalidValue()); + $test->assertNull($violations[0]->getPlural()); + $test->assertNull($violations[0]->getCode()); + + // Verify that this method is called + $context->addViolation('Separate violation'); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity->reference, $context->getRoot()); + $test->assertSame($entity->reference, $context->getValue()); + $test->assertSame($entity->reference, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validator->validate($entity, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $test->assertSame('Separate violation', $violations[0]->getMessage()); + } + + public function testValidateInContext() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test) { + $previousValue = $context->getValue(); + $previousObject = $context->getObject(); + $previousMetadata = $context->getMetadata(); + $previousPath = $context->getPropertyPath(); + $previousGroup = $context->getGroup(); + + $context + ->getValidator() + ->inContext($context) + ->atPath('subpath') + ->validate($value->reference) + ; + + // context changes shouldn't leak out of the validate() call + $test->assertSame($previousValue, $context->getValue()); + $test->assertSame($previousObject, $context->getObject()); + $test->assertSame($previousMetadata, $context->getMetadata()); + $test->assertSame($previousPath, $context->getPropertyPath()); + $test->assertSame($previousGroup, $context->getGroup()); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('subpath', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference, $context->getValue()); + $test->assertSame($entity->reference, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validator->validate($entity, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('subpath', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testValidateArrayInContext() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test) { + $previousValue = $context->getValue(); + $previousObject = $context->getObject(); + $previousMetadata = $context->getMetadata(); + $previousPath = $context->getPropertyPath(); + $previousGroup = $context->getGroup(); + + $context + ->getValidator() + ->inContext($context) + ->atPath('subpath') + ->validate(array('key' => $value->reference)) + ; + + // context changes shouldn't leak out of the validate() call + $test->assertSame($previousValue, $context->getValue()); + $test->assertSame($previousObject, $context->getObject()); + $test->assertSame($previousMetadata, $context->getMetadata()); + $test->assertSame($previousPath, $context->getPropertyPath()); + $test->assertSame($previousGroup, $context->getGroup()); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('subpath[key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference, $context->getValue()); + $test->assertSame($entity->reference, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validator->validate($entity, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('subpath[key]', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testTraverseTraversableByDefault() + { + $test = $this; + $entity = new Entity(); + $traversable = new \ArrayIterator(array('key' => $entity)); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity, $traversable) { + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('[key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->metadata, $context->getMetadata()); + $test->assertSame($traversable, $context->getRoot()); + $test->assertSame($entity, $context->getValue()); + $test->assertSame($entity, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadataFactory->addMetadata(new ClassMetadata('ArrayIterator')); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($traversable, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('[key]', $violations[0]->getPropertyPath()); + $this->assertSame($traversable, $violations[0]->getRoot()); + $this->assertSame($entity, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testTraversalEnabledOnClass() + { + $entity = new Entity(); + $traversable = new \ArrayIterator(array('key' => $entity)); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message'); + }; + + $traversableMetadata = new ClassMetadata('ArrayIterator'); + $traversableMetadata->addConstraint(new Traverse(true)); + + $this->metadataFactory->addMetadata($traversableMetadata); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($traversable, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + } + + public function testTraversalDisabledOnClass() + { + $test = $this; + $entity = new Entity(); + $traversable = new \ArrayIterator(array('key' => $entity)); + + $callback = function ($value, ExecutionContextInterface $context) use ($test) { + $test->fail('Should not be called'); + }; + + $traversableMetadata = new ClassMetadata('ArrayIterator'); + $traversableMetadata->addConstraint(new Traverse(false)); + + $this->metadataFactory->addMetadata($traversableMetadata); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($traversable, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException + */ + public function testExpectTraversableIfTraversalEnabledOnClass() + { + $entity = new Entity(); + + $this->metadata->addConstraint(new Traverse(true)); + + $this->validator->validate($entity); + } + + public function testReferenceTraversalDisabledOnClass() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new \ArrayIterator(array('key' => new Reference())); + + $callback = function ($value, ExecutionContextInterface $context) use ($test) { + $test->fail('Should not be called'); + }; + + $traversableMetadata = new ClassMetadata('ArrayIterator'); + $traversableMetadata->addConstraint(new Traverse(false)); + + $this->metadataFactory->addMetadata($traversableMetadata); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + $this->metadata->addPropertyConstraint('reference', new Valid()); + + $violations = $this->validate($entity, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + public function testReferenceTraversalEnabledOnReferenceDisabledOnClass() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new \ArrayIterator(array('key' => new Reference())); + + $callback = function ($value, ExecutionContextInterface $context) use ($test) { + $test->fail('Should not be called'); + }; + + $traversableMetadata = new ClassMetadata('ArrayIterator'); + $traversableMetadata->addConstraint(new Traverse(false)); + + $this->metadataFactory->addMetadata($traversableMetadata); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + $this->metadata->addPropertyConstraint('reference', new Valid(array( + 'traverse' => true, + ))); + + $violations = $this->validate($entity, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + public function testReferenceTraversalDisabledOnReferenceEnabledOnClass() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new \ArrayIterator(array('key' => new Reference())); + + $callback = function ($value, ExecutionContextInterface $context) use ($test) { + $test->fail('Should not be called'); + }; + + $traversableMetadata = new ClassMetadata('ArrayIterator'); + $traversableMetadata->addConstraint(new Traverse(true)); + + $this->metadataFactory->addMetadata($traversableMetadata); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + $this->metadata->addPropertyConstraint('reference', new Valid(array( + 'traverse' => false, + ))); + + $violations = $this->validate($entity, new Valid(), 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + public function testAddCustomizedViolation() + { + $entity = new Entity(); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->buildViolation('Message %param%') + ->setParameter('%param%', 'value') + ->setInvalidValue('Invalid value') + ->setPlural(2) + ->setCode(42) + ->addViolation(); + }; + + $this->metadata->addConstraint(new Callback($callback)); + + $violations = $this->validator->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Invalid value', $violations[0]->getInvalidValue()); + $this->assertSame(2, $violations[0]->getPlural()); + $this->assertSame(42, $violations[0]->getCode()); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnsupportedMetadataException + * @group legacy + */ + public function testMetadataMustImplementClassMetadataInterface() + { + $entity = new Entity(); + + $metadata = $this->getMockBuilder('Symfony\Component\Validator\Tests\Fixtures\LegacyClassMetadata')->getMock(); + $metadata->expects($this->any()) + ->method('getClassName') + ->will($this->returnValue(\get_class($entity))); + + $this->metadataFactory->addMetadata($metadata); + + $this->validator->validate($entity); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnsupportedMetadataException + * @group legacy + */ + public function testReferenceMetadataMustImplementClassMetadataInterface() + { + $entity = new Entity(); + $entity->reference = new Reference(); + + $metadata = $this->getMockBuilder('Symfony\Component\Validator\Tests\Fixtures\LegacyClassMetadata')->getMock(); + $metadata->expects($this->any()) + ->method('getClassName') + ->will($this->returnValue(\get_class($entity->reference))); + + $this->metadataFactory->addMetadata($metadata); + + $this->metadata->addPropertyConstraint('reference', new Valid()); + + $this->validator->validate($entity); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\UnsupportedMetadataException + * @group legacy + */ + public function testLegacyPropertyMetadataMustImplementPropertyMetadataInterface() + { + $entity = new Entity(); + + // Legacy interface + $propertyMetadata = $this->getMockBuilder('Symfony\Component\Validator\MetadataInterface')->getMock(); + $metadata = new FakeClassMetadata(\get_class($entity)); + $metadata->addCustomPropertyMetadata('firstName', $propertyMetadata); + + $this->metadataFactory->addMetadata($metadata); + + $this->validator->validate($entity); + } + + public function testNoDuplicateValidationIfClassConstraintInMultipleGroups() + { + $entity = new Entity(); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => array('Group 1', 'Group 2'), + ))); + + $violations = $this->validator->validate($entity, new Valid(), array('Group 1', 'Group 2')); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + } + + public function testNoDuplicateValidationIfPropertyConstraintInMultipleGroups() + { + $entity = new Entity(); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message'); + }; + + $this->metadata->addPropertyConstraint('firstName', new Callback(array( + 'callback' => $callback, + 'groups' => array('Group 1', 'Group 2'), + ))); + + $violations = $this->validator->validate($entity, new Valid(), array('Group 1', 'Group 2')); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\RuntimeException + */ + public function testValidateFailsIfNoConstraintsAndNoObjectOrArray() + { + $this->validate('Foobar'); + } + + public function testAccessCurrentObject() + { + $test = $this; + $called = false; + $entity = new Entity(); + $entity->firstName = 'Bernhard'; + $entity->data = array('firstName' => 'Bernhard'); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity, &$called) { + $called = true; + $test->assertSame($entity, $context->getObject()); + }; + + $this->metadata->addConstraint(new Callback($callback)); + $this->metadata->addPropertyConstraint('firstName', new Callback($callback)); + $this->metadata->addPropertyConstraint('data', new Collection(array('firstName' => new Expression('value == this.firstName')))); + + $this->validator->validate($entity); + + $this->assertTrue($called); + } + + public function testInitializeObjectsOnFirstValidation() + { + $test = $this; + $entity = new Entity(); + $entity->initialized = false; + + // prepare initializers that set "initialized" to true + $initializer1 = $this->getMockBuilder('Symfony\\Component\\Validator\\ObjectInitializerInterface')->getMock(); + $initializer2 = $this->getMockBuilder('Symfony\\Component\\Validator\\ObjectInitializerInterface')->getMock(); + + $initializer1->expects($this->once()) + ->method('initialize') + ->with($entity) + ->will($this->returnCallback(function ($object) { + $object->initialized = true; + })); + + $initializer2->expects($this->once()) + ->method('initialize') + ->with($entity); + + $this->validator = $this->createValidator($this->metadataFactory, array( + $initializer1, + $initializer2, + )); + + // prepare constraint which + // * checks that "initialized" is set to true + // * validates the object again + $callback = function ($object, ExecutionContextInterface $context) use ($test) { + $test->assertTrue($object->initialized); + + // validate again in same group + $validator = $context->getValidator()->inContext($context); + + $validator->validate($object); + + // validate again in other group + $validator->validate($object, null, 'SomeGroup'); + }; + + $this->metadata->addConstraint(new Callback($callback)); + + $this->validate($entity); + + $this->assertTrue($entity->initialized); + } + + public function testPassConstraintToViolation() + { + $constraint = new FailingConstraint(); + $violations = $this->validate('Foobar', $constraint); + + $this->assertCount(1, $violations); + $this->assertSame($constraint, $violations[0]->getConstraint()); + } + + public function testCollectionConstraitViolationHasCorrectContext() + { + $data = array( + 'foo' => 'fooValue', + ); + + // Missing field must not be the first in the collection validation + $constraint = new Collection(array( + 'foo' => new NotNull(), + 'bar' => new NotNull(), + )); + + $violations = $this->validate($data, $constraint); + + $this->assertCount(1, $violations); + $this->assertSame($constraint, $violations[0]->getConstraint()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php new file mode 100644 index 00000000000..47346324b88 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php @@ -0,0 +1,313 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Validator; + +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\ConstraintViolationInterface; +use Symfony\Component\Validator\ExecutionContextInterface; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Tests\Fixtures\Entity; +use Symfony\Component\Validator\Tests\Fixtures\Reference; +use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface; + +/** + * Verifies that a validator satisfies the API of Symfony < 2.5. + * + * @author Bernhard Schussek + * @group legacy + */ +abstract class AbstractLegacyApiTest extends AbstractValidatorTest +{ + /** + * @var LegacyValidatorInterface + */ + protected $validator; + + /** + * @param MetadataFactoryInterface $metadataFactory + * + * @return LegacyValidatorInterface + */ + abstract protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()); + + protected function setUp() + { + parent::setUp(); + + $this->validator = $this->createValidator($this->metadataFactory); + } + + protected function validate($value, $constraints = null, $groups = null) + { + if (null === $constraints) { + $constraints = new Valid(); + } + + if ($constraints instanceof Valid) { + return $this->validator->validate($value, $groups, $constraints->traverse, $constraints->deep); + } + + return $this->validator->validateValue($value, $constraints, $groups); + } + + protected function validateProperty($object, $propertyName, $groups = null) + { + return $this->validator->validateProperty($object, $propertyName, $groups); + } + + protected function validatePropertyValue($object, $propertyName, $value, $groups = null) + { + return $this->validator->validatePropertyValue($object, $propertyName, $value, $groups); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException + */ + public function testTraversableTraverseDisabled() + { + $test = $this; + $entity = new Entity(); + $traversable = new \ArrayIterator(array('key' => $entity)); + + $callback = function () use ($test) { + $test->fail('Should not be called'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $this->validator->validate($traversable, 'Group'); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException + */ + public function testRecursiveTraversableRecursiveTraversalDisabled() + { + $test = $this; + $entity = new Entity(); + $traversable = new \ArrayIterator(array( + 2 => new \ArrayIterator(array('key' => $entity)), + )); + + $callback = function () use ($test) { + $test->fail('Should not be called'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $this->validator->validate($traversable, 'Group'); + } + + public function testValidateInContext() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test) { + $previousValue = $context->getValue(); + $previousMetadata = $context->getMetadata(); + $previousPath = $context->getPropertyPath(); + $previousGroup = $context->getGroup(); + + $context->validate($value->reference, 'subpath'); + + // context changes shouldn't leak out of the validate() call + $test->assertSame($previousValue, $context->getValue()); + $test->assertSame($previousMetadata, $context->getMetadata()); + $test->assertSame($previousPath, $context->getPropertyPath()); + $test->assertSame($previousGroup, $context->getGroup()); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('subpath', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($test->metadataFactory, $context->getMetadataFactory()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference, $context->getValue()); + $test->assertSame($entity->reference, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validator->validate($entity, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('subpath', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testValidateArrayInContext() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test) { + $previousValue = $context->getValue(); + $previousMetadata = $context->getMetadata(); + $previousPath = $context->getPropertyPath(); + $previousGroup = $context->getGroup(); + + $context->validate(array('key' => $value->reference), 'subpath'); + + // context changes shouldn't leak out of the validate() call + $test->assertSame($previousValue, $context->getValue()); + $test->assertSame($previousMetadata, $context->getMetadata()); + $test->assertSame($previousPath, $context->getPropertyPath()); + $test->assertSame($previousGroup, $context->getGroup()); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('subpath[key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($test->metadataFactory, $context->getMetadataFactory()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference, $context->getValue()); + $test->assertSame($entity->reference, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validator->validate($entity, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('subpath[key]', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testAddCustomizedViolation() + { + $entity = new Entity(); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation( + 'Message %param%', + array('%param%' => 'value'), + 'Invalid value', + 2, + 'Code' + ); + }; + + $this->metadata->addConstraint(new Callback($callback)); + + $violations = $this->validator->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Invalid value', $violations[0]->getInvalidValue()); + $this->assertSame(2, $violations[0]->getPlural()); + $this->assertSame('Code', $violations[0]->getCode()); + } + + public function testInitializeObjectsOnFirstValidation() + { + $test = $this; + $entity = new Entity(); + $entity->initialized = false; + + // prepare initializers that set "initialized" to true + $initializer1 = $this->getMockBuilder('Symfony\\Component\\Validator\\ObjectInitializerInterface')->getMock(); + $initializer2 = $this->getMockBuilder('Symfony\\Component\\Validator\\ObjectInitializerInterface')->getMock(); + + $initializer1->expects($this->once()) + ->method('initialize') + ->with($entity) + ->will($this->returnCallback(function ($object) { + $object->initialized = true; + })); + + $initializer2->expects($this->once()) + ->method('initialize') + ->with($entity); + + $this->validator = $this->createValidator($this->metadataFactory, array( + $initializer1, + $initializer2, + )); + + // prepare constraint which + // * checks that "initialized" is set to true + // * validates the object again + $callback = function ($object, ExecutionContextInterface $context) use ($test) { + $test->assertTrue($object->initialized); + + // validate again in same group + $context->validate($object); + + // validate again in other group + $context->validate($object, '', 'SomeGroup'); + }; + + $this->metadata->addConstraint(new Callback($callback)); + + $this->validate($entity); + + $this->assertTrue($entity->initialized); + } + + public function testGetMetadataFactory() + { + $this->assertSame($this->metadataFactory, $this->validator->getMetadataFactory()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php new file mode 100644 index 00000000000..8dd9adc87e1 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php @@ -0,0 +1,1284 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Validator; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\Constraints\Callback; +use Symfony\Component\Validator\Constraints\GroupSequence; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\ConstraintViolationInterface; +use Symfony\Component\Validator\ExecutionContextInterface; +use Symfony\Component\Validator\Mapping\ClassMetadata; +use Symfony\Component\Validator\Tests\Fixtures\Entity; +use Symfony\Component\Validator\Tests\Fixtures\FakeMetadataFactory; +use Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity; +use Symfony\Component\Validator\Tests\Fixtures\Reference; + +/** + * @author Bernhard Schussek + */ +abstract class AbstractValidatorTest extends TestCase +{ + const ENTITY_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\Entity'; + + const REFERENCE_CLASS = 'Symfony\Component\Validator\Tests\Fixtures\Reference'; + + /** + * @var FakeMetadataFactory + */ + public $metadataFactory; + + /** + * @var ClassMetadata + */ + public $metadata; + + /** + * @var ClassMetadata + */ + public $referenceMetadata; + + protected function setUp() + { + $this->metadataFactory = new FakeMetadataFactory(); + $this->metadata = new ClassMetadata(self::ENTITY_CLASS); + $this->referenceMetadata = new ClassMetadata(self::REFERENCE_CLASS); + $this->metadataFactory->addMetadata($this->metadata); + $this->metadataFactory->addMetadata($this->referenceMetadata); + } + + protected function tearDown() + { + $this->metadataFactory = null; + $this->metadata = null; + $this->referenceMetadata = null; + } + + abstract protected function validate($value, $constraints = null, $groups = null); + + abstract protected function validateProperty($object, $propertyName, $groups = null); + + abstract protected function validatePropertyValue($object, $propertyName, $value, $groups = null); + + public function testValidate() + { + $test = $this; + + $callback = function ($value, ExecutionContextInterface $context) use ($test) { + $test->assertNull($context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame('Bernhard', $context->getRoot()); + $test->assertSame('Bernhard', $context->getValue()); + $test->assertSame('Bernhard', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $constraint = new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + )); + + $violations = $this->validate('Bernhard', $constraint, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('', $violations[0]->getPropertyPath()); + $this->assertSame('Bernhard', $violations[0]->getRoot()); + $this->assertSame('Bernhard', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testClassConstraint() + { + $test = $this; + $entity = new Entity(); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->metadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity, $context->getValue()); + $test->assertSame($entity, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testPropertyConstraint() + { + $test = $this; + $entity = new Entity(); + $entity->firstName = 'Bernhard'; + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $propertyMetadatas = $test->metadata->getPropertyMetadata('firstName'); + + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertSame('firstName', $context->getPropertyName()); + $test->assertSame('firstName', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($propertyMetadatas[0], $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame('Bernhard', $context->getValue()); + $test->assertSame('Bernhard', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('firstName', new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('firstName', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Bernhard', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testGetterConstraint() + { + $test = $this; + $entity = new Entity(); + $entity->setLastName('Schussek'); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $propertyMetadatas = $test->metadata->getPropertyMetadata('lastName'); + + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertSame('lastName', $context->getPropertyName()); + $test->assertSame('lastName', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($propertyMetadatas[0], $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame('Schussek', $context->getValue()); + $test->assertSame('Schussek', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addGetterConstraint('lastName', new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('lastName', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Schussek', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testArray() + { + $test = $this; + $entity = new Entity(); + $array = array('key' => $entity); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity, $array) { + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('[key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->metadata, $context->getMetadata()); + $test->assertSame($array, $context->getRoot()); + $test->assertSame($entity, $context->getValue()); + $test->assertSame($entity, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($array, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('[key]', $violations[0]->getPropertyPath()); + $this->assertSame($array, $violations[0]->getRoot()); + $this->assertSame($entity, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testRecursiveArray() + { + $test = $this; + $entity = new Entity(); + $array = array(2 => array('key' => $entity)); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity, $array) { + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('[2][key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->metadata, $context->getMetadata()); + $test->assertSame($array, $context->getRoot()); + $test->assertSame($entity, $context->getValue()); + $test->assertSame($entity, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($array, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('[2][key]', $violations[0]->getPropertyPath()); + $this->assertSame($array, $violations[0]->getRoot()); + $this->assertSame($entity, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testTraversable() + { + $test = $this; + $entity = new Entity(); + $traversable = new \ArrayIterator(array('key' => $entity)); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity, $traversable) { + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('[key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->metadata, $context->getMetadata()); + $test->assertSame($traversable, $context->getRoot()); + $test->assertSame($entity, $context->getValue()); + $test->assertSame($entity, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($traversable, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('[key]', $violations[0]->getPropertyPath()); + $this->assertSame($traversable, $violations[0]->getRoot()); + $this->assertSame($entity, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testRecursiveTraversable() + { + $test = $this; + $entity = new Entity(); + $traversable = new \ArrayIterator(array( + 2 => new \ArrayIterator(array('key' => $entity)), + )); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity, $traversable) { + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('[2][key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->metadata, $context->getMetadata()); + $test->assertSame($traversable, $context->getRoot()); + $test->assertSame($entity, $context->getValue()); + $test->assertSame($entity, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($traversable, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('[2][key]', $violations[0]->getPropertyPath()); + $this->assertSame($traversable, $violations[0]->getRoot()); + $this->assertSame($entity, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testReferenceClassConstraint() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('reference', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference, $context->getValue()); + $test->assertSame($entity->reference, $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('reference', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference, $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testReferencePropertyConstraint() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + $entity->reference->value = 'Foobar'; + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $propertyMetadatas = $test->referenceMetadata->getPropertyMetadata('value'); + + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertSame('value', $context->getPropertyName()); + $test->assertSame('reference.value', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($propertyMetadatas[0], $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame('Foobar', $context->getValue()); + $test->assertSame('Foobar', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addPropertyConstraint('value', new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('reference.value', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Foobar', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testReferenceGetterConstraint() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new Reference(); + $entity->reference->setPrivateValue('Bamboo'); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $propertyMetadatas = $test->referenceMetadata->getPropertyMetadata('privateValue'); + + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertSame('privateValue', $context->getPropertyName()); + $test->assertSame('reference.privateValue', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($propertyMetadatas[0], $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame('Bamboo', $context->getValue()); + $test->assertSame('Bamboo', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addPropertyConstraint('privateValue', new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('reference.privateValue', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Bamboo', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testsIgnoreNullReference() + { + $entity = new Entity(); + $entity->reference = null; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException + */ + public function testFailOnScalarReferences() + { + $entity = new Entity(); + $entity->reference = 'string'; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + + $this->validate($entity); + } + + public function testArrayReference() + { + $test = $this; + $entity = new Entity(); + $entity->reference = array('key' => new Reference()); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('reference[key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference['key'], $context->getValue()); + $test->assertSame($entity->reference['key'], $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('reference[key]', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference['key'], $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + // https://github.com/symfony/symfony/issues/6246 + public function testRecursiveArrayReference() + { + $test = $this; + $entity = new Entity(); + $entity->reference = array(2 => array('key' => new Reference())); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('reference[2][key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference[2]['key'], $context->getValue()); + $test->assertSame($entity->reference[2]['key'], $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('reference[2][key]', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference[2]['key'], $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testArrayTraversalCannotBeDisabled() + { + $entity = new Entity(); + $entity->reference = array('key' => new Reference()); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid(array( + 'traverse' => false, + ))); + $this->referenceMetadata->addConstraint(new Callback($callback)); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + } + + public function testRecursiveArrayTraversalCannotBeDisabled() + { + $entity = new Entity(); + $entity->reference = array(2 => array('key' => new Reference())); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid(array( + 'traverse' => false, + ))); + $this->referenceMetadata->addConstraint(new Callback($callback)); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + } + + public function testIgnoreScalarsDuringArrayTraversal() + { + $entity = new Entity(); + $entity->reference = array('string', 1234); + + $this->metadata->addPropertyConstraint('reference', new Valid()); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + public function testIgnoreNullDuringArrayTraversal() + { + $entity = new Entity(); + $entity->reference = array(null); + + $this->metadata->addPropertyConstraint('reference', new Valid()); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + public function testTraversableReference() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new \ArrayIterator(array('key' => new Reference())); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('reference[key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference['key'], $context->getValue()); + $test->assertSame($entity->reference['key'], $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('reference[key]', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference['key'], $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testDisableTraversableTraversal() + { + $entity = new Entity(); + $entity->reference = new \ArrayIterator(array('key' => new Reference())); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadataFactory->addMetadata(new ClassMetadata('ArrayIterator')); + $this->metadata->addPropertyConstraint('reference', new Valid(array( + 'traverse' => false, + ))); + $this->referenceMetadata->addConstraint(new Callback($callback)); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(0, $violations); + } + + /** + * @expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException + */ + public function testMetadataMustExistIfTraversalIsDisabled() + { + $entity = new Entity(); + $entity->reference = new \ArrayIterator(); + + $this->metadata->addPropertyConstraint('reference', new Valid(array( + 'traverse' => false, + ))); + + $this->validate($entity); + } + + public function testEnableRecursiveTraversableTraversal() + { + $test = $this; + $entity = new Entity(); + $entity->reference = new \ArrayIterator(array( + 2 => new \ArrayIterator(array('key' => new Reference())), + )); + + $callback = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $test->assertSame($test::REFERENCE_CLASS, $context->getClassName()); + $test->assertNull($context->getPropertyName()); + $test->assertSame('reference[2][key]', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($test->referenceMetadata, $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame($entity->reference[2]['key'], $context->getValue()); + $test->assertSame($entity->reference[2]['key'], $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid(array( + 'traverse' => true, + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group', + ))); + + $violations = $this->validate($entity, null, 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('reference[2][key]', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame($entity->reference[2]['key'], $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testValidateProperty() + { + $test = $this; + $entity = new Entity(); + $entity->firstName = 'Bernhard'; + $entity->setLastName('Schussek'); + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $propertyMetadatas = $test->metadata->getPropertyMetadata('firstName'); + + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertSame('firstName', $context->getPropertyName()); + $test->assertSame('firstName', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($propertyMetadatas[0], $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame('Bernhard', $context->getValue()); + $test->assertSame('Bernhard', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Other violation'); + }; + + $this->metadata->addPropertyConstraint('firstName', new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->metadata->addPropertyConstraint('lastName', new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validateProperty($entity, 'firstName', 'Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('firstName', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Bernhard', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + /** + * Cannot be UnsupportedMetadataException for BC with Symfony < 2.5. + * + * @expectedException \Symfony\Component\Validator\Exception\ValidatorException + * @group legacy + */ + public function testLegacyValidatePropertyFailsIfPropertiesNotSupported() + { + // $metadata does not implement PropertyMetadataContainerInterface + $metadata = $this->getMockBuilder('Symfony\Component\Validator\MetadataInterface')->getMock(); + + $this->metadataFactory->addMetadataForValue('VALUE', $metadata); + + $this->validateProperty('VALUE', 'someProperty'); + } + + /** + * https://github.com/symfony/symfony/issues/11604. + */ + public function testValidatePropertyWithoutConstraints() + { + $entity = new Entity(); + $violations = $this->validateProperty($entity, 'lastName'); + + $this->assertCount(0, $violations, '->validateProperty() returns no violations if no constraints have been configured for the property being validated'); + } + + public function testValidatePropertyValue() + { + $test = $this; + $entity = new Entity(); + $entity->setLastName('Schussek'); + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test, $entity) { + $propertyMetadatas = $test->metadata->getPropertyMetadata('firstName'); + + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertSame('firstName', $context->getPropertyName()); + $test->assertSame('firstName', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($propertyMetadatas[0], $context->getMetadata()); + $test->assertSame($entity, $context->getRoot()); + $test->assertSame('Bernhard', $context->getValue()); + $test->assertSame('Bernhard', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Other violation'); + }; + + $this->metadata->addPropertyConstraint('firstName', new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->metadata->addPropertyConstraint('lastName', new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validatePropertyValue( + $entity, + 'firstName', + 'Bernhard', + 'Group' + ); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('firstName', $violations[0]->getPropertyPath()); + $this->assertSame($entity, $violations[0]->getRoot()); + $this->assertSame('Bernhard', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + public function testValidatePropertyValueWithClassName() + { + $test = $this; + + $callback1 = function ($value, ExecutionContextInterface $context) use ($test) { + $propertyMetadatas = $test->metadata->getPropertyMetadata('firstName'); + + $test->assertSame($test::ENTITY_CLASS, $context->getClassName()); + $test->assertSame('firstName', $context->getPropertyName()); + $test->assertSame('', $context->getPropertyPath()); + $test->assertSame('Group', $context->getGroup()); + $test->assertSame($propertyMetadatas[0], $context->getMetadata()); + $test->assertSame('Bernhard', $context->getRoot()); + $test->assertSame('Bernhard', $context->getValue()); + $test->assertSame('Bernhard', $value); + + $context->addViolation('Message %param%', array('%param%' => 'value')); + }; + + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Other violation'); + }; + + $this->metadata->addPropertyConstraint('firstName', new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group', + ))); + $this->metadata->addPropertyConstraint('lastName', new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group', + ))); + + $violations = $this->validatePropertyValue( + self::ENTITY_CLASS, + 'firstName', + 'Bernhard', + 'Group' + ); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Message value', $violations[0]->getMessage()); + $this->assertSame('Message %param%', $violations[0]->getMessageTemplate()); + $this->assertSame(array('%param%' => 'value'), $violations[0]->getParameters()); + $this->assertSame('', $violations[0]->getPropertyPath()); + $this->assertSame('Bernhard', $violations[0]->getRoot()); + $this->assertSame('Bernhard', $violations[0]->getInvalidValue()); + $this->assertNull($violations[0]->getPlural()); + $this->assertNull($violations[0]->getCode()); + } + + /** + * Cannot be UnsupportedMetadataException for BC with Symfony < 2.5. + * + * @expectedException \Symfony\Component\Validator\Exception\ValidatorException + * @group legacy + */ + public function testLegacyValidatePropertyValueFailsIfPropertiesNotSupported() + { + // $metadata does not implement PropertyMetadataContainerInterface + $metadata = $this->getMockBuilder('Symfony\Component\Validator\MetadataInterface')->getMock(); + + $this->metadataFactory->addMetadataForValue('VALUE', $metadata); + + $this->validatePropertyValue('VALUE', 'someProperty', 'someValue'); + } + + /** + * https://github.com/symfony/symfony/issues/11604. + */ + public function testValidatePropertyValueWithoutConstraints() + { + $entity = new Entity(); + $violations = $this->validatePropertyValue($entity, 'lastName', 'foo'); + + $this->assertCount(0, $violations, '->validatePropertyValue() returns no violations if no constraints have been configured for the property being validated'); + } + + public function testValidateObjectOnlyOncePerGroup() + { + $entity = new Entity(); + $entity->reference = new Reference(); + $entity->reference2 = $entity->reference; + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message'); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->metadata->addPropertyConstraint('reference2', new Valid()); + $this->referenceMetadata->addConstraint(new Callback($callback)); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + } + + public function testValidateDifferentObjectsSeparately() + { + $entity = new Entity(); + $entity->reference = new Reference(); + $entity->reference2 = new Reference(); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message'); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->metadata->addPropertyConstraint('reference2', new Valid()); + $this->referenceMetadata->addConstraint(new Callback($callback)); + + $violations = $this->validate($entity); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(2, $violations); + } + + public function testValidateSingleGroup() + { + $entity = new Entity(); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group 1', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group 2', + ))); + + $violations = $this->validate($entity, null, 'Group 2'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + } + + public function testValidateMultipleGroups() + { + $entity = new Entity(); + + $callback = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Message'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group 1', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback, + 'groups' => 'Group 2', + ))); + + $violations = $this->validate($entity, null, array('Group 1', 'Group 2')); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(2, $violations); + } + + public function testReplaceDefaultGroupByGroupSequenceObject() + { + $entity = new Entity(); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 2'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 3'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => function () {}, + 'groups' => 'Group 1', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group 2', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 3', + ))); + + $sequence = new GroupSequence(array('Group 1', 'Group 2', 'Group 3', 'Entity')); + $this->metadata->setGroupSequence($sequence); + + $violations = $this->validate($entity, null, 'Default'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Violation in Group 2', $violations[0]->getMessage()); + } + + public function testReplaceDefaultGroupByGroupSequenceArray() + { + $entity = new Entity(); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 2'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 3'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => function () {}, + 'groups' => 'Group 1', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group 2', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 3', + ))); + + $sequence = array('Group 1', 'Group 2', 'Group 3', 'Entity'); + $this->metadata->setGroupSequence($sequence); + + $violations = $this->validate($entity, null, 'Default'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Violation in Group 2', $violations[0]->getMessage()); + } + + public function testPropagateDefaultGroupToReferenceWhenReplacingDefaultGroup() + { + $entity = new Entity(); + $entity->reference = new Reference(); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Default group'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in group sequence'); + }; + + $this->metadata->addPropertyConstraint('reference', new Valid()); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Default', + ))); + $this->referenceMetadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 1', + ))); + + $sequence = new GroupSequence(array('Group 1', 'Entity')); + $this->metadata->setGroupSequence($sequence); + + $violations = $this->validate($entity, null, 'Default'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Violation in Default group', $violations[0]->getMessage()); + } + + public function testValidateCustomGroupWhenDefaultGroupWasReplaced() + { + $entity = new Entity(); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in other group'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in group sequence'); + }; + + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Other Group', + ))); + $this->metadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 1', + ))); + + $sequence = new GroupSequence(array('Group 1', 'Entity')); + $this->metadata->setGroupSequence($sequence); + + $violations = $this->validate($entity, null, 'Other Group'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Violation in other group', $violations[0]->getMessage()); + } + + public function testReplaceDefaultGroupWithObjectFromGroupSequenceProvider() + { + $sequence = new GroupSequence(array('Group 1', 'Group 2', 'Group 3', 'Entity')); + $entity = new GroupSequenceProviderEntity($sequence); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 2'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 3'); + }; + + $metadata = new ClassMetadata(\get_class($entity)); + $metadata->addConstraint(new Callback(array( + 'callback' => function () {}, + 'groups' => 'Group 1', + ))); + $metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group 2', + ))); + $metadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 3', + ))); + $metadata->setGroupSequenceProvider(true); + + $this->metadataFactory->addMetadata($metadata); + + $violations = $this->validate($entity, null, 'Default'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Violation in Group 2', $violations[0]->getMessage()); + } + + public function testReplaceDefaultGroupWithArrayFromGroupSequenceProvider() + { + $sequence = array('Group 1', 'Group 2', 'Group 3', 'Entity'); + $entity = new GroupSequenceProviderEntity($sequence); + + $callback1 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 2'); + }; + $callback2 = function ($value, ExecutionContextInterface $context) { + $context->addViolation('Violation in Group 3'); + }; + + $metadata = new ClassMetadata(\get_class($entity)); + $metadata->addConstraint(new Callback(array( + 'callback' => function () {}, + 'groups' => 'Group 1', + ))); + $metadata->addConstraint(new Callback(array( + 'callback' => $callback1, + 'groups' => 'Group 2', + ))); + $metadata->addConstraint(new Callback(array( + 'callback' => $callback2, + 'groups' => 'Group 3', + ))); + $metadata->setGroupSequenceProvider(true); + + $this->metadataFactory->addMetadata($metadata); + + $violations = $this->validate($entity, null, 'Default'); + + /* @var ConstraintViolationInterface[] $violations */ + $this->assertCount(1, $violations); + $this->assertSame('Violation in Group 2', $violations[0]->getMessage()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php new file mode 100644 index 00000000000..fd1287fe718 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidator2Dot5ApiTest.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Validator; + +use Symfony\Component\Translation\IdentityTranslator; +use Symfony\Component\Validator\ConstraintValidatorFactory; +use Symfony\Component\Validator\Context\LegacyExecutionContextFactory; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Validator\LegacyValidator; + +/** + * @group legacy + */ +class LegacyValidator2Dot5ApiTest extends Abstract2Dot5ApiTest +{ + protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) + { + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $contextFactory = new LegacyExecutionContextFactory($metadataFactory, $translator); + $validatorFactory = new ConstraintValidatorFactory(); + + return new LegacyValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidatorLegacyApiTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidatorLegacyApiTest.php new file mode 100644 index 00000000000..0b51a1146e6 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Validator/LegacyValidatorLegacyApiTest.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Validator; + +use Symfony\Component\Translation\IdentityTranslator; +use Symfony\Component\Validator\ConstraintValidatorFactory; +use Symfony\Component\Validator\Context\LegacyExecutionContextFactory; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Validator\LegacyValidator; + +/** + * @group legacy + */ +class LegacyValidatorLegacyApiTest extends AbstractLegacyApiTest +{ + protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) + { + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $contextFactory = new LegacyExecutionContextFactory($metadataFactory, $translator); + $validatorFactory = new ConstraintValidatorFactory(); + + return new LegacyValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php b/upload/system/storage/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php new file mode 100644 index 00000000000..1313fb9e31a --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/Validator/RecursiveValidator2Dot5ApiTest.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests\Validator; + +use Symfony\Component\Translation\IdentityTranslator; +use Symfony\Component\Validator\ConstraintValidatorFactory; +use Symfony\Component\Validator\Context\ExecutionContextFactory; +use Symfony\Component\Validator\MetadataFactoryInterface; +use Symfony\Component\Validator\Tests\Fixtures\Entity; +use Symfony\Component\Validator\Validator\RecursiveValidator; + +class RecursiveValidator2Dot5ApiTest extends Abstract2Dot5ApiTest +{ + protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) + { + $translator = new IdentityTranslator(); + $translator->setLocale('en'); + + $contextFactory = new ExecutionContextFactory($translator); + $validatorFactory = new ConstraintValidatorFactory(); + + return new RecursiveValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers); + } + + public function testEmptyGroupsArrayDoesNotTriggerDeprecation() + { + $entity = new Entity(); + + $validatorContext = $this->getMockBuilder('Symfony\Component\Validator\Validator\ContextualValidatorInterface')->getMock(); + $validatorContext + ->expects($this->once()) + ->method('validate') + ->with($entity, null, array()) + ->willReturnSelf(); + + $validator = $this + ->getMockBuilder('Symfony\Component\Validator\Validator\RecursiveValidator') + ->disableOriginalConstructor() + ->setMethods(array('startContext')) + ->getMock(); + $validator + ->expects($this->once()) + ->method('startContext') + ->willReturn($validatorContext); + + $validator->validate($entity, null, array()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Tests/ValidatorBuilderTest.php b/upload/system/storage/vendor/symfony/validator/Tests/ValidatorBuilderTest.php new file mode 100644 index 00000000000..77d586412b7 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Tests/ValidatorBuilderTest.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Tests; + +use PHPUnit\Framework\TestCase; +use Symfony\Component\Validator\ValidatorBuilder; +use Symfony\Component\Validator\ValidatorBuilderInterface; + +class ValidatorBuilderTest extends TestCase +{ + /** + * @var ValidatorBuilderInterface + */ + protected $builder; + + protected function setUp() + { + $this->builder = new ValidatorBuilder(); + } + + protected function tearDown() + { + $this->builder = null; + } + + public function testAddObjectInitializer() + { + $this->assertSame($this->builder, $this->builder->addObjectInitializer( + $this->getMockBuilder('Symfony\Component\Validator\ObjectInitializerInterface')->getMock() + )); + } + + public function testAddObjectInitializers() + { + $this->assertSame($this->builder, $this->builder->addObjectInitializers(array())); + } + + public function testAddXmlMapping() + { + $this->assertSame($this->builder, $this->builder->addXmlMapping('mapping')); + } + + public function testAddXmlMappings() + { + $this->assertSame($this->builder, $this->builder->addXmlMappings(array())); + } + + public function testAddYamlMapping() + { + $this->assertSame($this->builder, $this->builder->addYamlMapping('mapping')); + } + + public function testAddYamlMappings() + { + $this->assertSame($this->builder, $this->builder->addYamlMappings(array())); + } + + public function testAddMethodMapping() + { + $this->assertSame($this->builder, $this->builder->addMethodMapping('mapping')); + } + + public function testAddMethodMappings() + { + $this->assertSame($this->builder, $this->builder->addMethodMappings(array())); + } + + public function testEnableAnnotationMapping() + { + $this->assertSame($this->builder, $this->builder->enableAnnotationMapping()); + } + + public function testDisableAnnotationMapping() + { + $this->assertSame($this->builder, $this->builder->disableAnnotationMapping()); + } + + public function testSetMetadataCache() + { + $this->assertSame($this->builder, $this->builder->setMetadataCache( + $this->getMockBuilder('Symfony\Component\Validator\Mapping\Cache\CacheInterface')->getMock()) + ); + } + + public function testSetConstraintValidatorFactory() + { + $this->assertSame($this->builder, $this->builder->setConstraintValidatorFactory( + $this->getMockBuilder('Symfony\Component\Validator\ConstraintValidatorFactoryInterface')->getMock()) + ); + } + + public function testSetTranslator() + { + $this->assertSame($this->builder, $this->builder->setTranslator( + $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock()) + ); + } + + public function testSetTranslationDomain() + { + $this->assertSame($this->builder, $this->builder->setTranslationDomain('TRANS_DOMAIN')); + } + + public function testGetValidator() + { + $this->assertInstanceOf('Symfony\Component\Validator\Validator\RecursiveValidator', $this->builder->getValidator()); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ValidationVisitor.php b/upload/system/storage/vendor/symfony/validator/ValidationVisitor.php new file mode 100644 index 00000000000..14fd88b5c68 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ValidationVisitor.php @@ -0,0 +1,181 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +@trigger_error('The '.__NAMESPACE__.'\ValidationVisitor class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\Exception\NoSuchMetadataException; +use Symfony\Component\Validator\Exception\UnexpectedTypeException; + +/** + * Default implementation of {@link ValidationVisitorInterface} and + * {@link GlobalExecutionContextInterface}. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + */ +class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionContextInterface +{ + private $root; + private $metadataFactory; + private $validatorFactory; + private $translator; + private $translationDomain; + private $objectInitializers; + private $violations; + private $validatedObjects = array(); + + /** + * Creates a new validation visitor. + * + * @param mixed $root The value passed to the validator + * @param MetadataFactoryInterface $metadataFactory The factory for obtaining metadata instances + * @param ConstraintValidatorFactoryInterface $validatorFactory The factory for creating constraint validators + * @param TranslatorInterface $translator The translator for translating violation messages + * @param string|null $translationDomain The domain of the translation messages + * @param ObjectInitializerInterface[] $objectInitializers The initializers for preparing objects before validation + * + * @throws UnexpectedTypeException If any of the object initializers is not an instance of ObjectInitializerInterface + */ + public function __construct($root, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, TranslatorInterface $translator, $translationDomain = null, array $objectInitializers = array()) + { + foreach ($objectInitializers as $initializer) { + if (!$initializer instanceof ObjectInitializerInterface) { + throw new UnexpectedTypeException($initializer, 'Symfony\Component\Validator\ObjectInitializerInterface'); + } + } + + $this->root = $root; + $this->metadataFactory = $metadataFactory; + $this->validatorFactory = $validatorFactory; + $this->translator = $translator; + $this->translationDomain = $translationDomain; + $this->objectInitializers = $objectInitializers; + $this->violations = new ConstraintViolationList(); + } + + /** + * {@inheritdoc} + */ + public function visit(MetadataInterface $metadata, $value, $group, $propertyPath) + { + $context = new ExecutionContext( + $this, + $this->translator, + $this->translationDomain, + $metadata, + $value, + $group, + $propertyPath + ); + + $context->validateValue($value, $metadata->findConstraints($group)); + } + + /** + * {@inheritdoc} + */ + public function validate($value, $group, $propertyPath, $traverse = false, $deep = false) + { + if (null === $value) { + return; + } + + if (\is_object($value)) { + $hash = spl_object_hash($value); + + // Exit, if the object is already validated for the current group + if (isset($this->validatedObjects[$hash][$group])) { + return; + } + + // Initialize if the object wasn't initialized before + if (!isset($this->validatedObjects[$hash])) { + foreach ($this->objectInitializers as $initializer) { + if (!$initializer instanceof ObjectInitializerInterface) { + throw new \LogicException('Validator initializers must implement ObjectInitializerInterface.'); + } + $initializer->initialize($value); + } + } + + // Remember validating this object before starting and possibly + // traversing the object graph + $this->validatedObjects[$hash][$group] = true; + } + + // Validate arrays recursively by default, otherwise every driver needs + // to implement special handling for arrays. + // https://github.com/symfony/symfony/issues/6246 + if (\is_array($value) || ($traverse && $value instanceof \Traversable)) { + foreach ($value as $key => $element) { + // Ignore any scalar values in the collection + if (\is_object($element) || \is_array($element)) { + // Only repeat the traversal if $deep is set + $this->validate($element, $group, $propertyPath.'['.$key.']', $deep, $deep); + } + } + + try { + $this->metadataFactory->getMetadataFor($value)->accept($this, $value, $group, $propertyPath); + } catch (NoSuchMetadataException $e) { + // Metadata doesn't necessarily have to exist for + // traversable objects, because we know how to validate + // them anyway. Optionally, additional metadata is supported. + } + } else { + $this->metadataFactory->getMetadataFor($value)->accept($this, $value, $group, $propertyPath); + } + } + + /** + * {@inheritdoc} + */ + public function getViolations() + { + return $this->violations; + } + + /** + * {@inheritdoc} + */ + public function getRoot() + { + return $this->root; + } + + /** + * {@inheritdoc} + */ + public function getVisitor() + { + return $this; + } + + /** + * {@inheritdoc} + */ + public function getValidatorFactory() + { + return $this->validatorFactory; + } + + /** + * {@inheritdoc} + */ + public function getMetadataFactory() + { + return $this->metadataFactory; + } +} diff --git a/upload/system/storage/vendor/symfony/validator/ValidationVisitorInterface.php b/upload/system/storage/vendor/symfony/validator/ValidationVisitorInterface.php new file mode 100644 index 00000000000..28d492132b8 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ValidationVisitorInterface.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Validates values against constraints defined in {@link MetadataInterface} + * instances. + * + * This interface is an implementation of the Visitor design pattern. A value + * is validated by first passing it to the {@link validate} method. That method + * will determine the matching {@link MetadataInterface} for validating the + * value. It then calls the {@link MetadataInterface::accept} method of that + * metadata. accept() does two things: + * + *
      + *
    1. It calls {@link visit} to validate the value against the constraints of + * the metadata.
    2. + *
    3. It calls accept() on all nested metadata instances with the + * corresponding values extracted from the current value. For example, if the + * current metadata represents a class and the current value is an object of + * that class, the metadata contains nested instances for each property of that + * class. It forwards the call to these nested metadata with the values of the + * corresponding properties in the original object.
    4. + *
    + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + */ +interface ValidationVisitorInterface +{ + /** + * Validates a value. + * + * If the value is an array or a traversable object, you can set the + * parameter $traverse to true in order to run through + * the collection and validate each element. If these elements can be + * collections again and you want to traverse them recursively, set the + * parameter $deep to true as well. + * + * If you set $traversable to true, the visitor will + * nevertheless try to find metadata for the collection and validate its + * constraints. If no such metadata is found, the visitor ignores that and + * only iterates the collection. + * + * If you don't set $traversable to true and the visitor + * does not find metadata for the given value, it will fail with an + * exception. + * + * @param mixed $value The value to validate + * @param string $group The validation group to validate + * @param string $propertyPath The current property path in the validation graph + * @param bool $traverse Whether to traverse the value if it is traversable + * @param bool $deep Whether to traverse nested traversable values recursively + * + * @throws Exception\NoSuchMetadataException if no metadata can be found for + * the given value + */ + public function validate($value, $group, $propertyPath, $traverse = false, $deep = false); + + /** + * Validates a value against the constraints defined in some metadata. + * + * This method implements the Visitor design pattern. See also + * {@link ValidationVisitorInterface}. + * + * @param MetadataInterface $metadata The metadata holding the constraints + * @param mixed $value The value to validate + * @param string $group The validation group to validate + * @param string $propertyPath The current property path in the validation graph + */ + public function visit(MetadataInterface $metadata, $value, $group, $propertyPath); +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator.php b/upload/system/storage/vendor/symfony/validator/Validator.php new file mode 100644 index 00000000000..1aa5fd18d6f --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator.php @@ -0,0 +1,208 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +@trigger_error('The '.__NAMESPACE__.'\Validator class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Validator\RecursiveValidator class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\Constraints\Valid; +use Symfony\Component\Validator\Exception\ValidatorException; + +/** + * Default implementation of {@link ValidatorInterface}. + * + * @author Fabien Potencier + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Validator\RecursiveValidator} instead. + */ +class Validator implements ValidatorInterface, Mapping\Factory\MetadataFactoryInterface +{ + private $metadataFactory; + private $validatorFactory; + private $translator; + private $translationDomain; + private $objectInitializers; + + public function __construct(MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, TranslatorInterface $translator, $translationDomain = 'validators', array $objectInitializers = array()) + { + $this->metadataFactory = $metadataFactory; + $this->validatorFactory = $validatorFactory; + $this->translator = $translator; + $this->translationDomain = $translationDomain; + $this->objectInitializers = $objectInitializers; + } + + /** + * {@inheritdoc} + */ + public function getMetadataFactory() + { + return $this->metadataFactory; + } + + /** + * {@inheritdoc} + */ + public function getMetadataFor($value) + { + return $this->metadataFactory->getMetadataFor($value); + } + + /** + * {@inheritdoc} + */ + public function hasMetadataFor($value) + { + return $this->metadataFactory->hasMetadataFor($value); + } + + /** + * {@inheritdoc} + */ + public function validate($value, $groups = null, $traverse = false, $deep = false) + { + $visitor = $this->createVisitor($value); + + foreach ($this->resolveGroups($groups) as $group) { + $visitor->validate($value, $group, '', $traverse, $deep); + } + + return $visitor->getViolations(); + } + + /** + * {@inheritdoc} + * + * @throws ValidatorException if the metadata for the value does not support properties + */ + public function validateProperty($containingValue, $property, $groups = null) + { + $visitor = $this->createVisitor($containingValue); + $metadata = $this->metadataFactory->getMetadataFor($containingValue); + + if (!$metadata instanceof PropertyMetadataContainerInterface) { + $valueAsString = is_scalar($containingValue) + ? '"'.$containingValue.'"' + : 'the value of type '.\gettype($containingValue); + + throw new ValidatorException(sprintf('The metadata for %s does not support properties.', $valueAsString)); + } + + foreach ($this->resolveGroups($groups) as $group) { + if (!$metadata->hasPropertyMetadata($property)) { + continue; + } + + foreach ($metadata->getPropertyMetadata($property) as $propMeta) { + $propMeta->accept($visitor, $propMeta->getPropertyValue($containingValue), $group, $property); + } + } + + return $visitor->getViolations(); + } + + /** + * {@inheritdoc} + * + * @throws ValidatorException if the metadata for the value does not support properties + */ + public function validatePropertyValue($containingValue, $property, $value, $groups = null) + { + $visitor = $this->createVisitor(\is_object($containingValue) ? $containingValue : $value); + $metadata = $this->metadataFactory->getMetadataFor($containingValue); + + if (!$metadata instanceof PropertyMetadataContainerInterface) { + $valueAsString = is_scalar($containingValue) + ? '"'.$containingValue.'"' + : 'the value of type '.\gettype($containingValue); + + throw new ValidatorException(sprintf('The metadata for %s does not support properties.', $valueAsString)); + } + + // If $containingValue is passed as class name, take $value as root + // and start the traversal with an empty property path + $propertyPath = \is_object($containingValue) ? $property : ''; + + foreach ($this->resolveGroups($groups) as $group) { + if (!$metadata->hasPropertyMetadata($property)) { + continue; + } + + foreach ($metadata->getPropertyMetadata($property) as $propMeta) { + $propMeta->accept($visitor, $value, $group, $propertyPath); + } + } + + return $visitor->getViolations(); + } + + /** + * {@inheritdoc} + */ + public function validateValue($value, $constraints, $groups = null) + { + $context = new ExecutionContext($this->createVisitor($value), $this->translator, $this->translationDomain); + + $constraints = \is_array($constraints) ? $constraints : array($constraints); + + foreach ($constraints as $constraint) { + if ($constraint instanceof Valid) { + // Why can't the Valid constraint be executed directly? + // + // It cannot be executed like regular other constraints, because regular + // constraints are only executed *if they belong to the validated group*. + // The Valid constraint, on the other hand, is always executed and propagates + // the group to the cascaded object. The propagated group depends on + // + // * Whether a group sequence is currently being executed. Then the default + // group is propagated. + // + // * Otherwise the validated group is propagated. + + throw new ValidatorException(sprintf('The constraint %s cannot be validated. Use the method validate() instead.', \get_class($constraint))); + } + + $context->validateValue($value, $constraint, '', $groups); + } + + return $context->getViolations(); + } + + /** + * @param mixed $root + * + * @return ValidationVisitor + */ + private function createVisitor($root) + { + return new ValidationVisitor( + $root, + $this->metadataFactory, + $this->validatorFactory, + $this->translator, + $this->translationDomain, + $this->objectInitializers + ); + } + + /** + * @param string|string[]|null $groups + * + * @return string[] + */ + private function resolveGroups($groups) + { + return $groups ? (array) $groups : array(Constraint::DEFAULT_GROUP); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/Validator/LegacyValidator.php b/upload/system/storage/vendor/symfony/validator/Validator/LegacyValidator.php new file mode 100644 index 00000000000..c4d818b39fa --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Validator/LegacyValidator.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Validator; + +@trigger_error('The '.__NAMESPACE__.'\LegacyValidator class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + +/** + * A validator that supports both the API of Symfony < 2.5 and Symfony 2.5+. + * + * @author Bernhard Schussek + * + * @see \Symfony\Component\Validator\ValidatorInterface + * @see \Symfony\Component\Validator\Validator\ValidatorInterface + * @deprecated since version 2.5, to be removed in 3.0. + */ +class LegacyValidator extends RecursiveValidator +{ +} diff --git a/upload/system/storage/vendor/symfony/validator/ValidatorBuilderInterface.php b/upload/system/storage/vendor/symfony/validator/ValidatorBuilderInterface.php new file mode 100644 index 00000000000..1b0bd729963 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ValidatorBuilderInterface.php @@ -0,0 +1,181 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +use Doctrine\Common\Annotations\Reader; +use Symfony\Component\PropertyAccess\PropertyAccessorInterface; +use Symfony\Component\Translation\TranslatorInterface; +use Symfony\Component\Validator\Mapping\Cache\CacheInterface; + +/** + * A configurable builder for ValidatorInterface objects. + * + * @author Bernhard Schussek + */ +interface ValidatorBuilderInterface +{ + /** + * Adds an object initializer to the validator. + * + * @return $this + */ + public function addObjectInitializer(ObjectInitializerInterface $initializer); + + /** + * Adds a list of object initializers to the validator. + * + * @param ObjectInitializerInterface[] $initializers + * + * @return $this + */ + public function addObjectInitializers(array $initializers); + + /** + * Adds an XML constraint mapping file to the validator. + * + * @param string $path The path to the mapping file + * + * @return $this + */ + public function addXmlMapping($path); + + /** + * Adds a list of XML constraint mapping files to the validator. + * + * @param string[] $paths The paths to the mapping files + * + * @return $this + */ + public function addXmlMappings(array $paths); + + /** + * Adds a YAML constraint mapping file to the validator. + * + * @param string $path The path to the mapping file + * + * @return $this + */ + public function addYamlMapping($path); + + /** + * Adds a list of YAML constraint mappings file to the validator. + * + * @param string[] $paths The paths to the mapping files + * + * @return $this + */ + public function addYamlMappings(array $paths); + + /** + * Enables constraint mapping using the given static method. + * + * @param string $methodName The name of the method + * + * @return $this + */ + public function addMethodMapping($methodName); + + /** + * Enables constraint mapping using the given static methods. + * + * @param string[] $methodNames The names of the methods + * + * @return $this + */ + public function addMethodMappings(array $methodNames); + + /** + * Enables annotation based constraint mapping. + * + * @return $this + */ + public function enableAnnotationMapping(Reader $annotationReader = null); + + /** + * Disables annotation based constraint mapping. + * + * @return $this + */ + public function disableAnnotationMapping(); + + /** + * Sets the class metadata factory used by the validator. + * + * @return $this + */ + public function setMetadataFactory(MetadataFactoryInterface $metadataFactory); + + /** + * Sets the cache for caching class metadata. + * + * @return $this + */ + public function setMetadataCache(CacheInterface $cache); + + /** + * Sets the constraint validator factory used by the validator. + * + * @return $this + */ + public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory); + + /** + * Sets the translator used for translating violation messages. + * + * @return $this + */ + public function setTranslator(TranslatorInterface $translator); + + /** + * Sets the default translation domain of violation messages. + * + * The same message can have different translations in different domains. + * Pass the domain that is used for violation messages by default to this + * method. + * + * @param string $translationDomain The translation domain of the violation messages + * + * @return $this + */ + public function setTranslationDomain($translationDomain); + + /** + * Sets the property accessor for resolving property paths. + * + * @param PropertyAccessorInterface $propertyAccessor The property accessor + * + * @return $this + * + * @deprecated since version 2.5, to be removed in 3.0. + */ + public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor); + + /** + * Sets the API version that the returned validator should support. + * + * @param int $apiVersion The required API version + * + * @return $this + * + * @see Validation::API_VERSION_2_5 + * @see Validation::API_VERSION_2_5_BC + * @deprecated since version 2.7, to be removed in 3.0. + */ + public function setApiVersion($apiVersion); + + /** + * Builds and returns a new validator object. + * + * @return ValidatorInterface The built validator + */ + public function getValidator(); +} diff --git a/upload/system/storage/vendor/symfony/validator/ValidatorInterface.php b/upload/system/storage/vendor/symfony/validator/ValidatorInterface.php new file mode 100644 index 00000000000..570ba99720d --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/ValidatorInterface.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator; + +/** + * Validates values and graphs of objects and arrays. + * + * @author Bernhard Schussek + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link \Symfony\Component\Validator\Validator\ValidatorInterface} instead. + */ +interface ValidatorInterface +{ + /** + * Validates a value. + * + * The accepted values depend on the {@link MetadataFactoryInterface} + * implementation. + * + * The signature changed with Symfony 2.5 (see + * {@link Validator\ValidatorInterface::validate()}. This signature will be + * disabled in Symfony 3.0. + * + * @param mixed $value The value to validate + * @param array|null $groups The validation groups to validate + * @param bool $traverse Whether to traverse the value if it is traversable + * @param bool $deep Whether to traverse nested traversable values recursively + * + * @return ConstraintViolationListInterface A list of constraint violations. If the + * list is empty, validation succeeded. + */ + public function validate($value, $groups = null, $traverse = false, $deep = false); + + /** + * Validates a property of a value against its current value. + * + * The accepted values depend on the {@link MetadataFactoryInterface} + * implementation. + * + * @param mixed $containingValue The value containing the property + * @param string $property The name of the property to validate + * @param array|null $groups The validation groups to validate + * + * @return ConstraintViolationListInterface A list of constraint violations. If the + * list is empty, validation succeeded. + */ + public function validateProperty($containingValue, $property, $groups = null); + + /** + * Validate a property of a value against a potential value. + * + * The accepted values depend on the {@link MetadataFactoryInterface} + * implementation. + * + * @param mixed $containingValue The value containing the property + * @param string $property The name of the property to validate + * @param string $value The value to validate against the + * constraints of the property + * @param array|null $groups The validation groups to validate + * + * @return ConstraintViolationListInterface A list of constraint violations. If the + * list is empty, validation succeeded. + */ + public function validatePropertyValue($containingValue, $property, $value, $groups = null); + + /** + * Validates a value against a constraint or a list of constraints. + * + * @param mixed $value The value to validate + * @param Constraint|Constraint[] $constraints The constraint(s) to validate against + * @param array|null $groups The validation groups to validate + * + * @return ConstraintViolationListInterface A list of constraint violations. If the + * list is empty, validation succeeded. + * + * @deprecated since version 2.5, to be removed in 3.0. + * Renamed to {@link Validator\ValidatorInterface::validate()} + * in Symfony 2.5. + */ + public function validateValue($value, $constraints, $groups = null); + + /** + * Returns the factory for metadata instances. + * + * @return MetadataFactoryInterface The metadata factory + * + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link Validator\ValidatorInterface::getMetadataFor()} or + * {@link Validator\ValidatorInterface::hasMetadataFor()} + * instead. + */ + public function getMetadataFactory(); +} diff --git a/upload/system/storage/vendor/symfony/validator/Violation/LegacyConstraintViolationBuilder.php b/upload/system/storage/vendor/symfony/validator/Violation/LegacyConstraintViolationBuilder.php new file mode 100644 index 00000000000..324e9d1e4dd --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/Violation/LegacyConstraintViolationBuilder.php @@ -0,0 +1,166 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Violation; + +@trigger_error('The '.__NAMESPACE__.'\LegacyConstraintViolationBuilder class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + +use Symfony\Component\Validator\ExecutionContextInterface; + +/** + * Backwards-compatible implementation of {@link ConstraintViolationBuilderInterface}. + * + * @author Bernhard Schussek + * + * @internal You should not instantiate or use this class. Code against + * {@link ConstraintViolationBuilderInterface} instead. + * + * @deprecated since version 2.5.5, to be removed in 3.0. + */ +class LegacyConstraintViolationBuilder implements ConstraintViolationBuilderInterface +{ + /** + * @var ExecutionContextInterface + */ + private $context; + + /** + * @var string + */ + private $message; + + /** + * @var array + */ + private $parameters; + + /** + * @var mixed + */ + private $invalidValue; + + /** + * @var string + */ + private $propertyPath; + + /** + * @var int|null + */ + private $plural; + + /** + * @var mixed + */ + private $code; + + public function __construct(ExecutionContextInterface $context, $message, array $parameters) + { + $this->context = $context; + $this->message = $message; + $this->parameters = $parameters; + $this->invalidValue = $context->getValue(); + } + + /** + * {@inheritdoc} + */ + public function atPath($path) + { + $this->propertyPath = $path; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setParameter($key, $value) + { + $this->parameters[$key] = $value; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setParameters(array $parameters) + { + $this->parameters = $parameters; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setTranslationDomain($translationDomain) + { + // can't be set in the old API + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setInvalidValue($invalidValue) + { + $this->invalidValue = $invalidValue; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setPlural($number) + { + $this->plural = $number; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setCode($code) + { + $this->code = $code; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setCause($cause) + { + // do nothing - we can't save the cause through the old API + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addViolation() + { + if ($this->propertyPath) { + $this->context->addViolationAt($this->propertyPath, $this->message, $this->parameters, $this->invalidValue, $this->plural, $this->code); + + return; + } + + $this->context->addViolation($this->message, $this->parameters, $this->invalidValue, $this->plural, $this->code); + } +} diff --git a/upload/system/storage/vendor/symfony/validator/phpunit.xml.dist b/upload/system/storage/vendor/symfony/validator/phpunit.xml.dist new file mode 100644 index 00000000000..5d07c4e6480 --- /dev/null +++ b/upload/system/storage/vendor/symfony/validator/phpunit.xml.dist @@ -0,0 +1,31 @@ + + + + + + + + + + ./Tests/ + + + + + + ./ + + ./Resources + ./Tests + ./vendor + + + +